1(self["__LOADABLE_LOADED_CHUNKS__"] = self["__LOADABLE_LOADED_CHUNKS__"] || []).push([[84121],{ 2 3/***/ 62720 4(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 5 6"use strict"; 7/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8/* harmony export */ A: () => (/* binding */ _assertThisInitialized) 9/* harmony export */ }); 10function _assertThisInitialized(e) { 11 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 12 return e; 13} 14 15 16/***/ }, 17 18/***/ 55285 19(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 20 21"use strict"; 22/* harmony export */ __webpack_require__.d(__webpack_exports__, { 23/* harmony export */ A: () => (/* binding */ _extends) 24/* harmony export */ }); 25function _extends() { 26 return _extends = Object.assign ? Object.assign.bind() : function (n) { 27 for (var e = 1; e < arguments.length; e++) { 28 var t = arguments[e]; 29 for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); 30 } 31 return n; 32 }, _extends.apply(null, arguments); 33} 34 35 36/***/ }, 37 38/***/ 48298 39(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 40 41"use strict"; 42/* harmony export */ __webpack_require__.d(__webpack_exports__, { 43/* harmony export */ A: () => (/* binding */ _inheritsLoose) 44/* harmony export */ }); 45/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96297); 46 47function _inheritsLoose(t, o) { 48 t.prototype = Object.create(o.prototype), t.prototype.constructor = t, (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(t, o); 49} 50 51 52/***/ }, 53 54/***/ 40644 55(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 56 57"use strict"; 58/* harmony export */ __webpack_require__.d(__webpack_exports__, { 59/* harmony export */ A: () => (/* binding */ _objectWithoutPropertiesLoose) 60/* harmony export */ }); 61function _objectWithoutPropertiesLoose(r, e) { 62 if (null == r) return {}; 63 var t = {}; 64 for (var n in r) if ({}.hasOwnProperty.call(r, n)) { 65 if (-1 !== e.indexOf(n)) continue; 66 t[n] = r[n]; 67 } 68 return t; 69} 70 71 72/***/ }, 73 74/***/ 96297 75(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 76 77"use strict"; 78/* harmony export */ __webpack_require__.d(__webpack_exports__, { 79/* harmony export */ A: () => (/* binding */ _setPrototypeOf) 80/* harmony export */ }); 81function _setPrototypeOf(t, e) { 82 return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { 83 return t.__proto__ = e, t; 84 }, _setPrototypeOf(t, e); 85} 86 87 88/***/ }, 89 90/***/ 76550 91(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 92 93"use strict"; 94/* harmony export */ __webpack_require__.d(__webpack_exports__, { 95/* harmony export */ A4: () => (/* binding */ Renderer), 96/* harmony export */ P7: () => (/* binding */ RendererContext), 97/* harmony export */ Tz: () => (/* binding */ RenderContextProvider), 98/* harmony export */ XI: () => (/* binding */ Table) 99/* harmony export */ }); 100/* unused harmony exports Abbreviation, Anchor, Asset, Code, Component, Delete, Divider, Emphasis, Entry, FormContentType, Fragment, Heading, Image, InlineCode, InlineEntry, Insert, Keyboard, LineBreak, Link, Liquid, List, ListItem, Mark, Panel, Paragraph, Quote, RenderChildren, Strikethrough, Strong, Subscript, Superscript, TableBody, TableCaption, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Underline, Variable */ 101/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 102var __defProp = Object.defineProperty; 103var __getOwnPropSymbols = Object.getOwnPropertySymbols; 104var __hasOwnProp = Object.prototype.hasOwnProperty; 105var __propIsEnum = Object.prototype.propertyIsEnumerable; 106var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 107var __spreadValues = (a, b) => { 108 for (var prop in b || (b = {})) 109 if (__hasOwnProp.call(b, prop)) 110 __defNormalProp(a, prop, b[prop]); 111 if (__getOwnPropSymbols) 112 for (var prop of __getOwnPropSymbols(b)) { 113 if (__propIsEnum.call(b, prop)) 114 __defNormalProp(a, prop, b[prop]); 115 } 116 return a; 117}; 118var __objRest = (source, exclude) => { 119 var target = {}; 120 for (var prop in source) 121 if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) 122 target[prop] = source[prop]; 123 if (source != null && __getOwnPropSymbols) 124 for (var prop of __getOwnPropSymbols(source)) { 125 if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) 126 target[prop] = source[prop]; 127 } 128 return target; 129}; 130
131// src/renderer.tsx 132 133var RendererContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({}); 134var BlockRenderContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ ancestors: [] }); 135function findAncestorOfType(ancestors, types) { 136 return ancestors == null ? void 0 : ancestors.slice().reverse().find((ancestor) => types.includes(ancestor.type)); 137} 138function RenderContextProvider(props) { 139 const overrideBlocks = props.blocks; 140 const blocks = Object.keys(BLOCK_RENDERERS).reduce((prev, type) => { 141 const blockType = type; 142 const renderer = (overrideBlocks == null ? void 0 : overrideBlocks[blockType]) || BLOCK_RENDERERS[blockType]; 143 prev[blockType] = renderer; 144 return prev; 145 }, {}); 146 const overrideDecorators = props.decorators; 147 const decorators = Object.keys(DECORATOR_RENDERERS).reduce((prev, type) => { 148 const decoratorType = type; 149 prev[decoratorType] = (overrideDecorators == null ? void 0 : overrideDecorators[decoratorType]) || DECORATOR_RENDERERS[decoratorType]; 150 return prev; 151 }, {}); 152 const value = { blocks, decorators, components: props.components, entries: props.entries, assets: props == null ? void 0 : props.assets }; 153 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RendererContext.Provider, { value }, props.children); 154} 155function useBlocks() { 156 const value = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RendererContext); 157 return value.blocks || BLOCK_RENDERERS; 158} 159function useDecorators() { 160 const value = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RendererContext); 161 return value.decorators || DECORATOR_RENDERERS; 162} 163function useComponents() { 164 const value = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RendererContext); 165 return value.components || {}; 166} 167function useEntries() { 168 const value = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RendererContext); 169 return value.entries || {}; 170} 171function useAssets() { 172 const value = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RendererContext); 173 return value.assets || {}; 174} 175function RenderBlock(props) { 176 const blocks = useBlocks(); 177 const Component2 = blocks[props.block.type]; 178 const renderContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BlockRenderContext); 179 const ancestors = [...renderContext.ancestors, props.block]; 180 return !!Component2 ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(BlockRenderContext.Provider, { value: { ancestors } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component2, { block: props.block })) : null; 181} 182function RenderBlocks(props) { 183 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, props.blocks.map((block) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderBlock, { block, key: block.id }))); 184} 185function RenderContents(props) { 186 return props.contents ? props.contents : props.fallback; 187} 188function RenderChildren(props) { 189 var _a, _b; 190 const isArray = Array.isArray((_a = props.block) == null ? void 0 : _a.value); 191 const isString = typeof ((_b = props.block) == null ? void 0 : _b.value) === "string"; 192 const render = () => { 193 if (isArray) { 194 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderBlocks, { blocks: props.block.value }); 195 } else if (isString) { 196 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderText, { text: props.block.value }); 197 } else { 198 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderText, { text: "" }); 199 } 200 }; 201 return render(); 202} 203function RenderText(props) { 204 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, props.text); 205} 206function Renderer(props) { 207 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderBlocks, { blocks: props.data }); 208} 209function getAttributes(props, extra = {}) { 210 var _c; 211 const _a = props, { block } = _a, rest = __objRest(_a, ["block"]); 212 let _b = rest, { children, decorator, otherDecorators } = _b, attributes = __objRest(_b, ["children", "decorator", "otherDecorators"]); 213 attributes = __spreadValues(__spreadValues({ 214 id: (_c = block == null ? void 0 : block.properties) == null ? void 0 : _c.id 215 }, extra), attributes); 216 return attributes; 217} 218function WithCaption(props) {
219 return !!props.caption ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("figure", null, props.children, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("figcaption", null, props.caption)) : props.children || null; 220} 221function RenderBlockChildrenFactory() { 222 return function(props) { 223 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderChildren, { block: props.block }); 224 }; 225} 226function EmptyChildrenFactory() { 227 return function(props) { 228 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null); 229 }; 230} 231function Anchor(props) { 232 const attributes = getAttributes(props); 233 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Anchor.Children, { block: props.block }) })); 234} 235Anchor.Children = RenderBlockChildrenFactory(); 236function Asset(props) { 237 var _a, _b, _c; 238 const contentTypeId = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.contentTypeId; 239 const components = useAssets(); 240 const AssetElement = !!contentTypeId ? components == null ? void 0 : components[contentTypeId] : void 0; 241 const attributes = getAttributes(props); 242 return !!AssetElement ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(AssetElement, __spreadValues({}, props)) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Asset.Children, { block: props.block }) })); 243} 244Asset.Children = function(props) { 245 var _a, _b, _c, _d, _e, _f, _g; 246 const href = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.uri; 247 const entryTitle = ((_e = (_d = props == null ? void 0 : props.block) == null ? void 0 : _d.value) == null ? void 0 : _e.entryTitle) || ""; 248 const entryDescription = ((_g = (_f = props == null ? void 0 : props.block) == null ? void 0 : _f.value) == null ? void 0 : _g.entryDescription) || ""; 249 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, !!href ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", { href }, entryTitle) : entryTitle), !!entryDescription ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, entryDescription) : null); 250}; 251function Code(props) { 252 var _a, _b, _c, _d; 253 const attributes = getAttributes(props, { 254 "data-language": (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.language 255 }); 256 const codeAttributes = getAttributes(props, { 257 className: `language-${(_d = (_c = props.block) == null ? void 0 : _c.value) == null ? void 0 : _d.language}` 258 }); 259 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("pre", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("code", __spreadValues({}, codeAttributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Code.Children, { block: props.block }) }))); 260} 261Code.Children = function(props) { 262 var _a, _b; 263 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.code); 264}; 265function CodeWithCaption(props) { 266 var _a, _b; 267 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(WithCaption, { caption: (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.caption }
267, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Code, __spreadValues({}, props))); 268} 269function Component(props) { 270 var _a, _b; 271 const component = (_a = props == null ? void 0 : props.block.properties) == null ? void 0 : _a.component; 272 const components = useComponents(); 273 const ComponentElement = !!component ? components == null ? void 0 : components[component] : void 0; 274 const value = props.block.value ? JSON.stringify(props.block.value) : ""; 275 const attributes = getAttributes(props, { 276 className: "component", 277 "data-component": (_b = props.block.properties) == null ? void 0 : _b.component, 278 "data-component-value": value 279 }); 280 return !!ComponentElement ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(ComponentElement, __spreadValues({}, props)) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component.Children, { block: props.block }) })); 281} 282Component.Children = function(props) { 283 var _a, _b; 284 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, "Component: ", (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.component); 285}; 286function Divider(props) { 287 const attributes = getAttributes(props); 288 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("hr", __spreadValues({}, attributes)); 289} 290Divider.Children = EmptyChildrenFactory(); 291function Entry(props) { 292 var _a, _b, _c; 293 const contentTypeId = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.contentTypeId; 294 const components = useEntries(); 295 const EntryElement = !!contentTypeId ? components == null ? void 0 : components[contentTypeId] : void 0; 296 const attributes = getAttributes(props); 297 return !!EntryElement ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(EntryElement, __spreadValues({}, props)) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Entry.Children, { block: props.block }) })); 298} 299Entry.Children = function(props) { 300 var _a, _b, _c, _d, _e, _f, _g; 301 const href = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.uri; 302 const entryTitle = ((_e = (_d = props == null ? void 0 : props.block) == null ? void 0 : _d.value) == null ? void 0 : _e.entryTitle) || ""; 303 const entryDescription = ((_g = (_f = props == null ? void 0 : props.block) == null ? void 0 : _f.value) == null ? void 0 : _g.entryDescription) || ""; 304 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, !!href ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", { href }, entryTitle) : entryTitle), !!entryDescription ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, entryDescription) : null); 305}; 306function FormContentType(_props) { 307 return null; 308} 309FormContentType.Children = function(_props) { 310 return null; 311}; 312function Fragment(props) { 313 var _a, _b, _c, _d, _e; 314 const hasDecorators = !!((_c = (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.decorators) == null ? void 0 : _c.length); 315 const decorators = (_e = (_d = props.block) == null ? void 0 : _d.properties) == null ? void 0 : _e.decorators; 316 return hasDecorators ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Decorators, { block: props.block, decorators }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Fragment.Children, { block: props.block }) }); 317} 318Fragment.Children = RenderBlockChildrenFactory(); 319function Heading(props) { 320 const attributes = getAttributes(props); 321 const render = () => { 322 var _a, _b; 323 switch ((_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.level) { 324 case 2: { 325 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h2", __spreadValues({}
325, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Heading.Children, { block: props.block }) })); 326 } 327 case 3: { 328 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h3", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Heading.Children, { block: props.block }) })); 329 } 330 case 4: { 331 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h4", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Heading.Children, { block: props.block }) })); 332 } 333 case 5: { 334 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h5", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Heading.Children, { block: props.block }) })); 335 } 336 case 6: { 337 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h6", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Heading.Children, { block: props.block }) })); 338 } 339 default: { 340 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Heading.Children, { block: props.block }) })); 341 } 342 } 343 }; 344 return render(); 345} 346Heading.Children = RenderBlockChildrenFactory(); 347function Image(props) { 348 var _a, _b, _c, _d, _e, _f, _g, _h; 349 const src = (_d = (_c = (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.asset) == null ? void 0 : _c.sys) == null ? void 0 : _d.uri; 350 const attributes = getAttributes(props, { 351 src, 352 alt: (_f = (_e = props.block) == null ? void 0 : _e.value) == null ? void 0 : _f.altText, 353 title: (_h = (_g = props == null ? void 0 : props.block) == null ? void 0 : _g.value) == null ? void 0 : _h.caption 354 }); 355 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", __spreadValues({}, attributes)); 356} 357Image.Children = EmptyChildrenFactory(); 358function ImageWithCaption(props) { 359 var _a, _b; 360 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(WithCaption, { caption: (_b = (_a = props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.caption }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Image, __spreadValues({}, props))); 361} 362function InlineEntry(props) { 363 var _a, _b, _c; 364 const href = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.sys) == null ? void 0 : _c.uri; 365 const attributes = getAttributes(props, { 366 href 367 }); 368 return !!attributes.href ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(InlineEntry.Children, { block: props.block }) })) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(InlineEntry.Children, { block: props.block }) }); 369} 370InlineEntry.Children = function(props) { 371 var _a, _b; 372 const entryTitle = ((_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.value) == null ? void 0 : _b.entryTitle) || ""; 373 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, entryTitle); 374}; 375function Link(props) { 376 var _a, _b, _c, _d, _e, _f, _g; 377 const linkValue = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.link; 378 const attributes = getAttributes(props, { 379 href: (_c = linkValue == null ? void 0 : linkValue.sys) == null ? void 0 : _c.uri, 380 target: ((_e = (_d = props == null ? void 0 : props.block) == null ? void 0 : _d.properties) == null ? void 0 : _e.newTab) ? "_blank" : null, 381 rel: ((_g = (_f = props == null ? void 0 : props.block) == null ? void 0 : _f.properties) == null ? void 0 : _g.newTab) ? "noopener noreferrer" : null 382 });
383 return !!attributes.href ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Link.Children, { block: props.block }) })) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Link.Children, { block: props.block }) }); 384} 385Link.Children = RenderBlockChildrenFactory(); 386function Liquid(props) { 387 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Liquid.Children, { block: props.block }) }); 388} 389Liquid.Children = function(props) { 390 var _a; 391 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (_a = props.block) == null ? void 0 : _a.value); 392}; 393function List(props) { 394 var _a, _b, _c, _d; 395 const isOrdered = ((_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.listType) === "ordered"; 396 const attributes = getAttributes(props, { 397 start: isOrdered ? (_d = (_c = props.block) == null ? void 0 : _c.properties) == null ? void 0 : _d.start : null 398 }); 399 return isOrdered ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("ol", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(List.Children, { block: props.block }) })) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("ul", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(List.Children, { block: props.block }) })); 400} 401List.Children = RenderBlockChildrenFactory(); 402function ListItem(props) { 403 const attributes = getAttributes(props); 404 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("li", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(ListItem.Children, { block: props.block }) })); 405} 406ListItem.Children = RenderBlockChildrenFactory(); 407function Panel(props) { 408 var _a, _b; 409 const attributes = getAttributes(props, { 410 className: ["panel", ((_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.panelType) || "info"].join(" ") 411 }); 412 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("aside", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Panel.Children, { block: props.block }) })); 413} 414Panel.Children = RenderBlockChildrenFactory(); 415function Paragraph(props) { 416 var _a, _b; 417 const attributes = getAttributes(props, { 418 className: (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.paragraphType 419 }); 420 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Paragraph.Children, { block: props.block }) })); 421} 422Paragraph.Children = RenderBlockChildrenFactory(); 423function Quote(props) { 424 var _a, _b; 425 const attributes = getAttributes(props, { 426 "cite": (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.url 427 }); 428 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("blockquote", __spreadValues({}
428, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Quote.Children, { block: props.block }) })); 429} 430Quote.Children = function(props) { 431 var _a, _b, _c, _d; 432 const source = (_b = (_a = props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.source; 433 const citation = (_d = (_c = props.block) == null ? void 0 : _c.properties) == null ? void 0 : _d.citation; 434 const hasChildren = !!source || !!citation; 435 return hasChildren ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderChildren, { block: props.block })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("footer", null, source, " ", !!citation ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("cite", null, citation) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null))) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderChildren, { block: props.block }); 436}; 437function Table(props) { 438 const attributes = getAttributes(props); 439 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("table", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Table.Children, { block: props.block }) })); 440} 441Table.Children = RenderBlockChildrenFactory(); 442function TableBody(props) { 443 const attributes = getAttributes(props); 444 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("tbody", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(TableBody.Children, { block: props.block }) })); 445} 446TableBody.Children = RenderBlockChildrenFactory(); 447function TableCaption(props) { 448 const attributes = getAttributes(props); 449 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("caption", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(TableCaption.Children, { block: props.block }) })); 450} 451TableCaption.Children = RenderBlockChildrenFactory(); 452function TableCell(props) { 453 const attributes = getAttributes(props); 454 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("td", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(TableCell.Children, { block: props.block }) })); 455} 456TableCell.Children = RenderBlockChildrenFactory(); 457function TableFooter(props) { 458 const attributes = getAttributes(props); 459 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("tfoot", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(TableFooter.Children, { block: props.block }) })); 460} 461TableFooter.Children = RenderBlockChildrenFactory(); 462function TableHeader(props) { 463 const attributes = getAttributes(props); 464 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("thead", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(TableHeader.Children, { block: props.block }) })); 465} 466TableHeader.Children = RenderBlockChildrenFactory(); 467function TableHeaderCell(props) { 468 const renderContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BlockRenderContext);
469 const sectionAncestor = findAncestorOfType(renderContext.ancestors, ["_tableHeader", "_tableBody", "_tableFooter"]); 470 const attributes = getAttributes(props, { scope: (sectionAncestor == null ? void 0 : sectionAncestor.type) === "_tableHeader" ? "col" : "row" }); 471 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("th", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(TableHeaderCell.Children, { block: props.block }) })); 472} 473TableHeaderCell.Children = RenderBlockChildrenFactory(); 474function TableRow(props) { 475 const attributes = getAttributes(props); 476 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("tr", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(TableRow.Children, { block: props.block }) })); 477} 478TableRow.Children = RenderBlockChildrenFactory(); 479function Decorators(props) { 480 const decorators = useDecorators(); 481 const remainingDecorators = !!props.decorators ? [...props.decorators] : void 0; 482 const firstDecorator = !!remainingDecorators ? remainingDecorators.shift() : void 0; 483 const DecoratorComponent = !!firstDecorator ? decorators[firstDecorator] : void 0; 484 const render = () => { 485 if (!!DecoratorComponent) { 486 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(DecoratorComponent, { block: props.block, decorator: firstDecorator, otherDecorators: remainingDecorators }); 487 } else if (firstDecorator) { 488 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Decorators, { block: props.block, decorators: remainingDecorators }); 489 } else { 490 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Fragment.Children, { block: props.block }); 491 } 492 }; 493 return render(); 494} 495function DecoratorChildren(props) { 496 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Decorators, { block: props.block, decorators: props.otherDecorators }); 497} 498function Abbreviation(props) { 499 var _a, _b, _c; 500 const title = (_c = (_b = (_a = props == null ? void 0 : props.block) == null ? void 0 : _a.properties) == null ? void 0 : _b.abbreviation) == null ? void 0 : _c.title; 501 const attributes = getAttributes(props, { title }); 502 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("abbr", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(InlineCode.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 503} 504Abbreviation.Children = DecoratorChildren; 505function InlineCode(props) { 506 const attributes = getAttributes(props); 507 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("code", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(InlineCode.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 508} 509InlineCode.Children = DecoratorChildren; 510function Delete(props) { 511 const attributes = getAttributes(props); 512 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("del", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Delete.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 513} 514Delete.Children = DecoratorChildren; 515function Emphasis(props) { 516 const attributes = getAttributes(props); 517 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("em", __spreadValues({}
517, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Emphasis.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 518} 519Emphasis.Children = DecoratorChildren; 520function Insert(props) { 521 const attributes = getAttributes(props); 522 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("ins", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Insert.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 523} 524Insert.Children = DecoratorChildren; 525function Keyboard(props) { 526 const attributes = getAttributes(props); 527 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("kbd", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Keyboard.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 528} 529Keyboard.Children = DecoratorChildren; 530function LineBreak(props) { 531 const attributes = getAttributes(props); 532 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("br", __spreadValues({}, attributes)); 533} 534LineBreak.Children = function(props) { 535 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null); 536}; 537function Mark(props) { 538 const attributes = getAttributes(props); 539 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("mark", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Mark.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 540} 541Mark.Children = DecoratorChildren; 542function Strong(props) { 543 const attributes = getAttributes(props); 544 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("strong", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Strong.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 545} 546Strong.Children = DecoratorChildren; 547function Strikethrough(props) { 548 const attributes = getAttributes(props); 549 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("s", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Strikethrough.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 550} 551Strikethrough.Children = DecoratorChildren; 552function Subscript(props) { 553 const attributes = getAttributes(props); 554 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("sub", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Subscript.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 555} 556Subscript.Children = DecoratorChildren; 557function Superscript(props) { 558 const attributes = getAttributes(props); 559 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("sup", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Superscript.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 560} 561Superscript.Children = DecoratorChildren; 562function Underline(props) { 563 const attributes = getAttributes(props); 564 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("u", __spreadValues({}
564, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Underline.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 565} 566Underline.Children = DecoratorChildren; 567function Variable(props) { 568 const attributes = getAttributes(props); 569 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("var", __spreadValues({}, attributes), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderContents, { contents: props.children, fallback: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Variable.Children, { block: props.block, decorator: props.decorator, otherDecorators: props.otherDecorators }) })); 570} 571Variable.Children = DecoratorChildren; 572var BLOCK_RENDERERS = { 573 "_anchor": Anchor, 574 "_asset": Asset, 575 "_code": CodeWithCaption, 576 "_component": Component, 577 "_divider": Divider, 578 "_entry": Entry, 579 "_formContentType": FormContentType, 580 "_fragment": Fragment, 581 "_heading": Heading, 582 "_image": ImageWithCaption, 583 "_inlineEntry": InlineEntry, 584 "_link": Link, 585 "_liquid": Liquid, 586 "_list": List, 587 "_listItem": ListItem, 588 "_panel": Panel, 589 "_paragraph": Paragraph, 590 "_quote": Quote, 591 "_table": Table, 592 "_tableBody": TableBody, 593 "_tableCaption": TableCaption, 594 "_tableCell": TableCell, 595 "_tableFooter": TableFooter, 596 "_tableHeader": TableHeader, 597 "_tableHeaderCell": TableHeaderCell, 598 "_tableRow": TableRow 599}; 600var DECORATOR_RENDERERS = { 601 "abbreviation": Abbreviation, 602 "code": InlineCode, 603 "delete": Delete, 604 "emphasis": Emphasis, 605 "insert": Insert, 606 "keyboard": Keyboard, 607 "linebreak": LineBreak, 608 "mark": Mark, 609 "strikethrough": Strikethrough, 610 "strong": Strong, 611 "subscript": Subscript, 612 "superscript": Superscript, 613 "underline": Underline, 614 "variable": Variable 615}; 616 617//# sourceMappingURL=canvas-react.mjs.map 618 619/***/ }, 620 621/***/ 90762 622(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 623 624"use strict"; 625 626// EXPORTS 627__webpack_require__.d(__webpack_exports__, { 628 f: () => (/* binding */ ContensisForm) 629}); 630 631// NAMESPACE OBJECT: ./node_modules/mdurl/index.mjs 632var mdurl_namespaceObject = {}; 633__webpack_require__.r(mdurl_namespaceObject); 634__webpack_require__.d(mdurl_namespaceObject, { 635 decode: () => (lib_decode), 636 encode: () => (lib_encode), 637 format: () => (format), 638 parse: () => (parse) 639}); 640 641// NAMESPACE OBJECT: ./node_modules/uc.micro/index.mjs 642var uc_micro_namespaceObject = {}; 643__webpack_require__.r(uc_micro_namespaceObject); 644__webpack_require__.d(uc_micro_namespaceObject, { 645 Any: () => (Any_regex), 646 Cc: () => (Cc_regex), 647 Cf: () => (Cf_regex), 648 P: () => (regex), 649 S: () => (S_regex), 650 Z: () => (Z_regex) 651}); 652 653// NAMESPACE OBJECT: ./node_modules/markdown-it/lib/common/utils.mjs 654var utils_namespaceObject = {}; 655__webpack_require__.r(utils_namespaceObject); 656__webpack_require__.d(utils_namespaceObject, { 657 arrayReplaceAt: () => (arrayReplaceAt), 658 asciiTrim: () => (asciiTrim), 659 assign: () => (utils_assign), 660 escapeHtml: () => (escapeHtml), 661 escapeRE: () => (escapeRE), 662 fromCodePoint: () => (utils_fromCodePoint), 663 has: () => (has), 664 isMdAsciiPunct: () => (isMdAsciiPunct), 665 isPunctChar: () => (isPunctChar), 666 isPunctCharCode: () => (isPunctCharCode), 667 isSpace: () => (isSpace), 668 isString: () => (isString), 669 isValidEntityCode: () => (isValidEntityCode), 670 isWhiteSpace: () => (isWhiteSpace), 671 lib: () => (lib), 672 normalizeReference: () => (normalizeReference), 673 unescapeAll: () => (unescapeAll), 674 unescapeMd: () => (unescapeMd) 675}); 676 677// NAMESPACE OBJECT: ./node_modules/markdown-it/lib/helpers/index.mjs 678var helpers_namespaceObject = {}; 679__webpack_require__.r(helpers_namespaceObject); 680__webpack_require__.d(helpers_namespaceObject, { 681 parseLinkDestination: () => (parseLinkDestination), 682 parseLinkLabel: () => (parseLinkLabel), 683 parseLinkTitle: () => (parseLinkTitle) 684}); 685 686// EXTERNAL MODULE: ./node_modules/react/index.js 687var react = __webpack_require__(96540); 688;// ./node_modules/mdurl/lib/decode.mjs 689/* eslint-disable no-bitwise */ 690 691const decodeCache = {} 692 693function getDecodeCache (exclude) { 694 let cache = decodeCache[exclude] 695 if (cache) { return cache } 696 697 cache = decodeCache[exclude] = [] 698 699 for (let i = 0; i < 128; i++) { 700 const ch = String.fromCharCode(i) 701 cache.push(ch) 702 } 703 704 for (let i = 0; i < exclude.length; i++) { 705 const ch = exclude.charCodeAt(i) 706 cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2) 707 } 708 709 return cache 710} 711 712// Decode percent-encoded string. 713// 714function decode (string, exclude) { 715 if (typeof exclude !== 'string') { 716 exclude = decode.defaultChars 717 } 718 719 const cache = getDecodeCache(exclude) 720 721 return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) { 722 let result = '' 723 724 for (let i = 0, l = seq.length; i < l; i += 3) { 725 const b1 = parseInt(seq.slice(i + 1, i + 3), 16) 726 727 if (b1 < 0x80) { 728 result += cache[b1] 729 continue 730 } 731 732 if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) { 733 // 110xxxxx 10xxxxxx 734 const b2 = parseInt(seq.slice(i + 4, i + 6), 16) 735 736 if ((b2 & 0xC0) === 0x80) { 737 const chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F) 738 739 if (chr < 0x80) { 740 result += '\ufffd\ufffd' 741 } else { 742 result += String.fromCharCode(chr) 743 } 744 745 i += 3 746 continue 747 } 748 } 749 750 if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) { 751 // 1110xxxx 10xxxxxx 10xxxxxx 752 const b2 = parseInt(seq.slice(i + 4, i + 6), 16) 753 const b3 = parseInt(seq.slice(i + 7, i + 9), 16) 754 755 if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) { 756 const chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F) 757 758 if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) { 759 result += '\ufffd\ufffd\ufffd' 760 } else { 761 result += String.fromCharCode(chr) 762 } 763 764 i += 6 765 continue 766 } 767 } 768 769 if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) { 770 // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 771 const b2 = parseInt(seq.slice(i + 4, i + 6), 16) 772 const b3 = parseInt(seq.slice(i + 7, i + 9), 16) 773 const b4 = parseInt(seq.slice(i + 10, i + 12), 16) 774 775 if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) { 776 let chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F) 777 778 if (chr < 0x10000 || chr > 0x10FFFF) { 779 result += '\ufffd\ufffd\ufffd\ufffd' 780 } else { 781 chr -= 0x10000 782 result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF)) 783 } 784 785 i += 9 786 continue 787 } 788 } 789 790 result += '\ufffd' 791 } 792 793 return result 794 }) 795} 796 797decode.defaultChars = ';/?:@&=+$,#' 798decode.componentChars = '' 799 800/* harmony default export */ const lib_decode = (decode); 801 802;// ./node_modules/mdurl/lib/encode.mjs 803const encodeCache = {} 804 805// Create a lookup array where anything but characters in `chars` string 806// and alphanumeric chars is percent-encoded.
807// 808function getEncodeCache (exclude) { 809 let cache = encodeCache[exclude] 810 if (cache) { return cache } 811 812 cache = encodeCache[exclude] = [] 813 814 for (let i = 0; i < 128; i++) { 815 const ch = String.fromCharCode(i) 816 817 if (/^[0-9a-z]$/i.test(ch)) { 818 // always allow unencoded alphanumeric characters 819 cache.push(ch) 820 } else { 821 cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2)) 822 } 823 } 824 825 for (let i = 0; i < exclude.length; i++) { 826 cache[exclude.charCodeAt(i)] = exclude[i] 827 } 828 829 return cache 830} 831 832// Encode unsafe characters with percent-encoding, skipping already 833// encoded sequences. 834// 835// - string - string to encode 836// - exclude - list of characters to ignore (in addition to a-zA-Z0-9) 837// - keepEscaped - don't encode '%' in a correct escape sequence (default: true) 838// 839function encode (string, exclude, keepEscaped) { 840 if (typeof exclude !== 'string') { 841 // encode(string, keepEscaped) 842 keepEscaped = exclude 843 exclude = encode.defaultChars 844 } 845 846 if (typeof keepEscaped === 'undefined') { 847 keepEscaped = true 848 } 849 850 const cache = getEncodeCache(exclude) 851 let result = '' 852 853 for (let i = 0, l = string.length; i < l; i++) { 854 const code = string.charCodeAt(i) 855 856 if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) { 857 if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { 858 result += string.slice(i, i + 3) 859 i += 2 860 continue 861 } 862 } 863 864 if (code < 128) { 865 result += cache[code] 866 continue 867 } 868 869 if (code >= 0xD800 && code <= 0xDFFF) { 870 if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) { 871 const nextCode = string.charCodeAt(i + 1) 872 if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { 873 result += encodeURIComponent(string[i] + string[i + 1]) 874 i++ 875 continue 876 } 877 } 878 result += '%EF%BF%BD' 879 continue 880 } 881 882 result += encodeURIComponent(string[i]) 883 } 884 885 return result 886} 887 888encode.defaultChars = ";/?:@&=+$,-_.!~*'()#" 889encode.componentChars = "-_.!~*'()" 890 891/* harmony default export */ const lib_encode = (encode); 892 893;// ./node_modules/mdurl/lib/format.mjs 894function format (url) { 895 let result = '' 896 897 result += url.protocol || '' 898 result += url.slashes ? '//' : '' 899 result += url.auth ? url.auth + '@' : '' 900 901 if (url.hostname && url.hostname.indexOf(':') !== -1) { 902 // ipv6 address 903 result += '[' + url.hostname + ']' 904 } else { 905 result += url.hostname || '' 906 } 907 908 result += url.port ? ':' + url.port : '' 909 result += url.pathname || '' 910 result += url.search || '' 911 result += url.hash || '' 912 913 return result 914}; 915 916;// ./node_modules/mdurl/lib/parse.mjs 917// Copyright Joyent, Inc. and other Node contributors. 918// 919// Permission is hereby granted, free of charge, to any person obtaining a 920// copy of this software and associated documentation files (the 921// "Software"), to deal in the Software without restriction, including 922// without limitation the rights to use, copy, modify, merge, publish, 923// distribute, sublicense, and/or sell copies of the Software, and to permit 924// persons to whom the Software is furnished to do so, subject to the 925// following conditions: 926// 927// The above copyright notice and this permission notice shall be included 928// in all copies or substantial portions of the Software. 929// 930// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 931// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 932// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 933// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 934// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 935// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 936// USE OR OTHER DEALINGS IN THE SOFTWARE. 937 938// 939// Changes from joyent/node: 940// 941// 1. No leading slash in paths, 942// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/` 943// 944// 2. Backslashes are not replaced with slashes, 945// so `http:\\example.org\` is treated like a relative path 946// 947// 3. Trailing colon is treated like a part of the path, 948// i.e. in `http://example.org:foo` pathname is `:foo` 949// 950// 4. Nothing is URL-encoded in the resulting object, 951// (in joyent/node some chars in auth and paths are encoded) 952// 953// 5. `url.parse()` does not have `parseQueryString` argument 954// 955// 6. Removed extraneous result properties: `host`, `path`, `query`, etc., 956// which can be constructed using other parts of the url. 957// 958 959function Url () { 960 this.protocol = null 961 this.slashes = null 962 this.auth = null 963 this.port = null 964 this.hostname = null 965 this.hash = null 966 this.search = null 967 this.pathname = null 968} 969 970// Reference: RFC 3986, RFC 1808, RFC 2396 971 972// define these here so at least they only have to be 973// compiled once on the first module load. 974const protocolPattern = /^([a-z0-9.+-]+:)/i 975const portPattern = /:[0-9]*$/ 976 977// Special case for a simple path URL 978/* eslint-disable-next-line no-useless-escape */
979const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/ 980 981// RFC 2396: characters reserved for delimiting URLs. 982// We actually just auto-escape these. 983const delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'] 984 985// RFC 2396: characters not allowed for various reasons. 986const unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims) 987 988// Allowed by RFCs, but cause of XSS attacks. Always escape these. 989const autoEscape = ['\''].concat(unwise) 990// Characters that are never ever allowed in a hostname. 991// Note that any invalid chars are also handled, but these 992// are the ones that are *expected* to be seen, so we fast-path 993// them. 994const nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape) 995const hostEndingChars = ['/', '?', '#'] 996const hostnameMaxLen = 255 997const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/ 998const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/ 999// protocols that can allow "unsafe" and "unwise" chars. 1000// protocols that never have a hostname. 1001const hostlessProtocol = { 1002 javascript: true, 1003 'javascript:': true 1004} 1005// protocols that always contain a // bit. 1006const slashedProtocol = { 1007 http: true, 1008 https: true, 1009 ftp: true, 1010 gopher: true, 1011 file: true, 1012 'http:': true, 1013 'https:': true, 1014 'ftp:': true, 1015 'gopher:': true, 1016 'file:': true 1017} 1018 1019function urlParse (url, slashesDenoteHost) { 1020 if (url && url instanceof Url) return url 1021 1022 const u = new Url() 1023 u.parse(url, slashesDenoteHost) 1024 return u 1025} 1026 1027Url.prototype.parse = function (url, slashesDenoteHost) { 1028 let lowerProto, hec, slashes 1029 let rest = url 1030 1031 // trim before proceeding. 1032 // This is to support parse stuff like " http://foo.com \n" 1033 rest = rest.trim() 1034 1035 if (!slashesDenoteHost && url.split('#').length === 1) { 1036 // Try fast path regexp 1037 const simplePath = simplePathPattern.exec(rest) 1038 if (simplePath) { 1039 this.pathname = simplePath[1] 1040 if (simplePath[2]) { 1041 this.search = simplePath[2] 1042 } 1043 return this 1044 } 1045 } 1046 1047 let proto = protocolPattern.exec(rest) 1048 if (proto) { 1049 proto = proto[0] 1050 lowerProto = proto.toLowerCase() 1051 this.protocol = proto 1052 rest = rest.substr(proto.length) 1053 } 1054 1055 // figure out if it's got a host 1056 // user@server is *always* interpreted as a hostname, and url 1057 // resolution will treat //foo/bar as host=foo,path=bar because that's 1058 // how the browser resolves relative URLs. 1059 /* eslint-disable-next-line no-useless-escape */ 1060 if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { 1061 slashes = rest.substr(0, 2) === '//' 1062 if (slashes && !(proto && hostlessProtocol[proto])) { 1063 rest = rest.substr(2) 1064 this.slashes = true 1065 } 1066 } 1067 1068 if (!hostlessProtocol[proto] && 1069 (slashes || (proto && !slashedProtocol[proto]))) { 1070 // there's a hostname. 1071 // the first instance of /, ?, ;, or # ends the host. 1072 // 1073 // If there is an @ in the hostname, then non-host chars *are* allowed 1074 // to the left of the last @ sign, unless some host-ending character 1075 // comes *before* the @-sign. 1076 // URLs are obnoxious. 1077 // 1078 // ex: 1079 // http://a@b@c/ => user:a@b host:c 1080 // http://a@b?@c => user:a host:c path:/?@c 1081 1082 // v0.12 TODO(isaacs): This is not quite how Chrome does things. 1083 // Review our test case against browsers more comprehensively. 1084 1085 // find the first instance of any hostEndingChars 1086 let hostEnd = -1 1087 for (let i = 0; i < hostEndingChars.length; i++) { 1088 hec = rest.indexOf(hostEndingChars[i]) 1089 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { 1090 hostEnd = hec 1091 } 1092 } 1093 1094 // at this point, either we have an explicit point where the 1095 // auth portion cannot go past, or the last @ char is the decider. 1096 let auth, atSign 1097 if (hostEnd === -1) { 1098 // atSign can be anywhere. 1099 atSign = rest.lastIndexOf('@') 1100 } else { 1101 // atSign must be in auth portion. 1102 // http://a@b/c@d => host:b auth:a path:/c@d 1103 atSign = rest.lastIndexOf('@', hostEnd) 1104 } 1105 1106 // Now we have a portion which is definitely the auth. 1107 // Pull that off. 1108 if (atSign !== -1) { 1109 auth = rest.slice(0, atSign) 1110 rest = rest.slice(atSign + 1) 1111 this.auth = auth 1112 } 1113 1114 // the host is the remaining to the left of the first non-host char 1115 hostEnd = -1 1116 for (let i = 0; i < nonHostChars.length; i++) { 1117 hec = rest.indexOf(nonHostChars[i]) 1118 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { 1119 hostEnd = hec 1120 } 1121 } 1122 // if we still have not hit it, then the entire thing is a host. 1123 if (hostEnd === -1) { 1124 hostEnd = rest.length 1125 } 1126 1127 if (rest[hostEnd - 1] === ':') { hostEnd-- } 1128 const host = rest.slice(0, hostEnd) 1129 rest = rest.slice(hostEnd) 1130 1131 // pull out port. 1132 this.parseHost(host) 1133 1134 // we've indicated that there is a hostname, 1135 // so even if it's empty, it has to be present. 1136 this.hostname = this.hostname || '' 1137 1138 // if hostname begins with [ and ends with ] 1139 // assume that it's an IPv6 address. 1140 const ipv6Hostname = this.hostname[0] === '[' && 1141 this.hostname[this.hostname.length - 1] === ']' 1142 1143 // validate a little. 1144 if (!ipv6Hostname) { 1145 const hostparts = this.hostname.split(/\./) 1146 for (let i = 0, l = hostparts.length; i < l; i++) { 1147 const part = hostparts[i] 1148 if (!part) { continue } 1149 if (!part.match(hostnamePartPattern)) { 1150 let newpart = '' 1151 for (let j = 0, k = part.length; j < k; j++) { 1152 if (part.charCodeAt(j) > 127) { 1153 // we replace non-ASCII char with a temporary placeholder 1154 // we need this to make sure size of hostname is not 1155 // broken by replacing non-ASCII by nothing 1156 newpart += 'x' 1157 } else { 1158 newpart += part[j] 1159 } 1160 } 1161 // we test again with ASCII char only 1162 if (!newpart.match(hostnamePartPattern)) { 1163 const validParts = hostparts.slice(0, i) 1164 const notHost = hostparts.slice(i + 1) 1165 const bit = part.match(hostnamePartStart) 1166 if (bit) { 1167 validParts.push(bit[1]) 1168 notHost.unshift(bit[2]) 1169 } 1170 if (notHost.length) { 1171 rest = notHost.join('.') + rest 1172 } 1173 this.hostname = validParts.join('.') 1174 break 1175 } 1176 } 1177 } 1178 } 1179 1180 if (this.hostname.length > hostnameMaxLen) { 1181 this.hostname = '' 1182 } 1183 1184 // strip [ and ] from the hostname 1185 // the host field still retains them, though 1186 if (ipv6Hostname) { 1187 this.hostname = this.hostname.substr(1, this.hostname.length - 2) 1188 } 1189 } 1190 1191 // chop off from the tail first. 1192 const hash = rest.indexOf('#') 1193 if (hash !== -1) { 1194 // got a fragment string.
1195 this.hash = rest.substr(hash) 1196 rest = rest.slice(0, hash) 1197 } 1198 const qm = rest.indexOf('?') 1199 if (qm !== -1) { 1200 this.search = rest.substr(qm) 1201 rest = rest.slice(0, qm) 1202 } 1203 if (rest) { this.pathname = rest } 1204 if (slashedProtocol[lowerProto] && 1205 this.hostname && !this.pathname) { 1206 this.pathname = '' 1207 } 1208 1209 return this 1210} 1211 1212Url.prototype.parseHost = function (host) { 1213 let port = portPattern.exec(host) 1214 if (port) { 1215 port = port[0] 1216 if (port !== ':') { 1217 this.port = port.substr(1) 1218 } 1219 host = host.substr(0, host.length - port.length) 1220 } 1221 if (host) { this.hostname = host } 1222} 1223 1224/* harmony default export */ const parse = (urlParse); 1225 1226;// ./node_modules/mdurl/index.mjs 1227 1228 1229 1230 1231 1232 1233 1234;// ./node_modules/uc.micro/categories/P/regex.mjs 1235/* harmony default export */ const regex = (/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/); 1236;// ./node_modules/uc.micro/categories/S/regex.mjs 1237/* harmony default export */ const S_regex = (/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uD
1237F3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/); 1238;// ./node_modules/uc.micro/properties/Any/regex.mjs 1239/* harmony default export */ const Any_regex = (/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/); 1240;// ./node_modules/uc.micro/categories/Cc/regex.mjs 1241/* harmony default export */ const Cc_regex = (/[\0-\x1F\x7F-\x9F]/); 1242;// ./node_modules/uc.micro/categories/Cf/regex.mjs 1243/* harmony default export */ const Cf_regex = (/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/); 1244;// ./node_modules/uc.micro/categories/Z/regex.mjs 1245/* harmony default export */ const Z_regex = (/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/); 1246;// ./node_modules/uc.micro/index.mjs 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256;// ./node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.js 1257// Generated using scripts/write-decode-map.ts 1258/* harmony default export */ const decode_data_html = (new Uint16Array( 1259// prettier-ignore
vendor: 8,806 bytes, line 1260
1260"\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;
vendor: 4,505 bytes, line 1260
1260\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b\"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;
vendor: 34,221 bytes, line 1260
1260\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c"
1261 .split("") 1262 .map((c) => c.charCodeAt(0)))); 1263//# sourceMappingURL=decode-data-html.js.map 1264;// ./node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.js 1265// Generated using scripts/write-decode-map.ts 1266/* harmony default export */ const decode_data_xml = (new Uint16Array( 1267// prettier-ignore 1268"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022" 1269 .split("") 1270 .map((c) => c.charCodeAt(0)))); 1271//# sourceMappingURL=decode-data-xml.js.map 1272;// ./node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.js 1273// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134 1274var _a; 1275const decodeMap = new Map([ 1276 [0, 65533], 1277 // C1 Unicode control character reference replacements 1278 [128, 8364], 1279 [130, 8218], 1280 [131, 402], 1281 [132, 8222], 1282 [133, 8230], 1283 [134, 8224], 1284 [135, 8225], 1285 [136, 710], 1286 [137, 8240], 1287 [138, 352], 1288 [139, 8249], 1289 [140, 338], 1290 [142, 381], 1291 [145, 8216], 1292 [146, 8217], 1293 [147, 8220], 1294 [148, 8221], 1295 [149, 8226], 1296 [150, 8211], 1297 [151, 8212], 1298 [152, 732], 1299 [153, 8482], 1300 [154, 353], 1301 [155, 8250], 1302 [156, 339], 1303 [158, 382], 1304 [159, 376], 1305]); 1306/** 1307 * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. 1308 */ 1309const fromCodePoint = 1310// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins 1311(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) { 1312 let output = ""; 1313 if (codePoint > 0xffff) { 1314 codePoint -= 0x10000; 1315 output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); 1316 codePoint = 0xdc00 | (codePoint & 0x3ff); 1317 } 1318 output += String.fromCharCode(codePoint); 1319 return output; 1320}; 1321/** 1322 * Replace the given code point with a replacement character if it is a 1323 * surrogate or is outside the valid range. Otherwise return the code 1324 * point unchanged. 1325 */ 1326function replaceCodePoint(codePoint) { 1327 var _a; 1328 if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { 1329 return 0xfffd; 1330 } 1331 return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint; 1332} 1333/** 1334 * Replace the code point if relevant, then convert it to a string. 1335 * 1336 * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead. 1337 * @param codePoint The code point to decode. 1338 * @returns The decoded code point. 1339 */ 1340function decodeCodePoint(codePoint) { 1341 return fromCodePoint(replaceCodePoint(codePoint)); 1342} 1343//# sourceMappingURL=decode_codepoint.js.map 1344;// ./node_modules/markdown-it/node_modules/entities/lib/esm/decode.js 1345 1346 1347 1348// Re-export for use by eg. htmlparser2 1349 1350 1351var CharCodes; 1352(function (CharCodes) {
vendor: 4,149 bytes, lines 1353-1446
1353 CharCodes[CharCodes["NUM"] = 35] = "NUM"; 1354 CharCodes[CharCodes["SEMI"] = 59] = "SEMI"; 1355 CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS"; 1356 CharCodes[CharCodes["ZERO"] = 48] = "ZERO"; 1357 CharCodes[CharCodes["NINE"] = 57] = "NINE"; 1358 CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A"; 1359 CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F"; 1360 CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X"; 1361 CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z"; 1362 CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A"; 1363 CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F"; 1364 CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z"; 1365})(CharCodes || (CharCodes = {})); 1366/** Bit that needs to be set to convert an upper case ASCII character to lower case */ 1367const TO_LOWER_BIT = 0b100000; 1368var BinTrieFlags; 1369(function (BinTrieFlags) { 1370 BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; 1371 BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; 1372 BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE"; 1373})(BinTrieFlags || (BinTrieFlags = {})); 1374function isNumber(code) { 1375 return code >= CharCodes.ZERO && code <= CharCodes.NINE; 1376} 1377function isHexadecimalCharacter(code) { 1378 return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) || 1379 (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F)); 1380} 1381function isAsciiAlphaNumeric(code) { 1382 return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) || 1383 (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) || 1384 isNumber(code)); 1385} 1386/** 1387 * Checks if the given character is a valid end character for an entity in an attribute. 1388 * 1389 * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error. 1390 * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state 1391 */ 1392function isEntityInAttributeInvalidEnd(code) { 1393 return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code); 1394} 1395var EntityDecoderState; 1396(function (EntityDecoderState) { 1397 EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart"; 1398 EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart"; 1399 EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal"; 1400 EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex"; 1401 EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity"; 1402})(EntityDecoderState || (EntityDecoderState = {})); 1403var DecodingMode; 1404(function (DecodingMode) { 1405 /** Entities in text nodes that can end with any character. */ 1406 DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy"; 1407 /** Only allow entities terminated with a semicolon. */ 1408 DecodingMode[DecodingMode["Strict"] = 1] = "Strict"; 1409 /** Entities in attributes have limitations on ending characters. */ 1410 DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute"; 1411})(DecodingMode || (DecodingMode = {})); 1412/** 1413 * Token decoder with support of writing partial entities. 1414 */ 1415class EntityDecoder { 1416 constructor( 1417 /** The tree used to decode entities. */ 1418 decodeTree, 1419 /** 1420 * The function that is called when a codepoint is decoded. 1421 * 1422 * For multi-byte named entities, this will be called multiple times, 1423 * with the second codepoint, and the same `consumed` value. 1424 * 1425 * @param codepoint The decoded codepoint. 1426 * @param consumed The number of bytes consumed by the decoder. 1427 */ 1428 emitCodePoint, 1429 /** An object that is used to produce errors. */ 1430 errors) { 1431 this.decodeTree = decodeTree; 1432 this.emitCodePoint = emitCodePoint; 1433 this.errors = errors; 1434 /** The current state of the decoder. */ 1435 this.state = EntityDecoderState.EntityStart; 1436 /** Characters that were consumed while parsing an entity. */ 1437 this.consumed = 1; 1438 /** 1439 * The result of the entity. 1440 * 1441 * Either the result index of a numeric entity, or the codepoint of a 1442 * numeric entity. 1443 */ 1444 this.result = 0; 1445 /** The current index in the decode tree. */ 1446 this.treeIndex = 0;
vendor: 16,384 bytes, lines 1447-1850
1447 /** The number of characters that were consumed in excess. */ 1448 this.excess = 1; 1449 /** The mode in which the decoder is operating. */ 1450 this.decodeMode = DecodingMode.Strict; 1451 } 1452 /** Resets the instance to make it reusable. */ 1453 startEntity(decodeMode) { 1454 this.decodeMode = decodeMode; 1455 this.state = EntityDecoderState.EntityStart; 1456 this.result = 0; 1457 this.treeIndex = 0; 1458 this.excess = 1; 1459 this.consumed = 1; 1460 } 1461 /** 1462 * Write an entity to the decoder. This can be called multiple times with partial entities. 1463 * If the entity is incomplete, the decoder will return -1. 1464 * 1465 * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the 1466 * entity is incomplete, and resume when the next string is written. 1467 * 1468 * @param string The string containing the entity (or a continuation of the entity). 1469 * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. 1470 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 1471 */ 1472 write(str, offset) { 1473 switch (this.state) { 1474 case EntityDecoderState.EntityStart: { 1475 if (str.charCodeAt(offset) === CharCodes.NUM) { 1476 this.state = EntityDecoderState.NumericStart; 1477 this.consumed += 1; 1478 return this.stateNumericStart(str, offset + 1); 1479 } 1480 this.state = EntityDecoderState.NamedEntity; 1481 return this.stateNamedEntity(str, offset); 1482 } 1483 case EntityDecoderState.NumericStart: { 1484 return this.stateNumericStart(str, offset); 1485 } 1486 case EntityDecoderState.NumericDecimal: { 1487 return this.stateNumericDecimal(str, offset); 1488 } 1489 case EntityDecoderState.NumericHex: { 1490 return this.stateNumericHex(str, offset); 1491 } 1492 case EntityDecoderState.NamedEntity: { 1493 return this.stateNamedEntity(str, offset); 1494 } 1495 } 1496 } 1497 /** 1498 * Switches between the numeric decimal and hexadecimal states. 1499 * 1500 * Equivalent to the `Numeric character reference state` in the HTML spec. 1501 * 1502 * @param str The string containing the entity (or a continuation of the entity). 1503 * @param offset The current offset. 1504 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 1505 */ 1506 stateNumericStart(str, offset) { 1507 if (offset >= str.length) { 1508 return -1; 1509 } 1510 if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { 1511 this.state = EntityDecoderState.NumericHex; 1512 this.consumed += 1; 1513 return this.stateNumericHex(str, offset + 1); 1514 } 1515 this.state = EntityDecoderState.NumericDecimal; 1516 return this.stateNumericDecimal(str, offset); 1517 } 1518 addToNumericResult(str, start, end, base) { 1519 if (start !== end) { 1520 const digitCount = end - start; 1521 this.result = 1522 this.result * Math.pow(base, digitCount) + 1523 parseInt(str.substr(start, digitCount), base); 1524 this.consumed += digitCount; 1525 } 1526 } 1527 /** 1528 * Parses a hexadecimal numeric entity. 1529 * 1530 * Equivalent to the `Hexademical character reference state` in the HTML spec. 1531 * 1532 * @param str The string containing the entity (or a continuation of the entity). 1533 * @param offset The current offset. 1534 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 1535 */ 1536 stateNumericHex(str, offset) { 1537 const startIdx = offset; 1538 while (offset < str.length) { 1539 const char = str.charCodeAt(offset); 1540 if (isNumber(char) || isHexadecimalCharacter(char)) { 1541 offset += 1; 1542 } 1543 else { 1544 this.addToNumericResult(str, startIdx, offset, 16); 1545 return this.emitNumericEntity(char, 3); 1546 } 1547 } 1548 this.addToNumericResult(str, startIdx, offset, 16); 1549 return -1; 1550 } 1551 /** 1552 * Parses a decimal numeric entity. 1553 * 1554 * Equivalent to the `Decimal character reference state` in the HTML spec. 1555 * 1556 * @param str The string containing the entity (or a continuation of the entity). 1557 * @param offset The current offset. 1558 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 1559 */ 1560 stateNumericDecimal(str, offset) { 1561 const startIdx = offset; 1562 while (offset < str.length) { 1563 const char = str.charCodeAt(offset); 1564 if (isNumber(char)) { 1565 offset += 1; 1566 } 1567 else { 1568 this.addToNumericResult(str, startIdx, offset, 10); 1569 return this.emitNumericEntity(char, 2); 1570 } 1571 } 1572 this.addToNumericResult(str, startIdx, offset, 10); 1573 return -1; 1574 } 1575 /** 1576 * Validate and emit a numeric entity. 1577 * 1578 * Implements the logic from the `Hexademical character reference start 1579 * state` and `Numeric character reference end state` in the HTML spec. 1580 * 1581 * @param lastCp The last code point of the entity. Used to see if the 1582 * entity was terminated with a semicolon. 1583 * @param expectedLength The minimum number of characters that should be 1584 * consumed. Used to validate that at least one digit 1585 * was consumed. 1586 * @returns The number of characters that were consumed. 1587 */ 1588 emitNumericEntity(lastCp, expectedLength) { 1589 var _a; 1590 // Ensure we consumed at least one digit. 1591 if (this.consumed <= expectedLength) { 1592 (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); 1593 return 0; 1594 } 1595 // Figure out if this is a legit end of the entity 1596 if (lastCp === CharCodes.SEMI) { 1597 this.consumed += 1; 1598 } 1599 else if (this.decodeMode === DecodingMode.Strict) { 1600 return 0; 1601 } 1602 this.emitCodePoint(replaceCodePoint(this.result), this.consumed); 1603 if (this.errors) { 1604 if (lastCp !== CharCodes.SEMI) { 1605 this.errors.missingSemicolonAfterCharacterReference(); 1606 } 1607 this.errors.validateNumericCharacterReference(this.result); 1608 } 1609 return this.consumed; 1610 } 1611 /** 1612 * Parses a named entity. 1613 * 1614 * Equivalent to the `Named character reference state` in the HTML spec. 1615 * 1616 * @param str The string containing the entity (or a continuation of the entity). 1617 * @param offset The current offset. 1618 * @returns The number of characters that were consumed, or -1 if the entity is incomplete. 1619 */ 1620 stateNamedEntity(str, offset) { 1621 const { decodeTree } = this; 1622 let current = decodeTree[this.treeIndex]; 1623 // The mask is the number of bytes of the value, including the current byte. 1624 let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; 1625 for (; offset < str.length; offset++, this.excess++) { 1626 const char = str.charCodeAt(offset); 1627 this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); 1628 if (this.treeIndex < 0) { 1629 return this.result === 0 || 1630 // If we are parsing an attribute 1631 (this.decodeMode === DecodingMode.Attribute && 1632 // We shouldn't have consumed any characters after the entity, 1633 (valueLength === 0 || 1634 // And there should be no invalid characters. 1635 isEntityInAttributeInvalidEnd(char))) 1636 ? 0 1637 : this.emitNotTerminatedNamedEntity(); 1638 } 1639 current = decodeTree[this.treeIndex]; 1640 valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; 1641 // If the branch is a value, store it and continue 1642 if (valueLength !== 0) { 1643 // If the entity is terminated by a semicolon, we are done. 1644 if (char === CharCodes.SEMI) { 1645 return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); 1646 } 1647 // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it. 1648 if (this.decodeMode !== DecodingMode.Strict) { 1649 this.result = this.treeIndex; 1650 this.consumed += this.excess; 1651 this.excess = 0; 1652 } 1653 } 1654 } 1655 return -1; 1656 } 1657 /** 1658 * Emit a named entity that was not terminated with a semicolon. 1659 * 1660 * @returns The number of characters consumed. 1661 */ 1662 emitNotTerminatedNamedEntity() { 1663 var _a; 1664 const { result, decodeTree } = this; 1665 const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; 1666 this.emitNamedEntityData(result, valueLength, this.consumed); 1667 (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference(); 1668 return this.consumed; 1669 } 1670 /** 1671 * Emit a named entity. 1672 * 1673 * @param result The index of the entity in the decode tree. 1674 * @param valueLength The number of bytes in the entity. 1675 * @param consumed The number of characters consumed. 1676 * 1677 * @returns The number of characters consumed. 1678 */ 1679 emitNamedEntityData(result, valueLength, consumed) { 1680 const { decodeTree } = this; 1681 this.emitCodePoint(valueLength === 1 1682 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH 1683 : decodeTree[result + 1], consumed); 1684 if (valueLength === 3) { 1685 // For multi-byte values, we need to emit the second byte. 1686 this.emitCodePoint(decodeTree[result + 2], consumed); 1687 } 1688 return consumed; 1689 } 1690 /** 1691 * Signal to the parser that the end of the input was reached. 1692 * 1693 * Remaining data will be emitted and relevant errors will be produced. 1694 * 1695 * @returns The number of characters consumed. 1696 */ 1697 end() { 1698 var _a; 1699 switch (this.state) { 1700 case EntityDecoderState.NamedEntity: { 1701 // Emit a named entity if we have one. 1702 return this.result !== 0 && 1703 (this.decodeMode !== DecodingMode.Attribute || 1704 this.result === this.treeIndex) 1705 ? this.emitNotTerminatedNamedEntity() 1706 : 0; 1707 } 1708 // Otherwise, emit a numeric entity if we have one. 1709 case EntityDecoderState.NumericDecimal: { 1710 return this.emitNumericEntity(0, 2); 1711 } 1712 case EntityDecoderState.NumericHex: { 1713 return this.emitNumericEntity(0, 3); 1714 } 1715 case EntityDecoderState.NumericStart: { 1716 (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); 1717 return 0; 1718 } 1719 case EntityDecoderState.EntityStart: { 1720 // Return 0 if we have no entity. 1721 return 0; 1722 } 1723 } 1724 } 1725} 1726/** 1727 * Creates a function that decodes entities in a string. 1728 * 1729 * @param decodeTree The decode tree. 1730 * @returns A function that decodes entities in a string. 1731 */ 1732function getDecoder(decodeTree) { 1733 let ret = ""; 1734 const decoder = new EntityDecoder(decodeTree, (str) => (ret += fromCodePoint(str))); 1735 return function decodeWithTrie(str, decodeMode) { 1736 let lastIndex = 0; 1737 let offset = 0; 1738 while ((offset = str.indexOf("&", offset)) >= 0) { 1739 ret += str.slice(lastIndex, offset); 1740 decoder.startEntity(decodeMode); 1741 const len = decoder.write(str, 1742 // Skip the "&" 1743 offset + 1); 1744 if (len < 0) { 1745 lastIndex = offset + decoder.end(); 1746 break; 1747 } 1748 lastIndex = offset + len; 1749 // If `len` is 0, skip the current `&` and continue. 1750 offset = len === 0 ? lastIndex + 1 : lastIndex; 1751 } 1752 const result = ret + str.slice(lastIndex); 1753 // Make sure we don't keep a reference to the final string. 1754 ret = ""; 1755 return result; 1756 }; 1757} 1758/** 1759 * Determines the branch of the current node that is taken given the current 1760 * character. This function is used to traverse the trie. 1761 * 1762 * @param decodeTree The trie. 1763 * @param current The current node. 1764 * @param nodeIdx The index right after the current node and its value. 1765 * @param char The current character. 1766 * @returns The index of the next node, or -1 if no branch is taken. 1767 */ 1768function determineBranch(decodeTree, current, nodeIdx, char) { 1769 const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; 1770 const jumpOffset = current & BinTrieFlags.JUMP_TABLE; 1771 // Case 1: Single branch encoded in jump offset 1772 if (branchCount === 0) { 1773 return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; 1774 } 1775 // Case 2: Multiple branches encoded in jump table 1776 if (jumpOffset) { 1777 const value = char - jumpOffset; 1778 return value < 0 || value >= branchCount 1779 ? -1 1780 : decodeTree[nodeIdx + value] - 1; 1781 } 1782 // Case 3: Multiple branches encoded in dictionary 1783 // Binary search for the character. 1784 let lo = nodeIdx; 1785 let hi = lo + branchCount - 1; 1786 while (lo <= hi) { 1787 const mid = (lo + hi) >>> 1; 1788 const midVal = decodeTree[mid]; 1789 if (midVal < char) { 1790 lo = mid + 1; 1791 } 1792 else if (midVal > char) { 1793 hi = mid - 1; 1794 } 1795 else { 1796 return decodeTree[mid + branchCount]; 1797 } 1798 } 1799 return -1; 1800} 1801const htmlDecoder = getDecoder(decode_data_html); 1802const xmlDecoder = getDecoder(decode_data_xml); 1803/** 1804 * Decodes an HTML string. 1805 * 1806 * @param str The string to decode. 1807 * @param mode The decoding mode. 1808 * @returns The decoded string. 1809 */ 1810function decodeHTML(str, mode = DecodingMode.Legacy) { 1811 return htmlDecoder(str, mode); 1812} 1813/** 1814 * Decodes an HTML string in an attribute. 1815 * 1816 * @param str The string to decode. 1817 * @returns The decoded string. 1818 */ 1819function decodeHTMLAttribute(str) { 1820 return htmlDecoder(str, DecodingMode.Attribute); 1821} 1822/** 1823 * Decodes an HTML string, requiring all entities to be terminated by a semicolon. 1824 * 1825 * @param str The string to decode. 1826 * @returns The decoded string. 1827 */ 1828function decodeHTMLStrict(str) { 1829 return htmlDecoder(str, DecodingMode.Strict); 1830} 1831/** 1832 * Decodes an XML string, requiring all entities to be terminated by a semicolon. 1833 * 1834 * @param str The string to decode. 1835 * @returns The decoded string. 1836 */ 1837function decodeXML(str) { 1838 return xmlDecoder(str, DecodingMode.Strict); 1839} 1840//# sourceMappingURL=decode.js.map 1841;// ./node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.js 1842// Generated using scripts/write-encode-map.ts 1843function restoreDiff(arr) { 1844 for (let i = 1; i < arr.length; i++) { 1845 arr[i][0] += arr[i - 1][0] + 1; 1846 } 1847 return arr; 1848} 1849// prettier-ignore 1850/* harmony default export */ const encode_html = (new Map(/* #__PURE__ */ restoreDiff([[9, "	"], [0, "
"], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { v: "<", n: 8402, o: "<⃒" }], [0, { v: "=", n: 8421, o: "=⃥" }], [0, { v: ">", n: 8402, o: ">⃒" }], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { n: 106, o: "fj" }], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "&n
1850ot;"], [0, "­"], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, "‌"], [0, "‍"], [0, "‎"], [0, "‏"], [0, "‐
1850"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { v: " ", n: 8202, o: "  " }], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { v: "↝", n: 824, o: "↝̸" }], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { v: "∂", n: 824, o: "∂̸" }], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { v: "∠", n: 8402, o: "∠⃒" }], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { v: "∩", n: 65024, o: "∩︀" }], [0, { v: "∪", n: 65024, o: "∪︀" }], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { v: "∼", n: 8402, o: "∼⃒" }], [0, { v: "∽", n: 817, o: "∽̱" }], [0, { v: "∾", n: 819, o: "∾̳" }], [0, "∿"], [0, "≀"], [0, "≁"], [0, { v: "≂", n: 824, o: "≂̸" }], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { v: "≋", n: 824, o: "≋̸" }], [0, "≌"], [0, { v: "≍", n: 8402, o: "≍⃒" }], [0, { v: "≎", n: 824, o: "≎̸" }], [0, { v: "≏", n: 824, o: "≏̸" }], [0, { v: "≐", n: 824, o: "≐̸" }], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔
1850"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { v: "≡", n: 8421, o: "≡⃥" }], [0, "≢"], [1, { v: "≤", n: 8402, o: "≤⃒" }], [0, { v: "≥", n: 8402, o: "≥⃒" }], [0, { v: "≦", n: 824, o: "≦̸" }], [0, { v: "≧", n: 824, o: "≧̸" }], [0, { v: "≨", n: 65024, o: "≨︀" }], [0, { v: "≩", n: 65024, o: "≩︀" }], [0, { v: "≪", n: new Map(/* #__PURE__ */ restoreDiff([[824, "≪̸"], [7577, "≪⃒"]])) }], [0, { v: "≫", n: new Map(/* #__PURE__ */ restoreDiff([[824, "≫̸"], [7577, "≫⃒"]])) }], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { v: "≿", n: 824, o: "≿̸" }], [0, "⊀"], [0, "⊁"], [0, { v: "⊂", n: 8402, o: "⊂⃒" }], [0, { v: "⊃", n: 8402, o: "⊃⃒" }], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { v: "⊊", n: 65024, o: "⊊︀" }], [0, { v: "⊋", n: 65024, o: "⊋︀" }], [1, "⊍"], [0, "⊎"], [0, { v: "⊏", n: 824, o: "⊏̸" }], [0, { v: "⊐", n: 824, o: "⊐̸" }], [0, "⊑"], [0, "⊒"], [0, { v: "⊓", n: 65024, o: "⊓︀" }], [0, { v: "⊔", n: 65024, o: "⊔︀" }], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { v: "⊴", n: 8402, o: "⊴⃒" }], [0, { v: "⊵", n: 8402, o: "⊵⃒" }], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { v: "⋘", n: 824, o: "⋘̸" }], [0, { v: "⋙", n: 824, o: "⋙̸" }], [0, { v: "⋚", n: 65024, o: "⋚︀" }], [0, { v: "⋛", n: 65024, o: "⋛︀" }], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { v: "⋵", n: 824, o: "⋵̸" }], [0, "⋶"], [0, "⋷"], [1, { v: "⋹", n: 824, o: "⋹̸" }], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "⟨"], [0, "⟩"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { v: "⤳", n: 824, o: "⤳̸" }], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨
1850"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { v: "⧏", n: 824, o: "⧏̸" }], [0, { v: "⧐", n: 824, o: "⧐̸" }], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { v: "⩭", n: 824, o: "⩭̸" }], [0, "⩮"], [0, "⩯"], [0, { v: "⩰", n: 824, o: "⩰̸" }], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { v: "⩽", n: 824, o: "⩽̸" }], [0, { v: "⩾", n: 824, o: "⩾̸" }], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { v: "⪡", n: 824, o: "⪡̸" }], [0, { v: "⪢", n: 824, o: "⪢̸" }], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { v: "⪬", n: 65024, o: "⪬︀" }], [0, { v: "⪭", n: 65024, o: "⪭︀" }], [0, "⪮"], [0, { v: "⪯", n: 824, o: "⪯̸" }], [0, { v: "⪰", n: 824, o: "⪰̸" }], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { v: "⫅", n: 824, o: "⫅̸" }], [0, { v: "⫆", n: 824, o: "⫆̸" }], [0, "⫇"], [0, "⫈"], [2, { v: "⫋", n: 65024, o: "⫋︀" }], [0, { v: "⫌", n: 65024, o: "⫌︀" }], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { v: "⫽", n: 8421, o: "⫽⃥" }], [44343, { n: new Map(/* #__PURE__ */ restoreDiff([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) }], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]]))); 1851//# sourceMappingURL=encode-html.js.map 1852;// ./node_modules/markdown-it/node_modules/entities/lib/esm/escape.js 1853const xmlReplacer = /["&'<>$\x80-\uFFFF]/g; 1854const xmlCodeMap = new Map([ 1855 [34, """], 1856 [38, "&"], 1857 [39, "'"], 1858 [60, "<"], 1859 [62, ">"], 1860]); 1861// For compatibility with node < 4, we wrap `codePointAt` 1862const getCodePoint = 1863// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition 1864String.prototype.codePointAt != null 1865 ? (str, index) => str.codePointAt(index) 1866 : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 1867 (c, index) => (c.charCodeAt(index) & 0xfc00) === 0xd800 1868 ? (c.charCodeAt(index) - 0xd800) * 0x400 +
1869 c.charCodeAt(index + 1) - 1870 0xdc00 + 1871 0x10000 1872 : c.charCodeAt(index); 1873/** 1874 * Encodes all non-ASCII characters, as well as characters not valid in XML 1875 * documents using XML entities. 1876 * 1877 * If a character has no equivalent entity, a 1878 * numeric hexadecimal reference (eg. `ü`) will be used. 1879 */ 1880function encodeXML(str) { 1881 let ret = ""; 1882 let lastIdx = 0; 1883 let match; 1884 while ((match = xmlReplacer.exec(str)) !== null) { 1885 const i = match.index; 1886 const char = str.charCodeAt(i); 1887 const next = xmlCodeMap.get(char); 1888 if (next !== undefined) { 1889 ret += str.substring(lastIdx, i) + next; 1890 lastIdx = i + 1; 1891 } 1892 else { 1893 ret += `${str.substring(lastIdx, i)}&#x${getCodePoint(str, i).toString(16)};`; 1894 // Increase by 1 if we have a surrogate pair 1895 lastIdx = xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800); 1896 } 1897 } 1898 return ret + str.substr(lastIdx); 1899} 1900/** 1901 * Encodes all non-ASCII characters, as well as characters not valid in XML 1902 * documents using numeric hexadecimal reference (eg. `ü`). 1903 * 1904 * Have a look at `escapeUTF8` if you want a more concise output at the expense 1905 * of reduced transportability. 1906 * 1907 * @param data String to escape. 1908 */ 1909const escape_escape = (/* unused pure expression or super */ null && (encodeXML)); 1910/** 1911 * Creates a function that escapes all characters matched by the given regular
1912 * expression using the given map of characters to escape to their entities. 1913 * 1914 * @param regex Regular expression to match characters to escape. 1915 * @param map Map of characters to escape to their entities. 1916 * 1917 * @returns Function that escapes all characters matched by the given regular 1918 * expression using the given map of characters to escape to their entities. 1919 */ 1920function getEscaper(regex, map) { 1921 return function escape(data) { 1922 let match; 1923 let lastIdx = 0; 1924 let result = ""; 1925 while ((match = regex.exec(data))) { 1926 if (lastIdx !== match.index) { 1927 result += data.substring(lastIdx, match.index); 1928 } 1929 // We know that this character will be in the map. 1930 result += map.get(match[0].charCodeAt(0)); 1931 // Every match will be of length 1 1932 lastIdx = match.index + 1; 1933 } 1934 return result + data.substring(lastIdx); 1935 }; 1936} 1937/** 1938 * Encodes all characters not valid in XML documents using XML entities. 1939 * 1940 * Note that the output will be character-set dependent. 1941 * 1942 * @param data String to escape. 1943 */ 1944const escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap); 1945/** 1946 * Encodes all characters that have to be escaped in HTML attributes, 1947 * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
1948 * 1949 * @param data String to escape. 1950 */ 1951const escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([ 1952 [34, """], 1953 [38, "&"], 1954 [160, " "], 1955])); 1956/** 1957 * Encodes all characters that have to be escaped in HTML text, 1958 * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. 1959 * 1960 * @param data String to escape. 1961 */ 1962const escapeText = getEscaper(/[&<>\u00A0]/g, new Map([ 1963 [38, "&"], 1964 [60, "<"], 1965 [62, ">"], 1966 [160, " "], 1967])); 1968//# sourceMappingURL=escape.js.map 1969;// ./node_modules/markdown-it/node_modules/entities/lib/esm/encode.js 1970/* unused harmony import specifier */ var htmlTrie; 1971/* unused harmony import specifier */ var encode_xmlReplacer; 1972/* unused harmony import specifier */ var encode_getCodePoint; 1973 1974 1975const htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g; 1976/** 1977 * Encodes all characters in the input using HTML entities. This includes 1978 * characters that are valid ASCII characters in HTML documents, such as `#`. 1979 * 1980 * To get a more compact output, consider using the `encodeNonAsciiHTML` 1981 * function, which will only encode characters that are not valid in HTML 1982 * documents, as well as non-ASCII characters. 1983 * 1984 * If a character has no equivalent entity, a numeric hexadecimal reference 1985 * (eg. `ü`) will be used. 1986 */ 1987function encodeHTML(data) { 1988 return encodeHTMLTrieRe(htmlReplacer, data); 1989} 1990/** 1991 * Encodes all non-ASCII characters, as well as characters not valid in HTML 1992 * documents using HTML entities. This function will not encode characters that 1993 * are valid in HTML documents, such as `#`. 1994 * 1995 * If a character has no equivalent entity, a numeric hexadecimal reference 1996 * (eg. `ü`) will be used. 1997 */ 1998function encodeNonAsciiHTML(data) { 1999 return encodeHTMLTrieRe(encode_xmlReplacer, data); 2000} 2001function encodeHTMLTrieRe(regExp, str) { 2002 let ret = ""; 2003 let lastIdx = 0; 2004 let match; 2005 while ((match = regExp.exec(str)) !== null) { 2006 const i = match.index; 2007 ret += str.substring(lastIdx, i); 2008 const char = str.charCodeAt(i); 2009 let next = htmlTrie.get(char); 2010 if (typeof next === "object") { 2011 // We are in a branch. Try to match the next char. 2012 if (i + 1 < str.length) { 2013 const nextChar = str.charCodeAt(i + 1); 2014 const value = typeof next.n === "number" 2015 ? next.n === nextChar 2016 ? next.o 2017 : undefined 2018 : next.n.get(nextChar); 2019 if (value !== undefined) { 2020 ret += value; 2021 lastIdx = regExp.lastIndex += 1; 2022 continue; 2023 } 2024 } 2025 next = next.v; 2026 } 2027 // We might have a tree node without a value; skip and use a numeric entity. 2028 if (next !== undefined) { 2029 ret += next; 2030 lastIdx = i + 1; 2031 } 2032 else { 2033 const cp = encode_getCodePoint(str, i); 2034 ret += `&#x${cp.toString(16)};`; 2035 // Increase by 1 if we have a surrogate pair 2036 lastIdx = regExp.lastIndex += Number(cp !== char); 2037 } 2038 } 2039 return ret + str.substr(lastIdx); 2040} 2041//# sourceMappingURL=encode.js.map 2042;// ./node_modules/markdown-it/node_modules/entities/lib/esm/index.js 2043/* unused harmony import specifier */ var esm_decodeHTML; 2044/* unused harmony import specifier */ var esm_decodeXML; 2045/* unused harmony import specifier */ var esm_DecodingMode; 2046/* unused harmony import specifier */ var esm_encodeNonAsciiHTML; 2047/* unused harmony import specifier */ var esm_encodeHTML; 2048/* unused harmony import specifier */ var esm_escapeUTF8; 2049/* unused harmony import specifier */ var esm_escapeAttribute; 2050/* unused harmony import specifier */ var esm_escapeText; 2051/* unused harmony import specifier */ var esm_encodeXML; 2052 2053 2054 2055/** The level of entities to support. */ 2056var EntityLevel; 2057(function (EntityLevel) { 2058 /** Support only XML entities. */ 2059 EntityLevel[EntityLevel["XML"] = 0] = "XML"; 2060 /** Support HTML entities, which are a superset of XML entities. */ 2061 EntityLevel[EntityLevel["HTML"] = 1] = "HTML"; 2062})(EntityLevel || (EntityLevel = {})); 2063var EncodingMode; 2064(function (EncodingMode) { 2065 /** 2066 * The output is UTF-8 encoded. Only characters that need escaping within 2067 * XML will be escaped. 2068 */ 2069 EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8"; 2070 /** 2071 * The output consists only of ASCII characters. Characters that need 2072 * escaping within HTML, and characters that aren't ASCII characters will 2073 * be escaped. 2074 */ 2075 EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII"; 2076 /** 2077 * Encode all characters that have an equivalent entity, as well as all 2078 * characters that are not ASCII characters. 2079 */ 2080 EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive"; 2081 /** 2082 * Encode all characters that have to be escaped in HTML attributes, 2083 * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
2084 */ 2085 EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute"; 2086 /** 2087 * Encode all characters that have to be escaped in HTML text, 2088 * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. 2089 */ 2090 EncodingMode[EncodingMode["Text"] = 4] = "Text"; 2091})(EncodingMode || (EncodingMode = {})); 2092/** 2093 * Decodes a string with entities. 2094 * 2095 * @param data String to decode. 2096 * @param options Decoding options. 2097 */ 2098function esm_decode(data, options = EntityLevel.XML) { 2099 const level = typeof options === "number" ? options : options.level; 2100 if (level === EntityLevel.HTML) { 2101 const mode = typeof options === "object" ? options.mode : undefined; 2102 return esm_decodeHTML(data, mode); 2103 } 2104 return esm_decodeXML(data); 2105} 2106/** 2107 * Decodes a string with entities. Does not allow missing trailing semicolons for entities. 2108 * 2109 * @param data String to decode. 2110 * @param options Decoding options. 2111 * @deprecated Use `decode` with the `mode` set to `Strict`. 2112 */ 2113function decodeStrict(data, options = EntityLevel.XML) { 2114 var _a; 2115 const opts = typeof options === "number" ? { level: options } : options; 2116 (_a = opts.mode) !== null && _a !== void 0 ? _a : (opts.mode = esm_DecodingMode.Strict); 2117 return esm_decode(data, opts); 2118} 2119/** 2120 * Encodes a string with entities. 2121 * 2122 * @param data String to encode. 2123 * @param options Encoding options. 2124 */ 2125function esm_encode(data, options = EntityLevel.XML) { 2126 const opts = typeof options === "number" ? { level: options } : options; 2127 // Mode `UTF8` just escapes XML entities 2128 if (opts.mode === EncodingMode.UTF8) 2129 return esm_escapeUTF8(data); 2130 if (opts.mode === EncodingMode.Attribute) 2131 return esm_escapeAttribute(data); 2132 if (opts.mode === EncodingMode.Text) 2133 return esm_escapeText(data); 2134 if (opts.level === EntityLevel.HTML) { 2135 if (opts.mode === EncodingMode.ASCII) { 2136 return esm_encodeNonAsciiHTML(data); 2137 } 2138 return esm_encodeHTML(data); 2139 } 2140 // ASCII and Extensive are equivalent 2141 return esm_encodeXML(data); 2142} 2143 2144 2145 2146//# sourceMappingURL=index.js.map 2147;// ./node_modules/markdown-it/lib/common/utils.mjs 2148// Utilities 2149// 2150 2151 2152 2153 2154 2155function _class (obj) { return Object.prototype.toString.call(obj) } 2156 2157function isString (obj) { return _class(obj) === '[object String]' } 2158 2159const _hasOwnProperty = Object.prototype.hasOwnProperty 2160 2161function has (object, key) { 2162 return _hasOwnProperty.call(object, key) 2163} 2164 2165// Merge objects 2166// 2167function utils_assign (obj /* from1, from2, from3, ... */) { 2168 const sources = Array.prototype.slice.call(arguments, 1) 2169 2170 sources.forEach(function (source) { 2171 if (!source) { return } 2172 2173 if (typeof source !== 'object') { 2174 throw new TypeError(source + 'must be object') 2175 } 2176 2177 Object.keys(source).forEach(function (key) { 2178 obj[key] = source[key] 2179 }) 2180 }) 2181 2182 return obj 2183} 2184 2185// Remove element from array and put another array at those position. 2186// Useful for some operations with tokens 2187function arrayReplaceAt (src, pos, newElements) { 2188 return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)) 2189} 2190 2191function isValidEntityCode (c) { 2192 /* eslint no-bitwise:0 */ 2193 // broken sequence 2194 if (c >= 0xD800 && c <= 0xDFFF) { return false } 2195 // never used 2196 if (c >= 0xFDD0 && c <= 0xFDEF) { return false } 2197 if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false } 2198 // control codes 2199 if (c >= 0x00 && c <= 0x08) { return false } 2200 if (c === 0x0B) { return false } 2201 if (c >= 0x0E && c <= 0x1F) { return false } 2202 if (c >= 0x7F && c <= 0x9F) { return false } 2203 // out of range 2204 if (c > 0x10FFFF) { return false } 2205 return true 2206} 2207 2208function utils_fromCodePoint (c) { 2209 /* eslint no-bitwise:0 */ 2210 if (c > 0xffff) { 2211 c -= 0x10000 2212 const surrogate1 = 0xd800 + (c >> 10) 2213 const surrogate2 = 0xdc00 + (c & 0x3ff) 2214 2215 return String.fromCharCode(surrogate1, surrogate2) 2216 } 2217 return String.fromCharCode(c) 2218} 2219 2220const UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g 2221const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi 2222const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi') 2223 2224const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i 2225 2226function replaceEntityPattern (match, name) { 2227 if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { 2228 const code = name[1].toLowerCase() === 'x' 2229 ? parseInt(name.slice(2), 16) 2230 : parseInt(name.slice(1), 10) 2231 2232 if (isValidEntityCode(code)) { 2233 return utils_fromCodePoint(code) 2234 } 2235 2236 return match 2237 } 2238 2239 const decoded = decodeHTML(match) 2240 if (decoded !== match) { 2241 return decoded 2242 } 2243 2244 return match 2245} 2246 2247/* function replaceEntities(str) { 2248 if (str.indexOf('&') < 0) { return str; } 2249 2250 return str.replace(ENTITY_RE, replaceEntityPattern); 2251} */ 2252 2253function unescapeMd (str) { 2254 if (str.indexOf('\\') < 0) { return str } 2255 return str.replace(UNESCAPE_MD_RE, '$1') 2256} 2257 2258function unescapeAll (str) { 2259 if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str } 2260 2261 return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) { 2262 if (escaped) { return escaped } 2263 return replaceEntityPattern(match, entity) 2264 }) 2265} 2266 2267const HTML_ESCAPE_TEST_RE = /[&<>"]/ 2268const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g 2269const HTML_REPLACEMENTS = { 2270 '&': '&', 2271 '<': '<', 2272 '>': '>', 2273 '"': '"' 2274} 2275 2276function replaceUnsafeChar (ch) { 2277 return HTML_REPLACEMENTS[ch] 2278} 2279 2280function escapeHtml (str) { 2281 if (HTML_ESCAPE_TEST_RE.test(str)) { 2282 return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar) 2283 } 2284 return str 2285} 2286 2287const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g 2288 2289function escapeRE (str) { 2290 return str.replace(REGEXP_ESCAPE_RE, '\\$&') 2291} 2292 2293function isSpace (code) { 2294 switch (code) { 2295 case 0x09: 2296 case 0x20: 2297 return true 2298 } 2299 return false 2300} 2301 2302// Zs (unicode class) || [\t\f\v\r\n] 2303function isWhiteSpace (code) { 2304 if (code >= 0x2000 && code <= 0x200A) { return true } 2305 switch (code) { 2306 case 0x09: // \t 2307 case 0x0A: // \n 2308 case 0x0B: // \v 2309 case 0x0C: // \f 2310 case 0x0D: // \r 2311 case 0x20: 2312 case 0xA0: 2313 case 0x1680: 2314 case 0x202F: 2315 case 0x205F: 2316 case 0x3000: 2317 return true 2318 } 2319 return false 2320} 2321 2322/* eslint-disable max-len */ 2323 2324// Currently without astral characters support.
2325function isPunctChar (ch) { 2326 return regex.test(ch) || S_regex.test(ch) 2327} 2328 2329function isPunctCharCode (code) { 2330 return isPunctChar(utils_fromCodePoint(code)) 2331} 2332 2333// Markdown ASCII punctuation characters. 2334// 2335// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ 2336// http://spec.commonmark.org/0.15/#ascii-punctuation-character 2337// 2338// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. 2339// 2340function isMdAsciiPunct (ch) { 2341 switch (ch) { 2342 case 0x21/* ! */: 2343 case 0x22/* " */: 2344 case 0x23/* # */: 2345 case 0x24/* $ */: 2346 case 0x25/* % */: 2347 case 0x26/* & */: 2348 case 0x27/* ' */: 2349 case 0x28/* ( */: 2350 case 0x29/* ) */: 2351 case 0x2A/* * */: 2352 case 0x2B/* + */: 2353 case 0x2C/* , */: 2354 case 0x2D/* - */: 2355 case 0x2E/* . */: 2356 case 0x2F/* / */: 2357 case 0x3A/* : */: 2358 case 0x3B/* ; */: 2359 case 0x3C/* < */: 2360 case 0x3D/* = */: 2361 case 0x3E/* > */: 2362 case 0x3F/* ? */: 2363 case 0x40/* @ */: 2364 case 0x5B/* [ */: 2365 case 0x5C/* \ */: 2366 case 0x5D/* ] */: 2367 case 0x5E/* ^ */: 2368 case 0x5F/* _ */: 2369 case 0x60/* ` */: 2370 case 0x7B/* { */: 2371 case 0x7C/* | */: 2372 case 0x7D/* } */: 2373 case 0x7E/* ~ */: 2374 return true 2375 default: 2376 return false 2377 } 2378} 2379 2380// Hepler to unify [reference labels]. 2381// 2382function normalizeReference (str) { 2383 // Trim and collapse whitespace 2384 // 2385 str = str.trim().replace(/\s+/g, ' ') 2386 2387 // In node v10 'áº'.toLowerCase() === 'á¹¾', which is presumed to be a bug 2388 // fixed in v12 (couldn't find any details). 2389 // 2390 // So treat this one as a special case 2391 // (remove this when node v10 is no longer supported). 2392 // 2393 if ('áº'.toLowerCase() === 'á¹¾') { 2394 /* c8 ignore next 2 */ 2395 str = str.replace(/áº/g, 'Ã') 2396 } 2397 2398 // .toLowerCase().toUpperCase() should get rid of all differences 2399 // between letter variants. 2400 // 2401 // Simple .toLowerCase() doesn't normalize 125 code points correctly, 2402 // and .toUpperCase doesn't normalize 6 of them (list of exceptions: 2403 // İ, Ï´, áº, â¦, âª, â« - those are already uppercased, but have differently 2404 // uppercased versions). 2405 // 2406 // Here's an example showing how it happens. Lets take greek letter omega: 2407 // uppercase U+0398 (Î), U+03f4 (Ï´) and lowercase U+03b8 (θ), U+03d1 (Ï) 2408 // 2409 // Unicode entries: 2410 // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8; 2411 // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 2412 // 03D1;GREEK THETA SYMBOL;Ll;0;L;<compat> 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 2413 // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L;<compat> 0398;;;;N;;;;03B8; 2414 // 2415 // Case-insensitive comparison should treat all of them as equivalent. 2416 // 2417 // But .toLowerCase() doesn't change Ï (it's already lowercase), 2418 // and .toUpperCase() doesn't change Ï´ (already uppercase). 2419 // 2420 // Applying first lower then upper case normalizes any character: 2421 // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398' 2422 // 2423 // Note: this is equivalent to unicode case folding; unicode normalization 2424 // is a different step that is not required here. 2425 // 2426 // Final result should be uppercased, because it's later stored in an object 2427 // (this avoid a conflict with Object.prototype members, 2428 // most notably, `__proto__`) 2429 // 2430 return str.toLowerCase().toUpperCase() 2431} 2432 2433function isAsciiTrimmable (c) { 2434 return c === 0x20 || c === 0x09 || c === 0x0a || c === 0x0d 2435} 2436 2437// "Light" .trim() for blocks (headers, paragraphs), where unicode spaces 2438// should be preserved. 2439function asciiTrim (str) { 2440 let start = 0 2441 for (; start < str.length; start++) { 2442 if (!isAsciiTrimmable(str.charCodeAt(start))) { 2443 break 2444 } 2445 } 2446 let end = str.length - 1 2447 for (; end >= start; end--) { 2448 if (!isAsciiTrimmable(str.charCodeAt(end))) { 2449 break 2450 } 2451 } 2452 return str.slice(start, end + 1) 2453} 2454 2455// Re-export libraries commonly used in both markdown-it and its plugins, 2456// so plugins won't have to depend on them explicitly, which reduces their 2457// bundled size (e.g. a browser build). 2458// 2459const lib = { mdurl: mdurl_namespaceObject, ucmicro: uc_micro_namespaceObject } 2460 2461 2462 2463;// ./node_modules/markdown-it/lib/helpers/parse_link_label.mjs 2464// Parse link label 2465// 2466// this function assumes that first character ("[") already matches; 2467// returns the end of the label 2468// 2469 2470function parseLinkLabel (state, start, disableNested) { 2471 let level, found, marker, prevPos 2472 2473 const max = state.posMax 2474 const oldPos = state.pos 2475 2476 state.pos = start + 1 2477 level = 1 2478 2479 while (state.pos < max) {
2480 marker = state.src.charCodeAt(state.pos) 2481 if (marker === 0x5D /* ] */) { 2482 level-- 2483 if (level === 0) { 2484 found = true 2485 break 2486 } 2487 } 2488 2489 prevPos = state.pos 2490 state.md.inline.skipToken(state) 2491 if (marker === 0x5B /* [ */) { 2492 if (prevPos === state.pos - 1) { 2493 // increase level if we find text `[`, which is not a part of any token 2494 level++ 2495 } else if (disableNested) { 2496 state.pos = oldPos 2497 return -1 2498 } 2499 } 2500 } 2501 2502 let labelEnd = -1 2503 2504 if (found) { 2505 labelEnd = state.pos 2506 } 2507 2508 // restore old state 2509 state.pos = oldPos 2510 2511 return labelEnd 2512} 2513 2514;// ./node_modules/markdown-it/lib/helpers/parse_link_destination.mjs 2515// Parse link destination 2516// 2517 2518 2519 2520function parseLinkDestination (str, start, max) { 2521 let code 2522 let pos = start 2523 2524 const result = { 2525 ok: false, 2526 pos: 0, 2527 str: '' 2528 } 2529 2530 if (str.charCodeAt(pos) === 0x3C /* < */) { 2531 pos++ 2532 while (pos < max) { 2533 code = str.charCodeAt(pos) 2534 if (code === 0x0A /* \n */) { return result } 2535 if (code === 0x3C /* < */) { return result } 2536 if (code === 0x3E /* > */) { 2537 result.pos = pos + 1 2538 result.str = unescapeAll(str.slice(start + 1, pos)) 2539 result.ok = true 2540 return result 2541 } 2542 if (code === 0x5C /* \ */ && pos + 1 < max) { 2543 pos += 2 2544 continue 2545 } 2546 2547 pos++ 2548 } 2549 2550 // no closing '>' 2551 return result 2552 } 2553 2554 // this should be ... } else { ... branch 2555 2556 let level = 0 2557 while (pos < max) { 2558 code = str.charCodeAt(pos) 2559 2560 if (code === 0x20) { break } 2561 2562 // ascii control characters 2563 if (code < 0x20 || code === 0x7F) { break } 2564 2565 if (code === 0x5C /* \ */ && pos + 1 < max) { 2566 if (str.charCodeAt(pos + 1) === 0x20) { break } 2567 pos += 2 2568 continue 2569 } 2570 2571 if (code === 0x28 /* ( */) { 2572 level++ 2573 if (level > 32) { return result } 2574 } 2575 2576 if (code === 0x29 /* ) */) { 2577 if (level === 0) { break } 2578 level-- 2579 } 2580 2581 pos++ 2582 } 2583 2584 if (start === pos) { return result } 2585 if (level !== 0) { return result } 2586 2587 result.str = unescapeAll(str.slice(start, pos)) 2588 result.pos = pos 2589 result.ok = true 2590 return result 2591} 2592 2593;// ./node_modules/markdown-it/lib/helpers/parse_link_title.mjs 2594// Parse link title 2595// 2596 2597 2598 2599// Parse link title within `str` in [start, max] range, 2600// or continue previous parsing if `prev_state` is defined (equal to result of last execution). 2601// 2602function parseLinkTitle (str, start, max, prev_state) { 2603 let code 2604 let pos = start 2605 2606 const state = { 2607 // if `true`, this is a valid link title 2608 ok: false, 2609 // if `true`, this link can be continued on the next line 2610 can_continue: false, 2611 // if `ok`, it's the position of the first character after the closing marker 2612 pos: 0, 2613 // if `ok`, it's the unescaped title 2614 str: '', 2615 // expected closing marker character code 2616 marker: 0 2617 } 2618 2619 if (prev_state) { 2620 // this is a continuation of a previous parseLinkTitle call on the next line, 2621 // used in reference links only 2622 state.str = prev_state.str 2623 state.marker = prev_state.marker 2624 } else { 2625 if (pos >= max) { return state } 2626 2627 let marker = str.charCodeAt(pos) 2628 if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return state } 2629 2630 start++ 2631 pos++ 2632 2633 // if opening marker is "(", switch it to closing marker ")" 2634 if (marker === 0x28) { marker = 0x29 } 2635 2636 state.marker = marker 2637 } 2638 2639 while (pos < max) { 2640 code = str.charCodeAt(pos) 2641 if (code === state.marker) { 2642 state.pos = pos + 1 2643 state.str += unescapeAll(str.slice(start, pos)) 2644 state.ok = true 2645 return state 2646 } else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) { 2647 return state 2648 } else if (code === 0x5C /* \ */ && pos + 1 < max) { 2649 pos++ 2650 } 2651 2652 pos++ 2653 } 2654 2655 // no closing marker found, but this link title may continue on the next line (for references) 2656 state.can_continue = true 2657 state.str += unescapeAll(str.slice(start, pos)) 2658 return state 2659} 2660 2661;// ./node_modules/markdown-it/lib/helpers/index.mjs 2662// Just a shortcut for bulk export 2663 2664 2665 2666 2667 2668 2669 2670;// ./node_modules/markdown-it/lib/renderer.mjs 2671/** 2672 * class Renderer 2673 * 2674 * Generates HTML from parsed token stream. Each instance has independent 2675 * copy of rules. Those can be rewritten with ease. Also, you can add new 2676 * rules if you create plugin and adds new token types. 2677 **/ 2678 2679 2680 2681const default_rules = {} 2682 2683default_rules.code_inline = function (tokens, idx, options, env, slf) { 2684 const token = tokens[idx] 2685 2686 return '<code' + slf.renderAttrs(token) + '>' + 2687 escapeHtml(token.content) + 2688 '</code>' 2689} 2690 2691default_rules.code_block = function (tokens, idx, options, env, slf) { 2692 const token = tokens[idx] 2693 2694 return '<pre' + slf.renderAttrs(token) + '><code>' + 2695 escapeHtml(tokens[idx].content) + 2696 '</code></pre>\n' 2697} 2698 2699default_rules.fence = function (tokens, idx, options, env, slf) { 2700 const token = tokens[idx] 2701 const info = token.info ? unescapeAll(token.info).trim() : '' 2702 let langName = '' 2703 let langAttrs = '' 2704 2705 if (info) { 2706 const arr = info.split(/(\s+)/g) 2707 langName = arr[0] 2708 langAttrs = arr.slice(2).join('') 2709 } 2710 2711 let highlighted 2712 if (options.highlight) { 2713 highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content) 2714 } else { 2715 highlighted = escapeHtml(token.content) 2716 } 2717 2718 if (highlighted.indexOf('<pre') === 0) { 2719 return highlighted + '\n'
2720 } 2721 2722 // If language exists, inject class gently, without modifying original token. 2723 // May be, one day we will add .deepClone() for token and simplify this part, but 2724 // now we prefer to keep things local. 2725 if (info) { 2726 const i = token.attrIndex('class') 2727 const tmpAttrs = token.attrs ? token.attrs.slice() : [] 2728 2729 if (i < 0) { 2730 tmpAttrs.push(['class', options.langPrefix + langName]) 2731 } else { 2732 tmpAttrs[i] = tmpAttrs[i].slice() 2733 tmpAttrs[i][1] += ' ' + options.langPrefix + langName 2734 } 2735 2736 // Fake token just to render attributes 2737 const tmpToken = { 2738 attrs: tmpAttrs 2739 } 2740 2741 return `<pre><code${slf.renderAttrs(tmpToken)}>${highlighted}</code></pre>\n` 2742 } 2743 2744 return `<pre><code${slf.renderAttrs(token)}>${highlighted}</code></pre>\n` 2745} 2746 2747default_rules.image = function (tokens, idx, options, env, slf) { 2748 const token = tokens[idx] 2749 2750 // "alt" attr MUST be set, even if empty. Because it's mandatory and 2751 // should be placed on proper position for tests. 2752 // 2753 // Replace content with actual value 2754 2755 token.attrs[token.attrIndex('alt')][1] = 2756 slf.renderInlineAsText(token.children, options, env) 2757 2758 return slf.renderToken(tokens, idx, options) 2759} 2760 2761default_rules.hardbreak = function (tokens, idx, options /*, env */) { 2762 return options.xhtmlOut ? '<br />\n' : '<br>\n' 2763} 2764default_rules.softbreak = function (tokens, idx, options /*, env */) { 2765 return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n' 2766} 2767 2768default_rules.text = function (tokens, idx /*, options, env */) { 2769 return escapeHtml(tokens[idx].content) 2770} 2771 2772default_rules.html_block = function (tokens, idx /*, options, env */) { 2773 return tokens[idx].content 2774} 2775default_rules.html_inline = function (tokens, idx /*, options, env */) { 2776 return tokens[idx].content 2777} 2778 2779/** 2780 * new Renderer() 2781 * 2782 * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults. 2783 **/ 2784function Renderer () { 2785 /** 2786 * Renderer#rules -> Object 2787 * 2788 * Contains render rules for tokens. Can be updated and extended. 2789 * 2790 * ##### Example 2791 * 2792 * ```javascript 2793 * var md = require('markdown-it')(); 2794 * 2795 * md.renderer.rules.strong_open = function () { return '<b>'; }; 2796 * md.renderer.rules.strong_close = function () { return '</b>'; }; 2797 * 2798 * var result = md.renderInline(...); 2799 * ``` 2800 * 2801 * Each rule is called as independent static function with fixed signature: 2802 * 2803 * ```javascript 2804 * function my_token_render(tokens, idx, options, env, renderer) { 2805 * // ... 2806 * return renderedHTML; 2807 * } 2808 * ``` 2809 * 2810 * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs) 2811 * for more details and examples. 2812 **/ 2813 this.rules = utils_assign({}, default_rules) 2814} 2815 2816/** 2817 * Renderer.renderAttrs(token) -> String 2818 * 2819 * Render token attributes to string. 2820 **/ 2821Renderer.prototype.renderAttrs = function renderAttrs (token) { 2822 let i, l, result 2823 2824 if (!token.attrs) { return '' } 2825 2826 result = '' 2827 2828 for (i = 0, l = token.attrs.length; i < l; i++) { 2829 result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"' 2830 } 2831 2832 return result 2833} 2834 2835/** 2836 * Renderer.renderToken(tokens, idx, options) -> String 2837 * - tokens (Array): list of tokens 2838 * - idx (Numbed): token index to render 2839 * - options (Object): params of parser instance 2840 * 2841 * Default token renderer. Can be overriden by custom function 2842 * in [[Renderer#rules]]. 2843 **/ 2844Renderer.prototype.renderToken = function renderToken (tokens, idx, options) { 2845 const token = tokens[idx] 2846 let result = '' 2847 2848 // Tight list paragraphs 2849 if (token.hidden) { 2850 return '' 2851 } 2852 2853 // Insert a newline between hidden paragraph and subsequent opening 2854 // block-level tag. 2855 // 2856 // For example, here we should insert a newline before blockquote: 2857 // - a 2858 // > 2859 // 2860 if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) { 2861 result += '\n' 2862 } 2863 2864 // Add token name, e.g. `<img` 2865 result += (token.nesting === -1 ? '</' : '<') + token.tag 2866 2867 // Encode attributes, e.g. `<img src="foo"` 2868 result += this.renderAttrs(token) 2869 2870 // Add a slash for self-closing tags, e.g. `<img src="foo" /` 2871 if (token.nesting === 0 && options.xhtmlOut) { 2872 result += ' /' 2873 } 2874 2875 // Check if we need to add a newline after this tag 2876 let needLf = false 2877 if (token.block) { 2878 needLf = true 2879 2880 if (token.nesting === 1) { 2881 if (idx + 1 < tokens.length) { 2882 const nextToken = tokens[idx + 1] 2883 2884 if (nextToken.type === 'inline' || nextToken.hidden) { 2885 // Block-level tag containing an inline tag. 2886 // 2887 needLf = false 2888 } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) { 2889 // Opening tag + closing tag of the same type. E.g. `<li></li>`. 2890 // 2891 needLf = false 2892 } 2893 } 2894 } 2895 } 2896 2897 result += needLf ? '>\n' : '>' 2898 2899 return result 2900} 2901 2902/** 2903 * Renderer.renderInline(tokens, options, env) -> String 2904 * - tokens (Array): list on block tokens to render 2905 * - options (Object): params of parser instance 2906 * - env (Object): additional data from parsed input (references, for example) 2907 * 2908 * The same as [[Renderer.render]], but for single token of `inline` type. 2909 **/ 2910Renderer.prototype.renderInline = function (tokens, options, env) { 2911 let result = '' 2912 const rules = this.rules 2913 2914 for (let i = 0, len = tokens.length; i < len; i++) { 2915 const type = tokens[i].type 2916 2917 if (typeof rules[type] !== 'undefined') { 2918 result += rules[type](tokens, i, options, env, this) 2919 } else { 2920 result += this.renderToken(tokens, i, options) 2921 } 2922 } 2923 2924 return result 2925} 2926 2927/** internal 2928 * Renderer.renderInlineAsText(tokens, options, env) -> String 2929 * - tokens (Array): list on block tokens to render 2930 * - options (Object): params of parser instance 2931 * - env (Object): additional data from parsed input (references, for example) 2932 * 2933 * Special kludge for image `alt` attributes to conform CommonMark spec. 2934 * Don't try to use it! Spec requires to show `alt` content with stripped markup, 2935 * instead of simple escaping. 2936 **/ 2937Renderer.prototype.renderInlineAsText = function (tokens, options, env) { 2938 let result = '' 2939 2940 for (let i = 0, len = tokens.length; i < len; i++) { 2941 switch (tokens[i].type) { 2942 case 'text': 2943 result += tokens[i].content 2944 break 2945 case 'image': 2946 result += this.renderInlineAsText(tokens[i].children, options, env) 2947 break 2948 case 'html_inline': 2949 case 'html_block': 2950 result += tokens[i].content 2951 break 2952 case 'softbreak': 2953 case 'hardbreak': 2954 result += '\n' 2955 break 2956 default: 2957 // all other tokens are skipped 2958 } 2959 } 2960 2961 return result 2962} 2963 2964/** 2965 * Renderer.render(tokens, options, env) -> String 2966 * - tokens (Array): list on block tokens to render 2967 * - options (Object): params of parser instance 2968 * - env (Object): additional data from parsed input (references, for example) 2969 * 2970 * Takes token stream and generates HTML. Probably, you will never need to call 2971 * this method directly. 2972 **/ 2973Renderer.prototype.render = function (tokens, options, env) { 2974 let result = '' 2975 const rules = this.rules 2976 2977 for (let i = 0, len = tokens.length; i < len; i++) { 2978 const type = tokens[i].type 2979 2980 if (type === 'inline') { 2981 result += this.renderInline(tokens[i].children, options, env) 2982 } else if (typeof rules[type] !== 'undefined') { 2983 result += rules[type](tokens, i, options, env, this) 2984 } else { 2985 result += this.renderToken(tokens, i, options, env) 2986 } 2987 } 2988 2989 return result 2990} 2991 2992/* harmony default export */ const renderer = (Renderer); 2993 2994;// ./node_modules/markdown-it/lib/ruler.mjs 2995/** 2996 * class Ruler 2997 * 2998 * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and 2999 * [[MarkdownIt#inline]] to manage sequences of functions (rules): 3000 * 3001 * - keep rules in defined order 3002 * - assign the name to each rule 3003 * - enable/disable rules 3004 * - add/replace rules 3005 * - allow assign rules to additional named chains (in the same) 3006 * - cacheing lists of active rules 3007 * 3008 * You will not need use this class directly until write plugins. For simple 3009 * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and 3010 * [[MarkdownIt.use]]. 3011 **/ 3012 3013/** 3014 * new Ruler() 3015 **/ 3016function Ruler () { 3017 // List of added rules. Each element is: 3018 // 3019 // { 3020 // name: XXX, 3021 // enabled: Boolean, 3022 // fn: Function(), 3023 // alt: [ name2, name3 ] 3024 // } 3025 // 3026 this.__rules__ = [] 3027 3028 // Cached rule chains. 3029 // 3030 // First level - chain name, '' for default. 3031 // Second level - diginal anchor for fast filtering by charcodes. 3032 // 3033 this.__cache__ = null 3034} 3035 3036// Helper methods, should not be used directly 3037 3038// Find rule index by name
3039// 3040Ruler.prototype.__find__ = function (name) { 3041 for (let i = 0; i < this.__rules__.length; i++) { 3042 if (this.__rules__[i].name === name) { 3043 return i 3044 } 3045 } 3046 return -1 3047} 3048 3049// Build rules lookup cache 3050// 3051Ruler.prototype.__compile__ = function () { 3052 const self = this 3053 const chains = [''] 3054 3055 // collect unique names 3056 self.__rules__.forEach(function (rule) { 3057 if (!rule.enabled) { return } 3058 3059 rule.alt.forEach(function (altName) { 3060 if (chains.indexOf(altName) < 0) { 3061 chains.push(altName) 3062 } 3063 }) 3064 }) 3065 3066 self.__cache__ = {} 3067 3068 chains.forEach(function (chain) { 3069 self.__cache__[chain] = [] 3070 self.__rules__.forEach(function (rule) { 3071 if (!rule.enabled) { return } 3072 3073 if (chain && rule.alt.indexOf(chain) < 0) { return } 3074 3075 self.__cache__[chain].push(rule.fn) 3076 }) 3077 }) 3078} 3079 3080/** 3081 * Ruler.at(name, fn [, options]) 3082 * - name (String): rule name to replace. 3083 * - fn (Function): new rule function. 3084 * - options (Object): new rule options (not mandatory). 3085 * 3086 * Replace rule by name with new function & options. Throws error if name not 3087 * found. 3088 * 3089 * ##### Options: 3090 * 3091 * - __alt__ - array with names of "alternate" chains. 3092 * 3093 * ##### Example 3094 * 3095 * Replace existing typographer replacement rule with new one: 3096 * 3097 * ```javascript 3098 * var md = require('markdown-it')(); 3099 * 3100 * md.core.ruler.at('replacements', function replace(state) { 3101 * //... 3102 * }); 3103 * ``` 3104 **/ 3105Ruler.prototype.at = function (name, fn, options) { 3106 const index = this.__find__(name) 3107 const opt = options || {} 3108 3109 if (index === -1) { throw new Error('Parser rule not found: ' + name) } 3110 3111 this.__rules__[index].fn = fn 3112 this.__rules__[index].alt = opt.alt || [] 3113 this.__cache__ = null 3114} 3115 3116/** 3117 * Ruler.before(beforeName, ruleName, fn [, options]) 3118 * - beforeName (String): new rule will be added before this one. 3119 * - ruleName (String): name of added rule. 3120 * - fn (Function): rule function. 3121 * - options (Object): rule options (not mandatory). 3122 * 3123 * Add new rule to chain before one with given name. See also 3124 * [[Ruler.after]], [[Ruler.push]]. 3125 * 3126 * ##### Options: 3127 * 3128 * - __alt__ - array with names of "alternate" chains. 3129 * 3130 * ##### Example 3131 * 3132 * ```javascript 3133 * var md = require('markdown-it')(); 3134 * 3135 * md.block.ruler.before('paragraph', 'my_rule', function replace(state) { 3136 * //... 3137 * }); 3138 * ``` 3139 **/ 3140Ruler.prototype.before = function (beforeName, ruleName, fn, options) { 3141 const index = this.__find__(beforeName) 3142 const opt = options || {} 3143 3144 if (index === -1) { throw new Error('Parser rule not found: ' + beforeName) } 3145 3146 this.__rules__.splice(index, 0, { 3147 name: ruleName, 3148 enabled: true, 3149 fn, 3150 alt: opt.alt || [] 3151 }) 3152 3153 this.__cache__ = null 3154} 3155 3156/** 3157 * Ruler.after(afterName, ruleName, fn [, options]) 3158 * - afterName (String): new rule will be added after this one. 3159 * - ruleName (String): name of added rule. 3160 * - fn (Function): rule function. 3161 * - options (Object): rule options (not mandatory). 3162 * 3163 * Add new rule to chain after one with given name. See also 3164 * [[Ruler.before]], [[Ruler.push]]. 3165 * 3166 * ##### Options: 3167 * 3168 * - __alt__ - array with names of "alternate" chains. 3169 * 3170 * ##### Example 3171 * 3172 * ```javascript 3173 * var md = require('markdown-it')(); 3174 * 3175 * md.inline.ruler.after('text', 'my_rule', function replace(state) { 3176 * //... 3177 * }); 3178 * ``` 3179 **/ 3180Ruler.prototype.after = function (afterName, ruleName, fn, options) { 3181 const index = this.__find__(afterName) 3182 const opt = options || {} 3183 3184 if (index === -1) { throw new Error('Parser rule not found: ' + afterName) } 3185 3186 this.__rules__.splice(index + 1, 0, { 3187 name: ruleName, 3188 enabled: true, 3189 fn, 3190 alt: opt.alt || [] 3191 }) 3192 3193 this.__cache__ = null 3194} 3195 3196/** 3197 * Ruler.push(ruleName, fn [, options]) 3198 * - ruleName (String): name of added rule. 3199 * - fn (Function): rule function. 3200 * - options (Object): rule options (not mandatory). 3201 * 3202 * Push new rule to the end of chain. See also 3203 * [[Ruler.before]], [[Ruler.after]]. 3204 * 3205 * ##### Options: 3206 * 3207 * - __alt__ - array with names of "alternate" chains. 3208 * 3209 * ##### Example 3210 * 3211 * ```javascript 3212 * var md = require('markdown-it')(); 3213 * 3214 * md.core.ruler.push('my_rule', function replace(state) { 3215 * //... 3216 * }); 3217 * ``` 3218 **/ 3219Ruler.prototype.push = function (ruleName, fn, options) { 3220 const opt = options || {} 3221 3222 this.__rules__.push({ 3223 name: ruleName, 3224 enabled: true, 3225 fn, 3226 alt: opt.alt || [] 3227 }) 3228 3229 this.__cache__ = null 3230} 3231
3232/** 3233 * Ruler.enable(list [, ignoreInvalid]) -> Array 3234 * - list (String|Array): list of rule names to enable. 3235 * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. 3236 * 3237 * Enable rules with given names. If any rule name not found - throw Error. 3238 * Errors can be disabled by second param. 3239 * 3240 * Returns list of found rule names (if no exception happened). 3241 * 3242 * See also [[Ruler.disable]], [[Ruler.enableOnly]]. 3243 **/ 3244Ruler.prototype.enable = function (list, ignoreInvalid) { 3245 if (!Array.isArray(list)) { list = [list] } 3246 3247 const result = [] 3248 3249 // Search by name and enable 3250 list.forEach(function (name) { 3251 const idx = this.__find__(name) 3252 3253 if (idx < 0) { 3254 if (ignoreInvalid) { return } 3255 throw new Error('Rules manager: invalid rule name ' + name) 3256 } 3257 this.__rules__[idx].enabled = true 3258 result.push(name) 3259 }, this) 3260 3261 this.__cache__ = null 3262 return result 3263} 3264 3265/** 3266 * Ruler.enableOnly(list [, ignoreInvalid]) 3267 * - list (String|Array): list of rule names to enable (whitelist). 3268 * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. 3269 * 3270 * Enable rules with given names, and disable everything else. If any rule name 3271 * not found - throw Error. Errors can be disabled by second param. 3272 * 3273 * See also [[Ruler.disable]], [[Ruler.enable]]. 3274 **/ 3275Ruler.prototype.enableOnly = function (list, ignoreInvalid) { 3276 if (!Array.isArray(list)) { list = [list] } 3277 3278 this.__rules__.forEach(function (rule) { rule.enabled = false }) 3279 3280 this.enable(list, ignoreInvalid) 3281} 3282 3283/** 3284 * Ruler.disable(list [, ignoreInvalid]) -> Array 3285 * - list (String|Array): list of rule names to disable. 3286 * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. 3287 * 3288 * Disable rules with given names. If any rule name not found - throw Error. 3289 * Errors can be disabled by second param. 3290 * 3291 * Returns list of found rule names (if no exception happened). 3292 * 3293 * See also [[Ruler.enable]], [[Ruler.enableOnly]]. 3294 **/ 3295Ruler.prototype.disable = function (list, ignoreInvalid) { 3296 if (!Array.isArray(list)) { list = [list] } 3297 3298 const result = [] 3299 3300 // Search by name and disable 3301 list.forEach(function (name) { 3302 const idx = this.__find__(name) 3303 3304 if (idx < 0) { 3305 if (ignoreInvalid) { return } 3306 throw new Error('Rules manager: invalid rule name ' + name) 3307 } 3308 this.__rules__[idx].enabled = false 3309 result.push(name) 3310 }, this) 3311 3312 this.__cache__ = null 3313 return result 3314} 3315 3316/** 3317 * Ruler.getRules(chainName) -> Array 3318 * 3319 * Return array of active functions (rules) for given chain name. It analyzes 3320 * rules configuration, compiles caches if not exists and returns result. 3321 * 3322 * Default chain name is `''` (empty string). It can't be skipped. That's 3323 * done intentionally, to keep signature monomorphic for high speed. 3324 **/ 3325Ruler.prototype.getRules = function (chainName) { 3326 if (this.__cache__ === null) { 3327 this.__compile__() 3328 } 3329 3330 // Chain can be empty, if rules disabled. But we still have to return Array. 3331 return this.__cache__[chainName] || [] 3332} 3333 3334/* harmony default export */ const ruler = (Ruler); 3335 3336;// ./node_modules/markdown-it/lib/token.mjs 3337// Token class 3338 3339/** 3340 * class Token 3341 **/ 3342 3343/** 3344 * new Token(type, tag, nesting) 3345 * 3346 * Create new token and fill passed properties. 3347 **/ 3348function Token (type, tag, nesting) { 3349 /** 3350 * Token#type -> String 3351 * 3352 * Type of the token (string, e.g. "paragraph_open") 3353 **/ 3354 this.type = type 3355 3356 /** 3357 * Token#tag -> String 3358 * 3359 * html tag name, e.g. "p" 3360 **/ 3361 this.tag = tag 3362 3363 /** 3364 * Token#attrs -> Array 3365 * 3366 * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` 3367 **/ 3368 this.attrs = null 3369 3370 /** 3371 * Token#map -> Array 3372 * 3373 * Source map info. Format: `[ line_begin, line_end ]` 3374 **/ 3375 this.map = null 3376 3377 /** 3378 * Token#nesting -> Number 3379 * 3380 * Level change (number in {-1, 0, 1} set), where: 3381 * 3382 * - `1` means the tag is opening 3383 * - `0` means the tag is self-closing 3384 * - `-1` means the tag is closing 3385 **/ 3386 this.nesting = nesting 3387 3388 /** 3389 * Token#level -> Number 3390 * 3391 * nesting level, the same as `state.level` 3392 **/ 3393 this.level = 0 3394 3395 /** 3396 * Token#children -> Array 3397 * 3398 * An array of child nodes (inline and img tokens) 3399 **/ 3400 this.children = null 3401 3402 /** 3403 * Token#content -> String 3404 * 3405 * In a case of self-closing tag (code, html, fence, etc.), 3406 * it has contents of this tag. 3407 **/ 3408 this.content = '' 3409 3410 /** 3411 * Token#markup -> String 3412 * 3413 * '*' or '_' for emphasis, fence string for fence, etc. 3414 **/ 3415 this.markup = '' 3416 3417 /** 3418 * Token#info -> String 3419 * 3420 * Additional information: 3421 * 3422 * - Info string for "fence" tokens 3423 * - The value "auto" for autolink "link_open" and "link_close" tokens 3424 * - The string value of the item marker for ordered-list "list_item_open" tokens 3425 **/ 3426 this.info = '' 3427 3428 /** 3429 * Token#meta -> Object 3430 * 3431 * A place for plugins to store an arbitrary data 3432 **/ 3433 this.meta = null 3434 3435 /** 3436 * Token#block -> Boolean 3437 * 3438 * True for block-level tokens, false for inline tokens. 3439 * Used in renderer to calculate line breaks 3440 **/ 3441 this.block = false 3442 3443 /** 3444 * Token#hidden -> Boolean 3445 * 3446 * If it's true, ignore this element when rendering. Used for tight lists 3447 * to hide paragraphs. 3448 **/ 3449 this.hidden = false 3450} 3451 3452/** 3453 * Token.attrIndex(name) -> Number 3454 * 3455 * Search attribute index by name. 3456 **/ 3457Token.prototype.attrIndex = function attrIndex (name) { 3458 if (!this.attrs) { return -1 } 3459 3460 const attrs = this.attrs 3461 3462 for (let i = 0, len = attrs.length; i < len; i++) { 3463 if (attrs[i][0] === name) { return i } 3464 } 3465 return -1 3466} 3467 3468/** 3469 * Token.attrPush(attrData) 3470 * 3471 * Add `[ name, value ]` attribute to list. Init attrs if necessary 3472 **/ 3473Token.prototype.attrPush = function attrPush (attrData) { 3474 if (this.attrs) { 3475 this.attrs.push(attrData) 3476 } else { 3477 this.attrs = [attrData] 3478 } 3479} 3480 3481/** 3482 * Token.attrSet(name, value) 3483 * 3484 * Set `name` attribute to `value`. Override old value if exists. 3485 **/
3486Token.prototype.attrSet = function attrSet (name, value) { 3487 const idx = this.attrIndex(name) 3488 const attrData = [name, value] 3489 3490 if (idx < 0) { 3491 this.attrPush(attrData) 3492 } else { 3493 this.attrs[idx] = attrData 3494 } 3495} 3496 3497/** 3498 * Token.attrGet(name) 3499 * 3500 * Get the value of attribute `name`, or null if it does not exist. 3501 **/ 3502Token.prototype.attrGet = function attrGet (name) { 3503 const idx = this.attrIndex(name) 3504 let value = null 3505 if (idx >= 0) { 3506 value = this.attrs[idx][1] 3507 } 3508 return value 3509} 3510 3511/** 3512 * Token.attrJoin(name, value) 3513 * 3514 * Join value to existing attribute via space. Or create new attribute if not 3515 * exists. Useful to operate with token classes. 3516 **/ 3517Token.prototype.attrJoin = function attrJoin (name, value) { 3518 const idx = this.attrIndex(name) 3519 3520 if (idx < 0) { 3521 this.attrPush([name, value]) 3522 } else { 3523 this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value 3524 } 3525} 3526 3527/* harmony default export */ const lib_token = (Token); 3528 3529;// ./node_modules/markdown-it/lib/rules_core/state_core.mjs 3530// Core state object 3531// 3532 3533 3534 3535function StateCore (src, md, env) { 3536 this.src = src 3537 this.env = env 3538 this.tokens = [] 3539 this.inlineMode = false 3540 this.md = md // link to parser instance 3541} 3542 3543// re-export Token class to use in core rules 3544StateCore.prototype.Token = lib_token 3545 3546/* harmony default export */ const state_core = (StateCore); 3547 3548;// ./node_modules/markdown-it/lib/rules_core/normalize.mjs 3549// Normalize input string 3550 3551// https://spec.commonmark.org/0.29/#line-ending 3552const NEWLINES_RE = /\r\n?|\n/g 3553const NULL_RE = /\0/g 3554 3555function normalize (state) { 3556 let str 3557 3558 // Normalize newlines 3559 str = state.src.replace(NEWLINES_RE, '\n') 3560 3561 // Replace NULL characters 3562 str = str.replace(NULL_RE, '\uFFFD') 3563 3564 state.src = str 3565} 3566 3567;// ./node_modules/markdown-it/lib/rules_core/block.mjs 3568function block (state) { 3569 let token 3570 3571 if (state.inlineMode) { 3572 token = new state.Token('inline', '', 0) 3573 token.content = state.src 3574 token.map = [0, 1] 3575 token.children = [] 3576 state.tokens.push(token) 3577 } else { 3578 state.md.block.parse(state.src, state.md, state.env, state.tokens) 3579 } 3580} 3581 3582;// ./node_modules/markdown-it/lib/rules_core/inline.mjs 3583function inline (state) { 3584 const tokens = state.tokens 3585 3586 // Parse inlines 3587 for (let i = 0, l = tokens.length; i < l; i++) { 3588 const tok = tokens[i] 3589 if (tok.type === 'inline') { 3590 state.md.inline.parse(tok.content, state.md, state.env, tok.children) 3591 } 3592 } 3593} 3594 3595;// ./node_modules/markdown-it/lib/rules_core/linkify.mjs 3596// Replace link-like texts with link nodes. 3597// 3598// Currently restricted by `md.validateLink()` to http/https/ftp 3599// 3600 3601 3602 3603function isLinkOpen (str) { 3604 return /^<a[>\s]/i.test(str) 3605} 3606function isLinkClose (str) { 3607 return /^<\/a\s*>/i.test(str) 3608} 3609 3610function linkify (state) { 3611 const blockTokens = state.tokens 3612 3613 if (!state.md.options.linkify) { return } 3614 3615 for (let j = 0, l = blockTokens.length; j < l; j++) { 3616 if (blockTokens[j].type !== 'inline' || 3617 !state.md.linkify.pretest(blockTokens[j].content)) { 3618 continue 3619 } 3620 3621 let tokens = blockTokens[j].children 3622 3623 let htmlLinkLevel = 0 3624 3625 // We scan from the end, to keep position when new tags added. 3626 // Use reversed logic in links start/end match 3627 for (let i = tokens.length - 1; i >= 0; i--) { 3628 const currentToken = tokens[i] 3629 3630 // Skip content of markdown links 3631 if (currentToken.type === 'link_close') { 3632 i-- 3633 while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') { 3634 i-- 3635 } 3636 continue 3637 } 3638 3639 // Skip content of html tag links 3640 if (currentToken.type === 'html_inline') { 3641 if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) { 3642 htmlLinkLevel-- 3643 } 3644 if (isLinkClose(currentToken.content)) { 3645 htmlLinkLevel++ 3646 } 3647 } 3648 if (htmlLinkLevel > 0) { continue } 3649 3650 if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) { 3651 const text = currentToken.content 3652 let links = state.md.linkify.match(text) 3653 3654 // Now split string to nodes 3655 const nodes = [] 3656 let level = currentToken.level
3657 let lastPos = 0 3658 3659 // forbid escape sequence at the start of the string, 3660 // this avoids http\://example.com/ from being linkified as 3661 // http:<a href="//example.com/">//example.com/</a> 3662 if (links.length > 0 && 3663 links[0].index === 0 && 3664 i > 0 && 3665 tokens[i - 1].type === 'text_special') { 3666 links = links.slice(1) 3667 } 3668 3669 for (let ln = 0; ln < links.length; ln++) { 3670 const url = links[ln].url 3671 const fullUrl = state.md.normalizeLink(url) 3672 if (!state.md.validateLink(fullUrl)) { continue } 3673 3674 let urlText = links[ln].text 3675 3676 // Linkifier might send raw hostnames like "example.com", where url 3677 // starts with domain name. So we prepend http:// in those cases, 3678 // and remove it afterwards. 3679 // 3680 if (!links[ln].schema) { 3681 urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '') 3682 } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) { 3683 urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '') 3684 } else { 3685 urlText = state.md.normalizeLinkText(urlText) 3686 } 3687 3688 const pos = links[ln].index 3689 3690 if (pos > lastPos) { 3691 const token = new state.Token('text', '', 0) 3692 token.content = text.slice(lastPos, pos) 3693 token.level = level 3694 nodes.push(token) 3695 } 3696 3697 const token_o = new state.Token('link_open', 'a', 1) 3698 token_o.attrs = [['href', fullUrl]] 3699 token_o.level = level++ 3700 token_o.markup = 'linkify' 3701 token_o.info = 'auto' 3702 nodes.push(token_o) 3703 3704 const token_t = new state.Token('text', '', 0) 3705 token_t.content = urlText 3706 token_t.level = level 3707 nodes.push(token_t) 3708 3709 const token_c = new state.Token('link_close', 'a', -1) 3710 token_c.level = --level 3711 token_c.markup = 'linkify' 3712 token_c.info = 'auto' 3713 nodes.push(token_c) 3714 3715 lastPos = links[ln].lastIndex 3716 } 3717 if (lastPos < text.length) { 3718 const token = new state.Token('text', '', 0) 3719 token.content = text.slice(lastPos) 3720 token.level = level 3721 nodes.push(token) 3722 } 3723 3724 // replace current node 3725 blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes) 3726 } 3727 } 3728 } 3729} 3730 3731;// ./node_modules/markdown-it/lib/rules_core/replacements.mjs 3732// Simple typographic replacements 3733// 3734// (c) (C) â © 3735// (tm) (TM) â ⢠3736// (r) (R) â ® 3737// +- â ± 3738// ... â ⦠(also ?.... â ?.., !.... â !..) 3739// ???????? â ???, !!!!! â !!!, `,,` â `,` 3740// -- â –, --- â — 3741// 3742 3743// TODO: 3744// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾ 3745// - multiplications 2 x 4 -> 2 à 4 3746 3747const RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/ 3748 3749// Workaround for phantomjs - need regex without /g flag, 3750// or root check will fail every second time 3751const SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i 3752 3753const SCOPED_ABBR_RE = /\((c|tm|r)\)/ig 3754const SCOPED_ABBR = { 3755 c: '©', 3756 r: '®', 3757 tm: 'â¢' 3758} 3759 3760function replaceFn (match, name) { 3761 return SCOPED_ABBR[name.toLowerCase()] 3762} 3763 3764function replace_scoped (inlineTokens) { 3765 let inside_autolink = 0 3766 3767 for (let i = inlineTokens.length - 1; i >= 0; i--) { 3768 const token = inlineTokens[i] 3769 3770 if (token.type === 'text' && !inside_autolink) { 3771 token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn) 3772 } 3773 3774 if (token.type === 'link_open' && token.info === 'auto') { 3775 inside_autolink-- 3776 } 3777 3778 if (token.type === 'link_close' && token.info === 'auto') { 3779 inside_autolink++ 3780 } 3781 } 3782} 3783 3784function replace_rare (inlineTokens) { 3785 let inside_autolink = 0 3786 3787 for (let i = inlineTokens.length - 1; i >= 0; i--) { 3788 const token = inlineTokens[i] 3789 3790 if (token.type === 'text' && !inside_autolink) { 3791 if (RARE_RE.test(token.content)) { 3792 token.content = token.content 3793 .replace(/\+-/g, '±') 3794 // .., ..., ....... -> ⦠3795 // but ?..... & !..... -> ?.. & !.. 3796 .replace(/\.{2,}/g, 'â¦').replace(/([?!])â¦/g, '$1..') 3797 .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',') 3798 // em-dash 3799 .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\u2014') 3800 // en-dash 3801 .replace(/(^|\s)--(?=\s|$)/mg, '$1\u2013') 3802 .replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, '$1\u2013') 3803 } 3804 } 3805 3806 if (token.type === 'link_open' && token.info === 'auto') { 3807 inside_autolink-- 3808 } 3809 3810 if (token.type === 'link_close' && token.info === 'auto') { 3811 inside_autolink++ 3812 } 3813 } 3814} 3815 3816function replace (state) { 3817 let blkIdx 3818 3819 if (!state.md.options.typographer) { return } 3820 3821 for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
3822 if (state.tokens[blkIdx].type !== 'inline') { continue } 3823 3824 if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) { 3825 replace_scoped(state.tokens[blkIdx].children) 3826 } 3827 3828 if (RARE_RE.test(state.tokens[blkIdx].content)) { 3829 replace_rare(state.tokens[blkIdx].children) 3830 } 3831 } 3832} 3833 3834;// ./node_modules/markdown-it/lib/rules_core/smartquotes.mjs 3835// Convert straight quotation marks to typographic ones 3836// 3837 3838 3839 3840const QUOTE_TEST_RE = /['"]/ 3841const QUOTE_RE = /['"]/g 3842const APOSTROPHE = '\u2019' /* â */ 3843 3844function addReplacement (replacements, tokenIdx, pos, ch) { 3845 if (!replacements[tokenIdx]) { 3846 replacements[tokenIdx] = [] 3847 } 3848 3849 replacements[tokenIdx].push({ pos, ch }) 3850} 3851 3852function applyReplacements (str, replacements) { 3853 let result = '' 3854 let lastPos = 0 3855 3856 replacements.sort((a, b) => a.pos - b.pos) 3857 3858 for (let i = 0; i < replacements.length; i++) { 3859 const replacement = replacements[i] 3860 3861 result += str.slice(lastPos, replacement.pos) + replacement.ch 3862 lastPos = replacement.pos + 1 3863 } 3864 3865 return result + str.slice(lastPos) 3866} 3867 3868function process_inlines (tokens, state) { 3869 let j 3870 3871 const stack = [] 3872 // token index -> list of replacements in the original token content 3873 const replacements = {} 3874 3875 for (let i = 0; i < tokens.length; i++) { 3876 const token = tokens[i] 3877 3878 const thisLevel = tokens[i].level 3879 3880 for (j = stack.length - 1; j >= 0; j--) { 3881 if (stack[j].level <= thisLevel) { break } 3882 } 3883 stack.length = j + 1 3884 3885 if (token.type !== 'text') { continue } 3886 3887 const text = token.content 3888 let pos = 0 3889 const max = text.length 3890 3891 /* eslint no-labels:0,block-scoped-var:0 */ 3892 OUTER: 3893 while (pos < max) { 3894 QUOTE_RE.lastIndex = pos 3895 const t = QUOTE_RE.exec(text) 3896 if (!t) { break } 3897 3898 let canOpen = true 3899 let canClose = true 3900 pos = t.index + 1 3901 const isSingle = (t[0] === "'") 3902 3903 // Find previous character, 3904 // default to space if it's the beginning of the line 3905 // 3906 let lastChar = 0x20 3907 3908 if (t.index - 1 >= 0) { 3909 lastChar = text.charCodeAt(t.index - 1) 3910 } else { 3911 for (j = i - 1; j >= 0; j--) { 3912 if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // lastChar defaults to 0x20 3913 if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline' 3914 3915 lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1) 3916 break 3917 } 3918 } 3919 3920 // Find next character, 3921 // default to space if it's the end of the line 3922 // 3923 let nextChar = 0x20 3924 3925 if (pos < max) { 3926 nextChar = text.charCodeAt(pos) 3927 } else { 3928 for (j = i + 1; j < tokens.length; j++) { 3929 if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // nextChar defaults to 0x20 3930 if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline' 3931 3932 nextChar = tokens[j].content.charCodeAt(0) 3933 break 3934 } 3935 } 3936 3937 const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar) 3938 const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar) 3939 3940 const isLastWhiteSpace = isWhiteSpace(lastChar) 3941 const isNextWhiteSpace = isWhiteSpace(nextChar) 3942 3943 if (isNextWhiteSpace) { 3944 canOpen = false 3945 } else if (isNextPunctChar) { 3946 if (!(isLastWhiteSpace || isLastPunctChar)) { 3947 canOpen = false 3948 } 3949 } 3950 3951 if (isLastWhiteSpace) { 3952 canClose = false 3953 } else if (isLastPunctChar) { 3954 if (!(isNextWhiteSpace || isNextPunctChar)) { 3955 canClose = false 3956 } 3957 } 3958 3959 if (nextChar === 0x22 /* " */ && t[0] === '"') { 3960 if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) { 3961 // special case: 1"" - count first quote as an inch 3962 canClose = canOpen = false 3963 } 3964 } 3965 3966 if (canOpen && canClose) { 3967 // Replace quotes in the middle of punctuation sequence, but not 3968 // in the middle of the words, i.e.: 3969 // 3970 // 1. foo " bar " baz - not replaced 3971 // 2. foo-"-bar-"-baz - replaced 3972 // 3. foo"bar"baz - not replaced 3973 // 3974 canOpen = isLastPunctChar 3975 canClose = isNextPunctChar 3976 } 3977 3978 if (!canOpen && !canClose) { 3979 // middle of word 3980 if (isSingle) { 3981 addReplacement(replacements, i, t.index, APOSTROPHE) 3982 } 3983 continue 3984 } 3985 3986 if (canClose) { 3987 // this could be a closing quote, rewind the stack to get a match 3988 for (j = stack.length - 1; j >= 0; j--) { 3989 let item = stack[j] 3990 if (stack[j].level < thisLevel) { break } 3991 if (item.single === isSingle && stack[j].level === thisLevel) { 3992 item = stack[j] 3993 3994 let openQuote 3995 let closeQuote 3996 if (isSingle) { 3997 openQuote = state.md.options.quotes[2] 3998 closeQuote = state.md.options.quotes[3] 3999 } else { 4000 openQuote = state.md.options.quotes[0] 4001 closeQuote = state.md.options.quotes[1] 4002 } 4003 4004 addReplacement(replacements, i, t.index, closeQuote) 4005 addReplacement(replacements, item.token, item.pos, openQuote) 4006 4007 stack.length = j 4008 continue OUTER 4009 } 4010 } 4011 } 4012 4013 if (canOpen) { 4014 stack.push({ 4015 token: i, 4016 pos: t.index, 4017 single: isSingle, 4018 level: thisLevel 4019 }) 4020 } else if (canClose && isSingle) { 4021 addReplacement(replacements, i, t.index, APOSTROPHE) 4022 } 4023 } 4024 } 4025
4026 Object.keys(replacements).forEach(function (tokenIdx) { 4027 tokens[tokenIdx].content = applyReplacements(tokens[tokenIdx].content, replacements[tokenIdx]) 4028 }) 4029} 4030 4031function smartquotes (state) { 4032 /* eslint max-depth:0 */ 4033 if (!state.md.options.typographer) { return } 4034 4035 for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { 4036 if (state.tokens[blkIdx].type !== 'inline' || 4037 !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) { 4038 continue 4039 } 4040 4041 process_inlines(state.tokens[blkIdx].children, state) 4042 } 4043} 4044 4045;// ./node_modules/markdown-it/lib/rules_core/text_join.mjs 4046// Join raw text tokens with the rest of the text 4047// 4048// This is set as a separate rule to provide an opportunity for plugins 4049// to run text replacements after text join, but before escape join. 4050// 4051// For example, `\:)` shouldn't be replaced with an emoji. 4052// 4053 4054function text_join (state) { 4055 let curr, last 4056 const blockTokens = state.tokens 4057 const l = blockTokens.length 4058 4059 for (let j = 0; j < l; j++) { 4060 if (blockTokens[j].type !== 'inline') continue 4061 4062 const tokens = blockTokens[j].children 4063 const max = tokens.length 4064 4065 for (curr = 0; curr < max; curr++) { 4066 if (tokens[curr].type === 'text_special') { 4067 tokens[curr].type = 'text' 4068 } 4069 } 4070 4071 for (curr = last = 0; curr < max; curr++) { 4072 if (tokens[curr].type === 'text' && 4073 curr + 1 < max && 4074 tokens[curr + 1].type === 'text') { 4075 // collapse two adjacent text nodes 4076 tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content 4077 } else { 4078 if (curr !== last) { tokens[last] = tokens[curr] } 4079 4080 last++ 4081 } 4082 } 4083 4084 if (curr !== last) { 4085 tokens.length = last 4086 } 4087 } 4088} 4089 4090;// ./node_modules/markdown-it/lib/parser_core.mjs 4091/** internal 4092 * class Core 4093 * 4094 * Top-level rules executor. Glues block/inline parsers and does intermediate 4095 * transformations. 4096 **/ 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109const _rules = [ 4110 ['normalize', normalize], 4111 ['block', block], 4112 ['inline', inline], 4113 ['linkify', linkify], 4114 ['replacements', replace], 4115 ['smartquotes', smartquotes], 4116 // `text_join` finds `text_special` tokens (for escape sequences) 4117 // and joins them with the rest of the text 4118 ['text_join', text_join] 4119] 4120 4121/** 4122 * new Core() 4123 **/ 4124function Core () { 4125 /** 4126 * Core#ruler -> Ruler 4127 * 4128 * [[Ruler]] instance. Keep configuration of core rules. 4129 **/ 4130 this.ruler = new ruler() 4131 4132 for (let i = 0; i < _rules.length; i++) { 4133 this.ruler.push(_rules[i][0], _rules[i][1]) 4134 } 4135} 4136 4137/** 4138 * Core.process(state) 4139 * 4140 * Executes core chain rules. 4141 **/ 4142Core.prototype.process = function (state) { 4143 const rules = this.ruler.getRules('') 4144 4145 for (let i = 0, l = rules.length; i < l; i++) { 4146 rules[i](state) 4147 } 4148} 4149 4150Core.prototype.State = state_core 4151 4152/* harmony default export */ const parser_core = (Core); 4153 4154;// ./node_modules/markdown-it/lib/rules_block/state_block.mjs 4155// Parser state class 4156 4157 4158 4159 4160function StateBlock (src, md, env, tokens) { 4161 this.src = src 4162 4163 // link to parser instance 4164 this.md = md 4165 4166 this.env = env 4167 4168 // 4169 // Internal state vartiables 4170 // 4171 4172 this.tokens = tokens 4173 4174 this.bMarks = [] // line begin offsets for fast jumps 4175 this.eMarks = [] // line end offsets for fast jumps 4176 this.tShift = [] // offsets of the first non-space characters (tabs not expanded) 4177 this.sCount = [] // indents for each line (tabs expanded) 4178 4179 // An amount of virtual spaces (tabs expanded) between beginning 4180 // of each line (bMarks) and real beginning of that line. 4181 // 4182 // It exists only as a hack because blockquotes override bMarks 4183 // losing information in the process. 4184 // 4185 // It's used only when expanding tabs, you can think about it as 4186 // an initial tab length, e.g. bsCount=21 applied to string `\t123` 4187 // means first tab should be expanded to 4-21%4 === 3 spaces. 4188 // 4189 this.bsCount = [] 4190 4191 // block parser variables 4192 4193 // required block content indent (for example, if we are 4194 // inside a list, it would be positioned after list marker) 4195 this.blkIndent = 0 4196 this.line = 0 // line index in src 4197 this.lineMax = 0 // lines count 4198 this.tight = false // loose/tight mode for lists 4199 this.ddIndent = -1 // indent of the current dd block (-1 if there isn't any) 4200 this.listIndent = -1 // indent of the current list block (-1 if there isn't any) 4201 4202 // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' 4203 // used in lists to determine if they interrupt a paragraph 4204 this.parentType = 'root' 4205 4206 this.level = 0 4207 4208 // Create caches 4209 // Generate markers. 4210 const s = this.src 4211 4212 for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {
4213 const ch = s.charCodeAt(pos) 4214 4215 if (!indent_found) { 4216 if (isSpace(ch)) { 4217 indent++ 4218 4219 if (ch === 0x09) { 4220 offset += 4 - offset % 4 4221 } else { 4222 offset++ 4223 } 4224 continue 4225 } else { 4226 indent_found = true 4227 } 4228 } 4229 4230 if (ch === 0x0A || pos === len - 1) { 4231 if (ch !== 0x0A) { pos++ } 4232 this.bMarks.push(start) 4233 this.eMarks.push(pos) 4234 this.tShift.push(indent) 4235 this.sCount.push(offset) 4236 this.bsCount.push(0) 4237 4238 indent_found = false 4239 indent = 0 4240 offset = 0 4241 start = pos + 1 4242 } 4243 } 4244 4245 // Push fake entry to simplify cache bounds checks 4246 this.bMarks.push(s.length) 4247 this.eMarks.push(s.length) 4248 this.tShift.push(0) 4249 this.sCount.push(0) 4250 this.bsCount.push(0) 4251 4252 this.lineMax = this.bMarks.length - 1 // don't count last fake line 4253} 4254 4255// Push new token to "stream". 4256// 4257StateBlock.prototype.push = function (type, tag, nesting) { 4258 const token = new lib_token(type, tag, nesting) 4259 token.block = true 4260 4261 if (nesting < 0) this.level-- // closing tag 4262 token.level = this.level 4263 if (nesting > 0) this.level++ // opening tag 4264 4265 this.tokens.push(token) 4266 return token 4267} 4268 4269StateBlock.prototype.isEmpty = function isEmpty (line) { 4270 return this.bMarks[line] + this.tShift[line] >= this.eMarks[line] 4271} 4272 4273StateBlock.prototype.skipEmptyLines = function skipEmptyLines (from) { 4274 for (let max = this.lineMax; from < max; from++) { 4275 if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { 4276 break 4277 } 4278 } 4279 return from 4280} 4281 4282// Skip spaces from given position. 4283StateBlock.prototype.skipSpaces = function skipSpaces (pos) { 4284 for (let max = this.src.length; pos < max; pos++) { 4285 const ch = this.src.charCodeAt(pos) 4286 if (!isSpace(ch)) { break } 4287 } 4288 return pos 4289} 4290 4291// Skip spaces from given position in reverse. 4292StateBlock.prototype.skipSpacesBack = function skipSpacesBack (pos, min) { 4293 if (pos <= min) { return pos } 4294 4295 while (pos > min) { 4296 if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1 } 4297 } 4298 return pos 4299} 4300 4301// Skip char codes from given position 4302StateBlock.prototype.skipChars = function skipChars (pos, code) { 4303 for (let max = this.src.length; pos < max; pos++) { 4304 if (this.src.charCodeAt(pos) !== code) { break } 4305 } 4306 return pos 4307} 4308 4309// Skip char codes reverse from given position - 1 4310StateBlock.prototype.skipCharsBack = function skipCharsBack (pos, code, min) { 4311 if (pos <= min) { return pos } 4312 4313 while (pos > min) { 4314 if (code !== this.src.charCodeAt(--pos)) { return pos + 1 } 4315 } 4316 return pos 4317} 4318 4319// cut lines range from source. 4320StateBlock.prototype.getLines = function getLines (begin, end, indent, keepLastLF) { 4321 if (begin >= end) { 4322 return '' 4323 } 4324 4325 const queue = new Array(end - begin) 4326 4327 for (let i = 0, line = begin; line < end; line++, i++) { 4328 let lineIndent = 0 4329 const lineStart = this.bMarks[line] 4330 let first = lineStart 4331 let last 4332 4333 if (line + 1 < end || keepLastLF) { 4334 // No need for bounds check because we have fake entry on tail. 4335 last = this.eMarks[line] + 1 4336 } else { 4337 last = this.eMarks[line] 4338 } 4339 4340 while (first < last && lineIndent < indent) { 4341 const ch = this.src.charCodeAt(first) 4342 4343 if (isSpace(ch)) { 4344 if (ch === 0x09) { 4345 lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4 4346 } else { 4347 lineIndent++ 4348 } 4349 } else if (first - lineStart < this.tShift[line]) { 4350 // patched tShift masked characters to look like spaces (blockquotes, list markers) 4351 lineIndent++ 4352 } else { 4353 break 4354 } 4355 4356 first++ 4357 } 4358 4359 if (lineIndent > indent) { 4360 // partially expanding tabs in code blocks, e.g '\t\tfoobar' 4361 // with indent=2 becomes ' \tfoobar' 4362 queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last) 4363 } else { 4364 queue[i] = this.src.slice(first, last) 4365 } 4366 } 4367 4368 return queue.join('') 4369} 4370 4371// re-export Token class to use in block rules 4372StateBlock.prototype.Token = lib_token 4373 4374/* harmony default export */ const state_block = (StateBlock); 4375 4376;// ./node_modules/markdown-it/lib/rules_block/table.mjs 4377// GFM table, https://github.github.com/gfm/#tables-extension- 4378 4379 4380 4381// Limit the amount of empty autocompleted cells in a table, 4382// see https://github.com/markdown-it/markdown-it/issues/1000, 4383// 4384// Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k. 4385// We set it to 65k, which can expand user input by a factor of x370 4386// (256x256 square is 1.8kB expanded into 650kB). 4387const MAX_AUTOCOMPLETED_CELLS = 0x10000 4388 4389function getLine (state, line) { 4390 const pos = state.bMarks[line] + state.tShift[line] 4391 const max = state.eMarks[line] 4392 4393 return state.src.slice(pos, max) 4394} 4395 4396function escapedSplit (str) { 4397 const result = [] 4398 const max = str.length 4399 4400 let pos = 0 4401 let ch = str.charCodeAt(pos) 4402 let isEscaped = false
4403 let lastPos = 0 4404 let current = '' 4405 4406 while (pos < max) { 4407 if (ch === 0x7c/* | */) { 4408 if (!isEscaped) { 4409 // pipe separating cells, '|' 4410 result.push(current + str.substring(lastPos, pos)) 4411 current = '' 4412 lastPos = pos + 1 4413 } else { 4414 // escaped pipe, '\|' 4415 current += str.substring(lastPos, pos - 1) 4416 lastPos = pos 4417 } 4418 } 4419 4420 isEscaped = (ch === 0x5c/* \ */) 4421 pos++ 4422 4423 ch = str.charCodeAt(pos) 4424 } 4425 4426 result.push(current + str.substring(lastPos)) 4427 4428 return result 4429} 4430 4431function table (state, startLine, endLine, silent) { 4432 // should have at least two lines 4433 if (startLine + 2 > endLine) { return false } 4434 4435 let nextLine = startLine + 1 4436 4437 if (state.sCount[nextLine] < state.blkIndent) { return false } 4438 4439 // if it's indented more than 3 spaces, it should be a code block 4440 if (state.sCount[nextLine] - state.blkIndent >= 4) { return false } 4441 4442 // first character of the second line should be '|', '-', ':', 4443 // and no other characters are allowed but spaces; 4444 // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp 4445 4446 let pos = state.bMarks[nextLine] + state.tShift[nextLine] 4447 if (pos >= state.eMarks[nextLine]) { return false } 4448 4449 const firstCh = state.src.charCodeAt(pos++) 4450 if (firstCh !== 0x7C/* | */ && firstCh !== 0x2D/* - */ && firstCh !== 0x3A/* : */) { return false } 4451 4452 if (pos >= state.eMarks[nextLine]) { return false } 4453 4454 const secondCh = state.src.charCodeAt(pos++) 4455 if (secondCh !== 0x7C/* | */ && secondCh !== 0x2D/* - */ && secondCh !== 0x3A/* : */ && !isSpace(secondCh)) { 4456 return false 4457 } 4458 4459 // if first character is '-', then second character must not be a space 4460 // (due to parsing ambiguity with list) 4461 if (firstCh === 0x2D/* - */ && isSpace(secondCh)) { return false } 4462 4463 while (pos < state.eMarks[nextLine]) { 4464 const ch = state.src.charCodeAt(pos) 4465 4466 if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false } 4467 4468 pos++ 4469 } 4470 4471 let lineText = getLine(state, startLine + 1) 4472 let columns = lineText.split('|') 4473 const aligns = [] 4474 for (let i = 0; i < columns.length; i++) { 4475 const t = columns[i].trim() 4476 if (!t) { 4477 // allow empty columns before and after table, but not in between columns; 4478 // e.g. allow ` |---| `, disallow ` ---||--- ` 4479 if (i === 0 || i === columns.length - 1) { 4480 continue 4481 } else { 4482 return false 4483 } 4484 } 4485 4486 if (!/^:?-+:?$/.test(t)) { return false } 4487 if (t.charCodeAt(t.length - 1) === 0x3A/* : */) { 4488 aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right') 4489 } else if (t.charCodeAt(0) === 0x3A/* : */) { 4490 aligns.push('left') 4491 } else { 4492 aligns.push('') 4493 } 4494 } 4495 4496 lineText = getLine(state, startLine).trim() 4497 if (lineText.indexOf('|') === -1) { return false } 4498 if (state.sCount[startLine] - state.blkIndent >= 4) { return false } 4499 columns = escapedSplit(lineText) 4500 if (columns.length && columns[0] === '') columns.shift() 4501 if (columns.length && columns[columns.length - 1] === '') columns.pop() 4502 4503 // header row will define an amount of columns in the entire table, 4504 // and align row should be exactly the same (the rest of the rows can differ) 4505 const columnCount = columns.length 4506 if (columnCount === 0 || columnCount !== aligns.length) { return false } 4507 4508 if (silent) { return true } 4509 4510 const oldParentType = state.parentType 4511 state.parentType = 'table' 4512 4513 // use 'blockquote' lists for termination because it's 4514 // the most similar to tables 4515 const terminatorRules = state.md.block.ruler.getRules('blockquote') 4516
4517 const token_to = state.push('table_open', 'table', 1) 4518 const tableLines = [startLine, 0] 4519 token_to.map = tableLines 4520 4521 const token_tho = state.push('thead_open', 'thead', 1) 4522 token_tho.map = [startLine, startLine + 1] 4523 4524 const token_htro = state.push('tr_open', 'tr', 1) 4525 token_htro.map = [startLine, startLine + 1] 4526 4527 for (let i = 0; i < columns.length; i++) { 4528 const token_ho = state.push('th_open', 'th', 1) 4529 if (aligns[i]) { 4530 token_ho.attrs = [['style', 'text-align:' + aligns[i]]] 4531 } 4532 4533 const token_il = state.push('inline', '', 0) 4534 token_il.content = columns[i].trim() 4535 token_il.children = [] 4536 4537 state.push('th_close', 'th', -1) 4538 } 4539 4540 state.push('tr_close', 'tr', -1) 4541 state.push('thead_close', 'thead', -1) 4542 4543 let tbodyLines 4544 let autocompletedCells = 0 4545 4546 for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { 4547 if (state.sCount[nextLine] < state.blkIndent) { break } 4548 4549 let terminate = false 4550 for (let i = 0, l = terminatorRules.length; i < l; i++) { 4551 if (terminatorRules[i](state, nextLine, endLine, true)) { 4552 terminate = true 4553 break 4554 } 4555 } 4556 4557 if (terminate) { break } 4558 lineText = getLine(state, nextLine).trim() 4559 if (!lineText) { break } 4560 if (state.sCount[nextLine] - state.blkIndent >= 4) { break } 4561 columns = escapedSplit(lineText) 4562 if (columns.length && columns[0] === '') columns.shift() 4563 if (columns.length && columns[columns.length - 1] === '') columns.pop() 4564 4565 // note: autocomplete count can be negative if user specifies more columns than header, 4566 // but that does not affect intended use (which is limiting expansion) 4567 autocompletedCells += columnCount - columns.length 4568 if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) { break } 4569 4570 if (nextLine === startLine + 2) { 4571 const token_tbo = state.push('tbody_open', 'tbody', 1) 4572 token_tbo.map = tbodyLines = [startLine + 2, 0] 4573 } 4574 4575 const token_tro = state.push('tr_open', 'tr', 1) 4576 token_tro.map = [nextLine, nextLine + 1] 4577 4578 for (let i = 0; i < columnCount; i++) { 4579 const token_tdo = state.push('td_open', 'td', 1) 4580 if (aligns[i]) { 4581 token_tdo.attrs = [['style', 'text-align:' + aligns[i]]] 4582 } 4583 4584 const token_il = state.push('inline', '', 0) 4585 token_il.content = columns[i] ? columns[i].trim() : '' 4586 token_il.children = [] 4587 4588 state.push('td_close', 'td', -1) 4589 } 4590 state.push('tr_close', 'tr', -1) 4591 } 4592 4593 if (tbodyLines) { 4594 state.push('tbody_close', 'tbody', -1) 4595 tbodyLines[1] = nextLine 4596 } 4597 4598 state.push('table_close', 'table', -1) 4599 tableLines[1] = nextLine 4600 4601 state.parentType = oldParentType 4602 state.line = nextLine 4603 return true 4604} 4605 4606;// ./node_modules/markdown-it/lib/rules_block/code.mjs 4607// Code block (4 spaces padded) 4608 4609function code (state, startLine, endLine/*, silent */) { 4610 if (state.sCount[startLine] - state.blkIndent < 4) { return false } 4611 4612 let nextLine = startLine + 1 4613 let last = nextLine 4614 4615 while (nextLine < endLine) { 4616 if (state.isEmpty(nextLine)) { 4617 nextLine++ 4618 continue 4619 } 4620 4621 if (state.sCount[nextLine] - state.blkIndent >= 4) { 4622 nextLine++ 4623 last = nextLine 4624 continue 4625 } 4626 break 4627 } 4628 4629 state.line = last 4630 4631 const token = state.push('code_block', 'code', 0) 4632 token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n' 4633 token.map = [startLine, state.line] 4634 4635 return true 4636} 4637 4638;// ./node_modules/markdown-it/lib/rules_block/fence.mjs 4639// fences (``` lang, ~~~ lang) 4640 4641function fence (state, startLine, endLine, silent) { 4642 let pos = state.bMarks[startLine] + state.tShift[startLine] 4643 let max = state.eMarks[startLine] 4644 4645 // if it's indented more than 3 spaces, it should be a code block 4646 if (state.sCount[startLine] - state.blkIndent >= 4) { return false } 4647 4648 if (pos + 3 > max) { return false } 4649 4650 const marker = state.src.charCodeAt(pos) 4651 4652 if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) { 4653 return false 4654 } 4655 4656 // scan marker length 4657 let mem = pos 4658 pos = state.skipChars(pos, marker) 4659 4660 let len = pos - mem 4661 4662 if (len < 3) { return false } 4663 4664 const markup = state.src.slice(mem, pos) 4665 const params = state.src.slice(pos, max) 4666 4667 if (marker === 0x60 /* ` */) { 4668 if (params.indexOf(String.fromCharCode(marker)) >= 0) { 4669 return false 4670 } 4671 } 4672 4673 // Since start is found, we can report success here in validation mode 4674 if (silent) { return true } 4675 4676 // search end of block 4677 let nextLine = startLine 4678 let haveEndMarker = false 4679 4680 for (;;) { 4681 nextLine++ 4682 if (nextLine >= endLine) { 4683 // unclosed block should be autoclosed by end of document. 4684 // also block seems to be autoclosed by end of parent 4685 break 4686 } 4687 4688 pos = mem = state.bMarks[nextLine] + state.tShift[nextLine] 4689 max = state.eMarks[nextLine] 4690 4691 if (pos < max && state.sCount[nextLine] < state.blkIndent) { 4692 // non-empty line with negative indent should stop the list: 4693 // - ``` 4694 // test 4695 break 4696 } 4697
4698 if (state.src.charCodeAt(pos) !== marker) { continue } 4699 4700 if (state.sCount[nextLine] - state.blkIndent >= 4) { 4701 // closing fence should be indented less than 4 spaces 4702 continue 4703 } 4704 4705 pos = state.skipChars(pos, marker) 4706 4707 // closing code fence must be at least as long as the opening one 4708 if (pos - mem < len) { continue } 4709 4710 // make sure tail has spaces only 4711 pos = state.skipSpaces(pos) 4712 4713 if (pos < max) { continue } 4714 4715 haveEndMarker = true 4716 // found! 4717 break 4718 } 4719 4720 // If a fence has heading spaces, they should be removed from its inner block 4721 len = state.sCount[startLine] 4722 4723 state.line = nextLine + (haveEndMarker ? 1 : 0) 4724 4725 const token = state.push('fence', 'code', 0) 4726 token.info = params 4727 token.content = state.getLines(startLine + 1, nextLine, len, true) 4728 token.markup = markup 4729 token.map = [startLine, state.line] 4730 4731 return true 4732} 4733 4734;// ./node_modules/markdown-it/lib/rules_block/blockquote.mjs 4735// Block quotes 4736 4737 4738 4739function blockquote (state, startLine, endLine, silent) { 4740 let pos = state.bMarks[startLine] + state.tShift[startLine] 4741 let max = state.eMarks[startLine] 4742 4743 const oldLineMax = state.lineMax 4744 4745 // if it's indented more than 3 spaces, it should be a code block 4746 if (state.sCount[startLine] - state.blkIndent >= 4) { return false } 4747 4748 // check the block quote marker 4749 if (state.src.charCodeAt(pos) !== 0x3E/* > */) { return false } 4750 4751 // we know that it's going to be a valid blockquote, 4752 // so no point trying to find the end of it in silent mode 4753 if (silent) { return true } 4754 4755 const oldBMarks = [] 4756 const oldBSCount = [] 4757 const oldSCount = [] 4758 const oldTShift = [] 4759 4760 const terminatorRules = state.md.block.ruler.getRules('blockquote') 4761 4762 const oldParentType = state.parentType 4763 state.parentType = 'blockquote' 4764 let lastLineEmpty = false 4765 let nextLine 4766 4767 // Search the end of the block 4768 // 4769 // Block ends with either: 4770 // 1. an empty line outside: 4771 // ``` 4772 // > test 4773 // 4774 // ``` 4775 // 2. an empty line inside: 4776 // ``` 4777 // > 4778 // test 4779 // ``` 4780 // 3. another tag: 4781 // ``` 4782 // > test 4783 // - - - 4784 // ``` 4785 for (nextLine = startLine; nextLine < endLine; nextLine++) { 4786 // check if it's outdented, i.e. it's inside list item and indented 4787 // less than said list item: 4788 // 4789 // ``` 4790 // 1. anything 4791 // > current blockquote 4792 // 2. checking this line 4793 // ``` 4794 const isOutdented = state.sCount[nextLine] < state.blkIndent 4795 4796 pos = state.bMarks[nextLine] + state.tShift[nextLine] 4797 max = state.eMarks[nextLine] 4798 4799 if (pos >= max) { 4800 // Case 1: line is not inside the blockquote, and this line is empty. 4801 break 4802 } 4803 4804 if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) { 4805 // This line is inside the blockquote. 4806
4807 // set offset past spaces and ">" 4808 let initial = state.sCount[nextLine] + 1 4809 let spaceAfterMarker 4810 let adjustTab 4811 4812 // skip one optional space after '>' 4813 if (state.src.charCodeAt(pos) === 0x20 /* space */) { 4814 // ' > test ' 4815 // ^ -- position start of line here: 4816 pos++ 4817 initial++ 4818 adjustTab = false 4819 spaceAfterMarker = true 4820 } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { 4821 spaceAfterMarker = true 4822 4823 if ((state.bsCount[nextLine] + initial) % 4 === 3) { 4824 // ' >\t test ' 4825 // ^ -- position start of line here (tab has width===1) 4826 pos++ 4827 initial++ 4828 adjustTab = false 4829 } else { 4830 // ' >\t test ' 4831 // ^ -- position start of line here + shift bsCount slightly 4832 // to make extra space appear 4833 adjustTab = true 4834 } 4835 } else { 4836 spaceAfterMarker = false 4837 } 4838 4839 let offset = initial 4840 oldBMarks.push(state.bMarks[nextLine]) 4841 state.bMarks[nextLine] = pos 4842 4843 while (pos < max) { 4844 const ch = state.src.charCodeAt(pos) 4845 4846 if (isSpace(ch)) { 4847 if (ch === 0x09) { 4848 offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4 4849 } else { 4850 offset++ 4851 } 4852 } else { 4853 break 4854 } 4855 4856 pos++ 4857 } 4858 4859 lastLineEmpty = pos >= max 4860 4861 oldBSCount.push(state.bsCount[nextLine]) 4862 state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0) 4863 4864 oldSCount.push(state.sCount[nextLine]) 4865 state.sCount[nextLine] = offset - initial 4866 4867 oldTShift.push(state.tShift[nextLine]) 4868 state.tShift[nextLine] = pos - state.bMarks[nextLine] 4869 continue 4870 } 4871 4872 // Case 2: line is not inside the blockquote, and the last line was empty. 4873 if (lastLineEmpty) { break } 4874 4875 // Case 3: another tag found. 4876 let terminate = false 4877 for (let i = 0, l = terminatorRules.length; i < l; i++) { 4878 if (terminatorRules[i](state, nextLine, endLine, true)) { 4879 terminate = true 4880 break 4881 } 4882 } 4883 4884 if (terminate) { 4885 // Quirk to enforce "hard termination mode" for paragraphs; 4886 // normally if you call `tokenize(state, startLine, nextLine)`, 4887 // paragraphs will look below nextLine for paragraph continuation, 4888 // but if blockquote is terminated by another tag, they shouldn't 4889 state.lineMax = nextLine 4890 4891 if (state.blkIndent !== 0) { 4892 // state.blkIndent was non-zero, we now set it to zero, 4893 // so we need to re-calculate all offsets to appear as 4894 // if indent wasn't changed 4895 oldBMarks.push(state.bMarks[nextLine]) 4896 oldBSCount.push(state.bsCount[nextLine]) 4897 oldTShift.push(state.tShift[nextLine]) 4898 oldSCount.push(state.sCount[nextLine]) 4899 state.sCount[nextLine] -= state.blkIndent 4900 } 4901 4902 break 4903 } 4904 4905 oldBMarks.push(state.bMarks[nextLine]) 4906 oldBSCount.push(state.bsCount[nextLine]) 4907 oldTShift.push(state.tShift[nextLine]) 4908 oldSCount.push(state.sCount[nextLine]) 4909 4910 // A negative indentation means that this is a paragraph continuation 4911 // 4912 state.sCount[nextLine] = -1 4913 } 4914 4915 const oldIndent = state.blkIndent 4916 state.blkIndent = 0 4917 4918 const token_o = state.push('blockquote_open', 'blockquote', 1) 4919 token_o.markup = '>' 4920 const lines = [startLine, 0] 4921 token_o.map = lines 4922 4923 state.md.block.tokenize(state, startLine, nextLine) 4924 4925 const token_c = state.push('blockquote_close', 'blockquote', -1) 4926 token_c.markup = '>' 4927 4928 state.lineMax = oldLineMax 4929 state.parentType = oldParentType 4930 lines[1] = state.line 4931 4932 // Restore original tShift; this might not be necessary since the parser 4933 // has already been here, but just to make sure we can do that. 4934 for (let i = 0; i < oldTShift.length; i++) { 4935 state.bMarks[i + startLine] = oldBMarks[i] 4936 state.tShift[i + startLine] = oldTShift[i] 4937 state.sCount[i + startLine] = oldSCount[i] 4938 state.bsCount[i + startLine] = oldBSCount[i] 4939 } 4940 state.blkIndent = oldIndent 4941 4942 return true 4943} 4944 4945;// ./node_modules/markdown-it/lib/rules_block/hr.mjs 4946// Horizontal rule 4947 4948 4949 4950function hr (state, startLine, endLine, silent) { 4951 const max = state.eMarks[startLine] 4952 // if it's indented more than 3 spaces, it should be a code block 4953 if (state.sCount[startLine] - state.blkIndent >= 4) { return false } 4954 4955 let pos = state.bMarks[startLine] + state.tShift[startLine]
4956 const marker = state.src.charCodeAt(pos++) 4957 4958 // Check hr marker 4959 if (marker !== 0x2A/* * */ && 4960 marker !== 0x2D/* - */ && 4961 marker !== 0x5F/* _ */) { 4962 return false 4963 } 4964 4965 // markers can be mixed with spaces, but there should be at least 3 of them 4966 4967 let cnt = 1 4968 while (pos < max) { 4969 const ch = state.src.charCodeAt(pos++) 4970 if (ch !== marker && !isSpace(ch)) { return false } 4971 if (ch === marker) { cnt++ } 4972 } 4973 4974 if (cnt < 3) { return false } 4975 4976 if (silent) { return true } 4977 4978 state.line = startLine + 1 4979 4980 const token = state.push('hr', 'hr', 0) 4981 token.map = [startLine, state.line] 4982 token.markup = Array(cnt + 1).join(String.fromCharCode(marker)) 4983 4984 return true 4985} 4986 4987;// ./node_modules/markdown-it/lib/rules_block/list.mjs 4988// Lists 4989 4990 4991 4992// Search `[-+*][\n ]`, returns next pos after marker on success 4993// or -1 on fail. 4994function skipBulletListMarker (state, startLine) { 4995 const max = state.eMarks[startLine] 4996 let pos = state.bMarks[startLine] + state.tShift[startLine] 4997 4998 const marker = state.src.charCodeAt(pos++) 4999 // Check bullet 5000 if (marker !== 0x2A/* * */ && 5001 marker !== 0x2D/* - */ && 5002 marker !== 0x2B/* + */) { 5003 return -1 5004 } 5005 5006 if (pos < max) { 5007 const ch = state.src.charCodeAt(pos) 5008 5009 if (!isSpace(ch)) { 5010 // " -test " - is not a list item 5011 return -1 5012 } 5013 } 5014 5015 return pos 5016} 5017 5018// Search `\d+[.)][\n ]`, returns next pos after marker on success 5019// or -1 on fail. 5020function skipOrderedListMarker (state, startLine) { 5021 const start = state.bMarks[startLine] + state.tShift[startLine] 5022 const max = state.eMarks[startLine] 5023 let pos = start 5024 5025 // List marker should have at least 2 chars (digit + dot) 5026 if (pos + 1 >= max) { return -1 } 5027 5028 let ch = state.src.charCodeAt(pos++) 5029 5030 if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1 } 5031 5032 for (;;) { 5033 // EOL -> fail 5034 if (pos >= max) { return -1 } 5035 5036 ch = state.src.charCodeAt(pos++) 5037 5038 if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) { 5039 // List marker should have no more than 9 digits 5040 // (prevents integer overflow in browsers) 5041 if (pos - start >= 10) { return -1 } 5042 5043 continue 5044 } 5045 5046 // found valid marker 5047 if (ch === 0x29/* ) */ || ch === 0x2e/* . */) { 5048 break 5049 } 5050 5051 return -1 5052 } 5053 5054 if (pos < max) { 5055 ch = state.src.charCodeAt(pos) 5056 5057 if (!isSpace(ch)) { 5058 // " 1.test " - is not a list item 5059 return -1 5060 } 5061 } 5062 return pos 5063} 5064 5065function markTightParagraphs (state, idx) { 5066 const level = state.level + 2 5067 5068 for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) { 5069 if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') { 5070 state.tokens[i + 2].hidden = true 5071 state.tokens[i].hidden = true 5072 i += 2 5073 } 5074 } 5075} 5076 5077function list (state, startLine, endLine, silent) { 5078 let max, pos, start, token 5079 let nextLine = startLine 5080 let tight = true 5081 5082 // if it's indented more than 3 spaces, it should be a code block 5083 if (state.sCount[nextLine] - state.blkIndent >= 4) { return false } 5084 5085 // Special case: 5086 // - item 1 5087 // - item 2 5088 // - item 3 5089 // - item 4 5090 // - this one is a paragraph continuation 5091 if (state.listIndent >= 0 && 5092 state.sCount[nextLine] - state.listIndent >= 4 && 5093 state.sCount[nextLine] < state.blkIndent) { 5094 return false 5095 } 5096 5097 let isTerminatingParagraph = false 5098 5099 // limit conditions when list can interrupt 5100 // a paragraph (validation mode only) 5101 if (silent && state.parentType === 'paragraph') { 5102 // Next list item should still terminate previous list item; 5103 // 5104 // This code can fail if plugins use blkIndent as well as lists, 5105 // but I hope the spec gets fixed long before that happens. 5106 // 5107 if (state.sCount[nextLine] >= state.blkIndent) { 5108 isTerminatingParagraph = true 5109 } 5110 } 5111 5112 // Detect list type and position after marker 5113 let isOrdered 5114 let markerValue 5115 let posAfterMarker 5116 if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) { 5117 isOrdered = true 5118 start = state.bMarks[nextLine] + state.tShift[nextLine] 5119 markerValue = Number(state.src.slice(start, posAfterMarker - 1)) 5120 5121 // If we're starting a new ordered list right after 5122 // a paragraph, it should start with 1. 5123 if (isTerminatingParagraph && markerValue !== 1) return false 5124 } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) { 5125 isOrdered = false 5126 } else { 5127 return false 5128 } 5129 5130 // If we're starting a new unordered list right after 5131 // a paragraph, first line should not be empty. 5132 if (isTerminatingParagraph) { 5133 if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false 5134 } 5135 5136 // For validation mode we can terminate immediately 5137 if (silent) { return true } 5138 5139 // We should terminate list on style change. Remember first one to compare.
5140 const markerCharCode = state.src.charCodeAt(posAfterMarker - 1) 5141 5142 // Start list 5143 const listTokIdx = state.tokens.length 5144 5145 if (isOrdered) { 5146 token = state.push('ordered_list_open', 'ol', 1) 5147 if (markerValue !== 1) { 5148 token.attrs = [['start', markerValue]] 5149 } 5150 } else { 5151 token = state.push('bullet_list_open', 'ul', 1) 5152 } 5153 5154 const listLines = [nextLine, 0] 5155 token.map = listLines 5156 token.markup = String.fromCharCode(markerCharCode) 5157 5158 // 5159 // Iterate list items 5160 // 5161 5162 let prevEmptyEnd = false 5163 const terminatorRules = state.md.block.ruler.getRules('list') 5164 5165 const oldParentType = state.parentType 5166 state.parentType = 'list' 5167 5168 while (nextLine < endLine) { 5169 pos = posAfterMarker 5170 max = state.eMarks[nextLine] 5171 5172 const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]) 5173 let offset = initial 5174 5175 while (pos < max) { 5176 const ch = state.src.charCodeAt(pos) 5177 5178 if (ch === 0x09) { 5179 offset += 4 - (offset + state.bsCount[nextLine]) % 4 5180 } else if (ch === 0x20) { 5181 offset++ 5182 } else { 5183 break 5184 } 5185 5186 pos++ 5187 } 5188 5189 const contentStart = pos 5190 let indentAfterMarker 5191 5192 if (contentStart >= max) { 5193 // trimming space in "- \n 3" case, indent is 1 here 5194 indentAfterMarker = 1 5195 } else { 5196 indentAfterMarker = offset - initial 5197 } 5198 5199 // If we have more than 4 spaces, the indent is 1 5200 // (the rest is just indented code block) 5201 if (indentAfterMarker > 4) { indentAfterMarker = 1 } 5202 5203 // " - test" 5204 // ^^^^^ - calculating total length of this thing 5205 const indent = initial + indentAfterMarker 5206 5207 // Run subparser & write tokens 5208 token = state.push('list_item_open', 'li', 1) 5209 token.markup = String.fromCharCode(markerCharCode) 5210 const itemLines = [nextLine, 0] 5211 token.map = itemLines 5212 if (isOrdered) { 5213 token.info = state.src.slice(start, posAfterMarker - 1) 5214 } 5215 5216 // change current state, then restore it after parser subcall 5217 const oldTight = state.tight 5218 const oldTShift = state.tShift[nextLine] 5219 const oldSCount = state.sCount[nextLine] 5220 5221 // - example list 5222 // ^ listIndent position will be here 5223 // ^ blkIndent position will be here 5224 // 5225 const oldListIndent = state.listIndent 5226 state.listIndent = state.blkIndent 5227 state.blkIndent = indent 5228 5229 state.tight = true 5230 state.tShift[nextLine] = contentStart - state.bMarks[nextLine] 5231 state.sCount[nextLine] = offset 5232 5233 if (contentStart >= max && state.isEmpty(nextLine + 1)) { 5234 // workaround for this case 5235 // (list item is empty, list terminates before "foo"): 5236 // ~~~~~~~~ 5237 // - 5238 // 5239 // foo 5240 // ~~~~~~~~ 5241 state.line = Math.min(state.line + 2, endLine) 5242 } else { 5243 state.md.block.tokenize(state, nextLine, endLine, true) 5244 } 5245 5246 // If any of list item is tight, mark list as tight 5247 if (!state.tight || prevEmptyEnd) { 5248 tight = false 5249 } 5250 // Item become loose if finish with empty line, 5251 // but we should filter last element, because it means list finish 5252 prevEmptyEnd = (state.line - nextLine) > 1 && state.isEmpty(state.line - 1) 5253 5254 state.blkIndent = state.listIndent 5255 state.listIndent = oldListIndent 5256 state.tShift[nextLine] = oldTShift 5257 state.sCount[nextLine] = oldSCount 5258 state.tight = oldTight 5259 5260 token = state.push('list_item_close', 'li', -1) 5261 token.markup = String.fromCharCode(markerCharCode) 5262 5263 nextLine = state.line 5264 itemLines[1] = nextLine 5265 5266 if (nextLine >= endLine) { break } 5267 5268 // 5269 // Try to check if list is terminated or continued. 5270 // 5271 if (state.sCount[nextLine] < state.blkIndent) { break } 5272 5273 // if it's indented more than 3 spaces, it should be a code block 5274 if (state.sCount[nextLine] - state.blkIndent >= 4) { break } 5275 5276 // fail if terminating block found 5277 let terminate = false 5278 for (let i = 0, l = terminatorRules.length; i < l; i++) { 5279 if (terminatorRules[i](state, nextLine, endLine, true)) { 5280 terminate = true 5281 break 5282 } 5283 } 5284 if (terminate) { break } 5285 5286 // fail if list has another type 5287 if (isOrdered) { 5288 posAfterMarker = skipOrderedListMarker(state, nextLine) 5289 if (posAfterMarker < 0) { break } 5290 start = state.bMarks[nextLine] + state.tShift[nextLine] 5291 } else { 5292 posAfterMarker = skipBulletListMarker(state, nextLine) 5293 if (posAfterMarker < 0) { break } 5294 } 5295
5296 if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break } 5297 } 5298 5299 // Finalize list 5300 if (isOrdered) { 5301 token = state.push('ordered_list_close', 'ol', -1) 5302 } else { 5303 token = state.push('bullet_list_close', 'ul', -1) 5304 } 5305 token.markup = String.fromCharCode(markerCharCode) 5306 5307 listLines[1] = nextLine 5308 state.line = nextLine 5309 5310 state.parentType = oldParentType 5311 5312 // mark paragraphs tight if needed 5313 if (tight) { 5314 markTightParagraphs(state, listTokIdx) 5315 } 5316 5317 return true 5318} 5319 5320;// ./node_modules/markdown-it/lib/rules_block/reference.mjs 5321 5322 5323function reference (state, startLine, _endLine, silent) { 5324 let pos = state.bMarks[startLine] + state.tShift[startLine] 5325 let max = state.eMarks[startLine] 5326 let nextLine = startLine + 1 5327 5328 // if it's indented more than 3 spaces, it should be a code block 5329 if (state.sCount[startLine] - state.blkIndent >= 4) { return false } 5330 5331 if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false } 5332 5333 function getNextLine (nextLine) { 5334 const endLine = state.lineMax 5335 5336 if (nextLine >= endLine || state.isEmpty(nextLine)) { 5337 // empty line or end of input 5338 return null 5339 } 5340 5341 let isContinuation = false 5342 5343 // this would be a code block normally, but after paragraph 5344 // it's considered a lazy continuation regardless of what's there 5345 if (state.sCount[nextLine] - state.blkIndent > 3) { isContinuation = true } 5346 5347 // quirk for blockquotes, this line should already be checked by that rule 5348 if (state.sCount[nextLine] < 0) { isContinuation = true } 5349 5350 if (!isContinuation) { 5351 const terminatorRules = state.md.block.ruler.getRules('reference') 5352 const oldParentType = state.parentType 5353 state.parentType = 'reference' 5354 5355 // Some tags can terminate paragraph without empty line. 5356 let terminate = false 5357 for (let i = 0, l = terminatorRules.length; i < l; i++) { 5358 if (terminatorRules[i](state, nextLine, endLine, true)) { 5359 terminate = true 5360 break 5361 } 5362 } 5363 5364 state.parentType = oldParentType 5365 if (terminate) { 5366 // terminated by another block 5367 return null 5368 } 5369 } 5370 5371 const pos = state.bMarks[nextLine] + state.tShift[nextLine] 5372 const max = state.eMarks[nextLine] 5373 5374 // max + 1 explicitly includes the newline 5375 return state.src.slice(pos, max + 1) 5376 } 5377 5378 let str = state.src.slice(pos, max + 1) 5379 5380 max = str.length 5381 let labelEnd = -1 5382 5383 for (pos = 1; pos < max; pos++) { 5384 const ch = str.charCodeAt(pos) 5385 if (ch === 0x5B /* [ */) { 5386 return false 5387 } else if (ch === 0x5D /* ] */) { 5388 labelEnd = pos 5389 break 5390 } else if (ch === 0x0A /* \n */) { 5391 const lineContent = getNextLine(nextLine) 5392 if (lineContent !== null) { 5393 str += lineContent 5394 max = str.length 5395 nextLine++ 5396 } 5397 } else if (ch === 0x5C /* \ */) { 5398 pos++ 5399 if (pos < max && str.charCodeAt(pos) === 0x0A) { 5400 const lineContent = getNextLine(nextLine) 5401 if (lineContent !== null) { 5402 str += lineContent 5403 max = str.length 5404 nextLine++ 5405 } 5406 } 5407 } 5408 } 5409 5410 if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false } 5411 5412 // [label]: destination 'title' 5413 // ^^^ skip optional whitespace here 5414 for (pos = labelEnd + 2; pos < max; pos++) { 5415 const ch = str.charCodeAt(pos) 5416 if (ch === 0x0A) { 5417 const lineContent = getNextLine(nextLine) 5418 if (lineContent !== null) { 5419 str += lineContent 5420 max = str.length 5421 nextLine++ 5422 } 5423 } else if (isSpace(ch)) { 5424 /* eslint no-empty:0 */ 5425 } else { 5426 break 5427 } 5428 } 5429 5430 // [label]: destination 'title' 5431 // ^^^^^^^^^^^ parse this 5432 const destRes = state.md.helpers.parseLinkDestination(str, pos, max) 5433 if (!destRes.ok) { return false } 5434 5435 const href = state.md.normalizeLink(destRes.str) 5436 if (!state.md.validateLink(href)) { return false } 5437 5438 pos = destRes.pos 5439 5440 // save cursor state, we could require to rollback later 5441 const destEndPos = pos 5442 const destEndLineNo = nextLine 5443 5444 // [label]: destination 'title' 5445 // ^^^ skipping those spaces 5446 const start = pos 5447 for (; pos < max; pos++) { 5448 const ch = str.charCodeAt(pos) 5449 if (ch === 0x0A) { 5450 const lineContent = getNextLine(nextLine) 5451 if (lineContent !== null) { 5452 str += lineContent 5453 max = str.length 5454 nextLine++ 5455 } 5456 } else if (isSpace(ch)) { 5457 /* eslint no-empty:0 */ 5458 } else { 5459 break 5460 } 5461 } 5462 5463 // [label]: destination 'title' 5464 // ^^^^^^^ parse this 5465 let titleRes = state.md.helpers.parseLinkTitle(str, pos, max) 5466 while (titleRes.can_continue) { 5467 const lineContent = getNextLine(nextLine) 5468 if (lineContent === null) break 5469 str += lineContent 5470 pos = max 5471 max = str.length 5472 nextLine++ 5473 titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes) 5474 } 5475 let title 5476 5477 if (pos < max && start !== pos && titleRes.ok) { 5478 title = titleRes.str 5479 pos = titleRes.pos 5480 } else { 5481 title = '' 5482 pos = destEndPos 5483 nextLine = destEndLineNo 5484 } 5485
5486 // skip trailing spaces until the rest of the line 5487 while (pos < max) { 5488 const ch = str.charCodeAt(pos) 5489 if (!isSpace(ch)) { break } 5490 pos++ 5491 } 5492 5493 if (pos < max && str.charCodeAt(pos) !== 0x0A) { 5494 if (title) { 5495 // garbage at the end of the line after title, 5496 // but it could still be a valid reference if we roll back 5497 title = '' 5498 pos = destEndPos 5499 nextLine = destEndLineNo 5500 while (pos < max) { 5501 const ch = str.charCodeAt(pos) 5502 if (!isSpace(ch)) { break } 5503 pos++ 5504 } 5505 } 5506 } 5507 5508 if (pos < max && str.charCodeAt(pos) !== 0x0A) { 5509 // garbage at the end of the line 5510 return false 5511 } 5512 5513 const label = normalizeReference(str.slice(1, labelEnd)) 5514 if (!label) { 5515 // CommonMark 0.20 disallows empty labels 5516 return false 5517 } 5518 5519 // Reference can not terminate anything. This check is for safety only. 5520 /* istanbul ignore if */ 5521 if (silent) { return true } 5522 5523 if (typeof state.env.references === 'undefined') { 5524 state.env.references = {} 5525 } 5526 if (typeof state.env.references[label] === 'undefined') { 5527 state.env.references[label] = { title, href } 5528 } 5529 5530 state.line = nextLine 5531 return true 5532} 5533 5534;// ./node_modules/markdown-it/lib/common/html_blocks.mjs 5535// List of valid html blocks names, according to commonmark spec 5536// https://spec.commonmark.org/0.30/#html-blocks 5537 5538/* harmony default export */ const html_blocks = ([ 5539 'address', 5540 'article', 5541 'aside', 5542 'base', 5543 'basefont', 5544 'blockquote', 5545 'body', 5546 'caption', 5547 'center', 5548 'col', 5549 'colgroup', 5550 'dd', 5551 'details', 5552 'dialog', 5553 'dir', 5554 'div', 5555 'dl', 5556 'dt', 5557 'fieldset', 5558 'figcaption', 5559 'figure', 5560 'footer', 5561 'form', 5562 'frame', 5563 'frameset', 5564 'h1', 5565 'h2', 5566 'h3', 5567 'h4', 5568 'h5', 5569 'h6', 5570 'head', 5571 'header', 5572 'hr', 5573 'html', 5574 'iframe', 5575 'legend', 5576 'li', 5577 'link', 5578 'main', 5579 'menu', 5580 'menuitem', 5581 'nav', 5582 'noframes', 5583 'ol', 5584 'optgroup', 5585 'option', 5586 'p', 5587 'param', 5588 'search', 5589 'section', 5590 'summary', 5591 'table', 5592 'tbody', 5593 'td', 5594 'tfoot', 5595 'th', 5596 'thead', 5597 'title', 5598 'tr', 5599 'track', 5600 'ul' 5601]); 5602 5603;// ./node_modules/markdown-it/lib/common/html_re.mjs 5604// Regexps to match html elements 5605 5606const attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*' 5607 5608const unquoted = '[^"\'=<>`\\x00-\\x20]+' 5609const single_quoted = "'[^']*'" 5610const double_quoted = '"[^"]*"' 5611 5612const attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')' 5613 5614const attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)' 5615 5616const open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>' 5617 5618const close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>' 5619const comment = '<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->' 5620const processing = '<[?][\\s\\S]*?[?]>' 5621const declaration = '<![A-Za-z][^>]*>' 5622const cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>' 5623 5624const HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + 5625 '|' + processing + '|' + declaration + '|' + cdata + ')') 5626const HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')') 5627 5628 5629 5630;// ./node_modules/markdown-it/lib/rules_block/html_block.mjs 5631// HTML block 5632 5633 5634 5635 5636// An array of opening and corresponding closing sequences for html tags, 5637// last argument defines whether it can terminate a paragraph or not 5638// 5639const HTML_SEQUENCES = [ 5640 [/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true], 5641 [/^<!--/, /-->/, true], 5642 [/^<\?/, /\?>/, true], 5643 [/^<![A-Z]/, />/, true], 5644 [/^<!\[CDATA\[/, /\]\]>/, true], 5645 [new RegExp('^</?(' + html_blocks.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true], 5646 [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false] 5647] 5648 5649function html_block (state, startLine, endLine, silent) { 5650 let pos = state.bMarks[startLine] + state.tShift[startLine] 5651 let max = state.eMarks[startLine] 5652 5653 // if it's indented more than 3 spaces, it should be a code block 5654 if (state.sCount[startLine] - state.blkIndent >= 4) { return false } 5655 5656 if (!state.md.options.html) { return false } 5657 5658 if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false } 5659 5660 let lineText = state.src.slice(pos, max) 5661 5662 let i = 0 5663 for (; i < HTML_SEQUENCES.length; i++) { 5664 if (HTML_SEQUENCES[i][0].test(lineText)) { break } 5665 } 5666 if (i === HTML_SEQUENCES.length) { return false } 5667 5668 if (silent) { 5669 // true if this sequence can be a terminator, false otherwise 5670 return HTML_SEQUENCES[i][2] 5671 } 5672 5673 let nextLine = startLine + 1 5674 5675 // Block types 6 and 7 (the only ones whose end condition is a blank line) 5676 // have `/^$/` as their closing regexp. For all other types (1-5, e.g. 5677 // `<!--` comments), a blank line is regular content and must not terminate 5678 // the block - it ends only when its closing sequence is found. 5679 const endsOnBlankLine = HTML_SEQUENCES[i][1].test('') 5680 5681 // If we are here - we detected HTML block. 5682 // Let's roll down till block end. 5683 if (!HTML_SEQUENCES[i][1].test(lineText)) { 5684 for (; nextLine < endLine; nextLine++) { 5685 if (state.sCount[nextLine] < state.blkIndent) { 5686 // An outdented blank line shouldn't end a block that doesn't end on a 5687 // blank line (e.g. a `<!--` comment inside a list item). Such blocks 5688 // must continue until their closing sequence regardless of indent. 5689 if (endsOnBlankLine || !state.isEmpty(nextLine)) { break } 5690 } 5691 5692 pos = state.bMarks[nextLine] + state.tShift[nextLine] 5693 max = state.eMarks[nextLine] 5694 lineText = state.src.slice(pos, max) 5695 5696 if (HTML_SEQUENCES[i][1].test(lineText)) { 5697 if (lineText.length !== 0) { nextLine++ } 5698 break 5699 } 5700 } 5701 } 5702 5703 state.line = nextLine 5704 5705 const token = state.push('html_block', '', 0) 5706 token.map = [startLine, nextLine] 5707 token.content = state.getLines(startLine, nextLine, state.blkIndent, true) 5708 5709 return true 5710} 5711 5712;// ./node_modules/markdown-it/lib/rules_block/heading.mjs 5713// heading (#, ##, ...) 5714 5715 5716 5717function heading (state, startLine, endLine, silent) { 5718 let pos = state.bMarks[startLine] + state.tShift[startLine] 5719 let max = state.eMarks[startLine] 5720 5721 // if it's indented more than 3 spaces, it should be a code block 5722 if (state.sCount[startLine] - state.blkIndent >= 4) { return false } 5723
5724 let ch = state.src.charCodeAt(pos) 5725 5726 if (ch !== 0x23/* # */ || pos >= max) { return false } 5727 5728 // count heading level 5729 let level = 1 5730 ch = state.src.charCodeAt(++pos) 5731 while (ch === 0x23/* # */ && pos < max && level <= 6) { 5732 level++ 5733 ch = state.src.charCodeAt(++pos) 5734 } 5735 5736 if (level > 6 || (pos < max && !isSpace(ch))) { return false } 5737 5738 if (silent) { return true } 5739 5740 // Let's cut tails like ' ### ' from the end of string 5741 5742 max = state.skipSpacesBack(max, pos) 5743 const tmp = state.skipCharsBack(max, 0x23, pos) // # 5744 if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) { 5745 max = tmp 5746 } 5747 5748 state.line = startLine + 1 5749 5750 const token_o = state.push('heading_open', 'h' + String(level), 1) 5751 token_o.markup = '########'.slice(0, level) 5752 token_o.map = [startLine, state.line] 5753 5754 const token_i = state.push('inline', '', 0) 5755 token_i.content = asciiTrim(state.src.slice(pos, max)) 5756 token_i.map = [startLine, state.line] 5757 token_i.children = [] 5758 5759 const token_c = state.push('heading_close', 'h' + String(level), -1) 5760 token_c.markup = '########'.slice(0, level) 5761 5762 return true 5763} 5764 5765;// ./node_modules/markdown-it/lib/rules_block/lheading.mjs 5766// lheading (---, ===) 5767 5768 5769 5770function lheading (state, startLine, endLine/*, silent */) { 5771 const terminatorRules = state.md.block.ruler.getRules('paragraph') 5772 5773 // if it's indented more than 3 spaces, it should be a code block 5774 if (state.sCount[startLine] - state.blkIndent >= 4) { return false } 5775 5776 const oldParentType = state.parentType 5777 state.parentType = 'paragraph' // use paragraph to match terminatorRules 5778 5779 // jump line-by-line until empty one or EOF 5780 let level = 0 5781 let marker 5782 let nextLine = startLine + 1 5783 5784 for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { 5785 // this would be a code block normally, but after paragraph 5786 // it's considered a lazy continuation regardless of what's there 5787 if (state.sCount[nextLine] - state.blkIndent > 3) { continue } 5788 5789 // 5790 // Check for underline in setext header 5791 // 5792 if (state.sCount[nextLine] >= state.blkIndent) { 5793 let pos = state.bMarks[nextLine] + state.tShift[nextLine] 5794 const max = state.eMarks[nextLine] 5795 5796 if (pos < max) { 5797 marker = state.src.charCodeAt(pos) 5798 5799 if (marker === 0x2D/* - */ || marker === 0x3D/* = */) { 5800 pos = state.skipChars(pos, marker) 5801 pos = state.skipSpaces(pos) 5802 5803 if (pos >= max) { 5804 level = (marker === 0x3D/* = */ ? 1 : 2) 5805 break 5806 } 5807 } 5808 } 5809 } 5810 5811 // quirk for blockquotes, this line should already be checked by that rule 5812 if (state.sCount[nextLine] < 0) { continue } 5813 5814 // Some tags can terminate paragraph without empty line. 5815 let terminate = false 5816 for (let i = 0, l = terminatorRules.length; i < l; i++) { 5817 if (terminatorRules[i](state, nextLine, endLine, true)) { 5818 terminate = true 5819 break 5820 } 5821 } 5822 if (terminate) { break } 5823 } 5824 5825 if (!level) { 5826 // Didn't find valid underline 5827 state.parentType = oldParentType 5828 return false 5829 } 5830 5831 const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false)) 5832 5833 state.line = nextLine + 1 5834 5835 const token_o = state.push('heading_open', 'h' + String(level), 1) 5836 token_o.markup = String.fromCharCode(marker) 5837 token_o.map = [startLine, state.line] 5838 5839 const token_i = state.push('inline', '', 0) 5840 token_i.content = content 5841 token_i.map = [startLine, state.line - 1] 5842 token_i.children = [] 5843 5844 const token_c = state.push('heading_close', 'h' + String(level), -1) 5845 token_c.markup = String.fromCharCode(marker) 5846 5847 state.parentType = oldParentType 5848 5849 return true 5850} 5851 5852;// ./node_modules/markdown-it/lib/rules_block/paragraph.mjs 5853// Paragraph 5854 5855 5856 5857function paragraph (state, startLine, endLine) { 5858 const terminatorRules = state.md.block.ruler.getRules('paragraph') 5859 const oldParentType = state.parentType 5860 let nextLine = startLine + 1 5861 state.parentType = 'paragraph' 5862 5863 // jump line-by-line until empty one or EOF 5864 for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { 5865 // this would be a code block normally, but after paragraph 5866 // it's considered a lazy continuation regardless of what's there 5867 if (state.sCount[nextLine] - state.blkIndent > 3) { continue } 5868 5869 // quirk for blockquotes, this line should already be checked by that rule 5870 if (state.sCount[nextLine] < 0) { continue } 5871 5872 // Some tags can terminate paragraph without empty line. 5873 let terminate = false 5874 for (let i = 0, l = terminatorRules.length; i < l; i++) { 5875 if (terminatorRules[i](state, nextLine, endLine, true)) { 5876 terminate = true 5877 break 5878 } 5879 } 5880 if (terminate) { break } 5881 } 5882 5883 const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false)) 5884 5885 state.line = nextLine 5886 5887 const token_o = state.push('paragraph_open', 'p', 1) 5888 token_o.map = [startLine, state.line] 5889 5890 const token_i = state.push('inline', '', 0) 5891 token_i.content = content 5892 token_i.map = [startLine, state.line] 5893 token_i.children = [] 5894 5895 state.push('paragraph_close', 'p', -1) 5896 5897 state.parentType = oldParentType 5898 5899 return true 5900} 5901 5902;// ./node_modules/markdown-it/lib/parser_block.mjs 5903/** internal 5904 * class ParserBlock 5905 * 5906 * Block-level tokenizer. 5907 **/ 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924const parser_block_rules = [ 5925 // First 2 params - rule name & source. Secondary array - list of rules, 5926 // which can be terminated by this one. 5927 ['table', table, ['paragraph', 'reference']], 5928 ['code', code], 5929 ['fence', fence, ['paragraph', 'reference', 'blockquote', 'list']], 5930 ['blockquote', blockquote, ['paragraph', 'reference', 'blockquote', 'list']], 5931 ['hr', hr, ['paragraph', 'reference', 'blockquote', 'list']], 5932 ['list', list, ['paragraph', 'reference', 'blockquote']], 5933 ['reference', reference], 5934 ['html_block', html_block, ['paragraph', 'reference', 'blockquote']], 5935 ['heading', heading, ['paragraph', 'reference', 'blockquote']], 5936 ['lheading', lheading], 5937 ['paragraph', paragraph] 5938] 5939 5940/** 5941 * new ParserBlock() 5942 **/ 5943function ParserBlock () { 5944 /** 5945 * ParserBlock#ruler -> Ruler 5946 * 5947 * [[Ruler]] instance. Keep configuration of block rules. 5948 **/ 5949 this.ruler = new ruler() 5950 5951 for (let i = 0; i < parser_block_rules.length; i++) { 5952 this.ruler.push(parser_block_rules[i][0], parser_block_rules[i][1], { alt: (parser_block_rules[i][2] || []).slice() }) 5953 } 5954} 5955 5956// Generate tokens for input range 5957// 5958ParserBlock.prototype.tokenize = function (state, startLine, endLine) { 5959 const rules = this.ruler.getRules('') 5960 const len = rules.length 5961 const maxNesting = state.md.options.maxNesting 5962 let line = startLine 5963 let hasEmptyLines = false 5964 5965 while (line < endLine) { 5966 state.line = line = state.skipEmptyLines(line) 5967 if (line >= endLine) { break } 5968 5969 // Termination condition for nested calls. 5970 // Nested calls currently used for blockquotes & lists 5971 if (state.sCount[line] < state.blkIndent) { break } 5972 5973 // If nesting level exceeded - skip tail to the end. That's not ordinary 5974 // situation and we should not care about content. 5975 if (state.level >= maxNesting) { 5976 state.line = endLine 5977 break 5978 } 5979 5980 // Try all possible rules. 5981 // On success, rule should: 5982 // 5983 // - update `state.line` 5984 // - update `state.tokens` 5985 // - return true 5986 const prevLine = state.line 5987 let ok = false 5988 5989 for (let i = 0; i < len; i++) { 5990 ok = rules[i](state, line, endLine, false) 5991 if (ok) { 5992 if (prevLine >= state.line) { 5993 throw new Error("block rule didn't increment state.line") 5994 } 5995 break 5996 } 5997 } 5998 5999 // this can only happen if user disables paragraph rule 6000 if (!ok) throw new Error('none of the block rules matched') 6001 6002 // set state.tight if we had an empty line before current tag 6003 // i.e. latest empty line should not count 6004 state.tight = !hasEmptyLines 6005 6006 // paragraph might "eat" one newline after it in nested lists 6007 if (state.isEmpty(state.line - 1)) { 6008 hasEmptyLines = true 6009 } 6010 6011 line = state.line 6012 6013 if (line < endLine && state.isEmpty(line)) { 6014 hasEmptyLines = true 6015 line++ 6016 state.line = line 6017 } 6018 } 6019} 6020 6021/** 6022 * ParserBlock.parse(str, md, env, outTokens) 6023 * 6024 * Process input string and push block tokens into `outTokens` 6025 **/ 6026ParserBlock.prototype.parse = function (src, md, env, outTokens) { 6027 if (!src) { return } 6028 6029 const state = new this.State(src, md, env, outTokens) 6030 6031 this.tokenize(state, state.line, state.lineMax) 6032} 6033 6034ParserBlock.prototype.State = state_block 6035 6036/* harmony default export */ const parser_block = (ParserBlock); 6037 6038;// ./node_modules/markdown-it/lib/rules_inline/state_inline.mjs 6039// Inline parser state 6040 6041 6042 6043 6044function StateInline (src, md, env, outTokens) { 6045 this.src = src 6046 this.env = env 6047 this.md = md 6048 this.tokens = outTokens 6049 this.tokens_meta = Array(outTokens.length) 6050 6051 this.pos = 0 6052 this.posMax = this.src.length 6053 this.level = 0 6054 this.pending = '' 6055 this.pendingLevel = 0 6056 6057 // Stores { start: end } pairs. Useful for backtrack 6058 // optimization of pairs parse (emphasis, strikes). 6059 this.cache = {} 6060 6061 // List of emphasis-like delimiters for current tag 6062 this.delimiters = [] 6063 6064 // Stack of delimiter lists for upper level tags 6065 this._prev_delimiters = [] 6066 6067 // backtick length => last seen position 6068 this.backticks = {} 6069 this.backticksScanned = false 6070 6071 // Counter used to disable inline linkify-it execution 6072 // inside <a> and markdown links 6073 this.linkLevel = 0 6074} 6075 6076// Flush pending text 6077// 6078StateInline.prototype.pushPending = function () { 6079 const token = new lib_token('text', '', 0) 6080 token.content = this.pending 6081 token.level = this.pendingLevel 6082 this.tokens.push(token) 6083 this.pending = '' 6084 return token 6085} 6086
6087// Push new token to "stream". 6088// If pending text exists - flush it as text token 6089// 6090StateInline.prototype.push = function (type, tag, nesting) { 6091 if (this.pending) { 6092 this.pushPending() 6093 } 6094 6095 const token = new lib_token(type, tag, nesting) 6096 let token_meta = null 6097 6098 if (nesting < 0) { 6099 // closing tag 6100 this.level-- 6101 this.delimiters = this._prev_delimiters.pop() 6102 } 6103 6104 token.level = this.level 6105 6106 if (nesting > 0) { 6107 // opening tag 6108 this.level++ 6109 this._prev_delimiters.push(this.delimiters) 6110 this.delimiters = [] 6111 token_meta = { delimiters: this.delimiters } 6112 } 6113 6114 this.pendingLevel = this.level 6115 this.tokens.push(token) 6116 this.tokens_meta.push(token_meta) 6117 return token 6118} 6119 6120// Scan a sequence of emphasis-like markers, and determine whether 6121// it can start an emphasis sequence or end an emphasis sequence. 6122// 6123// - start - position to scan from (it should point at a valid marker); 6124// - canSplitWord - determine if these markers can be found inside a word 6125// 6126StateInline.prototype.scanDelims = function (start, canSplitWord) { 6127 const max = this.posMax 6128 const marker = this.src.charCodeAt(start) 6129 6130 // Astral characters below are combined manually, because .codePointAt() 6131 // does not guarantee numeric type output. And we don't wish JIT cache issues. 6132 // The broken surrogate pairs are evaluated as U+FFFD to prevent possible 6133 // crashes. 6134 6135 let lastChar 6136 if (start === 0) { 6137 // treat beginning of the line as a whitespace 6138 lastChar = 0x20 6139 } else if (start === 1) { 6140 lastChar = this.src.charCodeAt(0) 6141 if ((lastChar & 0xF800) === 0xD800) { lastChar = 0xFFFD } 6142 } else { 6143 lastChar = this.src.charCodeAt(start - 1) 6144 if ((lastChar & 0xFC00) === 0xDC00) { 6145 // low surrogate => add high one, replace broken pair with U+FFFD 6146 const highSurr = this.src.charCodeAt(start - 2) 6147 lastChar = (highSurr & 0xFC00) === 0xD800 6148 ? 0x10000 + ((highSurr - 0xD800) << 10) + (lastChar - 0xDC00) 6149 : 0xFFFD 6150 } else if ((lastChar & 0xFC00) === 0xD800) { 6151 lastChar = 0xFFFD 6152 } 6153 } 6154 6155 let pos = start 6156 while (pos < max && this.src.charCodeAt(pos) === marker) { pos++ } 6157 6158 const count = pos - start 6159 6160 // treat end of the line as a whitespace 6161 let nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20 6162 if ((nextChar & 0xFC00) === 0xD800) { 6163 // high surrogate => add low one, replace broken pair with U+FFFD 6164 const lowSurr = this.src.charCodeAt(pos + 1) 6165 nextChar = (lowSurr & 0xFC00) === 0xDC00 6166 ? 0x10000 + ((nextChar - 0xD800) << 10) + (lowSurr - 0xDC00) 6167 : 0xFFFD 6168 } else if ((nextChar & 0xFC00) === 0xDC00) { 6169 nextChar = 0xFFFD 6170 } 6171 6172 const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar) 6173 const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar) 6174 6175 const isLastWhiteSpace = isWhiteSpace(lastChar) 6176 const isNextWhiteSpace = isWhiteSpace(nextChar) 6177 6178 const left_flanking = 6179 !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar) 6180 const right_flanking = 6181 !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar) 6182 6183 const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar) 6184 const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar) 6185 6186 return { can_open, can_close, length: count } 6187} 6188 6189// re-export Token class to use in block rules 6190StateInline.prototype.Token = lib_token 6191 6192/* harmony default export */ const state_inline = (StateInline); 6193 6194;// ./node_modules/markdown-it/lib/rules_inline/text.mjs 6195// Skip text characters for text token, place those to pending buffer 6196// and increment current pos 6197 6198// Rule to skip pure text 6199// '{}$%@~+=:' reserved for extentions 6200 6201// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ 6202 6203// !!!! Don't confuse with "Markdown ASCII Punctuation" chars 6204// http://spec.commonmark.org/0.15/#ascii-punctuation-character 6205function isTerminatorChar (ch) { 6206 switch (ch) { 6207 case 0x0A/* \n */: 6208 case 0x21/* ! */: 6209 case 0x23/* # */: 6210 case 0x24/* $ */: 6211 case 0x25/* % */: 6212 case 0x26/* & */: 6213 case 0x2A/* * */: 6214 case 0x2B/* + */: 6215 case 0x2D/* - */: 6216 case 0x3A/* : */: 6217 case 0x3C/* < */: 6218 case 0x3D/* = */: 6219 case 0x3E/* > */: 6220 case 0x40/* @ */: 6221 case 0x5B/* [ */: 6222 case 0x5C/* \ */: 6223 case 0x5D/* ] */: 6224 case 0x5E/* ^ */: 6225 case 0x5F/* _ */: 6226 case 0x60/* ` */: 6227 case 0x7B/* { */: 6228 case 0x7D/* } */: 6229 case 0x7E/* ~ */: 6230 return true 6231 default: 6232 return false 6233 } 6234} 6235 6236function text_text (state, silent) { 6237 let pos = state.pos 6238 6239 while (pos < state.posMax && !isTerminatorChar(state.src.charCo
6239deAt(pos))) { 6240 pos++ 6241 } 6242 6243 if (pos === state.pos) { return false } 6244 6245 if (!silent) { state.pending += state.src.slice(state.pos, pos) } 6246 6247 state.pos = pos 6248 6249 return true 6250} 6251 6252// Alternative implementation, for memory. 6253// 6254// It costs 10% of performance, but allows extend terminators list, if place it 6255// to `ParserInline` property. Probably, will switch to it sometime, such 6256// flexibility required. 6257 6258/* 6259var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/; 6260 6261module.exports = function text(state, silent) { 6262 var pos = state.pos, 6263 idx = state.src.slice(pos).search(TERMINATOR_RE); 6264 6265 // first char is terminator -> empty text 6266 if (idx === 0) { return false; } 6267 6268 // no terminator -> text till end of string 6269 if (idx < 0) { 6270 if (!silent) { state.pending += state.src.slice(pos); } 6271 state.pos = state.src.length; 6272 return true; 6273 } 6274 6275 if (!silent) { state.pending += state.src.slice(pos, pos + idx); } 6276 6277 state.pos += idx; 6278 6279 return true; 6280}; */ 6281 6282;// ./node_modules/markdown-it/lib/rules_inline/linkify.mjs 6283// Process links like https://example.org/ 6284 6285// RFC3986: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) 6286const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i 6287 6288function linkify_linkify (state, silent) { 6289 if (!state.md.options.linkify) return false 6290 if (state.linkLevel > 0) return false 6291 6292 const pos = state.pos 6293 const max = state.posMax 6294 6295 if (pos + 3 > max) return false 6296 if (state.src.charCodeAt(pos) !== 0x3A/* : */) return false 6297 if (state.src.charCodeAt(pos + 1) !== 0x2F/* / */) return false 6298 if (state.src.charCodeAt(pos + 2) !== 0x2F/* / */) return false 6299 6300 const match = state.pending.match(SCHEME_RE) 6301 if (!match) return false 6302 6303 const proto = match[1] 6304 6305 const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length)) 6306 if (!link) return false 6307 6308 let url = link.url 6309 6310 // invalid link, but still detected by linkify somehow; 6311 // need to check to prevent infinite loop below 6312 if (url.length <= proto.length) return false 6313 6314 // disallow '*' at the end of the link (conflicts with emphasis) 6315 // do manual backsearch to avoid perf issues with regex /\*+$/ on "****...****a". 6316 let urlEnd = url.length 6317 while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 0x2A/* * */) { 6318 urlEnd-- 6319 } 6320 if (urlEnd !== url.length) { 6321 url = url.slice(0, urlEnd) 6322 } 6323 6324 const fullUrl = state.md.normalizeLink(url) 6325 if (!state.md.validateLink(fullUrl)) return false 6326 6327 if (!silent) { 6328 state.pending = state.pending.slice(0, -proto.length) 6329 6330 const token_o = state.push('link_open', 'a', 1) 6331 token_o.attrs = [['href', fullUrl]] 6332 token_o.markup = 'linkify' 6333 token_o.info = 'auto' 6334 6335 const token_t = state.push('text', '', 0) 6336 token_t.content = state.md.normalizeLinkText(url) 6337 6338 const token_c = state.push('link_close', 'a', -1) 6339 token_c.markup = 'linkify' 6340 token_c.info = 'auto' 6341 } 6342 6343 state.pos += url.length - proto.length 6344 return true 6345} 6346 6347;// ./node_modules/markdown-it/lib/rules_inline/newline.mjs 6348// Proceess '\n' 6349 6350 6351 6352function newline (state, silent) { 6353 let pos = state.pos 6354 6355 if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false } 6356 6357 const pmax = state.pending.length - 1 6358 const max = state.posMax 6359 6360 // ' \n' -> hardbreak 6361 // Lookup in pending chars is bad practice! Don't copy to other rules! 6362 // Pending string is stored in concat mode, indexed lookups will cause 6363 // convertion to flat mode. 6364 if (!silent) { 6365 if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) { 6366 if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) { 6367 // Find whitespaces tail of pending chars. 6368 let ws = pmax - 1 6369 while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws-- 6370 6371 state.pending = state.pending.slice(0, ws) 6372 state.push('hardbreak', 'br', 0) 6373 } else { 6374 state.pending = state.pending.slice(0, -1) 6375 state.push('softbreak', 'br', 0) 6376 } 6377 } else { 6378 state.push('softbreak', 'br', 0) 6379 } 6380 } 6381 6382 pos++ 6383 6384 // skip heading spaces for next line 6385 while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++ } 6386 6387 state.pos = pos 6388 return true 6389} 6390 6391;// ./node_modules/markdown-it/lib/rules_inline/escape.mjs 6392// Process escaped chars and hardbreaks 6393 6394 6395 6396const ESCAPED = [] 6397 6398for (let i = 0; i < 256; i++) { ESCAPED.push(0) } 6399 6400'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
6401 .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1 }) 6402 6403function rules_inline_escape_escape (state, silent) { 6404 let pos = state.pos 6405 const max = state.posMax 6406 6407 if (state.src.charCodeAt(pos) !== 0x5C/* \ */) return false 6408 pos++ 6409 6410 // '\' at the end of the inline block 6411 if (pos >= max) return false 6412 6413 let ch1 = state.src.charCodeAt(pos) 6414 6415 if (ch1 === 0x0A) { 6416 if (!silent) { 6417 state.push('hardbreak', 'br', 0) 6418 } 6419 6420 pos++ 6421 // skip leading whitespaces from next line 6422 while (pos < max) { 6423 ch1 = state.src.charCodeAt(pos) 6424 if (!isSpace(ch1)) break 6425 pos++ 6426 } 6427 6428 state.pos = pos 6429 return true 6430 } 6431 6432 let escapedStr = state.src[pos] 6433 6434 if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) { 6435 const ch2 = state.src.charCodeAt(pos + 1) 6436 6437 if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { 6438 escapedStr += state.src[pos + 1] 6439 pos++ 6440 } 6441 } 6442 6443 const origStr = '\\' + escapedStr 6444 6445 if (!silent) { 6446 const token = state.push('text_special', '', 0) 6447 6448 if (ch1 < 256 && ESCAPED[ch1] !== 0) { 6449 token.content = escapedStr 6450 } else { 6451 token.content = origStr 6452 } 6453 6454 token.markup = origStr 6455 token.info = 'escape' 6456 } 6457 6458 state.pos = pos + 1 6459 return true 6460} 6461 6462;// ./node_modules/markdown-it/lib/rules_inline/backticks.mjs 6463// Parse backticks 6464 6465function backtick (state, silent) { 6466 let pos = state.pos 6467 const ch = state.src.charCodeAt(pos) 6468 6469 if (ch !== 0x60/* ` */) { return false } 6470 6471 const start = pos 6472 pos++ 6473 const max = state.posMax 6474 6475 // scan marker length 6476 while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++ } 6477 6478 const marker = state.src.slice(start, pos) 6479 const openerLength = marker.length 6480 6481 if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) { 6482 if (!silent) state.pending += marker 6483 state.pos += openerLength 6484 return true 6485 } 6486 6487 let matchEnd = pos 6488 let matchStart 6489 6490 // Nothing found in the cache, scan until the end of the line (or until marker is found) 6491 while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) { 6492 matchEnd = matchStart + 1 6493 6494 // scan marker length 6495 while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++ } 6496 6497 const closerLength = matchEnd - matchStart 6498 6499 if (closerLength === openerLength) { 6500 // Found matching closer length. 6501 if (!silent) { 6502 const token = state.push('code_inline', 'code', 0) 6503 token.markup = marker 6504 token.content = state.src.slice(pos, matchStart) 6505 .replace(/\n/g, ' ') 6506 .replace(/^ (.+) $/, '$1') 6507 } 6508 state.pos = matchEnd 6509 return true 6510 } 6511 6512 // Some different length found, put it in cache as upper limit of where closer can be found 6513 state.backticks[closerLength] = matchStart 6514 } 6515 6516 // Scanned through the end, didn't find anything 6517 state.backticksScanned = true 6518 6519 if (!silent) state.pending += marker 6520 state.pos += openerLength 6521 return true 6522} 6523 6524;// ./node_modules/markdown-it/lib/rules_inline/strikethrough.mjs 6525// ~~strike through~~ 6526// 6527 6528// Insert each marker as a separate text token, and add it to delimiter list 6529// 6530function strikethrough_tokenize (state, silent) { 6531 const start = state.pos 6532 const marker = state.src.charCodeAt(start) 6533 6534 if (silent) { return false } 6535 6536 if (marker !== 0x7E/* ~ */) { return false } 6537 6538 const scanned = state.scanDelims(state.pos, true) 6539 let len = scanned.length 6540 const ch = String.fromCharCode(marker) 6541 6542 if (len < 2) { return false } 6543 6544 let token 6545 6546 if (len % 2) { 6547 token = state.push('text', '', 0) 6548 token.content = ch 6549 len-- 6550 } 6551 6552 for (let i = 0; i < len; i += 2) { 6553 token = state.push('text', '', 0) 6554 token.content = ch + ch 6555 6556 state.delimiters.push({ 6557 marker, 6558 length: 0, // disable "rule of 3" length checks meant for emphasis 6559 token: state.tokens.length - 1, 6560 end: -1, 6561 open: scanned.can_open, 6562 close: scanned.can_close 6563 }) 6564 } 6565 6566 state.pos += scanned.length 6567 6568 return true 6569} 6570 6571function postProcess (state, delimiters) { 6572 let token 6573 const loneMarkers = [] 6574 const max = delimiters.length 6575 6576 for (let i = 0; i < max; i++) { 6577 const startDelim = delimiters[i] 6578 6579 if (startDelim.marker !== 0x7E/* ~ */) { 6580 continue 6581 } 6582 6583 if (startDelim.end === -1) { 6584 continue 6585 } 6586 6587 const endDelim = delimiters[startDelim.end] 6588 6589 token = state.tokens[startDelim.token] 6590 token.type = 's_open' 6591 token.tag = 's' 6592 token.nesting = 1 6593 token.markup = '~~' 6594 token.content = '' 6595 6596 token = state.tokens[endDelim.token] 6597 token.type = 's_close' 6598 token.tag = 's' 6599 token.nesting = -1 6600 token.markup = '~~' 6601 token.content = '' 6602 6603 if (state.tokens[endDelim.token - 1].type === 'text' && 6604 state.tokens[endDelim.token - 1].content === '~') { 6605 loneMarkers.push(endDelim.token - 1) 6606 } 6607 } 6608 6609 // If a marker sequence has an odd number of characters, it's splitted 6610 // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the 6611 // start of the sequence. 6612 // 6613 // So, we have to move all those markers after subsequent s_close tags. 6614 // 6615 while (loneMarkers.length) { 6616 const i = loneMarkers.pop() 6617 let j = i + 1 6618 6619 while (j < state.tokens.length && state.tokens[j].type === 's_close') { 6620 j++ 6621 } 6622 6623 j-- 6624 6625 if (i !== j) { 6626 token = state.tokens[j] 6627 state.tokens[j] = state.tokens[i] 6628 state.tokens[i] = token 6629 } 6630 } 6631} 6632 6633// Walk through delimiter list and replace text tokens with tags 6634// 6635function strikethrough_postProcess (state) { 6636 const tokens_meta = state.tokens_meta 6637 const max = state.tokens_meta.length 6638 6639 postProcess(state, state.delimiters) 6640 6641 for (let curr = 0; curr < max; curr++) { 6642 if (tokens_meta[curr] && tokens_meta[curr].delimiters) { 6643 postProcess(state, tokens_meta[curr].delimiters) 6644 } 6645 } 6646} 6647 6648/* harmony default export */ const strikethrough = ({ 6649 tokenize: strikethrough_tokenize, 6650 postProcess: strikethrough_postProcess 6651}); 6652 6653;// ./node_modules/markdown-it/lib/rules_inline/emphasis.mjs 6654// Process *this* and _that_ 6655// 6656 6657// Insert each marker as a separate text token, and add it to delimiter list 6658// 6659function emphasis_tokenize (state, silent) { 6660 const start = state.pos
6661 const marker = state.src.charCodeAt(start) 6662 6663 if (silent) { return false } 6664 6665 if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false } 6666 6667 const scanned = state.scanDelims(state.pos, marker === 0x2A) 6668 6669 for (let i = 0; i < scanned.length; i++) { 6670 const token = state.push('text', '', 0) 6671 token.content = String.fromCharCode(marker) 6672 6673 state.delimiters.push({ 6674 // Char code of the starting marker (number). 6675 // 6676 marker, 6677 6678 // Total length of these series of delimiters. 6679 // 6680 length: scanned.length, 6681 6682 // A position of the token this delimiter corresponds to. 6683 // 6684 token: state.tokens.length - 1, 6685 6686 // If this delimiter is matched as a valid opener, `end` will be 6687 // equal to its position, otherwise it's `-1`. 6688 // 6689 end: -1, 6690 6691 // Boolean flags that determine if this delimiter could open or close 6692 // an emphasis. 6693 // 6694 open: scanned.can_open, 6695 close: scanned.can_close 6696 }) 6697 } 6698 6699 state.pos += scanned.length 6700 6701 return true 6702} 6703 6704function emphasis_postProcess (state, delimiters) { 6705 const max = delimiters.length 6706 6707 for (let i = max - 1; i >= 0; i--) { 6708 const startDelim = delimiters[i] 6709 6710 if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) { 6711 continue 6712 } 6713 6714 // Process only opening markers 6715 if (startDelim.end === -1) { 6716 continue 6717 } 6718 6719 const endDelim = delimiters[startDelim.end] 6720 6721 // If the previous delimiter has the same marker and is adjacent to this one, 6722 // merge those into one strong delimiter. 6723 // 6724 // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>` 6725 // 6726 const isStrong = i > 0 && 6727 delimiters[i - 1].end === startDelim.end + 1 && 6728 // check that first two markers match and adjacent 6729 delimiters[i - 1].marker === startDelim.marker && 6730 delimiters[i - 1].token === startDelim.token - 1 && 6731 // check that last two markers are adjacent (we can safely assume they match) 6732 delimiters[startDelim.end + 1].token === endDelim.token + 1 6733 6734 const ch = String.fromCharCode(startDelim.marker) 6735 6736 const token_o = state.tokens[startDelim.token] 6737 token_o.type = isStrong ? 'strong_open' : 'em_open' 6738 token_o.tag = isStrong ? 'strong' : 'em' 6739 token_o.nesting = 1 6740 token_o.markup = isStrong ? ch + ch : ch 6741 token_o.content = '' 6742 6743 const token_c = state.tokens[endDelim.token] 6744 token_c.type = isStrong ? 'strong_close' : 'em_close' 6745 token_c.tag = isStrong ? 'strong' : 'em' 6746 token_c.nesting = -1 6747 token_c.markup = isStrong ? ch + ch : ch 6748 token_c.content = '' 6749 6750 if (isStrong) { 6751 state.tokens[delimiters[i - 1].token].content = '' 6752 state.tokens[delimiters[startDelim.end + 1].token].content = '' 6753 i-- 6754 } 6755 } 6756} 6757 6758// Walk through delimiter list and replace text tokens with tags 6759// 6760function emphasis_post_process (state) { 6761 const tokens_meta = state.tokens_meta 6762 const max = state.tokens_meta.length 6763 6764 emphasis_postProcess(state, state.delimiters) 6765 6766 for (let curr = 0; curr < max; curr++) { 6767 if (tokens_meta[curr] && tokens_meta[curr].delimiters) { 6768 emphasis_postProcess(state, tokens_meta[curr].delimiters) 6769 } 6770 } 6771} 6772 6773/* harmony default export */ const emphasis = ({ 6774 tokenize: emphasis_tokenize, 6775 postProcess: emphasis_post_process 6776}); 6777 6778;// ./node_modules/markdown-it/lib/rules_inline/link.mjs 6779// Process [link](<to> "stuff") 6780 6781 6782 6783function link_link (state, silent) { 6784 let code, label, res, ref 6785 let href = '' 6786 let title = '' 6787 let start = state.pos 6788 let parseReference = true 6789 6790 if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false } 6791 6792 const oldPos = state.pos 6793 const max = state.posMax 6794 const labelStart = state.pos + 1 6795 const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true) 6796 6797 // parser failed to find ']', so it's not a valid link 6798 if (labelEnd < 0) { return false } 6799 6800 let pos = labelEnd + 1 6801 if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) { 6802 // 6803 // Inline link 6804 // 6805 6806 // might have found a valid shortcut link, disable reference parsing 6807 parseReference = false 6808 6809 // [link]( <href> "title" ) 6810 // ^^ skipping these spaces 6811 pos++ 6812 for (; pos < max; pos++) {
6813 code = state.src.charCodeAt(pos) 6814 if (!isSpace(code) && code !== 0x0A) { break } 6815 } 6816 if (pos >= max) { return false } 6817 6818 // [link]( <href> "title" ) 6819 // ^^^^^^ parsing link destination 6820 start = pos 6821 res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax) 6822 if (res.ok) { 6823 href = state.md.normalizeLink(res.str) 6824 if (state.md.validateLink(href)) { 6825 pos = res.pos 6826 } else { 6827 href = '' 6828 } 6829 6830 // [link]( <href> "title" ) 6831 // ^^ skipping these spaces 6832 start = pos 6833 for (; pos < max; pos++) { 6834 code = state.src.charCodeAt(pos) 6835 if (!isSpace(code) && code !== 0x0A) { break } 6836 } 6837 6838 // [link]( <href> "title" ) 6839 // ^^^^^^^ parsing link title 6840 res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax) 6841 if (pos < max && start !== pos && res.ok) { 6842 title = res.str 6843 pos = res.pos 6844 6845 // [link]( <href> "title" ) 6846 // ^^ skipping these spaces 6847 for (; pos < max; pos++) { 6848 code = state.src.charCodeAt(pos) 6849 if (!isSpace(code) && code !== 0x0A) { break } 6850 } 6851 } 6852 } 6853 6854 if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) { 6855 // parsing a valid shortcut link failed, fallback to reference 6856 parseReference = true 6857 } 6858 pos++ 6859 } 6860 6861 if (parseReference) { 6862 // 6863 // Link reference 6864 // 6865 if (typeof state.env.references === 'undefined') { return false } 6866 6867 if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) { 6868 start = pos + 1 6869 pos = state.md.helpers.parseLinkLabel(state, pos) 6870 if (pos >= 0) { 6871 label = state.src.slice(start, pos++) 6872 } else { 6873 pos = labelEnd + 1 6874 } 6875 } else { 6876 pos = labelEnd + 1 6877 } 6878 6879 // covers label === '' and label === undefined 6880 // (collapsed reference link and shortcut reference link respectively) 6881 if (!label) { label = state.src.slice(labelStart, labelEnd) } 6882 6883 ref = state.env.references[normalizeReference(label)] 6884 if (!ref) { 6885 state.pos = oldPos 6886 return false 6887 } 6888 href = ref.href 6889 title = ref.title 6890 } 6891 6892 // 6893 // We found the end of the link, and know for a fact it's a valid link; 6894 // so all that's left to do is to call tokenizer. 6895 // 6896 if (!silent) { 6897 state.pos = labelStart 6898 state.posMax = labelEnd 6899 6900 const token_o = state.push('link_open', 'a', 1) 6901 const attrs = [['href', href]] 6902 token_o.attrs = attrs 6903 if (title) { 6904 attrs.push(['title', title]) 6905 } 6906 6907 state.linkLevel++ 6908 state.md.inline.tokenize(state) 6909 state.linkLevel-- 6910 6911 state.push('link_close', 'a', -1) 6912 } 6913 6914 state.pos = pos 6915 state.posMax = max 6916 return true 6917} 6918 6919;// ./node_modules/markdown-it/lib/rules_inline/image.mjs 6920// Process  6921 6922 6923 6924function image_image (state, silent) { 6925 let code, content, label, pos, ref, res, title, start 6926 let href = '' 6927 const oldPos = state.pos 6928 const max = state.posMax 6929 6930 if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false } 6931 if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false } 6932 6933 const labelStart = state.pos + 2 6934 const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false) 6935 6936 // parser failed to find ']', so it's not a valid link 6937 if (labelEnd < 0) { return false } 6938 6939 pos = labelEnd + 1 6940 if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) { 6941 // 6942 // Inline link 6943 // 6944 6945 // [link]( <href> "title" ) 6946 // ^^ skipping these spaces 6947 pos++ 6948 for (; pos < max; pos++) { 6949 code = state.src.charCodeAt(pos) 6950 if (!isSpace(code) && code !== 0x0A) { break } 6951 } 6952 if (pos >= max) { return false } 6953 6954 // [link]( <href> "title" ) 6955 // ^^^^^^ parsing link destination 6956 start = pos 6957 res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax) 6958 if (res.ok) { 6959 href = state.md.normalizeLink(res.str) 6960 if (state.md.validateLink(href)) { 6961 pos = res.pos 6962 } else { 6963 href = '' 6964 } 6965 } 6966 6967 // [link]( <href> "title" ) 6968 // ^^ skipping these spaces 6969 start = pos 6970 for (; pos < max; pos++) {
6971 code = state.src.charCodeAt(pos) 6972 if (!isSpace(code) && code !== 0x0A) { break } 6973 } 6974 6975 // [link]( <href> "title" ) 6976 // ^^^^^^^ parsing link title 6977 res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax) 6978 if (pos < max && start !== pos && res.ok) { 6979 title = res.str 6980 pos = res.pos 6981 6982 // [link]( <href> "title" ) 6983 // ^^ skipping these spaces 6984 for (; pos < max; pos++) { 6985 code = state.src.charCodeAt(pos) 6986 if (!isSpace(code) && code !== 0x0A) { break } 6987 } 6988 } else { 6989 title = '' 6990 } 6991 6992 if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) { 6993 state.pos = oldPos 6994 return false 6995 } 6996 pos++ 6997 } else { 6998 // 6999 // Link reference 7000 // 7001 if (typeof state.env.references === 'undefined') { return false } 7002 7003 if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) { 7004 start = pos + 1 7005 pos = state.md.helpers.parseLinkLabel(state, pos) 7006 if (pos >= 0) { 7007 label = state.src.slice(start, pos++) 7008 } else { 7009 pos = labelEnd + 1 7010 } 7011 } else { 7012 pos = labelEnd + 1 7013 } 7014 7015 // covers label === '' and label === undefined 7016 // (collapsed reference link and shortcut reference link respectively) 7017 if (!label) { label = state.src.slice(labelStart, labelEnd) } 7018 7019 ref = state.env.references[normalizeReference(label)] 7020 if (!ref) { 7021 state.pos = oldPos 7022 return false 7023 } 7024 href = ref.href 7025 title = ref.title 7026 } 7027 7028 // 7029 // We found the end of the link, and know for a fact it's a valid link; 7030 // so all that's left to do is to call tokenizer. 7031 // 7032 if (!silent) { 7033 content = state.src.slice(labelStart, labelEnd) 7034 7035 const tokens = [] 7036 state.md.inline.parse( 7037 content, 7038 state.md, 7039 state.env, 7040 tokens 7041 ) 7042 7043 const token = state.push('image', 'img', 0) 7044 const attrs = [['src', href], ['alt', '']] 7045 token.attrs = attrs 7046 token.children = tokens 7047 token.content = content 7048 7049 if (title) { 7050 attrs.push(['title', title]) 7051 } 7052 } 7053 7054 state.pos = pos 7055 state.posMax = max 7056 return true 7057} 7058 7059;// ./node_modules/markdown-it/lib/rules_inline/autolink.mjs 7060// Process autolinks '<protocol:...>' 7061 7062/* eslint max-len:0 */ 7063const EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/ 7064/* eslint-disable-next-line no-control-regex */ 7065const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/ 7066 7067function autolink (state, silent) { 7068 let pos = state.pos 7069 7070 if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false } 7071 7072 const start = state.pos 7073 const max = state.posMax 7074 7075 for (;;) { 7076 if (++pos >= max) return false 7077 7078 const ch = state.src.charCodeAt(pos) 7079 7080 if (ch === 0x3C /* < */) return false 7081 if (ch === 0x3E /* > */) break 7082 } 7083 7084 const url = state.src.slice(start + 1, pos) 7085 7086 if (AUTOLINK_RE.test(url)) { 7087 const fullUrl = state.md.normalizeLink(url) 7088 if (!state.md.validateLink(fullUrl)) { return false } 7089 7090 if (!silent) { 7091 const token_o = state.push('link_open', 'a', 1) 7092 token_o.attrs = [['href', fullUrl]] 7093 token_o.markup = 'autolink' 7094 token_o.info = 'auto' 7095 7096 const token_t = state.push('text', '', 0) 7097 token_t.content = state.md.normalizeLinkText(url) 7098 7099 const token_c = state.push('link_close', 'a', -1) 7100 token_c.markup = 'autolink' 7101 token_c.info = 'auto' 7102 } 7103 7104 state.pos += url.length + 2 7105 return true 7106 } 7107 7108 if (EMAIL_RE.test(url)) { 7109 const fullUrl = state.md.normalizeLink('mailto:' + url) 7110 if (!state.md.validateLink(fullUrl)) { return false } 7111 7112 if (!silent) { 7113 const token_o = state.push('link_open', 'a', 1) 7114 token_o.attrs = [['href', fullUrl]] 7115 token_o.markup = 'autolink' 7116 token_o.info = 'auto' 7117 7118 const token_t = state.push('text', '', 0) 7119 token_t.content = state.md.normalizeLinkText(url) 7120 7121 const token_c = state.push('link_close', 'a', -1) 7122 token_c.markup = 'autolink' 7123 token_c.info = 'auto' 7124 } 7125 7126 state.pos += url.length + 2 7127 return true 7128 } 7129 7130 return false 7131} 7132 7133;// ./node_modules/markdown-it/lib/rules_inline/html_inline.mjs 7134// Process html tags 7135 7136 7137 7138function html_inline_isLinkOpen (str) { 7139 return /^<a[>\s]/i.test(str) 7140} 7141function html_inline_isLinkClose (str) { 7142 return /^<\/a\s*>/i.test(str) 7143} 7144 7145function isLetter (ch) { 7146 /* eslint no-bitwise:0 */ 7147 const lc = ch | 0x20 // to lower case 7148 return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */) 7149} 7150 7151function html_inline (state, silent) { 7152 if (!state.md.options.html) { return false } 7153
7154 // Check start 7155 const max = state.posMax 7156 const pos = state.pos 7157 if (state.src.charCodeAt(pos) !== 0x3C/* < */ || 7158 pos + 2 >= max) { 7159 return false 7160 } 7161 7162 // Quick fail on second char 7163 const ch = state.src.charCodeAt(pos + 1) 7164 if (ch !== 0x21/* ! */ && 7165 ch !== 0x3F/* ? */ && 7166 ch !== 0x2F/* / */ && 7167 !isLetter(ch)) { 7168 return false 7169 } 7170 7171 const match = state.src.slice(pos).match(HTML_TAG_RE) 7172 if (!match) { return false } 7173 7174 if (!silent) { 7175 const token = state.push('html_inline', '', 0) 7176 token.content = match[0] 7177 7178 if (html_inline_isLinkOpen(token.content)) state.linkLevel++ 7179 if (html_inline_isLinkClose(token.content)) state.linkLevel-- 7180 } 7181 state.pos += match[0].length 7182 return true 7183} 7184 7185;// ./node_modules/markdown-it/lib/rules_inline/entity.mjs 7186// Process html entity - {, ¯, ", ... 7187 7188 7189 7190 7191const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i 7192const NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i 7193 7194function entity (state, silent) { 7195 const pos = state.pos 7196 const max = state.posMax 7197 7198 if (state.src.charCodeAt(pos) !== 0x26/* & */) return false 7199 7200 if (pos + 1 >= max) return false 7201 7202 const ch = state.src.charCodeAt(pos + 1) 7203 7204 if (ch === 0x23 /* # */) { 7205 const match = state.src.slice(pos).match(DIGITAL_RE) 7206 if (match) { 7207 if (!silent) { 7208 const code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10) 7209 7210 const token = state.push('text_special', '', 0) 7211 token.content = isValidEntityCode(code) ? utils_fromCodePoint(code) : utils_fromCodePoint(0xFFFD) 7212 token.markup = match[0] 7213 token.info = 'entity' 7214 } 7215 state.pos += match[0].length 7216 return true 7217 } 7218 } else { 7219 const match = state.src.slice(pos).match(NAMED_RE) 7220 if (match) { 7221 const decoded = decodeHTMLStrict(match[0]) 7222 if (decoded !== match[0]) { 7223 if (!silent) { 7224 const token = state.push('text_special', '', 0) 7225 token.content = decoded 7226 token.markup = match[0] 7227 token.info = 'entity' 7228 } 7229 state.pos += match[0].length 7230 return true 7231 } 7232 } 7233 } 7234 7235 return false 7236} 7237 7238;// ./node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs 7239// For each opening emphasis-like marker find a matching closing one 7240// 7241 7242function processDelimiters (delimiters) { 7243 const openersBottom = {} 7244 const max = delimiters.length 7245 7246 if (!max) return 7247 7248 // headerIdx is the first delimiter of the current (where closer is) delimiter run 7249 let headerIdx = 0 7250 let lastTokenIdx = -2 // needs any value lower than -1 7251 const jumps = [] 7252 7253 for (let closerIdx = 0; closerIdx < max; closerIdx++) { 7254 const closer = delimiters[closerIdx] 7255 7256 jumps.push(0) 7257 7258 // markers belong to same delimiter run if: 7259 // - they have adjacent tokens 7260 // - AND markers are the same 7261 // 7262 if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) { 7263 headerIdx = closerIdx 7264 } 7265 7266 lastTokenIdx = closer.token 7267 7268 // Length is only used for emphasis-specific "rule of 3", 7269 // if it's not defined (in strikethrough or 3rd party plugins), 7270 // we can default it to 0 to disable those checks. 7271 // 7272 closer.length = closer.length || 0 7273 7274 if (!closer.close) continue 7275 7276 // Previously calculated lower bounds (previous fails) 7277 // for each marker, each delimiter length modulo 3, 7278 // and for whether this closer can be an opener; 7279 // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460 7280 /* eslint-disable-next-line no-prototype-builtins */ 7281 if (!openersBottom.hasOwnProperty(closer.marker)) { 7282 openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1] 7283 } 7284 7285 const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length % 3)] 7286 7287 let openerIdx = headerIdx - jumps[headerIdx] - 1 7288 7289 let newMinOpenerIdx = openerIdx 7290 7291 for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) { 7292 const opener = delimiters[openerIdx] 7293 7294 if (opener.marker !== closer.marker) continue 7295 7296 if (opener.open && opener.end < 0) { 7297 let isOddMatch = false 7298 7299 // from spec: 7300 // 7301 // If one of the delimiters can both open and close emphasis, then the 7302 // sum of the lengths of the delimiter runs containing the opening and 7303 // closing delimiters must not be a multiple of 3 unless both lengths 7304 // are multiples of 3. 7305 // 7306 if (opener.close || closer.open) { 7307 if ((opener.length + closer.length) % 3 === 0) { 7308 if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { 7309 isOddMatch = true 7310 } 7311 } 7312 } 7313 7314 if (!isOddMatch) { 7315 // If previous delimiter cannot be an opener, we can safely ski
7315p 7316 // the entire sequence in future checks. This is required to make 7317 // sure algorithm has linear complexity (see *_*_*_*_*_... case). 7318 // 7319 const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open 7320 ? jumps[openerIdx - 1] + 1 7321 : 0 7322 7323 jumps[closerIdx] = closerIdx - openerIdx + lastJump 7324 jumps[openerIdx] = lastJump 7325 7326 closer.open = false 7327 opener.end = closerIdx 7328 opener.close = false 7329 newMinOpenerIdx = -1 7330 // treat next token as start of run, 7331 // it optimizes skips in **<...>**a**<...>** pathological case 7332 lastTokenIdx = -2 7333 break 7334 } 7335 } 7336 } 7337 7338 if (newMinOpenerIdx !== -1) { 7339 // If match for this delimiter run failed, we want to set lower bound for 7340 // future lookups. This is required to make sure algorithm has linear 7341 // complexity. 7342 // 7343 // See details here: 7344 // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442 7345 // 7346 openersBottom[closer.marker][(closer.open ? 3 : 0) + ((closer.length || 0) % 3)] = newMinOpenerIdx 7347 } 7348 } 7349} 7350 7351function link_pairs (state) { 7352 const tokens_meta = state.tokens_meta 7353 const max = state.tokens_meta.length 7354 7355 processDelimiters(state.delimiters) 7356 7357 for (let curr = 0; curr < max; curr++) { 7358 if (tokens_meta[curr] && tokens_meta[curr].delimiters) { 7359 processDelimiters(tokens_meta[curr].delimiters) 7360 } 7361 } 7362} 7363 7364;// ./node_modules/markdown-it/lib/rules_inline/fragments_join.mjs 7365// Clean up tokens after emphasis and strikethrough postprocessing: 7366// merge adjacent text nodes into one and re-calculate all token levels 7367// 7368// This is necessary because initially emphasis delimiter markers (*, _, ~) 7369// are treated as their own separate text tokens. Then emphasis rule either 7370// leaves them as text (needed to merge with adjacent text) or turns them 7371// into opening/closing tags (which messes up levels inside). 7372// 7373 7374function fragments_join (state) { 7375 let curr, last 7376 let level = 0 7377 const tokens = state.tokens 7378 const max = state.tokens.length 7379 7380 for (curr = last = 0; curr < max; curr++) { 7381 // re-calculate levels after emphasis/strikethrough turns some text nodes 7382 // into opening/closing tags 7383 if (tokens[curr].nesting < 0) level-- // closing tag 7384 tokens[curr].level = level 7385 if (tokens[curr].nesting > 0) level++ // opening tag 7386 7387 if (tokens[curr].type === 'text' && 7388 curr + 1 < max && 7389 tokens[curr + 1].type === 'text') { 7390 // collapse two adjacent text nodes 7391 tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content 7392 } else { 7393 if (curr !== last) { tokens[last] = tokens[curr] } 7394 7395 last++ 7396 } 7397 } 7398 7399 if (curr !== last) { 7400 tokens.length = last 7401 } 7402} 7403 7404;// ./node_modules/markdown-it/lib/parser_inline.mjs 7405/** internal 7406 * class ParserInline 7407 * 7408 * Tokenizes paragraph content. 7409 **/ 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430// Parser rules 7431 7432const parser_inline_rules = [ 7433 ['text', text_text], 7434 ['linkify', linkify_linkify], 7435 ['newline', newline], 7436 ['escape', rules_inline_escape_escape], 7437 ['backticks', backtick], 7438 ['strikethrough', strikethrough.tokenize], 7439 ['emphasis', emphasis.tokenize], 7440 ['link', link_link], 7441 ['image', image_image], 7442 ['autolink', autolink], 7443 ['html_inline', html_inline], 7444 ['entity', entity] 7445] 7446 7447// `rule2` ruleset was created specifically for emphasis/strikethrough 7448// post-processing and may be changed in the future. 7449// 7450// Don't use this for anything except pairs (plugins working with `balance_pairs`). 7451// 7452const _rules2 = [ 7453 ['balance_pairs', link_pairs], 7454 ['strikethrough', strikethrough.postProcess], 7455 ['emphasis', emphasis.postProcess],
7456 // rules for pairs separate '**' into its own text tokens, which may be left unused, 7457 // rule below merges unused segments back with the rest of the text 7458 ['fragments_join', fragments_join] 7459] 7460 7461/** 7462 * new ParserInline() 7463 **/ 7464function ParserInline () { 7465 /** 7466 * ParserInline#ruler -> Ruler 7467 * 7468 * [[Ruler]] instance. Keep configuration of inline rules. 7469 **/ 7470 this.ruler = new ruler() 7471 7472 for (let i = 0; i < parser_inline_rules.length; i++) { 7473 this.ruler.push(parser_inline_rules[i][0], parser_inline_rules[i][1]) 7474 } 7475 7476 /** 7477 * ParserInline#ruler2 -> Ruler 7478 * 7479 * [[Ruler]] instance. Second ruler used for post-processing 7480 * (e.g. in emphasis-like rules). 7481 **/ 7482 this.ruler2 = new ruler() 7483 7484 for (let i = 0; i < _rules2.length; i++) { 7485 this.ruler2.push(_rules2[i][0], _rules2[i][1]) 7486 } 7487} 7488 7489// Skip single token by running all rules in validation mode; 7490// returns `true` if any rule reported success 7491// 7492ParserInline.prototype.skipToken = function (state) { 7493 const pos = state.pos 7494 const rules = this.ruler.getRules('') 7495 const len = rules.length 7496 const maxNesting = state.md.options.maxNesting 7497 const cache = state.cache 7498 7499 if (typeof cache[pos] !== 'undefined') { 7500 state.pos = cache[pos] 7501 return 7502 } 7503 7504 let ok = false 7505 7506 if (state.level < maxNesting) { 7507 for (let i = 0; i < len; i++) { 7508 // Increment state.level and decrement it later to limit recursion. 7509 // It's harmless to do here, because no tokens are created. But ideally, 7510 // we'd need a separate private state variable for this purpose. 7511 // 7512 state.level++ 7513 ok = rules[i](state, true) 7514 state.level-- 7515 7516 if (ok) { 7517 if (pos >= state.pos) { throw new Error("inline rule didn't increment state.pos") } 7518 break 7519 } 7520 } 7521 } else { 7522 // Too much nesting, just skip until the end of the paragraph. 7523 // 7524 // NOTE: this will cause links to behave incorrectly in the following case, 7525 // when an amount of `[` is exactly equal to `maxNesting + 1`: 7526 // 7527 // [[[[[[[[[[[[[[[[[[[[[foo]() 7528 // 7529 // TODO: remove this workaround when CM standard will allow nested links 7530 // (we can replace it by preventing links from being parsed in 7531 // validation mode) 7532 // 7533 state.pos = state.posMax 7534 } 7535 7536 if (!ok) { state.pos++ } 7537 cache[pos] = state.pos 7538} 7539 7540// Generate tokens for input range 7541// 7542ParserInline.prototype.tokenize = function (state) { 7543 const rules = this.ruler.getRules('') 7544 const len = rules.length 7545 const end = state.posMax 7546 const maxNesting = state.md.options.maxNesting 7547 7548 while (state.pos < end) { 7549 // Try all possible rules. 7550 // On success, rule should: 7551 // 7552 // - update `state.pos` 7553 // - update `state.tokens` 7554 // - return true 7555 const prevPos = state.pos 7556 let ok = false 7557 7558 if (state.level < maxNesting) { 7559 for (let i = 0; i < len; i++) { 7560 ok = rules[i](state, false) 7561 if (ok) { 7562 if (prevPos >= state.pos) { throw new Error("inline rule didn't increment state.pos") } 7563 break 7564 } 7565 } 7566 } 7567 7568 if (ok) { 7569 if (state.pos >= end) { break } 7570 continue 7571 } 7572 7573 state.pending += state.src[state.pos++] 7574 } 7575 7576 if (state.pending) { 7577 state.pushPending() 7578 } 7579} 7580 7581/** 7582 * ParserInline.parse(str, md, env, outTokens) 7583 * 7584 * Process input string and push inline tokens into `outTokens` 7585 **/ 7586ParserInline.prototype.parse = function (str, md, env, outTokens) { 7587 const state = new this.State(str, md, env, outTokens) 7588 7589 this.tokenize(state) 7590 7591 const rules = this.ruler2.getRules('') 7592 const len = rules.length 7593 7594 for (let i = 0; i < len; i++) { 7595 rules[i](state) 7596 } 7597} 7598 7599ParserInline.prototype.State = state_inline 7600 7601/* harmony default export */ const parser_inline = (ParserInline); 7602 7603;// ./node_modules/linkify-it/lib/re.mjs 7604Object.defineProperty(lib_re, "name", { value: "default", configurable: true }); 7605 7606 7607/* harmony default export */ function lib_re(opts) { 7608 const re = {} 7609 opts = opts || {} 7610 7611 re.src_Any = Any_regex.source 7612 re.src_Cc = Cc_regex.source 7613 re.src_Z = Z_regex.source 7614 re.src_P = regex.source 7615 7616 // \p{\Z\P\Cc\CF}
7616 (white spaces + control + format + punctuation) 7617 re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|') 7618 7619 // \p{\Z\Cc} (white spaces + control) 7620 re.src_ZCc = [re.src_Z, re.src_Cc].join('|') 7621 7622 // Experimental. List of chars, completely prohibited in links 7623 // because can separate it from other part of text 7624 const text_separators = '[><\uff5c]' 7625 7626 // All possible word characters (everything without punctuation, spaces & controls) 7627 // Defined via punctuation & spaces to save space 7628 // Should be something like \p{\L\N\S\M} (\w but without `_`) 7629 re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')' 7630 // The same as abothe but without [0-9] 7631 // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')'; 7632 7633 re.src_ip4 = 7634 7635 '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' 7636 7637 // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch. 7638 re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?' 7639 7640 re.src_port = 7641 7642 '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?' 7643 7644 re.src_host_terminator = 7645 7646 '(?=$|' + text_separators + '|' + re.src_ZPCc + ')' + 7647 '(?!' + (opts['---'] ? '-(?!--)|' : '-|') + '_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))' 7648 7649 re.src_path = 7650 7651 '(?:' + 7652 '[/?#]' + 7653 '(?:' + 7654 '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-;]).|' + 7655 '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + 7656 '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + 7657 '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + 7658 '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + 7659 "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + 7660 7661 // allow `I'm_king` if no pair found 7662 "\\'(?=" + re.src_pseudo_letter + '|[-])|' + 7663 7664 // google has many dots in "google search" links (#66, #81). 7665 // github has ... in commit range links, 7666 // Restrict to 7667 // - english 7668 // - percent-encoded 7669 // - parts of file path 7670 // - params separator 7671 // until more examples found. 7672 '\\.{2,}[a-zA-Z0-9%/&]|' + 7673 7674 '\\.(?!' + re.src_ZCc + '|[.]|$)|' + 7675 (opts['---'] 7676 ? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate 7677 : '\\-+|' 7678 ) + 7679 // allow `,,,` in paths 7680 ',(?!' + re.src_ZCc + '|$)|' + 7681 7682 // allow `;` if not followed by space-like char 7683 ';(?!' + re.src_ZCc + '|$)|' + 7684 7685 // allow `!!!` in paths, but not at the end 7686 '\\!+(?!' + re.src_ZCc + '|[!]|$)|' + 7687 7688 '\\?(?!' + re.src_ZCc + '|[?]|$)' + 7689 ')+' + 7690 '|\\/' + 7691 ')?' 7692 7693 // Allow anything in markdown spec, forbid quote (") at the first position 7694 // because emails enclosed in quotes are far more common 7695 re.src_email_name = 7696 7697 '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*' 7698 7699 re.src_xn = 7700 7701 'xn--[a-z0-9\\-]{1,59}' 7702 7703 // More to read about domain names 7704 // http://serverfault.com/questions/638260/ 7705 7706 re.src_domain_root = 7707 7708 // Allow letters & digits (http://test1) 7709 '(?:' + 7710 re.src_xn + 7711 '|' + 7712 re.src_pseudo_letter + '{1,63}' + 7713 ')' 7714 7715 re.src_domain = 7716 7717 '(?:' + 7718 re.src_xn + 7719 '|' + 7720 '(?:' + re.src_pseudo_letter + ')' + 7721 '|' + 7722 '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' + 7723 ')' 7724 7725 re.src_host = 7726 7727 '(?:' + 7728 // Don't need IP check, because digits are already allowed in normal domain names 7729 // src_ip4 + 7730 // '|' +
7731 '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/* _root */ + ')' + 7732 ')' 7733 7734 re.tpl_host_fuzzy = 7735 7736 '(?:' + 7737 re.src_ip4 + 7738 '|' + 7739 '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' + 7740 ')' 7741 7742 re.tpl_host_no_ip_fuzzy = 7743 7744 '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' 7745 7746 re.src_host_strict = 7747 7748 re.src_host + re.src_host_terminator 7749 7750 re.tpl_host_fuzzy_strict = 7751 7752 re.tpl_host_fuzzy + re.src_host_terminator 7753 7754 re.src_host_port_strict = 7755 7756 re.src_host + re.src_port + re.src_host_terminator 7757 7758 re.tpl_host_port_fuzzy_strict = 7759 7760 re.tpl_host_fuzzy + re.src_port + re.src_host_terminator 7761 7762 re.tpl_host_port_no_ip_fuzzy_strict = 7763 7764 re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator 7765 7766 // 7767 // Main rules 7768 // 7769 7770 // Rude test fuzzy links by host, for quick deny 7771 re.tpl_host_fuzzy_test = 7772 7773 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))' 7774 7775 re.tpl_email_fuzzy = 7776 7777 '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' + 7778 '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')' 7779 7780 re.tpl_link_fuzzy = 7781 // Fuzzy link can't be prepended with .:/\- and non punctuation. 7782 // but can start with > (markdown blockquote) 7783 '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + 7784 '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')' 7785 7786 re.tpl_link_no_ip_fuzzy = 7787 // Fuzzy link can't be prepended with .:/\- and non punctuation. 7788 // but can start with > (markdown blockquote) 7789 '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + 7790 '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')' 7791 7792 return re 7793} 7794 7795;// ./node_modules/linkify-it/index.mjs 7796 7797 7798// 7799// Helpers 7800// 7801 7802// Merge objects 7803// 7804function linkify_it_assign (obj /* from1, from2, from3, ... */) { 7805 const sources = Array.prototype.slice.call(arguments, 1) 7806 7807 sources.forEach(function (source) { 7808 if (!source) { return } 7809 7810 Object.keys(source).forEach(function (key) { 7811 obj[key] = source[key] 7812 }) 7813 }) 7814 7815 return obj 7816} 7817 7818function linkify_it_class (obj) { return Object.prototype.toString.call(obj) } 7819function linkify_it_isString (obj) { return linkify_it_class(obj) === '[object String]' } 7820function isObject (obj) { return linkify_it_class(obj) === '[object Object]' } 7821function isRegExp (obj) { return linkify_it_class(obj) === '[object RegExp]' } 7822function isFunction (obj) { return linkify_it_class(obj) === '[object Function]' } 7823 7824function linkify_it_escapeRE (str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&') } 7825 7826// 7827 7828const defaultOptions = { 7829 fuzzyLink: true, 7830 fuzzyEmail: true, 7831 fuzzyIP: false 7832} 7833 7834function isOptionsObj (obj) { 7835 return Object.keys(obj || {}).reduce(function (acc, k) { 7836 /* eslint-disable-next-line no-prototype-builtins */ 7837 return acc || defaultOptions.hasOwnProperty(k) 7838 }, false) 7839} 7840 7841const defaultSchemas = { 7842 'http:': { 7843 validate: function (text, pos, self) { 7844 const tail = text.slice(pos) 7845 7846 if (!self.re.http) { 7847 // compile lazily, because "host"-containing variables can change on tlds update. 7848 self.re.http = new RegExp( 7849 '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i' 7850 ) 7851 } 7852 if (self.re.http.test(tail)) { 7853 return tail.match(self.re.http)[0].length 7854 } 7855 return 0 7856 } 7857 }, 7858 'https:': 'http:', 7859 'ftp:': 'http:', 7860 '//': { 7861 validate: function (text, pos, self) { 7862 const tail = text.slice(pos) 7863 7864 if (!self.re.no_http) { 7865 // compile lazily, because "host"-containing variables can change on tlds update. 7866 self.re.no_http = new RegExp( 7867 '^' + 7868 self.re.src_auth + 7869 // Don't allow single-level domains, because of false positives like '//test' 7870 // with code comments 7871 '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' + 7872 self.re.src_port + 7873 self.re.src_host_terminator + 7874 self.re.src_path, 7875 7876 'i' 7877 ) 7878 } 7879 7880 if (self.re.no_http.test(tail)) { 7881 // should not be `://` & `///`, that protects from errors in protocol name 7882 if (pos >= 3 && text[pos - 3] === ':') { return 0 } 7883 if (pos >= 3 && text[pos - 3] === '/') { return 0 } 7884 return tail.match(self.re.no_http)[0].length 7885 } 7886 return 0 7887 } 7888 }, 7889 'mailto:': { 7890 validate: function (text, pos, self) { 7891 const tail = text.slice(pos) 7892 7893 if (!self.re.mailto) { 7894 self.re.mailto = new RegExp( 7895 '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i' 7896 ) 7897 } 7898 if (self.re.mailto.test(tail)) { 7899 return tail.match(self.re.mailto)[0].length 7900 } 7901 return 0 7902 } 7903 } 7904} 7905 7906// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js) 7907/* eslint-disable-next-line max-len */ 7908const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]' 7909 7910// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead 7911const tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|ÑÑ'.split('|') 7912 7913function createValidator (re) { 7914 return function (text, pos) { 7915 const tail = text.slice(pos) 7916 7917 if (re.test(tail)) { 7918 return tail.match(re)[0].length 7919 } 7920 return 0 7921 } 7922} 7923 7924function createNormalizer () { 7925 return function (match, self) { 7926 self.normalize(match) 7927 } 7928} 7929 7930// Schemas compiler. Build regexps. 7931// 7932function compile (self) { 7933 // Load & clone RE patterns. 7934 const re = self.re = lib_re(self.__opts__) 7935 7936 // Define dynamic patterns 7937 const tlds = self.__tlds__.slice() 7938 7939 self.onCompile() 7940 7941 if (!self.__tlds_replaced__) { 7942 tlds.push(tlds_2ch_src_re) 7943 } 7944 tlds.push(re.src_xn) 7945
7946 re.src_tlds = tlds.join('|') 7947 7948 function untpl (tpl) { return tpl.replace('%TLDS%', re.src_tlds) } 7949 7950 re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i') 7951 re.email_fuzzy_global = RegExp(untpl(re.tpl_email_fuzzy), 'ig') 7952 re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i') 7953 re.link_fuzzy_global = RegExp(untpl(re.tpl_link_fuzzy), 'ig') 7954 re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i') 7955 re.link_no_ip_fuzzy_global = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'ig') 7956 re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i') 7957 7958 // 7959 // Compile each schema 7960 // 7961 7962 const aliases = [] 7963 7964 self.__compiled__ = {} // Reset compiled data 7965 7966 function schemaError (name, val) { 7967 throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val) 7968 } 7969 7970 Object.keys(self.__schemas__).forEach(function (name) { 7971 const val = self.__schemas__[name] 7972 7973 // skip disabled methods 7974 if (val === null) { return } 7975 7976 const compiled = { validate: null, link: null } 7977 7978 self.__compiled__[name] = compiled 7979 7980 if (isObject(val)) { 7981 if (isRegExp(val.validate)) { 7982 compiled.validate = createValidator(val.validate) 7983 } else if (isFunction(val.validate)) { 7984 compiled.validate = val.validate 7985 } else { 7986 schemaError(name, val) 7987 } 7988 7989 if (isFunction(val.normalize)) { 7990 compiled.normalize = val.normalize 7991 } else if (!val.normalize) { 7992 compiled.normalize = createNormalizer() 7993 } else { 7994 schemaError(name, val) 7995 } 7996 7997 return 7998 } 7999 8000 if (linkify_it_isString(val)) { 8001 aliases.push(name) 8002 return 8003 } 8004 8005 schemaError(name, val) 8006 }) 8007 8008 // 8009 // Compile postponed aliases 8010 // 8011 8012 aliases.forEach(function (alias) { 8013 if (!self.__compiled__[self.__schemas__[alias]]) { 8014 // Silently fail on missed schemas to avoid errons on disable. 8015 // schemaError(alias, self.__schemas__[alias]); 8016 return 8017 } 8018 8019 self.__compiled__[alias].validate = 8020 self.__compiled__[self.__schemas__[alias]].validate 8021 self.__compiled__[alias].normalize = 8022 self.__compiled__[self.__schemas__[alias]].normalize 8023 }) 8024 8025 // 8026 // Fake record for guessed links 8027 // 8028 self.__compiled__[''] = { validate: null, normalize: createNormalizer() } 8029 8030 // 8031 // Build schema condition 8032 // 8033 const slist = Object.keys(self.__compiled__) 8034 .filter(function (name) { 8035 // Filter disabled & fake schemas 8036 return name.length > 0 && self.__compiled__[name] 8037 }) 8038 .map(linkify_it_escapeRE) 8039 .join('|') 8040 // (?!_) cause 1.5x slowdown 8041 self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i') 8042 self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig') 8043 self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i') 8044 8045 self.re.pretest = RegExp( 8046 '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', 8047 'i' 8048 ) 8049} 8050 8051/** 8052 * class Match 8053 * 8054 * Match result. Single element of array, returned by [[LinkifyIt#match]] 8055 **/ 8056function Match (text, schema, index, lastIndex) { 8057 const raw = text.slice(index, lastIndex) 8058 8059 /** 8060 * Match#schema -> String 8061 * 8062 * Prefix (protocol) for matched string. 8063 **/ 8064 this.schema = schema.toLowerCase() 8065 /** 8066 * Match#index -> Number 8067 * 8068 * First position of matched string. 8069 **/ 8070 this.index = index 8071 /** 8072 * Match#lastIndex -> Number 8073 * 8074 * Next position after matched string. 8075 **/ 8076 this.lastIndex = lastIndex 8077 /** 8078 * Match#raw -> String 8079 * 8080 * Matched string. 8081 **/ 8082 this.raw = raw 8083 /** 8084 * Match#text -> String 8085 * 8086 * Notmalized text of matched string. 8087 **/ 8088 this.text = raw 8089 /** 8090 * Match#url -> String 8091 * 8092 * Normalized url of matched string. 8093 **/ 8094 this.url = raw 8095} 8096 8097/** 8098 * class LinkifyIt 8099 **/ 8100 8101/** 8102 * new LinkifyIt(schemas, options) 8103 * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) 8104 * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } 8105 * 8106 * Creates new linkifier instance with optional additional schemas. 8107 * Can be called without `new` keyword for convenience. 8108 * 8109 * By default understands: 8110 * 8111 * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links 8112 * - "fuzzy" links and emails (example.com, [email protected]). 8113 *
8114 * `schemas` is an object, where each key/value describes protocol/rule: 8115 * 8116 * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` 8117 * for example). `linkify-it` makes shure that prefix is not preceeded with 8118 * alphanumeric char and symbols. Only whitespaces and punctuation allowed. 8119 * - __value__ - rule to check tail after link prefix 8120 * - _String_ - just alias to existing rule 8121 * - _Object_ 8122 * - _validate_ - validator function (should return matched length on success), 8123 * or `RegExp`. 8124 * - _normalize_ - optional function to normalize text & url of matched result 8125 * (for example, for @twitter mentions). 8126 * 8127 * `options`: 8128 * 8129 * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`. 8130 * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts 8131 * like version numbers. Default `false`. 8132 * - __fuzzyEmail__ - recognize emails without `mailto:` prefix. 8133 * 8134 **/ 8135function LinkifyIt (schemas, options) { 8136 if (!(this instanceof LinkifyIt)) { 8137 return new LinkifyIt(schemas, options) 8138 } 8139 8140 if (!options) { 8141 if (isOptionsObj(schemas)) { 8142 options = schemas 8143 schemas = {} 8144 } 8145 } 8146 8147 this.__opts__ = linkify_it_assign({}, defaultOptions, options) 8148 8149 this.__schemas__ = linkify_it_assign({}, defaultSchemas, schemas) 8150 this.__compiled__ = {} 8151 8152 this.__tlds__ = tlds_default 8153 this.__tlds_replaced__ = false 8154 8155 this.re = {} 8156 8157 compile(this) 8158} 8159 8160/** chainable 8161 * LinkifyIt#add(schema, definition) 8162 * - schema (String): rule name (fixed pattern prefix) 8163 * - definition (String|RegExp|Object): schema definition 8164 * 8165 * Add new rule definition. See constructor description for details. 8166 **/ 8167LinkifyIt.prototype.add = function add (schema, definition) { 8168 this.__schemas__[schema] = definition 8169 compile(this) 8170 return this 8171} 8172 8173/** chainable 8174 * LinkifyIt#set(options) 8175 * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } 8176 * 8177 * Set recognition options for links without schema. 8178 **/ 8179LinkifyIt.prototype.set = function set (options) { 8180 this.__opts__ = linkify_it_assign(this.__opts__, options) 8181 return this 8182} 8183 8184/** 8185 * LinkifyIt#test(text) -> Boolean 8186 * 8187 * Searches linkifiable pattern and returns `true` on success or `false` on fail. 8188 **/ 8189LinkifyIt.prototype.test = function test (text) { 8190 if (!text.length) { return false } 8191 8192 let m, re 8193 8194 // try to scan for link with schema - that's the most simple rule 8195 if (this.re.schema_test.test(text)) { 8196 re = this.re.schema_search 8197 re.lastIndex = 0 8198 while ((m = re.exec(text)) !== null) { 8199 if (this.testSchemaAt(text, m[2], re.lastIndex)) { return true } 8200 } 8201 } 8202 8203 if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { 8204 // guess schemaless links 8205 if (text.search(this.re.host_fuzzy_test) >= 0) { 8206 if (text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy) !== null) { 8207 return true 8208 } 8209 } 8210 } 8211 8212 if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { 8213 // guess schemaless emails 8214 if (text.indexOf('@') >= 0) { 8215 // We can't skip this check, because this cases are possible: 8216 // [email protected], [email protected] 8217 if (text.match(this.re.email_fuzzy) !== null) { return true } 8218 } 8219 } 8220 8221 return false 8222} 8223 8224/** 8225 * LinkifyIt#pretest(text) -> Boolean 8226 * 8227 * Very quick check, that can give false positives. Returns true if link MAY BE 8228 * can exists. Can be used for speed optimization, when you need to check that 8229 * link NOT exists. 8230 **/ 8231LinkifyIt.prototype.pretest = function pretest (text) { 8232 return this.re.pretest.test(text) 8233} 8234 8235/** 8236 * LinkifyIt#testSchemaAt(text, name, position) -> Number 8237 * - text (String): text to scan 8238 * - name (String): rule (schema) name 8239 * - position (Number): text offset to check from 8240 * 8241 * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly 8242 * at given position. Returns length of found pattern (0 on fail). 8243 **/ 8244LinkifyIt.prototype.testSchemaAt = function testSchemaAt (text, schema, pos) { 8245 // If not supported schema check requested - terminate 8246 if (!this.__compiled__[schema.toLowerCase()]) { 8247 return 0 8248 } 8249 return this.__compiled__[schema.toLowerCase()].validate(text, pos, this) 8250} 8251 8252/** 8253 * LinkifyIt#match(text) -> Array|null 8254 * 8255 * Returns array of found link descriptions or `null` on fail. We strongly 8256 * recommend to use [[LinkifyIt#test]] first, for best speed. 8257 * 8258 * ##### Result match description 8259 * 8260 * - __schema__ - link schema, can be empty for fuzzy links, or `//` for 8261 * protocol-neutral links. 8262 * - __index__ - offset of matched text 8263 * - __lastIndex__ - index of next char after mathch end 8264 * - __raw__ - matched text 8265 * - __text__ - normalized text 8266 * - __url__ - link, generated from matched text 8267 **/ 8268LinkifyIt.prototype.match = function match (text) { 8269 const result = [] 8270 const type_schemed = [] 8271 const type_fuzzy_link = [] 8272 const type_fuzzy_email = [] 8273 let m, len, re 8274 8275 function choose (a, b) { 8276 if (!a) { return b } 8277 if (!b) { return a } 8278 if (a.index !== b.index) { return a.index < b.index ? a : b } 8279 return a.lastIndex >= b.lastIndex ? a : b 8280 } 8281 8282 if (!text.length) { return null } 8283 8284 // scan for links with schema 8285 if (this.re.schema_test.test(text)) { 8286 re = this.re.schema_search 8287 re.lastIndex = 0 8288 while ((m = re.exec(text)) !== null) { 8289 len = this.testSchemaAt(text, m[2], re.lastIndex) 8290 if (len) { 8291 type_schemed.push({ 8292 schema: m[2], 8293 index: m.index + m[1].length, 8294 lastIndex: m.index + m[0].length + len 8295 }) 8296 } 8297 } 8298 } 8299 8300 if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { 8301 re = this.__opts__.fuzzyIP ? this.re.link_fuzzy_global : this.re.link_no_ip_fuzzy_global 8302 re.lastIndex = 0 8303 while ((m = re.exec(text)) !== null) { 8304 type_fuzzy_link.push({ 8305 schema: '', 8306 index: m.index + m[1].length, 8307 lastIndex: m.index + m[0].length 8308 }) 8309 } 8310 } 8311 8312 if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { 8313 re = this.re.email_fuzzy_global 8314 re.lastIndex = 0 8315 while ((m = re.exec(text)) !== null) { 8316 type_fuzzy_email.push({ 8317 schema: 'mailto:', 8318 index: m.index + m[1].length, 8319 lastIndex: m.index + m[0].length 8320 }) 8321 } 8322 } 8323 8324 const indexes = [0, 0, 0] 8325 let lastIndex = 0 8326 8327 for (;;) { 8328 const candidates = [ 8329 type_schemed[indexes[0]], 8330 type_fuzzy_email[indexes[1]], 8331 type_fuzzy_link[indexes[2]] 8332 ] 8333 8334 const candidate = choose(choose(candidates[0], candidates[1]), candidates[2]) 8335 8336 if (!candidate) { break } 8337 8338 if (candidate === candidates[0]) { 8339 indexes[0]++ 8340 } else if (candidate === candidates[1]) { 8341 indexes[1]++ 8342 } else { 8343 indexes[2]++ 8344 } 8345 8346 if (candidate.index < lastIndex) { continue } 8347 8348 const match = new Match(text, candidate.schema, candidate.index, candidate.lastIndex) 8349 this.__compiled__[match.schema].normalize(match, this) 8350 result.push(match) 8351 lastIndex = candidate.lastIndex 8352 } 8353 8354 if (result.length) { 8355 return result 8356 } 8357 8358 return null 8359} 8360
8361/** 8362 * LinkifyIt#matchAtStart(text) -> Match|null 8363 * 8364 * Returns fully-formed (not fuzzy) link if it starts at the beginning 8365 * of the string, and null otherwise. 8366 **/ 8367LinkifyIt.prototype.matchAtStart = function matchAtStart (text) { 8368 if (!text.length) return null 8369 8370 const m = this.re.schema_at_start.exec(text) 8371 if (!m) return null 8372 8373 const len = this.testSchemaAt(text, m[2], m[0].length) 8374 if (!len) return null 8375 8376 const match = new Match(text, m[2], m.index + m[1].length, m.index + m[0].length + len) 8377 8378 this.__compiled__[match.schema].normalize(match, this) 8379 return match 8380} 8381 8382/** chainable 8383 * LinkifyIt#tlds(list [, keepOld]) -> this 8384 * - list (Array): list of tlds 8385 * - keepOld (Boolean): merge with current list if `true` (`false` by default) 8386 * 8387 * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) 8388 * to avoid false positives. By default this algorythm used: 8389 * 8390 * - hostname with any 2-letter root zones are ok. 8391 * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|ÑÑ 8392 * are ok. 8393 * - encoded (`xn--...`) root zones are ok. 8394 * 8395 * If list is replaced, then exact match for 2-chars root zones will be checked. 8396 **/ 8397LinkifyIt.prototype.tlds = function tlds (list, keepOld) { 8398 list = Array.isArray(list) ? list : [list] 8399 8400 if (!keepOld) { 8401 this.__tlds__ = list.slice() 8402 this.__tlds_replaced__ = true 8403 compile(this) 8404 return this 8405 } 8406 8407 this.__tlds__ = this.__tlds__.concat(list) 8408 .sort() 8409 .filter(function (el, idx, arr) { 8410 return el !== arr[idx - 1] 8411 }) 8412 .reverse() 8413 8414 compile(this) 8415 return this 8416} 8417 8418/** 8419 * LinkifyIt#normalize(match) 8420 * 8421 * Default normalizer (if schema does not define it's own). 8422 **/ 8423LinkifyIt.prototype.normalize = function normalize (match) { 8424 // Do minimal possible changes by default. Need to collect feedback prior 8425 // to move forward https://github.com/markdown-it/linkify-it/issues/1 8426 8427 if (!match.schema) { match.url = 'http://' + match.url } 8428 8429 if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { 8430 match.url = 'mailto:' + match.url 8431 } 8432} 8433 8434/** 8435 * LinkifyIt#onCompile() 8436 * 8437 * Override to modify basic RegExp-s. 8438 **/ 8439LinkifyIt.prototype.onCompile = function onCompile () { 8440} 8441 8442/* harmony default export */ const linkify_it = (LinkifyIt); 8443 8444;// ./node_modules/punycode.js/punycode.es6.js 8445 8446 8447/** Highest positive signed 32-bit float value */ 8448const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 8449 8450/** Bootstring parameters */ 8451const base = 36; 8452const tMin = 1; 8453const tMax = 26; 8454const skew = 38; 8455const damp = 700; 8456const initialBias = 72; 8457const initialN = 128; // 0x80 8458const delimiter = '-'; // '\x2D' 8459 8460/** Regular expressions */ 8461const regexPunycode = /^xn--/; 8462const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. 8463const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators 8464 8465/** Error messages */ 8466const errors = { 8467 'overflow': 'Overflow: input needs wider integers to process', 8468 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 8469 'invalid-input': 'Invalid input' 8470}; 8471 8472/** Convenience shortcuts */ 8473const baseMinusTMin = base - tMin; 8474const floor = Math.floor; 8475const stringFromCharCode = String.fromCharCode; 8476 8477/*--------------------------------------------------------------------------*/ 8478 8479/** 8480 * A generic error utility function. 8481 * @private 8482 * @param {String} type The error type. 8483 * @returns {Error} Throws a `RangeError` with the applicable error message. 8484 */ 8485function error(type) { 8486 throw new RangeError(errors[type]); 8487} 8488 8489/** 8490 * A generic `Array#map` utility function. 8491 * @private 8492 * @param {Array} array The array to iterate over. 8493 * @param {Function} callback The function that gets called for every array 8494 * item. 8495 * @returns {Array} A new array of values returned by the callback function. 8496 */ 8497function map(array, callback) { 8498 const result = []; 8499 let length = array.length; 8500 while (length--) { 8501 result[length] = callback(array[length]); 8502 } 8503 return result; 8504} 8505 8506/** 8507 * A simple `Array#map`-like wrapper to work with domain name strings or email 8508 * addresses. 8509 * @private 8510 * @param {String} domain The domain name or email address. 8511 * @param {Function} callback The function that gets called for every 8512 * character. 8513 * @returns {String} A new string of characters returned by the callback 8514 * function. 8515 */ 8516function mapDomain(domain, callback) { 8517 const parts = domain.split('@'); 8518 let result = ''; 8519 if (parts.length > 1) { 8520 // In email addresses, only the domain name should be punycoded. Leave 8521 // the local part (i.e. everything up to `@`) intact. 8522 result = parts[0] + '@'; 8523 domain = parts[1]; 8524 } 8525 // Avoid `split(regex)` for IE8 compatibility. See #17. 8526 domain = domain.replace(regexSeparators, '\x2E'); 8527 const labels = domain.split('.'); 8528 const encoded = map(labels, callback).join('.'); 8529 return result + encoded; 8530} 8531 8532/** 8533 * Creates an array containing the numeric code points of each Unicode 8534 * character in the string. While JavaScript uses UCS-2 internally, 8535 * this function will convert a pair of surrogate halves (each of which 8536 * UCS-2 exposes as separate characters) into a single code point, 8537 * matching UTF-16. 8538 * @see `punycode.ucs2.encode` 8539 * @see <https://mathiasbynens.be/notes/javascript-encoding> 8540 * @memberOf punycode.ucs2 8541 * @name decode 8542 * @param {String} string The Unicode input string (UCS-2). 8543 * @returns {Array} The new array of code points. 8544 */ 8545function ucs2decode(string) { 8546 const output = []; 8547 let counter = 0; 8548 const length = string.length; 8549 while (counter < length) { 8550 const value = string.charCodeAt(counter++); 8551 if (value >= 0xD800 && value <= 0xDBFF && counter < length) { 8552 // It's a high surrogate, and there is a next character. 8553 const extra = string.charCodeAt(counter++); 8554 if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
vendor: 8,852 bytes, lines 8555-8866
8555 output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); 8556 } else { 8557 // It's an unmatched surrogate; only append this code unit, in case the 8558 // next code unit is the high surrogate of a surrogate pair. 8559 output.push(value); 8560 counter--; 8561 } 8562 } else { 8563 output.push(value); 8564 } 8565 } 8566 return output; 8567} 8568 8569/** 8570 * Creates a string based on an array of numeric code points. 8571 * @see `punycode.ucs2.decode` 8572 * @memberOf punycode.ucs2 8573 * @name encode 8574 * @param {Array} codePoints The array of numeric code points. 8575 * @returns {String} The new Unicode string (UCS-2). 8576 */ 8577const ucs2encode = codePoints => String.fromCodePoint(...codePoints); 8578 8579/** 8580 * Converts a basic code point into a digit/integer. 8581 * @see `digitToBasic()` 8582 * @private 8583 * @param {Number} codePoint The basic numeric code point value. 8584 * @returns {Number} The numeric value of a basic code point (for use in 8585 * representing integers) in the range `0` to `base - 1`, or `base` if 8586 * the code point does not represent a value. 8587 */ 8588const basicToDigit = function(codePoint) { 8589 if (codePoint >= 0x30 && codePoint < 0x3A) { 8590 return 26 + (codePoint - 0x30); 8591 } 8592 if (codePoint >= 0x41 && codePoint < 0x5B) { 8593 return codePoint - 0x41; 8594 } 8595 if (codePoint >= 0x61 && codePoint < 0x7B) { 8596 return codePoint - 0x61; 8597 } 8598 return base; 8599}; 8600 8601/** 8602 * Converts a digit/integer into a basic code point. 8603 * @see `basicToDigit()` 8604 * @private 8605 * @param {Number} digit The numeric value of a basic code point. 8606 * @returns {Number} The basic code point whose value (when used for 8607 * representing integers) is `digit`, which needs to be in the range 8608 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is 8609 * used; else, the lowercase form is used. The behavior is undefined 8610 * if `flag` is non-zero and `digit` has no uppercase form. 8611 */ 8612const digitToBasic = function(digit, flag) { 8613 // 0..25 map to ASCII a..z or A..Z 8614 // 26..35 map to ASCII 0..9 8615 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); 8616}; 8617 8618/** 8619 * Bias adaptation function as per section 3.4 of RFC 3492. 8620 * https://tools.ietf.org/html/rfc3492#section-3.4 8621 * @private 8622 */ 8623const adapt = function(delta, numPoints, firstTime) { 8624 let k = 0; 8625 delta = firstTime ? floor(delta / damp) : delta >> 1; 8626 delta += floor(delta / numPoints); 8627 for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { 8628 delta = floor(delta / baseMinusTMin); 8629 } 8630 return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); 8631}; 8632 8633/** 8634 * Converts a Punycode string of ASCII-only symbols to a string of Unicode 8635 * symbols. 8636 * @memberOf punycode 8637 * @param {String} input The Punycode string of ASCII-only symbols. 8638 * @returns {String} The resulting string of Unicode symbols. 8639 */ 8640const punycode_es6_decode = function(input) { 8641 // Don't use UCS-2. 8642 const output = []; 8643 const inputLength = input.length; 8644 let i = 0; 8645 let n = initialN; 8646 let bias = initialBias; 8647 8648 // Handle the basic code points: let `basic` be the number of input code 8649 // points before the last delimiter, or `0` if there is none, then copy 8650 // the first basic code points to the output. 8651 8652 let basic = input.lastIndexOf(delimiter); 8653 if (basic < 0) { 8654 basic = 0; 8655 } 8656 8657 for (let j = 0; j < basic; ++j) { 8658 // if it's not a basic code point 8659 if (input.charCodeAt(j) >= 0x80) { 8660 error('not-basic'); 8661 } 8662 output.push(input.charCodeAt(j)); 8663 } 8664 8665 // Main decoding loop: start just after the last delimiter if any basic code 8666 // points were copied; start at the beginning otherwise. 8667 8668 for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { 8669 8670 // `index` is the index of the next character to be consumed. 8671 // Decode a generalized variable-length integer into `delta`, 8672 // which gets added to `i`. The overflow checking is easier 8673 // if we increase `i` as we go, then subtract off its starting 8674 // value at the end to obtain `delta`. 8675 const oldi = i; 8676 for (let w = 1, k = base; /* no condition */; k += base) { 8677 8678 if (index >= inputLength) { 8679 error('invalid-input'); 8680 } 8681 8682 const digit = basicToDigit(input.charCodeAt(index++)); 8683 8684 if (digit >= base) { 8685 error('invalid-input'); 8686 } 8687 if (digit > floor((maxInt - i) / w)) { 8688 error('overflow'); 8689 } 8690 8691 i += digit * w; 8692 const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 8693 8694 if (digit < t) { 8695 break; 8696 } 8697 8698 const baseMinusT = base - t; 8699 if (w > floor(maxInt / baseMinusT)) { 8700 error('overflow'); 8701 } 8702 8703 w *= baseMinusT; 8704 8705 } 8706 8707 const out = output.length + 1; 8708 bias = adapt(i - oldi, out, oldi == 0); 8709 8710 // `i` was supposed to wrap around from `out` to `0`, 8711 // incrementing `n` each time, so we'll fix that now: 8712 if (floor(i / out) > maxInt - n) { 8713 error('overflow'); 8714 } 8715 8716 n += floor(i / out); 8717 i %= out; 8718 8719 // Insert `n` at position `i` of the output. 8720 output.splice(i++, 0, n); 8721 8722 } 8723 8724 return String.fromCodePoint(...output); 8725}; 8726 8727/** 8728 * Converts a string of Unicode symbols (e.g. a domain name label) to a 8729 * Punycode string of ASCII-only symbols. 8730 * @memberOf punycode 8731 * @param {String} input The string of Unicode symbols. 8732 * @returns {String} The resulting Punycode string of ASCII-only symbols. 8733 */ 8734const punycode_es6_encode = function(input) { 8735 const output = []; 8736 8737 // Convert the input in UCS-2 to an array of Unicode code points. 8738 input = ucs2decode(input); 8739 8740 // Cache the length. 8741 const inputLength = input.length; 8742 8743 // Initialize the state. 8744 let n = initialN; 8745 let delta = 0; 8746 let bias = initialBias; 8747 8748 // Handle the basic code points. 8749 for (const currentValue of input) { 8750 if (currentValue < 0x80) { 8751 output.push(stringFromCharCode(currentValue)); 8752 } 8753 } 8754 8755 const basicLength = output.length; 8756 let handledCPCount = basicLength; 8757 8758 // `handledCPCount` is the number of code points that have been handled; 8759 // `basicLength` is the number of basic code points. 8760 8761 // Finish the basic string with a delimiter unless it's empty. 8762 if (basicLength) { 8763 output.push(delimiter); 8764 } 8765 8766 // Main encoding loop: 8767 while (handledCPCount < inputLength) { 8768 8769 // All non-basic code points < n have been handled already. Find the next 8770 // larger one: 8771 let m = maxInt; 8772 for (const currentValue of input) { 8773 if (currentValue >= n && currentValue < m) { 8774 m = currentValue; 8775 } 8776 } 8777 8778 // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, 8779 // but guard against overflow. 8780 const handledCPCountPlusOne = handledCPCount + 1; 8781 if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { 8782 error('overflow'); 8783 } 8784 8785 delta += (m - n) * handledCPCountPlusOne; 8786 n = m; 8787 8788 for (const currentValue of input) { 8789 if (currentValue < n && ++delta > maxInt) { 8790 error('overflow'); 8791 } 8792 if (currentValue === n) { 8793 // Represent delta as a generalized variable-length integer. 8794 let q = delta; 8795 for (let k = base; /* no condition */; k += base) { 8796 const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 8797 if (q < t) { 8798 break; 8799 } 8800 const qMinusT = q - t; 8801 const baseMinusT = base - t; 8802 output.push( 8803 stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) 8804 ); 8805 q = floor(qMinusT / baseMinusT); 8806 } 8807 8808 output.push(stringFromCharCode(digitToBasic(q, 0))); 8809 bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); 8810 delta = 0; 8811 ++handledCPCount; 8812 } 8813 } 8814 8815 ++delta; 8816 ++n; 8817 8818 } 8819 return output.join(''); 8820}; 8821 8822/** 8823 * Converts a Punycode string representing a domain name or an email address 8824 * to Unicode. Only the Punycoded parts of the input will be converted, i.e. 8825 * it doesn't matter if you call it on a string that has already been 8826 * converted to Unicode. 8827 * @memberOf punycode 8828 * @param {String} input The Punycoded domain name or email address to 8829 * convert to Unicode. 8830 * @returns {String} The Unicode representation of the given Punycode 8831 * string. 8832 */ 8833const toUnicode = function(input) { 8834 return mapDomain(input, function(string) { 8835 return regexPunycode.test(string) 8836 ? punycode_es6_decode(string.slice(4).toLowerCase()) 8837 : string; 8838 }); 8839}; 8840 8841/** 8842 * Converts a Unicode string representing a domain name or an email address to 8843 * Punycode. Only the non-ASCII parts of the domain name will be converted, 8844 * i.e. it doesn't matter if you call it with a domain that's already in 8845 * ASCII. 8846 * @memberOf punycode 8847 * @param {String} input The domain name or email address to convert, as a 8848 * Unicode string. 8849 * @returns {String} The Punycode representation of the given domain name or 8850 * email address. 8851 */ 8852const toASCII = function(input) { 8853 return mapDomain(input, function(string) { 8854 return regexNonASCII.test(string) 8855 ? 'xn--' + punycode_es6_encode(string) 8856 : string; 8857 }); 8858}; 8859 8860/*--------------------------------------------------------------------------*/ 8861 8862/** Define the public API */ 8863const punycode = { 8864 /** 8865 * A string representing the current Punycode.js version number. 8866 * @memberOf punycode
8867 * @type String 8868 */ 8869 'version': '2.3.1', 8870 /** 8871 * An object of methods to convert from JavaScript's internal character 8872 * representation (UCS-2) to Unicode code points, and back. 8873 * @see <https://mathiasbynens.be/notes/javascript-encoding> 8874 * @memberOf punycode 8875 * @type Object 8876 */ 8877 'ucs2': { 8878 'decode': ucs2decode, 8879 'encode': ucs2encode 8880 }, 8881 'decode': punycode_es6_decode, 8882 'encode': punycode_es6_encode, 8883 'toASCII': toASCII, 8884 'toUnicode': toUnicode 8885}; 8886 8887 8888/* harmony default export */ const punycode_es6 = (punycode); 8889 8890;// ./node_modules/markdown-it/lib/presets/default.mjs 8891// markdown-it default options 8892 8893/* harmony default export */ const presets_default = ({ 8894 options: { 8895 // Enable HTML tags in source 8896 html: false, 8897 8898 // Use '/' to close single tags (<br />) 8899 xhtmlOut: false, 8900 8901 // Convert '\n' in paragraphs into <br> 8902 breaks: false, 8903 8904 // CSS language prefix for fenced blocks 8905 langPrefix: 'language-', 8906 8907 // autoconvert URL-like texts to links 8908 linkify: false, 8909 8910 // Enable some language-neutral replacements + quotes beautification 8911 typographer: false, 8912 8913 // Double + single quotes replacement pairs, when typographer enabled, 8914 // and smartquotes on. Could be either a String or an Array. 8915 // 8916 // For example, you can use '«»ââ' for Russian, 'ââââ' for German, 8917 // and ['«\xA0', '\xA0»', 'â¹\xA0', '\xA0âº'] for French (including nbsp). 8918 quotes: '\u201c\u201d\u2018\u2019', /* ââââ */ 8919 8920 // Highlighter function. Should return escaped HTML, 8921 // or '' if the source string is not changed and should be escaped externaly. 8922 // If result starts with <pre... internal wrapper is skipped. 8923 // 8924 // function (/*str, lang*/) { return ''; } 8925 // 8926 highlight: null, 8927 8928 // Internal protection, recursion limit 8929 maxNesting: 100 8930 }, 8931 8932 components: { 8933 core: {}, 8934 block: {}, 8935 inline: {} 8936 } 8937}); 8938 8939;// ./node_modules/markdown-it/lib/presets/zero.mjs 8940// "Zero" preset, with nothing enabled. Useful for manual configuring of simple 8941// modes. For example, to parse bold/italic only. 8942 8943/* harmony default export */ const zero = ({ 8944 options: { 8945 // Enable HTML tags in source 8946 html: false, 8947 8948 // Use '/' to close single tags (<br />) 8949 xhtmlOut: false, 8950 8951 // Convert '\n' in paragraphs into <br> 8952 breaks: false, 8953 8954 // CSS language prefix for fenced blocks 8955 langPrefix: 'language-', 8956 8957 // autoconvert URL-like texts to links 8958 linkify: false, 8959 8960 // Enable some language-neutral replacements + quotes beautification 8961 typographer: false, 8962 8963 // Double + single quotes replacement pairs, when typographer enabled, 8964 // and smartquotes on. Could be either a String or an Array. 8965 // 8966 // For example, you can use '«»ââ' for Russian, 'ââââ' for German, 8967 // and ['«\xA0', '\xA0»', 'â¹\xA0', '\xA0âº'] for French (including nbsp). 8968 quotes: '\u201c\u201d\u2018\u2019', /* ââââ */ 8969 8970 // Highlighter function. Should return escaped HTML, 8971 // or '' if the source string is not changed and should be escaped externaly. 8972 // If result starts with <pre... internal wrapper is skipped. 8973 // 8974 // function (/*str, lang*/) { return ''; } 8975 // 8976 highlight: null, 8977 8978 // Internal protection, recursion limit 8979 maxNesting: 20 8980 }, 8981 8982 components: { 8983 8984 core: { 8985 rules: [ 8986 'normalize', 8987 'block', 8988 'inline', 8989 'text_join' 8990 ] 8991 }, 8992 8993 block: { 8994 rules: [ 8995 'paragraph' 8996 ] 8997 }, 8998 8999 inline: { 9000 rules: [ 9001 'text' 9002 ], 9003 rules2: [ 9004 'balance_pairs', 9005 'fragments_join' 9006 ] 9007 } 9008 } 9009}); 9010 9011;// ./node_modules/markdown-it/lib/presets/commonmark.mjs 9012// Commonmark default options 9013 9014/* harmony default export */ const commonmark = ({ 9015 options: { 9016 // Enable HTML tags in source 9017 html: true, 9018 9019 // Use '/' to close single tags (<br />) 9020 xhtmlOut: true, 9021 9022 // Convert '\n' in paragraphs into <br> 9023 breaks: false, 9024 9025 // CSS language prefix for fenced blocks 9026 langPrefix: 'language-', 9027 9028 // autoconvert URL-like texts to links 9029 linkify: false, 9030 9031 // Enable some language-neutral replacements + quotes beautification 9032 typographer: false, 9033 9034 // Double + single quotes replacement pairs, when typographer enabled, 9035 // and smartquotes on. Could be either a String or an Array. 9036 // 9037 // For example, you can use '«»ââ' for Russian, 'ââââ' for German, 9038 // and ['«\xA0', '\xA0»', 'â¹\xA0', '\xA0âº'] for French (including nbsp). 9039 quotes: '\u201c\u201d\u2018\u2019', /* ââââ */ 9040 9041 // Highlighter function. Should return escaped HTML, 9042 // or '' if the source string is not changed and should be escaped externaly. 9043 // If result starts with <pre... internal wrapper is skipped. 9044 // 9045 // function (/*str, lang*/) { return ''; } 9046 // 9047 highlight: null, 9048 9049 // Internal protection, recursion limit 9050 maxNesting: 20 9051 }, 9052 9053 components: { 9054 9055 core: { 9056 rules: [ 9057 'normalize', 9058 'block', 9059 'inline', 9060 'text_join' 9061 ] 9062 }, 9063 9064 block: { 9065 rules: [ 9066 'blockquote', 9067 'code', 9068 'fence', 9069 'heading', 9070 'hr', 9071 'html_block', 9072 'lheading', 9073 'list', 9074 'reference', 9075 'paragraph' 9076 ] 9077 }, 9078 9079 inline: { 9080 rules: [ 9081 'autolink', 9082 'backticks', 9083 'emphasis', 9084 'entity', 9085 'escape', 9086 'html_inline', 9087 'image', 9088 'link', 9089 'newline', 9090 'text' 9091 ], 9092 rules2: [ 9093 'balance_pairs', 9094 'emphasis', 9095 'fragments_join' 9096 ] 9097 } 9098 } 9099}); 9100 9101;// ./node_modules/markdown-it/lib/index.mjs 9102// Main parser class 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118const config = { 9119 default: presets_default, 9120 zero: zero, 9121 commonmark: commonmark 9122} 9123 9124// 9125// This validator can prohibit more than really needed to prevent XSS. It's a 9126// tradeoff to keep code simple and to be secure by default. 9127// 9128// If you need different setup - override validator method as you wish. Or 9129// replace it with dummy function and use external sanitizer. 9130// 9131 9132const BAD_PROTO_RE = /^(vbscript|javascript|file|data):/ 9133const GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/ 9134 9135function validateLink (url) { 9136 // url should be normalized at this point, and existing entities are decoded 9137 const str = url.trim().toLowerCase() 9138
9139 return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) : true 9140} 9141 9142const RECODE_HOSTNAME_FOR = ['http:', 'https:', 'mailto:'] 9143 9144function normalizeLink (url) { 9145 const parsed = parse(url, true) 9146 9147 if (parsed.hostname) { 9148 // Encode hostnames in urls like: 9149 // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` 9150 // 9151 // We don't encode unknown schemas, because it's likely that we encode 9152 // something we shouldn't (e.g. `skype:name` treated as `skype:host`) 9153 // 9154 if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { 9155 try { 9156 parsed.hostname = punycode_es6.toASCII(parsed.hostname) 9157 } catch (er) { /**/ } 9158 } 9159 } 9160 9161 return lib_encode(format(parsed)) 9162} 9163 9164function normalizeLinkText (url) { 9165 const parsed = parse(url, true) 9166 9167 if (parsed.hostname) { 9168 // Encode hostnames in urls like: 9169 // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` 9170 // 9171 // We don't encode unknown schemas, because it's likely that we encode 9172 // something we shouldn't (e.g. `skype:name` treated as `skype:host`) 9173 // 9174 if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { 9175 try { 9176 parsed.hostname = punycode_es6.toUnicode(parsed.hostname) 9177 } catch (er) { /**/ } 9178 } 9179 } 9180 9181 // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720 9182 return lib_decode(format(parsed), lib_decode.defaultChars + '%') 9183} 9184 9185/** 9186 * class MarkdownIt 9187 * 9188 * Main parser/renderer class. 9189 * 9190 * ##### Usage 9191 * 9192 * ```javascript 9193 * // node.js, "classic" way: 9194 * var MarkdownIt = require('markdown-it'), 9195 * md = new MarkdownIt(); 9196 * var result = md.render('# markdown-it rulezz!'); 9197 * 9198 * // node.js, the same, but with sugar: 9199 * var md = require('markdown-it')(); 9200 * var result = md.render('# markdown-it rulezz!'); 9201 * 9202 * // browser without AMD, added to "window" on script load 9203 * // Note, there are no dash. 9204 * var md = window.markdownit(); 9205 * var result = md.render('# markdown-it rulezz!'); 9206 * ``` 9207 * 9208 * Single line rendering, without paragraph wrap: 9209 * 9210 * ```javascript 9211 * var md = require('markdown-it')(); 9212 * var result = md.renderInline('__markdown-it__ rulezz!'); 9213 * ``` 9214 **/ 9215 9216/** 9217 * new MarkdownIt([presetName, options]) 9218 * - presetName (String): optional, `commonmark` / `zero` 9219 * - options (Object) 9220 * 9221 * Creates parser instanse with given config. Can be called without `new`. 9222 * 9223 * ##### presetName 9224 * 9225 * MarkdownIt provides named presets as a convenience to quickly 9226 * enable/disable active syntax rules and options for common use cases. 9227 * 9228 * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.mjs) - 9229 * configures parser to strict [CommonMark](http://commonmark.org/) mode. 9230 * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.mjs) - 9231 * similar to GFM, used when no preset name given. Enables all available rules, 9232 * but still without html, typographer & autolinker. 9233 * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.mjs) - 9234 * all rules disabled. Useful to quickly setup your config via `.enable()`. 9235 * For example, when you need only `bold` and `italic` markup and nothing else. 9236 * 9237 * ##### options: 9238 * 9239 * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful! 9240 * That's not safe! You may need external sanitizer to protect output from XSS. 9241 * It's better to extend features via plugins, instead of enabling HTML. 9242 * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags 9243 * (`<br />`). This is needed only for full CommonMark compatibility. In real 9244 * world you will need HTML output. 9245 * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`. 9246 * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks. 9247 * Can be useful for external highlighters. 9248 * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links. 9249 * - __typographer__ - `false`. Set `true` to enable [some language-neutral 9250 * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs) + 9251 * quotes beautification (smartquotes). 9252 * - __quotes__ - `ââââ`, String or Array. Double + single quotes replacement 9253 * pairs, when typographer enabled and smartquotes on. For example, you can 9254 * use `'«»ââ'` for Russian, `'ââââ'` for German, and 9255 * `['«\xA0', '\xA0»', 'â¹\xA0', '\xA0âº']` for French (including nbsp). 9256 * - __highlight__ - `null`. Highlighter function for fenced code blocks. 9257 * Highlighter `function (str, lang)` should return escaped HTML. It can also 9258 * return empty string if the source was not changed and should be escaped 9259 * externaly. If result starts with <pre... internal wrapper is skipped. 9260 * 9261 * ##### Example 9262 * 9263 * ```javascript 9264 * // commonmark mode 9265 * var md = require('markdown-it')('commonmark'); 9266 * 9267 * // default mode 9268 * var md = require('markdown-it')(); 9269 * 9270 * // enable everything 9271 * var md = require('markdown-it')({ 9272 * html: true, 9273 * linkify: true, 9274 * typographer: true 9275 * }); 9276 * ``` 9277 * 9278 * ##### Syntax highlighting 9279 * 9280 * ```js 9281 * var hljs = require('highlight.js') // https://highlightjs.org/ 9282 * 9283 * var md = require('markdown-it')({ 9284 * highlight: function (str, lang) {
9285 * if (lang && hljs.getLanguage(lang)) { 9286 * try { 9287 * return hljs.highlight(str, { language: lang, ignoreIllegals: true }).value; 9288 * } catch (__) {} 9289 * } 9290 * 9291 * return ''; // use external default escaping 9292 * } 9293 * }); 9294 * ``` 9295 * 9296 * Or with full wrapper override (if you need assign class to `<pre>` or `<code>`): 9297 * 9298 * ```javascript 9299 * var hljs = require('highlight.js') // https://highlightjs.org/ 9300 * 9301 * // Actual default values 9302 * var md = require('markdown-it')({ 9303 * highlight: function (str, lang) { 9304 * if (lang && hljs.getLanguage(lang)) { 9305 * try { 9306 * return '<pre><code class="hljs">' + 9307 * hljs.highlight(str, { language: lang, ignoreIllegals: true }).value + 9308 * '</code></pre>'; 9309 * } catch (__) {} 9310 * } 9311 * 9312 * return '<pre><code class="hljs">' + md.utils.escapeHtml(str) + '</code></pre>'; 9313 * } 9314 * }); 9315 * ``` 9316 * 9317 **/ 9318function MarkdownIt (presetName, options) { 9319 if (!(this instanceof MarkdownIt)) { 9320 return new MarkdownIt(presetName, options) 9321 } 9322 9323 if (!options) { 9324 if (!isString(presetName)) { 9325 options = presetName || {} 9326 presetName = 'default' 9327 } 9328 } 9329 9330 /** 9331 * MarkdownIt#inline -> ParserInline 9332 * 9333 * Instance of [[ParserInline]]. You may need it to add new rules when 9334 * writing plugins. For simple rules control use [[MarkdownIt.disable]] and 9335 * [[MarkdownIt.enable]]. 9336 **/ 9337 this.inline = new parser_inline() 9338 9339 /** 9340 * MarkdownIt#block -> ParserBlock 9341 * 9342 * Instance of [[ParserBlock]]. You may need it to add new rules when 9343 * writing plugins. For simple rules control use [[MarkdownIt.disable]] and 9344 * [[MarkdownIt.enable]]. 9345 **/ 9346 this.block = new parser_block() 9347 9348 /** 9349 * MarkdownIt#core -> Core 9350 * 9351 * Instance of [[Core]] chain executor. You may need it to add new rules when 9352 * writing plugins. For simple rules control use [[MarkdownIt.disable]] and 9353 * [[MarkdownIt.enable]]. 9354 **/ 9355 this.core = new parser_core() 9356 9357 /** 9358 * MarkdownIt#renderer -> Renderer 9359 * 9360 * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering 9361 * rules for new token types, generated by plugins. 9362 * 9363 * ##### Example 9364 * 9365 * ```javascript 9366 * var md = require('markdown-it')(); 9367 * 9368 * function myToken(tokens, idx, options, env, self) { 9369 * //... 9370 * return result; 9371 * }; 9372 * 9373 * md.renderer.rules['my_token'] = myToken 9374 * ``` 9375 * 9376 * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs). 9377 **/ 9378 this.renderer = new renderer() 9379 9380 /** 9381 * MarkdownIt#linkify -> LinkifyIt 9382 * 9383 * [linkify-it](https://github.com/markdown-it/linkify-it) instance. 9384 * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs) 9385 * rule. 9386 **/ 9387 this.linkify = new linkify_it() 9388 9389 /** 9390 * MarkdownIt#validateLink(url) -> Boolean 9391 * 9392 * Link validation function. CommonMark allows too much in links. By default 9393 * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas 9394 * except some embedded image types. 9395 * 9396 * You can change this behaviour: 9397 * 9398 * ```javascript 9399 * var md = require('markdown-it')(); 9400 * // enable everything 9401 * md.validateLink = function () { return true; } 9402 * ``` 9403 **/ 9404 this.validateLink = validateLink 9405 9406 /** 9407 * MarkdownIt#normalizeLink(url) -> String 9408 * 9409 * Function used to encode link url to a machine-readable format, 9410 * which includes url-encoding, punycode, etc. 9411 **/ 9412 this.normalizeLink = normalizeLink 9413 9414 /** 9415 * MarkdownIt#normalizeLinkText(url) -> String 9416 * 9417 * Function used to decode link url to a human-readable format` 9418 **/ 9419 this.normalizeLinkText = normalizeLinkText 9420 9421 // Expose utils & helpers for easy acces from plugins 9422 9423 /** 9424 * MarkdownIt#utils -> utils 9425 * 9426 * Assorted utility functions, useful to write plugins. See details 9427 * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.mjs). 9428 **/ 9429 this.utils = utils_namespaceObject 9430 9431 /** 9432 * MarkdownIt#helpers -> helpers 9433 * 9434 * Link components parser functions, useful to write plugins. See details 9435 * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers). 9436 **/ 9437 this.helpers = utils_assign({}, helpers_namespaceObject) 9438 9439 this.options = {} 9440 this.configure(presetName) 9441 9442 if (options) { this.set(options) } 9443} 9444 9445/** chainable 9446 * MarkdownIt.set(options) 9447 * 9448 * Set parser options (in the same format as in constructor). Probably, you 9449 * will never need it, but you can change options after constructor call. 9450 * 9451 * ##### Example 9452 * 9453 * ```javascript 9454 * var md = require('markdown-it')() 9455 * .set({ html: true, breaks: true }) 9456 * .set({ typographer: true }); 9457 * ``` 9458 * 9459 * __Note:__ To achieve the best possible performance, don't modify a 9460 * `markdown-it` instance options on the fly. If you need multiple configurations 9461 * it's best to create multiple instances and initialize each with separate 9462 * config. 9463 **/ 9464MarkdownIt.prototype.set = function (options) { 9465 utils_assign(this.options, options) 9466 return this 9467} 9468 9469/** chainable, internal
9470 * MarkdownIt.configure(presets) 9471 * 9472 * Batch load of all options and compenent settings. This is internal method, 9473 * and you probably will not need it. But if you will - see available presets 9474 * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets) 9475 * 9476 * We strongly recommend to use presets instead of direct config loads. That 9477 * will give better compatibility with next versions. 9478 **/ 9479MarkdownIt.prototype.configure = function (presets) { 9480 const self = this 9481 9482 if (isString(presets)) { 9483 const presetName = presets 9484 presets = config[presetName] 9485 if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name') } 9486 } 9487 9488 if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty') } 9489 9490 if (presets.options) { self.set(presets.options) } 9491 9492 if (presets.components) { 9493 Object.keys(presets.components).forEach(function (name) { 9494 if (presets.components[name].rules) { 9495 self[name].ruler.enableOnly(presets.components[name].rules) 9496 } 9497 if (presets.components[name].rules2) {
9498 self[name].ruler2.enableOnly(presets.components[name].rules2) 9499 } 9500 }) 9501 } 9502 return this 9503} 9504 9505/** chainable 9506 * MarkdownIt.enable(list, ignoreInvalid) 9507 * - list (String|Array): rule name or list of rule names to enable 9508 * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. 9509 * 9510 * Enable list or rules. It will automatically find appropriate components, 9511 * containing rules with given names. If rule not found, and `ignoreInvalid` 9512 * not set - throws exception. 9513 * 9514 * ##### Example 9515 * 9516 * ```javascript 9517 * var md = require('markdown-it')() 9518 * .enable(['sub', 'sup']) 9519 * .disable('smartquotes'); 9520 * ``` 9521 **/ 9522MarkdownIt.prototype.enable = function (list, ignoreInvalid) { 9523 let result = [] 9524 9525 if (!Array.isArray(list)) { list = [list] } 9526 9527 ['core', 'block', 'inline'].forEach(function (chain) { 9528 result = result.concat(this[chain].ruler.enable(list, true)) 9529 }, this) 9530 9531 result = result.concat(this.inline.ruler2.enable(list, true)) 9532 9533 const missed = list.filter(function (name) { return result.indexOf(name) < 0 }) 9534 9535 if (missed.length && !ignoreInvalid) { 9536 throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed) 9537 } 9538 9539 return this 9540} 9541 9542/** chainable 9543 * MarkdownIt.disable(list, ignoreInvalid) 9544 * - list (String|Array): rule name or list of rule names to disable. 9545 * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. 9546 * 9547 * The same as [[MarkdownIt.enable]], but turn specified rules off. 9548 **/ 9549MarkdownIt.prototype.disable = function (list, ignoreInvalid) { 9550 let result = [] 9551 9552 if (!Array.isArray(list)) { list = [list] } 9553 9554 ['core', 'block', 'inline'].forEach(function (chain) { 9555 result = result.concat(this[chain].ruler.disable(list, true)) 9556 }, this) 9557 9558 result = result.concat(this.inline.ruler2.disable(list, true)) 9559 9560 const missed = list.filter(function (name) { return result.indexOf(name) < 0 }) 9561 9562 if (missed.length && !ignoreInvalid) { 9563 throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed) 9564 } 9565 return this 9566} 9567 9568/** chainable 9569 * MarkdownIt.use(plugin, params) 9570 * 9571 * Load specified plugin with given params into current parser instance. 9572 * It's just a sugar to call `plugin(md, params)` with curring. 9573 * 9574 * ##### Example 9575 * 9576 * ```javascript 9577 * var iterator = require('markdown-it-for-inline'); 9578 * var md = require('markdown-it')() 9579 * .use(iterator, 'foo_replace', 'text', function (tokens, idx) { 9580 * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); 9581 * }); 9582 * ``` 9583 **/ 9584MarkdownIt.prototype.use = function (plugin /*, params, ... */) { 9585 const args = [this].concat(Array.prototype.slice.call(arguments, 1)) 9586 plugin.apply(plugin, args) 9587 return this 9588} 9589 9590/** internal 9591 * MarkdownIt.parse(src, env) -> Array 9592 * - src (String): source string 9593 * - env (Object): environment sandbox 9594 * 9595 * Parse input string and return list of block tokens (special token type 9596 * "inline" will contain list of inline tokens). You should not call this 9597 * method directly, until you write custom renderer (for example, to produce 9598 * AST). 9599 * 9600 * `env` is used to pass data between "distributed" rules and return additional 9601 * metadata like reference info, needed for the renderer. It also can be used to 9602 * inject data in specific cases. Usually, you will be ok to pass `{}`, 9603 * and then pass updated object to renderer. 9604 **/ 9605MarkdownIt.prototype.parse = function (src, env) { 9606 if (typeof src !== 'string') { 9607 throw new Error('Input data should be a String') 9608 } 9609 9610 const state = new this.core.State(src, this, env) 9611 9612 this.core.process(state) 9613 9614 return state.tokens 9615} 9616 9617/** 9618 * MarkdownIt.render(src [, env]) -> String 9619 * - src (String): source string 9620 * - env (Object): environment sandbox 9621 * 9622 * Render markdown string into html. It does all magic for you :). 9623 * 9624 * `env` can be used to inject additional metadata (`{}` by default). 9625 * But you will not need it with high probability. See also comment 9626 * in [[MarkdownIt.parse]]. 9627 **/ 9628MarkdownIt.prototype.render = function (src, env) { 9629 env = env || {} 9630 9631 return this.renderer.render(this.parse(src, env), this.options, env) 9632} 9633 9634/** internal 9635 * MarkdownIt.parseInline(src, env) -> Array 9636 * - src (String): source string 9637 * - env (Object): environment sandbox 9638 * 9639 * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the 9640 * block tokens list with the single `inline` element, containing parsed inline 9641 * tokens in `children` property. Also updates `env` object. 9642 **/ 9643MarkdownIt.prototype.parseInline = function (src, env) { 9644 const state = new this.core.State(src, this, env) 9645 9646 state.inlineMode = true 9647 this.core.process(state) 9648 9649 return state.tokens 9650} 9651 9652/** 9653 * MarkdownIt.renderInline(src [, env]) -> String 9654 * - src (String): source string 9655 * - env (Object): environment sandbox 9656 * 9657 * Similar to [[MarkdownIt.render]] but for single paragraph content. Result 9658 * will NOT be wrapped into `<p>` tags. 9659 **/ 9660MarkdownIt.prototype.renderInline = function (src, env) { 9661 env = env || {} 9662 9663 return this.renderer.render(this.parseInline(src, env), this.options, env) 9664} 9665 9666/* harmony default export */ const markdown_it_lib = (MarkdownIt); 9667 9668;// ./node_modules/markdown-it/index.mjs 9669 9670 9671;// ./node_modules/@contensis/forms/dist/contensis-forms.mjs
9672// src/components/Form.tsx 9673 9674
9675// src/state/captcha.ts 9676var CAPTCHA_LOAD_CALLBACK = "on_captcha_load"; 9677function getCaptchaUrl(siteKey) { 9678 return `https://www.google.com/recaptcha/api.js?onload=${CAPTCHA_LOAD_CALLBACK}&render=${siteKey}`; 9679} 9680function load(captcha) { 9681 if (captcha?.enabled && captcha?.siteKey) { 9682 ensureLoadCallback(); 9683 const captchaUrl = getCaptchaUrl(captcha.siteKey); 9684 const head = document.getElementsByTagName("head")[0]; 9685 const scripts = [...head.getElementsByTagName("script")]; 9686 const scriptSrcs = scripts.map((s) => s.src); 9687 const hasCaptcha = scriptSrcs.includes(captchaUrl); 9688 if (!hasCaptcha) { 9689 const captcha2 = document.createElement("script"); 9690 captcha2.src = captchaUrl; 9691 head.appendChild(captcha2); 9692 } 9693 } 9694} 9695async function contensis_forms_submit(formId, captcha) { 9696 if (captcha?.enabled && captcha?.siteKey) { 9697 load(captcha); 9698 await window[CAPTCHA_LOAD_CALLBACK].loaded; 9699 await new Promise((resolve) => grecaptcha.ready(() => resolve(true))); 9700 return grecaptcha.execute(captcha.siteKey, { action: `${formId}_submit` }); 9701 } else { 9702 return Promise.resolve(""); 9703 } 9704} 9705function ensureLoadCallback() { 9706 if (!window[CAPTCHA_LOAD_CALLBACK]) { 9707 let loadedResolve; 9708 const loaded = new Promise((resolve) => { 9709 loadedResolve = resolve; 9710 }); 9711 const callback = function() { 9712 loadedResolve(null); 9713 }; 9714 Object.assign(callback, { loaded }); 9715 window[CAPTCHA_LOAD_CALLBACK] = callback; 9716 } 9717} 9718var Captcha = { 9719 load, 9720 submit: contensis_forms_submit 9721}; 9722
9723// src/state/version.ts 9724function isPublishedVersion(versionStatus) { 9725 return !versionStatus || versionStatus === "published"; 9726} 9727var Version = { 9728 isPublishedVersion 9729}; 9730
9731// src/state/api.ts 9732function getAllCookies() { 9733 return (document.cookie || "").split("; ").reduce( 9734 (cookies, cookieString) => { 9735 const parts = cookieString.split("="); 9736 const name = contensis_forms_decode(parts[0]); 9737 if (name) { 9738 cookies[name] = contensis_forms_decode(parts.slice(1).join("=")); 9739 } 9740 return cookies; 9741 }, 9742 {} 9743 ); 9744} 9745function contensis_forms_decode(s) { 9746 try { 9747 return decodeURIComponent(s); 9748 } catch (e) { 9749 return s; 9750 } 9751} 9752function setCookie(key, value, expiry) { 9753 document.cookie = `${encodeURIComponent(key)}=${encodeURIComponent(value)}; expires=${expiry.toUTCString()}; path=/;`; 9754} 9755var CmsBearerTokenCookie = "ContensisSecurityBearerToken"; 9756var CmsRefreshTokenCookie = "ContensisSecurityRefreshToken"; 9757var RefreshTokenCookie = "RefreshToken"; 9758var RefreshTokenExpiryTime = 15 * 24 * 3600 * 1e3; 9759var SCOPE = "Security_Administrator ContentType_Read ContentType_Write ContentType_Delete Entry_Read Entry_Write Entry_Delete Project_Read Project_Write Project_Delete Workflow_Administrator"; 9760var GRANT_TYPE = "contensis_classic_refresh_token"; 9761function isLoggedIn() { 9762 const cookies = getAllCookies(); 9763 return !!cookies[CmsBearerTokenCookie]; 9764} 9765async function getBearerToken(options) { 9766 const cookies = getAllCookies(); 9767 if (cookies[CmsBearerTokenCookie]) { 9768 return cookies[CmsBearerTokenCookie]; 9769 } 9770 const refreshToken = cookies[CmsRefreshTokenCookie] || cookies[RefreshTokenCookie]; 9771 if (!refreshToken) { 9772 return null; 9773 } 9774 try { 9775 const currentDate = /* @__PURE__ */ new Date(); 9776 const response = await fetch(`${options.apiUrl}/authenticate/connect/token`, { 9777 headers: { 9778 "content-type": "application/x-www-form-urlencoded;charset=UTF-8" 9779 }, 9780 body: `scope=${encodeURIComponent(SCOPE)}&grant_type=${encodeURIComponent(GRANT_TYPE)}&refresh_token=${encodeURIComponent(refreshToken)}`, 9781 method: "POST", 9782 mode: "cors", 9783 credentials: "omit" 9784 }); 9785 if (!response.ok) { 9786 return null; 9787 } 9788 const data = await response.json(); 9789 const bearerToken = data.access_token; 9790 const bearerTokenExpiryDate = new Date(currentDate.getTime() + data.expires_in * 1e3); 9791 const newRefreshToken = data.refresh_token; 9792 const refreshTokenExpiryDate = new Date(currentDate.getTime() + RefreshTokenExpiryTime); 9793 setCookie(CmsBearerTokenCookie, bearerToken, bearerTokenExpiryDate); 9794 if (newRefreshToken) { 9795 setCookie(RefreshTokenCookie, newRefreshToken, refreshTokenExpiryDate); 9796 } 9797 return bearerToken; 9798 } catch (e) { 9799 return null; 9800 } 9801} 9802async function getDefaultHeaders(options) { 9803 const bearerToken = await getBearerToken(options); 9804 const headers = { 9805 "content-type": "application/json" 9806 }; 9807 if (bearerToken) { 9808 headers.authorization = `Bearer ${bearerToken}`; 9809 } 9810 return headers; 9811} 9812async function getForm({ apiUrl, projectId, formId, language, versionStatus }, signal) { 9813 const query = versionStatus === "latest" ? `?versionStatus=${versionStatus}` : ""; 9814 const headers = await getDefaultHeaders({ apiUrl }); 9815 const response = await fetch(`${apiUrl}/api/forms/projects/${projectId}/contentTypes/${formId}/languages/${language || "default"}${query}`, { 9816 headers, 9817 method: "GET", 9818 mode: "cors", 9819 signal 9820 }); 9821 if (response.ok) { 9822 const result = await response.json(); 9823 return result; 9824 } else { 9825 const error = await response.json(); 9826 return Promise.reject({ 9827 status: response.status, 9828 statusText: response.statusText, 9829 message: error?.message, 9830 error 9831 }); 9832 } 9833} 9834async function saveFormResponse({ 9835 apiUrl, 9836 projectId, 9837 formId, 9838 language, 9839 formVersionNo, 9840 versionStatus, 9841 formResponse, 9842 captcha 9843}) { 9844 const headers = await getDefaultHeaders({ apiUrl }); 9845 const captchaResponse = Version.isPublishedVersion(versionStatus) && !isLoggedIn() ? await Captcha.submit(formId, captcha) : ""; 9846 let url = `${apiUrl}/api/forms/projects/${projectId}/contentTypes/${formId}/languages/${language || "default"}/entries`; 9847 url = Version.isPublishedVersion(versionStatus) && formVersionNo ? url : `${url}?contentTypePreviewVersion=${formVersionNo}`; 9848 const response = await fetch(url, { 9849 headers: { 9850 ...headers, 9851 ...!!captchaResponse ? { "g-recaptcha-response": captchaResponse } : {} 9852 }, 9853 method: "POST", 9854 body: JSON.stringify(formResponse), 9855 mode: "cors" 9856 }); 9857 if (response.ok) { 9858 const result = await response.json(); 9859 return result; 9860 } else { 9861 const error = await response.json(); 9862 return Promise.reject({ 9863 status: response.status, 9864 statusText: response.statusText, 9865 message: error?.message, 9866 error 9867 }); 9868 } 9869} 9870var Api = { 9871 isLoggedIn, 9872 getForm, 9873 saveFormResponse 9874}; 9875
9876// src/state/dates/date-utils.ts 9877function pad(n, length = 2) { 9878 const padding = Array.from({ length }).map(() => "0").join(""); 9879 return `${padding}${n}`.slice(-1 * length); 9880} 9881function padYear(year) { 9882 if (year >= 100) { 9883 return year; 9884 } 9885 year = 1900 + year; 9886 const currentYear = (/* @__PURE__ */ new Date()).getUTCFullYear(); 9887 return currentYear - year > 80 ? year + 100 : year; 9888} 9889function toNumber(n) { 9890 if (typeof n === "number") { 9891 return n; 9892 } 9893 if (typeof n === "string" && !!n) { 9894 const num = Number(n); 9895 if (!Number.isNaN(num)) { 9896 return num; 9897 } 9898 } 9899 return null; 9900} 9901function isWithinRange(n, min, max) { 9902 if (typeof n === "number") { 9903 return n >= min && n <= max; 9904 } 9905 return false; 9906} 9907var INVALID_DATE = "Invalid date"; 9908var INVALID_TIME = "Invalid time"; 9909function isDate(d) { 9910 return Object.prototype.toString.call(d) === "[object Date]"; 9911} 9912function isValidDate(dt) { 9913 return !Number.isNaN(Number(dt)); 9914} 9915function validateDateTimeParts(parts) { 9916 if (!parts?.year && !parts?.month && !parts?.day && !parts?.hour && !parts?.minute) { 9917 return { datetime: null }; 9918 } 9919 const { year, month, day, ...timeParts } = parts; 9920 const date = validateDateParts({ year, month, day }); 9921 const time = validateTimeParts(timeParts);
9922 if (date.invalid || time.invalid) { 9923 return { 9924 datetime: INVALID_DATE, 9925 invalid: [...date.invalid || [], ...time.invalid || []] 9926 }; 9927 } 9928 return { 9929 datetime: date.date.substring(0, 11) + time.time 9930 }; 9931} 9932function validateDateParts(parts) { 9933 if (!parts?.year && !parts?.month && !parts?.day) { 9934 return { date: null }; 9935 } 9936 const year = toNumber(parts.year); 9937 const month = toNumber(parts.month); 9938 const day = toNumber(parts.day); 9939 const invalid = []; 9940 if (!isWithinRange(year, 0, 3e3)) { 9941 invalid.push("year"); 9942 } 9943 if (!isWithinRange(month, 1, 12)) { 9944 invalid.push("month"); 9945 } 9946 if (!isWithinRange(day, 1, 31)) { 9947 invalid.push("day"); 9948 } 9949 if (!invalid.includes("year") && !invalid.includes("month") && !invalid.includes("day")) { 9950 const monthDays = daysInMonth(year, month); 9951 if (day > monthDays) { 9952 invalid.push("day"); 9953 } 9954 } 9955 if (invalid.length) { 9956 return { 9957 date: INVALID_DATE, 9958 invalid 9959 }; 9960 } 9961 return { 9962 date: `${padYear(year)}-${pad(month)}-${pad(day)}T00:00` 9963 }; 9964} 9965function validateTimeParts(parts) { 9966 if (!parts?.hour && !parts?.minute) { 9967 return { time: null }; 9968 } 9969 const hour = toNumber(parts.hour); 9970 const minute = toNumber(parts.minute); 9971 const { timeFormat, period } = parts; 9972 let hour24 = hour; 9973 const invalid = []; 9974 if (timeFormat === "12h") { 9975 if (!isWithinRange(hour, 1, 12)) { 9976 invalid.push("hour"); 9977 } else { 9978 if (hour === 12) { 9979 hour24 = period === "am" ? 0 : hour; 9980 } else { 9981 hour24 = period === "pm" ? hour + 12 : hour; 9982 } 9983 } 9984 } else { 9985 if (!isWithinRange(hour, 0, 23)) { 9986 invalid.push("hour"); 9987 } 9988 } 9989 if (!isWithinRange(minute, 0, 59)) { 9990 invalid.push("minute"); 9991 } 9992 if (invalid.length) { 9993 return { 9994 time: INVALID_TIME, 9995 invalid 9996 }; 9997 } 9998 return { 9999 time: `${pad(hour24)}:${pad(minute)}` 10000 }; 10001} 10002function daysInMonth(year, month) { 10003 const date = new Date(year, month, 1); 10004 date.setDate(0); 10005 return date.getDate(); 10006} 10007
10008// src/state/dates/time-parsing.ts 10009function parseTime(time) { 10010 if (!time) { 10011 return time; 10012 } 10013 const match = [match3Digit, match4Digit].reduce( 10014 (prev, fn) => { 10015 return prev || fn(time); 10016 }, 10017 null 10018 ); 10019 if (!match) { 10020 return INVALID_TIME; 10021 } 10022 let { hour, minute, period } = match; 10023 if (Number.isNaN(hour) || Number.isNaN(minute)) { 10024 return INVALID_TIME; 10025 } 10026 if (hour === 24) { 10027 if (minute === 0) { 10028 hour = 0; 10029 } else { 10030 return INVALID_TIME; 10031 } 10032 } 10033 if (hour === 0 && period === "pm") { 10034 return INVALID_TIME; 10035 } 10036 if (period === "am" && hour > 12) { 10037 return INVALID_TIME; 10038 } 10039 if (period === "am" && hour === 12) { 10040 hour = 0; 10041 } 10042 if (period === "pm" && hour < 12) { 10043 hour += 12; 10044 } 10045 if (hour > 24 || hour < 0) { 10046 return INVALID_TIME; 10047 } 10048 if (minute > 59 || minute < 0) { 10049 return INVALID_TIME; 10050 } 10051 return `${pad(hour)}:${pad(minute)}`; 10052} 10053function match3Digit(time) { 10054 const timeRegex = /^(\d{1,3})([ .])?(am|a.m|a.m.|pm|p.m|p.m.)?$/; 10055 const match = time.match(timeRegex); 10056 if (!match) { 10057 return null; 10058 } 10059 let t = Number(match[1]); 10060 if (Number.isNaN(t)) { 10061 return null; 10062 } 10063 let hour = 0; 10064 let minute = 0; 10065 const period = match[3]; 10066 const isAm = !!period?.startsWith("a"); 10067 const isPm = !!period?.startsWith("p"); 10068 if (t < 100) { 10069 hour = t; 10070 } else { 10071 hour = Math.floor(t / 100); 10072 minute = t % 100; 10073 } 10074 return { 10075 hour, 10076 minute, 10077 period: isAm ? "am" : isPm ? "pm" : null 10078 }; 10079} 10080function match4Digit(time) { 10081 const timeRegex = /^(\d{1,2})([.: ])?(\d{1,2})?([ .])?(am|a.m|am.|a.m.|pm|p.m|pm.|p.m.)?$/; 10082 const match = time.match(timeRegex); 10083 if (!match) { 10084 return null; 10085 } 10086 let hour = Number(match[1]); 10087 const minute = Number(match[3]); 10088 const period = match[5]; 10089 const isAm = !!period?.startsWith("a"); 10090 const isPm = !!period?.startsWith("p"); 10091 return { 10092 hour, 10093 minute, 10094 period: isAm ? "am" : isPm ? "pm" : null 10095 }; 10096} 10097
10098// src/state/dates/locale.ts 10099var DEFAULT_LOCALE = "default"; 10100function isDatePartKey(key) { 10101 return key === "day" || key === "month" || key === "year"; 10102} 10103var localeInfo = /* @__PURE__ */ function() { 10104 let info = void 0; 10105 const createLocaleInfo = function() { 10106 const shortDateFormatter = new Intl.DateTimeFormat(DEFAULT_LOCALE, { dateStyle: "short" }); 10107 const shortTimeFormatter = new Intl.DateTimeFormat(DEFAULT_LOCALE, { timeStyle: "short" }); 10108 const shortDatePartsOrder = shortDateFormatter.formatToParts().map((p) => p.type).filter(isDatePartKey); 10109 const formatters = [dateFormatter("short"), dateFormatter("medium"), dateFormatter("long"), dateFormatter("full")]; 10110 return { 10111 formatters, 10112 shortDateMatchToParts(match) { 10113 return { 10114 [shortDatePartsOrder[0]]: match[0], 10115 [shortDatePartsOrder[1]]: match[1], 10116 [shortDatePartsOrder[2]]: match[2] 10117 }; 10118 }, 10119 shortDateTimeMatchToParts(match) { 10120 return { 10121 [shortDatePartsOrder[0]]: match[0], 10122 [shortDatePartsOrder[1]]: match[1], 10123 [shortDatePartsOrder[2]]: match[2], 10124 hour: match[3], 10125 minute: match[4] 10126 }; 10127 }, 10128 toShortDateString(input) { 10129 if (!input) { 10130 return ""; 10131 } 10132 const dt = isDate(input) ? input : new Date(input); 10133 return isValidDate(dt) ? shortDateFormatter.format(dt) : ""; 10134 }, 10135 toShortDateTimeString(input) { 10136 if (!input) { 10137 return ""; 10138 } 10139 const dt = isDate(input) ? input : new Date(input); 10140 return isValidDate(dt) ? `${shortDateFormatter.format(dt)} ${shortTimeFormatter.format(dt)}` : ""; 10141 } 10142 }; 10143 }; 10144 return function() { 10145 info = info || createLocaleInfo(); 10146 return info; 10147 }; 10148}(); 10149function dateFormatter(dateStyle) { 10150 const dtf = new Intl.DateTimeFormat(DEFAULT_LOCALE, { dateStyle }); 10151 const parts = dtf.formatToParts(); 10152 const monthNames = Array.from({ length: 12 }).map((_, i) => { 10153 const parts2 = dtf.formatToParts(new Date(2e3, i, 1)); 10154 const monthPart = parts2.find((p) => p.type === "month"); 10155 return monthPart?.value || ""; 10156 }); 10157 return { parts, monthNames }; 10158} 10159function parseDateFromFormatter(input, formatter) { 10160 const pattern = createDateParsePattern(formatter.parts); 10161 const result = {}; 10162 for (const p of pattern) { 10163 if (p.literal) { 10164 const i = input.indexOf(p.literal); 10165 if (i >= 0) { 10166 result[p.type] = input.substring(0, i); 10167 input = input.substring(i + p.literal.length); 10168 } 10169 } else { 10170 result[p.type] = input; 10171 } 10172 } 10173 if (result.day && result.month && result.year) { 10174 let month = Number(result.month); 10175 if (Number.isNaN(month)) { 10176 const index = formatter.monthNames.findIndex((m) => !!m && m?.toUpperCase() === result.month?.toUpperCase()); 10177 month = index >= 0 ? index + 1 : month; 10178 } 10179 const dt = validateDateParts({ 10180 year: result.year, 10181 month: `${month}`, 10182 day: result.day 10183 }); 10184 if (!dt.invalid) { 10185 return dt; 10186 } 10187 } 10188} 10189function createDateParsePattern(parts) { 10190 return parts.reduce((prev, part) => { 10191 if (part.type === "literal") { 10192 if (!!prev[prev.length - 1]) { 10193 prev[prev.length - 1].literal = part.value; 10194 } 10195 } else { 10196 prev.push({ type: part.type }); 10197 } 10198 return prev; 10199 }, []); 10200} 10201function parseDateTimeFromFormatter(input, formatter) { 10202 const pattern = createDateTimeParsePattern(formatter.parts); 10203 const result = {}; 10204 for (const p of pattern) { 10205 if (p.literal) { 10206 const i = input.indexOf(p.literal); 10207 if (i >= 0) { 10208 result[p.type] = input.substring(0, i); 10209 input = input.substring(i + p.literal.length); 10210 } 10211 } else { 10212 result[p.type] = input; 10213 } 10214 } 10215 let time = ""; 10216 if (input) { 10217 time = parseTime(input); 10218 if (!time) { 10219 return void 0; 10220 } 10221 } 10222 if (result.day && result.month && result.year) { 10223 let month = Number(result.month); 10224 if (Number.isNaN(month)) { 10225 const index = formatter.monthNames.findIndex((m) => !!m && m?.toUpperCase() === result.month?.toUpperCase());
10226 month = index >= 0 ? index + 1 : month; 10227 } 10228 const hour = !!time ? time.split(":")[0] : void 0; 10229 const minute = !!time ? time.split(":")[1] : void 0; 10230 const dt = validateDateTimeParts({ 10231 year: result.year, 10232 month: `${month}`, 10233 day: result.day, 10234 hour, 10235 minute 10236 }); 10237 if (!dt.invalid) { 10238 return dt; 10239 } 10240 } 10241} 10242function createDateTimeParsePattern(parts) { 10243 return parts.reduce((prev, part) => { 10244 if (part.type === "literal") { 10245 if (!!prev[prev.length - 1]) { 10246 prev[prev.length - 1].literal = part.value; 10247 } 10248 } else { 10249 prev.push({ type: part.type, literal: " " }); 10250 } 10251 return prev; 10252 }, []); 10253} 10254
10255// src/state/dates/date-parsing.ts 10256var ISO_REG_EX = /^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.([0-9]+))?(Z|(?:\+|-)[0-9]{4})?$/; 10257var SHORT_DATE_REG_EX = /^(\d{1,2})(\/|-|\.)(\d{1,2})(\/|-|\.)(\d{2,4})$/; 10258function parseDate(date) { 10259 if (!date) { 10260 return date; 10261 } 10262 let d = parseIso(date); 10263 if (d) { 10264 return d.date; 10265 } 10266 d = parseShortDate(date); 10267 if (d) { 10268 return d.date; 10269 } 10270 d = localeInfo().formatters.reduce((prev, formatter) => prev || parseDateFromFormatter(date, formatter), void 0); 10271 if (d) { 10272 return d.date; 10273 } 10274 return INVALID_DATE; 10275} 10276function parseIso(date) { 10277 let match = date.match(ISO_REG_EX); 10278 if (match) { 10279 const year = match[1]; 10280 const month = match[2]; 10281 const day = match[3]; 10282 return validateDateParts({ year, month, day }); 10283 } 10284} 10285function parseShortDate(date) { 10286 let match = date.match(SHORT_DATE_REG_EX); 10287 if (match) { 10288 const dateParts = localeInfo().shortDateMatchToParts([match[1], match[3], match[5]]); 10289 return validateDateParts(dateParts); 10290 } 10291} 10292
10293// src/state/dates/date-time-parsing.ts 10294var ISO_REG_EX2 = /^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.([0-9]+))?(Z|(?:\+|-)[0-9]{4})?$/; 10295var SHORT_DATE_TIME_REG_EX = /^(\d{1,2})(\/|-|\.)(\d{1,2})(\/|-|\.)(\d{2,4}) (\d{1,2}):(\d{1,2})$/; 10296function parseDateTime(date) { 10297 if (!date) { 10298 return date; 10299 } 10300 let d = parseIso2(date); 10301 if (d) { 10302 return d.datetime; 10303 } 10304 d = parseShortDateTime(date); 10305 if (d) { 10306 return d.datetime; 10307 } 10308 d = localeInfo().formatters.reduce((prev, formatter) => prev || parseDateTimeFromFormatter(date, formatter), void 0); 10309 if (d) { 10310 return d.datetime; 10311 } 10312 return INVALID_DATE; 10313} 10314function parseIso2(date) { 10315 let match = date.match(ISO_REG_EX2); 10316 if (match) { 10317 const year = match[1]; 10318 const month = match[2]; 10319 const day = match[3]; 10320 const hour = match[4]; 10321 const minute = match[5]; 10322 return validateDateTimeParts({ year, month, day, hour, minute, period: "am", timeFormat: "24h" }); 10323 } 10324} 10325function parseShortDateTime(date) { 10326 let match = date.match(SHORT_DATE_TIME_REG_EX); 10327 if (match) { 10328 const dateParts = localeInfo().shortDateTimeMatchToParts([match[1], match[3], match[5], match[6], match[7]]); 10329 return validateDateTimeParts(dateParts); 10330 } 10331} 10332
10333// src/state/dates/dates.ts 10334function getNowDate() { 10335 return toLocalIsoDate(/* @__PURE__ */ new Date()); 10336} 10337function getNowDateTime() { 10338 return toLocalIsoDateTime(/* @__PURE__ */ new Date()); 10339} 10340function getNowTime() { 10341 return toLocalIsoTime(/* @__PURE__ */ new Date()); 10342} 10343function toLocalIsoDate(dt) { 10344 return `${dt.getFullYear()}-${pad2(dt.getMonth() + 1)}-${pad2(dt.getDate())}T00:00`; 10345} 10346function toLocalIsoDateTime(dt) { 10347 return `${dt.getFullYear()}-${pad2(dt.getMonth() + 1)}-${pad2(dt.getDate())}T${pad2(dt.getHours())}:${pad2(dt.getMinutes())}`; 10348} 10349function toDateParts(input) { 10350 const { year, month, day } = toDateTimeParts(input, "24h"); 10351 return { year, month, day }; 10352} 10353function timeToTimeParts(hour, minute, timeFormat) { 10354 let period = "am"; 10355 if (timeFormat === "12h") { 10356 if (hour === 0) { 10357 hour = 12; 10358 } else if (hour === 12) { 10359 period = "pm"; 10360 } else if (hour > 12) { 10361 hour = hour - 12; 10362 period = "pm"; 10363 } 10364 } 10365 return { 10366 hour: timeFormat === "24h" ? pad2(hour) : `${hour}`, 10367 minute: pad2(minute), 10368 period, 10369 timeFormat 10370 }; 10371} 10372function toDateTimeParts(input, timeFormat) { 10373 if (!input) { 10374 return { 10375 year: "", 10376 month: "", 10377 day: "", 10378 hour: "", 10379 minute: "", 10380 period: "am", 10381 timeFormat 10382 }; 10383 } 10384 const dt = isDate(input) ? input : new Date(input); 10385 if (isValidDate(dt)) { 10386 return { 10387 year: `${dt.getFullYear()}`, 10388 month: `${dt.getMonth() + 1}`, 10389 day: `${dt.getDate()}`, 10390 ...timeToTimeParts(dt.getHours(), dt.getMinutes(), timeFormat) 10391 }; 10392 } else { 10393 return { 10394 year: "", 10395 month: "", 10396 day: "", 10397 hour: "", 10398 minute: "", 10399 period: "am", 10400 timeFormat 10401 }; 10402 } 10403} 10404function toTimeParts(input, timeFormat) { 10405 const dateParts = toDateTimeParts(input, timeFormat); 10406 if (dateParts.hour && dateParts.minute) { 10407 return { 10408 hour: dateParts.hour, 10409 minute: dateParts.minute, 10410 period: dateParts.period, 10411 timeFormat: dateParts.timeFormat 10412 }; 10413 } 10414 if (typeof input === "string") { 10415 const parts = input.split(":"); 10416 if (parts.length === 2) { 10417 const hourNum = parseInt(parts[0], 10); 10418 const minuteNum = parseInt(parts[1], 10); 10419 if (!Number.isNaN(hourNum) && !Number.isNaN(minuteNum)) { 10420 return timeToTimeParts(hourNum, minuteNum, timeFormat); 10421 } 10422 } 10423 } 10424 return { 10425 hour: "", 10426 minute: "", 10427 period: "am", 10428 timeFormat 10429 }; 10430} 10431function toLocalIsoTime(dt) { 10432 return `${pad2(dt.getHours())}:${pad2(dt.getMinutes())}`; 10433} 10434function pad2(n, length = 2) { 10435 const padding = Array.from({ length }).map(() => "0").join(""); 10436 return `${padding}${n}`.slice(-1 * length); 10437} 10438
10439// src/state/dates/index.ts 10440var DateTime = { 10441 getNowDate, 10442 getNowDateTime, 10443 getNowTime, 10444 localeInfo, 10445 parseDate, 10446 parseDateTime, 10447 parseTime, 10448 toDateParts, 10449 toDateTimeParts, 10450 toTimeParts, 10451 toLocalIsoDateTime, 10452 validateDateParts, 10453 validateDateTimeParts, 10454 validateTimeParts 10455}; 10456var DateTimeSettings = { 10457 dateFormats: { 10458 dd_mm_yyyy: "dd-mm-yyyy", 10459 mm_dd_yyyy: "mm-dd-yyyy", 10460 yyyy_mm_dd: "yyyy-mm-dd" 10461 }, 10462 timeFormats: { 10463 h12: "12h", 10464 h24: "24h" 10465 }, 10466 defaultSeparators: { 10467 date: "/", 10468 time: ":" 10469 }, 10470 timePeriods: { 10471 am: "am", 10472 pm: "pm" 10473 } 10474}; 10475
10476// src/state/errors.ts 10477function handleError(error) { 10478 console.log(error); 10479} 10480function getErrorMessages(errors) { 10481 return !!errors ? Object.values(errors).map((e) => e.message) : null; 10482} 10483var Errors = { 10484 handleError, 10485 getErrorMessages 10486}; 10487
10488// src/state/localisations.ts 10489function contensis_forms_format(s, ...args) { 10490 if (args.length === 0 || !s) { 10491 return ""; 10492 } 10493 return s.replace(/{([^{}]*)}/g, (_a, b) => { 10494 const bValue = parseInt(b, 10); 10495 if (!Number.isNaN(bValue) && bValue < args.length) { 10496 return args[bValue]; 10497 } 10498 return ""; 10499 }); 10500} 10501function plural(locale, value, fns) { 10502 const pluralRules = new Intl.PluralRules(locale); 10503 const rule = pluralRules.select(value); 10504 const fn = fns[rule]; 10505 return fn(); 10506} 10507function getPageTitle(defaultPageTitle, pageTitle, pageNo, pageCount, hasError, localizations) { 10508 let result = defaultPageTitle; 10509 if (pageCount > 1) { 10510 const pageProgress = contensis_forms_format(localizations.messages.page, pageNo, pageCount); 10511 result = `${defaultPageTitle} - ${pageProgress}`; 10512 if (pageTitle) { 10513 result = `${result} - ${pageTitle}`; 10514 } 10515 } 10516 if (hasError) { 10517 result = `${localizations.error.pageTitle}: ${result}`; 10518 } 10519 return result; 10520} 10521
10522// src/state/store.ts 10523function memo(projector) { 10524 let lastArgs = null; 10525 let lastResult = null; 10526 return function(...args) { 10527 if (lastArgs && lastArgs.length === args.length && lastArgs.every((a, index) => Object.is(a, args[index]))) { 10528 return lastResult; 10529 } 10530 lastArgs = args; 10531 lastResult = projector.apply(null, args); 10532 return lastResult; 10533 }; 10534} 10535
10536// src/state/validation.ts 10537var createFieldValidator = memo((field, language, localizations) => { 10538 const dataTypeMessage = localizations.validation.dataType; 10539 const dateFormatMessages = { 10540 ...localizations.validation.dataFormat, 10541 reference: "" 10542 }; 10543 const validators = [ 10544 ["dataType", createDataTypeValidator(field.dataType), contensis_forms_format(dataTypeMessage[field.dataType], field.name)], 10545 ["dataFormat", createDataFormatValidator(field.dataFormat), field.dataFormat ? contensis_forms_format(dateFormatMessages[field.dataFormat], field.name) : ""], 10546 [ 10547 "required", 10548 createRequiredValidator(field.validations?.required), 10549 field.validations?.required?.message || contensis_forms_format(localizations.validation.required, field.name) 10550 ], 10551 [ 10552 "allowedValue", 10553 createAllowedValueValidator(field.validations?.allowedValue), 10554 field.validations?.allowedValue?.message || contensis_forms_format(localizations.validation.allowedValue, field.name) 10555 ], 10556 [ 10557 "size", 10558 createSizeValidator(field.validations?.min, field.validations?.max), 10559 getRangeErrorMessage( 10560 field.validations?.min, 10561 field.validations?.max, 10562 contensis_forms_format(localizations.validation.min, field.name, field.validations?.min?.value), 10563 contensis_forms_format(localizations.validation.max, field.name, field.validations?.max?.value), 10564 contensis_forms_format(localizations.validation.minMax, field.name, field.validations?.min?.value, field.validations?.max?.value) 10565 ) 10566 ], 10567 [ 10568 "length", 10569 createLengthValidator(field.validations?.minLength, field.validations?.maxLength), 10570 getRangeErrorMessage( 10571 field.validations?.minLength, 10572 field.validations?.maxLength, 10573 contensis_forms_format(localizations.validation.minLength, field.name, field.validations?.minLength?.value), 10574 contensis_forms_format(localizations.validation.maxLength, field.name, field.validations?.maxLength?.value), 10575 contensis_forms_format(localizations.validation.minMax, field.name, field.validations?.minLength?.value, field.validations?.maxLength?.value) 10576 ) 10577 ], 10578 [ 10579 "count", 10580 createCountValidator(field.validations?.minCount, field.validations?.maxCount), 10581 getRangeErrorMessage( 10582 field.validations?.minCount, 10583 field.validations?.maxCount, 10584 countMessage(language, field.validations?.minCount?.value, field, localizations.validation.minCount), 10585 countMessage(language, field.validations?.maxCount?.value, field, localizations.validation.maxCount), 10586 contensis_forms_format(localizations.validation.minMaxCount, field.name, field.validations?.minCount?.value, field.validations?.maxCount?.value) 10587 ) 10588 ], 10589 ["regex", createRegExValidator(field.validations?.regex), field.validations?.regex?.message || contensis_forms_format(localizations.validation.regEx, field.name)], 10590 [ 10591 "allowedValues", 10592 createAllowedValuesValidator(field.validations?.allowedValues), 10593 field.validations?.allowedValues?.message || contensis_forms_format(localizations.validation.allowedValues, field.name) 10594 ], 10595 [ 10596 "pastDateTime", 10597 createPastDateTimeValidator(field.dataType, field.validations?.pastDateTime), 10598 field.validations?.pastDateTime?.message || contensis_forms_format(localizations.validation.pastDateTime, field.name) 10599 ] 10600 ]; 10601 return function(value) { 10602 return validators.reduce( 10603 (prev, [key, validator, message]) => { 10604 const error = validator(value); 10605 if (error) { 10606 prev = prev || {}; 10607 prev = { 10608 ...prev, 10609 [key]: { 10610 ...error, 10611 message 10612 } 10613 }; 10614 } 10615 return prev; 10616 }, 10617 null 10618 ); 10619 }; 10620}); 10621function noopValidator() { 10622 return null; 10623} 10624function isNull(value) { 10625 return value == null; 10626} 10627function isEmpty(value) { 10628 return isNull(value) || value.length === 0; 10629} 10630function hasLength(value) { 10631 return typeof value === "string" || Array.isArray(value); 10632} 10633function fromValid(fn, getResult) { 10634 return (value) => { 10635 const isValid = fn(value); 10636 return isValid ? null : getResult(); 10637 }; 10638} 10639function createDataTypeValidator(dataType) { 10640 return fromValid( 10641 (value) => { 10642 if (isNull(value)) { 10643 return true; 10644 } 10645 switch (dataType) { 10646 case "boolean": { 10647 return typeof value === "boolean"; 10648 } 10649 case "dateTime": { 10650 if (typeof value !== "string") { 10651 return false;
10652 } 10653 const d = new Date(value); 10654 return !Number.isNaN(d.getTime()); 10655 } 10656 case "decimal": { 10657 return typeof value === "number"; 10658 } 10659 case "integer": { 10660 return typeof value === "number" && Number.isSafeInteger(value); 10661 } 10662 case "string": { 10663 return typeof value === "string"; 10664 } 10665 case "stringArray": { 10666 return Array.isArray(value); 10667 } 10668 } 10669 }, 10670 () => ({}) 10671 ); 10672} 10673function createDataFormatValidator(dataFormat) { 10674 return fromValid( 10675 (value) => { 10676 if (isEmpty(value) || !dataFormat) { 10677 return true; 10678 } 10679 switch (dataFormat) { 10680 case "email": { 10681 const emailRegex = new RegExp( 10682 '^(([^<>()\\[\\]\\.,;:\\s@\\"]+(\\.[^<>()\\[\\]\\.,;:\\s@\\"]+)*)|(\\".+\\"))@(([^<>()[\\]\\.,;:\\s@\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\"]{2,})$', 10683 "i" 10684 ); 10685 return typeof value === "string" && emailRegex.test(value); 10686 } 10687 case "phone": { 10688 return true; 10689 } 10690 case "reference": { 10691 return true; 10692 } 10693 case "time": { 10694 const timeRegex = new RegExp("^([01]?[0-9]|2[0-3])([:. ])([0-5]\\d)(\\2[0-5]\\d)?$"); 10695 return typeof value === "string" && timeRegex.test(value); 10696 } 10697 case "url": { 10698 const urlRegex = new RegExp( 10699 "^(?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$" 10700 ); 10701 return typeof value === "string" && urlRegex.test(value); 10702 } 10703 } 10704 }, 10705 () => ({}) 10706 ); 10707} 10708function createRequiredValidator(required) { 10709 return !!required ? fromValid( 10710 (value) => !isEmpty(value),
10711 () => ({}) 10712 ) : noopValidator; 10713} 10714function createSizeValidator(min, max) { 10715 return !!min || !!max ? fromValid( 10716 (value) => { 10717 let valid = true; 10718 if (typeof value === "number") { 10719 if (min) { 10720 valid = value >= min.value; 10721 } 10722 if (valid && max) { 10723 valid = value <= max.value; 10724 } 10725 } 10726 return valid; 10727 }, 10728 () => ({ min: min?.value, max: max?.value }) 10729 ) : noopValidator; 10730} 10731function createLengthValidator(minLength, maxLength) { 10732 return !!minLength || !!maxLength ? fromValid( 10733 (value) => { 10734 let valid = true; 10735 if (hasLength(value)) { 10736 if (minLength) { 10737 valid = value.length >= minLength.value; 10738 } 10739 if (valid && maxLength) { 10740 valid = value.length <= maxLength.value; 10741 } 10742 } 10743 return valid; 10744 }, 10745 () => ({ minLength: minLength?.value, maxLength: maxLength?.value }) 10746 ) : noopValidator; 10747} 10748function createCountValidator(minCount, maxCount) { 10749 return !!minCount || !!maxCount ? fromValid( 10750 (value) => { 10751 let valid = true; 10752 if (hasLength(value)) { 10753 if (minCount) { 10754 valid = value.length >= minCount.value; 10755 } 10756 if (valid && maxCount) { 10757 valid = value.length <= maxCount.value; 10758 } 10759 } 10760 return valid; 10761 }, 10762 () => ({ minCount: minCount?.value, maxCount: maxCount?.value }) 10763 ) : noopValidator; 10764} 10765function createRegExValidator(regex) { 10766 if (!regex?.pattern) { 10767 return noopValidator; 10768 } 10769 const pattern = regex.pattern; 10770 const isValidPattern = pattern && pattern.length > 3 && pattern.startsWith("/"); 10771 const flagsIndex = pattern.lastIndexOf("/"); 10772 const patternWithoutFlags = isValidPattern ? pattern.substring(1, flagsIndex) : pattern; 10773 const flags = !isValidPattern || flagsIndex === pattern.length - 1 || flagsIndex < 0 ? "" : pattern.substring(flagsIndex + 1); 10774 return fromValid( 10775 (value) => { 10776 if (isEmpty(value)) { 10777 return true; 10778 } 10779 const regex2 = new RegExp(patternWithoutFlags, flags); 10780 return typeof value === "string" && regex2.test(value); 10781 }, 10782 () => ({ pattern }) 10783 ); 10784} 10785function createAllowedValueValidator(allowedValue) { 10786 const allowed = allowedValue?.value; 10787 if (isNull(allowed)) { 10788 return noopValidator; 10789 } 10790 return fromValid( 10791 (value) => { 10792 return value === allowed; 10793 }, 10794 () => ({ allowed }) 10795 ); 10796} 10797function createAllowedValuesValidator(allowedValues) { 10798 const allowed = allowedValues?.labeledValues ? allowedValues.labeledValues.map((value) => value.value) : allowedValues?.values; 10799 if (!allowed?.length) { 10800 return noopValidator; 10801 } 10802 return fromValid( 10803 (value) => { 10804 if (isEmpty(value)) { 10805 return true; 10806 } 10807 return Array.isArray(value) ? value.every((v) => allowed.includes(v)) : allowed.includes(value); 10808 }, 10809 () => ({ allowed }) 10810 ); 10811} 10812function createPastDateTimeValidator(dataType, pastDateTime) { 10813 return !!pastDateTime ? fromValid( 10814 (value) => { 10815 if (isNull(value)) { 10816 return true; 10817 } 10818 if (dataType === "dateTime") { 10819 const now = /* @__PURE__ */ new Date(); 10820 const dt = /* @__PURE__ */ new Date(`${value}`); 10821 return dt.getTime() <= now.getTime(); 10822 } 10823 return true; 10824 }, 10825 () => ({}) 10826 ) : noopValidator; 10827} 10828function validate(value, language, field, localizations) { 10829 if (field?.editor?.properties?.hidden) { 10830 return null; 10831 } 10832 const validator = createFieldValidator(field, language, localizations); 10833 return validator(value); 10834} 10835function countMessage(language, value, field, localizations) { 10836 value = value || 0; 10837 return plural(language, value, { 10838 zero: () => contensis_forms_format(localizations.zero, field.name, value), 10839 one: () => contensis_forms_format(localizations.one, field.name, value), 10840 two: () => contensis_forms_format(localizations.two, field.name, value), 10841 few: () => contensis_forms_format(localizations.few, field.name, value), 10842 many: () => contensis_forms_format(localizations.many, field.name, value), 10843 other: () => contensis_forms_format(localizations.other, field.name, value) 10844 }); 10845} 10846function getRangeErrorMessage(min, max, defaultMinMessage, defaultMaxMessage, defaultRangeMessage) { 10847 if (min?.message) { 10848 return min.message; 10849 } 10850 if (max?.message) { 10851 return max.message; 10852 } 10853 if (min && max) { 10854 return defaultRangeMessage; 10855 } 10856 if (min) { 10857 return defaultMinMessage; 10858 } 10859 if (max) { 10860 return defaultMaxMessage; 10861 } 10862 return ""; 10863} 10864var Validation = { 10865 validate 10866}; 10867
10868// src/state/fields.ts 10869var DEFAULT_DATA_TYPE_EDITOR_TYPES = { 10870 boolean: "checkbox", 10871 dateTime: "date", 10872 decimal: "decimal", 10873 integer: "integer", 10874 string: "text", 10875 stringArray: "radio" 10876}; 10877var DEFAULT_DATA_FORMAT_EDITOR_TYPES = { 10878 email: "email", 10879 phone: "tel", 10880 reference: "reference", 10881 time: "time", 10882 url: "url" 10883}; 10884var DEFAULT_EDITOR_ID_EDITOR_TYPES = { 10885 date: "date", 10886 dateparts: "dateparts", 10887 datetime: "datetime", 10888 datetimeparts: "datetimeparts", 10889 decimal: "decimal", 10890 integer: "integer", 10891 list: "radio", 10892 "list-dropdown": "select", 10893 multiline: "multiline", 10894 text: "text", 10895 time: "time", 10896 timeparts: "timeparts" 10897}; 10898function getEditorType(field) { 10899 let editorType = field.editor?.id ? DEFAULT_EDITOR_ID_EDITOR_TYPES[field.editor.id] : null; 10900 if (!editorType && field.dataFormat) { 10901 editorType = DEFAULT_DATA_FORMAT_EDITOR_TYPES[field.dataFormat]; 10902 } 10903 if (!editorType && (field.validations?.allowedValues?.values || field.validations?.allowedValues?.labeledValues)) { 10904 editorType = field.dataType === "stringArray" ? "multiselect" : "radio"; 10905 } 10906 editorType = editorType || DEFAULT_DATA_TYPE_EDITOR_TYPES[field.dataType]; 10907 return editorType || "text"; 10908} 10909var EMPTY_FIELD_VALUES = { 10910 boolean: false, 10911 dateTime: null, 10912 decimal: null, 10913 integer: null, 10914 string: "", 10915 stringArray: null 10916}; 10917function getEmptyFieldValue(field) { 10918 return EMPTY_FIELD_VALUES[field.dataType]; 10919} 10920function getOptions(field, htmlId, localizations) { 10921 const pairs = field?.validations?.allowedValues?.labeledValues ? field?.validations?.allowedValues?.labeledValues?.map((value) => value) : field?.validations?.allowedValues?.values?.map((value) => ({ value, label: value })); 10922 let options = pairs?.filter((pair) => !!pair.value).map((pair, index) => { 10923 return { 10924 key: `${index}`, 10925 htmlId: `${htmlId}-option-${index}`, 10926 value: pair.value || "", 10927 label: pair.label 10928 }; 10929 }); 10930 if (getEditorType(field) === "select") { 10931 options = [ 10932 { 10933 key: "", 10934 htmlId: `${htmlId}-option--1`, 10935 value: "", 10936 label: field?.editor?.properties?.placeholderText || localizations.labels.selectPlaceholder 10937 }, 10938 ...options || [] 10939 ]; 10940 } 10941 return options; 10942} 10943function getDefaultValue(field) { 10944 const defaultValue = typeof field?.default !== "undefined" && field?.default !== null ? field.default : getEmptyFieldValue(field); 10945 if (field.dataType === "dateTime" && defaultValue === "now()") { 10946 const editorType = getEditorType(field); 10947 return editorType === "datetime" || editorType === "datetimeparts" ? DateTime.getNowDateTime() : DateTime.getNowDate(); 10948 } else if (field.dataType === "string" && field.dataFormat === "time" && defaultValue === "now()") { 10949 return DateTime.getNowTime(); 10950 } 10951 return defaultValue; 10952} 10953function getInputValue(field, value) { 10954 const editor = getEditorType(field); 10955 if (field.dataType === "dateTime") { 10956 if (editor === "datetime") { 10957 return DateTime.localeInfo().toShortDateTimeString(value); 10958 } 10959 if (editor === "date") { 10960 return DateTime.localeInfo().toShortDateString(value); 10961 } 10962 if (editor === "datetimeparts") { 10963 return DateTime.toDateTimeParts(value, field.editor?.properties?.timeFormat || "24h"); 10964 } 10965 if (editor === "dateparts") { 10966 return DateTime.toDateParts(value); 10967 } 10968 } 10969 if (field.dataType === "string" && field.dataFormat === "time") { 10970 if (editor === "timeparts") { 10971 return DateTime.toTimeParts(value, field.editor?.properties?.timeFormat || "24h"); 10972 } 10973 } 10974 return value; 10975} 10976function reduceFields(form, fn) { 10977 return form?.fields ? form.fields.reduce((prev, field, index) => ({ ...prev, [field.id]: fn(field, index) }), {}) : {}; 10978} 10979function validate2(field, value, language, localizations) { 10980 return Validation.validate(value, language, field, localizations); 10981} 10982function isNullish(o) { 10983 return o === null || typeof o === "undefined"; 10984} 10985function getInitialValue(field, language, query, progressValue, localizations) { 10986 let value = null; 10987 if (typeof progressValue !== "undefined") { 10988 const errors = validate2(field, progressValue, language, localizations); 10989 if (!errors?.dataType && !errors?.allowedValues) { 10990 value = progressValue; 10991 } 10992 } 10993 if (isNullish(value)) { 10994 let queryValue = null; 10995 const firstQuery = query?.[0]; 10996 switch (field.dataType) { 10997 case "boolean": { 10998 if (firstQuery === "true" || firstQuery === "checked" || firstQuery === "on") { 10999 queryValue = true; 11000 }
11000 else if (firstQuery === "false" || firstQuery === "unchecked" || firstQuery === "off") { 11001 queryValue = false; 11002 } 11003 break; 11004 } 11005 case "dateTime": { 11006 if (firstQuery) { 11007 if (field.dataType === "dateTime") { 11008 return getEditorType(field) === "datetime" ? DateTime.parseDateTime(firstQuery) : DateTime.parseDate(firstQuery); 11009 } else if (field.dataType === "string" && field.dataFormat === "time") { 11010 return DateTime.parseTime(firstQuery); 11011 } 11012 } 11013 break; 11014 } 11015 case "decimal": { 11016 queryValue = !!firstQuery ? parseFloat(firstQuery) : null; 11017 break; 11018 } 11019 case "integer": { 11020 queryValue = !!firstQuery ? parseInt(firstQuery, 10) : null; 11021 break; 11022 } 11023 case "string": { 11024 queryValue = firstQuery; 11025 break; 11026 } 11027 case "stringArray": { 11028 if (query) { 11029 if (field.validations?.allowedValues) { 11030 const allowed = field.validations.allowedValues.labeledValues ? field.validations.allowedValues.labeledValues.map((value2) => value2.value) : field.validations.allowedValues.values; 11031 if (allowed) { 11032 queryValue = query.filter((item) => allowed.includes(item)); 11033 } 11034 } else { 11035 queryValue = query; 11036 } 11037 } 11038 break; 11039 } 11040 } 11041 if (queryValue !== null) { 11042 const errors = validate2(field, queryValue, language, localizations); 11043 if (!errors?.dataType && !errors?.allowedValues) { 11044 value = queryValue; 11045 } 11046 } 11047 } 11048 if (isNullish(value)) { 11049 value = getDefaultValue(field); 11050 } 11051 return value; 11052} 11053var Fields = { 11054 getEditorType, 11055 getOptions, 11056 getInitialValue, 11057 getInputValue, 11058 reduceFields, 11059 validate: validate2 11060}; 11061
11062// src/state/progress.ts 11063var AUTO_SAVE_PROGRESS_EXPIRY_DAYS = 30; 11064function getProgressExpiry() { 11065 const d = /* @__PURE__ */ new Date(); 11066 d.setDate(d.getDate() + AUTO_SAVE_PROGRESS_EXPIRY_DAYS); 11067 return DateTime.toLocalIsoDateTime(d); 11068} 11069function autoSave(form, value) { 11070 if (form?.id && form?.properties?.autoSaveProgress) { 11071 localStorage.setItem(`contensis-form-${form?.id}-expiry`, getProgressExpiry()); 11072 localStorage.setItem(`contensis-form-${form?.id}-value`, !!value ? JSON.stringify(value) : ""); 11073 } 11074} 11075function contensis_forms_reset(form) { 11076 if (form?.id) { 11077 localStorage.removeItem(`contensis-form-${form?.id}-expiry`); 11078 localStorage.removeItem(`contensis-form-${form?.id}-value`); 11079 } 11080} 11081function load2(form) { 11082 if (!!form) { 11083 const expiry = localStorage.getItem(`contensis-form-${form.id}-expiry`); 11084 const jsonValue = localStorage.getItem(`contensis-form-${form.id}-value`); 11085 const d = DateTime.getNowDateTime(); 11086 if (expiry && jsonValue && d < expiry) { 11087 try { 11088 const value = JSON.parse(jsonValue); 11089 return { 11090 value 11091 }; 11092 } catch { 11093 } 11094 } 11095 } 11096 return null; 11097} 11098function loadQuery() { 11099 if (window?.location?.search) { 11100 const params = new URLSearchParams(window.location.search); 11101 return [...params.keys()].reduce( 11102 (prev, key) => ({ 11103 ...prev, 11104 [key]: params.getAll(key) 11105 }), 11106 {} 11107 ); 11108 } 11109 return {}; 11110} 11111var Progress = { 11112 autoSave, 11113 reset: contensis_forms_reset, 11114 load: load2, 11115 loadQuery 11116}; 11117
11118// src/state/form.ts 11119function getInputValue2(form, value) { 11120 return Fields.reduceFields(form, (field) => Fields.getInputValue(field, value?.[field.id])); 11121} 11122function validate3(form, value, localizations) { 11123 return Fields.reduceFields(form, (field) => Validation.validate(value?.[field.id], form.language, field, localizations)); 11124} 11125function getPages(form) { 11126 if (!form) { 11127 return []; 11128 } 11129 if (form?.properties?.mode === "survey") { 11130 return form.fields.map((field, index) => { 11131 const { id, name, description } = field; 11132 return { 11133 pageNo: index + 1, 11134 id, 11135 title: name, 11136 description, 11137 fields: [field] 11138 }; 11139 }); 11140 } else if (!form.groups) { 11141 return [ 11142 { 11143 pageNo: 1, 11144 id: "page1", 11145 title: "", 11146 description: null, 11147 fields: form.fields 11148 } 11149 ]; 11150 } else { 11151 return form.groups.map((group, index) => { 11152 const { id, name, description } = group; 11153 return { 11154 pageNo: index + 1, 11155 id, 11156 title: name, 11157 description, 11158 fields: (form?.fields || []).filter((field) => field.groupId === id) 11159 }; 11160 }); 11161 } 11162} 11163function getInitialValue2(form, localizations) { 11164 const query = Progress.loadQuery(); 11165 const progress = Progress.load(form); 11166 return Fields.reduceFields(form, (field) => Fields.getInitialValue(field, form.language, query?.[field.id], progress?.value?.[field.id], localizations)); 11167} 11168function pageHasErrors(page, errors) { 11169 return !!page && !!page.fields.some((field) => !!errors?.[field.id]); 11170} 11171var Form = { 11172 getInputValue: getInputValue2, 11173 getPages, 11174 getInitialValue: getInitialValue2, 11175 pageHasErrors, 11176 validate: validate3 11177}; 11178
11179// src/state/rules.ts 11180function isConfirmationRuleReturnUri(r) { 11181 return !!r?.link?.sys?.uri; 11182} 11183function isConfirmationRuleReturnContent(r) { 11184 return !!r?.content; 11185} 11186var Rules = { 11187 isConfirmationRuleReturnContent, 11188 isConfirmationRuleReturnUri 11189}; 11190
11191// src/components/FormConfirmation.tsx 11192 11193
11194// src/components/FormRenderContext.tsx 11195 11196var DEFAULT_LANGUAGE = "en-GB"; 11197var DEFAULT_HEADING_LEVEL = 3; 11198var DEFAULT_LOCALIZATIONS = { 11199 buttons: { 11200 next: "Next", 11201 // next 11202 previous: "Previous", 11203 // previous 11204 submit: "Submit" 11205 //submit 11206 }, 11207 load: { 11208 error: "Error loading form", 11209 // na 11210 loading: "Loading..." 11211 // na 11212 }, 11213 error: { 11214 label: "Error", 11215 // errorLabel 11216 pageTitle: "Error", 11217 // errorPageTitle 11218 summaryTitle: "There is a problem" 11219 // errorSummaryTitle 11220 }, 11221 messages: { 11222 confirmation: "Form submitted successfully", 11223 // na 11224 page: "Page {0} of {1}" 11225 // pageHeader 11226 }, 11227 labels: { 11228 selectPlaceholder: "Please select", 11229 // na 11230 required: "required" 11231 // requiredLabel 11232 }, 11233 dates: { 11234 day: "Day", 11235 // dateInputDayLabel 11236 month: "Month", 11237 // dateInputMonthLabel 11238 year: "Year", 11239 // dateInputYearLabel 11240 hour: "Hour", 11241 // dateInputHourLabel 11242 minute: "Minute", 11243 // dateInputMinuteLabel 11244 period: "Period" 11245 // dateInputPeriodLabel 11246 }, 11247 validation: { 11248 dataType: { 11249 boolean: "{0} is not a boolean", 11250 // validationDataTypeBoolean 11251 dateTime: "{0} is not a date", 11252 // validationDataTypeDateTime 11253 decimal: "{0} is not a number", 11254 // validationDataTypeDecimal 11255 integer: "{0} is not an integer", 11256 // // validationDataTypeInteger 11257 string: "{0} is not a string", 11258 // // validationDataTypeString 11259 stringArray: "{0} is not an array" 11260 // validationDataTypeStringArray 11261 }, 11262 dataFormat: { 11263 email: "{0} is not a valid email", 11264 //validationDataFormatEmail 11265 phone: "{0} is not a valid telephone number", 11266 // validationDataFormatPhone 11267 time: "{0} is not a valid time", 11268 // validationDataFormatTime 11269 url: "{0} is not a valid URL" 11270 // validationDataFormatUrl 11271 }, 11272 minCount: { 11273 zero: "{0} requires a minimum of {1} items", 11274 // validationMinCountZero 11275 one: "{0} requires a minimum of {1} item", 11276 // validationMinCountOne 11277 two: "{0} requires a minimum of {1} items", 11278 // validationMinCountTwo 11279 few: "{0} requires a minimum of {1} items", 11280 // validationMinCountFew 11281 many: "{0} requires a minimum of {1} items", 11282 // validationMinCountMany 11283 other: "{0} requires a minimum of {1} items" 11284 // validationMinCountOther 11285 }, 11286 maxCount: { 11287 zero: "{0} requires a maximum of {1} items", 11288 // validationMaxCountZero 11289 one: "{0} requires a maximum of {1} item", 11290 // validationMaxCountOne 11291 two: "{0} requires a maximum of {1} items", 11292 // validationMaxCountTwo 11293 few: "{0} requires a maximum of {1} items", 11294 // validationMaxCountFew 11295 many: "{0} requires a maximum of {1} items", 11296 // validationMaxCountMany 11297 other: "{0} requires a maximum of {1} items" 11298 // validationMaxCountOther 11299 }, 11300 required: "{0} is required", 11301 // validationRequired 11302 allowedValue: "{0} is required", 11303 // validationAllowedValue 11304 allowedValues: "{0} has an invalid value", 11305 // validationAllowedValues 11306 regEx: "{0} has an invalid format", 11307 // validationRegEx 11308 pastDateTime: "{0} must be in the past", 11309 // validationPastDateTime 11310 min: "{0} must be minimum of {1}", 11311 // validationMin 11312 max: "{0} must be a maximum of {1}", 11313 // validationMax 11314 minMax: "{0} must be between {1} and {2}", 11315 // validationMinMax 11316 minLength: "{0} must have a minimum length of {1}", 11317 // validationMinLength 11318 maxLength: "{0} must have a maximum length of {1}", 11319 // validationMaxLength 11320 minMaxLength: "{0} must have a length between {1} and {2}", 11321 // validationMinMaxLength 11322 minMaxCount: "{0} requires between {1} and {2} items" 11323 // validationMinMaxCount 11324 }, 11325 characterCount: { 11326 remaining: { 11327 zero: "You have {0} characters remaining", 11328 // characterCountRemainingZero 11329 one: "You have {0} character remaining", 11330 // characterCountRemainingOne 11331 two: "You have {0} characters remaining", 11332 // characterCountRemainingTwo 11333 few: "You have {0} characters remaining", 11334 // characterCountRemainingFew 11335 many: "You have {0} characters remaining", 11336 // characterCountRemainingMany 11337 other: "You have {0} characters remaining" 11338 // characterCountRemainingOther 11339 }, 11340 exceeded: { 11341 zero: "You have {0} characters too many", 11342 // characterCountExceededZero 11343 one: "You have {0} character too many", 11344 // characterCountExceededOne 11345 two: "You have {0} characters too many", 11346 // characterCountExceededTwo 11347 few: "You have {0} characters too many", 11348 // characterCountExceededFew 11349 many: "You have {0} characters too many", 11350 // characterCountExceededMany 11351 other: "You have {0} characters too many" 11352 // characterCountExceededOther 11353 } 11354 } 11355}; 11356var FormRenderContext = (0,react.createContext)({ language: DEFAULT_LANGUAGE, headingLevel: DEFAULT_HEADING_LEVEL, localizations: DEFAULT_LOCALIZATIONS }); 11357function deepMergeLocalisations(source, partial) { 11358 Object.keys(partial || {}
11358).forEach((key) => { 11359 const value = partial[key]; 11360 if (typeof value === "string" && value !== "") { 11361 source = { ...source, [key]: value }; 11362 } else if (value !== null && typeof value === "object") { 11363 source = { 11364 ...source, 11365 [key]: deepMergeLocalisations(source[key], value) 11366 }; 11367 } 11368 }); 11369 return source; 11370} 11371function mergeLocalizations(localizationsOverrides, form) { 11372 let localizations = JSON.parse(JSON.stringify(DEFAULT_LOCALIZATIONS)); 11373 if (form?.properties?.localizations) { 11374 const l = form.properties.localizations; 11375 localizations = deepMergeLocalisations(localizations, { 11376 buttons: { 11377 next: l.next, 11378 previous: l.previous, 11379 submit: l.submit 11380 }, 11381 error: { 11382 label: l.errorLabel, 11383 pageTitle: l.errorPageTitle, 11384 summaryTitle: l.errorSummaryTitle 11385 }, 11386 messages: { 11387 page: l.pageHeader 11388 }, 11389 labels: { 11390 required: l.requiredLabel 11391 }, 11392 dates: { 11393 day: l.dateInputDayLabel, 11394 month: l.dateInputMonthLabel, 11395 year: l.dateInputYearLabel, 11396 hour: l.dateInputHourLabel, 11397 minute: l.dateInputMinuteLabel, 11398 period: l.dateInputPeriodLabel 11399 }, 11400 validation: { 11401 dataType: { 11402 boolean: l.validationDataTypeBoolean, 11403 dateTime: l.validationDataTypeDateTime, 11404 decimal: l.validationDataTypeDecimal, 11405 integer: l.validationDataTypeInteger, 11406 string: l.validationDataTypeString, 11407 stringArray: l.validationDataTypeStringArray 11408 }, 11409 dataFormat: { 11410 email: l.validationDataFormatEmail, 11411 phone: l.validationDataFormatPhone, 11412 time: l.validationDataFormatTime, 11413 url: l.validationDataFormatUrl 11414 }, 11415 minCount: { 11416 zero: l.validationMinCountZero, 11417 one: l.validationMinCountOne, 11418 two: l.validationMinCountTwo, 11419 few: l.validationMinCountFew, 11420 many: l.validationMinCountMany, 11421 other: l.validationMinCountOther 11422 }, 11423 maxCount: { 11424 zero: l.validationMaxCountZero, 11425 one: l.validationMaxCountOne, 11426 two: l.validationMaxCountTwo, 11427 few: l.validationMaxCountFew, 11428 many: l.validationMaxCountMany, 11429 other: l.validationMaxCountOther 11430 }, 11431 required: l.validationRequired, 11432 allowedValue: l.validationAllowedValue, 11433 allowedValues: l.validationAllowedValues, 11434 regEx: l.validationRegEx, 11435 pastDateTime: l.validationPastDateTime, 11436 min: l.validationMin, 11437 max: l.validationMax, 11438 minMax: l.validationMinMax, 11439 minLength: l.validationMinLength, 11440 maxLength: l.validationMaxLength, 11441 minMaxLength: l.validationMinMaxLength, 11442 minMaxCount: l.validationMinMaxCount 11443 }, 11444 characterCount: { 11445 remaining: { 11446 zero: l.characterCountRemainingZero, 11447 one: l.characterCountRemainingOne, 11448 two: l.characterCountRemainingTwo, 11449 few: l.characterCountRemainingFew, 11450 many: l.characterCountRemainingMany, 11451 other: l.characterCountRemainingOther 11452 }, 11453 exceeded: { 11454 zero: l.characterCountExceededZero, 11455 one: l.characterCountExceededOne, 11456 two: l.characterCountExceededTwo, 11457 few: l.characterCountExceededFew, 11458 many: l.characterCountExceededMany, 11459 other: l.characterCountExceededOther 11460 } 11461 } 11462 }); 11463 } 11464 if (localizationsOverrides) { 11465 localizations = deepMergeLocalisations(localizations, localizationsOverrides); 11466 } 11467 return localizations; 11468} 11469function FormRenderContextProvider({ language, headingLevel, localizations, children }) { 11470 const value = (0,react.useMemo)( 11471 () => ({ 11472 language: language || DEFAULT_LANGUAGE, 11473 headingLevel: headingLevel || DEFAULT_HEADING_LEVEL, 11474 localizations: localizations || DEFAULT_LOCALIZATIONS 11475 }), 11476 [language, headingLevel, localizations] 11477 ); 11478 return /* @__PURE__ */ react.createElement(FormRenderContext.Provider, { value }, children); 11479} 11480
11481// src/components/FormConfirmation.tsx 11482function FormConfirmation(props) { 11483 const { localizations } = (0,react.useContext)(FormRenderContext); 11484 const confirmation = Rules.isConfirmationRuleReturnContent(props.rule) ? props.rule.content : null; 11485 return !!confirmation ? /* @__PURE__ */ react.createElement("div", { className: "form-confirmation-message", dangerouslySetInnerHTML: { __html: confirmation } }) : /* @__PURE__ */ react.createElement("div", { className: "form-confirmation-message" }, localizations.messages.confirmation); 11486} 11487
11488// src/components/FormLoader.tsx 11489 11490
11491// src/components/FormButtons.tsx 11492 11493function FormButtons({ pageIndex, pageCount, currentPage, previousPage }) { 11494 const { localizations } = (0,react.useContext)(FormRenderContext); 11495 const isFirstPage = pageIndex === 0; 11496 const isLastPage = !!pageCount && pageIndex === pageCount - 1; 11497 const pageProgress = pageCount > 1 ? contensis_forms_format(localizations.messages.page, currentPage.pageNo, pageCount) : ""; 11498 return /* @__PURE__ */ react.createElement("div", { className: "form-footer" }, /* @__PURE__ */ react.createElement("div", { className: "form-footer-page" }, pageProgress), /* @__PURE__ */ react.createElement("div", { className: "form-actions" }, isFirstPage ? null : /* @__PURE__ */ react.createElement("button", { type: "button", className: "form-button form-button--secondary form-button--previous", onClick: previousPage }, localizations.buttons.previous), /* @__PURE__ */ react.createElement( 11499 "button", 11500 { 11501 type: "submit", 11502 className: isLastPage ? "form-button form-button--primary form-button--submit" : "form-button form-button--secondary form-button--next" 11503 }, 11504 isLastPage ? localizations.buttons.submit : localizations.buttons.next 11505 ))); 11506} 11507
11508// src/components/FormCurrentPage.tsx 11509 11510
11511// src/components/FormFieldContainer.tsx 11512 11513
11514// src/components/FormCheckbox.tsx 11515 11516
11517// src/components/FormFieldErrors.tsx 11518 11519
11520// src/components/utils.ts 11521function attr(...args) { 11522 const keys = args.reduce((prev, arg) => { 11523 if (arg) { 11524 if (typeof arg === "string") { 11525 prev.push(arg); 11526 } else if (Array.isArray(arg)) { 11527 prev.push(...arg.filter((a) => !!a)); 11528 } else { 11529 Object.keys(arg).filter((key) => !!arg[key]).forEach((key) => prev.push(key)); 11530 } 11531 } 11532 return prev; 11533 }, []); 11534 return keys.length ? keys.join(" ") : void 0; 11535} 11536function progressId(htmlId) { 11537 return `${htmlId}-progress`; 11538} 11539function inputId(inputs) { 11540 return inputs.htmlId; 11541} 11542function instructionsId(inputs) { 11543 return `${inputs.htmlId}-instructions`; 11544} 11545function errorsId(inputs) { 11546 return `${inputs.htmlId}-errors`; 11547} 11548function charCountId(inputs) { 11549 return `${inputs.htmlId}-char-count`; 11550} 11551function inputClassname(inputs, fieldType) { 11552 return attr(`form-${fieldType}-input`, { 11553 [`form-${fieldType}-input-has-error`]: inputs.showErrors && !!inputs.errors 11554 }); 11555} 11556function inputAttrs(inputs, fieldType, settings) { 11557 const invalid = inputs.showErrors && !!inputs.errors; 11558 return { 11559 ref: inputs.inputRef, 11560 className: !!fieldType ? inputClassname(inputs, fieldType) : void 0, 11561 id: inputs.htmlId, 11562 name: inputs.htmlId, 11563 autoComplete: inputs.autoFill || settings?.autoComplete, 11564 rows: inputs.rows || void 0, 11565 placeholder: settings.placeholder && inputs.placeholder || void 0, 11566 inputMode: settings?.inputMode || void 0, 11567 "aria-invalid": invalid, 11568 "aria-describedby": attr({ 11569 [instructionsId(inputs)]: !!inputs.instructions, 11570 [errorsId(inputs)]: invalid, 11571 [charCountId(inputs)]: !!inputs.maxLength 11572 }) 11573 }; 11574} 11575function childInputAttrs(inputs, fieldType, settings) { 11576 const invalid = inputs.showErrors && !!inputs.errors; 11577 return { 11578 ref: inputs.inputRef, 11579 className: !!fieldType ? inputClassname(inputs, `${fieldType}-${settings.name}`) : void 0, 11580 id: `${inputs.htmlId}-${settings.name}`, 11581 name: settings.name, 11582 autoComplete: settings?.autoComplete || void 0, 11583 placeholder: settings?.placeholder || void 0, 11584 inputMode: settings?.inputMode || void 0, 11585 "aria-invalid": invalid, 11586 "aria-describedby": attr({ 11587 [instructionsId(inputs)]: !!inputs.instructions, 11588 [errorsId(inputs)]: invalid, 11589 [charCountId(inputs)]: !!inputs.maxLength 11590 }) 11591 }; 11592} 11593function textValue(value) { 11594 if (typeof value === "string") { 11595 return value; 11596 } 11597 if (typeof value === "number") { 11598 return `${value}`; 11599 } 11600 return ""; 11601} 11602function formFieldCss(inputs, formFieldType) { 11603 return attr( 11604 `form-${formFieldType}`, 11605 [ 11606 inputs.cssClass || "", 11607 inputs.labelPosition === "top" ? `form-${formFieldType}-label-top` : "", 11608 inputs.labelPosition === "leftAligned" ? `form-${formFieldType}-label-left` : "" 11609 ], 11610 { 11611 [`form-${formFieldType}-has-error`]: inputs.showErrors && !!inputs.errors 11612 } 11613 ); 11614} 11615
11616// src/components/FormFieldErrors.tsx 11617function FormFieldErrors({ showErrors, errors, errorMessage, ...attrs }) { 11618 const { localizations } = (0,react.useContext)(FormRenderContext); 11619 return showErrors && errors ? /* @__PURE__ */ react.createElement("div", { id: errorsId(attrs), className: "form-field-error" }, /* @__PURE__ */ react.createElement("span", { className: "visually-hidden" }, localizations.error.label, ":"), " ", errorMessage) : null; 11620} 11621
11622// src/components/FormFieldFooter.tsx 11623 11624function FormFieldFooter({ value, maxLength, ...attrs }) { 11625 const { language, localizations } = (0,react.useContext)(FormRenderContext); 11626 let message = ""; 11627 let remaining = 0; 11628 if (maxLength) { 11629 const v = !!value ? `${value}` : ""; 11630 remaining = maxLength - v.length; 11631 message = getCharCountMessage(language, remaining, localizations); 11632 } 11633 return message ? /* @__PURE__ */ react.createElement("div", { id: charCountId(attrs), className: attr("form-field-char-count", { "field-char-count-error": remaining < 0 }) }, message) : null; 11634} 11635function getCharCountMessage(language, remaining, localizations) { 11636 const exceeded = -1 * remaining; 11637 return remaining < 0 ? plural(language, exceeded, { 11638 zero: () => contensis_forms_format(localizations.characterCount.exceeded.zero, exceeded), 11639 one: () => contensis_forms_format(localizations.characterCount.exceeded.one, exceeded), 11640 two: () => contensis_forms_format(localizations.characterCount.exceeded.two, exceeded), 11641 few: () => contensis_forms_format(localizations.characterCount.exceeded.few, exceeded), 11642 many: () => contensis_forms_format(localizations.characterCount.exceeded.many, exceeded), 11643 other: () => contensis_forms_format(localizations.characterCount.exceeded.other, exceeded) 11644 }) : plural(language, remaining, { 11645 zero: () => contensis_forms_format(localizations.characterCount.remaining.zero, remaining), 11646 one: () => contensis_forms_format(localizations.characterCount.remaining.one, remaining), 11647 two: () => contensis_forms_format(localizations.characterCount.remaining.two, remaining), 11648 few: () => contensis_forms_format(localizations.characterCount.remaining.few, remaining), 11649 many: () => contensis_forms_format(localizations.characterCount.remaining.many, remaining), 11650 other: () => contensis_forms_format(localizations.characterCount.remaining.other, remaining) 11651 }); 11652} 11653
11654// src/components/FormFieldInstructions.tsx 11655 11656
11657// src/components/html/renderer.ts 11658 11659var markdownRenderer = markdown_it_lib(); 11660function markdown(markdown2) { 11661 return markdownRenderer.render(markdown2); 11662} 11663var Renderers = { 11664 markdown 11665}; 11666
11667// src/components/html/Description.tsx 11668 11669function Description(props) { 11670 const description = (0,react.useMemo)(() => getDescriptionHtml(props.description), [props.description]); 11671 return !!description ? /* @__PURE__ */ react.createElement("div", { id: props.id, className: props.className, dangerouslySetInnerHTML: { __html: description } }) : null; 11672} 11673function getDescriptionHtml(description) { 11674 if (!description) { 11675 return ""; 11676 } 11677 return Renderers.markdown(description); 11678} 11679
11680// src/components/html/Heading.tsx 11681 11682function Heading({ level, ...props }) { 11683 const { headingLevel } = (0,react.useContext)(FormRenderContext); 11684 let newLevel = Number(level); 11685 newLevel = Number.isNaN(newLevel) ? 1 : newLevel; 11686 newLevel = newLevel + headingLevel - 1; 11687 const HeadingEl = `h${newLevel}`; 11688 return /* @__PURE__ */ react.createElement(HeadingEl, { ...props }); 11689} 11690
11691// src/components/FormFieldInstructions.tsx 11692function FormFieldInstructions(props) { 11693 return /* @__PURE__ */ react.createElement(Description, { id: instructionsId(props), className: "form-field-instructions", description: props.instructions }); 11694} 11695
11696// src/components/FormFieldLabel.tsx 11697 11698function FormFieldLabel(props) { 11699 return /* @__PURE__ */ react.createElement("div", { className: "form-field-label-container" }, /* @__PURE__ */ react.createElement("label", { className: "form-field-label", htmlFor: inputId(props) }, /* @__PURE__ */ react.createElement(RequiredLabelText, { label: props.label, required: props.required, requiredClassName: "form-field-label-required" }))); 11700} 11701function RequiredLabelText(props) { 11702 const { localizations } = (0,react.useContext)(FormRenderContext); 11703 return /* @__PURE__ */ react.createElement(react.Fragment, null, props.label, " ", props.required ? /* @__PURE__ */ react.createElement("abbr", { className: props.requiredClassName, title: localizations.labels.required }, "*") : ""); 11704} 11705
11706// src/components/FormCheckbox.tsx 11707function FormCheckbox(props) { 11708 return /* @__PURE__ */ react.createElement("div", { className: formFieldCss(props, "checkbox-field") }, /* @__PURE__ */ react.createElement(FormFieldInstructions, { ...props }), /* @__PURE__ */ react.createElement(FormFieldErrors, { ...props }), /* @__PURE__ */ react.createElement("div", { className: attr("form-checkbox", { "form-checkbox--checked": !!props.inputValue }) }, props.children, /* @__PURE__ */ react.createElement("label", { className: "form-checkbox-label form-checkbox-field-label", htmlFor: inputId(props) }, /* @__PURE__ */ react.createElement(RequiredLabelText, { label: props.label, required: props.required, requiredClassName: "form-checkbox-field-label-required" }))), /* @__PURE__ */ react.createElement(FormFieldFooter, { ...props })); 11709} 11710
11711// src/components/FormField.tsx 11712 11713function FormField(props) { 11714 return /* @__PURE__ */ react.createElement("div", { className: formFieldCss(props, "field") }, /* @__PURE__ */ react.createElement(FormFieldLabel, { ...props }), /* @__PURE__ */ react.createElement(FormFieldInstructions, { ...props }), /* @__PURE__ */ react.createElement(FormFieldErrors, { ...props }), /* @__PURE__ */ react.createElement("div", { className: "form-field-input-container" }, props.children), /* @__PURE__ */ react.createElement(FormFieldFooter, { ...props })); 11715} 11716
11717// src/components/FormFieldset.tsx 11718 11719function FormFieldset(props) { 11720 return /* @__PURE__ */ react.createElement("fieldset", { className: formFieldCss(props, "fieldset"), ...props.instructions ? { "aria-describedby": instructionsId(props) } : {} }, /* @__PURE__ */ react.createElement("legend", { className: "form-field-legend" }, /* @__PURE__ */ react.createElement(RequiredLabelText, { label: props.label, required: props.required, requiredClassName: "form-field-legend-required" })), /* @__PURE__ */ react.createElement(FormFieldInstructions, { ...props }), /* @__PURE__ */ react.createElement(FormFieldErrors, { ...props }), /* @__PURE__ */ react.createElement("div", { className: "form-fieldset-input-container" }, props.children)); 11721} 11722
11723// src/components/inputs/CheckboxInput.tsx 11724 11725function CheckboxInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 11726 const onInputChange = ($event) => { 11727 onChange($event.target.checked); 11728 }; 11729 return /* @__PURE__ */ react.createElement("input", { type: "checkbox", ...inputAttrs(attrs, "checkbox", {}), checked: !!inputValue, onChange: onInputChange, onFocus, onBlur }); 11730} 11731
11732// src/components/inputs/DateInput.tsx 11733 11734function DateInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 11735 const onInputChange = ($event) => { 11736 const date = DateTime.parseDate($event.target.value); 11737 onChange($event.target.value, date); 11738 }; 11739 return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement( 11740 "input", 11741 { 11742 type: "text", 11743 ...inputAttrs(attrs, "date", { autoComplete: "bday" }), 11744 value: textValue(inputValue), 11745 onChange: onInputChange, 11746 onFocus, 11747 onBlur 11748 } 11749 )); 11750} 11751
11752// src/components/inputs/DatePartsInput.tsx 11753 11754function DatePartsInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 11755 const { localizations } = (0,react.useContext)(FormRenderContext); 11756 const { field } = attrs; 11757 const date = inputValue; 11758 const onInputChange = ($event) => { 11759 const newDateParts = { ...date, [$event.target.name]: $event.target.value }; 11760 const newDate = DateTime.validateDateParts(newDateParts); 11761 onChange(newDateParts, newDate.date); 11762 }; 11763 const separator = field?.editor?.properties?.dateSeparator || DateTimeSettings.defaultSeparators.date; 11764 const day = { 11765 label: localizations.dates.day, 11766 attrs: childInputAttrs(attrs, "date", { autoComplete: "bday-day", inputMode: "numeric", name: "day" }), 11767 value: textValue(date.day) 11768 }; 11769 const month = { 11770 label: localizations.dates.month, 11771 attrs: childInputAttrs(attrs, "date", { autoComplete: "bday-month", inputMode: "numeric", name: "month" }), 11772 value: textValue(date.month) 11773 }; 11774 const year = { 11775 label: localizations.dates.year, 11776 attrs: childInputAttrs(attrs, "date", { autoComplete: "bday-year", inputMode: "numeric", name: "year" }), 11777 value: textValue(date.year) 11778 }; 11779 let input1 = day; 11780 let input2 = month; 11781 let input3 = year; 11782 if (field?.editor?.properties?.dateFormat === DateTimeSettings.dateFormats.mm_dd_yyyy) { 11783 input1 = month; 11784 input2 = day; 11785 input3 = year; 11786 } else if (field?.editor?.properties?.dateFormat === DateTimeSettings.dateFormats.yyyy_mm_dd) { 11787 input1 = year; 11788 input2 = month; 11789 input3 = day; 11790 } 11791 return /* @__PURE__ */ react.createElement("div", { className: "form-date-items" }, /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: input1.attrs.id }, input1.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...input1.attrs, value: input1.value, onChange: onInputChange, onFocus, onBlur })), /* @__PURE__ */ react.createElement("div", { className: "form-date-separator" }, separator), /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: input2.attrs.id }, input2.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...input2.attrs, value: input2.value, onChange: onInputChange, onFocus, onBlur })), /* @__PURE__ */ react.createElement("div", { className: "form-date-separator" }, separator), /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: input3.attrs.id }, input3.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...input3.attrs, value: input3.value, onChange: onInputChange, onFocus, onBlur }))); 11792} 11793
11794// src/components/inputs/DateTimeInput.tsx 11795 11796function DateTimeInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 11797 const onInputChange = ($event) => { 11798 const date = DateTime.parseDateTime($event.target.value); 11799 onChange($event.target.value, date); 11800 }; 11801 return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement( 11802 "input", 11803 { 11804 type: "text", 11805 ...inputAttrs(attrs, "date-time", { autoComplete: "bday" }), 11806 value: textValue(inputValue), 11807 onChange: onInputChange, 11808 onFocus, 11809 onBlur 11810 } 11811 )); 11812} 11813
11814// src/components/inputs/DateTimePartsInput.tsx 11815 11816function DateTimePartsInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 11817 const { localizations } = (0,react.useContext)(FormRenderContext); 11818 const { field } = attrs; 11819 const dateTime = inputValue; 11820 const onInputChange = ($event) => { 11821 const newDateTimeParts = { ...dateTime, [$event.target.name]: $event.target.value }; 11822 const newDateTime = DateTime.validateDateTimeParts(newDateTimeParts); 11823 onChange(newDateTimeParts, newDateTime.datetime); 11824 }; 11825 const separator = field?.editor?.properties?.dateSeparator || DateTimeSettings.defaultSeparators.date; 11826 const timeSeparator = field?.editor?.properties?.timeSeparator || DateTimeSettings.defaultSeparators.time; 11827 const day = { 11828 label: localizations.dates.day, 11829 attrs: childInputAttrs(attrs, "date", { autoComplete: "bday-day", inputMode: "numeric", name: "day" }), 11830 value: textValue(dateTime.day) 11831 }; 11832 const month = { 11833 label: localizations.dates.month, 11834 attrs: childInputAttrs(attrs, "date", { autoComplete: "bday-month", inputMode: "numeric", name: "month" }), 11835 value: textValue(dateTime.month) 11836 }; 11837 const year = { 11838 label: localizations.dates.year, 11839 attrs: childInputAttrs(attrs, "date", { autoComplete: "bday-year", inputMode: "numeric", name: "year" }), 11840 value: textValue(dateTime.year) 11841 }; 11842 const hour = { 11843 label: localizations.dates.hour, 11844 attrs: childInputAttrs(attrs, "time", { autoComplete: "off", inputMode: "numeric", name: "hour" }), 11845 value: textValue(dateTime.hour) 11846 }; 11847 const minute = { 11848 label: localizations.dates.minute, 11849 attrs: childInputAttrs(attrs, "time", { autoComplete: "off", inputMode: "numeric", name: "minute" }), 11850 value: textValue(dateTime.minute) 11851 }; 11852 const period = { 11853 label: localizations.dates.period, 11854 attrs: childInputAttrs(attrs, "time", { name: "period" }), 11855 value: textValue(dateTime.period) 11856 }; 11857 let input1 = day; 11858 let input2 = month; 11859 let input3 = year; 11860 if (field?.editor?.properties?.dateFormat === DateTimeSettings.dateFormats.mm_dd_yyyy) { 11861 input1 = month; 11862 input2 = day; 11863 input3 = year; 11864 } else if (field?.editor?.properties?.dateFormat === DateTimeSettings.dateFormats.yyyy_mm_dd) { 11865 input1 = year; 11866 input2 = month; 11867 input3 = day; 11868 } 11869 return /* @__PURE__ */ react.createElement("div", { className: "form-date-items" }, /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: input1.attrs.id }, input1.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...input1.attrs, value: input1.value, onChange: onInputChange, onFocus, onBlur })), /* @__PURE__ */ react.createElement("div", { className: "form-date-separator" }, separator), /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: input2.attrs.id }, input2.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...input2.attrs, value: input2.value, onChange: onInputChange, onFocus, onBlur })), /* @__PURE__ */ react.createElement("div", { className: "form-date-separator" }, separator), /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: input3.attrs.id }, input3.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...input3.attrs, value: input3.value, onChange: onInputChange, onFocus, onBlur })), /* @__PURE__ */ react.createElement("div", { className: "form-date-separator" }, " "), /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: hour.attrs.id }, hour.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...hour.attrs, value: hour.value, onChange: onInputChange, onFocus, onBlur })), /* @__PURE__ */ react.createElement("div", { className: "form-date-separator" }, timeSeparator), /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: minute.attrs.id }
11869, minute.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...minute.attrs, value: minute.value, onChange: onInputChange, onFocus, onBlur })), dateTime.timeFormat === "12h" ? /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement("div", { className: "form-date-separator" }, timeSeparator), /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: period.attrs.id }, period.label), /* @__PURE__ */ react.createElement("select", { ...period.attrs, value: period.value, onChange: onInputChange, onFocus, onBlur }, /* @__PURE__ */ react.createElement("option", { value: DateTimeSettings.timePeriods.am }, DateTimeSettings.timePeriods.am), /* @__PURE__ */ react.createElement("option", { value: DateTimeSettings.timePeriods.pm }, DateTimeSettings.timePeriods.pm)))) : null); 11870} 11871
11872// src/components/inputs/DecimalInput.tsx 11873 11874function DecimalInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 11875 const onInputChange = ($event) => { 11876 const inputValue2 = $event.target.value; 11877 const decimalValue = !!inputValue2 ? Number(inputValue2) : null; 11878 const value = Number.isNaN(decimalValue) ? inputValue2 : decimalValue; 11879 onChange(inputValue2, value); 11880 }; 11881 return /* @__PURE__ */ react.createElement( 11882 "input", 11883 { 11884 type: "text", 11885 ...inputAttrs(attrs, "decimal", { placeholder: true, inputMode: "decimal" }), 11886 spellCheck: "false", 11887 value: textValue(inputValue), 11888 onChange: onInputChange, 11889 onFocus, 11890 onBlur 11891 } 11892 ); 11893} 11894
11895// src/components/inputs/EmailInput.tsx 11896 11897function EmailInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 11898 const onInputChange = ($event) => { 11899 onChange($event.target.value); 11900 }; 11901 return /* @__PURE__ */ react.createElement( 11902 "input", 11903 { 11904 type: "email", 11905 ...inputAttrs(attrs, "email", { autoComplete: "email", placeholder: true }), 11906 spellCheck: "false", 11907 value: textValue(inputValue), 11908 onChange: onInputChange, 11909 onFocus, 11910 onBlur 11911 } 11912 ); 11913} 11914
11915// src/components/inputs/IntegerInput.tsx 11916 11917function IntegerInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 11918 const onInputChange = ($event) => { 11919 const inputValue2 = $event.target.value; 11920 const integerValue = !!inputValue2 ? Number(inputValue2) : null; 11921 const value = Number.isNaN(integerValue) ? inputValue2 : integerValue; 11922 onChange(inputValue2, value); 11923 }; 11924 return /* @__PURE__ */ react.createElement( 11925 "input", 11926 { 11927 type: "text", 11928 ...inputAttrs(attrs, "integer", { placeholder: true, inputMode: "numeric" }), 11929 spellCheck: "false", 11930 inputMode: "numeric", 11931 pattern: "[0-9]*", 11932 value: textValue(inputValue), 11933 onChange: onInputChange, 11934 onFocus, 11935 onBlur 11936 } 11937 ); 11938} 11939
11940// src/components/inputs/MultiSelectInput.tsx 11941 11942function MultiSelectInput({ value: unknownValue, options, inputRef, htmlId, onChange, onBlur, onFocus }) { 11943 const value = unknownValue; 11944 const onInputChange = ($event) => { 11945 let newValue = value || []; 11946 if ($event.target.checked) { 11947 if (!newValue.includes($event.target.value)) { 11948 onChange([...newValue, $event.target.value]); 11949 } 11950 } else { 11951 if (newValue.includes($event.target.value)) { 11952 onChange(newValue.filter((v) => v !== $event.target.value)); 11953 } 11954 } 11955 }; 11956 return /* @__PURE__ */ react.createElement("div", { className: "form-checkbox-list" }, options?.map((option, index) => /* @__PURE__ */ react.createElement("div", { className: attr("form-checkbox", { "form-checkbox--checked": !!value?.includes(option.value) }), key: option.key }, /* @__PURE__ */ react.createElement( 11957 "input", 11958 { 11959 type: "checkbox", 11960 ref: index === 0 ? inputRef : void 0, 11961 className: "form-checkbox-input", 11962 id: option.htmlId, 11963 name: htmlId, 11964 value: option.value, 11965 checked: !!value?.includes(option.value), 11966 onChange: onInputChange, 11967 onFocus, 11968 onBlur 11969 } 11970 ), /* @__PURE__ */ react.createElement("label", { className: "form-checkbox-label", htmlFor: option.htmlId }, option.label)))); 11971} 11972
11973// src/components/inputs/MultilineInput.tsx 11974 11975function MultilineInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 11976 const onInputChange = ($event) => { 11977 onChange($event.target.value); 11978 }; 11979 return /* @__PURE__ */ react.createElement( 11980 "textarea", 11981 { 11982 ...inputAttrs(attrs, "multiline", { placeholder: true }), 11983 value: textValue(inputValue), 11984 onChange: onInputChange, 11985 onFocus, 11986 onBlur 11987 } 11988 ); 11989} 11990
11991// src/components/inputs/RadioInput.tsx 11992 11993function RadioInput({ onChange, options, htmlId, inputRef, value, onBlur, onFocus }) { 11994 const onInputChange = ($event) => { 11995 onChange($event.target.value); 11996 }; 11997 return /* @__PURE__ */ react.createElement("div", { className: "form-radio-list" }, options?.map((option, index) => /* @__PURE__ */ react.createElement("div", { className: attr("form-radio", { "form-radio--checked": value === option.value }), key: option.key }, /* @__PURE__ */ react.createElement( 11998 "input", 11999 { 12000 type: "radio", 12001 ref: index === 0 ? inputRef : void 0, 12002 className: "form-radio-input", 12003 id: option.htmlId, 12004 name: htmlId, 12005 value: option.value, 12006 checked: value === option.value, 12007 onChange: onInputChange, 12008 onFocus, 12009 onBlur 12010 } 12011 ), /* @__PURE__ */ react.createElement("label", { className: "form-radio-label", htmlFor: option.htmlId }, option.label)))); 12012} 12013
12014// src/components/inputs/ReferenceInput.tsx 12015function ReferenceInput() { 12016 return null; 12017} 12018
12019// src/components/inputs/SelectInput.tsx 12020 12021function SelectInput({ inputValue, options, onChange, onBlur, onFocus, ...attrs }) { 12022 const onInputChange = ($event) => { 12023 onChange($event.target.value); 12024 }; 12025 return /* @__PURE__ */ react.createElement("select", { ...inputAttrs(attrs, "select", {}), value: textValue(inputValue), onChange: onInputChange, onFocus, onBlur }, options?.map((option) => /* @__PURE__ */ react.createElement("option", { value: option.value, key: option.key }, option.label))); 12026} 12027
12028// src/components/inputs/TelInput.tsx 12029 12030function TelInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 12031 const onInputChange = ($event) => { 12032 onChange($event.target.value); 12033 }; 12034 return /* @__PURE__ */ react.createElement( 12035 "input", 12036 { 12037 type: "tel", 12038 ...inputAttrs(attrs, "tel", { autoComplete: "tel", placeholder: true }), 12039 spellCheck: "false", 12040 value: textValue(inputValue), 12041 onChange: onInputChange, 12042 onFocus, 12043 onBlur 12044 } 12045 ); 12046} 12047
12048// src/components/inputs/TextInput.tsx 12049 12050function TextInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 12051 const onInputChange = ($event) => { 12052 onChange($event.target.value); 12053 }; 12054 return /* @__PURE__ */ react.createElement( 12055 "input", 12056 { 12057 type: "text", 12058 ...inputAttrs(attrs, "text", { placeholder: true }), 12059 value: textValue(inputValue), 12060 onChange: onInputChange, 12061 onFocus, 12062 onBlur 12063 } 12064 ); 12065} 12066
12067// src/components/inputs/TimeInput.tsx 12068 12069function TimeInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 12070 const onInputChange = ($event) => { 12071 const time = DateTime.parseTime($event.target.value); 12072 onChange($event.target.value, time); 12073 }; 12074 return /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement( 12075 "input", 12076 { 12077 type: "text", 12078 ...inputAttrs(attrs, "time", { autoComplete: "off", placeholder: false }), 12079 value: textValue(inputValue), 12080 onChange: onInputChange, 12081 onFocus, 12082 onBlur 12083 } 12084 )); 12085} 12086
12087// src/components/inputs/TimePartsInput.tsx 12088 12089function TimePartsInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 12090 const { localizations } = (0,react.useContext)(FormRenderContext); 12091 const { field } = attrs; 12092 const time = inputValue; 12093 const timeSeparator = field?.editor?.properties?.timeSeparator || DateTimeSettings.defaultSeparators.time; 12094 const onInputChange = ($event) => { 12095 const newTimeParts = { ...time, [$event.target.name]: $event.target.value }; 12096 const newTime = DateTime.validateTimeParts(newTimeParts); 12097 onChange(newTimeParts, newTime.time); 12098 }; 12099 const hour = { 12100 label: localizations.dates.hour, 12101 attrs: childInputAttrs(attrs, "time", { autoComplete: "off", inputMode: "numeric", name: "hour" }), 12102 value: textValue(time.hour) 12103 }; 12104 const minute = { 12105 label: localizations.dates.minute, 12106 attrs: childInputAttrs(attrs, "time", { autoComplete: "off", inputMode: "numeric", name: "minute" }), 12107 value: textValue(time.minute) 12108 }; 12109 const period = { 12110 label: localizations.dates.period, 12111 attrs: childInputAttrs(attrs, "time", { name: "period" }), 12112 value: textValue(time.period) 12113 }; 12114 return /* @__PURE__ */ react.createElement("div", { className: "form-date-items" }, /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: hour.attrs.id }, hour.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...hour.attrs, value: hour.value, onChange: onInputChange, onFocus, onBlur })), /* @__PURE__ */ react.createElement("div", { className: "form-date-separator" }, timeSeparator), /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: minute.attrs.id }, minute.label), /* @__PURE__ */ react.createElement("input", { type: "text", ...minute.attrs, value: minute.value, onChange: onInputChange, onFocus, onBlur }
12114)), time.timeFormat === "12h" ? /* @__PURE__ */ react.createElement(react.Fragment, null, /* @__PURE__ */ react.createElement("div", { className: "form-date-separator" }, timeSeparator), /* @__PURE__ */ react.createElement("div", { className: "form-date-item" }, /* @__PURE__ */ react.createElement("label", { htmlFor: period.attrs.id }, period.label), /* @__PURE__ */ react.createElement("select", { ...period.attrs, value: period.value, onChange: onInputChange, onFocus, onBlur }, /* @__PURE__ */ react.createElement("option", { value: DateTimeSettings.timePeriods.am }, DateTimeSettings.timePeriods.am), /* @__PURE__ */ react.createElement("option", { value: DateTimeSettings.timePeriods.pm }, DateTimeSettings.timePeriods.pm)))) : null); 12115} 12116
12117// src/components/inputs/UrlInput.tsx 12118 12119function UrlInput({ inputValue, onChange, onBlur, onFocus, ...attrs }) { 12120 const onInputChange = ($event) => { 12121 onChange($event.target.value); 12122 }; 12123 return /* @__PURE__ */ react.createElement( 12124 "input", 12125 { 12126 type: "url", 12127 ...inputAttrs(attrs, "url", { autoComplete: "url", placeholder: true }), 12128 spellCheck: "false", 12129 value: textValue(inputValue), 12130 onChange: onInputChange, 12131 onFocus, 12132 onBlur 12133 } 12134 ); 12135} 12136
12137// src/components/inputs/defaults.ts 12138var DEFAULT_INPUTS = { 12139 checkbox: CheckboxInput, 12140 date: DateInput, 12141 dateparts: DatePartsInput, 12142 datetime: DateTimeInput, 12143 datetimeparts: DateTimePartsInput, 12144 decimal: DecimalInput, 12145 email: EmailInput, 12146 integer: IntegerInput, 12147 multiline: MultilineInput, 12148 multiselect: MultiSelectInput, 12149 radio: RadioInput, 12150 reference: ReferenceInput, 12151 select: SelectInput, 12152 tel: TelInput, 12153 text: TextInput, 12154 time: TimeInput, 12155 timeparts: TimePartsInput, 12156 url: UrlInput 12157}; 12158
12159// src/components/FormFieldContainer.tsx 12160var DEFAULT_CONTAINERS_TYPES = { 12161 checkbox: "checkbox", 12162 date: "control", 12163 dateparts: "fieldset", 12164 datetime: "control", 12165 datetimeparts: "fieldset", 12166 decimal: "control", 12167 email: "control", 12168 integer: "control", 12169 multiline: "control", 12170 multiselect: "fieldset", 12171 radio: "fieldset", 12172 reference: "control", 12173 select: "control", 12174 tel: "control", 12175 text: "control", 12176 time: "control", 12177 timeparts: "fieldset", 12178 url: "control" 12179}; 12180var DEFAULT_CONTAINERS = { 12181 checkbox: FormCheckbox, 12182 control: FormField, 12183 fieldset: FormFieldset 12184}; 12185function FormFieldContainer({ 12186 field, 12187 formHtmlId, 12188 formValue, 12189 formInputValue, 12190 formErrors, 12191 showErrors, 12192 inputRefs, 12193 hasFocus, 12194 setValue, 12195 setInputValue, 12196 setFocussed 12197}) { 12198 const { localizations } = (0,react.useContext)(FormRenderContext); 12199 const htmlId = `${formHtmlId}-${field.id}`; 12200 const editor = Fields.getEditorType(field); 12201 const errors = formErrors?.[field.id]; 12202 const errorMessages = Errors.getErrorMessages(errors); 12203 const formFieldContainer = DEFAULT_CONTAINERS_TYPES[editor]; 12204 const inputProps = { 12205 htmlId, 12206 id: field.id, 12207 label: field?.editor?.label || field.name, 12208 instructions: field?.editor?.instructions, 12209 autoFill: field?.editor?.properties?.autoFill, 12210 placeholder: field?.editor?.properties?.placeholderText, 12211 rows: field?.editor?.properties?.rows, 12212 labelPosition: field?.editor?.properties?.labelPosition, 12213 cssClass: field?.editor?.properties?.cssClass, 12214 hidden: !!field?.editor?.properties?.hidden || editor === "reference", 12215 options: Fields.getOptions(field, htmlId, localizations), 12216 field, 12217 editor, 12218 required: !!field?.validations?.required, 12219 maxLength: field?.validations?.maxLength?.value, 12220 inputValue: formInputValue?.[field.id], 12221 value: formValue?.[field.id], 12222 errors, 12223 errorMessages, 12224 errorMessage: errorMessages?.length ? errorMessages[0] : null, 12225 showErrors, 12226 inputRef: inputRefs?.[field.id], 12227 onChange: (inputValue, value) => { 12228 value = typeof value === "undefined" ? inputValue : value; 12229 setInputValue(field.id, inputValue); 12230 setValue(field.id, value); 12231 }, 12232 onFocus: () => { 12233 setFocussed(field.id, true); 12234 }, 12235 onBlur: () => { 12236 setFocussed(field.id, false); 12237 } 12238 }; 12239 (0,react.useEffect)(() => { 12240 if (hasFocus) { 12241 inputProps?.inputRef?.current?.focus(); 12242 } 12243 }, [hasFocus]); 12244 const Field = DEFAULT_CONTAINERS[formFieldContainer]; 12245 const Input = DEFAULT_INPUTS[inputProps.editor]; 12246 return inputProps.hidden ? null : /* @__PURE__ */ react.createElement(Field, { ...inputProps }, /* @__PURE__ */ react.createElement(Input, { ...inputProps })); 12247} 12248
12249// src/components/FormValidationSummary.tsx 12250 12251function FormValidationSummary({ currentPage, showErrors, formErrors, inputRefs }) { 12252 const errors = getErrors({ currentPage, showErrors, formErrors }); 12253 const summaryRef = (0,react.useRef)(null); 12254 const { localizations } = (0,react.useContext)(FormRenderContext); 12255 const onNavigateToError = (e, id) => { 12256 e.preventDefault(); 12257 inputRefs[id]?.current?.focus(); 12258 }; 12259 const onBlur = () => { 12260 if (summaryRef.current) { 12261 summaryRef.current.removeAttribute("tabindex"); 12262 } 12263 }; 12264 (0,react.useEffect)(() => { 12265 if (!errors.valid && summaryRef.current) { 12266 summaryRef.current.setAttribute("tabindex", "-1"); 12267 summaryRef.current.focus(); 12268 } 12269 }, [errors.valid]); 12270 return errors.valid ? null : /* @__PURE__ */ react.createElement("div", { className: "form-validation-summary", ref: summaryRef, onBlur }, /* @__PURE__ */ react.createElement("div", { role: "alert" }, /* @__PURE__ */ react.createElement(Heading, { level: "3", className: "form-validation-summary-title" }, localizations.error.summaryTitle), /* @__PURE__ */ react.createElement("div", { className: "form-validation-summary-body" }, /* @__PURE__ */ react.createElement("ul", { className: "form-validation-summary-list" }, errors.errors.map((error, index) => /* @__PURE__ */ react.createElement("li", { key: index }, /* @__PURE__ */ react.createElement("a", { href: `#${error.id}`, onClick: (e) => onNavigateToError(e, error.id) }, error.message))))))); 12271} 12272function getErrors({ currentPage, showErrors, formErrors }) { 12273 if (!showErrors || !formErrors) { 12274 return { 12275 valid: true, 12276 errors: [] 12277 }; 12278 } 12279 const errors = currentPage.fields.map(({ id }) => ({ id, messages: Errors.getErrorMessages(formErrors[id]) })).reduce( 12280 (prev, { id, messages }) => { 12281 if (messages?.length) { 12282 prev = [...prev, ...messages?.map((message) => ({ id, message })) || []]; 12283 } 12284 return prev; 12285 }, 12286 [] 12287 ); 12288 if (!errors?.length) { 12289 return { 12290 valid: true, 12291 errors: [] 12292 }; 12293 } 12294 return { 12295 valid: false, 12296 errors 12297 }; 12298} 12299
12300// src/components/FormCurrentPage.tsx 12301function FormCurrentPage({ 12302 currentPage, 12303 formHtmlId, 12304 formValue, 12305 formInputValue, 12306 formErrors, 12307 showErrors, 12308 setFocussed, 12309 setInputValue, 12310 setValue, 12311 showTitle, 12312 inputRefs, 12313 hasFocus 12314}) { 12315 return /* @__PURE__ */ react.createElement("div", { className: "form-current-page" }, /* @__PURE__ */ react.createElement("div", { className: "form-current-page-header" }, showTitle && /* @__PURE__ */ react.createElement(Heading, { level: "2", className: "form-current-page-title" }, currentPage?.title), /* @__PURE__ */ react.createElement(Description, { className: "form-current-page-description", description: currentPage.description })), /* @__PURE__ */ react.createElement(FormValidationSummary, { currentPage, showErrors, formErrors, inputRefs }), /* @__PURE__ */ react.createElement("div", { className: "form-fields-container" }, currentPage?.fields ? currentPage.fields.map((field, index) => /* @__PURE__ */ react.createElement( 12316 FormFieldContainer, 12317 { 12318 key: field.id, 12319 field, 12320 formHtmlId, 12321 formValue, 12322 formInputValue, 12323 formErrors, 12324 showErrors, 12325 inputRefs, 12326 hasFocus: hasFocus && index === 0, 12327 setFocussed, 12328 setInputValue, 12329 setValue 12330 } 12331 )) : null)); 12332} 12333
12334// src/components/FormProgress.tsx 12335 12336function FormProgress({ formHtmlId, pageCount, currentPage }) { 12337 const { localizations } = (0,react.useContext)(FormRenderContext); 12338 const pageProgress = contensis_forms_format(localizations.messages.page, currentPage.pageNo, pageCount); 12339 const id = progressId(formHtmlId); 12340 return pageCount > 1 ? /* @__PURE__ */ react.createElement("div", { className: "form-progress" }, /* @__PURE__ */ react.createElement("label", { htmlFor: id, className: "form-progress-label" }, pageProgress), /* @__PURE__ */ react.createElement("progress", { id, className: "form-progress-indicator", value: currentPage.pageNo, max: pageCount })) : null; 12341} 12342
12343// src/components/FormTitle.tsx 12344 12345function FormTitle({ form, showDescription, showTitle }) { 12346 return /* @__PURE__ */ react.createElement("div", { className: "form-header" }, showTitle && /* @__PURE__ */ react.createElement(Heading, { level: "1", className: "form-title" }, form?.name), showDescription && /* @__PURE__ */ react.createElement(Description, { className: "form-description", description: form?.description })); 12347} 12348
12349// src/components/FormLoader.tsx 12350function FormLoader({ 12351 loading, 12352 error, 12353 onFormSubmit, 12354 isLoading, 12355 apiError, 12356 form, 12357 versionStatus, 12358 formHtmlId, 12359 pageIndex, 12360 pageCount, 12361 currentPage, 12362 previousPage, 12363 formValue, 12364 formInputValue, 12365 formErrors, 12366 showErrors, 12367 inputRefs, 12368 hasFocus, 12369 setValue, 12370 setInputValue, 12371 showTitle, 12372 showDescription, 12373 setFocussed 12374}) { 12375 if (isLoading) { 12376 return loading || /* @__PURE__ */ react.createElement(FormLoading, null); 12377 } 12378 if (apiError) { 12379 return error ? error(apiError) : /* @__PURE__ */ react.createElement(FormLoadError, { error: apiError }); 12380 } 12381 if (form?.properties?.captcha && Version.isPublishedVersion(versionStatus) && !Api.isLoggedIn()) { 12382 Captcha.load(form.properties.captcha); 12383 } 12384 return /* @__PURE__ */ react.createElement("form", { noValidate: true, onSubmit: onFormSubmit }, /* @__PURE__ */ react.createElement(FormTitle, { form, showTitle, showDescription }), /* @__PURE__ */ react.createElement(FormProgress, { formHtmlId, pageCount, currentPage }), /* @__PURE__ */ react.createElement( 12385 FormCurrentPage, 12386 { 12387 currentPage, 12388 formHtmlId, 12389 formValue, 12390 formInputValue, 12391 formErrors, 12392 showErrors, 12393 inputRefs, 12394 setFocussed, 12395 setInputValue, 12396 setValue, 12397 showTitle: pageCount > 1, 12398 hasFocus 12399 } 12400 ), /* @__PURE__ */ react.createElement(FormButtons, { pageIndex, pageCount, currentPage, previousPage })); 12401} 12402function FormLoading() { 12403 const { localizations } = (0,react.useContext)(FormRenderContext); 12404 return /* @__PURE__ */ react.createElement("div", { className: "form-loading" }, localizations.load.loading); 12405} 12406function FormLoadError(props) { 12407 const { localizations } = (0,react.useContext)(FormRenderContext); 12408 return /* @__PURE__ */ react.createElement("div", { className: "form-load-error" }, props?.error?.message || localizations.load.error); 12409} 12410
12411// src/components/form-state.ts 12412 12413function initialFormState() { 12414 return { 12415 defaultPageTitle: document.title, 12416 isLoading: true, 12417 apiError: null, 12418 form: null, 12419 pageIndex: 0, 12420 isInitialPageLoad: true, 12421 value: {}, 12422 inputValue: {}, 12423 confirmationRule: null, 12424 formResponse: null, 12425 showErrors: false, 12426 errors: {}, 12427 isDirty: false, 12428 isSubmitted: false 12429 }; 12430} 12431function useFormState() { 12432 const [formState, setFormState] = (0,react.useState)(initialFormState); 12433 const patchFormState = function(updates) { 12434 setFormState((prev) => ({ 12435 ...prev, 12436 ...updates 12437 })); 12438 }; 12439 return [formState, setFormState, patchFormState]; 12440} 12441function toHistoryState(pageId, pageIndex) { 12442 return { pageId, pageIndex }; 12443} 12444function isValidHistoryState(state) { 12445 return !!state?.pageId && typeof state?.pageIndex === "number"; 12446} 12447function isCurrentHistoryState(state, windowState = window.history.state) { 12448 if (isValidHistoryState(state) && isValidHistoryState(windowState)) { 12449 return state.pageId === windowState.pageId && state.pageIndex === windowState.pageIndex; 12450 } 12451 return false; 12452} 12453function useFormHtmlId(formId) { 12454 return (0,react.useMemo)(() => { 12455 window.CONTENSIS_FORMS = window.CONTENSIS_FORMS || {}; 12456 window.CONTENSIS_FORMS.formCounter = window.CONTENSIS_FORMS.formCounter || 1; 12457 const counter = window.CONTENSIS_FORMS.formCounter++; 12458 return `contensis-form-${formId}-${counter}`; 12459 }, [formId]); 12460} 12461
12462// src/components/Form.tsx 12463function ContensisForm(props) { 12464 const [isClient, setIsClient] = (0,react.useState)(false); 12465 (0,react.useEffect)(() => setIsClient(true), []); 12466 return isClient ? /* @__PURE__ */ react.createElement(ClientFormContainer, { ...props }) : null; 12467} 12468function ClientFormContainer(props) { 12469 const { 12470 apiUrl, 12471 disabled, 12472 error, 12473 formId, 12474 headingLevel, 12475 language, 12476 loading, 12477 localizations: localizationOverrides, 12478 showTitle, 12479 projectId, 12480 versionStatus, 12481 onLoadError, 12482 onPopulate, 12483 onSubmit, 12484 onSubmitError, 12485 onSubmitSuccess 12486 } = props; 12487 const [localizations, setLocalizations] = (0,react.useState)(DEFAULT_LOCALIZATIONS); 12488 const [formState, setFormState, patchFormState] = useFormState(); 12489 const { errors, form, pageIndex, value } = formState; 12490 const pages = (0,react.useMemo)(() => Form.getPages(form), [form]); 12491 const pageCount = pages.length; 12492 const currentPage = pages[pageIndex]; 12493 const currentPageHasError = Form.pageHasErrors(currentPage, errors); 12494 (0,react.useEffect)(() => { 12495 async function loadForm(signal) { 12496 const params = { apiUrl: apiUrl || "", projectId, formId, language: language || null, versionStatus: versionStatus || "published" }; 12497 try { 12498 const form2 = await Api.getForm(params, signal); 12499 const localizations2 = mergeLocalizations(localizationOverrides, form2); 12500 setLocalizations(localizations2); 12501 let initialValue = Form.getInitialValue(form2, localizations2); 12502 initialValue = await (onPopulate ? onPopulate(initialValue, form2) : initialValue); 12503 const initialErrors = Form.validate(form2, initialValue, localizations2); 12504 patchFormState({ 12505 form: form2, 12506 isLoading: false, 12507 apiError: null, 12508 pageIndex: 0, 12509 isInitialPageLoad: true, 12510 value: initialValue, 12511 inputValue: Form.getInputValue(form2, initialValue), 12512 showErrors: false, 12513 errors: initialErrors 12514 }); 12515 } catch (apiError) { 12516 if (!signal.aborted) { 12517 if (onLoadError) { 12518 onLoadError(apiError, params); 12519 } 12520 patchFormState({ 12521 isLoading: false, 12522 apiError 12523 }); 12524 } 12525 } 12526 } 12527 patchFormState({ isLoading: true }); 12528 const controller = new AbortController(); 12529 loadForm(controller.signal); 12530 return () => { 12531 controller.abort(); 12532 }; 12533 }, [apiUrl, projectId, formId, language, versionStatus, localizationOverrides]); 12534 const onFormSubmit = async (e) => { 12535 e.preventDefault(); 12536 if (!form) { 12537 return; 12538 } 12539 if (currentPageHasError) { 12540 patchFormState({ showErrors: true }); 12541 return; 12542 } 12543 const isLastPage = !!pageCount && pageIndex === pageCount - 1; 12544 if (!isLastPage) { 12545 setFormState((prev) => ({ 12546 ...prev, 12547 showErrors: false, 12548 pageIndex: prev.pageIndex + 1, 12549 isInitialPageLoad: false 12550 })); 12551 return; 12552 } 12553 patchFormState({ showErrors: false }); 12554 const formResponse = await (onSubmit ? onSubmit(value, form) : value); 12555 if (!formResponse) { 12556 return; 12557 } 12558 try { 12559 const result = await Api.saveFormResponse({ 12560 apiUrl: apiUrl || "", 12561 projectId, 12562 formId, 12563 language: language || null, 12564 versionStatus: versionStatus || "published", 12565 formVersionNo: form?.version?.versionNo || "", 12566 captcha: form?.properties?.captcha, 12567 formResponse 12568 }); 12569 const success = await (onSubmitSuccess ? onSubmitSuccess(result, form) : true); 12570 Progress.reset(form); 12571 if (success) { 12572 if (Rules.isConfirmationRuleReturnUri(result?.confirmation)) { 12573 window.location.assign(result.confirmation.link.sys.uri); 12574 } else { 12575 patchFormState({ 12576 isSubmitted: true, 12577 formResponse: result.form, 12578 confirmationRule: result.confirmation 12579 }); 12580 } 12581 } 12582 } catch (e2) { 12583 const handleSubmitError = await (onSubmitError ? onSubmitError(e2, form) : true); 12584 if (handleSubmitError) { 12585 Errors.handleError(e2); 12586 patchFormState({ apiError: e2 }); 12587 } 12588 } 12589 }; 12590 const setValue = (id, value2) => { 12591 const field = form?.fields.find((f) => f.id === id); 12592 if (field) { 12593 setFormState((prev) => { 12594 const fieldErrors = Fields.validate(field, value2, form?.language || DEFAULT_LANGUAGE, localizations); 12595 const newValue = { ...prev.value, [id]: value2 }; 12596 const newErrors = { ...prev.errors, [id]: fieldErrors }; 12597 const newShowErrors = prev.showErrors && Form.pageHasErrors(currentPage, newErrors); 12598 return { 12599 ...prev, 12600 value: newValue, 12601 errors: newErrors,
12602 showErrors: newShowErrors, 12603 isDirty: true 12604 }; 12605 }); 12606 } 12607 }; 12608 const setInputValue = (id, value2) => { 12609 const field = form?.fields.find((f) => f.id === id); 12610 if (field) { 12611 setFormState((prev) => ({ 12612 ...prev, 12613 inputValue: { ...prev.inputValue, [id]: value2 } 12614 })); 12615 } 12616 }; 12617 const setFocussed = (_id, _focussed) => { 12618 }; 12619 const previousPage = () => { 12620 setFormState((prev) => ({ 12621 ...prev, 12622 pageIndex: Math.max(prev.pageIndex - 1, 0), 12623 isInitialPageLoad: false 12624 })); 12625 }; 12626 return /* @__PURE__ */ react.createElement(FormRenderContextProvider, { language: form?.language || language, headingLevel, localizations }, /* @__PURE__ */ react.createElement( 12627 ClientForm, 12628 { 12629 apiUrl, 12630 currentPage, 12631 currentPageHasError, 12632 disabled, 12633 formId, 12634 formState, 12635 language, 12636 loading, 12637 localizations, 12638 showTitle: showTitle || false, 12639 pageCount, 12640 pages, 12641 projectId, 12642 versionStatus, 12643 error, 12644 patchFormState, 12645 setFormState, 12646 setFocussed, 12647 setInputValue, 12648 setValue, 12649 onFormSubmit, 12650 previousPage 12651 } 12652 )); 12653} 12654function ClientForm({ 12655 apiUrl, 12656 currentPage, 12657 currentPageHasError, 12658 disabled, 12659 error, 12660 formId, 12661 formState, 12662 language, 12663 loading, 12664 localizations, 12665 showTitle, 12666 pageCount, 12667 pages, 12668 projectId, 12669 versionStatus, 12670 patchFormState, 12671 setFormState, 12672 setFocussed, 12673 setInputValue, 12674 setValue, 12675 onFormSubmit, 12676 previousPage 12677}) { 12678 const formHtmlId = useFormHtmlId(formId); 12679 const { 12680 defaultPageTitle, 12681 isLoading, 12682 apiError, 12683 form, 12684 pageIndex, 12685 isInitialPageLoad, 12686 value, 12687 inputValue, 12688 confirmationRule, 12689 formResponse, 12690 showErrors, 12691 errors, 12692 isDirty, 12693 isSubmitted 12694 } = formState; 12695 const inputRefs = (0,react.useMemo)(() => Fields.reduceFields(form, () => ({ current: void 0 })), [form]); 12696 const pageTitle = getPageTitle(defaultPageTitle, currentPage?.title, currentPage?.pageNo, pageCount, showErrors && currentPageHasError, localizations); 12697 (0,react.useEffect)(() => { 12698 document.title = pageTitle; 12699 }, [pageTitle]); 12700 (0,react.useEffect)(() => { 12701 if (form && isDirty && !isSubmitted) { 12702 Progress.autoSave(form, value); 12703 } 12704 }, [form, value, isDirty, isSubmitted]); 12705 (0,react.useEffect)(() => { 12706 const newState = toHistoryState(currentPage?.id, pageIndex); 12707 if (isValidHistoryState(newState) && !isCurrentHistoryState(newState)) { 12708 if (!isValidHistoryState(window.history.state)) { 12709 window.history.replaceState(newState, ""); 12710 } else { 12711 window.history.pushState(newState, ""); 12712 } 12713 } 12714 }, [pageIndex, currentPage]); 12715 const onPopState = (0,react.useCallback)( 12716 function(e) { 12717 if (isValidHistoryState(e.state)) { 12718 const newState = e.state; 12719 const newPage = pages[newState.pageIndex]; 12720 if (newPage) { 12721 if (newState.pageIndex < pageIndex) { 12722 patchFormState({ 12723 showErrors: false, 12724 pageIndex: newState.pageIndex, 12725 isInitialPageLoad: false 12726 }); 12727 } else if (newState.pageIndex > pageIndex) { 12728 if (currentPageHasError) { 12729 patchFormState({ showErrors: true }); 12730 } else { 12731 setFormState((prev) => ({ 12732 ...prev, 12733 showErrors: false, 12734 pageIndex: prev.pageIndex + 1, 12735 isInitialPageLoad: false 12736 })); 12737 } 12738 } 12739 } 12740 } 12741 }, 12742 [pageIndex, pages, currentPageHasError] 12743 ); 12744 (0,react.useEffect)(() => { 12745 const fn = onPopState; 12746 window.addEventListener("popstate", fn); 12747 return () => { 12748 window.removeEventListener("popstate", fn); 12749 }; 12750 }, [onPopState]); 12751 return /* @__PURE__ */ react.createElement("div", { className: "contensis-form" }, /* @__PURE__ */ react.createElement("div", { className: "form" }
12751, !confirmationRule ? /* @__PURE__ */ react.createElement( 12752 FormLoader, 12753 { 12754 apiUrl, 12755 projectId, 12756 formId, 12757 language, 12758 versionStatus, 12759 loading, 12760 disabled, 12761 error, 12762 formHtmlId, 12763 isLoading, 12764 apiError, 12765 form, 12766 pageIndex, 12767 pageCount, 12768 currentPage, 12769 formValue: value, 12770 formInputValue: inputValue, 12771 showErrors, 12772 showTitle, 12773 showDescription: showTitle, 12774 formErrors: errors, 12775 inputRefs, 12776 hasFocus: !isInitialPageLoad, 12777 setValue, 12778 setInputValue, 12779 setFocussed, 12780 previousPage, 12781 onFormSubmit 12782 } 12783 ) : null, !!confirmationRule && !!formResponse ? /* @__PURE__ */ react.createElement(FormConfirmation, { rule: confirmationRule, formResponse }) : null)); 12784} 12785 12786//# sourceMappingURL=contensis-forms.mjs.map 12787 12788/***/ }, 12789 12790/***/ 39316 12791(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 12792 12793"use strict"; 12794 12795// EXPORTS 12796__webpack_require__.d(__webpack_exports__, { 12797 A: () => (/* binding */ isPropValid) 12798}); 12799 12800;// ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js 12801function memoize(fn) { 12802 var cache = Object.create(null); 12803 return function (arg) { 12804 if (cache[arg] === undefined) cache[arg] = fn(arg); 12805 return cache[arg]; 12806 }; 12807} 12808 12809 12810 12811;// ./node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js 12812 12813 12814// eslint-disable-next-line no-undef 12815var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 12816 12817var isPropValid = /* #__PURE__ */memoize(function (prop) {
12818 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 12819 /* o */ 12820 && prop.charCodeAt(1) === 110 12821 /* n */ 12822 && prop.charCodeAt(2) < 91; 12823} 12824/* Z+1 */ 12825); 12826 12827 12828 12829 12830/***/ }, 12831 12832/***/ 93941 12833(__unused_webpack_module, exports, __webpack_require__) { 12834 12835"use strict"; 12836var __webpack_unused_export__; 12837 12838__webpack_unused_export__ = ({ value: true }); 12839exports.Z = shouldPolyfill; 12840var intl_localematcher_1 = __webpack_require__(21301); 12841var supported_locales_generated_1 = __webpack_require__(37235); 12842function supportsDateStyle() { 12843 try { 12844 return !!new Intl.DateTimeFormat(undefined, { 12845 dateStyle: 'short', 12846 }).resolvedOptions().dateStyle; 12847 } 12848 catch (e) { 12849 return false; 12850 } 12851} 12852/** 12853 * https://bugs.chromium.org/p/chromium/issues/detail?id=865351 12854 */ 12855function hasChromeLt71Bug() { 12856 try { 12857 return (new Intl.DateTimeFormat('en', { 12858 hourCycle: 'h11', 12859 hour: 'numeric', 12860 }).formatToParts(0)[2].type !== 'dayPeriod'); 12861 } 12862 catch (e) { 12863 return false; 12864 } 12865} 12866/** 12867 * Node 14's version of Intl.DateTimeFormat does not throw 12868 * when dateStyle/timeStyle is used with other options. 12869 * This was fixed in newer V8 versions 12870 */ 12871function hasUnthrownDateTimeStyleBug() { 12872 try { 12873 return !!new Intl.DateTimeFormat('en', { 12874 dateStyle: 'short', 12875 hour: 'numeric', 12876 }).format(new Date(0)); 12877 } 12878 catch (e) { 12879 return false; 12880 } 12881} 12882function supportedLocalesOf(locale) { 12883 if (!locale) { 12884 return true; 12885 } 12886 var locales = Array.isArray(locale) ? locale : [locale]; 12887 return (Intl.DateTimeFormat.supportedLocalesOf(locales).length === locales.length); 12888} 12889function shouldPolyfill(locale) { 12890 if (locale === void 0) { locale = 'en'; } 12891 if (!('DateTimeFormat' in Intl) || 12892 !('formatToParts' in Intl.DateTimeFormat.prototype) || 12893 !('formatRange' in Intl.DateTimeFormat.prototype) || 12894 hasChromeLt71Bug() || 12895 hasUnthrownDateTimeStyleBug() || 12896 !supportsDateStyle() || 12897 !supportedLocalesOf(locale)) { 12898 return locale ? (0, intl_localematcher_1.match)([locale], supported_locales_generated_1.supportedLocales, 'en') : undefined; 12899 } 12900} 12901 12902 12903/***/ }, 12904 12905/***/ 37235 12906(__unused_webpack_module, exports) { 12907 12908"use strict"; 12909 12910Object.defineProperty(exports, "__esModule", ({ value: true })); 12911exports.supportedLocales = void 0; 12912exports.supportedLocales = ["af", "af-NA", "agq", "ak", "am", "ar", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", "ar-SY", "ar-TD", "ar-TN", "ar-YE", "as", "asa", "ast", "az", "az-Cyrl", "az-Latn", "bas", "be", "be-tarask", "bem", "bez", "bg", "bm", "bn", "bn-IN", "bo", "bo-IN", "br", "brx", "bs", "bs-Cyrl", "bs-Latn", "ca", "ca-AD", "ca-ES-valencia", "ca-FR", "ca-IT", "ccp", "ccp-IN", "ce", "ceb", "cgg", "chr", "ckb", "ckb-IR", "cs", "cy", "da", "da-GL", "dav", "de", "de-AT", "de-BE", "de-CH", "de-IT", "de-LI", "de-LU", "dje", "doi", "dsb", "dua", "dyo", "dz", "ebu", "ee", "ee-TG", "el", "el-CY", "en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "eo", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "et", "eu", "ewo", "fa", "fa-AF", "ff", "ff-Adlm", "ff-Adlm-BF", "ff-Adlm-CM", "ff-Adlm-GH", "ff-Adlm-GM", "ff-Adlm-GW", "ff-Adlm-LR", "ff-Adlm-MR", "ff-Adlm-NE", "ff-Adlm-NG", "ff-Adlm-SL", "ff-Adlm-SN", "ff-Latn", "ff-Latn-BF", "ff-Latn-CM", "ff-Latn-GH", "ff-Latn-GM", "ff-Latn-GN", "ff-Latn-GW", "ff-Latn-LR", "ff-Latn-MR", "ff-Latn-NE", "ff-Latn-NG", "ff-Latn-SL", "fi", "fil", "fo", "fo-DK", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "fur", "fy", "ga", "ga-GB", "gd", "gl", "gsw", "gsw-FR", "gsw-LI", "gu", "guz", "gv", "ha", "ha-GH", "ha-NE", "haw", "he", "hi", "hr", "hr-BA", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "is", "it", "it-CH", "it-SM", "it-VA", "ja", "jgo", "jmc", "jv", "ka", "kab", "kam", "kde", "kea", "kgp", "khq", "ki", "kk", "kkj", "kl", "kln", "km", "kn", "ko", "ko-KP", "kok", "ks", "ks-Arab", "ksb", "ksf", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln", "ln-AO", "ln-CF", "ln-CG", "lo", "lrc", "lrc-IQ", "lt", "lu", "luo", "luy", "lv", "mai", "mas", "mas-TZ", "mer", "mfe", "mg", "mgh", "mgo", "mi", "mk", "ml", "mn", "mni", "mni-Beng", "mr", "ms", "ms-BN", "ms-ID", "ms-SG", "mt", "mua", "my", "mzn", "naq", "nb", "nb-SJ", "nd", "nds", "nds-NL", "ne", "ne-IN", "nl", "nl-AW", "nl-BE", "nl-BQ", "nl-CW", "nl-SR", "nl-SX", "nmg", "nn", "nnh", "no", "nus", "nyn", "om", "om-KE", "or", "os", "os-RU", "pa", "pa-Arab", "pa-Guru", "pcm", "pl", "ps", "ps-PK", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "qu", "qu-BO", "qu-EC", "rm", "rn", "ro", "ro-MD", "rof", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "rw", "rwk", "sa", "sah", "saq", "s
12912at", "sat-Olck", "sbp", "sc", "sd", "sd-Arab", "sd-Deva", "se", "se-FI", "se-SE", "seh", "ses", "sg", "shi", "shi-Latn", "shi-Tfng", "si", "sk", "sl", "smn", "sn", "so", "so-DJ", "so-ET", "so-KE", "sq", "sq-MK", "sq-XK", "sr", "sr-Cyrl", "sr-Cyrl-BA", "sr-Cyrl-ME", "sr-Cyrl-XK", "sr-Latn", "sr-Latn-BA", "sr-Latn-ME", "sr-Latn-XK", "su", "su-Latn", "sv", "sv-AX", "sv-FI", "sw", "sw-CD", "sw-KE", "sw-UG", "ta", "ta-LK", "ta-MY", "ta-SG", "te", "teo", "teo-KE", "tg", "th", "ti", "ti-ER", "tk", "to", "tr", "tr-CY", "tt", "twq", "tzm", "ug", "uk", "und", "ur", "ur-IN", "uz", "uz-Arab", "uz-Cyrl", "uz-Latn", "vai", "vai-Latn", "vai-Vaii", "vi", "vun", "wae", "wo", "xh", "xog", "yav", "yi", "yo", "yo-BJ", "yrl", "yrl-CO", "yrl-VE", "yue", "yue-Hans", "yue-Hant", "zgh", "zh", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG", "zh-Hant", "zh-Hant-HK", "zh-Hant-MO", "zu"]; 12913 12914 12915/***/ }, 12916 12917/***/ 21301 12918(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 12919 12920"use strict"; 12921// ESM COMPAT FLAG 12922__webpack_require__.r(__webpack_exports__); 12923 12924// EXPORTS 12925__webpack_require__.d(__webpack_exports__, { 12926 LookupSupportedLocales: () => (/* reexport */ LookupSupportedLocales), 12927 ResolveLocale: () => (/* reexport */ ResolveLocale), 12928 match: () => (/* binding */ match) 12929}); 12930 12931;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/CanonicalizeLocaleList.js 12932/** 12933 * http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist 12934 * @param locales 12935 */ 12936function CanonicalizeLocaleList(locales) { 12937 return Intl.getCanonicalLocales(locales); 12938} 12939 12940// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs 12941var tslib_es6 = __webpack_require__(8674); 12942;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/languageMatching.js 12943var languageMatching_data = { 12944 supplemental: { 12945 languageMatching: { 12946 'written-new': [ 12947 { 12948 paradigmLocales: { 12949 _locales: 'en en_GB es es_419 pt_BR pt_PT', 12950 }, 12951 }, 12952 { 12953 $enUS: { 12954 _value: 'AS+CA+GU+MH+MP+PH+PR+UM+US+VI', 12955 }, 12956 }, 12957 { 12958 $cnsar: { 12959 _value: 'HK+MO', 12960 }, 12961 }, 12962 { 12963 $americas: { 12964 _value: '019', 12965 }, 12966 }, 12967 { 12968 $maghreb: { 12969 _value: 'MA+DZ+TN+LY+MR+EH', 12970 }, 12971 }, 12972 { 12973 no: { 12974 _desired: 'nb', 12975 _distance: '1', 12976 }, 12977 }, 12978 { 12979 bs: { 12980 _desired: 'hr', 12981 _distance: '4', 12982 }, 12983 }, 12984 { 12985 bs: { 12986 _desired: 'sh', 12987 _distance: '4', 12988 }, 12989 }, 12990 { 12991 hr: { 12992 _desired: 'sh', 12993 _distance: '4', 12994 }, 12995 }, 12996 { 12997 sr: { 12998 _desired: 'sh', 12999 _distance: '4', 13000 }, 13001 }, 13002 { 13003 aa: { 13004 _desired: 'ssy', 13005 _distance: '4', 13006 }, 13007 }, 13008 { 13009 de: { 13010 _desired: 'gsw', 13011 _distance: '4', 13012 _oneway: 'true', 13013 }, 13014 }, 13015 { 13016 de: { 13017 _desired: 'lb', 13018 _distance: '4', 13019 _oneway: 'true', 13020 }, 13021 }, 13022 { 13023 no: { 13024 _desired: 'da', 13025 _distance: '8', 13026 }, 13027 }, 13028 { 13029 nb: { 13030 _desired: 'da', 13031 _distance: '8', 13032 }, 13033 }, 13034 { 13035 ru: { 13036 _desired: 'ab', 13037 _distance: '30', 13038 _oneway: 'true', 13039 }, 13040 }, 13041 { 13042 en: { 13043 _desired: 'ach', 13044 _distance: '30', 13045 _oneway: 'true', 13046 }, 13047 }, 13048 { 13049 nl: { 13050 _desired: 'af', 13051 _distance: '20', 13052 _oneway: 'true', 13053 }, 13054 }, 13055 { 13056 en: { 13057 _desired: 'ak', 13058 _distance: '30', 13059 _oneway: 'true', 13060 }, 13061 }, 13062 { 13063 en: { 13064 _desired: 'am', 13065 _distance: '30', 13066 _oneway: 'true', 13067 }, 13068 }, 13069 { 13070 es: { 13071 _desired: 'ay', 13072 _distance: '20', 13073 _oneway: 'true', 13074 }, 13075 }, 13076 { 13077 ru: { 13078 _desired: 'az', 13079 _distance: '30', 13080 _oneway: 'true', 13081 }, 13082 }, 13083 { 13084 ur: { 13085 _desired: 'bal', 13086 _distance: '20', 13087 _oneway: 'true', 13088 }, 13089 }, 13090 { 13091 ru: { 13092 _desired: 'be', 13093 _distance: '20', 13094 _oneway: 'true', 13095 }, 13096 }, 13097 { 13098 en: { 13099 _desired: 'bem', 13100 _distance: '30', 13101 _oneway: 'true', 13102 }, 13103 }, 13104 { 13105 hi: { 13106 _desired: 'bh', 13107 _distance: '30', 13108 _oneway: 'true', 13109 }, 13110 }, 13111 { 13112 en: { 13113 _desired: 'bn', 13114 _distance: '30', 13115 _oneway: 'true', 13116 }, 13117 }, 13118 { 13119 zh: { 13120 _desired: 'bo', 13121 _distance: '20', 13122 _oneway: 'true', 13123 }, 13124 }, 13125 { 13126 fr: { 13127 _desired: 'br', 13128 _distance: '20', 13129 _oneway: 'true', 13130 }, 13131 }, 13132 { 13133 es: { 13134 _desired: 'ca', 13135 _distance: '20', 13136 _oneway: 'true', 13137 }, 13138 }, 13139 { 13140 fil: { 13141 _desired: 'ceb', 13142 _distance: '30', 13143 _oneway: 'true', 13144 }, 13145 }, 13146 { 13147 en: { 13148 _desired: 'chr', 13149 _distance: '20', 13150 _oneway: 'true', 13151 }, 13152 }, 13153 { 13154 ar: { 13155 _desired: 'ckb', 13156 _distance: '30', 13157 _oneway: 'true', 13158 }, 13159 }, 13160 { 13161 fr: { 13162 _desired: 'co', 13163 _distance: '20', 13164 _oneway: 'true', 13165 }, 13166 }, 13167 { 13168 fr: { 13169 _desired: 'crs', 13170 _distance: '20', 13171 _oneway: 'true', 13172 }, 13173 }, 13174 { 13175 sk: { 13176 _desired: 'cs', 13177 _distance: '20', 13178 }, 13179 }, 13180 { 13181 en: { 13182 _desired: 'cy', 13183 _distance: '20', 13184 _oneway: 'true', 13185 }, 13186 }, 13187 { 13188 en: { 13189 _desired: 'ee', 13190 _distance: '30', 13191 _oneway: 'true', 13192 }, 13193 }, 13194 { 13195 en: { 13196 _desired: 'eo', 13197 _distance: '30', 13198 _oneway: 'true', 13199 }, 13200 }, 13201 { 13202 es: { 13203 _desired: 'eu', 13204 _distance: '20', 13205 _oneway: 'true', 13206 }, 13207 }, 13208 { 13209 da: { 13210 _desired: 'fo', 13211 _distance: '20', 13212 _oneway: 'true', 13213 }, 13214 }, 13215 { 13216 nl: { 13217 _desired: 'fy', 13218 _distance: '20', 13219 _oneway: 'true', 13220 }, 13221 }, 13222 { 13223 en: { 13224 _desired: 'ga', 13225 _distance: '20', 13226 _oneway: 'true', 13227 }, 13228 }, 13229 { 13230 en: { 13231 _desired: 'gaa', 13232 _distance: '30', 13233 _oneway: 'true', 13234 }, 13235 }, 13236 { 13237 en: { 13238 _desired: 'gd', 13239 _distance: '20', 13240 _oneway: 'true', 13241 }, 13242 }, 13243 { 13244 es: { 13245 _desired: 'gl', 13246 _distance: '20', 13247 _oneway: 'true', 13248 }, 13249 }, 13250 { 13251 es: { 13252 _desired: 'gn', 13253 _distance: '20', 13254 _oneway: 'true', 13255 }, 13256 }, 13257 { 13258 hi: { 13259 _desired: 'gu', 13260 _distance: '30', 13261 _oneway: 'true', 13262 }, 13263 }, 13264 { 13265 en: { 13266 _desired: 'ha', 13267 _distance: '30', 13268 _oneway: 'true', 13269 }, 13270 }, 13271 { 13272 en: { 13273 _desired: 'haw', 13274 _distance: '20', 13275 _oneway: 'true', 13276 }, 13277 }, 13278 { 13279 fr: { 13280 _desired: 'ht', 13281 _distance: '20', 13282 _oneway: 'true', 13283 }, 13284 }, 13285 { 13286 ru: { 13287 _desired: 'hy', 13288 _distance: '30', 13289 _oneway: 'true', 13290 }, 13291 }, 13292 { 13293 en: { 13294 _desired: 'ia', 13295 _distance: '30', 13296 _oneway: 'true', 13297 }, 13298 }, 13299 { 13300 en: { 13301 _desired: 'ig', 13302 _distance: '30', 13303 _oneway: 'true', 13304 }, 13305 }, 13306 { 13307 en: { 13308 _desired: 'is', 13309 _distance: '20', 13310 _oneway: 'true', 13311 }, 13312 }, 13313 { 13314 id: { 13315 _desired: 'jv', 13316 _distance: '20', 13317 _oneway: 'true', 13318 }, 13319 }, 13320 { 13321 en: { 13322 _desired: 'ka', 13323 _distance: '30', 13324 _oneway: 'true', 13325 }, 13326 }, 13327 { 13328 fr: { 13329 _desired: 'kg', 13330 _distance: '30', 13331 _oneway: 'true', 13332 }, 13333 }, 13334 { 13335 ru: { 13336 _desired: 'kk', 13337 _distance: '30', 13338 _oneway: 'true', 13339 }, 13340 }, 13341 { 13342 en: { 13343 _desired: 'km', 13344 _distance: '30', 13345 _oneway: 'true', 13346 }, 13347 }, 13348 { 13349 en: { 13350 _desired: 'kn', 13351 _distance: '30', 13352 _oneway: 'true', 13353 }, 13354 }, 13355 { 13356 en: { 13357 _desired: 'kri', 13358 _distance: '30', 13359 _oneway: 'true', 13360 }, 13361 }, 13362 { 13363 tr: { 13364 _desired: 'ku', 13365 _distance: '30', 13366 _oneway: 'true', 13367 }, 13368 }, 13369 { 13370 ru: { 13371 _desired: 'ky', 13372 _distance: '30', 13373 _oneway: 'true', 13374 }, 13375 }, 13376 { 13377 it: { 13378 _desired: 'la', 13379 _distance: '20', 13380 _oneway: 'true', 13381 }, 13382 }, 13383 { 13384 en: { 13385 _desired: 'lg', 13386 _distance: '30', 13387 _oneway: 'true', 13388 }, 13389 }, 13390 { 13391 fr: { 13392 _desired: 'ln', 13393 _distance: '30', 13394 _oneway: 'true', 13395 }, 13396 }, 13397 { 13398 en: { 13399 _desired: 'lo', 13400 _distance: '30', 13401 _oneway: 'true', 13402 }, 13403 }, 13404 { 13405 en: { 13406 _desired: 'loz', 13407 _distance: '30', 13408 _oneway: 'true', 13409 }, 13410 }, 13411 { 13412 fr: { 13413 _desired: 'lua', 13414 _distance: '30', 13415 _oneway: 'true', 13416 }, 13417 }, 13418 { 13419 hi: { 13420 _desired: 'mai', 13421 _distance: '20', 13422 _oneway: 'true', 13423 }, 13424 }, 13425 { 13426 en: { 13427 _desired: 'mfe', 13428 _distance: '30', 13429 _oneway: 'true', 13430 }, 13431 }, 13432 { 13433 fr: { 13434 _desired: 'mg', 13435 _distance: '30', 13436 _oneway: 'true', 13437 }, 13438 }, 13439 { 13440
13440 en: { 13441 _desired: 'mi', 13442 _distance: '20', 13443 _oneway: 'true', 13444 }, 13445 }, 13446 { 13447 en: { 13448 _desired: 'ml', 13449 _distance: '30', 13450 _oneway: 'true', 13451 }, 13452 }, 13453 { 13454 ru: { 13455 _desired: 'mn', 13456 _distance: '30', 13457 _oneway: 'true', 13458 }, 13459 }, 13460 { 13461 hi: { 13462 _desired: 'mr', 13463 _distance: '30', 13464 _oneway: 'true', 13465 }, 13466 }, 13467 { 13468 id: { 13469 _desired: 'ms', 13470 _distance: '30', 13471 _oneway: 'true', 13472 }, 13473 }, 13474 { 13475 en: { 13476 _desired: 'mt', 13477 _distance: '30', 13478 _oneway: 'true', 13479 }, 13480 }, 13481 { 13482 en: { 13483 _desired: 'my', 13484 _distance: '30', 13485 _oneway: 'true', 13486 }, 13487 }, 13488 { 13489 en: { 13490 _desired: 'ne', 13491 _distance: '30', 13492 _oneway: 'true', 13493 }, 13494 }, 13495 { 13496 nb: { 13497 _desired: 'nn', 13498 _distance: '20', 13499 }, 13500 }, 13501 { 13502 no: { 13503 _desired: 'nn', 13504 _distance: '20', 13505 }, 13506 }, 13507 { 13508 en: { 13509 _desired: 'nso', 13510 _distance: '30', 13511 _oneway: 'true', 13512 }, 13513 }, 13514 { 13515 en: { 13516 _desired: 'ny', 13517 _distance: '30', 13518 _oneway: 'true', 13519 }, 13520 }, 13521 { 13522 en: { 13523 _desired: 'nyn', 13524 _distance: '30', 13525 _oneway: 'true', 13526 }, 13527 }, 13528 { 13529 fr: { 13530 _desired: 'oc', 13531 _distance: '20', 13532 _oneway: 'true', 13533 }, 13534 }, 13535 { 13536 en: { 13537 _desired: 'om', 13538 _distance: '30', 13539 _oneway: 'true', 13540 }, 13541 }, 13542 { 13543 en: { 13544 _desired: 'or', 13545 _distance: '30', 13546 _oneway: 'true', 13547 }, 13548 }, 13549 { 13550 en: { 13551 _desired: 'pa', 13552 _distance: '30', 13553 _oneway: 'true', 13554 }, 13555 }, 13556 { 13557 en: { 13558 _desired: 'pcm', 13559 _distance: '20', 13560 _oneway: 'true', 13561 }, 13562 }, 13563 { 13564 en: { 13565 _desired: 'ps', 13566 _distance: '30', 13567 _oneway: 'true', 13568 }, 13569 }, 13570 { 13571 es: { 13572 _desired: 'qu', 13573 _distance: '30', 13574 _oneway: 'true', 13575 }, 13576 }, 13577 { 13578 de: { 13579 _desired: 'rm', 13580 _distance: '20', 13581 _oneway: 'true', 13582 }, 13583 }, 13584 { 13585 en: { 13586 _desired: 'rn', 13587 _distance: '30', 13588 _oneway: 'true', 13589 }, 13590 }, 13591 { 13592 fr: { 13593 _desired: 'rw', 13594 _distance: '30', 13595 _oneway: 'true', 13596 }, 13597 }, 13598 { 13599 hi: { 13600 _desired: 'sa', 13601 _distance: '30', 13602 _oneway: 'true', 13603 }, 13604 }, 13605 { 13606 en: { 13607 _desired: 'sd', 13608 _distance: '30', 13609 _oneway: 'true', 13610 }, 13611 }, 13612 { 13613 en: { 13614 _desired: 'si', 13615 _distance: '30', 13616 _oneway: 'true', 13617 }, 13618 }, 13619 { 13620 en: { 13621 _desired: 'sn', 13622 _distance: '30', 13623 _oneway: 'true', 13624 }, 13625 }, 13626 { 13627 en: { 13628 _desired: 'so', 13629 _distance: '30', 13630 _oneway: 'true', 13631 }, 13632 }, 13633 { 13634 en: { 13635 _desired: 'sq', 13636 _distance: '30', 13637 _oneway: 'true', 13638 }, 13639 }, 13640 { 13641 en: { 13642 _desired: 'st', 13643 _distance: '30', 13644 _oneway: 'true', 13645 }, 13646 }, 13647 { 13648 id: { 13649 _desired: 'su', 13650 _distance: '20', 13651 _oneway: 'true', 13652 }, 13653 }, 13654 { 13655 en: { 13656 _desired: 'sw', 13657 _distance: '30', 13658 _oneway: 'true', 13659 }, 13660 }, 13661 { 13662 en: { 13663 _desired: 'ta', 13664 _distance: '30', 13665 _oneway: 'true', 13666 }, 13667 }, 13668 { 13669 en: { 13670 _desired: 'te', 13671 _distance: '30', 13672 _oneway: 'true', 13673 }, 13674 }, 13675 { 13676 ru: { 13677 _desired: 'tg', 13678 _distance: '30', 13679 _oneway: 'true', 13680 }, 13681 }, 13682 { 13683 en: { 13684 _desired: 'ti', 13685 _distance: '30', 13686 _oneway: 'true', 13687 }, 13688 }, 13689 { 13690 ru: { 13691 _desired: 'tk', 13692 _distance: '30', 13693 _oneway: 'true', 13694 }, 13695 }, 13696 { 13697 en: { 13698 _desired: 'tlh', 13699 _distance: '30', 13700 _oneway: 'true', 13701 }, 13702 }, 13703 { 13704 en: { 13705 _desired: 'tn', 13706 _distance: '30', 13707 _oneway: 'true', 13708 }, 13709 }, 13710 { 13711 en: { 13712 _desired: 'to', 13713 _distance: '30', 13714 _oneway: 'true', 13715 }, 13716 }, 13717 { 13718 ru: { 13719 _desired: 'tt', 13720 _distance: '30', 13721 _oneway: 'true', 13722 }, 13723 }, 13724 { 13725 en: { 13726 _desired: 'tum', 13727 _distance: '30', 13728 _oneway: 'true', 13729 }, 13730 }, 13731 { 13732 zh: { 13733 _desired: 'ug', 13734 _distance: '20', 13735 _oneway: 'true', 13736 }, 13737 }, 13738 { 13739 ru: { 13740 _desired: 'uk', 13741 _distance: '20', 13742 _oneway: 'true', 13743 }, 13744 }, 13745 { 13746 en: { 13747 _desired: 'ur', 13748 _distance: '30', 13749 _oneway: 'true', 13750 }, 13751 }, 13752 { 13753 ru: { 13754 _desired: 'uz', 13755 _distance: '30', 13756 _oneway: 'true', 13757 }, 13758 }, 13759 { 13760 fr: { 13761 _desired: 'wo', 13762 _distance: '30', 13763 _oneway: 'true', 13764 }, 13765 }, 13766 { 13767 en: { 13768 _desired: 'xh', 13769 _distance: '30', 13770 _oneway: 'true', 13771 }, 13772 }, 13773 { 13774 en: { 13775 _desired: 'yi', 13776 _distance: '30', 13777 _oneway: 'true', 13778 }, 13779 }, 13780 { 13781 en: { 13782 _desired: 'yo', 13783 _distance: '30', 13784 _oneway: 'true', 13785 }, 13786 }, 13787 { 13788 zh: { 13789 _desired: 'za', 13790 _distance: '20', 13791 _oneway: 'true', 13792 }, 13793 }, 13794 { 13795 en: { 13796 _desired: 'zu', 13797 _distance: '30', 13798 _oneway: 'true', 13799 }, 13800 }, 13801 { 13802 ar: { 13803 _desired: 'aao', 13804 _distance: '10', 13805 _oneway: 'true', 13806 }, 13807 }, 13808 { 13809 ar: { 13810 _desired: 'abh', 13811 _distance: '10', 13812 _oneway: 'true', 13813 }, 13814 }, 13815 { 13816 ar: { 13817 _desired: 'abv', 13818 _distance: '10', 13819 _oneway: 'true', 13820 }, 13821 }, 13822 { 13823 ar: { 13824 _desired: 'acm', 13825 _distance: '10', 13826 _oneway: 'true', 13827 }, 13828 }, 13829 { 13830 ar: { 13831 _desired: 'acq', 13832 _distance: '10', 13833 _oneway: 'true', 13834 }, 13835 }, 13836 { 13837 ar: { 13838 _desired: 'acw', 13839 _distance: '10', 13840 _oneway: 'true', 13841 }, 13842 }, 13843 { 13844 ar: { 13845 _desired: 'acx', 13846 _distance: '10', 13847 _oneway: 'true', 13848 }, 13849 }, 13850 { 13851 ar: { 13852 _desired: 'acy', 13853 _distance: '10', 13854 _oneway: 'true', 13855 }, 13856 }, 13857 { 13858 ar: { 13859 _desired: 'adf', 13860 _distance: '10', 13861 _oneway: 'true', 13862 }, 13863 }, 13864 { 13865 ar: { 13866 _desired: 'aeb', 13867 _distance: '10', 13868 _oneway: 'true', 13869 }, 13870 }, 13871 { 13872 ar: { 13873 _desired: 'aec', 13874 _distance: '10', 13875 _oneway: 'true', 13876 }, 13877 }, 13878 { 13879 ar: { 13880 _desired: 'afb', 13881 _distance: '10', 13882 _oneway: 'true', 13883 }, 13884 }, 13885 { 13886 ar: { 13887 _desired: 'ajp', 13888 _distance: '10', 13889 _oneway: 'true', 13890 }, 13891 }, 13892 { 13893 ar: { 13894 _desired: 'apc', 13895 _distance: '10', 13896 _oneway: 'true', 13897 }, 13898 }, 13899 { 13900 ar: { 13901 _desired: 'apd', 13902 _distance: '10', 13903 _oneway: 'true', 13904 }, 13905 }, 13906 { 13907 ar: { 13908 _desired: 'arq', 13909 _distance: '10', 13910 _oneway: 'true', 13911 }, 13912 }, 13913 { 13914 ar: { 13915 _desired: 'ars', 13916 _distance: '10', 13917 _oneway: 'true', 13918 }, 13919 }, 13920 { 13921 ar: { 13922 _desired: 'ary', 13923 _distance: '10', 13924 _oneway: 'true', 13925 }, 13926 }, 13927 { 13928 ar: { 13929 _desired: 'arz', 13930 _distance: '10', 13931 _oneway: 'true', 13932 }, 13933 }, 13934 { 13935 ar: { 13936 _desired: 'auz', 13937 _distance: '10', 13938 _oneway: 'true', 13939 }, 13940 }, 13941 { 13942 ar: { 13943 _desired: 'avl', 13944 _distance: '10', 13945 _oneway: 'true', 13946 }, 13947 }, 13948 { 13949 ar: { 13950 _desired: 'ayh', 13951 _distance: '10', 13952 _oneway: 'true', 13953 }, 13954 }, 13955 { 13956 ar: { 13957 _desired: 'ayl', 13958 _distance: '10', 13959 _oneway: 'true', 13960 }, 13961 }, 13962 { 13963 ar: { 13964 _desired: 'ayn', 13965 _distance: '10', 13966 _oneway: 'true', 13967 }, 13968 }, 13969 { 13970 ar: { 13971 _desired: 'ayp', 13972 _distance: '10', 13973 _oneway: 'true', 13974 }, 13975 }, 13976 { 13977 ar: { 13978 _desired: 'bbz', 13979 _distance: '10', 13980 _oneway: 'true', 13981 }, 13982 }, 13983 { 13984 ar: { 13985 _desired: 'pga', 13986 _distance: '10', 13987 _oneway: 'true', 13988 }, 13989 }, 13990 { 13991
13991 ar: { 13992 _desired: 'shu', 13993 _distance: '10', 13994 _oneway: 'true', 13995 }, 13996 }, 13997 { 13998 ar: { 13999 _desired: 'ssh', 14000 _distance: '10', 14001 _oneway: 'true', 14002 }, 14003 }, 14004 { 14005 az: { 14006 _desired: 'azb', 14007 _distance: '10', 14008 _oneway: 'true', 14009 }, 14010 }, 14011 { 14012 et: { 14013 _desired: 'vro', 14014 _distance: '10', 14015 _oneway: 'true', 14016 }, 14017 }, 14018 { 14019 ff: { 14020 _desired: 'ffm', 14021 _distance: '10', 14022 _oneway: 'true', 14023 }, 14024 }, 14025 { 14026 ff: { 14027 _desired: 'fub', 14028 _distance: '10', 14029 _oneway: 'true', 14030 }, 14031 }, 14032 { 14033 ff: { 14034 _desired: 'fue', 14035 _distance: '10', 14036 _oneway: 'true', 14037 }, 14038 }, 14039 { 14040 ff: { 14041 _desired: 'fuf', 14042 _distance: '10', 14043 _oneway: 'true', 14044 }, 14045 }, 14046 { 14047 ff: { 14048 _desired: 'fuh', 14049 _distance: '10', 14050 _oneway: 'true', 14051 }, 14052 }, 14053 { 14054 ff: { 14055 _desired: 'fui', 14056 _distance: '10', 14057 _oneway: 'true', 14058 }, 14059 }, 14060 { 14061 ff: { 14062 _desired: 'fuq', 14063 _distance: '10', 14064 _oneway: 'true', 14065 }, 14066 }, 14067 { 14068 ff: { 14069 _desired: 'fuv', 14070 _distance: '10', 14071 _oneway: 'true', 14072 }, 14073 }, 14074 { 14075 gn: { 14076 _desired: 'gnw', 14077 _distance: '10', 14078 _oneway: 'true', 14079 }, 14080 }, 14081 { 14082 gn: { 14083 _desired: 'gui', 14084 _distance: '10', 14085 _oneway: 'true', 14086 }, 14087 }, 14088 { 14089 gn: { 14090 _desired: 'gun', 14091 _distance: '10', 14092 _oneway: 'true', 14093 }, 14094 }, 14095 { 14096 gn: { 14097 _desired: 'nhd', 14098 _distance: '10', 14099 _oneway: 'true', 14100 }, 14101 }, 14102 { 14103 iu: { 14104 _desired: 'ikt', 14105 _distance: '10', 14106 _oneway: 'true', 14107 }, 14108 }, 14109 { 14110 kln: { 14111 _desired: 'enb', 14112 _distance: '10', 14113 _oneway: 'true', 14114 }, 14115 }, 14116 { 14117 kln: { 14118 _desired: 'eyo', 14119 _distance: '10', 14120 _oneway: 'true', 14121 }, 14122 }, 14123 { 14124 kln: { 14125 _desired: 'niq', 14126 _distance: '10', 14127 _oneway: 'true', 14128 }, 14129 }, 14130 { 14131 kln: { 14132 _desired: 'oki', 14133 _distance: '10', 14134 _oneway: 'true', 14135 }, 14136 }, 14137 { 14138 kln: { 14139 _desired: 'pko', 14140 _distance: '10', 14141 _oneway: 'true', 14142 }, 14143 }, 14144 { 14145 kln: { 14146 _desired: 'sgc', 14147 _distance: '10', 14148 _oneway: 'true', 14149 }, 14150 }, 14151 { 14152 kln: { 14153 _desired: 'tec', 14154 _distance: '10', 14155 _oneway: 'true', 14156 }, 14157 }, 14158 { 14159 kln: { 14160 _desired: 'tuy', 14161 _distance: '10', 14162 _oneway: 'true', 14163 }, 14164 }, 14165 { 14166 kok: { 14167 _desired: 'gom', 14168 _distance: '10', 14169 _oneway: 'true', 14170 }, 14171 }, 14172 { 14173 kpe: { 14174 _desired: 'gkp', 14175 _distance: '10', 14176 _oneway: 'true', 14177 }, 14178 }, 14179 { 14180 luy: { 14181 _desired: 'ida', 14182 _distance: '10', 14183 _oneway: 'true', 14184 }, 14185 }, 14186 { 14187 luy: { 14188 _desired: 'lkb', 14189 _distance: '10', 14190 _oneway: 'true', 14191 }, 14192 }, 14193 { 14194 luy: { 14195 _desired: 'lko', 14196 _distance: '10', 14197 _oneway: 'true', 14198 }, 14199 }, 14200 { 14201 luy: { 14202 _desired: 'lks', 14203 _distance: '10', 14204 _oneway: 'true', 14205 }, 14206 }, 14207 { 14208 luy: { 14209 _desired: 'lri', 14210 _distance: '10', 14211 _oneway: 'true', 14212 }, 14213 }, 14214 { 14215 luy: { 14216 _desired: 'lrm', 14217 _distance: '10', 14218 _oneway: 'true', 14219 }, 14220 }, 14221 { 14222 luy: { 14223 _desired: 'lsm', 14224 _distance: '10', 14225 _oneway: 'true', 14226 }, 14227 }, 14228 { 14229 luy: { 14230 _desired: 'lto', 14231 _distance: '10', 14232 _oneway: 'true', 14233 }, 14234 }, 14235 { 14236 luy: { 14237 _desired: 'lts', 14238 _distance: '10', 14239 _oneway: 'true', 14240 }, 14241 }, 14242 { 14243 luy: { 14244 _desired: 'lwg', 14245 _distance: '10', 14246 _oneway: 'true', 14247 }, 14248 }, 14249 { 14250 luy: { 14251 _desired: 'nle', 14252 _distance: '10', 14253 _oneway: 'true', 14254 }, 14255 }, 14256 { 14257 luy: { 14258 _desired: 'nyd', 14259 _distance: '10', 14260 _oneway: 'true', 14261 }, 14262 }, 14263 { 14264 luy: { 14265 _desired: 'rag', 14266 _distance: '10', 14267 _oneway: 'true', 14268 }, 14269 }, 14270 { 14271 lv: { 14272 _desired: 'ltg', 14273 _distance: '10', 14274 _oneway: 'true', 14275 }, 14276 }, 14277 { 14278 mg: { 14279 _desired: 'bhr', 14280 _distance: '10', 14281 _oneway: 'true', 14282 }, 14283 }, 14284 { 14285 mg: { 14286 _desired: 'bjq', 14287 _distance: '10', 14288 _oneway: 'true', 14289 }, 14290 }, 14291 { 14292 mg: { 14293 _desired: 'bmm', 14294 _distance: '10', 14295 _oneway: 'true', 14296 }, 14297 }, 14298 { 14299 mg: { 14300 _desired: 'bzc', 14301 _distance: '10', 14302 _oneway: 'true', 14303 }, 14304 }, 14305 { 14306 mg: { 14307 _desired: 'msh', 14308 _distance: '10', 14309 _oneway: 'true', 14310 }, 14311 }, 14312 { 14313 mg: { 14314 _desired: 'skg', 14315 _distance: '10', 14316 _oneway: 'true', 14317 }, 14318 }, 14319 { 14320 mg: { 14321 _desired: 'tdx', 14322 _distance: '10', 14323 _oneway: 'true', 14324 }, 14325 }, 14326 { 14327 mg: { 14328 _desired: 'tkg', 14329 _distance: '10', 14330 _oneway: 'true', 14331 }, 14332 }, 14333 { 14334 mg: { 14335 _desired: 'txy', 14336 _distance: '10', 14337 _oneway: 'true', 14338 }, 14339 }, 14340 { 14341 mg: { 14342 _desired: 'xmv', 14343 _distance: '10', 14344 _oneway: 'true', 14345 }, 14346 }, 14347 { 14348 mg: { 14349 _desired: 'xmw', 14350 _distance: '10', 14351 _oneway: 'true', 14352 }, 14353 }, 14354 { 14355 mn: { 14356 _desired: 'mvf', 14357 _distance: '10', 14358 _oneway: 'true', 14359 }, 14360 }, 14361 { 14362 ms: { 14363 _desired: 'bjn', 14364 _distance: '10', 14365 _oneway: 'true', 14366 }, 14367 }, 14368 { 14369 ms: { 14370 _desired: 'btj', 14371 _distance: '10', 14372 _oneway: 'true', 14373 }, 14374 }, 14375 { 14376 ms: { 14377 _desired: 'bve', 14378 _distance: '10', 14379 _oneway: 'true', 14380 }, 14381 }, 14382 { 14383 ms: { 14384 _desired: 'bvu', 14385 _distance: '10', 14386 _oneway: 'true', 14387 }, 14388 }, 14389 { 14390 ms: { 14391 _desired: 'coa', 14392 _distance: '10', 14393 _oneway: 'true', 14394 }, 14395 }, 14396 { 14397 ms: { 14398 _desired: 'dup', 14399 _distance: '10', 14400 _oneway: 'true', 14401 }, 14402 }, 14403 { 14404 ms: { 14405 _desired: 'hji', 14406 _distance: '10', 14407 _oneway: 'true', 14408 }, 14409 }, 14410 { 14411 ms: { 14412 _desired: 'id', 14413 _distance: '10', 14414 _oneway: 'true', 14415 }, 14416 }, 14417 { 14418 ms: { 14419 _desired: 'jak', 14420 _distance: '10', 14421 _oneway: 'true', 14422 }, 14423 }, 14424 { 14425 ms: { 14426 _desired: 'jax', 14427 _distance: '10', 14428 _oneway: 'true', 14429 }, 14430 }, 14431 { 14432 ms: { 14433 _desired: 'kvb', 14434 _distance: '10', 14435 _oneway: 'true', 14436 }, 14437 }, 14438 { 14439 ms: { 14440 _desired: 'kvr', 14441 _distance: '10', 14442 _oneway: 'true', 14443 }, 14444 }, 14445 { 14446 ms: { 14447 _desired: 'kxd', 14448 _distance: '10', 14449 _oneway: 'true', 14450 }, 14451 }, 14452 { 14453 ms: { 14454 _desired: 'lce', 14455 _distance: '10', 14456 _oneway: 'true', 14457 }, 14458 }, 14459 { 14460 ms: { 14461 _desired: 'lcf', 14462 _distance: '10', 14463 _oneway: 'true', 14464 }, 14465 }, 14466 { 14467 ms: { 14468 _desired: 'liw', 14469 _distance: '10', 14470 _oneway: 'true', 14471 }, 14472 }, 14473 { 14474 ms: { 14475 _desired: 'max', 14476 _distance: '10', 14477 _oneway: 'true', 14478 }, 14479 }, 14480 { 14481 ms: { 14482 _desired: 'meo', 14483 _distance: '10', 14484 _oneway: 'true', 14485 }, 14486 }, 14487 { 14488 ms: { 14489 _desired: 'mfa', 14490 _distance: '10', 14491 _oneway: 'true', 14492 }, 14493 }, 14494 { 14495 ms: { 14496 _desired: 'mfb', 14497 _distance: '10', 14498 _oneway: 'true', 14499 }, 14500 }, 14501 { 14502 ms: { 14503 _desired: 'min', 14504 _distance: '10', 14505 _oneway: 'true', 14506 }, 14507 }, 14508 { 14509 ms: { 14510 _desired: 'mqg', 14511 _distance: '10', 14512 _oneway: 'true', 14513 }, 14514 }, 14515 { 14516 ms: { 14517 _desired: 'msi', 14518 _distance: '10', 14519 _oneway: 'true', 14520 }, 14521 }, 14522 { 14523 ms: { 14524 _desired: 'mui', 14525 _distance: '10', 14526 _oneway: 'true', 14527 }, 14528 }, 14529 { 14530 ms: { 14531 _desired: 'orn', 14532 _distance: '10', 14533 _oneway: 'true', 14534 }, 14535 }, 14536 { 14537 ms: { 14538 _desired: 'ors'
14538, 14539 _distance: '10', 14540 _oneway: 'true', 14541 }, 14542 }, 14543 { 14544 ms: { 14545 _desired: 'pel', 14546 _distance: '10', 14547 _oneway: 'true', 14548 }, 14549 }, 14550 { 14551 ms: { 14552 _desired: 'pse', 14553 _distance: '10', 14554 _oneway: 'true', 14555 }, 14556 }, 14557 { 14558 ms: { 14559 _desired: 'tmw', 14560 _distance: '10', 14561 _oneway: 'true', 14562 }, 14563 }, 14564 { 14565 ms: { 14566 _desired: 'urk', 14567 _distance: '10', 14568 _oneway: 'true', 14569 }, 14570 }, 14571 { 14572 ms: { 14573 _desired: 'vkk', 14574 _distance: '10', 14575 _oneway: 'true', 14576 }, 14577 }, 14578 { 14579 ms: { 14580 _desired: 'vkt', 14581 _distance: '10', 14582 _oneway: 'true', 14583 }, 14584 }, 14585 { 14586 ms: { 14587 _desired: 'xmm', 14588 _distance: '10', 14589 _oneway: 'true', 14590 }, 14591 }, 14592 { 14593 ms: { 14594 _desired: 'zlm', 14595 _distance: '10', 14596 _oneway: 'true', 14597 }, 14598 }, 14599 { 14600 ms: { 14601 _desired: 'zmi', 14602 _distance: '10', 14603 _oneway: 'true', 14604 }, 14605 }, 14606 { 14607 ne: { 14608 _desired: 'dty', 14609 _distance: '10', 14610 _oneway: 'true', 14611 }, 14612 }, 14613 { 14614 om: { 14615 _desired: 'gax', 14616 _distance: '10', 14617 _oneway: 'true', 14618 }, 14619 }, 14620 { 14621 om: { 14622 _desired: 'hae', 14623 _distance: '10', 14624 _oneway: 'true', 14625 }, 14626 }, 14627 { 14628 om: { 14629 _desired: 'orc', 14630 _distance: '10', 14631 _oneway: 'true', 14632 }, 14633 }, 14634 { 14635 or: { 14636 _desired: 'spv', 14637 _distance: '10', 14638 _oneway: 'true', 14639 }, 14640 }, 14641 { 14642 ps: { 14643 _desired: 'pbt', 14644 _distance: '10', 14645 _oneway: 'true', 14646 }, 14647 }, 14648 { 14649 ps: { 14650 _desired: 'pst', 14651 _distance: '10', 14652 _oneway: 'true', 14653 }, 14654 }, 14655 { 14656 qu: { 14657 _desired: 'qub', 14658 _distance: '10', 14659 _oneway: 'true', 14660 }, 14661 }, 14662 { 14663 qu: { 14664 _desired: 'qud', 14665 _distance: '10', 14666 _oneway: 'true', 14667 }, 14668 }, 14669 { 14670 qu: { 14671 _desired: 'quf', 14672 _distance: '10', 14673 _oneway: 'true', 14674 }, 14675 }, 14676 { 14677 qu: { 14678 _desired: 'qug', 14679 _distance: '10', 14680 _oneway: 'true', 14681 }, 14682 }, 14683 { 14684 qu: { 14685 _desired: 'quh', 14686 _distance: '10', 14687 _oneway: 'true', 14688 }, 14689 }, 14690 { 14691 qu: { 14692 _desired: 'quk', 14693 _distance: '10', 14694 _oneway: 'true', 14695 }, 14696 }, 14697 { 14698 qu: { 14699 _desired: 'qul', 14700 _distance: '10', 14701 _oneway: 'true', 14702 }, 14703 }, 14704 { 14705 qu: { 14706 _desired: 'qup', 14707 _distance: '10', 14708 _oneway: 'true', 14709 }, 14710 }, 14711 { 14712 qu: { 14713 _desired: 'qur', 14714 _distance: '10', 14715 _oneway: 'true', 14716 }, 14717 }, 14718 { 14719 qu: { 14720 _desired: 'qus', 14721 _distance: '10', 14722 _oneway: 'true', 14723 }, 14724 }, 14725 { 14726 qu: { 14727 _desired: 'quw', 14728 _distance: '10', 14729 _oneway: 'true', 14730 }, 14731 }, 14732 { 14733 qu: { 14734 _desired: 'qux', 14735 _distance: '10', 14736 _oneway: 'true', 14737 }, 14738 }, 14739 { 14740 qu: { 14741 _desired: 'quy', 14742 _distance: '10', 14743 _oneway: 'true', 14744 }, 14745 }, 14746 { 14747 qu: { 14748 _desired: 'qva', 14749 _distance: '10', 14750 _oneway: 'true', 14751 }, 14752 }, 14753 { 14754 qu: { 14755 _desired: 'qvc', 14756 _distance: '10', 14757 _oneway: 'true', 14758 }, 14759 }, 14760 { 14761 qu: { 14762 _desired: 'qve', 14763 _distance: '10', 14764 _oneway: 'true', 14765 }, 14766 }, 14767 { 14768 qu: { 14769 _desired: 'qvh', 14770 _distance: '10', 14771 _oneway: 'true', 14772 }, 14773 }, 14774 { 14775 qu: { 14776 _desired: 'qvi', 14777 _distance: '10', 14778 _oneway: 'true', 14779 }, 14780 }, 14781 { 14782 qu: { 14783 _desired: 'qvj', 14784 _distance: '10', 14785 _oneway: 'true', 14786 }, 14787 }, 14788 { 14789 qu: { 14790 _desired: 'qvl', 14791 _distance: '10', 14792 _oneway: 'true', 14793 }, 14794 }, 14795 { 14796 qu: { 14797 _desired: 'qvm', 14798 _distance: '10', 14799 _oneway: 'true', 14800 }, 14801 }, 14802 { 14803 qu: { 14804 _desired: 'qvn', 14805 _distance: '10', 14806 _oneway: 'true', 14807 }, 14808 }, 14809 { 14810 qu: { 14811 _desired: 'qvo', 14812 _distance: '10', 14813 _oneway: 'true', 14814 }, 14815 }, 14816 { 14817 qu: { 14818 _desired: 'qvp', 14819 _distance: '10', 14820 _oneway: 'true', 14821 }, 14822 }, 14823 { 14824 qu: { 14825 _desired: 'qvs', 14826 _distance: '10', 14827 _oneway: 'true', 14828 }, 14829 }, 14830 { 14831 qu: { 14832 _desired: 'qvw', 14833 _distance: '10', 14834 _oneway: 'true', 14835 }, 14836 }, 14837 { 14838 qu: { 14839 _desired: 'qvz', 14840 _distance: '10', 14841 _oneway: 'true', 14842 }, 14843 }, 14844 { 14845 qu: { 14846 _desired: 'qwa', 14847 _distance: '10', 14848 _oneway: 'true', 14849 }, 14850 }, 14851 { 14852 qu: { 14853 _desired: 'qwc', 14854 _distance: '10', 14855 _oneway: 'true', 14856 }, 14857 }, 14858 { 14859 qu: { 14860 _desired: 'qwh', 14861 _distance: '10', 14862 _oneway: 'true', 14863 }, 14864 }, 14865 { 14866 qu: { 14867 _desired: 'qws', 14868 _distance: '10', 14869 _oneway: 'true', 14870 }, 14871 }, 14872 { 14873 qu: { 14874 _desired: 'qxa', 14875 _distance: '10', 14876 _oneway: 'true', 14877 }, 14878 }, 14879 { 14880 qu: { 14881 _desired: 'qxc', 14882 _distance: '10', 14883 _oneway: 'true', 14884 }, 14885 }, 14886 { 14887 qu: { 14888 _desired: 'qxh', 14889 _distance: '10', 14890 _oneway: 'true', 14891 }, 14892 }, 14893 { 14894 qu: { 14895 _desired: 'qxl', 14896 _distance: '10', 14897 _oneway: 'true', 14898 }, 14899 }, 14900 { 14901 qu: { 14902 _desired: 'qxn', 14903 _distance: '10', 14904 _oneway: 'true', 14905 }, 14906 }, 14907 { 14908 qu: { 14909 _desired: 'qxo', 14910 _distance: '10', 14911 _oneway: 'true', 14912 }, 14913 }, 14914 { 14915 qu: { 14916 _desired: 'qxp', 14917 _distance: '10', 14918 _oneway: 'true', 14919 }, 14920 }, 14921 { 14922 qu: { 14923 _desired: 'qxr', 14924 _distance: '10', 14925 _oneway: 'true', 14926 }, 14927 }, 14928 { 14929 qu: { 14930 _desired: 'qxt', 14931 _distance: '10', 14932 _oneway: 'true', 14933 }, 14934 }, 14935 { 14936 qu: { 14937 _desired: 'qxu', 14938 _distance: '10', 14939 _oneway: 'true', 14940 }, 14941 }, 14942 { 14943 qu: { 14944 _desired: 'qxw', 14945 _distance: '10', 14946 _oneway: 'true', 14947 }, 14948 }, 14949 { 14950 sc: { 14951 _desired: 'sdc', 14952 _distance: '10', 14953 _oneway: 'true', 14954 }, 14955 }, 14956 { 14957 sc: { 14958 _desired: 'sdn', 14959 _distance: '10', 14960 _oneway: 'true', 14961 }, 14962 }, 14963 { 14964 sc: { 14965 _desired: 'sro', 14966 _distance: '10', 14967 _oneway: 'true', 14968 }, 14969 }, 14970 { 14971 sq: { 14972 _desired: 'aae', 14973 _distance: '10', 14974 _oneway: 'true', 14975 }, 14976 }, 14977 { 14978 sq: { 14979 _desired: 'aat', 14980 _distance: '10', 14981 _oneway: 'true', 14982 }, 14983 }, 14984 { 14985 sq: { 14986 _desired: 'aln', 14987 _distance: '10', 14988 _oneway: 'true', 14989 }, 14990 }, 14991 { 14992 syr: { 14993 _desired: 'aii', 14994 _distance: '10', 14995 _oneway: 'true', 14996 }, 14997 }, 14998 { 14999 uz: { 15000 _desired: 'uzs', 15001 _distance: '10', 15002 _oneway: 'true', 15003 }, 15004 }, 15005 { 15006 yi: { 15007 _desired: 'yih', 15008 _distance: '10', 15009 _oneway: 'true', 15010 }, 15011 }, 15012 { 15013 zh: { 15014 _desired: 'cdo', 15015 _distance: '10', 15016 _oneway: 'true', 15017 }, 15018 }, 15019 { 15020 zh: { 15021 _desired: 'cjy', 15022 _distance: '10', 15023 _oneway: 'true', 15024 }, 15025 }, 15026 { 15027 zh: { 15028 _desired: 'cpx', 15029 _distance: '10', 15030 _oneway: 'true', 15031 }, 15032 }, 15033 { 15034 zh: { 15035 _desired: 'czh', 15036 _distance: '10', 15037 _oneway: 'true', 15038 }, 15039 }, 15040 { 15041 zh: { 15042 _desired: 'czo', 15043 _distance: '10', 15044 _oneway: 'true', 15045 }, 15046 }, 15047 { 15048 zh: { 15049 _desired: 'gan', 15050 _distance: '10', 15051 _oneway: 'true', 15052 }, 15053 }, 15054 { 15055 zh: { 15056 _desired: 'hak', 15057 _distance: '10', 15058 _oneway: 'true', 15059 }, 15060 }, 15061 { 15062 zh: { 15063 _desired: 'hsn', 15064 _distance: '10', 15065 _oneway: 'true', 15066 }, 15067 }, 15068 { 15069 zh: { 15070 _desired: 'lzh', 15071 _distance: '10', 15072 _oneway: 'true', 15073 }, 15074 }, 15075 { 15076 zh: { 15077 _desired: 'mnp', 15078 _distance: '10', 15079 _oneway: 'true', 15080 }, 15081 }, 15082 { 15083 zh: { 15084 _desired: 'nan', 15085 _distance: '10', 15086 _oneway: 'true
15086', 15087 }, 15088 }, 15089 { 15090 zh: { 15091 _desired: 'wuu', 15092 _distance: '10', 15093 _oneway: 'true', 15094 }, 15095 }, 15096 { 15097 zh: { 15098 _desired: 'yue', 15099 _distance: '10', 15100 _oneway: 'true', 15101 }, 15102 }, 15103 { 15104 '*': { 15105 _desired: '*', 15106 _distance: '80', 15107 }, 15108 }, 15109 { 15110 'en-Latn': { 15111 _desired: 'am-Ethi', 15112 _distance: '10', 15113 _oneway: 'true', 15114 }, 15115 }, 15116 { 15117 'ru-Cyrl': { 15118 _desired: 'az-Latn', 15119 _distance: '10', 15120 _oneway: 'true', 15121 }, 15122 }, 15123 { 15124 'en-Latn': { 15125 _desired: 'bn-Beng', 15126 _distance: '10', 15127 _oneway: 'true', 15128 }, 15129 }, 15130 { 15131 'zh-Hans': { 15132 _desired: 'bo-Tibt', 15133 _distance: '10', 15134 _oneway: 'true', 15135 }, 15136 }, 15137 { 15138 'ru-Cyrl': { 15139 _desired: 'hy-Armn', 15140 _distance: '10', 15141 _oneway: 'true', 15142 }, 15143 }, 15144 { 15145 'en-Latn': { 15146 _desired: 'ka-Geor', 15147 _distance: '10', 15148 _oneway: 'true', 15149 }, 15150 }, 15151 { 15152 'en-Latn': { 15153 _desired: 'km-Khmr', 15154 _distance: '10', 15155 _oneway: 'true', 15156 }, 15157 }, 15158 { 15159 'en-Latn': { 15160 _desired: 'kn-Knda', 15161 _distance: '10', 15162 _oneway: 'true', 15163 }, 15164 }, 15165 { 15166 'en-Latn': { 15167 _desired: 'lo-Laoo', 15168 _distance: '10', 15169 _oneway: 'true', 15170 }, 15171 }, 15172 { 15173 'en-Latn': { 15174 _desired: 'ml-Mlym', 15175 _distance: '10', 15176 _oneway: 'true', 15177 }, 15178 }, 15179 { 15180 'en-Latn': { 15181 _desired: 'my-Mymr', 15182 _distance: '10', 15183 _oneway: 'true', 15184 }, 15185 }, 15186 { 15187 'en-Latn': { 15188 _desired: 'ne-Deva', 15189 _distance: '10', 15190 _oneway: 'true', 15191 }, 15192 }, 15193 { 15194 'en-Latn': { 15195 _desired: 'or-Orya', 15196 _distance: '10', 15197 _oneway: 'true', 15198 }, 15199 }, 15200 { 15201 'en-Latn': { 15202 _desired: 'pa-Guru', 15203 _distance: '10', 15204 _oneway: 'true', 15205 }, 15206 }, 15207 { 15208 'en-Latn': { 15209 _desired: 'ps-Arab', 15210 _distance: '10', 15211 _oneway: 'true', 15212 }, 15213 }, 15214 { 15215 'en-Latn': { 15216 _desired: 'sd-Arab', 15217 _distance: '10', 15218 _oneway: 'true', 15219 }, 15220 }, 15221 { 15222 'en-Latn': { 15223 _desired: 'si-Sinh', 15224 _distance: '10', 15225 _oneway: 'true', 15226 }, 15227 }, 15228 { 15229 'en-Latn': { 15230 _desired: 'ta-Taml', 15231 _distance: '10', 15232 _oneway: 'true', 15233 }, 15234 }, 15235 { 15236 'en-Latn': { 15237 _desired: 'te-Telu', 15238 _distance: '10', 15239 _oneway: 'true', 15240 }, 15241 }, 15242 { 15243 'en-Latn': { 15244 _desired: 'ti-Ethi', 15245 _distance: '10', 15246 _oneway: 'true', 15247 }, 15248 }, 15249 { 15250 'ru-Cyrl': { 15251 _desired: 'tk-Latn', 15252 _distance: '10', 15253 _oneway: 'true', 15254 }, 15255 }, 15256 { 15257 'en-Latn': { 15258 _desired: 'ur-Arab', 15259 _distance: '10', 15260 _oneway: 'true', 15261 }, 15262 }, 15263 { 15264 'ru-Cyrl': {
15265 _desired: 'uz-Latn', 15266 _distance: '10', 15267 _oneway: 'true', 15268 }, 15269 }, 15270 { 15271 'en-Latn': { 15272 _desired: 'yi-Hebr', 15273 _distance: '10', 15274 _oneway: 'true', 15275 }, 15276 }, 15277 { 15278 'sr-Cyrl': { 15279 _desired: 'sr-Latn', 15280 _distance: '5', 15281 }, 15282 }, 15283 { 15284 'zh-Hans': { 15285 _desired: 'za-Latn', 15286 _distance: '10', 15287 _oneway: 'true', 15288 }, 15289 }, 15290 { 15291 'zh-Hans': { 15292 _desired: 'zh-Hani', 15293 _distance: '20', 15294 _oneway: 'true', 15295 }, 15296 }, 15297 { 15298 'zh-Hant': { 15299 _desired: 'zh-Hani', 15300 _distance: '20', 15301 _oneway: 'true', 15302 }, 15303 }, 15304 { 15305 'ar-Arab': { 15306 _desired: 'ar-Latn', 15307 _distance: '20', 15308 _oneway: 'true', 15309 }, 15310 }, 15311 { 15312 'bn-Beng': { 15313 _desired: 'bn-Latn', 15314 _distance: '20', 15315 _oneway: 'true', 15316 }, 15317 }, 15318 { 15319 'gu-Gujr': { 15320 _desired: 'gu-Latn', 15321 _distance: '20', 15322 _oneway: 'true', 15323 }, 15324 }, 15325 { 15326 'hi-Deva': { 15327 _desired: 'hi-Latn', 15328 _distance: '20', 15329 _oneway: 'true', 15330 }, 15331 }, 15332 { 15333 'kn-Knda': { 15334 _desired: 'kn-Latn', 15335 _distance: '20', 15336 _oneway: 'true', 15337 }, 15338 }, 15339 { 15340 'ml-Mlym': { 15341 _desired: 'ml-Latn', 15342 _distance: '20', 15343 _oneway: 'true', 15344 }, 15345 }, 15346 { 15347 'mr-Deva': { 15348 _desired: 'mr-Latn', 15349 _distance: '20', 15350 _oneway: 'true', 15351 }, 15352 }, 15353 { 15354 'ta-Taml': { 15355 _desired: 'ta-Latn', 15356 _distance: '20', 15357 _oneway: 'true', 15358 }, 15359 }, 15360 { 15361 'te-Telu': { 15362 _desired: 'te-Latn', 15363 _distance: '20', 15364 _oneway: 'true', 15365 }, 15366 }, 15367 { 15368 'zh-Hans': { 15369 _desired: 'zh-Latn', 15370 _distance: '20', 15371 _oneway: 'true', 15372 }, 15373 }, 15374 { 15375 'ja-Jpan': { 15376 _desired: 'ja-Latn', 15377 _distance: '5', 15378 _oneway: 'true', 15379 }, 15380 }, 15381 { 15382 'ja-Jpan': { 15383 _desired: 'ja-Hani', 15384 _distance: '5', 15385 _oneway: 'true', 15386 }, 15387 }, 15388 { 15389 'ja-Jpan': { 15390 _desired: 'ja-Hira', 15391 _distance: '5', 15392 _oneway: 'true', 15393 }, 15394 }, 15395 { 15396 'ja-Jpan': { 15397 _desired: 'ja-Kana', 15398 _distance: '5', 15399 _oneway: 'true', 15400 }, 15401 }, 15402 { 15403 'ja-Jpan': { 15404 _desired: 'ja-Hrkt', 15405 _distance: '5', 15406 _oneway: 'true', 15407 }, 15408 }, 15409 { 15410 'ja-Hrkt': { 15411 _desired: 'ja-Hira', 15412 _distance: '5', 15413 _oneway: 'true', 15414 }, 15415 }, 15416 { 15417 'ja-Hrkt': { 15418 _desired: 'ja-Kana', 15419 _distance: '5', 15420 _oneway: 'true', 15421 }, 15422 }, 15423 { 15424 'ko-Kore': { 15425 _desired: 'ko-Hani', 15426 _distance: '5', 15427 _oneway: 'true', 15428 }, 15429 }, 15430 { 15431 'ko-Kore': { 15432 _desired: 'ko-Hang', 15433 _distance: '5', 15434 _oneway: 'true', 15435 }, 15436 }, 15437 { 15438 'ko-Kore': { 15439 _desired: 'ko-Jamo', 15440 _distance: '5', 15441 _oneway: 'true', 15442 }, 15443 }, 15444 { 15445 'ko-Hang': { 15446 _desired: 'ko-Jamo', 15447 _distance: '5', 15448 _oneway: 'true', 15449 }, 15450 }, 15451 { 15452 '*-*': { 15453 _desired: '*-*', 15454 _distance: '50', 15455 }, 15456 }, 15457 { 15458 'ar-*-$maghreb': { 15459 _desired: 'ar-*-$maghreb', 15460 _distance: '4', 15461 }, 15462 }, 15463 { 15464 'ar-*-$!maghreb': { 15465 _desired: 'ar-*-$!maghreb', 15466 _distance: '4', 15467 }, 15468 }, 15469 { 15470 'ar-*-*': { 15471 _desired: 'ar-*-*', 15472 _distance: '5', 15473 }, 15474 }, 15475 { 15476 'en-*-$enUS': { 15477 _desired: 'en-*-$enUS', 15478 _distance: '4', 15479 }, 15480 }, 15481 { 15482 'en-*-GB': { 15483 _desired: 'en-*-$!enUS', 15484 _distance: '3', 15485 }, 15486 }, 15487 { 15488 'en-*-$!enUS': { 15489 _desired: 'en-*-$!enUS', 15490 _distance: '4', 15491 }, 15492 }, 15493 { 15494 'en-*-*': { 15495 _desired: 'en-*-*', 15496 _distance: '5', 15497 }, 15498 }, 15499 { 15500 'es-*-$americas': { 15501 _desired: 'es-*-$americas', 15502 _distance: '4', 15503 }, 15504 }, 15505 { 15506 'es-*-$!americas': { 15507 _desired: 'es-*-$!americas', 15508 _distance: '4', 15509 }, 15510 }, 15511 { 15512 'es-*-*': { 15513 _desired: 'es-*-*', 15514 _distance: '5', 15515 }, 15516 }, 15517 { 15518 'pt-*-$americas': { 15519 _desired: 'pt-*-$americas', 15520 _distance: '4', 15521 }, 15522 }, 15523 { 15524 'pt-*-$!americas': { 15525 _desired: 'pt-*-$!americas', 15526 _distance: '4', 15527 }, 15528 }, 15529 { 15530 'pt-*-*': { 15531 _desired: 'pt-*-*', 15532 _distance: '5', 15533 }, 15534 }, 15535 { 15536 'zh-Hant-$cnsar': { 15537 _desired: 'zh-Hant-$cnsar', 15538 _distance: '4', 15539 }, 15540 }, 15541 { 15542 'zh-Hant-$!cnsar': { 15543 _desired: 'zh-Hant-$!cnsar', 15544 _distance: '4', 15545 }, 15546 }, 15547 { 15548 'zh-Hant-*': { 15549 _desired: 'zh-Hant-*', 15550 _distance: '5', 15551 }, 15552 }, 15553 { 15554 '*-*-*': { 15555 _desired: '*-*-*', 15556 _distance: '4', 15557 }, 15558 }, 15559 ], 15560 }, 15561 }, 15562}; 15563 15564;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/regions.generated.js 15565// This file is generated from regions-gen.ts 15566var regions = { 15567 "001": [ 15568 "001", 15569 "001-status-grouping", 15570 "002", 15571 "005", 15572 "009", 15573 "011", 15574 "013", 15575 "014", 15576 "015", 15577 "017", 15578 "018", 15579 "019", 15580 "021", 15581 "029", 15582 "030", 15583 "034", 15584 "035", 15585 "039", 15586 "053", 15587 "054", 15588 "057", 15589 "061", 15590 "142", 15591 "143", 15592 "145", 15593 "150", 15594 "151", 15595 "154", 15596 "155", 15597 "AC", 15598 "AD", 15599 "AE", 15600 "AF", 15601 "AG", 15602 "AI", 15603 "AL", 15604 "AM", 15605 "AO", 15606 "AQ", 15607 "AR", 15608 "AS", 15609 "AT", 15610 "AU", 15611 "AW", 15612 "AX", 15613 "AZ", 15614 "BA", 15615 "BB", 15616 "BD", 15617 "BE", 15618 "BF", 15619 "BG", 15620 "BH", 15621 "BI", 15622 "BJ", 15623 "BL", 15624 "BM", 15625 "BN", 15626 "BO", 15627 "BQ", 15628 "BR", 15629 "BS", 15630 "BT", 15631 "BV", 15632 "BW", 15633 "BY", 15634 "BZ", 15635 "CA", 15636 "CC", 15637 "CD", 15638 "CF", 15639 "CG", 15640 "CH", 15641 "CI", 15642 "CK", 15643 "CL", 15644 "CM", 15645 "CN", 15646 "CO", 15647 "CP", 15648 "CQ", 15649 "CR", 15650 "CU", 15651 "CV", 15652 "CW", 15653 "CX", 15654 "CY", 15655 "CZ", 15656 "DE", 15657 "DG", 15658 "DJ", 15659 "DK", 15660 "DM", 15661 "DO", 15662 "DZ", 15663 "EA", 15664 "EC", 15665 "EE", 15666 "EG", 15667 "EH", 15668 "ER", 15669 "ES", 15670 "ET", 15671 "EU", 15672 "EZ", 15673 "FI", 15674 "FJ", 15675 "FK", 15676 "FM", 15677 "FO", 15678 "FR", 15679 "GA", 15680 "GB", 15681 "GD", 15682 "GE", 15683 "GF", 15684 "GG", 15685 "GH", 15686 "GI", 15687 "GL", 15688 "GM", 15689 "GN", 15690 "GP", 15691 "GQ", 15692 "GR", 15693 "GS", 15694 "GT", 15695 "GU", 15696 "GW", 15697 "GY", 15698 "HK", 15699 "HM", 15700 "HN", 15701 "HR", 15702 "HT", 15703 "HU", 15704 "IC", 15705 "ID", 15706 "IE", 15707 "IL", 15708 "IM", 15709 "IN", 15710 "IO", 15711 "IQ", 15712 "IR", 15713 "IS", 15714 "IT", 15715 "JE", 15716 "JM", 15717 "JO", 15718 "JP", 15719 "KE", 15720 "KG", 15721 "KH", 15722 "KI", 15723 "KM", 15724 "KN", 15725 "KP", 15726 "KR", 15727 "KW", 15728 "KY", 15729 "KZ", 15730 "LA", 15731 "LB", 15732 "LC", 15733 "LI", 15734 "LK", 15735 "LR", 15736 "LS", 15737 "LT", 15738 "LU", 15739 "LV", 15740 "LY", 15741 "MA", 15742 "MC", 15743 "MD", 15744 "ME", 15745 "MF", 15746 "MG", 15747 "MH", 15748 "MK", 15749 "ML", 15750 "MM", 15751 "MN", 15752 "MO", 15753 "MP", 15754 "MQ", 15755 "MR", 15756 "MS", 15757 "MT", 15758 "MU", 15759 "MV", 15760 "MW", 15761 "MX", 15762 "MY", 15763 "MZ", 15764 "NA", 15765 "NC", 15766 "NE", 15767 "NF", 15768 "NG", 15769 "NI", 15770 "NL", 15771 "NO", 15772 "NP", 15773 "NR", 15774 "NU", 15775 "NZ", 15776 "OM", 15777 "PA", 15778 "PE", 15779 "PF", 15780 "PG", 15781 "PH", 15782 "PK", 15783 "PL", 15784 "PM", 15785 "PN", 15786 "PR", 15787 "PS", 15788 "PT", 15789 "PW", 15790 "PY", 15791 "QA", 15792 "QO", 15793 "RE", 15794 "RO", 15795 "RS", 15796 "RU", 15797 "RW", 15798 "SA", 15799 "SB", 15800 "SC", 15801 "SD", 15802 "SE", 15803 "SG", 15804 "SH", 15805 "SI", 15806 "SJ", 15807 "SK", 15808 "SL", 15809 "SM", 15810 "SN", 15811 "SO", 15812 "SR", 15813 "SS", 15814 "ST", 15815 "SV", 15816 "SX", 15817 "SY", 15818 "SZ", 15819 "TA", 15820 "TC", 15821 "TD", 15822 "TF", 15823 "TG", 15824 "TH", 15825 "TJ", 15826 "TK", 15827 "TL", 15828 "TM", 15829 "TN", 15830 "TO", 15831 "TR", 15832 "TT", 15833 "TV", 15834 "TW", 15835 "TZ", 15836 "UA", 15837 "UG", 15838 "UM", 15839 "UN", 15840 "US", 15841 "UY", 15842 "UZ", 15843 "VA", 15844 "VC", 15845 "VE", 15846 "VG", 15847 "VI", 15848 "VN", 15849 "VU", 15850 "WF", 15851 "WS", 15852 "XK", 15853 "YE", 15854 "YT", 15855 "ZA", 15856 "ZM", 15857 "ZW" 15858 ], 15859 "002": [ 15860 "002", 15861 "002-status-grouping", 15862 "011", 15863 "014", 15864 "015", 15865 "017", 15866 "018", 15867 "202", 15868 "AO", 15869 "BF", 15870 "BI", 15871 "BJ", 15872 "BW", 15873 "CD", 15874 "CF", 15875 "CG", 15876 "CI", 15877 "CM", 15878 "CV", 15879 "DJ", 15880 "DZ", 15881 "EA", 15882 "EG", 15883 "EH", 15884 "ER", 15885 "ET", 15886 "GA", 15887 "GH", 15888 "GM", 15889 "GN", 15890 "GQ", 15891 "GW", 15892 "IC", 15893 "IO", 15894 "KE", 15895 "KM", 15896 "LR", 15897 "LS", 15898 "LY", 15899 "MA", 15900 "MG", 15901 "ML", 15902 "MR", 15903 "MU", 15904 "MW", 15905 "MZ", 15906 "NA", 15907 "NE", 15908 "NG", 15909 "RE", 15910 "RW", 15911 "SC", 15912 "SD", 15913 "SH", 15914 "SL", 15915 "SN", 15916 "SO", 15917 "SS", 15918 "ST", 15919 "SZ", 15920 "TD", 15921 "TF", 15922 "TG", 15923 "TN", 15924 "TZ", 15925 "UG", 15926 "YT", 15927 "ZA", 15928 "ZM", 15929 "ZW" 15930 ], 15931 "003": [ 15932 "003", 15933 "013", 15934 "021", 15935 "029", 15936 "AG", 15937 "AI", 15938 "AW", 15939 "BB", 15940 "BL", 15941 "BM", 15942 "BQ", 15943 "BS", 15944 "BZ", 15945 "CA", 15946 "CR", 15947 "CU", 15948 "CW", 15949 "DM", 15950 "DO", 15951 "GD", 15952 "GL", 15953 "GP", 15954 "GT", 15955 "HN", 15956 "HT", 15957 "JM", 15958 "KN", 15959 "KY", 15960 "LC", 15961 "MF", 15962 "MQ", 15963 "MS", 15964 "MX", 15965 "NI", 15966 "PA", 15967 "PM", 15968 "PR", 15969 "SV", 15970 "SX", 15971 "TC", 15972 "TT", 15973 "US", 15974 "VC", 15975 "VG", 15976 "VI" 15977 ], 15978 "005": [ 15979 "005", 15980 "AR", 15981 "BO", 15982 "BR", 15983 "BV", 15984 "CL", 15985 "CO", 15986 "EC", 15987 "FK", 15988 "GF", 15989 "GS", 15990 "GY", 15991 "PE", 15992 "PY", 15993 "SR", 15994 "UY", 15995 "VE" 15996 ], 15997 "009": [ 15998 "009", 15999 "053", 16000 "054", 16001 "057", 16002 "061", 16003 "AC", 16004 "AQ", 16005 "AS", 16006 "AU", 16007 "CC", 16008 "CK", 16009 "CP", 16010 "CX", 16011 "DG", 16012 "FJ", 16013 "FM", 16014 "GU", 16015 "HM", 16016 "KI", 16017 "MH", 16018 "MP", 16019 "NC", 16020 "NF", 16021 "NR", 16022 "NU", 16023 "NZ", 16024 "PF", 16025 "PG", 16026 "PN", 16027 "PW", 16028 "QO", 16029 "SB", 16030 "TA", 16031 "TK", 16032 "TO", 16033 "TV", 16034 "UM", 16035 "VU", 16036 "WF", 16037 "WS" 16038 ], 16039 "011": [ 16040 "011", 16041 "BF", 16042 "BJ", 16043 "CI", 16044 "CV", 16045 "GH", 16046 "GM", 16047 "GN", 16048 "GW", 16049 "LR", 16050 "ML", 16051 "MR", 16052 "NE", 16053 "NG", 16054 "SH", 16055 "SL", 16056 "SN", 16057 "TG" 16058 ], 16059 "013": [ 16060 "013", 16061 "BZ", 16062 "CR", 16063 "GT", 16064 "HN", 16065 "MX", 16066 "NI", 16067 "PA", 16068
16068 "SV" 16069 ], 16070 "014": [ 16071 "014", 16072 "BI", 16073 "DJ", 16074 "ER", 16075 "ET", 16076 "IO", 16077 "KE", 16078 "KM", 16079 "MG", 16080 "MU", 16081 "MW", 16082 "MZ", 16083 "RE", 16084 "RW", 16085 "SC", 16086 "SO", 16087 "SS", 16088 "TF", 16089 "TZ", 16090 "UG", 16091 "YT", 16092 "ZM", 16093 "ZW" 16094 ], 16095 "015": [ 16096 "015", 16097 "DZ", 16098 "EA", 16099 "EG", 16100 "EH", 16101 "IC", 16102 "LY", 16103 "MA", 16104 "SD", 16105 "TN" 16106 ], 16107 "017": [ 16108 "017", 16109 "AO", 16110 "CD", 16111 "CF", 16112 "CG", 16113 "CM", 16114 "GA", 16115 "GQ", 16116 "ST", 16117 "TD" 16118 ], 16119 "018": [ 16120 "018", 16121 "BW", 16122 "LS", 16123 "NA", 16124 "SZ", 16125 "ZA" 16126 ], 16127 "019": [ 16128 "003", 16129 "005", 16130 "013", 16131 "019", 16132 "019-status-grouping", 16133 "021", 16134 "029", 16135 "419", 16136 "AG", 16137 "AI", 16138 "AR", 16139 "AW", 16140 "BB", 16141 "BL", 16142 "BM", 16143 "BO", 16144 "BQ", 16145 "BR", 16146 "BS", 16147 "BV", 16148 "BZ", 16149 "CA", 16150 "CL", 16151 "CO", 16152 "CR", 16153 "CU", 16154 "CW", 16155 "DM", 16156 "DO", 16157 "EC", 16158 "FK", 16159 "GD", 16160 "GF", 16161 "GL", 16162 "GP", 16163 "GS", 16164 "GT", 16165 "GY", 16166 "HN", 16167 "HT", 16168 "JM", 16169 "KN", 16170 "KY", 16171 "LC", 16172 "MF", 16173 "MQ", 16174 "MS", 16175 "MX", 16176 "NI", 16177 "PA", 16178 "PE", 16179 "PM", 16180 "PR", 16181 "PY", 16182 "SR", 16183 "SV", 16184 "SX", 16185 "TC", 16186 "TT", 16187 "US", 16188 "UY", 16189 "VC", 16190 "VE", 16191 "VG", 16192 "VI" 16193 ], 16194 "021": [ 16195 "021", 16196 "BM", 16197 "CA", 16198 "GL", 16199 "PM", 16200 "US" 16201 ], 16202 "029": [ 16203 "029", 16204 "AG", 16205 "AI", 16206 "AW", 16207 "BB", 16208 "BL", 16209 "BQ", 16210 "BS", 16211 "CU", 16212 "CW", 16213 "DM", 16214 "DO", 16215 "GD", 16216 "GP", 16217 "HT", 16218 "JM", 16219 "KN", 16220 "KY", 16221 "LC", 16222 "MF", 16223 "MQ", 16224 "MS", 16225 "PR", 16226 "SX", 16227 "TC", 16228 "TT", 16229 "VC", 16230 "VG", 16231 "VI" 16232 ], 16233 "030": [ 16234 "030", 16235 "CN", 16236 "HK", 16237 "JP", 16238 "KP", 16239 "KR", 16240 "MN", 16241 "MO", 16242 "TW" 16243 ], 16244 "034": [ 16245 "034", 16246 "AF", 16247 "BD", 16248 "BT", 16249 "IN", 16250 "IR", 16251 "LK", 16252 "MV", 16253 "NP", 16254 "PK" 16255 ], 16256 "035": [ 16257 "035", 16258 "BN", 16259 "ID", 16260 "KH", 16261 "LA", 16262 "MM", 16263 "MY", 16264 "PH", 16265 "SG", 16266 "TH", 16267 "TL", 16268 "VN" 16269 ], 16270 "039": [ 16271 "039", 16272 "AD", 16273 "AL", 16274 "BA", 16275 "ES", 16276 "GI", 16277 "GR", 16278 "HR", 16279 "IT", 16280 "ME", 16281 "MK", 16282 "MT", 16283 "PT", 16284 "RS", 16285 "SI", 16286 "SM", 16287 "VA", 16288 "XK" 16289 ], 16290 "053": [ 16291 "053", 16292 "AU", 16293 "CC", 16294 "CX", 16295 "HM", 16296 "NF", 16297 "NZ" 16298 ], 16299 "054": [ 16300 "054", 16301 "FJ", 16302 "NC", 16303 "PG", 16304 "SB", 16305 "VU" 16306 ], 16307 "057": [ 16308 "057", 16309 "FM", 16310 "GU", 16311 "KI", 16312 "MH", 16313 "MP", 16314 "NR", 16315 "PW", 16316 "UM" 16317 ], 16318 "061": [ 16319 "061", 16320 "AS", 16321 "CK", 16322 "NU", 16323 "PF", 16324 "PN", 16325 "TK", 16326 "TO", 16327 "TV", 16328 "WF", 16329 "WS" 16330 ], 16331 "142": [ 16332 "030", 16333 "034", 16334 "035", 16335 "142", 16336 "143", 16337 "145", 16338 "AE", 16339 "AF", 16340 "AM", 16341 "AZ", 16342 "BD", 16343 "BH", 16344 "BN", 16345 "BT", 16346 "CN", 16347 "CY", 16348 "GE", 16349 "HK", 16350 "ID", 16351 "IL", 16352 "IN", 16353 "IQ", 16354 "IR", 16355 "JO", 16356 "JP", 16357 "KG", 16358 "KH", 16359 "KP", 16360 "KR", 16361 "KW", 16362 "KZ", 16363 "LA", 16364 "LB", 16365 "LK", 16366 "MM", 16367 "MN", 16368 "MO", 16369 "MV", 16370 "MY", 16371 "NP", 16372 "OM", 16373 "PH", 16374 "PK", 16375 "PS", 16376 "QA", 16377 "SA", 16378 "SG", 16379 "SY", 16380 "TH", 16381 "TJ", 16382 "TL", 16383 "TM", 16384 "TR", 16385 "TW", 16386 "UZ", 16387 "VN", 16388 "YE" 16389 ], 16390 "143": [ 16391 "143", 16392 "KG", 16393 "KZ", 16394 "TJ", 16395 "TM", 16396 "UZ" 16397 ], 16398 "145": [ 16399 "145", 16400 "AE", 16401 "AM", 16402 "AZ", 16403 "BH", 16404 "CY", 16405 "GE", 16406 "IL", 16407 "IQ", 16408 "JO", 16409 "KW", 16410 "LB", 16411 "OM", 16412 "PS", 16413 "QA", 16414 "SA", 16415 "SY", 16416 "TR", 16417 "YE" 16418 ], 16419 "150": [ 16420 "039", 16421 "150", 16422 "151", 16423 "154", 16424 "155", 16425 "AD", 16426 "AL", 16427 "AT", 16428 "AX", 16429 "BA", 16430 "BE", 16431 "BG", 16432 "BY", 16433 "CH", 16434 "CQ", 16435 "CZ", 16436 "DE", 16437 "DK", 16438 "EE", 16439 "ES", 16440 "FI", 16441 "FO", 16442 "FR", 16443 "GB", 16444 "GG", 16445 "GI", 16446 "GR", 16447 "HR", 16448 "HU", 16449 "IE", 16450 "IM", 16451 "IS", 16452 "IT", 16453 "JE", 16454 "LI", 16455 "LT", 16456 "LU", 16457 "LV", 16458 "MC", 16459 "MD", 16460 "ME", 16461 "MK", 16462 "MT", 16463 "NL", 16464 "NO", 16465 "PL", 16466 "PT", 16467 "RO", 16468 "RS", 16469 "RU", 16470 "SE", 16471 "SI", 16472 "SJ", 16473 "SK", 16474 "SM", 16475 "UA", 16476 "VA", 16477 "XK" 16478 ], 16479 "151": [ 16480 "151", 16481 "BG", 16482 "BY", 16483 "CZ", 16484 "HU", 16485 "MD", 16486 "PL", 16487 "RO", 16488 "RU", 16489 "SK", 16490 "UA" 16491 ], 16492 "154": [ 16493 "154", 16494 "AX", 16495 "CQ", 16496 "DK", 16497 "EE", 16498 "FI", 16499 "FO", 16500 "GB", 16501 "GG", 16502 "IE", 16503 "IM", 16504 "IS", 16505 "JE", 16506 "LT", 16507 "LV", 16508 "NO", 16509 "SE", 16510 "SJ" 16511 ], 16512 "155": [ 16513 "155", 16514 "AT", 16515 "BE", 16516 "CH", 16517 "DE", 16518 "FR", 16519 "LI", 16520 "LU", 16521 "MC", 16522 "NL" 16523 ], 16524 "202": [ 16525 "011", 16526 "014", 16527 "017", 16528 "018", 16529 "202", 16530 "AO", 16531 "BF", 16532 "BI", 16533 "BJ", 16534 "BW", 16535 "CD", 16536 "CF", 16537 "CG", 16538 "CI", 16539 "CM", 16540 "CV", 16541 "DJ", 16542 "ER", 16543 "ET", 16544 "GA", 16545 "GH", 16546 "GM", 16547 "GN", 16548 "GQ", 16549 "GW", 16550 "IO", 16551 "KE", 16552 "KM", 16553 "LR", 16554 "LS", 16555 "MG", 16556 "ML", 16557 "MR", 16558 "MU", 16559 "MW", 16560 "MZ", 16561 "NA", 16562 "NE", 16563 "NG", 16564 "RE", 16565 "RW", 16566 "SC", 16567 "SH", 16568 "SL", 16569 "SN", 16570 "SO", 16571 "SS", 16572 "ST", 16573 "SZ", 16574 "TD", 16575 "TF", 16576 "TG", 16577 "TZ", 16578 "UG", 16579 "YT", 16580 "ZA", 16581 "ZM", 16582 "ZW" 16583 ], 16584 "419": [ 16585 "005", 16586 "013", 16587 "029", 16588 "419", 16589 "AG", 16590 "AI", 16591 "AR", 16592 "AW", 16593 "BB", 16594 "BL", 16595 "BO", 16596 "BQ", 16597 "BR", 16598 "BS", 16599 "BV", 16600 "BZ", 16601 "CL", 16602 "CO", 16603 "CR", 16604 "CU", 16605 "CW", 16606 "DM", 16607 "DO", 16608 "EC", 16609 "FK", 16610 "GD", 16611 "GF", 16612 "GP", 16613 "GS", 16614 "GT", 16615 "GY", 16616 "HN", 16617 "HT", 16618 "JM", 16619 "KN", 16620 "KY", 16621 "LC", 16622 "MF", 16623 "MQ", 16624 "MS", 16625 "MX", 16626 "NI", 16627 "PA", 16628 "PE", 16629 "PR", 16630 "PY", 16631 "SR", 16632 "SV", 16633 "SX", 16634 "TC", 16635 "TT", 16636 "UY", 16637 "VC", 16638 "VE", 16639 "VG", 16640 "VI" 16641 ], 16642 "EU": [ 16643 "AT", 16644 "BE", 16645 "BG", 16646 "CY", 16647 "CZ", 16648 "DE", 16649 "DK", 16650 "EE", 16651 "ES", 16652 "EU", 16653 "FI", 16654 "FR", 16655 "GR", 16656 "HR", 16657 "HU", 16658 "IE", 16659 "IT", 16660 "LT", 16661 "LU", 16662 "LV", 16663 "MT", 16664 "NL", 16665 "PL", 16666 "PT", 16667 "RO", 16668 "SE", 16669 "SI", 16670 "SK" 16671 ], 16672 "EZ": [ 16673 "AT", 16674 "BE", 16675 "CY", 16676 "DE", 16677 "EE", 16678 "ES", 16679 "EZ", 16680 "FI", 16681 "FR", 16682 "GR", 16683 "IE", 16684 "IT", 16685 "LT", 16686 "LU", 16687 "LV", 16688 "MT", 16689 "NL", 16690 "PT", 16691 "SI", 16692 "SK" 16693 ], 16694 "QO": [ 16695 "AC", 16696 "AQ", 16697 "CP", 16698 "DG", 16699 "QO", 16700 "TA" 16701 ], 16702 "UN": [ 16703 "AD", 16704 "AE", 16705 "AF", 16706 "AG", 16707 "AL", 16708 "AM", 16709 "AO", 16710 "AR", 16711 "AT", 16712 "AU", 16713 "AZ", 16714 "BA", 16715 "BB", 16716 "BD", 16717 "BE", 16718 "BF", 16719 "BG", 16720 "BH", 16721 "BI", 16722 "BJ", 16723 "BN", 16724 "BO", 16725 "BR", 16726 "BS", 16727 "BT", 16728 "BW", 16729 "BY", 16730 "BZ", 16731 "CA", 16732 "CD", 16733 "CF", 16734 "CG", 16735 "CH", 16736 "CI", 16737 "CL", 16738 "CM", 16739 "CN", 16740 "CO", 16741 "CR", 16742 "CU", 16743 "CV", 16744 "CY", 16745 "CZ", 16746 "DE", 16747 "DJ", 16748 "DK", 16749 "DM", 16750 "DO", 16751 "DZ", 16752 "EC", 16753 "EE", 16754 "EG", 16755 "ER", 16756 "ES", 16757 "ET", 16758 "FI", 16759 "FJ", 16760 "FM", 16761 "FR", 16762 "GA", 16763 "GB", 16764 "GD", 16765 "GE", 16766 "GH", 16767 "GM", 16768 "GN", 16769 "GQ", 16770 "GR", 16771 "GT", 16772 "GW", 16773 "GY", 16774 "HN", 16775 "HR", 16776 "HT", 16777 "HU", 16778 "ID", 16779 "IE", 16780 "IL", 16781 "IN", 16782 "IQ", 16783 "IR", 16784 "IS", 16785 "IT", 16786 "JM", 16787 "JO", 16788 "JP", 16789 "KE", 16790 "KG", 16791 "KH", 16792 "KI", 16793 "KM", 16794 "KN", 16795 "KP", 16796 "KR", 16797 "KW", 16798 "KZ", 16799 "LA", 16800 "LB", 16801 "LC", 16802 "LI", 16803 "LK", 16804 "LR", 16805 "LS", 16806 "LT", 16807 "LU", 16808 "LV", 16809 "LY", 16810 "MA", 16811 "MC", 16812 "MD", 16813 "ME", 16814 "MG", 16815 "MH", 16816 "MK", 16817 "ML", 16818 "MM", 16819 "MN", 16820 "MR", 16821 "MT", 16822 "MU", 16823 "MV", 16824 "MW", 16825 "MX", 16826 "MY", 16827 "MZ", 16828 "NA", 16829 "NE", 16830 "NG", 16831 "NI", 16832 "NL", 16833 "NO", 16834 "NP", 16835 "NR", 16836 "NZ", 16837 "OM", 16838 "PA", 16839 "PE", 16840 "PG", 16841 "PH", 16842 "PK", 16843 "PL", 16844 "PT", 16845 "PW", 16846 "PY", 16847 "QA", 16848 "RO", 16849 "RS", 16850 "RU", 16851 "RW", 16852 "SA", 16853 "SB", 16854 "SC", 16855 "SD", 16856 "SE", 16857 "SG", 16858 "SI", 16859 "SK", 16860 "SL", 16861 "SM", 16862 "SN", 16863 "SO", 16864 "SR", 16865 "SS", 16866 "ST", 16867 "SV", 16868 "SY", 16869 "SZ", 16870 "TD", 16871 "TG", 16872 "TH", 16873 "TJ", 16874 "TL", 16875 "TM", 16876 "TN", 16877 "TO", 16878 "TR", 16879 "TT", 16880 "TV", 16881 "TZ", 16882 "UA", 16883 "UG", 16884 "UN", 16885 "US", 16886 "UY", 16887 "UZ", 16888 "VC", 16889 "VE", 16890 "VN", 16891 "VU", 16892 "WS", 16893 "YE", 16894 "ZA", 16895 "ZM", 16896 "ZW" 16897 ] 16898}; 16899 16900;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/utils.js 16901 16902 16903 16904var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi; 16905function invariant(condition, message, Err) { 16906 if (Err === void 0) { Err = Error; } 16907 if (!condition) { 16908 throw new Err(message); 16909 } 16910} 16911// This is effectively 2 languages in 2 different regions in the same cluster 16912var DEFAULT_MATCHING_THRESHOLD = 838; 16913var PROCESSED_DATA; 16914function processData() { 16915 var _a, _b; 16916 if (!PROCESSED_DATA) { 16917 var paradigmLocales = (_b = (_a = languageMatching_data.supplemental.languageMatching['written-new'][0]) === null || _a === void 0 ? void 0 : _a.paradigmLocales) === null || _b === void 0 ? void 0 : _b._locales.split(' '); 16918 var matchVariables = languageMatching_data.supplemental.languageMatching['written-new'].slice(1, 5); 16919 var data = languageMatching_data.supplemental.languageMatching['written-new'].slice(5); 16920 var matches = data.map(function (d) { 16921 var key = Object.keys(d)[0]; 16922 var value = d[key]; 16923 return { 16924 supported: key, 16925 desired: value._desired, 16926 distance: +value._distance, 16927 oneway: value.oneway === 'true' ? true : false, 16928 }; 16929 }, {}); 16930 PROCESSED_DATA = { 16931 matches: matches, 16932 matchVariables: matchVariables.reduce(function (all, d) { 16933 var key = Object.keys(d)[0]; 16934 var value = d[key]; 16935 all[key.slice(1)] = value._value.split('+'); 16936 return all; 16937 }, {}), 16938 paradigmLocales: (0,tslib_es6.__spreadArray)((0,tslib_es6.__spreadArray)([], paradigmLocales, true), paradigmLocales.map(function (l) { 16939 return new Intl.Locale(l.replace(/_/g, '-')).maximize().toString(); 16940 }), true), 16941 }; 16942 } 16943 return PROCESSED_DATA; 16944} 16945function isMatched(locale, languageMatchInfoLocale, matchVariables) { 16946 var _a = languageMatchInfoLocale.split('-'), language = _a[0], script = _a[1], region = _a[2]; 16947 var matches = true; 16948 if (region && region[0] === '$') { 16949 var shouldInclude = region[1] !== '!'; 16950 var matchRegions = shouldInclude 16951 ? matchVariables[region.slice(1)] 16952 : matchVariables[region.slice(2)]; 16953 var expandedMatchedRegions = matchRegions 16954 .map(function (r) { return regions[r] || [r]; }) 16955 .reduce(function (all, list) { return (0,tslib_es6.__spreadArray)((0,tslib_es6.__spreadArray)([], all, true), list, true); }, []); 16956 matches && (matches = !(expandedMatchedRegions.indexOf(locale.region || '') > -1 != 16957 shouldInclude)); 16958 } 16959 else { 16960 matches && (matches = locale.region 16961 ? region === '*' || region === locale.region 16962 : true); 16963 } 16964 matches && (matches = locale.script ? script === '*' || script === locale.script : true); 16965 matches && (matches = locale.language 16966 ? language === '*' || language === locale.language 16967 : true); 16968 return matches; 16969} 16970function serializeLSR(lsr) {
16971 return [lsr.language, lsr.script, lsr.region].filter(Boolean).join('-'); 16972} 16973function findMatchingDistanceForLSR(desired, supported, data) { 16974 for (var _i = 0, _a = data.matches; _i < _a.length; _i++) { 16975 var d = _a[_i]; 16976 var matches = isMatched(desired, d.desired, data.matchVariables) && 16977 isMatched(supported, d.supported, data.matchVariables); 16978 if (!d.oneway && !matches) { 16979 matches = 16980 isMatched(desired, d.supported, data.matchVariables) && 16981 isMatched(supported, d.desired, data.matchVariables); 16982 } 16983 if (matches) { 16984 var distance = d.distance * 10; 16985 if (data.paradigmLocales.indexOf(serializeLSR(desired)) > -1 != 16986 data.paradigmLocales.indexOf(serializeLSR(supported)) > -1) { 16987 return distance - 1; 16988 } 16989 return distance; 16990 } 16991 } 16992 throw new Error('No matching distance found'); 16993} 16994function findMatchingDistance(desired, supported) { 16995 var desiredLocale = new Intl.Locale(desired).maximize(); 16996 var supportedLocale = new Intl.Locale(supported).maximize(); 16997 var desiredLSR = { 16998 language: desiredLocale.language, 16999 script: desiredLocale.script || '', 17000 region: desiredLocale.region || '', 17001 }; 17002 var supportedLSR = { 17003 language: supportedLocale.language, 17004 script: supportedLocale.script || '', 17005 region: supportedLocale.region || '', 17006 }; 17007 var matchingDistance = 0; 17008 var data = processData(); 17009 if (desiredLSR.language !== supportedLSR.language) { 17010 matchingDistance += findMatchingDistanceForLSR({ 17011 language: desiredLocale.language, 17012 script: '', 17013 region: '', 17014 }, { 17015 language: supportedLocale.language, 17016 script: '', 17017 region: '', 17018 }, data); 17019 } 17020 if (desiredLSR.script !== supportedLSR.script) { 17021 matchingDistance += findMatchingDistanceForLSR({ 17022 language: desiredLocale.language, 17023 script: desiredLSR.script, 17024 region: '', 17025 }, { 17026 language: supportedLocale.language, 17027 script: supportedLSR.script, 17028 region: '', 17029 }, data); 17030 } 17031 if (desiredLSR.region !== supportedLSR.region) { 17032 matchingDistance += findMatchingDistanceForLSR(desiredLSR, supportedLSR, data); 17033 } 17034 return matchingDistance; 17035} 17036function findBestMatch(requestedLocales, supportedLocales, threshold) { 17037 if (threshold === void 0) { threshold = DEFAULT_MATCHING_THRESHOLD; } 17038 var lowestDistance = Infinity; 17039 var result = { 17040 matchedDesiredLocale: '', 17041 distances: {}, 17042 }; 17043 requestedLocales.forEach(function (desired, i) { 17044 if (!result.distances[desired]) { 17045 result.distances[desired] = {}; 17046 } 17047 supportedLocales.forEach(function (supported) { 17048 // Add some weight to the distance based on the order of the supported locales 17049 // Add penalty for the order of the requested locales, which currently is 0 since ECMA-402 17050 // doesn't really have room for weighted locales like `en; q=0.1` 17051 var distance = findMatchingDistance(desired, supported) + 0 + i * 40; 17052 result.distances[desired][supported] = distance; 17053 if (distance < lowestDistance) { 17054 lowestDistance = distance; 17055 result.matchedDesiredLocale = desired; 17056 result.matchedSupportedLocale = supported; 17057 } 17058 }); 17059 }); 17060 if (lowestDistance >= threshold) { 17061 result.matchedDesiredLocale = undefined; 17062 result.matchedSupportedLocale = undefined; 17063 } 17064 return result; 17065} 17066 17067;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/BestFitMatcher.js 17068 17069/** 17070 * https://tc39.es/ecma402/#sec-bestfitmatcher 17071 * @param availableLocales 17072 * @param requestedLocales 17073 * @param getDefaultLocale 17074 */ 17075function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) { 17076 var foundLocale; 17077 var extension; 17078 var noExtensionLocales = []; 17079 var noExtensionLocaleMap = requestedLocales.reduce(function (all, l) { 17080 var noExtensionLocale = l.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, ''); 17081 noExtensionLocales.push(noExtensionLocale); 17082 all[noExtensionLocale] = l; 17083 return all; 17084 }, {}); 17085 var result = findBestMatch(noExtensionLocales, availableLocales); 17086 if (result.matchedSupportedLocale && result.matchedDesiredLocale) { 17087 foundLocale = result.matchedSupportedLocale; 17088 extension = 17089 noExtensionLocaleMap[result.matchedDesiredLocale].slice(result.matchedDesiredLocale.length) || undefined; 17090 } 17091 if (!foundLocale) { 17092 return { locale: getDefaultLocale() }; 17093 } 17094 return { 17095 locale: foundLocale, 17096 extension: extension, 17097 }; 17098} 17099 17100;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/CanonicalizeUValue.js 17101 17102function CanonicalizeUValue(ukey, uvalue) { 17103 // TODO: Implement algorithm for CanonicalizeUValue per https://tc39.es/ecma402/#sec-canonicalizeuvalue 17104 var lowerValue = uvalue.toLowerCase(); 17105 invariant(ukey !== undefined, "ukey must be defined"); 17106 var canonicalized = lowerValue; 17107 return canonicalized; 17108} 17109 17110;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/CanonicalizeUnicodeLocaleId.js 17111function CanonicalizeUnicodeLocaleId(locale) { 17112 return Intl.getCanonicalLocales(locale)[0]; 17113} 17114 17115;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/InsertUnicodeExtensionAndCanonicalize.js 17116 17117 17118function InsertUnicodeExtensionAndCanonicalize(locale, attributes, keywords) { 17119 invariant(locale.indexOf('-u-') === -1, 'Expected locale to not have a Unicode locale extension'); 17120 var extension = '-u'; 17121 for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) { 17122 var attr = attributes_1[_i]; 17123 extension += "-".concat(attr); 17124 } 17125 for (var _a = 0, keywords_1 = keywords; _a < keywords_1.length; _a++) { 17126 var kw = keywords_1[_a]; 17127 var key = kw.key, value = kw.value; 17128 extension += "-".concat(key); 17129 if (value !== '') { 17130 extension += "-".concat(value); 17131 } 17132 } 17133 if (extension === '-u') { 17134 return CanonicalizeUnicodeLocaleId(locale); 17135 } 17136 var privateIndex = locale.indexOf('-x-'); 17137 var newLocale; 17138 if (privateIndex === -1) { 17139 newLocale = locale + extension; 17140 } 17141 else { 17142 var preExtension = locale.slice(0, privateIndex); 17143 var postExtension = locale.slice(privateIndex); 17144 newLocale = preExtension + extension + postExtension; 17145 } 17146 return CanonicalizeUnicodeLocaleId(newLocale); 17147} 17148 17149;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/BestAvailableLocale.js 17150/** 17151 * https://tc39.es/ecma402/#sec-bestavailablelocale 17152 * @param availableLocales 17153 * @param locale 17154 */ 17155function BestAvailableLocale(availableLocales, locale) { 17156 var candidate = locale; 17157 while (true) { 17158 if (availableLocales.indexOf(candidate) > -1) { 17159 return candidate; 17160 } 17161 var pos = candidate.lastIndexOf('-'); 17162 if (!~pos) { 17163 return undefined; 17164 } 17165 if (pos >= 2 && candidate[pos - 2] === '-') { 17166 pos -= 2; 17167 } 17168 candidate = candidate.slice(0, pos); 17169 } 17170} 17171 17172;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/LookupMatcher.js 17173 17174 17175/** 17176 * https://tc39.es/ecma402/#sec-lookupmatcher 17177 * @param availableLocales 17178 * @param requestedLocales 17179 * @param getDefaultLocale 17180 */ 17181function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) { 17182 var result = { locale: '' }; 17183 for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) { 17184 var locale = requestedLocales_1[_i]; 17185 var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, ''); 17186 var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale); 17187 if (availableLocale) { 17188 result.locale = availableLocale; 17189 if (locale !== noExtensionLocale) { 17190 result.extension = locale.slice(noExtensionLocale.length, locale.length); 17191 } 17192 return result; 17193 } 17194 } 17195 result.locale = getDefaultLocale(); 17196 return result; 17197} 17198 17199;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/UnicodeExtensionComponents.js 17200 17201function UnicodeExtensionComponents(extension) { 17202 invariant(extension === extension.toLowerCase(), 'Expected extension to be lowercase'); 17203 invariant(extension.slice(0, 3) === '-u-', 'Expected extension to be a Unicode locale extension'); 17204 var attributes = []; 17205 var keywords = []; 17206 var keyword; 17207 var size = extension.length; 17208 var k = 3; 17209 while (k < size) { 17210 var e = extension.indexOf('-', k); 17211 var len = void 0; 17212 if (e === -1) { 17213 len = size - k; 17214 } 17215 else { 17216 len = e - k; 17217 } 17218 var subtag = extension.slice(k, k + len); 17219 invariant(len >= 2, 'Expected a subtag to have at least 2 characters'); 17220 if (keyword === undefined && len != 2) { 17221 if (attributes.indexOf(subtag) === -1) { 17222 attributes.push(subtag); 17223 } 17224 } 17225 else if (len === 2) { 17226 keyword = { key: subtag, value: '' }; 17227 if (keywords.find(function (k) { return k.key === (keyword === null ||
17227keyword === void 0 ? void 0 : keyword.key); }) === undefined) { 17228 keywords.push(keyword); 17229 } 17230 } 17231 else if ((keyword === null || keyword === void 0 ? void 0 : keyword.value) === '') { 17232 keyword.value = subtag; 17233 } 17234 else { 17235 invariant(keyword !== undefined, 'Expected keyword to be defined'); 17236 keyword.value += '-' + subtag; 17237 } 17238 k += len + 1; 17239 } 17240 return { attributes: attributes, keywords: keywords }; 17241} 17242 17243;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/ResolveLocale.js 17244 17245 17246 17247 17248 17249 17250/** 17251 * https://tc39.es/ecma402/#sec-resolvelocale 17252 */ 17253function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) { 17254 var _a; 17255 var matcher = options.localeMatcher; 17256 var r; 17257 if (matcher === 'lookup') { 17258 r = LookupMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale); 17259 } 17260 else { 17261 r = BestFitMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale); 17262 } 17263 if (r == null) { 17264 r = { 17265 locale: getDefaultLocale(), 17266 extension: '', 17267 }; 17268 } 17269 var foundLocale = r.locale; 17270 var foundLocaleData = localeData[foundLocale]; 17271 // TODO: We can't really guarantee that the locale data is available 17272 // invariant( 17273 // foundLocaleData !== undefined, 17274 // `Missing locale data for ${foundLocale}` 17275 // ) 17276 var result = { locale: 'en', dataLocale: foundLocale }; 17277 var components; 17278 var keywords; 17279 if (r.extension) { 17280 components = UnicodeExtensionComponents(r.extension); 17281 keywords = components.keywords; 17282 } 17283 else { 17284 keywords = []; 17285 } 17286 var supportedKeywords = []; 17287 var _loop_1 = function (key) { 17288 // TODO: Shouldn't default to empty array, see TODO above 17289 var keyLocaleData = (_a = foundLocaleData === null || foundLocaleData === void 0 ? void 0 : foundLocaleData[key]) !== null && _a !== void 0 ? _a : []; 17290 invariant(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array")); 17291 var value = keyLocaleData[0]; 17292 invariant(value === undefined || typeof value === 'string', "value must be a string or undefined"); 17293 var supportedKeyword = void 0; 17294 var entry = keywords.find(function (k) { return k.key === key; }); 17295 if (entry) { 17296 var requestedValue = entry.value; 17297 if (requestedValue !== '') { 17298 if (keyLocaleData.indexOf(requestedValue) > -1) { 17299 value = requestedValue; 17300 supportedKeyword = { 17301 key: key, 17302 value: value, 17303 }; 17304 } 17305 } 17306 else if (keyLocaleData.indexOf('true') > -1) { 17307 value = 'true'; 17308 supportedKeyword = { 17309 key: key, 17310 value: value, 17311 }; 17312 } 17313 } 17314 var optionsValue = options[key]; 17315 invariant(optionsValue == null || typeof optionsValue === 'string', "optionsValue must be a string or undefined"); 17316 if (typeof optionsValue === 'string') { 17317 var ukey = key.toLowerCase(); 17318 optionsValue = CanonicalizeUValue(ukey, optionsValue); 17319 if (optionsValue === '') { 17320 optionsValue = 'true'; 17321 } 17322 } 17323 if (optionsValue !== value && keyLocaleData.indexOf(optionsValue) > -1) { 17324 value = optionsValue; 17325 supportedKeyword = undefined; 17326 } 17327 if (supportedKeyword) { 17328 supportedKeywords.push(supportedKeyword); 17329 } 17330 result[key] = value; 17331 }; 17332 for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) { 17333 var key = relevantExtensionKeys_1[_i]; 17334 _loop_1(key); 17335 } 17336 var supportedAttributes = []; 17337 if (supportedKeywords.length > 0) { 17338 supportedAttributes = []; 17339 foundLocale = InsertUnicodeExtensionAndCanonicalize(foundLocale, supportedAttributes, supportedKeywords); 17340 } 17341 result.locale = foundLocale; 17342 return result; 17343} 17344 17345;// ./node_modules/@formatjs/intl-localematcher/lib/abstract/LookupSupportedLocales.js 17346 17347 17348/** 17349 * https://tc39.es/ecma402/#sec-lookupsupportedlocales 17350 * @param availableLocales 17351 * @param requestedLocales 17352 */ 17353function LookupSupportedLocales(availableLocales, requestedLocales) { 17354 var subset = []; 17355 for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) { 17356 var locale = requestedLocales_1[_i]; 17357 var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, ''); 17358 var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale); 17359 if (availableLocale) { 17360 subset.push(availableLocale); 17361 } 17362 } 17363 return subset; 17364} 17365 17366;// ./node_modules/@formatjs/intl-localematcher/lib/index.js 17367 17368 17369function match(requestedLocales, availableLocales, defaultLocale, opts) { 17370 return ResolveLocale(availableLocales, CanonicalizeLocaleList(requestedLocales), { 17371 localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || 'best fit', 17372 }, [], {}, function () { return defaultLocale; }).locale; 17373} 17374 17375 17376 17377 17378/***/ }, 17379 17380/***/ 75326 17381(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 17382 17383"use strict"; 17384/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17385/* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__), 17386/* harmony export */ ai: () => (/* binding */ loadableReady) 17387/* harmony export */ });
17388/* unused harmony exports __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, lazy */ 17389/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 17390/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40644); 17391/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55285); 17392/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(62720); 17393/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(48298); 17394/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4146); 17395/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5__); 17396 17397 17398 17399 17400 17401 17402 17403/* eslint-disable import/prefer-default-export */ 17404function invariant(condition, message) { 17405 if (condition) return; 17406 var error = new Error("loadable: " + message); 17407 error.framesToPop = 1; 17408 error.name = 'Invariant Violation'; 17409 throw error; 17410} 17411function warn(message) { 17412 // eslint-disable-next-line no-console 17413 console.warn("loadable: " + message); 17414} 17415 17416var Context = /*#__PURE__*/ 17417react__WEBPACK_IMPORTED_MODULE_0__.createContext(); 17418 17419var LOADABLE_REQUIRED_CHUNKS_KEY = '__LOADABLE_REQUIRED_CHUNKS__'; 17420function getRequiredChunkKey(namespace) { 17421 return "" + namespace + LOADABLE_REQUIRED_CHUNKS_KEY; 17422} 17423 17424var sharedInternals = /*#__PURE__*/Object.freeze({ 17425 __proto__: null, 17426 getRequiredChunkKey: getRequiredChunkKey, 17427 invariant: invariant, 17428 Context: Context 17429}); 17430 17431var LOADABLE_SHARED = { 17432 initialChunks: {} 17433}; 17434 17435var STATUS_PENDING = 'PENDING'; 17436var STATUS_RESOLVED = 'RESOLVED'; 17437var STATUS_REJECTED = 'REJECTED'; 17438 17439function resolveConstructor(ctor) { 17440 if (typeof ctor === 'function') { 17441 return { 17442 requireAsync: ctor, 17443 resolve: function resolve() { 17444 return undefined; 17445 }, 17446 chunkName: function chunkName() { 17447 return undefined; 17448 } 17449 }; 17450 } 17451 17452 return ctor; 17453} 17454 17455var withChunkExtractor = function withChunkExtractor(Component) { 17456 var LoadableWithChunkExtractor = function LoadableWithChunkExtractor(props) { 17457 return react__WEBPACK_IMPORTED_MODULE_0__.createElement(Context.Consumer, null, function (extractor) { 17458 return react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, Object.assign({ 17459 __chunkExtractor: extractor 17460 }, props)); 17461 }); 17462 }; 17463 17464 if (Component.displayName) { 17465 LoadableWithChunkExtractor.displayName = Component.displayName + "WithChunkExtractor"; 17466 } 17467 17468 return LoadableWithChunkExtractor; 17469}; 17470 17471var identity = function identity(v) { 17472 return v; 17473}; 17474 17475function createLoadable(_ref) { 17476 var _ref$defaultResolveCo = _ref.defaultResolveComponent, 17477 defaultResolveComponent = _ref$defaultResolveCo === void 0 ? identity : _ref$defaultResolveCo, 17478 _render = _ref.render, 17479 onLoad = _ref.onLoad; 17480 17481 function loadable(loadableConstructor, options) { 17482 if (options === void 0) { 17483 options = {}; 17484 } 17485 17486 var ctor = resolveConstructor(loadableConstructor); 17487 var cache = {}; 17488 /** 17489 * Cachekey represents the component to be loaded 17490 * if key changes - component has to be reloaded 17491 * @param props 17492 * @returns {null|Component} 17493 */ 17494 17495 function _getCacheKey(props) { 17496 if (options.cacheKey) { 17497 return options.cacheKey(props); 17498 } 17499 17500 if (ctor.resolve) { 17501 return ctor.resolve(props); 17502 } 17503 17504 return 'static'; 17505 } 17506 /** 17507 * Resolves loaded `module` to a specific `Component 17508 * @param module 17509 * @param props 17510 * @param Loadable 17511 * @returns Component 17512 */ 17513 17514 17515 function resolve(module, props, Loadable) { 17516 var Component = options.resolveComponent ? options.resolveComponent(module, props) : defaultResolveComponent(module); // FIXME: suppressed due to https://github.com/gregberge/loadable-components/issues/990 17517 // if (options.resolveComponent && !ReactIs.isValidElementType(Component)) { 17518 // throw new Error( 17519 // `resolveComponent returned something that is not a React component!`, 17520 // ) 17521 // } 17522 17523 hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5___default()(Loadable, Component, { 17524 preload: true 17525 }); 17526 return Component; 17527 } 17528 17529 var cachedLoad = function cachedLoad(props) { 17530 var cacheKey = _getCacheKey(props); 17531 17532 var promise = cache[cacheKey]; 17533 17534 if (!promise || promise.status === STATUS_REJECTED) { 17535 promise = ctor.requireAsync(props); 17536 promise.status = STATUS_PENDING; 17537 cache[cacheKey] = promise; 17538 promise.then(function () { 17539 promise.status = STATUS_RESOLVED; 17540 }, function (error) { 17541 console.error('loadable-components: failed to asynchronously load component', { 17542 fileName: ctor.resolve(props), 17543 chunkName: ctor.chunkName(props), 17544 error: error ? error.message : error 17545 }); 17546 promise.status = STATUS_REJECTED; 17547 }); 17548 } 17549 17550 return promise; 17551 }; 17552 17553 var InnerLoadable = 17554 /*#__PURE__*/ 17555 function (_React$Component) { 17556 (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(InnerLoadable, _React$Component); 17557 17558 InnerLoadable.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) { 17559 var cacheKey = _getCacheKey(props); 17560 17561 return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)({}, state, { 17562 cacheKey: cacheKey, 17563 // change of a key triggers loading state automatically 17564 loading: state.loading || state.cacheKey !== cacheKey 17565 }); 17566 }; 17567 17568 function InnerLoadable(props) { 17569 var _this; 17570 17571 _this = _React$Component.call(this, props) || this; 17572 _this.state = { 17573 result: null, 17574 error: null, 17575 loading: true, 17576 cacheKey: _getCacheKey(props) 17577 }; 17578 invariant(!props.__chunkExtractor || ctor.requireSync, 'SSR requires `@loadable/babel-plugin`, please install it'); // Server-side 17579 17580 if (props.__chunkExtractor) {
17581 // This module has been marked with no SSR 17582 if (options.ssr === false) { 17583 return (0,_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(_this); 17584 } // We run load function, we assume that it won't fail and that it 17585 // triggers a synchronous loading of the module 17586 17587 17588 ctor.requireAsync(props)["catch"](function () { 17589 return null; 17590 }); // So we can require now the module synchronously 17591 17592 _this.loadSync(); 17593 17594 props.__chunkExtractor.addChunk(ctor.chunkName(props)); 17595 17596 return (0,_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(_this); 17597 } // Client-side with `isReady` method present (SSR probably) 17598 // If module is already loaded, we use a synchronous loading 17599 // Only perform this synchronous loading if the component has not 17600 // been marked with no SSR, else we risk hydration mismatches 17601 17602 17603 if (options.ssr !== false && ( // is ready - was loaded in this session 17604 ctor.isReady && ctor.isReady(props) || // is ready - was loaded during SSR process 17605 ctor.chunkName && LOADABLE_SHARED.initialChunks[ctor.chunkName(props)])) { 17606 _this.loadSync(); 17607 } 17608 17609 return _this; 17610 } 17611 17612 var _proto = InnerLoadable.prototype; 17613 17614 _proto.componentDidMount = function componentDidMount() { 17615 this.mounted = true; // retrieve loading promise from a global cache 17616 17617 var cachedPromise = this.getCache(); // if promise exists, but rejected - clear cache 17618 17619 if (cachedPromise && cachedPromise.status === STATUS_REJECTED) { 17620 this.setCache(); 17621 } // component might be resolved synchronously in the constructor 17622 17623 17624 if (this.state.loading) { 17625 this.loadAsync(); 17626 } 17627 }; 17628 17629 _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) { 17630 // Component has to be reloaded on cacheKey change 17631 if (prevState.cacheKey !== this.state.cacheKey) { 17632 this.loadAsync(); 17633 } 17634 }; 17635 17636 _proto.componentWillUnmount = function componentWillUnmount() { 17637 this.mounted = false; 17638 }; 17639 17640 _proto.safeSetState = function safeSetState(nextState, callback) { 17641 if (this.mounted) { 17642 this.setState(nextState, callback); 17643 } 17644 } 17645 /** 17646 * returns a cache key for the current props 17647 * @returns {Component|string} 17648 */ 17649 ; 17650 17651 _proto.getCacheKey = function getCacheKey() { 17652 return _getCacheKey(this.props); 17653 } 17654 /** 17655 * access the persistent cache 17656 */ 17657 ; 17658 17659 _proto.getCache = function getCache() { 17660 return cache[this.getCacheKey()]; 17661 } 17662 /** 17663 * sets the cache value. If called without value sets it as undefined 17664 */ 17665 ; 17666 17667 _proto.setCache = function setCache(value) { 17668 if (value === void 0) { 17669 value = undefined; 17670 } 17671 17672 cache[this.getCacheKey()] = value; 17673 }; 17674 17675 _proto.triggerOnLoad = function triggerOnLoad() { 17676 var _this2 = this; 17677 17678 if (onLoad) { 17679 setTimeout(function () { 17680 onLoad(_this2.state.result, _this2.props); 17681 }); 17682 } 17683 } 17684 /** 17685 * Synchronously loads component 17686 * target module is expected to already exists in the module cache 17687 * or be capable to resolve synchronously (webpack target=node) 17688 */ 17689 ; 17690 17691 _proto.loadSync = function loadSync() { 17692 // load sync is expecting component to be in the "loading" state already 17693 // sounds weird, but loading=true is the initial state of InnerLoadable 17694 if (!this.state.loading) return; 17695 17696 try { 17697 var loadedModule = ctor.requireSync(this.props); 17698 var result = resolve(loadedModule, this.props, Loadable); 17699 this.state.result = result; 17700 this.state.loading = false; 17701 } catch (error) { 17702 console.error('loadable-components: failed to synchronously load component, which expected to be available', { 17703 fileName: ctor.resolve(this.props), 17704 chunkName: ctor.chunkName(this.props), 17705 error: error ? error.message : error 17706 }); 17707 this.state.error = error; 17708 } 17709 } 17710 /** 17711 * Asynchronously loads a component. 17712 */ 17713 ; 17714 17715 _proto.loadAsync = function loadAsync() { 17716 var _this3 = this; 17717 17718 var promise = this.resolveAsync(); 17719 promise.then(function (loadedModule) { 17720 var result = resolve(loadedModule, _this3.props, Loadable); 17721 17722 _this3.safeSetState({ 17723 result: result, 17724 loading: false 17725 }, function () { 17726 return _this3.triggerOnLoad(); 17727 }); 17728 })["catch"](function (error) { 17729 return _this3.safeSetState({ 17730 error: error, 17731 loading: false 17732 }); 17733 }); 17734 return promise; 17735 } 17736 /** 17737 * Asynchronously resolves(not loads) a component. 17738 * Note - this function does not change the state 17739 */ 17740 ; 17741 17742 _proto.resolveAsync = function resolveAsync() { 17743 var _this$props = this.props, 17744 __chunkExtractor = _this$props.__chunkExtractor, 17745 forwardedRef = _this$props.forwardedRef, 17746 props = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(_this$props, ["__chunkExtractor", "forwardedRef"]); 17747 17748 return cachedLoad(props); 17749 }; 17750 17751 _proto.render = function render() { 17752 var _this$props2 = this.props, 17753 forwardedRef = _this$props2.forwardedRef, 17754 propFallback = _this$props2.fallback, 17755 __chunkExtractor = _this$props2.__chunkExtractor, 17756 props = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(_this$props2, ["forwardedRef", "fallback", "__chunkExtractor"]); 17757 17758 var _this$state = this.state, 17759 error = _this$state.error, 17760 loading = _this$state.loading, 17761 result = _this$state.result; 17762 17763 if (options.suspense) {
17764 var cachedPromise = this.getCache() || this.loadAsync(); 17765 17766 if (cachedPromise.status === STATUS_PENDING) { 17767 throw this.loadAsync(); 17768 } 17769 } 17770 17771 if (error) { 17772 throw error; 17773 } 17774 17775 var fallback = propFallback || options.fallback || null; 17776 17777 if (loading) { 17778 return fallback; 17779 } 17780 17781 return _render({ 17782 fallback: fallback, 17783 result: result, 17784 options: options, 17785 props: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)({}, props, { 17786 ref: forwardedRef 17787 }) 17788 }); 17789 }; 17790 17791 return InnerLoadable; 17792 }(react__WEBPACK_IMPORTED_MODULE_0__.Component); 17793 17794 var EnhancedInnerLoadable = withChunkExtractor(InnerLoadable); 17795 var Loadable = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function (props, ref) { 17796 return react__WEBPACK_IMPORTED_MODULE_0__.createElement(EnhancedInnerLoadable, Object.assign({ 17797 forwardedRef: ref 17798 }, props)); 17799 }); 17800 Loadable.displayName = 'Loadable'; // In future, preload could use `<link rel="preload">` 17801 17802 Loadable.preload = function (props) { 17803 Loadable.load(props); 17804 }; 17805 17806 Loadable.load = function (props) { 17807 return cachedLoad(props); 17808 }; 17809 17810 return Loadable; 17811 } 17812 17813 function lazy(ctor, options) { 17814 return loadable(ctor, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)({}, options, { 17815 suspense: true 17816 })); 17817 } 17818 17819 return { 17820 loadable: loadable, 17821 lazy: lazy 17822 }; 17823} 17824 17825function defaultResolveComponent(loadedModule) { 17826 // eslint-disable-next-line no-underscore-dangle 17827 return loadedModule.__esModule ? loadedModule["default"] : loadedModule["default"] || loadedModule; 17828} 17829 17830/* eslint-disable no-use-before-define, react/no-multi-comp */ 17831 17832var _createLoadable = 17833/*#__PURE__*/ 17834createLoadable({ 17835 defaultResolveComponent: defaultResolveComponent, 17836 render: function render(_ref) { 17837 var Component = _ref.result, 17838 props = _ref.props; 17839 return react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, props); 17840 } 17841}), 17842 loadable = _createLoadable.loadable, 17843 lazy = _createLoadable.lazy; 17844 17845/* eslint-disable no-use-before-define, react/no-multi-comp */ 17846 17847var _createLoadable$1 = 17848/*#__PURE__*/ 17849createLoadable({ 17850 onLoad: function onLoad(result, props) { 17851 if (result && props.forwardedRef) { 17852 if (typeof props.forwardedRef === 'function') { 17853 props.forwardedRef(result); 17854 } else { 17855 props.forwardedRef.current = result; 17856 } 17857 } 17858 }, 17859 render: function render(_ref) { 17860 var result = _ref.result, 17861 props = _ref.props; 17862 17863 if (props.children) { 17864 return props.children(result); 17865 } 17866 17867 return null; 17868 } 17869}), 17870 loadable$1 = _createLoadable$1.loadable, 17871 lazy$1 = _createLoadable$1.lazy; 17872 17873/* eslint-disable no-underscore-dangle, camelcase */ 17874var BROWSER = typeof window !== 'undefined'; 17875function loadableReady(done, _temp) { 17876 if (done === void 0) { 17877 done = function done() {}; 17878 } 17879 17880 var _ref = _temp === void 0 ? {} : _temp, 17881 _ref$namespace = _ref.namespace, 17882 namespace = _ref$namespace === void 0 ? '' : _ref$namespace, 17883 _ref$chunkLoadingGlob = _ref.chunkLoadingGlobal, 17884 chunkLoadingGlobal = _ref$chunkLoadingGlob === void 0 ? '__LOADABLE_LOADED_CHUNKS__' : _ref$chunkLoadingGlob; 17885 17886 if (!BROWSER) { 17887 warn('`loadableReady()` must be called in browser only'); 17888 done(); 17889 return Promise.resolve(); 17890 } 17891 17892 var requiredChunks = null; 17893 17894 if (BROWSER) { 17895 var id = getRequiredChunkKey(namespace); 17896 var dataElement = document.getElementById(id); 17897 17898 if (dataElement) { 17899 requiredChunks = JSON.parse(dataElement.textContent); 17900 var extElement = document.getElementById(id + "_ext"); 17901 17902 if (extElement) { 17903 var _JSON$parse = JSON.parse(extElement.textContent), 17904 namedChunks = _JSON$parse.namedChunks; 17905 17906 namedChunks.forEach(function (chunkName) { 17907 LOADABLE_SHARED.initialChunks[chunkName] = true; 17908 }); 17909 } else { 17910 // version mismatch 17911 throw new Error('loadable-component: @loadable/server does not match @loadable/component'); 17912 } 17913 } 17914 } 17915 17916 if (!requiredChunks) { 17917 warn('`loadableReady()` requires state, please use `getScriptTags` or `getScriptElements` server-side'); 17918 done(); 17919 return Promise.resolve(); 17920 } 17921 17922 var resolved = false;
17923 return new Promise(function (resolve) { 17924 window[chunkLoadingGlobal] = window[chunkLoadingGlobal] || []; 17925 var loadedChunks = window[chunkLoadingGlobal]; 17926 var originalPush = loadedChunks.push.bind(loadedChunks); 17927 17928 function checkReadyState() { 17929 if (requiredChunks.every(function (chunk) { 17930 return loadedChunks.some(function (_ref2) { 17931 var chunks = _ref2[0]; 17932 return chunks.indexOf(chunk) > -1; 17933 }); 17934 })) { 17935 if (!resolved) { 17936 resolved = true; 17937 resolve(); 17938 } 17939 } 17940 } 17941 17942 loadedChunks.push = function () { 17943 originalPush.apply(void 0, arguments); 17944 checkReadyState(); 17945 }; 17946 17947 checkReadyState(); 17948 }).then(done); 17949} 17950 17951/* eslint-disable no-underscore-dangle */ 17952var loadable$2 = loadable; 17953loadable$2.lib = loadable$1; 17954var lazy$2 = lazy; 17955lazy$2.lib = lazy$1; 17956var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = (/* unused pure expression or super */ null && (sharedInternals)); 17957 17958/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (loadable$2); 17959 17960 17961 17962/***/ }, 17963 17964/***/ 28424 17965(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 17966 17967"use strict"; 17968/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17969/* harmony export */ $: () => (/* binding */ all), 17970/* harmony export */ A: () => (/* binding */ ALL), 17971/* harmony export */ B: () => (/* binding */ compose), 17972/* harmony export */ C: () => (/* binding */ CALL), 17973/* harmony export */ D: () => (/* binding */ logError), 17974/* harmony export */ E: () => (/* binding */ wrapSagaDispatch), 17975/* harmony export */ F: () => (/* binding */ FORK), 17976/* harmony export */ G: () => (/* binding */ GET_CONTEXT), 17977/* harmony export */ H: () => (/* binding */ identity), 17978/* harmony export */ J: () => (/* binding */ JOIN), 17979/* harmony export */ L: () => (/* binding */ take), 17980/* harmony export */ M: () => (/* binding */ fork), 17981/* harmony export */ N: () => (/* binding */ cancel), 17982/* harmony export */ O: () => (/* binding */ call), 17983/* harmony export */ P: () => (/* binding */ PUT), 17984/* harmony export */ R: () => (/* binding */ RACE), 17985/* harmony export */ S: () => (/* binding */ SELECT), 17986/* harmony export */ T: () => (/* binding */ TAKE), 17987/* harmony export */ Z: () => (/* binding */ put), 17988/* harmony export */ a: () => (/* binding */ CPS), 17989/* harmony export */ a4: () => (/* binding */ select), 17990/* harmony export */ a5: () => (/* binding */ cancelled), 17991/* harmony export */ b: () => (/* binding */ CANCEL), 17992/* harmony export */ d: () => (/* binding */ ACTION_CHANNEL), 17993/* harmony export */ e: () => (/* binding */ expanding), 17994/* harmony export */ f: () => (/* binding */ CANCELLED), 17995/* harmony export */ g: () => (/* binding */ FLUSH), 17996/* harmony export */ h: () => (/* binding */ SET_CONTEXT), 17997/* harmony export */ i: () => (/* binding */ internalErr), 17998/* harmony export */ j: () => (/* binding */ getMetaInfo), 17999/* harmony export */ k: () => (/* binding */ kTrue), 18000/* harmony export */ l: () => (/* binding */ createAllStyleChildCallbacks), 18001/* harmony export */ m: () => (/* binding */ createEmptyArray), 18002/* harmony export */ n: () => (/* binding */ none), 18003/* harmony export */ o: () => (/* binding */ once), 18004/* harmony export */ p: () => (/* binding */ assignWithSymbols), 18005/* harmony export */ q: () => (/* binding */ makeIterator), 18006/* harmony export */ r: () => (/* binding */ remove), 18007/* harmony export */ s: () => (/* binding */ shouldComplete), 18008/* harmony export */ t: () => (/* binding */ noop), 18009/* harmony export */ u: () => (/* binding */ flatMap), 18010/* harmony export */ v: () => (/* binding */ getLocation), 18011/* harmony export */ y: () => (/* binding */ shouldCancel), 18012/* harmony export */ z: () => (/* binding */ shouldTerminate) 18013/* harmony export */ }); 18014/* unused harmony exports I, K, Q, U, V, W, X, Y, _, a0, a1, a2, a3, a6, a7, a8, c, w, x */ 18015/* unused harmony import specifier */ var _extends; 18016/* unused harmony import specifier */ var effect; 18017/* unused harmony import specifier */ var notUndef; 18018/* unused harmony import specifier */ var func; 18019/* unused harmony import specifier */ var array; 18020/* unused harmony import specifier */ var object; 18021/* unused harmony import specifier */ var string; 18022/* unused harmony import specifier */ var delayP; 18023/* harmony import */ var _redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63821); 18024/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55285); 18025/* harmony import */ var _redux_saga_is__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21225); 18026 18027 18028 18029 18030 18031var konst = function konst(v) { 18032 return function () { 18033 return v; 18034 }; 18035}; 18036var kTrue = 18037/*#__PURE__*/ 18038konst(true); 18039 18040var noop = function noop() {}; 18041 18042if (false) // removed by dead control flow 18043{} 18044var identity = function identity(v) { 18045 return v; 18046}; 18047var hasSymbol = typeof Symbol === 'function'; 18048var asyncIteratorSymbol = hasSymbol && Symbol.asyncIterator ? Symbol.asyncIterator : '@@asyncIterator'; 18049function check(value, predicate, error) { 18050 if (!predicate(value)) { 18051 throw new Error(error); 18052 } 18053}
18054var assignWithSymbols = function assignWithSymbols(target, source) { 18055 (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(target, source); 18056 18057 if (Object.getOwnPropertySymbols) { 18058 Object.getOwnPropertySymbols(source).forEach(function (s) { 18059 target[s] = source[s]; 18060 }); 18061 } 18062}; 18063var flatMap = function flatMap(mapper, arr) { 18064 var _ref; 18065 18066 return (_ref = []).concat.apply(_ref, arr.map(mapper)); 18067}; 18068function remove(array, item) { 18069 var index = array.indexOf(item); 18070 18071 if (index >= 0) { 18072 array.splice(index, 1); 18073 } 18074} 18075function once(fn) { 18076 var called = false; 18077 return function () { 18078 if (called) { 18079 return; 18080 } 18081 18082 called = true; 18083 fn(); 18084 }; 18085} 18086 18087var kThrow = function kThrow(err) { 18088 throw err; 18089}; 18090 18091var kReturn = function kReturn(value) { 18092 return { 18093 value: value, 18094 done: true 18095 }; 18096}; 18097 18098function makeIterator(next, thro, name) { 18099 if (thro === void 0) { 18100 thro = kThrow; 18101 } 18102 18103 if (name === void 0) { 18104 name = 'iterator'; 18105 } 18106 18107 var iterator = { 18108 meta: { 18109 name: name 18110 }, 18111 next: next, 18112 throw: thro, 18113 return: kReturn, 18114 isSagaIterator: true 18115 }; 18116 18117 if (typeof Symbol !== 'undefined') { 18118 iterator[Symbol.iterator] = function () { 18119 return iterator; 18120 }; 18121 } 18122 18123 return iterator; 18124} 18125function logError(error, _ref2) { 18126 var sagaStack = _ref2.sagaStack; 18127 18128 /*eslint-disable no-console*/ 18129 console.error(error); 18130 console.error(sagaStack); 18131} 18132var internalErr = function internalErr(err) { 18133 return new Error("\n redux-saga: Error checking hooks detected an inconsistent state. This is likely a bug\n in redux-saga code and not yours. Thanks for reporting this in the project's github repo.\n Error: " + err + "\n"); 18134}; 18135var createSetContextWarning = function createSetContextWarning(ctx, props) { 18136 return (ctx ? ctx + '.' : '') + "setContext(props): argument " + props + " is not a plain object"; 18137}; 18138var FROZEN_ACTION_ERROR = "You can't put (a.k.a. dispatch from saga) frozen actions.\nWe have to define a special non-enumerable property on those actions for scheduling purposes.\nOtherwise you wouldn't be able to communicate properly between sagas & other subscribers (action ordering would become far less predictable).\nIf you are using redux and you care about this behaviour (frozen actions),\nthen you might want to switch to freezing actions in a middleware rather than in action creator.\nExample implementation:\n\nconst freezeActions = store => next => action => next(Object.freeze(action))\n"; // creates empty, but not-holey array 18139 18140var createEmptyArray = function createEmptyArray(n) { 18141 return Array.apply(null, new Array(n)); 18142}; 18143var wrapSagaDispatch = function wrapSagaDispatch(dispatch) { 18144 return function (action) { 18145 if (false) // removed by dead control flow 18146{} 18147 18148 return dispatch(Object.defineProperty(action, _redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__/* .SAGA_ACTION */ .q8, { 18149 value: true 18150 })); 18151 }; 18152}; 18153var shouldTerminate = function shouldTerminate(res) { 18154 return res === _redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__/* .TERMINATE */ .a6; 18155}; 18156var shouldCancel = function shouldCancel(res) { 18157 return res === _redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__/* .TASK_CANCEL */ .nm; 18158}; 18159var shouldComplete = function shouldComplete(res) { 18160 return shouldTerminate(res) || shouldCancel(res); 18161}; 18162function createAllStyleChildCallbacks(shape, parentCallback) { 18163 var keys = Object.keys(shape); 18164 var totalCount = keys.length; 18165 18166 if (false) // removed by dead control flow 18167{} 18168 18169 var completedCount = 0; 18170 var completed; 18171 var results = (0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .array */ .YO)(shape) ? createEmptyArray(totalCount) : {}; 18172 var childCallbacks = {}; 18173 18174 function checkEnd() { 18175 if (completedCount === totalCount) { 18176 completed = true; 18177 parentCallback(results); 18178 } 18179 } 18180 18181 keys.forEach(function (key) { 18182 var chCbAtKey = function chCbAtKey(res, isErr) { 18183 if (completed) { 18184 return; 18185 } 18186 18187 if (isErr || shouldComplete(res)) { 18188 parentCallback.cancel(); 18189 parentCallback(res, isErr); 18190 } else { 18191 results[key] = res; 18192 completedCount++; 18193 checkEnd(); 18194 } 18195 }; 18196
18197 chCbAtKey.cancel = noop; 18198 childCallbacks[key] = chCbAtKey; 18199 }); 18200 18201 parentCallback.cancel = function () { 18202 if (!completed) { 18203 completed = true; 18204 keys.forEach(function (key) { 18205 return childCallbacks[key].cancel(); 18206 }); 18207 } 18208 }; 18209 18210 return childCallbacks; 18211} 18212function getMetaInfo(fn) { 18213 return { 18214 name: fn.name || 'anonymous', 18215 location: getLocation(fn) 18216 }; 18217} 18218function getLocation(instrumented) { 18219 return instrumented[_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__/* .SAGA_LOCATION */ .x2]; 18220} 18221function compose() { 18222 for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { 18223 funcs[_key] = arguments[_key]; 18224 } 18225 18226 if (funcs.length === 0) { 18227 return function (arg) { 18228 return arg; 18229 }; 18230 } 18231 18232 if (funcs.length === 1) { 18233 return funcs[0]; 18234 } 18235 18236 return funcs.reduce(function (a, b) { 18237 return function () { 18238 return a(b.apply(void 0, arguments)); 18239 }; 18240 }); 18241} 18242 18243var BUFFER_OVERFLOW = "Channel's Buffer overflow!"; 18244var ON_OVERFLOW_THROW = 1; 18245var ON_OVERFLOW_DROP = 2; 18246var ON_OVERFLOW_SLIDE = 3; 18247var ON_OVERFLOW_EXPAND = 4; 18248var zeroBuffer = { 18249 isEmpty: kTrue, 18250 put: noop, 18251 take: noop 18252}; 18253 18254function ringBuffer(limit, overflowAction) { 18255 if (limit === void 0) { 18256 limit = 10; 18257 } 18258 18259 var arr = new Array(limit); 18260 var length = 0; 18261 var pushIndex = 0; 18262 var popIndex = 0; 18263 18264 var push = function push(it) { 18265 arr[pushIndex] = it; 18266 pushIndex = (pushIndex + 1) % limit; 18267 length++; 18268 }; 18269 18270 var take = function take() { 18271 if (length != 0) { 18272 var it = arr[popIndex]; 18273 arr[popIndex] = null; 18274 length--; 18275 popIndex = (popIndex + 1) % limit; 18276 return it; 18277 } 18278 }; 18279 18280 var flush = function flush() { 18281 var items = []; 18282 18283 while (length) { 18284 items.push(take()); 18285 } 18286 18287 return items; 18288 }; 18289 18290 return { 18291 isEmpty: function isEmpty() { 18292 return length == 0; 18293 }, 18294 put: function put(it) { 18295 if (length < limit) { 18296 push(it); 18297 } else { 18298 var doubledLimit; 18299 18300 switch (overflowAction) { 18301 case ON_OVERFLOW_THROW: 18302 throw new Error(BUFFER_OVERFLOW); 18303 18304 case ON_OVERFLOW_SLIDE: 18305 arr[pushIndex] = it; 18306 pushIndex = (pushIndex + 1) % limit; 18307 popIndex = pushIndex; 18308 break; 18309 18310 case ON_OVERFLOW_EXPAND: 18311 doubledLimit = 2 * limit; 18312 arr = flush(); 18313 length = arr.length; 18314 pushIndex = arr.length; 18315 popIndex = 0; 18316 arr.length = doubledLimit; 18317 limit = doubledLimit; 18318 push(it); 18319 break; 18320 18321 default: // DROP 18322 18323 } 18324 } 18325 }, 18326 take: take, 18327 flush: flush 18328 }; 18329} 18330 18331var none = function none() { 18332 return zeroBuffer; 18333}; 18334var fixed = function fixed(limit) { 18335 return ringBuffer(limit, ON_OVERFLOW_THROW); 18336}; 18337var dropping = function dropping(limit) { 18338 return ringBuffer(limit, ON_OVERFLOW_DROP); 18339}; 18340var sliding = function sliding(limit) { 18341 return ringBuffer(limit, ON_OVERFLOW_SLIDE); 18342}; 18343var expanding = function expanding(initialSize) { 18344 return ringBuffer(initialSize, ON_OVERFLOW_EXPAND); 18345}; 18346 18347var buffers = /*#__PURE__*/Object.freeze({ 18348 __proto__: null, 18349 none: none, 18350 fixed: fixed, 18351 dropping: dropping, 18352 sliding: sliding, 18353 expanding: expanding 18354}); 18355 18356var TAKE = 'TAKE'; 18357var PUT = 'PUT'; 18358var ALL = 'ALL'; 18359var RACE = 'RACE'; 18360var CALL = 'CALL'; 18361var CPS = 'CPS'; 18362var FORK = 'FORK'; 18363var JOIN = 'JOIN'; 18364var CANCEL = 'CANCEL'; 18365var SELECT = 'SELECT'; 18366var ACTION_CHANNEL = 'ACTION_CHANNEL'; 18367var CANCELLED = 'CANCELLED'; 18368var FLUSH = 'FLUSH'; 18369var GET_CONTEXT = 'GET_CONTEXT'; 18370var SET_CONTEXT = 'SET_CONTEXT'; 18371 18372var effectTypes = /*#__PURE__*/Object.freeze({ 18373 __proto__: null, 18374 TAKE: TAKE, 18375 PUT: PUT, 18376 ALL: ALL, 18377 RACE: RACE, 18378 CALL: CALL, 18379 CPS: CPS, 18380 FORK: FORK, 18381 JOIN: JOIN, 18382 CANCEL: CANCEL, 18383 SELECT: SELECT, 18384 ACTION_CHANNEL: ACTION_CHANNEL, 18385 CANCELLED: CANCELLED, 18386 FLUSH: FLUSH, 18387 GET_CONTEXT: GET_CONTEXT, 18388 SET_CONTEXT: SET_CONTEXT 18389}); 18390 18391var TEST_HINT = '\n(HINT: if you are getting these errors in tests, consider using createMockTask from @redux-saga/testing-utils)'; 18392 18393var makeEffect = function makeEffect(type, payload) { 18394 var _ref; 18395 18396 return _ref = {}, _ref[_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__.IO] = true, _ref.combinator = false, _ref.type = type, _ref.payload = payload, _ref; 18397}; 18398 18399var isForkEffect = function isForkEffect(eff) { 18400 return effect(eff) && eff.type === FORK; 18401}; 18402 18403var detach = function detach(eff) { 18404 if (false) // removed by dead control flow 18405{} 18406 18407 return makeEffect(FORK, _extends({}, eff.payload, { 18408 detached: true 18409 })); 18410}; 18411function take(patternOrChannel, multicastPattern) { 18412 if (patternOrChannel === void 0) { 18413 patternOrChannel = '*'; 18414 } 18415 18416 if (false) // removed by dead control flow 18417{} 18418 18419 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .pattern */ .T1)(patternOrChannel)) { 18420 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .notUndef */ .uQ)(multicastPattern)) { 18421 /* eslint-disable no-console */ 18422 console.warn("take(pattern) takes one argument but two were provided. Consider passing an array for listening to several action types"); 18423 } 18424 18425 return makeEffect(TAKE, { 18426 pattern: patternOrChannel 18427 }); 18428 } 18429 18430 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .multicast */ .fD)(patternOrChannel) && (0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .notUndef */ .uQ)(multicastPattern) && (0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .pattern */ .T1)(multicastPattern)) { 18431 return makeEffect(TAKE, { 18432 channel: patternOrChannel, 18433 pattern: multicastPattern 18434 }); 18435 } 18436 18437 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .channel */ .Ix)(patternOrChannel)) { 18438 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .notUndef */ .uQ)(multicastPattern)) { 18439 /* eslint-disable no-console */ 18440 console.warn("take(channel) takes one argument but two were provided. Second argument is ignored."); 18441 } 18442 18443 return makeEffect(TAKE, { 18444 channel: patternOrChannel 18445 }); 18446 } 18447 18448 if (false) // removed by dead control flow 18449{} 18450} 18451var takeMaybe = function takeMaybe() { 18452 var eff = take.apply(void 0, arguments); 18453 eff.payload.maybe = true; 18454 return eff; 18455}; 18456function put(channel$1, action) { 18457 if (false) // removed by dead control flow 18458{} 18459 18460 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .undef */ .vD)(action)) { 18461 action = channel$1; // `undefined` instead of `null` to make default parameter work 18462 18463 channel$1 = undefined; 18464 } 18465 18466 return makeEffect(PUT, { 18467 channel: channel$1, 18468 action: action 18469 }); 18470} 18471var putResolve = function putResolve() { 18472 var eff = put.apply(void 0, arguments); 18473 eff.payload.resolve = true; 18474 return eff; 18475}; 18476function all(effects) { 18477 var eff = makeEffect(ALL, effects);
18478 eff.combinator = true; 18479 return eff; 18480} 18481function race(effects) { 18482 var eff = makeEffect(RACE, effects); 18483 eff.combinator = true; 18484 return eff; 18485} // this match getFnCallDescriptor logic 18486 18487var validateFnDescriptor = function validateFnDescriptor(effectName, fnDescriptor) { 18488 check(fnDescriptor, notUndef, effectName + ": argument fn is undefined or null"); 18489 18490 if (func(fnDescriptor)) { 18491 return; 18492 } 18493 18494 var context = null; 18495 var fn; 18496 18497 if (array(fnDescriptor)) { 18498 context = fnDescriptor[0]; 18499 fn = fnDescriptor[1]; 18500 check(fn, notUndef, effectName + ": argument of type [context, fn] has undefined or null `fn`"); 18501 } else if (object(fnDescriptor)) { 18502 context = fnDescriptor.context; 18503 fn = fnDescriptor.fn; 18504 check(fn, notUndef, effectName + ": argument of type {context, fn} has undefined or null `fn`"); 18505 } else { 18506 check(fnDescriptor, func, effectName + ": argument fn is not function"); 18507 return; 18508 } 18509 18510 if (context && string(fn)) { 18511 check(context[fn], func, effectName + ": context arguments has no such method - \"" + fn + "\""); 18512 return; 18513 } 18514 18515 check(fn, func, effectName + ": unpacked fn argument (from [context, fn] or {context, fn}) is not a function"); 18516}; 18517 18518function getFnCallDescriptor(fnDescriptor, args) { 18519 var context = null; 18520 var fn; 18521 18522 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .func */ .Pc)(fnDescriptor)) { 18523 fn = fnDescriptor; 18524 } else { 18525 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .array */ .YO)(fnDescriptor)) { 18526 context = fnDescriptor[0]; 18527 fn = fnDescriptor[1]; 18528 } else { 18529 context = fnDescriptor.context; 18530 fn = fnDescriptor.fn; 18531 } 18532 18533 if (context && (0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .string */ .Yj)(fn) && (0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__/* .func */ .Pc)(context[fn])) { 18534 fn = context[fn]; 18535 } 18536 } 18537 18538 return { 18539 context: context, 18540 fn: fn, 18541 args: args 18542 }; 18543} 18544 18545var isNotDelayEffect = function isNotDelayEffect(fn) { 18546 return fn !== delay; 18547}; 18548 18549function call(fnDescriptor) { 18550 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 18551 args[_key - 1] = arguments[_key]; 18552 } 18553 18554 if (false) // removed by dead control flow 18555{ var arg0; } 18556 18557 return makeEffect(CALL, getFnCallDescriptor(fnDescriptor, args)); 18558} 18559function apply(context, fn, args) { 18560 if (args === void 0) { 18561 args = []; 18562 } 18563 18564 var fnDescriptor = [context, fn]; 18565 18566 if (false) // removed by dead control flow 18567{} 18568 18569 return makeEffect(CALL, getFnCallDescriptor([context, fn], args)); 18570} 18571function cps(fnDescriptor) { 18572 if (false) // removed by dead control flow 18573{} 18574 18575 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 18576 args[_key2 - 1] = arguments[_key2]; 18577 } 18578 18579 return makeEffect(CPS, getFnCallDescriptor(fnDescriptor, args)); 18580} 18581function fork(fnDescriptor) { 18582 if (false) // removed by dead control flow 18583{} 18584 18585 for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { 18586 args[_key3 - 1] = arguments[_key3]; 18587 } 18588 18589 return makeEffect(FORK, getFnCallDescriptor(fnDescriptor, args)); 18590} 18591function spawn(fnDescriptor) { 18592 if (false) // removed by dead control flow 18593{} 18594 18595 for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { 18596 args[_key4 - 1] = arguments[_key4]; 18597 } 18598 18599 return detach(fork.apply(void 0, [fnDescriptor].concat(args))); 18600} 18601function join(taskOrTasks) { 18602 if (false) // removed by dead control flow 18603{} 18604 18605 return makeEffect(JOIN, taskOrTasks); 18606} 18607function cancel(taskOrTasks) { 18608 if (taskOrTasks === void 0) { 18609 taskOrTasks = _redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__/* .SELF_CANCELLATION */ .Pe; 18610 } 18611 18612 if (false) // removed by dead control flow 18613{} 18614 18615 return makeEffect(CANCEL, taskOrTasks); 18616} 18617function select(selector) { 18618 if (selector === void 0) { 18619 selector = identity; 18620 } 18621 18622 for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { 18623 args[_key5 - 1] = arguments[_key5]; 18624 } 18625 18626 if (false) // removed by dead control flow 18627{} 18628 18629 return makeEffect(SELECT, { 18630 selector: selector, 18631 args: args 18632 }); 18633} 18634/** 18635 channel(pattern, [buffer]) => creates a proxy channel for store actions 18636**/ 18637
18638function actionChannel(pattern$1, buffer$1) { 18639 if (false) // removed by dead control flow 18640{} 18641 18642 return makeEffect(ACTION_CHANNEL, { 18643 pattern: pattern$1, 18644 buffer: buffer$1 18645 }); 18646} 18647function cancelled() { 18648 return makeEffect(CANCELLED, {}); 18649} 18650function flush(channel$1) { 18651 if (false) // removed by dead control flow 18652{} 18653 18654 return makeEffect(FLUSH, channel$1); 18655} 18656function getContext(prop) { 18657 if (false) // removed by dead control flow 18658{} 18659 18660 return makeEffect(GET_CONTEXT, prop); 18661} 18662function setContext(props) { 18663 if (false) // removed by dead control flow 18664{} 18665 18666 return makeEffect(SET_CONTEXT, props); 18667} 18668var delay = 18669/*#__PURE__*/ 18670(/* unused pure expression or super */ null && (call.bind(null, delayP))); 18671 18672 18673 18674 18675/***/ }, 18676 18677/***/ 85118 18678(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 18679 18680"use strict"; 18681/* harmony export */ __webpack_require__.d(__webpack_exports__, { 18682/* harmony export */ KW: () => (/* reexport safe */ _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.a5), 18683/* harmony export */ Lt: () => (/* reexport safe */ _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.a4), 18684/* harmony export */ Q7: () => (/* reexport safe */ _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.$), 18685/* harmony export */ T1: () => (/* reexport safe */ _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.O), 18686/* harmony export */ ZT: () => (/* reexport safe */ _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.N), 18687/* harmony export */ Zy: () => (/* reexport safe */ _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.M), 18688/* harmony export */ jP: () => (/* binding */ takeEvery$1), 18689/* harmony export */ s: () => (/* reexport safe */ _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.L), 18690/* harmony export */ yJ: () => (/* reexport safe */ _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.Z) 18691/* harmony export */ }); 18692/* unused harmony exports debounce, retry, takeLatest, takeLeading, throttle */ 18693/* unused harmony import specifier */ var channel; 18694/* unused harmony import specifier */ var notUndef; 18695/* unused harmony import specifier */ var take; 18696/* unused harmony import specifier */ var fork; 18697/* unused harmony import specifier */ var cancel; 18698/* unused harmony import specifier */ var call; 18699/* unused harmony import specifier */ var delay; 18700/* unused harmony import specifier */ var actionChannel; 18701/* unused harmony import specifier */ var sliding; 18702/* unused harmony import specifier */ var race; 18703/* unused harmony import specifier */ var check; 18704/* harmony import */ var _redux_saga_is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21225); 18705/* harmony import */ var _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28424); 18706 18707 18708 18709 18710 18711 18712 18713var done = function done(value) { 18714 return { 18715 done: true, 18716 value: value 18717 }; 18718}; 18719 18720var qEnd = {}; 18721function safeName(patternOrChannel) { 18722 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_0__/* .channel */ .Ix)(patternOrChannel)) { 18723 return 'channel'; 18724 } 18725 18726 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_0__/* .stringableFunc */ .mr)(patternOrChannel)) { 18727 return String(patternOrChannel); 18728 } 18729 18730 if ((0,_redux_saga_is__WEBPACK_IMPORTED_MODULE_0__/* .func */ .Pc)(patternOrChannel)) { 18731 return patternOrChannel.name; 18732 } 18733 18734 return String(patternOrChannel); 18735} 18736function fsmIterator(fsm, startState, name) { 18737 var stateUpdater, 18738 errorState, 18739 effect, 18740 nextState = startState; 18741 18742 function next(arg, error) { 18743 if (nextState === qEnd) { 18744 return done(arg); 18745 } 18746 18747 if (error && !errorState) { 18748 nextState = qEnd; 18749 throw error; 18750 } else { 18751 stateUpdater && stateUpdater(arg); 18752 var currentState = error ? fsm[errorState](error) : fsm[nextState](); 18753 nextState = currentState.nextState; 18754 effect = currentState.effect; 18755 stateUpdater = currentState.stateUpdater; 18756 errorState = currentState.errorState; 18757 return nextState === qEnd ? done(arg) : effect; 18758 } 18759 } 18760 18761 return (0,_io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.q)(next, function (error) { 18762 return next(null, error); 18763 }, name); 18764} 18765 18766function takeEvery(patternOrChannel, worker) { 18767 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 18768 args[_key - 2] = arguments[_key]; 18769 } 18770 18771 var yTake = { 18772 done: false, 18773 value: (0,_io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.L)(patternOrChannel) 18774 }; 18775 18776 var yFork = function yFork(ac) { 18777 return { 18778 done: false, 18779 value: _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.M.apply(void 0, [worker].concat(args, [ac])) 18780 }; 18781 }; 18782 18783 var action,
18784 setAction = function setAction(ac) { 18785 return action = ac; 18786 }; 18787 18788 return fsmIterator({ 18789 q1: function q1() { 18790 return { 18791 nextState: 'q2', 18792 effect: yTake, 18793 stateUpdater: setAction 18794 }; 18795 }, 18796 q2: function q2() { 18797 return { 18798 nextState: 'q1', 18799 effect: yFork(action) 18800 }; 18801 } 18802 }, 'q1', "takeEvery(" + safeName(patternOrChannel) + ", " + worker.name + ")"); 18803} 18804 18805function takeLatest(patternOrChannel, worker) { 18806 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 18807 args[_key - 2] = arguments[_key]; 18808 } 18809 18810 var yTake = { 18811 done: false, 18812 value: take(patternOrChannel) 18813 }; 18814 18815 var yFork = function yFork(ac) { 18816 return { 18817 done: false, 18818 value: fork.apply(void 0, [worker].concat(args, [ac])) 18819 }; 18820 }; 18821 18822 var yCancel = function yCancel(task) { 18823 return { 18824 done: false, 18825 value: cancel(task) 18826 }; 18827 }; 18828 18829 var task, action; 18830 18831 var setTask = function setTask(t) { 18832 return task = t; 18833 }; 18834 18835 var setAction = function setAction(ac) { 18836 return action = ac; 18837 }; 18838 18839 return fsmIterator({ 18840 q1: function q1() { 18841 return { 18842 nextState: 'q2', 18843 effect: yTake, 18844 stateUpdater: setAction 18845 }; 18846 }, 18847 q2: function q2() { 18848 return task ? { 18849 nextState: 'q3', 18850 effect: yCancel(task) 18851 } : { 18852 nextState: 'q1', 18853 effect: yFork(action), 18854 stateUpdater: setTask 18855 }; 18856 }, 18857 q3: function q3() { 18858 return { 18859 nextState: 'q1', 18860 effect: yFork(action), 18861 stateUpdater: setTask 18862 }; 18863 } 18864 }, 'q1', "takeLatest(" + safeName(patternOrChannel) + ", " + worker.name + ")"); 18865} 18866 18867function takeLeading(patternOrChannel, worker) { 18868 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 18869 args[_key - 2] = arguments[_key]; 18870 } 18871 18872 var yTake = { 18873 done: false, 18874 value: take(patternOrChannel) 18875 }; 18876 18877 var yCall = function yCall(ac) { 18878 return { 18879 done: false, 18880 value: call.apply(void 0, [worker].concat(args, [ac])) 18881 }; 18882 }; 18883 18884 var action; 18885 18886 var setAction = function setAction(ac) { 18887 return action = ac; 18888 }; 18889 18890 return fsmIterator({ 18891 q1: function q1() { 18892 return { 18893 nextState: 'q2', 18894 effect: yTake, 18895 stateUpdater: setAction 18896 }; 18897 }, 18898 q2: function q2() { 18899 return { 18900 nextState: 'q1', 18901 effect: yCall(action) 18902 }; 18903 } 18904 }, 'q1', "takeLeading(" + safeName(patternOrChannel) + ", " + worker.name + ")"); 18905} 18906 18907function throttle(delayLength, patternOrChannel, worker) { 18908 for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { 18909 args[_key - 3] = arguments[_key]; 18910 } 18911 18912 var action, channel$1; 18913 18914 var yTake = function yTake() { 18915 return { 18916 done: false, 18917 value: take(channel$1) 18918 }; 18919 }; 18920 18921 var yFork = function yFork(ac) { 18922 return { 18923 done: false, 18924 value: fork.apply(void 0, [worker].concat(args, [ac])) 18925 }; 18926 }; 18927 18928 var yDelay = { 18929 done: false, 18930 value: delay(delayLength) 18931 }; 18932 18933 var setAction = function setAction(ac) { 18934 return action = ac; 18935 }; 18936 18937 var setChannel = function setChannel(ch) { 18938 return channel$1 = ch; 18939 }; 18940 18941 var needsChannel = !channel(patternOrChannel); 18942 18943 if (!needsChannel) { 18944 setChannel(patternOrChannel); 18945 } 18946 18947 return fsmIterator({ 18948 q1: function q1() { 18949 var yActionChannel = { 18950 done: false, 18951 value: actionChannel(patternOrChannel, sliding(1)) 18952 }; 18953 return { 18954 nextState: 'q2', 18955 effect: yActionChannel, 18956 stateUpdater: setChannel 18957 }; 18958 }, 18959 q2: function q2() { 18960 return { 18961 nextState: 'q3', 18962 effect: yTake(), 18963 stateUpdater: setAction 18964 }; 18965 }, 18966 q3: function q3() { 18967 return { 18968 nextState: 'q4', 18969 effect: yFork(action) 18970 }; 18971 }, 18972 q4: function q4() { 18973 return { 18974 nextState: 'q2', 18975 effect: yDelay 18976 }; 18977 } 18978 }, needsChannel ? 'q1' : 'q2', "throttle(" + safeName(patternOrChannel) + ", " + worker.name + ")"); 18979} 18980 18981function retry(maxTries, delayLength, fn) { 18982 var counter = maxTries; 18983 18984 for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { 18985 args[_key - 3] = arguments[_key]; 18986 } 18987 18988 var yCall = { 18989 done: false, 18990 value: call.apply(void 0, [fn].concat(args)) 18991 }; 18992 var yDelay = { 18993 done: false, 18994 value: delay(delayLength) 18995 }; 18996 return fsmIterator({ 18997 q1: function q1() { 18998 return { 18999 nextState: 'q2', 19000 effect: yCall, 19001 errorState: 'q10' 19002 }; 19003 }, 19004 q2: function q2() { 19005 return { 19006 nextState: qEnd 19007 }; 19008 }, 19009 q10: function q10(error) { 19010 counter -= 1; 19011 19012 if (counter <= 0) { 19013 throw error; 19014 } 19015 19016 return { 19017 nextState: 'q1', 19018 effect: yDelay 19019 }; 19020 } 19021 }, 'q1', "retry(" + fn.name + ")"); 19022} 19023 19024function debounceHelper(delayLength, patternOrChannel, worker) { 19025 for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { 19026 args[_key - 3] = arguments[_key]; 19027 } 19028 19029 var action, raceOutput; 19030 var yTake = { 19031 done: false, 19032 value: take(patternOrChannel) 19033 }; 19034 var yRace = { 19035 done: false, 19036 value: race({ 19037 action: take(patternOrChannel), 19038 debounce: delay(delayLength) 19039 }) 19040 }; 19041 19042 var yFork = function yFork(ac) { 19043 return { 19044 done: false, 19045 value: fork.apply(void 0, [worker].concat(args, [ac])) 19046 }; 19047 }; 19048 19049 var yNoop = function yNoop(value) { 19050 return { 19051 done: false, 19052 value: value 19053 }; 19054 }; 19055 19056 var setAction = function setAction(ac) { 19057 return action = ac; 19058 }; 19059 19060 var setRaceOutput = function setRaceOutput(ro) { 19061 return raceOutput = ro; 19062 }; 19063 19064 return fsmIterator({ 19065 q1: function q1() { 19066 return { 19067 nextState: 'q2', 19068 effect: yTake, 19069 stateUpdater: setAction 19070 }; 19071 }, 19072 q2: function q2() { 19073 return { 19074 nextState: 'q3', 19075 effect: yRace, 19076 stateUpdater: setRaceOutput 19077 }; 19078 }, 19079 q3: function q3() { 19080 return raceOutput.debounce ? { 19081 nextState: 'q1', 19082 effect: yFork(action) 19083 } : { 19084 nextState: 'q2', 19085 effect: yNoop(raceOutput.action), 19086 stateUpdater: setAction 19087 }; 19088 } 19089 }, 'q1', "debounce(" + safeName(patternOrChannel) + ", " + worker.name + ")"); 19090} 19091 19092var validateTakeEffect = function validateTakeEffect(fn, patternOrChannel, worker) { 19093 check(patternOrChannel, notUndef, fn.name + " requires a pattern or channel"); 19094 check(worker, notUndef, fn.name + " requires a saga parameter"); 19095}; 19096 19097function takeEvery$1(patternOrChannel, worker) { 19098 if (false) // removed by dead control flow 19099{} 19100 19101 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 19102 args[_key - 2] = arguments[_key]; 19103 } 19104 19105 return _io_22ea0cf9_js__WEBPACK_IMPORTED_MODULE_1__.M.apply(void 0, [takeEvery, patternOrChannel, worker].concat(args)); 19106} 19107function takeLatest$1(patternOrChannel, worker) { 19108 if (false) // removed by dead control flow 19109{} 19110 19111 for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { 19112 args[_key2 - 2] = arguments[_key2]; 19113 } 19114 19115 return fork.apply(void 0, [takeLatest, patternOrChannel, worker].concat(args)); 19116} 19117function takeLeading$1(patternOrChannel, worker) { 19118 if (false) // removed by dead control flow 19119{} 19120 19121 for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { 19122 args[_key3 - 2] = arguments[_key3]; 19123 } 19124 19125 return fork.apply(void 0, [takeLeading, patternOrChannel, worker].concat(args)); 19126} 19127function throttle$1(ms, patternOrChannel, worker) { 19128 if (false) // removed by dead control flow 19129{} 19130 19131 for (var _len4 = arguments.length, args = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) { 19132 args[_key4 - 3] = arguments[_key4]; 19133 } 19134 19135 return fork.apply(void 0, [throttle, ms, patternOrChannel, worker].concat(args)); 19136} 19137function retry$1(maxTries, delayLength, worker) { 19138 for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) { 19139 args[_key5 - 3] = arguments[_key5]; 19140 } 19141 19142 return call.apply(void 0, [retry, maxTries, delayLength, worker].concat(args)); 19143} 19144function debounce(delayLength, pattern, worker) { 19145 for (var _len6 = arguments.length, args = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) { 19146 args[_key6 - 3] = arguments[_key6]; 19147 } 19148 19149 return fork.apply(void 0, [debounceHelper, delayLength, pattern, worker].concat(args)); 19150} 19151 19152 19153 19154 19155/***/ }, 19156 19157/***/ 21225 19158(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 19159 19160"use strict"; 19161/* harmony export */ __webpack_require__.d(__webpack_exports__, { 19162/* harmony export */ HR: () => (/* binding */ symbol), 19163/* harmony export */ Ix: () => (/* binding */ channel), 19164/* harmony export */ Pc: () => (/* binding */ func), 19165/* harmony export */ T1: () => (/* binding */ pattern), 19166/* harmony export */ YO: () => (/* binding */ array), 19167/* harmony export */ Yj: () => (/* binding */ string), 19168/* harmony export */ fD: () => (/* binding */ multicast), 19169/* harmony export */ iv: () => (/* binding */ promise), 19170/* harmony export */ lJ: () => (/* binding */ iterator),
19171/* harmony export */ mr: () => (/* binding */ stringableFunc), 19172/* harmony export */ uQ: () => (/* binding */ notUndef), 19173/* harmony export */ vD: () => (/* binding */ undef) 19174/* harmony export */ }); 19175/* unused harmony exports buffer, effect, iterable, number, object, observable, sagaAction, task */ 19176/* unused harmony import specifier */ var TASK; 19177/* unused harmony import specifier */ var SAGA_ACTION; 19178/* unused harmony import specifier */ var IO; 19179/* harmony import */ var _redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63821); 19180 19181 19182var undef = function undef(v) { 19183 return v === null || v === undefined; 19184}; 19185var notUndef = function notUndef(v) { 19186 return v !== null && v !== undefined; 19187}; 19188var func = function func(f) { 19189 return typeof f === 'function'; 19190}; 19191var number = function number(n) { 19192 return typeof n === 'number'; 19193}; 19194var string = function string(s) { 19195 return typeof s === 'string'; 19196}; 19197var array = Array.isArray; 19198var object = function object(obj) { 19199 return obj && !array(obj) && typeof obj === 'object'; 19200}; 19201var promise = function promise(p) { 19202 return p && func(p.then); 19203}; 19204var iterator = function iterator(it) { 19205 return it && func(it.next) && func(it.throw); 19206}; 19207var iterable = function iterable(it) { 19208 return it && func(Symbol) ? func(it[Symbol.iterator]) : array(it); 19209}; 19210var task = function task(t) { 19211 return t && t[TASK]; 19212}; 19213var sagaAction = function sagaAction(a) { 19214 return Boolean(a && a[SAGA_ACTION]); 19215};
19216var observable = function observable(ob) { 19217 return ob && func(ob.subscribe); 19218}; 19219var buffer = function buffer(buf) { 19220 return buf && func(buf.isEmpty) && func(buf.take) && func(buf.put); 19221}; 19222var pattern = function pattern(pat) { 19223 return pat && (string(pat) || symbol(pat) || func(pat) || array(pat) && pat.every(pattern)); 19224}; 19225var channel = function channel(ch) { 19226 return ch && func(ch.take) && func(ch.close); 19227}; 19228var stringableFunc = function stringableFunc(f) { 19229 return func(f) && f.hasOwnProperty('toString'); 19230}; 19231var symbol = function symbol(sym) { 19232 return Boolean(sym) && typeof Symbol === 'function' && sym.constructor === Symbol && sym !== Symbol.prototype; 19233}; 19234var multicast = function multicast(ch) { 19235 return channel(ch) && ch[_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__/* .MULTICAST */ .Xl]; 19236}; 19237var effect = function effect(eff) { 19238 return eff && eff[IO]; 19239}; 19240 19241 19242 19243 19244/***/ }, 19245 19246/***/ 63821 19247(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 19248 19249"use strict"; 19250/* harmony export */ __webpack_require__.d(__webpack_exports__, { 19251/* harmony export */ E_: () => (/* binding */ MATCH), 19252/* harmony export */ IO: () => (/* binding */ IO), 19253/* harmony export */ Pe: () => (/* binding */ SELF_CANCELLATION), 19254/* harmony export */ Xl: () => (/* binding */ MULTICAST), 19255/* harmony export */ a6: () => (/* binding */ TERMINATE), 19256/* harmony export */ bO: () => (/* binding */ CANCEL), 19257/* harmony export */ nm: () => (/* binding */ TASK_CANCEL), 19258/* harmony export */ q8: () => (/* binding */ SAGA_ACTION), 19259/* harmony export */ wn: () => (/* binding */ TASK), 19260/* harmony export */ x2: () => (/* binding */ SAGA_LOCATION), 19261/* harmony export */ x7: () => (/* binding */ CHANNEL_END_TYPE) 19262/* harmony export */ }); 19263var createSymbol = function createSymbol(name) { 19264 return "@@redux-saga/" + name; 19265}; 19266 19267var CANCEL = 19268/*#__PURE__*/ 19269createSymbol('CANCEL_PROMISE'); 19270var CHANNEL_END_TYPE = 19271/*#__PURE__*/ 19272createSymbol('CHANNEL_END'); 19273var IO = 19274/*#__PURE__*/ 19275createSymbol('IO'); 19276var MATCH = 19277/*#__PURE__*/ 19278createSymbol('MATCH'); 19279var MULTICAST = 19280/*#__PURE__*/ 19281createSymbol('MULTICAST'); 19282var SAGA_ACTION = 19283/*#__PURE__*/ 19284createSymbol('SAGA_ACTION'); 19285var SELF_CANCELLATION = 19286/*#__PURE__*/ 19287createSymbol('SELF_CANCELLATION'); 19288var TASK = 19289/*#__PURE__*/ 19290createSymbol('TASK'); 19291var TASK_CANCEL = 19292/*#__PURE__*/ 19293createSymbol('TASK_CANCEL'); 19294var TERMINATE = 19295/*#__PURE__*/ 19296createSymbol('TERMINATE'); 19297var SAGA_LOCATION = 19298/*#__PURE__*/ 19299createSymbol('LOCATION'); 19300 19301 19302 19303 19304/***/ }, 19305 19306/***/ 45588 19307(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 19308 19309"use strict"; 19310/* harmony export */ __webpack_require__.d(__webpack_exports__, { 19311/* harmony export */ AO: () => (/* binding */ createPath), 19312/* harmony export */ B6: () => (/* binding */ matchPath), 19313/* harmony export */ Gh: () => (/* binding */ resolveTo), 19314/* harmony export */ HS: () => (/* binding */ joinPaths), 19315/* harmony export */ Oi: () => (/* binding */ invariant), 19316/* harmony export */ Rr: () => (/* binding */ parsePath), 19317/* harmony export */ pX: () => (/* binding */ isRouteErrorResponse), 19318/* harmony export */ pb: () => (/* binding */ stripBasename), 19319/* harmony export */ rc: () => (/* binding */ Action), 19320/* harmony export */ tH: () => (/* binding */ AbortedDeferredError), 19321/* harmony export */ ue: () => (/* binding */ matchRoutes), 19322/* harmony export */ yD: () => (/* binding */ getResolveToMatches) 19323/* harmony export */ }); 19324/* unused harmony exports IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, UNSAFE_DEFERRED_SYMBOL, UNSAFE_DeferredData, UNSAFE_ErrorResponseImpl, UNSAFE_convertRouteMatchToUiMatch, UNSAFE_convertRoutesToDataRoutes, UNSAFE_decodePath, UNSAFE_warning, createBrowserHistory, createHashHistory, createMemoryHistory, createRouter, createStaticHandler, data, defer, generatePath, getStaticContextFromError, getToPathname, isDataWithResponseInit, isDeferredData, json, normalizePathname, redirect, redirectDocument, replace, resolvePath */ 19325/** 19326 * @remix-run/router v1.23.3
vendor: 31,083 bytes, lines 19326-20207
19326 19327 * 19328 * Copyright (c) Remix Software Inc. 19329 * 19330 * This source code is licensed under the MIT license found in the 19331 * LICENSE.md file in the root directory of this source tree. 19332 * 19333 * @license MIT 19334 */ 19335function _extends() { 19336 return _extends = Object.assign ? Object.assign.bind() : function (n) { 19337 for (var e = 1; e < arguments.length; e++) { 19338 var t = arguments[e]; 19339 for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); 19340 } 19341 return n; 19342 }, _extends.apply(null, arguments); 19343} 19344 19345//////////////////////////////////////////////////////////////////////////////// 19346//#region Types and Constants 19347//////////////////////////////////////////////////////////////////////////////// 19348/** 19349 * Actions represent the type of change to a location value. 19350 */ 19351var Action; 19352(function (Action) { 19353 /** 19354 * A POP indicates a change to an arbitrary index in the history stack, such 19355 * as a back or forward navigation. It does not describe the direction of the 19356 * navigation, only that the current index changed. 19357 * 19358 * Note: This is the default action for newly created history objects. 19359 */ 19360 Action["Pop"] = "POP"; 19361 /** 19362 * A PUSH indicates a new entry being added to the history stack, such as when 19363 * a link is clicked and a new page loads. When this happens, all subsequent 19364 * entries in the stack are lost. 19365 */ 19366 Action["Push"] = "PUSH"; 19367 /** 19368 * A REPLACE indicates the entry at the current index in the history stack 19369 * being replaced by a new one. 19370 */ 19371 Action["Replace"] = "REPLACE"; 19372})(Action || (Action = {})); 19373const PopStateEventType = "popstate"; 19374/** 19375 * Memory history stores the current location in memory. It is designed for use 19376 * in stateful non-browser environments like tests and React Native. 19377 */ 19378function createMemoryHistory(options) { 19379 if (options === void 0) { 19380 options = {}; 19381 } 19382 let { 19383 initialEntries = ["/"], 19384 initialIndex, 19385 v5Compat = false 19386 } = options; 19387 let entries; // Declare so we can access from createMemoryLocation 19388 entries = initialEntries.map((entry, index) => createMemoryLocation(entry, typeof entry === "string" ? null : entry.state, index === 0 ? "default" : undefined)); 19389 let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex); 19390 let action = Action.Pop; 19391 let listener = null; 19392 function clampIndex(n) { 19393 return Math.min(Math.max(n, 0), entries.length - 1); 19394 } 19395 function getCurrentLocation() { 19396 return entries[index]; 19397 } 19398 function createMemoryLocation(to, state, key) { 19399 if (state === void 0) { 19400 state = null; 19401 } 19402 let location = createLocation(entries ? getCurrentLocation().pathname : "/", to, state, key); 19403 warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in memory history: " + JSON.stringify(to)); 19404 return location; 19405 } 19406 function createHref(to) { 19407 return typeof to === "string" ? to : createPath(to); 19408 } 19409 let history = { 19410 get index() { 19411 return index; 19412 }, 19413 get action() { 19414 return action; 19415 }, 19416 get location() { 19417 return getCurrentLocation(); 19418 }, 19419 createHref, 19420 createURL(to) { 19421 return new URL(createHref(to), "http://localhost"); 19422 }, 19423 encodeLocation(to) { 19424 let path = typeof to === "string" ? parsePath(to) : to; 19425 return { 19426 pathname: path.pathname || "", 19427 search: path.search || "", 19428 hash: path.hash || "" 19429 }; 19430 }, 19431 push(to, state) { 19432 action = Action.Push; 19433 let nextLocation = createMemoryLocation(to, state); 19434 index += 1; 19435 entries.splice(index, entries.length, nextLocation); 19436 if (v5Compat && listener) { 19437 listener({ 19438 action, 19439 location: nextLocation, 19440 delta: 1 19441 }); 19442 } 19443 }, 19444 replace(to, state) { 19445 action = Action.Replace; 19446 let nextLocation = createMemoryLocation(to, state); 19447 entries[index] = nextLocation; 19448 if (v5Compat && listener) { 19449 listener({ 19450 action, 19451 location: nextLocation, 19452 delta: 0 19453 }); 19454 } 19455 }, 19456 go(delta) { 19457 action = Action.Pop; 19458 let nextIndex = clampIndex(index + delta); 19459 let nextLocation = entries[nextIndex]; 19460 index = nextIndex; 19461 if (listener) { 19462 listener({ 19463 action, 19464 location: nextLocation, 19465 delta 19466 }); 19467 } 19468 }, 19469 listen(fn) { 19470 listener = fn; 19471 return () => { 19472 listener = null; 19473 }; 19474 } 19475 }; 19476 return history; 19477} 19478/** 19479 * Browser history stores the location in regular URLs. This is the standard for 19480 * most web apps, but it requires some configuration on the server to ensure you 19481 * serve the same app at multiple URLs. 19482 * 19483 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory 19484 */ 19485function createBrowserHistory(options) { 19486 if (options === void 0) { 19487 options = {}; 19488 } 19489 function createBrowserLocation(window, globalHistory) { 19490 let { 19491 pathname, 19492 search, 19493 hash 19494 } = window.location; 19495 return createLocation("", { 19496 pathname, 19497 search, 19498 hash 19499 }, 19500 // state defaults to `null` because `window.history.state` does 19501 globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); 19502 } 19503 function createBrowserHref(window, to) { 19504 return typeof to === "string" ? to : createPath(to); 19505 } 19506 return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options); 19507} 19508/** 19509 * Hash history stores the location in window.location.hash. This makes it ideal 19510 * for situations where you don't want to send the location to the server for 19511 * some reason, either because you do cannot configure it or the URL space is 19512 * reserved for something else. 19513 * 19514 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory 19515 */ 19516function createHashHistory(options) { 19517 if (options === void 0) { 19518 options = {}; 19519 } 19520 function createHashLocation(window, globalHistory) { 19521 let { 19522 pathname = "/", 19523 search = "", 19524 hash = "" 19525 } = parsePath(window.location.hash.substr(1)); 19526 // Hash URL should always have a leading / just like window.location.pathname 19527 // does, so if an app ends up at a route like /#something then we add a 19528 // leading slash so all of our path-matching behaves the same as if it would 19529 // in a browser router. This is particularly important when there exists a 19530 // root splat route (<Route path="*">) since that matches internally against 19531 // "/*" and we'd expect /#something to 404 in a hash router app. 19532 if (!pathname.startsWith("/") && !pathname.startsWith(".")) { 19533 pathname = "/" + pathname; 19534 } 19535 return createLocation("", { 19536 pathname, 19537 search, 19538 hash 19539 }, 19540 // state defaults to `null` because `window.history.state` does 19541 globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); 19542 } 19543 function createHashHref(window, to) { 19544 let base = window.document.querySelector("base"); 19545 let href = ""; 19546 if (base && base.getAttribute("href")) { 19547 let url = window.location.href; 19548 let hashIndex = url.indexOf("#"); 19549 href = hashIndex === -1 ? url : url.slice(0, hashIndex); 19550 } 19551 return href + "#" + (typeof to === "string" ? to : createPath(to)); 19552 } 19553 function validateHashLocation(location, to) { 19554 warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in hash history.push(" + JSON.stringify(to) + ")"); 19555 } 19556 return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options); 19557} 19558function invariant(value, message) { 19559 if (value === false || value === null || typeof value === "undefined") { 19560 throw new Error(message); 19561 } 19562} 19563function warning(cond, message) { 19564 if (!cond) { 19565 // eslint-disable-next-line no-console 19566 if (typeof console !== "undefined") console.warn(message); 19567 try { 19568 // Welcome to debugging history! 19569 // 19570 // This error is thrown as a convenience, so you can more easily 19571 // find the source for a warning that appears in the console by 19572 // enabling "pause on exceptions" in your JavaScript debugger. 19573 throw new Error(message); 19574 // eslint-disable-next-line no-empty 19575 } catch (e) {} 19576 } 19577} 19578function createKey() { 19579 return Math.random().toString(36).substr(2, 8); 19580} 19581/** 19582 * For browser-based histories, we combine the state and key into an object 19583 */ 19584function getHistoryState(location, index) { 19585 return { 19586 usr: location.state, 19587 key: location.key, 19588 idx: index 19589 }; 19590} 19591/** 19592 * Creates a Location object with a unique key from the given Path 19593 */ 19594function createLocation(current, to, state, key) { 19595 if (state === void 0) { 19596 state = null; 19597 } 19598 let location = _extends({ 19599 pathname: typeof current === "string" ? current : current.pathname, 19600 search: "", 19601 hash: "" 19602 }, typeof to === "string" ? parsePath(to) : to, { 19603 state, 19604 // TODO: This could be cleaned up. push/replace should probably just take 19605 // full Locations now and avoid the need to run through this flow at all 19606 // But that's a pretty big refactor to the current test suite so going to 19607 // keep as is for the time being and just let any incoming keys take precedence 19608 key: to && to.key || key || createKey() 19609 }); 19610 return location; 19611} 19612/** 19613 * Creates a string URL path from the given pathname, search, and hash components. 19614 */ 19615function createPath(_ref) { 19616 let { 19617 pathname = "/", 19618 search = "", 19619 hash = "" 19620 } = _ref; 19621 if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search; 19622 if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash; 19623 return pathname; 19624} 19625/** 19626 * Parses a string URL path into its separate pathname, search, and hash components. 19627 */ 19628function parsePath(path) { 19629 let parsedPath = {}; 19630 if (path) { 19631 let hashIndex = path.indexOf("#"); 19632 if (hashIndex >= 0) { 19633 parsedPath.hash = path.substr(hashIndex); 19634 path = path.substr(0, hashIndex); 19635 } 19636 let searchIndex = path.indexOf("?"); 19637 if (searchIndex >= 0) { 19638 parsedPath.search = path.substr(searchIndex); 19639 path = path.substr(0, searchIndex); 19640 } 19641 if (path) { 19642 parsedPath.pathname = path; 19643 } 19644 } 19645 return parsedPath; 19646} 19647function getUrlBasedHistory(getLocation, createHref, validateLocation, options) { 19648 if (options === void 0) { 19649 options = {}; 19650 } 19651 let { 19652 window = document.defaultView, 19653 v5Compat = false 19654 } = options; 19655 let globalHistory = window.history; 19656 let action = Action.Pop; 19657 let listener = null; 19658 let index = getIndex(); 19659 // Index should only be null when we initialize. If not, it's because the 19660 // user called history.pushState or history.replaceState directly, in which 19661 // case we should log a warning as it will result in bugs. 19662 if (index == null) { 19663 index = 0; 19664 globalHistory.replaceState(_extends({}, globalHistory.state, { 19665 idx: index 19666 }), ""); 19667 } 19668 function getIndex() { 19669 let state = globalHistory.state || { 19670 idx: null 19671 }; 19672 return state.idx; 19673 } 19674 function handlePop() { 19675 action = Action.Pop; 19676 let nextIndex = getIndex(); 19677 let delta = nextIndex == null ? null : nextIndex - index; 19678 index = nextIndex; 19679 if (listener) { 19680 listener({ 19681 action, 19682 location: history.location, 19683 delta 19684 }); 19685 } 19686 } 19687 function push(to, state) { 19688 action = Action.Push; 19689 let location = createLocation(history.location, to, state); 19690 if (validateLocation) validateLocation(location, to); 19691 index = getIndex() + 1; 19692 let historyState = getHistoryState(location, index); 19693 let url = history.createHref(location); 19694 // try...catch because iOS limits us to 100 pushState calls :/ 19695 try { 19696 globalHistory.pushState(historyState, "", url); 19697 } catch (error) { 19698 // If the exception is because `state` can't be serialized, let that throw 19699 // outwards just like a replace call would so the dev knows the cause 19700 // https://html.spec.whatwg.org/multipage/nav-history-apis.html#shared-history-push/replace-state-steps 19701 // https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal 19702 if (error instanceof DOMException && error.name === "DataCloneError") { 19703 throw error; 19704 } 19705 // They are going to lose state here, but there is no real 19706 // way to warn them about it since the page will refresh... 19707 window.location.assign(url); 19708 } 19709 if (v5Compat && listener) { 19710 listener({ 19711 action, 19712 location: history.location, 19713 delta: 1 19714 }); 19715 } 19716 } 19717 function replace(to, state) { 19718 action = Action.Replace; 19719 let location = createLocation(history.location, to, state); 19720 if (validateLocation) validateLocation(location, to); 19721 index = getIndex(); 19722 let historyState = getHistoryState(location, index); 19723 let url = history.createHref(location); 19724 globalHistory.replaceState(historyState, "", url); 19725 if (v5Compat && listener) { 19726 listener({ 19727 action, 19728 location: history.location, 19729 delta: 0 19730 }); 19731 } 19732 } 19733 function createURL(to) { 19734 // window.location.origin is "null" (the literal string value) in Firefox 19735 // under certain conditions, notably when serving from a local HTML file 19736 // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297 19737 let base = window.location.origin !== "null" ? window.location.origin : window.location.href; 19738 let href = typeof to === "string" ? to : createPath(to); 19739 // Treating this as a full URL will strip any trailing spaces so we need to 19740 // pre-encode them since they might be part of a matching splat param from 19741 // an ancestor route 19742 href = href.replace(/ $/, "%20"); 19743 invariant(base, "No window.location.(origin|href) available to create URL for href: " + href); 19744 return new URL(href, base); 19745 } 19746 let history = { 19747 get action() { 19748 return action; 19749 }, 19750 get location() { 19751 return getLocation(window, globalHistory); 19752 }, 19753 listen(fn) { 19754 if (listener) { 19755 throw new Error("A history only accepts one active listener"); 19756 } 19757 window.addEventListener(PopStateEventType, handlePop); 19758 listener = fn; 19759 return () => { 19760 window.removeEventListener(PopStateEventType, handlePop); 19761 listener = null; 19762 }; 19763 }, 19764 createHref(to) { 19765 return createHref(window, to); 19766 }, 19767 createURL, 19768 encodeLocation(to) { 19769 // Encode a Location the same way window.location would 19770 let url = createURL(to); 19771 return { 19772 pathname: url.pathname, 19773 search: url.search, 19774 hash: url.hash 19775 }; 19776 }, 19777 push, 19778 replace, 19779 go(n) { 19780 return globalHistory.go(n); 19781 } 19782 }; 19783 return history; 19784} 19785//#endregion 19786 19787var ResultType; 19788(function (ResultType) { 19789 ResultType["data"] = "data"; 19790 ResultType["deferred"] = "deferred"; 19791 ResultType["redirect"] = "redirect"; 19792 ResultType["error"] = "error"; 19793})(ResultType || (ResultType = {})); 19794const immutableRouteKeys = new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]); 19795function isIndexRoute(route) { 19796 return route.index === true; 19797} 19798// Walk the route tree generating unique IDs where necessary, so we are working 19799// solely with AgnosticDataRouteObject's within the Router 19800function convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath, manifest) { 19801 if (parentPath === void 0) { 19802 parentPath = []; 19803 } 19804 if (manifest === void 0) { 19805 manifest = {}; 19806 } 19807 return routes.map((route, index) => { 19808 let treePath = [...parentPath, String(index)]; 19809 let id = typeof route.id === "string" ? route.id : treePath.join("-"); 19810 invariant(route.index !== true || !route.children, "Cannot specify children on an index route"); 19811 invariant(!manifest[id], "Found a route id collision on id \"" + id + "\". Route " + "id's must be globally unique within Data Router usages"); 19812 if (isIndexRoute(route)) { 19813 let indexRoute = _extends({}, route, mapRouteProperties(route), { 19814 id 19815 }); 19816 manifest[id] = indexRoute; 19817 return indexRoute; 19818 } else { 19819 let pathOrLayoutRoute = _extends({}, route, mapRouteProperties(route), { 19820 id, 19821 children: undefined 19822 }); 19823 manifest[id] = pathOrLayoutRoute; 19824 if (route.children) { 19825 pathOrLayoutRoute.children = convertRoutesToDataRoutes(route.children, mapRouteProperties, treePath, manifest); 19826 } 19827 return pathOrLayoutRoute; 19828 } 19829 }); 19830} 19831/** 19832 * Matches the given routes to a location and returns the match data. 19833 * 19834 * @see https://reactrouter.com/v6/utils/match-routes 19835 */ 19836function matchRoutes(routes, locationArg, basename) { 19837 if (basename === void 0) { 19838 basename = "/"; 19839 } 19840 return matchRoutesImpl(routes, locationArg, basename, false); 19841} 19842function matchRoutesImpl(routes, locationArg, basename, allowPartial) { 19843 let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; 19844 let pathname = stripBasename(location.pathname || "/", basename); 19845 if (pathname == null) { 19846 return null; 19847 } 19848 let branches = flattenRoutes(routes); 19849 rankRouteBranches(branches); 19850 let matches = null; 19851 let decoded = decodePath(pathname); 19852 for (let i = 0; matches == null && i < branches.length; ++i) { 19853 // Incoming pathnames are generally encoded from either window.location 19854 // or from router.navigate, but we want to match against the unencoded 19855 // paths in the route definitions. Memory router locations won't be 19856 // encoded here but there also shouldn't be anything to decode so this 19857 // should be a safe operation. This avoids needing matchRoutes to be 19858 // history-aware. 19859 matches = matchRouteBranch(branches[i], decoded, allowPartial); 19860 } 19861 return matches; 19862} 19863function convertRouteMatchToUiMatch(match, loaderData) { 19864 let { 19865 route, 19866 pathname, 19867 params 19868 } = match; 19869 return { 19870 id: route.id, 19871 pathname, 19872 params, 19873 data: loaderData[route.id], 19874 handle: route.handle 19875 }; 19876} 19877function flattenRoutes(routes, branches, parentsMeta, parentPath) { 19878 if (branches === void 0) { 19879 branches = []; 19880 } 19881 if (parentsMeta === void 0) { 19882 parentsMeta = []; 19883 } 19884 if (parentPath === void 0) { 19885 parentPath = ""; 19886 } 19887 let flattenRoute = (route, index, relativePath) => { 19888 let meta = { 19889 relativePath: relativePath === undefined ? route.path || "" : relativePath, 19890 caseSensitive: route.caseSensitive === true, 19891 childrenIndex: index, 19892 route 19893 }; 19894 if (meta.relativePath.startsWith("/")) { 19895 invariant(meta.relativePath.startsWith(parentPath), "Absolute route path \"" + meta.relativePath + "\" nested under path " + ("\"" + parentPath + "\" is not valid. An absolute child route path ") + "must start with the combined path of all its parent routes."); 19896 meta.relativePath = meta.relativePath.slice(parentPath.length); 19897 } 19898 let path = joinPaths([parentPath, meta.relativePath]); 19899 let routesMeta = parentsMeta.concat(meta); 19900 // Add the children before adding this route to the array, so we traverse the 19901 // route tree depth-first and child routes appear before their parents in 19902 // the "flattened" version. 19903 if (route.children && route.children.length > 0) { 19904 invariant( 19905 // Our types know better, but runtime JS may not! 19906 // @ts-expect-error 19907 route.index !== true, "Index routes must not have child routes. Please remove " + ("all child routes from route path \"" + path + "\".")); 19908 flattenRoutes(route.children, branches, routesMeta, path); 19909 } 19910 // Routes without a path shouldn't ever match by themselves unless they are 19911 // index routes, so don't add them to the list of possible branches. 19912 if (route.path == null && !route.index) { 19913 return; 19914 } 19915 branches.push({ 19916 path, 19917 score: computeScore(path, route.index), 19918 routesMeta 19919 }); 19920 }; 19921 routes.forEach((route, index) => { 19922 var _route$path; 19923 // coarse-grain check for optional params 19924 if (route.path === "" || !((_route$path = route.path) != null && _route$path.includes("?"))) { 19925 flattenRoute(route, index); 19926 } else { 19927 for (let exploded of explodeOptionalSegments(route.path)) { 19928 flattenRoute(route, index, exploded); 19929 } 19930 } 19931 }); 19932 return branches; 19933} 19934/** 19935 * Computes all combinations of optional path segments for a given path, 19936 * excluding combinations that are ambiguous and of lower priority. 19937 * 19938 * For example, `/one/:two?/three/:four?/:five?` explodes to: 19939 * - `/one/three` 19940 * - `/one/:two/three` 19941 * - `/one/three/:four` 19942 * - `/one/three/:five` 19943 * - `/one/:two/three/:four` 19944 * - `/one/:two/three/:five` 19945 * - `/one/three/:four/:five` 19946 * - `/one/:two/three/:four/:five` 19947 */ 19948function explodeOptionalSegments(path) { 19949 let segments = path.split("/"); 19950 if (segments.length === 0) return []; 19951 let [first, ...rest] = segments; 19952 // Optional path segments are denoted by a trailing `?` 19953 let isOptional = first.endsWith("?"); 19954 // Compute the corresponding required segment: `foo?` -> `foo` 19955 let required = first.replace(/\?$/, ""); 19956 if (rest.length === 0) { 19957 // Intepret empty string as omitting an optional segment 19958 // `["one", "", "three"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three` 19959 return isOptional ? [required, ""] : [required]; 19960 } 19961 let restExploded = explodeOptionalSegments(rest.join("/")); 19962 let result = []; 19963 // All child paths with the prefix. Do this for all children before the 19964 // optional version for all children, so we get consistent ordering where the 19965 // parent optional aspect is preferred as required. Otherwise, we can get 19966 // child sections interspersed where deeper optional segments are higher than 19967 // parent optional segments, where for example, /:two would explode _earlier_ 19968 // then /:one. By always including the parent as required _for all children_ 19969 // first, we avoid this issue 19970 result.push(...restExploded.map(subpath => subpath === "" ? required : [required, subpath].join("/"))); 19971 // Then, if this is an optional value, add all child versions without 19972 if (isOptional) { 19973 result.push(...restExploded); 19974 } 19975 // for absolute paths, ensure `/` instead of empty segment 19976 return result.map(exploded => path.startsWith("/") && exploded === "" ? "/" : exploded); 19977} 19978function rankRouteBranches(branches) { 19979 branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first 19980 : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex))); 19981} 19982const paramRe = /^:[\w-]+$/; 19983const dynamicSegmentValue = 3; 19984const indexRouteValue = 2; 19985const emptySegmentValue = 1; 19986const staticSegmentValue = 10; 19987const splatPenalty = -2; 19988const isSplat = s => s === "*"; 19989function computeScore(path, index) { 19990 let segments = path.split("/"); 19991 let initialScore = segments.length; 19992 if (segments.some(isSplat)) { 19993 initialScore += splatPenalty; 19994 } 19995 if (index) { 19996 initialScore += indexRouteValue; 19997 } 19998 return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore); 19999} 20000function compareIndexes(a, b) { 20001 let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]); 20002 return siblings ? 20003 // If two routes are siblings, we should try to match the earlier sibling 20004 // first. This allows people to have fine-grained control over the matching 20005 // behavior by simply putting routes with identical paths in the order they 20006 // want them tried. 20007 a[a.length - 1] - b[b.length - 1] : 20008 // Otherwise, it doesn't really make sense to rank non-siblings by index, 20009 // so they sort equally. 20010 0; 20011} 20012function matchRouteBranch(branch, pathname, allowPartial) { 20013 if (allowPartial === void 0) { 20014 allowPartial = false; 20015 } 20016 let { 20017 routesMeta 20018 } = branch; 20019 let matchedParams = {}; 20020 let matchedPathname = "/"; 20021 let matches = []; 20022 for (let i = 0; i < routesMeta.length; ++i) { 20023 let meta = routesMeta[i]; 20024 let end = i === routesMeta.length - 1; 20025 let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/"; 20026 let match = matchPath({ 20027 path: meta.relativePath, 20028 caseSensitive: meta.caseSensitive, 20029 end 20030 }, remainingPathname); 20031 let route = meta.route; 20032 if (!match && end && allowPartial && !routesMeta[routesMeta.length - 1].route.index) { 20033 match = matchPath({ 20034 path: meta.relativePath, 20035 caseSensitive: meta.caseSensitive, 20036 end: false 20037 }, remainingPathname); 20038 } 20039 if (!match) { 20040 return null; 20041 } 20042 Object.assign(matchedParams, match.params); 20043 matches.push({ 20044 // TODO: Can this as be avoided? 20045 params: matchedParams, 20046 pathname: joinPaths([matchedPathname, match.pathname]), 20047 pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])), 20048 route 20049 }); 20050 if (match.pathnameBase !== "/") { 20051 matchedPathname = joinPaths([matchedPathname, match.pathnameBase]); 20052 } 20053 } 20054 return matches; 20055} 20056/** 20057 * Returns a path with params interpolated. 20058 * 20059 * @see https://reactrouter.com/v6/utils/generate-path 20060 */ 20061function generatePath(originalPath, params) { 20062 if (params === void 0) { 20063 params = {}; 20064 } 20065 let path = originalPath; 20066 if (path.endsWith("*") && path !== "*" && !path.endsWith("/*")) { 20067 warning(false, "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")); 20068 path = path.replace(/\*$/, "/*"); 20069 } 20070 // ensure `/` is added at the beginning if the path is absolute 20071 const prefix = path.startsWith("/") ? "/" : ""; 20072 const stringify = p => p == null ? "" : typeof p === "string" ? p : String(p); 20073 const segments = path.split(/\/+/).map((segment, index, array) => { 20074 const isLastSegment = index === array.length - 1; 20075 // only apply the splat if it's the last segment 20076 if (isLastSegment && segment === "*") { 20077 const star = "*"; 20078 // Apply the splat 20079 return stringify(params[star]); 20080 } 20081 const keyMatch = segment.match(/^:([\w-]+)(\??)$/); 20082 if (keyMatch) { 20083 const [, key, optional] = keyMatch; 20084 let param = params[key]; 20085 invariant(optional === "?" || param != null, "Missing \":" + key + "\" param"); 20086 return stringify(param); 20087 } 20088 // Remove any optional markers from optional static segments 20089 return segment.replace(/\?$/g, ""); 20090 }) 20091 // Remove empty segments 20092 .filter(segment => !!segment); 20093 return prefix + segments.join("/"); 20094} 20095/** 20096 * Performs pattern matching on a URL pathname and returns information about 20097 * the match. 20098 * 20099 * @see https://reactrouter.com/v6/utils/match-path 20100 */ 20101function matchPath(pattern, pathname) { 20102 if (typeof pattern === "string") { 20103 pattern = { 20104 path: pattern, 20105 caseSensitive: false, 20106 end: true 20107 }; 20108 } 20109 let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end); 20110 let match = pathname.match(matcher); 20111 if (!match) return null; 20112 let matchedPathname = match[0]; 20113 let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1"); 20114 let captureGroups = match.slice(1); 20115 let params = compiledParams.reduce((memo, _ref, index) => { 20116 let { 20117 paramName, 20118 isOptional 20119 } = _ref; 20120 // We need to compute the pathnameBase here using the raw splat value 20121 // instead of using params["*"] later because it will be decoded then 20122 if (paramName === "*") { 20123 let splatValue = captureGroups[index] || ""; 20124 pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1"); 20125 } 20126 const value = captureGroups[index]; 20127 if (isOptional && !value) { 20128 memo[paramName] = undefined; 20129 } else { 20130 memo[paramName] = (value || "").replace(/%2F/g, "/"); 20131 } 20132 return memo; 20133 }, {}); 20134 return { 20135 params, 20136 pathname: matchedPathname, 20137 pathnameBase, 20138 pattern 20139 }; 20140} 20141function compilePath(path, caseSensitive, end) { 20142 if (caseSensitive === void 0) { 20143 caseSensitive = false; 20144 } 20145 if (end === void 0) { 20146 end = true; 20147 } 20148 warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")); 20149 let params = []; 20150 let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below 20151 .replace(/^\/*/, "/") // Make sure it has a leading / 20152 .replace(/[\\.*+^${}|()[\]]/g, "\\$&") // Escape special regex chars 20153 .replace(/\/:([\w-]+)(\?)?/g, (_, paramName, isOptional) => { 20154 params.push({ 20155 paramName, 20156 isOptional: isOptional != null 20157 }); 20158 return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)"; 20159 }); 20160 if (path.endsWith("*")) { 20161 params.push({ 20162 paramName: "*" 20163 }); 20164 regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest 20165 : "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"] 20166 } else if (end) { 20167 // When matching to the end, ignore trailing slashes 20168 regexpSource += "\\/*$"; 20169 } else if (path !== "" && path !== "/") { 20170 // If our path is non-empty and contains anything beyond an initial slash, 20171 // then we have _some_ form of path in our regex, so we should expect to 20172 // match only if we find the end of this path segment. Look for an optional 20173 // non-captured trailing slash (to match a portion of the URL) or the end 20174 // of the path (if we've matched to the end). We used to do this with a 20175 // word boundary but that gives false positives on routes like 20176 // /user-preferences since `-` counts as a word boundary. 20177 regexpSource += "(?:(?=\\/|$))"; 20178 } else ; 20179 let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i"); 20180 return [matcher, params]; 20181} 20182function decodePath(value) { 20183 try { 20184 return value.split("/").map(v => decodeURIComponent(v).replace(/\//g, "%2F")).join("/"); 20185 } catch (error) { 20186 warning(false, "The URL path \"" + value + "\" could not be decoded because it is is a " + "malformed URL segment. This is probably due to a bad percent " + ("encoding (" + error + ").")); 20187 return value; 20188 } 20189} 20190/** 20191 * @private 20192 */ 20193function stripBasename(pathname, basename) { 20194 if (basename === "/") return pathname; 20195 if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) { 20196 return null; 20197 } 20198 // We want to leave trailing slash behavior in the user's control, so if they 20199 // specify a basename with a trailing slash, we should support it 20200 let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length; 20201 let nextChar = pathname.charAt(startIndex); 20202 if (nextChar && nextChar !== "/") { 20203 // pathname does not start with basename/ 20204 return null; 20205 } 20206 return pathname.slice(startIndex) || "/"; 20207}
vendor: 17,953 bytes, lines 20208-20713
20208const ABSOLUTE_URL_REGEX$1 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i; 20209const isAbsoluteUrl = url => ABSOLUTE_URL_REGEX$1.test(url); 20210/** 20211 * Returns a resolved path object relative to the given pathname. 20212 * 20213 * @see https://reactrouter.com/v6/utils/resolve-path 20214 */ 20215function resolvePath(to, fromPathname) { 20216 if (fromPathname === void 0) { 20217 fromPathname = "/"; 20218 } 20219 let { 20220 pathname: toPathname, 20221 search = "", 20222 hash = "" 20223 } = typeof to === "string" ? parsePath(to) : to; 20224 let pathname; 20225 if (toPathname) { 20226 if (isAbsoluteUrl(toPathname)) { 20227 pathname = toPathname; 20228 } else { 20229 if (toPathname.includes("//")) { 20230 let oldPathname = toPathname; 20231 toPathname = removeDoubleSlashes(toPathname); 20232 warning(false, "Pathnames cannot have embedded double slashes - normalizing " + (oldPathname + " -> " + toPathname)); 20233 } 20234 if (toPathname.startsWith("/")) { 20235 pathname = resolvePathname(toPathname.substring(1), "/"); 20236 } else { 20237 pathname = resolvePathname(toPathname, fromPathname); 20238 } 20239 } 20240 } else { 20241 pathname = fromPathname; 20242 } 20243 return { 20244 pathname, 20245 search: normalizeSearch(search), 20246 hash: normalizeHash(hash) 20247 }; 20248} 20249function resolvePathname(relativePath, fromPathname) { 20250 let segments = fromPathname.replace(/\/+$/, "").split("/"); 20251 let relativeSegments = relativePath.split("/"); 20252 relativeSegments.forEach(segment => { 20253 if (segment === "..") { 20254 // Keep the root "" segment so the pathname starts at / 20255 if (segments.length > 1) segments.pop(); 20256 } else if (segment !== ".") { 20257 segments.push(segment); 20258 } 20259 }); 20260 return segments.length > 1 ? segments.join("/") : "/"; 20261} 20262function getInvalidPathError(char, field, dest, path) { 20263 return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + "a string in <Link to=\"...\"> and the router will parse it for you."; 20264} 20265/** 20266 * @private 20267 * 20268 * When processing relative navigation we want to ignore ancestor routes that 20269 * do not contribute to the path, such that index/pathless layout routes don't 20270 * interfere. 20271 * 20272 * For example, when moving a route element into an index route and/or a 20273 * pathless layout route, relative link behavior contained within should stay 20274 * the same. Both of the following examples should link back to the root: 20275 * 20276 * <Route path="/"> 20277 * <Route path="accounts" element={<Link to=".."}> 20278 * </Route> 20279 * 20280 * <Route path="/"> 20281 * <Route path="accounts"> 20282 * <Route element={<AccountsLayout />}> // <-- Does not contribute 20283 * <Route index element={<Link to=".."} /> // <-- Does not contribute 20284 * </Route 20285 * </Route> 20286 * </Route> 20287 */ 20288function getPathContributingMatches(matches) { 20289 return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0); 20290} 20291// Return the array of pathnames for the current route matches - used to 20292// generate the routePathnames input for resolveTo() 20293function getResolveToMatches(matches, v7_relativeSplatPath) { 20294 let pathMatches = getPathContributingMatches(matches); 20295 // When v7_relativeSplatPath is enabled, use the full pathname for the leaf 20296 // match so we include splat values for "." links. See: 20297 // https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329 20298 if (v7_relativeSplatPath) { 20299 return pathMatches.map((match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase); 20300 } 20301 return pathMatches.map(match => match.pathnameBase); 20302} 20303/** 20304 * @private 20305 */ 20306function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) { 20307 if (isPathRelative === void 0) { 20308 isPathRelative = false; 20309 } 20310 let to; 20311 if (typeof toArg === "string") { 20312 to = parsePath(toArg); 20313 } else { 20314 to = _extends({}, toArg); 20315 invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to)); 20316 invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to)); 20317 invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to)); 20318 } 20319 let isEmptyPath = toArg === "" || to.pathname === ""; 20320 let toPathname = isEmptyPath ? "/" : to.pathname; 20321 let from; 20322 // Routing is relative to the current pathname if explicitly requested. 20323 // 20324 // If a pathname is explicitly provided in `to`, it should be relative to the 20325 // route context. This is explained in `Note on `<Link to>` values` in our 20326 // migration guide from v5 as a means of disambiguation between `to` values 20327 // that begin with `/` and those that do not. However, this is problematic for 20328 // `to` values that do not provide a pathname. `to` can simply be a search or 20329 // hash string, in which case we should assume that the navigation is relative 20330 // to the current location's pathname and *not* the route pathname. 20331 if (toPathname == null) { 20332 from = locationPathname; 20333 } else { 20334 let routePathnameIndex = routePathnames.length - 1; 20335 // With relative="route" (the default), each leading .. segment means 20336 // "go up one route" instead of "go up one URL segment". This is a key 20337 // difference from how <a href> works and a major reason we call this a 20338 // "to" value instead of a "href". 20339 if (!isPathRelative && toPathname.startsWith("..")) { 20340 let toSegments = toPathname.split("/"); 20341 while (toSegments[0] === "..") { 20342 toSegments.shift(); 20343 routePathnameIndex -= 1; 20344 } 20345 to.pathname = toSegments.join("/"); 20346 } 20347 from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/"; 20348 } 20349 let path = resolvePath(to, from); 20350 // Ensure the pathname has a trailing slash if the original "to" had one 20351 let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"); 20352 // Or if this was a link to the current path which has a trailing slash 20353 let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/"); 20354 if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) { 20355 path.pathname += "/"; 20356 } 20357 return path; 20358} 20359/** 20360 * @private 20361 */ 20362function getToPathname(to) { 20363 // Empty strings should be treated the same as / paths 20364 return to === "" || to.pathname === "" ? "/" : typeof to === "string" ? parsePath(to).pathname : to.pathname; 20365} 20366const removeDoubleSlashes = path => path.replace(/\/\/+/g, "/"); 20367/** 20368 * @private 20369 */ 20370const joinPaths = paths => removeDoubleSlashes(paths.join("/")); 20371/** 20372 * @private 20373 */ 20374const normalizePathname = pathname => pathname.replace(/\/+$/, "").replace(/^\/*/, "/"); 20375/** 20376 * @private 20377 */ 20378const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search; 20379/** 20380 * @private 20381 */ 20382const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash; 20383/** 20384 * This is a shortcut for creating `application/json` responses. Converts `data` 20385 * to JSON and sets the `Content-Type` header. 20386 * 20387 * @deprecated The `json` method is deprecated in favor of returning raw objects. 20388 * This method will be removed in v7. 20389 */ 20390const json = function json(data, init) { 20391 if (init === void 0) { 20392 init = {}; 20393 } 20394 let responseInit = typeof init === "number" ? { 20395 status: init 20396 } : init; 20397 let headers = new Headers(responseInit.headers); 20398 if (!headers.has("Content-Type")) { 20399 headers.set("Content-Type", "application/json; charset=utf-8"); 20400 } 20401 return new Response(JSON.stringify(data), _extends({}, responseInit, { 20402 headers 20403 })); 20404}; 20405class DataWithResponseInit { 20406 constructor(data, init) { 20407 this.type = "DataWithResponseInit"; 20408 this.data = data; 20409 this.init = init || null; 20410 } 20411} 20412/** 20413 * Create "responses" that contain `status`/`headers` without forcing 20414 * serialization into an actual `Response` - used by Remix single fetch 20415 */ 20416function data(data, init) { 20417 return new DataWithResponseInit(data, typeof init === "number" ? { 20418 status: init 20419 } : init); 20420} 20421class AbortedDeferredError extends Error {} 20422class DeferredData { 20423 constructor(data, responseInit) { 20424 this.pendingKeysSet = new Set(); 20425 this.subscribers = new Set(); 20426 this.deferredKeys = []; 20427 invariant(data && typeof data === "object" && !Array.isArray(data), "defer() only accepts plain objects"); 20428 // Set up an AbortController + Promise we can race against to exit early 20429 // cancellation 20430 let reject; 20431 this.abortPromise = new Promise((_, r) => reject = r); 20432 this.controller = new AbortController(); 20433 let onAbort = () => reject(new AbortedDeferredError("Deferred data aborted")); 20434 this.unlistenAbortSignal = () => this.controller.signal.removeEventListener("abort", onAbort); 20435 this.controller.signal.addEventListener("abort", onAbort); 20436 this.data = Object.entries(data).reduce((acc, _ref2) => { 20437 let [key, value] = _ref2; 20438 return Object.assign(acc, { 20439 [key]: this.trackPromise(key, value) 20440 }); 20441 }, {}); 20442 if (this.done) { 20443 // All incoming values were resolved 20444 this.unlistenAbortSignal(); 20445 } 20446 this.init = responseInit; 20447 } 20448 trackPromise(key, value) { 20449 if (!(value instanceof Promise)) { 20450 return value; 20451 } 20452 this.deferredKeys.push(key); 20453 this.pendingKeysSet.add(key); 20454 // We store a little wrapper promise that will be extended with 20455 // _data/_error props upon resolve/reject 20456 let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, undefined, data), error => this.onSettle(promise, key, error)); 20457 // Register rejection listeners to avoid uncaught promise rejections on 20458 // errors or aborted deferred values 20459 promise.catch(() => {}); 20460 Object.defineProperty(promise, "_tracked", { 20461 get: () => true 20462 }); 20463 return promise; 20464 } 20465 onSettle(promise, key, error, data) { 20466 if (this.controller.signal.aborted && error instanceof AbortedDeferredError) { 20467 this.unlistenAbortSignal(); 20468 Object.defineProperty(promise, "_error", { 20469 get: () => error 20470 }); 20471 return Promise.reject(error); 20472 } 20473 this.pendingKeysSet.delete(key); 20474 if (this.done) { 20475 // Nothing left to abort! 20476 this.unlistenAbortSignal(); 20477 } 20478 // If the promise was resolved/rejected with undefined, we'll throw an error as you 20479 // should always resolve with a value or null 20480 if (error === undefined && data === undefined) { 20481 let undefinedError = new Error("Deferred data for key \"" + key + "\" resolved/rejected with `undefined`, " + "you must resolve/reject with a value or `null`."); 20482 Object.defineProperty(promise, "_error", { 20483 get: () => undefinedError 20484 }); 20485 this.emit(false, key); 20486 return Promise.reject(undefinedError); 20487 } 20488 if (data === undefined) { 20489 Object.defineProperty(promise, "_error", { 20490 get: () => error 20491 }); 20492 this.emit(false, key); 20493 return Promise.reject(error); 20494 } 20495 Object.defineProperty(promise, "_data", { 20496 get: () => data 20497 }); 20498 this.emit(false, key); 20499 return data; 20500 } 20501 emit(aborted, settledKey) { 20502 this.subscribers.forEach(subscriber => subscriber(aborted, settledKey)); 20503 } 20504 subscribe(fn) { 20505 this.subscribers.add(fn); 20506 return () => this.subscribers.delete(fn); 20507 } 20508 cancel() { 20509 this.controller.abort(); 20510 this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k)); 20511 this.emit(true); 20512 } 20513 async resolveData(signal) { 20514 let aborted = false; 20515 if (!this.done) { 20516 let onAbort = () => this.cancel(); 20517 signal.addEventListener("abort", onAbort); 20518 aborted = await new Promise(resolve => { 20519 this.subscribe(aborted => { 20520 signal.removeEventListener("abort", onAbort); 20521 if (aborted || this.done) { 20522 resolve(aborted); 20523 } 20524 }); 20525 }); 20526 } 20527 return aborted; 20528 } 20529 get done() { 20530 return this.pendingKeysSet.size === 0; 20531 } 20532 get unwrappedData() { 20533 invariant(this.data !== null && this.done, "Can only unwrap data on initialized and settled deferreds"); 20534 return Object.entries(this.data).reduce((acc, _ref3) => { 20535 let [key, value] = _ref3; 20536 return Object.assign(acc, { 20537 [key]: unwrapTrackedPromise(value) 20538 }); 20539 }, {}); 20540 } 20541 get pendingKeys() { 20542 return Array.from(this.pendingKeysSet); 20543 } 20544} 20545function isTrackedPromise(value) { 20546 return value instanceof Promise && value._tracked === true; 20547} 20548function unwrapTrackedPromise(value) { 20549 if (!isTrackedPromise(value)) { 20550 return value; 20551 } 20552 if (value._error) { 20553 throw value._error; 20554 } 20555 return value._data; 20556} 20557/** 20558 * @deprecated The `defer` method is deprecated in favor of returning raw 20559 * objects. This method will be removed in v7. 20560 */ 20561const defer = function defer(data, init) { 20562 if (init === void 0) { 20563 init = {}; 20564 } 20565 let responseInit = typeof init === "number" ? { 20566 status: init 20567 } : init; 20568 return new DeferredData(data, responseInit); 20569}; 20570/** 20571 * A redirect response. Sets the status code and the `Location` header. 20572 * Defaults to "302 Found". 20573 */ 20574const redirect = function redirect(url, init) { 20575 if (init === void 0) { 20576 init = 302; 20577 } 20578 let responseInit = init; 20579 if (typeof responseInit === "number") { 20580 responseInit = { 20581 status: responseInit 20582 }; 20583 } else if (typeof responseInit.status === "undefined") { 20584 responseInit.status = 302; 20585 } 20586 let headers = new Headers(responseInit.headers); 20587 headers.set("Location", url); 20588 return new Response(null, _extends({}, responseInit, { 20589 headers 20590 })); 20591}; 20592/** 20593 * A redirect response that will force a document reload to the new location. 20594 * Sets the status code and the `Location` header. 20595 * Defaults to "302 Found". 20596 */ 20597const redirectDocument = (url, init) => { 20598 let response = redirect(url, init); 20599 response.headers.set("X-Remix-Reload-Document", "true"); 20600 return response; 20601}; 20602/** 20603 * A redirect response that will perform a `history.replaceState` instead of a 20604 * `history.pushState` for client-side navigation redirects. 20605 * Sets the status code and the `Location` header. 20606 * Defaults to "302 Found". 20607 */ 20608const replace = (url, init) => { 20609 let response = redirect(url, init); 20610 response.headers.set("X-Remix-Replace", "true"); 20611 return response; 20612}; 20613/** 20614 * @private 20615 * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies 20616 * 20617 * We don't export the class for public use since it's an implementation 20618 * detail, but we export the interface above so folks can build their own 20619 * abstractions around instances via isRouteErrorResponse() 20620 */ 20621class ErrorResponseImpl { 20622 constructor(status, statusText, data, internal) { 20623 if (internal === void 0) { 20624 internal = false; 20625 } 20626 this.status = status; 20627 this.statusText = statusText || ""; 20628 this.internal = internal; 20629 if (data instanceof Error) { 20630 this.data = data.toString(); 20631 this.error = data; 20632 } else { 20633 this.data = data; 20634 } 20635 } 20636} 20637/** 20638 * Check if the given error is an ErrorResponse generated from a 4xx/5xx 20639 * Response thrown from an action/loader 20640 */ 20641function isRouteErrorResponse(error) { 20642 return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error; 20643} 20644 20645const validMutationMethodsArr = ["post", "put", "patch", "delete"]; 20646const validMutationMethods = new Set(validMutationMethodsArr); 20647const validRequestMethodsArr = ["get", ...validMutationMethodsArr]; 20648const validRequestMethods = new Set(validRequestMethodsArr); 20649const redirectStatusCodes = new Set([301, 302, 303, 307, 308]); 20650const redirectPreserveMethodStatusCodes = new Set([307, 308]); 20651const IDLE_NAVIGATION = { 20652 state: "idle", 20653 location: undefined, 20654 formMethod: undefined, 20655 formAction: undefined, 20656 formEncType: undefined, 20657 formData: undefined, 20658 json: undefined, 20659 text: undefined 20660}; 20661const IDLE_FETCHER = { 20662 state: "idle", 20663 data: undefined, 20664 formMethod: undefined, 20665 formAction: undefined, 20666 formEncType: undefined, 20667 formData: undefined, 20668 json: undefined, 20669 text: undefined 20670}; 20671const IDLE_BLOCKER = { 20672 state: "unblocked", 20673 proceed: undefined, 20674 reset: undefined, 20675 location: undefined 20676}; 20677const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i; 20678const defaultMapRouteProperties = route => ({ 20679 hasErrorBoundary: Boolean(route.hasErrorBoundary) 20680}); 20681const TRANSITIONS_STORAGE_KEY = "remix-router-transitions"; 20682//#endregion 20683//////////////////////////////////////////////////////////////////////////////// 20684//#region createRouter 20685//////////////////////////////////////////////////////////////////////////////// 20686/** 20687 * Create a router and listen to history POP navigations 20688 */ 20689function createRouter(init) { 20690 const routerWindow = init.window ? init.window : typeof window !== "undefined" ? window : undefined; 20691 const isBrowser = typeof routerWindow !== "undefined" && typeof routerWindow.document !== "undefined" && typeof routerWindow.document.createElement !== "undefined"; 20692 const isServer = !isBrowser; 20693 invariant(init.routes.length > 0, "You must provide a non-empty routes array to createRouter"); 20694 let mapRouteProperties; 20695 if (init.mapRouteProperties) { 20696 mapRouteProperties = init.mapRouteProperties; 20697 } else if (init.detectErrorBoundary) { 20698 // If they are still using the deprecated version, wrap it with the new API 20699 let detectErrorBoundary = init.detectErrorBoundary; 20700 mapRouteProperties = route => ({ 20701 hasErrorBoundary: detectErrorBoundary(route) 20702 }); 20703 } else { 20704 mapRouteProperties = defaultMapRouteProperties; 20705 } 20706 // Routes keyed by ID 20707 let manifest = {}; 20708 // Routes in tree format for matching 20709 let dataRoutes = convertRoutesToDataRoutes(init.routes, mapRouteProperties, undefined, manifest); 20710 let inFlightDataRoutes; 20711 let basename = init.basename || "/"; 20712 let dataStrategyImpl = init.dataStrategy || defaultDataStrategy; 20713 let patchRoutesOnNavigationImpl = init.patchRoutesOnNavigation;
vendor: 1,344 bytes, lines 20713-20741
20713 20714 // Config driven behavior flags 20715 let future = _extends({ 20716 v7_fetcherPersist: false, 20717 v7_normalizeFormMethod: false, 20718 v7_partialHydration: false, 20719 v7_prependBasename: false, 20720 v7_relativeSplatPath: false, 20721 v7_skipActionErrorRevalidation: false 20722 }, init.future); 20723 // Cleanup function for history 20724 let unlistenHistory = null; 20725 // Externally-provided functions to call on all state changes 20726 let subscribers = new Set(); 20727 // Externally-provided object to hold scroll restoration locations during routing 20728 let savedScrollPositions = null; 20729 // Externally-provided function to get scroll restoration keys 20730 let getScrollRestorationKey = null; 20731 // Externally-provided function to get current scroll position 20732 let getScrollPosition = null; 20733 // One-time flag to control the initial hydration scroll restoration. Because 20734 // we don't get the saved positions from <ScrollRestoration /> until _after_ 20735 // the initial render, we need to manually trigger a separate updateState to 20736 // send along the restoreScrollPosition 20737 // Set to true if we have `hydrationData` since we assume we were SSR'd and that 20738 // SSR did the initial scroll restoration. 20739 let initialScrollRestored = init.hydrationData != null; 20740 let initialMatches = matchRoutes(dataRoutes, init.history.location, basename); 20741 let initialMatchesIsFOW = false;
vendor: 147,343 bytes, lines 20742-24390
20742 let initialErrors = null; 20743 if (initialMatches == null && !patchRoutesOnNavigationImpl) { 20744 // If we do not match a user-provided-route, fall back to the root 20745 // to allow the error boundary to take over 20746 let error = getInternalRouterError(404, { 20747 pathname: init.history.location.pathname 20748 }); 20749 let { 20750 matches, 20751 route 20752 } = getShortCircuitMatches(dataRoutes); 20753 initialMatches = matches; 20754 initialErrors = { 20755 [route.id]: error 20756 }; 20757 } 20758 // In SPA apps, if the user provided a patchRoutesOnNavigation implementation and 20759 // our initial match is a splat route, clear them out so we run through lazy 20760 // discovery on hydration in case there's a more accurate lazy route match. 20761 // In SSR apps (with `hydrationData`), we expect that the server will send 20762 // up the proper matched routes so we don't want to run lazy discovery on 20763 // initial hydration and want to hydrate into the splat route. 20764 if (initialMatches && !init.hydrationData) { 20765 let fogOfWar = checkFogOfWar(initialMatches, dataRoutes, init.history.location.pathname); 20766 if (fogOfWar.active) { 20767 initialMatches = null; 20768 } 20769 } 20770 let initialized; 20771 if (!initialMatches) { 20772 initialized = false; 20773 initialMatches = []; 20774 // If partial hydration and fog of war is enabled, we will be running 20775 // `patchRoutesOnNavigation` during hydration so include any partial matches as 20776 // the initial matches so we can properly render `HydrateFallback`'s 20777 if (future.v7_partialHydration) { 20778 let fogOfWar = checkFogOfWar(null, dataRoutes, init.history.location.pathname); 20779 if (fogOfWar.active && fogOfWar.matches) { 20780 initialMatchesIsFOW = true; 20781 initialMatches = fogOfWar.matches; 20782 } 20783 } 20784 } else if (initialMatches.some(m => m.route.lazy)) { 20785 // All initialMatches need to be loaded before we're ready. If we have lazy 20786 // functions around still then we'll need to run them in initialize() 20787 initialized = false; 20788 } else if (!initialMatches.some(m => m.route.loader)) { 20789 // If we've got no loaders to run, then we're good to go 20790 initialized = true; 20791 } else if (future.v7_partialHydration) { 20792 // If partial hydration is enabled, we're initialized so long as we were 20793 // provided with hydrationData for every route with a loader, and no loaders 20794 // were marked for explicit hydration 20795 let loaderData = init.hydrationData ? init.hydrationData.loaderData : null; 20796 let errors = init.hydrationData ? init.hydrationData.errors : null; 20797 // If errors exist, don't consider routes below the boundary 20798 if (errors) { 20799 let idx = initialMatches.findIndex(m => errors[m.route.id] !== undefined); 20800 initialized = initialMatches.slice(0, idx + 1).every(m => !shouldLoadRouteOnHydration(m.route, loaderData, errors)); 20801 } else { 20802 initialized = initialMatches.every(m => !shouldLoadRouteOnHydration(m.route, loaderData, errors)); 20803 } 20804 } else { 20805 // Without partial hydration - we're initialized if we were provided any 20806 // hydrationData - which is expected to be complete 20807 initialized = init.hydrationData != null; 20808 } 20809 let router; 20810 let state = { 20811 historyAction: init.history.action, 20812 location: init.history.location, 20813 matches: initialMatches, 20814 initialized, 20815 navigation: IDLE_NAVIGATION, 20816 // Don't restore on initial updateState() if we were SSR'd 20817 restoreScrollPosition: init.hydrationData != null ? false : null, 20818 preventScrollReset: false, 20819 revalidation: "idle", 20820 loaderData: init.hydrationData && init.hydrationData.loaderData || {}, 20821 actionData: init.hydrationData && init.hydrationData.actionData || null, 20822 errors: init.hydrationData && init.hydrationData.errors || initialErrors, 20823 fetchers: new Map(), 20824 blockers: new Map() 20825 }; 20826 // -- Stateful internal variables to manage navigations -- 20827 // Current navigation in progress (to be committed in completeNavigation) 20828 let pendingAction = Action.Pop; 20829 // Should the current navigation prevent the scroll reset if scroll cannot 20830 // be restored? 20831 let pendingPreventScrollReset = false; 20832 // AbortController for the active navigation 20833 let pendingNavigationController; 20834 // Should the current navigation enable document.startViewTransition? 20835 let pendingViewTransitionEnabled = false; 20836 // Store applied view transitions so we can apply them on POP 20837 let appliedViewTransitions = new Map(); 20838 // Cleanup function for persisting applied transitions to sessionStorage 20839 let removePageHideEventListener = null; 20840 // We use this to avoid touching history in completeNavigation if a 20841 // revalidation is entirely uninterrupted 20842 let isUninterruptedRevalidation = false; 20843 // Use this internal flag to force revalidation of all loaders: 20844 // - submissions (completed or interrupted) 20845 // - useRevalidator() 20846 // - X-Remix-Revalidate (from redirect) 20847 let isRevalidationRequired = false; 20848 // Use this internal array to capture routes that require revalidation due 20849 // to a cancelled deferred on action submission 20850 let cancelledDeferredRoutes = []; 20851 // Use this internal array to capture fetcher loads that were cancelled by an 20852 // action navigation and require revalidation 20853 let cancelledFetcherLoads = new Set(); 20854 // AbortControllers for any in-flight fetchers 20855 let fetchControllers = new Map(); 20856 // Track loads based on the order in which they started 20857 let incrementingLoadId = 0; 20858 // Track the outstanding pending navigation data load to be compared against 20859 // the globally incrementing load when a fetcher load lands after a completed 20860 // navigation 20861 let pendingNavigationLoadId = -1; 20862 // Fetchers that triggered data reloads as a result of their actions 20863 let fetchReloadIds = new Map(); 20864 // Fetchers that triggered redirect navigations 20865 let fetchRedirectIds = new Set(); 20866 // Most recent href/match for fetcher.load calls for fetchers 20867 let fetchLoadMatches = new Map(); 20868 // Ref-count mounted fetchers so we know when it's ok to clean them up 20869 let activeFetchers = new Map(); 20870 // Fetchers that have requested a delete when using v7_fetcherPersist, 20871 // they'll be officially removed after they return to idle 20872 let deletedFetchers = new Set(); 20873 // Store DeferredData instances for active route matches. When a 20874 // route loader returns defer() we stick one in here. Then, when a nested 20875 // promise resolves we update loaderData. If a new navigation starts we 20876 // cancel active deferreds for eliminated routes. 20877 let activeDeferreds = new Map(); 20878 // Store blocker functions in a separate Map outside of router state since 20879 // we don't need to update UI state if they change 20880 let blockerFunctions = new Map(); 20881 // Flag to ignore the next history update, so we can revert the URL change on 20882 // a POP navigation that was blocked by the user without touching router state 20883 let unblockBlockerHistoryUpdate = undefined; 20884 // Initialize the router, all side effects should be kicked off from here. 20885 // Implemented as a Fluent API for ease of: 20886 // let router = createRouter(init).initialize(); 20887 function initialize() { 20888 // If history informs us of a POP navigation, start the navigation but do not update 20889 // state. We'll update our own state once the navigation completes 20890 unlistenHistory = init.history.listen(_ref => { 20891 let { 20892 action: historyAction, 20893 location, 20894 delta 20895 } = _ref; 20896 // Ignore this event if it was just us resetting the URL from a 20897 // blocked POP navigation 20898 if (unblockBlockerHistoryUpdate) { 20899 unblockBlockerHistoryUpdate(); 20900 unblockBlockerHistoryUpdate = undefined; 20901 return; 20902 } 20903 warning(blockerFunctions.size === 0 || delta != null, "You are trying to use a blocker on a POP navigation to a location " + "that was not created by @remix-run/router. This will fail silently in " + "production. This can happen if you are navigating outside the router " + "via `window.history.pushState`/`window.location.hash` instead of using " + "router navigation APIs. This can also happen if you are using " + "createHashRouter and the user manually changes the URL."); 20904 let blockerKey = shouldBlockNavigation({ 20905 currentLocation: state.location, 20906 nextLocation: location, 20907 historyAction 20908 }); 20909 if (blockerKey && delta != null) { 20910 // Restore the URL to match the current UI, but don't update router state 20911 let nextHistoryUpdatePromise = new Promise(resolve => { 20912 unblockBlockerHistoryUpdate = resolve; 20913 }); 20914 init.history.go(delta * -1); 20915 // Put the blocker into a blocked state 20916 updateBlocker(blockerKey, { 20917 state: "blocked", 20918 location, 20919 proceed() { 20920 updateBlocker(blockerKey, { 20921 state: "proceeding", 20922 proceed: undefined, 20923 reset: undefined, 20924 location 20925 }); 20926 // Re-do the same POP navigation we just blocked, after the url 20927 // restoration is also complete. See: 20928 // https://github.com/remix-run/react-router/issues/11613 20929 nextHistoryUpdatePromise.then(() => init.history.go(delta)); 20930 }, 20931 reset() { 20932 let blockers = new Map(state.blockers); 20933 blockers.set(blockerKey, IDLE_BLOCKER); 20934 updateState({ 20935 blockers 20936 }); 20937 } 20938 }); 20939 return; 20940 } 20941 return startNavigation(historyAction, location); 20942 }); 20943 if (isBrowser) { 20944 // FIXME: This feels gross. How can we cleanup the lines between 20945 // scrollRestoration/appliedTransitions persistance? 20946 restoreAppliedTransitions(routerWindow, appliedViewTransitions); 20947 let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions); 20948 routerWindow.addEventListener("pagehide", _saveAppliedTransitions); 20949 removePageHideEventListener = () => routerWindow.removeEventListener("pagehide", _saveAppliedTransitions); 20950 } 20951 // Kick off initial data load if needed. Use Pop to avoid modifying history 20952 // Note we don't do any handling of lazy here. For SPA's it'll get handled 20953 // in the normal navigation flow. For SSR it's expected that lazy modules are 20954 // resolved prior to router creation since we can't go into a fallbackElement 20955 // UI for SSR'd apps 20956 if (!state.initialized) { 20957 startNavigation(Action.Pop, state.location, { 20958 initialHydration: true 20959 }); 20960 } 20961 return router; 20962 } 20963 // Clean up a router and it's side effects 20964 function dispose() { 20965 if (unlistenHistory) { 20966 unlistenHistory(); 20967 } 20968 if (removePageHideEventListener) { 20969 removePageHideEventListener(); 20970 } 20971 subscribers.clear(); 20972 pendingNavigationController && pendingNavigationController.abort(); 20973 state.fetchers.forEach((_, key) => deleteFetcher(key)); 20974 state.blockers.forEach((_, key) => deleteBlocker(key)); 20975 } 20976 // Subscribe to state updates for the router 20977 function subscribe(fn) { 20978 subscribers.add(fn); 20979 return () => subscribers.delete(fn); 20980 } 20981 // Update our state and notify the calling context of the change 20982 function updateState(newState, opts) { 20983 if (opts === void 0) { 20984 opts = {}; 20985 } 20986 state = _extends({}, state, newState); 20987 // Prep fetcher cleanup so we can tell the UI which fetcher data entries 20988 // can be removed 20989 let completedFetchers = []; 20990 let deletedFetchersKeys = []; 20991 if (future.v7_fetcherPersist) { 20992 state.fetchers.forEach((fetcher, key) => { 20993 if (fetcher.state === "idle") { 20994 if (deletedFetchers.has(key)) { 20995 // Unmounted from the UI and can be totally removed 20996 deletedFetchersKeys.push(key); 20997 } else { 20998 // Returned to idle but still mounted in the UI, so semi-remains for 20999 // revalidations and such 21000 completedFetchers.push(key); 21001 } 21002 } 21003 }); 21004 } 21005 // Remove any lingering deleted fetchers that have already been removed 21006 // from state.fetchers 21007 deletedFetchers.forEach(key => { 21008 if (!state.fetchers.has(key) && !fetchControllers.has(key)) { 21009 deletedFetchersKeys.push(key); 21010 } 21011 }); 21012 // Iterate over a local copy so that if flushSync is used and we end up 21013 // removing and adding a new subscriber due to the useCallback dependencies, 21014 // we don't get ourselves into a loop calling the new subscriber immediately 21015 [...subscribers].forEach(subscriber => subscriber(state, { 21016 deletedFetchers: deletedFetchersKeys, 21017 viewTransitionOpts: opts.viewTransitionOpts, 21018 flushSync: opts.flushSync === true 21019 })); 21020 // Remove idle fetchers from state since we only care about in-flight fetchers. 21021 if (future.v7_fetcherPersist) { 21022 completedFetchers.forEach(key => state.fetchers.delete(key)); 21023 deletedFetchersKeys.forEach(key => deleteFetcher(key)); 21024 } else { 21025 // We already called deleteFetcher() on these, can remove them from this 21026 // Set now that we've handed the keys off to the data layer 21027 deletedFetchersKeys.forEach(key => deletedFetchers.delete(key)); 21028 } 21029 } 21030 // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION 21031 // and setting state.[historyAction/location/matches] to the new route. 21032 // - Location is a required param 21033 // - Navigation will always be set to IDLE_NAVIGATION 21034 // - Can pass any other state in newState 21035 function completeNavigation(location, newState, _temp) { 21036 var _location$state, _location$state2; 21037 let { 21038 flushSync 21039 } = _temp === void 0 ? {} : _temp; 21040 // Deduce if we're in a loading/actionReload state: 21041 // - We have committed actionData in the store 21042 // - The current navigation was a mutation submission 21043 // - We're past the submitting state and into the loading state 21044 // - The location being loaded is not the result of a redirect 21045 let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true; 21046 let actionData; 21047 if (newState.actionData) { 21048 if (Object.keys(newState.actionData).length > 0) { 21049 actionData = newState.actionData; 21050 } else { 21051 // Empty actionData -> clear prior actionData due to an action error 21052 actionData = null; 21053 } 21054 } else if (isActionReload) { 21055 // Keep the current data if we're wrapping up the action reload 21056 actionData = state.actionData; 21057 } else { 21058 // Clear actionData on any other completed navigations 21059 actionData = null; 21060 } 21061 // Always preserve any existing loaderData from re-used routes 21062 let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData; 21063 // On a successful navigation we can assume we got through all blockers 21064 // so we can start fresh 21065 let blockers = state.blockers; 21066 if (blockers.size > 0) { 21067 blockers = new Map(blockers); 21068 blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER)); 21069 } 21070 // Always respect the user flag. Otherwise don't reset on mutation 21071 // submission navigations unless they redirect 21072 let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location.state) == null ? void 0 : _location$state2._isRedirect) !== true; 21073 // Commit any in-flight routes at the end of the HMR revalidation "navigation" 21074 if (inFlightDataRoutes) { 21075 dataRoutes = inFlightDataRoutes; 21076 inFlightDataRoutes = undefined; 21077 } 21078 if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) { 21079 init.history.push(location, location.state); 21080 } else if (pendingAction === Action.Replace) { 21081 init.history.replace(location, location.state); 21082 } 21083 let viewTransitionOpts; 21084 // On POP, enable transitions if they were enabled on the original navigation 21085 if (pendingAction === Action.Pop) { 21086 // Forward takes precedence so they behave like the original navigation 21087 let priorPaths = appliedViewTransitions.get(state.location.pathname); 21088 if (priorPaths && priorPaths.has(location.pathname)) { 21089 viewTransitionOpts = { 21090 currentLocation: state.location, 21091 nextLocation: location 21092 }; 21093 } else if (appliedViewTransitions.has(location.pathname)) { 21094 // If we don't have a previous forward nav, assume we're popping back to 21095 // the new location and enable if that location previously enabled 21096 viewTransitionOpts = { 21097 currentLocation: location, 21098 nextLocation: state.location 21099 }; 21100 } 21101 } else if (pendingViewTransitionEnabled) { 21102 // Store the applied transition on PUSH/REPLACE 21103 let toPaths = appliedViewTransitions.get(state.location.pathname); 21104 if (toPaths) { 21105 toPaths.add(location.pathname); 21106 } else { 21107 toPaths = new Set([location.pathname]); 21108 appliedViewTransitions.set(state.location.pathname, toPaths); 21109 } 21110 viewTransitionOpts = { 21111 currentLocation: state.location, 21112 nextLocation: location 21113 }; 21114 } 21115 updateState(_extends({}, newState, { 21116 actionData, 21117 loaderData, 21118 historyAction: pendingAction, 21119 location, 21120 initialized: true, 21121 navigation: IDLE_NAVIGATION, 21122 revalidation: "idle", 21123 restoreScrollPosition: getSavedScrollPosition(location, newState.matches || state.matches), 21124 preventScrollReset, 21125 blockers 21126 }), { 21127 viewTransitionOpts, 21128 flushSync: flushSync === true 21129 }); 21130 // Reset stateful navigation vars 21131 pendingAction = Action.Pop; 21132 pendingPreventScrollReset = false; 21133 pendingViewTransitionEnabled = false; 21134 isUninterruptedRevalidation = false; 21135 isRevalidationRequired = false; 21136 cancelledDeferredRoutes = []; 21137 } 21138 // Trigger a navigation event, which can either be a numerical POP or a PUSH 21139 // replace with an optional submission 21140 async function navigate(to, opts) { 21141 if (typeof to === "number") { 21142 init.history.go(to); 21143 return; 21144 } 21145 let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, future.v7_relativeSplatPath, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative); 21146 let { 21147 path, 21148 submission, 21149 error 21150 } = normalizeNavigateOptions(future.v7_normalizeFormMethod, false, normalizedPath, opts); 21151 let currentLocation = state.location; 21152 let nextLocation = createLocation(state.location, path, opts && opts.state); 21153 // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded 21154 // URL from window.location, so we need to encode it here so the behavior 21155 // remains the same as POP and non-data-router usages. new URL() does all 21156 // the same encoding we'd get from a history.pushState/window.location read 21157 // without having to touch history 21158 nextLocation = _extends({}, nextLocation, init.history.encodeLocation(nextLocation)); 21159 let userReplace = opts && opts.replace != null ? opts.replace : undefined; 21160 let historyAction = Action.Push; 21161 if (userReplace === true) { 21162 historyAction = Action.Replace; 21163 } else if (userReplace === false) ; else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) { 21164 // By default on submissions to the current location we REPLACE so that 21165 // users don't have to double-click the back button to get to the prior 21166 // location. If the user redirects to a different location from the 21167 // action/loader this will be ignored and the redirect will be a PUSH 21168 historyAction = Action.Replace; 21169 } 21170 let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : undefined; 21171 let flushSync = (opts && opts.flushSync) === true; 21172 let blockerKey = shouldBlockNavigation({ 21173 currentLocation, 21174 nextLocation, 21175 historyAction 21176 }); 21177 if (blockerKey) { 21178 // Put the blocker into a blocked state 21179 updateBlocker(blockerKey, { 21180 state: "blocked", 21181 location: nextLocation, 21182 proceed() { 21183 updateBlocker(blockerKey, { 21184 state: "proceeding", 21185 proceed: undefined, 21186 reset: undefined, 21187 location: nextLocation 21188 }); 21189 // Send the same navigation through 21190 navigate(to, opts); 21191 }, 21192 reset() { 21193 let blockers = new Map(state.blockers); 21194 blockers.set(blockerKey, IDLE_BLOCKER); 21195 updateState({ 21196 blockers 21197 }); 21198 } 21199 }); 21200 return; 21201 } 21202 return await startNavigation(historyAction, nextLocation, { 21203 submission, 21204 // Send through the formData serialization error if we have one so we can 21205 // render at the right error boundary after we match routes 21206 pendingError: error, 21207 preventScrollReset, 21208 replace: opts && opts.replace, 21209 enableViewTransition: opts && opts.viewTransition, 21210 flushSync 21211 }); 21212 } 21213 // Revalidate all current loaders. If a navigation is in progress or if this 21214 // is interrupted by a navigation, allow this to "succeed" by calling all 21215 // loaders during the next loader round 21216 function revalidate() { 21217 interruptActiveLoads(); 21218 updateState({ 21219 revalidation: "loading" 21220 }); 21221 // If we're currently submitting an action, we don't need to start a new 21222 // navigation, we'll just let the follow up loader execution call all loaders 21223 if (state.navigation.state === "submitting") { 21224 return; 21225 } 21226 // If we're currently in an idle state, start a new navigation for the current 21227 // action/location and mark it as uninterrupted, which will skip the history 21228 // update in completeNavigation 21229 if (state.navigation.state === "idle") { 21230 startNavigation(state.historyAction, state.location, { 21231 startUninterruptedRevalidation: true 21232 }); 21233 return; 21234 } 21235 // Otherwise, if we're currently in a loading state, just start a new 21236 // navigation to the navigation.location but do not trigger an uninterrupted 21237 // revalidation so that history correctly updates once the navigation completes 21238 startNavigation(pendingAction || state.historyAction, state.navigation.location, { 21239 overrideNavigation: state.navigation, 21240 // Proxy through any rending view transition 21241 enableViewTransition: pendingViewTransitionEnabled === true 21242 }); 21243 } 21244 // Start a navigation to the given action/location. Can optionally provide a 21245 // overrideNavigation which will override the normalLoad in the case of a redirect 21246 // navigation 21247 async function startNavigation(historyAction, location, opts) { 21248 // Abort any in-progress navigations and start a new one. Unset any ongoing 21249 // uninterrupted revalidations unless told otherwise, since we want this 21250 // new navigation to update history normally 21251 pendingNavigationController && pendingNavigationController.abort(); 21252 pendingNavigationController = null; 21253 pendingAction = historyAction; 21254 isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; 21255 // Save the current scroll position every time we start a new navigation, 21256 // and track whether we should reset scroll on completion 21257 saveScrollPosition(state.location, state.matches); 21258 pendingPreventScrollReset = (opts && opts.preventScrollReset) === true; 21259 pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true; 21260 let routesToUse = inFlightDataRoutes || dataRoutes; 21261 let loadingNavigation = opts && opts.overrideNavigation; 21262 let matches = opts != null && opts.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ? 21263 // `matchRoutes()` has already been called if we're in here via `router.initialize()` 21264 state.matches : matchRoutes(routesToUse, location, basename); 21265 let flushSync = (opts && opts.flushSync) === true; 21266 // Short circuit if it's only a hash change and not a revalidation or 21267 // mutation submission. 21268 // 21269 // Ignore on initial page loads because since the initial hydration will always 21270 // be "same hash". For example, on /page#hash and submit a <Form method="post"> 21271 // which will default to a navigation to /page 21272 if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) { 21273 completeNavigation(location, { 21274 matches 21275 }, { 21276 flushSync 21277 }); 21278 return; 21279 } 21280 let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname); 21281 if (fogOfWar.active && fogOfWar.matches) { 21282 matches = fogOfWar.matches; 21283 } 21284 // Short circuit with a 404 on the root error boundary if we match nothing 21285 if (!matches) { 21286 let { 21287 error, 21288 notFoundMatches, 21289 route 21290 } = handleNavigational404(location.pathname); 21291 completeNavigation(location, { 21292 matches: notFoundMatches, 21293 loaderData: {}, 21294 errors: { 21295 [route.id]: error 21296 } 21297 }, { 21298 flushSync 21299 }); 21300 return; 21301 } 21302 // Create a controller/Request for this navigation 21303 pendingNavigationController = new AbortController(); 21304 let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission); 21305 let pendingActionResult; 21306 if (opts && opts.pendingError) { 21307 // If we have a pendingError, it means the user attempted a GET submission 21308 // with binary FormData so assign here and skip to handleLoaders. That 21309 // way we handle calling loaders above the boundary etc. It's not really 21310 // different from an actionError in that sense. 21311 pendingActionResult = [findNearestBoundary(matches).route.id, { 21312 type: ResultType.error, 21313 error: opts.pendingError 21314 }]; 21315 } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) { 21316 // Call action if we received an action submission 21317 let actionResult = await handleAction(request, location, opts.submission, matches, fogOfWar.active, { 21318 replace: opts.replace, 21319 flushSync 21320 }); 21321 if (actionResult.shortCircuited) { 21322 return; 21323 } 21324 // If we received a 404 from handleAction, it's because we couldn't lazily 21325 // discover the destination route so we don't want to call loaders 21326 if (actionResult.pendingActionResult) { 21327 let [routeId, result] = actionResult.pendingActionResult; 21328 if (isErrorResult(result) && isRouteErrorResponse(result.error) && result.error.status === 404) { 21329 pendingNavigationController = null; 21330 completeNavigation(location, { 21331 matches: actionResult.matches, 21332 loaderData: {}, 21333 errors: { 21334 [routeId]: result.error 21335 } 21336 }); 21337 return; 21338 } 21339 } 21340 matches = actionResult.matches || matches; 21341 pendingActionResult = actionResult.pendingActionResult; 21342 loadingNavigation = getLoadingNavigation(location, opts.submission); 21343 flushSync = false; 21344 // No need to do fog of war matching again on loader execution 21345 fogOfWar.active = false; 21346 // Create a GET request for the loaders 21347 request = createClientSideRequest(init.history, request.url, request.signal); 21348 } 21349 // Call loaders 21350 let { 21351 shortCircuited, 21352 matches: updatedMatches, 21353 loaderData, 21354 errors 21355 } = await handleLoaders(request, location, matches, fogOfWar.active, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, opts && opts.initialHydration === true, flushSync, pendingActionResult); 21356 if (shortCircuited) { 21357 return; 21358 } 21359 // Clean up now that the action/loaders have completed. Don't clean up if 21360 // we short circuited because pendingNavigationController will have already 21361 // been assigned to a new controller for the next navigation 21362 pendingNavigationController = null; 21363 completeNavigation(location, _extends({ 21364 matches: updatedMatches || matches 21365 }, getActionDataForCommit(pendingActionResult), { 21366 loaderData, 21367 errors 21368 })); 21369 } 21370 // Call the action matched by the leaf route for this navigation and handle 21371 // redirects/errors 21372 async function handleAction(request, location, submission, matches, isFogOfWar, opts) { 21373 if (opts === void 0) { 21374 opts = {}; 21375 } 21376 interruptActiveLoads(); 21377 // Put us in a submitting state 21378 let navigation = getSubmittingNavigation(location, submission); 21379 updateState({ 21380 navigation 21381 }, { 21382 flushSync: opts.flushSync === true 21383 }); 21384 if (isFogOfWar) { 21385 let discoverResult = await discoverRoutes(matches, location.pathname, request.signal); 21386 if (discoverResult.type === "aborted") { 21387 return { 21388 shortCircuited: true 21389 }; 21390 } else if (discoverResult.type === "error") { 21391 let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id; 21392 return { 21393 matches: discoverResult.partialMatches, 21394 pendingActionResult: [boundaryId, { 21395 type: ResultType.error, 21396 error: discoverResult.error 21397 }] 21398 }; 21399 } else if (!discoverResult.matches) { 21400 let { 21401 notFoundMatches, 21402 error, 21403 route 21404 } = handleNavigational404(location.pathname); 21405 return { 21406 matches: notFoundMatches, 21407 pendingActionResult: [route.id, { 21408 type: ResultType.error, 21409 error 21410 }] 21411 }; 21412 } else { 21413 matches = discoverResult.matches; 21414 } 21415 } 21416 // Call our action and get the result 21417 let result; 21418 let actionMatch = getTargetMatch(matches, location); 21419 if (!actionMatch.route.action && !actionMatch.route.lazy) { 21420 result = { 21421 type: ResultType.error, 21422 error: getInternalRouterError(405, { 21423 method: request.method, 21424 pathname: location.pathname, 21425 routeId: actionMatch.route.id 21426 }) 21427 }; 21428 } else { 21429 let results = await callDataStrategy("action", state, request, [actionMatch], matches, null); 21430 result = results[actionMatch.route.id]; 21431 if (request.signal.aborted) { 21432 return { 21433 shortCircuited: true 21434 }; 21435 } 21436 } 21437 if (isRedirectResult(result)) { 21438 let replace; 21439 if (opts && opts.replace != null) { 21440 replace = opts.replace; 21441 } else { 21442 // If the user didn't explicity indicate replace behavior, replace if 21443 // we redirected to the exact same location we're currently at to avoid 21444 // double back-buttons 21445 let location = normalizeRedirectLocation(result.response.headers.get("Location"), new URL(request.url), basename, init.history); 21446 replace = location === state.location.pathname + state.location.search; 21447 } 21448 await startRedirectNavigation(request, result, true, { 21449 submission, 21450 replace 21451 }); 21452 return { 21453 shortCircuited: true 21454 }; 21455 } 21456 if (isDeferredResult(result)) { 21457 throw getInternalRouterError(400, { 21458 type: "defer-action" 21459 }); 21460 } 21461 if (isErrorResult(result)) { 21462 // Store off the pending error - we use it to determine which loaders 21463 // to call and will commit it when we complete the navigation 21464 let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); 21465 // By default, all submissions to the current location are REPLACE 21466 // navigations, but if the action threw an error that'll be rendered in 21467 // an errorElement, we fall back to PUSH so that the user can use the 21468 // back button to get back to the pre-submission form location to try 21469 // again 21470 if ((opts && opts.replace) !== true) { 21471 pendingAction = Action.Push; 21472 } 21473 return { 21474 matches, 21475 pendingActionResult: [boundaryMatch.route.id, result] 21476 }; 21477 } 21478 return { 21479 matches, 21480 pendingActionResult: [actionMatch.route.id, result] 21481 }; 21482 } 21483 // Call all applicable loaders for the given matches, handling redirects, 21484 // errors, etc. 21485 async function handleLoaders(request, location, matches, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace, initialHydration, flushSync, pendingActionResult) { 21486 // Figure out the right navigation we want to use for data loading 21487 let loadingNavigation = overrideNavigation || getLoadingNavigation(location, submission); 21488 // If this was a redirect from an action we don't have a "submission" but 21489 // we have it on the loading navigation so use that if available 21490 let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation); 21491 // If this is an uninterrupted revalidation, we remain in our current idle 21492 // state. If not, we need to switch to our loading state and load data, 21493 // preserving any new action data or existing action data (in the case of 21494 // a revalidation interrupting an actionReload) 21495 // If we have partialHydration enabled, then don't update the state for the 21496 // initial data load since it's not a "navigation" 21497 let shouldUpdateNavigationState = !isUninterruptedRevalidation && (!future.v7_partialHydration || !initialHydration); 21498 // When fog of war is enabled, we enter our `loading` state earlier so we 21499 // can discover new routes during the `loading` state. We skip this if 21500 // we've already run actions since we would have done our matching already. 21501 // If the children() function threw then, we want to proceed with the 21502 // partial matches it discovered. 21503 if (isFogOfWar) { 21504 if (shouldUpdateNavigationState) { 21505 let actionData = getUpdatedActionData(pendingActionResult); 21506 updateState(_extends({ 21507 navigation: loadingNavigation 21508 }, actionData !== undefined ? { 21509 actionData 21510 } : {}), { 21511 flushSync 21512 }); 21513 } 21514 let discoverResult = await discoverRoutes(matches, location.pathname, request.signal); 21515 if (discoverResult.type === "aborted") { 21516 return { 21517 shortCircuited: true 21518 }; 21519 } else if (discoverResult.type === "error") { 21520 let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id; 21521 return { 21522 matches: discoverResult.partialMatches, 21523 loaderData: {}, 21524 errors: { 21525 [boundaryId]: discoverResult.error 21526 } 21527 }; 21528 } else if (!discoverResult.matches) { 21529 let { 21530 error, 21531 notFoundMatches, 21532 route 21533 } = handleNavigational404(location.pathname); 21534 return { 21535 matches: notFoundMatches, 21536 loaderData: {}, 21537 errors: { 21538 [route.id]: error 21539 } 21540 }; 21541 } else { 21542 matches = discoverResult.matches; 21543 } 21544 } 21545 let routesToUse = inFlightDataRoutes || dataRoutes; 21546 let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, future.v7_partialHydration && initialHydration === true, future.v7_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult); 21547 // Cancel pending deferreds for no-longer-matched routes or routes we're 21548 // about to reload. Note that if this is an action reload we would have 21549 // already cancelled all pending deferreds so this would be a no-op 21550 cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId)); 21551 pendingNavigationLoadId = ++incrementingLoadId; 21552 // Short circuit if we have no loaders to run 21553 if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) { 21554 let updatedFetchers = markFetchRedirectsDone(); 21555 completeNavigation(location, _extends({ 21556 matches, 21557 loaderData: {}, 21558 // Commit pending error if we're short circuiting 21559 errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? { 21560 [pendingActionResult[0]]: pendingActionResult[1].error 21561 } : null 21562 }, getActionDataForCommit(pendingActionResult), updatedFetchers ? { 21563 fetchers: new Map(state.fetchers) 21564 } : {}), { 21565 flushSync 21566 }); 21567 return { 21568 shortCircuited: true 21569 }; 21570 } 21571 if (shouldUpdateNavigationState) { 21572 let updates = {}; 21573 if (!isFogOfWar) { 21574 // Only update navigation/actionNData if we didn't already do it above 21575 updates.navigation = loadingNavigation; 21576 let actionData = getUpdatedActionData(pendingActionResult); 21577 if (actionData !== undefined) { 21578 updates.actionData = actionData; 21579 } 21580 } 21581 if (revalidatingFetchers.length > 0) { 21582 updates.fetchers = getUpdatedRevalidatingFetchers(revalidatingFetchers); 21583 } 21584 updateState(updates, { 21585 flushSync 21586 }); 21587 } 21588 revalidatingFetchers.forEach(rf => { 21589 abortFetcher(rf.key); 21590 if (rf.controller) { 21591 // Fetchers use an independent AbortController so that aborting a fetcher 21592 // (via deleteFetcher) does not abort the triggering navigation that 21593 // triggered the revalidation 21594 fetchControllers.set(rf.key, rf.controller); 21595 } 21596 }); 21597 // Proxy navigation abort through to revalidation fetchers 21598 let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(f => abortFetcher(f.key)); 21599 if (pendingNavigationController) { 21600 pendingNavigationController.signal.addEventListener("abort", abortPendingFetchRevalidations); 21601 } 21602 let { 21603 loaderResults, 21604 fetcherResults 21605 } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, request); 21606 if (request.signal.aborted) { 21607 return { 21608 shortCircuited: true 21609 }; 21610 } 21611 // Clean up _after_ loaders have completed. Don't clean up if we short 21612 // circuited because fetchControllers would have been aborted and 21613 // reassigned to new controllers for the next navigation 21614 if (pendingNavigationController) { 21615 pendingNavigationController.signal.removeEventListener("abort", abortPendingFetchRevalidations); 21616 } 21617 revalidatingFetchers.forEach(rf => fetchControllers.delete(rf.key)); 21618 // If any loaders returned a redirect Response, start a new REPLACE navigation 21619 let redirect = findRedirect(loaderResults); 21620 if (redirect) { 21621 await startRedirectNavigation(request, redirect.result, true, { 21622 replace 21623 }); 21624 return { 21625 shortCircuited: true 21626 }; 21627 } 21628 redirect = findRedirect(fetcherResults); 21629 if (redirect) { 21630 // If this redirect came from a fetcher make sure we mark it in 21631 // fetchRedirectIds so it doesn't get revalidated on the next set of 21632 // loader executions 21633 fetchRedirectIds.add(redirect.key); 21634 await startRedirectNavigation(request, redirect.result, true, { 21635 replace 21636 }); 21637 return { 21638 shortCircuited: true 21639 }; 21640 } 21641 // Process and commit output from loaders 21642 let { 21643 loaderData, 21644 errors 21645 } = processLoaderData(state, matches, loaderResults, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds); 21646 // Wire up subscribers to update loaderData as promises settle 21647 activeDeferreds.forEach((deferredData, routeId) => { 21648 deferredData.subscribe(aborted => { 21649 // Note: No need to updateState here since the TrackedPromise on 21650 // loaderData is stable across resolve/reject 21651 // Remove this instance if we were aborted or if promises have settled 21652 if (aborted || deferredData.done) { 21653 activeDeferreds.delete(routeId); 21654 } 21655 }); 21656 }); 21657 // Preserve SSR errors during partial hydration 21658 if (future.v7_partialHydration && initialHydration && state.errors) { 21659 errors = _extends({}, state.errors, errors); 21660 } 21661 let updatedFetchers = markFetchRedirectsDone(); 21662 let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId); 21663 let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0; 21664 return _extends({ 21665 matches, 21666 loaderData, 21667 errors 21668 }, shouldUpdateFetchers ? { 21669 fetchers: new Map(state.fetchers) 21670 } : {}); 21671 } 21672 function getUpdatedActionData(pendingActionResult) { 21673 if (pendingActionResult && !isErrorResult(pendingActionResult[1])) { 21674 // This is cast to `any` currently because `RouteData`uses any and it 21675 // would be a breaking change to use any. 21676 // TODO: v7 - change `RouteData` to use `unknown` instead of `any` 21677 return { 21678 [pendingActionResult[0]]: pendingActionResult[1].data 21679 }; 21680 } else if (state.actionData) { 21681 if (Object.keys(state.actionData).length === 0) { 21682 return null; 21683 } else { 21684 return state.actionData; 21685 } 21686 } 21687 } 21688 function getUpdatedRevalidatingFetchers(revalidatingFetchers) { 21689 revalidatingFetchers.forEach(rf => { 21690 let fetcher = state.fetchers.get(rf.key); 21691 let revalidatingFetcher = getLoadingFetcher(undefined, fetcher ? fetcher.data : undefined); 21692 state.fetchers.set(rf.key, revalidatingFetcher); 21693 }); 21694 return new Map(state.fetchers); 21695 } 21696 // Trigger a fetcher load/submit for the given fetcher key 21697 function fetch(key, routeId, href, opts) { 21698 if (isServer) { 21699 throw new Error("router.fetch() was called during the server render, but it shouldn't be. " + "You are likely calling a useFetcher() method in the body of your component. " + "Try moving it to a useEffect or a callback."); 21700 } 21701 abortFetcher(key); 21702 let flushSync = (opts && opts.flushSync) === true; 21703 let routesToUse = inFlightDataRoutes || dataRoutes; 21704 let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, future.v7_relativeSplatPath, routeId, opts == null ? void 0 : opts.relative); 21705 let matches = matchRoutes(routesToUse, normalizedPath, basename); 21706 let fogOfWar = checkFogOfWar(matches, routesToUse, normalizedPath); 21707 if (fogOfWar.active && fogOfWar.matches) { 21708 matches = fogOfWar.matches; 21709 } 21710 if (!matches) { 21711 setFetcherError(key, routeId, getInternalRouterError(404, { 21712 pathname: normalizedPath 21713 }), { 21714 flushSync 21715 }); 21716 return; 21717 } 21718 let { 21719 path, 21720 submission, 21721 error 21722 } = normalizeNavigateOptions(future.v7_normalizeFormMethod, true, normalizedPath, opts); 21723 if (error) { 21724 setFetcherError(key, routeId, error, { 21725 flushSync 21726 }); 21727 return; 21728 } 21729 let match = getTargetMatch(matches, path); 21730 let preventScrollReset = (opts && opts.preventScrollReset) === true; 21731 if (submission && isMutationMethod(submission.formMethod)) { 21732 handleFetcherAction(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission); 21733 return; 21734 } 21735 // Store off the match so we can call it's shouldRevalidate on subsequent 21736 // revalidations 21737 fetchLoadMatches.set(key, { 21738 routeId, 21739 path 21740 }); 21741 handleFetcherLoader(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission); 21742 } 21743 // Call the action for the matched fetcher.submit(), and then handle redirects, 21744 // errors, and revalidation 21745 async function handleFetcherAction(key, routeId, path, match, requestMatches, isFogOfWar, flushSync, preventScrollReset, submission) { 21746 interruptActiveLoads(); 21747 fetchLoadMatches.delete(key); 21748 function detectAndHandle405Error(m) { 21749 if (!m.route.action && !m.route.lazy) { 21750 let error = getInternalRouterError(405, { 21751 method: submission.formMethod, 21752 pathname: path, 21753 routeId: routeId 21754 }); 21755 setFetcherError(key, routeId, error, { 21756 flushSync 21757 }); 21758 return true; 21759 } 21760 return false; 21761 } 21762 if (!isFogOfWar && detectAndHandle405Error(match)) { 21763 return; 21764 } 21765 // Put this fetcher into it's submitting state 21766 let existingFetcher = state.fetchers.get(key); 21767 updateFetcherState(key, getSubmittingFetcher(submission, existingFetcher), { 21768 flushSync 21769 }); 21770 let abortController = new AbortController(); 21771 let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission); 21772 if (isFogOfWar) { 21773 let discoverResult = await discoverRoutes(requestMatches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key); 21774 if (discoverResult.type === "aborted") { 21775 return; 21776 } else if (discoverResult.type === "error") { 21777 setFetcherError(key, routeId, discoverResult.error, { 21778 flushSync 21779 }); 21780 return; 21781 } else if (!discoverResult.matches) { 21782 setFetcherError(key, routeId, getInternalRouterError(404, { 21783 pathname: path 21784 }), { 21785 flushSync 21786 }); 21787 return; 21788 } else { 21789 requestMatches = discoverResult.matches; 21790 match = getTargetMatch(requestMatches, path); 21791 if (detectAndHandle405Error(match)) { 21792 return; 21793 } 21794 } 21795 } 21796 // Call the action for the fetcher 21797 fetchControllers.set(key, abortController); 21798 let originatingLoadId = incrementingLoadId; 21799 let actionResults = await callDataStrategy("action", state, fetchRequest, [match], requestMatches, key); 21800 let actionResult = actionResults[match.route.id]; 21801 if (fetchRequest.signal.aborted) { 21802 // We can delete this so long as we weren't aborted by our own fetcher 21803 // re-submit which would have put _new_ controller is in fetchControllers 21804 if (fetchControllers.get(key) === abortController) { 21805 fetchControllers.delete(key); 21806 } 21807 return; 21808 } 21809 // When using v7_fetcherPersist, we don't want errors bubbling up to the UI 21810 // or redirects processed for unmounted fetchers so we just revert them to 21811 // idle 21812 if (future.v7_fetcherPersist && deletedFetchers.has(key)) { 21813 if (isRedirectResult(actionResult) || isErrorResult(actionResult)) { 21814 updateFetcherState(key, getDoneFetcher(undefined)); 21815 return; 21816 } 21817 // Let SuccessResult's fall through for revalidation 21818 } else { 21819 if (isRedirectResult(actionResult)) { 21820 fetchControllers.delete(key); 21821 if (pendingNavigationLoadId > originatingLoadId) { 21822 // A new navigation was kicked off after our action started, so that 21823 // should take precedence over this redirect navigation. We already 21824 // set isRevalidationRequired so all loaders for the new route should 21825 // fire unless opted out via shouldRevalidate 21826 updateFetcherState(key, getDoneFetcher(undefined)); 21827 return; 21828 } else { 21829 fetchRedirectIds.add(key); 21830 updateFetcherState(key, getLoadingFetcher(submission)); 21831 return startRedirectNavigation(fetchRequest, actionResult, false, { 21832 fetcherSubmission: submission, 21833 preventScrollReset 21834 }); 21835 } 21836 } 21837 // Process any non-redirect errors thrown 21838 if (isErrorResult(actionResult)) { 21839 setFetcherError(key, routeId, actionResult.error); 21840 return; 21841 } 21842 } 21843 if (isDeferredResult(actionResult)) { 21844 throw getInternalRouterError(400, { 21845 type: "defer-action" 21846 }); 21847 } 21848 // Start the data load for current matches, or the next location if we're 21849 // in the middle of a navigation 21850 let nextLocation = state.navigation.location || state.location; 21851 let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal); 21852 let routesToUse = inFlightDataRoutes || dataRoutes; 21853 let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches; 21854 invariant(matches, "Didn't find any matches after fetcher action"); 21855 let loadId = ++incrementingLoadId; 21856 fetchReloadIds.set(key, loadId); 21857 let loadFetcher = getLoadingFetcher(submission, actionResult.data); 21858 state.fetchers.set(key, loadFetcher); 21859 let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, false, future.v7_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, [match.route.id, actionResult]); 21860 // Put all revalidating fetchers into the loading state, except for the 21861 // current fetcher which we want to keep in it's current loading state which 21862 // contains it's action submission info + action data 21863 revalidatingFetchers.filter(rf => rf.key !== key).forEach(rf => { 21864 let staleKey = rf.key; 21865 let existingFetcher = state.fetchers.get(staleKey); 21866 let revalidatingFetcher = getLoadingFetcher(undefined, existingFetcher ? existingFetcher.data : undefined); 21867 state.fetchers.set(staleKey, revalidatingFetcher); 21868 abortFetcher(staleKey); 21869 if (rf.controller) { 21870 fetchControllers.set(staleKey, rf.controller); 21871 } 21872 }); 21873 updateState({ 21874 fetchers: new Map(state.fetchers) 21875 }); 21876 let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(rf => abortFetcher(rf.key)); 21877 abortController.signal.addEventListener("abort", abortPendingFetchRevalidations); 21878 let { 21879 loaderResults, 21880 fetcherResults 21881 } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, revalidationRequest); 21882 if (abortController.signal.aborted) { 21883 return; 21884 } 21885 abortController.signal.removeEventListener("abort", abortPendingFetchRevalidations); 21886 fetchReloadIds.delete(key); 21887 fetchControllers.delete(key); 21888 revalidatingFetchers.forEach(r => fetchControllers.delete(r.key)); 21889 let redirect = findRedirect(loaderResults); 21890 if (redirect) { 21891 return startRedirectNavigation(revalidationRequest, redirect.result, false, { 21892 preventScrollReset 21893 }); 21894 } 21895 redirect = findRedirect(fetcherResults); 21896 if (redirect) { 21897 // If this redirect came from a fetcher make sure we mark it in 21898 // fetchRedirectIds so it doesn't get revalidated on the next set of 21899 // loader executions 21900 fetchRedirectIds.add(redirect.key); 21901 return startRedirectNavigation(revalidationRequest, redirect.result, false, { 21902 preventScrollReset 21903 }); 21904 } 21905 // Process and commit output from loaders 21906 let { 21907 loaderData, 21908 errors 21909 } = processLoaderData(state, matches, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds); 21910 // Since we let revalidations complete even if the submitting fetcher was 21911 // deleted, only put it back to idle if it hasn't been deleted 21912 if (state.fetchers.has(key)) { 21913 let doneFetcher = getDoneFetcher(actionResult.data); 21914 state.fetchers.set(key, doneFetcher); 21915 } 21916 abortStaleFetchLoads(loadId); 21917 // If we are currently in a navigation loading state and this fetcher is 21918 // more recent than the navigation, we want the newer data so abort the 21919 // navigation and complete it with the fetcher data 21920 if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) { 21921 invariant(pendingAction, "Expected pending action"); 21922 pendingNavigationController && pendingNavigationController.abort(); 21923 completeNavigation(state.navigation.location, { 21924 matches, 21925 loaderData, 21926 errors, 21927 fetchers: new Map(state.fetchers) 21928 }); 21929 } else { 21930 // otherwise just update with the fetcher data, preserving any existing 21931 // loaderData for loaders that did not need to reload. We have to 21932 // manually merge here since we aren't going through completeNavigation 21933 updateState({ 21934 errors, 21935 loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors), 21936 fetchers: new Map(state.fetchers) 21937 }); 21938 isRevalidationRequired = false; 21939 } 21940 } 21941 // Call the matched loader for fetcher.load(), handling redirects, errors, etc. 21942 async function handleFetcherLoader(key, routeId, path, match, matches, isFogOfWar, flushSync, preventScrollReset, submission) { 21943 let existingFetcher = state.fetchers.get(key); 21944 updateFetcherState(key, getLoadingFetcher(submission, existingFetcher ? existingFetcher.data : undefined), { 21945 flushSync 21946 }); 21947 let abortController = new AbortController(); 21948 let fetchRequest = createClientSideRequest(init.history, path, abortController.signal); 21949 if (isFogOfWar) { 21950 let discoverResult = await discoverRoutes(matches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key); 21951 if (discoverResult.type === "aborted") { 21952 return; 21953 } else if (discoverResult.type === "error") { 21954 setFetcherError(key, routeId, discoverResult.error, { 21955 flushSync 21956 }); 21957 return; 21958 } else if (!discoverResult.matches) { 21959 setFetcherError(key, routeId, getInternalRouterError(404, { 21960 pathname: path 21961 }), { 21962 flushSync 21963 }); 21964 return; 21965 } else { 21966 matches = discoverResult.matches; 21967 match = getTargetMatch(matches, path); 21968 } 21969 } 21970 // Call the loader for this fetcher route match 21971 fetchControllers.set(key, abortController); 21972 let originatingLoadId = incrementingLoadId; 21973 let results = await callDataStrategy("loader", state, fetchRequest, [match], matches, key); 21974 let result = results[match.route.id]; 21975 // Deferred isn't supported for fetcher loads, await everything and treat it 21976 // as a normal load. resolveDeferredData will return undefined if this 21977 // fetcher gets aborted, so we just leave result untouched and short circuit 21978 // below if that happens 21979 if (isDeferredResult(result)) { 21980 result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result; 21981 } 21982 // We can delete this so long as we weren't aborted by our our own fetcher 21983 // re-load which would have put _new_ controller is in fetchControllers 21984 if (fetchControllers.get(key) === abortController) { 21985 fetchControllers.delete(key); 21986 } 21987 if (fetchRequest.signal.aborted) { 21988 return; 21989 } 21990 // We don't want errors bubbling up or redirects followed for unmounted 21991 // fetchers, so short circuit here if it was removed from the UI 21992 if (deletedFetchers.has(key)) { 21993 updateFetcherState(key, getDoneFetcher(undefined)); 21994 return; 21995 } 21996 // If the loader threw a redirect Response, start a new REPLACE navigation 21997 if (isRedirectResult(result)) { 21998 if (pendingNavigationLoadId > originatingLoadId) { 21999 // A new navigation was kicked off after our loader started, so that 22000 // should take precedence over this redirect navigation 22001 updateFetcherState(key, getDoneFetcher(undefined)); 22002 return; 22003 } else { 22004 fetchRedirectIds.add(key); 22005 await startRedirectNavigation(fetchRequest, result, false, { 22006 preventScrollReset 22007 }); 22008 return; 22009 } 22010 } 22011 // Process any non-redirect errors thrown 22012 if (isErrorResult(result)) { 22013 setFetcherError(key, routeId, result.error); 22014 return; 22015 } 22016 invariant(!isDeferredResult(result), "Unhandled fetcher deferred data"); 22017 // Put the fetcher back into an idle state 22018 updateFetcherState(key, getDoneFetcher(result.data)); 22019 } 22020 /** 22021 * Utility function to handle redirects returned from an action or loader. 22022 * Normally, a redirect "replaces" the navigation that triggered it. So, for 22023 * example: 22024 * 22025 * - user is on /a 22026 * - user clicks a link to /b 22027 * - loader for /b redirects to /c 22028 * 22029 * In a non-JS app the browser would track the in-flight navigation to /b and 22030 * then replace it with /c when it encountered the redirect response. In 22031 * the end it would only ever update the URL bar with /c. 22032 * 22033 * In client-side routing using pushState/replaceState, we aim to emulate 22034 * this behavior and we also do not update history until the end of the 22035 * navigation (including processed redirects). This means that we never 22036 * actually touch history until we've processed redirects, so we just use 22037 * the history action from the original navigation (PUSH or REPLACE). 22038 */ 22039 async function startRedirectNavigation(request, redirect, isNavigation, _temp2) { 22040 let { 22041 submission, 22042 fetcherSubmission, 22043 preventScrollReset, 22044 replace 22045 } = _temp2 === void 0 ? {} : _temp2; 22046 if (redirect.response.headers.has("X-Remix-Revalidate")) { 22047 isRevalidationRequired = true; 22048 } 22049 let location = redirect.response.headers.get("Location"); 22050 invariant(location, "Expected a Location header on the redirect Response"); 22051 location = normalizeRedirectLocation(location, new URL(request.url), basename, init.history); 22052 let redirectLocation = createLocation(state.location, location, { 22053 _isRedirect: true 22054 }); 22055 if (isBrowser) { 22056 let isDocumentReload = false; 22057 if (redirect.response.headers.has("X-Remix-Reload-Document")) { 22058 // Hard reload if the response contained X-Remix-Reload-Document 22059 isDocumentReload = true; 22060 } else if (ABSOLUTE_URL_REGEX.test(location)) { 22061 const url = init.history.createURL(location); 22062 isDocumentReload = 22063 // Hard reload if it's an absolute URL to a new origin 22064 url.origin !== routerWindow.location.origin || 22065 // Hard reload if it's an absolute URL that does not match our basename 22066 stripBasename(url.pathname, basename) == null; 22067 } 22068 if (isDocumentReload) { 22069 if (replace) { 22070 routerWindow.location.replace(location); 22071 } else { 22072 routerWindow.location.assign(location); 22073 } 22074 return; 22075 } 22076 } 22077 // There's no need to abort on redirects, since we don't detect the 22078 // redirect until the action/loaders have settled 22079 pendingNavigationController = null; 22080 let redirectHistoryAction = replace === true || redirect.response.headers.has("X-Remix-Replace") ? Action.Replace : Action.Push; 22081 // Use the incoming submission if provided, fallback on the active one in 22082 // state.navigation 22083 let { 22084 formMethod, 22085 formAction, 22086 formEncType 22087 } = state.navigation; 22088 if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) { 22089 submission = getSubmissionFromNavigation(state.navigation); 22090 } 22091 // If this was a 307/308 submission we want to preserve the HTTP method and 22092 // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the 22093 // redirected location 22094 let activeSubmission = submission || fetcherSubmission; 22095 if (redirectPreserveMethodStatusCodes.has(redirect.response.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) { 22096 await startNavigation(redirectHistoryAction, redirectLocation, { 22097 submission: _extends({}, activeSubmission, { 22098 formAction: location 22099 }), 22100 // Preserve these flags across redirects 22101 preventScrollReset: preventScrollReset || pendingPreventScrollReset, 22102 enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined 22103 }); 22104 } else { 22105 // If we have a navigation submission, we will preserve it through the 22106 // redirect navigation 22107 let overrideNavigation = getLoadingNavigation(redirectLocation, submission); 22108 await startNavigation(redirectHistoryAction, redirectLocation, { 22109 overrideNavigation, 22110 // Send fetcher submissions through for shouldRevalidate 22111 fetcherSubmission, 22112 // Preserve these flags across redirects 22113 preventScrollReset: preventScrollReset || pendingPreventScrollReset, 22114 enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined 22115 }); 22116 } 22117 } 22118 // Utility wrapper for calling dataStrategy client-side without having to 22119 // pass around the manifest, mapRouteProperties, etc. 22120 async function callDataStrategy(type, state, request, matchesToLoad, matches, fetcherKey) { 22121 let results; 22122 let dataResults = {}; 22123 try { 22124 results = await callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties); 22125 } catch (e) { 22126 // If the outer dataStrategy method throws, just return the error for all 22127 // matches - and it'll naturally bubble to the root 22128 matchesToLoad.forEach(m => { 22129 dataResults[m.route.id] = { 22130 type: ResultType.error, 22131 error: e 22132 }; 22133 }); 22134 return dataResults; 22135 } 22136 for (let [routeId, result] of Object.entries(results)) { 22137 if (isRedirectDataStrategyResultResult(result)) { 22138 let response = result.result; 22139 dataResults[routeId] = { 22140 type: ResultType.redirect, 22141 response: normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename, future.v7_relativeSplatPath) 22142 }; 22143 } else { 22144 dataResults[routeId] = await convertDataStrategyResultToDataResult(result); 22145 } 22146 } 22147 return dataResults; 22148 } 22149 async function callLoadersAndMaybeResolveData(state, matches, matchesToLoad, fetchersToLoad, request) { 22150 let currentMatches = state.matches; 22151 // Kick off loaders and fetchers in parallel 22152 let loaderResultsPromise = callDataStrategy("loader", state, request, matchesToLoad, matches, null); 22153 let fetcherResultsPromise = Promise.all(fetchersToLoad.map(async f => { 22154 if (f.matches && f.match && f.controller) { 22155 let results = await callDataStrategy("loader", state, createClientSideRequest(init.history, f.path, f.controller.signal), [f.match], f.matches, f.key); 22156 let result = results[f.match.route.id]; 22157 // Fetcher results are keyed by fetcher key from here on out, not routeId 22158 return { 22159 [f.key]: result 22160 }; 22161 } else { 22162 return Promise.resolve({ 22163 [f.key]: { 22164 type: ResultType.error, 22165 error: getInternalRouterError(404, { 22166 pathname: f.path 22167 }) 22168 } 22169 }); 22170 } 22171 })); 22172 let loaderResults = await loaderResultsPromise; 22173 let fetcherResults = (await fetcherResultsPromise).reduce((acc, r) => Object.assign(acc, r), {}); 22174 await Promise.all([resolveNavigationDeferredResults(matches, loaderResults, request.signal, currentMatches, state.loaderData), resolveFetcherDeferredResults(matches, fetcherResults, fetchersToLoad)]); 22175 return { 22176 loaderResults, 22177 fetcherResults 22178 }; 22179 } 22180 function interruptActiveLoads() { 22181 // Every interruption triggers a revalidation 22182 isRevalidationRequired = true; 22183 // Cancel pending route-level deferreds and mark cancelled routes for 22184 // revalidation 22185 cancelledDeferredRoutes.push(...cancelActiveDeferreds()); 22186 // Abort in-flight fetcher loads 22187 fetchLoadMatches.forEach((_, key) => { 22188 if (fetchControllers.has(key)) { 22189 cancelledFetcherLoads.add(key); 22190 } 22191 abortFetcher(key); 22192 }); 22193 } 22194 function updateFetcherState(key, fetcher, opts) { 22195 if (opts === void 0) { 22196 opts = {}; 22197 } 22198 state.fetchers.set(key, fetcher); 22199 updateState({ 22200 fetchers: new Map(state.fetchers) 22201 }, { 22202 flushSync: (opts && opts.flushSync) === true 22203 }); 22204 } 22205 function setFetcherError(key, routeId, error, opts) { 22206 if (opts === void 0) { 22207 opts = {}; 22208 } 22209 let boundaryMatch = findNearestBoundary(state.matches, routeId); 22210 deleteFetcher(key); 22211 updateState({ 22212 errors: { 22213 [boundaryMatch.route.id]: error 22214 }, 22215 fetchers: new Map(state.fetchers) 22216 }, { 22217 flushSync: (opts && opts.flushSync) === true 22218 }); 22219 } 22220 function getFetcher(key) { 22221 activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1); 22222 // If this fetcher was previously marked for deletion, unmark it since we 22223 // have a new instance 22224 if (deletedFetchers.has(key)) { 22225 deletedFetchers.delete(key); 22226 } 22227 return state.fetchers.get(key) || IDLE_FETCHER; 22228 } 22229 function deleteFetcher(key) { 22230 let fetcher = state.fetchers.get(key); 22231 // Don't abort the controller if this is a deletion of a fetcher.submit() 22232 // in it's loading phase since - we don't want to abort the corresponding 22233 // revalidation and want them to complete and land 22234 if (fetchControllers.has(key) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))) { 22235 abortFetcher(key); 22236 } 22237 fetchLoadMatches.delete(key); 22238 fetchReloadIds.delete(key); 22239 fetchRedirectIds.delete(key); 22240 // If we opted into the flag we can clear this now since we're calling 22241 // deleteFetcher() at the end of updateState() and we've already handed the 22242 // deleted fetcher keys off to the data layer. 22243 // If not, we're eagerly calling deleteFetcher() and we need to keep this 22244 // Set populated until the next updateState call, and we'll clear 22245 // `deletedFetchers` then 22246 if (future.v7_fetcherPersist) { 22247 deletedFetchers.delete(key); 22248 } 22249 cancelledFetcherLoads.delete(key); 22250 state.fetchers.delete(key); 22251 } 22252 function deleteFetcherAndUpdateState(key) { 22253 let count = (activeFetchers.get(key) || 0) - 1; 22254 if (count <= 0) { 22255 activeFetchers.delete(key); 22256 deletedFetchers.add(key); 22257 if (!future.v7_fetcherPersist) { 22258 deleteFetcher(key); 22259 } 22260 } else { 22261 activeFetchers.set(key, count); 22262 } 22263 updateState({ 22264 fetchers: new Map(state.fetchers) 22265 }); 22266 } 22267 function abortFetcher(key) { 22268 let controller = fetchControllers.get(key); 22269 if (controller) { 22270 controller.abort(); 22271 fetchControllers.delete(key); 22272 } 22273 } 22274 function markFetchersDone(keys) { 22275 for (let key of keys) { 22276 let fetcher = getFetcher(key); 22277 let doneFetcher = getDoneFetcher(fetcher.data); 22278 state.fetchers.set(key, doneFetcher); 22279 } 22280 } 22281 function markFetchRedirectsDone() { 22282 let doneKeys = []; 22283 let updatedFetchers = false; 22284 for (let key of fetchRedirectIds) { 22285 let fetcher = state.fetchers.get(key); 22286 invariant(fetcher, "Expected fetcher: " + key); 22287 if (fetcher.state === "loading") { 22288 fetchRedirectIds.delete(key); 22289 doneKeys.push(key); 22290 updatedFetchers = true; 22291 } 22292 } 22293 markFetchersDone(doneKeys); 22294 return updatedFetchers; 22295 } 22296 function abortStaleFetchLoads(landedId) { 22297 let yeetedKeys = []; 22298 for (let [key, id] of fetchReloadIds) { 22299 if (id < landedId) { 22300 let fetcher = state.fetchers.get(key); 22301 invariant(fetcher, "Expected fetcher: " + key); 22302 if (fetcher.state === "loading") { 22303 abortFetcher(key); 22304 fetchReloadIds.delete(key); 22305 yeetedKeys.push(key); 22306 } 22307 } 22308 } 22309 markFetchersDone(yeetedKeys); 22310 return yeetedKeys.length > 0; 22311 } 22312 function getBlocker(key, fn) { 22313 let blocker = state.blockers.get(key) || IDLE_BLOCKER; 22314 if (blockerFunctions.get(key) !== fn) { 22315 blockerFunctions.set(key, fn); 22316 } 22317 return blocker; 22318 } 22319 function deleteBlocker(key) { 22320 state.blockers.delete(key); 22321 blockerFunctions.delete(key); 22322 } 22323 // Utility function to update blockers, ensuring valid state transitions 22324 function updateBlocker(key, newBlocker) { 22325 let blocker = state.blockers.get(key) || IDLE_BLOCKER; 22326 // Poor mans state machine :) 22327 // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM 22328 invariant(blocker.state === "unblocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "proceeding" || blocker.state === "blocked" && newBlocker.state === "unblocked" || blocker.state === "proceeding" && newBlocker.state === "unblocked", "Invalid blocker state transition: " + blocker.state + " -> " + newBlocker.state); 22329 let blockers = new Map(state.blockers); 22330 blockers.set(key, newBlocker); 22331 updateState({ 22332 blockers 22333 }); 22334 } 22335 function shouldBlockNavigation(_ref2) { 22336 let { 22337 currentLocation, 22338 nextLocation, 22339 historyAction 22340 } = _ref2; 22341 if (blockerFunctions.size === 0) { 22342 return; 22343 } 22344 // We ony support a single active blocker at the moment since we don't have 22345 // any compelling use cases for multi-blocker yet 22346 if (blockerFunctions.size > 1) { 22347 warning(false, "A router only supports one blocker at a time"); 22348 } 22349 let entries = Array.from(blockerFunctions.entries()); 22350 let [blockerKey, blockerFunction] = entries[entries.length - 1]; 22351 let blocker = state.blockers.get(blockerKey); 22352 if (blocker && blocker.state === "proceeding") { 22353 // If the blocker is currently proceeding, we don't need to re-check 22354 // it and can let this navigation continue 22355 return; 22356 } 22357 // At this point, we know we're unblocked/blocked so we need to check the 22358 // user-provided blocker function 22359 if (blockerFunction({ 22360 currentLocation, 22361 nextLocation, 22362 historyAction 22363 })) { 22364 return blockerKey; 22365 } 22366 } 22367 function handleNavigational404(pathname) { 22368 let error = getInternalRouterError(404, { 22369 pathname 22370 }); 22371 let routesToUse = inFlightDataRoutes || dataRoutes; 22372 let { 22373 matches, 22374 route 22375 } = getShortCircuitMatches(routesToUse); 22376 // Cancel all pending deferred on 404s since we don't keep any routes 22377 cancelActiveDeferreds(); 22378 return { 22379 notFoundMatches: matches, 22380 route, 22381 error 22382 }; 22383 } 22384 function cancelActiveDeferreds(predicate) { 22385 let cancelledRouteIds = []; 22386 activeDeferreds.forEach((dfd, routeId) => { 22387 if (!predicate || predicate(routeId)) { 22388 // Cancel the deferred - but do not remove from activeDeferreds here - 22389 // we rely on the subscribers to do that so our tests can assert proper 22390 // cleanup via _internalActiveDeferreds 22391 dfd.cancel(); 22392 cancelledRouteIds.push(routeId); 22393 activeDeferreds.delete(routeId); 22394 } 22395 }); 22396 return cancelledRouteIds; 22397 } 22398 // Opt in to capturing and reporting scroll positions during navigations, 22399 // used by the <ScrollRestoration> component 22400 function enableScrollRestoration(positions, getPosition, getKey) { 22401 savedScrollPositions = positions; 22402 getScrollPosition = getPosition; 22403 getScrollRestorationKey = getKey || null; 22404 // Perform initial hydration scroll restoration, since we miss the boat on 22405 // the initial updateState() because we've not yet rendered <ScrollRestoration/> 22406 // and therefore have no savedScrollPositions available 22407 if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) { 22408 initialScrollRestored = true; 22409 let y = getSavedScrollPosition(state.location, state.matches); 22410 if (y != null) { 22411 updateState({ 22412 restoreScrollPosition: y 22413 }); 22414 } 22415 } 22416 return () => { 22417 savedScrollPositions = null; 22418 getScrollPosition = null; 22419 getScrollRestorationKey = null; 22420 }; 22421 } 22422 function getScrollKey(location, matches) { 22423 if (getScrollRestorationKey) { 22424 let key = getScrollRestorationKey(location, matches.map(m => convertRouteMatchToUiMatch(m, state.loaderData))); 22425 return key || location.key; 22426 } 22427 return location.key; 22428 } 22429 function saveScrollPosition(location, matches) { 22430 if (savedScrollPositions && getScrollPosition) { 22431 let key = getScrollKey(location, matches); 22432 savedScrollPositions[key] = getScrollPosition(); 22433 } 22434 } 22435 function getSavedScrollPosition(location, matches) { 22436 if (savedScrollPositions) { 22437 let key = getScrollKey(location, matches); 22438 let y = savedScrollPositions[key]; 22439 if (typeof y === "number") { 22440 return y; 22441 } 22442 } 22443 return null; 22444 } 22445 function checkFogOfWar(matches, routesToUse, pathname) { 22446 if (patchRoutesOnNavigationImpl) { 22447 if (!matches) { 22448 let fogMatches = matchRoutesImpl(routesToUse, pathname, basename, true); 22449 return { 22450 active: true, 22451 matches: fogMatches || [] 22452 }; 22453 } else { 22454 if (Object.keys(matches[0].params).length > 0) { 22455 // If we matched a dynamic param or a splat, it might only be because 22456 // we haven't yet discovered other routes that would match with a 22457 // higher score. Call patchRoutesOnNavigation just to be sure 22458 let partialMatches = matchRoutesImpl(routesToUse, pathname, basename, true); 22459 return { 22460 active: true, 22461 matches: partialMatches 22462 }; 22463 } 22464 } 22465 } 22466 return { 22467 active: false, 22468 matches: null 22469 }; 22470 } 22471 async function discoverRoutes(matches, pathname, signal, fetcherKey) { 22472 if (!patchRoutesOnNavigationImpl) { 22473 return { 22474 type: "success", 22475 matches 22476 }; 22477 } 22478 let partialMatches = matches; 22479 while (true) { 22480 let isNonHMR = inFlightDataRoutes == null; 22481 let routesToUse = inFlightDataRoutes || dataRoutes; 22482 let localManifest = manifest; 22483 try { 22484 await patchRoutesOnNavigationImpl({ 22485 signal, 22486 path: pathname, 22487 matches: partialMatches, 22488 fetcherKey, 22489 patch: (routeId, children) => { 22490 if (signal.aborted) return; 22491 patchRoutesImpl(routeId, children, routesToUse, localManifest, mapRouteProperties); 22492 } 22493 }); 22494 } catch (e) { 22495 return { 22496 type: "error", 22497 error: e, 22498 partialMatches 22499 }; 22500 } finally { 22501 // If we are not in the middle of an HMR revalidation and we changed the 22502 // routes, provide a new identity so when we `updateState` at the end of 22503 // this navigation/fetch `router.routes` will be a new identity and 22504 // trigger a re-run of memoized `router.routes` dependencies. 22505 // HMR will already update the identity and reflow when it lands 22506 // `inFlightDataRoutes` in `completeNavigation` 22507 if (isNonHMR && !signal.aborted) { 22508 dataRoutes = [...dataRoutes]; 22509 } 22510 } 22511 if (signal.aborted) { 22512 return { 22513 type: "aborted" 22514 }; 22515 } 22516 let newMatches = matchRoutes(routesToUse, pathname, basename); 22517 if (newMatches) { 22518 return { 22519 type: "success", 22520 matches: newMatches 22521 }; 22522 } 22523 let newPartialMatches = matchRoutesImpl(routesToUse, pathname, basename, true); 22524 // Avoid loops if the second pass results in the same partial matches 22525 if (!newPartialMatches || partialMatches.length === newPartialMatches.length && partialMatches.every((m, i) => m.route.id === newPartialMatches[i].route.id)) { 22526 return { 22527 type: "success", 22528 matches: null 22529 }; 22530 } 22531 partialMatches = newPartialMatches; 22532 } 22533 } 22534 function _internalSetRoutes(newRoutes) { 22535 manifest = {}; 22536 inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties, undefined, manifest); 22537 } 22538 function patchRoutes(routeId, children) { 22539 let isNonHMR = inFlightDataRoutes == null; 22540 let routesToUse = inFlightDataRoutes || dataRoutes; 22541 patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties); 22542 // If we are not in the middle of an HMR revalidation and we changed the 22543 // routes, provide a new identity and trigger a reflow via `updateState` 22544 // to re-run memoized `router.routes` dependencies. 22545 // HMR will already update the identity and reflow when it lands 22546 // `inFlightDataRoutes` in `completeNavigation` 22547 if (isNonHMR) { 22548 dataRoutes = [...dataRoutes]; 22549 updateState({}); 22550 } 22551 } 22552 router = { 22553 get basename() { 22554 return basename; 22555 }, 22556 get future() { 22557 return future; 22558 }, 22559 get state() { 22560 return state; 22561 }, 22562 get routes() { 22563 return dataRoutes; 22564 }, 22565 get window() { 22566 return routerWindow; 22567 }, 22568 initialize, 22569 subscribe, 22570 enableScrollRestoration, 22571 navigate, 22572 fetch, 22573 revalidate, 22574 // Passthrough to history-aware createHref used by useHref so we get proper 22575 // hash-aware URLs in DOM paths 22576 createHref: to => init.history.createHref(to), 22577 encodeLocation: to => init.history.encodeLocation(to), 22578 getFetcher, 22579 deleteFetcher: deleteFetcherAndUpdateState, 22580 dispose, 22581 getBlocker, 22582 deleteBlocker, 22583 patchRoutes, 22584 _internalFetchControllers: fetchControllers, 22585 _internalActiveDeferreds: activeDeferreds, 22586 // TODO: Remove setRoutes, it's temporary to avoid dealing with 22587 // updating the tree while validating the update algorithm. 22588 _internalSetRoutes 22589 }; 22590 return router; 22591} 22592//#endregion 22593//////////////////////////////////////////////////////////////////////////////// 22594//#region createStaticHandler 22595//////////////////////////////////////////////////////////////////////////////// 22596const UNSAFE_DEFERRED_SYMBOL = Symbol("deferred"); 22597function createStaticHandler(routes, opts) { 22598 invariant(routes.length > 0, "You must provide a non-empty routes array to createStaticHandler"); 22599 let manifest = {}; 22600 let basename = (opts ? opts.basename : null) || "/"; 22601 let mapRouteProperties; 22602 if (opts != null && opts.mapRouteProperties) { 22603 mapRouteProperties = opts.mapRouteProperties; 22604 } else if (opts != null && opts.detectErrorBoundary) { 22605 // If they are still using the deprecated version, wrap it with the new API 22606 let detectErrorBoundary = opts.detectErrorBoundary; 22607 mapRouteProperties = route => ({ 22608 hasErrorBoundary: detectErrorBoundary(route) 22609 }); 22610 } else { 22611 mapRouteProperties = defaultMapRouteProperties; 22612 } 22613 // Config driven behavior flags 22614 let future = _extends({ 22615 v7_relativeSplatPath: false, 22616 v7_throwAbortReason: false 22617 }, opts ? opts.future : null); 22618 let dataRoutes = convertRoutesToDataRoutes(routes, mapRouteProperties, undefined, manifest); 22619 /** 22620 * The query() method is intended for document requests, in which we want to 22621 * call an optional action and potentially multiple loaders for all nested 22622 * routes. It returns a StaticHandlerContext object, which is very similar 22623 * to the router state (location, loaderData, actionData, errors, etc.) and 22624 * also adds SSR-specific information such as the statusCode and headers 22625 * from action/loaders Responses. 22626 * 22627 * It _should_ never throw and should report all errors through the 22628 * returned context.errors object, properly associating errors to their error 22629 * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be 22630 * used to emulate React error boundaries during SSr by performing a second 22631 * pass only down to the boundaryId. 22632 * 22633 * The one exception where we do not return a StaticHandlerContext is when a 22634 * redirect response is returned or thrown from any action/loader. We 22635 * propagate that out and return the raw Response so the HTTP server can 22636 * return it directly. 22637 * 22638 * - `opts.requestContext` is an optional server context that will be passed 22639 * to actions/loaders in the `context` parameter 22640 * - `opts.skipLoaderErrorBubbling` is an optional parameter that will prevent 22641 * the bubbling of errors which allows single-fetch-type implementations 22642 * where the client will handle the bubbling and we may need to return data 22643 * for the handling route 22644 */ 22645 async function query(request, _temp3) { 22646 let { 22647 requestContext, 22648 skipLoaderErrorBubbling, 22649 dataStrategy 22650 } = _temp3 === void 0 ? {} : _temp3; 22651 let url = new URL(request.url); 22652 let method = request.method; 22653 let location = createLocation("", createPath(url), null, "default"); 22654 let matches = matchRoutes(dataRoutes, location, basename); 22655 // SSR supports HEAD requests while SPA doesn't 22656 if (!isValidMethod(method) && method !== "HEAD") { 22657 let error = getInternalRouterError(405, { 22658 method 22659 }); 22660 let { 22661 matches: methodNotAllowedMatches, 22662 route 22663 } = getShortCircuitMatches(dataRoutes); 22664 return { 22665 basename, 22666 location, 22667 matches: methodNotAllowedMatches, 22668 loaderData: {}, 22669 actionData: null, 22670 errors: { 22671 [route.id]: error 22672 }, 22673 statusCode: error.status, 22674 loaderHeaders: {}, 22675 actionHeaders: {}, 22676 activeDeferreds: null 22677 }; 22678 } else if (!matches) { 22679 let error = getInternalRouterError(404, { 22680 pathname: location.pathname 22681 }); 22682 let { 22683 matches: notFoundMatches, 22684 route 22685 } = getShortCircuitMatches(dataRoutes); 22686 return { 22687 basename, 22688 location, 22689 matches: notFoundMatches, 22690 loaderData: {}, 22691 actionData: null, 22692 errors: { 22693 [route.id]: error 22694 }, 22695 statusCode: error.status, 22696 loaderHeaders: {}, 22697 actionHeaders: {}, 22698 activeDeferreds: null 22699 }; 22700 } 22701 let result = await queryImpl(request, location, matches, requestContext, dataStrategy || null, skipLoaderErrorBubbling === true, null); 22702 if (isResponse(result)) { 22703 return result; 22704 } 22705 // When returning StaticHandlerContext, we patch back in the location here 22706 // since we need it for React Context. But this helps keep our submit and 22707 // loadRouteData operating on a Request instead of a Location 22708 return _extends({ 22709 location, 22710 basename 22711 }, result); 22712 } 22713 /** 22714 * The queryRoute() method is intended for targeted route requests, either 22715 * for fetch ?_data requests or resource route requests. In this case, we 22716 * are only ever calling a single action or loader, and we are returning the 22717 * returned value directly. In most cases, this will be a Response returned 22718 * from the action/loader, but it may be a primitive or other value as well - 22719 * and in such cases the calling context should handle that accordingly. 22720 * 22721 * We do respect the throw/return differentiation, so if an action/loader 22722 * throws, then this method will throw the value. This is important so we 22723 * can do proper boundary identification in Remix where a thrown Response 22724 * must go to the Catch Boundary but a returned Response is happy-path. 22725 * 22726 * One thing to note is that any Router-initiated Errors that make sense 22727 * to associate with a status code will be thrown as an ErrorResponse 22728 * instance which include the raw Error, such that the calling context can 22729 * serialize the error as they see fit while including the proper response 22730 * code. Examples here are 404 and 405 errors that occur prior to reaching 22731 * any user-defined loaders. 22732 * 22733 * - `opts.routeId` allows you to specify the specific route handler to call. 22734 * If not provided the handler will determine the proper route by matching 22735 * against `request.url` 22736 * - `opts.requestContext` is an optional server context that will be passed 22737 * to actions/loaders in the `context` parameter 22738 */ 22739 async function queryRoute(request, _temp4) { 22740 let { 22741 routeId, 22742 requestContext, 22743 dataStrategy 22744 } = _temp4 === void 0 ? {} : _temp4; 22745 let url = new URL(request.url); 22746 let method = request.method; 22747 let location = createLocation("", createPath(url), null, "default"); 22748 let matches = matchRoutes(dataRoutes, location, basename); 22749 // SSR supports HEAD requests while SPA doesn't 22750 if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") { 22751 throw getInternalRouterError(405, { 22752 method 22753 }); 22754 } else if (!matches) { 22755 throw getInternalRouterError(404, { 22756 pathname: location.pathname 22757 }); 22758 } 22759 let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location); 22760 if (routeId && !match) { 22761 throw getInternalRouterError(403, { 22762 pathname: location.pathname, 22763 routeId 22764 }); 22765 } else if (!match) { 22766 // This should never hit I don't think? 22767 throw getInternalRouterError(404, { 22768 pathname: location.pathname 22769 }); 22770 } 22771 let result = await queryImpl(request, location, matches, requestContext, dataStrategy || null, false, match); 22772 if (isResponse(result)) { 22773 return result; 22774 } 22775 let error = result.errors ? Object.values(result.errors)[0] : undefined; 22776 if (error !== undefined) { 22777 // If we got back result.errors, that means the loader/action threw 22778 // _something_ that wasn't a Response, but it's not guaranteed/required 22779 // to be an `instanceof Error` either, so we have to use throw here to 22780 // preserve the "error" state outside of queryImpl. 22781 throw error; 22782 } 22783 // Pick off the right state value to return 22784 if (result.actionData) { 22785 return Object.values(result.actionData)[0]; 22786 } 22787 if (result.loaderData) { 22788 var _result$activeDeferre; 22789 let data = Object.values(result.loaderData)[0]; 22790 if ((_result$activeDeferre = result.activeDeferreds) != null && _result$activeDeferre[match.route.id]) { 22791 data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id]; 22792 } 22793 return data; 22794 } 22795 return undefined; 22796 } 22797 async function queryImpl(request, location, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch) { 22798 invariant(request.signal, "query()/queryRoute() requests must contain an AbortController signal"); 22799 try { 22800 if (isMutationMethod(request.method.toLowerCase())) { 22801 let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch != null); 22802 return result; 22803 } 22804 let result = await loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch); 22805 return isResponse(result) ? result : _extends({}, result, { 22806 actionData: null, 22807 actionHeaders: {} 22808 }); 22809 } catch (e) { 22810 // If the user threw/returned a Response in callLoaderOrAction for a 22811 // `queryRoute` call, we throw the `DataStrategyResult` to bail out early 22812 // and then return or throw the raw Response here accordingly 22813 if (isDataStrategyResult(e) && isResponse(e.result)) { 22814 if (e.type === ResultType.error) { 22815 throw e.result; 22816 } 22817 return e.result; 22818 } 22819 // Redirects are always returned since they don't propagate to catch 22820 // boundaries 22821 if (isRedirectResponse(e)) { 22822 return e; 22823 } 22824 throw e; 22825 } 22826 } 22827 async function submit(request, matches, actionMatch, requestContext, dataStrategy, skipLoaderErrorBubbling, isRouteRequest) { 22828 let result; 22829 if (!actionMatch.route.action && !actionMatch.route.lazy) { 22830 let error = getInternalRouterError(405, { 22831 method: request.method, 22832 pathname: new URL(request.url).pathname, 22833 routeId: actionMatch.route.id 22834 }); 22835 if (isRouteRequest) { 22836 throw error; 22837 } 22838 result = { 22839 type: ResultType.error, 22840 error 22841 }; 22842 } else { 22843 let results = await callDataStrategy("action", request, [actionMatch], matches, isRouteRequest, requestContext, dataStrategy); 22844 result = results[actionMatch.route.id]; 22845 if (request.signal.aborted) { 22846 throwStaticHandlerAbortedError(request, isRouteRequest, future); 22847 } 22848 } 22849 if (isRedirectResult(result)) { 22850 // Uhhhh - this should never happen, we should always throw these from 22851 // callLoaderOrAction, but the type narrowing here keeps TS happy and we 22852 // can get back on the "throw all redirect responses" train here should 22853 // this ever happen :/ 22854 throw new Response(null, { 22855 status: result.response.status, 22856 headers: { 22857 Location: result.response.headers.get("Location") 22858 } 22859 }); 22860 } 22861 if (isDeferredResult(result)) { 22862 let error = getInternalRouterError(400, { 22863 type: "defer-action" 22864 }); 22865 if (isRouteRequest) { 22866 throw error; 22867 } 22868 result = { 22869 type: ResultType.error, 22870 error 22871 }; 22872 } 22873 if (isRouteRequest) { 22874 // Note: This should only be non-Response values if we get here, since 22875 // isRouteRequest should throw any Response received in callLoaderOrAction 22876 if (isErrorResult(result)) { 22877 throw result.error; 22878 } 22879 return { 22880 matches: [actionMatch], 22881 loaderData: {}, 22882 actionData: { 22883 [actionMatch.route.id]: result.data 22884 }, 22885 errors: null, 22886 // Note: statusCode + headers are unused here since queryRoute will 22887 // return the raw Response or value 22888 statusCode: 200, 22889 loaderHeaders: {}, 22890 actionHeaders: {}, 22891 activeDeferreds: null 22892 }; 22893 } 22894 // Create a GET request for the loaders 22895 let loaderRequest = new Request(request.url, { 22896 headers: request.headers, 22897 redirect: request.redirect, 22898 signal: request.signal 22899 }); 22900 if (isErrorResult(result)) { 22901 // Store off the pending error - we use it to determine which loaders 22902 // to call and will commit it when we complete the navigation 22903 let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id); 22904 let context = await loadRouteData(loaderRequest, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, null, [boundaryMatch.route.id, result]); 22905 // action status codes take precedence over loader status codes 22906 return _extends({}, context, { 22907 statusCode: isRouteErrorResponse(result.error) ? result.error.status : result.statusCode != null ? result.statusCode : 500, 22908 actionData: null, 22909 actionHeaders: _extends({}, result.headers ? { 22910 [actionMatch.route.id]: result.headers 22911 } : {}) 22912 }); 22913 } 22914 let context = await loadRouteData(loaderRequest, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, null); 22915 return _extends({}, context, { 22916 actionData: { 22917 [actionMatch.route.id]: result.data 22918 } 22919 }, result.statusCode ? { 22920 statusCode: result.statusCode 22921 } : {}, { 22922 actionHeaders: result.headers ? { 22923 [actionMatch.route.id]: result.headers 22924 } : {} 22925 }); 22926 } 22927 async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, pendingActionResult) { 22928 let isRouteRequest = routeMatch != null; 22929 // Short circuit if we have no loaders to run (queryRoute()) 22930 if (isRouteRequest && !(routeMatch != null && routeMatch.route.loader) && !(routeMatch != null && routeMatch.route.lazy)) { 22931 throw getInternalRouterError(400, { 22932 method: request.method, 22933 pathname: new URL(request.url).pathname, 22934 routeId: routeMatch == null ? void 0 : routeMatch.route.id 22935 }); 22936 } 22937 let requestMatches = routeMatch ? [routeMatch] : pendingActionResult && isErrorResult(pendingActionResult[1]) ? getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]) : matches; 22938 let matchesToLoad = requestMatches.filter(m => m.route.loader || m.route.lazy); 22939 // Short circuit if we have no loaders to run (query()) 22940 if (matchesToLoad.length === 0) { 22941 return { 22942 matches, 22943 // Add a null for all matched routes for proper revalidation on the client 22944 loaderData: matches.reduce((acc, m) => Object.assign(acc, { 22945 [m.route.id]: null 22946 }), {}), 22947 errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? { 22948 [pendingActionResult[0]]: pendingActionResult[1].error 22949 } : null, 22950 statusCode: 200, 22951 loaderHeaders: {}, 22952 activeDeferreds: null 22953 }; 22954 } 22955 let results = await callDataStrategy("loader", request, matchesToLoad, matches, isRouteRequest, requestContext, dataStrategy); 22956 if (request.signal.aborted) { 22957 throwStaticHandlerAbortedError(request, isRouteRequest, future); 22958 } 22959 // Process and commit output from loaders 22960 let activeDeferreds = new Map(); 22961 let context = processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling); 22962 // Add a null for any non-loader matches for proper revalidation on the client 22963 let executedLoaders = new Set(matchesToLoad.map(match => match.route.id)); 22964 matches.forEach(match => { 22965 if (!executedLoaders.has(match.route.id)) { 22966 context.loaderData[match.route.id] = null; 22967 } 22968 }); 22969 return _extends({}, context, { 22970 matches, 22971 activeDeferreds: activeDeferreds.size > 0 ? Object.fromEntries(activeDeferreds.entries()) : null 22972 }); 22973 } 22974 // Utility wrapper for calling dataStrategy server-side without having to 22975 // pass around the manifest, mapRouteProperties, etc. 22976 async function callDataStrategy(type, request, matchesToLoad, matches, isRouteRequest, requestContext, dataStrategy) { 22977 let results = await callDataStrategyImpl(dataStrategy || defaultDataStrategy, type, null, request, matchesToLoad, matches, null, manifest, mapRouteProperties, requestContext); 22978 let dataResults = {}; 22979 await Promise.all(matches.map(async match => { 22980 if (!(match.route.id in results)) { 22981 return; 22982 } 22983 let result = results[match.route.id]; 22984 if (isRedirectDataStrategyResultResult(result)) { 22985 let response = result.result; 22986 // Throw redirects and let the server handle them with an HTTP redirect 22987 throw normalizeRelativeRoutingRedirectResponse(response, request, match.route.id, matches, basename, future.v7_relativeSplatPath); 22988 } 22989 if (isResponse(result.result) && isRouteRequest) { 22990 // For SSR single-route requests, we want to hand Responses back 22991 // directly without unwrapping 22992 throw result; 22993 } 22994 dataResults[match.route.id] = await convertDataStrategyResultToDataResult(result); 22995 })); 22996 return dataResults; 22997 } 22998 return { 22999 dataRoutes, 23000 query, 23001 queryRoute 23002 }; 23003} 23004//#endregion 23005//////////////////////////////////////////////////////////////////////////////// 23006//#region Helpers 23007//////////////////////////////////////////////////////////////////////////////// 23008/** 23009 * Given an existing StaticHandlerContext and an error thrown at render time, 23010 * provide an updated StaticHandlerContext suitable for a second SSR render 23011 */ 23012function getStaticContextFromError(routes, context, error) { 23013 let newContext = _extends({}, context, { 23014 statusCode: isRouteErrorResponse(error) ? error.status : 500, 23015 errors: { 23016 [context._deepestRenderedBoundaryId || routes[0].id]: error 23017 } 23018 }); 23019 return newContext; 23020} 23021function throwStaticHandlerAbortedError(request, isRouteRequest, future) { 23022 if (future.v7_throwAbortReason && request.signal.reason !== undefined) { 23023 throw request.signal.reason; 23024 } 23025 let method = isRouteRequest ? "queryRoute" : "query"; 23026 throw new Error(method + "() call aborted: " + request.method + " " + request.url); 23027} 23028function isSubmissionNavigation(opts) { 23029 return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== undefined); 23030} 23031function normalizeTo(location, matches, basename, prependBasename, to, v7_relativeSplatPath, fromRouteId, relative) { 23032 let contextualMatches; 23033 let activeRouteMatch; 23034 if (fromRouteId) { 23035 // Grab matches up to the calling route so our route-relative logic is 23036 // relative to the correct source route 23037 contextualMatches = []; 23038 for (let match of matches) { 23039 contextualMatches.push(match); 23040 if (match.route.id === fromRouteId) { 23041 activeRouteMatch = match; 23042 break; 23043 } 23044 } 23045 } else { 23046 contextualMatches = matches; 23047 activeRouteMatch = matches[matches.length - 1]; 23048 } 23049 // Resolve the relative path 23050 let path = resolveTo(to ? to : ".", getResolveToMatches(contextualMatches, v7_relativeSplatPath), stripBasename(location.pathname, basename) || location.pathname, relative === "path"); 23051 // When `to` is not specified we inherit search/hash from the current 23052 // location, unlike when to="." and we just inherit the path. 23053 // See https://github.com/remix-run/remix/issues/927 23054 if (to == null) { 23055 path.search = location.search; 23056 path.hash = location.hash; 23057 } 23058 // Account for `?index` params when routing to the current location 23059 if ((to == null || to === "" || to === ".") && activeRouteMatch) { 23060 let nakedIndex = hasNakedIndexQuery(path.search); 23061 if (activeRouteMatch.route.index && !nakedIndex) { 23062 // Add one when we're targeting an index route 23063 path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index"; 23064 } else if (!activeRouteMatch.route.index && nakedIndex) { 23065 // Remove existing ones when we're not 23066 let params = new URLSearchParams(path.search); 23067 let indexValues = params.getAll("index"); 23068 params.delete("index"); 23069 indexValues.filter(v => v).forEach(v => params.append("index", v)); 23070 let qs = params.toString(); 23071 path.search = qs ? "?" + qs : ""; 23072 } 23073 } 23074 // If we're operating within a basename, prepend it to the pathname. If 23075 // this is a root navigation, then just use the raw basename which allows 23076 // the basename to have full control over the presence of a trailing slash 23077 // on root actions 23078 if (prependBasename && basename !== "/") { 23079 path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]); 23080 } 23081 return createPath(path); 23082} 23083// Normalize navigation options by converting formMethod=GET formData objects to 23084// URLSearchParams so they behave identically to links with query params 23085function normalizeNavigateOptions(normalizeFormMethod, isFetcher, path, opts) { 23086 // Return location verbatim on non-submission navigations 23087 if (!opts || !isSubmissionNavigation(opts)) { 23088 return { 23089 path 23090 }; 23091 } 23092 if (opts.formMethod && !isValidMethod(opts.formMethod)) { 23093 return { 23094 path, 23095 error: getInternalRouterError(405, { 23096 method: opts.formMethod 23097 }) 23098 }; 23099 } 23100 let getInvalidBodyError = () => ({ 23101 path, 23102 error: getInternalRouterError(400, { 23103 type: "invalid-body" 23104 }) 23105 }); 23106 // Create a Submission on non-GET navigations 23107 let rawFormMethod = opts.formMethod || "get"; 23108 let formMethod = normalizeFormMethod ? rawFormMethod.toUpperCase() : rawFormMethod.toLowerCase(); 23109 let formAction = stripHashFromPath(path); 23110 if (opts.body !== undefined) { 23111 if (opts.formEncType === "text/plain") { 23112 // text only support POST/PUT/PATCH/DELETE submissions 23113 if (!isMutationMethod(formMethod)) { 23114 return getInvalidBodyError(); 23115 } 23116 let text = typeof opts.body === "string" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ? 23117 // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data 23118 Array.from(opts.body.entries()).reduce((acc, _ref3) => { 23119 let [name, value] = _ref3; 23120 return "" + acc + name + "=" + value + "\n"; 23121 }, "") : String(opts.body); 23122 return { 23123 path, 23124 submission: { 23125 formMethod, 23126 formAction, 23127 formEncType: opts.formEncType, 23128 formData: undefined, 23129 json: undefined, 23130 text 23131 } 23132 }; 23133 } else if (opts.formEncType === "application/json") { 23134 // json only supports POST/PUT/PATCH/DELETE submissions 23135 if (!isMutationMethod(formMethod)) { 23136 return getInvalidBodyError(); 23137 } 23138 try { 23139 let json = typeof opts.body === "string" ? JSON.parse(opts.body) : opts.body; 23140 return { 23141 path, 23142 submission: { 23143 formMethod, 23144 formAction, 23145 formEncType: opts.formEncType, 23146 formData: undefined, 23147 json, 23148 text: undefined 23149 } 23150 }; 23151 } catch (e) { 23152 return getInvalidBodyError(); 23153 } 23154 } 23155 } 23156 invariant(typeof FormData === "function", "FormData is not available in this environment"); 23157 let searchParams; 23158 let formData; 23159 if (opts.formData) { 23160 searchParams = convertFormDataToSearchParams(opts.formData); 23161 formData = opts.formData; 23162 } else if (opts.body instanceof FormData) { 23163 searchParams = convertFormDataToSearchParams(opts.body); 23164 formData = opts.body; 23165 } else if (opts.body instanceof URLSearchParams) { 23166 searchParams = opts.body; 23167 formData = convertSearchParamsToFormData(searchParams); 23168 } else if (opts.body == null) { 23169 searchParams = new URLSearchParams(); 23170 formData = new FormData(); 23171 } else { 23172 try { 23173 searchParams = new URLSearchParams(opts.body); 23174 formData = convertSearchParamsToFormData(searchParams); 23175 } catch (e) { 23176 return getInvalidBodyError(); 23177 } 23178 } 23179 let submission = { 23180 formMethod, 23181 formAction, 23182 formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded", 23183 formData, 23184 json: undefined, 23185 text: undefined 23186 }; 23187 if (isMutationMethod(submission.formMethod)) { 23188 return { 23189 path, 23190 submission 23191 }; 23192 } 23193 // Flatten submission onto URLSearchParams for GET submissions 23194 let parsedPath = parsePath(path); 23195 // On GET navigation submissions we can drop the ?index param from the 23196 // resulting location since all loaders will run. But fetcher GET submissions 23197 // only run a single loader so we need to preserve any incoming ?index params 23198 if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) { 23199 searchParams.append("index", ""); 23200 } 23201 parsedPath.search = "?" + searchParams; 23202 return { 23203 path: createPath(parsedPath), 23204 submission 23205 }; 23206} 23207// Filter out all routes at/below any caught error as they aren't going to 23208// render so we don't need to load them 23209function getLoaderMatchesUntilBoundary(matches, boundaryId, includeBoundary) { 23210 if (includeBoundary === void 0) { 23211 includeBoundary = false; 23212 } 23213 let index = matches.findIndex(m => m.route.id === boundaryId); 23214 if (index >= 0) { 23215 return matches.slice(0, includeBoundary ? index + 1 : index); 23216 } 23217 return matches; 23218} 23219function getMatchesToLoad(history, state, matches, submission, location, initialHydration, skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult) { 23220 let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : undefined; 23221 let currentUrl = history.createURL(state.location); 23222 let nextUrl = history.createURL(location); 23223 // Pick navigation matches that are net-new or qualify for revalidation 23224 let boundaryMatches = matches; 23225 if (initialHydration && state.errors) { 23226 // On initial hydration, only consider matches up to _and including_ the boundary. 23227 // This is inclusive to handle cases where a server loader ran successfully, 23228 // a child server loader bubbled up to this route, but this route has 23229 // `clientLoader.hydrate` so we want to still run the `clientLoader` so that 23230 // we have a complete version of `loaderData` 23231 boundaryMatches = getLoaderMatchesUntilBoundary(matches, Object.keys(state.errors)[0], true); 23232 } else if (pendingActionResult && isErrorResult(pendingActionResult[1])) { 23233 // If an action threw an error, we call loaders up to, but not including the 23234 // boundary 23235 boundaryMatches = getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]); 23236 } 23237 // Don't revalidate loaders by default after action 4xx/5xx responses 23238 // when the flag is enabled. They can still opt-into revalidation via 23239 // `shouldRevalidate` via `actionResult` 23240 let actionStatus = pendingActionResult ? pendingActionResult[1].statusCode : undefined; 23241 let shouldSkipRevalidation = skipActionErrorRevalidation && actionStatus && actionStatus >= 400; 23242 let navigationMatches = boundaryMatches.filter((match, index) => { 23243 let { 23244 route 23245 } = match; 23246 if (route.lazy) { 23247 // We haven't loaded this route yet so we don't know if it's got a loader! 23248 return true; 23249 } 23250 if (route.loader == null) { 23251 return false; 23252 } 23253 if (initialHydration) { 23254 return shouldLoadRouteOnHydration(route, state.loaderData, state.errors); 23255 } 23256 // Always call the loader on new route instances and pending defer cancellations 23257 if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some(id => id === match.route.id)) { 23258 return true; 23259 } 23260 // This is the default implementation for when we revalidate. If the route 23261 // provides it's own implementation, then we give them full control but 23262 // provide this value so they can leverage it if needed after they check 23263 // their own specific use cases 23264 let currentRouteMatch = state.matches[index]; 23265 let nextRouteMatch = match; 23266 return shouldRevalidateLoader(match, _extends({ 23267 currentUrl, 23268 currentParams: currentRouteMatch.params, 23269 nextUrl, 23270 nextParams: nextRouteMatch.params 23271 }, submission, { 23272 actionResult, 23273 actionStatus, 23274 defaultShouldRevalidate: shouldSkipRevalidation ? false : 23275 // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate 23276 isRevalidationRequired || currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search || 23277 // Search params affect all loaders 23278 currentUrl.search !== nextUrl.search || isNewRouteInstance(currentRouteMatch, nextRouteMatch) 23279 })); 23280 }); 23281 // Pick fetcher.loads that need to be revalidated 23282 let revalidatingFetchers = []; 23283 fetchLoadMatches.forEach((f, key) => { 23284 // Don't revalidate: 23285 // - on initial hydration (shouldn't be any fetchers then anyway) 23286 // - if fetcher won't be present in the subsequent render 23287 // - no longer matches the URL (v7_fetcherPersist=false) 23288 // - was unmounted but persisted due to v7_fetcherPersist=true 23289 if (initialHydration || !matches.some(m => m.route.id === f.routeId) || deletedFetchers.has(key)) { 23290 return; 23291 } 23292 let fetcherMatches = matchRoutes(routesToUse, f.path, basename); 23293 // If the fetcher path no longer matches, push it in with null matches so 23294 // we can trigger a 404 in callLoadersAndMaybeResolveData. Note this is 23295 // currently only a use-case for Remix HMR where the route tree can change 23296 // at runtime and remove a route previously loaded via a fetcher 23297 if (!fetcherMatches) { 23298 revalidatingFetchers.push({ 23299 key, 23300 routeId: f.routeId, 23301 path: f.path, 23302 matches: null, 23303 match: null, 23304 controller: null 23305 }); 23306 return; 23307 } 23308 // Revalidating fetchers are decoupled from the route matches since they 23309 // load from a static href. They revalidate based on explicit revalidation 23310 // (submission, useRevalidator, or X-Remix-Revalidate) 23311 let fetcher = state.fetchers.get(key); 23312 let fetcherMatch = getTargetMatch(fetcherMatches, f.path); 23313 let shouldRevalidate = false; 23314 if (fetchRedirectIds.has(key)) { 23315 // Never trigger a revalidation of an actively redirecting fetcher 23316 shouldRevalidate = false; 23317 } else if (cancelledFetcherLoads.has(key)) { 23318 // Always mark for revalidation if the fetcher was cancelled 23319 cancelledFetcherLoads.delete(key); 23320 shouldRevalidate = true; 23321 } else if (fetcher && fetcher.state !== "idle" && fetcher.data === undefined) { 23322 // If the fetcher hasn't ever completed loading yet, then this isn't a 23323 // revalidation, it would just be a brand new load if an explicit 23324 // revalidation is required 23325 shouldRevalidate = isRevalidationRequired; 23326 } else { 23327 // Otherwise fall back on any user-defined shouldRevalidate, defaulting 23328 // to explicit revalidations only 23329 shouldRevalidate = shouldRevalidateLoader(fetcherMatch, _extends({ 23330 currentUrl, 23331 currentParams: state.matches[state.matches.length - 1].params, 23332 nextUrl, 23333 nextParams: matches[matches.length - 1].params 23334 }, submission, { 23335 actionResult, 23336 actionStatus, 23337 defaultShouldRevalidate: shouldSkipRevalidation ? false : isRevalidationRequired 23338 })); 23339 } 23340 if (shouldRevalidate) { 23341 revalidatingFetchers.push({ 23342 key, 23343 routeId: f.routeId, 23344 path: f.path, 23345 matches: fetcherMatches, 23346 match: fetcherMatch, 23347 controller: new AbortController() 23348 }); 23349 } 23350 }); 23351 return [navigationMatches, revalidatingFetchers]; 23352} 23353function shouldLoadRouteOnHydration(route, loaderData, errors) { 23354 // We dunno if we have a loader - gotta find out! 23355 if (route.lazy) { 23356 return true; 23357 } 23358 // No loader, nothing to initialize 23359 if (!route.loader) { 23360 return false; 23361 } 23362 let hasData = loaderData != null && loaderData[route.id] !== undefined; 23363 let hasError = errors != null && errors[route.id] !== undefined; 23364 // Don't run if we error'd during SSR 23365 if (!hasData && hasError) { 23366 return false; 23367 } 23368 // Explicitly opting-in to running on hydration 23369 if (typeof route.loader === "function" && route.loader.hydrate === true) { 23370 return true; 23371 } 23372 // Otherwise, run if we're not yet initialized with anything 23373 return !hasData && !hasError; 23374} 23375function isNewLoader(currentLoaderData, currentMatch, match) { 23376 let isNew = 23377 // [a] -> [a, b] 23378 !currentMatch || 23379 // [a, b] -> [a, c] 23380 match.route.id !== currentMatch.route.id; 23381 // Handle the case that we don't have data for a re-used route, potentially 23382 // from a prior error or from a cancelled pending deferred 23383 let isMissingData = currentLoaderData[match.route.id] === undefined; 23384 // Always load if this is a net-new route or we don't yet have data 23385 return isNew || isMissingData; 23386} 23387function isNewRouteInstance(currentMatch, match) { 23388 let currentPath = currentMatch.route.path; 23389 return ( 23390 // param change for this match, /users/123 -> /users/456 23391 currentMatch.pathname !== match.pathname || 23392 // splat param changed, which is not present in match.path 23393 // e.g. /files/images/avatar.jpg -> files/finances.xls 23394 currentPath != null && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"] 23395 ); 23396} 23397function shouldRevalidateLoader(loaderMatch, arg) { 23398 if (loaderMatch.route.shouldRevalidate) { 23399 let routeChoice = loaderMatch.route.shouldRevalidate(arg); 23400 if (typeof routeChoice === "boolean") { 23401 return routeChoice; 23402 } 23403 } 23404 return arg.defaultShouldRevalidate; 23405} 23406function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties) { 23407 var _childrenToPatch; 23408 let childrenToPatch; 23409 if (routeId) { 23410 let route = manifest[routeId]; 23411 invariant(route, "No route found to patch children into: routeId = " + routeId); 23412 if (!route.children) { 23413 route.children = []; 23414 } 23415 childrenToPatch = route.children; 23416 } else { 23417 childrenToPatch = routesToUse; 23418 } 23419 // Don't patch in routes we already know about so that `patch` is idempotent 23420 // to simplify user-land code. This is useful because we re-call the 23421 // `patchRoutesOnNavigation` function for matched routes with params. 23422 let uniqueChildren = children.filter(newRoute => !childrenToPatch.some(existingRoute => isSameRoute(newRoute, existingRoute))); 23423 let newRoutes = convertRoutesToDataRoutes(uniqueChildren, mapRouteProperties, [routeId || "_", "patch", String(((_childrenToPatch = childrenToPatch) == null ? void 0 : _childrenToPatch.length) || "0")], manifest); 23424 childrenToPatch.push(...newRoutes); 23425} 23426function isSameRoute(newRoute, existingRoute) { 23427 // Most optimal check is by id 23428 if ("id" in newRoute && "id" in existingRoute && newRoute.id === existingRoute.id) { 23429 return true; 23430 } 23431 // Second is by pathing differences 23432 if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) { 23433 return false; 23434 } 23435 // Pathless layout routes are trickier since we need to check children. 23436 // If they have no children then they're the same as far as we can tell 23437 if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) { 23438 return true; 23439 } 23440 // Otherwise, we look to see if every child in the new route is already 23441 // represented in the existing route's children 23442 return newRoute.children.every((aChild, i) => { 23443 var _existingRoute$childr; 23444 return (_existingRoute$childr = existingRoute.children) == null ? void 0 : _existingRoute$childr.some(bChild => isSameRoute(aChild, bChild)); 23445 }); 23446} 23447/** 23448 * Execute route.lazy() methods to lazily load route modules (loader, action, 23449 * shouldRevalidate) and update the routeManifest in place which shares objects 23450 * with dataRoutes so those get updated as well. 23451 */ 23452async function loadLazyRouteModule(route, mapRouteProperties, manifest) { 23453 if (!route.lazy) { 23454 return; 23455 } 23456 let lazyRoute = await route.lazy(); 23457 // If the lazy route function was executed and removed by another parallel 23458 // call then we can return - first lazy() to finish wins because the return 23459 // value of lazy is expected to be static 23460 if (!route.lazy) { 23461 return; 23462 } 23463 let routeToUpdate = manifest[route.id]; 23464 invariant(routeToUpdate, "No route found in manifest"); 23465 // Update the route in place. This should be safe because there's no way 23466 // we could yet be sitting on this route as we can't get there without 23467 // resolving lazy() first. 23468 // 23469 // This is different than the HMR "update" use-case where we may actively be 23470 // on the route being updated. The main concern boils down to "does this 23471 // mutation affect any ongoing navigations or any current state.matches 23472 // values?". If not, it should be safe to update in place. 23473 let routeUpdates = {}; 23474 for (let lazyRouteProperty in lazyRoute) { 23475 let staticRouteValue = routeToUpdate[lazyRouteProperty]; 23476 let isPropertyStaticallyDefined = staticRouteValue !== undefined && 23477 // This property isn't static since it should always be updated based 23478 // on the route updates 23479 lazyRouteProperty !== "hasErrorBoundary"; 23480 warning(!isPropertyStaticallyDefined, "Route \"" + routeToUpdate.id + "\" has a static property \"" + lazyRouteProperty + "\" " + "defined but its lazy function is also returning a value for this property. " + ("The lazy route property \"" + lazyRouteProperty + "\" will be ignored.")); 23481 if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) { 23482 routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty]; 23483 } 23484 } 23485 // Mutate the route with the provided updates. Do this first so we pass 23486 // the updated version to mapRouteProperties 23487 Object.assign(routeToUpdate, routeUpdates); 23488 // Mutate the `hasErrorBoundary` property on the route based on the route 23489 // updates and remove the `lazy` function so we don't resolve the lazy 23490 // route again. 23491 Object.assign(routeToUpdate, _extends({}, mapRouteProperties(routeToUpdate), { 23492 lazy: undefined 23493 })); 23494} 23495// Default implementation of `dataStrategy` which fetches all loaders in parallel 23496async function defaultDataStrategy(_ref4) { 23497 let { 23498 matches 23499 } = _ref4; 23500 let matchesToLoad = matches.filter(m => m.shouldLoad); 23501 let results = await Promise.all(matchesToLoad.map(m => m.resolve())); 23502 return results.reduce((acc, result, i) => Object.assign(acc, { 23503 [matchesToLoad[i].route.id]: result 23504 }), {}); 23505} 23506async function callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties, requestContext) { 23507 let loadRouteDefinitionsPromises = matches.map(m => m.route.lazy ? loadLazyRouteModule(m.route, mapRouteProperties, manifest) : undefined); 23508 let dsMatches = matches.map((match, i) => { 23509 let loadRoutePromise = loadRouteDefinitionsPromises[i]; 23510 let shouldLoad = matchesToLoad.some(m => m.route.id === match.route.id); 23511 // `resolve` encapsulates route.lazy(), executing the loader/action, 23512 // and mapping return values/thrown errors to a `DataStrategyResult`. Users 23513 // can pass a callback to take fine-grained control over the execution 23514 // of the loader/action 23515 let resolve = async handlerOverride => { 23516 if (handlerOverride && request.method === "GET" && (match.route.lazy || match.route.loader)) { 23517 shouldLoad = true; 23518 } 23519 return shouldLoad ? callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, requestContext) : Promise.resolve({ 23520 type: ResultType.data, 23521 result: undefined 23522 }); 23523 }; 23524 return _extends({}, match, { 23525 shouldLoad, 23526 resolve 23527 }); 23528 }); 23529 // Send all matches here to allow for a middleware-type implementation. 23530 // handler will be a no-op for unneeded routes and we filter those results 23531 // back out below. 23532 let results = await dataStrategyImpl({ 23533 matches: dsMatches, 23534 request, 23535 params: matches[0].params, 23536 fetcherKey, 23537 context: requestContext 23538 }); 23539 // Wait for all routes to load here but 'swallow the error since we want 23540 // it to bubble up from the `await loadRoutePromise` in `callLoaderOrAction` - 23541 // called from `match.resolve()` 23542 try { 23543 await Promise.all(loadRouteDefinitionsPromises); 23544 } catch (e) { 23545 // No-op 23546 } 23547 return results; 23548} 23549// Default logic for calling a loader/action is the user has no specified a dataStrategy 23550async function callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, staticContext) { 23551 let result; 23552 let onReject; 23553 let runHandler = handler => { 23554 // Setup a promise we can race against so that abort signals short circuit 23555 let reject; 23556 // This will never resolve so safe to type it as Promise<DataStrategyResult> to 23557 // satisfy the function return value 23558 let abortPromise = new Promise((_, r) => reject = r); 23559 onReject = () => reject(); 23560 request.signal.addEventListener("abort", onReject); 23561 let actualHandler = ctx => { 23562 if (typeof handler !== "function") { 23563 return Promise.reject(new Error("You cannot call the handler for a route which defines a boolean " + ("\"" + type + "\" [routeId: " + match.route.id + "]"))); 23564 } 23565 return handler({ 23566 request, 23567 params: match.params, 23568 context: staticContext 23569 }, ...(ctx !== undefined ? [ctx] : [])); 23570 }; 23571 let handlerPromise = (async () => { 23572 try { 23573 let val = await (handlerOverride ? handlerOverride(ctx => actualHandler(ctx)) : actualHandler()); 23574 return { 23575 type: "data", 23576 result: val 23577 }; 23578 } catch (e) { 23579 return { 23580 type: "error", 23581 result: e 23582 }; 23583 } 23584 })(); 23585 return Promise.race([handlerPromise, abortPromise]); 23586 }; 23587 try { 23588 let handler = match.route[type]; 23589 // If we have a route.lazy promise, await that first 23590 if (loadRoutePromise) { 23591 if (handler) { 23592 // Run statically defined handler in parallel with lazy() 23593 let handlerError; 23594 let [value] = await Promise.all([ 23595 // If the handler throws, don't let it immediately bubble out, 23596 // since we need to let the lazy() execution finish so we know if this 23597 // route has a boundary that can handle the error 23598 runHandler(handler).catch(e => { 23599 handlerError = e; 23600 }), loadRoutePromise]); 23601 if (handlerError !== undefined) { 23602 throw handlerError; 23603 } 23604 result = value; 23605 } else { 23606 // Load lazy route module, then run any returned handler 23607 await loadRoutePromise; 23608 handler = match.route[type]; 23609 if (handler) { 23610 // Handler still runs even if we got interrupted to maintain consistency 23611 // with un-abortable behavior of handler execution on non-lazy or 23612 // previously-lazy-loaded routes 23613 result = await runHandler(handler); 23614 } else if (type === "action") { 23615 let url = new URL(request.url); 23616 let pathname = url.pathname + url.search; 23617 throw getInternalRouterError(405, { 23618 method: request.method, 23619 pathname, 23620 routeId: match.route.id 23621 }); 23622 } else { 23623 // lazy() route has no loader to run. Short circuit here so we don't 23624 // hit the invariant below that errors on returning undefined. 23625 return { 23626 type: ResultType.data, 23627 result: undefined 23628 }; 23629 } 23630 } 23631 } else if (!handler) { 23632 let url = new URL(request.url); 23633 let pathname = url.pathname + url.search; 23634 throw getInternalRouterError(404, { 23635 pathname 23636 }); 23637 } else { 23638 result = await runHandler(handler); 23639 } 23640 invariant(result.result !== undefined, "You defined " + (type === "action" ? "an action" : "a loader") + " for route " + ("\"" + match.route.id + "\" but didn't return anything from your `" + type + "` ") + "function. Please return a value or `null`."); 23641 } catch (e) { 23642 // We should already be catching and converting normal handler executions to 23643 // DataStrategyResults and returning them, so anything that throws here is an 23644 // unexpected error we still need to wrap 23645 return { 23646 type: ResultType.error, 23647 result: e 23648 }; 23649 } finally { 23650 if (onReject) { 23651 request.signal.removeEventListener("abort", onReject); 23652 } 23653 } 23654 return result; 23655} 23656async function convertDataStrategyResultToDataResult(dataStrategyResult) { 23657 let { 23658 result, 23659 type 23660 } = dataStrategyResult; 23661 if (isResponse(result)) { 23662 let data; 23663 try { 23664 let contentType = result.headers.get("Content-Type"); 23665 // Check between word boundaries instead of startsWith() due to the last 23666 // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type 23667 if (contentType && /\bapplication\/json\b/.test(contentType)) { 23668 if (result.body == null) { 23669 data = null; 23670 } else { 23671 data = await result.json(); 23672 } 23673 } else { 23674 data = await result.text(); 23675 } 23676 } catch (e) { 23677 return { 23678 type: ResultType.error, 23679 error: e 23680 }; 23681 } 23682 if (type === ResultType.error) { 23683 return { 23684 type: ResultType.error, 23685 error: new ErrorResponseImpl(result.status, result.statusText, data), 23686 statusCode: result.status, 23687 headers: result.headers 23688 }; 23689 } 23690 return { 23691 type: ResultType.data, 23692 data, 23693 statusCode: result.status, 23694 headers: result.headers 23695 }; 23696 } 23697 if (type === ResultType.error) { 23698 if (isDataWithResponseInit(result)) { 23699 var _result$init3, _result$init4; 23700 if (result.data instanceof Error) { 23701 var _result$init, _result$init2; 23702 return { 23703 type: ResultType.error, 23704 error: result.data, 23705 statusCode: (_result$init = result.init) == null ? void 0 : _result$init.status, 23706 headers: (_result$init2 = result.init) != null && _result$init2.headers ? new Headers(result.init.headers) : undefined 23707 }; 23708 } 23709 // Convert thrown data() to ErrorResponse instances 23710 return { 23711 type: ResultType.error, 23712 error: new ErrorResponseImpl(((_result$init3 = result.init) == null ? void 0 : _result$init3.status) || 500, undefined, result.data), 23713 statusCode: isRouteErrorResponse(result) ? result.status : undefined, 23714 headers: (_result$init4 = result.init) != null && _result$init4.headers ? new Headers(result.init.headers) : undefined 23715 }; 23716 } 23717 return { 23718 type: ResultType.error, 23719 error: result, 23720 statusCode: isRouteErrorResponse(result) ? result.status : undefined 23721 }; 23722 } 23723 if (isDeferredData(result)) { 23724 var _result$init5, _result$init6; 23725 return { 23726 type: ResultType.deferred, 23727 deferredData: result, 23728 statusCode: (_result$init5 = result.init) == null ? void 0 : _result$init5.status, 23729 headers: ((_result$init6 = result.init) == null ? void 0 : _result$init6.headers) && new Headers(result.init.headers) 23730 }; 23731 } 23732 if (isDataWithResponseInit(result)) { 23733 var _result$init7, _result$init8; 23734 return { 23735 type: ResultType.data, 23736 data: result.data, 23737 statusCode: (_result$init7 = result.init) == null ? void 0 : _result$init7.status, 23738 headers: (_result$init8 = result.init) != null && _result$init8.headers ? new Headers(result.init.headers) : undefined 23739 }; 23740 } 23741 return { 23742 type: ResultType.data, 23743 data: result 23744 }; 23745} 23746// Support relative routing in internal redirects 23747function normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename, v7_relativeSplatPath) { 23748 let location = response.headers.get("Location"); 23749 invariant(location, "Redirects returned/thrown from loaders/actions must have a Location header"); 23750 if (!ABSOLUTE_URL_REGEX.test(location)) { 23751 let trimmedMatches = matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1); 23752 location = normalizeTo(new URL(request.url), trimmedMatches, basename, true, location, v7_relativeSplatPath); 23753 response.headers.set("Location", location); 23754 } 23755 return response; 23756} 23757function normalizeRedirectLocation(location, currentUrl, basename, historyInstance) { 23758 // Match Chrome's behavior: 23759 // https://github.com/chromium/chromium/blob/216dbeb61db0c667e62082e5f5400a32d6983df3/content/public/common/url_utils.cc#L82 23760 let invalidProtocols = ["about:", "blob:", "chrome:", "chrome-untrusted:", "content:", "data:", "devtools:", "file:", "filesystem:", 23761 // eslint-disable-next-line no-script-url 23762 "javascript:"]; 23763 if (ABSOLUTE_URL_REGEX.test(location)) { 23764 // Strip off the protocol+origin for same-origin + same-basename absolute redirects 23765 let normalizedLocation = location; 23766 let url = normalizedLocation.startsWith("//") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation); 23767 if (invalidProtocols.includes(url.protocol)) { 23768 throw new Error("Invalid redirect location"); 23769 } 23770 let isSameBasename = stripBasename(url.pathname, basename) != null; 23771 if (url.origin === currentUrl.origin && isSameBasename) { 23772 return removeDoubleSlashes(url.pathname) + url.search + url.hash; 23773 } 23774 } 23775 try { 23776 let url = historyInstance.createURL(location); 23777 if (invalidProtocols.includes(url.protocol)) { 23778 throw new Error("Invalid redirect location"); 23779 } 23780 } catch (e) {} 23781 return location; 23782} 23783// Utility method for creating the Request instances for loaders/actions during 23784// client-side navigations and fetches. During SSR we will always have a 23785// Request instance from the static handler (query/queryRoute) 23786function createClientSideRequest(history, location, signal, submission) { 23787 let url = history.createURL(stripHashFromPath(location)).toString(); 23788 let init = { 23789 signal 23790 }; 23791 if (submission && isMutationMethod(submission.formMethod)) { 23792 let { 23793 formMethod, 23794 formEncType 23795 } = submission; 23796 // Didn't think we needed this but it turns out unlike other methods, patch 23797 // won't be properly normalized to uppercase and results in a 405 error. 23798 // See: https://fetch.spec.whatwg.org/#concept-method 23799 init.method = formMethod.toUpperCase(); 23800 if (formEncType === "application/json") { 23801 init.headers = new Headers({ 23802 "Content-Type": formEncType 23803 }); 23804 init.body = JSON.stringify(submission.json); 23805 } else if (formEncType === "text/plain") { 23806 // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) 23807 init.body = submission.text; 23808 } else if (formEncType === "application/x-www-form-urlencoded" && submission.formData) { 23809 // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) 23810 init.body = convertFormDataToSearchParams(submission.formData); 23811 } else { 23812 // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) 23813 init.body = submission.formData; 23814 } 23815 } 23816 return new Request(url, init); 23817} 23818function convertFormDataToSearchParams(formData) { 23819 let searchParams = new URLSearchParams(); 23820 for (let [key, value] of formData.entries()) { 23821 // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs 23822 searchParams.append(key, typeof value === "string" ? value : value.name); 23823 } 23824 return searchParams; 23825} 23826function convertSearchParamsToFormData(searchParams) { 23827 let formData = new FormData(); 23828 for (let [key, value] of searchParams.entries()) { 23829 formData.append(key, value); 23830 } 23831 return formData; 23832} 23833function processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling) { 23834 // Fill in loaderData/errors from our loaders 23835 let loaderData = {}; 23836 let errors = null; 23837 let statusCode; 23838 let foundError = false; 23839 let loaderHeaders = {}; 23840 let pendingError = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : undefined; 23841 // Process loader results into state.loaderData/state.errors 23842 matches.forEach(match => { 23843 if (!(match.route.id in results)) { 23844 return; 23845 } 23846 let id = match.route.id; 23847 let result = results[id]; 23848 invariant(!isRedirectResult(result), "Cannot handle redirect results in processLoaderData"); 23849 if (isErrorResult(result)) { 23850 let error = result.error; 23851 // If we have a pending action error, we report it at the highest-route 23852 // that throws a loader error, and then clear it out to indicate that 23853 // it was consumed 23854 if (pendingError !== undefined) { 23855 error = pendingError; 23856 pendingError = undefined; 23857 } 23858 errors = errors || {}; 23859 if (skipLoaderErrorBubbling) { 23860 errors[id] = error; 23861 } else { 23862 // Look upwards from the matched route for the closest ancestor error 23863 // boundary, defaulting to the root match. Prefer higher error values 23864 // if lower errors bubble to the same boundary 23865 let boundaryMatch = findNearestBoundary(matches, id); 23866 if (errors[boundaryMatch.route.id] == null) { 23867 errors[boundaryMatch.route.id] = error; 23868 } 23869 } 23870 // Clear our any prior loaderData for the throwing route 23871 loaderData[id] = undefined; 23872 // Once we find our first (highest) error, we set the status code and 23873 // prevent deeper status codes from overriding 23874 if (!foundError) { 23875 foundError = true; 23876 statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500; 23877 } 23878 if (result.headers) { 23879 loaderHeaders[id] = result.headers; 23880 } 23881 } else { 23882 if (isDeferredResult(result)) { 23883 activeDeferreds.set(id, result.deferredData); 23884 loaderData[id] = result.deferredData.data; 23885 // Error status codes always override success status codes, but if all 23886 // loaders are successful we take the deepest status code. 23887 if (result.statusCode != null && result.statusCode !== 200 && !foundError) { 23888 statusCode = result.statusCode; 23889 } 23890 if (result.headers) { 23891 loaderHeaders[id] = result.headers; 23892 } 23893 } else { 23894 loaderData[id] = result.data; 23895 // Error status codes always override success status codes, but if all 23896 // loaders are successful we take the deepest status code. 23897 if (result.statusCode && result.statusCode !== 200 && !foundError) { 23898 statusCode = result.statusCode; 23899 } 23900 if (result.headers) { 23901 loaderHeaders[id] = result.headers; 23902 } 23903 } 23904 } 23905 }); 23906 // If we didn't consume the pending action error (i.e., all loaders 23907 // resolved), then consume it here. Also clear out any loaderData for the 23908 // throwing route 23909 if (pendingError !== undefined && pendingActionResult) { 23910 errors = { 23911 [pendingActionResult[0]]: pendingError 23912 }; 23913 loaderData[pendingActionResult[0]] = undefined; 23914 } 23915 return { 23916 loaderData, 23917 errors, 23918 statusCode: statusCode || 200, 23919 loaderHeaders 23920 }; 23921} 23922function processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds) { 23923 let { 23924 loaderData, 23925 errors 23926 } = processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, false // This method is only called client side so we always want to bubble 23927 ); 23928 // Process results from our revalidating fetchers 23929 revalidatingFetchers.forEach(rf => { 23930 let { 23931 key, 23932 match, 23933 controller 23934 } = rf; 23935 let result = fetcherResults[key]; 23936 invariant(result, "Did not find corresponding fetcher result"); 23937 // Process fetcher non-redirect errors 23938 if (controller && controller.signal.aborted) { 23939 // Nothing to do for aborted fetchers 23940 return; 23941 } else if (isErrorResult(result)) { 23942 let boundaryMatch = findNearestBoundary(state.matches, match == null ? void 0 : match.route.id); 23943 if (!(errors && errors[boundaryMatch.route.id])) { 23944 errors = _extends({}, errors, { 23945 [boundaryMatch.route.id]: result.error 23946 }); 23947 } 23948 state.fetchers.delete(key); 23949 } else if (isRedirectResult(result)) { 23950 // Should never get here, redirects should get processed above, but we 23951 // keep this to type narrow to a success result in the else 23952 invariant(false, "Unhandled fetcher revalidation redirect"); 23953 } else if (isDeferredResult(result)) { 23954 // Should never get here, deferred data should be awaited for fetchers 23955 // in resolveDeferredResults 23956 invariant(false, "Unhandled fetcher deferred data"); 23957 } else { 23958 let doneFetcher = getDoneFetcher(result.data); 23959 state.fetchers.set(key, doneFetcher); 23960 } 23961 }); 23962 return { 23963 loaderData, 23964 errors 23965 }; 23966} 23967function mergeLoaderData(loaderData, newLoaderData, matches, errors) { 23968 let mergedLoaderData = _extends({}, newLoaderData); 23969 for (let match of matches) { 23970 let id = match.route.id; 23971 if (newLoaderData.hasOwnProperty(id)) { 23972 if (newLoaderData[id] !== undefined) { 23973 mergedLoaderData[id] = newLoaderData[id]; 23974 } 23975 } else if (loaderData[id] !== undefined && match.route.loader) { 23976 // Preserve existing keys not included in newLoaderData and where a loader 23977 // wasn't removed by HMR 23978 mergedLoaderData[id] = loaderData[id]; 23979 } 23980 if (errors && errors.hasOwnProperty(id)) { 23981 // Don't keep any loader data below the boundary 23982 break; 23983 } 23984 } 23985 return mergedLoaderData; 23986} 23987function getActionDataForCommit(pendingActionResult) { 23988 if (!pendingActionResult) { 23989 return {}; 23990 } 23991 return isErrorResult(pendingActionResult[1]) ? { 23992 // Clear out prior actionData on errors 23993 actionData: {} 23994 } : { 23995 actionData: { 23996 [pendingActionResult[0]]: pendingActionResult[1].data 23997 } 23998 }; 23999} 24000// Find the nearest error boundary, looking upwards from the leaf route (or the 24001// route specified by routeId) for the closest ancestor error boundary, 24002// defaulting to the root match 24003function findNearestBoundary(matches, routeId) { 24004 let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches]; 24005 return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0]; 24006} 24007function getShortCircuitMatches(routes) { 24008 // Prefer a root layout route if present, otherwise shim in a route object 24009 let route = routes.length === 1 ? routes[0] : routes.find(r => r.index || !r.path || r.path === "/") || { 24010 id: "__shim-error-route__" 24011 }; 24012 return { 24013 matches: [{ 24014 params: {}, 24015 pathname: "", 24016 pathnameBase: "", 24017 route 24018 }], 24019 route 24020 }; 24021} 24022function getInternalRouterError(status, _temp5) { 24023 let { 24024 pathname, 24025 routeId, 24026 method, 24027 type, 24028 message 24029 } = _temp5 === void 0 ? {} : _temp5; 24030 let statusText = "Unknown Server Error"; 24031 let errorMessage = "Unknown @remix-run/router error"; 24032 if (status === 400) { 24033 statusText = "Bad Request"; 24034 if (method && pathname && routeId) { 24035 errorMessage = "You made a " + method + " request to \"" + pathname + "\" but " + ("did not provide a `loader` for route \"" + routeId + "\", ") + "so there is no way to handle the request."; 24036 } else if (type === "defer-action") { 24037 errorMessage = "defer() is not supported in actions"; 24038 } else if (type === "invalid-body") { 24039 errorMessage = "Unable to encode submission body"; 24040 } 24041 } else if (status === 403) { 24042 statusText = "Forbidden"; 24043 errorMessage = "Route \"" + routeId + "\" does not match URL \"" + pathname + "\""; 24044 } else if (status === 404) { 24045 statusText = "Not Found"; 24046 errorMessage = "No route matches URL \"" + pathname + "\""; 24047 } else if (status === 405) { 24048 statusText = "Method Not Allowed"; 24049 if (method && pathname && routeId) { 24050 errorMessage = "You made a " + method.toUpperCase() + " request to \"" + pathname + "\" but " + ("did not provide an `action` for route \"" + routeId + "\", ") + "so there is no way to handle the request."; 24051 } else if (method) { 24052 errorMessage = "Invalid request method \"" + method.toUpperCase() + "\""; 24053 } 24054 } 24055 return new ErrorResponseImpl(status || 500, statusText, new Error(errorMessage), true); 24056} 24057// Find any returned redirect errors, starting from the lowest match 24058function findRedirect(results) { 24059 let entries = Object.entries(results); 24060 for (let i = entries.length - 1; i >= 0; i--) { 24061 let [key, result] = entries[i]; 24062 if (isRedirectResult(result)) { 24063 return { 24064 key, 24065 result 24066 }; 24067 } 24068 } 24069} 24070function stripHashFromPath(path) { 24071 let parsedPath = typeof path === "string" ? parsePath(path) : path; 24072 return createPath(_extends({}, parsedPath, { 24073 hash: "" 24074 })); 24075} 24076function isHashChangeOnly(a, b) { 24077 if (a.pathname !== b.pathname || a.search !== b.search) { 24078 return false; 24079 } 24080 if (a.hash === "") { 24081 // /page -> /page#hash 24082 return b.hash !== ""; 24083 } else if (a.hash === b.hash) { 24084 // /page#hash -> /page#hash 24085 return true; 24086 } else if (b.hash !== "") { 24087 // /page#hash -> /page#other 24088 return true; 24089 } 24090 // If the hash is removed the browser will re-perform a request to the server 24091 // /page#hash -> /page 24092 return false; 24093} 24094function isDataStrategyResult(result) { 24095 return result != null && typeof result === "object" && "type" in result && "result" in result && (result.type === ResultType.data || result.type === ResultType.error); 24096} 24097function isRedirectDataStrategyResultResult(result) { 24098 return isResponse(result.result) && redirectStatusCodes.has(result.result.status); 24099} 24100function isDeferredResult(result) { 24101 return result.type === ResultType.deferred; 24102} 24103function isErrorResult(result) { 24104 return result.type === ResultType.error; 24105} 24106function isRedirectResult(result) { 24107 return (result && result.type) === ResultType.redirect; 24108} 24109function isDataWithResponseInit(value) { 24110 return typeof value === "object" && value != null && "type" in value && "data" in value && "init" in value && value.type === "DataWithResponseInit"; 24111} 24112function isDeferredData(value) { 24113 let deferred = value; 24114 return deferred && typeof deferred === "object" && typeof deferred.data === "object" && typeof deferred.subscribe === "function" && typeof deferred.cancel === "function" && typeof deferred.resolveData === "function"; 24115} 24116function isResponse(value) { 24117 return value != null && typeof value.status === "number" && typeof value.statusText === "string" && typeof value.headers === "object" && typeof value.body !== "undefined"; 24118} 24119function isRedirectResponse(result) { 24120 if (!isResponse(result)) { 24121 return false; 24122 } 24123 let status = result.status; 24124 let location = result.headers.get("Location"); 24125 return status >= 300 && status <= 399 && location != null; 24126} 24127function isValidMethod(method) { 24128 return validRequestMethods.has(method.toLowerCase()); 24129} 24130function isMutationMethod(method) { 24131 return validMutationMethods.has(method.toLowerCase()); 24132} 24133async function resolveNavigationDeferredResults(matches, results, signal, currentMatches, currentLoaderData) { 24134 let entries = Object.entries(results); 24135 for (let index = 0; index < entries.length; index++) { 24136 let [routeId, result] = entries[index]; 24137 let match = matches.find(m => (m == null ? void 0 : m.route.id) === routeId); 24138 // If we don't have a match, then we can have a deferred result to do 24139 // anything with. This is for revalidating fetchers where the route was 24140 // removed during HMR 24141 if (!match) { 24142 continue; 24143 } 24144 let currentMatch = currentMatches.find(m => m.route.id === match.route.id); 24145 let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined; 24146 if (isDeferredResult(result) && isRevalidatingLoader) { 24147 // Note: we do not have to touch activeDeferreds here since we race them 24148 // against the signal in resolveDeferredData and they'll get aborted 24149 // there if needed 24150 await resolveDeferredData(result, signal, false).then(result => { 24151 if (result) { 24152 results[routeId] = result; 24153 } 24154 }); 24155 } 24156 } 24157} 24158async function resolveFetcherDeferredResults(matches, results, revalidatingFetchers) { 24159 for (let index = 0; index < revalidatingFetchers.length; index++) { 24160 let { 24161 key, 24162 routeId, 24163 controller 24164 } = revalidatingFetchers[index]; 24165 let result = results[key]; 24166 let match = matches.find(m => (m == null ? void 0 : m.route.id) === routeId); 24167 // If we don't have a match, then we can have a deferred result to do 24168 // anything with. This is for revalidating fetchers where the route was 24169 // removed during HMR 24170 if (!match) { 24171 continue; 24172 } 24173 if (isDeferredResult(result)) { 24174 // Note: we do not have to touch activeDeferreds here since we race them 24175 // against the signal in resolveDeferredData and they'll get aborted 24176 // there if needed 24177 invariant(controller, "Expected an AbortController for revalidating fetcher deferred result"); 24178 await resolveDeferredData(result, controller.signal, true).then(result => { 24179 if (result) { 24180 results[key] = result; 24181 } 24182 }); 24183 } 24184 } 24185} 24186async function resolveDeferredData(result, signal, unwrap) { 24187 if (unwrap === void 0) { 24188 unwrap = false; 24189 } 24190 let aborted = await result.deferredData.resolveData(signal); 24191 if (aborted) { 24192 return; 24193 } 24194 if (unwrap) { 24195 try { 24196 return { 24197 type: ResultType.data, 24198 data: result.deferredData.unwrappedData 24199 }; 24200 } catch (e) { 24201 // Handle any TrackedPromise._error values encountered while unwrapping 24202 return { 24203 type: ResultType.error, 24204 error: e 24205 }; 24206 } 24207 } 24208 return { 24209 type: ResultType.data, 24210 data: result.deferredData.data 24211 }; 24212} 24213function hasNakedIndexQuery(search) { 24214 return new URLSearchParams(search).getAll("index").some(v => v === ""); 24215} 24216function getTargetMatch(matches, location) { 24217 let search = typeof location === "string" ? parsePath(location).search : location.search; 24218 if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) { 24219 // Return the leaf index route when index is present 24220 return matches[matches.length - 1]; 24221 } 24222 // Otherwise grab the deepest "path contributing" match (ignoring index and 24223 // pathless layout routes) 24224 let pathMatches = getPathContributingMatches(matches); 24225 return pathMatches[pathMatches.length - 1]; 24226} 24227function getSubmissionFromNavigation(navigation) { 24228 let { 24229 formMethod, 24230 formAction, 24231 formEncType, 24232 text, 24233 formData, 24234 json 24235 } = navigation; 24236 if (!formMethod || !formAction || !formEncType) { 24237 return; 24238 } 24239 if (text != null) { 24240 return { 24241 formMethod, 24242 formAction, 24243 formEncType, 24244 formData: undefined, 24245 json: undefined, 24246 text 24247 }; 24248 } else if (formData != null) { 24249 return { 24250 formMethod, 24251 formAction, 24252 formEncType, 24253 formData, 24254 json: undefined, 24255 text: undefined 24256 }; 24257 } else if (json !== undefined) { 24258 return { 24259 formMethod, 24260 formAction, 24261 formEncType, 24262 formData: undefined, 24263 json, 24264 text: undefined 24265 }; 24266 } 24267} 24268function getLoadingNavigation(location, submission) { 24269 if (submission) { 24270 let navigation = { 24271 state: "loading", 24272 location, 24273 formMethod: submission.formMethod, 24274 formAction: submission.formAction, 24275 formEncType: submission.formEncType, 24276 formData: submission.formData, 24277 json: submission.json, 24278 text: submission.text 24279 }; 24280 return navigation; 24281 } else { 24282 let navigation = { 24283 state: "loading", 24284 location, 24285 formMethod: undefined, 24286 formAction: undefined, 24287 formEncType: undefined, 24288 formData: undefined, 24289 json: undefined, 24290 text: undefined 24291 }; 24292 return navigation; 24293 } 24294} 24295function getSubmittingNavigation(location, submission) { 24296 let navigation = { 24297 state: "submitting", 24298 location, 24299 formMethod: submission.formMethod, 24300 formAction: submission.formAction, 24301 formEncType: submission.formEncType, 24302 formData: submission.formData, 24303 json: submission.json, 24304 text: submission.text 24305 }; 24306 return navigation; 24307} 24308function getLoadingFetcher(submission, data) { 24309 if (submission) { 24310 let fetcher = { 24311 state: "loading", 24312 formMethod: submission.formMethod, 24313 formAction: submission.formAction, 24314 formEncType: submission.formEncType, 24315 formData: submission.formData, 24316 json: submission.json, 24317 text: submission.text, 24318 data 24319 }; 24320 return fetcher; 24321 } else { 24322 let fetcher = { 24323 state: "loading", 24324 formMethod: undefined, 24325 formAction: undefined, 24326 formEncType: undefined, 24327 formData: undefined, 24328 json: undefined, 24329 text: undefined, 24330 data 24331 }; 24332 return fetcher; 24333 } 24334} 24335function getSubmittingFetcher(submission, existingFetcher) { 24336 let fetcher = { 24337 state: "submitting", 24338 formMethod: submission.formMethod, 24339 formAction: submission.formAction, 24340 formEncType: submission.formEncType, 24341 formData: submission.formData, 24342 json: submission.json, 24343 text: submission.text, 24344 data: existingFetcher ? existingFetcher.data : undefined 24345 }; 24346 return fetcher; 24347} 24348function getDoneFetcher(data) { 24349 let fetcher = { 24350 state: "idle", 24351 formMethod: undefined, 24352 formAction: undefined, 24353 formEncType: undefined, 24354 formData: undefined, 24355 json: undefined, 24356 text: undefined, 24357 data 24358 }; 24359 return fetcher; 24360} 24361function restoreAppliedTransitions(_window, transitions) { 24362 try { 24363 let sessionPositions = _window.sessionStorage.getItem(TRANSITIONS_STORAGE_KEY); 24364 if (sessionPositions) { 24365 let json = JSON.parse(sessionPositions); 24366 for (let [k, v] of Object.entries(json || {})) { 24367 if (v && Array.isArray(v)) { 24368 transitions.set(k, new Set(v || [])); 24369 } 24370 } 24371 } 24372 } catch (e) { 24373 // no-op, use default empty object 24374 } 24375} 24376function persistAppliedTransitions(_window, transitions) { 24377 if (transitions.size > 0) { 24378 let json = {}; 24379 for (let [k, v] of transitions) { 24380 json[k] = [...v]; 24381 } 24382 try { 24383 _window.sessionStorage.setItem(TRANSITIONS_STORAGE_KEY, JSON.stringify(json)); 24384 } catch (error) { 24385 warning(false, "Failed to save applied view transitions in sessionStorage (" + error + ")."); 24386 } 24387 } 24388} 24389//#endregion 24390
24391 24392//# sourceMappingURL=router.js.map 24393 24394 24395/***/ }, 24396 24397/***/ 86425 24398(module, __unused_webpack_exports, __webpack_require__) { 24399 24400"use strict"; 24401 24402 24403var _warn = _interopRequireDefault(__webpack_require__(81157)); 24404function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 24405// https://developers.google.com/tag-manager/quickstart 24406 24407const Snippets = { 24408 tags: function ({ 24409 id, 24410 events, 24411 dataLayer, 24412 dataLayerName, 24413 preview = undefined, 24414 auth = undefined, 24415 nonce = undefined, 24416 source 24417 }) { 24418 if (!id) (0, _warn.default)('GTM Id is required'); 24419 const url = new URL(source); 24420 const environment = auth && preview ? `>m_auth=${auth}>m_preview=${preview}>m_cookies_win=x` : ''; 24421 const iframe = ` 24422 <iframe src="${url.origin}/ns.html?id=${id}${environment}" 24423 height="0" width="0" style="display:none;visibility:hidden" id="tag-manager"></iframe>`; 24424 const script = ` 24425 (function(w,d,s,l,i){w[l]=w[l]||[]; 24426 w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'}${events.length > 0 ? ',' + JSON.stringify(events).slice(1, -1) : ''}); 24427 var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:''; 24428 j.async=true; 24429 j.src='${source}?id='+i+dl+'${environment}'; 24430 ${nonce ? `j.setAttribute('nonce','${nonce}');` : ''} 24431 f.parentNode.insertBefore(j,f); 24432 })(window,document,'script','${dataLayerName}','${id}');`; 24433 const dataLayerVar = this.dataLayer(dataLayer, dataLayerName); 24434 return { 24435 iframe, 24436 script, 24437 dataLayerVar 24438 }; 24439 }, 24440 dataLayer: function (dataLayer, dataLayerName) { 24441 return ` 24442 window.${dataLayerName} = window.${dataLayerName} || []; 24443 window.${dataLayerName}.push(${JSON.stringify(dataLayer)})`; 24444 } 24445}; 24446module.exports = Snippets; 24447 24448/***/ }, 24449 24450/***/ 67088 24451(module, __unused_webpack_exports, __webpack_require__) { 24452 24453"use strict"; 24454 24455 24456var _Snippets = _interopRequireDefault(__webpack_require__(86425)); 24457function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 24458const TagManager = { 24459 dataScript: function (dataLayer) { 24460 const script = document.createElement('script'); 24461 script.innerHTML = dataLayer; 24462 return script; 24463 }, 24464 gtm: function (args) { 24465 const snippets = _Snippets.default.tags(args); 24466 const noScript = () => { 24467 const noscript = document.createElement('noscript'); 24468 noscript.innerHTML = snippets.iframe; 24469 return noscript; 24470 }; 24471 const script = () => { 24472 const script = document.createElement('script'); 24473 script.innerHTML = snippets.script; 24474 if (args.nonce) { 24475 script.setAttribute('nonce', args.nonce); 24476 } 24477 return script; 24478 }; 24479 const dataScript = this.dataScript(snippets.dataLayerVar); 24480 return { 24481 noScript, 24482 script, 24483 dataScript 24484 }; 24485 }, 24486 initialize: function ({ 24487 gtmId, 24488 events = [], 24489 dataLayer = undefined, 24490 dataLayerName = 'dataLayer', 24491 auth = undefined, 24492 preview = undefined, 24493 nonce = undefined, 24494 source = 'https://googletagmanager.com/gtm.js' 24495 }) { 24496 const gtm = this.gtm({ 24497 id: gtmId, 24498 events, 24499 dataLayer, 24500 dataLayerName, 24501 auth, 24502 preview, 24503 nonce, 24504 source 24505 }); 24506 if (dataLayer) document.head.appendChild(gtm.dataScript); 24507 document.head.insertBefore(gtm.script(), document.head.childNodes[0]); 24508 document.body.insertBefore(gtm.noScript(), document.body.childNodes[0]); 24509 }, 24510 dataLayer: function ({ 24511 dataLayer, 24512 dataLayerName = 'dataLayer' 24513 }) { 24514 if (window[dataLayerName]) return window[dataLayerName].push(dataLayer); 24515 const snippets = _Snippets.default.dataLayer(dataLayer, dataLayerName); 24516 const dataScript = this.dataScript(snippets); 24517 document.head.insertBefore(dataScript, document.head.childNodes[0]); 24518 } 24519}; 24520module.exports = TagManager; 24521 24522/***/ }, 24523 24524/***/ 40439 24525(module, __unused_webpack_exports, __webpack_require__) { 24526 24527"use strict"; 24528 24529 24530var _TagManager = _interopRequireDefault(__webpack_require__(67088)); 24531function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 24532module.exports = _TagManager.default; 24533 24534/***/ }, 24535 24536/***/ 81157 24537(module) { 24538 24539"use strict"; 24540 24541 24542const warn = s => { 24543 console.warn('[react-gtm-module]', s); 24544}; 24545module.exports = warn; 24546 24547/***/ }, 24548 24549/***/ 22255 24550(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 24551 24552"use strict"; 24553/* harmony export */ __webpack_require__.d(__webpack_exports__, { 24554/* harmony export */ L: () => (/* binding */ LruCache), 24555/* harmony export */ a: () => (/* binding */ cachedSearchWithContext), 24556/* harmony export */ b: () => (/* binding */ cachedSearchWithCookies), 24557/* harmony export */ c: () => (/* binding */ cachedSearch), 24558/* harmony export */ d: () => (/* binding */ deliveryApi), 24559/* harmony export */ e: () => (/* binding */ deliveryApiWithCookies), 24560/* harmony export */ g: () => (/* binding */ getClientConfig) 24561/* harmony export */ }); 24562/* harmony import */ var contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15575); 24563/* harmony import */ var contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__); 24564/* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17276); 24565/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23790); 24566/* harmony import */ var _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95137); 24567/* harmony import */ var _CookieConstants_DEmbwzYr_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83068); 24568 24569 24570 24571 24572 24573 24574const isSSR = typeof window === 'undefined'; 24575 24576class CacheNode { 24577 constructor(key, value) { 24578 this.key = key; 24579 this.value = value; 24580 this.next = null; 24581 this.prev = null; 24582 } 24583} 24584class LruCache { 24585 constructor(limit = 100) { 24586 this.map = {}; 24587 this.head = null; 24588 this.tail = null; 24589 this.limit = limit || 100; 24590 this.size = 0; 24591 } 24592 get(key) { 24593 if (this.map[key]) { 24594 let value = this.map[key].value; 24595 let node = new CacheNode(key, value); 24596 this.remove(key); 24597 this.setHead(node); 24598 return value; 24599 } 24600 } 24601 set(key, value) { 24602 let node = new CacheNode(key, value); 24603 if (this.map[key]) { 24604 this.remove(key); 24605 } else { 24606 if (this.size >= this.limit) { 24607 delete this.map[this.tail.key]; 24608 this.size--; 24609 this.tail = this.tail.prev; 24610 this.tail.next = null; 24611 } 24612 } 24613 this.setHead(node); 24614 } 24615 setHead(node) { 24616 node.next = this.head; 24617 node.prev = null; 24618 if (this.head) { 24619 this.head.prev = node; 24620 } 24621 this.head = node; 24622 if (!this.tail) { 24623 this.tail = node; 24624 } 24625 this.size++; 24626 this.map[node.key] = node; 24627 } 24628 remove(key) { 24629 let node = this.map[key]; 24630 if (!node) return; // This is sometimes null and crashes the container without this check 24631 24632 if (node.prev) { 24633 node.prev.next = node.next; 24634 } else { 24635 this.head = node.next; 24636 } 24637 if (node.next) { 24638 node.next.prev = node.prev; 24639 } else { 24640 this.tail = node.prev; 24641 } 24642 delete this.map[key]; 24643 this.size--; 24644 } 24645} 24646 24647// CachedSearch does not cache results in SSR by design 24648class CachedSearch { 24649 constructor(ssr) { 24650 var _this$ssr; 24651 this.cache = new LruCache(); 24652 this.ssr = ssr; 24653 this.cookies = (_this$ssr = this.ssr) === null || _this$ssr === void 0 ? void 0 : _this$ssr.cookies.raw; 24654 } 24655 getClient(...args) { 24656 return new DeliveryApi(this.ssr).getClient(...args); 24657 } 24658 search(query, linkDepth = 0, project) { 24659 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create(getClientConfig(project, this.ssr)); 24660 return this.request(`${project}+${JSON.stringify(query)}+${linkDepth}`, () => client.entries.search(query, linkDepth)); 24661 } 24662 searchUsingPost(query, linkDepth = 0, project = '') { 24663 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create(getClientConfig(project, this.ssr)); 24664 return this.request(`${project}+${JSON.stringify(query)}+${linkDepth}`, () => client.entries.searchUsingPost(query, linkDepth)); 24665 } 24666 get(id, linkDepth = 0, versionStatus = 'published', project, fields) { 24667 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create({ 24668 ...getClientConfig(project, this.ssr), 24669 versionStatus 24670 }); 24671 return this.request(id, () => client.entries.get({ 24672 id, 24673 linkDepth, 24674 fields 24675 })); 24676 } 24677 getContentType(id, project) { 24678 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create(getClientConfig(project, this.ssr)); 24679 return this.request(`[CONTENT TYPE] ${id} ${project}`, () => client.contentTypes.get(id)); 24680 } 24681 getRootNode(options, versionStatus = 'published', project) { 24682 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create({ 24683 ...getClientConfig(project, this.ssr), 24684 versionStatus 24685 }); 24686 return this.request(`${project} / ${JSON.stringify(options)}`, () => client.nodes.getRoot(options)); 24687 } 24688 getNode(options, project) { 24689 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create(getClientConfig(project, this.ssr)); 24690 return this.request(`${project} ${options && typeof options !== 'string' ? 'path' in options ? options.path : options.id : options} ${JSON.stringify(options)}`, () => client.nodes.get(options)); 24691 } 24692 getAncestors(options, project) { 24693 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create(getClientConfig(project, this.ssr)); 24694 return this.request(`${project} [A] ${options && typeof options !== 'string' && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getAncestors(options)); 24695 } 24696 getChildren(options, project) { 24697 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create(getClientConfig(project, this.ssr)); 24698 return this.request(`${project} [C] ${options && typeof options !== 'string' && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getChildren(options)); 24699 } 24700 getSiblings(options, project) { 24701 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create(getClientConfig(project, this.ssr)); 24702 return this.request(`${project} [S] ${options && typeof options !== 'string' && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getSiblings(options)); 24703 } 24704 request(key, execute) { 24705 // do not cache results in SSR 24706 if (!this.cache.get(key) || typeof window == 'undefined') { 24707 const promise = execute(); 24708 this.cache.set(key, promise); 24709 promise.catch(() => { 24710 this.cache.remove(key); 24711 }); 24712 } 24713 return this.cache.get(key); 24714 } 24715 24716 /** Use the cached API for fetch requests */ 24717 fetch(uri, opts = {}) { 24718 return this.request(`[FETCH] ${uri} ${JSON.stringify(opts)}`, () => fetch(uri, opts)); 24719 } 24720} 24721const cachedSearch = new CachedSearch(); 24722 24723/** Create a cached search instance attached to the current environment 24724 * SSR context and connected to your environment via global variable 24725 * `DELIVERY_API_CONFIG` */ 24726const cachedSearchWithContext = ssr => new CachedSearch(ssr); 24727 24728/** @deprecated Use cachedSearchWithContext instead */ 24729const cachedSearchWithCookies = cachedSearchWithContext; 24730 24731const mapCookieHeader = cookies => typeof cookies === 'object' ? Object.entries(cookies).map(([name, value]) => `${name}=${value}`).join('; ') : cookies; 24732const getSsrReferer = ({ 24733 request 24734}) => { 24735 if (request) { 24736 try { 24737 const url = new URL(request.url, `${request.protocol || `http`}://${request.headers.host}`); 24738 return url.href; 24739 } catch (ex) { 24740 console.error(`getSsrReferer cannot parse url ${request.url} and host ${request.headers.host}`); 24741 return request.url; 24742 } 24743 } 24744 24745 // if (typeof window === 'undefined') { 24746 // const state = reduxStore.getState(); 24747 // const referer = `${selectCurrentHostname(state)}${selectCurrentPath( 24748 // state 24749 // )}${selectCurrentSearch(state)}`; 24750 24751 // return referer; 24752 // } 24753 return ''; 24754}; 24755 24756/** 24757 * Record API call metrics in Redux state. 24758 * Metrics are collected on both SSR and client-side. 24759 * Surrogate keys are only included during SSR. 24760 */ 24761const recordApiResponse = (ssr, startTime = Date.now()) => response => { 24762 var _performance$getEntri; 24763 // Duration: Performance API client-side, closure timestamp best-effort fallback for SSR 24764 const duration = Math.round(((_performance$getEntri = performance.getEntriesByName(response.url, 'resource')) === null || _performance$getEntri === void 0 || (_performance$getEntri = _performance$getEntri[0]) === null || _performance$getEntri === void 0 ? void 0 : _performance$getEntri.duration) || Date.now() - startTime); 24765 const contentLength = Number(response.headers.get('Content-Length')); 24766 if (contentLength > 100_000) 24767 // > 100 KB
24768 console.warn(`[crb] ð Large response (${contentLength} bytes) from ${response.url}`); 24769 if (duration > 5_000_000) 24770 // > 5 seconds 24771 console.warn(`[crb] ð Slow response (${duration} ms) from ${response.url}`); 24772 const metrics = { 24773 context: isSSR ? 'ssr' : 'client', 24774 statusCode: response.status, 24775 contentLength, 24776 duration, 24777 url: response.url 24778 }; 24779 24780 // Surrogate keys are only meaningful during SSR 24781 if (isSSR) { 24782 const surrogateKeyHeader = response.headers.get('surrogate-key'); 24783 if (surrogateKeyHeader) { 24784 metrics.surrogateKeys = surrogateKeyHeader.split(' ').filter(Boolean); 24785 } else if (response.status === 200) { 24786 console.info(`[recordApiResponse] No surrogate-key header in ${response.url}`); 24787 } 24788 } 24789 24790 // Using imported reduxStore in SSR is unreliable during high 24791 // concurrent loads and exists here as a best effort fallback 24792 // in case the SSRContext is not provided 24793 const put = (ssr === null || ssr === void 0 ? void 0 : ssr.dispatch) || (_store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_3__.r === null || _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_3__.r === void 0 ? void 0 : _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_3__.r.dispatch); 24794 put === null || put === void 0 || put((0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_2__.a3)(metrics)); 24795}; 24796 24797/** 24798 * Create a new Config object to create a DeliveryAPI Client 24799 */ 24800const deliveryApiConfig = ssr => { 24801 const config = { 24802 ...DELIVERY_API_CONFIG /* global DELIVERY_API_CONFIG */ 24803 }; 24804 config.responseHandler = { 24805 // Record metrics on both SSR and client-side; 24806 // surrogate keys are only captured during SSR. 24807 [200]: recordApiResponse(ssr) 24808 }; 24809 24810 // Add SSR headers and handlers 24811 if (isSSR) { 24812 config.defaultHeaders = { 24813 'x-require-surrogate-key': 'true', 24814 // request surrogate-key response header 24815 'x-crb-ssr': 'true' // add this for support tracing 24816 }; 24817 if (ssr) config.defaultHeaders.referer = getSsrReferer(ssr); // add this for support tracing 24818 } else if (true /* global PROXY_DELIVERY_API */) { 24819 // ensure a relative url is used client-side to bypass the need for CORS (separate OPTIONS calls) 24820 config.rootUrl = ''; 24821 config.responseHandler[404] = () => null; 24822 } 24823 return config; 24824}; 24825const getClientConfig = (project, ssr) => { 24826 const config = deliveryApiConfig(ssr); 24827 if (project) { 24828 config.projectId = project; 24829 } 24830 if (ssr !== null && ssr !== void 0 && ssr.cookies) { 24831 const cookieHeader = mapCookieHeader((0,_CookieConstants_DEmbwzYr_js__WEBPACK_IMPORTED_MODULE_4__.f)(ssr.cookies)); 24832 if (cookieHeader) { 24833 config.defaultHeaders = Object.assign(config.defaultHeaders || {}, { 24834 Cookie: cookieHeader 24835 }); 24836 } 24837 } 24838 return config; 24839}; 24840 24841// export * from 'contensis-delivery-api'; 24842 24843class DeliveryApi { 24844 constructor(ssr) { 24845 this.getClientSideVersionStatus = () => { 24846 if (typeof window !== 'undefined') { 24847 // Allow overriding versionStatus with the querystring 24848 const { 24849 versionStatus 24850 } = (0,query_string__WEBPACK_IMPORTED_MODULE_1__.parse)(window.location.search); 24851 if (versionStatus) return versionStatus; 24852 // Client-side we will have a global variable set if rendered by SSR in production 24853 if (typeof window.versionStatus !== 'undefined') return window.versionStatus; 24854 // For localhost development we can only work out versionStatus from the current hostname 24855 const currentHostname = window.location.hostname; 24856 return this.getVersionStatusFromHostname(currentHostname); 24857 } 24858 return null; 24859 }; 24860 this.getServerSideVersionStatus = request => { 24861 var _ref, _request$query$versio; 24862 const rawStatus = (_ref = (_request$query$versio = request.query.versionStatus) != null ? _request$query$versio : deliveryApi.getVersionStatusFromHeaders(request.headers)) != null ? _ref : deliveryApi.getVersionStatusFromHostname(request.hostname); 24863 const status = typeof rawStatus === 'string' ? rawStatus.trim().toLowerCase() : ''; 24864 24865 // Validate the status to only allow known values and ignore any others 24866 // to prevent malicious injection 24867 if (['latest', 'published'].includes(status)) { 24868 return status; 24869 } 24870 return undefined; 24871 }; 24872 this.getVersionStatusFromHeaders = headers => { 24873 const versionStatusHeader = headers['x-entry-versionstatus']; 24874 if (typeof versionStatusHeader !== 'undefined') return versionStatusHeader; 24875 return null; 24876 }; 24877 this.getVersionStatusFromHostname = currentHostname => { 24878 if (currentHostname.indexOf('localhost') > -1) return 'latest'; 24879 if (currentHostname.endsWith('contensis.cloud')) { 24880 if (currentHostname.indexOf('preview.') > -1) { 24881 return 'latest'; 24882 } else { 24883 return 'published'; 24884 } 24885 } 24886 if (currentHostname.endsWith('cloud.contensis.com')) { 24887 if (currentHostname.indexOf('preview-') > -1) { 24888 return 'latest'; 24889 } else { 24890 return 'published'; 24891 } 24892 } 24893 return 'published'; 24894 }; 24895 this.search = (query, linkDepth = 0, project) => { 24896 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create(getClientConfig(project, this.ssr)); 24897 return client.entries.search(query, typeof linkDepth !== 'undefined' ? linkDepth : 1); 24898 }; 24899 this.getClient = (versionStatus = 'published', project) => contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create({ 24900 ...getClientConfig(project, this.ssr), 24901 versionStatus 24902 }); 24903 this.getEntry = (id, linkDepth = 0, versionStatus = 'published', project) => { 24904 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_0__.Client.create({ 24905 ...getClientConfig(project, this.ssr), 24906 versionStatus 24907 }); 24908 return client.entries.get({ 24909 id, 24910 linkDepth 24911 }); 24912 }; 24913 this.ssr = ssr; 24914 this.cookies = ssr === null || ssr === void 0 ? void 0 : ssr.cookies.raw; 24915 } 24916} 24917const deliveryApi = new DeliveryApi(); 24918const deliveryApiWithCookies = ssr => new DeliveryApi(ssr); 24919 24920 24921//# sourceMappingURL=ContensisDeliveryApi-Czq1gBOi.js.map 24922 24923 24924/***/ }, 24925 24926/***/ 83068 24927(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 24928 24929"use strict"; 24930/* harmony export */ __webpack_require__.d(__webpack_exports__, { 24931/* harmony export */ B: () => (/* binding */ BEARER_TOKEN_COOKIE), 24932/* harmony export */ L: () => (/* binding */ LOGIN_COOKIE), 24933/* harmony export */ R: () => (/* binding */ REFRESH_TOKEN_COOKIE), 24934/* harmony export */ f: () =>
24934 (/* binding */ findLoginCookies) 24935/* harmony export */ }); 24936const BEARER_TOKEN_COOKIE = 'ContensisSecurityBearerToken'; 24937const LOGIN_COOKIE = 'ContensisCMSUserName'; 24938const REFRESH_TOKEN_COOKIE = 'RefreshToken'; 24939const findLoginCookies = cookies => typeof cookies === 'object' ? Object.fromEntries(Object.entries(cookies).filter(([name]) => [LOGIN_COOKIE, REFRESH_TOKEN_COOKIE].includes(name))) : cookies; 24940 24941 24942//# sourceMappingURL=CookieConstants-DEmbwzYr.js.map 24943 24944 24945/***/ }, 24946 24947/***/ 26240 24948(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 24949 24950"use strict"; 24951/* harmony export */ __webpack_require__.d(__webpack_exports__, { 24952/* harmony export */ C: () => (/* binding */ CookieHelper) 24953/* harmony export */ }); 24954/* unused harmony export a */ 24955var dist = {}; 24956 24957var hasRequiredDist; 24958 24959function requireDist () { 24960 if (hasRequiredDist) return dist; 24961 hasRequiredDist = 1; 24962 Object.defineProperty(dist, "__esModule", { value: true }); 24963 dist.parse = parse; 24964 dist.serialize = serialize; 24965 /** 24966 * RegExp to match cookie-name in RFC 6265 sec 4.1.1 24967 * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2 24968 * which has been replaced by the token definition in RFC 7230 appendix B. 24969 * 24970 * cookie-name = token 24971 * token = 1*tchar 24972 * tchar = "!" / "#" / "$" / "%" / "&" / "'" / 24973 * "*" / "+" / "-" / "." / "^" / "_" / 24974 * "`" / "|" / "~" / DIGIT / ALPHA 24975 * 24976 * Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191 24977 * Allow same range as cookie value, except `=`, which delimits end of name. 24978 */ 24979 const cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/; 24980 /** 24981 * RegExp to match cookie-value in RFC 6265 sec 4.1.1 24982 * 24983 * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) 24984 * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E 24985 * ; US-ASCII characters excluding CTLs, 24986 * ; whitespace DQUOTE, comma, semicolon, 24987 * ; and backslash 24988 * 24989 * Allowing more characters: https://github.com/jshttp/cookie/issues/191 24990 * Comma, backslash, and DQUOTE are not part of the parsing algorithm. 24991 */ 24992 const cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/; 24993 /** 24994 * RegExp to match domain-value in RFC 6265 sec 4.1.1 24995 * 24996 * domain-value = <subdomain> 24997 * ; defined in [RFC1034], Section 3.5, as 24998 * ; enhanced by [RFC1123], Section 2.1 24999 * <subdomain> = <label> | <subdomain> "." <label> 25000 * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ] 25001 * Labels must be 63 characters or less. 25002 * 'let-dig' not 'letter' in the first char, per RFC1123 25003 * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str> 25004 * <let-dig-hyp> = <let-dig> | "-" 25005 * <let-dig> = <letter> | <digit> 25006 * <letter> = any one of the 52 alphabetic characters A through Z in 25007 * upper case and a through z in lower case 25008 * <digit> = any one of the ten digits 0 through 9 25009 * 25010 * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173 25011 * 25012 * > (Note that a leading %x2E ("."), if present, is ignored even though that 25013 * character is not permitted, but a trailing %x2E ("."), if present, will 25014 * cause the user agent to ignore the attribute.) 25015 */ 25016 const domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i; 25017 /** 25018 * RegExp to match path-value in RFC 6265 sec 4.1.1 25019 * 25020 * path-value = <any CHAR except CTLs or ";"> 25021 * CHAR = %x01-7F 25022 * ; defined in RFC 5234 appendix B.1 25023 */ 25024 const pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/; 25025 const __toString = Object.prototype.toString; 25026 const NullObject = /* @__PURE__ */ (() => { 25027 const C = function () { }; 25028 C.prototype = Object.create(null); 25029 return C; 25030 })(); 25031 /** 25032 * Parse a cookie header. 25033 * 25034 * Parse the given cookie header string into an object 25035 * The object has the various cookies as keys(names) => values 25036 */ 25037 function parse(str, options) { 25038 const obj = new NullObject(); 25039 const len = str.length; 25040 // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='. 25041 if (len < 2) 25042 return obj; 25043 const dec = options?.decode || decode; 25044 let index = 0; 25045 do { 25046 const eqIdx = str.indexOf("=", index); 25047 if (eqIdx === -1) 25048 break; // No more cookie pairs. 25049 const colonIdx = str.indexOf(";", index); 25050 const endIdx = colonIdx === -1 ? len : colonIdx; 25051 if (eqIdx > endIdx) { 25052 // backtrack on prior semicolon 25053 index = str.lastIndexOf(";", eqIdx - 1) + 1; 25054 continue; 25055 }
25056 const keyStartIdx = startIndex(str, index, eqIdx); 25057 const keyEndIdx = endIndex(str, eqIdx, keyStartIdx); 25058 const key = str.slice(keyStartIdx, keyEndIdx); 25059 // only assign once 25060 if (obj[key] === undefined) { 25061 let valStartIdx = startIndex(str, eqIdx + 1, endIdx); 25062 let valEndIdx = endIndex(str, endIdx, valStartIdx); 25063 const value = dec(str.slice(valStartIdx, valEndIdx)); 25064 obj[key] = value; 25065 } 25066 index = endIdx + 1; 25067 } while (index < len); 25068 return obj; 25069 } 25070 function startIndex(str, index, max) { 25071 do { 25072 const code = str.charCodeAt(index); 25073 if (code !== 0x20 /* */ && code !== 0x09 /* \t */) 25074 return index; 25075 } while (++index < max); 25076 return max; 25077 } 25078 function endIndex(str, index, min) { 25079 while (index > min) { 25080 const code = str.charCodeAt(--index); 25081 if (code !== 0x20 /* */ && code !== 0x09 /* \t */) 25082 return index + 1; 25083 } 25084 return min; 25085 } 25086 /** 25087 * Serialize data into a cookie header. 25088 * 25089 * Serialize a name value pair into a cookie string suitable for 25090 * http headers. An optional options object specifies cookie parameters. 25091 * 25092 * serialize('foo', 'bar', { httpOnly: true }) 25093 * => "foo=bar; httpOnly" 25094 */ 25095 function serialize(name, val, options) { 25096 const enc = options?.encode || encodeURIComponent; 25097 if (!cookieNameRegExp.test(name)) { 25098 throw new TypeError(`argument name is invalid: ${name}`); 25099 } 25100 const value = enc(val); 25101 if (!cookieValueRegExp.test(value)) { 25102 throw new TypeError(`argument val is invalid: ${val}`); 25103 } 25104 let str = name + "=" + value; 25105 if (!options) 25106 return str; 25107 if (options.maxAge !== undefined) { 25108 if (!Number.isInteger(options.maxAge)) { 25109 throw new TypeError(`option maxAge is invalid: ${options.maxAge}`); 25110 } 25111 str += "; Max-Age=" + options.maxAge; 25112 } 25113 if (options.domain) { 25114 if (!domainValueRegExp.test(options.domain)) { 25115 throw new TypeError(`option domain is invalid: ${options.domain}`); 25116 } 25117 str += "; Domain=" + options.domain; 25118 } 25119 if (options.path) { 25120 if (!pathValueRegExp.test(options.path)) { 25121 throw new TypeError(`option path is invalid: ${options.path}`); 25122 } 25123 str += "; Path=" + options.path; 25124 } 25125 if (options.expires) { 25126 if (!isDate(options.expires) || 25127 !Number.isFinite(options.expires.valueOf())) {
vendor: 4,279 bytes, lines 25128-25271
25128 throw new TypeError(`option expires is invalid: ${options.expires}`); 25129 } 25130 str += "; Expires=" + options.expires.toUTCString(); 25131 } 25132 if (options.httpOnly) { 25133 str += "; HttpOnly"; 25134 } 25135 if (options.secure) { 25136 str += "; Secure"; 25137 } 25138 if (options.partitioned) { 25139 str += "; Partitioned"; 25140 } 25141 if (options.priority) { 25142 const priority = typeof options.priority === "string" 25143 ? options.priority.toLowerCase() 25144 : undefined; 25145 switch (priority) { 25146 case "low": 25147 str += "; Priority=Low"; 25148 break; 25149 case "medium": 25150 str += "; Priority=Medium"; 25151 break; 25152 case "high": 25153 str += "; Priority=High"; 25154 break; 25155 default: 25156 throw new TypeError(`option priority is invalid: ${options.priority}`); 25157 } 25158 } 25159 if (options.sameSite) { 25160 const sameSite = typeof options.sameSite === "string" 25161 ? options.sameSite.toLowerCase() 25162 : options.sameSite; 25163 switch (sameSite) { 25164 case true: 25165 case "strict": 25166 str += "; SameSite=Strict"; 25167 break; 25168 case "lax": 25169 str += "; SameSite=Lax"; 25170 break; 25171 case "none": 25172 str += "; SameSite=None"; 25173 break; 25174 default: 25175 throw new TypeError(`option sameSite is invalid: ${options.sameSite}`); 25176 } 25177 } 25178 return str; 25179 } 25180 /** 25181 * URL-decode string value. Optimized to skip native call when no %. 25182 */ 25183 function decode(str) { 25184 if (str.indexOf("%") === -1) 25185 return str; 25186 try { 25187 return decodeURIComponent(str); 25188 } 25189 catch (e) { 25190 return str; 25191 } 25192 } 25193 /** 25194 * Determine if value is a Date. 25195 */ 25196 function isDate(val) { 25197 return __toString.call(val) === "[object Date]"; 25198 } 25199 25200 return dist; 25201} 25202 25203var distExports = requireDist(); 25204 25205function hasDocumentCookie() { 25206 const testingValue = typeof __webpack_require__.g === 'undefined' 25207 ? undefined 25208 : __webpack_require__.g.TEST_HAS_DOCUMENT_COOKIE; 25209 if (typeof testingValue === 'boolean') { 25210 return testingValue; 25211 } 25212 // Can we get/set cookies on document.cookie? 25213 return typeof document === 'object' && typeof document.cookie === 'string'; 25214} 25215function parseCookies(cookies) { 25216 if (typeof cookies === 'string') { 25217 return distExports.parse(cookies); 25218 } 25219 else if (typeof cookies === 'object' && cookies !== null) { 25220 return cookies; 25221 } 25222 else { 25223 return {}; 25224 } 25225} 25226function readCookie(value, options = {}) { 25227 const cleanValue = cleanupCookieValue(value); 25228 if (!options.doNotParse) { 25229 try { 25230 return JSON.parse(cleanValue); 25231 } 25232 catch (e) { 25233 // At least we tried 25234 } 25235 } 25236 // Ignore clean value if we failed the deserialization 25237 // It is not relevant anymore to trim those values 25238 return value; 25239} 25240function cleanupCookieValue(value) { 25241 // express prepend j: before serializing a cookie 25242 if (value && value[0] === 'j' && value[1] === ':') { 25243 return value.substr(2); 25244 } 25245 return value; 25246} 25247 25248class Cookies { 25249 constructor(cookies, defaultSetOptions = {}) { 25250 this.changeListeners = []; 25251 this.HAS_DOCUMENT_COOKIE = false; 25252 this.update = () => { 25253 if (!this.HAS_DOCUMENT_COOKIE) { 25254 return; 25255 } 25256 const previousCookies = this.cookies; 25257 this.cookies = distExports.parse(document.cookie); 25258 this._checkChanges(previousCookies); 25259 }; 25260 const domCookies = typeof document === 'undefined' ? '' : document.cookie; 25261 this.cookies = parseCookies(cookies || domCookies); 25262 this.defaultSetOptions = defaultSetOptions; 25263 this.HAS_DOCUMENT_COOKIE = hasDocumentCookie(); 25264 } 25265 _emitChange(params) { 25266 for (let i = 0; i < this.changeListeners.length; ++i) { 25267 this.changeListeners[i](params); 25268 } 25269 } 25270 _checkChanges(previousCookies) { 25271 const names = new Set(Object.keys(previousCookies).concat(Object.keys(this.cookies)));
25272 names.forEach((name) => { 25273 if (previousCookies[name] !== this.cookies[name]) { 25274 this._emitChange({ 25275 name, 25276 value: readCookie(this.cookies[name]), 25277 }); 25278 } 25279 }); 25280 } 25281 _startPolling() { 25282 this.pollingInterval = setInterval(this.update, 300); 25283 } 25284 _stopPolling() { 25285 if (this.pollingInterval) { 25286 clearInterval(this.pollingInterval); 25287 } 25288 } 25289 get(name, options = {}) { 25290 if (!options.doNotUpdate) { 25291 this.update(); 25292 } 25293 return readCookie(this.cookies[name], options); 25294 } 25295 getAll(options = {}) { 25296 if (!options.doNotUpdate) { 25297 this.update(); 25298 } 25299 const result = {}; 25300 for (let name in this.cookies) { 25301 result[name] = readCookie(this.cookies[name], options); 25302 } 25303 return result; 25304 } 25305 set(name, value, options) { 25306 if (options) { 25307 options = Object.assign(Object.assign({}, this.defaultSetOptions), options); 25308 } 25309 else { 25310 options = this.defaultSetOptions; 25311 } 25312 const stringValue = typeof value === 'string' ? value : JSON.stringify(value); 25313 this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: stringValue }); 25314 if (this.HAS_DOCUMENT_COOKIE) { 25315 document.cookie = distExports.serialize(name, stringValue, options); 25316 } 25317 this._emitChange({ name, value, options }); 25318 } 25319 remove(name, options) { 25320 const finalOptions = (options = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 })); 25321 this.cookies = Object.assign({}, this.cookies); 25322 delete this.cookies[name]; 25323 if (this.HAS_DOCUMENT_COOKIE) { 25324 document.cookie = distExports.serialize(name, '', finalOptions); 25325 } 25326 this._emitChange({ name, value: undefined, options }); 25327 } 25328 addChangeListener(callback) { 25329 this.changeListeners.push(callback); 25330 if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1) { 25331 if (typeof window === 'object' && 'cookieStore' in window) { 25332 window.cookieStore.addEventListener('change', this.update); 25333 } 25334 else { 25335 this._startPolling(); 25336 } 25337 } 25338 } 25339 removeChangeListener(callback) { 25340 const idx = this.changeListeners.indexOf(callback); 25341 if (idx >= 0) { 25342 this.changeListeners.splice(idx, 1); 25343 } 25344 if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0) { 25345 if (typeof window === 'object' && 'cookieStore' in window) { 25346 window.cookieStore.removeEventListener('change', this.update); 25347 } 25348 else { 25349 this._stopPolling(); 25350 } 25351 } 25352 } 25353 removeAllChangeListeners() { 25354 while (this.changeListeners.length > 0) { 25355 this.removeChangeListener(this.changeListeners[0]); 25356 } 25357 } 25358} 25359 25360const COOKIE_VALID_DAYS = 1; // 0 = Session cookie 25361 25362// CookieHelper is a class that takes in and lets us pass around the methods provided 25363// by `useCookie` react hook in backend code that is connected to the universal-cookies 25364// instance created in SSR middleware (and provides browser cookies) 25365class CookieHelper { 25366 get raw() { 25367 return this.cookies; 25368 } 25369 get cookie() { 25370 return this.set ? this : this.fallback; 25371 } 25372 constructor(cookies, setCookie, removeCookie, updateCookies) { 25373 // Add fallback methods if global cookies not supplied 25374 if (!cookies || !setCookie || !removeCookie) this.fallback = new Cookies(); 25375 this.cookies = cookies || this.fallback.getAll(); 25376 if (setCookie) this.set = setCookie; 25377 if (removeCookie) this.remove = removeCookie; 25378 if (updateCookies) this.update = updateCookies; 25379 } 25380 GetCookie(name) { 25381 const cookie = this.cookies[name]; 25382 if (typeof cookie === 'undefined') { 25383 return null; 25384 } 25385 return cookie; 25386 } 25387 SetCookie(name, value, maxAgeDays = COOKIE_VALID_DAYS) { 25388 // update local cookies object as this is provided as a clone of `req.universalCookies` 25389 this.cookies[name] = value; 25390 25391 // call the passed setCookie method so we can update the `universal-cookie` instance 25392 // with the change listener attached so the cookies can be set in SSR response 25393 if (maxAgeDays === 0) this.cookie.set(name, value);else this.cookie.set(name, value, { 25394 expires: addDays(new Date(), maxAgeDays), 25395 path: '/' 25396 }); 25397 } 25398 DeleteCookie(name) { 25399 // update local cookies object as this is provided as a clone of `req.universalCookies` 25400 delete this.cookies[name]; 25401 this.cookie.remove(name, { 25402 path: '/' 25403 }); 25404 } 25405} 25406const addDays = (date = new Date(), days) => { 25407 const result = new Date(date); 25408 result.setDate(result.getDate() + days); 25409 return result; 25410}; 25411 25412 25413//# sourceMappingURL=CookieHelper.class-C6rTRl_1.js.map 25414 25415 25416/***/ }, 25417 25418/***/ 43236 25419(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 25420 25421"use strict"; 25422/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25423/* harmony export */ a: () => (/* binding */ RouteLoader) 25424/* harmony export */ }); 25425/* unused harmony exports H, R, S, m, u */ 25426/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 25427/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45135); 25428/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(45588); 25429/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20913); 25430/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13527); 25431/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23790); 25432/* harmony import */ var _matchGroups_C2_rxOIO_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(54293); 25433/* harmony import */ var _SSRContext_DqqZUlqT_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2460); 25434/* harmony import */ var _ToJs_BnRRHk6f_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(32078); 25435 25436 25437 25438 25439 25440 25441 25442 25443 25444const mergeStaticRoutes = matchedStaticRoute => { 25445 let finalRoute = {}; 25446 for (const [i, route] of matchedStaticRoute.entries()) { 25447 const staticRouteCopy = { 25448 ...route.route 25449 }; 25450 if (i === matchedStaticRoute.length - 1) { 25451 finalRoute = { 25452 ...finalRoute, 25453 ...staticRouteCopy, 25454 fullPath: `${finalRoute.fullPath || ''}${route.route.path ? route.route.path : ''}` 25455 }; 25456 matchedStaticRoute[i].route = finalRoute; 25457 } else { 25458 delete staticRouteCopy.children; 25459 delete staticRouteCopy.index; 25460 delete staticRouteCopy.path; 25461 delete staticRouteCopy.component; 25462 delete staticRouteCopy.element; 25463 finalRoute = { 25464 ...finalRoute, 25465 ...staticRouteCopy, 25466 fullPath: `${finalRoute.fullPath || ''}${route.route.path ? route.route.path.endsWith('/') ? route.route.path : route.route.path + '/' : ''}` 25467 }; 25468 } 25469 } 25470}; 25471 25472const HttpContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({}); 25473const useHttpContext = () => { 25474 return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(HttpContext); 25475}; 25476 25477const Redirect = ({ 25478 code, 25479 to 25480}) => { 25481 const httpContext = useHttpContext(); 25482 if (httpContext) { 25483 httpContext.statusCode = code; 25484 httpContext.url = to; 25485 } 25486 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_3__/* .Navigate */ .C5, { 25487 to: to 25488 }); 25489}; 25490 25491const Status = ({ 25492 code, 25493 children 25494}) => { 25495 const httpContext = useHttpContext(); 25496 if (httpContext) { 25497 httpContext.statusCode = code; 25498 } 25499 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, children); 25500}; 25501 25502const NotFound = ({ 25503 statusCode, 25504 statusText 25505}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("header", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h1", null, statusCode || '404', " Page Not Found"), statusText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h2", { 25506 style: { 25507 background: '#eee', 25508 color: '#666', 25509 fontSize: '100%', 25510 padding: '10px' 25511 } 25512}, statusText))); 25513 25514const StaticRouteLoader = ({ 25515 staticRoutes 25516}) => { 25517 const staticRouteElement = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__/* .useRoutes */ .Ye)(staticRoutes); 25518 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, staticRouteElement); 25519}; 25520 25521const replaceDoubleSlashRecursive = path => {
25522 const nextPath = path.replace(/\/\//, '/'); 25523 if (nextPath.match(/\/\//)) { 25524 return replaceDoubleSlashRecursive(nextPath); 25525 } 25526 return nextPath; 25527}; 25528const getTrimmedPath = path => { 25529 if (path !== '/') { 25530 const cleanedPath = replaceDoubleSlashRecursive(path); 25531 const lastChar = cleanedPath[cleanedPath.length - 1]; 25532 if (lastChar === '/') { 25533 // Trim trailing slash from path to ensure urls are always unique 25534 return cleanedPath.substring(0, cleanedPath.length - 1); 25535 } else { 25536 // Return path with any double slashes removed 25537 return cleanedPath; 25538 } 25539 } 25540 return path; 25541}; 25542const processStaticRoutes = (staticRoutes, componentProps) => { 25543 const { 25544 projectId, 25545 contentTypeId, 25546 entry, 25547 mappedEntry, 25548 isLoggedIn 25549 } = componentProps; 25550 return staticRoutes.map(x => { 25551 const route = { 25552 ...x 25553 }; 25554 if (route.component) { 25555 route.element = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(route.component, { 25556 projectId: projectId, 25557 contentTypeId: contentTypeId ? contentTypeId : undefined, 25558 entry: entry, 25559 mappedEntry: mappedEntry, 25560 isLoggedIn: isLoggedIn 25561 }); 25562 delete route.component; 25563 } 25564 if (route.element) { 25565 route.element = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(route.element, { 25566 projectId, 25567 contentTypeId, 25568 entry, 25569 mappedEntry, 25570 isLoggedIn 25571 }); 25572 } 25573 if (route.children) { 25574 route.children = processStaticRoutes(route.children, componentProps); 25575 } 25576 return route; 25577 }); 25578}; 25579const RouteLoader$1 = ({ 25580 contentTypeId, 25581 entry, 25582 isError, 25583 isLoading, 25584 isLoggedIn, 25585 isNotFound, 25586 loadingComponent, 25587 mappedEntry, 25588 notFoundComponent, 25589 projectId, 25590 routes, 25591 setNavigationPath, 25592 statePath, 25593 statusCode, 25594 statusText, 25595 userGroups, 25596 withEvents, 25597 trailingSlashRedirectCode = 302 25598}) => { 25599 const location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__/* .useLocation */ .zy)(); 25600 25601 // In SSR pass references to things in backing sagas 25602 // we cannot access in a global scope 25603 const ssrContext = (0,_SSRContext_DqqZUlqT_js__WEBPACK_IMPORTED_MODULE_7__.a)(); 25604 25605 // Always ensure paths are trimmed of trailing slashes so urls are always unique 25606 const trimmedPath = getTrimmedPath(location.pathname); 25607 25608 // Convert any react-router-v5 style routes to react-router-v6 style routes. 25609 const staticRoutes = processStaticRoutes(routes.StaticRoutes, { 25610 projectId, 25611 contentTypeId, 25612 entry, 25613 mappedEntry, 25614 isLoggedIn 25615 }); 25616 25617 // Match any Static Routes a developer has defined 25618 const matchedStaticRoute = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__/* .matchRoutes */ .ue)(staticRoutes, location); 25619 const isStaticRoute = matchedStaticRoute && matchedStaticRoute.length > 0; 25620 25621 // Combine custom params for all static routes, with the furthest config taking precedence. 25622 if (isStaticRoute) { 25623 mergeStaticRoutes(matchedStaticRoute); 25624 } 25625 const staticRoute = isStaticRoute ? matchedStaticRoute.pop() || undefined : undefined; 25626 const routeRequiresLogin = staticRoute ? staticRoute.route.requireLogin : undefined; 25627 const setPath = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { 25628 // Use serverPath to control the path we send to siteview node api to resolve a route 25629 let serverPath = ''; 25630 if (staticRoute && staticRoute.pathname === staticRoute.pathnameBase) { 25631 var _route$path, _route$fetchNode; 25632 const { 25633 route, 25634 pathname, 25635 params 25636 } = staticRoute; 25637 if ((_route$path = route.path) !== null && _route$path !== void 0 && _route$path.includes('*')) { 25638 // Send the whole url to api if we have matched route containing wildcard 25639 serverPath = pathname; 25640 } else if (typeof route.fetchNodeLevel === 'number') {
25641 // Send all url parts to a specified level to api 25642 serverPath = pathname.split('/').splice(0, route.fetchNodeLevel + 1).join('/'); 25643 } else if (typeof route.fetchNode === 'object' && (_route$fetchNode = route.fetchNode) !== null && _route$fetchNode !== void 0 && _route$fetchNode.params) { 25644 const fetchNodeParams = route.fetchNode.params; 25645 const routeParams = params; 25646 const regexExp = new RegExp(Object.keys(routeParams).map(p => `:${p}`).join('|'), 'g'); 25647 serverPath = pathname.replace(/\?/g, '').replace(regexExp, matched => { 25648 const param = matched.replace(':', ''); 25649 if (fetchNodeParams.includes(param)) return routeParams[param] || '';else return ''; 25650 }).replace(/\/$/, ''); 25651 } else { 25652 var _route$fullPath; 25653 // Send all non-parameterised url parts to api 25654 serverPath = (_route$fullPath = route.fullPath) === null || _route$fullPath === void 0 ? void 0 : _route$fullPath.split('/').filter(p => !p.startsWith(':')).join('/'); 25655 } 25656 } 25657 const { 25658 clientPath, 25659 contentPath 25660 } = (0,_SSRContext_DqqZUlqT_js__WEBPACK_IMPORTED_MODULE_7__.t)(serverPath || trimmedPath, ssrContext.request); 25661 setNavigationPath(clientPath, contentPath, location, staticRoute, withEvents, statePath, routes, ssrContext); 25662 // eslint-disable-next-line react-hooks/exhaustive-deps 25663 }, [setNavigationPath, 25664 // staticRoute, 25665 withEvents, location, routes, 25666 // statePath, 25667 trimmedPath]); 25668 if (typeof window == 'undefined') setPath(); 25669 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 25670 setPath(); 25671 }, [location, setPath]); 25672 25673 // Need to redirect when url endswith a / 25674 if (location.pathname.length > trimmedPath.length) { 25675 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Redirect, { 25676 code: trailingSlashRedirectCode || 302, 25677 to: `${trimmedPath}${location.search}${location.hash}` 25678 }); 25679 } 25680 25681 // Render any Static Routes a developer has defined 25682 if (isStaticRoute && !(!isLoggedIn && routeRequiresLogin)) { 25683 if ((0,_matchGroups_C2_rxOIO_js__WEBPACK_IMPORTED_MODULE_6__.m)(userGroups, routeRequiresLogin)) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(StaticRouteLoader, { 25684 staticRoutes: staticRoutes 25685 }); 25686 } 25687 25688 // Render a supplied Loading component if the route 25689 // is not a static route and is in a loading state 25690 if (isLoading && !isNotFound && loadingComponent) { 25691 const LoadingComponent = loadingComponent; 25692 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(LoadingComponent, null); 25693 } 25694 25695 // Match any defined Content Type Mappings 25696 if (contentTypeId && !(!isLoggedIn && routeRequiresLogin)) { 25697 const MatchedComponent = routes.ContentTypeMappings.find(item => item.contentTypeID === contentTypeId); 25698 if (MatchedComponent && !(MatchedComponent.requireLogin && !isLoggedIn)) { 25699 if ((0,_matchGroups_C2_rxOIO_js__WEBPACK_IMPORTED_MODULE_6__.m)(userGroups, MatchedComponent.requireLogin)) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(MatchedComponent.component, { 25700 projectId: projectId, 25701 contentTypeId: contentTypeId, 25702 entry: entry, 25703 mappedEntry: mappedEntry, 25704 isLoggedIn: isLoggedIn 25705 }); 25706 } 25707 } 25708 const NotFoundComponent = notFoundComponent ? notFoundComponent : NotFound; 25709 if (isNotFound || isError) { 25710 // console.info( 25711 // `RouteLoader rendering NotFound component: statusCode ${statusCode}, isNotFound ${isNotFound}, isError ${isError}` 25712 // ); 25713 25714 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Status, { 25715 code: statusCode 25716 }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(NotFoundComponent, { 25717 statusCode: statusCode, 25718 statusText: statusText 25719 })); 25720 } 25721 return null; 25722}; 25723const mapStateToPropsMemoized = (0,reselect__WEBPACK_IMPORTED_MODULE_4__/* .createSelector */ .Mz)(_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.Q, _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.O, _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.Z, _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.M, _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__._, _matchGroups_C2_rxOIO_js__WEBPACK_IMPORTED_MODULE_6__.o, _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.N, _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.I, _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.H, _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.$, _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.Y, _matchGroups_C2_rxOIO_js__WEBPACK_IMPORTED_MODULE_6__.l, (contentTypeId, entry, isError, isNotFound, isLoading, isLoggedIn, mappedEntry, projectId, statePath, statusCode, statusText, userGroups) => ({ 25724 contentTypeId, 25725 entry, 25726 isError, 25727 isNotFound, 25728 isLoading, 25729 isLoggedIn, 25730 mappedEntry, 25731 projectId, 25732 statePath, 25733 statusCode, 25734 statusText, 25735 userGroups 25736})); 25737const mapDispatchToProps = { 25738 setNavigationPath: _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_5__.a5 25739}; 25740var RouteLoader = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .connect */ .Ng)(mapStateToPropsMemoized, mapDispatchToProps)((0,_ToJs_BnRRHk6f_js__WEBPACK_IMPORTED_MODULE_8__.t)(RouteLoader$1)); 25741 25742 25743//# sourceMappingURL=RouteLoader-CAVJs2rj.js.map 25744 25745 25746/***/ }, 25747 25748/***/ 2460 25749(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 25750 25751"use strict"; 25752/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25753/* harmony export */ S: () => (/* binding */ SSRContextProvider), 25754/* harmony export */ a: () => (/* binding */ useSSRContext), 25755/* harmony export */ g: () => (/* binding */ getSubsitePath), 25756/* harmony export */ t: () => (/* binding */ transformPathForSubsite), 25757/* harmony export */ u: () => (/* binding */ useDeliveryApi) 25758/* harmony export */ }); 25759/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 25760/* harmony import */ var react_cookie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94836); 25761/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(45135); 25762/* harmony import */ var _ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22255); 25763/* harmony import */ var _CookieHelper_class_C6rTRl_1_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26240); 25764 25765 25766 25767 25768 25769 25770const isSSR = typeof window === 'undefined'; 25771const ensureLeadingSlash = value => value.startsWith('/') ? value : `/${value}`; 25772const trimTrailingSlash = value => value.length > 1 && value.endsWith('/') ? value.slice(0, -1) : value; 25773const normalizeSubsitePath = path => { 25774 const trimmed = `${path || ''}`.trim(); 25775 if (!trimmed || trimmed === '/') return ''; 25776 return trimTrailingSlash(ensureLeadingSlash(trimmed)); 25777}; 25778const addSubsitePath = (path, subsitePath) => { 25779 if (!path || path === '/') return subsitePath; 25780 if (path.startsWith(subsitePath)) return path; 25781 return `${subsitePath}${path.startsWith('/') ? '' : '/'}${path}`;
25782}; 25783const trimSubsitePath = (path, subsitePath) => { 25784 if (!path.startsWith(subsitePath)) return path; 25785 const stripped = path.slice(subsitePath.length); 25786 return stripped ? stripped : '/'; 25787}; 25788 25789/** 25790 * Retrieves a subsite path from the request headers in SSR or the global window object in CSR. 25791 * @param request The SSR request. 25792 * @returns The normalized subsite path. 25793 */ 25794const getSubsitePath = request => { 25795 var _request$headers; 25796 return isSSR ? normalizeSubsitePath(request === null || request === void 0 || (_request$headers = request.headers) === null || _request$headers === void 0 ? void 0 : _request$headers['subsite_path']) : window.subsitePath; 25797}; 25798const transformPathForSubsite = (path, request) => { 25799 const subsitePath = getSubsitePath(request); 25800 if (!subsitePath) return { 25801 clientPath: path, 25802 contentPath: path 25803 }; 25804 return { 25805 clientPath: isSSR ? trimSubsitePath(path, subsitePath) : path, 25806 contentPath: isSSR ? path : addSubsitePath(path, subsitePath), 25807 subsitePath 25808 }; 25809}; 25810 25811const SSRContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); 25812 25813/** 25814 * SSRContextProvider allows us to hold and access request-scoped references 25815 * throughout the component tree 25816 * 25817 * adding this in client side allows consumers to write universal code and use 25818 * the same helpers and request-scoped refs for api, cookies and redux dispatcher 25819 * as in SSR */ 25820const SSRContextProvider = ({ 25821 accessMethod, 25822 children, 25823 request, 25824 response 25825}) => { 25826 // In SSR pass references to things in backing sagas 25827 // we cannot access in a global scope 25828 const dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__/* .useDispatch */ .wA)(); 25829 const cookies = new _CookieHelper_class_C6rTRl_1_js__WEBPACK_IMPORTED_MODULE_4__.C(...(0,react_cookie__WEBPACK_IMPORTED_MODULE_1__/* .useCookies */ .lT)()); 25830 const api = (0,_ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_3__.a)({ 25831 cookies, 25832 dispatch, 25833 request, 25834 response 25835 }); 25836 const subsitePath = getSubsitePath(request); 25837 const [context] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({ 25838 accessMethod, 25839 api, 25840 cookies, 25841 dispatch, 25842 request, 25843 response, 25844 subsitePath 25845 }); 25846 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(SSRContext.Provider, { 25847 value: { 25848 ...context 25849 } 25850 }, children); 25851}; 25852 25853/** 25854 * Server side usage provides access to request-scoped references throughout the component tree 25855 * 25856 * Client side usage allows consumers to write universal code, using the same 25857 * helpers and request-scoped refs for api, cookies and redux dispatcher as in SSR 25858 * @returns SSRContextType 25859 */ 25860const useSSRContext = () => (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(SSRContext); 25861const useDeliveryApi = () => { 25862 const { 25863 api 25864 } = useSSRContext(); 25865 return api; 25866}; 25867 25868 25869//# sourceMappingURL=SSRContext-DqqZUlqT.js.map 25870 25871 25872/***/ }, 25873 25874/***/ 32078 25875(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 25876 25877"use strict"; 25878/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25879/* harmony export */ t: () => (/* binding */ toJS) 25880/* harmony export */ }); 25881/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 25882 25883 25884/* eslint-disable react/display-name */ 25885const toJS = WrappedComponent => wrappedComponentProps => { 25886 const KEY = 0; 25887 const VALUE = 1; 25888 const propsJS = Object.entries(wrappedComponentProps).reduce((newProps, wrappedComponentProp) => { 25889 const propKey = wrappedComponentProp[KEY]; 25890 const propValue = wrappedComponentProp[VALUE]; 25891 newProps[propKey] = propValue && typeof propValue === 'object' && 'toJS' in propValue ? propValue.toJS() : propValue; 25892 return newProps; 25893 }, {}); 25894 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(WrappedComponent, propsJS); 25895}; 25896 25897 25898//# sourceMappingURL=ToJs-BnRRHk6f.js.map 25899 25900 25901/***/ }, 25902 25903/***/ 23367 25904(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 25905 25906"use strict"; 25907/* harmony export */ __webpack_require__.d(__webpack_exports__, { 25908/* harmony export */ V: () => (/* binding */ VersionInfo), 25909/* harmony export */ s: () => (/* binding */ stringifyStrings) 25910/* harmony export */ }); 25911/* harmony import */ var _commonjsHelpers_BFTU3MAI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90912); 25912/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96540); 25913/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(45135); 25914/* harmony import */ var jsonpath_mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(47149); 25915/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23790); 25916/* harmony import */ var _version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81452); 25917/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(27149); 25918 25919 25920 25921 25922 25923 25924 25925 25926var stringifyStrings_1; 25927var hasRequiredStringifyStrings; 25928 25929function requireStringifyStrings () { 25930 if (hasRequiredStringifyStrings) return stringifyStrings_1; 25931 hasRequiredStringifyStrings = 1; 25932 const stringifyStrings = obj => { 25933 const returnObj = Array.isArray(obj) ? [] : {};
25934 Object.entries(obj).forEach(([key, value]) => { 25935 switch (typeof value) { 25936 case 'string': 25937 returnObj[key] = JSON.stringify(value); 25938 break; 25939 case 'object': 25940 returnObj[key] = stringifyStrings(value); 25941 break; 25942 default: 25943 returnObj[key] = value; 25944 break; 25945 } 25946 }); 25947 return returnObj; 25948 }; 25949 stringifyStrings_1 = stringifyStrings; 25950 return stringifyStrings_1; 25951} 25952 25953var stringifyStringsExports = requireStringifyStrings(); 25954var stringifyStrings = /*@__PURE__*/(0,_commonjsHelpers_BFTU3MAI_js__WEBPACK_IMPORTED_MODULE_0__.g)(stringifyStringsExports); 25955 25956const context = typeof window != 'undefined' ? window : __webpack_require__.g; 25957const isDev = "production" === 'development'; 25958const pj = () => isDev ? PACKAGE_JSON /* global PACKAGE_JSON */ : context.PACKAGE_JSON || { 25959 name: 'packagejson not found', 25960 repository: '' 25961}; 25962const versionInfoProps = { 25963 packageDetail: () => { 25964 const pkg = pj(); 25965 return { 25966 name: pkg.name, 25967 version: pkg.version, 25968 repository: pkg.repository 25969 }; 25970 }, 25971 uris: { 25972 gitRepo: () => pj().repository, 25973 commit: state => { 25974 const commitRef = (0,_version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_5__.a)(state); 25975 return `${pj().repository}/commit/${commitRef ? commitRef : ''}`; 25976 }, 25977 pipeline: state => { 25978 const buildNumber = (0,_version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_5__.s)(state); 25979 return `${pj().repository}/${pj().repository.includes('github.com') ? 'actions/runs' : 'pipelines'}/${buildNumber ? buildNumber : ''}`; 25980 } 25981 }, 25982 zenPackageVersions: () => [...(Object.entries(pj().devDependencies || {}).filter(([pkg]) => pkg.includes('zengenti') || pkg.includes('contensis')) || []), ...(Object.entries(pj().dependencies || {}).filter(([pkg]) => pkg.includes('zengenti') || pkg.includes('contensis')) || [])], 25983 deliveryApi: () => JSON.parse(JSON.stringify(DELIVERY_API_CONFIG /* global DELIVERY_API_CONFIG */)), 25984 devEnv: () => typeof DEV_ENV !== 'undefined' /* global DEV_ENV */ ? DEV_ENV : null, 25985 disableSsrRedux: () => isDev ? false /* global DISABLE_SSR_REDUX*/ : context.DISABLE_SSR_REDUX || false, 25986 nodeEnv: () => "production" || 0, 25987 packagejson: () => pj() || {}, 25988 projects: () => isDev ? PROJECTS /* global PROJECTS */ : context.PROJECTS, 25989 proxyDeliveryApi: () => isDev ? true /* global PROXY_DELIVERY_API */ : context.PROXY_DELIVERY_API || false, 25990 publicUri: () => isDev ? PUBLIC_URI /* global PUBLIC_URI */ : context.PUBLIC_URI || null, 25991 project: state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_4__.I)(state), 25992 reverseProxyPaths: () => isDev ? ["/image-library/**","/video-library/**","/asset-library/**"] /* global REVERSE_PROXY_PATHS */ : context.REVERSE_PROXY_PATHS || {}, 25993 servers: () => isDev ? SERVERS /* global SERVERS */ : context.SERVERS, 25994 version: { 25995 buildNumber: state => (0,_version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_5__.s)(state), 25996 commitRef: state => (0,_version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_5__.a)(state), 25997 contensisVersionStatus: state => (0,_version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_5__.b)(state) 25998 } 25999}; 26000const mapStateToVersionInfo = state => { 26001 const mappedProps = (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Ay)(state, versionInfoProps); 26002 return mappedProps; 26003}; 26004 26005const VersionInfoStyledTable = styled_components__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.table.withConfig({ 26006 displayName: "VersionInfostyled__VersionInfoStyledTable", 26007 componentId: "sc-ogujr7-0" 26008})(["font-family:'Source Sans Pro',Helvetica,Arial,sans-serif;font-size:1.6rem;line-height:1.5rem;border-bottom:4px solid #8892bf;border-collapse:separate;margin:0 auto;width:80%;th{text-align:left;background-color:#c4c9df;border-bottom:#8892bf 2px solid;border-bottom-color:#8892bf;border-top:20px solid #fff;}td{border-bottom:1px solid #eee;}td,th{padding:0.5rem 0.75rem;vertical-align:top;}.left{width:25%;}tr th{border-right:hidden;border-spacing:0 15px;}.green{background-color:#9c9;border-bottom:1px solid #696;}.red{background-color:#c99;border-bottom:1px solid #966;}.small{font-size:100%;line-height:2.4rem;}"]); 26009 26010const VersionInfo$1 = ({ 26011 deliveryApi, 26012 devEnv, 26013 disableSsrRedux, 26014 nodeEnv, 26015 packageDetail, 26016 project, 26017 projects, 26018 proxyDeliveryApi, 26019 publicUri, 26020 reverseProxyPaths, 26021 servers, 26022 uris, 26023 version, 26024 zenPackageVersions 26025}) => { 26026 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(VersionInfoStyledTable, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("thead", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { 26027 colSpan: 2 26028 }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("h1", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("a", { 26029 href: "/" 26030 }, "Version Information"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tbody", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("th", { 26031 colSpan: 2 26032 }, "Package detail")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { 26033 className: "left" 26034 }, "Name"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, packageDetail.name)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { 26035 className: "left" 26036 }, "Version"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, packageDetail.version)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("th", { 26037 colSpan: 2 26038 }, "Version info (state)")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Git repo url: "), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("a", { 26039 href: packageDetail.repository, 26040 target: "_blank", 26041 rel: "noopener noreferrer" 26042 }
26042, packageDetail.repository))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Pipeline: "), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("a", { 26043 href: uris.pipeline, 26044 target: "_blank", 26045 rel: "noopener noreferrer" 26046 }, version.buildNumber))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Commit: "), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("a", { 26047 href: uris.commit, 26048 target: "_blank", 26049 rel: "noopener noreferrer" 26050 }, version.commitRef))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Project"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { 26051 className: project === 'unknown' ? 'red' : '' 26052 }, project)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Contensis version status: "), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { 26053 className: version.contensisVersionStatus === 'published' ? 'green' : 'red' 26054 }, version.contensisVersionStatus)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("th", { 26055 colSpan: 2 26056 }, "Build configuration")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Environment"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, servers.alias)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Public uri"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, publicUri)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Zengenti packages"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, zenPackageVersions.map(([pkg, ver], idx) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { 26057 key: idx 26058 }, pkg, ": ", ver)))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Servers"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { 26059 className: "small" 26060 }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, "web: ", servers.web), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, "preview: ", servers.previewWeb), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, "api: ", servers.api), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, "cms: ", servers.cms), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, "iis: ", servers.iis), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, "iis preview: ", servers.previewIis))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Reverse proxy paths"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, Object.entries(reverseProxyPaths).map(([, path], key) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { 26061 key: key 26062 }, "[ ", path, " ] ")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Projects"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, Object.entries(projects).map(([, project], key) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { 26063 key: key 26064 }, "[ ", project.id, ": ", project.publicUri, " ]")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Delivery API"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { 26065 className: "small" 26066 }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("ul", { 26067 style: { 26068 margin: 0, 26069 padding: 0 26070 } 26071 }, Object.entries(deliveryApi).map(([key, value], idx) => { 26072 if (typeof value === 'object') return null; 26073 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("li", { 26074 key: idx, 26075 style: { 26076 listStyleType: 'none' 26077 } 26078 }, key, ": ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", null, value)); 26079 })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Proxy Delivery API requests"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { 26080 className: proxyDeliveryApi ? 'green' : 'red' 26081 }, proxyDeliveryApi.toString())), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "Disable SSR inline-redux"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, disableSsrRedux.toString())), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "NODE_ENV"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { 26082 className: nodeEnv === 'production' ? 'green' : 'red' 26083 }, nodeEnv.toString())), devEnv && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, "process.env"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", null, Object.entries(devEnv).map(([k, v], key) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { 26084 key: key 26085 }, "[ ", k, ": ", v, " ]")))))); 26086}; 26087var VersionInfo = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__/* .connect */ .Ng)(mapStateToVersionInfo)(VersionInfo$1); 26088 26089 26090//# sourceMappingURL=VersionInfo-BinQYaU1.js.map 26091 26092 26093/***/ }, 26094 26095/***/ 90912 26096(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 26097 26098"use strict"; 26099/* harmony export */ __webpack_require__.d(__webpack_exports__, { 26100/* harmony export */ c: () => (/* binding */ commonjsGlobal), 26101/* harmony export */ g: () => (/* binding */ getDefaultExportFromCjs) 26102/* harmony export */ }); 26103var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {}; 26104 26105function getDefaultExportFromCjs (x) { 26106 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; 26107} 26108 26109 26110//# sourceMappingURL=_commonjsHelpers-BFTU3MAI.js.map 26111 26112 26113/***/ }, 26114 26115/***/ 56520 26116(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 26117 26118"use strict"; 26119 26120// EXPORTS 26121__webpack_require__.d(__webpack_exports__, { 26122 A: () => (/* binding */ ClientApp) 26123}); 26124 26125// UNUSED EXPORTS: ReactApp 26126 26127// EXTERNAL MODULE: ./node_modules/isomorphic-fetch/fetch-npm-browserify.js 26128var fetch_npm_browserify = __webpack_require__(60328); 26129// EXTERNAL MODULE: ./node_modules/react/index.js 26130var react = __webpack_require__(96540); 26131// EXTERNAL MODULE: ./node_modules/react-dom/client.js 26132var client = __webpack_require__(5338); 26133// EXTERNAL MODULE: ./node_modules/react-redux/dist/react-redux.mjs 26134var react_redux = __webpack_require__(45135); 26135// EXTERNAL MODULE: ./node_modules/react-router-dom/dist/index.js 26136var dist = __webpack_require__(84976);
vendor: 10,816 bytes, lines 26137-26512
26137// EXTERNAL MODULE: ./node_modules/@loadable/component/dist/esm/loadable.esm.mjs 26138var loadable_esm = __webpack_require__(75326); 26139// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/node_modules/query-string/index.js 26140var query_string = __webpack_require__(17276); 26141// EXTERNAL MODULE: ./node_modules/react-cookie/esm/index.mjs + 1 modules 26142var esm = __webpack_require__(94836); 26143// EXTERNAL MODULE: ./node_modules/react-helmet-async/lib/index.esm.js 26144var index_esm = __webpack_require__(85902); 26145// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 26146var esm_extends = __webpack_require__(55285); 26147;// ./node_modules/@zengenti/contensis-react-base/node_modules/history/index.js 26148/* unused harmony import specifier */ var _extends; 26149 26150 26151/** 26152 * Actions represent the type of change to a location value. 26153 * 26154 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#action 26155 */ 26156var Action; 26157 26158(function (Action) { 26159 /** 26160 * A POP indicates a change to an arbitrary index in the history stack, such 26161 * as a back or forward navigation. It does not describe the direction of the 26162 * navigation, only that the current index changed. 26163 * 26164 * Note: This is the default action for newly created history objects. 26165 */ 26166 Action["Pop"] = "POP"; 26167 /** 26168 * A PUSH indicates a new entry being added to the history stack, such as when 26169 * a link is clicked and a new page loads. When this happens, all subsequent 26170 * entries in the stack are lost. 26171 */ 26172 26173 Action["Push"] = "PUSH"; 26174 /** 26175 * A REPLACE indicates the entry at the current index in the history stack 26176 * being replaced by a new one. 26177 */ 26178 26179 Action["Replace"] = "REPLACE"; 26180})(Action || (Action = {})); 26181 26182var readOnly = false ? 0 : function (obj) { 26183 return obj; 26184}; 26185 26186function warning(cond, message) { 26187 if (!cond) { 26188 // eslint-disable-next-line no-console 26189 if (typeof console !== 'undefined') console.warn(message); 26190 26191 try { 26192 // Welcome to debugging history! 26193 // 26194 // This error is thrown as a convenience so you can more easily 26195 // find the source for a warning that appears in the console by 26196 // enabling "pause on exceptions" in your JavaScript debugger. 26197 throw new Error(message); // eslint-disable-next-line no-empty 26198 } catch (e) {} 26199 } 26200} 26201 26202var BeforeUnloadEventType = 'beforeunload'; 26203var HashChangeEventType = 'hashchange'; 26204var PopStateEventType = 'popstate'; 26205/** 26206 * Browser history stores the location in regular URLs. This is the standard for 26207 * most web apps, but it requires some configuration on the server to ensure you 26208 * serve the same app at multiple URLs. 26209 * 26210 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory 26211 */ 26212 26213function createBrowserHistory(options) { 26214 if (options === void 0) { 26215 options = {}; 26216 } 26217 26218 var _options = options, 26219 _options$window = _options.window, 26220 window = _options$window === void 0 ? document.defaultView : _options$window; 26221 var globalHistory = window.history; 26222 26223 function getIndexAndLocation() { 26224 var _window$location = window.location, 26225 pathname = _window$location.pathname, 26226 search = _window$location.search, 26227 hash = _window$location.hash; 26228 var state = globalHistory.state || {}; 26229 return [state.idx, readOnly({ 26230 pathname: pathname, 26231 search: search, 26232 hash: hash, 26233 state: state.usr || null, 26234 key: state.key || 'default' 26235 })]; 26236 } 26237 26238 var blockedPopTx = null; 26239 26240 function handlePop() { 26241 if (blockedPopTx) { 26242 blockers.call(blockedPopTx); 26243 blockedPopTx = null; 26244 } else { 26245 var nextAction = Action.Pop; 26246 26247 var _getIndexAndLocation = getIndexAndLocation(), 26248 nextIndex = _getIndexAndLocation[0], 26249 nextLocation = _getIndexAndLocation[1]; 26250 26251 if (blockers.length) { 26252 if (nextIndex != null) { 26253 var delta = index - nextIndex; 26254 26255 if (delta) { 26256 // Revert the POP 26257 blockedPopTx = { 26258 action: nextAction, 26259 location: nextLocation, 26260 retry: function retry() { 26261 go(delta * -1); 26262 } 26263 }; 26264 go(delta); 26265 } 26266 } else { 26267 // Trying to POP to a location with no index. We did not create 26268 // this location, so we can't effectively block the navigation. 26269 false ? 0 : void 0; 26270 } 26271 } else { 26272 applyTx(nextAction); 26273 } 26274 } 26275 } 26276 26277 window.addEventListener(PopStateEventType, handlePop); 26278 var action = Action.Pop; 26279 26280 var _getIndexAndLocation2 = getIndexAndLocation(), 26281 index = _getIndexAndLocation2[0], 26282 location = _getIndexAndLocation2[1]; 26283 26284 var listeners = createEvents(); 26285 var blockers = createEvents(); 26286 26287 if (index == null) { 26288 index = 0; 26289 globalHistory.replaceState((0,esm_extends/* default */.A)({}, globalHistory.state, { 26290 idx: index 26291 }), ''); 26292 } 26293 26294 function createHref(to) { 26295 return typeof to === 'string' ? to : createPath(to); 26296 } // state defaults to `null` because `window.history.state` does 26297 26298 26299 function getNextLocation(to, state) { 26300 if (state === void 0) { 26301 state = null; 26302 } 26303 26304 return readOnly((0,esm_extends/* default */.A)({ 26305 pathname: location.pathname, 26306 hash: '', 26307 search: '' 26308 }, typeof to === 'string' ? parsePath(to) : to, { 26309 state: state, 26310 key: createKey() 26311 })); 26312 } 26313 26314 function getHistoryStateAndUrl(nextLocation, index) { 26315 return [{ 26316 usr: nextLocation.state, 26317 key: nextLocation.key, 26318 idx: index 26319 }, createHref(nextLocation)]; 26320 } 26321 26322 function allowTx(action, location, retry) { 26323 return !blockers.length || (blockers.call({ 26324 action: action, 26325 location: location, 26326 retry: retry 26327 }), false); 26328 } 26329 26330 function applyTx(nextAction) { 26331 action = nextAction; 26332 26333 var _getIndexAndLocation3 = getIndexAndLocation(); 26334 26335 index = _getIndexAndLocation3[0]; 26336 location = _getIndexAndLocation3[1]; 26337 listeners.call({ 26338 action: action, 26339 location: location 26340 }); 26341 } 26342 26343 function push(to, state) { 26344 var nextAction = Action.Push; 26345 var nextLocation = getNextLocation(to, state); 26346 26347 function retry() { 26348 push(to, state); 26349 } 26350 26351 if (allowTx(nextAction, nextLocation, retry)) { 26352 var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1), 26353 historyState = _getHistoryStateAndUr[0], 26354 url = _getHistoryStateAndUr[1]; // TODO: Support forced reloading 26355 // try...catch because iOS limits us to 100 pushState calls :/ 26356 26357 26358 try { 26359 globalHistory.pushState(historyState, '', url); 26360 } catch (error) { 26361 // They are going to lose state here, but there is no real 26362 // way to warn them about it since the page will refresh... 26363 window.location.assign(url); 26364 } 26365 26366 applyTx(nextAction); 26367 } 26368 } 26369 26370 function replace(to, state) { 26371 var nextAction = Action.Replace; 26372 var nextLocation = getNextLocation(to, state); 26373 26374 function retry() { 26375 replace(to, state); 26376 } 26377 26378 if (allowTx(nextAction, nextLocation, retry)) { 26379 var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index), 26380 historyState = _getHistoryStateAndUr2[0], 26381 url = _getHistoryStateAndUr2[1]; // TODO: Support forced reloading 26382 26383 26384 globalHistory.replaceState(historyState, '', url); 26385 applyTx(nextAction); 26386 } 26387 } 26388 26389 function go(delta) { 26390 globalHistory.go(delta); 26391 } 26392 26393 var history = { 26394 get action() { 26395 return action; 26396 }, 26397 26398 get location() { 26399 return location; 26400 }, 26401 26402 createHref: createHref, 26403 push: push, 26404 replace: replace, 26405 go: go, 26406 back: function back() { 26407 go(-1); 26408 }, 26409 forward: function forward() { 26410 go(1); 26411 }, 26412 listen: function listen(listener) { 26413 return listeners.push(listener); 26414 }, 26415 block: function block(blocker) { 26416 var unblock = blockers.push(blocker); 26417 26418 if (blockers.length === 1) { 26419 window.addEventListener(BeforeUnloadEventType, promptBeforeUnload); 26420 } 26421 26422 return function () { 26423 unblock(); // Remove the beforeunload listener so the document may 26424 // still be salvageable in the pagehide event. 26425 // See https://html.spec.whatwg.org/#unloading-documents 26426 26427 if (!blockers.length) { 26428 window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload); 26429 } 26430 }; 26431 } 26432 }; 26433 return history; 26434} 26435/** 26436 * Hash history stores the location in window.location.hash. This makes it ideal 26437 * for situations where you don't want to send the location to the server for 26438 * some reason, either because you do cannot configure it or the URL space is 26439 * reserved for something else. 26440 * 26441 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory 26442 */ 26443 26444function createHashHistory(options) { 26445 if (options === void 0) { 26446 options = {}; 26447 } 26448 26449 var _options2 = options, 26450 _options2$window = _options2.window, 26451 window = _options2$window === void 0 ? document.defaultView : _options2$window; 26452 var globalHistory = window.history; 26453 26454 function getIndexAndLocation() { 26455 var _parsePath = parsePath(window.location.hash.substr(1)), 26456 _parsePath$pathname = _parsePath.pathname, 26457 pathname = _parsePath$pathname === void 0 ? '/' : _parsePath$pathname, 26458 _parsePath$search = _parsePath.search, 26459 search = _parsePath$search === void 0 ? '' : _parsePath$search, 26460 _parsePath$hash = _parsePath.hash, 26461 hash = _parsePath$hash === void 0 ? '' : _parsePath$hash; 26462 26463 var state = globalHistory.state || {}; 26464 return [state.idx, readOnly({ 26465 pathname: pathname, 26466 search: search, 26467 hash: hash, 26468 state: state.usr || null, 26469 key: state.key || 'default' 26470 })]; 26471 } 26472 26473 var blockedPopTx = null; 26474 26475 function handlePop() { 26476 if (blockedPopTx) { 26477 blockers.call(blockedPopTx); 26478 blockedPopTx = null; 26479 } else { 26480 var nextAction = Action.Pop; 26481 26482 var _getIndexAndLocation4 = getIndexAndLocation(), 26483 nextIndex = _getIndexAndLocation4[0], 26484 nextLocation = _getIndexAndLocation4[1]; 26485 26486 if (blockers.length) { 26487 if (nextIndex != null) { 26488 var delta = index - nextIndex; 26489 26490 if (delta) { 26491 // Revert the POP 26492 blockedPopTx = { 26493 action: nextAction, 26494 location: nextLocation, 26495 retry: function retry() { 26496 go(delta * -1); 26497 } 26498 }; 26499 go(delta); 26500 } 26501 } else { 26502 // Trying to POP to a location with no index. We did not create 26503 // this location, so we can't effectively block the navigation. 26504 false ? 0 : void 0; 26505 } 26506 } else { 26507 applyTx(nextAction); 26508 } 26509 } 26510 } 26511 26512 window.addEventListener(PopStateEventType, handlePop);
vendor: 4,706 bytes, lines 26512-26698
26512 // popstate does not fire on hashchange in IE 11 and old (trident) Edge 26513 // https://developer.mozilla.org/de/docs/Web/API/Window/popstate_event 26514 26515 window.addEventListener(HashChangeEventType, function () { 26516 var _getIndexAndLocation5 = getIndexAndLocation(), 26517 nextLocation = _getIndexAndLocation5[1]; // Ignore extraneous hashchange events. 26518 26519 26520 if (createPath(nextLocation) !== createPath(location)) { 26521 handlePop(); 26522 } 26523 }); 26524 var action = Action.Pop; 26525 26526 var _getIndexAndLocation6 = getIndexAndLocation(), 26527 index = _getIndexAndLocation6[0], 26528 location = _getIndexAndLocation6[1]; 26529 26530 var listeners = createEvents(); 26531 var blockers = createEvents(); 26532 26533 if (index == null) { 26534 index = 0; 26535 globalHistory.replaceState(_extends({}, globalHistory.state, { 26536 idx: index 26537 }), ''); 26538 } 26539 26540 function getBaseHref() { 26541 var base = document.querySelector('base'); 26542 var href = ''; 26543 26544 if (base && base.getAttribute('href')) { 26545 var url = window.location.href; 26546 var hashIndex = url.indexOf('#'); 26547 href = hashIndex === -1 ? url : url.slice(0, hashIndex); 26548 } 26549 26550 return href; 26551 } 26552 26553 function createHref(to) { 26554 return getBaseHref() + '#' + (typeof to === 'string' ? to : createPath(to)); 26555 } 26556 26557 function getNextLocation(to, state) { 26558 if (state === void 0) { 26559 state = null; 26560 } 26561 26562 return readOnly(_extends({ 26563 pathname: location.pathname, 26564 hash: '', 26565 search: '' 26566 }, typeof to === 'string' ? parsePath(to) : to, { 26567 state: state, 26568 key: createKey() 26569 })); 26570 } 26571 26572 function getHistoryStateAndUrl(nextLocation, index) { 26573 return [{ 26574 usr: nextLocation.state, 26575 key: nextLocation.key, 26576 idx: index 26577 }, createHref(nextLocation)]; 26578 } 26579 26580 function allowTx(action, location, retry) { 26581 return !blockers.length || (blockers.call({ 26582 action: action, 26583 location: location, 26584 retry: retry 26585 }), false); 26586 } 26587 26588 function applyTx(nextAction) { 26589 action = nextAction; 26590 26591 var _getIndexAndLocation7 = getIndexAndLocation(); 26592 26593 index = _getIndexAndLocation7[0]; 26594 location = _getIndexAndLocation7[1]; 26595 listeners.call({ 26596 action: action, 26597 location: location 26598 }); 26599 } 26600 26601 function push(to, state) { 26602 var nextAction = Action.Push; 26603 var nextLocation = getNextLocation(to, state); 26604 26605 function retry() { 26606 push(to, state); 26607 } 26608 26609 false ? 0 : void 0; 26610 26611 if (allowTx(nextAction, nextLocation, retry)) { 26612 var _getHistoryStateAndUr3 = getHistoryStateAndUrl(nextLocation, index + 1), 26613 historyState = _getHistoryStateAndUr3[0], 26614 url = _getHistoryStateAndUr3[1]; // TODO: Support forced reloading 26615 // try...catch because iOS limits us to 100 pushState calls :/ 26616 26617 26618 try { 26619 globalHistory.pushState(historyState, '', url); 26620 } catch (error) { 26621 // They are going to lose state here, but there is no real 26622 // way to warn them about it since the page will refresh... 26623 window.location.assign(url); 26624 } 26625 26626 applyTx(nextAction); 26627 } 26628 } 26629 26630 function replace(to, state) { 26631 var nextAction = Action.Replace; 26632 var nextLocation = getNextLocation(to, state); 26633 26634 function retry() { 26635 replace(to, state); 26636 } 26637 26638 false ? 0 : void 0; 26639 26640 if (allowTx(nextAction, nextLocation, retry)) { 26641 var _getHistoryStateAndUr4 = getHistoryStateAndUrl(nextLocation, index), 26642 historyState = _getHistoryStateAndUr4[0], 26643 url = _getHistoryStateAndUr4[1]; // TODO: Support forced reloading 26644 26645 26646 globalHistory.replaceState(historyState, '', url); 26647 applyTx(nextAction); 26648 } 26649 } 26650 26651 function go(delta) { 26652 globalHistory.go(delta); 26653 } 26654 26655 var history = { 26656 get action() { 26657 return action; 26658 }, 26659 26660 get location() { 26661 return location; 26662 }, 26663 26664 createHref: createHref, 26665 push: push, 26666 replace: replace, 26667 go: go, 26668 back: function back() { 26669 go(-1); 26670 }, 26671 forward: function forward() { 26672 go(1); 26673 }, 26674 listen: function listen(listener) { 26675 return listeners.push(listener); 26676 }, 26677 block: function block(blocker) { 26678 var unblock = blockers.push(blocker); 26679 26680 if (blockers.length === 1) { 26681 window.addEventListener(BeforeUnloadEventType, promptBeforeUnload); 26682 } 26683 26684 return function () { 26685 unblock(); // Remove the beforeunload listener so the document may 26686 // still be salvageable in the pagehide event. 26687 // See https://html.spec.whatwg.org/#unloading-documents 26688 26689 if (!blockers.length) { 26690 window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload); 26691 } 26692 }; 26693 } 26694 }; 26695 return history; 26696} 26697/** 26698 * Memory history stores the current location in memory. It is designed for use
vendor: 3,509 bytes, lines 26699-26846
26699 * in stateful non-browser environments like tests and React Native. 26700 * 26701 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#creatememoryhistory 26702 */ 26703 26704function createMemoryHistory(options) { 26705 if (options === void 0) { 26706 options = {}; 26707 } 26708 26709 var _options3 = options, 26710 _options3$initialEntr = _options3.initialEntries, 26711 initialEntries = _options3$initialEntr === void 0 ? ['/'] : _options3$initialEntr, 26712 initialIndex = _options3.initialIndex; 26713 var entries = initialEntries.map(function (entry) { 26714 var location = readOnly((0,esm_extends/* default */.A)({ 26715 pathname: '/', 26716 search: '', 26717 hash: '', 26718 state: null, 26719 key: createKey() 26720 }, typeof entry === 'string' ? parsePath(entry) : entry)); 26721 false ? 0 : void 0; 26722 return location; 26723 }); 26724 var index = clamp(initialIndex == null ? entries.length - 1 : initialIndex, 0, entries.length - 1); 26725 var action = Action.Pop; 26726 var location = entries[index]; 26727 var listeners = createEvents(); 26728 var blockers = createEvents(); 26729 26730 function createHref(to) { 26731 return typeof to === 'string' ? to : createPath(to); 26732 } 26733 26734 function getNextLocation(to, state) { 26735 if (state === void 0) { 26736 state = null; 26737 } 26738 26739 return readOnly((0,esm_extends/* default */.A)({ 26740 pathname: location.pathname, 26741 search: '', 26742 hash: '' 26743 }, typeof to === 'string' ? parsePath(to) : to, { 26744 state: state, 26745 key: createKey() 26746 })); 26747 } 26748 26749 function allowTx(action, location, retry) { 26750 return !blockers.length || (blockers.call({ 26751 action: action, 26752 location: location, 26753 retry: retry 26754 }), false); 26755 } 26756 26757 function applyTx(nextAction, nextLocation) { 26758 action = nextAction; 26759 location = nextLocation; 26760 listeners.call({ 26761 action: action, 26762 location: location 26763 }); 26764 } 26765 26766 function push(to, state) { 26767 var nextAction = Action.Push; 26768 var nextLocation = getNextLocation(to, state); 26769 26770 function retry() { 26771 push(to, state); 26772 } 26773 26774 false ? 0 : void 0; 26775 26776 if (allowTx(nextAction, nextLocation, retry)) { 26777 index += 1; 26778 entries.splice(index, entries.length, nextLocation); 26779 applyTx(nextAction, nextLocation); 26780 } 26781 } 26782 26783 function replace(to, state) { 26784 var nextAction = Action.Replace; 26785 var nextLocation = getNextLocation(to, state); 26786 26787 function retry() { 26788 replace(to, state); 26789 } 26790 26791 false ? 0 : void 0; 26792 26793 if (allowTx(nextAction, nextLocation, retry)) { 26794 entries[index] = nextLocation; 26795 applyTx(nextAction, nextLocation); 26796 } 26797 } 26798 26799 function go(delta) { 26800 var nextIndex = clamp(index + delta, 0, entries.length - 1); 26801 var nextAction = Action.Pop; 26802 var nextLocation = entries[nextIndex]; 26803 26804 function retry() { 26805 go(delta); 26806 } 26807 26808 if (allowTx(nextAction, nextLocation, retry)) { 26809 index = nextIndex; 26810 applyTx(nextAction, nextLocation); 26811 } 26812 } 26813 26814 var history = { 26815 get index() { 26816 return index; 26817 }, 26818 26819 get action() { 26820 return action; 26821 }, 26822 26823 get location() { 26824 return location; 26825 }, 26826 26827 createHref: createHref, 26828 push: push, 26829 replace: replace, 26830 go: go, 26831 back: function back() { 26832 go(-1); 26833 }, 26834 forward: function forward() { 26835 go(1); 26836 }, 26837 listen: function listen(listener) { 26838 return listeners.push(listener); 26839 }, 26840 block: function block(blocker) { 26841 return blockers.push(blocker); 26842 } 26843 }; 26844 return history; 26845} //////////////////////////////////////////////////////////////////////////////// 26846// UTILS
26847//////////////////////////////////////////////////////////////////////////////// 26848 26849function clamp(n, lowerBound, upperBound) { 26850 return Math.min(Math.max(n, lowerBound), upperBound); 26851} 26852 26853function promptBeforeUnload(event) { 26854 // Cancel the event. 26855 event.preventDefault(); // Chrome (and legacy IE) requires returnValue to be set. 26856 26857 event.returnValue = ''; 26858} 26859 26860function createEvents() { 26861 var handlers = []; 26862 return { 26863 get length() { 26864 return handlers.length; 26865 }, 26866 26867 push: function push(fn) { 26868 handlers.push(fn); 26869 return function () { 26870 handlers = handlers.filter(function (handler) { 26871 return handler !== fn; 26872 }); 26873 }; 26874 }, 26875 call: function call(arg) { 26876 handlers.forEach(function (fn) { 26877 return fn && fn(arg); 26878 }); 26879 } 26880 }; 26881} 26882 26883function createKey() { 26884 return Math.random().toString(36).substr(2, 8); 26885} 26886/** 26887 * Creates a string URL path from the given pathname, search, and hash components. 26888 * 26889 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createpath 26890 */ 26891 26892 26893function createPath(_ref) { 26894 var _ref$pathname = _ref.pathname, 26895 pathname = _ref$pathname === void 0 ? '/' : _ref$pathname, 26896 _ref$search = _ref.search, 26897 search = _ref$search === void 0 ? '' : _ref$search, 26898 _ref$hash = _ref.hash, 26899 hash = _ref$hash === void 0 ? '' : _ref$hash; 26900 if (search && search !== '?') pathname += search.charAt(0) === '?' ? search : '?' + search; 26901 if (hash && hash !== '#') pathname += hash.charAt(0) === '#' ? hash : '#' + hash; 26902 return pathname; 26903} 26904/** 26905 * Parses a string URL path into its separate pathname, search, and hash components. 26906 * 26907 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#parsepath 26908 */ 26909 26910function parsePath(path) { 26911 var parsedPath = {}; 26912 26913 if (path) { 26914 var hashIndex = path.indexOf('#'); 26915 26916 if (hashIndex >= 0) { 26917 parsedPath.hash = path.substr(hashIndex); 26918 path = path.substr(0, hashIndex); 26919 } 26920 26921 var searchIndex = path.indexOf('?'); 26922 26923 if (searchIndex >= 0) { 26924 parsedPath.search = path.substr(searchIndex); 26925 path = path.substr(0, searchIndex); 26926 } 26927 26928 if (path) { 26929 parsedPath.pathname = path; 26930 } 26931 } 26932 26933 return parsedPath; 26934} 26935 26936 26937//# sourceMappingURL=index.js.map 26938 26939// EXTERNAL MODULE: ./node_modules/@redux-saga/core/dist/redux-saga-effects.esm.js 26940var redux_saga_effects_esm = __webpack_require__(85118); 26941// EXTERNAL MODULE: ./node_modules/loglevel/lib/loglevel.js 26942var loglevel = __webpack_require__(73065); 26943// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/store-Cxe7mlLh.js + 2 modules 26944var store_Cxe7mlLh = __webpack_require__(95137); 26945// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/version-Cy-gb20a.js 26946var version_Cy_gb20a = __webpack_require__(9348); 26947;// ./node_modules/await-to-js/dist/await-to-js.es5.js 26948/** 26949 * @param { Promise } promise 26950 * @param { Object= } errorExt - Additional Information you can pass to the err object 26951 * @return { Promise } 26952 */ 26953function to(promise, errorExt) { 26954 return promise 26955 .then(function (data) { return [null, data]; }) 26956 .catch(function (err) { 26957 if (errorExt) { 26958 Object.assign(err, errorExt); 26959 } 26960 return [err, undefined]; 26961 }); 26962} 26963 26964 26965/* harmony default export */ const await_to_js_es5 = (to); 26966//# sourceMappingURL=await-to-js.es5.js.map 26967 26968// EXTERNAL MODULE: ./node_modules/redux-saga/dist/redux-saga-core-npm-proxy.esm.js + 2 modules 26969var redux_saga_core_npm_proxy_esm = __webpack_require__(27701); 26970// EXTERNAL MODULE: ./node_modules/contensis-delivery-api/lib/index.js 26971var lib = __webpack_require__(15575); 26972// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/slice-C6JLQik8.js + 1 modules 26973var slice_C6JLQik8 = __webpack_require__(60218); 26974// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/selectors-Dj45vPZR.js 26975var selectors_Dj45vPZR = __webpack_require__(23790); 26976// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/version-hQnuV0n7.js 26977var version_hQnuV0n7 = __webpack_require__(81452); 26978// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/ContensisDeliveryApi-Czq1gBOi.js 26979var ContensisDeliveryApi_Czq1gBOi = __webpack_require__(22255); 26980// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/VersionInfo-BinQYaU1.js 26981var VersionInfo_BinQYaU1 = __webpack_require__(23367); 26982// EXTERNAL MODULE: ./node_modules/jsonpath-mapper/dist/jsonpath-mapper.mjs + 1 modules 26983var jsonpath_mapper = __webpack_require__(47149); 26984// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/selectors-D4ulaTom.js 26985var selectors_D4ulaTom = __webpack_require__(83069); 26986// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/matchGroups-C2_rxOIO.js 26987var matchGroups_C2_rxOIO = __webpack_require__(54293); 26988// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/CookieConstants-DEmbwzYr.js 26989var CookieConstants_DEmbwzYr = __webpack_require__(83068); 26990// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/CookieHelper.class-C6rTRl_1.js 26991var CookieHelper_class_C6rTRl_1 = __webpack_require__(26240); 26992// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/ToJs-BnRRHk6f.js 26993var ToJs_BnRRHk6f = __webpack_require__(32078); 26994;// ./node_modules/@zengenti/contensis-react-base/esm/ChangePassword.container-BlSy5eHk.js 26995/* unused harmony import specifier */ var ChangePassword_container_BlSy5eHk_select; 26996/* unused harmony import specifier */ var put; 26997/* unused harmony import specifier */ var SET_AUTHENTICATION_STATE; 26998/* unused harmony import specifier */ var selectClientCredentials; 26999 27000 27001 27002 27003 27004 27005 27006 27007 27008 27009 27010const findContentTypeMapping = (ContentTypeMappings, contentTypeId) => ContentTypeMappings.find(ct => ct.contentTypeID === contentTypeId); 27011 27012/** Find a searchOptions object in any of the current routes */ 27013const getSearchOptions = (staticRoute, contentTypeRoute) => { 27014 var _staticRoute$route; 27015 return (staticRoute === null || staticRoute === void 0 || (_staticRoute$route = staticRoute.route) === null || _staticRoute$route === void 0 ? void 0 : _staticRoute$route.searchOptions) || (contentTypeRoute === null || contentTypeRoute === void 0 ? void 0 : contentTypeRoute.searchOptions); 27016}; 27017 27018const clientCredentials = { 27019 bearerToken: 'bearerToken', 27020 bearerTokenExpiryDate: ({ 27021 bearerTokenExpiryDate 27022 }) => bearerTokenExpiryDate.toISOString(), 27023 refreshToken: 'refreshToken', 27024 refreshTokenExpiryDate: ({ 27025 refreshTokenExpiryDate 27026 }) => refreshTokenExpiryDate.toISOString(), 27027 contensisClassicToken: 'contensisClassicToken' 27028}; 27029var mapClientCredentials = obj => (0,jsonpath_mapper/* default */.Ay)(obj, clientCredentials); 27030 27031const getManagementApiClient = async ({ 27032 bearerToken, 27033 bearerTokenExpiryDate, 27034 refreshToken, 27035 refreshTokenExpiryDate, 27036 contensisClassicToken, 27037 username, 27038 password 27039}) => { 27040 const rootUrl = SERVERS.cms || SERVERS.api; /* global SERVERS */ 27041 const projectId = PROJECTS[0].id; /* global PROJECTS */ 27042 27043 let config = {}; 27044 if (refreshToken) { 27045 config = { 27046 clientType: 'contensis_classic_refresh_token', 27047 clientDetails: { 27048 refreshToken 27049 } 27050 }; 27051 } else { 27052 config = { 27053 clientType: 'contensis_classic', 27054 clientDetails: { 27055 username, 27056 password 27057 } 27058 }; 27059 } 27060 let { 27061 Client 27062 } = await __webpack_require__.e(/* import() */ 97324).then(__webpack_require__.t.bind(__webpack_require__, 97324, 23)); 27063 if (typeof window === 'undefined') { 27064 const { 27065 UniversalClient 27066 } = await __webpack_require__.e(/* import() */ 97324).then(__webpack_require__.t.bind(__webpack_require__, 97324, 23)); 27067 Client = UniversalClient; 27068 } 27069 const client = Client.create({ 27070 ...config, 27071 projectId, 27072 rootUrl 27073 }); 27074 if (bearerToken) client.bearerToken = bearerToken; 27075 if (bearerTokenExpiryDate) client.bearerTokenExpiryDate = bearerTokenExpiryDate; 27076 if (refreshToken) client.refreshToken = refreshToken; 27077 if (refreshTokenExpiryDate) client.refreshTokenExpiryDate = refreshTokenExpiryDate; 27078 if (contensisClassicToken) client.contensisClassicToken = contensisClassicToken; 27079 return client; 27080}; 27081 27082const context$1 = typeof window != 'undefined' ? window : __webpack_require__.g; 27083const requireOidc = false ? 0 /* global WSFED_LOGIN */ : context$1.WSFED_LOGIN === 'true'; 27084const servers = SERVERS; /* global SERVERS */ 27085 27086const userManagerConfig = typeof window !== 'undefined' ? { 27087 authority: `${servers.cms}/authenticate/`, 27088 client_id: 'WebsiteAdfsClient', 27089 redirect_uri: window.location.toString(), 27090 post_logout_redirect_uri: window.location.toString(), 27091 response_type: 'id_token', 27092 scope: 'openid', 27093 filterProtocolClaims: false 27094} : {}; 27095const createUserManager = async config => { 27096 if (typeof window !== 'undefined' && requireOidc) { 27097 try { 27098 const { 27099 UserManager 27100 } = await __webpack_require__.e(/* import() | oidcclient */ 28013).then(__webpack_require__.t.bind(__webpack_require__, 76405, 23)); 27101 return new UserManager(config); 27102 } catch (e) { 27103 console.error('Exception in createUserManager: ', e); 27104 } 27105 } else return; 27106}; 27107 27108var _LoginHelper; 27109const context = typeof window != 'undefined' ? window : __webpack_require__.g; 27110class LoginHelper {
27111 constructor(cookies) { 27112 this.cookies = cookies || new CookieHelper_class_C6rTRl_1.C(); 27113 } 27114 static ClientRedirectToHome(location) { 27115 if (typeof window != 'undefined') { 27116 let url = '/'; 27117 if (location) { 27118 const { 27119 search, 27120 hash 27121 } = location; 27122 url = search ? `${url}${search}` : url; 27123 url = hash ? `${url}${hash}` : url; 27124 } 27125 window.location.href = url; 27126 } 27127 } 27128 static async ClientRedirectToSignInPage(redirectPath) { 27129 if (typeof location === 'undefined') return; 27130 if (LoginHelper.WSFED_LOGIN) { 27131 await LoginHelper.WsFedLogout(); 27132 await LoginHelper.WsFedLogin(); 27133 } else { 27134 // Standard Contensis Login 27135 let url = LoginHelper.LOGIN_ROUTE; 27136 if (typeof redirectPath === 'string') url = `${url}?redirect_uri=${redirectPath}`; 27137 if (typeof location !== 'undefined' && redirectPath !== LoginHelper.LOGIN_ROUTE) location.replace(url); 27138 } 27139 } 27140 static GetAccessDeniedRoute(originalPath) { 27141 let url = LoginHelper.ACCESS_DENIED_ROUTE; 27142 if (originalPath !== url && typeof originalPath === 'string') url = `${url}?original_uri=${originalPath}`; 27143 return url; 27144 } 27145 static ClientRedirectToAccessDeniedPage(originalPath) { 27146 if (typeof location !== 'undefined') location.href = LoginHelper.GetAccessDeniedRoute(originalPath); 27147 } 27148 static ClientRedirectToPath(redirectPath) { 27149 if (typeof redirectPath === 'string') { 27150 if (typeof location !== 'undefined') window.location.href = redirectPath; 27151 } else LoginHelper.ClientRedirectToHome(); 27152 } 27153 static async WsFedLogin(redirectUri) { 27154 const userManager = await createUserManager(userManagerConfig); 27155 userManager === null || userManager === void 0 || userManager.signinRedirect({ 27156 scope: 'openid', 27157 response_type: 'id_token', 27158 redirect_uri: redirectUri || window.location.toString() 27159 }); 27160 } 27161 static RemoveSecurityTokenQuery() { 27162 const params = new URLSearchParams(window.location.search); 27163 if (params.has('securitytoken') || params.has('securityToken')) { 27164 params.delete('securitytoken'); 27165 params.delete('securityToken'); 27166 window.location.href = `${window.location.pathname}${params.toString() ? `?${params}` : ''}`; 27167 } 27168 } 27169 static async WsFedLogout(redirectPath) { 27170 await fetch(`${LoginHelper.CMS_URL}/authenticate/logout?jsonResponseRequired=true`, { 27171 credentials: 'include' 27172 }); 27173 if (redirectPath) { 27174 window.location.href = redirectPath; 27175 } else { 27176 // Explicitly check and remove any stale 27177 // security token that may be in the query string 27178 LoginHelper.RemoveSecurityTokenQuery(); 27179 } 27180 } 27181 static async GetCredentialsForSecurityToken(securityToken) { 27182 const [error, response] = await to(fetch(`${LoginHelper.CMS_URL}/REST/Contensis/Security/IsAuthenticated`, { 27183 method: 'POST', 27184 headers: { 27185 Accept: 'application/json', 27186 'Content-Type': 'application/json' 27187 }, 27188 body: JSON.stringify({ 27189 securityToken: encodeURIComponent(securityToken) 27190 }) 27191 })); 27192 if (error) return [{ 27193 message: 'Failed to fetch credentials' 27194 }]; 27195 if (response.ok) { 27196 const [parseError, body] = await to(response.json()); 27197 if (parseError) return [parseError]; 27198 const { 27199 LogonResult, 27200 ApplicationData = [] 27201 } = body; 27202 if (LogonResult !== 0) { 27203 // console.info(`Security token is invalid - LogonResult: ${LogonResult}`); 27204 return [{ 27205 message: 'Security token is invalid', 27206 data: ApplicationData 27207 }]; 27208 } 27209 if (ApplicationData.length > 0) { 27210 let refreshToken; 27211 ApplicationData.forEach(item => { 27212 if (item.Key === 'ContensisSecurityRefreshToken') refreshToken = item.Value; 27213 }); 27214 if (!refreshToken) { 27215 return [{ 27216 message: 'Fetch credentials: Unable to find ContensisSecurityRefreshToken' 27217 }]; 27218 } 27219 return [undefined, refreshToken]; 27220 } else { 27221 return [{ 27222 message: 'Fetch credentials: Unable to find ContensisSecurityRefreshToken' 27223 }]; 27224 } 27225 } else { 27226 return [{ 27227 message: `Fetch credentials error: ${response.status} ${response.statusText}` 27228 }]; 27229 } 27230 } 27231 27232 // static isZengentiStaff(email) { 27233 // const emailRefs = ['@zengenti', '@contensis']; 27234 27235 // return emailRefs.some(emailRef => { 27236 // if (email.includes(emailRef)) { 27237 // return true; 27238 // } 27239 // }); 27240 // } 27241 27242 SetLoginCookies({ 27243 bearerToken, 27244 contensisClassicToken, 27245 refreshToken 27246 }) { 27247 if (bearerToken) this.cookies.SetCookie(CookieConstants_DEmbwzYr.B, bearerToken); 27248 if (contensisClassicToken) this.cookies.SetCookie(CookieConstants_DEmbwzYr.L, contensisClassicToken); 27249 if (refreshToken) this.cookies.SetCookie(CookieConstants_DEmbwzYr.R, refreshToken); 27250 } 27251 GetCachedCredentials() { 27252 return { 27253 bearerToken: null, 27254 bearerTokenExpiryDate: null, 27255 refreshToken: this.cookies.GetCookie(CookieConstants_DEmbwzYr.R), 27256 refreshTokenExpiryDate: null, 27257 contensisClassicToken: this.cookies.GetCookie(CookieConstants_DEmbwzYr.L), 27258 securityToken: null 27259 }; 27260 } 27261 ClearCachedCredentials() { 27262 this.cookies.DeleteCookie(CookieConstants_DEmbwzYr.L); 27263 this.cookies.DeleteCookie(CookieConstants_DEmbwzYr.R); 27264 this.cookies.DeleteCookie(CookieConstants_DEmbwzYr.B); // additional cookie used by @contensis/forms package 27265 27266 if (LoginHelper.WSFED_LOGIN && typeof window !== 'undefined') { 27267 // remove any oidc keys left over in localStorage 27268 const { 27269 localStorage 27270 } = window;
27271 const keys = []; 27272 for (let i = 0; i < localStorage.length; i++) { 27273 const key = localStorage.key(i); 27274 if (typeof key === 'string' && key.startsWith('oidc.')) keys.push(key); 27275 } 27276 keys.forEach(key => localStorage.removeItem(key)); 27277 } 27278 } 27279 async LoginUser({ 27280 username, 27281 password, 27282 clientCredentials 27283 }) { 27284 let credentials = clientCredentials; 27285 let authenticationState = { 27286 clientCredentials: null, 27287 isAuthenticated: false, 27288 isAuthenticationError: false, 27289 isError: false 27290 }; 27291 let transientClient = null; 27292 let user; 27293 if (username && password) { 27294 // Get a management client with username and password 27295 transientClient = await getManagementApiClient({ 27296 username, 27297 password 27298 }); 27299 27300 // Ensure the client has requested a bearer token 27301 const [loginError, clientBearerToken] = await to(transientClient.ensureBearerToken()); 27302 27303 // Problem getting token with username and password 27304 if (loginError) { 27305 authenticationState = { 27306 clientCredentials: null, 27307 errorMessage: loginError.message || null, 27308 isAuthenticated: false, 27309 isAuthenticationError: loginError.name.includes('ContensisAuthenticationError'), 27310 isError: true 27311 }; 27312 this.ClearCachedCredentials(); 27313 } 27314 27315 // Got a token using username and password 27316 if (clientBearerToken) { 27317 // Set credentials so we can continue to GetUserDetails 27318 const clientCredentials = mapClientCredentials(transientClient); 27319 this.SetLoginCookies(clientCredentials); 27320 authenticationState = { 27321 clientCredentials, 27322 isAuthenticated: true, 27323 isAuthenticationError: false, 27324 isError: false 27325 }; 27326 credentials = clientCredentials; 27327 } 27328 } 27329 27330 // If we have credentials supplied by a successful username and password login 27331 // or clientCredentials supplied in the options argument we can continue to 27332 // fetch the user's details 27333 if (credentials) { 27334 const client = transientClient || (await getManagementApiClient(credentials)); 27335 const [error, userDetails] = await LoginHelper.GetUserDetails(client); 27336 if (error) { 27337 authenticationState = { 27338 clientCredentials: null, 27339 errorMessage: error.message, 27340 isAuthenticated: false, 27341 isAuthenticationError: false, 27342 isError: true 27343 }; 27344 this.ClearCachedCredentials(); 27345 } else { 27346 // Ensure we get latest refreshToken and contensisClassicToken from the latest client 27347 const latestCredentials = mapClientCredentials(client); 27348 this.SetLoginCookies(latestCredentials); 27349 user = userDetails; 27350 authenticationState = { 27351 clientCredentials: latestCredentials, 27352 isAuthenticated: true, 27353 isAuthenticationError: false, 27354 isError: false 27355 }; 27356 } 27357 } 27358 return { 27359 authenticationState, 27360 user 27361 }; 27362 } 27363 LogoutUser(redirectPath) { 27364 this.ClearCachedCredentials(); 27365 if (LoginHelper.WSFED_LOGIN) { 27366 LoginHelper.WsFedLogout(redirectPath); 27367 } else { 27368 if (redirectPath) LoginHelper.ClientRedirectToPath(redirectPath);else LoginHelper.ClientRedirectToSignInPage(); 27369 } 27370 } 27371} 27372_LoginHelper = LoginHelper; 27373LoginHelper.CMS_URL = SERVERS.cms /* global SERVERS */; 27374LoginHelper.WSFED_LOGIN = false ? 0 /* global WSFED_LOGIN */ : context.WSFED_LOGIN === 'true'; 27375LoginHelper.LOGIN_ROUTE = '/account/login'; 27376LoginHelper.ACCESS_DENIED_ROUTE = '/account/access-denied'; 27377LoginHelper.withCookies = cookieHelper => new _LoginHelper(cookieHelper); 27378LoginHelper.GetUserDetails = async client => { 27379 const [userError, user] = await to(client.security.users.getCurrent()); 27380 if (user && user.id) { 27381 const [groupsError, groupsResult] = await to(client.security.users.getUserGroups({ 27382 userId: user.id, 27383 includeInherited: true, 27384 pageOptions: { 27385 pageSize: 100 27386 } 27387 })); 27388 // Set groups attribute in user object to be the items 27389 // array from the getUserGroups result 27390 if (groupsResult && groupsResult.items) user.groups = groupsResult.items; 27391 27392 // If groups call fails then log the error but allow the user to login still 27393 27394 if (groupsError) console.log(groupsError); 27395 } 27396 return [userError, user]; 27397}; 27398 27399const loginSagas = [(0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.L, loginUserSaga), (0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.d, logoutUserSaga), (0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.V, validateUserSaga), (0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.p, redirectAfterSuccessfulLoginSaga)]; 27400function* handleRequiresLoginSaga(action) { 27401 var _entry$sys; 27402 const { 27403 cookies, 27404 entry, 27405 path, 27406 requireLogin, 27407 routes: { 27408 ContentTypeMappings 27409 }, 27410 staticRoute 27411 } = action; 27412 let userLoggedIn = yield (0,redux_saga_effects_esm/* select */.Lt)(matchGroups_C2_rxOIO.o); 27413 27414 // Check for a securityToken in querystring 27415 const currentQs = (0,selectors_Dj45vPZR.A)(yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.J)); 27416 const securityToken = currentQs.securityToken || currentQs.securitytoken; 27417 27418 // Check if any of the defined routes have "requireLogin" attribute 27419 const { 27420 requireLogin: authRoute 27421 } = staticRoute && staticRoute.route || {}; 27422 const { 27423 requireLogin: authContentType 27424 } = entry && findContentTypeMapping(ContentTypeMappings, entry === null || entry === void 0 || (_entry$sys = entry.sys) === null || _entry$sys === void 0 ? void 0 : _entry$sys.contentTypeId) || {}; 27425 27426 // If requireLogin, authRoute or authContentType has been specified as an 27427 // array of groups we can merge all the arrays and match on any group supplied 27428 const routeRequiresGroups = [...(Array.isArray(authContentType) && authContentType || []), ...(Array.isArray(authRoute) && authRoute || []), ...(Array.isArray(requireLogin) && requireLogin || [])]; 27429 const routeRequiresLogin = !!authContentType || !!authRoute || !!requireLogin; 27430 if (!userLoggedIn) { 27431 // If cookies or securityToken are found on any route change 27432 // always validate and login the user 27433 if (routeRequiresLogin) { 27434 // console.info(`Route requires login: ${path}`); 27435 // If routeRequiresLogin do a blocking call that returns userLoggedIn 27436 userLoggedIn = yield (0,redux_saga_effects_esm/* call */.T1)(validateUserSaga, { 27437 cookies, 27438 securityToken 27439 }); 27440 // console.info(`User logged in: ${userLoggedIn}`); 27441 } 27442 // otherwise do a non blocking put to handle validation in the background 27443 else yield (0,redux_saga_effects_esm/* put */.yJ)({ 27444 type: selectors_Dj45vPZR.V, 27445 cookies, 27446 securityToken 27447 }); 27448 } 27449 if (routeRequiresLogin) { 27450 // If a security token is in the querystring and we are not already 27451 // logged in something is wrong and we won't bother going on another redirect loop 27452 if (!userLoggedIn && !securityToken) { 27453 LoginHelper.ClientRedirectToSignInPage(action.location.pathname); 27454 } else if (routeRequiresGroups.length > 0) { 27455 const userGroups = yield (0,redux_saga_effects_esm/* select */.Lt)(matchGroups_C2_rxOIO.l, 'js'); 27456 const groupMatch = (0,matchGroups_C2_rxOIO.m)(userGroups, routeRequiresGroups); 27457 if (!groupMatch) LoginHelper.ClientRedirectToAccessDeniedPage(action.location.pathname); 27458 } 27459 } 27460 return userLoggedIn; 27461} 27462function* validateUserSaga({ 27463 cookies, 27464 securityToken 27465}) { 27466 const login = LoginHelper.withCookies(cookies); 27467 // Check for refreshToken in cookies 27468 let clientCredentials = login.GetCachedCredentials(); 27469 if (securityToken || clientCredentials.securityToken || clientCredentials.refreshToken) { 27470 // We only attempt to validate the user if one of the stored 27471 // tokens are found, in this case we set loading state manually 27472 // so we don't need to set and unset loading if there are no stored 27473 yield (0,redux_saga_effects_esm/* put */.yJ)({ 27474 type: selectors_Dj45vPZR.p, 27475 authenticationState: { 27476 isLoading: true 27477 } 27478 }); 27479 // If we have just a security token we will call a CMS endpoint 27480 // and provide us with a RefreshToken cookie we can use during login 27481 if (securityToken || clientCredentials.securityToken && !clientCredentials.refreshToken) { 27482 const [error, refreshToken] = yield LoginHelper.GetCredentialsForSecurityToken(securityToken || clientCredentials.securityToken); 27483 if (refreshToken) { 27484 // Set cookies and reload values 27485 login.SetLoginCookies({ 27486 contensisClassicToken: securityToken, 27487 refreshToken 27488 }); 27489 clientCredentials = login.GetCachedCredentials(); 27490 } 27491 if (error) { 27492 login.ClearCachedCredentials(); 27493 yield (0,redux_saga_effects_esm/* put */.yJ)({ 27494 type: selectors_Dj45vPZR.p, 27495 authenticationState: { 27496 isError: true, 27497 errorMessage: (error === null || error === void 0 ? void 0 : error.message) || error && 'toString' in error && error.toString() 27498 } 27499 }); 27500 } 27501 } 27502 27503 // Log the user in if a refreshToken is found 27504 if (clientCredentials.refreshToken) { 27505 // console.info( 27506 // `Login user with refreshToken ${clientCredentials.refreshToken}` 27507 // ); 27508 yield (0,redux_saga_effects_esm/* call */.T1)(loginUserSaga, { 27509 clientCredentials, 27510 cookies: login.cookies 27511 }); 27512 } 27513 } 27514 27515 // Tell any callers have we successfully logged in? 27516 return yield (0,redux_saga_effects_esm/* select */.Lt)(matchGroups_C2_rxOIO.o); 27517} 27518function* loginUserSaga(action = {}) { 27519 const { 27520 username, 27521 password, 27522 clientCredentials, 27523 cookies 27524 } = action; 27525 const login = LoginHelper.withCookies(cookies); 27526 27527 // If a WSFED_LOGIN site has dispatched the loginUser action 27528 // just redirect them to the Identity Provider sign in 27529 if (action.type === selectors_Dj45vPZR.L && LoginHelper.WSFED_LOGIN) LoginHelper.ClientRedirectToSignInPage(); 27530 const { 27531 authenticationState, 27532 user 27533 } = yield login.LoginUser({ 27534 username, 27535 password, 27536 clientCredentials 27537 }); 27538 yield (0,redux_saga_effects_esm/* put */.yJ)({ 27539 type: selectors_Dj45vPZR.p, 27540 authenticationState, 27541 user 27542 }); 27543} 27544const removeHostnamePart = path => { 27545 const relativePath = '/' + path.split('/').splice(3).join('/'); 27546 return relativePath; 27547}; 27548function* redirectAfterSuccessfulLoginSaga() { 27549 const isLoggedIn = yield (0,redux_saga_effects_esm/* select */.Lt)(matchGroups_C2_rxOIO.o); 27550 const { 27551 redirect_uri, 27552 ReturnURL 27553 } = (0,selectors_Dj45vPZR.A)(yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.J)); 27554 const redirectPath = Array.isArray(redirect_uri) ? redirect_uri[0] : redirect_uri; 27555 const assetRedirectPath = Array.isArray(ReturnURL) ? ReturnURL[0] : ReturnURL; 27556 if (isLoggedIn && assetRedirectPath && typeof window != 'undefined') { 27557 const path = removeHostnamePart(assetRedirectPath); 27558 // This has to be a hard href to get the app to 27559 // leave React and hit the server for the IIS hosted assets 27560 window.location.href = path; 27561 // yield put(setRoute(path)); // does not work in this scenario 27562 } else if (isLoggedIn && redirectPath) { 27563 yield (0,redux_saga_effects_esm/* put */.yJ)((0,selectors_Dj45vPZR.a6)(redirectPath)); 27564 } 27565} 27566function* logoutUserSaga({ 27567 redirectPath, 27568 cookies 27569}) { 27570 yield (0,redux_saga_effects_esm/* put */.yJ)({ 27571 type: selectors_Dj45vPZR.p, 27572 user: null 27573 }); 27574 yield LoginHelper.withCookies(cookies).LogoutUser(redirectPath); 27575} 27576function* refreshSecurityToken() { 27577 const clientCredentials = yield ChangePassword_container_BlSy5eHk_select(selectClientCredentials, 'js'); 27578 if (Object.keys(clientCredentials).length > 0) { 27579 const client = yield getManagementApiClient(clientCredentials); 27580 yield client.authenticate(); 27581 yield put({ 27582 type: SET_AUTHENTICATION_STATE, 27583 authenticationState: { 27584 clientCredentials: mapClientCredentials(client) 27585 } 27586 }); 27587 } 27588} 27589 27590const loginUser = (username, password, cookies) => (0,selectors_Dj45vPZR.w)(selectors_Dj45vPZR.L, { 27591 username, 27592 password, 27593 cookies 27594});
27595const logoutUser = (redirectPath, cookies) => (0,selectors_Dj45vPZR.w)(selectors_Dj45vPZR.d, { 27596 redirectPath, 27597 cookies 27598}); 27599const registerUser = (user, mappers) => (0,selectors_Dj45vPZR.w)(selectors_Dj45vPZR.R, { 27600 user, 27601 mappers 27602}); 27603const requestPasswordReset = userEmailObject => (0,selectors_Dj45vPZR.w)(selectors_Dj45vPZR.g, { 27604 userEmailObject 27605}); 27606const resetPassword = resetPasswordObject => (0,selectors_Dj45vPZR.w)(selectors_Dj45vPZR.k, { 27607 resetPasswordObject 27608}); 27609const changePassword = (userId, currentPassword, newPassword) => (0,selectors_Dj45vPZR.w)(selectors_Dj45vPZR.C, { 27610 userId, 27611 currentPassword, 27612 newPassword 27613}); 27614 27615var actions = /*#__PURE__*/Object.freeze({ 27616 __proto__: null, 27617 changePassword: changePassword, 27618 loginUser: loginUser, 27619 logoutUser: logoutUser, 27620 registerUser: registerUser, 27621 requestPasswordReset: requestPasswordReset, 27622 resetPassword: resetPassword 27623}); 27624 27625const useLogin = () => { 27626 const cookies = new CookieHelper_class_C6rTRl_1.C(...(0,esm/* useCookies */.lT)()); 27627 const dispatch = (0,react_redux/* useDispatch */.wA)(); 27628 const select = react_redux/* useSelector */.d4; 27629 return { 27630 loginUser: (username, password) => dispatch(loginUser(username, password, cookies)), 27631 logoutUser: redirectPath => dispatch(logoutUser(redirectPath, cookies)), 27632 errorMessage: select(matchGroups_C2_rxOIO.k), 27633 isAuthenticated: select(matchGroups_C2_rxOIO.o), 27634 isAuthenticationError: select(matchGroups_C2_rxOIO.p), 27635 isError: select(matchGroups_C2_rxOIO.q), 27636 isLoading: select(matchGroups_C2_rxOIO.r), 27637 user: select(matchGroups_C2_rxOIO.j), 27638 // DEPRECATED: authenticationError is deprecated use isAuthenticationError instead 27639 authenticationError: select(matchGroups_C2_rxOIO.p), 27640 // DEPRECATED: authenticationErrorMessage is deprecated use errorMessage instead 27641 authenticationErrorMessage: select(matchGroups_C2_rxOIO.k), 27642 // DEPRECATED: error is deprecated use isError instead 27643 error: select(matchGroups_C2_rxOIO.q) 27644 }; 27645}; 27646 27647const LoginContainer = ({ 27648 children, 27649 ...props 27650}) => { 27651 const userProps = useLogin(); 27652 return children(userProps); 27653}; 27654LoginContainer.propTypes = {}; 27655var Login_container = (0,ToJs_BnRRHk6f.t)(LoginContainer); 27656 27657const useRegistration = () => { 27658 const dispatch = (0,react_redux/* useDispatch */.wA)(); 27659 const select = react_redux/* useSelector */.d4; 27660 return { 27661 registerUser: (user, mappers) => dispatch(registerUser(user, mappers)), 27662 error: select(matchGroups_C2_rxOIO.u), 27663 isLoading: select(matchGroups_C2_rxOIO.v), 27664 isSuccess: select(matchGroups_C2_rxOIO.w), 27665 user: select(matchGroups_C2_rxOIO.t) 27666 }; 27667}; 27668 27669const RegistrationContainer = ({ 27670 children, 27671 ...props 27672}) => { 27673 const userProps = useRegistration(); 27674 return children(userProps); 27675}; 27676RegistrationContainer.propTypes = {}; 27677var Registration_container = (0,ToJs_BnRRHk6f.t)(RegistrationContainer); 27678 27679const useForgotPassword = () => { 27680 const dispatch = (0,react_redux/* useDispatch */.wA)(); 27681 const select = react_redux/* useSelector */.d4; 27682 return { 27683 isLoading: select(matchGroups_C2_rxOIO.e), 27684 isSuccess: select(matchGroups_C2_rxOIO.f), 27685 error: select(matchGroups_C2_rxOIO.d), 27686 requestPasswordReset: userEmailObject => dispatch(requestPasswordReset(userEmailObject)), 27687 setNewPassword: { 27688 queryString: select(selectors_Dj45vPZR.J), 27689 isLoading: select(matchGroups_C2_rxOIO.h), 27690 isSuccess: select(matchGroups_C2_rxOIO.i), 27691 error: select(matchGroups_C2_rxOIO.g), 27692 submit: resetPasswordObject => dispatch(resetPassword(resetPasswordObject)) 27693 } 27694 }; 27695}; 27696 27697const ForgotPasswordContainer = ({ 27698 children, 27699 ...props 27700}) => { 27701 const userProps = useForgotPassword(); 27702 return children(userProps); 27703}; 27704ForgotPasswordContainer.propTypes = {}; 27705var ForgotPassword_container = (0,ToJs_BnRRHk6f.t)(ForgotPasswordContainer); 27706 27707const useChangePassword = () => { 27708 const dispatch = (0,react_redux/* useDispatch */.wA)(); 27709 const select = react_redux/* useSelector */.d4; 27710 return { 27711 isLoading: select(matchGroups_C2_rxOIO.a), 27712 isSuccess: select(matchGroups_C2_rxOIO.b), 27713 userId: select(matchGroups_C2_rxOIO.n), 27714 isLoggedIn: select(matchGroups_C2_rxOIO.o), 27715 error: select(matchGroups_C2_rxOIO.s), 27716 changePassword: (userId, currentPassword, newPassword) => dispatch(changePassword(userId, currentPassword, newPassword)) 27717 }; 27718}; 27719 27720const ChangePasswordContainer = ({ 27721 children, 27722 ...props 27723}) => { 27724 const userProps = useChangePassword(); 27725 return children(userProps); 27726};
27727ChangePasswordContainer.propTypes = {}; 27728var ChangePassword_container = (0,ToJs_BnRRHk6f.t)(ChangePasswordContainer); 27729 27730 27731//# sourceMappingURL=ChangePassword.container-BlSy5eHk.js.map 27732 27733// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/sagas-BN4gNmmc.js 27734var sagas_BN4gNmmc = __webpack_require__(69248); 27735// EXTERNAL MODULE: ./node_modules/deep-equal/index.js 27736var deep_equal = __webpack_require__(4982); 27737// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js 27738var cjs = __webpack_require__(14744); 27739// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/util-DHWbLSvO.js 27740var util_DHWbLSvO = __webpack_require__(12846); 27741// EXTERNAL MODULE: ./node_modules/contensis-core-api/lib/index.js 27742var contensis_core_api_lib = __webpack_require__(41416); 27743// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/RouteLoader-CAVJs2rj.js 27744var RouteLoader_CAVJs2rj = __webpack_require__(43236); 27745;// ./node_modules/@zengenti/contensis-react-base/esm/App-DvfrUH4b.js 27746/* unused harmony import specifier */ var React; 27747/* unused harmony import specifier */ var RouteLoader; 27748 27749 27750 27751 27752 27753 27754 27755 27756 27757 27758 27759 27760 27761 27762 27763 27764 27765 27766 27767 27768 27769 27770 27771 27772 27773 27774 27775 27776 27777 27778 27779 27780 27781const isApiError = e => !!e && typeof e === 'object' && 'status' in e && 'statusText' in e; 27782const isPlainError = e => !!e && typeof e === 'object' && 'message' in e && typeof e.message === 'string'; 27783const logError = (prefix, e) => { 27784 var _e$data; 27785 const message = isApiError(e) ? `${prefix} ${e.status} "${((_e$data = e.data) === null || _e$data === void 0 ? void 0 : _e$data.message) || ''}" url: ${e.url || ''}` : isPlainError(e) ? `${prefix} "${(e === null || e === void 0 ? void 0 : e.message) || e}"${e !== null && e !== void 0 && e.stack ? `\n${e.stack}` : ''}` : `${prefix} "${e}"`; 27786 (0,loglevel.error)(message); 27787}; 27788const shorten = (str, maxLength = 120, endWeight = 0.6) => { 27789 if (!str || str.length <= maxLength) return str; 27790 const charsToShow = maxLength - 3; 27791 const back = Math.floor(charsToShow * endWeight); 27792 const front = charsToShow - back; 27793 return `${str.slice(0, front)}...${str.slice(str.length - back)}`; 27794}; 27795 27796const deparameterise = path => { 27797 return path.replace(/\/:\w+\??/g, ''); 27798}; 27799 27800/** Create static routes for routes with specified locales */ 27801const createLocaleRoutes = routes => { 27802 const localeRoutes = {}; 27803 for (const route of routes.StaticRoutes) { 27804 // If the route has defined locales, create entries for each locale 27805 if (route.i18n && route.path) { 27806 for (const [language, path] of Object.entries(route.i18n)) { 27807 // We already have a locale route, so just append the language and path 27808 const deparameterisedPath = deparameterise(route.path); 27809 const deparameterisedLocalePath = deparameterise(path); 27810 if (localeRoutes[deparameterisedPath]) localeRoutes[deparameterisedPath][language] = deparameterisedLocalePath; 27811 // Otherwise, create a new entry for this route path 27812 else localeRoutes[deparameterisedPath] = { 27813 [language]: deparameterisedLocalePath 27814 }; 27815 if (deparameterise(route.path) !== deparameterisedLocalePath) { 27816 // I think we are OK to mutate here as this is only run once on app init 27817 // we can change this if needed later 27818 routes.StaticRoutes.push({ 27819 ...route, 27820 path, 27821 // Add the path with any parameters included 27822 language, 27823 i18n: undefined 27824 }); 27825 } else { 27826 // Just set the language on the existing route instead of creating a duplicate 27827 route.language = language; 27828 } 27829 } 27830 } 27831 } 27832 return localeRoutes; 27833}; 27834 27835// Create a history depending on the environment 27836const selectedHistory = typeof window !== 'undefined' ? createBrowserHistory : createMemoryHistory; 27837const App_DvfrUH4b_history = (options = {}) => selectedHistory(options); 27838const browserHistory = selectedHistory(); 27839 27840const navigationSagas = [(0,redux_saga_effects_esm/* takeEvery */.jP)(store_Cxe7mlLh.G, ensureNodeTreeSaga)]; 27841function* ensureNodeTreeSaga(action) { 27842 const { 27843 api, 27844 language, 27845 project, 27846 versionStatus, 27847 subsitePath, 27848 treeDepth 27849 } = action; 27850 const state = yield (0,redux_saga_effects_esm/* select */.Lt)(); 27851 try { 27852 if (!(0,version_Cy_gb20a.h)(state)) { 27853 const nodes = subsitePath ? yield api.getNode({ 27854 path: subsitePath, 27855 depth: treeDepth || 0, 27856 language 27857 }, project) : yield api.getRootNode({ 27858 depth: treeDepth || 0, 27859 language 27860 }, versionStatus, project); 27861 if (nodes) { 27862 yield (0,redux_saga_effects_esm/* put */.yJ)({ 27863 type: store_Cxe7mlLh.S, 27864 nodes 27865 }); 27866 } else { 27867 yield (0,redux_saga_effects_esm/* put */.yJ)({ 27868 type: store_Cxe7mlLh.a 27869 }); 27870 } 27871 } 27872 } catch (ex) { 27873 loglevel.error(...['Error running ensureNodeTreeSaga:', ex]); 27874 yield (0,redux_saga_effects_esm/* put */.yJ)({ 27875 type: store_Cxe7mlLh.a, 27876 error: ex.toString() 27877 }); 27878 } 27879} 27880 27881const i18nSagas = [(0,redux_saga_effects_esm/* takeEvery */.jP)(slice_C6JLQik8.a.INIT_LOCALES.type, getProjectLanguages), (0,redux_saga_effects_esm/* takeEvery */.jP)(slice_C6JLQik8.a.UPDATE_LANGUAGE.type, updateLanguage), (0,redux_saga_effects_esm/* takeEvery */.jP)(slice_C6JLQik8.a.SET_LANGUAGE.type, setLanguageRoute)]; 27882 27883/** 27884 * Resolve the current route language based on the entry, node, static route or path 27885 * Is called directly from the routing saga as soon as an entry or node has been fetched 27886 */
27887function* resolveCurrentRouteLanguage({ 27888 entry, 27889 node 27890}) { 27891 var _entry$sys, _staticRoute$route; 27892 const currentLanguage = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.s); 27893 const staticRoute = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.a1); 27894 let nextLanguage = currentLanguage; 27895 if (entry !== null && entry !== void 0 && (_entry$sys = entry.sys) !== null && _entry$sys !== void 0 && _entry$sys.language) nextLanguage = entry.sys.language;else if (node !== null && node !== void 0 && node.language) nextLanguage = node.language;else if (staticRoute !== null && staticRoute !== void 0 && (_staticRoute$route = staticRoute.route) !== null && _staticRoute$route !== void 0 && _staticRoute$route.language) nextLanguage = staticRoute.route.language;else { 27896 var _currentPath$split$fi; 27897 // attempt to infer language from the path 27898 const currentPath = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.H); 27899 27900 // path is normally lowercase 27901 const firstPathSegment = (_currentPath$split$fi = currentPath.split('/').find(segment => segment.length)) === null || _currentPath$split$fi === void 0 ? void 0 : _currentPath$split$fi.toLowerCase(); 27902 const locales = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.d); 27903 const matchedLanguage = Object.keys(locales).find(lang => lang.toLowerCase() === firstPathSegment); 27904 // matched a supported language in the path 27905 if (matchedLanguage) nextLanguage = matchedLanguage;else 27906 // falling back to primary language 27907 nextLanguage = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.e); 27908 } 27909 if (nextLanguage && nextLanguage !== currentLanguage) { 27910 const dictionary = yield (0,redux_saga_effects_esm/* call */.T1)(resolveDictionaryForLanguage, nextLanguage); 27911 yield (0,redux_saga_effects_esm/* put */.yJ)(slice_C6JLQik8.a.SET_LANGUAGE({ 27912 language: nextLanguage, 27913 dictionary 27914 })); 27915 } 27916} 27917 27918/** 27919 * Resolve the current dictionary for route language either using a supplied resolver 27920 * function or directly derive from the locales stored in state 27921 * Is called directly any time the language is changed 27922 */ 27923function* resolveDictionaryForLanguage(language) { 27924 let dictionary = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.a); 27925 // try and resolve a dictionary for this language 27926 const resolver = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.b); 27927 if (typeof resolver === 'function') { 27928 try { 27929 // dynamic import of dictionary file 27930 const loadedDictionary = yield (0,redux_saga_effects_esm/* call */.T1)(resolver, language); 27931 dictionary = loadedDictionary; 27932 } catch (error) { 27933 console.error(`No dictionary resolved for language ${language}`, error); 27934 } 27935 } else { 27936 // Load dictionary from locales in state 27937 const locales = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.d); 27938 if (locales && locales[language]) { 27939 dictionary = locales[language]; 27940 } 27941 } 27942 return dictionary; 27943} 27944 27945/** 27946 * Side effects triggered from updating the language via dispatched action 27947 * in language switching components, including resolving the next route, 27948 * update the dictionary and subsequently redirect if needed 27949 */ 27950function* updateLanguage({ 27951 payload: { 27952 language, 27953 redirect, 27954 fallbackPath 27955 } 27956}) { 27957 const currentLanguage = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.s); 27958 if (language === currentLanguage) { 27959 // no change needed 27960 return; 27961 } else { 27962 const dictionary = language !== currentLanguage ? yield (0,redux_saga_effects_esm/* call */.T1)(resolveDictionaryForLanguage, language) : yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.a); 27963 const uri = yield (0,redux_saga_effects_esm/* call */.T1)(resolveNextLanguageRoute, { 27964 language, 27965 redirect, 27966 fallbackPath 27967 }); 27968 yield (0,redux_saga_effects_esm/* put */.yJ)(slice_C6JLQik8.a.SET_LANGUAGE({ 27969 language, 27970 dictionary: dictionary != null ? dictionary : undefined, 27971 redirect: redirect !== false ? uri : undefined 27972 })); 27973 } 27974} 27975 27976/** Handle any route redirection after we have set the language */ 27977function* setLanguageRoute({ 27978 payload 27979}) { 27980 if (payload !== null && payload !== void 0 && payload.redirect) { 27981 const currentPath = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.H); 27982 if (payload.redirect === currentPath) { 27983 // already on the correct path, no need to redirect 27984 return; 27985 } 27986 yield (0,redux_saga_effects_esm/* put */.yJ)((0,selectors_Dj45vPZR.a6)(payload.redirect)); 27987 } 27988} 27989 27990/** Determine the correct route uri when the language changes */ 27991function* resolveNextLanguageRoute({ 27992 language, 27993 redirect, 27994 fallbackPath 27995}) { 27996 // have they supplied the route to go to? 27997 if (typeof redirect === 'string') { 27998 return redirect; 27999 } 28000 28001 // is this an entry or a static route? 28002 const availableLanguages = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.P); 28003 if (availableLanguages.find(l => l.toLowerCase() === language.toLowerCase())) { 28004 // if entry, get the uri for this language variation from the api 28005 const entryUri = yield (0,redux_saga_effects_esm/* call */.T1)(getEntryUriForLanguage, { 28006 entryId: yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.W), 28007 language 28008 }); 28009 if (entryUri) { 28010 return entryUri; 28011 } 28012 } 28013 28014 // if static route, get the uri from the routes config 28015 const staticRouteUri = yield (0,redux_saga_effects_esm/* call */.T1)(getStaticRouteUri, { 28016 language 28017 }); 28018 if (staticRouteUri) { 28019 return staticRouteUri; 28020 } 28021 28022 // if all else fails, fallback to the supplied fallback path or homepage 28023 return fallbackPath || `/${language.toLowerCase()}`; 28024} 28025 28026/** Check any current static route for a language variation we have stored in i18n.routes */ 28027function* getStaticRouteUri({ 28028 language 28029}) {
28030 const staticRoute = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.a1); 28031 if (staticRoute !== null && staticRoute !== void 0 && staticRoute.route.path) { 28032 var _Object$entries$find; 28033 // Routes can have parameters such as `/:facet?` we need to deparameterise 28034 // so we can check against our stored locale routes 28035 const deparameterisedPath = deparameterise(staticRoute.route.path); 28036 const localeRoutes = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.c); 28037 const originalPath = (_Object$entries$find = Object.entries(localeRoutes || {}).find(([, locales]) => Object.values(locales).includes(deparameterisedPath))) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0]; 28038 const routeLocales = localeRoutes[deparameterisedPath] || localeRoutes[originalPath || '']; 28039 const routeUri = routeLocales === null || routeLocales === void 0 ? void 0 : routeLocales[language]; 28040 return routeUri; 28041 } 28042} 28043 28044/** 28045 * Run when the app initiates locales, populating supported languages from the config 28046 * or fetching from the project if not provided 28047 */ 28048function* getProjectLanguages({ 28049 payload 28050}) { 28051 const stateLocales = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_D4ulaTom.d); 28052 if (stateLocales && Object.keys(stateLocales).length > 0) 28053 // Locales already set in state, no need to fetch again 28054 return; 28055 const locales = {}; 28056 let primaryLanguage = payload.primaryLanguage; 28057 const supportedLanguages = [...(payload.supportedLanguages || [])]; 28058 if (supportedLanguages !== null && supportedLanguages !== void 0 && supportedLanguages.length) { 28059 // If supported languages are provided in config, use these 28060 for (const supportedLanguage of supportedLanguages) { 28061 locales[supportedLanguage] = {}; 28062 } 28063 } else { 28064 // Fallback to getting languages from the project 28065 const [error, project] = yield await_to_js_es5(ContensisDeliveryApi_Czq1gBOi.c.getClient().project.get()); 28066 if (error) { 28067 console.error('Problem fetching project languages:', error); 28068 } else if (project) { 28069 var _project$primaryLangu; 28070 for (const supportedLanguage of project.supportedLanguages || []) { 28071 locales[supportedLanguage] = {}; 28072 supportedLanguages.push(supportedLanguage); 28073 } 28074 // Set primary language from project if we have it 28075 primaryLanguage = (_project$primaryLangu = project.primaryLanguage) != null ? _project$primaryLangu : primaryLanguage; 28076 } 28077 } 28078 if (Object.keys(locales).length === 0) { 28079 // Ensure at least the primary language is included 28080 locales[payload.primaryLanguage] = {}; 28081 supportedLanguages.push(payload.primaryLanguage); 28082 } 28083 28084 // Only commit if we have locales to set or we will end up in an infinite loop 28085 if (Object.keys(locales).length) yield (0,redux_saga_effects_esm/* put */.yJ)(slice_C6JLQik8.a.SET_LOCALES({ 28086 ...payload, 28087 primaryLanguage, 28088 supportedLanguages, 28089 locales 28090 })); 28091} 28092 28093/** 28094 * Run a Delivery API query to get the uri for the chosen language variation of this entryId 28095 * */ 28096function* getEntryUriForLanguage({ 28097 entryId, 28098 language 28099}) { 28100 try { 28101 const versionStatus = yield (0,redux_saga_effects_esm/* select */.Lt)(version_hQnuV0n7.b); 28102 const query = new lib.Query(lib.Op.equalTo('sys.id', entryId), lib.Op.equalTo('sys.language', language), lib.Op.equalTo('sys.versionStatus', versionStatus)); 28103 query.fields = ['sys.uri']; 28104 query.pageSize = 1; 28105 const result = yield ContensisDeliveryApi_Czq1gBOi.c.search(query); 28106 return result.items.length ? result.items[0].sys.uri : null; 28107 } catch (error) { 28108 console.error('Error fetching language variations:', error); 28109 yield (0,redux_saga_effects_esm/* put */.yJ)(slice_C6JLQik8.a.GET_ENTRY_URI_ERROR(error)); 28110 } 28111} 28112 28113const sys = { 28114 versionStatus: 'sys.versionStatus' 28115}; 28116const Fields = { 28117 sys}; 28118 28119const fieldExpression = (field, value, operator = 'equalTo', weight = null) => { 28120 if (!field || !value) return []; 28121 if (Array.isArray(value)) return equalToOrIn(field, value, operator);else return !weight ? [lib.Op[operator](field, value)] : [lib.Op[operator](field, value).weight(weight)]; 28122}; 28123const defaultExpressions = versionStatus => { 28124 return [lib.Op.equalTo(Fields.sys.versionStatus, versionStatus)]; 28125}; 28126const equalToOrIn = (field, arr, operator = 'equalTo') => arr.length === 0 ? [] : arr.length === 1 ? [lib.Op[operator](field, arr[0])] : [lib.Op.in(field, ...arr)]; 28127 28128const routeEntryByFieldsQuery = (id, language = 'en-GB', contentTypeId = '', fields = [], fieldLinkDepths, versionStatus = 'published') => { 28129 const query = new lib.Query(...[...fieldExpression('sys.id', id), ...fieldExpression('sys.language', language), ...(contentTypeId ? fieldExpression('sys.
28129contentTypeId', contentTypeId) : fieldExpression('sys.dataFormat', 'entry')), ...defaultExpressions(versionStatus)]); 28130 query.fields = fields; 28131 query.fieldLinkDepths = fieldLinkDepths; 28132 return query; 28133}; 28134 28135function* reduxInjectorSaga(injectorFn) { 28136 if (typeof injectorFn === 'function') { 28137 const { 28138 key, 28139 reducer, 28140 saga 28141 } = yield injectorFn(); 28142 (0,version_Cy_gb20a.a)({ 28143 key, 28144 reducer, 28145 saga 28146 }); 28147 } 28148} 28149 28150/** 28151 * @description Asynchronously load and inject assets related to Search 28152 */ 28153const importSearchAssets = () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 26280)); 28154 28155/** 28156 * Invokes the Search saga if: 28157 * - `searchOptions` is present on `staticRoute` or `contentTypeRoute` 28158 * - `searchOptions` is provided by the consumer app 28159 * - and path starts with one of `onPaths: ['/search']` 28160 * - or a `facet` or `listingType` is present in provided `searchOptions` 28161 * 28162 * A `config` is required if we want to inject the redux reducer here, sagas are injected automatically 28163 */ 28164function* handleSearchSaga({ 28165 location, 28166 params, 28167 routeSearchOptions, 28168 searchOptions, 28169 ssr 28170}) { 28171 // Merge supplied mappers with route-supplied mappers taking precedence 28172 const mappers = { 28173 results: e => e, 28174 ...((searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.mappers) || {}), 28175 ...((routeSearchOptions === null || routeSearchOptions === void 0 ? void 0 : routeSearchOptions.mappers) || {}) 28176 }; 28177 28178 // Merge all other search options with route-supplied options taking precedence 28179 const { 28180 onPaths = ['/search'], 28181 ...searchOpts 28182 } = { 28183 ...(routeSearchOptions || {}), 28184 ...(searchOptions || {}) 28185 }; 28186 28187 // Check do we meet conditions to run the search saga 28188 const invokeSearch = onPaths.find(p => location.pathname.startsWith(p)) || searchOpts.composition || searchOpts.facet || searchOpts.listingType; 28189 28190 // An empty routeSearchOptions object can be used to import assets and load config for a minilist 28191 const importAssets = routeSearchOptions; 28192 if (importAssets || invokeSearch) { 28193 // Async load search assets 28194 const { 28195 reducer, 28196 sagas, 28197 setRouteFilters 28198 } = yield importSearchAssets(); 28199 28200 // Inject search reducer and sagas 28201 yield (0,redux_saga_effects_esm/* call */.T1)(reduxInjectorSaga, async () => ({ 28202 key: 'search', 28203 reducer: searchOpts.config && reducer(searchOpts.config), 28204 saga: sagas 28205 })); 28206 if (invokeSearch) yield (0,redux_saga_effects_esm/* call */.T1)(setRouteFilters, { 28207 params, 28208 ssr, 28209 ...searchOpts, 28210 mappers 28211 }); 28212 } 28213} 28214 28215const error = (e, message) => logError(`[routeSaga]${message ? ` ${message}` : ''}`, e); 28216let livePreviewTask = null; 28217const routingSagas = [(0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.r, getRouteSaga), (0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.s, setRouteSaga)]; 28218 28219/** 28220 * To navigate / push a specific route via redux middleware 28221 * @param {path, state} action 28222 */ 28223function* setRouteSaga(action) { 28224 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28225 type: 'CALL_HISTORY_METHOD', 28226 payload: { 28227 method: 'push', 28228 args: [action.path, action.state] 28229 } 28230 }); 28231} 28232function* getRouteSaga(action) { 28233 let entry = null; 28234 try { 28235 var _staticRoute$route, _staticRoute$route2, _staticRoute$route3, _staticRoute$route4, _appsays, _appsays2, _appsays3, _appsays4, _pathNode3, _pathNode4, _pathNode5; 28236 const { 28237 withEvents, 28238 routes: { 28239 ContentTypeMappings = {} 28240 } = {}, 28241 staticRoute, 28242 // get api instance from ssr context that is connected to the specific request in ssr 28243 ssr: { 28244 api, 28245 subsitePath 28246 } 28247 } = action; 28248 28249 // Inject redux { key, reducer, saga } provided by staticRoute 28250 if (staticRoute && staticRoute.route.injectRedux) yield (0,redux_saga_effects_esm/* call */.T1)(reduxInjectorSaga, staticRoute.route.injectRedux); 28251 28252 // Variables we will pass to setRouteEntry 28253 let pathNode = null, 28254 ancestors = null, 28255 children = [], 28256 siblings = null;
28257 let contentTypeMapping = {}; 28258 28259 // These variables are the return values from 28260 // calls to withEvents.onRouteLoad and onRouteLoaded 28261 let appsays, 28262 requireLogin = false, 28263 searchOptions = false; 28264 28265 // Route parameters are used for driving search options and live preview functionality, 28266 // and are passed to the consuming app via withEvents hooks 28267 const params = (0,util_DHWbLSvO.h)(staticRoute, action.location); 28268 if (withEvents && withEvents.onRouteLoad) { 28269 appsays = yield withEvents.onRouteLoad(action); 28270 } 28271 28272 // We could improve this further with a reusable mapper 28273 // function to return these params given a static route 28274 // or matching a content type mapping we could call at various points 28275 // enabling us to mix and match and prioritise inputs if there are multiple 28276 let linkDepth = staticRoute === null || staticRoute === void 0 || (_staticRoute$route = staticRoute.route) === null || _staticRoute$route === void 0 || (_staticRoute$route = _staticRoute$route.fetchNode) === null || _staticRoute$route === void 0 ? void 0 : _staticRoute$route.linkDepth; 28277 let fields = staticRoute === null || staticRoute === void 0 || (_staticRoute$route2 = staticRoute.route) === null || _staticRoute$route2 === void 0 || (_staticRoute$route2 = _staticRoute$route2.fetchNode) === null || _staticRoute$route2 === void 0 ? void 0 : _staticRoute$route2.fields; 28278 let fieldLinkDepths = staticRoute === null || staticRoute === void 0 || (_staticRoute$route3 = staticRoute.route) === null || _staticRoute$route3 === void 0 || (_staticRoute$route3 = _staticRoute$route3.fetchNode) === null || _staticRoute$route3 === void 0 ? void 0 : _staticRoute$route3.fieldLinkDepths; 28279 let entryMapper = staticRoute === null || staticRoute === void 0 || (_staticRoute$route4 = staticRoute.route) === null || _staticRoute$route4 === void 0 || (_staticRoute$route4 = _staticRoute$route4.fetchNode) === null || _staticRoute$route4 === void 0 ? void 0 : _staticRoute$route4.entryMapper; 28280 28281 // TODO: drop this default fallback to 0 with CRBv5 as 2 is a legacy arbritary medium and encourages 28282 // routing optimisation to be ignored resulting in excessive API calls going unnoticed 28283 // Use of `linkDepth` should be avoided in favour of `fieldLinkDepths` with newer Contensis versions 28284 const defaultLinkDepth = ((_appsays = appsays) === null || _appsays === void 0 ? void 0 : _appsays.entryLinkDepth) !== undefined ? appsays.entryLinkDepth : 2; 28285 const defaultFieldLinkDepths = (_appsays2 = appsays) === null || _appsays2 === void 0 ? void 0 : _appsays2.entryFieldLinkDepths; 28286 const setStaticRouteLimits = typeof linkDepth !== 'undefined' || fields || fieldLinkDepths; 28287 const setContentTypeLimits = !!ContentTypeMappings.find(ct => ct.fields || ct.linkDepth || ct.nodeOptions || ct.fieldLinkDepths); 28288 28289 // Limits set in a static route take priority over limits in a content type mapping 28290 // If we have limits set in: 28291 // - a matched static route - set them here to resolve everything with the initial node upfront 28292 // - any content type mapping - we set defaults for the initial node resolve then 28293 // - identify the contentTypeId and locate the content type mapping 28294 // - perform a second search query with the limits applied from the content type mapping 28295 // If no limits are set in route configuration: 28296 // - fall back to entryLinkDepth and entryFieldLinkDepths provided by the app in `onRouteLoad` event 28297 // - or default to entryLinkDepth of 2 with all fields (default for legacy `/preview` endpoints) 28298 fields = setStaticRouteLimits ? fields || '*' : setContentTypeLimits ? ['sys.contentTypeId', 'sys.id'] : '*'; 28299 linkDepth = setStaticRouteLimits && typeof linkDepth !== 'undefined' ? linkDepth : setContentTypeLimits ? 0 : defaultLinkDepth; 28300 fieldLinkDepths = setStaticRouteLimits ? fieldLinkDepths : setContentTypeLimits ? undefined : defaultFieldLinkDepths; 28301 const state = yield (0,redux_saga_effects_esm/* select */.Lt)(); 28302 const routeEntry = (0,selectors_Dj45vPZR.O)(state, 'js'); 28303 const routeNode = (0,selectors_Dj45vPZR.G)(state, 'js'); 28304 const currentPath = action.path; //selectCurrentPath(state); 28305 const contentPath = action.contentPath; 28306 const deliveryApiStatus = (0,version_hQnuV0n7.b)(state); 28307 const project = (0,selectors_Dj45vPZR.I)(state); 28308 // const isHome = currentPath === '/'; 28309 const isPreview = currentPath && currentPath.startsWith('/preview/'); 28310 const currentLanguage = (0,selectors_D4ulaTom.s)(state); 28311 const defaultLang = appsays && appsays.defaultLang || currentLanguage || 'en-GB'; 28312 if (!isPreview && ((_appsays3 = appsays) !== null && _appsays3 !== void 0 && _appsays3.customRouting || staticRoute && !staticRoute.route.fetchNode || routeEntry && action.statePath === action.path && ((_appsays4 = appsays) === null || _appsays4 === void 0 ? void 0 : _appsays4.refetchNode) !== true)) { 28313 var _staticRoute$route5; 28314 // To prevent erroneous 404s and wasted network calls, this covers 28315 // - appsays customRouting and does SET_ENTRY etc. via the consuming app 28316 // - all staticRoutes (where custom 'route.fetchNode' attribute is falsey) 28317 // - standard Contensis SiteView Routing where we already have that entry in state 28318 if (routeEntry && (!staticRoute || staticRoute !== null && staticRoute !== void 0 && (_staticRoute$route5 = staticRoute.route) !== null && _staticRoute$route5 !== void 0 && _staticRoute$route5.fetchNode)) { 28319 pathNode = { 28320 ...routeNode, 28321 entry: null 28322 }; 28323 pathNode.entry = entry = routeEntry; 28324 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28325 type: selectors_Dj45vPZR.U, 28326 isLoading: false 28327 }); 28328 if (params.livePreview && typeof window !== 'undefined') {
28329 var _contentTypeMapping, _contentTypeMapping2, _contentTypeMapping3; 28330 // Update the "limits" (fields, fieldLinkDepths and linkDepth) 28331 // used in route resolution (likely SSR) based on the entry's content type mapping 28332 // so that we can pass the correct limits to live preview parent 28333 contentTypeMapping = findContentTypeMapping(ContentTypeMappings, entry.sys.contentTypeId); 28334 // Static route limits override content type mapping limits 28335 fields = setStaticRouteLimits ? fields || '*' : ((_contentTypeMapping = contentTypeMapping) === null || _contentTypeMapping === void 0 ? void 0 : _contentTypeMapping.fields) || fields; 28336 linkDepth = setStaticRouteLimits ? linkDepth || 0 : typeof ((_contentTypeMapping2 = contentTypeMapping) === null || _contentTypeMapping2 === void 0 ? void 0 : _contentTypeMapping2.linkDepth) !== 'undefined' ? contentTypeMapping.linkDepth : linkDepth; 28337 fieldLinkDepths = setStaticRouteLimits ? fieldLinkDepths : ((_contentTypeMapping3 = contentTypeMapping) === null || _contentTypeMapping3 === void 0 ? void 0 : _contentTypeMapping3.fieldLinkDepths) || fieldLinkDepths; 28338 } 28339 } else yield (0,redux_saga_effects_esm/* call */.T1)(setRouteEntry, currentPath, routeEntry, yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.G), yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.F), yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.K)); 28340 } else { 28341 var _staticRoute$route6; 28342 // Handle preview routes (legacy - can we remove?) 28343 if (isPreview) { 28344 let splitPath = currentPath.split('/'); 28345 let entryGuid = splitPath[2]; 28346 let language = defaultLang; 28347 if (splitPath.length >= 3) { 28348 //set lang key if available in the path, else use default lang 28349 //assumes preview url on content type is: http://preview.ALIAS.contensis.cloud/preview/{GUID}/{LANG} 28350 if (splitPath.length == 4) language = splitPath[3]; 28351 // According to product dev we cannot use Node API 28352 // for previewing entries as it gives a response of [] 28353 // -- apparently it is not correct to request latest content 28354 // with Node API 28355 let previewEntry = yield api.getClient(deliveryApiStatus, project).entries.get({ 28356 id: entryGuid, 28357 language, 28358 linkDepth: defaultLinkDepth 28359 }); 28360 if (previewEntry) { 28361 pathNode = { 28362 entry: previewEntry 28363 }; 28364 ({ 28365 entry 28366 } = pathNode || {}); 28367 } 28368 } 28369 } else { 28370 var _pathNode, _pathNode2; 28371 // Handle all other routes 28372 let nodeError = undefined; 28373 // Resolve a stub of route node if we are setting limits in content type mappings 28374 // Resolve the complete entry with the node if we are setting limits in a static route 28375 [nodeError, pathNode] = yield await_to_js_es5(api.getNode({ 28376 depth: 0, 28377 path: contentPath, 28378 entryFields: fields, 28379 entryLinkDepth: linkDepth, 28380 entryFieldLinkDepths: fieldLinkDepths, 28381 // language parameter is not used when resolving a node by path 28382 // https://www.contensis.com/help-and-docs/apis/delivery-http/navigation/nodes/get-a-node-by-path 28383 // language: defaultLang, 28384 versionStatus: deliveryApiStatus 28385 }, project)); 28386 if (nodeError) { 28387 if ([401, 403].includes(nodeError.status)) { 28388 // Capture specific auth errors with the delivery api 28389 // and fire the user down the handleRequiresLoginSaga 28390 // If auth was successful via a refreshToken we need to reload the page 28391 // to run this getRouteSaga again with the security token cookie 28392 const userLoggedIn = yield (0,redux_saga_effects_esm/* call */.T1)(handleRequiresLoginSaga, { 28393 ...action, 28394 requireLogin: true 28395 }); 28396 if (userLoggedIn && nodeError.status === 401) { 28397 // Reload the route so we can re-run the routing request now the 28398 // authentication cookies are written 28399 return yield (0,redux_saga_effects_esm/* call */.T1)(setRouteSaga, { 28400 path: currentPath 28401 }); 28402 } else if (userLoggedIn && nodeError.status === 403) { 28403 return yield (0,redux_saga_effects_esm/* call */.T1)(setRouteSaga, { 28404 path: LoginHelper.GetAccessDeniedRoute(currentPath) 28405 }); 28406 } else { 28407 return yield (0,redux_saga_effects_esm/* call */.T1)(do500, nodeError); 28408 } 28409 } else throw nodeError; 28410 } else ({ 28411 entry 28412 } = pathNode || {}); 28413 28414 // Try resolve a content type mapping 28415 if ((_pathNode = pathNode) !== null && _pathNode !== void 0 && (_pathNode = _pathNode.entry) !== null && _pathNode !== void 0 && (_pathNode = _pathNode.sys) !== null && _pathNode !== void 0 && _pathNode.id && pathNode.entry.sys.contentTypeId) { 28416 // Get fields[] and linkDepth from ContentTypeMapping to get the entry data 28417 // and current node's ordinates at a specified depth with specified fields 28418 contentTypeMapping = findContentTypeMapping(ContentTypeMappings, pathNode.entry.sys.contentTypeId); 28419 } 28420 28421 // Run a second search query if we aren't setting limits from a static route 28422 // but we are setting limits from a content type mapping, now we have a handle 28423 // on a contentTypeId from the resolve node, we can apply the right limits when 28424 // fetching the entry 28425 if (!setStaticRouteLimits && setContentTypeLimits && (_pathNode2 = pathNode) !== null && _pathNode2 !== void 0 && (_pathNode2 = _pathNode2.entry) !== null && _pathNode2 !== void 0 && (_pathNode2 = _pathNode2.sys) !== null && _pathNode2 !== void 0 && _pathNode2.id) { 28426 var _payload$items; 28427 // Now we have a handle on a content type mapping we can 28428 // reassign the query limiting variables if we haven't 28429 // already set them in a static route 28430 if (!setStaticRouteLimits) ({ 28431 fieldLinkDepths, 28432 fields, 28433 linkDepth = defaultLinkDepth 28434 } = contentTypeMapping || {}); 28435 const query = routeEntryByFieldsQuery(pathNode.entry.sys.id, pathNode.entry.sys.language, pathNode.entry.sys.contentTypeId, fields, fieldLinkDepths, deliveryApiStatus); 28436 const payload = yield api.search(query, linkDepth, project); 28437 if ((payload === null || payload === void 0 || (_payload$items = payload.items) === null || _payload$items === void 0 ? void 0 : _payload$items.length) > 0) { 28438 pathNode.entry = entry = payload.items[0]; 28439 } 28440 } 28441 } 28442 28443 // make calls to fetch node ancestors, children, 28444 // siblings or entire node tree 28445 [ancestors, children, siblings] = yield (0,redux_saga_effects_esm/* call */.T1)(resolveCurrentNodeOrdinates, { 28446 api, 28447 appsays, 28448 contentTypeMapping: contentTypeMapping || (staticRoute === null || staticRoute === void 0 || (_staticRoute$route6 = staticRoute.route) === null || _staticRoute$route6 === void 0 ? void 0 : _staticRoute$route6.fetchNode) || {}, 28449 language: defaultLang, 28450 path: contentPath, 28451 pathNode, 28452 project, 28453 subsitePath, 28454 versionStatus: deliveryApiStatus 28455 }); 28456 if (children) pathNode.children = children; 28457 } 28458 28459 // We initially listened for SET_ENTRY to complete before 28460 // resolving the current route language, but this meant 28461 // that the language change was not captured in time for the SSR response 28462 yield (0,redux_saga_effects_esm/* call */.T1)(resolveCurrentRouteLanguage, { 28463 entry: (_pathNode3 = pathNode) === null || _pathNode3 === void 0 ? void 0 : _pathNode3.entry, 28464 node: pathNode 28465 }); 28466 const contentTypeRoute = findContentTypeMapping(ContentTypeMappings, (_pathNode4 = pathNode) === null || _pathNode4 === void 0 || (_pathNode4 = _pathNode4.entry) === null || _pathNode4 === void 0 || (_pathNode4 = _pathNode4.sys) === null || _pathNode4 === void 0 ? void 0 : _pathNode4.contentTypeId); 28467 28468 // Inject redux { key, reducer, saga } provided by ContentTypeMapping 28469 if (contentTypeRoute !== null && contentTypeRoute !== void 0 && contentTypeRoute.injectRedux) yield (0,redux_saga_effects_esm/* call */.T1)(reduxInjectorSaga, contentTypeRoute.injectRedux); 28470 28471 // Have we defined search options in the route configuration (for triggering search) 28472 const routeSearchOptions = getSearchOptions(staticRoute, contentTypeRoute); 28473 if (withEvents && withEvents.onRouteLoaded) { 28474 // Check if the app has provided a requireLogin boolean flag or groups array 28475 // in addition to checking if requireLogin is set in the route definition 28476 // The app can provide an object to invoke the search saga 28477 ({ 28478 requireLogin, 28479 searchOptions 28480 } = (yield withEvents.onRouteLoaded({ 28481 ...action, 28482 contentTypeRoute, 28483 entry, 28484 params, 28485 searchOptions: routeSearchOptions 28486 })) || {}); 28487 } 28488 if (requireLogin !== false) {
28489 // Do not call the login feature saga if requireLogin is false 28490 yield (0,redux_saga_effects_esm/* call */.T1)(handleRequiresLoginSaga, { 28491 ...action, 28492 entry, 28493 requireLogin 28494 }); 28495 } 28496 if (searchOptions || routeSearchOptions) yield (0,redux_saga_effects_esm/* call */.T1)(handleSearchSaga, { 28497 ...action, 28498 params, 28499 routeSearchOptions, 28500 searchOptions 28501 }); 28502 if (!appsays || !appsays.preventScrollTop) { 28503 // Scroll into View 28504 if (typeof window !== 'undefined') window.scrollTo(0, 0); 28505 } 28506 if ((_pathNode5 = pathNode) !== null && _pathNode5 !== void 0 && (_pathNode5 = _pathNode5.entry) !== null && _pathNode5 !== void 0 && (_pathNode5 = _pathNode5.sys) !== null && _pathNode5 !== void 0 && _pathNode5.id) { 28507 var _appsays5; 28508 entryMapper = entryMapper || (contentTypeRoute === null || contentTypeRoute === void 0 ? void 0 : contentTypeRoute.entryMapper); 28509 if (params.livePreview && typeof window !== 'undefined') { 28510 if (livePreviewTask) yield (0,redux_saga_effects_esm/* cancel */.ZT)(livePreviewTask); 28511 livePreviewTask = yield (0,redux_saga_effects_esm/* fork */.Zy)(watchLivePreviewSaga, { 28512 currentPath, 28513 entry, 28514 entryMapper, 28515 pathNode, 28516 limits: { 28517 fields, 28518 fieldLinkDepths, 28519 linkDepth 28520 } 28521 }); 28522 } 28523 entry = pathNode.entry; 28524 yield (0,redux_saga_effects_esm/* call */.T1)(setRouteEntry, currentPath, entry, pathNode, ancestors, siblings, entryMapper, false, (_appsays5 = appsays) === null || _appsays5 === void 0 ? void 0 : _appsays5.refetchNode); 28525 } else { 28526 if (staticRoute) yield (0,redux_saga_effects_esm/* call */.T1)(setRouteEntry, currentPath, null, pathNode, ancestors, siblings);else yield (0,redux_saga_effects_esm/* call */.T1)(do404); 28527 } 28528 } catch (e) { 28529 error(e); 28530 yield (0,redux_saga_effects_esm/* call */.T1)(do500, e); 28531 } 28532} 28533function createLivePreviewChannel() { 28534 return (0,redux_saga_core_npm_proxy_esm/* eventChannel */.Od)(emit => { 28535 const handler = e => { 28536 var _e$data; 28537 // console.log('Received message in live preview channel', e.data); 28538 if ((_e$data = e.data) !== null && _e$data !== void 0 && (_e$data = _e$data.type) !== null && _e$data !== void 0 && _e$data.startsWith('LIVE_ENTRY_')) emit(e.data); 28539 }; 28540 window.addEventListener('message', handler); 28541 return () => window.removeEventListener('message', handler); 28542 }); 28543} 28544function* watchLivePreviewSaga(context) { 28545 var _parent; 28546 const channel = createLivePreviewChannel(); 28547 const routeLoadOptions = { 28548 type: 'LIVE_ENTRY_ROUTE_LOAD_OPTIONS', 28549 payload: context.limits 28550 }; 28551 if ((0,util_DHWbLSvO.h)().debug) routeLoadOptions.debug = context.pathNode; 28552 (_parent = parent) === null || _parent === void 0 || _parent.postMessage(routeLoadOptions, '*'); 28553 try { 28554 while (true) { 28555 const data = yield (0,redux_saga_effects_esm/* take */.s)(channel); 28556 let entry = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.O); 28557 if (data.type === 'LIVE_ENTRY_RESET') { 28558 console.log('Resetting live preview entry to original route entry'); 28559 entry = context.entry; 28560 } else if (data.type === 'LIVE_ENTRY_UPDATE') { 28561 console.log('Handling live preview update', data); 28562 entry = { 28563 ...entry, 28564 ...data.payload 28565 }; 28566 } 28567 yield (0,redux_saga_effects_esm/* call */.T1)(setRouteEntry, context.currentPath, entry, context.pathNode, null, 28568 // ancestors unchanged 28569 null, 28570 // siblings unchanged 28571 context.entryMapper, false, true // we need to remap the entry here 28572 ); 28573 } 28574 } finally { 28575 if (yield (0,redux_saga_effects_esm/* cancelled */.KW)()) channel.close(); 28576 } 28577} 28578function* resolveCurrentNodeOrdinates(action) { 28579 const { 28580 api, 28581 appsays, 28582 contentTypeMapping, 28583 language, 28584 path, 28585 pathNode, 28586 project, 28587 subsitePath, 28588 versionStatus 28589 } = action; 28590 const apiCall = [() => null, () => null, () => null, () => null]; 28591 28592 // if appsays customNavigation: true, we will set doNavigation to fal
28592se 28593 // if appsays customNavigation: { ... }, we will set doNavigation to the customNavigation object and check for child elements 28594 // if appsays nothing we will set doNavigation to true and continue to do navigation calls 28595 const doNavigation = !appsays || ((appsays === null || appsays === void 0 ? void 0 : appsays.customNavigation) === true ? false : (appsays === null || appsays === void 0 ? void 0 : appsays.customNavigation) || true); 28596 const { 28597 entryLinkDepth = 0, 28598 fieldLinkDepths, 28599 fields, 28600 linkDepth, 28601 nodeOptions = {} 28602 } = contentTypeMapping; 28603 if (pathNode && pathNode.id) { 28604 if (doNavigation === true || doNavigation.ancestors) { 28605 apiCall[0] = function* getAncestors() { 28606 try { 28607 return yield api.getAncestors({ 28608 id: pathNode.id, 28609 language, 28610 versionStatus, 28611 startLevel: (subsitePath || '').split('/').length 28612 }, project); 28613 } catch (ex) { 28614 error(ex, 'Problem fetching ancestors'); 28615 return []; 28616 } 28617 }; 28618 } 28619 const childrenDepth = doNavigation === true || doNavigation.children === true ? 1 : doNavigation && doNavigation.children || 0; 28620 if (typeof (nodeOptions === null || nodeOptions === void 0 ? void 0 : nodeOptions.children) === 'undefined' && childrenDepth > 0 || nodeOptions.children) { 28621 const childrenOptions = !nodeOptions.children || typeof nodeOptions.children === 'boolean' ? {} : nodeOptions.children; 28622 apiCall[1] = function* getChildren() { 28623 try { 28624 return yield api.getNode({ 28625 depth: childrenOptions.depth !== undefined ? childrenOptions.depth : childrenDepth, 28626 path, 28627 entryFieldLinkDepths: childrenOptions.fieldLinkDepths || fieldLinkDepths, 28628 entryFields: childrenOptions.fields || fields || undefined, 28629 entryLinkDepth: typeof childrenOptions.linkDepth !== 'undefined' ? childrenOptions.linkDepth : typeof linkDepth !== 'undefined' ? linkDepth : entryLinkDepth, 28630 language, 28631 versionStatus 28632 }, project); 28633 } catch (ex) { 28634 error(ex, 'Problem fetching children'); 28635 return []; 28636 } 28637 }; 28638 } 28639 if (typeof (nodeOptions === null || nodeOptions === void 0 ? void 0 : nodeOptions.siblings) === 'undefined' && doNavigation.siblings || nodeOptions.siblings) { 28640 apiCall[2] = function* getSiblings() { 28641 try { 28642 var _nodeOptions$siblings, _nodeOptions$siblings2, _nodeOptions$siblings3; 28643 return yield api.getSiblings({ 28644 id: pathNode.id, 28645 entryFieldLinkDepths: (nodeOptions === null || nodeOptions === void 0 || (_nodeOptions$siblings = nodeOptions.siblings) === null || _nodeOptions$siblings === void 0 ? void 0 : _nodeOptions$siblings.fieldLinkDepths) || fieldLinkDepths, 28646 entryFields: (nodeOptions === null || nodeOptions === void 0 || (_nodeOptions$siblings2 = nodeOptions.siblings) === null || _nodeOptions$siblings2 === void 0 ? void 0 : _nodeOptions$siblings2.fields) || fields || undefined, 28647 entryLinkDepth: typeof (nodeOptions === null || nodeOptions === void 0 || (_nodeOptions$siblings3 = nodeOptions.siblings) === null || _nodeOptions$siblings3 === void 0 ? void 0 : _nodeOptions$siblings3.linkDepth) !== 'undefined' ? nodeOptions.siblings.linkDepth : typeof linkDepth !== 'undefined' ? linkDepth : entryLinkDepth, 28648 includeInMenu: true, 28649 language, 28650 versionStatus 28651 }, project); 28652 } catch (ex) { 28653 error(ex, 'Problem fetching siblings'); 28654 return []; 28655 } 28656 }; 28657 } 28658 } 28659 const isTreeLoaded = yield (0,redux_saga_effects_esm/* select */.Lt)(version_Cy_gb20a.h); 28660 if (!isTreeLoaded && (doNavigation === true || doNavigation.tree)) apiCall[3] = function* getNodeTree() { 28661 const treeDepth = doNavigation === true || !doNavigation.tree || doNavigation.tree === true ? 2 : doNavigation.tree; 28662 if (typeof window !== 'undefined') { 28663 return yield (0,redux_saga_effects_esm/* put */.yJ)({ 28664 type: store_Cxe7mlLh.G, 28665 ...action, 28666 treeDepth 28667 }); 28668 } else { 28669 return yield (0,redux_saga_effects_esm/* call */.T1)(ensureNodeTreeSaga, { 28670 ...action, 28671 treeDepth 28672 }); 28673 } 28674 }; 28675 const [loadAncestors, loadChildren, loadSiblings, loadTree] = apiCall; 28676 const [ancestors, nodeWithChildren, siblings] = yield (0,redux_saga_effects_esm/* all */.Q7)([loadAncestors(), loadChildren(), loadSiblings(), loadTree()]); 28677 return [ancestors, nodeWithChildren === null || nodeWithChildren === void 0 ? void 0 : nodeWithChildren.children, siblings]; 28678} 28679function* setRouteEntry(currentPath, entry, node, ancestors, siblings, entryMapper, notFound = false, remapEntry = false) { 28680 const entrySys = entry && entry.sys || {}; 28681 28682 // Update a window global to provide the preview toolbar 28683 // an updated entry id in client-side navigation 28684 if (typeof window !== 'undefined') window.ContensisEntryId = entrySys.id; 28685 const currentEntryId = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.T); 28686 const currentEntryLang = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.X); 28687 const mappedEntry = !entryMapper ? null : currentEntryId === entrySys.id && currentEntryLang === entrySys.language && remapEntry === false ? (yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.N, 'js')) || {} : yield mapRouteEntry(entryMapper, { 28688 ...node, 28689 entry, 28690 ancestors, 28691 siblings 28692 }); 28693 yield (0,redux_saga_effects_esm/* all */.Q7)([(0,redux_saga_effects_esm/* put */.yJ)({ 28694 type: selectors_Dj45vPZR.q, 28695 id: entrySys.id, 28696 currentPath, 28697 entry, 28698 mappedEntry, 28699 node, 28700 notFound 28701 }), ancestors && (0,redux_saga_effects_esm/* put */.yJ)({ 28702 type: selectors_Dj45vPZR.S, 28703 ancestors 28704 }), siblings && (0,redux_saga_effects_esm/* put */.yJ)({ 28705 type: selectors_Dj45vPZR.t, 28706 siblings 28707 })]); 28708} 28709function* mapRouteEntry(entryMapper, node) { 28710 try { 28711 if (typeof entryMapper === 'function') { 28712 const state = yield (0,redux_saga_effects_esm/* select */.Lt)(); 28713 const mappedEntry = yield (0,redux_saga_effects_esm/* call */.T1)(entryMapper, node, state); 28714 return mappedEntry; 28715 } 28716 } catch (e) { 28717 error(e, 'Error in entryMapper:'); 28718 throw e; 28719 } 28720 return; 28721} 28722function* do404() { 28723 yield (0,redux_saga_effects_esm/* call */.T1)(clientReloadHitServer); 28724 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28725 type: selectors_Dj45vPZR.q, 28726 id: null, 28727 entry: null, 28728 notFound: true 28729 }); 28730} 28731function* clientReloadHitServer() { 28732 const stateEntry = yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.O); 28733 28734 // If in client and there is a stateEntry.sys field reload the page, 28735 // on the 2nd load stateEntry.sys should be null at this point, 28736 // we do not wish to reload again and get stuck in an infinite reloading loop 28737 if (typeof window !== 'undefined' && (stateEntry !== null && stateEntry !== void 0 && stateEntry.sys || null)) { 28738 window.location.reload(); 28739 } 28740} 28741function* do500(error) { 28742 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28743 type: selectors_Dj45vPZR.q, 28744 id: null, 28745 entry: null, 28746 notFound: true, 28747 isError: true, 28748 error, 28749 statusCode: error && error.status ? error.status : 500 28750 }); 28751} 28752 28753const registerSagas = [(0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.R, registerSaga), (0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.f, redirectSaga)]; 28754function* registerSaga({ 28755 user, 28756 mappers 28757}) { 28758 let requestBody = user; 28759 // Allow use of request mapper to take a user object 28760 // of any format and return the payload for the api request 28761 if (mappers && mappers.request && typeof mappers.request === 'function') { 28762 requestBody = yield mappers.request(user); 28763 } 28764 28765 // Make POST call to register API 28766 const response = yield fetch('/account/register', { 28767 method: 'POST', 28768 headers: { 28769 Accept: 'application/json', 28770 'Content-Type': 'application/json' 28771 }, 28772 body: JSON.stringify(requestBody) 28773 }); 28774 if (response.ok) { 28775 let mappedResponse; 28776 const [, responseBody] = yield to(response.json()); 28777 if (responseBody) { 28778 // Allow use of response mapper to convert the successful user object 28779 // from the api response body into a user object of any format 28780 if (mappers && mappers.response && typeof mappers.response === 'function') { 28781 mappedResponse = yield mappers.response(responseBody); 28782 } 28783 // Update user object with mappedResponse or responseBody 28784 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28785 type: selectors_Dj45vPZR.f, 28786 user: mappedResponse || responseBody 28787 }); 28788 } else { 28789 // OK response but unable to parse the response body 28790 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28791 type: selectors_Dj45vPZR.e, 28792 error: { 28793 message: 'Unable to parse the created user from the register service response' 28794 } 28795 }); 28796 } 28797 } else { 28798 // Not OK responses, these can be due to service availability 28799 // or status codes echoed from the responses received from 28800 // management api when registering the user 28801 const [, errorResponse] = yield to(response.json()); 28802 const error = errorResponse && errorResponse.error || errorResponse || {}; 28803 // Get something meaningful from the response if there is no message in the body 28804 if (!error.message) { 28805 error.message = `Registration service: ${response.statusText}`; 28806 error.status = response.status; 28807 } 28808 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28809 type: selectors_Dj45vPZR.e, 28810 error 28811 }); 28812 } 28813} 28814function* redirectSaga() { 28815 // Check if querystring contains a redirect_uri 28816 const currentQs = (0,selectors_Dj45vPZR.A)(yield (0,redux_saga_effects_esm/* select */.Lt)(selectors_Dj45vPZR.J)); 28817 const redirectUri = currentQs.redirect_uri || currentQs.redirect; 28818 28819 // We must use redux based navigation to preserve the registration state 28820 if (redirectUri) yield (0,redux_saga_effects_esm/* put */.yJ)((0,selectors_Dj45vPZR.a6)(redirectUri)); 28821} 28822
28823const PAP_URL = 'https://pap.zengenti.com'; 28824const USER_ENVS_URI = 'my-environments'; 28825const USER_RESEND_VERIFICATION_URI = 'account/verify/resend'; 28826const USER_REQUEST_PASSWORD_RESET_URI = 'account/reset'; 28827const USER_RESET_PASSWORD_URI = 'account/reset/password'; 28828const USER_ENVS_URL = `${PAP_URL}/${USER_ENVS_URI}`; 28829const BASE_OPTIONS = { 28830 method: 'GET', 28831 headers: { 28832 'Content-Type': 'application/json' 28833 } 28834}; 28835class UserHelper { 28836 static async GetUsersEnvironments(securityToken) { 28837 const options = { 28838 ...BASE_OPTIONS, 28839 headers: { 28840 'x-security-token': securityToken 28841 } 28842 }; 28843 return await UserHelper.get(USER_ENVS_URL, options); 28844 } 28845 static async ResendUserVerification(userEmail) { 28846 const options = { 28847 ...BASE_OPTIONS 28848 }; 28849 return await UserHelper.get(`/${USER_RESEND_VERIFICATION_URI}?user=${userEmail}`, options); 28850 } 28851 static async RequestPasswordReset(userEmailObject) { 28852 const options = { 28853 ...BASE_OPTIONS, 28854 body: JSON.stringify(userEmailObject) 28855 }; 28856 options.method = 'POST'; 28857 return await UserHelper.get(`/${USER_REQUEST_PASSWORD_RESET_URI}`, options); 28858 } 28859 static async ResetPassword(resetPasswordObject) { 28860 const options = { 28861 ...BASE_OPTIONS, 28862 body: JSON.stringify(resetPasswordObject) 28863 }; 28864 options.method = 'POST'; 28865 return await UserHelper.get(`/${USER_RESET_PASSWORD_URI}`, options); 28866 } 28867 static async get(url, options = BASE_OPTIONS) { 28868 try { 28869 const responseBody = await api(url, options); 28870 return responseBody; 28871 } catch (err) { 28872 return { 28873 error: { 28874 message: err.message 28875 } 28876 }; 28877 } 28878 } 28879} 28880async function api(url, options) { 28881 return fetch(url, options).then(async response => { 28882 return response.json().then(data => data); 28883 }).catch(error => { 28884 throw error; 28885 }); 28886} 28887 28888const resetPasswordSagas = [(0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.g, requestPasswordResetSaga), (0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.k, resetPasswordSaga), (0,redux_saga_effects_esm/* takeEvery */.jP)(selectors_Dj45vPZR.C, changePasswordSaga)]; 28889function* requestPasswordResetSaga(action) { 28890 const userEmailObject = action.userEmailObject; 28891 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28892 type: selectors_Dj45vPZR.i 28893 }); 28894 if (userEmailObject && userEmailObject.userEmail) { 28895 try { 28896 const passwordResetRequestResponse = yield UserHelper.RequestPasswordReset(userEmailObject); 28897 if (passwordResetRequestResponse) { 28898 if (!passwordResetRequestResponse.error) { 28899 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28900 type: selectors_Dj45vPZR.j 28901 }); 28902 } else { 28903 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28904 type: selectors_Dj45vPZR.h, 28905 error: passwordResetRequestResponse.error.message 28906 }); 28907 } 28908 } else { 28909 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28910 type: selectors_Dj45vPZR.h, 28911 error: 'No response from server' 28912 }); 28913 } 28914 } catch (error) { 28915 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28916 type: selectors_Dj45vPZR.h, 28917 error: error && error.toString() 28918 }); 28919 } 28920 } else { 28921 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28922 type: selectors_Dj45vPZR.h, 28923 error: 'Invalid object' 28924 }); 28925 } 28926} 28927function* resetPasswordSaga(action) { 28928 const resetPasswordObject = action.resetPasswordObject; 28929 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28930 type: selectors_Dj45vPZR.m 28931 }); 28932 if (resetPasswordObject.token && resetPasswordObject.password) { 28933 try { 28934 const resetPasswordResponse = yield UserHelper.ResetPassword(resetPasswordObject); 28935 if (resetPasswordResponse) { 28936 if (!resetPasswordResponse.error) { 28937 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28938 type: selectors_Dj45vPZR.n 28939 }); 28940 } else { 28941 const error = resetPasswordResponse.error.data && resetPasswordResponse.error.data.length > 0 && resetPasswordResponse.error.data[0].message || resetPasswordResponse.error.message; 28942 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28943 type: selectors_Dj45vPZR.l, 28944 error 28945 }); 28946 } 28947 } else { 28948 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28949 type: selectors_Dj45vPZR.l,
28950 error: 'No response from server' 28951 }); 28952 } 28953 } catch (error) { 28954 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28955 type: selectors_Dj45vPZR.l, 28956 error: error && error.toString() 28957 }); 28958 } 28959 } else { 28960 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28961 type: selectors_Dj45vPZR.l, 28962 error: 'Invalid object' 28963 }); 28964 } 28965} 28966 28967// userId 28968// existingPassword 28969// newPassword 28970function* changePasswordSaga(action) { 28971 if (!action || !action.userId || !action.currentPassword || !action.newPassword) { 28972 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28973 type: selectors_Dj45vPZR.a, 28974 error: 'Invalid action object sent to changePassword saga' 28975 }); 28976 return; 28977 } 28978 try { 28979 const changePasswordObject = { 28980 userId: action.userId, 28981 existing: action.currentPassword, 28982 new: action.newPassword 28983 }; 28984 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28985 type: selectors_Dj45vPZR.b 28986 }); 28987 const clientCredentials = yield (0,redux_saga_effects_esm/* select */.Lt)(matchGroups_C2_rxOIO.c, 'js'); 28988 const client = yield getManagementApiClient({ 28989 ...clientCredentials 28990 }); 28991 const [err, res] = yield to(client.security.users.updatePassword(changePasswordObject)); 28992 if (err) { 28993 var _err$data, _err$data2; 28994 const error = (err === null || err === void 0 || (_err$data = err.data) === null || _err$data === void 0 || (_err$data = _err$data.data) === null || _err$data === void 0 ? void 0 : _err$data.length) > 0 && err.data.data[0].message || (err === null || err === void 0 || (_err$data2 = err.data) === null || _err$data2 === void 0 ? void 0 : _err$data2.message); 28995 yield (0,redux_saga_effects_esm/* put */.yJ)({ 28996 type: selectors_Dj45vPZR.a, 28997 error 28998 }); 28999 return; 29000 } 29001 yield (0,redux_saga_effects_esm/* put */.yJ)({ 29002 type: selectors_Dj45vPZR.c 29003 }); 29004 } catch (error) { 29005 yield (0,redux_saga_effects_esm/* put */.yJ)({ 29006 type: selectors_Dj45vPZR.a, 29007 error: error && error.toString() 29008 }); 29009 } 29010} 29011 29012const userSagas = [...loginSagas, ...registerSagas, ...resetPasswordSagas]; 29013 29014var rootSaga = (featureSagas = []) => { 29015 return [...i18nSagas, ...routingSagas, ...navigationSagas, ...userSagas, ...featureSagas]; 29016}; 29017 29018// export default function (featureSagas: Effect[] = []) { 29019// return function* rootSaga() { 29020// const subSagas = [...routingSagas, ...navigationSagas, ...userSagas]; 29021// yield all([...subSagas, ...featureSagas]); 29022// }; 29023// } 29024 29025const App_DvfrUH4b_servers = SERVERS; /* global SERVERS */ 29026const alias = App_DvfrUH4b_servers.alias.toLowerCase(); 29027const publicUri = PUBLIC_URI; /* global PUBLIC_URI */ 29028const projects = PROJECTS; /* global PROJECTS */ 29029 29030// return a projectId via the request hostname 29031const pickProject = (hostname, query) => { 29032 // if localhost we can only infer via a querystring, and take your word for it 29033 if (hostname == 'localhost') { 29034 return query && query.p || projects[0].id; 29035 } 29036 29037 // if hostname is the actual public uri we can return the first project from the list 29038 if (hostname == publicUri) { 29039 return projects[0].id; 29040 } 29041 let project = 'unknown'; 29042 29043 // // go through all the defined projects 29044 // Object.entries(projects).map(([, p]) => { 29045 const p = projects[0]; 29046 29047 // check if we're accessing via the project's public uri 29048 if (hostname.includes(p.publicUri)) project = p.id; 29049 29050 // the url structure is different for website (we don't prefix) 29051 if (p.id.startsWith('website')) { 29052 // check for internal and external hostnames 29053 // we check live and preview distinctly so our rule does not clash with 29054 // hostnames that use a project prefix 29055 if (hostname.includes(`live-${alias}.cloud.contensis.com`) || hostname.includes(`live.${alias}.contensis.cloud`) || hostname.includes(`preview-${alias}.cloud.contensis.com`) || hostname.includes(`preview.${alias}.contensis.cloud`)) project = p.id; 29056 } else { 29057 // check for internal and external hostnames, prefixed with the projectId 29058 if (hostname.includes(`${p.id.toLowerCase()}-${alias}.cloud.contensis.com`) || hostname.includes(`${p.id.toLowerCase()}.${alias}.contensis.cloud`)) project = p.id; 29059 } 29060 // }); 29061 return project === 'unknown' ? p.id : project; 29062}; 29063 29064const AppRoot = props => { 29065 return /*#__PURE__*/React.createElement(RouteLoader, props); 29066}; 29067 29068
29069//# sourceMappingURL=App-DvfrUH4b.js.map 29070 29071// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/SSRContext-DqqZUlqT.js 29072var SSRContext_DqqZUlqT = __webpack_require__(2460); 29073// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/_commonjsHelpers-BFTU3MAI.js 29074var _commonjsHelpers_BFTU3MAI = __webpack_require__(90912); 29075;// ./node_modules/@zengenti/contensis-react-base/esm/client.js 29076 29077 29078 29079 29080 29081 29082 29083 29084 29085 29086 29087 29088 29089 29090 29091 29092 29093 29094 29095 29096 29097 29098 29099 29100 29101 29102 29103 29104 29105 29106 29107 29108 29109 29110 29111 29112 29113 29114 29115 29116 29117 29118 29119 29120 29121 29122 29123class ClientApp { 29124 constructor(ReactApp, config) { 29125 const documentRoot = document.getElementById('root'); 29126 const { 29127 i18n, 29128 // stateType = 'immutable', // changed default in v4 29129 stateType = 'js', 29130 routes, 29131 withReducers, 29132 withSagas, 29133 withEvents 29134 } = config; 29135 29136 // process locales in static routes for i18n 29137 const localeRoutes = createLocaleRoutes(routes); 29138 const GetClientJSX = store => { 29139 const ClientJsx = /*#__PURE__*/react.createElement(index_esm/* HelmetProvider */.vd, null, /*#__PURE__*/react.createElement(esm/* CookiesProvider */.vD, null, /*#__PURE__*/react.createElement(react_redux/* Provider */.Kq, { 29140 store: store 29141 }, /*#__PURE__*/react.createElement(dist/* unstable_HistoryRouter */.rI, { 29142 history: browserHistory, 29143 future: { 29144 v7_relativeSplatPath: true, 29145 v7_startTransition: true 29146 } 29147 }, /*#__PURE__*/react.createElement(SSRContext_DqqZUlqT.S, null, /*#__PURE__*/react.createElement(ReactApp, { 29148 routes: routes, 29149 withEvents: withEvents 29150 })))))); 29151 return ClientJsx; 29152 }; 29153 const isDev = "production" !== 'production'; 29154 // const isProduction = !isDev; 29155 const shouldHydrate = window.__USE_HYDRATE__ && !window.isDynamic; 29156 29157 /** 29158 * Webpack HMR Setup. 29159 */ 29160 const HMRRenderer = Component => { 29161 if (shouldHydrate) (0,loadable_esm/* loadableReady */.ai)(() => { 29162 (0,client/* hydrateRoot */.c)(documentRoot, Component, { 29163 onRecoverableError(error) { 29164 console.warn('Hydration warning:', error); 29165 } 29166 }); 29167 }, { 29168 namespace: 'modern' 29169 });else (0,client/* createRoot */.H)(documentRoot).render(Component); 29170 }; 29171 const hmr = store => { 29172 // webpack Hot Module Replacement API 29173 if (false) // removed by dead control flow 29174{} 29175 }; 29176 const qs = (0,query_string.parse)(window.location.search); 29177 const versionStatus = ContensisDeliveryApi_Czq1gBOi.d.getClientSideVersionStatus(); 29178 if (isDev || window.isDynamic || window.REDUX_DATA) { 29179 (0,store_Cxe7mlLh.d)(withReducers, window.REDUX_DATA, browserHistory, stateType).then(store => { 29180 const state = store.getState(); 29181 const ssrVersionStatus = (0,version_hQnuV0n7.b)(state); 29182 if (!ssrVersionStatus) store.dispatch((0,version_Cy_gb20a.c)(versionStatus)); 29183 if (isDev && window.REDUX_DATA) console.log('Hydrating from inline Redux'); 29184 store.runSaga(rootSaga(withSagas)); 29185 store.dispatch((0,selectors_Dj45vPZR.a4)(pickProject(window.location.hostname, qs), [], window.location.hostname)); 29186 if (i18n) { 29187 store.dispatch(slice_C6JLQik8.a.INIT_LOCALES({ 29188 locales: {}, 29189 // Keep a record of the locale routes in Redux 29190 // so we can navigate between them when switching language 29191 routes: localeRoutes, 29192 ...i18n 29193 })); 29194 } 29195 delete window.REDUX_DATA; 29196 HMRRenderer(GetClientJSX(store)); 29197 hmr(store); 29198 }); 29199 } else { 29200 fetch(`${window.location.pathname}?redux=true`).then(response => response.json()).then(data => { 29201 const ssRedux = JSON.parse(data); 29202 (0,store_Cxe7mlLh.d)(withReducers, ssRedux, browserHistory, stateType).then(store => { 29203 store.dispatch((0,version_Cy_gb20a.c)(versionStatus)); 29204 store.runSaga(rootSaga(withSagas)); 29205 store.dispatch((0,selectors_Dj45vPZR.a4)(pickProject(window.location.hostname, qs), [], window.location.hostname)); 29206 HMRRenderer(GetClientJSX(store)); 29207 hmr(store); 29208 }); 29209 }); 29210 } 29211 } 29212} 29213 29214 29215//# sourceMappingURL=client.js.map 29216 29217 29218/***/ }, 29219 29220/***/ 54293 29221(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 29222 29223"use strict"; 29224/* harmony export */ __webpack_require__.d(__webpack_exports__, { 29225/* harmony export */ a: () => (/* binding */ selectChangePasswordSending), 29226/* harmony export */ b: () => (/* binding */ selectChangePasswordSent), 29227/* harmony export */ c: () => (/* binding */ selectClientCredentials), 29228/* harmony export */ d: () => (/* binding */ selectPasswordResetRequestError), 29229/* harmony export */ e: () => (/* binding */ selectPasswordResetRequestSending), 29230/* harmony export */ f: () => (/* binding */ selectPasswordResetRequestSent), 29231/* harmony export */ g: () => (/* binding */ selectResetPasswordError), 29232/* harmony export */ h: () => (/* binding */ selectResetPasswordSending), 29233/* harmony export */ i: () => (/* binding */ selectResetPasswordSent), 29234/* harmony export */ j: () => (/* binding */ selectUser), 29235/* harmony export */ k: () => (/* binding */ selectUserErrorMessage),
29236/* harmony export */ l: () => (/* binding */ selectUserGroups), 29237/* harmony export */ m: () => (/* binding */ matchUserGroup), 29238/* harmony export */ n: () => (/* binding */ selectUserGuid), 29239/* harmony export */ o: () => (/* binding */ selectUserIsAuthenticated), 29240/* harmony export */ p: () => (/* binding */ selectUserIsAuthenticationError), 29241/* harmony export */ q: () => (/* binding */ selectUserIsError), 29242/* harmony export */ r: () => (/* binding */ selectUserIsLoading), 29243/* harmony export */ s: () => (/* binding */ selectChangePasswordError), 29244/* harmony export */ t: () => (/* binding */ selectUserRegistration), 29245/* harmony export */ u: () => (/* binding */ selectUserRegistrationError), 29246/* harmony export */ v: () => (/* binding */ selectUserRegistrationIsLoading), 29247/* harmony export */ w: () => (/* binding */ selectUserRegistrationIsSuccess) 29248/* harmony export */ }); 29249/* unused harmony export x */ 29250/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23790); 29251 29252 29253const selectUserIsLoading = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'authenticationState', 'isLoading']); 29254const selectUserIsAuthenticated = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'authenticationState', 'isAuthenticated']); 29255const selectUserIsAuthenticationError = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'authenticationState', 'isAuthenticationError']); 29256const selectUserIsError = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'authenticationState', 'isError']); 29257 29258/** 29259 * DEPRECATED 12/2021 - use selectUserErrorMessage instead 29260 * @param state AppState 29261 * @returns string 29262 */ 29263const selectUserAuthenticationErrorMessage = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'authenticationState', 'errorMessage']); 29264const selectUserErrorMessage = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'authenticationState', 'errorMessage']); 29265const selectClientCredentials = (state, returnType) => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'authenticationState', 'clientCredentials'], {}, returnType); 29266const selectUser = (state, returnType) => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, 'user', {}, returnType); 29267const selectUserIsZengentiStaff = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'isZengentiStaff']); 29268const selectUserGuid = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'id']); 29269const selectUsername = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'username']); 29270const selectUserEmail = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'email']); 29271const selectUserGroups = (state, returnType) => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'groups'], [], returnType); 29272const selectUserSecurityToken = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'authenticationState', 'clientCredentials', 'contensisClassicToken']); 29273const selectUserRegistration = (state, returnType) => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'registration'], {}, returnType); 29274const selectUserRegistrationError = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'registration', 'error'], false); 29275const selectUserRegistrationIsLoading = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'registration', 'isLoading'], false); 29276const selectUserRegistrationIsSuccess = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'registration', 'success'], false); 29277const selectPasswordResetRequestSending = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'passwordResetRequest', 'isSending']); 29278const selectPasswordResetRequestSent = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'passwordResetRequest', 'sent']); 29279const selectPasswordResetRequestError = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'passwordResetRequest', 'error']); 29280const selectResetPasswordSending = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'resetPassword', 'isSe
29280nding']); 29281const selectResetPasswordSent = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'resetPassword', 'sent']); 29282const selectResetPasswordError = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'resetPassword', 'error']); 29283const selectChangePasswordSending = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'changePassword', 'isSending']); 29284const selectChangePasswordSent = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'changePassword', 'sent']); 29285const selectChangePasswordError = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['user', 'changePassword', 'error']); 29286 29287var selectors = /*#__PURE__*/Object.freeze({ 29288 __proto__: null, 29289 selectChangePasswordError: selectChangePasswordError, 29290 selectChangePasswordSending: selectChangePasswordSending, 29291 selectChangePasswordSent: selectChangePasswordSent, 29292 selectClientCredentials: selectClientCredentials, 29293 selectPasswordResetRequestError: selectPasswordResetRequestError, 29294 selectPasswordResetRequestSending: selectPasswordResetRequestSending, 29295 selectPasswordResetRequestSent: selectPasswordResetRequestSent, 29296 selectResetPasswordError: selectResetPasswordError, 29297 selectResetPasswordSending: selectResetPasswordSending, 29298 selectResetPasswordSent: selectResetPasswordSent, 29299 selectUser: selectUser, 29300 selectUserAuthenticationErrorMessage: selectUserAuthenticationErrorMessage, 29301 selectUserEmail: selectUserEmail, 29302 selectUserErrorMessage: selectUserErrorMessage, 29303 selectUserGroups: selectUserGroups, 29304 selectUserGuid: selectUserGuid, 29305 selectUserIsAuthenticated: selectUserIsAuthenticated, 29306 selectUserIsAuthenticationError: selectUserIsAuthenticationError, 29307 selectUserIsError: selectUserIsError, 29308 selectUserIsLoading: selectUserIsLoading, 29309 selectUserIsZengentiStaff: selectUserIsZengentiStaff, 29310 selectUserRegistration: selectUserRegistration, 29311 selectUserRegistrationError: selectUserRegistrationError, 29312 selectUserRegistrationIsLoading: selectUserRegistrationIsLoading, 29313 selectUserRegistrationIsSuccess: selectUserRegistrationIsSuccess, 29314 selectUserSecurityToken: selectUserSecurityToken, 29315 selectUsername: selectUsername 29316}); 29317 29318const matchUserGroup = (userGroups = [], requiredGroups = []) => { 29319 if (!Array.isArray(requiredGroups) || Array.isArray(requiredGroups) && requiredGroups.length === 0) return true; 29320 const groupMatch = requiredGroups.some(requiredGroup => { 29321 return userGroups.some(userGroup => { 29322 if (requiredGroup.id === userGroup.id) { 29323 return true; 29324 } 29325 if (requiredGroup.name === userGroup.name) { 29326 return true; 29327 } 29328 }); 29329 }); 29330 return groupMatch; 29331}; 29332 29333 29334//# sourceMappingURL=matchGroups-C2_rxOIO.js.map 29335 29336 29337/***/ }, 29338 29339/***/ 65700 29340(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 29341 29342"use strict"; 29343/* harmony export */ __webpack_require__.d(__webpack_exports__, { 29344/* harmony export */ DT: () => (/* binding */ routing), 29345/* harmony export */ rE: () => (/* binding */ version) 29346/* harmony export */ }); 29347/* unused harmony export navigation */ 29348/* harmony import */ var _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95137); 29349/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23790); 29350/* harmony import */ var _version_Cy_gb20a_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9348); 29351/* harmony import */ var _version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81452); 29352/* harmony import */ var redux_saga__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27701); 29353/* harmony import */ var _slice_C6JLQik8_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(60218); 29354/* harmony import */ var _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85118); 29355/* harmony import */ var jsonpath_mapper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(47149); 29356/* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17276); 29357 29358 29359 29360 29361 29362 29363 29364 29365 29366 29367 29368 29369 29370 29371 29372 29373 29374 29375 29376var types = { 29377 navigation: _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_0__.n, 29378 routing: _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_1__.E, 29379 version: _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_0__.v 29380}; 29381 29382const loadNavigationTree = () =>
29382 (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_1__.w)(_store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_0__.G); 29383 29384var navigation$1 = /*#__PURE__*/Object.freeze({ 29385 __proto__: null, 29386 loadNavigationTree: loadNavigationTree 29387}); 29388 29389var actions = { 29390 navigation: navigation$1, 29391 routing: _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_1__.B, 29392 version: _version_Cy_gb20a_js__WEBPACK_IMPORTED_MODULE_2__.v 29393}; 29394 29395var selectors = { 29396 navigation: _version_Cy_gb20a_js__WEBPACK_IMPORTED_MODULE_2__.n, 29397 routing: _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_1__.D, 29398 version: _version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_3__.v 29399}; 29400 29401// Remap the objects so they are presented in "feature" hierarchy 29402// e.g. { routing: { types, actions }, navigation: { types, actions } } 29403// instead of { types: { routing, navigation }, actions: { routing, navigation } } 29404 29405const navigation = { 29406 types: types.navigation, 29407 actions: actions.navigation, 29408 selectors: selectors.navigation 29409}; 29410const routing = { 29411 types: types.routing, 29412 actions: actions.routing, 29413 selectors: selectors.routing 29414}; 29415const version = { 29416 types: types.version, 29417 actions: actions.version, 29418 selectors: selectors.version 29419}; 29420 29421 29422//# sourceMappingURL=redux.js.map 29423 29424 29425/***/ }, 29426 29427/***/ 16752 29428(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 29429 29430"use strict"; 29431/* harmony export */ __webpack_require__.d(__webpack_exports__, { 29432/* harmony export */ F6: () => (/* reexport safe */ _RouteLoader_CAVJs2rj_js__WEBPACK_IMPORTED_MODULE_1__.a), 29433/* harmony export */ Tp: () => (/* reexport safe */ _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.D) 29434/* harmony export */ }); 29435/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23790); 29436/* harmony import */ var _RouteLoader_CAVJs2rj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43236); 29437/* harmony import */ var _util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12846); 29438/* harmony import */ var jsonpath_mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(47149); 29439/* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17276); 29440/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96540); 29441/* harmony import */ var _matchGroups_C2_rxOIO_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(54293); 29442/* harmony import */ var _SSRContext_DqqZUlqT_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2460); 29443/* harmony import */ var _ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22255); 29444/* harmony import */ var contensis_delivery_api__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(15575); 29445/* harmony import */ var contensis_delivery_api__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(contensis_delivery_api__WEBPACK_IMPORTED_MODULE_9__); 29446/* harmony import */ var _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(95137); 29447/* harmony import */ var redux_saga__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(27701); 29448/* harmony import */ var _slice_C6JLQik8_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60218); 29449/* harmony import */ var _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(85118); 29450/* harmony import */ var _CookieHelper_class_C6rTRl_1_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(26240); 29451/* harmony import */ var _ToJs_BnRRHk6f_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(32078); 29452 29453 29454 29455 29456 29457 29458 29459 29460 29461 29462 29463 29464 29465 29466 29467 29468 29469 29470 29471 29472 29473 29474 29475 29476 29477 29478//# sourceMappingURL=routing.js.map 29479 29480 29481/***/ }, 29482 29483/***/ 69248 29484(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 29485 29486"use strict"; 29487/* harmony export */ __webpack_require__.d(__webpack_exports__, { 29488/* harmony export */ $: () => (/* binding */ triggerListingSsr), 29489/* harmony export */ A: () => (/* binding */ APPLY_CONFIG), 29490/* harmony export */ B: () => (/* binding */ getIsLoading$2), 29491/* harmony export */ C: () => (/* binding */ CLEAR_FILTERS), 29492/* harmony export */ D: () => (/* binding */ getPageIndex$2), 29493/* harmony export */ E: () => (/* binding */ EXECUTE_SEARCH), 29494/* harmony export */ F: () => (/* binding */ getPageIsLoading$2), 29495/* harmony export */ G: () => (/* binding */ getPaging), 29496/* harmony export */ H: () => (/* binding */ getQueryParameter$2), 29497/* harmony export */ I: () => (/* binding */ getRenderableFilters$2), 29498/* harmony export */ J: () => (/* binding */ getResults), 29499/* harmony export */ K: () => (/* binding */ getResultsInfo), 29500/* harmony export */ L: () => (/* binding */ LOAD_FILTERS), 29501/* harmony export */ M: () => (/* binding */ getSearchTerm$2), 29502/* harmony export */ N: () => (/* binding */ getSearchTotalCount$1), 29503/* harmony export */ O: () => (/* binding */ getSelectedFilters), 29504/* harmony export */ P: () => (/* binding */ getTabFacets$1), 29505/* harmony export */ Q: () => (/* binding */ getTabsAndFacets$1), 29506/* harmony export */ R: () => (/* binding */ getTotalCount$1), 29507/* harmony export */ S: () => (/* binding */ SET_ROUTE_FILTERS), 29508/* harmony export */ U: () => (/* binding */ UPDATE_PAGE_INDEX), 29509/* harmony export */ V: () => (/* binding */ queries), 29510/* harmony export */ W: () => (/* binding */ searchSagas), 29511/* harmony export */ X: () => (/* binding */ selectListing), 29512/* harmony export */ Y: () => (/* binding */ selectors), 29513/* harmony export */ Z: () => (/* binding */ setRouteFilters), 29514/* harmony export */ a: () => (/* binding */ Context), 29515/* harmony export */ a0: () => (/* binding */ triggerMinilistSsr), 29516/* harmony export */ a1: () => (/* binding */ triggerSearch), 29517/* harmony export */ a2: () => (/* binding */ triggerSearchSsr), 29518/* harmony export */ a3: () => (/* binding */ types), 29519/* harmony export */ a4: () => (/* binding */ updateCurrentFacet$1), 29520/* harmony export */ a5: () => (/* binding */ updateCurrentTab$1), 29521/* harmony export */ a6: () => (/* binding */ updatePageIndex$1), 29522/* harmony export */ a7: () => (/* binding */ updatePageSize$1), 29523/* harmony export */ a8: () => (/* binding */ updateSearchTerm$1), 29524/* harmony export */ a9: () => (/* binding */ updateSelectedFilters), 29525/* harmony export */ aa: () => (/* binding */ updateSortOrder$1), 29526/* harmony export */ ab: () => (/* binding */ useFacets), 29527/* harmony export */ ac: () => (/* binding */ useListing), 29528/* harmony export */ ad: () => (/* binding */ withMappers), 29529/* harmony export */ b: () => (/* binding */ EXECUTE_SEARCH_ERROR), 29530/* harmony export */ c: () => (/* binding */ LOAD_FILTERS_COMPLETE), 29531/* harmony export */ d: () => (/* binding */ LOAD_FILTERS_ERROR), 29532/* harmony export */ e: () => (/* binding */ SET_SEARCH_ENTRIES), 29533/* harmony export */ f: () => (/* binding */ SET_SEARCH_FILTERS), 29534/* harmony export */ g: () => (/* binding */ UPDATE_PAGE_SIZE), 29535/* harmony export */ h: () => (/* binding */ UPDATE_SEARCH_TERM), 29536/* harmony export */ i: () => (/* binding */ UPDATE_SELECTED_FILTERS), 29537/* harmony export */ j: () => (/* binding */ UPDATE_SORT_ORDER), 29538/* harmony export */ k: () => (/* binding */ actions), 29539/* harmony export */ l: () => (/* binding */ clearFilters$1), 29540/* harmony export */ q: () => (/* binding */ doSearch), 29541/* harmony export */ r: () => (/* binding */ expressions), 29542/* harmony export */ t: () => (/* binding */ getCurrentFacet), 29543/* harmony export */ u: () => (/* binding */ getCurrentTab$1), 29544/* harmony export */ v: () => (/* binding */ getFacet$1), 29545/* harmony export */ w: () => (/* binding */ getFacetTitles$1), 29546/* harmony export */ x: () => (/* binding */ getFacetsTotalCount$1), 29547/* harmony export */ y: () => (/* binding */ getFeaturedResults$2), 29548/* harmony export */ z: () => (/* binding */ getFilters) 29549/* harmony export */ }); 29550/* unused harmony exports T, _, m, n, o, p, s */ 29551/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 29552/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45135); 29553/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13527); 29554/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(73065); 29555/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_3__); 29556/* harmony import */ var _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85118); 29557/* harmony import */ var _version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81452); 29558/* harmony import */ var _ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(22255); 29559/* harmony import */ var contensis_delivery_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(15575); 29560/* harmony import */ var contensis_delivery_api__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(contensis_delivery_api__WEBPACK_IMPORTED_MODULE_7__); 29561/* harmony import */ var _util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12846); 29562/* harmony import */ var _selectors_D4ulaTom_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(83069); 29563/* harmony import */ var _slice_C6JLQik8_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(60218); 29564/* harmony import */ var jsonpath_mapper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(47149); 29565/* harmony import */ var contensis_core_api__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(41416); 29566/* harmony import */ var contensis_core_api__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__); 29567/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(14744); 29568/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_13__); 29569/* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(17276); 29570/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(23790); 29571/* harmony import */ var _commonjsHelpers_BFTU3MAI_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(90912); 29572 29573 29574 29575 29576 29577 29578 29579 29580 29581 29582 29583 29584 29585 29586 29587 29588 29589 29590const ACTION_PREFIX = '@SEARCH/'; 29591const APPLY_CONFIG = `${ACTION_PREFIX}APPLY_CONFIG`; 29592const CLEAR_FILTERS = `${ACTION_PREFIX}CLEAR_FILTERS`; 29593const DO_SEARCH = `${ACTION_PREFIX}DO_SEARCH`; 29594const EXECUTE_SEARCH = `${ACTION_PREFIX}EXECUTE_SEARCH`; 29595const EXECUTE_SEARCH_ERROR = `${ACTION_PREFIX}EXECUTE_SEARCH_ERROR`; 29596const EXECUTE_SEARCH_PRELOAD = `${ACTION_PREFIX}EXECUTE_SEARCH_PRELOAD`; 29597const LOAD_FILTERS = `${ACTION_PREFIX}LOAD_FILTERS`; 29598const LOAD_FILTERS_COMPLETE = `${ACTION_PREFIX}LOAD_FILTERS_COMPLETE`; 29599const LOAD_FILTERS_ERROR = `${ACTION_PREFIX}LOAD_FILTERS_ERROR`; 29600const SET_FEATURED_ENTRIES = `${ACTION_PREFIX}SET_FEATURED_ENTRIES`; 29601const SET_ROUTE_FILTERS = `${ACTION_PREFIX}SET_ROUTE_FILTERS`; 29602const SET_SEARCH_FILTERS = `${ACTION_PREFIX}SET_SEARCH_FILTERS`; 29603const SET_SEARCH_ENTRIES = `${ACTION_PREFIX}SET_SEARCH_ENTRIES`; 29604const SET_SELECTED_FILTER = `${ACTION_PREFIX}SET_SELECTED_FILTER`; 29605const UPDATE_CURRENT_FACET = `${ACTION_PREFIX}UPDATE_CURRENT_FACET`; 29606const UPDATE_CURRENT_TAB = `${ACTION_PREFIX}UPDATE_CURRENT_TAB`; 29607const UPDATE_SORT_ORDER = `${ACTION_PREFIX}UPDATE_SORT_ORDER`; 29608const UPDATE_PAGE_INDEX = `${ACTION_PREFIX}UPDATE_PAGE_INDEX`; 29609const UPDATE_PAGE_SIZE = `${ACTION_PREFIX}UPDATE_PAGE_SIZE`; 29610const UPDATE_SEARCH_TERM = `${ACTION_PREFIX}UPDATE_SEARCH_TERM`; 29611const UPDATE_SELECTED_FILTERS = `${ACTION_PREFIX}UPDATE_SELECTED_FILTERS`; 29612 29613var types = /*#__PURE__*/Object.freeze({ 29614 __proto__: null, 29615 APPLY_CONFIG: APPLY_CONFIG, 29616 CLEAR_FILTERS: CLEAR_FILTERS, 29617 DO_SEARCH: DO_SEARCH, 29618 EXECUTE_SEARCH: EXECUTE_SEARCH, 29619 EXECUTE_SEARCH_ERROR: EXECUTE_SEARCH_ERROR, 29620 EXECUTE_SEARCH_PRELOAD: EXECUTE_SEARCH_PRELOAD, 29621 LOAD_FILTERS: LOAD_FILTERS, 29622 LOAD_FILTERS_COMPLETE: LOAD_FILTERS_COMPLETE, 29623 LOAD_FILTERS_ERROR: LOAD_FILTERS_ERROR, 29624 SET_FEATURED_ENTRIES: SET_FEATURED_ENTRIES, 29625 SET_ROUTE_FILTERS: SET_ROUTE_FILTERS, 29626 SET_SEARCH_ENTRIES: SET_SEARCH_ENTRIES, 29627 SET_SEARCH_FILTERS: SET_SEARCH_FILTERS, 29628 SET_SELECTED_FILTER: SET_SELECTED_FILTER, 29629 UPDATE_CURRENT_FACET: UPDATE_CURRENT_FACET, 29630 UPDATE_CURRENT_TAB: UPDATE_CURRENT_TAB, 29631 UPDATE_PAGE_INDEX: UPDATE_PAGE_INDEX, 29632 UPDATE_PAGE_SIZE: UPDATE_PAGE_SIZE, 29633 UPDATE_SEARCH_TERM: UPDATE_SEARCH_TERM, 29634 UPDATE_SELECTED_FILTERS: UPDATE_SELECTED_FILTERS, 29635 UPDATE_SORT_ORDER: UPDATE_SORT_ORDER 29636}); 29637 29638const withMappers = (action, mappers) => { 29639 return { 29640 ...action, 29641 mappers 29642 }; 29643}; 29644const triggerSearch = ({ 29645 config, 29646 context, 29647 debug, 29648 defaultLang, 29649 excludeIds, 29650 facet, 29651 mapper, 29652 mappers, 29653 params 29654}) => { 29655 return { 29656 type: DO_SEARCH, 29657 config, 29658 context, 29659 debug, 29660 defaultLang, 29661 excludeIds, 29662 facet, 29663 mapper, 29664 mappers, 29665 params 29666 }; 29667}; 29668const initListing = ({ 29669 context, 29670 facet, 29671 mapper, 29672 params 29673}) => { 29674 return { 29675 type: SET_ROUTE_FILTERS, 29676 context, 29677 facet, 29678 mapper, 29679 params 29680 }; 29681}; 29682const navigate = (path, state) => { 29683 return { 29684 type: '@ROUTING/_SET_ROUTE', 29685 path, 29686 state 29687 }; 29688}; 29689const clearFilters$1 = filterKeyOrOptions => { 29690 return { 29691 type: CLEAR_FILTERS, 29692 clear: typeof filterKeyOrOptions === 'string' ? { 29693 keys: [filterKeyOrOptions] 29694 } : filterKeyOrOptions 29695 }; 29696}; 29697const updatePageIndex$1 = (pageIndex, scrollToElement) => { 29698 return { 29699 type: UPDATE_PAGE_INDEX, 29700 pageIndex, 29701 scrollToElement 29702 }; 29703}; 29704const updatePageSize$1 = (pageSize, scrollToElement) => { 29705 return { 29706 type: UPDATE_PAGE_SIZE, 29707 pageSize, 29708 scrollToElement 29709 }; 29710}; 29711const updateCurrentFacet$1 = facet => { 29712 return { 29713 type: UPDATE_CURRENT_FACET, 29714 facet 29715 }; 29716}; 29717const updateCurrentTab$1 = id => { 29718 return { 29719 type: UPDATE_CURRENT_TAB, 29720 id 29721 }; 29722}; 29723const updateSearchTerm$1 = term => { 29724 return { 29725 type: UPDATE_SEARCH_TERM, 29726 term
29727 }; 29728}; 29729const updateSelectedFilters = (filter, key, isUnknownItem = false, scrollToElement) => { 29730 return { 29731 type: UPDATE_SELECTED_FILTERS, 29732 filter, 29733 key, 29734 isUnknownItem, 29735 scrollToElement 29736 }; 29737}; 29738const updateSortOrder$1 = (orderBy, facet) => { 29739 return { 29740 type: UPDATE_SORT_ORDER, 29741 orderBy, 29742 facet 29743 }; 29744}; 29745 29746var actions = /*#__PURE__*/Object.freeze({ 29747 __proto__: null, 29748 clearFilters: clearFilters$1, 29749 initListing: initListing, 29750 navigate: navigate, 29751 triggerSearch: triggerSearch, 29752 updateCurrentFacet: updateCurrentFacet$1, 29753 updateCurrentTab: updateCurrentTab$1, 29754 updatePageIndex: updatePageIndex$1, 29755 updatePageSize: updatePageSize$1, 29756 updateSearchTerm: updateSearchTerm$1, 29757 updateSelectedFilters: updateSelectedFilters, 29758 updateSortOrder: updateSortOrder$1, 29759 withMappers: withMappers 29760}); 29761 29762let Context = /*#__PURE__*/function (Context) { 29763 Context["facets"] = "facets"; 29764 Context["listings"] = "listings"; 29765 Context["minilist"] = "minilist"; 29766 return Context; 29767}({}); 29768// export type Context = 'facets' | 'listings' | 'minilist'; 29769 29770// Find a fromJS function from global that is dynamically loaded in createStore 29771// or replace with a stub function for non-immutable gets 29772const makeFromJS = (returnType = globalThis.STATE_TYPE || 'immutable') => { 29773 var _immutable, _immutable2; 29774 return returnType === 'immutable' ? ((_immutable = globalThis.immutable) === null || _immutable === void 0 ? void 0 : _immutable.fromJSOrdered) || ((_immutable2 = globalThis.immutable) === null || _immutable2 === void 0 ? void 0 : _immutable2.fromJS) || (v => v) : v => v; 29775}; 29776const getImmutableOrJS = (state, stateKey, fallbackValue, returnType = globalThis.STATE_TYPE || 'immutable') => { 29777 // Find a fromJS function from global that is dynamically loaded in createStore 29778 // or replace with a stub function for non-immutable gets 29779 const fromJS = makeFromJS(returnType); 29780 if (state && 'get' in state && typeof state.get === 'function' && 'getIn' in state && typeof state.getIn === 'function' && 'toJS' in state && typeof state.toJS === 'function') { 29781 if (Array.isArray(stateKey)) return fromJS(state.getIn(stateKey, fallbackValue)); 29782 return fromJS(state.get(stateKey, fallbackValue)); 29783 } 29784 if (Array.isArray(stateKey) && state && typeof state === 'object') { 29785 const result = (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_11__/* .jpath */ .oA)(stateKey.join('.'), state); 29786 if (typeof result === 'undefined') return fallbackValue; 29787 return result; 29788 } 29789 const result = state && typeof state === 'object' ? state[stateKey] : undefined; 29790 if (typeof result === 'undefined') return fallbackValue; 29791 return result; 29792}; 29793 29794const getSearchContext = state => getImmutableOrJS(state, ['search', 'context'], Context.facets); 29795const getCurrent$2 = (state, context = getSearchContext(state)) => context === Context.facets ? getCurrentFacet(state) : getCurrentListing(state); 29796const getCurrentFacet = state => getImmutableOrJS(state, ['search', 'currentFacet']); 29797const getCurrentListing = state => getImmutableOrJS(state, ['search', 'currentListing']); 29798const getCurrentTab$1 = state => getImmutableOrJS(state, ['search', Context.facets, getCurrentFacet(state), 'tabId'], 0); 29799const getCurrentComposition = state => getImmutableOrJS(state, ['search', 'currentComposition']); 29800 29801/** A localised version of `getCurrent` selector */ 29802const getLocalisedCurrent$2 = (state, language = (0,_selectors_D4ulaTom_js__WEBPACK_IMPORTED_MODULE_9__.s)(state), context = getSearchContext(state)) => { 29803 var _facet$i18n; 29804 const currentFacet = getCurrent$2(state, context); 29805 const facet = getFacet$1(state, currentFacet, context, 'js'); 29806 const i18n = (_facet$i18n = facet.i18n) === null || _facet$i18n === void 0 ? void 0 : _facet$i18n[language]; 29807 return i18n || currentFacet; 29808}; 29809const getLocalisedFacetKey = (state, facet = getCurrent$2(state), language = (0,_selectors_D4ulaTom_js__WEBPACK_IMPORTED_MODULE_9__.s)(state), context = getSearchContext(state)) => { 29810 var _getFacet; 29811 return (_getFacet = getFacet$1(state, facet, context, 'js')) === null || _getFacet === void 0 || (_getFacet = _getFacet.i18n) === null || _getFacet === void 0 ? void 0 : _getFacet[language]; 29812}; 29813const getCurrentFromLocalised = (state, alias, language, context = getSearchContext(state)) => { 29814 var _state$search; 29815 const facets = ((_state$search = state.search) === null || _state$search === void 0 ? void 0 : _state$search[context]) || {}; 29816 for (const [facetKey, facet] of Object.entries(facets)) { 29817 if (language) { 29818 var _facet$i18n2; 29819 const languageAlias = (_facet$i18n2 = facet.i18n) === null || _facet$i18n2 === void 0 ? void 0 : _facet$i18n2[language]; 29820 if (languageAlias === alias) { 29821 return { 29822 facet: facetKey, 29823 language 29824 }; 29825 } 29826 } else { 29827 // Fallback to check for any language 29828 for (const lang in facet.i18n) { 29829 if (facet.i18n[lang] === alias) { 29830 return { 29831 facet: facetKey, 29832 language: lang 29833 }; 29834 } 29835 } 29836 } 29837 } 29838 return null; 29839 // // Default to returning the inputs 29840 // return { facet: alias, language }; 29841}; 29842const getFacets = (state, returnType) => getImmutableOrJS(state, ['search', Context.facets], {}, returnType); 29843const getTabFacets$1 = state => Object.fromEntries(Object.entries(getFacets(state, 'js')).filter(([key]) => getImmutableOrJS(getFacets(state), [key, 'tabId'], 0) === getCurrentTab$1(state))); 29844const getCompositionFacets = (state, composition) => { 29845 const currentComposition = composition || getCurrentComposition(state); 29846 if (!currentComposition) return {}; 29847 const compositionConfig = getSearchCompositions(state)[currentComposition]; 29848 const context = getSearchContext(state); 29849 if (!compositionConfig[context]) return {}; 29850 const facets = {}; 29851 for (const facet of compositionConfig[context]) { 29852 facets[facet] = getFacet$1(state, facet, context); 29853 } 29854 return facets; 29855}; 29856const getFacetTitles$1 = state => Object.entries(getFacets(state, 'js')).map(([key, facet = {}]) => { 29857 var _facet$pagingInfo; 29858 return { 29859 isSelected: getCurrentFacet(state) === key, 29860 key, 29861 title: facet.title, 29862 totalCount: (_facet$pagingInfo = facet.pagingInfo) === null || _facet$pagingInfo === void 0 ? void 0 : _facet$pagingInfo.totalCount 29863 }; 29864}); 29865const getFacet$1 = (state, facetName = '', context = Context.facets, returnType) => { 29866 const currentFacet = facetName || getCurrentFacet(state); 29867 return getImmutableOrJS(state, ['search', context, currentFacet], {}, returnType); 29868}; 29869const getListing$1 = (state, listing = '') => { 29870 const currentListing = listing || getCurrentListing(state); 29871 return getImmutableOrJS(state, ['search', Context.listings, currentListing], {}); 29872}; 29873const getComposition = (state, composition = '') => { 29874 const currentComposition = composition || getCurrentComposition(state); 29875 const context = getSearchContext(state); 29876 const compositionConfig = getSearchCompositions(state)[currentComposition]; 29877 if (!compositionConfig) return {}; 29878 const facets = getCompositionFacets(state, currentComposition); 29879 return { 29880 ...compositionConfig, 29881 [context]: facets 29882 }; 29883}; 29884 29885/** Return filter state for the current (or provided) facet */ 29886const getFilters = (state, facet, context = Context.facets, returnType) => { 29887 return getImmutableOrJS(state, ['search', context, facet || getCurrent$2(state, context), 'filters'], {}, returnType); 29888}; 29889const getLocalisedFilterKey = (state, key, language = (0,_selectors_D4ulaTom_js__WEBPACK_IMPORTED_MODULE_9__.s)(state), facet, context = getSearchContext(state)) => { 29890 var _filter$i18n; 29891 const filter = getFilters(state, facet, context, 'js')[key]; 29892 if (filter !== null && filter !== void 0 && (_filter$i18n = filter.i18n) !== null && _filter$i18n !== void 0 && _filter$i18n[language]) { 29893 return filter.i18n[language]; 29894 } 29895 return key; 29896}; 29897const getFilterKeyFromLocalised = (state, key, language = (0,_selectors_D4ulaTom_js__WEBPACK_IMPORTED_MODULE_9__.s)(state), facet, context = getSearchContext(state)) => { 29898 const filters = getFilters(state, facet, context, 'js'); 29899 for (const [filterKey, filter] of Object.entries(filters)) { 29900 var _filter$i18n2; 29901 if (((_filter$i18n2 = filter.i18n) === null || _filter$i18n2 === void 0 ? void 0 : _filter$i18n2[language]) === key) { 29902 return filterKey; 29903 } 29904 } 29905 return key; 29906}; 29907 29908/** Return filter state for the current (or provided) facet, excluding filters configured as `renderable: false` */ 29909const getRenderableFilters$2 = (state, facet = '', context = Context.facets) => Object.fromEntries(Object.entries(getFilters(state, facet, context, 'js')).filter(([, f = {}]) => typeof f.renderable !== 'boolean' ? true : f.renderable)); 29910const getFiltersToLoad = (state, facet, context = Context.facets, returnType) => { 29911 const filters = getFilters(state, facet, context, returnType); 29912 const loadedFilters = Object.entries(filters).map(([key, f = {}]) => [key, (f.items || []).filter(i => { 29913 const title = i === null || i === void 0 ? void 0 : i.title; 29914 return typeof title !== 'undefined' && !!title; 29915 }).length > 0 && (f.isError || false) === false]); 29916 return loadedFilters.map(([filterKey, isLoaded]) => !isLoaded ? filterKey : null).filter(f => !!f); 29917}; 29918 29919/** Iterate the selected filters and update their keys to their localized equivalents */ 29920const localiseSelectedFilterKeys = (selectedFilters, state) => { 29921 const language = (0,_selectors_D4ulaTom_js__WEBPACK_IMPORTED_MODULE_9__.s)(state); 29922 const filters = getFilters(state, getCurrentFacet(state), getSearchContext(state), 'js'); 29923 const localisedSelectedFilters = {}; 29924 for (const [filterKey, selectedValues] of Object.entries(selectedFilters)) { 29925 var _filter$i18n3;
29926 const filter = filters[filterKey]; 29927 if (filter !== null && filter !== void 0 && (_filter$i18n3 = filter.i18n) !== null && _filter$i18n3 !== void 0 && _filter$i18n3[language]) { 29928 const localisedKey = filter.i18n[language]; 29929 localisedSelectedFilters[localisedKey] = selectedValues; 29930 } else { 29931 localisedSelectedFilters[filterKey] = selectedValues; 29932 } 29933 } 29934 return localisedSelectedFilters; 29935}; 29936 29937/** Reduce filters state to a simple object containing all filter keys and the selected values */ 29938const reduceSelectedFilters = filters => { 29939 const selectedFilters = Object.fromEntries(Object.entries(filters).map(([key, filter = {}]) => [key, (filter.items || []).filter(item => !!(item.isSelected || false)).map(item => { 29940 const key = (item === null || item === void 0 ? void 0 : item.key) || ''; 29941 return key; 29942 })])); 29943 return selectedFilters; 29944}; 29945 29946/** Return keyed object for all filters in the current facet with all selected values for each filter */ 29947const getSelectedFilters = (state, facet = '', context = Context.facets, returnType) => { 29948 const filters = getFilters(state, facet, context, 'js'); 29949 const selectedFilters = reduceSelectedFilters(filters); 29950 const fromJS = makeFromJS(returnType); 29951 return fromJS(selectedFilters); 29952}; 29953 29954/** Return keyed object for all _renderable_ filters in the current facet with all selected values for each filter */ 29955const getRenderableSelectedFilters = (state, facet = '', context = Context.facets) => { 29956 const filters = getRenderableFilters$2(state, facet, context); 29957 29958 // new in CRB4: intended no support for immutable state type 29959 const selectedFilters = reduceSelectedFilters(filters); 29960 return selectedFilters; 29961}; 29962 29963/** A localised version of `getRenderableSelectedFilters` selector */ 29964const getLocalisedRenderableSelectedFilters = (state, facet = '', context = Context.facets) => { 29965 const filters = getRenderableSelectedFilters(state, facet, context); 29966 const localisedFilters = localiseSelectedFilterKeys(filters, state); 29967 return localisedFilters; 29968}; 29969const getResults = (state, current = '', context = Context.facets, returnType) => { 29970 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'results'], [], returnType); 29971}; 29972const getResultsInfo = (state, current = '', context = getSearchContext(state)) => { 29973 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'resultsInfo'], {}, 'js'); 29974}; 29975const getIsInternalPaging = (state, current, context = Context.facets) => { 29976 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'queryParams', 'internalPaging'], false); 29977}; 29978const getIsLoaded = (state, context = Context.facets, facet) => { 29979 return !!getImmutableOrJS(state, ['search', context, facet || getCurrent$2(state, context), 'queryDuration'], 0); 29980}; 29981const getIsLoading$2 = (state, context = Context.facets, facet) => { 29982 return getImmutableOrJS(state, ['search', context, facet || getCurrent$2(state, context), 'entries', 'isLoading']); 29983}; 29984const getIsSsr = state => getImmutableOrJS(state, ['search', 'config', 'ssr'], false); 29985const getFeaturedResults$2 = (state, current = '', context = Context.facets, returnType) => { 29986 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'featuredResults'], [], returnType); 29987}; 29988const getPaging = (state, current = '', context = Context.facets, returnType) => { 29989 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo'], {}, returnType); 29990}; 29991const getPageIndex$2 = (state, current = '', context = Context.facets) => { 29992 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'pageIndex']); 29993}; 29994const getPageSize = (state, current = '', context = Context.facets) => { 29995 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'pageSize'], 0 // Defaults to 0 because we want it to fall back to a query param if not defined 29996 ); 29997}; 29998const getPrevPageIndex = (state, current = '', context = Context.facets) => { 29999 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'prevPageIndex']); 30000}; 30001const getPageIsLoading$2 = (state, current = '', context = Context.facets) => { 30002 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'isLoading']); 30003}; 30004const getPagesLoaded = (state, current = '', context = Context.facets) => { 30005 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'pagesLoaded'], [], 'js'); 30006}; 30007const getTotalCount$1 = (state, current = '', context = Context.facets) => { 30008 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'pagingInfo', 'totalCount']); 30009}; 30010const getSearchTerm$2 = state => getImmutableOrJS(state, ['search', 'term']); 30011const getSearchTabs = (state, returnType) => getImmutableOrJS(state, ['search', 'tabs'], [], returnType); 30012const getSearchCompositions = state => getImmutableOrJS(state, ['search', 'compositions'], {}, 'js'); 30013const getQueryParams = (state, current = '', context = Context.facets) => { 30014 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'queryParams'], {}, 'js'); 30015}; 30016const getQueryParameter$2 = ({ 30017 state, 30018 facet, 30019 context = Context.facets 30020}, key, ifnull = null) => { 30021 return getImmutableOrJS(getQueryParams(state, facet, context), key, ifnull, 'js'); 30022}; 30023const getCustomApi = (state, current, context = Context.facets, returnType) => { 30024 return getImmutableOrJS(state, ['search', context, current || getCurrent$2(state, context), 'customApi'], null, returnType); 30025}; 30026const getTabsAndFacets$1 = (state, returnType) => { 30027 const tabs = getSearchTabs(state, 'js'); 30028 const facets = getFacets(state, 'js'); 30029 const tabsAndFacets = (tabs || []).map((tab = {}) => { 30030 const fieldsToCount = tab.totalCount;
30031 let countFields; 30032 if (typeof fieldsToCount === 'string') countFields = [[fieldsToCount]]; 30033 const thisTabFacets = Object.entries(facets).filter(([key]) => getImmutableOrJS(facets, [key, 'tabId'], 0) === tab.id); 30034 const thisTabTotal = thisTabFacets.map(([facetName, facet = {}]) => { 30035 if (!countFields || countFields.find((f = []) => (f === null || f === void 0 ? void 0 : f[0]) === facetName)) return getImmutableOrJS(facet, ['pagingInfo', 'totalCount']); 30036 return 0; 30037 }).reduce((a, b) => a + b, 0); 30038 return { 30039 ...tab, 30040 [Context.facets]: Object.fromEntries(thisTabFacets), 30041 totalCount: thisTabTotal 30042 }; 30043 }); 30044 const fromJS = makeFromJS(returnType); 30045 return fromJS(tabsAndFacets); 30046}; 30047const getSearchTotalCount$1 = state => { 30048 const tabsAndFacets = getTabsAndFacets$1(state, 'js'); 30049 const wholeSearchTotal = tabsAndFacets.map((t = {}) => t.totalCount).reduce((a, b) => a + b, 0); 30050 return wholeSearchTotal; 30051}; 30052const getFacetsTotalCount$1 = state => { 30053 const facets = getFacets(state); 30054 const wholeSearchTotal = Object.entries(facets).map(([, t = {}]) => { 30055 var _t$pagingInfo; 30056 return ((_t$pagingInfo = t.pagingInfo) === null || _t$pagingInfo === void 0 ? void 0 : _t$pagingInfo.totalCount) || 0; 30057 }).reduce((a, b) => a + b, 0); 30058 return wholeSearchTotal; 30059}; 30060 30061// An exported copy of the relevant selectors scoped by default to a facets context 30062const selectFacets = { 30063 getCurrent: getCurrentFacet, 30064 getCurrentTab: getCurrentTab$1, 30065 getCustomApi, 30066 getFacet: getFacet$1, 30067 getFacetTitles: getFacetTitles$1, 30068 getFacets, 30069 getFacetsTotalCount: getFacetsTotalCount$1, 30070 getFeaturedResults: getFeaturedResults$2, 30071 getFilters, 30072 getFiltersToLoad, 30073 getIsLoaded, 30074 getIsLoading: getIsLoading$2, 30075 /* Localised version of getCurrent */ 30076 getLocalisedCurrent: state => getLocalisedCurrent$2(state, undefined, Context.facets), 30077 getPageIndex: getPageIndex$2, 30078 getPageIsLoading: getPageIsLoading$2, 30079 getPagesLoaded, 30080 getPaging, 30081 getQueryParams: (state, facet) => getQueryParams(state, facet, Context.facets), 30082 getQueryParameter: ({ 30083 state, 30084 facet 30085 }, key, ifnull) => getQueryParameter$2({ 30086 state, 30087 facet, 30088 context: Context.facets 30089 }, key, ifnull), 30090 getRenderableFilters: getRenderableFilters$2, 30091 getResults, 30092 getTabFacets: getTabFacets$1, 30093 getTabsAndFacets: getTabsAndFacets$1, 30094 getTotalCount: getTotalCount$1, 30095 getSearchTabs, 30096 getSearchTerm: getSearchTerm$2,
30097 getSearchTotalCount: getSearchTotalCount$1, 30098 getSelectedFilters 30099}; 30100 30101// An exported copy of the relevant selectors pre-scoped to a listing context 30102const selectListing = { 30103 getCurrent: getCurrentListing, 30104 getFeaturedResults: (state, listing = '') => getFeaturedResults$2(state, listing, Context.listings, 'js'), 30105 getFilters: (state, listing = '') => getFilters(state, listing, Context.listings, 'js'), 30106 getFiltersToLoad: (state, listing = '') => getFiltersToLoad(state, listing, Context.listings), 30107 getListing: getListing$1, 30108 /* Localised version of getCurrent */ 30109 getLocalisedCurrent: state => getLocalisedCurrent$2(state, undefined, Context.listings), 30110 getIsLoaded: state => getIsLoaded(state, Context.listings), 30111 getIsLoading: state => getIsLoading$2(state, Context.listings), 30112 getPageIndex: (state, listing = '') => getPageIndex$2(state, listing, Context.listings), 30113 getPaging: (state, listing = '') => getPaging(state, listing, Context.listings, 'js'), 30114 getPageIsLoading: (state, listing = '') => getPageIsLoading$2(state, listing, Context.listings), 30115 getPagesLoaded: (state, listing = '') => getPagesLoaded(state, listing, Context.listings), 30116 getQueryParams: (state, listing = '') => getQueryParams(state, listing, Context.listings), 30117 getQueryParameter: ({ 30118 state, 30119 facet 30120 }, key, ifnull) => getQueryParameter$2({ 30121 state, 30122 facet, 30123 context: Context.listings 30124 }, key, ifnull), 30125 getRenderableFilters: (state, listing = '') => getRenderableFilters$2(state, listing, Context.listings), 30126 getResults: (state, listing = '') => getResults(state, listing, Context.listings, 'js'), 30127 getSearchTerm: getSearchTerm$2, 30128 getTotalCount: (state, listing = '') => getTotalCount$1(state, listing, Context.listings), 30129 getSelectedFilters: (state, listing = '') => getSelectedFilters(state, listing, Context.listings, 'js') 30130}; 30131 30132var selectors = /*#__PURE__*/Object.freeze({ 30133 __proto__: null, 30134 getComposition: getComposition, 30135 getCompositionFacets: getCompositionFacets, 30136 getCurrent: getCurrent$2, 30137 getCurrentComposition: getCurrentComposition, 30138 getCurrentFacet: getCurrentFacet, 30139 getCurrentFromLocalised: getCurrentFromLocalised, 30140 getCurrentListing: getCurrentListing, 30141 getCurrentTab: getCurrentTab$1, 30142 getCustomApi: getCustomApi, 30143 getFacet: getFacet$1, 30144 getFacetTitles: getFacetTitles$1, 30145 getFacets: getFacets, 30146 getFacetsTotalCount: getFacetsTotalCount$1, 30147 getFeaturedResults: getFeaturedResults$2, 30148 getFilterKeyFromLocalised: getFilterKeyFromLocalised, 30149 getFilters: getFilters, 30150 getFiltersToLoad: getFiltersToLoad, 30151 getIsInternalPaging: getIsInternalPaging, 30152 getIsLoaded: getIsLoaded, 30153 getIsLoading: getIsLoading$2, 30154 getIsSsr: getIsSsr, 30155 getListing: getListing$1, 30156 getLocalisedCurrent: getLocalisedCurrent$2, 30157 getLocalisedFacetKey: getLocalisedFacetKey, 30158 getLocalisedFilterKey: getLocalisedFilterKey, 30159 getLocalisedRenderableSelectedFilters: getLocalisedRenderableSelectedFilters, 30160 getPageIndex: getPageIndex$2, 30161 getPageIsLoading: getPageIsLoading$2, 30162 getPageSize: getPageSize, 30163 getPagesLoaded: getPagesLoaded, 30164 getPaging: getPaging, 30165 getPrevPageIndex: getPrevPageIndex, 30166 getQueryParameter: getQueryParameter$2, 30167 getQueryParams: getQueryParams, 30168 getRenderableFilters: getRenderableFilters$2, 30169 getRenderableSelectedFilters: getRenderableSelectedFilters, 30170 getResults: getResults, 30171 getResultsInfo: getResultsInfo, 30172 getSearchCompositions: getSearchCompositions, 30173 getSearchContext: getSearchContext, 30174 getSearchTabs: getSearchTabs, 30175 getSearchTerm: getSearchTerm$2,
30176 getSearchTotalCount: getSearchTotalCount$1, 30177 getSelectedFilters: getSelectedFilters, 30178 getTabFacets: getTabFacets$1, 30179 getTabsAndFacets: getTabsAndFacets$1, 30180 getTotalCount: getTotalCount$1, 30181 selectFacets: selectFacets, 30182 selectListing: selectListing 30183}); 30184 30185const searchUriTemplate = { 30186 path: ({ 30187 state, 30188 facet 30189 }) => { 30190 var _staticRoute$route; 30191 const context = getSearchContext(state); 30192 const currentPath = (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_15__.H)(state) || '/search'; 30193 const staticRoute = (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_15__.a1)(state); 30194 const hasFacetRouteParam = staticRoute === null || staticRoute === void 0 || (_staticRoute$route = staticRoute.route) === null || _staticRoute$route === void 0 || (_staticRoute$route = _staticRoute$route.path) === null || _staticRoute$route === void 0 ? void 0 : _staticRoute$route.includes(`/:${context === 'facets' ? 'facet' : 'listingType'}`); 30195 30196 // if (context !== 'listings') { 30197 if (hasFacetRouteParam) { 30198 const currentFacet = getLocalisedFacetKey(state, facet) || facet || getLocalisedCurrent$2(state); 30199 const filters = getSelectedFilters(state, facet, context); 30200 // TODO: This only looking for a filter called contentTypeId 30201 // feels a bit useless and only really serves as an example. 30202 // We could expand this in future to be configured with the filter or the route 30203 // e.g. look for a route param matching the filter key in the static route 30204 const currentFilter = filters.contentTypeId; 30205 30206 // Check if we have a filter first 30207 const newPath = (currentFilter === null || currentFilter === void 0 ? void 0 : currentFilter.length) > 0 && currentFacet ? `${currentPath}/${currentFacet}/${currentFilter}` : currentFacet ? `${currentPath}/${currentFacet}` : currentPath; 30208 return newPath; 30209 } else { 30210 return currentPath; 30211 } 30212 }, 30213 search: ({ 30214 state, 30215 facet, 30216 orderBy, 30217 term, 30218 pageIndex, 30219 pageSize 30220 }) => { 30221 var _staticRoute$route2; 30222 const context = getSearchContext(state); 30223 const staticRoute = (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_15__.a1)(state); 30224 // Some listing routes may not have the listingType or facet as a route param 30225 // include it as a query param to ensure the correct listing/facet is set or updated 30226 const hasFacetRouteParam = staticRoute === null || staticRoute === void 0 || (_staticRoute$route2 = staticRoute.route) === null || _staticRoute$route2 === void 0 || (_staticRoute$route2 = _staticRoute$route2.path) === null || _staticRoute$route2 === void 0 ? void 0 : _staticRoute$route2.includes(`/:${context === 'facets' ? 'facet' : 'listingType'}`); 30227 const currentFacet = getLocalisedFacetKey(state, facet) || facet || getLocalisedCurrent$2(state); 30228 const facetQuery = !hasFacetRouteParam && currentFacet ? { 30229 [context === 'listings' ? 'listingType' : 'facet']: currentFacet 30230 } : {}; 30231 30232 // Lose stateFilters and currentSearch if a new 30233 // term is passed via an argument 30234 const stateFilters = term ? {} : Object.fromEntries(Object.entries(getLocalisedRenderableSelectedFilters(state, facet, context)).map(([k, f]) => [k, f === null || f === void 0 ? void 0 : f.join(',')])); 30235 const currentSearch = !term && getImmutableOrJS(state, ['routing', 'location', 'search']); 30236 const currentQs = (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.r)((0,query_string__WEBPACK_IMPORTED_MODULE_14__.parse)(currentSearch || '')); 30237 30238 // An argument is provided with the updated value 30239 // when the relevant action has been triggered 30240 if (typeof orderBy !== 'undefined') currentQs.orderBy = orderBy; 30241 const searchTerm = getSearchTerm$2(state); 30242 // Use Immutable's merge to merge the stateFilters with any current Qs 30243 // to build the new Qs. 30244 const mergedSearch = (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.r)(deepmerge__WEBPACK_IMPORTED_MODULE_13___default()(currentQs, { 30245 ...facetQuery, 30246 ...stateFilters 30247 })); 30248 30249 // We must handle term === '' separately, because this means the user has cleared the search term 30250 // If this is true, we don't want to fall back to the existing search term. We only want to do that if the 30251 // incoming term is explicitly undefined. 30252 if (typeof term != 'undefined') { 30253 if (term) mergedSearch.term = term;else if (term === '') delete mergedSearch.term; 30254 } else { 30255 if (searchTerm) mergedSearch.term = searchTerm; 30256 } 30257 if (pageIndex) mergedSearch.pageIndex = pageIndex + 1; 30258 if (pageIndex === 0) mergedSearch.pageIndex = undefined; 30259 if (pageSize) mergedSearch.pageSize = pageSize; 30260 30261 // We don't want these as search params in the url, we just need the search package to see them 30262 // [query-string v6+] BEHAVIOUR CHANGE: sort defaults to true â output key order is now alphabetical. 30263 // Pass { sort: false } if URL key order matters for cache keys or string comparison downstream. 30264 return (0,query_string__WEBPACK_IMPORTED_MODULE_14__.stringify)(mergedSearch); 30265 }, 30266 hash: ({ 30267 state 30268 }) => getImmutableOrJS(state, ['routing', 'location', 'hash'], '').replace('#', '') 30269}; 30270const mapStateToSearchUri = state => (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Ay)(state, searchUriTemplate); 30271 30272var defaultMappers = { 30273 results: entries => entries, 30274 navigate: mapStateToSearchUri 30275}; 30276 30277const { 30278 getCurrent: getCurrent$1, 30279 getCurrentTab, 30280 getFacet, 30281 getFacetsTotalCount, 30282 getFacetTitles, 30283 getFeaturedResults: getFeaturedResults$1, 30284 getIsLoading: getIsLoading$1, 30285 getLocalisedCurrent: getLocalisedCurrent$1, 30286 getPageIndex: getPageIndex$1, 30287 getPageIsLoading: getPageIsLoading$1, 30288 getQueryParameter: getQueryParameter$1, 30289 getRenderableFilters: getRenderableFilters$1, 30290 getSearchTerm: getSearchTerm$1, 30291 getSearchTotalCount, 30292 getTabFacets, 30293 getTabsAndFacets, 30294 getTotalCount 30295} = selectFacets; 30296const makeSelectFacetsProps = () => (0,reselect__WEBPACK_IMPORTED_MODULE_2__/* .createSelector */ .Mz)(state => state, (_, mappers) => mappers, (state, mappers) => ({ 30297 composition: getComposition(state), 30298 currentComposition: getCurrentComposition(state), 30299 currentFacet: getCurrent$1(state), 30300 currentPageIndex: getPageIndex$1(state), 30301 currentTabIndex: getCurrentTab(state), 30302 facet: getFacet(state), 30303 facetTitles: getFacetTitles(state), 30304 facets: getTabFacets(state), 30305 facetsTotalCount: getFacetsTotalCount(state), 30306 featured: getFeaturedResults$1(state), 30307 filters: getRenderableFilters$1(state), 30308 isLoading: getIsLoading$1(state), 30309 localisedCurrent: getLocalisedCurrent$1(state), 30310 pageIsLoading: getPageIsLoading$1(state), 30311 paging: getPaging(state, '', Context.facets, 'js'), 30312 results: getResults(state, '', Context.facets, 'js'), 30313 resultsInfo: typeof (mappers === null || mappers === void 0 ? void 0 : mappers.resultsInfo) === 'function' && mappers.resultsInfo(state) || getResultsInfo(state), 30314 searchTerm: getSearchTerm$1(state), 30315 searchTotalCount: getSearchTotalCount(state), 30316 selectedFilters: getSelectedFilters(state, '', Context.facets, 'js'), 30317 sortOrder: getQueryParameter$1({ 30318 state 30319 }, 'dynamicOrderBy', []), 30320 tabsAndFacets: getTabsAndFacets(state), 30321 totalCount: getTotalCount(state) 30322})); 30323const useFacets = ({ 30324 mappers 30325} = { 30326 id: '' 30327}) => { 30328 const dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .useDispatch */ .wA)(); 30329 const m = mappers || defaultMappers; 30330 const selectListingProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(makeSelectFacetsProps, [m]); 30331 const dispatchProps = { 30332 clearFilters: filterKey => dispatch(withMappers(clearFilters$1(filterKey), m)), 30333 updateCurrentFacet: facet => dispatch(withMappers(updateCurrentFacet$1(facet), m)), 30334 updateCurrentTab: id => withMappers(updateCurrentTab$1(id), m), 30335 updatePageIndex: (pageIndex, scrollToElement) => dispatch(withMappers(updatePageIndex$1(pageIndex, scrollToElement), m)), 30336 updatePageSize: (pageSize, scrollToElement) => dispatch(withMappers(updatePageSize$1(pageSize, scrollToElement), m)), 30337 updateSearchTerm: term => dispatch(withMappers(updateSearchTerm$1(term), m)), 30338 updateSelectedFilters: (filter, key, isUnknownItem = false, scrollToElement) => dispatch(withMappers(updateSelectedFilters(filter, key, isUnknownItem, scrollToElement), m)), 30339 updateSortOrder: orderBy => dispatch(withMappers(updateSortOrder$1(orderBy), m)) 30340 }; 30341 const { 30342 composition, 30343 currentComposition, 30344 currentFacet, 30345 currentPageIndex, 30346 currentTabIndex, 30347 facet, 30348 facets, 30349 facetsTotalCount, 30350 facetTitles, 30351 featured, 30352 filters, 30353 isLoading, 30354 localisedCurrent, 30355 paging, 30356 pageIsLoading, 30357 results, 30358 resultsInfo, 30359 searchTerm, 30360 searchTotalCount, 30361 selectedFilters, 30362 sortOrder, 30363 tabsAndFacets, 30364 totalCount 30365 } = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .useSelector */ .d4)(state => selectListingProps(state, m)); 30366 return { 30367 composition, 30368 currentComposition, 30369 currentFacet, 30370 currentPageIndex, 30371 currentTabIndex, 30372 facet, 30373 facets, 30374 facetsTotalCount, 30375 facetTitles, 30376 featured, 30377 filters, 30378 isLoading, 30379 localisedCurrent, 30380 paging, 30381 pageIsLoading, 30382 results, 30383 resultsInfo, 30384 searchTerm, 30385 searchTotalCount, 30386 selectedFilters, 30387 sortOrder, 30388 tabsAndFacets, 30389 totalCount, 30390 ...dispatchProps 30391 }; 30392}; 30393 30394const { 30395 getCurrent, 30396 getFeaturedResults, 30397 getIsLoading, 30398 getListing, 30399 getLocalisedCurrent, 30400 getPageIndex, 30401 getPageIsLoading, 30402 getQueryParameter, 30403 getRenderableFilters, 30404 getSearchTerm 30405} = selectListing; 30406const makeSelectListingProps = () => (0,reselect__WEBPACK_IMPORTED_MODULE_2__/* .createSelector */ .Mz)(state => state, (_, mappers) => mappers, (state, mappers) => ({ 30407 composition: getComposition(state), 30408 currentComposition: getCurrentComposition(state), 30409 currentListing: getCurrent(state), 30410 currentPageIndex: getPageIndex(state), 30411 featured: getFeaturedResults(state), 30412 filters: getRenderableFilters(state), 30413 isLoading: getIsLoading(state), 30414 listing: getListing(state), 30415 localisedCurrent: getLocalisedCurrent(state), 30416 pageIsLoading: getPageIsLoading(state), 30417 paging: getPaging(state, '', Context.listings, 'js'), 30418 results: getResults(state, '', Context.listings, 'js'), 30419 resultsInfo: typeof mappers.resultsInfo === 'function' && mappers.resultsInfo(state) || getResultsInfo(state), 30420 searchTerm: getSearchTerm(state), 30421 selectedFilters: getSelectedFilters(state, '', Context.listings, 'js'), 30422 sortOrder: getQueryParameter({ 30423 state 30424 }, 'dynamicOrderBy', []) 30425})); 30426const useListing = ({ 30427 mappers 30428} = { 30429 id: '' 30430}) => { 30431 const dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .useDispatch */ .wA)(); 30432 const m = mappers || defaultMappers; 30433 const selectListingProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(makeSelectListingProps, [m]); 30434 const dispatchProps = { 30435 clearFilters: filterKey => dispatch(withMappers(clearFilters$1(filterKey), m)), 30436 updateCurrentFacet: facet => dispatch(withMappers(updateCurrentFacet$1(facet), m)), 30437 updatePageIndex: (pageIndex, scrollToElement) => dispatch(withMappers(updatePageIndex$1(pageIndex, scrollToElement), m)), 30438 updatePageSize: (pageSize, scrollToElement) => dispatch(withMappers(updatePageSize$1(pageSize, scrollToElement), m)), 30439 updateSearchTerm: term => dispatch(withMappers(updateSearchTerm$1(term), m)), 30440 updateSelectedFilters: (filter, key, isUnknownItem = false, scrollToElement) => dispatch(withMappers(updateSelectedFilters(filter, key, isUnknownItem, scrollToElement), m)), 30441 updateSortOrder: orderBy => dispatch(withMappers(updateSortOrder$1(orderBy), m)) 30442 }; 30443 const { 30444 composition, 30445 currentComposition, 30446 currentListing, 30447 currentPageIndex, 30448 featured, 30449 filters, 30450 isLoading, 30451 listing, 30452 localisedCurrent, 30453 paging, 30454 pageIsLoading, 30455 results, 30456 resultsInfo, 30457 searchTerm, 30458 selectedFilters, 30459 sortOrder 30460 }
30460 = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .useSelector */ .d4)(state => selectListingProps(state, m)); 30461 return { 30462 composition, 30463 currentComposition, 30464 currentListing, 30465 currentPageIndex, 30466 featured, 30467 filters, 30468 isLoading, 30469 listing, 30470 localisedCurrent, 30471 pageIsLoading, 30472 paging, 30473 results, 30474 resultsInfo, 30475 searchTerm, 30476 selectedFilters, 30477 sortOrder, 30478 title: listing.title, 30479 ...dispatchProps 30480 }; 30481}; 30482 30483class CachedTaxonomyLookup { 30484 constructor() { 30485 this.cache = new _ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_6__.L(); 30486 this.taxonomyLookup = {}; 30487 } 30488 getTaxonomyNodeByPath(path, project, env) { 30489 const client = contensis_delivery_api__WEBPACK_IMPORTED_MODULE_7__.Client.create((0,_ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_6__.g)(project, env)); 30490 return this.request(`[TAXONOMY] ${path}`, () => client.taxonomy.getNodeByPath({ 30491 path: path, 30492 order: 'defined', 30493 childDepth: 2 30494 }).then(node => this.extendTaxonomyNode(node))); 30495 } 30496 request(key, execute) { 30497 if (!this.cache.get(key) || typeof window == 'undefined') { 30498 let promise = execute(); 30499 this.cache.set(key, promise); 30500 promise.catch(() => { 30501 this.cache.remove(key); 30502 }); 30503 } 30504 return this.cache.get(key); 30505 } 30506 extendTaxonomyNode(node) { 30507 let id = this.getTaxonomyId(node); 30508 this.taxonomyLookup[id] = node.key; 30509 return { 30510 ...node, 30511 id, 30512 children: node.children ? node.children.map(n => this.extendTaxonomyNode(n)) : null 30513 }; 30514 } 30515 getTaxonomyId(node) { 30516 if (node.key) { 30517 let parts = node.key.split('/'); 30518 return parts[parts.length - 1]; 30519 } 30520 return ''; 30521 } 30522} 30523 30524/** @deprecated Taxonomy is deprecated in Contensis, code remains 30525 * to support any legacy implementations using Taxonomy in their search */ 30526const cachedTaxonomyLookup = new CachedTaxonomyLookup(); 30527 30528const DataFormats = { 30529 entry: 'entry'}; 30530const FilterExpressionTypes = { 30531 contentType: 'contentType', 30532 field: 'field' 30533}; 30534const sys = { 30535 allUris: 'sys.allUris', 30536 contentTypeId: 'sys.contentTypeId', 30537 dataFormat: 'sys.dataFormat', 30538 filename: 'sys.properties.filename', 30539 id: 'sys.id', 30540 includeInSearch: 'sys.metadata.includeInSearch', 30541 language: 'sys.language', 30542 uri: 'sys.uri', 30543 versionStatus: 'sys.versionStatus' 30544}; 30545const Fields = { 30546 entryDescription: 'entryDescription', 30547 entryTitle: 'entryTitle', 30548 keywords: 'keywords', 30549 searchContent: 'searchContent', 30550 sys}; 30551 30552const fieldExpression = (field, value, operator = 'equalTo', weight, fuzzySearch = false) => { 30553 if (!field || !value || Array.isArray(value) && value.length === 0) return []; 30554 if (Array.isArray(field)) 30555 // If an array of fieldIds have been provided, call self for each fieldId 30556 // to generate expressions that are combined with an 'or' operator 30557 return [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.or(...field.map(fieldId => fieldExpression(fieldId, value, operator, weight, fuzzySearch)).flat())]; 30558 if (operator === 'between') return between(field, value); 30559 if (Array.isArray(value)) return equalToOrIn(field, value, operator, fuzzySearch);else return !weight ? equalToOrIn(field, value, operator, fuzzySearch) : [equalToOrIn(field, value, operator, fuzzySearch)[0].weight(weight)]; 30560}; 30561const contentTypeIdExpression = (contentTypeIds, webpageTemplates, assetTypes) => { 30562 const expressions = []; 30563 if (!contentTypeIds && !webpageTemplates && !assetTypes) return expressions; 30564 const ids = [...new Set([...(contentTypeIds || []), ...(webpageTemplates || []), ...(assetTypes || [])])]; 30565 30566 /** 30567 * We have an array of contentTypeIds some may be prefixed with a "!" 30568 * to indicate this is a "not" expression 30569 */ 30570 const withContentTypeIds = ids.filter(c => !c.startsWith('!')); 30571 const notContentTypeIds = ids.filter(c => c.startsWith('!')).map(id => id.substring(1)); 30572 if (withContentTypeIds.length > 0) { 30573 expressions.push(...fieldExpression(Fields.sys.contentTypeId, withContentTypeIds)); 30574 } 30575 if (notContentTypeIds.length > 0) { 30576 expressions.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.not(fieldExpression(Fields.sys.contentTypeId, notContentTypeIds)[0])); 30577 } 30578 return expressions; 30579}; 30580const filterExpressions = (filters, isOptional = false) => { 30581 if (!filters) return []; 30582 const expressions = []; 30583 filters.map(selectedFilter => { 30584 if (selectedFilter.logicOperator === 'and') 30585 // using 'and' logic operator we loop through each filter 30586 // and loop through all values to add an expression for each filter value
30587 selectedFilter.values.forEach(value => expressions.push(...fieldExpression(selectedFilter.key, value, selectedFilter.fieldOperator || 'equalTo')));else if (selectedFilter.logicOperator === 'not') { 30588 const fieldExpressions = fieldExpression(selectedFilter.key, selectedFilter.values, selectedFilter.fieldOperator || 'in'); 30589 fieldExpressions.forEach(expr => { 30590 expressions.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.not(expr)); 30591 }); 30592 } 30593 // using 'or' logic operator we loop over each filter 30594 // and simply add the array of values to an expression with an 'in' operator 30595 else expressions.push(...fieldExpression(selectedFilter.key, selectedFilter.values, selectedFilter.fieldOperator || 'in')); 30596 if (isOptional) expressions.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.not(fieldExpression(selectedFilter.key, true, 'exists')[0])); 30597 }); 30598 return expressions; 30599}; 30600 30601/** @deprecated since v4 - contentTypeIdExpression produces a simpler more efficient query 30602 * now and negates the need for supplying `sys.dataFormat` with `sys.contentTypeId` */ 30603const dataFormatExpression = (contentTypeIds, dataFormat = DataFormats.entry) => { 30604 if (contentTypeIds && contentTypeIds.length > 0) { 30605 /** 30606 * We have an array of contentTypeIds some may be prefixed with a "!" 30607 * to indicate this is a "not" expression 30608 */ 30609 const withContentTypeIds = contentTypeIds.filter(c => !c.startsWith('!')); 30610 const notContentTypeIds = contentTypeIds.filter(c => c.startsWith('!')).map(id => id.substring(1)); 30611 const andExpr = contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.and(); 30612 const dataFormatExpr = fieldExpression(Fields.sys.dataFormat, dataFormat)[0]; 30613 const withExpr = fieldExpression(Fields.sys.contentTypeId, withContentTypeIds)[0]; 30614 const notExpr = contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.not(fieldExpression(Fields.sys.contentTypeId, notContentTypeIds)[0]); 30615 andExpr.add(dataFormatExpr); 30616 if (withContentTypeIds.length > 0 && withExpr) andExpr.add(withExpr); 30617 if (notContentTypeIds.length > 0 && notExpr) andExpr.add(notExpr); 30618 return [andExpr]; 30619 } 30620 return []; 30621}; 30622const featuredResultsExpression = ({ 30623 contentTypeId, 30624 fieldId, 30625 fieldValue = true 30626} = {}) => { 30627 const expressions = []; 30628 if (contentTypeId) { 30629 expressions.push(...contentTypeIdExpression(Array.isArray(contentTypeId) ? contentTypeId : [contentTypeId])); 30630 } 30631 if (fieldId && fieldValue) { 30632 expressions.push(...fieldExpression(fieldId, fieldValue)); 30633 } 30634 return expressions; 30635}; 30636const languagesExpression = languages => fieldExpression(Fields.sys.language, languages); 30637const includeInSearchExpressions = (webpageTemplates, includeInSearchFields) => { 30638 const expressions = []; 30639 // Or include this expression if we have explicity specified non-default includeInSearch fields 30640 if (Array.isArray(includeInSearchFields)) expressions.push(...includeInSearchFields.map(includeInSearchField => contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.or(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.and(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.exists(includeInSearchField, true), contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.equalTo(includeInSearchField, true)), contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.exists(includeInSearchField, false)))); 30641 30642 // If webpageTemplates have been specified, include this expression 30643 // with the default includeInSearch field from classic Contensis. 30644 if (Array.isArray(webpageTemplates) && webpageTemplates.length > 0) expressions.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.or(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.and(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.exists(Fields.sys.includeInSearch, true), contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.equalTo(Fields.sys.includeInSearch, true)), contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.exists(Fields.sys.includeInSearch, false))); 30645 return expressions; 30646}; 30647const defaultExpressions = versionStatus => { 30648 return [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.equalTo(Fields.sys.versionStatus, versionStatus)]; 30649}; 30650const includeIdsExpression = includeIds => { 30651 if (Array.isArray(includeIds) && includeIds.length > 0) { 30652 return fieldExpression(Fields.sys.id, includeIds); 30653 } else return []; 30654}; 30655const excludeIdsExpression = excludeIds => { 30656 if (Array.isArray(excludeIds) && excludeIds.length > 0) { 30657 const [expr] = fieldExpression(Fields.sys.id, excludeIds); 30658 return [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.not(expr)]; 30659 } else return []; 30660}; 30661const orderByExpression = orderBy => { 30662 let expression; 30663 if (orderBy && orderBy.length > 0) { 30664 expression = contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.OrderBy; 30665 for (const ob of orderBy) { 30666 var _expression, _expression2; 30667 expression = ob.startsWith('-') ? (_expression = expression) === null || _expression === void 0 ? void 0 : _expression.desc(ob.substring(1)) : (_expression2 = expression) === null || _expression2 === void 0 ? void 0 : _expression2.asc(ob); 30668 } 30669 } 30670 return expression; 30671}; 30672const equalToOrIn = (field, value, operator = 'equalTo', fuzzySearch = false) => { 30673 if (value.length === 0) return []; 30674 if (Array.isArray(value)) { 30675 if (operator === 'equalTo' || operator === 'in') return [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.in(field, ...value)]; 30676 const expressions = value.map(innerValue => { 30677 var _between, _distanceWithin; 30678 switch (operator) { 30679 case 'between': 30680 return (_between = between(field, innerValue)) === null || _between === void 0 ? void 0 : _between[0]; 30681 case 'distanceWithin': 30682 return (_distanceWithin = distanceWithin(field, innerValue)) === null || _distanceWithin === void 0 ? void 0 : _distanceWithin[0]; 30683 case 'exists': 30684 return contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.exists(field, innerValue); 30685 case 'freeText': 30686 // TODO: Potentially needs further implementation of new options 30687 return contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](field, innerValue, fuzzySearch, undefined); 30688 default: 30689 return contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](field, innerValue); 30690 } 30691 }); 30692 return (expressions === null || expressions === void 0 ? void 0 : expressions.length) > 1 ? [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.or(...expressions)] : expressions || []; 30693 } 30694 switch (operator) { 30695 case 'between': 30696 return between(field, value); 30697 case 'distanceWithin': 30698 return distanceWithin(field, value); 30699 case 'freeText': 30700 // TODO: Potentially needs further implementation of new options 30701 return [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.freeText(field, value, fuzzySearch, undefined)]; 30702 default: 30703 return [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](field, value)]; 30704 } 30705}; 30706const between = (field, value) => { 30707 const handle = betweenValue => { 30708 const valArr = betweenValue.split('--'); 30709 if (valArr.length > 1) { 30710 const [minimum, maximum] = valArr; 30711 return contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.between(field, minimum, maximum); 30712 } else { 30713 console.log(`[search] You have supplied only one value to a "between" operator which must have two values. Your supplied value "${valArr.length && valArr[0]}" has been discarded.`); 30714 return false;
30715 } 30716 }; 30717 if (value.length === 0) return []; 30718 if (Array.isArray(value)) return [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.or(...value.map(handle).filter(bc => bc !== false))]; 30719 const op = handle(value); 30720 return op ? [op] : []; 30721}; 30722const distanceWithin = (field, value) => { 30723 const handle = distanceValue => { 30724 const valArr = distanceValue.split(' '); 30725 if (valArr.length > 1) { 30726 const [lat, lon] = valArr; 30727 return contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.distanceWithin(field, Number(lat), Number(lon), (valArr === null || valArr === void 0 ? void 0 : valArr[2]) || '10mi'); 30728 } else { 30729 console.log(`[search] You have supplied only one value to a "distanceWithin" operator which must be made up of "lat,lon,distance". Your supplied value "${valArr.length && valArr[0]}" has been discarded.`); 30730 return false; 30731 } 30732 }; 30733 if (value.length === 0) return []; 30734 if (Array.isArray(value)) return [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.or(...value.map(handle).filter(bc => bc !== false))]; 30735 const op = handle(value); 30736 return op ? [op] : []; 30737}; 30738 30739/** 30740 * Accept HTTP style objects and map them to 30741 * their equivalent JS client "Op" expressions 30742 * @param {array} where the where array as you'd provide it to the HTTP API 30743 * @returns {array} array of constructed Delivery API Operators 30744 */ 30745const customWhereExpressions = where => { 30746 if (!where || !Array.isArray(where)) return []; 30747 30748 // Map each clause inside the where array 30749 return where.map(clause => { 30750 let expression; 30751 // Map through each property in the clause so we can 30752 // capture the values required and reconstruct them as 30753 // a Delivery API expression 30754 let operator; 30755 Object.keys(clause).map((key, idx) => { 30756 // The clause may contain only one key 30757 if (idx === 0) operator = key; 30758 const field = clause.field; 30759 const value = clause[Object.keys(clause).find(k => !['field', 'weight'].includes(k)) || '']; 30760 const weight = clause.weight; 30761 if (idx === 0) { 30762 if (operator === 'and' || operator === 'or') { 30763 // These are array expressions so we can call ourself recursively 30764 // to map these inner values to expressions 30765 const recurseExpr = customWhereExpressions(clause[operator]); 30766 expression = contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](...recurseExpr); 30767 } 30768 if (['not'].includes(operator)) { 30769 // A 'not' expression is an object with only one inner field and inner operator 30770 Object.keys(value).map((notKey, notIdx) => { 30771 const innerOperator = notKey; 30772 const innerValue = value[notKey]; 30773 const innerField = value.field; 30774 // Map the expression when we've looped and scoped to 30775 // the second property inside the clause 30776 if (notIdx === 1) expression = contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.not(makeJsExpression(innerOperator, innerField, innerValue)); 30777 }); 30778 } 30779 } 30780 // Map the expression when we've looped and scoped to 30781 // the second property inside the clause 30782 operator = Object.keys(clause).find(clauseKey => !['field', 'weight'].includes(clauseKey)); 30783 if (idx === 1) { 30784 expression = makeJsExpression(operator, field, value); 30785 if (typeof weight === 'number') expression = expression.weight(weight); 30786 } 30787 }); 30788 return expression; 30789 }); 30790}; 30791const makeJsExpression = (operator, field, value) => operator === 'freeText' || operator === 'contains' ? contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](field, value) : operator === 'in' ? contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](field, ...value) : operator === 'exists' ? contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](field, value) : operator === 'between' ? contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](field, value[0], value[1]) : operator === 'distanceWithin' ? contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](field, value === null || value === void 0 ? void 0 : value.lat, value === null || value === void 0 ? void 0 : value.lon, value === null || value === void 0 ? void 0 : value.distance) : contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op[operator](field, value); 30792const termExpressions = (searchTerm, weightedSearchFields, fuzzySearch, omitSearchFields = []) => { 30793 if (searchTerm && weightedSearchFields && weightedSearchFields.length > 0) { 30794 // Extract any phrases in quotes to array 30795 const quotedPhrases = (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.e)(searchTerm); 30796 30797 // Modify the search term to remove any quoted phrases to leave any remaining terms 30798 let modifiedSearchTerm = searchTerm;
30799 quotedPhrases.forEach(qp => modifiedSearchTerm = modifiedSearchTerm.replace(qp, '').replace('""', '').trim()); 30800 30801 // Push to the operators array to include in the query 30802 const operators = []; 30803 30804 // Helper functions to generate Op expressions 30805 const containsOp = (f, term) => fieldExpression(f.fieldId, (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.f)(term), 'contains', f.weight); 30806 const freeTextOp = (f, term) => fieldExpression(f.fieldId, (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.f)(term), 'freeText', f.weight, fuzzySearch); 30807 30808 // For each weighted search field 30809 weightedSearchFields.forEach(wsf => { 30810 // Push to field operators 30811 const fieldOperators = []; 30812 30813 // Add operator expressions for modified search term 30814 if (modifiedSearchTerm) { 30815 if ([Fields.keywords, Fields.sys.filename, Fields.sys.uri].includes(wsf.fieldId)) { 30816 fieldOperators.push(...containsOp(wsf, modifiedSearchTerm)); 30817 } else { 30818 if ([Fields.entryTitle].includes(wsf.fieldId)) { 30819 fieldOperators.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.or(...containsOp(wsf, modifiedSearchTerm), ...freeTextOp(wsf, modifiedSearchTerm))); 30820 } else { 30821 fieldOperators.push(...freeTextOp(wsf, modifiedSearchTerm)); 30822 } 30823 } 30824 } 30825 30826 // Add operator expressions for any quoted phrases 30827 quotedPhrases.forEach(qp => fieldOperators.push(...containsOp(wsf, qp))); 30828 30829 // If we are using multiple operators for a field we will 30830 // wrap each field inside an And operator so we will match 30831 // all terms/phrases rather than any terms/phrases 30832 if (fieldOperators.length > 1) { 30833 operators.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.and(...fieldOperators)); 30834 } else { 30835 operators.push(...fieldOperators); 30836 } 30837 }); 30838 30839 // Wrap operators in an Or operator 30840 const expressions = contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.or().addRange(operators); 30841 if (!omitSearchFields.find(sf => sf === Fields.searchContent)) 30842 // include "searchContent" field by default unless omitted 30843 return [expressions.add(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.freeText(Fields.searchContent, searchTerm, fuzzySearch))];else return [expressions]; 30844 } else if (searchTerm) { 30845 // Searching without weightedSearchFields defined will fall back 30846 // to a default set of search fields with arbritary weights set. 30847 30848 const exp = []; 30849 if (!omitSearchFields.find(sf => sf === Fields.entryTitle)) { 30850 exp.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.equalTo(Fields.entryTitle, searchTerm).weight(10)); 30851 exp.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.freeText(Fields.entryTitle, searchTerm, fuzzySearch).weight(2)); 30852 } 30853 if (!omitSearchFields.find(sf => sf === Fields.entryDescription)) exp.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.freeText(Fields.entryDescription, searchTerm, fuzzySearch).weight(2)); 30854 if (!omitSearchFields.find(sf => sf === Fields.keywords)) exp.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.contains(Fields.keywords, searchTerm).weight(2)); 30855 if (!omitSearchFields.find(sf => sf === Fields.sys.uri)) exp.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.contains(Fields.sys.uri, searchTerm).weight(2)); 30856 if (!omitSearchFields.find(sf => sf === Fields.sys.allUris)) exp.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.contains(Fields.sys.allUris, searchTerm)); 30857 if (!omitSearchFields.find(sf => sf === Fields.searchContent)) exp.push(contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.freeText(Fields.searchContent, searchTerm, fuzzySearch)); 30858 return [contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Op.or(...exp)]; 30859 } else { 30860 return []; 30861 } 30862}; 30863 30864var expressions = /*#__PURE__*/Object.freeze({ 30865 __proto__: null, 30866 contentTypeIdExpression: contentTypeIdExpression, 30867 customWhereExpressions: customWhereExpressions, 30868 dataFormatExpression: dataFormatExpression, 30869 defaultExpressions: defaultExpressions, 30870 excludeIdsExpression: excludeIdsExpression, 30871 featuredResultsExpression: featuredResultsExpression, 30872 fieldExpression: fieldExpression, 30873 filterExpressions: filterExpressions, 30874 includeIdsExpression: includeIdsExpression, 30875 includeInSearchExpressions: includeInSearchExpressions, 30876 languagesExpression: languagesExpression, 30877 orderByExpression: orderByExpression, 30878 termExpressions: termExpressions 30879}); 30880 30881const filterQuery = (contentTypeIds, languages, versionStatus, customWhere, pageSize = 100) => { 30882 const query = new contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Query(...[...contentTypeIdExpression(contentTypeIds), ...languagesExpression(languages), ...defaultExpressions(versionStatus), ...customWhereExpressions(customWhere)]); 30883 query.orderBy = contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.OrderBy.asc(Fields.entryTitle); 30884 query.pageSize = pageSize; 30885 return query; 30886}; 30887const searchQuery = ({ 30888 aggregations, 30889 assetTypes, 30890 contentTypeIds, 30891 customWhere, 30892 dynamicOrderBy, 30893 excludeIds, 30894 featuredResults, 30895 fieldLinkDepths, 30896 fields, 30897 filters, 30898 fuzzySearch, 30899 includeInSearchFields, 30900 languages, 30901 pageSize, 30902 pageIndex, 30903 omitDefaultSearchFields, 30904 orderBy, 30905 searchTerm, 30906 versionStatus, 30907 webpageTemplates, 30908 weightedSearchFields 30909}, isFeatured = false) => { 30910 let expressions = [...termExpressions(searchTerm, weightedSearchFields, fuzzySearch, omitDefaultSearchFields), ...defaultExpressions(versionStatus), ...includeInSearchExpressions(webpageTemplates, includeInSearchFields), ...languagesExpression(languages), ...customWhereExpressions(customWhere), ...excludeIdsExpression(excludeIds)]; 30911 if (isFeatured) expressions = [...expressions, ...featuredResultsExpression(featuredResults)]; 30912 if (!isFeatured || featuredResults && !featuredResults.contentTypeId) expressions = [...expressions, ...filterExpressions(filters), ...contentTypeIdExpression(contentTypeIds, webpageTemplates, assetTypes)]; 30913 const query = new contensis_core_api__WEBPACK_IMPORTED_MODULE_12__.Query(...expressions); 30914 if (!searchTerm) query.orderBy = orderByExpression(orderBy); 30915 if (dynamicOrderBy && dynamicOrderBy.length) query.orderBy = orderByExpression(dynamicOrderBy); 30916 if (Object.keys(fieldLinkDepths || {}).length && !isFeatured) query.fieldLinkDepths = fieldLinkDepths; 30917 if (fields !== null && fields !== void 0 && fields.length && !isFeatured) query.fields = fields; 30918 if (Object.keys(aggregations || {}).length && !isFeatured) query.aggregations = aggregations; 30919 query.pageIndex = isFeatured ? 0 : pageIndex; 30920 query.pageSize = isFeatured && typeof featuredResults.count === 'number' ? featuredResults.count : pageSize; 30921 return query; 30922}; 30923 30924var queries = /*#__PURE__*/Object.freeze({ 30925 __proto__: null, 30926 filterQuery: filterQuery, 30927 searchQuery: searchQuery 30928}); 30929 30930/** 30931 * Removes all key-value entries from the list cache. 30932 * 30933 * @private 30934 * @name clear 30935 * @memberOf ListCache 30936 */ 30937 30938var _listCacheClear; 30939var hasRequired_listCacheClear; 30940 30941function require_listCacheClear () { 30942 if (hasRequired_listCacheClear) return _listCacheClear; 30943 hasRequired_listCacheClear = 1; 30944 function listCacheClear() { 30945 this.__data__ = []; 30946 this.size = 0; 30947 } 30948 30949 _listCacheClear = listCacheClear; 30950 return _listCacheClear; 30951} 30952
vendor: 8,163 bytes, lines 30953-31311
30953/** 30954 * Performs a 30955 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 30956 * comparison between two values to determine if they are equivalent. 30957 * 30958 * @static 30959 * @memberOf _ 30960 * @since 4.0.0 30961 * @category Lang 30962 * @param {*} value The value to compare. 30963 * @param {*} other The other value to compare. 30964 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 30965 * @example 30966 * 30967 * var object = { 'a': 1 }; 30968 * var other = { 'a': 1 }; 30969 * 30970 * _.eq(object, object); 30971 * // => true 30972 * 30973 * _.eq(object, other); 30974 * // => false 30975 * 30976 * _.eq('a', 'a'); 30977 * // => true 30978 * 30979 * _.eq('a', Object('a')); 30980 * // => false 30981 * 30982 * _.eq(NaN, NaN); 30983 * // => true 30984 */ 30985 30986var eq_1; 30987var hasRequiredEq; 30988 30989function requireEq () { 30990 if (hasRequiredEq) return eq_1; 30991 hasRequiredEq = 1; 30992 function eq(value, other) { 30993 return value === other || (value !== value && other !== other); 30994 } 30995 30996 eq_1 = eq; 30997 return eq_1; 30998} 30999 31000var _assocIndexOf; 31001var hasRequired_assocIndexOf; 31002 31003function require_assocIndexOf () { 31004 if (hasRequired_assocIndexOf) return _assocIndexOf; 31005 hasRequired_assocIndexOf = 1; 31006 var eq = requireEq(); 31007 31008 /** 31009 * Gets the index at which the `key` is found in `array` of key-value pairs. 31010 * 31011 * @private 31012 * @param {Array} array The array to inspect. 31013 * @param {*} key The key to search for. 31014 * @returns {number} Returns the index of the matched value, else `-1`. 31015 */ 31016 function assocIndexOf(array, key) { 31017 var length = array.length; 31018 while (length--) { 31019 if (eq(array[length][0], key)) { 31020 return length; 31021 } 31022 } 31023 return -1; 31024 } 31025 31026 _assocIndexOf = assocIndexOf; 31027 return _assocIndexOf; 31028} 31029 31030var _listCacheDelete; 31031var hasRequired_listCacheDelete; 31032 31033function require_listCacheDelete () { 31034 if (hasRequired_listCacheDelete) return _listCacheDelete; 31035 hasRequired_listCacheDelete = 1; 31036 var assocIndexOf = require_assocIndexOf(); 31037 31038 /** Used for built-in method references. */ 31039 var arrayProto = Array.prototype; 31040 31041 /** Built-in value references. */ 31042 var splice = arrayProto.splice; 31043 31044 /** 31045 * Removes `key` and its value from the list cache. 31046 * 31047 * @private 31048 * @name delete 31049 * @memberOf ListCache 31050 * @param {string} key The key of the value to remove. 31051 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 31052 */ 31053 function listCacheDelete(key) { 31054 var data = this.__data__, 31055 index = assocIndexOf(data, key); 31056 31057 if (index < 0) { 31058 return false; 31059 } 31060 var lastIndex = data.length - 1; 31061 if (index == lastIndex) { 31062 data.pop(); 31063 } else { 31064 splice.call(data, index, 1); 31065 } 31066 --this.size; 31067 return true; 31068 } 31069 31070 _listCacheDelete = listCacheDelete; 31071 return _listCacheDelete; 31072} 31073 31074var _listCacheGet; 31075var hasRequired_listCacheGet; 31076 31077function require_listCacheGet () { 31078 if (hasRequired_listCacheGet) return _listCacheGet; 31079 hasRequired_listCacheGet = 1; 31080 var assocIndexOf = require_assocIndexOf(); 31081 31082 /** 31083 * Gets the list cache value for `key`. 31084 * 31085 * @private 31086 * @name get 31087 * @memberOf ListCache 31088 * @param {string} key The key of the value to get. 31089 * @returns {*} Returns the entry value. 31090 */ 31091 function listCacheGet(key) { 31092 var data = this.__data__, 31093 index = assocIndexOf(data, key); 31094 31095 return index < 0 ? undefined : data[index][1]; 31096 } 31097 31098 _listCacheGet = listCacheGet; 31099 return _listCacheGet; 31100} 31101 31102var _listCacheHas; 31103var hasRequired_listCacheHas; 31104 31105function require_listCacheHas () { 31106 if (hasRequired_listCacheHas) return _listCacheHas; 31107 hasRequired_listCacheHas = 1; 31108 var assocIndexOf = require_assocIndexOf(); 31109 31110 /** 31111 * Checks if a list cache value for `key` exists. 31112 * 31113 * @private 31114 * @name has 31115 * @memberOf ListCache 31116 * @param {string} key The key of the entry to check. 31117 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 31118 */ 31119 function listCacheHas(key) { 31120 return assocIndexOf(this.__data__, key) > -1; 31121 } 31122 31123 _listCacheHas = listCacheHas; 31124 return _listCacheHas; 31125} 31126 31127var _listCacheSet; 31128var hasRequired_listCacheSet; 31129 31130function require_listCacheSet () { 31131 if (hasRequired_listCacheSet) return _listCacheSet; 31132 hasRequired_listCacheSet = 1; 31133 var assocIndexOf = require_assocIndexOf(); 31134 31135 /** 31136 * Sets the list cache `key` to `value`. 31137 * 31138 * @private 31139 * @name set 31140 * @memberOf ListCache 31141 * @param {string} key The key of the value to set. 31142 * @param {*} value The value to set. 31143 * @returns {Object} Returns the list cache instance. 31144 */ 31145 function listCacheSet(key, value) { 31146 var data = this.__data__, 31147 index = assocIndexOf(data, key); 31148 31149 if (index < 0) { 31150 ++this.size; 31151 data.push([key, value]); 31152 } else { 31153 data[index][1] = value; 31154 } 31155 return this; 31156 } 31157 31158 _listCacheSet = listCacheSet; 31159 return _listCacheSet; 31160} 31161 31162var _ListCache; 31163var hasRequired_ListCache; 31164 31165function require_ListCache () { 31166 if (hasRequired_ListCache) return _ListCache; 31167 hasRequired_ListCache = 1; 31168 var listCacheClear = require_listCacheClear(), 31169 listCacheDelete = require_listCacheDelete(), 31170 listCacheGet = require_listCacheGet(), 31171 listCacheHas = require_listCacheHas(), 31172 listCacheSet = require_listCacheSet(); 31173 31174 /** 31175 * Creates an list cache object. 31176 * 31177 * @private 31178 * @constructor 31179 * @param {Array} [entries] The key-value pairs to cache. 31180 */ 31181 function ListCache(entries) { 31182 var index = -1, 31183 length = entries == null ? 0 : entries.length; 31184 31185 this.clear(); 31186 while (++index < length) { 31187 var entry = entries[index]; 31188 this.set(entry[0], entry[1]); 31189 } 31190 } 31191 31192 // Add methods to `ListCache`. 31193 ListCache.prototype.clear = listCacheClear; 31194 ListCache.prototype['delete'] = listCacheDelete; 31195 ListCache.prototype.get = listCacheGet; 31196 ListCache.prototype.has = listCacheHas; 31197 ListCache.prototype.set = listCacheSet; 31198 31199 _ListCache = ListCache; 31200 return _ListCache; 31201} 31202 31203var _stackClear; 31204var hasRequired_stackClear; 31205 31206function require_stackClear () { 31207 if (hasRequired_stackClear) return _stackClear; 31208 hasRequired_stackClear = 1; 31209 var ListCache = require_ListCache(); 31210 31211 /** 31212 * Removes all key-value entries from the stack. 31213 * 31214 * @private 31215 * @name clear 31216 * @memberOf Stack 31217 */ 31218 function stackClear() { 31219 this.__data__ = new ListCache; 31220 this.size = 0; 31221 } 31222 31223 _stackClear = stackClear; 31224 return _stackClear; 31225} 31226 31227/** 31228 * Removes `key` and its value from the stack. 31229 * 31230 * @private 31231 * @name delete 31232 * @memberOf Stack 31233 * @param {string} key The key of the value to remove. 31234 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 31235 */ 31236 31237var _stackDelete; 31238var hasRequired_stackDelete; 31239 31240function require_stackDelete () { 31241 if (hasRequired_stackDelete) return _stackDelete; 31242 hasRequired_stackDelete = 1; 31243 function stackDelete(key) { 31244 var data = this.__data__, 31245 result = data['delete'](key); 31246 31247 this.size = data.size; 31248 return result; 31249 } 31250 31251 _stackDelete = stackDelete; 31252 return _stackDelete; 31253} 31254 31255/** 31256 * Gets the stack value for `key`. 31257 * 31258 * @private 31259 * @name get 31260 * @memberOf Stack 31261 * @param {string} key The key of the value to get. 31262 * @returns {*} Returns the entry value. 31263 */ 31264 31265var _stackGet; 31266var hasRequired_stackGet; 31267 31268function require_stackGet () { 31269 if (hasRequired_stackGet) return _stackGet; 31270 hasRequired_stackGet = 1; 31271 function stackGet(key) { 31272 return this.__data__.get(key); 31273 } 31274 31275 _stackGet = stackGet; 31276 return _stackGet; 31277} 31278 31279/** 31280 * Checks if a stack value for `key` exists. 31281 * 31282 * @private 31283 * @name has 31284 * @memberOf Stack 31285 * @param {string} key The key of the entry to check. 31286 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 31287 */ 31288 31289var _stackHas; 31290var hasRequired_stackHas; 31291 31292function require_stackHas () { 31293 if (hasRequired_stackHas) return _stackHas; 31294 hasRequired_stackHas = 1; 31295 function stackHas(key) { 31296 return this.__data__.has(key); 31297 } 31298 31299 _stackHas = stackHas; 31300 return _stackHas; 31301} 31302 31303/** Detect free variable `global` from Node.js. */ 31304 31305var _freeGlobal; 31306var hasRequired_freeGlobal; 31307 31308function require_freeGlobal () { 31309 if (hasRequired_freeGlobal) return _freeGlobal; 31310 hasRequired_freeGlobal = 1; 31311 var freeGlobal = typeof _commonjsHelpers_BFTU3MAI_js__WEBPACK_IMPORTED_MODULE_16__.c == 'object' && _commonjsHelpers_BFTU3MAI_js__WEBPACK_IMPORTED_MODULE_16__.c && _commonjsHelpers_BFTU3MAI_js__WEBPACK_IMPORTED_MODULE_16__.c.Object === Object && _commonjsHelpers_BFTU3MAI_js__WEBPACK_IMPORTED_MODULE_16__.c
vendor: 22,959 bytes, lines 31311-32281
31311; 31312 31313 _freeGlobal = freeGlobal; 31314 return _freeGlobal; 31315} 31316 31317var _root; 31318var hasRequired_root; 31319 31320function require_root () { 31321 if (hasRequired_root) return _root; 31322 hasRequired_root = 1; 31323 var freeGlobal = require_freeGlobal(); 31324 31325 /** Detect free variable `self`. */ 31326 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 31327 31328 /** Used as a reference to the global object. */ 31329 var root = freeGlobal || freeSelf || Function('return this')(); 31330 31331 _root = root; 31332 return _root; 31333} 31334 31335var _Symbol; 31336var hasRequired_Symbol; 31337 31338function require_Symbol () { 31339 if (hasRequired_Symbol) return _Symbol; 31340 hasRequired_Symbol = 1; 31341 var root = require_root(); 31342 31343 /** Built-in value references. */ 31344 var Symbol = root.Symbol; 31345 31346 _Symbol = Symbol; 31347 return _Symbol; 31348} 31349 31350var _getRawTag; 31351var hasRequired_getRawTag; 31352 31353function require_getRawTag () { 31354 if (hasRequired_getRawTag) return _getRawTag; 31355 hasRequired_getRawTag = 1; 31356 var Symbol = require_Symbol(); 31357 31358 /** Used for built-in method references. */ 31359 var objectProto = Object.prototype; 31360 31361 /** Used to check objects for own properties. */ 31362 var hasOwnProperty = objectProto.hasOwnProperty; 31363 31364 /** 31365 * Used to resolve the 31366 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 31367 * of values. 31368 */ 31369 var nativeObjectToString = objectProto.toString; 31370 31371 /** Built-in value references. */ 31372 var symToStringTag = Symbol ? Symbol.toStringTag : undefined; 31373 31374 /** 31375 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 31376 * 31377 * @private 31378 * @param {*} value The value to query. 31379 * @returns {string} Returns the raw `toStringTag`. 31380 */ 31381 function getRawTag(value) { 31382 var isOwn = hasOwnProperty.call(value, symToStringTag), 31383 tag = value[symToStringTag]; 31384 31385 try { 31386 value[symToStringTag] = undefined; 31387 var unmasked = true; 31388 } catch (e) {} 31389 31390 var result = nativeObjectToString.call(value); 31391 if (unmasked) { 31392 if (isOwn) { 31393 value[symToStringTag] = tag; 31394 } else { 31395 delete value[symToStringTag]; 31396 } 31397 } 31398 return result; 31399 } 31400 31401 _getRawTag = getRawTag; 31402 return _getRawTag; 31403} 31404 31405/** Used for built-in method references. */ 31406 31407var _objectToString; 31408var hasRequired_objectToString; 31409 31410function require_objectToString () { 31411 if (hasRequired_objectToString) return _objectToString; 31412 hasRequired_objectToString = 1; 31413 var objectProto = Object.prototype; 31414 31415 /** 31416 * Used to resolve the 31417 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 31418 * of values. 31419 */ 31420 var nativeObjectToString = objectProto.toString; 31421 31422 /** 31423 * Converts `value` to a string using `Object.prototype.toString`. 31424 * 31425 * @private 31426 * @param {*} value The value to convert. 31427 * @returns {string} Returns the converted string. 31428 */ 31429 function objectToString(value) { 31430 return nativeObjectToString.call(value); 31431 } 31432 31433 _objectToString = objectToString; 31434 return _objectToString; 31435} 31436 31437var _baseGetTag; 31438var hasRequired_baseGetTag; 31439 31440function require_baseGetTag () { 31441 if (hasRequired_baseGetTag) return _baseGetTag; 31442 hasRequired_baseGetTag = 1; 31443 var Symbol = require_Symbol(), 31444 getRawTag = require_getRawTag(), 31445 objectToString = require_objectToString(); 31446 31447 /** `Object#toString` result references. */ 31448 var nullTag = '[object Null]', 31449 undefinedTag = '[object Undefined]'; 31450 31451 /** Built-in value references. */ 31452 var symToStringTag = Symbol ? Symbol.toStringTag : undefined; 31453 31454 /** 31455 * The base implementation of `getTag` without fallbacks for buggy environments. 31456 * 31457 * @private 31458 * @param {*} value The value to query. 31459 * @returns {string} Returns the `toStringTag`. 31460 */ 31461 function baseGetTag(value) { 31462 if (value == null) { 31463 return value === undefined ? undefinedTag : nullTag; 31464 } 31465 return (symToStringTag && symToStringTag in Object(value)) 31466 ? getRawTag(value) 31467 : objectToString(value); 31468 } 31469 31470 _baseGetTag = baseGetTag; 31471 return _baseGetTag; 31472} 31473 31474/** 31475 * Checks if `value` is the 31476 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 31477 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 31478 * 31479 * @static 31480 * @memberOf _ 31481 * @since 0.1.0 31482 * @category Lang 31483 * @param {*} value The value to check. 31484 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 31485 * @example 31486 * 31487 * _.isObject({}); 31488 * // => true 31489 * 31490 * _.isObject([1, 2, 3]); 31491 * // => true 31492 * 31493 * _.isObject(_.noop); 31494 * // => true 31495 * 31496 * _.isObject(null); 31497 * // => false 31498 */ 31499 31500var isObject_1; 31501var hasRequiredIsObject; 31502 31503function requireIsObject () { 31504 if (hasRequiredIsObject) return isObject_1; 31505 hasRequiredIsObject = 1; 31506 function isObject(value) { 31507 var type = typeof value; 31508 return value != null && (type == 'object' || type == 'function'); 31509 } 31510 31511 isObject_1 = isObject; 31512 return isObject_1; 31513} 31514 31515var isFunction_1; 31516var hasRequiredIsFunction; 31517 31518function requireIsFunction () { 31519 if (hasRequiredIsFunction) return isFunction_1; 31520 hasRequiredIsFunction = 1; 31521 var baseGetTag = require_baseGetTag(), 31522 isObject = requireIsObject(); 31523 31524 /** `Object#toString` result references. */ 31525 var asyncTag = '[object AsyncFunction]', 31526 funcTag = '[object Function]', 31527 genTag = '[object GeneratorFunction]', 31528 proxyTag = '[object Proxy]'; 31529 31530 /** 31531 * Checks if `value` is classified as a `Function` object. 31532 * 31533 * @static 31534 * @memberOf _ 31535 * @since 0.1.0 31536 * @category Lang 31537 * @param {*} value The value to check. 31538 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 31539 * @example 31540 * 31541 * _.isFunction(_); 31542 * // => true 31543 * 31544 * _.isFunction(/abc/); 31545 * // => false 31546 */ 31547 function isFunction(value) { 31548 if (!isObject(value)) { 31549 return false; 31550 } 31551 // The use of `Object#toString` avoids issues with the `typeof` operator 31552 // in Safari 9 which returns 'object' for typed arrays and other constructors. 31553 var tag = baseGetTag(value); 31554 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 31555 } 31556 31557 isFunction_1 = isFunction; 31558 return isFunction_1; 31559} 31560 31561var _coreJsData; 31562var hasRequired_coreJsData; 31563 31564function require_coreJsData () { 31565 if (hasRequired_coreJsData) return _coreJsData; 31566 hasRequired_coreJsData = 1; 31567 var root = require_root(); 31568 31569 /** Used to detect overreaching core-js shims. */ 31570 var coreJsData = root['__core-js_shared__']; 31571 31572 _coreJsData = coreJsData; 31573 return _coreJsData; 31574} 31575 31576var _isMasked; 31577var hasRequired_isMasked; 31578 31579function require_isMasked () { 31580 if (hasRequired_isMasked) return _isMasked; 31581 hasRequired_isMasked = 1; 31582 var coreJsData = require_coreJsData(); 31583 31584 /** Used to detect methods masquerading as native. */ 31585 var maskSrcKey = (function() { 31586 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 31587 return uid ? ('Symbol(src)_1.' + uid) : ''; 31588 }()); 31589 31590 /** 31591 * Checks if `func` has its source masked. 31592 * 31593 * @private 31594 * @param {Function} func The function to check. 31595 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 31596 */ 31597 function isMasked(func) { 31598 return !!maskSrcKey && (maskSrcKey in func); 31599 } 31600 31601 _isMasked = isMasked; 31602 return _isMasked; 31603} 31604 31605/** Used for built-in method references. */ 31606 31607var _toSource; 31608var hasRequired_toSource; 31609 31610function require_toSource () { 31611 if (hasRequired_toSource) return _toSource; 31612 hasRequired_toSource = 1; 31613 var funcProto = Function.prototype; 31614 31615 /** Used to resolve the decompiled source of functions. */ 31616 var funcToString = funcProto.toString; 31617 31618 /** 31619 * Converts `func` to its source code. 31620 * 31621 * @private 31622 * @param {Function} func The function to convert. 31623 * @returns {string} Returns the source code. 31624 */ 31625 function toSource(func) { 31626 if (func != null) { 31627 try { 31628 return funcToString.call(func); 31629 } catch (e) {} 31630 try { 31631 return (func + ''); 31632 } catch (e) {} 31633 } 31634 return ''; 31635 } 31636 31637 _toSource = toSource; 31638 return _toSource; 31639} 31640 31641var _baseIsNative; 31642var hasRequired_baseIsNative; 31643 31644function require_baseIsNative () { 31645 if (hasRequired_baseIsNative) return _baseIsNative; 31646 hasRequired_baseIsNative = 1; 31647 var isFunction = requireIsFunction(), 31648 isMasked = require_isMasked(), 31649 isObject = requireIsObject(), 31650 toSource = require_toSource(); 31651 31652 /** 31653 * Used to match `RegExp` 31654 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 31655 */ 31656 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 31657 31658 /** Used to detect host constructors (Safari). */ 31659 var reIsHostCtor = /^\[object .+?Constructor\]$/; 31660 31661 /** Used for built-in method references. */ 31662 var funcProto = Function.prototype, 31663 objectProto = Object.prototype; 31664 31665 /** Used to resolve the decompiled source of functions. */ 31666 var funcToString = funcProto.toString; 31667 31668 /** Used to check objects for own properties. */ 31669 var hasOwnProperty = objectProto.hasOwnProperty; 31670 31671 /** Used to detect if a method is native. */ 31672 var reIsNative = RegExp('^' + 31673 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 31674 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 31675 ); 31676 31677 /** 31678 * The base implementation of `_.isNative` without bad shim checks. 31679 * 31680 * @private 31681 * @param {*} value The value to check. 31682 * @returns {boolean} Returns `true` if `value` is a native function, 31683 * else `false`. 31684 */ 31685 function baseIsNative(value) { 31686 if (!isObject(value) || isMasked(value)) { 31687 return false; 31688 } 31689 var pattern = isFunction(value) ? reIsNative : reIsHostCtor; 31690 return pattern.test(toSource(value)); 31691 } 31692 31693 _baseIsNative = baseIsNative; 31694 return _baseIsNative; 31695} 31696 31697/** 31698 * Gets the value at `key` of `object`. 31699 * 31700 * @private 31701 * @param {Object} [object] The object to query. 31702 * @param {string} key The key of the property to get. 31703 * @returns {*} Returns the property value. 31704 */ 31705 31706var _getValue; 31707var hasRequired_getValue; 31708 31709function require_getValue () { 31710 if (hasRequired_getValue) return _getValue; 31711 hasRequired_getValue = 1; 31712 function getValue(object, key) { 31713 return object == null ? undefined : object[key]; 31714 } 31715 31716 _getValue = getValue; 31717 return _getValue; 31718} 31719 31720var _getNative; 31721var hasRequired_getNative; 31722 31723function require_getNative () { 31724 if (hasRequired_getNative) return _getNative; 31725 hasRequired_getNative = 1; 31726 var baseIsNative = require_baseIsNative(), 31727 getValue = require_getValue(); 31728 31729 /** 31730 * Gets the native function at `key` of `object`. 31731 * 31732 * @private 31733 * @param {Object} object The object to query. 31734 * @param {string} key The key of the method to get. 31735 * @returns {*} Returns the function if it's native, else `undefined`. 31736 */ 31737 function getNative(object, key) { 31738 var value = getValue(object, key); 31739 return baseIsNative(value) ? value : undefined; 31740 } 31741 31742 _getNative = getNative; 31743 return _getNative; 31744} 31745 31746var _Map; 31747var hasRequired_Map; 31748 31749function require_Map () { 31750 if (hasRequired_Map) return _Map; 31751 hasRequired_Map = 1; 31752 var getNative = require_getNative(), 31753 root = require_root(); 31754 31755 /* Built-in method references that are verified to be native. */ 31756 var Map = getNative(root, 'Map'); 31757 31758 _Map = Map; 31759 return _Map; 31760} 31761 31762var _nativeCreate; 31763var hasRequired_nativeCreate; 31764 31765function require_nativeCreate () { 31766 if (hasRequired_nativeCreate) return _nativeCreate; 31767 hasRequired_nativeCreate = 1; 31768 var getNative = require_getNative(); 31769 31770 /* Built-in method references that are verified to be native. */ 31771 var nativeCreate = getNative(Object, 'create'); 31772 31773 _nativeCreate = nativeCreate; 31774 return _nativeCreate; 31775} 31776 31777var _hashClear; 31778var hasRequired_hashClear; 31779 31780function require_hashClear () { 31781 if (hasRequired_hashClear) return _hashClear; 31782 hasRequired_hashClear = 1; 31783 var nativeCreate = require_nativeCreate(); 31784 31785 /** 31786 * Removes all key-value entries from the hash. 31787 * 31788 * @private 31789 * @name clear 31790 * @memberOf Hash 31791 */ 31792 function hashClear() { 31793 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 31794 this.size = 0; 31795 } 31796 31797 _hashClear = hashClear; 31798 return _hashClear; 31799} 31800 31801/** 31802 * Removes `key` and its value from the hash. 31803 * 31804 * @private 31805 * @name delete 31806 * @memberOf Hash 31807 * @param {Object} hash The hash to modify. 31808 * @param {string} key The key of the value to remove. 31809 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 31810 */ 31811 31812var _hashDelete; 31813var hasRequired_hashDelete; 31814 31815function require_hashDelete () { 31816 if (hasRequired_hashDelete) return _hashDelete; 31817 hasRequired_hashDelete = 1; 31818 function hashDelete(key) { 31819 var result = this.has(key) && delete this.__data__[key]; 31820 this.size -= result ? 1 : 0; 31821 return result; 31822 } 31823 31824 _hashDelete = hashDelete; 31825 return _hashDelete; 31826} 31827 31828var _hashGet; 31829var hasRequired_hashGet; 31830 31831function require_hashGet () { 31832 if (hasRequired_hashGet) return _hashGet; 31833 hasRequired_hashGet = 1; 31834 var nativeCreate = require_nativeCreate(); 31835 31836 /** Used to stand-in for `undefined` hash values. */ 31837 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 31838 31839 /** Used for built-in method references. */ 31840 var objectProto = Object.prototype; 31841 31842 /** Used to check objects for own properties. */ 31843 var hasOwnProperty = objectProto.hasOwnProperty; 31844 31845 /** 31846 * Gets the hash value for `key`. 31847 * 31848 * @private 31849 * @name get 31850 * @memberOf Hash 31851 * @param {string} key The key of the value to get. 31852 * @returns {*} Returns the entry value. 31853 */ 31854 function hashGet(key) { 31855 var data = this.__data__; 31856 if (nativeCreate) { 31857 var result = data[key]; 31858 return result === HASH_UNDEFINED ? undefined : result; 31859 } 31860 return hasOwnProperty.call(data, key) ? data[key] : undefined; 31861 } 31862 31863 _hashGet = hashGet; 31864 return _hashGet; 31865} 31866 31867var _hashHas; 31868var hasRequired_hashHas; 31869 31870function require_hashHas () { 31871 if (hasRequired_hashHas) return _hashHas; 31872 hasRequired_hashHas = 1; 31873 var nativeCreate = require_nativeCreate(); 31874 31875 /** Used for built-in method references. */ 31876 var objectProto = Object.prototype; 31877 31878 /** Used to check objects for own properties. */ 31879 var hasOwnProperty = objectProto.hasOwnProperty; 31880 31881 /** 31882 * Checks if a hash value for `key` exists. 31883 * 31884 * @private 31885 * @name has 31886 * @memberOf Hash 31887 * @param {string} key The key of the entry to check. 31888 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 31889 */ 31890 function hashHas(key) { 31891 var data = this.__data__; 31892 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); 31893 } 31894 31895 _hashHas = hashHas; 31896 return _hashHas; 31897} 31898 31899var _hashSet; 31900var hasRequired_hashSet; 31901 31902function require_hashSet () { 31903 if (hasRequired_hashSet) return _hashSet; 31904 hasRequired_hashSet = 1; 31905 var nativeCreate = require_nativeCreate(); 31906 31907 /** Used to stand-in for `undefined` hash values. */ 31908 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 31909 31910 /** 31911 * Sets the hash `key` to `value`. 31912 * 31913 * @private 31914 * @name set 31915 * @memberOf Hash 31916 * @param {string} key The key of the value to set. 31917 * @param {*} value The value to set. 31918 * @returns {Object} Returns the hash instance. 31919 */ 31920 function hashSet(key, value) { 31921 var data = this.__data__; 31922 this.size += this.has(key) ? 0 : 1; 31923 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 31924 return this; 31925 } 31926 31927 _hashSet = hashSet; 31928 return _hashSet; 31929} 31930 31931var _Hash; 31932var hasRequired_Hash; 31933 31934function require_Hash () { 31935 if (hasRequired_Hash) return _Hash; 31936 hasRequired_Hash = 1; 31937 var hashClear = require_hashClear(), 31938 hashDelete = require_hashDelete(), 31939 hashGet = require_hashGet(), 31940 hashHas = require_hashHas(), 31941 hashSet = require_hashSet(); 31942 31943 /** 31944 * Creates a hash object. 31945 * 31946 * @private 31947 * @constructor 31948 * @param {Array} [entries] The key-value pairs to cache. 31949 */ 31950 function Hash(entries) { 31951 var index = -1, 31952 length = entries == null ? 0 : entries.length; 31953 31954 this.clear(); 31955 while (++index < length) { 31956 var entry = entries[index]; 31957 this.set(entry[0], entry[1]); 31958 } 31959 } 31960 31961 // Add methods to `Hash`. 31962 Hash.prototype.clear = hashClear; 31963 Hash.prototype['delete'] = hashDelete; 31964 Hash.prototype.get = hashGet; 31965 Hash.prototype.has = hashHas; 31966 Hash.prototype.set = hashSet; 31967 31968 _Hash = Hash; 31969 return _Hash; 31970} 31971 31972var _mapCacheClear; 31973var hasRequired_mapCacheClear; 31974 31975function require_mapCacheClear () { 31976 if (hasRequired_mapCacheClear) return _mapCacheClear; 31977 hasRequired_mapCacheClear = 1; 31978 var Hash = require_Hash(), 31979 ListCache = require_ListCache(), 31980 Map = require_Map(); 31981 31982 /** 31983 * Removes all key-value entries from the map. 31984 * 31985 * @private 31986 * @name clear 31987 * @memberOf MapCache 31988 */ 31989 function mapCacheClear() { 31990 this.size = 0; 31991 this.__data__ = { 31992 'hash': new Hash, 31993 'map': new (Map || ListCache), 31994 'string': new Hash 31995 }; 31996 } 31997 31998 _mapCacheClear = mapCacheClear; 31999 return _mapCacheClear; 32000} 32001 32002/** 32003 * Checks if `value` is suitable for use as unique object key. 32004 * 32005 * @private 32006 * @param {*} value The value to check. 32007 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 32008 */ 32009 32010var _isKeyable; 32011var hasRequired_isKeyable; 32012 32013function require_isKeyable () { 32014 if (hasRequired_isKeyable) return _isKeyable; 32015 hasRequired_isKeyable = 1; 32016 function isKeyable(value) { 32017 var type = typeof value; 32018 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 32019 ? (value !== '__proto__') 32020 : (value === null); 32021 } 32022 32023 _isKeyable = isKeyable; 32024 return _isKeyable; 32025} 32026 32027var _getMapData; 32028var hasRequired_getMapData; 32029 32030function require_getMapData () { 32031 if (hasRequired_getMapData) return _getMapData; 32032 hasRequired_getMapData = 1; 32033 var isKeyable = require_isKeyable(); 32034 32035 /** 32036 * Gets the data for `map`. 32037 * 32038 * @private 32039 * @param {Object} map The map to query. 32040 * @param {string} key The reference key. 32041 * @returns {*} Returns the map data. 32042 */ 32043 function getMapData(map, key) { 32044 var data = map.__data__; 32045 return isKeyable(key) 32046 ? data[typeof key == 'string' ? 'string' : 'hash'] 32047 : data.map; 32048 } 32049 32050 _getMapData = getMapData; 32051 return _getMapData; 32052} 32053 32054var _mapCacheDelete; 32055var hasRequired_mapCacheDelete; 32056 32057function require_mapCacheDelete () { 32058 if (hasRequired_mapCacheDelete) return _mapCacheDelete; 32059 hasRequired_mapCacheDelete = 1; 32060 var getMapData = require_getMapData(); 32061 32062 /** 32063 * Removes `key` and its value from the map. 32064 * 32065 * @private 32066 * @name delete 32067 * @memberOf MapCache 32068 * @param {string} key The key of the value to remove. 32069 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 32070 */ 32071 function mapCacheDelete(key) { 32072 var result = getMapData(this, key)['delete'](key); 32073 this.size -= result ? 1 : 0; 32074 return result; 32075 } 32076 32077 _mapCacheDelete = mapCacheDelete; 32078 return _mapCacheDelete; 32079} 32080 32081var _mapCacheGet; 32082var hasRequired_mapCacheGet; 32083 32084function require_mapCacheGet () { 32085 if (hasRequired_mapCacheGet) return _mapCacheGet; 32086 hasRequired_mapCacheGet = 1; 32087 var getMapData = require_getMapData(); 32088 32089 /** 32090 * Gets the map value for `key`. 32091 * 32092 * @private 32093 * @name get 32094 * @memberOf MapCache 32095 * @param {string} key The key of the value to get. 32096 * @returns {*} Returns the entry value. 32097 */ 32098 function mapCacheGet(key) { 32099 return getMapData(this, key).get(key); 32100 } 32101 32102 _mapCacheGet = mapCacheGet; 32103 return _mapCacheGet; 32104} 32105 32106var _mapCacheHas; 32107var hasRequired_mapCacheHas; 32108 32109function require_mapCacheHas () { 32110 if (hasRequired_mapCacheHas) return _mapCacheHas; 32111 hasRequired_mapCacheHas = 1; 32112 var getMapData = require_getMapData(); 32113 32114 /** 32115 * Checks if a map value for `key` exists. 32116 * 32117 * @private 32118 * @name has 32119 * @memberOf MapCache 32120 * @param {string} key The key of the entry to check. 32121 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 32122 */ 32123 function mapCacheHas(key) { 32124 return getMapData(this, key).has(key); 32125 } 32126 32127 _mapCacheHas = mapCacheHas; 32128 return _mapCacheHas; 32129} 32130 32131var _mapCacheSet; 32132var hasRequired_mapCacheSet; 32133 32134function require_mapCacheSet () { 32135 if (hasRequired_mapCacheSet) return _mapCacheSet; 32136 hasRequired_mapCacheSet = 1; 32137 var getMapData = require_getMapData(); 32138 32139 /** 32140 * Sets the map `key` to `value`. 32141 * 32142 * @private 32143 * @name set 32144 * @memberOf MapCache 32145 * @param {string} key The key of the value to set. 32146 * @param {*} value The value to set. 32147 * @returns {Object} Returns the map cache instance. 32148 */ 32149 function mapCacheSet(key, value) { 32150 var data = getMapData(this, key), 32151 size = data.size; 32152 32153 data.set(key, value); 32154 this.size += data.size == size ? 0 : 1; 32155 return this; 32156 } 32157 32158 _mapCacheSet = mapCacheSet; 32159 return _mapCacheSet; 32160} 32161 32162var _MapCache; 32163var hasRequired_MapCache; 32164 32165function require_MapCache () { 32166 if (hasRequired_MapCache) return _MapCache; 32167 hasRequired_MapCache = 1; 32168 var mapCacheClear = require_mapCacheClear(), 32169 mapCacheDelete = require_mapCacheDelete(), 32170 mapCacheGet = require_mapCacheGet(), 32171 mapCacheHas = require_mapCacheHas(), 32172 mapCacheSet = require_mapCacheSet(); 32173 32174 /** 32175 * Creates a map cache object to store key-value pairs. 32176 * 32177 * @private 32178 * @constructor 32179 * @param {Array} [entries] The key-value pairs to cache. 32180 */ 32181 function MapCache(entries) { 32182 var index = -1, 32183 length = entries == null ? 0 : entries.length; 32184 32185 this.clear(); 32186 while (++index < length) { 32187 var entry = entries[index]; 32188 this.set(entry[0], entry[1]); 32189 } 32190 } 32191 32192 // Add methods to `MapCache`. 32193 MapCache.prototype.clear = mapCacheClear; 32194 MapCache.prototype['delete'] = mapCacheDelete; 32195 MapCache.prototype.get = mapCacheGet; 32196 MapCache.prototype.has = mapCacheHas; 32197 MapCache.prototype.set = mapCacheSet; 32198 32199 _MapCache = MapCache; 32200 return _MapCache; 32201} 32202 32203var _stackSet; 32204var hasRequired_stackSet; 32205 32206function require_stackSet () { 32207 if (hasRequired_stackSet) return _stackSet; 32208 hasRequired_stackSet = 1; 32209 var ListCache = require_ListCache(), 32210 Map = require_Map(), 32211 MapCache = require_MapCache(); 32212 32213 /** Used as the size to enable large array optimizations. */ 32214 var LARGE_ARRAY_SIZE = 200; 32215 32216 /** 32217 * Sets the stack `key` to `value`. 32218 * 32219 * @private 32220 * @name set 32221 * @memberOf Stack 32222 * @param {string} key The key of the value to set. 32223 * @param {*} value The value to set. 32224 * @returns {Object} Returns the stack cache instance. 32225 */ 32226 function stackSet(key, value) { 32227 var data = this.__data__; 32228 if (data instanceof ListCache) { 32229 var pairs = data.__data__; 32230 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { 32231 pairs.push([key, value]); 32232 this.size = ++data.size; 32233 return this; 32234 } 32235 data = this.__data__ = new MapCache(pairs); 32236 } 32237 data.set(key, value); 32238 this.size = data.size; 32239 return this; 32240 } 32241 32242 _stackSet = stackSet; 32243 return _stackSet; 32244} 32245 32246var _Stack; 32247var hasRequired_Stack; 32248 32249function require_Stack () { 32250 if (hasRequired_Stack) return _Stack; 32251 hasRequired_Stack = 1; 32252 var ListCache = require_ListCache(), 32253 stackClear = require_stackClear(), 32254 stackDelete = require_stackDelete(), 32255 stackGet = require_stackGet(), 32256 stackHas = require_stackHas(), 32257 stackSet = require_stackSet(); 32258 32259 /** 32260 * Creates a stack cache object to store key-value pairs. 32261 * 32262 * @private 32263 * @constructor 32264 * @param {Array} [entries] The key-value pairs to cache. 32265 */ 32266 function Stack(entries) { 32267 var data = this.__data__ = new ListCache(entries); 32268 this.size = data.size; 32269 } 32270 32271 // Add methods to `Stack`. 32272 Stack.prototype.clear = stackClear; 32273 Stack.prototype['delete'] = stackDelete; 32274 Stack.prototype.get = stackGet; 32275 Stack.prototype.has = stackHas; 32276 Stack.prototype.set = stackSet; 32277 32278 _Stack = Stack; 32279 return _Stack; 32280} 32281
vendor: 54,387 bytes, lines 32282-34398
32282/** 32283 * A specialized version of `_.forEach` for arrays without support for 32284 * iteratee shorthands. 32285 * 32286 * @private 32287 * @param {Array} [array] The array to iterate over. 32288 * @param {Function} iteratee The function invoked per iteration. 32289 * @returns {Array} Returns `array`. 32290 */ 32291 32292var _arrayEach; 32293var hasRequired_arrayEach; 32294 32295function require_arrayEach () { 32296 if (hasRequired_arrayEach) return _arrayEach; 32297 hasRequired_arrayEach = 1; 32298 function arrayEach(array, iteratee) { 32299 var index = -1, 32300 length = array == null ? 0 : array.length; 32301 32302 while (++index < length) { 32303 if (iteratee(array[index], index, array) === false) { 32304 break; 32305 } 32306 } 32307 return array; 32308 } 32309 32310 _arrayEach = arrayEach; 32311 return _arrayEach; 32312} 32313 32314var _defineProperty; 32315var hasRequired_defineProperty; 32316 32317function require_defineProperty () { 32318 if (hasRequired_defineProperty) return _defineProperty; 32319 hasRequired_defineProperty = 1; 32320 var getNative = require_getNative(); 32321 32322 var defineProperty = (function() { 32323 try { 32324 var func = getNative(Object, 'defineProperty'); 32325 func({}, '', {}); 32326 return func; 32327 } catch (e) {} 32328 }()); 32329 32330 _defineProperty = defineProperty; 32331 return _defineProperty; 32332} 32333 32334var _baseAssignValue; 32335var hasRequired_baseAssignValue; 32336 32337function require_baseAssignValue () { 32338 if (hasRequired_baseAssignValue) return _baseAssignValue; 32339 hasRequired_baseAssignValue = 1; 32340 var defineProperty = require_defineProperty(); 32341 32342 /** 32343 * The base implementation of `assignValue` and `assignMergeValue` without 32344 * value checks. 32345 * 32346 * @private 32347 * @param {Object} object The object to modify. 32348 * @param {string} key The key of the property to assign. 32349 * @param {*} value The value to assign. 32350 */ 32351 function baseAssignValue(object, key, value) { 32352 if (key == '__proto__' && defineProperty) { 32353 defineProperty(object, key, { 32354 'configurable': true, 32355 'enumerable': true, 32356 'value': value, 32357 'writable': true 32358 }); 32359 } else { 32360 object[key] = value; 32361 } 32362 } 32363 32364 _baseAssignValue = baseAssignValue; 32365 return _baseAssignValue; 32366} 32367 32368var _assignValue; 32369var hasRequired_assignValue; 32370 32371function require_assignValue () { 32372 if (hasRequired_assignValue) return _assignValue; 32373 hasRequired_assignValue = 1; 32374 var baseAssignValue = require_baseAssignValue(), 32375 eq = requireEq(); 32376 32377 /** Used for built-in method references. */ 32378 var objectProto = Object.prototype; 32379 32380 /** Used to check objects for own properties. */ 32381 var hasOwnProperty = objectProto.hasOwnProperty; 32382 32383 /** 32384 * Assigns `value` to `key` of `object` if the existing value is not equivalent 32385 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 32386 * for equality comparisons. 32387 * 32388 * @private 32389 * @param {Object} object The object to modify. 32390 * @param {string} key The key of the property to assign. 32391 * @param {*} value The value to assign. 32392 */ 32393 function assignValue(object, key, value) { 32394 var objValue = object[key]; 32395 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 32396 (value === undefined && !(key in object))) { 32397 baseAssignValue(object, key, value); 32398 } 32399 } 32400 32401 _assignValue = assignValue; 32402 return _assignValue; 32403} 32404 32405var _copyObject; 32406var hasRequired_copyObject; 32407 32408function require_copyObject () { 32409 if (hasRequired_copyObject) return _copyObject; 32410 hasRequired_copyObject = 1; 32411 var assignValue = require_assignValue(), 32412 baseAssignValue = require_baseAssignValue(); 32413 32414 /** 32415 * Copies properties of `source` to `object`. 32416 * 32417 * @private 32418 * @param {Object} source The object to copy properties from. 32419 * @param {Array} props The property identifiers to copy. 32420 * @param {Object} [object={}] The object to copy properties to. 32421 * @param {Function} [customizer] The function to customize copied values. 32422 * @returns {Object} Returns `object`. 32423 */ 32424 function copyObject(source, props, object, customizer) { 32425 var isNew = !object; 32426 object || (object = {}); 32427 32428 var index = -1, 32429 length = props.length; 32430 32431 while (++index < length) { 32432 var key = props[index]; 32433 32434 var newValue = customizer 32435 ? customizer(object[key], source[key], key, object, source) 32436 : undefined; 32437 32438 if (newValue === undefined) { 32439 newValue = source[key]; 32440 } 32441 if (isNew) { 32442 baseAssignValue(object, key, newValue); 32443 } else { 32444 assignValue(object, key, newValue); 32445 } 32446 } 32447 return object; 32448 } 32449 32450 _copyObject = copyObject; 32451 return _copyObject; 32452} 32453 32454/** 32455 * The base implementation of `_.times` without support for iteratee shorthands 32456 * or max array length checks. 32457 * 32458 * @private 32459 * @param {number} n The number of times to invoke `iteratee`. 32460 * @param {Function} iteratee The function invoked per iteration. 32461 * @returns {Array} Returns the array of results. 32462 */ 32463 32464var _baseTimes; 32465var hasRequired_baseTimes; 32466 32467function require_baseTimes () { 32468 if (hasRequired_baseTimes) return _baseTimes; 32469 hasRequired_baseTimes = 1; 32470 function baseTimes(n, iteratee) { 32471 var index = -1, 32472 result = Array(n); 32473 32474 while (++index < n) { 32475 result[index] = iteratee(index); 32476 } 32477 return result; 32478 } 32479 32480 _baseTimes = baseTimes; 32481 return _baseTimes; 32482} 32483 32484/** 32485 * Checks if `value` is object-like. A value is object-like if it's not `null` 32486 * and has a `typeof` result of "object". 32487 * 32488 * @static 32489 * @memberOf _ 32490 * @since 4.0.0 32491 * @category Lang 32492 * @param {*} value The value to check. 32493 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 32494 * @example 32495 * 32496 * _.isObjectLike({}); 32497 * // => true 32498 * 32499 * _.isObjectLike([1, 2, 3]); 32500 * // => true 32501 * 32502 * _.isObjectLike(_.noop); 32503 * // => false 32504 * 32505 * _.isObjectLike(null); 32506 * // => false 32507 */ 32508 32509var isObjectLike_1; 32510var hasRequiredIsObjectLike; 32511 32512function requireIsObjectLike () { 32513 if (hasRequiredIsObjectLike) return isObjectLike_1; 32514 hasRequiredIsObjectLike = 1; 32515 function isObjectLike(value) { 32516 return value != null && typeof value == 'object'; 32517 } 32518 32519 isObjectLike_1 = isObjectLike; 32520 return isObjectLike_1; 32521} 32522 32523var _baseIsArguments; 32524var hasRequired_baseIsArguments; 32525 32526function require_baseIsArguments () { 32527 if (hasRequired_baseIsArguments) return _baseIsArguments; 32528 hasRequired_baseIsArguments = 1; 32529 var baseGetTag = require_baseGetTag(), 32530 isObjectLike = requireIsObjectLike(); 32531 32532 /** `Object#toString` result references. */ 32533 var argsTag = '[object Arguments]'; 32534 32535 /** 32536 * The base implementation of `_.isArguments`. 32537 * 32538 * @private 32539 * @param {*} value The value to check. 32540 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 32541 */ 32542 function baseIsArguments(value) { 32543 return isObjectLike(value) && baseGetTag(value) == argsTag; 32544 } 32545 32546 _baseIsArguments = baseIsArguments; 32547 return _baseIsArguments; 32548} 32549 32550var isArguments_1; 32551var hasRequiredIsArguments; 32552 32553function requireIsArguments () { 32554 if (hasRequiredIsArguments) return isArguments_1; 32555 hasRequiredIsArguments = 1; 32556 var baseIsArguments = require_baseIsArguments(), 32557 isObjectLike = requireIsObjectLike(); 32558 32559 /** Used for built-in method references. */ 32560 var objectProto = Object.prototype; 32561 32562 /** Used to check objects for own properties. */ 32563 var hasOwnProperty = objectProto.hasOwnProperty; 32564 32565 /** Built-in value references. */ 32566 var propertyIsEnumerable = objectProto.propertyIsEnumerable; 32567 32568 /** 32569 * Checks if `value` is likely an `arguments` object. 32570 * 32571 * @static 32572 * @memberOf _ 32573 * @since 0.1.0 32574 * @category Lang 32575 * @param {*} value The value to check. 32576 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 32577 * else `false`. 32578 * @example 32579 * 32580 * _.isArguments(function() { return arguments; }()); 32581 * // => true 32582 * 32583 * _.isArguments([1, 2, 3]); 32584 * // => false 32585 */ 32586 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { 32587 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && 32588 !propertyIsEnumerable.call(value, 'callee'); 32589 }; 32590 32591 isArguments_1 = isArguments; 32592 return isArguments_1; 32593} 32594 32595/** 32596 * Checks if `value` is classified as an `Array` object. 32597 * 32598 * @static 32599 * @memberOf _ 32600 * @since 0.1.0 32601 * @category Lang 32602 * @param {*} value The value to check. 32603 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 32604 * @example 32605 * 32606 * _.isArray([1, 2, 3]); 32607 * // => true 32608 * 32609 * _.isArray(document.body.children); 32610 * // => false 32611 * 32612 * _.isArray('abc'); 32613 * // => false 32614 * 32615 * _.isArray(_.noop); 32616 * // => false 32617 */ 32618 32619var isArray_1; 32620var hasRequiredIsArray; 32621 32622function requireIsArray () { 32623 if (hasRequiredIsArray) return isArray_1; 32624 hasRequiredIsArray = 1; 32625 var isArray = Array.isArray; 32626 32627 isArray_1 = isArray; 32628 return isArray_1; 32629} 32630 32631var isBuffer = {exports: {}}; 32632 32633/** 32634 * This method returns `false`. 32635 * 32636 * @static 32637 * @memberOf _ 32638 * @since 4.13.0 32639 * @category Util 32640 * @returns {boolean} Returns `false`. 32641 * @example 32642 * 32643 * _.times(2, _.stubFalse); 32644 * // => [false, false] 32645 */ 32646 32647var stubFalse_1; 32648var hasRequiredStubFalse; 32649 32650function requireStubFalse () { 32651 if (hasRequiredStubFalse) return stubFalse_1; 32652 hasRequiredStubFalse = 1; 32653 function stubFalse() { 32654 return false; 32655 } 32656 32657 stubFalse_1 = stubFalse; 32658 return stubFalse_1; 32659} 32660 32661isBuffer.exports; 32662 32663var hasRequiredIsBuffer; 32664 32665function requireIsBuffer () { 32666 if (hasRequiredIsBuffer) return isBuffer.exports; 32667 hasRequiredIsBuffer = 1; 32668 (function (module, exports) { 32669 var root = require_root(), 32670 stubFalse = requireStubFalse(); 32671 32672 /** Detect free variable `exports`. */ 32673 var freeExports = exports && !exports.nodeType && exports; 32674 32675 /** Detect free variable `module`. */ 32676 var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; 32677 32678 /** Detect the popular CommonJS extension `module.exports`. */ 32679 var moduleExports = freeModule && freeModule.exports === freeExports; 32680 32681 /** Built-in value references. */ 32682 var Buffer = moduleExports ? root.Buffer : undefined; 32683 32684 /* Built-in method references for those with the same name as other `lodash` methods. */ 32685 var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; 32686 32687 /** 32688 * Checks if `value` is a buffer. 32689 * 32690 * @static 32691 * @memberOf _ 32692 * @since 4.3.0 32693 * @category Lang 32694 * @param {*} value The value to check. 32695 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 32696 * @example 32697 * 32698 * _.isBuffer(new Buffer(2)); 32699 * // => true 32700 * 32701 * _.isBuffer(new Uint8Array(2)); 32702 * // => false 32703 */ 32704 var isBuffer = nativeIsBuffer || stubFalse; 32705 32706 module.exports = isBuffer; 32707 } (isBuffer, isBuffer.exports)); 32708 return isBuffer.exports; 32709} 32710 32711/** Used as references for various `Number` constants. */ 32712 32713var _isIndex; 32714var hasRequired_isIndex; 32715 32716function require_isIndex () { 32717 if (hasRequired_isIndex) return _isIndex; 32718 hasRequired_isIndex = 1; 32719 var MAX_SAFE_INTEGER = 9007199254740991; 32720 32721 /** Used to detect unsigned integer values. */ 32722 var reIsUint = /^(?:0|[1-9]\d*)$/; 32723 32724 /** 32725 * Checks if `value` is a valid array-like index. 32726 * 32727 * @private 32728 * @param {*} value The value to check. 32729 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 32730 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 32731 */ 32732 function isIndex(value, length) { 32733 var type = typeof value; 32734 length = length == null ? MAX_SAFE_INTEGER : length; 32735 32736 return !!length && 32737 (type == 'number' || 32738 (type != 'symbol' && reIsUint.test(value))) && 32739 (value > -1 && value % 1 == 0 && value < length); 32740 } 32741 32742 _isIndex = isIndex; 32743 return _isIndex; 32744} 32745 32746/** Used as references for various `Number` constants. */ 32747 32748var isLength_1; 32749var hasRequiredIsLength; 32750 32751function requireIsLength () { 32752 if (hasRequiredIsLength) return isLength_1; 32753 hasRequiredIsLength = 1; 32754 var MAX_SAFE_INTEGER = 9007199254740991; 32755 32756 /** 32757 * Checks if `value` is a valid array-like length. 32758 * 32759 * **Note:** This method is loosely based on 32760 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 32761 * 32762 * @static 32763 * @memberOf _ 32764 * @since 4.0.0 32765 * @category Lang 32766 * @param {*} value The value to check. 32767 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 32768 * @example 32769 * 32770 * _.isLength(3); 32771 * // => true 32772 * 32773 * _.isLength(Number.MIN_VALUE); 32774 * // => false 32775 * 32776 * _.isLength(Infinity); 32777 * // => false 32778 * 32779 * _.isLength('3'); 32780 * // => false 32781 */ 32782 function isLength(value) { 32783 return typeof value == 'number' && 32784 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 32785 } 32786 32787 isLength_1 = isLength; 32788 return isLength_1; 32789} 32790 32791var _baseIsTypedArray; 32792var hasRequired_baseIsTypedArray; 32793 32794function require_baseIsTypedArray () { 32795 if (hasRequired_baseIsTypedArray) return _baseIsTypedArray; 32796 hasRequired_baseIsTypedArray = 1; 32797 var baseGetTag = require_baseGetTag(), 32798 isLength = requireIsLength(), 32799 isObjectLike = requireIsObjectLike(); 32800 32801 /** `Object#toString` result references. */ 32802 var argsTag = '[object Arguments]', 32803 arrayTag = '[object Array]', 32804 boolTag = '[object Boolean]', 32805 dateTag = '[object Date]', 32806 errorTag = '[object Error]', 32807 funcTag = '[object Function]', 32808 mapTag = '[object Map]', 32809 numberTag = '[object Number]', 32810 objectTag = '[object Object]', 32811 regexpTag = '[object RegExp]', 32812 setTag = '[object Set]', 32813 stringTag = '[object String]', 32814 weakMapTag = '[object WeakMap]'; 32815 32816 var arrayBufferTag = '[object ArrayBuffer]', 32817 dataViewTag = '[object DataView]', 32818 float32Tag = '[object Float32Array]', 32819 float64Tag = '[object Float64Array]', 32820 int8Tag = '[object Int8Array]', 32821 int16Tag = '[object Int16Array]', 32822 int32Tag = '[object Int32Array]', 32823 uint8Tag = '[object Uint8Array]', 32824 uint8ClampedTag = '[object Uint8ClampedArray]', 32825 uint16Tag = '[object Uint16Array]', 32826 uint32Tag = '[object Uint32Array]'; 32827 32828 /** Used to identify `toStringTag` values of typed arrays. */ 32829 var typedArrayTags = {}; 32830 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = 32831 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = 32832 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = 32833 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = 32834 typedArrayTags[uint32Tag] = true; 32835 typedArrayTags[argsTag] = typedArrayTags[arrayTag] = 32836 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = 32837 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = 32838 typedArrayTags[errorTag] = typedArrayTags[funcTag] = 32839 typedArrayTags[mapTag] = typedArrayTags[numberTag] = 32840 typedArrayTags[objectTag] = typedArrayTags[regexpTag] = 32841 typedArrayTags[setTag] = typedArrayTags[stringTag] = 32842 typedArrayTags[weakMapTag] = false; 32843 32844 /** 32845 * The base implementation of `_.isTypedArray` without Node.js optimizations. 32846 * 32847 * @private 32848 * @param {*} value The value to check. 32849 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 32850 */ 32851 function baseIsTypedArray(value) { 32852 return isObjectLike(value) && 32853 isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 32854 } 32855 32856 _baseIsTypedArray = baseIsTypedArray; 32857 return _baseIsTypedArray; 32858} 32859 32860/** 32861 * The base implementation of `_.unary` without support for storing metadata. 32862 * 32863 * @private 32864 * @param {Function} func The function to cap arguments for. 32865 * @returns {Function} Returns the new capped function. 32866 */ 32867 32868var _baseUnary; 32869var hasRequired_baseUnary; 32870 32871function require_baseUnary () { 32872 if (hasRequired_baseUnary) return _baseUnary; 32873 hasRequired_baseUnary = 1; 32874 function baseUnary(func) { 32875 return function(value) { 32876 return func(value); 32877 }; 32878 } 32879 32880 _baseUnary = baseUnary; 32881 return _baseUnary; 32882} 32883 32884var _nodeUtil = {exports: {}}; 32885 32886_nodeUtil.exports; 32887 32888var hasRequired_nodeUtil; 32889 32890function require_nodeUtil () { 32891 if (hasRequired_nodeUtil) return _nodeUtil.exports; 32892 hasRequired_nodeUtil = 1; 32893 (function (module, exports) { 32894 var freeGlobal = require_freeGlobal(); 32895 32896 /** Detect free variable `exports`. */ 32897 var freeExports = exports && !exports.nodeType && exports; 32898 32899 /** Detect free variable `module`. */ 32900 var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; 32901 32902 /** Detect the popular CommonJS extension `module.exports`. */ 32903 var moduleExports = freeModule && freeModule.exports === freeExports; 32904 32905 /** Detect free variable `process` from Node.js. */ 32906 var freeProcess = moduleExports && freeGlobal.process; 32907 32908 /** Used to access faster Node.js helpers. */ 32909 var nodeUtil = (function() { 32910 try { 32911 // Use `util.types` for Node.js 10+. 32912 var types = freeModule && freeModule.require && freeModule.require('util').types; 32913 32914 if (types) { 32915 return types; 32916 } 32917 32918 // Legacy `process.binding('util')` for Node.js < 10. 32919 return freeProcess && freeProcess.binding && freeProcess.binding('util'); 32920 } catch (e) {} 32921 }()); 32922 32923 module.exports = nodeUtil; 32924 } (_nodeUtil, _nodeUtil.exports)); 32925 return _nodeUtil.exports; 32926} 32927 32928var isTypedArray_1; 32929var hasRequiredIsTypedArray; 32930 32931function requireIsTypedArray () { 32932 if (hasRequiredIsTypedArray) return isTypedArray_1; 32933 hasRequiredIsTypedArray = 1; 32934 var baseIsTypedArray = require_baseIsTypedArray(), 32935 baseUnary = require_baseUnary(), 32936 nodeUtil = require_nodeUtil(); 32937 32938 /* Node.js helper references. */ 32939 var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 32940 32941 /** 32942 * Checks if `value` is classified as a typed array. 32943 * 32944 * @static 32945 * @memberOf _ 32946 * @since 3.0.0 32947 * @category Lang 32948 * @param {*} value The value to check. 32949 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 32950 * @example 32951 * 32952 * _.isTypedArray(new Uint8Array); 32953 * // => true 32954 * 32955 * _.isTypedArray([]); 32956 * // => false 32957 */ 32958 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 32959 32960 isTypedArray_1 = isTypedArray; 32961 return isTypedArray_1; 32962} 32963 32964var _arrayLikeKeys; 32965var hasRequired_arrayLikeKeys; 32966 32967function require_arrayLikeKeys () { 32968 if (hasRequired_arrayLikeKeys) return _arrayLikeKeys; 32969 hasRequired_arrayLikeKeys = 1; 32970 var baseTimes = require_baseTimes(), 32971 isArguments = requireIsArguments(), 32972 isArray = requireIsArray(), 32973 isBuffer = requireIsBuffer(), 32974 isIndex = require_isIndex(), 32975 isTypedArray = requireIsTypedArray(); 32976 32977 /** Used for built-in method references. */ 32978 var objectProto = Object.prototype; 32979 32980 /** Used to check objects for own properties. */ 32981 var hasOwnProperty = objectProto.hasOwnProperty; 32982 32983 /** 32984 * Creates an array of the enumerable property names of the array-like `value`. 32985 * 32986 * @private 32987 * @param {*} value The value to query. 32988 * @param {boolean} inherited Specify returning inherited property names. 32989 * @returns {Array} Returns the array of property names. 32990 */ 32991 function arrayLikeKeys(value, inherited) { 32992 var isArr = isArray(value), 32993 isArg = !isArr && isArguments(value), 32994 isBuff = !isArr && !isArg && isBuffer(value), 32995 isType = !isArr && !isArg && !isBuff && isTypedArray(value), 32996 skipIndexes = isArr || isArg || isBuff || isType, 32997 result = skipIndexes ? baseTimes(value.length, String) : [], 32998 length = result.length; 32999 33000 for (var key in value) { 33001 if ((inherited || hasOwnProperty.call(value, key)) && 33002 !(skipIndexes && ( 33003 // Safari 9 has enumerable `arguments.length` in strict mode. 33004 key == 'length' || 33005 // Node.js 0.10 has enumerable non-index properties on buffers. 33006 (isBuff && (key == 'offset' || key == 'parent')) || 33007 // PhantomJS 2 has enumerable non-index properties on typed arrays. 33008 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || 33009 // Skip index properties. 33010 isIndex(key, length) 33011 ))) { 33012 result.push(key); 33013 } 33014 } 33015 return result; 33016 } 33017 33018 _arrayLikeKeys = arrayLikeKeys; 33019 return _arrayLikeKeys; 33020} 33021 33022/** Used for built-in method references. */ 33023 33024var _isPrototype; 33025var hasRequired_isPrototype; 33026 33027function require_isPrototype () { 33028 if (hasRequired_isPrototype) return _isPrototype; 33029 hasRequired_isPrototype = 1; 33030 var objectProto = Object.prototype; 33031 33032 /** 33033 * Checks if `value` is likely a prototype object. 33034 * 33035 * @private 33036 * @param {*} value The value to check. 33037 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 33038 */ 33039 function isPrototype(value) { 33040 var Ctor = value && value.constructor, 33041 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; 33042 33043 return value === proto; 33044 } 33045 33046 _isPrototype = isPrototype; 33047 return _isPrototype; 33048} 33049 33050/** 33051 * Creates a unary function that invokes `func` with its argument transformed. 33052 * 33053 * @private 33054 * @param {Function} func The function to wrap. 33055 * @param {Function} transform The argument transform. 33056 * @returns {Function} Returns the new function. 33057 */ 33058 33059var _overArg; 33060var hasRequired_overArg; 33061 33062function require_overArg () { 33063 if (hasRequired_overArg) return _overArg; 33064 hasRequired_overArg = 1; 33065 function overArg(func, transform) { 33066 return function(arg) { 33067 return func(transform(arg)); 33068 }; 33069 } 33070 33071 _overArg = overArg; 33072 return _overArg; 33073} 33074 33075var _nativeKeys; 33076var hasRequired_nativeKeys; 33077 33078function require_nativeKeys () { 33079 if (hasRequired_nativeKeys) return _nativeKeys; 33080 hasRequired_nativeKeys = 1; 33081 var overArg = require_overArg(); 33082 33083 /* Built-in method references for those with the same name as other `lodash` methods. */ 33084 var nativeKeys = overArg(Object.keys, Object); 33085 33086 _nativeKeys = nativeKeys; 33087 return _nativeKeys; 33088} 33089 33090var _baseKeys; 33091var hasRequired_baseKeys; 33092 33093function require_baseKeys () { 33094 if (hasRequired_baseKeys) return _baseKeys; 33095 hasRequired_baseKeys = 1; 33096 var isPrototype = require_isPrototype(), 33097 nativeKeys = require_nativeKeys(); 33098 33099 /** Used for built-in method references. */ 33100 var objectProto = Object.prototype; 33101 33102 /** Used to check objects for own properties. */ 33103 var hasOwnProperty = objectProto.hasOwnProperty; 33104 33105 /** 33106 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 33107 * 33108 * @private 33109 * @param {Object} object The object to query. 33110 * @returns {Array} Returns the array of property names. 33111 */ 33112 function baseKeys(object) { 33113 if (!isPrototype(object)) { 33114 return nativeKeys(object); 33115 } 33116 var result = []; 33117 for (var key in Object(object)) { 33118 if (hasOwnProperty.call(object, key) && key != 'constructor') { 33119 result.push(key); 33120 } 33121 } 33122 return result; 33123 } 33124 33125 _baseKeys = baseKeys; 33126 return _baseKeys; 33127} 33128 33129var isArrayLike_1; 33130var hasRequiredIsArrayLike; 33131 33132function requireIsArrayLike () { 33133 if (hasRequiredIsArrayLike) return isArrayLike_1; 33134 hasRequiredIsArrayLike = 1; 33135 var isFunction = requireIsFunction(), 33136 isLength = requireIsLength(); 33137 33138 /** 33139 * Checks if `value` is array-like. A value is considered array-like if it's 33140 * not a function and has a `value.length` that's an integer greater than or 33141 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 33142 * 33143 * @static 33144 * @memberOf _ 33145 * @since 4.0.0 33146 * @category Lang 33147 * @param {*} value The value to check. 33148 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 33149 * @example 33150 * 33151 * _.isArrayLike([1, 2, 3]); 33152 * // => true 33153 * 33154 * _.isArrayLike(document.body.children); 33155 * // => true 33156 * 33157 * _.isArrayLike('abc'); 33158 * // => true 33159 * 33160 * _.isArrayLike(_.noop); 33161 * // => false 33162 */ 33163 function isArrayLike(value) { 33164 return value != null && isLength(value.length) && !isFunction(value); 33165 } 33166 33167 isArrayLike_1 = isArrayLike; 33168 return isArrayLike_1; 33169} 33170 33171var keys_1; 33172var hasRequiredKeys; 33173 33174function requireKeys () { 33175 if (hasRequiredKeys) return keys_1; 33176 hasRequiredKeys = 1; 33177 var arrayLikeKeys = require_arrayLikeKeys(), 33178 baseKeys = require_baseKeys(), 33179 isArrayLike = requireIsArrayLike(); 33180 33181 /** 33182 * Creates an array of the own enumerable property names of `object`. 33183 * 33184 * **Note:** Non-object values are coerced to objects. See the 33185 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 33186 * for more details. 33187 * 33188 * @static 33189 * @since 0.1.0 33190 * @memberOf _ 33191 * @category Object 33192 * @param {Object} object The object to query. 33193 * @returns {Array} Returns the array of property names. 33194 * @example 33195 * 33196 * function Foo() { 33197 * this.a = 1; 33198 * this.b = 2; 33199 * } 33200 * 33201 * Foo.prototype.c = 3; 33202 * 33203 * _.keys(new Foo); 33204 * // => ['a', 'b'] (iteration order is not guaranteed) 33205 * 33206 * _.keys('hi'); 33207 * // => ['0', '1'] 33208 */ 33209 function keys(object) { 33210 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 33211 } 33212 33213 keys_1 = keys; 33214 return keys_1; 33215} 33216 33217var _baseAssign; 33218var hasRequired_baseAssign; 33219 33220function require_baseAssign () { 33221 if (hasRequired_baseAssign) return _baseAssign; 33222 hasRequired_baseAssign = 1; 33223 var copyObject = require_copyObject(), 33224 keys = requireKeys(); 33225 33226 /** 33227 * The base implementation of `_.assign` without support for multiple sources 33228 * or `customizer` functions. 33229 * 33230 * @private 33231 * @param {Object} object The destination object. 33232 * @param {Object} source The source object. 33233 * @returns {Object} Returns `object`. 33234 */ 33235 function baseAssign(object, source) { 33236 return object && copyObject(source, keys(source), object); 33237 } 33238 33239 _baseAssign = baseAssign; 33240 return _baseAssign; 33241} 33242 33243/** 33244 * This function is like 33245 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 33246 * except that it includes inherited enumerable properties. 33247 * 33248 * @private 33249 * @param {Object} object The object to query. 33250 * @returns {Array} Returns the array of property names. 33251 */ 33252 33253var _nativeKeysIn; 33254var hasRequired_nativeKeysIn; 33255 33256function require_nativeKeysIn () { 33257 if (hasRequired_nativeKeysIn) return _nativeKeysIn; 33258 hasRequired_nativeKeysIn = 1; 33259 function nativeKeysIn(object) { 33260 var result = []; 33261 if (object != null) { 33262 for (var key in Object(object)) { 33263 result.push(key); 33264 } 33265 } 33266 return result; 33267 } 33268 33269 _nativeKeysIn = nativeKeysIn; 33270 return _nativeKeysIn; 33271} 33272 33273var _baseKeysIn; 33274var hasRequired_baseKeysIn; 33275 33276function require_baseKeysIn () { 33277 if (hasRequired_baseKeysIn) return _baseKeysIn; 33278 hasRequired_baseKeysIn = 1; 33279 var isObject = requireIsObject(), 33280 isPrototype = require_isPrototype(), 33281 nativeKeysIn = require_nativeKeysIn(); 33282 33283 /** Used for built-in method references. */ 33284 var objectProto = Object.prototype; 33285 33286 /** Used to check objects for own properties. */ 33287 var hasOwnProperty = objectProto.hasOwnProperty; 33288 33289 /** 33290 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. 33291 * 33292 * @private 33293 * @param {Object} object The object to query. 33294 * @returns {Array} Returns the array of property names. 33295 */ 33296 function baseKeysIn(object) { 33297 if (!isObject(object)) { 33298 return nativeKeysIn(object); 33299 } 33300 var isProto = isPrototype(object), 33301 result = []; 33302 33303 for (var key in object) { 33304 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 33305 result.push(key); 33306 } 33307 } 33308 return result; 33309 } 33310 33311 _baseKeysIn = baseKeysIn; 33312 return _baseKeysIn; 33313} 33314 33315var keysIn_1; 33316var hasRequiredKeysIn; 33317 33318function requireKeysIn () { 33319 if (hasRequiredKeysIn) return keysIn_1; 33320 hasRequiredKeysIn = 1; 33321 var arrayLikeKeys = require_arrayLikeKeys(), 33322 baseKeysIn = require_baseKeysIn(), 33323 isArrayLike = requireIsArrayLike(); 33324 33325 /** 33326 * Creates an array of the own and inherited enumerable property names of `object`. 33327 * 33328 * **Note:** Non-object values are coerced to objects. 33329 * 33330 * @static 33331 * @memberOf _ 33332 * @since 3.0.0 33333 * @category Object 33334 * @param {Object} object The object to query. 33335 * @returns {Array} Returns the array of property names. 33336 * @example 33337 * 33338 * function Foo() { 33339 * this.a = 1; 33340 * this.b = 2; 33341 * } 33342 * 33343 * Foo.prototype.c = 3; 33344 * 33345 * _.keysIn(new Foo); 33346 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 33347 */ 33348 function keysIn(object) { 33349 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); 33350 } 33351 33352 keysIn_1 = keysIn; 33353 return keysIn_1; 33354} 33355 33356var _baseAssignIn; 33357var hasRequired_baseAssignIn; 33358 33359function require_baseAssignIn () { 33360 if (hasRequired_baseAssignIn) return _baseAssignIn; 33361 hasRequired_baseAssignIn = 1; 33362 var copyObject = require_copyObject(), 33363 keysIn = requireKeysIn(); 33364 33365 /** 33366 * The base implementation of `_.assignIn` without support for multiple sources 33367 * or `customizer` functions. 33368 * 33369 * @private 33370 * @param {Object} object The destination object. 33371 * @param {Object} source The source object. 33372 * @returns {Object} Returns `object`. 33373 */ 33374 function baseAssignIn(object, source) { 33375 return object && copyObject(source, keysIn(source), object); 33376 } 33377 33378 _baseAssignIn = baseAssignIn; 33379 return _baseAssignIn; 33380} 33381 33382var _cloneBuffer = {exports: {}}; 33383 33384_cloneBuffer.exports; 33385 33386var hasRequired_cloneBuffer; 33387 33388function require_cloneBuffer () { 33389 if (hasRequired_cloneBuffer) return _cloneBuffer.exports; 33390 hasRequired_cloneBuffer = 1; 33391 (function (module, exports) { 33392 var root = require_root(); 33393 33394 /** Detect free variable `exports`. */ 33395 var freeExports = exports && !exports.nodeType && exports; 33396 33397 /** Detect free variable `module`. */ 33398 var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; 33399 33400 /** Detect the popular CommonJS extension `module.exports`. */ 33401 var moduleExports = freeModule && freeModule.exports === freeExports; 33402 33403 /** Built-in value references. */ 33404 var Buffer = moduleExports ? root.Buffer : undefined, 33405 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; 33406 33407 /** 33408 * Creates a clone of `buffer`. 33409 * 33410 * @private 33411 * @param {Buffer} buffer The buffer to clone. 33412 * @param {boolean} [isDeep] Specify a deep clone. 33413 * @returns {Buffer} Returns the cloned buffer. 33414 */ 33415 function cloneBuffer(buffer, isDeep) { 33416 if (isDeep) { 33417 return buffer.slice(); 33418 } 33419 var length = buffer.length, 33420 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); 33421 33422 buffer.copy(result); 33423 return result; 33424 } 33425 33426 module.exports = cloneBuffer; 33427 } (_cloneBuffer, _cloneBuffer.exports)); 33428 return _cloneBuffer.exports; 33429} 33430 33431/** 33432 * Copies the values of `source` to `array`. 33433 * 33434 * @private 33435 * @param {Array} source The array to copy values from. 33436 * @param {Array} [array=[]] The array to copy values to. 33437 * @returns {Array} Returns `array`. 33438 */ 33439 33440var _copyArray; 33441var hasRequired_copyArray; 33442 33443function require_copyArray () { 33444 if (hasRequired_copyArray) return _copyArray; 33445 hasRequired_copyArray = 1; 33446 function copyArray(source, array) { 33447 var index = -1, 33448 length = source.length; 33449 33450 array || (array = Array(length)); 33451 while (++index < length) { 33452 array[index] = source[index]; 33453 } 33454 return array; 33455 } 33456 33457 _copyArray = copyArray; 33458 return _copyArray; 33459} 33460 33461/** 33462 * A specialized version of `_.filter` for arrays without support for 33463 * iteratee shorthands. 33464 * 33465 * @private 33466 * @param {Array} [array] The array to iterate over. 33467 * @param {Function} predicate The function invoked per iteration. 33468 * @returns {Array} Returns the new filtered array. 33469 */ 33470 33471var _arrayFilter; 33472var hasRequired_arrayFilter; 33473 33474function require_arrayFilter () { 33475 if (hasRequired_arrayFilter) return _arrayFilter; 33476 hasRequired_arrayFilter = 1; 33477 function arrayFilter(array, predicate) { 33478 var index = -1, 33479 length = array == null ? 0 : array.length, 33480 resIndex = 0, 33481 result = []; 33482 33483 while (++index < length) { 33484 var value = array[index]; 33485 if (predicate(value, index, array)) { 33486 result[resIndex++] = value; 33487 } 33488 } 33489 return result; 33490 } 33491 33492 _arrayFilter = arrayFilter; 33493 return _arrayFilter; 33494} 33495 33496/** 33497 * This method returns a new empty array. 33498 * 33499 * @static 33500 * @memberOf _ 33501 * @since 4.13.0 33502 * @category Util 33503 * @returns {Array} Returns the new empty array. 33504 * @example 33505 * 33506 * var arrays = _.times(2, _.stubArray); 33507 * 33508 * console.log(arrays); 33509 * // => [[], []] 33510 * 33511 * console.log(arrays[0] === arrays[1]); 33512 * // => false 33513 */ 33514 33515var stubArray_1; 33516var hasRequiredStubArray; 33517 33518function requireStubArray () { 33519 if (hasRequiredStubArray) return stubArray_1; 33520 hasRequiredStubArray = 1; 33521 function stubArray() { 33522 return []; 33523 } 33524 33525 stubArray_1 = stubArray; 33526 return stubArray_1; 33527} 33528 33529var _getSymbols; 33530var hasRequired_getSymbols; 33531 33532function require_getSymbols () { 33533 if (hasRequired_getSymbols) return _getSymbols; 33534 hasRequired_getSymbols = 1; 33535 var arrayFilter = require_arrayFilter(), 33536 stubArray = requireStubArray(); 33537 33538 /** Used for built-in method references. */ 33539 var objectProto = Object.prototype; 33540 33541 /** Built-in value references. */ 33542 var propertyIsEnumerable = objectProto.propertyIsEnumerable; 33543 33544 /* Built-in method references for those with the same name as other `lodash` methods. */ 33545 var nativeGetSymbols = Object.getOwnPropertySymbols; 33546 33547 /** 33548 * Creates an array of the own enumerable symbols of `object`. 33549 * 33550 * @private 33551 * @param {Object} object The object to query. 33552 * @returns {Array} Returns the array of symbols. 33553 */ 33554 var getSymbols = !nativeGetSymbols ? stubArray : function(object) { 33555 if (object == null) { 33556 return []; 33557 } 33558 object = Object(object); 33559 return arrayFilter(nativeGetSymbols(object), function(symbol) { 33560 return propertyIsEnumerable.call(object, symbol); 33561 }); 33562 }; 33563 33564 _getSymbols = getSymbols; 33565 return _getSymbols; 33566} 33567 33568var _copySymbols; 33569var hasRequired_copySymbols; 33570 33571function require_copySymbols () { 33572 if (hasRequired_copySymbols) return _copySymbols; 33573 hasRequired_copySymbols = 1; 33574 var copyObject = require_copyObject(), 33575 getSymbols = require_getSymbols(); 33576 33577 /** 33578 * Copies own symbols of `source` to `object`. 33579 * 33580 * @private 33581 * @param {Object} source The object to copy symbols from. 33582 * @param {Object} [object={}] The object to copy symbols to. 33583 * @returns {Object} Returns `object`. 33584 */ 33585 function copySymbols(source, object) { 33586 return copyObject(source, getSymbols(source), object); 33587 } 33588 33589 _copySymbols = copySymbols; 33590 return _copySymbols; 33591} 33592 33593/** 33594 * Appends the elements of `values` to `array`. 33595 * 33596 * @private 33597 * @param {Array} array The array to modify. 33598 * @param {Array} values The values to append. 33599 * @returns {Array} Returns `array`. 33600 */ 33601 33602var _arrayPush; 33603var hasRequired_arrayPush; 33604 33605function require_arrayPush () { 33606 if (hasRequired_arrayPush) return _arrayPush; 33607 hasRequired_arrayPush = 1; 33608 function arrayPush(array, values) { 33609 var index = -1, 33610 length = values.length, 33611 offset = array.length; 33612 33613 while (++index < length) { 33614 array[offset + index] = values[index]; 33615 } 33616 return array; 33617 } 33618 33619 _arrayPush = arrayPush; 33620 return _arrayPush; 33621} 33622 33623var _getPrototype; 33624var hasRequired_getPrototype; 33625 33626function require_getPrototype () { 33627 if (hasRequired_getPrototype) return _getPrototype; 33628 hasRequired_getPrototype = 1; 33629 var overArg = require_overArg(); 33630 33631 /** Built-in value references. */ 33632 var getPrototype = overArg(Object.getPrototypeOf, Object); 33633 33634 _getPrototype = getPrototype; 33635 return _getPrototype; 33636} 33637 33638var _getSymbolsIn; 33639var hasRequired_getSymbolsIn; 33640 33641function require_getSymbolsIn () { 33642 if (hasRequired_getSymbolsIn) return _getSymbolsIn; 33643 hasRequired_getSymbolsIn = 1; 33644 var arrayPush = require_arrayPush(), 33645 getPrototype = require_getPrototype(), 33646 getSymbols = require_getSymbols(), 33647 stubArray = requireStubArray(); 33648 33649 /* Built-in method references for those with the same name as other `lodash` methods. */ 33650 var nativeGetSymbols = Object.getOwnPropertySymbols; 33651 33652 /** 33653 * Creates an array of the own and inherited enumerable symbols of `object`. 33654 * 33655 * @private 33656 * @param {Object} object The object to query. 33657 * @returns {Array} Returns the array of symbols. 33658 */ 33659 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { 33660 var result = []; 33661 while (object) { 33662 arrayPush(result, getSymbols(object)); 33663 object = getPrototype(object); 33664 } 33665 return result; 33666 }; 33667 33668 _getSymbolsIn = getSymbolsIn; 33669 return _getSymbolsIn; 33670} 33671 33672var _copySymbolsIn; 33673var hasRequired_copySymbolsIn; 33674 33675function require_copySymbolsIn () { 33676 if (hasRequired_copySymbolsIn) return _copySymbolsIn; 33677 hasRequired_copySymbolsIn = 1; 33678 var copyObject = require_copyObject(), 33679 getSymbolsIn = require_getSymbolsIn(); 33680 33681 /** 33682 * Copies own and inherited symbols of `source` to `object`. 33683 * 33684 * @private 33685 * @param {Object} source The object to copy symbols from. 33686 * @param {Object} [object={}] The object to copy symbols to. 33687 * @returns {Object} Returns `object`. 33688 */ 33689 function copySymbolsIn(source, object) { 33690 return copyObject(source, getSymbolsIn(source), object); 33691 } 33692 33693 _copySymbolsIn = copySymbolsIn; 33694 return _copySymbolsIn; 33695} 33696 33697var _baseGetAllKeys; 33698var hasRequired_baseGetAllKeys; 33699 33700function require_baseGetAllKeys () { 33701 if (hasRequired_baseGetAllKeys) return _baseGetAllKeys; 33702 hasRequired_baseGetAllKeys = 1; 33703 var arrayPush = require_arrayPush(), 33704 isArray = requireIsArray(); 33705 33706 /** 33707 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses 33708 * `keysFunc` and `symbolsFunc` to get the enumerable property names and 33709 * symbols of `object`. 33710 * 33711 * @private 33712 * @param {Object} object The object to query. 33713 * @param {Function} keysFunc The function to get the keys of `object`. 33714 * @param {Function} symbolsFunc The function to get the symbols of `object`. 33715 * @returns {Array} Returns the array of property names and symbols. 33716 */ 33717 function baseGetAllKeys(object, keysFunc, symbolsFunc) { 33718 var result = keysFunc(object); 33719 return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); 33720 } 33721 33722 _baseGetAllKeys = baseGetAllKeys; 33723 return _baseGetAllKeys; 33724} 33725 33726var _getAllKeys; 33727var hasRequired_getAllKeys; 33728 33729function require_getAllKeys () { 33730 if (hasRequired_getAllKeys) return _getAllKeys; 33731 hasRequired_getAllKeys = 1; 33732 var baseGetAllKeys = require_baseGetAllKeys(), 33733 getSymbols = require_getSymbols(), 33734 keys = requireKeys(); 33735 33736 /** 33737 * Creates an array of own enumerable property names and symbols of `object`. 33738 * 33739 * @private 33740 * @param {Object} object The object to query. 33741 * @returns {Array} Returns the array of property names and symbols. 33742 */ 33743 function getAllKeys(object) { 33744 return baseGetAllKeys(object, keys, getSymbols); 33745 } 33746 33747 _getAllKeys = getAllKeys; 33748 return _getAllKeys; 33749} 33750 33751var _getAllKeysIn; 33752var hasRequired_getAllKeysIn; 33753 33754function require_getAllKeysIn () { 33755 if (hasRequired_getAllKeysIn) return _getAllKeysIn; 33756 hasRequired_getAllKeysIn = 1; 33757 var baseGetAllKeys = require_baseGetAllKeys(), 33758 getSymbolsIn = require_getSymbolsIn(), 33759 keysIn = requireKeysIn(); 33760 33761 /** 33762 * Creates an array of own and inherited enumerable property names and 33763 * symbols of `object`. 33764 * 33765 * @private 33766 * @param {Object} object The object to query. 33767 * @returns {Array} Returns the array of property names and symbols. 33768 */ 33769 function getAllKeysIn(object) { 33770 return baseGetAllKeys(object, keysIn, getSymbolsIn); 33771 } 33772 33773 _getAllKeysIn = getAllKeysIn; 33774 return _getAllKeysIn; 33775} 33776 33777var _DataView; 33778var hasRequired_DataView; 33779 33780function require_DataView () { 33781 if (hasRequired_DataView) return _DataView; 33782 hasRequired_DataView = 1; 33783 var getNative = require_getNative(), 33784 root = require_root(); 33785 33786 /* Built-in method references that are verified to be native. */ 33787 var DataView = getNative(root, 'DataView'); 33788 33789 _DataView = DataView; 33790 return _DataView; 33791} 33792 33793var _Promise; 33794var hasRequired_Promise; 33795 33796function require_Promise () { 33797 if (hasRequired_Promise) return _Promise; 33798 hasRequired_Promise = 1; 33799 var getNative = require_getNative(), 33800 root = require_root(); 33801 33802 /* Built-in method references that are verified to be native. */ 33803 var Promise = getNative(root, 'Promise'); 33804 33805 _Promise = Promise; 33806 return _Promise; 33807} 33808 33809var _Set; 33810var hasRequired_Set; 33811 33812function require_Set () { 33813 if (hasRequired_Set) return _Set; 33814 hasRequired_Set = 1; 33815 var getNative = require_getNative(), 33816 root = require_root(); 33817 33818 /* Built-in method references that are verified to be native. */ 33819 var Set = getNative(root, 'Set'); 33820 33821 _Set = Set; 33822 return _Set; 33823} 33824 33825var _WeakMap; 33826var hasRequired_WeakMap; 33827 33828function require_WeakMap () { 33829 if (hasRequired_WeakMap) return _WeakMap; 33830 hasRequired_WeakMap = 1; 33831 var getNative = require_getNative(), 33832 root = require_root(); 33833 33834 /* Built-in method references that are verified to be native. */ 33835 var WeakMap = getNative(root, 'WeakMap'); 33836 33837 _WeakMap = WeakMap; 33838 return _WeakMap; 33839} 33840 33841var _getTag; 33842var hasRequired_getTag; 33843 33844function require_getTag () { 33845 if (hasRequired_getTag) return _getTag; 33846 hasRequired_getTag = 1; 33847 var DataView = require_DataView(), 33848 Map = require_Map(), 33849 Promise = require_Promise(), 33850 Set = require_Set(), 33851 WeakMap = require_WeakMap(), 33852 baseGetTag = require_baseGetTag(), 33853 toSource = require_toSource(); 33854 33855 /** `Object#toString` result references. */ 33856 var mapTag = '[object Map]', 33857 objectTag = '[object Object]', 33858 promiseTag = '[object Promise]', 33859 setTag = '[object Set]', 33860 weakMapTag = '[object WeakMap]'; 33861 33862 var dataViewTag = '[object DataView]'; 33863 33864 /** Used to detect maps, sets, and weakmaps. */ 33865 var dataViewCtorString = toSource(DataView), 33866 mapCtorString = toSource(Map), 33867 promiseCtorString = toSource(Promise), 33868 setCtorString = toSource(Set), 33869 weakMapCtorString = toSource(WeakMap); 33870 33871 /** 33872 * Gets the `toStringTag` of `value`. 33873 * 33874 * @private 33875 * @param {*} value The value to query. 33876 * @returns {string} Returns the `toStringTag`. 33877 */ 33878 var getTag = baseGetTag; 33879 33880 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 33881 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || 33882 (Map && getTag(new Map) != mapTag) || 33883 (Promise && getTag(Promise.resolve()) != promiseTag) || 33884 (Set && getTag(new Set) != setTag) || 33885 (WeakMap && getTag(new WeakMap) != weakMapTag)) { 33886 getTag = function(value) { 33887 var result = baseGetTag(value), 33888 Ctor = result == objectTag ? value.constructor : undefined, 33889 ctorString = Ctor ? toSource(Ctor) : ''; 33890 33891 if (ctorString) { 33892 switch (ctorString) { 33893 case dataViewCtorString: return dataViewTag; 33894 case mapCtorString: return mapTag; 33895 case promiseCtorString: return promiseTag; 33896 case setCtorString: return setTag; 33897 case weakMapCtorString: return weakMapTag; 33898 } 33899 } 33900 return result; 33901 }; 33902 } 33903 33904 _getTag = getTag; 33905 return _getTag; 33906} 33907 33908/** Used for built-in method references. */ 33909 33910var _initCloneArray; 33911var hasRequired_initCloneArray; 33912 33913function require_initCloneArray () { 33914 if (hasRequired_initCloneArray) return _initCloneArray; 33915 hasRequired_initCloneArray = 1; 33916 var objectProto = Object.prototype; 33917 33918 /** Used to check objects for own properties. */ 33919 var hasOwnProperty = objectProto.hasOwnProperty; 33920 33921 /** 33922 * Initializes an array clone. 33923 * 33924 * @private 33925 * @param {Array} array The array to clone. 33926 * @returns {Array} Returns the initialized clone. 33927 */ 33928 function initCloneArray(array) { 33929 var length = array.length, 33930 result = new array.constructor(length); 33931 33932 // Add properties assigned by `RegExp#exec`. 33933 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 33934 result.index = array.index; 33935 result.input = array.input; 33936 } 33937 return result; 33938 } 33939 33940 _initCloneArray = initCloneArray; 33941 return _initCloneArray; 33942} 33943 33944var _Uint8Array; 33945var hasRequired_Uint8Array; 33946 33947function require_Uint8Array () { 33948 if (hasRequired_Uint8Array) return _Uint8Array; 33949 hasRequired_Uint8Array = 1; 33950 var root = require_root(); 33951 33952 /** Built-in value references. */ 33953 var Uint8Array = root.Uint8Array; 33954 33955 _Uint8Array = Uint8Array; 33956 return _Uint8Array; 33957} 33958 33959var _cloneArrayBuffer; 33960var hasRequired_cloneArrayBuffer; 33961 33962function require_cloneArrayBuffer () { 33963 if (hasRequired_cloneArrayBuffer) return _cloneArrayBuffer; 33964 hasRequired_cloneArrayBuffer = 1; 33965 var Uint8Array = require_Uint8Array(); 33966 33967 /** 33968 * Creates a clone of `arrayBuffer`. 33969 * 33970 * @private 33971 * @param {ArrayBuffer} arrayBuffer The array buffer to clone. 33972 * @returns {ArrayBuffer} Returns the cloned array buffer. 33973 */ 33974 function cloneArrayBuffer(arrayBuffer) { 33975 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 33976 new Uint8Array(result).set(new Uint8Array(arrayBuffer)); 33977 return result; 33978 } 33979 33980 _cloneArrayBuffer = cloneArrayBuffer; 33981 return _cloneArrayBuffer; 33982} 33983 33984var _cloneDataView; 33985var hasRequired_cloneDataView; 33986 33987function require_cloneDataView () { 33988 if (hasRequired_cloneDataView) return _cloneDataView; 33989 hasRequired_cloneDataView = 1; 33990 var cloneArrayBuffer = require_cloneArrayBuffer(); 33991 33992 /** 33993 * Creates a clone of `dataView`. 33994 * 33995 * @private 33996 * @param {Object} dataView The data view to clone. 33997 * @param {boolean} [isDeep] Specify a deep clone. 33998 * @returns {Object} Returns the cloned data view. 33999 */ 34000 function cloneDataView(dataView, isDeep) { 34001 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 34002 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 34003 } 34004 34005 _cloneDataView = cloneDataView; 34006 return _cloneDataView; 34007} 34008 34009/** Used to match `RegExp` flags from their coerced string values. */ 34010 34011var _cloneRegExp; 34012var hasRequired_cloneRegExp; 34013 34014function require_cloneRegExp () { 34015 if (hasRequired_cloneRegExp) return _cloneRegExp; 34016 hasRequired_cloneRegExp = 1; 34017 var reFlags = /\w*$/; 34018 34019 /** 34020 * Creates a clone of `regexp`. 34021 * 34022 * @private 34023 * @param {Object} regexp The regexp to clone. 34024 * @returns {Object} Returns the cloned regexp. 34025 */ 34026 function cloneRegExp(regexp) { 34027 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 34028 result.lastIndex = regexp.lastIndex; 34029 return result; 34030 } 34031 34032 _cloneRegExp = cloneRegExp; 34033 return _cloneRegExp; 34034} 34035 34036var _cloneSymbol; 34037var hasRequired_cloneSymbol; 34038 34039function require_cloneSymbol () { 34040 if (hasRequired_cloneSymbol) return _cloneSymbol; 34041 hasRequired_cloneSymbol = 1; 34042 var Symbol = require_Symbol(); 34043 34044 /** Used to convert symbols to primitives and strings. */ 34045 var symbolProto = Symbol ? Symbol.prototype : undefined, 34046 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; 34047 34048 /** 34049 * Creates a clone of the `symbol` object. 34050 * 34051 * @private 34052 * @param {Object} symbol The symbol object to clone. 34053 * @returns {Object} Returns the cloned symbol object. 34054 */ 34055 function cloneSymbol(symbol) { 34056 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 34057 } 34058 34059 _cloneSymbol = cloneSymbol; 34060 return _cloneSymbol; 34061} 34062 34063var _cloneTypedArray; 34064var hasRequired_cloneTypedArray; 34065 34066function require_cloneTypedArray () { 34067 if (hasRequired_cloneTypedArray) return _cloneTypedArray; 34068 hasRequired_cloneTypedArray = 1; 34069 var cloneArrayBuffer = require_cloneArrayBuffer(); 34070 34071 /** 34072 * Creates a clone of `typedArray`. 34073 * 34074 * @private 34075 * @param {Object} typedArray The typed array to clone. 34076 * @param {boolean} [isDeep] Specify a deep clone. 34077 * @returns {Object} Returns the cloned typed array. 34078 */ 34079 function cloneTypedArray(typedArray, isDeep) { 34080 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 34081 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 34082 } 34083 34084 _cloneTypedArray = cloneTypedArray; 34085 return _cloneTypedArray; 34086} 34087 34088var _initCloneByTag; 34089var hasRequired_initCloneByTag; 34090 34091function require_initCloneByTag () { 34092 if (hasRequired_initCloneByTag) return _initCloneByTag; 34093 hasRequired_initCloneByTag = 1; 34094 var cloneArrayBuffer = require_cloneArrayBuffer(), 34095 cloneDataView = require_cloneDataView(), 34096 cloneRegExp = require_cloneRegExp(), 34097 cloneSymbol = require_cloneSymbol(), 34098 cloneTypedArray = require_cloneTypedArray(); 34099 34100 /** `Object#toString` result references. */ 34101 var boolTag = '[object Boolean]', 34102 dateTag = '[object Date]', 34103 mapTag = '[object Map]', 34104 numberTag = '[object Number]', 34105 regexpTag = '[object RegExp]', 34106 setTag = '[object Set]', 34107 stringTag = '[object String]', 34108 symbolTag = '[object Symbol]'; 34109 34110 var arrayBufferTag = '[object ArrayBuffer]', 34111 dataViewTag = '[object DataView]', 34112 float32Tag = '[object Float32Array]', 34113 float64Tag = '[object Float64Array]', 34114 int8Tag = '[object Int8Array]', 34115 int16Tag = '[object Int16Array]', 34116 int32Tag = '[object Int32Array]', 34117 uint8Tag = '[object Uint8Array]', 34118 uint8ClampedTag = '[object Uint8ClampedArray]', 34119 uint16Tag = '[object Uint16Array]', 34120 uint32Tag = '[object Uint32Array]'; 34121 34122 /** 34123 * Initializes an object clone based on its `toStringTag`. 34124 * 34125 * **Note:** This function only supports cloning values with tags of 34126 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. 34127 * 34128 * @private 34129 * @param {Object} object The object to clone. 34130 * @param {string} tag The `toStringTag` of the object to clone. 34131 * @param {boolean} [isDeep] Specify a deep clone. 34132 * @returns {Object} Returns the initialized clone. 34133 */ 34134 function initCloneByTag(object, tag, isDeep) { 34135 var Ctor = object.constructor; 34136 switch (tag) { 34137 case arrayBufferTag: 34138 return cloneArrayBuffer(object); 34139 34140 case boolTag: 34141 case dateTag: 34142 return new Ctor(+object); 34143 34144 case dataViewTag: 34145 return cloneDataView(object, isDeep); 34146 34147 case float32Tag: case float64Tag: 34148 case int8Tag: case int16Tag: case int32Tag: 34149 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: 34150 return cloneTypedArray(object, isDeep); 34151 34152 case mapTag: 34153 return new Ctor; 34154 34155 case numberTag: 34156 case stringTag: 34157 return new Ctor(object); 34158 34159 case regexpTag: 34160 return cloneRegExp(object); 34161 34162 case setTag: 34163 return new Ctor; 34164 34165 case symbolTag: 34166 return cloneSymbol(object); 34167 } 34168 } 34169 34170 _initCloneByTag = initCloneByTag; 34171 return _initCloneByTag; 34172} 34173 34174var _baseCreate; 34175var hasRequired_baseCreate; 34176 34177function require_baseCreate () { 34178 if (hasRequired_baseCreate) return _baseCreate; 34179 hasRequired_baseCreate = 1; 34180 var isObject = requireIsObject(); 34181 34182 /** Built-in value references. */ 34183 var objectCreate = Object.create; 34184 34185 /** 34186 * The base implementation of `_.create` without support for assigning 34187 * properties to the created object. 34188 * 34189 * @private 34190 * @param {Object} proto The object to inherit from. 34191 * @returns {Object} Returns the new object. 34192 */ 34193 var baseCreate = (function() { 34194 function object() {} 34195 return function(proto) { 34196 if (!isObject(proto)) { 34197 return {}; 34198 } 34199 if (objectCreate) { 34200 return objectCreate(proto); 34201 } 34202 object.prototype = proto; 34203 var result = new object; 34204 object.prototype = undefined; 34205 return result; 34206 }; 34207 }()); 34208 34209 _baseCreate = baseCreate; 34210 return _baseCreate; 34211} 34212 34213var _initCloneObject; 34214var hasRequired_initCloneObject; 34215 34216function require_initCloneObject () { 34217 if (hasRequired_initCloneObject) return _initCloneObject; 34218 hasRequired_initCloneObject = 1; 34219 var baseCreate = require_baseCreate(), 34220 getPrototype = require_getPrototype(), 34221 isPrototype = require_isPrototype(); 34222 34223 /** 34224 * Initializes an object clone. 34225 * 34226 * @private 34227 * @param {Object} object The object to clone. 34228 * @returns {Object} Returns the initialized clone. 34229 */ 34230 function initCloneObject(object) { 34231 return (typeof object.constructor == 'function' && !isPrototype(object)) 34232 ? baseCreate(getPrototype(object)) 34233 : {}; 34234 } 34235 34236 _initCloneObject = initCloneObject; 34237 return _initCloneObject; 34238} 34239 34240var _baseIsMap; 34241var hasRequired_baseIsMap; 34242 34243function require_baseIsMap () { 34244 if (hasRequired_baseIsMap) return _baseIsMap; 34245 hasRequired_baseIsMap = 1; 34246 var getTag = require_getTag(), 34247 isObjectLike = requireIsObjectLike(); 34248 34249 /** `Object#toString` result references. */ 34250 var mapTag = '[object Map]'; 34251 34252 /** 34253 * The base implementation of `_.isMap` without Node.js optimizations. 34254 * 34255 * @private 34256 * @param {*} value The value to check. 34257 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 34258 */ 34259 function baseIsMap(value) { 34260 return isObjectLike(value) && getTag(value) == mapTag; 34261 } 34262 34263 _baseIsMap = baseIsMap; 34264 return _baseIsMap; 34265} 34266 34267var isMap_1; 34268var hasRequiredIsMap; 34269 34270function requireIsMap () { 34271 if (hasRequiredIsMap) return isMap_1; 34272 hasRequiredIsMap = 1; 34273 var baseIsMap = require_baseIsMap(), 34274 baseUnary = require_baseUnary(), 34275 nodeUtil = require_nodeUtil(); 34276 34277 /* Node.js helper references. */ 34278 var nodeIsMap = nodeUtil && nodeUtil.isMap; 34279 34280 /** 34281 * Checks if `value` is classified as a `Map` object. 34282 * 34283 * @static 34284 * @memberOf _ 34285 * @since 4.3.0 34286 * @category Lang 34287 * @param {*} value The value to check. 34288 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 34289 * @example 34290 * 34291 * _.isMap(new Map); 34292 * // => true 34293 * 34294 * _.isMap(new WeakMap); 34295 * // => false 34296 */ 34297 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; 34298 34299 isMap_1 = isMap; 34300 return isMap_1; 34301} 34302 34303var _baseIsSet; 34304var hasRequired_baseIsSet; 34305 34306function require_baseIsSet () { 34307 if (hasRequired_baseIsSet) return _baseIsSet; 34308 hasRequired_baseIsSet = 1; 34309 var getTag = require_getTag(), 34310 isObjectLike = requireIsObjectLike(); 34311 34312 /** `Object#toString` result references. */ 34313 var setTag = '[object Set]'; 34314 34315 /** 34316 * The base implementation of `_.isSet` without Node.js optimizations. 34317 * 34318 * @private 34319 * @param {*} value The value to check. 34320 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 34321 */ 34322 function baseIsSet(value) { 34323 return isObjectLike(value) && getTag(value) == setTag; 34324 } 34325 34326 _baseIsSet = baseIsSet; 34327 return _baseIsSet; 34328} 34329 34330var isSet_1; 34331var hasRequiredIsSet; 34332 34333function requireIsSet () { 34334 if (hasRequiredIsSet) return isSet_1; 34335 hasRequiredIsSet = 1; 34336 var baseIsSet = require_baseIsSet(), 34337 baseUnary = require_baseUnary(), 34338 nodeUtil = require_nodeUtil(); 34339 34340 /* Node.js helper references. */ 34341 var nodeIsSet = nodeUtil && nodeUtil.isSet; 34342 34343 /** 34344 * Checks if `value` is classified as a `Set` object. 34345 * 34346 * @static 34347 * @memberOf _ 34348 * @since 4.3.0 34349 * @category Lang 34350 * @param {*} value The value to check. 34351 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 34352 * @example 34353 * 34354 * _.isSet(new Set); 34355 * // => true 34356 * 34357 * _.isSet(new WeakSet); 34358 * // => false 34359 */ 34360 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; 34361 34362 isSet_1 = isSet; 34363 return isSet_1; 34364} 34365 34366var _baseClone; 34367var hasRequired_baseClone; 34368 34369function require_baseClone () { 34370 if (hasRequired_baseClone) return _baseClone; 34371 hasRequired_baseClone = 1; 34372 var Stack = require_Stack(), 34373 arrayEach = require_arrayEach(), 34374 assignValue = require_assignValue(), 34375 baseAssign = require_baseAssign(), 34376 baseAssignIn = require_baseAssignIn(), 34377 cloneBuffer = require_cloneBuffer(), 34378 copyArray = require_copyArray(), 34379 copySymbols = require_copySymbols(), 34380 copySymbolsIn = require_copySymbolsIn(), 34381 getAllKeys = require_getAllKeys(), 34382 getAllKeysIn = require_getAllKeysIn(), 34383 getTag = require_getTag(), 34384 initCloneArray = require_initCloneArray(), 34385 initCloneByTag = require_initCloneByTag(), 34386 initCloneObject = require_initCloneObject(), 34387 isArray = requireIsArray(), 34388 isBuffer = requireIsBuffer(), 34389 isMap = requireIsMap(), 34390 isObject = requireIsObject(), 34391 isSet = requireIsSet(), 34392 keys = requireKeys(), 34393 keysIn = requireKeysIn(); 34394 34395 /** Used to compose bitmasks for cloning. */ 34396 var CLONE_DEEP_FLAG = 1, 34397 CLONE_FLAT_FLAG = 2, 34398 CLONE_SYMBOLS_FLAG = 4;
vendor: 3,288 bytes, lines 34399-34490
34399 34400 /** `Object#toString` result references. */ 34401 var argsTag = '[object Arguments]', 34402 arrayTag = '[object Array]', 34403 boolTag = '[object Boolean]', 34404 dateTag = '[object Date]', 34405 errorTag = '[object Error]', 34406 funcTag = '[object Function]', 34407 genTag = '[object GeneratorFunction]', 34408 mapTag = '[object Map]', 34409 numberTag = '[object Number]', 34410 objectTag = '[object Object]', 34411 regexpTag = '[object RegExp]', 34412 setTag = '[object Set]', 34413 stringTag = '[object String]', 34414 symbolTag = '[object Symbol]', 34415 weakMapTag = '[object WeakMap]'; 34416 34417 var arrayBufferTag = '[object ArrayBuffer]', 34418 dataViewTag = '[object DataView]', 34419 float32Tag = '[object Float32Array]', 34420 float64Tag = '[object Float64Array]', 34421 int8Tag = '[object Int8Array]', 34422 int16Tag = '[object Int16Array]', 34423 int32Tag = '[object Int32Array]', 34424 uint8Tag = '[object Uint8Array]', 34425 uint8ClampedTag = '[object Uint8ClampedArray]', 34426 uint16Tag = '[object Uint16Array]', 34427 uint32Tag = '[object Uint32Array]'; 34428 34429 /** Used to identify `toStringTag` values supported by `_.clone`. */ 34430 var cloneableTags = {}; 34431 cloneableTags[argsTag] = cloneableTags[arrayTag] = 34432 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = 34433 cloneableTags[boolTag] = cloneableTags[dateTag] = 34434 cloneableTags[float32Tag] = cloneableTags[float64Tag] = 34435 cloneableTags[int8Tag] = cloneableTags[int16Tag] = 34436 cloneableTags[int32Tag] = cloneableTags[mapTag] = 34437 cloneableTags[numberTag] = cloneableTags[objectTag] = 34438 cloneableTags[regexpTag] = cloneableTags[setTag] = 34439 cloneableTags[stringTag] = cloneableTags[symbolTag] = 34440 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = 34441 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 34442 cloneableTags[errorTag] = cloneableTags[funcTag] = 34443 cloneableTags[weakMapTag] = false; 34444 34445 /** 34446 * The base implementation of `_.clone` and `_.cloneDeep` which tracks 34447 * traversed objects. 34448 * 34449 * @private 34450 * @param {*} value The value to clone. 34451 * @param {boolean} bitmask The bitmask flags. 34452 * 1 - Deep clone 34453 * 2 - Flatten inherited properties 34454 * 4 - Clone symbols 34455 * @param {Function} [customizer] The function to customize cloning. 34456 * @param {string} [key] The key of `value`. 34457 * @param {Object} [object] The parent object of `value`. 34458 * @param {Object} [stack] Tracks traversed objects and their clone counterparts. 34459 * @returns {*} Returns the cloned value. 34460 */ 34461 function baseClone(value, bitmask, customizer, key, object, stack) { 34462 var result, 34463 isDeep = bitmask & CLONE_DEEP_FLAG, 34464 isFlat = bitmask & CLONE_FLAT_FLAG, 34465 isFull = bitmask & CLONE_SYMBOLS_FLAG; 34466 34467 if (customizer) { 34468 result = object ? customizer(value, key, object, stack) : customizer(value); 34469 } 34470 if (result !== undefined) { 34471 return result; 34472 } 34473 if (!isObject(value)) { 34474 return value; 34475 } 34476 var isArr = isArray(value); 34477 if (isArr) { 34478 result = initCloneArray(value); 34479 if (!isDeep) { 34480 return copyArray(value, result); 34481 } 34482 } else { 34483 var tag = getTag(value), 34484 isFunc = tag == funcTag || tag == genTag; 34485 34486 if (isBuffer(value)) { 34487 return cloneBuffer(value, isDeep); 34488 } 34489 if (tag == objectTag || tag == argsTag || (isFunc && !object)) { 34490 result = (isFlat || isFunc) ? {}
34490 : initCloneObject(value); 34491 if (!isDeep) { 34492 return isFlat 34493 ? copySymbolsIn(value, baseAssignIn(result, value)) 34494 : copySymbols(value, baseAssign(result, value)); 34495 } 34496 } else { 34497 if (!cloneableTags[tag]) { 34498 return object ? value : {}; 34499 } 34500 result = initCloneByTag(value, tag, isDeep); 34501 } 34502 } 34503 // Check for circular references and return its corresponding clone. 34504 stack || (stack = new Stack); 34505 var stacked = stack.get(value); 34506 if (stacked) { 34507 return stacked; 34508 } 34509 stack.set(value, result); 34510 34511 if (isSet(value)) { 34512 value.forEach(function(subValue) { 34513 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); 34514 }); 34515 } else if (isMap(value)) { 34516 value.forEach(function(subValue, key) { 34517 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); 34518 }); 34519 } 34520 34521 var keysFunc = isFull 34522 ? (isFlat ? getAllKeysIn : getAllKeys) 34523 : (isFlat ? keysIn : keys); 34524 34525 var props = isArr ? undefined : keysFunc(value); 34526 arrayEach(props || value, function(subValue, key) { 34527 if (props) { 34528 key = subValue; 34529 subValue = value[key]; 34530 } 34531 // Recursively populate clone (susceptible to call stack limits). 34532 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); 34533 }); 34534 return result; 34535 } 34536 34537 _baseClone = baseClone; 34538 return _baseClone; 34539} 34540 34541var cloneDeep_1; 34542var hasRequiredCloneDeep; 34543 34544function requireCloneDeep () { 34545 if (hasRequiredCloneDeep) return cloneDeep_1; 34546 hasRequiredCloneDeep = 1; 34547 var baseClone = require_baseClone(); 34548 34549 /** Used to compose bitmasks for cloning. */ 34550 var CLONE_DEEP_FLAG = 1, 34551 CLONE_SYMBOLS_FLAG = 4; 34552 34553 /** 34554 * This method is like `_.clone` except that it recursively clones `value`. 34555 * 34556 * @static 34557 * @memberOf _ 34558 * @since 1.0.0 34559 * @category Lang 34560 * @param {*} value The value to recursively clone. 34561 * @returns {*} Returns the deep cloned value. 34562 * @see _.clone 34563 * @example 34564 * 34565 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 34566 * 34567 * var deep = _.cloneDeep(objects); 34568 * console.log(deep[0] === objects[0]); 34569 * // => false 34570 */ 34571 function cloneDeep(value) { 34572 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 34573 } 34574 34575 cloneDeep_1 = cloneDeep; 34576 return cloneDeep_1; 34577} 34578 34579var cloneDeepExports = requireCloneDeep(); 34580var cloneDeep = /*@__PURE__*/(0,_commonjsHelpers_BFTU3MAI_js__WEBPACK_IMPORTED_MODULE_16__.g)(cloneDeepExports); 34581 34582const mapEntriesToSearchResults = ({ 34583 mappers, 34584 mapper, 34585 context, 34586 facet 34587}, items, state) => { 34588 const mapperFunc = mapper || mappers && mappers.results; 34589 return items && typeof mapperFunc === 'function' ? mapperFunc(items, facet, context, state) : []; 34590}; 34591const facetTemplate = { 34592 type: () => SET_SEARCH_ENTRIES, 34593 context: 'action.context', 34594 facet: 'action.facet', 34595 mappers: 'action.mappers', 34596 nextFacet: { 34597 aggregations: 'result.payload.aggregations', 34598 entries: { 34599 isLoading: () => false, 34600 isError: () => false 34601 }, 34602 featuredEntries: { 34603 isLoading: () => false, 34604 isError: () => false 34605 }, 34606 featuredResults: ({ 34607 action, 34608 featuredResult, 34609 state 34610 }) => mapEntriesToSearchResults(action, (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.g)(featuredResult), state), 34611 filters: ({ 34612 result, 34613 state, 34614 action 34615 }) => { 34616 const aggregations = result.payload && 'aggregations' in result.payload ? result.payload.aggregations : undefined; 34617 if (!aggregations) return {}; 34618 34619 // Handle aggregations client-side where the filter items have loaded 34620 // before the results containing the aggregations 34621 const filters = cloneDeep(getFilters(state, action.facet, action.context, 'js')); 34622 for (const filter of Object.values(filters)) { 34623 let aggregation = {}; 34624 if (typeof filter.fieldId === 'string') { 34625 aggregation = aggregations[(0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.d)(filter.fieldId)] || {}; 34626 } else if (Array.isArray(filter.fieldId)) { 34627 for (const fieldId of filter.fieldId) { 34628 aggregation = deepmerge__WEBPACK_IMPORTED_MODULE_13___default()(aggregation, aggregations[(0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.d)(fieldId)] || {}); 34629 } 34630 } 34631 // Populate filter items from aggregations for example tag fields 34632 if (filter.aggregations) { 34633 // Use supplied aggregations instead of field aggregations 34634 if (typeof filter.aggregations === 'string') { 34635 aggregation = aggregations[(0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.d)(filter.aggregations)] || {}; 34636 } else if (Array.isArray(filter.aggregations)) { 34637 aggregation = {}; 34638 for (const fieldId of filter.aggregations) { 34639 aggregation = deepmerge__WEBPACK_IMPORTED_MODULE_13___default()(aggregation, aggregations[(0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.d)(fieldId)] || {}); 34640 } 34641 } 34642 // Start with existing items that are not in the aggregation 34643 const existingItemsNotInAggregation = (filter.items || []).filter(item => !(item.key in (aggregation || {}))).map(item => { 34644 delete item.aggregate; 34645 return item; 34646 }); 34647 34648 // Map aggregation entries to filter items 34649 const aggregationItems = Object.entries(aggregation || {}).map(([key, aggregate]) => { 34650 var _filter$items; 34651 const existing = ((_filter$items = filter.items) === null || _filter$items === void 0 ? void 0 : _filter$items.find(item => item.key === key)) || {}; 34652 return { 34653 key, 34654 title: (existing === null || existing === void 0 ? void 0 : existing.title) || `${key[0].toUpperCase()}${key.slice(1)}`, 34655 isSelected: !!(existing !== null && existing !== void 0 && existing.isSelected), 34656 aggregate 34657 }; 34658 }); 34659 34660 // Combine existing items not in aggregation with aggregation items 34661 filter.items = [...existingItemsNotInAggregation, ...aggregationItems].sort((a, b) => (a.title || a.key).localeCompare(b.title || b.key)); 34662 continue; 34663 } 34664 34665 // Update aggregation counts on existing filter items 34666 // In the context of a pre-loaded facet, the filter items will 34667 // not have been loaded yet, so we need to check again when 34668 // the filter items load and populate the aggregate counts then as well 34669 for (const filterItem of filter.items || []) { 34670 if (!aggregation) delete filterItem.aggregate;else { 34671 const aggregate = aggregation[filterItem.key.toLowerCase()]; 34672 if (typeof aggregate === 'number') filterItem.aggregate = aggregate;else delete filterItem.aggregate; 34673 } 34674 } 34675 } 34676 return filters; 34677 }, 34678 queryDuration: 'result.duration', 34679 pagingInfo: { 34680 isLoading: () => false, 34681 pageCount: { 34682 $path: 'result.payload.pageCount', 34683 $default: 0 34684 }, 34685 totalCount: { 34686 $path: 'result.payload.totalCount', 34687 $default: 0 34688 }, 34689 pageSize: { 34690 $path: 'result.payload.pageSize', 34691 $default: 0 34692 }, 34693 pageIndex: 'pageIndex', 34694 pagesLoaded: { 34695 $path: 'action.queryParams', 34696 $formatting: ({ 34697 pageIndex, 34698 pagesLoaded 34699 }) => { 34700 const loaded = [...(pagesLoaded || [])]; 34701 if (isNaN(loaded.find(l => l === pageIndex))) { 34702 loaded.push(pageIndex); 34703 } 34704 return loaded.sort((a, b) => a - b); 34705 } 34706 }, 34707 prevPageIndex: 'action.queryParams.prevPageIndex' 34708 }, 34709 preloaded: { 34710 $path: 'preload', 34711 $default: false 34712 }, 34713 results: ({ 34714 action, 34715 pageIndex, 34716 result, 34717 prevResults, 34718 state 34719 }) => { 34720 const {
34721 loadMorePaging, 34722 pagesLoaded, 34723 prevPageIndex 34724 } = action.queryParams; 34725 const results = mapEntriesToSearchResults(action, (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.g)(result), state); 34726 if (!loadMorePaging) return results; 34727 34728 // add a _pageIndex property to the returned results to help us later 34729 const nextResults = results.map((r, idx) => ({ 34730 _pageIndex: pageIndex, 34731 _pagePosition: idx, 34732 ...r 34733 })); 34734 const loadedPages = pagesLoaded || []; 34735 34736 // if pageIndex is found in loadedPages, we have already loaded this page 34737 if (!isNaN(loadedPages.find(l => l === pageIndex))) return prevResults; 34738 34739 // Determine where we put the results depending on if we 34740 // are paging forwards, backwards, or doing a new search 34741 const firstResultSet = pageIndex > prevPageIndex ? prevResults || [] : nextResults; 34742 const secondResultSet = pageIndex > prevPageIndex ? nextResults : prevResults || []; 34743 const onlyResultSet = loadedPages.length === 0 ? nextResults : false; 34744 return onlyResultSet || [...firstResultSet, ...secondResultSet]; 34745 } 34746 }, 34747 preload: 'action.preload', 34748 ogState: 'action.ogState', 34749 state: 'state', 34750 debug: 'action.debug' 34751}; 34752const filterTemplate = { 34753 type: ({ 34754 type 34755 }) => type || LOAD_FILTERS_COMPLETE, 34756 context: 'context', 34757 facetKey: 'facetKey', 34758 filterKey: 'filterKey', 34759 nextFilter: { 34760 isLoading: () => false, 34761 isError: ({ 34762 type 34763 }) => type === LOAD_FILTERS_ERROR, 34764 items: ({ 34765 payload, 34766 selectedKeys, 34767 mapper, 34768 facet, 34769 filter 34770 }) => { 34771 // Handle taxonomy filter items 34772 if (payload && 'children' in payload) { 34773 var _payload$children; 34774 const items = (_payload$children = payload.children) === null || _payload$children === void 0 ? void 0 : _payload$children.map(item => { 34775 item.isSelected = selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.includes(item.key); 34776 return item; 34777 }); 34778 return (mapper === null || mapper === void 0 ? void 0 : mapper(items || [])) || []; 34779 } 34780 34781 // Handle entries-based filter items 34782 if (payload && 'items' in payload && filter.fieldId) { 34783 var _facet$aggregations2; 34784 // Handle aggregations from SSR where the results containing the aggregations have loaded before the filter items 34785 const aggregation = Array.isArray(filter.fieldId) ? filter.fieldId.reduce((agg, fieldId) => { 34786 var _facet$aggregations; 34787 const fieldAggregations = ((_facet$aggregations = facet.aggregations) === null || _facet$aggregations === void 0 ? void 0 : _facet$aggregations[(0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.d)(fieldId)]) || {}; 34788 // Accumulate numeric values for matching keys from previous counted fields 34789 for (const [key, value] of Object.entries(fieldAggregations)) { 34790 agg[key] = (agg[key] || 0) + value; 34791 } 34792 return agg; 34793 }, {}) : (_facet$aggregations2 = facet.aggregations) === null || _facet$aggregations2 === void 0 ? void 0 : _facet$aggregations2[(0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.d)(filter.fieldId)]; 34794 const items = payload.items.map(item => { 34795 var _item$sys, _item$sys2; 34796 item.isSelected = selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.includes(item === null || item === void 0 || (_item$sys = item.sys) === null || _item$sys === void 0 ? void 0 : _item$sys.id); 34797 const aggregate = aggregation === null || aggregation === void 0 ? void 0 : aggregation[item === null || item === void 0 || (_item$sys2 = item.sys) === null || _item$sys2 === void 0 ? void 0 : _item$sys2.id.toLowerCase()]; 34798 if (typeof aggregate === 'number') item.aggregate = aggregate; 34799 return item; 34800 }); 34801 return (mapper === null || mapper === void 0 ? void 0 : mapper(items)) || []; 34802 } 34803 return []; 34804 } 34805 }, 34806 error: { 34807 $path: 'error', 34808 $disable: e => !e 34809 } 34810}; 34811 34812const filterExpressionMapper = { 34813 // Expression type: so we can identify how to build the query 34814 expressionType: ({ 34815 contentTypeId 34816 }) => contentTypeId ? FilterExpressionTypes.contentType : FilterExpressionTypes.field,
34817 // Key: so we can target the query to a specific field 34818 key: 'fieldId', 34819 // Value: so we can filter a specific field by an array of values 34820 // e.g. taxonomy key or contentTypeId array 34821 values: 'selectedValues', 34822 fieldOperator: 'fieldOperator', 34823 logicOperator: 'logicOperator' 34824}; 34825const mapFilterToFilterExpression = filter => (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Ay)(filter, filterExpressionMapper); 34826 34827const mapFiltersToFilterExpression = (filters, selectedFilters) => { 34828 if (!selectedFilters || Object.keys(selectedFilters).length === 0) return []; 34829 const filterExpressions = []; 34830 34831 // Iterate through the keys in selectedFilters and locate 34832 // the items that are selected and queryable 34833 Object.entries(selectedFilters).map(([fkey, selectedValues]) => { 34834 const filter = filters[fkey]; 34835 if (selectedValues && filter) { 34836 // Where we have a value for a selectedFilter 34837 // and a filter is found for the current key 34838 // map the filter to a filterExpression object 34839 const expr = mapFilterToFilterExpression({ 34840 ...filter, 34841 selectedValues 34842 }); 34843 filterExpressions.push(expr); 34844 } 34845 }); 34846 return filterExpressions; 34847}; 34848 34849const queryParamsTemplate = { 34850 aggregations: root => { 34851 const { 34852 context, 34853 facet, 34854 state 34855 } = root; 34856 const stateFilters = getFilters(state, facet, context, 'js'); 34857 const aggregations = {}; 34858 for (const filter of Object.values(stateFilters)) { 34859 if (Array.isArray(filter.fieldId)) { 34860 for (const id of filter.fieldId) { 34861 const field = (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.b)(id); 34862 const aggregationKey = (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.d)(field); 34863 if (!aggregations[aggregationKey]) { 34864 aggregations[aggregationKey] = { 34865 field, 34866 size: 100 34867 }; 34868 } 34869 } 34870 } else if (filter.fieldId) { 34871 const field = (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.b)(filter.fieldId); 34872 aggregations[(0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.d)(field)] = { 34873 field, 34874 size: 100 34875 }; 34876 } 34877 } 34878 return { 34879 ...aggregations, 34880 ...getQueryParameter$2(root, 'customAggregations', {}) 34881 }; 34882 }, 34883 assetTypes: root => getQueryParameter$2(root, 'assetTypes', []), 34884 contentTypeIds: root => getQueryParameter$2(root, 'contentTypeIds', []), 34885 customWhere: root => getQueryParameter$2(root, 'customWhere', []), 34886 dynamicOrderBy: root => getQueryParameter$2(root, 'dynamicOrderBy', []), 34887 excludeIds: ({ 34888 action: { 34889 excludeIds 34890 } 34891 }) => { 34892 // Exclude current route entry id from minilist searches or any supplied ids 34893 if (excludeIds) return Array.isArray(excludeIds) ? excludeIds : excludeIds.split(',').map(id => id.trim()); 34894 return null; 34895 }, 34896 featuredResults: root => getQueryParameter$2(root, 'featuredResults', null), 34897 fieldLinkDepths: root => getQueryParameter$2(root, 'fieldLinkDepths', []), 34898 fields: root => getQueryParameter$2(root, 'fields', []), 34899 filters: ({ 34900 state, 34901 facet, 34902 context 34903 }) => { 34904 const stateFilters = getFilters(state, facet, context, 'js'); 34905 const selectedFilters = getSelectedFilters(state, facet, context, 'js'); 34906 // Use another mapping function to map the filter parameters for the query 34907 const filterParams = mapFiltersToFilterExpression(stateFilters, selectedFilters); 34908 return filterParams; 34909 }, 34910 fuzzySearch: root => getQueryParameter$2(root, 'fuzzySearch', false), 34911 includeInSearchFields: root => getQueryParameter$2(root, 'includeInSearch', []), 34912 internalPageIndex: ({ 34913 action, 34914 state 34915 }) => getPageIndex$2(state, '', action.context), 34916 internalPaging: root => getQueryParameter$2(root, 'internalPaging', false), 34917 languages: root => getQueryParameter$2(root, 'languages', []), 34918 linkDepth: root => getQueryParameter$2(root, 'linkDepth', 0), 34919 loadMorePaging: root => getQueryParameter$2(root, 'loadMorePaging', false), 34920 omitDefaultSearchFields: root => getQueryParameter$2(root, 'omitDefaultSearchFields', []), 34921 orderBy: root => getQueryParameter$2(root, 'orderBy', []), 34922 pageIndex: root => { 34923 const { 34924 action, 34925 state 34926 } = root; 34927 if (getQueryParameter$2(root, 'internalPaging', false)) return 0; 34928 if (action.type === UPDATE_PAGE_INDEX) return action.params.pageIndex; 34929 return !action.preload ? getPageIndex$2(state, action.facet, action.context) : 0; 34930 }, 34931 pageSize: root => { 34932 const { 34933 action, 34934 state 34935 } = root; 34936 return getPageSize(state, action.facet, action.context) || getQueryParameter$2(root, 'pageSize'); 34937 }, 34938 pagesLoaded: ({ 34939 state, 34940 facet, 34941 context 34942 }) => getPagesLoaded(state, facet, context), 34943 prevPageIndex: ({ 34944 state, 34945 facet, 34946 context 34947 }) => getPrevPageIndex(state, facet, context), 34948 projectId: ({ 34949 state, 34950 facet, 34951 context 34952 }) => { 34953 var _getFacet; 34954 return ((_getFacet = getFacet$1(state, facet, context, 'js')) === null || _getFacet === void 0 ? void 0 : _getFacet.projectId) || (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_15__.I)(state); 34955 }, 34956 searchTerm: root => root.context !== Context.minilist || getQueryParameter$2(root, 'useSearchTerm', false) ? getSearchTerm$2(root.state) : '', 34957 selectedFilters: ({ 34958 state, 34959 facet, 34960 context 34961 }) => Object.fromEntries(Object.entries(getSelectedFilters(state, facet, context, 'js')).map(([key, f]) => [key, f === null || f === void 0 ? void 0 : f.join(',')])), 34962 versionStatus: root => { 34963 const versionStatusOverride = getQueryParameter$2(root, 'versionStatus'); 34964 return versionStatusOverride || (0,_version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_5__.b)(root.
34964state); 34965 }, 34966 weightedSearchFields: root => { 34967 const wsf = getQueryParameter$2(root, 'weightedSearchFields', []); 34968 const deduped = wsf.filter((v, i, a) => a.findIndex(t => t.fieldId === v.fieldId) === i); 34969 return deduped; 34970 // return wsf; 34971 }, 34972 webpageTemplates: root => getQueryParameter$2(root, 'webpageTemplates', []) 34973}; 34974const mapStateToQueryParams = sourceJson => (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Ay)(sourceJson, queryParamsTemplate); 34975 34976/** 34977 * 1, Generates all the parameters required to run the search query. 34978 * 2, Tells us if we should run the search. 34979 * @param {object} action 34980 * @param {AppState} state 34981 * @returns [queryParams, runSearch] 34982 */ 34983const generateQueryParams = (action, state) => { 34984 const { 34985 context, 34986 facet 34987 } = action; 34988 // Map parameters using state and some additional 34989 // inputs from the action 34990 const queryParams = mapStateToQueryParams({ 34991 context, 34992 facet, 34993 action, 34994 state 34995 }); 34996 return [queryParams, runSearch(action, state, queryParams)]; 34997}; 34998 34999/** 35000 * Checks if we have already loaded everything we're asking for and tells us to run the search or not 35001 * @param action 35002 * @param state 35003 */ 35004const runSearch = (action, state, queryParams) => { 35005 const { 35006 context, 35007 // defaultLang, 35008 facet, 35009 ogState = state, 35010 preload, 35011 isSSR 35012 } = action; 35013 let willRun = false; 35014 35015 // const facetIsLoaded = defaultLang 35016 // ? false 35017 // : getIsLoaded(state, context, facet); 35018 const facetIsLoaded = getIsLoaded(state, context, facet); 35019 const stateParams = { 35020 ...getQueryParams(ogState, facet, context) 35021 }; 35022 stateParams.pageIndex = getPageIndex$2(ogState, facet, context); 35023 stateParams.searchTerm = getSearchTerm$2(ogState); 35024 stateParams.pageSize = getPageSize(ogState, facet, context); 35025 if (isSSR || 35026 // (context === Context.facets && isSSR) || 35027 // context === Context.minilist || 35028 preload || !facetIsLoaded || filterParamsChanged(action) || 35029 // || defaultLang 35030 languageChanged(action)) { 35031 willRun = true; 35032 } else { 35033 // Don't execute the search if the inbound query params 35034 // are the same as what we already have in state 35035 Object.entries(stateParams).forEach(([param, value]) => { 35036 const queryParam = queryParams[param]; 35037 if (JSON.stringify(value) !== JSON.stringify(queryParam)) { 35038 willRun = true; 35039 } 35040 }); 35041 } 35042 const internalPaging = getIsInternalPaging(ogState, facet, context); 35043 if (internalPaging && facetIsLoaded) { 35044 willRun = false; 35045 } 35046 return willRun; 35047}; 35048 35049/** 35050 * Patch mutates original params argument to decode certain 35051 * url encoded params which can creep into urls and cause a 35052 * flash of different content when hydrating from SSR 35053 * @param params SearchParams 35054 * @returns SearchParams 35055 */ 35056const sanitiseParams = params => { 35057 if (params && typeof params === 'object') for (const param of Object.keys(params)) { 35058 if (typeof params[param] === 'string') params[param] = params[param].replaceAll('%2C', ','); 35059 } 35060 return params; 35061}; 35062 35063/** 35064 * This will tell us if filter parameters have been 35065 * changed by some external event such as a route change 35066 * @param action 35067 * @returns true or false 35068 */ 35069const filterParamsChanged = (action, state) => { 35070 const { 35071 context, 35072 facet, 35073 params, 35074 ogState = state 35075 } = action; 35076 const selectedFilters = getSelectedFilters(ogState, facet, context, 'js'); 35077 const paramsChanged = Object.entries(selectedFilters).map(([filterKey, selectedValues]) => { 35078 const inboundValues = params && params[filterKey] && params[filterKey].split(',') || []; 35079 if (!(0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.a)(selectedValues, inboundValues)) return true; 35080 }); 35081 return paramsChanged.filter(f => f === true).length > 0; 35082}; 35083const languageChanged = action => { 35084 const stateLanguages = getQueryParameter$2({ 35085 ...action, 35086 state: action.ogState 35087 }, 'languages', []); 35088 return !(0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.a)(action.languages || [], stateLanguages); 35089}; 35090const debugExecuteSearch = (action, state) => { 35091 const [queryParams, runSearch] = generateQueryParams(action, state); 35092 console.log('runSearch', runSearch, 'action', action, 'filterParamsChanged', filterParamsChanged(action, state), 'getIsLoaded(state, context, facet)', getIsLoaded(state, action.context, action.facet)); 35093 const stateParams = { 35094 ...getQueryParams(action.ogState || state, action.facet, action.context), 35095 pageIndex: getPageIndex$2(action.ogState || state, action.facet, action.context), 35096 searchTerm: getSearchTerm$2(action.ogState || state) 35097 }; 35098 console.log(stateParams, queryParams); 35099 console.log('getSelectedFilters', getSelectedFilters(action.ogState || state, action.facet, action.context, 'js'), 'params', action.params); 35100}; 35101const scrollTo = scrollToElement => { 35102 if (typeof window !== 'undefined') { 35103 if (typeof scrollToElement === 'number') 35104 // Used to be Y coordinate, deprecated, because it's not accessible 35105 console.warn('updatePageIndex arg2 needs string');else if (typeof scrollToElement === 'string') { 35106 /* Effectively simulates an anchor link. Needed for accessibility, as window.scrollTo 35107 does not change focus, only scrolls the screen */ 35108 window.location.href = `${location.pathname}${location.search}#${scrollToElement}`; 35109 } 35110 } 35111}; 35112 35113// *** FILTER ITEM MAPPING *** 35114 35115// Base mapping, fields that are the same across all mappings 35116// to save repeating these elements in every mapper, spread this 35117// into your discrete mappings 35118const base = { 35119 contentTypeId: Fields.sys.contentTypeId, 35120 title: 'entryTitle', 35121 key: 'sys.id', 35122 path: 'sys.slug', 35123 isSelected: 'isSelected', 35124 aggregate: 'aggregate' 35125}; 35126const mapEntriesToFilterItems = entries => { 35127 if (!entries) return []; 35128 return entries.map(entry => { 35129 const template = base; 35130 if (template) { 35131 return (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Ay)(entry, template); 35132 } 35133 return entry; 35134 }); 35135}; 35136 35137const mapQueryParamsToCustomApi = queryParams => { 35138 const customApiMapping = { 35139 fieldLinkDepths: ({ 35140 fieldLinkDepths 35141 }) => JSON.stringify(fieldLinkDepths), 35142 fields: ({ 35143 fields 35144 }) => JSON.stringify(fields), 35145 orderBy: 'orderBy', 35146 linkDepth: 'linkDepth', 35147 pageSize: 'pageSize', 35148 pageIndex: 'pageIndex', 35149 term: { 35150 $path: 'searchTerm', 35151 $disable: t => !t 35152 }, 35153 versionStatus: 'versionStatus' 35154 };
35155 Object.keys(queryParams.selectedFilters).forEach(k => { 35156 customApiMapping[k] = { 35157 $path: `selectedFilters.${k}`, 35158 $disable: f => !f 35159 }; 35160 }); 35161 return (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Ay)(queryParams, customApiMapping); 35162}; 35163 35164const searchSagas = [(0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(CLEAR_FILTERS, clearFilters), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(DO_SEARCH, doSearch), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(SET_ROUTE_FILTERS, loadFilters), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(SET_SEARCH_ENTRIES, preloadOtherFacets), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(UPDATE_CURRENT_FACET, updateCurrentFacet), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(UPDATE_CURRENT_TAB, updateCurrentTab), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(UPDATE_PAGE_INDEX, updatePageIndex), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(UPDATE_PAGE_SIZE, updatePageSize), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(UPDATE_SEARCH_TERM, updateSearchTerm), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(UPDATE_SORT_ORDER, updateSortOrder), (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .takeEvery */ .jP)(UPDATE_SELECTED_FILTERS, applySearchFilter)]; 35165const toJS = obj => obj && 'toJS' in obj && typeof obj.toJS === 'function' ? obj.toJS() : obj; 35166function* setRouteFilters(action) { 35167 const { 35168 mappers, 35169 params, 35170 composition, 35171 debug, 35172 ssr 35173 } = action; 35174 let { 35175 defaultLang 35176 } = action; 35177 const state = toJS(yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)()); 35178 const isSSR = getIsSsr(state); 35179 sanitiseParams(params); 35180 35181 // Get current facet from params or state 35182 const facet = (params === null || params === void 0 ? void 0 : params.facet) || action.facet; 35183 const listingType = (params === null || params === void 0 ? void 0 : params.listingType) || action.listingType; 35184 35185 // Determine facets or listings context 35186 let context = listingType ? Context.listings : Context.facets; 35187 let currentFacet = listingType || facet; 35188 35189 // Instead of just taking the facet/listing from params, 35190 // we need to check all aliases to determine the correct facet/listing 35191 const currentLanguage = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(_selectors_D4ulaTom_js__WEBPACK_IMPORTED_MODULE_9__.s); 35192 if (currentFacet) { 35193 const currentLocalised = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(getCurrentFromLocalised, currentFacet, currentLanguage, context); 35194 if (currentLocalised) { 35195 currentFacet = currentLocalised.facet; 35196 defaultLang = currentLocalised.language; 35197 } 35198 } 35199 35200 // If composition is set, and no facet/listingType in params, 35201 // pick the first facet/listing from the composition 35202 if (composition) { 35203 const compositions = getSearchCompositions(state); 35204 const compositionConfig = compositions[composition]; 35205 if (compositionConfig) { 35206 if ('facets' in compositionConfig) { 35207 if (!facet) { 35208 var _compositionConfig$fa; 35209 const firstFacetKey = (_compositionConfig$fa = compositionConfig.facets) === null || _compositionConfig$fa === void 0 ? void 0 : _compositionConfig$fa[0]; 35210 context = Context.facets; 35211 currentFacet = firstFacetKey; 35212 } 35213 } else if ('listings' in compositionConfig) { 35214 if (!listingType) { 35215 var _compositionConfig$li; 35216 const firstListingKey = (_compositionConfig$li = compositionConfig.listings) === null || _compositionConfig$li === void 0 ? void 0 : _compositionConfig$li[0]; 35217 context = Context.listings; 35218 currentFacet = firstListingKey; 35219 } 35220 } 35221 } 35222 } 35223 35224 // If Listing use listing type (ignore params.facet) 35225 if (context === Context.listings && listingType) { 35226 currentFacet = listingType; 35227 } 35228 35229 // Pick the default facet from initialState 35230 if (!currentFacet) { 35231 var _tabs$, _Object$keys; 35232 const tabs = getSearchTabs(state, 'js'); 35233 currentFacet = (tabs === null || tabs === void 0 || (_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.defaultFacet) || ((_Object$keys = Object.keys(getFacets(state, 'js'))) === null || _Object$keys === void 0 ? void 0 : _Object$keys[0]) || ''; 35234 } 35235 35236 // Ensure we have a language set 35237 if (!defaultLang) defaultLang = currentLanguage; 35238 35239 // When we have a currentFacet, check the defaultLang 35240 // and translate any filter params from the localised aliases 35241 // to the actual filter keys 35242 if (currentFacet && defaultLang) { 35243 for (const paramKey of Object.keys(params || {})) { 35244 const filterKey = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(getFilterKeyFromLocalised, paramKey, defaultLang, currentFacet, context); 35245 if (filterKey && filterKey !== paramKey) { 35246 params[filterKey] = params[paramKey]; 35247 delete params[paramKey]; 35248 } 35249 } 35250 } 35251 const nextAction = { 35252 type: SET_ROUTE_FILTERS, 35253 context, 35254 composition, 35255 facet: currentFacet, 35256 mappers, 35257 params, 35258 defaultLang, 35259 languages: defaultLang ? [defaultLang] : [], 35260 isSSR, 35261 ssr, 35262 debug 35263 }; 35264 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(nextAction); 35265 35266 // keep track of this state ref for comparing changes to params later 35267 const ogState = { 35268 search: state.search 35269 }; 35270 35271 // Using call instead of triggering from the put 35272 // to allow this exported saga to continue during SSR 35273 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .call */ .T1)(ensureSearch, { 35274 ...nextAction, 35275 ogState 35276 }); 35277} 35278function* doSearch(action) { 35279 var _action$params; 35280 const state = toJS(yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)()); 35281 if (action.config) { 35282 // If the action contains a config object, we can add this to the 35283 // state at runtime 35284 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)({ 35285 ...action, 35286 type: APPLY_CONFIG 35287 }); 35288 } 35289 const nextAction = { 35290 ...action, 35291 type: SET_SEARCH_FILTERS, 35292 isSSR: getIsSsr(state), 35293 facet: action.facet || ((_action$params = action.params) === null || _action$params === void 0 ? void 0 : _action$params.facet) 35294 }; 35295 if (nextAction.facet && (action.config || Object.keys(getFacet$1(state, nextAction.facet, action.context, 'js')).length > 0)) { 35296 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(nextAction); 35297 35298 // keep track of this state ref for comparing changes to params later 35299 const ogState = { 35300 search: state.search 35301 }; 35302 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .call */ .T1)(ensureSearch, { 35303 ...nextAction, 35304 ogState 35305 }); 35306 } 35307} 35308function* loadFilters(action) { 35309 const { 35310 facet: facetKey, 35311 context, 35312 mappers = {}, 35313 languages, 35314 ssr
35315 } = action; 35316 const filtersToLoad = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(getFiltersToLoad, facetKey, context, 'js'); 35317 if (filtersToLoad.length > 0) { 35318 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)({ 35319 type: LOAD_FILTERS, 35320 filtersToLoad, 35321 facetKey, 35322 context, 35323 languages 35324 }); 35325 const selectedKeys = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(getSelectedFilters, facetKey, context, 'js'); 35326 const facet = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(getFacet$1, facetKey, context, 'js'); 35327 const filters = facet.filters || {}; 35328 const projectId = facet.projectId; 35329 const filtersToLoadSagas = filters && filtersToLoad.map((filterKey = '') => { 35330 return (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .call */ .T1)(loadFilter, { 35331 facetKey, 35332 filterKey, 35333 filter: filters[filterKey], 35334 projectId, 35335 languages, 35336 selectedKeys: selectedKeys[filterKey], 35337 context, 35338 mapper: 'filterItems' in mappers && mappers.filterItems || mapEntriesToFilterItems, 35339 ssr 35340 }); 35341 }); 35342 if (filtersToLoadSagas) yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .all */ .Q7)(filtersToLoadSagas); 35343 } 35344} 35345function* loadFilter(action) { 35346 const { 35347 context, 35348 facetKey, 35349 filter, 35350 filterKey, 35351 languages, 35352 mapper, 35353 projectId, 35354 selectedKeys, 35355 // get api instance from SSR context that is connected to the current request in SSR, 35356 // fall back to the imported cachedSearch api that is not connected to the current SSR context 35357 ssr: { 35358 api 35359 } = { 35360 api: _ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_6__.c 35361 } 35362 } = action; 35363 const { 35364 contentTypeId, 35365 customWhere, 35366 pageSize, 35367 path 35368 } = filter; 35369 const createStateFrom = { 35370 type: LOAD_FILTERS_COMPLETE, 35371 context, 35372 error: undefined, 35373 facetKey, 35374 filter, 35375 filterKey, 35376 payload: {}, 35377 selectedKeys, 35378 mapper 35379 }; 35380 try { 35381 if (contentTypeId) { 35382 const versionStatus = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(_version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_5__.b); 35383 const query = filterQuery(Array.isArray(contentTypeId) ? contentTypeId : [contentTypeId], languages, versionStatus, customWhere, pageSize); 35384 const payload = yield api.search(query, 0, projectId); 35385 if (!payload) throw new Error('No payload returned by search'); 35386 if (payload.type === 'error') throw payload; 35387 createStateFrom.payload = payload; 35388 } 35389 if (path) { 35390 const payload = yield cachedTaxonomyLookup.getTaxonomyNodeByPath(path, projectId); 35391 if (!payload) throw new Error(`Nothing returned for taxonomy: '${path}'`); 35392 if (payload.type === 'error') throw payload; 35393 createStateFrom.payload = payload; 35394 } 35395 } catch (error) { 35396 createStateFrom.type = LOAD_FILTERS_ERROR; 35397 createStateFrom.error = error; 35398 } 35399 createStateFrom.facet = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(getFacet$1, facetKey, context, 'js'); 35400 const nextAction = (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Ay)(createStateFrom, filterTemplate); 35401 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(nextAction); 35402} 35403function* ensureSearch(action) { 35404 const { 35405 context, 35406 facet, 35407 debug 35408 }
35408 = action; 35409 try { 35410 const state = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(); 35411 const nextAction = { 35412 ...action, 35413 ogState: action.ogState || { 35414 search: state.search 35415 } 35416 }; 35417 const [queryParams, runSearch] = generateQueryParams(nextAction, state); 35418 if (debug && (debug === true || debug.executeSearch)) debugExecuteSearch(nextAction, state); 35419 if (runSearch) { 35420 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)({ 35421 type: EXECUTE_SEARCH, 35422 facet, 35423 context 35424 }); 35425 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .call */ .T1)(executeSearch, { 35426 ...nextAction, 35427 context, 35428 facet, 35429 queryParams, 35430 debug 35431 }); 35432 } 35433 } catch (error) { 35434 loglevel__WEBPACK_IMPORTED_MODULE_3__.error('Error running ensureSearch:', error, error.stack); 35435 } 35436} 35437function* executeSearch(action) { 35438 const { 35439 context, 35440 facet, 35441 queryParams, 35442 mappers, 35443 ssr 35444 } = action; 35445 try { 35446 const state = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(); 35447 let result = {}; 35448 let featuredResult; 35449 let featuredQuery; 35450 const customApi = getCustomApi(state, facet, context, 'js'); 35451 if (customApi) { 35452 const apiParams = typeof mappers === 'object' && typeof mappers.customApi === 'function' && mappers.customApi(queryParams) || mapQueryParamsToCustomApi(queryParams); 35453 result.payload = yield (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.c)(customApi, apiParams, ssr); 35454 result.duration = 1; 35455 } else { 35456 if (queryParams.featuredResults) { 35457 featuredQuery = searchQuery(queryParams, true); 35458 featuredResult = yield (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.t)(featuredQuery, queryParams.linkDepth, queryParams.projectId, ssr); 35459 queryParams.excludeIds = (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.g)(featuredResult).map(fi => { 35460 var _fi$sys; 35461 return fi === null || fi === void 0 || (_fi$sys = fi.sys) === null || _fi$sys === void 0 ? void 0 : _fi$sys.id; 35462 }).filter(fi => typeof fi === 'string'); 35463 } 35464 const query = searchQuery(queryParams); 35465 result = yield (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.t)(query, queryParams.linkDepth, queryParams.projectId, ssr); 35466 } 35467 const createStateFrom = { 35468 action, 35469 featuredResult, 35470 pageIndex: queryParams.internalPaging && queryParams.internalPageIndex || queryParams.pageIndex, 35471 prevResults: getResults(state, facet, action.context, 'js'), 35472 result, 35473 state: yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)() 35474 }; 35475 const nextAction = (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Ay)(createStateFrom, facetTemplate); 35476 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(nextAction); 35477 } catch (error) { 35478 loglevel__WEBPACK_IMPORTED_MODULE_3__.error('Error running executeSearch:', error, error.stack); 35479 } 35480} 35481function* preloadOtherFacets(action) { 35482 const { 35483 preload, 35484 context, 35485 facet, 35486 debug 35487 }
35487 = action; 35488 const state = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(); 35489 const currentFacet = getCurrent$2(state, context); 35490 const currentComposition = getCurrentComposition(state); 35491 if (!preload && facet === currentFacet && (context !== Context.listings || currentComposition)) { 35492 const allFacets = currentComposition ? getCompositionFacets(state, currentComposition) : getFacets(state, 'js'); 35493 const otherFacets = Object.keys(allFacets).filter(f => f !== currentFacet); 35494 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .all */ .Q7)(otherFacets.map((preloadFacet = '') => { 35495 const preloadAction = { 35496 ...action, 35497 facet: preloadFacet, 35498 preload: true 35499 }; 35500 const [queryParams, runSearch] = generateQueryParams(preloadAction, state); 35501 if (debug && (debug === true || debug.preloadOtherFacets)) debugExecuteSearch(preloadAction, state); 35502 return runSearch && (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .call */ .T1)(executeSearch, { 35503 ...action, 35504 type: EXECUTE_SEARCH_PRELOAD, 35505 preload: true, 35506 facet: preloadFacet, 35507 queryParams 35508 }); 35509 })); 35510 } 35511} 35512function* updateCurrentTab(action) { 35513 const { 35514 id, 35515 mappers 35516 } = action; 35517 const state = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(); 35518 const facets = getFacets(state, 'js'); 35519 const tabs = getSearchTabs(state, 'js'); 35520 let nextFacet = tabs === null || tabs === void 0 ? void 0 : tabs[id].currentFacet; 35521 if (!nextFacet) { 35522 Object.entries(facets).map(([facetName, facet]) => { 35523 if (facet.tabId === id && (tabs === null || tabs === void 0 ? void 0 : tabs[id].defaultFacet) === facetName) nextFacet = facetName; 35524 }); 35525 } 35526 // If the next Tab does not have a defaultFacet, 35527 // take the first facet for that tab 35528 if (!nextFacet) nextFacet = Object.entries(facets).filter(([, f]) => f.tabId === id)[0][0]; 35529 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(withMappers(updateCurrentFacet$1(nextFacet), mappers)); 35530} 35531function* clearFilters(action) { 35532 const { 35533 clear, 35534 mappers 35535 } = action; 35536 const term = clear !== null && clear !== void 0 && clear.term ? '' : undefined; 35537 const uri = yield buildUri({ 35538 term 35539 }, mappers); 35540 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(navigate(uri)); 35541} 35542function* updateCurrentFacet(action) { 35543 const { 35544 facet, 35545 mappers 35546 } = action; 35547 const pageIndex = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(getPageIndex$2, facet); 35548 const uri = yield buildUri({ 35549 facet, 35550 pageIndex 35551 }, mappers); 35552 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(navigate(uri)); 35553} 35554function* updateSearchTerm(action) { 35555 const { 35556 term, 35557 mappers 35558 } = action; 35559 const uri = yield buildUri({ 35560 term 35561 }, mappers); 35562 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(navigate(uri)); 35563} 35564function* updateSortOrder(action) { 35565 const { 35566 orderBy, 35567 facet, 35568 mappers 35569 } = action; 35570 const uri = yield buildUri({ 35571 orderBy, 35572 facet 35573 }, mappers); 35574 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(navigate(uri)); 35575} 35576function* updatePageIndex(action) { 35577 const { 35578 pageIndex, 35579 mappers, 35580 scrollToElement 35581 } = action; 35582 const uri = yield buildUri({ 35583 pageIndex 35584 }, mappers); 35585 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(navigate(uri)); 35586 if (typeof scrollToElement !== 'undefined') scrollTo(scrollToElement); 35587} 35588function* updatePageSize(action) { 35589 const { 35590 pageSize, 35591 mappers, 35592 scrollToElement 35593 } = action; 35594 const uri = yield buildUri({ 35595 pageSize 35596 }, mappers); 35597 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(navigate(uri)); 35598 if (typeof scrollToElement !== 'undefined') scrollTo(scrollToElement); 35599} 35600function* applySearchFilter(action) { 35601 const { 35602 mappers, 35603 scrollToElement 35604 } = action; 35605 const uri = yield buildUri({}, mappers); 35606 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .put */ .yJ)(navigate(uri)); 35607 if (typeof scrollToElement !== 'undefined') scrollTo(scrollToElement); 35608} 35609function* buildUri({ 35610 facet, 35611 orderBy, 35612 pageIndex = 0, 35613 pageSize, 35614 term 35615}, mappers) { 35616 const state = yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Lt)(); 35617 const mapUri = (mappers === null || mappers === void 0 ? void 0 : mappers.navigate) || mapStateToSearchUri; 35618 const uri = mapUri({ 35619 state, 35620 facet, 35621 orderBy, 35622 pageIndex, 35623 pageSize, 35624 term
35625 }); 35626 // return uri; 35627 return `${uri.path}${uri.search && `?${uri.search}` || ''}${uri.hash && `#${uri.hash}` || ''}`; 35628} 35629function* triggerMinilistSsr(options) { 35630 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .call */ .T1)(doSearch, { 35631 type: DO_SEARCH, 35632 ...options 35633 }); 35634} 35635function* triggerListingSsr(options) { 35636 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .call */ .T1)(setRouteFilters, options); 35637} 35638function* triggerSearchSsr(options) { 35639 yield (0,_redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_4__/* .call */ .T1)(setRouteFilters, options); 35640} 35641 35642 35643//# sourceMappingURL=sagas-BN4gNmmc.js.map 35644 35645 35646/***/ }, 35647 35648/***/ 26280 35649(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 35650 35651"use strict"; 35652__webpack_require__.r(__webpack_exports__); 35653/* harmony export */ __webpack_require__.d(__webpack_exports__, { 35654/* harmony export */ Context: () => (/* binding */ Context), 35655/* harmony export */ actions: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.k), 35656/* harmony export */ doSearch: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.q), 35657/* harmony export */ expressions: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.r), 35658/* harmony export */ queries: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.V), 35659/* harmony export */ reducer: () => (/* binding */ reducers), 35660/* harmony export */ routeParams: () => (/* reexport safe */ _util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.h), 35661/* harmony export */ sagas: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.W), 35662/* harmony export */ schema: () => (/* binding */ schema), 35663/* harmony export */ selectors: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.Y), 35664/* harmony export */ setRouteFilters: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.Z), 35665/* harmony export */ triggerListingSsr: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.$), 35666/* harmony export */ triggerMinilistSsr: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a0), 35667/* harmony export */ triggerSearchSsr: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a2), 35668/* harmony export */ types: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a3), 35669/* harmony export */ useFacets: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ab), 35670/* harmony export */ useListing: () => (/* reexport safe */ _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ac), 35671/* harmony export */ useMinilist: () => (/* binding */ useMinilist), 35672/* harmony export */ withListing: () => (/* binding */ withListing), 35673/* harmony export */ withSearch: () => (/* binding */ withSearch) 35674/* harmony export */ }); 35675/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 35676/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45135); 35677/* harmony import */ var _ToJs_BnRRHk6f_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32078); 35678/* harmony import */ var _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69248); 35679/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13527); 35680/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(73575); 35681/* harmony import */ var deep_equal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4982); 35682/* harmony import */ var deep_equal__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(deep_equal__WEBPACK_IMPORTED_MODULE_6__); 35683/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14744); 35684/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_7__); 35685/* harmony import */ var _util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12846); 35686/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73065); 35687/* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_9__); 35688/* harmony import */ var _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(85118); 35689/* harmony import */ var _version_hQnuV0n7_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81452); 35690/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(23790); 35691/* harmony import */ var jsonpath_mapper__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(47149); 35692/* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(17276); 35693/* harmony import */ var _ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(22255); 35694/* harmony import */ var contensis_delivery_api__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(15575); 35695/* harmony import */ var contensis_delivery_api__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(contensis_delivery_api__WEBPACK_IMPORTED_MODULE_16__); 35696/* harmony import */ var _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(95137); 35697/* harmony import */ var redux_saga__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(27701); 35698/* harmony import */ var _slice_C6JLQik8_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(60218); 35699/* harmony import */ var contensis_core_api__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(41416); 35700/* harmony import */ var contensis_core_api__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(contensis_core_api__WEBPACK_IMPORTED_MODULE_20__); 35701/* harmony import */ var _commonjsHelpers_BFTU3MAI_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(90912); 35702 35703 35704 35705 35706 35707 35708 35709 35710 35711 35712 35713 35714 35715 35716 35717 35718 35719 35720 35721 35722 35723 35724 35725 35726 35727 35728 35729 35730 35731 35732 35733const withSearch = mappers => SearchComponent => { 35734 const Wrapper = props => { 35735 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(SearchComponent, props); 35736 }; 35737 Wrapper.displayName = `withSearch(${SearchComponent.displayName || SearchComponent.name})`; 35738 const mapStateToProps = state => { 35739 return { 35740 currentFacet: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.t)(state), 35741 currentPageIndex: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.D)(state), 35742 currentTabIndex: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.u)(state), 35743 facet: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.v)(state), 35744 facets: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.P)(state), 35745 facetsTotalCount: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.x)(state), 35746 facetTitles: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.w)(state), 35747 featuredResults: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.y)(state), 35748 filters: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.I)(state), 35749 isLoading: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.B)(state), 35750 paging: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.G)(state), 35751 pageIsLoading: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.F)(state), 35752 results: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.J)(state), 35753 resultsInfo: (mappers === null || mappers === void 0 ? void 0 : mappers.resultsInfo) && mappers.resultsInfo(state) || (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.K)(state), 35754 searchTerm: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.M)(state), 35755 searchTotalCount: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.N)(state), 35756 selectedFilters: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.O)(state), 35757 sortOrder: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.H)({ 35758 state 35759 }, 'dynamicOrderBy', []), 35760 tabsAndFacets: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.Q)(state), 35761 totalCount: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.R)(state) 35762 }; 35763 }; 35764 const mapDispatchToProps = { 35765 clearFilters: filterKey => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.l)(filterKey), mappers), 35766 updateCurrentFacet: facet => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a4)(facet), mappers), 35767 updateCurrentTab: id => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a5)(id), mappers), 35768 updatePageIndex: (pageIndex, scrollToElement) => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a6)(pageIndex, scrollToElement), mappers), 35769 updatePageSize: (pageSize, scrollToElement) => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a7)(pageSize, scrollToElement), mappers), 35770 updateSearchTerm: term => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a8)(term), mappers), 35771 updateSelectedFilters: (filter, key, isUnknownItem = false, scrollToElement) => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a9)(filter, key, isUnknownItem, scrollToElement), mappers), 35772 updateSortOrder: orderBy => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.aa)(orderBy), mappers) 35773 }; 35774 const connector = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .connect */ .Ng)(mapStateToProps, mapDispatchToProps); 35775 return connector((0,_ToJs_BnRRHk6f_js__WEBPACK_IMPORTED_MODULE_2__.t)(Wrapper)); 35776}; 35777 35778const withListing = mappers => ListingComponent => { 35779 const Wrapper = props => { 35780 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(ListingComponent, props); 35781 }; 35782 Wrapper.displayName = `withListing(${ListingComponent.displayName || ListingComponent.name})`; 35783 const { 35784 getCurrent, 35785 getFeaturedResults, 35786 getIsLoading, 35787 getListing, 35788 getPageIndex, 35789 getPaging, 35790 getQueryParameter, 35791 getRenderableFilters, 35792 getResults, 35793 getSearchTerm, 35794 getSelectedFilters 35795 } = _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.X; 35796 const mapStateToProps = state => { 35797 return { 35798 currentListing: getCurrent(state), 35799 currentPageIndex: getPageIndex(state), 35800 listing: getListing(state), 35801 featured: getFeaturedResults(state), 35802 filters: getRenderableFilters(state), 35803 isLoading: getIsLoading(state), 35804 paging: getPaging(state), 35805 results: getResults(state), 35806 resultsInfo: typeof (mappers === null || mappers === void 0 ? void 0 : mappers.resultsInfo) === 'function' && mappers.resultsInfo(state) || (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.K)(state), 35807 searchTerm: getSearchTerm(state), 35808 selectedFilters: getSelectedFilters(state), 35809 sortOrder: getQueryParameter({ 35810 state 35811 }, 'dynamicOrderBy', []) 35812 }; 35813 }; 35814 const mapDispatchToProps = { 35815 clearFilters: filterKey => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.l)(filterKey), mappers), 35816 updateCurrentFacet: facet => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a4)(facet), mappers), 35817 updatePageIndex: (pageIndex, scrollToElement) => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a6)(pageIndex, scrollToElement), mappers), 35818 updatePageSize: (pageSize, scrollToElement) => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a7)(pageSize, scrollToElement), mappers), 35819 updateSearchTerm: term => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a8)(term), mappers), 35820 updateSelectedFilters: (filter, key, isUnknownItem = false, scrollToElement) => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a9)(filter, key, isUnknownItem, scrollToElement), mappers), 35821 updateSortOrder: orderBy => (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.ad)((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.aa)(orderBy), mappers) 35822 }; 35823 return (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .connect */ .Ng)(mapStateToProps, mapDispatchToProps)((0,_ToJs_BnRRHk6f_js__WEBPACK_IMPORTED_MODULE_2__.t)(Wrapper)); 35824}; 35825 35826const makeSelectMinilistProps = () => (0,reselect__WEBPACK_IMPORTED_MODULE_4__/* .createSelector */ .Mz)(state =>
35826 state, (_, id) => id, (state, id) => id ? { 35827 facet: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.v)(state, id, _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist, 'js'), 35828 filters: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.z)(state, id, _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist, 'js'), 35829 isLoading: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.B)(state, _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist, id), 35830 pagingInfo: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.G)(state, id, _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist, 'js'), 35831 results: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.J)(state, id, _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist, 'js'), 35832 searchTerm: (0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.M)(state) 35833} : null); 35834const useMinilist = ({ 35835 id, 35836 config, 35837 excludeIds, 35838 mapper, 35839 mappers, 35840 params, 35841 defaultLang, 35842 debug 35843} = { 35844 id: '' 35845}) => { 35846 const dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .useDispatch */ .wA)(); 35847 const selectMinilistProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(makeSelectMinilistProps, [id]); 35848 const { 35849 facet, 35850 filters, 35851 isLoading, 35852 pagingInfo, 35853 results, 35854 searchTerm 35855 } = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .useSelector */ .d4)(state => selectMinilistProps(state, id)) || { 35856 facet: {}, 35857 filters: {}, 35858 isLoading: false, 35859 pagingInfo: {}, 35860 results: [], 35861 searchTerm: '' 35862 }; 35863 // useSelector((state: AppState) => ({ 35864 // facet: getFacet(state, id, Context.minilist).toJS(), 35865 // filters: getFilters(state, id, Context.minilist).toJS(), 35866 // isLoading: getIsLoading(state, Context.minilist, id), 35867 // pagingInfo: getPaging(state, id, Context.minilist).toJS(), 35868 // results: getResults(state, id, Context.minilist).toJS(), 35869 // searchTerm: getSearchTerm(state), 35870 // })); 35871 35872 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 35873 if (id && (mapper || mappers !== null && mappers !== void 0 && mappers.results)) { 35874 dispatch((0,_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a1)({ 35875 config, 35876 context: _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist, 35877 defaultLang, 35878 facet: id, 35879 mapper, 35880 mappers, 35881 params, 35882 excludeIds, 35883 debug 35884 })); 35885 } 35886 }, [dispatch, excludeIds, id, defaultLang, params]); 35887 return { 35888 filters, 35889 isLoading, 35890 paging: pagingInfo, 35891 results, 35892 searchTerm, 35893 title: facet.title 35894 }; 35895}; 35896 35897const entries = { 35898 isLoading: false, 35899 isError: false, 35900 items: [] 35901}; 35902const pagingInfo = { 35903 isLoading: false, 35904 pageCount: 0, 35905 pageIndex: 0, 35906 pageSize: 0, 35907 pagesLoaded: [], 35908 prevPageIndex: 0, 35909 totalCount: 0 35910}; 35911const searchFacet = { 35912 title: null, 35913 featuredEntries: entries, 35914 featuredResults: [], 35915 entries, 35916 results: [], 35917 queryParams: {}, 35918 filters: {}, 35919 queryDuration: 0, 35920 pagingInfo, 35921 projectId: '' 35922}; 35923const searchTab = { 35924 currentFacet: undefined, 35925 facets: {}, 35926 id: 0, 35927 label: undefined, 35928 totalCount: '' 35929}; 35930const filtering = { 35931 isLoading: false, 35932 isError: false, 35933 isGrouped: false, 35934 title: undefined, 35935 contentTypeId: undefined, 35936 customWhere: [], 35937 fieldId: undefined, 35938 items: [] 35939}; 35940const filterItem = { 35941 key: '', 35942 type: undefined, 35943 title: undefined, 35944 path: undefined, 35945 isSelected: false 35946}; 35947const config = { 35948 isLoaded: false, 35949 isError: false 35950}; 35951const searchState = { 35952 compositions: {}, 35953 context: 'facets', 35954 currentFacet: '', 35955 currentListing: '', 35956 currentComposition: '', 35957 facets: {}, 35958 listings: {}, 35959 minilist: {}, 35960 term: '', 35961 tabs: [], 35962 config 35963}; 35964const initialState = searchState; 35965 35966var schema = /*#__PURE__*/Object.freeze({ 35967 __proto__: null, 35968 entries: entries, 35969 filterItem: filterItem, 35970 filtering: filtering, 35971 initialState: initialState, 35972 pagingInfo: pagingInfo, 35973 searchFacet: searchFacet, 35974 searchTab: searchTab 35975}); 35976 35977const addConfigToState = (state, action) => { 35978 const { 35979 context, 35980 facet, 35981 config 35982 } = action; 35983 // Adding or changing the config of a single facet, listing or minilist 35984 if (context && facet && config) { 35985 state[context][facet] = { 35986 ...searchFacet, 35987 ...config 35988 }; 35989 } else if (config) { 35990 // Changing the entire search config 35991 state = { 35992 ...config, 35993 config: initialState.config 35994 }; 35995 } 35996 return state; 35997}; 35998const generateSearchFacets = (context, config) => { 35999 const facets = {}; 36000 if (config) { 36001 const thisConfig = config[context] || {}; 36002 if (Object.keys(thisConfig).length > 0) { 36003 Object.entries(thisConfig).map(([facetName, facet]) => { 36004 const newFacet = deepmerge__WEBPACK_IMPORTED_MODULE_7___default()(searchFacet, facet); 36005 if (!('isDisabled' in facet) || facet.isDisabled !== true) facets[facetName] = newFacet; 36006 }); 36007 } 36008 } 36009 return facets; 36010}; 36011const generateFiltersState = ({ 36012 facet, 36013 params, 36014 context, 36015 isCurrentFacet 36016}, state) => { 36017 // Remove filters we know about from params 36018 const filterParams = { 36019 ...params, 36020 facet: undefined, 36021 orderBy: undefined, 36022 pageIndex: undefined, 36023 term: undefined 36024 }; 36025 36026 // Get any existing filters and normalise the items[] 36027 // so we can start off with isSelected is false 36028 let filters = Object.entries(state[context][facet].filters || []).map(([key, filter]) => { 36029 if (isCurrentFacet || filter.isGrouped) { 36030 var _filter$items; 36031 return [key, { 36032 ...filter, 36033 items: (_filter$items = filter.items) === null || _filter$items === void 0 ? void 0 : _filter$items.map(item => ({ 36034 ...item, 36035 isSelected: false 36036 })) 36037 }]; 36038 } 36039 return [key, filter]; 36040 }); 36041 const addFilterItem = (filters, paramKey, paramValue) => 36042 // Iterate through all filters within the facet, 36043 // if the paramKey matches the filter key 36044 // get the existing items list, and see if that filter 36045 // already exists, if so set isSelected to true, 36046 // if not create a new filterItem, setting the key only 36047 // so we can match this key later on when we load the filters 36048 filters.map(([key, filter]) => { 36049 if (paramKey !== key || !isCurrentFacet && !filter.isGrouped) { 36050 return [key, filter]; 36051 } else { 36052 const items = filter.items || []; 36053 const itemIndex = items.findIndex(item => (item === null || item === void 0 ? void 0 : item.key) === paramValue); 36054 if (items.length > 0 && itemIndex !== -1) { 36055 items[itemIndex].isSelected = true; 36056 } else { 36057 items.push({ 36058 ...filterItem, 36059 key: paramValue, 36060 isSelected: true 36061 }); 36062 } 36063 return [key, { 36064 ...filter, 36065 items 36066 }]; 36067 } 36068 }); 36069 36070 // For each value found in filterParams 36071 // we are looking to split that value into multiple by any comma 36072 // and then either set isSelected for an existing filterItem 36073 // or push an item to the filters.{ key }.items[] array 36074 // giving it only the key (entry guid) that can be taken to filter 36075 // the search results during SSR without needing to fetch the filters first 36076 Object.entries(filterParams).map(([paramName = '', paramValue]) => { 36077 if (typeof paramValue === 'string') return paramValue.split(',').map(pVal => filters = addFilterItem(filters, paramName, pVal)); 36078 if (typeof paramValue === 'boolean') filters = addFilterItem(filters, paramName, paramValue); 36079 }); 36080 return Object.fromEntries(filters); 36081}; 36082const resetFacets = (state, context) => Object.fromEntries(Object.entries(state[context]).map(([k, v]) => [k, resetFacet(v)])); 36083const resetFacet = facet => { 36084 facet.pagingInfo.pagesLoaded = []; 36085 facet.pagingInfo.pageIndex = 0; 36086 facet.queryDuration = 0; 36087 return facet; 36088}; 36089var reducers = config => { 36090 // Add facets from SearchConfig to initialState 36091 const initState = { 36092 ...initialState, 36093 tabs: config.tabs, 36094 compositions: config.compositions || {},
36095 facets: generateSearchFacets(_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.facets, config), 36096 listings: generateSearchFacets(_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.listings, config), 36097 minilist: generateSearchFacets(_sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist, config) 36098 }; 36099 return (0,immer__WEBPACK_IMPORTED_MODULE_5__/* .produce */ .jM)((state = initState, action) => { 36100 const context = state.context; 36101 const current$1 = context !== 'listings' ? state.currentFacet : state.currentListing; 36102 switch (action.type) { 36103 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.A: 36104 { 36105 state = addConfigToState(state, action); 36106 return state; 36107 } 36108 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.C: 36109 { 36110 var _action$clear, _action$clear2; 36111 const currentFilters = state[context][current$1].filters; 36112 const filterKeys = ((_action$clear = action.clear) === null || _action$clear === void 0 ? void 0 : _action$clear.keys) || []; 36113 state[context][current$1].filters = Object.fromEntries(Object.entries(currentFilters).map(([filterKey, filter]) => { 36114 if (filterKeys.length === 0 || filterKeys.includes(filterKey)) { 36115 const filterItems = filter.items || []; 36116 filter.items = filterItems.map(item => ({ 36117 ...item, 36118 isSelected: false 36119 })); 36120 } 36121 return [filterKey, filter]; 36122 })); 36123 state[context][current$1].queryDuration = 0; 36124 state[context][current$1].pagingInfo.pagesLoaded = []; 36125 36126 // also clone UPDATE_SEARCH_TERM behavior if clearing term also 36127 if (((_action$clear2 = action.clear) === null || _action$clear2 === void 0 ? void 0 : _action$clear2.term) === true) { 36128 state.term = ''; 36129 state[context] = resetFacets(state, context); 36130 } 36131 return; 36132 } 36133 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.E: 36134 { 36135 state[action.context][action.facet].entries = { 36136 ...(state[action.context][action.facet].entries || entries), 36137 isLoading: true 36138 }; 36139 return; 36140 } 36141 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.b: 36142 { 36143 state[action.context][action.facet].entries = { 36144 ...entries, 36145 isError: true, 36146 error: action.error 36147 }; 36148 return; 36149 } 36150 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.L: 36151 { 36152 const { 36153 facetKey, 36154 filtersToLoad 36155 } = action; 36156 const filters = state[action.context][facetKey].filters; 36157 Object.entries(filters).map(([filterKey, filter]) => { 36158 if (filtersToLoad.find(f => f === filterKey)) return { 36159 ...filter, 36160 isLoading: true 36161 }; 36162 return filter; 36163 }); 36164 state[action.context][facetKey].filters = Object.fromEntries(Object.entries(filters).map(([filterKey, filter]) => { 36165 if (filtersToLoad.find(f => f === filterKey)) return [filterKey, { 36166 ...filter, 36167 isLoading: true 36168 }]; 36169 return [filterKey, filter]; 36170 })); 36171 return; 36172 } 36173 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.d: 36174 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.c: 36175 { 36176 var _nextFilter$items; 36177 const { 36178 facetKey, 36179 filterKey, 36180 nextFilter 36181 } = action; 36182 const stateFilter = state[action.context][facetKey].filters[filterKey]; 36183 if (!((_nextFilter$items = nextFilter.items) !== null && _nextFilter$items !== void 0 && _nextFilter$items.length) && (stateFilter.items || []).length >= nextFilter.items.length) { 36184 // Preserve items already in state 36185 state[action.context][facetKey].filters[filterKey] = { 36186 ...stateFilter, 36187 isLoading: false, 36188 isError: nextFilter.isError 36189 }; 36190 return; 36191 } 36192 state[action.context][facetKey].filters[filterKey] = deepmerge__WEBPACK_IMPORTED_MODULE_7___default()(stateFilter, nextFilter, { 36193 arrayMerge: (source, inbound) => inbound 36194 }); 36195 return; 36196 } 36197 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.S: 36198 { 36199 var _state$context$facet, _state$tabs, _state$context$facet$; 36200 const { 36201 facet, 36202 params, 36203 context, 36204 languages 36205 } = action; 36206 const { 36207 term = '', 36208 pageIndex, 36209 pageSize, 36210 orderBy 36211 } = params; 36212 const stateTerm = state.term; 36213 const tabId = ((_state$context$facet = state[context][facet]) === null || _state$context$facet === void 0 ? void 0 : _state$context$facet.tabId) || 0; 36214 36215 // Reset the facet if the search term has changed, or if the any of 36216 // the filters have changed 36217 const resetAllFacets = stateTerm && term !== stateTerm; 36218 let resetCurrentFacet = false;
36219 36220 // Add filter values in params to the matched filters in state for the current facet 36221 // causing unfetched filter items to be generated with isSelected: true 36222 // or existing filter items to be tagged with isSelected: true 36223 const nextFacets = Object.fromEntries(Object.entries(state[context]).map(([facetName = '', stateFacet]) => { 36224 const isCurrentFacet = facetName === facet; 36225 const nextFilters = generateFiltersState({ 36226 facet: facetName, 36227 params, 36228 context, 36229 isCurrentFacet 36230 }, state); 36231 resetCurrentFacet = state.config.isLoaded === true && !deep_equal__WEBPACK_IMPORTED_MODULE_6___default()(nextFilters, stateFacet.filters); 36232 stateFacet = resetCurrentFacet ? resetFacet(stateFacet) : stateFacet; 36233 stateFacet.filters = nextFilters; 36234 stateFacet.queryParams.dynamicOrderBy = (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.i)(orderBy) || []; 36235 stateFacet.queryParams.languages = languages; 36236 return [facetName, stateFacet]; 36237 })); 36238 state.context = context; 36239 state[context] = nextFacets; 36240 state[action.context === _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.facets ? 'currentFacet' : 'currentListing'] = facet; 36241 state.currentComposition = action.composition; 36242 state.term = term; 36243 if ((_state$tabs = state.tabs) !== null && _state$tabs !== void 0 && _state$tabs[tabId]) state.tabs[tabId].currentFacet = facet; 36244 if (state[context][facet]) state[context][facet].pagingInfo = { 36245 ...(state[context][facet].pagingInfo || pagingInfo), 36246 pageIndex: Number(pageIndex) - 1 || (state[context][facet].queryParams.loadMorePaging ? ((_state$context$facet$ = state[context][facet].pagingInfo) === null || _state$context$facet$ === void 0 ? void 0 : _state$context$facet$.pageIndex) || 0 : 0), 36247 pageSize: Number(pageSize) || state[context][facet].queryParams.pageSize 36248 }; 36249 state.config.isLoaded = true; 36250 state.config.ssr = typeof window === 'undefined'; 36251 if (resetAllFacets) state[context] = resetFacets(state, context); 36252 return; 36253 } 36254 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.e: 36255 { 36256 var _action$mappers; 36257 const thisContext = action.context || context; 36258 const currentFacet = state[thisContext][action.facet]; 36259 36260 // // Handle aggregations client-side where the filter items have loaded before the results containing the aggregations 36261 // for (const [filterKey, filter] of Object.entries( 36262 // currentFacet.filters 36263 // )) { 36264 // const aggregation = (action.nextFacet as Partial<Facet>) 36265 // .aggregations?.[convertKeyForAggregation(filterKey)]; 36266 36267 // for (const filterItem of filter.items || []) { 36268 // if (!aggregation) delete filterItem.aggregate; 36269 // else { 36270 // const aggregate = aggregation[filterItem.key.toLowerCase()]; 36271 // if (typeof aggregate === 'number') 36272 // filterItem.aggregate = aggregate; 36273 // else delete filterItem.aggregate; 36274 // } 36275 // } 36276 // } 36277 36278 state[thisContext][action.facet] = deepmerge__WEBPACK_IMPORTED_MODULE_7___default()(currentFacet, action.nextFacet, { 36279 arrayMerge: (source, inbound) => inbound 36280 }); 36281 if ((_action$mappers = action.mappers) !== null && _action$mappers !== void 0 && _action$mappers.resultsInfo && typeof action.mappers.resultsInfo === 'function') { 36282 // Likely an anti-pattern but we need to provide the whole state 36283 // to the resultsInfo mapper, including the latest search state 36284 // which is not yet committed outside of this produce() call 36285 state[thisContext][action.facet].resultsInfo = action.mappers.resultsInfo({ 36286 ...action.state, 36287 search: (0,immer__WEBPACK_IMPORTED_MODULE_5__/* .current */ .ss)(state) 36288 }); 36289 } 36290 return; 36291 } 36292 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.f: 36293 { 36294 var _action$params; 36295 // DO SEARCH then SET_SEARCH_FILTERS is for when we cannot use SET_ROUTE_FILTERS 36296 // for example in a minilist scenario where the route filters 36297 // are used for the primary page / listing navigation 36298
36299 // Add filter values in params to the matched filters in state 36300 // causing unfetched filter items to be generated with isSelected: true 36301 const filters = generateFiltersState({ 36302 ...action, 36303 isCurrentFacet: true 36304 }, state); 36305 const term = action === null || action === void 0 || (_action$params = action.params) === null || _action$params === void 0 ? void 0 : _action$params.term; 36306 const useSearchTerm = state[action.context || _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist][action.facet].queryParams.useSearchTerm || false; 36307 state[action.context || _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist][action.facet].filters = filters; 36308 state[action.context || _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.a.minilist][action.facet].queryParams.excludeIds = action.excludeIds; 36309 state.term = useSearchTerm ? term : state.term; 36310 state.config.ssr = typeof window === 'undefined'; 36311 return; 36312 } 36313 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.U: 36314 { 36315 const { 36316 pageIndex 36317 } = action; 36318 const internalPaging = state[context][current$1].queryParams.internalPaging || false; 36319 const currentPageIndex = state[context][current$1].pagingInfo.pageIndex || 0; 36320 state[context][current$1].pagingInfo.pageIndex = Number(pageIndex) || 0; 36321 state[context][current$1].pagingInfo.prevPageIndex = currentPageIndex; 36322 state[context][current$1].pagingInfo.isLoading = true; 36323 if (internalPaging) return; 36324 state[context][current$1].queryDuration = 0; 36325 return; 36326 } 36327 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.g: 36328 { 36329 const { 36330 pageSize 36331 } = action; 36332 state[context][current$1].pagingInfo.pageSize = pageSize; 36333 state[context][current$1].pagingInfo.pageIndex = 0; 36334 state[context][current$1].pagingInfo.isLoading = true; 36335 state[context][current$1].queryDuration = 0; 36336 return; 36337 } 36338 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.h: 36339 { 36340 state.term = action.term; 36341 state[context] = resetFacets(state, context); 36342 return; 36343 } 36344 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.i: 36345 { 36346 const { 36347 filter, 36348 key, 36349 isUnknownItem 36350 } = action; 36351 const isSingleSelect = state[context][current$1].filters[filter].isSingleSelect || false; 36352 const isGrouped = state[context][current$1].filters[filter].isGrouped || false; 36353 const currentItems = state[context][current$1].filters[filter].items; 36354 if (isGrouped) state[context] = resetFacets(state, context); 36355 state[context][current$1] = resetFacet(state[context][current$1]); 36356 if (isUnknownItem && (currentItems === null || currentItems === void 0 ? void 0 : currentItems.findIndex(item => (item === null || item === void 0 ? void 0 : item.key) === key)) === -1) { 36357 currentItems === null || currentItems === void 0 || currentItems.push({ 36358 key, 36359 isSelected: false 36360 }); 36361 } 36362 state[context][current$1].filters[filter].items = currentItems === null || currentItems === void 0 ? void 0 : currentItems.map(item => { 36363 if (item.key === key) { 36364 return { 36365 ...item, 36366 isSelected: !item.isSelected 36367 }; 36368 } 36369 if (isSingleSelect) return { 36370 ...item, 36371 isSelected: false 36372 }; 36373 return item; 36374 }); 36375 return; 36376 } 36377 case _sagas_BN4gNmmc_js__WEBPACK_IMPORTED_MODULE_3__.j: 36378 { 36379 const { 36380 orderBy, 36381 facet 36382 } = action; 36383 state[context] = resetFacets(state, context); 36384 const currentFacet = facet || current$1; 36385 state[context][currentFacet].queryParams.dynamicOrderBy = orderBy ? (0,_util_DHWbLSvO_js__WEBPACK_IMPORTED_MODULE_8__.i)(orderBy) || [] : []; 36386 return; 36387 } 36388 default: 36389 return; 36390 } 36391 }, initState); 36392}; 36393 36394const Context = { 36395 facets: 'facets', 36396 listings: 'listings', 36397 minilist: 'minilist' 36398}; 36399 36400 36401//# sourceMappingURL=search.js.map 36402 36403 36404/***/ }, 36405 36406/***/ 83069 36407(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 36408 36409"use strict"; 36410/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36411/* harmony export */ a: () => (/* binding */ selectDictionary), 36412/* harmony export */ b: () => (/* binding */ selectDictionaryResolver), 36413/* harmony export */ c: () => (/* binding */ selectLocaleRoutes), 36414/* harmony export */ d: () => (/* binding */ selectLocales), 36415/* harmony export */ e: () => (/* binding */ selectPrimaryLanguage),
36416/* harmony export */ s: () => (/* binding */ selectCurrentLanguage) 36417/* harmony export */ }); 36418/* unused harmony export f */ 36419const selectLocales = state => state.i18n.locales; 36420const selectLocaleRoutes = state => state.i18n.routes; 36421const selectCurrentLanguage = state => state.i18n.currentLanguage; 36422const selectPrimaryLanguage = state => state.i18n.primaryLanguage; 36423const selectSupportedLanguages = state => state.i18n.supportedLanguages; 36424const selectDictionary = state => state.i18n.dictionary; 36425const selectDictionaryResolver = state => state.i18n.resolver; 36426 36427 36428//# sourceMappingURL=selectors-D4ulaTom.js.map 36429 36430 36431/***/ }, 36432 36433/***/ 23790 36434(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 36435 36436"use strict"; 36437/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36438/* harmony export */ $: () => (/* binding */ selectRouteStatusCode), 36439/* harmony export */ A: () => (/* binding */ queryParams), 36440/* harmony export */ B: () => (/* binding */ routing$1), 36441/* harmony export */ C: () => (/* binding */ CHANGE_USER_PASSWORD), 36442/* harmony export */ D: () => (/* binding */ routing), 36443/* harmony export */ E: () => (/* binding */ routing$2), 36444/* harmony export */ F: () => (/* binding */ selectCurrentAncestors), 36445/* harmony export */ G: () => (/* binding */ selectCurrentNode), 36446/* harmony export */ H: () => (/* binding */ selectCurrentPath), 36447/* harmony export */ I: () => (/* binding */ selectCurrentProject), 36448/* harmony export */ J: () => (/* binding */ selectCurrentSearch), 36449/* harmony export */ K: () => (/* binding */ selectCurrentSiblings), 36450/* harmony export */ L: () => (/* binding */ LOGIN_USER), 36451/* harmony export */ M: () => (/* binding */ selectIsNotFound), 36452/* harmony export */ N: () => (/* binding */ selectMappedEntry), 36453/* harmony export */ O: () => (/* binding */ selectRouteEntry), 36454/* harmony export */ P: () => (/* binding */ selectRouteEntryAvailableLanguages), 36455/* harmony export */ Q: () => (/* binding */ selectRouteEntryContentTypeId), 36456/* harmony export */ R: () => (/* binding */ REGISTER_USER), 36457/* harmony export */ S: () => (/* binding */ SET_ANCESTORS), 36458/* harmony export */ T: () => (/* binding */ selectRouteEntryEntryId), 36459/* harmony export */ U: () => (/* binding */ UPDATE_LOADING_STATE), 36460/* harmony export */ V: () => (/* binding */ VALIDATE_USER), 36461/* harmony export */ W: () => (/* binding */ selectRouteEntryID), 36462/* harmony export */ X: () => (/* binding */ selectRouteEntryLanguage), 36463/* harmony export */ Y: () => (/* binding */ selectRouteErrorMessage), 36464/* harmony export */ Z: () => (/* binding */ selectRouteIsError), 36465/* harmony export */ _: () => (/* binding */ selectRouteLoading), 36466/* harmony export */ a: () => (/* binding */ CHANGE_USER_PASSWORD_ERROR), 36467/* harmony export */ a1: () => (/* binding */ selectStaticRoute), 36468/* harmony export */ a3: () => (/* binding */ setApiMetrics), 36469/* harmony export */ a4: () => (/* binding */ setCurrentProject), 36470/* harmony export */ a5: () => (/* binding */ setNavigationPath), 36471/* harmony export */ a6: () => (/* binding */ setRoute), 36472/* harmony export */ b: () => (/* binding */ CHANGE_USER_PASSWORD_SENDING), 36473/* harmony export */ c: () => (/* binding */ CHANGE_USER_PASSWORD_SUCCESS), 36474/* harmony export */ d: () => (/* binding */ LOGOUT_USER), 36475/* harmony export */ e: () => (/* binding */ REGISTER_USER_FAILED), 36476/* harmony export */ f: () => (/* binding */ REGISTER_USER_SUCCESS), 36477/* harmony export */ g: () => (/* binding */ REQUEST_USER_PASSWORD_RESET), 36478/* harmony export */ h: () => (/* binding */ REQUEST_USER_PASSWORD_RESET_ERROR), 36479/* harmony export */ i: () => (/* binding */ REQUEST_USER_PASSWORD_RESET_SENDING), 36480/* harmony export */ j: () => (/* binding */ REQUEST_USER_PASSWORD_RESET_SUCCESS), 36481/* harmony export */ k: () => (/* binding */ RESET_USER_PASSWORD), 36482/* harmony export */ l: () => (/* binding */ RESET_USER_PASSWORD_ERROR), 36483/* harmony export */ m: () => (/* binding */ RESET_USER_PASSWORD_SENDING), 36484/* harmony export */ n: () => (/* binding */ RESET_USER_PASSWORD_SUCCESS), 36485/* harmony export */ o: () => (/* binding */ SET_API_METRICS), 36486/* harmony export */ p: () => (/* binding */ SET_AUTHENTICATION_STATE), 36487/* harmony export */ q: () => (/* binding */ SET_ENTRY), 36488/* harmony export */ r: () => (/* binding */ SET_NAVIGATION_PATH), 36489/* harmony export */ s: () => (/* binding */ SET_ROUTE), 36490/* harmony export */ t: () => (/* binding */ SET_SIBLINGS), 36491/* harmony export */ u: () => (/* binding */ SET_TARGET_PROJECT), 36492/* harmony export */ v: () => (/* binding */ UserReducer), 36493/* harmony export */ w: () => (/* binding */ action), 36494/* harmony export */ x: () => (/* binding */ getImmutableOrJS) 36495/* harmony export */ }); 36496/* unused harmony exports a0, a2, a7, y, z */ 36497/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73575); 36498/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13527); 36499/* harmony import */ var jsonpath_mapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(47149); 36500/* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17276); 36501 36502 36503 36504 36505 36506const action = (type, payload = {}) => ({ 36507 type, 36508 ...payload 36509}); 36510const getJS = (state, stateKey) => { 36511 if ('get' in state && typeof state.get === 'function' && 'toJS' in state && typeof state.toJS === 'function') { 36512 return state.get(stateKey); 36513 } 36514 return state[stateKey]; 36515}; 36516const getImmutableOrJS = (state, stateKey, fallbackValue, returnType = globalThis.STATE_TYPE) => { 36517 var _globalThis$immutable, _globalThis$immutable2; 36518 // Find a fromJS function from global that is dynamically loaded in createStore 36519 // or replace with a stub function for non-immutable gets 36520 const fromJS = returnType === 'immutable' ? ((_globalThis$immutable = globalThis.immutable) === null || _globalThis$immutable === void 0 ? void 0 : _globalThis$immutable.fromJSOrdered) || ((_globalThis$immutable2 = globalThis.immutable) === null || _globalThis$immutable2 === void 0 ? void 0 : _globalThis$immutable2.fromJS) : v => v; 36521 if (state && 'get' in state && typeof state.get === 'function' && 'getIn' in state && typeof state.getIn === 'function' && 'toJS' in state && typeof state.toJS === 'function') { 36522 if (Array.isArray(stateKey)) return fromJS(state.getIn(stateKey, fallbackValue)); 36523 return fromJS(state.get(stateKey, fallbackValue)); 36524 } 36525 if (Array.isArray(stateKey) && state && typeof state === 'object') { 36526 const result = (0,jsonpath_mapper__WEBPACK_IMPORTED_MODULE_2__/* .jpath */ .oA)(stateKey.join('.'), state); 36527 if (typeof result === 'undefined') return fallbackValue; 36528 return result; 36529 } 36530 const result = state && typeof state === 'object' ? state[stateKey] : undefined; 36531 if (typeof result === 'undefined') return fallbackValue; 36532 return result; 36533}; 36534 36535const ROUTING_PREFIX = '@ROUTING/'; 36536const GET_ENTRY = `${ROUTING_PREFIX}_GET_ENTRY`; 36537const SET_ENTRY = `${ROUTING_PREFIX}_SET_ENTRY`; 36538const SET_NODE = `${ROUTING_PREFIX}_SET_NODE`; 36539const SET_ANCESTORS = `${ROUTING_PREFIX}_SET_ANCESTORS`; 36540const SET_SIBLINGS = `${ROUTING_PREFIX}_SET_SIBLINGS`; 36541const SET_ENTRY_ID = `${ROUTING_PREFIX}_SET_ENTRY_ID`; 36542const SET_API_METRICS = `${ROUTING_PREFIX}_SET_API_METRICS`; 36543const SET_NAVIGATION_PATH = `${ROUTING_PREFIX}_SET_NAVIGATION_PATH`; 36544const SET_TARGET_PROJECT = `${ROUTING_PREFIX}_SET_TARGET_PROJECT`; 36545const SET_ROUTE = `${ROUTING_PREFIX}_SET_ROUTE`; 36546const UPDATE_LOADING_STATE = `${ROUTING_PREFIX}_UPDATE_LOADING_STATE`; 36547 36548var routing$2 = /*#__PURE__*/Object.freeze({ 36549 __proto__: null, 36550 GET_ENTRY: GET_ENTRY, 36551 SET_ANCESTORS: SET_ANCESTORS, 36552 SET_API_METRICS: SET_API_METRICS, 36553 SET_ENTRY: SET_ENTRY, 36554 SET_ENTRY_ID: SET_ENTRY_ID, 36555 SET_NAVIGATION_PATH: SET_NAVIGATION_PATH, 36556 SET_NODE: SET_NODE, 36557 SET_ROUTE: SET_ROUTE, 36558 SET_SIBLINGS: SET_SIBLINGS, 36559 SET_TARGET_PROJECT: SET_TARGET_PROJECT, 36560 UPDATE_LOADING_STATE: UPDATE_LOADING_STATE 36561}); 36562 36563const setNavigationPath = (path, contentPath, location, staticRoute, withEvents, statePath, routes, ssr) => action(SET_NAVIGATION_PATH, { 36564 path,
36565 contentPath, 36566 location, 36567 staticRoute, 36568 withEvents, 36569 statePath, 36570 routes, 36571 ssr 36572}); 36573const setCurrentProject = (project, allowedGroups, hostname) => action(SET_TARGET_PROJECT, { 36574 project, 36575 allowedGroups, 36576 hostname 36577}); 36578const setRoute = (path, state) => action(SET_ROUTE, { 36579 path, 36580 state 36581}); 36582const setRouteEntry = entry => action(SET_ENTRY, { 36583 entry 36584}); 36585 36586/** 36587 * Represents a single API call record stored in Redux state. 36588 * Used for SSR surrogate key tracking and performance metrics. 36589 */ 36590 36591/** 36592 * Record API call metrics. Surrogate keys are only included during SSR. 36593 */ 36594const setApiMetrics = metrics => action(SET_API_METRICS, metrics); 36595 36596var routing$1 = /*#__PURE__*/Object.freeze({ 36597 __proto__: null, 36598 setApiMetrics: setApiMetrics, 36599 setCurrentProject: setCurrentProject, 36600 setNavigationPath: setNavigationPath, 36601 setRoute: setRoute, 36602 setRouteEntry: setRouteEntry 36603}); 36604 36605const ACTION_PREFIX = '@USER/'; 36606const VALIDATE_USER = `${ACTION_PREFIX}VALIDATE_USER`; 36607const SET_AUTHENTICATION_STATE = `${ACTION_PREFIX}SET_AUTHENTICATION_STATE`; 36608const LOGIN_USER = `${ACTION_PREFIX}LOGIN_USER`; 36609const LOGIN_SUCCESSFUL = `${ACTION_PREFIX}LOGIN_SUCCESSFUL`; 36610const LOGIN_FAILED = `${ACTION_PREFIX}LOGIN_FAILED`; 36611const LOGOUT_USER = `${ACTION_PREFIX}LOGOUT_USER`; 36612const REGISTER_USER = `${ACTION_PREFIX}REGISTER_USER`; 36613const REGISTER_USER_SUCCESS = `${ACTION_PREFIX}REGISTER_USER_SUCCESS`; 36614const REGISTER_USER_FAILED = `${ACTION_PREFIX}REGISTER_USER_FAILED`; 36615const REQUEST_USER_PASSWORD_RESET = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET`; 36616const RESET_USER_PASSWORD = `${ACTION_PREFIX}RESET_USER_PASSWORD`; 36617const REQUEST_USER_PASSWORD_RESET_SENDING = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_SENDING`; 36618const REQUEST_USER_PASSWORD_RESET_SUCCESS = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_SUCCESS`; 36619const REQUEST_USER_PASSWORD_RESET_ERROR = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_ERROR`; 36620const RESET_USER_PASSWORD_SENDING = `${ACTION_PREFIX}RESET_USER_PASSWORD_SENDING`; 36621const RESET_USER_PASSWORD_SUCCESS = `${ACTION_PREFIX}RESET_USER_PASSWORD_SUCCESS`; 36622const RESET_USER_PASSWORD_ERROR = `${ACTION_PREFIX}RESET_USER_PASSWORD_ERROR`; 36623const CHANGE_USER_PASSWORD = `${ACTION_PREFIX}CHANGE_USER_PASSWORD`; 36624const CHANGE_USER_PASSWORD_SENDING = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_SENDING`; 36625const CHANGE_USER_PASSWORD_SUCCESS = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_SUCCESS`; 36626const CHANGE_USER_PASSWORD_ERROR = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_ERROR`; 36627 36628var types = /*#__PURE__*/Object.freeze({ 36629 __proto__: null, 36630 CHANGE_USER_PASSWORD: CHANGE_USER_PASSWORD, 36631 CHANGE_USER_PASSWORD_ERROR: CHANGE_USER_PASSWORD_ERROR, 36632 CHANGE_USER_PASSWORD_SENDING: CHANGE_USER_PASSWORD_SENDING, 36633 CHANGE_USER_PASSWORD_SUCCESS: CHANGE_USER_PASSWORD_SUCCESS, 36634 LOGIN_FAILED: LOGIN_FAILED, 36635 LOGIN_SUCCESSFUL: LOGIN_SUCCESSFUL, 36636 LOGIN_USER: LOGIN_USER, 36637 LOGOUT_USER: LOGOUT_USER, 36638 REGISTER_USER: REGISTER_USER,
36639 REGISTER_USER_FAILED: REGISTER_USER_FAILED, 36640 REGISTER_USER_SUCCESS: REGISTER_USER_SUCCESS, 36641 REQUEST_USER_PASSWORD_RESET: REQUEST_USER_PASSWORD_RESET, 36642 REQUEST_USER_PASSWORD_RESET_ERROR: REQUEST_USER_PASSWORD_RESET_ERROR, 36643 REQUEST_USER_PASSWORD_RESET_SENDING: REQUEST_USER_PASSWORD_RESET_SENDING, 36644 REQUEST_USER_PASSWORD_RESET_SUCCESS: REQUEST_USER_PASSWORD_RESET_SUCCESS, 36645 RESET_USER_PASSWORD: RESET_USER_PASSWORD, 36646 RESET_USER_PASSWORD_ERROR: RESET_USER_PASSWORD_ERROR, 36647 RESET_USER_PASSWORD_SENDING: RESET_USER_PASSWORD_SENDING, 36648 RESET_USER_PASSWORD_SUCCESS: RESET_USER_PASSWORD_SUCCESS, 36649 SET_AUTHENTICATION_STATE: SET_AUTHENTICATION_STATE, 36650 VALIDATE_USER: VALIDATE_USER 36651}); 36652 36653const defaultAuthenticationState = { 36654 clientCredentials: null, 36655 errorMessage: null, 36656 isAuthenticated: false, 36657 isAuthenticationError: false, 36658 isError: false, 36659 isLoading: false 36660}; 36661const defaultPasswordResetRequestValues = { 36662 isSending: false, 36663 sent: false, 36664 error: null 36665}; 36666const defaultResetPasswordValues = { 36667 isSending: false, 36668 sent: false, 36669 error: null 36670}; 36671const defaultChangePasswordValues = { 36672 isSending: false, 36673 sent: false, 36674 error: null 36675}; 36676const defaultRegistrationValues = { 36677 isLoading: false, 36678 success: false, 36679 error: null 36680}; 36681const initialUserState = { 36682 authenticationState: defaultAuthenticationState, 36683 passwordResetRequest: defaultPasswordResetRequestValues, 36684 resetPassword: defaultResetPasswordValues, 36685 changePassword: defaultChangePasswordValues, 36686 groups: [] 36687}; 36688var UserReducer = (0,immer__WEBPACK_IMPORTED_MODULE_0__/* .produce */ .jM)((state, action) => { 36689 switch (action.type) { 36690 case LOGOUT_USER: 36691 { 36692 return initialUserState; 36693 } 36694 case LOGIN_USER: 36695 case SET_AUTHENTICATION_STATE: 36696 { 36697 var _state; 36698 if (!action.authenticationState) { 36699 action.authenticationState = defaultAuthenticationState; 36700 } 36701 const { 36702 authenticationState: { 36703 clientCredentials = null, 36704 errorMessage = null, 36705 isAuthenticated, 36706 isAuthenticationError = false, 36707 isError = false, 36708 isLoading = action.type === LOGIN_USER 36709 }, 36710 user 36711 } = action; 36712 if (user) { 36713 user.name = `${user.firstName}${user.lastName ? ` ${user.lastName}` : ''}` || null; 36714 user.isZengentiStaff = user.email.includes('@zengenti.com'); 36715 } 36716 state = { 36717 ...initialUserState, 36718 ...(user || state), 36719 authenticationState: { 36720 clientCredentials, 36721 errorMessage, 36722 isAuthenticated: isAuthenticated || ((_state = state) === null || _state === void 0 || (_state = _state.authenticationState) === null || _state === void 0 ? void 0 : _state.isAuthenticated), 36723 isAuthenticationError, 36724 isError, 36725 isLoading 36726 } 36727 }; 36728 return state; 36729 } 36730 // REGISTER_USER is the trigger to set the user.registration initial state 36731 // and will set user.registration.isLoading to true 36732 // REGISTER_USER_FAILED will unset user.registration.isLoading and will set 36733 // the value in user.registration.error 36734 // REGISTER_USER_SUCCESS will unset user.registration.isLoading and will 36735 // set user.registration to the created user from the api response 36736 case REGISTER_USER: 36737 case REGISTER_USER_FAILED: 36738 case REGISTER_USER_SUCCESS: 36739 { 36740 const { 36741 error, 36742 user 36743 } = action; 36744 36745 // Set registration object from the supplied action.user 36746 // so we can call these values back later 36747 state.registration = user || state.registration || defaultRegistrationValues; 36748 36749 // Set registration flags so the UI can track the status 36750 state.registration.success = action.type === REGISTER_USER_SUCCESS; 36751 state.registration.error = error || false; 36752 state.registration.isLoading = action.type === REGISTER_USER; 36753 return; 36754 } 36755 case REQUEST_USER_PASSWORD_RESET_SENDING: 36756 if (state.passwordResetRequest) { 36757 state.passwordResetRequest = { 36758 ...defaultPasswordResetRequestValues 36759 }; 36760 state.passwordResetRequest.isSending = true; 36761 } 36762 return; 36763 case REQUEST_USER_PASSWORD_RESET_SUCCESS: 36764 if (state.passwordResetRequest) { 36765 state.passwordResetRequest.isSending = false;
36766 state.passwordResetRequest.sent = true; 36767 } 36768 return; 36769 case REQUEST_USER_PASSWORD_RESET_ERROR: 36770 if (state.passwordResetRequest) { 36771 state.passwordResetRequest.isSending = false; 36772 state.passwordResetRequest.error = action.error; 36773 } 36774 return; 36775 case RESET_USER_PASSWORD_SENDING: 36776 if (state.resetPassword) { 36777 state.resetPassword.isSending = true; 36778 } 36779 return; 36780 case RESET_USER_PASSWORD_SUCCESS: 36781 if (state.resetPassword) { 36782 state.resetPassword.isSending = false; 36783 state.resetPassword.sent = true; 36784 } 36785 return; 36786 case RESET_USER_PASSWORD_ERROR: 36787 if (state.resetPassword) { 36788 state.resetPassword.isSending = false; 36789 state.resetPassword.error = action.error; 36790 } 36791 return; 36792 case CHANGE_USER_PASSWORD_SENDING: 36793 if (state.changePassword) { 36794 state.changePassword.isSending = true; 36795 } 36796 return; 36797 case CHANGE_USER_PASSWORD_SUCCESS: 36798 if (state.changePassword) { 36799 state.changePassword.isSending = false; 36800 state.changePassword.sent = true; 36801 } 36802 return; 36803 case CHANGE_USER_PASSWORD_ERROR: 36804 if (state.changePassword) { 36805 state.changePassword.isSending = false; 36806 state.changePassword.error = action.error; 36807 } 36808 return; 36809 default: 36810 return; 36811 } 36812}, initialUserState); 36813 36814// Switched from default import to named imports: v8+ (ESM-only) has no default export, 36815// which would make queryString.parse and queryString.stringify silently undefined at runtime.
36816// Named imports work identically with the current v5 CJS build via Rollup's commonjs interop. 36817function queryParams(search) { 36818 return (0,query_string__WEBPACK_IMPORTED_MODULE_3__.parse)(typeof window != 'undefined' ? window.location.search : search || ''); 36819} 36820 36821const selectRouteEntry = (state, returnType) => getImmutableOrJS(state, ['routing', 'entry'], {}, returnType); 36822const selectMappedEntry = (state, returnType) => getImmutableOrJS(state, ['routing', 'mappedEntry'], null, returnType); 36823const selectSurrogateKeys = state => { 36824 const keys = getImmutableOrJS(state, ['routing', 'surrogateKeys'], [], 'js'); 36825 return keys; 36826}; 36827const selectSsrApiCalls = state => { 36828 return getImmutableOrJS(state, ['routing', 'apiCalls'], [], 'js'); 36829}; 36830const selectCurrentHostname = state => getImmutableOrJS(state, ['routing', 'currentHostname']); 36831const selectSsrHostname = state => getImmutableOrJS(state, ['routing', 'ssrHostname']); 36832const selectCurrentTreeID = state => getImmutableOrJS(state, ['routing', 'currentHostname']); 36833const selectRouteEntryEntryId = state => getImmutableOrJS(state, ['routing', 'entry', 'sys', 'id'], null); 36834const selectRouteEntryContentTypeId = state => { 36835 const entry = selectRouteEntry(state); 36836 return getImmutableOrJS(entry, ['sys', 'contentTypeId'], null); 36837}; 36838const selectRouteEntryLanguage = state => { 36839 const entry = selectRouteEntry(state); 36840 return getImmutableOrJS(entry, ['sys', 'language'], null); 36841}; 36842const selectRouteEntryAvailableLanguages = state => { 36843 const entry = selectRouteEntry(state); 36844 return getImmutableOrJS(entry, ['sys', 'availableLanguages'], []); 36845}; 36846const selectRouteEntrySlug = state => { 36847 const entry = selectRouteEntry(state); 36848 return getImmutableOrJS(entry, ['sys', 'slug'], null); 36849}; 36850const selectRouteEntryID = state => getImmutableOrJS(state, ['routing', 'entryID']); 36851const selectCanonicalPath = state => { 36852 return getImmutableOrJS(state, ['routing', 'canonicalPath']); 36853}; 36854const selectCurrentPath = state => getImmutableOrJS(state, ['routing', 'currentPath']); 36855const selectCurrentLocation = state => getImmutableOrJS(state, ['routing', 'location']); 36856const selectCurrentSearch = state => getImmutableOrJS(state, ['routing', 'location', 'search']); 36857const selectCurrentHash = state => getImmutableOrJS(state, ['routing', 'location', 'hash']); 36858 36859// export const selectQueryStringAsObject = (state: AppState) => 36860// queryParams(selectCurrentSearch(state)); 36861 36862const selectQueryStringAsObject = (0,reselect__WEBPACK_IMPORTED_MODULE_1__/* .createSelector */ .Mz)([selectCurrentSearch], currentSearch => queryParams(currentSearch)); 36863const selectCurrentProject = state => getImmutableOrJS(state, ['routing', 'currentProject']); 36864const selectIsNotFound = state => getImmutableOrJS(state, ['routing', 'notFound']); 36865const selectCurrentAncestors = state => getImmutableOrJS(state, ['routing', 'currentNodeAncestors'], []); 36866const selectCurrentSiblings = state => getImmutableOrJS(state, ['routing', 'currentNodeSiblings'], []); 36867const selectCurrentNode = (state, returnType) => getImmutableOrJS(state, ['routing', 'currentNode'], null, returnType); 36868const selectCurrentNodeLanguage = state => getImmutableOrJS(state, ['routing', 'currentNode', 'language'], null); 36869const selectCurrentChildren = state => getImmutableOrJS(state, ['routing', 'currentNode', 'children'], []); 36870 36871// export const selectBreadcrumb = (state: AppState) => { 36872// return [...selectCurrentAncestors(state), selectCurrentNode(state)]; 36873// }; 36874 36875const selectBreadcrumb = (0,reselect__WEBPACK_IMPORTED_MODULE_1__/* .createSelector */ .Mz)([selectCurrentAncestors, selectCurrentNode], (currentAncestors, currentNode) => [...currentAncestors, currentNode]); 36876const selectRouteErrorMessage = state => { 36877 const error = getImmutableOrJS(state, ['routing', 'error']); 36878 return getImmutableOrJS(error, ['data', 'message'], getImmutableOrJS(error, 'statusText')); 36879}; 36880const selectRouteIsError = state => getImmutableOrJS(state, ['routing', 'isError']); 36881const selectRouteLoading = state => getImmutableOrJS(state, ['routing', 'isLoading']); 36882const selectRouteStatusCode = state => getImmutableOrJS(state, ['routing', 'statusCode']); 36883const selectStaticRoute = state => getImmutableOrJS(state, ['routing', 'staticRoute']); 36884 36885var routing = /*#__PURE__*/Object.freeze({ 36886 __proto__: null, 36887 selectBreadcrumb: selectBreadcrumb, 36888 selectCanonicalPath: selectCanonicalPath, 36889 selectCurrentAncestors: selectCurrentAncestors, 36890 selectCurrentChildren: selectCurrentChildren, 36891 selectCurrentHash: selectCurrentHash, 36892 selectCurrentHostname: selectCurrentHostname, 36893 selectCurrentLocation: selectCurrentLocation, 36894 selectCurrentNode: selectCurrentNode, 36895 selectCurrentNodeLanguage: selectCurrentNodeLanguage, 36896 selectCurrentPath: selectCurrentPath, 36897 selectCurrentProject: selectCurrentProject, 36898 selectCurrentSearch: selectCurrentSearch, 36899 selectCurrentSiblings: selectCurrentSiblings, 36900 selectCurrentTreeID: selectCurrentTreeID, 36901 selectIsNotFound: selectIsNotFound, 36902 selectMappedEntry: selectMappedEntry, 36903 selectQueryStringAsObject: selectQueryStringAsObject, 36904 selectRouteEntry: selectRouteEntry, 36905 selectRouteEntryAvailableLanguages: selectRouteEntryAvailableLanguages, 36906 selectRouteEntryContentTypeId: selectRouteEntryContentTypeId, 36907 selectRouteEntryEntryId: selectRouteEntryEntryId, 36908 selectRouteEntryID: selectRouteEntryID, 36909 selectRouteEntryLanguage: selectRouteEntryLanguage, 36910 selectRouteEntrySlug: selectRouteEntrySlug, 36911 selectRouteErrorMessage: selectRouteErrorMessage, 36912 selectRouteIsError: selectRouteIsError, 36913 selectRouteLoading: selectRouteLoading, 36914 selectRouteStatusCode: selectRouteStatusCode, 36915 selectSsrApiCalls: selectSsrApiCalls, 36916 selectSsrHostname: selectSsrHostname, 36917 selectStaticRoute: selectStaticRoute, 36918 selectSurrogateKeys: selectSurrogateKeys 36919}); 36920 36921 36922//# sourceMappingURL=selectors-Dj45vPZR.js.map 36923 36924 36925/***/ }, 36926 36927/***/ 60218 36928(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 36929 36930"use strict"; 36931 36932// EXPORTS 36933__webpack_require__.d(__webpack_exports__, { 36934 a: () => (/* binding */ actions), 36935 i: () => (/* binding */ i18nSlice) 36936}); 36937 36938// UNUSED EXPORTS: g, r, u 36939 36940// EXTERNAL MODULE: ./node_modules/immer/dist/immer.mjs 36941var immer = __webpack_require__(73575); 36942// EXTERNAL MODULE: ./node_modules/redux/dist/redux.mjs 36943var redux = __webpack_require__(93079); 36944;// ./node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs 36945/* unused harmony import specifier */ var isDraft; 36946/* unused harmony import specifier */ var current; 36947/* unused harmony import specifier */ var produce; 36948/* unused harmony import specifier */ var createSelectorCreator; 36949/* unused harmony import specifier */ var weakMapMemoize; 36950/* unused harmony import specifier */ var isAction; 36951/* unused harmony import specifier */ var isPlainObject; 36952/* unused harmony import specifier */ var combineReducers; 36953/* unused harmony import specifier */ var compose; 36954/* unused harmony import specifier */ var applyMiddleware; 36955/* unused harmony import specifier */ var createStore; 36956/* unused harmony import specifier */ var thunkMiddleware; 36957/* unused harmony import specifier */ var withExtraArgument; 36958/* unused harmony import specifier */ var combineReducers2;
36959// src/index.ts 36960 36961 36962
36963// src/immerImports.ts 36964 36965
36966// src/index.ts 36967 36968
36969// src/reselectImports.ts 36970 36971
36972// src/createDraftSafeSelector.ts 36973var createDraftSafeSelectorCreator = (...args) => { 36974 const createSelector2 = createSelectorCreator(...args); 36975 const createDraftSafeSelector2 = Object.assign((...args2) => { 36976 const selector = createSelector2(...args2); 36977 const wrappedSelector = (value, ...rest) => selector(isDraft(value) ? current(value) : value, ...rest); 36978 Object.assign(wrappedSelector, selector); 36979 return wrappedSelector; 36980 }, { 36981 withTypes: () => createDraftSafeSelector2 36982 }); 36983 return createDraftSafeSelector2; 36984}; 36985var createDraftSafeSelector = /* @__PURE__ */ (/* unused pure expression or super */ null && (createDraftSafeSelectorCreator(weakMapMemoize))); 36986
36987// src/reduxImports.ts 36988 36989
36990// src/devtoolsExtension.ts 36991var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() { 36992 if (arguments.length === 0) return void 0; 36993 if (typeof arguments[0] === "object") return redux/* compose */.Zz; 36994 return redux/* compose */.Zz.apply(null, arguments); 36995}; 36996var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() { 36997 return function(noop3) { 36998 return noop3; 36999 }; 37000}; 37001
37002// src/getDefaultMiddleware.ts
vendor: 324 bytes, lines 37003-37016
37003 37004 37005// src/tsHelpers.ts 37006var hasMatchFunction = (v) => { 37007 return v && typeof v.match === "function"; 37008}; 37009 37010// src/createAction.ts 37011function createAction(type, prepareAction) { 37012 function actionCreator(...args) { 37013 if (prepareAction) { 37014 let prepared = prepareAction(...args); 37015 if (!prepared) { 37016 throw new Error(
37016 true ? formatProdErrorMessage(0) : 0); 37017 } 37018 return { 37019 type, 37020 payload: prepared.payload, 37021 ..."meta" in prepared && { 37022 meta: prepared.meta 37023 }, 37024 ..."error" in prepared && { 37025 error: prepared.error 37026 } 37027 }; 37028 } 37029 return { 37030 type, 37031 payload: args[0] 37032 }; 37033 } 37034 actionCreator.toString = () => `${type}`; 37035 actionCreator.type = type; 37036 actionCreator.match = (action) => (0,redux/* isAction */.ve)(action) && action.type === type; 37037 return actionCreator; 37038} 37039function isActionCreator(action) { 37040 return typeof action === "function" && "type" in action && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it 37041 hasMatchFunction(action); 37042} 37043function isFSA(action) { 37044 return isAction(action) && Object.keys(action).every(isValidKey); 37045} 37046function isValidKey(key) { 37047 return ["type", "payload", "error", "meta"].indexOf(key) > -1; 37048} 37049
37050// src/actionCreatorInvariantMiddleware.ts 37051function getMessage(type) { 37052 const splitType = type ? `${type}`.split("/") : []; 37053 const actionName = splitType[splitType.length - 1] || "actionCreator"; 37054 return `Detected an action creator with type "${type || "unknown"}" being dispatched. 37055Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${actionName}())\` instead of \`dispatch(${actionName})\`. This is necessary even if the action has no payload.`; 37056} 37057function createActionCreatorInvariantMiddleware(options = {}) { 37058 if (true) { 37059 return () => (next) => (action) => next(action); 37060 } 37061 // removed by dead control flow 37062 37063 // removed by dead control flow 37064 37065} 37066
37067// src/utils.ts 37068function getTimeMeasureUtils(maxDelay, fnName) { 37069 let elapsed = 0; 37070 return { 37071 measureTime(fn) { 37072 const started = Date.now(); 37073 try { 37074 return fn(); 37075 } finally { 37076 const finished = Date.now(); 37077 elapsed += finished - started; 37078 } 37079 }, 37080 warnIfExceeded() { 37081 if (elapsed > maxDelay) { 37082 console.warn(`${fnName} took ${elapsed}ms, which is more than the warning threshold of ${maxDelay}ms. 37083If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions. 37084It is disabled in production builds, so you don't need to worry about that.`); 37085 } 37086 } 37087 }; 37088} 37089var Tuple = class _Tuple extends Array { 37090 constructor(...items) { 37091 super(...items); 37092 Object.setPrototypeOf(this, _Tuple.prototype); 37093 } 37094 static get [Symbol.species]() { 37095 return _Tuple; 37096 } 37097 concat(...arr) { 37098 return super.concat.apply(this, arr); 37099 } 37100 prepend(...arr) { 37101 if (arr.length === 1 && Array.isArray(arr[0])) { 37102 return new _Tuple(...arr[0].concat(this)); 37103 } 37104 return new _Tuple(...arr.concat(this)); 37105 } 37106}; 37107function freezeDraftable(val) { 37108 return (0,immer/* isDraftable */.a6)(val) ? (0,immer/* produce */.jM)(val, () => { 37109 }) : val; 37110} 37111function getOrInsertComputed(map, key, compute) { 37112 if (map.has(key)) return map.get(key); 37113 return map.set(key, compute(key)).get(key); 37114} 37115
37116// src/immutableStateInvariantMiddleware.ts 37117function isImmutableDefault(value) { 37118 return typeof value !== "object" || value == null || Object.isFrozen(value); 37119} 37120function trackForMutations(isImmutable, ignoredPaths, obj) { 37121 const trackedProperties = trackProperties(isImmutable, ignoredPaths, obj); 37122 return { 37123 detectMutations() { 37124 return detectMutations(isImmutable, ignoredPaths, trackedProperties, obj); 37125 } 37126 }; 37127} 37128function trackProperties(isImmutable, ignoredPaths = [], obj, path = "", checkedObjects = /* @__PURE__ */ new Set()) { 37129 const tracked = { 37130 value: obj 37131 }; 37132 if (!isImmutable(obj) && !checkedObjects.has(obj)) { 37133 checkedObjects.add(obj); 37134 tracked.children = {}; 37135 const hasIgnoredPaths = ignoredPaths.length > 0; 37136 for (const key in obj) { 37137 const nestedPath = path ? path + "." + key : key; 37138 if (hasIgnoredPaths) { 37139 const hasMatches = ignoredPaths.some((ignored) => { 37140 if (ignored instanceof RegExp) { 37141 return ignored.test(nestedPath); 37142 } 37143 return nestedPath === ignored; 37144 }); 37145 if (hasMatches) { 37146 continue; 37147 } 37148 } 37149 tracked.children[key] = trackProperties(isImmutable, ignoredPaths, obj[key], nestedPath); 37150 } 37151 } 37152 return tracked; 37153} 37154function detectMutations(isImmutable, ignoredPaths = [], trackedProperty, obj, sameParentRef = false, path = "") { 37155 const prevObj = trackedProperty ? trackedProperty.value : void 0; 37156 const sameRef = prevObj === obj; 37157 if (sameParentRef && !sameRef && !Number.isNaN(obj)) { 37158 return { 37159 wasMutated: true, 37160 path 37161 }; 37162 } 37163 if (isImmutable(prevObj) || isImmutable(obj)) { 37164 return { 37165 wasMutated: false 37166 }; 37167 } 37168 const keysToDetect = {}; 37169 for (let key in trackedProperty.children) { 37170 keysToDetect[key] = true; 37171 } 37172 for (let key in obj) { 37173 keysToDetect[key] = true; 37174 } 37175 const hasIgnoredPaths = ignoredPaths.length > 0; 37176 for (let key in keysToDetect) { 37177 const nestedPath = path ? path + "." + key : key; 37178 if (hasIgnoredPaths) { 37179 const hasMatches = ignoredPaths.some((ignored) => { 37180 if (ignored instanceof RegExp) { 37181 return ignored.test(nestedPath); 37182 } 37183 return nestedPath === ignored; 37184 }); 37185 if (hasMatches) { 37186 continue; 37187 } 37188 } 37189 const result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath); 37190 if (result.wasMutated) { 37191 return result; 37192 } 37193 } 37194 return { 37195 wasMutated: false 37196 }; 37197} 37198function createImmutableStateInvariantMiddleware(options = {}) { 37199 if (true) { 37200 return () => (next) => (action) => next(action); 37201 } else // removed by dead control flow 37202{ var stringify, getSerialize; } 37203} 37204
37205// src/serializableStateInvariantMiddleware.ts 37206function isPlain(val) { 37207 const type = typeof val; 37208 return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val); 37209} 37210function findNonSerializableValue(value, path = "", isSerializable = isPlain, getEntries, ignoredPaths = [], cache) { 37211 let foundNestedSerializable; 37212 if (!isSerializable(value)) { 37213 return { 37214 keyPath: path || "<root>", 37215 value 37216 }; 37217 } 37218 if (typeof value !== "object" || value === null) { 37219 return false; 37220 } 37221 if (cache?.has(value)) return false; 37222 const entries = getEntries != null ? getEntries(value) : Object.entries(value); 37223 const hasIgnoredPaths = ignoredPaths.length > 0; 37224 for (const [key, nestedValue] of entries) { 37225 const nestedPath = path ? path + "." + key : key; 37226 if (hasIgnoredPaths) { 37227 const hasMatches = ignoredPaths.some((ignored) => { 37228 if (ignored instanceof RegExp) { 37229 return ignored.test(nestedPath); 37230 } 37231 return nestedPath === ignored; 37232 }); 37233 if (hasMatches) { 37234 continue; 37235 } 37236 } 37237 if (!isSerializable(nestedValue)) { 37238 return { 37239 keyPath: nestedPath, 37240 value: nestedValue 37241 }; 37242 } 37243 if (typeof nestedValue === "object") { 37244 foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache); 37245 if (foundNestedSerializable) { 37246 return foundNestedSerializable; 37247 } 37248 } 37249 } 37250 if (cache && isNestedFrozen(value)) cache.add(value); 37251 return false; 37252} 37253function isNestedFrozen(value) { 37254 if (!Object.isFrozen(value)) return false; 37255 for (const nestedValue of Object.values(value)) { 37256 if (typeof nestedValue !== "object" || nestedValue === null) continue; 37257 if (!isNestedFrozen(nestedValue)) return false; 37258 } 37259 return true; 37260} 37261function createSerializableStateInvariantMiddleware(options = {}) { 37262 if (true) { 37263 return () => (next) => (action) => next(action); 37264 } else // removed by dead control flow 37265{} 37266} 37267
37268// src/getDefaultMiddleware.ts 37269function isBoolean(x) { 37270 return typeof x === "boolean"; 37271} 37272var buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) { 37273 const { 37274 thunk = true, 37275 immutableCheck = true, 37276 serializableCheck = true, 37277 actionCreatorCheck = true 37278 } = options ?? {}; 37279 let middlewareArray = new Tuple(); 37280 if (thunk) { 37281 if (isBoolean(thunk)) { 37282 middlewareArray.push(thunkMiddleware); 37283 } else { 37284 middlewareArray.push(withExtraArgument(thunk.extraArgument)); 37285 } 37286 } 37287 if (false) // removed by dead control flow 37288{
vendor: 3,483 bytes, lines 37288-37399
37288} 37289 return middlewareArray; 37290}; 37291 37292// src/autoBatchEnhancer.ts 37293var SHOULD_AUTOBATCH = "RTK_autoBatch"; 37294var prepareAutoBatched = () => (payload) => ({ 37295 payload, 37296 meta: { 37297 [SHOULD_AUTOBATCH]: true 37298 } 37299}); 37300var createQueueWithTimer = (timeout) => { 37301 return (notify) => { 37302 setTimeout(notify, timeout); 37303 }; 37304}; 37305var createRafWithFallbackTimer = (raf, timeout) => { 37306 return (notify) => { 37307 let called = false; 37308 const callback = () => { 37309 if (called) return; 37310 called = true; 37311 cancelAnimationFrame(rafId); 37312 clearTimeout(timerId); 37313 notify(); 37314 }; 37315 const rafId = raf(callback); 37316 const timerId = setTimeout(callback, timeout); 37317 }; 37318}; 37319var autoBatchEnhancer = (options = { 37320 type: "raf" 37321}) => (next) => (...args) => { 37322 const store = next(...args); 37323 let notifying = true; 37324 let shouldNotifyAtEndOfTick = false; 37325 let notificationQueued = false; 37326 const listeners = /* @__PURE__ */ new Set(); 37327 const queueCallback = options.type === "tick" ? queueMicrotask : options.type === "raf" ? ( 37328 // requestAnimationFrame won't exist in SSR environments. Fall back to a vague approximation just to keep from erroring. 37329 typeof window !== "undefined" && window.requestAnimationFrame ? createRafWithFallbackTimer(window.requestAnimationFrame, 100) : createQueueWithTimer(10) 37330 ) : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout); 37331 const notifyListeners = () => { 37332 notificationQueued = false; 37333 if (shouldNotifyAtEndOfTick) { 37334 shouldNotifyAtEndOfTick = false; 37335 listeners.forEach((l) => l()); 37336 } 37337 }; 37338 return Object.assign({}, store, { 37339 // Override the base `store.subscribe` method to keep original listeners 37340 // from running if we're delaying notifications 37341 subscribe(listener2) { 37342 const wrappedListener = () => notifying && listener2(); 37343 const unsubscribe = store.subscribe(wrappedListener); 37344 listeners.add(listener2); 37345 return () => { 37346 unsubscribe(); 37347 listeners.delete(listener2); 37348 }; 37349 }, 37350 // Override the base `store.dispatch` method so that we can check actions 37351 // for the `shouldAutoBatch` flag and determine if batching is active 37352 dispatch(action) { 37353 try { 37354 notifying = !action?.meta?.[SHOULD_AUTOBATCH]; 37355 shouldNotifyAtEndOfTick = !notifying; 37356 if (shouldNotifyAtEndOfTick) { 37357 if (!notificationQueued) { 37358 notificationQueued = true; 37359 queueCallback(notifyListeners); 37360 } 37361 } 37362 return store.dispatch(action); 37363 } finally { 37364 notifying = true; 37365 } 37366 } 37367 }); 37368}; 37369 37370// src/getDefaultEnhancers.ts 37371var buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) { 37372 const { 37373 autoBatch = true 37374 } = options ?? {}; 37375 let enhancerArray = new Tuple(middlewareEnhancer); 37376 if (autoBatch) { 37377 enhancerArray.push(autoBatchEnhancer(typeof autoBatch === "object" ? autoBatch : void 0)); 37378 } 37379 return enhancerArray; 37380}; 37381 37382// src/configureStore.ts 37383function configureStore(options) { 37384 const getDefaultMiddleware = buildGetDefaultMiddleware(); 37385 const { 37386 reducer = void 0, 37387 middleware, 37388 devTools = true, 37389 duplicateMiddlewareCheck = true, 37390 preloadedState = void 0, 37391 enhancers = void 0 37392 } = options || {}; 37393 let rootReducer; 37394 if (typeof reducer === "function") { 37395 rootReducer = reducer; 37396 } else if (isPlainObject(reducer)) { 37397 rootReducer = combineReducers(reducer); 37398 } else { 37399 throw new Error(
37399 true ? formatProdErrorMessage(1) : 0); 37400 } 37401 if (false) // removed by dead control flow 37402{} 37403 let finalMiddleware; 37404 if (typeof middleware === "function") { 37405 finalMiddleware = middleware(getDefaultMiddleware); 37406 if (false) // removed by dead control flow 37407{} 37408 } else { 37409 finalMiddleware = getDefaultMiddleware(); 37410 } 37411 if (false) // removed by dead control flow 37412{} 37413 if (false) // removed by dead control flow 37414{} 37415 let finalCompose = compose; 37416 if (devTools) { 37417 finalCompose = composeWithDevTools({ 37418 // Enable capture of stack traces for dispatched Redux actions 37419 trace: "production" !== "production", 37420 ...typeof devTools === "object" && devTools 37421 }); 37422 } 37423 const middlewareEnhancer = applyMiddleware(...finalMiddleware); 37424 const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer); 37425 if (false) // removed by dead control flow 37426{} 37427 let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers(); 37428 if (false) // removed by dead control flow 37429{} 37430 if (false) // removed by dead control flow 37431{} 37432 if (false) // removed by dead control flow 37433{} 37434 const composedEnhancer = finalCompose(...storeEnhancers); 37435 return createStore(rootReducer, preloadedState, composedEnhancer); 37436} 37437
37438// src/mapBuilders.ts 37439function executeReducerBuilderCallback(builderCallback) { 37440 const actionsMap = {}; 37441 const actionMatchers = []; 37442 let defaultCaseReducer; 37443 const builder = { 37444 addCase(typeOrActionCreator, reducer) { 37445 if (false) // removed by dead control flow 37446{} 37447 const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; 37448 if (!type) { 37449 throw new Error( true ? formatProdErrorMessage(28) : 0); 37450 } 37451 if (type in actionsMap) { 37452 throw new Error( true ? formatProdErrorMessage(29) : 0); 37453 } 37454 actionsMap[type] = reducer; 37455 return builder; 37456 }, 37457 addAsyncThunk(asyncThunk, reducers) { 37458 if (false) // removed by dead control flow 37459{} 37460 if (reducers.pending) actionsMap[asyncThunk.pending.type] = reducers.pending; 37461 if (reducers.rejected) actionsMap[asyncThunk.rejected.type] = reducers.rejected; 37462 if (reducers.fulfilled) actionsMap[asyncThunk.fulfilled.type] = reducers.fulfilled; 37463 if (reducers.settled) actionMatchers.push({ 37464 matcher: asyncThunk.settled, 37465 reducer: reducers.settled 37466 }); 37467 return builder; 37468 }, 37469 addMatcher(matcher, reducer) { 37470 if (false) // removed by dead control flow 37471{} 37472 actionMatchers.push({ 37473 matcher, 37474 reducer 37475 }); 37476 return builder; 37477 }, 37478 addDefaultCase(reducer) { 37479 if (false) // removed by dead control flow 37480{} 37481 defaultCaseReducer = reducer; 37482 return builder; 37483 } 37484 }; 37485 builderCallback(builder); 37486 return [actionsMap, actionMatchers, defaultCaseReducer]; 37487} 37488
vendor: 1,701 bytes, lines 37489-37532
37489// src/createReducer.ts 37490function isStateFunction(x) { 37491 return typeof x === "function"; 37492} 37493function createReducer(initialState, mapOrBuilderCallback) { 37494 if (false) // removed by dead control flow 37495{} 37496 let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback); 37497 let getInitialState; 37498 if (isStateFunction(initialState)) { 37499 getInitialState = () => freezeDraftable(initialState()); 37500 } else { 37501 const frozenInitialState = freezeDraftable(initialState); 37502 getInitialState = () => frozenInitialState; 37503 } 37504 function reducer(state = getInitialState(), action) { 37505 let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({ 37506 matcher 37507 }) => matcher(action)).map(({ 37508 reducer: reducer2 37509 }) => reducer2)]; 37510 if (caseReducers.filter((cr) => !!cr).length === 0) { 37511 caseReducers = [finalDefaultCaseReducer]; 37512 } 37513 return caseReducers.reduce((previousState, caseReducer) => { 37514 if (caseReducer) { 37515 if ((0,immer/* isDraft */.Qx)(previousState)) { 37516 const draft = previousState; 37517 const result = caseReducer(draft, action); 37518 if (result === void 0) { 37519 return previousState; 37520 } 37521 return result; 37522 } else if (!(0,immer/* isDraftable */.a6)(previousState)) { 37523 const result = caseReducer(previousState, action); 37524 if (result === void 0) { 37525 if (previousState === null) { 37526 return previousState; 37527 } 37528 throw Error("A case reducer on a non-draftable value must not return undefined"); 37529 } 37530 return result; 37531 } else { 37532 return (0,immer/* produce */.jM)
vendor: 9,971 bytes, lines 37532-37855
37532(previousState, (draft) => { 37533 return caseReducer(draft, action); 37534 }); 37535 } 37536 } 37537 return previousState; 37538 }, state); 37539 } 37540 reducer.getInitialState = getInitialState; 37541 return reducer; 37542} 37543 37544// src/matchers.ts 37545var matches = (matcher, action) => { 37546 if (hasMatchFunction(matcher)) { 37547 return matcher.match(action); 37548 } else { 37549 return matcher(action); 37550 } 37551}; 37552function isAnyOf(...matchers) { 37553 return (action) => { 37554 return matchers.some((matcher) => matches(matcher, action)); 37555 }; 37556} 37557function isAllOf(...matchers) { 37558 return (action) => { 37559 return matchers.every((matcher) => matches(matcher, action)); 37560 }; 37561} 37562function hasExpectedRequestMetadata(action, validStatus) { 37563 if (!action || !action.meta) return false; 37564 const hasValidRequestId = typeof action.meta.requestId === "string"; 37565 const hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1; 37566 return hasValidRequestId && hasValidRequestStatus; 37567} 37568function isAsyncThunkArray(a) { 37569 return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0]; 37570} 37571function isPending(...asyncThunks) { 37572 if (asyncThunks.length === 0) { 37573 return (action) => hasExpectedRequestMetadata(action, ["pending"]); 37574 } 37575 if (!isAsyncThunkArray(asyncThunks)) { 37576 return isPending()(asyncThunks[0]); 37577 } 37578 return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.pending)); 37579} 37580function isRejected(...asyncThunks) { 37581 if (asyncThunks.length === 0) { 37582 return (action) => hasExpectedRequestMetadata(action, ["rejected"]); 37583 } 37584 if (!isAsyncThunkArray(asyncThunks)) { 37585 return isRejected()(asyncThunks[0]); 37586 } 37587 return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.rejected)); 37588} 37589function isRejectedWithValue(...asyncThunks) { 37590 const hasFlag = (action) => { 37591 return action && action.meta && action.meta.rejectedWithValue; 37592 }; 37593 if (asyncThunks.length === 0) { 37594 return isAllOf(isRejected(...asyncThunks), hasFlag); 37595 } 37596 if (!isAsyncThunkArray(asyncThunks)) { 37597 return isRejectedWithValue()(asyncThunks[0]); 37598 } 37599 return isAllOf(isRejected(...asyncThunks), hasFlag); 37600} 37601function isFulfilled(...asyncThunks) { 37602 if (asyncThunks.length === 0) { 37603 return (action) => hasExpectedRequestMetadata(action, ["fulfilled"]); 37604 } 37605 if (!isAsyncThunkArray(asyncThunks)) { 37606 return isFulfilled()(asyncThunks[0]); 37607 } 37608 return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.fulfilled)); 37609} 37610function isAsyncThunkAction(...asyncThunks) { 37611 if (asyncThunks.length === 0) { 37612 return (action) => hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); 37613 } 37614 if (!isAsyncThunkArray(asyncThunks)) { 37615 return isAsyncThunkAction()(asyncThunks[0]); 37616 } 37617 return isAnyOf(...asyncThunks.flatMap((asyncThunk) => [asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled])); 37618} 37619 37620// src/nanoid.ts 37621var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"; 37622var nanoid = (size = 21) => { 37623 let id = ""; 37624 let i = size; 37625 while (i--) { 37626 id += urlAlphabet[Math.random() * 64 | 0]; 37627 } 37628 return id; 37629}; 37630 37631// src/createAsyncThunk.ts 37632var commonProperties = ["name", "message", "stack", "code"]; 37633var RejectWithValue = class { 37634 constructor(payload, meta) { 37635 this.payload = payload; 37636 this.meta = meta; 37637 } 37638 payload; 37639 meta; 37640 /* 37641 type-only property to distinguish between RejectWithValue and FulfillWithMeta 37642 does not exist at runtime 37643 */ 37644 _type; 37645}; 37646var FulfillWithMeta = class { 37647 constructor(payload, meta) { 37648 this.payload = payload; 37649 this.meta = meta; 37650 } 37651 payload; 37652 meta; 37653 /* 37654 type-only property to distinguish between RejectWithValue and FulfillWithMeta 37655 does not exist at runtime 37656 */ 37657 _type; 37658}; 37659var miniSerializeError = (value) => { 37660 if (typeof value === "object" && value !== null) { 37661 const simpleError = {}; 37662 for (const property of commonProperties) { 37663 if (typeof value[property] === "string") { 37664 simpleError[property] = value[property]; 37665 } 37666 } 37667 return simpleError; 37668 } 37669 return { 37670 message: String(value) 37671 }; 37672}; 37673var externalAbortMessage = "External signal was aborted"; 37674var createAsyncThunk = /* @__PURE__ */ (() => { 37675 function createAsyncThunk2(typePrefix, payloadCreator, options) { 37676 const fulfilled = createAction(typePrefix + "/fulfilled", (payload, requestId, arg, meta) => ({ 37677 payload, 37678 meta: { 37679 ...meta || {}, 37680 arg, 37681 requestId, 37682 requestStatus: "fulfilled" 37683 } 37684 })); 37685 const pending = createAction(typePrefix + "/pending", (requestId, arg, meta) => ({ 37686 payload: void 0, 37687 meta: { 37688 ...meta || {}, 37689 arg, 37690 requestId, 37691 requestStatus: "pending" 37692 } 37693 })); 37694 const rejected = createAction(typePrefix + "/rejected", (error, requestId, arg, payload, meta) => ({ 37695 payload, 37696 error: (options && options.serializeError || miniSerializeError)(error || "Rejected"), 37697 meta: { 37698 ...meta || {}, 37699 arg, 37700 requestId, 37701 rejectedWithValue: !!payload, 37702 requestStatus: "rejected", 37703 aborted: error?.name === "AbortError", 37704 condition: error?.name === "ConditionError" 37705 } 37706 })); 37707 function actionCreator(arg, { 37708 signal 37709 } = {}) { 37710 return (dispatch, getState, extra) => { 37711 const requestId = options?.idGenerator ? options.idGenerator(arg) : nanoid(); 37712 const abortController = new AbortController(); 37713 let abortHandler; 37714 let abortReason; 37715 function abort(reason) { 37716 abortReason = reason; 37717 abortController.abort(); 37718 } 37719 if (signal) { 37720 if (signal.aborted) { 37721 abort(externalAbortMessage); 37722 } else { 37723 signal.addEventListener("abort", () => abort(externalAbortMessage), { 37724 once: true 37725 }); 37726 } 37727 } 37728 const promise = (async function() { 37729 let finalAction; 37730 try { 37731 let conditionResult = options?.condition?.(arg, { 37732 getState, 37733 extra 37734 }); 37735 if (isThenable(conditionResult)) { 37736 conditionResult = await conditionResult; 37737 } 37738 if (conditionResult === false || abortController.signal.aborted) { 37739 throw { 37740 name: "ConditionError", 37741 message: "Aborted due to condition callback returning false." 37742 }; 37743 } 37744 const abortedPromise = new Promise((_, reject) => { 37745 abortHandler = () => { 37746 reject({ 37747 name: "AbortError", 37748 message: abortReason || "Aborted" 37749 }); 37750 }; 37751 abortController.signal.addEventListener("abort", abortHandler, { 37752 once: true 37753 }); 37754 }); 37755 dispatch(pending(requestId, arg, options?.getPendingMeta?.({ 37756 requestId, 37757 arg 37758 }, { 37759 getState, 37760 extra 37761 }))); 37762 finalAction = await Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, { 37763 dispatch, 37764 getState, 37765 extra, 37766 requestId, 37767 signal: abortController.signal, 37768 abort, 37769 rejectWithValue: ((value, meta) => { 37770 return new RejectWithValue(value, meta); 37771 }), 37772 fulfillWithValue: ((value, meta) => { 37773 return new FulfillWithMeta(value, meta); 37774 }) 37775 })).then((result) => { 37776 if (result instanceof RejectWithValue) { 37777 throw result; 37778 } 37779 if (result instanceof FulfillWithMeta) { 37780 return fulfilled(result.payload, requestId, arg, result.meta); 37781 } 37782 return fulfilled(result, requestId, arg); 37783 })]); 37784 } catch (err) { 37785 finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err, requestId, arg); 37786 } finally { 37787 if (abortHandler) { 37788 abortController.signal.removeEventListener("abort", abortHandler); 37789 } 37790 } 37791 const skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition; 37792 if (!skipDispatch) { 37793 dispatch(finalAction); 37794 } 37795 return finalAction; 37796 })(); 37797 return Object.assign(promise, { 37798 abort, 37799 requestId, 37800 arg, 37801 unwrap() { 37802 return promise.then(unwrapResult); 37803 } 37804 }); 37805 }; 37806 } 37807 return Object.assign(actionCreator, { 37808 pending, 37809 rejected, 37810 fulfilled, 37811 settled: isAnyOf(rejected, fulfilled), 37812 typePrefix 37813 }); 37814 } 37815 createAsyncThunk2.withTypes = () => createAsyncThunk2; 37816 return createAsyncThunk2; 37817})(); 37818function unwrapResult(action) { 37819 if (action.meta && action.meta.rejectedWithValue) { 37820 throw action.payload; 37821 } 37822 if (action.error) { 37823 throw action.error; 37824 } 37825 return action.payload; 37826} 37827function isThenable(value) { 37828 return value !== null && typeof value === "object" && typeof value.then === "function"; 37829} 37830 37831// src/createSlice.ts 37832var asyncThunkSymbol = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk"); 37833var asyncThunkCreator = { 37834 [asyncThunkSymbol]: createAsyncThunk 37835}; 37836var ReducerType = /* @__PURE__ */ ((ReducerType2) => { 37837 ReducerType2["reducer"] = "reducer"; 37838 ReducerType2["reducerWithPrepare"] = "reducerWithPrepare"; 37839 ReducerType2["asyncThunk"] = "asyncThunk"; 37840 return ReducerType2; 37841})(ReducerType || {}); 37842function getType(slice, actionKey) { 37843 return `${slice}/${actionKey}`; 37844} 37845function buildCreateSlice({ 37846 creators 37847} = {}) { 37848 const cAT = creators?.asyncThunk?.[asyncThunkSymbol]; 37849 return function createSlice2(options) { 37850 const { 37851 name, 37852 reducerPath = name 37853 } = options; 37854 if (!name) { 37855 throw new Error(
vendor: 8,414 bytes, lines 37855-38106
37855 true ? formatProdErrorMessage(11) : 0); 37856 } 37857 if (typeof process !== "undefined" && "production" === "development") // removed by dead control flow 37858{} 37859 const reducers = (typeof options.reducers === "function" ? options.reducers(buildReducerCreators()) : options.reducers) || {}; 37860 const reducerNames = Object.keys(reducers); 37861 const context = { 37862 sliceCaseReducersByName: {}, 37863 sliceCaseReducersByType: {}, 37864 actionCreators: {}, 37865 sliceMatchers: [] 37866 }; 37867 const contextMethods = { 37868 addCase(typeOrActionCreator, reducer2) { 37869 const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; 37870 if (!type) { 37871 throw new Error( true ? formatProdErrorMessage(12) : 0); 37872 } 37873 if (type in context.sliceCaseReducersByType) { 37874 throw new Error( true ? formatProdErrorMessage(13) : 0); 37875 } 37876 context.sliceCaseReducersByType[type] = reducer2; 37877 return contextMethods; 37878 }, 37879 addMatcher(matcher, reducer2) { 37880 context.sliceMatchers.push({ 37881 matcher, 37882 reducer: reducer2 37883 }); 37884 return contextMethods; 37885 }, 37886 exposeAction(name2, actionCreator) { 37887 context.actionCreators[name2] = actionCreator; 37888 return contextMethods; 37889 }, 37890 exposeCaseReducer(name2, reducer2) { 37891 context.sliceCaseReducersByName[name2] = reducer2; 37892 return contextMethods; 37893 } 37894 }; 37895 reducerNames.forEach((reducerName) => { 37896 const reducerDefinition = reducers[reducerName]; 37897 const reducerDetails = { 37898 reducerName, 37899 type: getType(name, reducerName), 37900 createNotation: typeof options.reducers === "function" 37901 }; 37902 if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) { 37903 handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT); 37904 } else { 37905 handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods); 37906 } 37907 }); 37908 function buildReducer() { 37909 if (false) // removed by dead control flow 37910{} 37911 const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = void 0] = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers]; 37912 const finalCaseReducers = { 37913 ...extraReducers, 37914 ...context.sliceCaseReducersByType 37915 }; 37916 return createReducer(options.initialState, (builder) => { 37917 for (let key in finalCaseReducers) { 37918 builder.addCase(key, finalCaseReducers[key]); 37919 } 37920 for (let sM of context.sliceMatchers) { 37921 builder.addMatcher(sM.matcher, sM.reducer); 37922 } 37923 for (let m of actionMatchers) { 37924 builder.addMatcher(m.matcher, m.reducer); 37925 } 37926 if (defaultCaseReducer) { 37927 builder.addDefaultCase(defaultCaseReducer); 37928 } 37929 }); 37930 } 37931 const selectSelf = (state) => state; 37932 const injectedSelectorCache = /* @__PURE__ */ new Map(); 37933 const injectedStateCache = /* @__PURE__ */ new WeakMap(); 37934 let _reducer; 37935 function reducer(state, action) { 37936 if (!_reducer) _reducer = buildReducer(); 37937 return _reducer(state, action); 37938 } 37939 function getInitialState() { 37940 if (!_reducer) _reducer = buildReducer(); 37941 return _reducer.getInitialState(); 37942 } 37943 function makeSelectorProps(reducerPath2, injected = false) { 37944 function selectSlice(state) { 37945 let sliceState = state[reducerPath2]; 37946 if (typeof sliceState === "undefined") { 37947 if (injected) { 37948 sliceState = getOrInsertComputed(injectedStateCache, selectSlice, getInitialState); 37949 } else if (false) // removed by dead control flow 37950{} 37951 } 37952 return sliceState; 37953 } 37954 function getSelectors(selectState = selectSelf) { 37955 const selectorCache = getOrInsertComputed(injectedSelectorCache, injected, () => /* @__PURE__ */ new WeakMap()); 37956 return getOrInsertComputed(selectorCache, selectState, () => { 37957 const map = {}; 37958 for (const [name2, selector] of Object.entries(options.selectors ?? {})) { 37959 map[name2] = wrapSelector(selector, selectState, () => getOrInsertComputed(injectedStateCache, selectState, getInitialState), injected); 37960 } 37961 return map; 37962 }); 37963 } 37964 return { 37965 reducerPath: reducerPath2, 37966 getSelectors, 37967 get selectors() { 37968 return getSelectors(selectSlice); 37969 }, 37970 selectSlice 37971 }; 37972 } 37973 const slice = { 37974 name, 37975 reducer, 37976 actions: context.actionCreators, 37977 caseReducers: context.sliceCaseReducersByName, 37978 getInitialState, 37979 ...makeSelectorProps(reducerPath), 37980 injectInto(injectable, { 37981 reducerPath: pathOpt, 37982 ...config 37983 } = {}) { 37984 const newReducerPath = pathOpt ?? reducerPath; 37985 injectable.inject({ 37986 reducerPath: newReducerPath, 37987 reducer 37988 }, config); 37989 return { 37990 ...slice, 37991 ...makeSelectorProps(newReducerPath, true) 37992 }; 37993 } 37994 }; 37995 return slice; 37996 }; 37997} 37998function wrapSelector(selector, selectState, getInitialState, injected) { 37999 function wrapper(rootState, ...args) { 38000 let sliceState = selectState(rootState); 38001 if (typeof sliceState === "undefined") { 38002 if (injected) { 38003 sliceState = getInitialState(); 38004 } else if (false) // removed by dead control flow 38005{} 38006 } 38007 return selector(sliceState, ...args); 38008 } 38009 wrapper.unwrapped = selector; 38010 return wrapper; 38011} 38012var createSlice = /* @__PURE__ */ buildCreateSlice(); 38013function buildReducerCreators() { 38014 function asyncThunk(payloadCreator, config) { 38015 return { 38016 _reducerDefinitionType: "asyncThunk" /* asyncThunk */, 38017 payloadCreator, 38018 ...config 38019 }; 38020 } 38021 asyncThunk.withTypes = () => asyncThunk; 38022 return { 38023 reducer(caseReducer) { 38024 return Object.assign({ 38025 // hack so the wrapping function has the same name as the original 38026 // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original 38027 [caseReducer.name](...args) { 38028 return caseReducer(...args); 38029 } 38030 }[caseReducer.name], { 38031 _reducerDefinitionType: "reducer" /* reducer */ 38032 }); 38033 }, 38034 preparedReducer(prepare, reducer) { 38035 return { 38036 _reducerDefinitionType: "reducerWithPrepare" /* reducerWithPrepare */, 38037 prepare, 38038 reducer 38039 }; 38040 }, 38041 asyncThunk 38042 }; 38043} 38044function handleNormalReducerDefinition({ 38045 type, 38046 reducerName, 38047 createNotation 38048}, maybeReducerWithPrepare, context) { 38049 let caseReducer; 38050 let prepareCallback; 38051 if ("reducer" in maybeReducerWithPrepare) { 38052 if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) { 38053 throw new Error( true ? formatProdErrorMessage(17) : 0); 38054 } 38055 caseReducer = maybeReducerWithPrepare.reducer; 38056 prepareCallback = maybeReducerWithPrepare.prepare; 38057 } else { 38058 caseReducer = maybeReducerWithPrepare; 38059 } 38060 context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type)); 38061} 38062function isAsyncThunkSliceReducerDefinition(reducerDefinition) { 38063 return reducerDefinition._reducerDefinitionType === "asyncThunk" /* asyncThunk */; 38064} 38065function isCaseReducerWithPrepareDefinition(reducerDefinition) { 38066 return reducerDefinition._reducerDefinitionType === "reducerWithPrepare" /* reducerWithPrepare */; 38067} 38068function handleThunkCaseReducerDefinition({ 38069 type, 38070 reducerName 38071}, reducerDefinition, context, cAT) { 38072 if (!cAT) { 38073 throw new Error( true ? formatProdErrorMessage(18) : 0); 38074 } 38075 const { 38076 payloadCreator, 38077 fulfilled, 38078 pending, 38079 rejected, 38080 settled, 38081 options 38082 } = reducerDefinition; 38083 const thunk = cAT(type, payloadCreator, options); 38084 context.exposeAction(reducerName, thunk); 38085 if (fulfilled) { 38086 context.addCase(thunk.fulfilled, fulfilled); 38087 } 38088 if (pending) { 38089 context.addCase(thunk.pending, pending); 38090 } 38091 if (rejected) { 38092 context.addCase(thunk.rejected, rejected); 38093 } 38094 if (settled) { 38095 context.addMatcher(thunk.settled, settled); 38096 } 38097 context.exposeCaseReducer(reducerName, { 38098 fulfilled: fulfilled || noop, 38099 pending: pending || noop, 38100 rejected: rejected || noop, 38101 settled: settled || noop 38102 }); 38103} 38104function noop() { 38105} 38106
38107// src/entities/entity_state.ts 38108function getInitialEntityState() { 38109 return { 38110 ids: [], 38111 entities: {} 38112 }; 38113} 38114function createInitialStateFactory(stateAdapter) { 38115 function getInitialState(additionalState = {}, entities) { 38116 const state = Object.assign(getInitialEntityState(), additionalState); 38117 return entities ? stateAdapter.setAll(state, entities) : state; 38118 } 38119 return { 38120 getInitialState 38121 }; 38122} 38123
38124// src/entities/state_selectors.ts 38125function createSelectorsFactory() { 38126 function getSelectors(selectState, options = {}) { 38127 const { 38128 createSelector: createSelector2 = createDraftSafeSelector 38129 } = options; 38130 const selectIds = (state) => state.ids; 38131 const selectEntities = (state) => state.entities; 38132 const selectAll = createSelector2(selectIds, selectEntities, (ids, entities) => ids.map((id) => entities[id])); 38133 const selectId = (_, id) => id; 38134 const selectById = (entities, id) => entities[id]; 38135 const selectTotal = createSelector2(selectIds, (ids) => ids.length); 38136 if (!selectState) { 38137 return { 38138 selectIds, 38139 selectEntities, 38140 selectAll, 38141 selectTotal, 38142 selectById: createSelector2(selectEntities, selectId, selectById) 38143 }; 38144 } 38145 const selectGlobalizedEntities = createSelector2(selectState, selectEntities); 38146 return { 38147 selectIds: createSelector2(selectState, selectIds), 38148 selectEntities: selectGlobalizedEntities, 38149 selectAll: createSelector2(selectState, selectAll), 38150 selectTotal: createSelector2(selectState, selectTotal), 38151 selectById: createSelector2(selectGlobalizedEntities, selectId, selectById) 38152 }; 38153 } 38154 return { 38155 getSelectors 38156 }; 38157} 38158
38159// src/entities/state_adapter.ts 38160var isDraftTyped = (/* unused pure expression or super */ null && (isDraft)); 38161function createSingleArgumentStateOperator(mutator) { 38162 const operator = createStateOperator((_, state) => mutator(state)); 38163 return function operation(state) { 38164 return operator(state, void 0); 38165 }; 38166} 38167function createStateOperator(mutator) { 38168 return function operation(state, arg) { 38169 function isPayloadActionArgument(arg2) { 38170 return isFSA(arg2); 38171 } 38172 const runMutator = (draft) => { 38173 if (isPayloadActionArgument(arg)) { 38174 mutator(arg.payload, draft); 38175 } else { 38176 mutator(arg, draft); 38177 } 38178 }; 38179 if (isDraftTyped(state)) { 38180 runMutator(state); 38181 return state; 38182 } 38183 return produce(state, runMutator); 38184 }; 38185} 38186
38187// src/entities/utils.ts 38188function selectIdValue(entity, selectId) { 38189 const key = selectId(entity); 38190 if (false) // removed by dead control flow 38191{} 38192 return key; 38193} 38194function ensureEntitiesArray(entities) { 38195 if (!Array.isArray(entities)) { 38196 entities = Object.values(entities); 38197 } 38198 return entities; 38199} 38200function getCurrent(value) { 38201 return isDraft(value) ? current(value) : value; 38202} 38203function splitAddedUpdatedEntities(newEntities, selectId, state) { 38204 newEntities = ensureEntitiesArray(newEntities); 38205 const existingIdsArray = getCurrent(state.ids); 38206 const existingIds = new Set(existingIdsArray); 38207 const added = []; 38208 const addedIds = /* @__PURE__ */ new Set([]); 38209 const updated = []; 38210 for (const entity of newEntities) { 38211 const id = selectIdValue(entity, selectId); 38212 if (existingIds.has(id) || addedIds.has(id)) { 38213 updated.push({ 38214 id, 38215 changes: entity 38216 }); 38217 } else { 38218 addedIds.add(id); 38219 added.push(entity); 38220 } 38221 } 38222 return [added, updated, existingIdsArray]; 38223} 38224
38225// src/entities/unsorted_state_adapter.ts 38226function createUnsortedStateAdapter(selectId) { 38227 function addOneMutably(entity, state) { 38228 const key = selectIdValue(entity, selectId); 38229 if (key in state.entities) { 38230 return; 38231 } 38232 state.ids.push(key); 38233 state.entities[key] = entity; 38234 } 38235 function addManyMutably(newEntities, state) { 38236 newEntities = ensureEntitiesArray(newEntities); 38237 for (const entity of newEntities) { 38238 addOneMutably(entity, state); 38239 } 38240 } 38241 function setOneMutably(entity, state) { 38242 const key = selectIdValue(entity, selectId); 38243 if (!(key in state.entities)) { 38244 state.ids.push(key); 38245 } 38246 ; 38247 state.entities[key] = entity; 38248 } 38249 function setManyMutably(newEntities, state) { 38250 newEntities = ensureEntitiesArray(newEntities); 38251 for (const entity of newEntities) { 38252 setOneMutably(entity, state); 38253 } 38254 } 38255 function setAllMutably(newEntities, state) { 38256 newEntities = ensureEntitiesArray(newEntities); 38257 state.ids = []; 38258 state.entities = {}; 38259 addManyMutably(newEntities, state); 38260 } 38261 function removeOneMutably(key, state) { 38262 return removeManyMutably([key], state); 38263 } 38264 function removeManyMutably(keys, state) { 38265 let didMutate = false; 38266 keys.forEach((key) => { 38267 if (key in state.entities) { 38268 delete state.entities[key]; 38269 didMutate = true; 38270 } 38271 }); 38272 if (didMutate) { 38273 state.ids = state.ids.filter((id) => id in state.entities); 38274 } 38275 } 38276 function removeAllMutably(state) { 38277 Object.assign(state, { 38278 ids: [], 38279 entities: {} 38280 }); 38281 } 38282 function takeNewKey(keys, update, state) { 38283 const original3 = state.entities[update.id]; 38284 if (original3 === void 0) { 38285 return false; 38286 } 38287 const updated = Object.assign({}, original3, update.changes); 38288 const newKey = selectIdValue(updated, selectId); 38289 const hasNewKey = newKey !== update.id; 38290 if (hasNewKey) { 38291 keys[update.id] = newKey; 38292 delete state.entities[update.id]; 38293 } 38294 ; 38295 state.entities[newKey] = updated; 38296 return hasNewKey; 38297 } 38298 function updateOneMutably(update, state) { 38299 return updateManyMutably([update], state); 38300 } 38301 function updateManyMutably(updates, state) { 38302 const newKeys = {}; 38303 const updatesPerEntity = {}; 38304 updates.forEach((update) => { 38305 if (update.id in state.entities) { 38306 updatesPerEntity[update.id] = { 38307 id: update.id, 38308 // Spreads ignore falsy values, so this works even if there isn't 38309 // an existing update already at this key 38310 changes: { 38311 ...updatesPerEntity[update.id]?.changes, 38312 ...update.changes 38313 } 38314 }; 38315 } 38316 }); 38317 updates = Object.values(updatesPerEntity); 38318 const didMutateEntities = updates.length > 0; 38319 if (didMutateEntities) { 38320 const didMutateIds = updates.filter((update) => takeNewKey(newKeys, update, state)).length > 0; 38321 if (didMutateIds) { 38322 state.ids = Object.values(state.entities).map((e) => selectIdValue(e, selectId)); 38323 } 38324 } 38325 } 38326 function upsertOneMutably(entity, state) { 38327 return upsertManyMutably([entity], state); 38328 } 38329 function upsertManyMutably(newEntities, state) { 38330 const [added, updated] = splitAddedUpdatedEntities(newEntities, selectId, state); 38331 addManyMutably(added, state); 38332 updateManyMutably(updated, state); 38333 } 38334 return { 38335 removeAll: createSingleArgumentStateOperator(removeAllMutably), 38336 addOne: createStateOperator(addOneMutably), 38337 addMany: createStateOperator(addManyMutably), 38338 setOne: createStateOperator(setOneMutably), 38339 setMany: createStateOperator(setManyMutably), 38340 setAll: createStateOperator(setAllMutably), 38341 updateOne: createStateOperator(updateOneMutably), 38342 updateMany: createStateOperator(updateManyMutably), 38343 upsertOne: createStateOperator(upsertOneMutably), 38344 upsertMany: createStateOperator(upsertManyMutably), 38345 removeOne: createStateOperator(removeOneMutably), 38346 removeMany: createStateOperator(removeManyMutably) 38347 }; 38348} 38349
38350// src/entities/sorted_state_adapter.ts 38351function findInsertIndex(sortedItems, item, comparisonFunction) { 38352 let lowIndex = 0; 38353 let highIndex = sortedItems.length; 38354 while (lowIndex < highIndex) { 38355 let middleIndex = lowIndex + highIndex >>> 1; 38356 const currentItem = sortedItems[middleIndex]; 38357 const res = comparisonFunction(item, currentItem); 38358 if (res >= 0) { 38359 lowIndex = middleIndex + 1; 38360 } else { 38361 highIndex = middleIndex; 38362 } 38363 } 38364 return lowIndex; 38365} 38366function insert(sortedItems, item, comparisonFunction) { 38367 const insertAtIndex = findInsertIndex(sortedItems, item, comparisonFunction); 38368 sortedItems.splice(insertAtIndex, 0, item); 38369 return sortedItems; 38370} 38371function createSortedStateAdapter(selectId, comparer) { 38372 const { 38373 removeOne, 38374 removeMany, 38375 removeAll 38376 } = createUnsortedStateAdapter(selectId); 38377 function addOneMutably(entity, state) { 38378 return addManyMutably([entity], state); 38379 } 38380 function addManyMutably(newEntities, state, existingIds) { 38381 newEntities = ensureEntitiesArray(newEntities); 38382 const existingKeys = new Set(existingIds ?? getCurrent(state.ids)); 38383 const addedKeys = /* @__PURE__ */ new Set(); 38384 const models = newEntities.filter((model) => { 38385 const modelId = selectIdValue(model, selectId); 38386 const notAdded = !addedKeys.has(modelId); 38387 if (notAdded) addedKeys.add(modelId); 38388 return !existingKeys.has(modelId) && notAdded; 38389 }); 38390 if (models.length !== 0) { 38391 mergeFunction(state, models); 38392 } 38393 } 38394 function setOneMutably(entity, state) { 38395 return setManyMutably([entity], state); 38396 } 38397 function setManyMutably(newEntities, state) { 38398 let deduplicatedEntities = {}; 38399 newEntities = ensureEntitiesArray(newEntities); 38400 if (newEntities.length !== 0) { 38401 for (const item of newEntities) { 38402 const entityId = selectId(item); 38403 deduplicatedEntities[entityId] = item; 38404 delete state.entities[entityId]; 38405 } 38406 newEntities = ensureEntitiesArray(deduplicatedEntities); 38407 mergeFunction(state, newEntities); 38408 } 38409 } 38410 function setAllMutably(newEntities, state) { 38411 newEntities = ensureEntitiesArray(newEntities); 38412 state.entities = {}; 38413 state.ids = []; 38414 addManyMutably(newEntities, state, []); 38415 } 38416 function updateOneMutably(update, state) { 38417 return updateManyMutably([update], state); 38418 } 38419 function updateManyMutably(updates, state) { 38420 let appliedUpdates = false; 38421 let replacedIds = false; 38422 for (let update of updates) { 38423 const entity = state.entities[update.id]; 38424 if (!entity) { 38425 continue; 38426 } 38427 appliedUpdates = true; 38428 Object.assign(entity, update.changes); 38429 const newId = selectId(entity); 38430 if (update.id !== newId) { 38431 replacedIds = true; 38432 delete state.entities[update.id]; 38433 const oldIndex = state.ids.indexOf(update.id); 38434 state.ids[oldIndex] = newId; 38435 state.entities[newId] = entity; 38436 } 38437 } 38438 if (appliedUpdates) { 38439 mergeFunction(state, [], appliedUpdates, replacedIds); 38440 } 38441 } 38442 function upsertOneMutably(entity, state) { 38443 return upsertManyMutably([entity], state); 38444 } 38445 function upsertManyMutably(newEntities, state) { 38446 const [added, updated, existingIdsArray] = splitAddedUpdatedEntities(newEntities, selectId, state); 38447 if (added.length) { 38448 addManyMutably(added, state, existingIdsArray); 38449 } 38450 if (updated.length) { 38451 updateManyMutably(updated, state); 38452 } 38453 } 38454 function areArraysEqual(a, b) { 38455 if (a.length !== b.length) { 38456 return false; 38457 } 38458 for (let i = 0; i < a.length; i++) { 38459 if (a[i] === b[i]) { 38460 continue; 38461 } 38462 return false; 38463 } 38464 return true; 38465 } 38466 const mergeFunction = (state, addedItems, appliedUpdates, replacedIds) => { 38467 const currentEntities = getCurrent(state.entities); 38468 const currentIds = getCurrent(state.ids); 38469 const stateEntities = state.entities; 38470 let ids = currentIds; 38471 if (replacedIds) { 38472 ids = new Set(currentIds); 38473 } 38474 let sortedEntities = []; 38475 for (const id of ids) { 38476 const entity = currentEntities[id]; 38477 if (entity) { 38478 sortedEntities.push(entity); 38479 } 38480 } 38481 const wasPreviouslyEmpty = sortedEntities.length === 0; 38482 for (const item of addedItems) { 38483 stateEntities[selectId(item)] = item; 38484 if (!wasPreviouslyEmpty) { 38485 insert(sortedEntities, item, comparer); 38486 } 38487 } 38488 if (wasPreviouslyEmpty) { 38489 sortedEntities = addedItems.slice().sort(comparer); 38490 } else if (appliedUpdates) { 38491 sortedEntities.sort(comparer); 38492 } 38493 const newSortedIds = sortedEntities.map(selectId); 38494 if (!areArraysEqual(currentIds, newSortedIds)) { 38495 state.ids = newSortedIds; 38496 } 38497 }; 38498 return { 38499 removeOne, 38500 removeMany, 38501 removeAll, 38502 addOne: createStateOperator(addOneMutably), 38503 updateOne: createStateOperator(updateOneMutably), 38504 upsertOne: createStateOperator(upsertOneMutably), 38505 setOne: createStateOperator(setOneMutably), 38506 setMany: createStateOperator(setManyMutably), 38507 setAll: createStateOperator(setAllMutably),
38508 addMany: createStateOperator(addManyMutably), 38509 updateMany: createStateOperator(updateManyMutably), 38510 upsertMany: createStateOperator(upsertManyMutably) 38511 }; 38512} 38513
38514// src/entities/create_adapter.ts 38515function createEntityAdapter(options = {}) { 38516 const { 38517 selectId, 38518 sortComparer 38519 } = { 38520 sortComparer: false, 38521 selectId: (instance) => instance.id, 38522 ...options 38523 }; 38524 const stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId); 38525 const stateFactory = createInitialStateFactory(stateAdapter); 38526 const selectorsFactory = createSelectorsFactory(); 38527 return { 38528 selectId, 38529 sortComparer, 38530 ...stateFactory, 38531 ...selectorsFactory, 38532 ...stateAdapter 38533 }; 38534} 38535
38536// src/listenerMiddleware/exceptions.ts 38537var task = "task"; 38538var listener = "listener"; 38539var completed = "completed"; 38540var cancelled = "cancelled"; 38541var taskCancelled = (/* unused pure expression or super */ null && (`task-${cancelled}`)); 38542var taskCompleted = (/* unused pure expression or super */ null && (`task-${completed}`)); 38543var listenerCancelled = (/* unused pure expression or super */ null && (`${listener}-${cancelled}`)); 38544var listenerCompleted = (/* unused pure expression or super */ null && (`${listener}-${completed}`)); 38545var TaskAbortError = class { 38546 constructor(code) { 38547 this.code = code; 38548 this.message = `${task} ${cancelled} (reason: ${code})`; 38549 } 38550 code; 38551 name = "TaskAbortError"; 38552 message; 38553}; 38554
38555// src/listenerMiddleware/utils.ts 38556var assertFunction = (func, expected) => { 38557 if (typeof func !== "function") { 38558 throw new TypeError( true ? formatProdErrorMessage(32) : 0); 38559 } 38560}; 38561var noop2 = () => { 38562}; 38563var catchRejection = (promise, onError = noop2) => { 38564 promise.catch(onError); 38565 return promise; 38566}; 38567var addAbortSignalListener = (abortSignal, callback) => { 38568 abortSignal.addEventListener("abort", callback, { 38569 once: true 38570 }); 38571 return () => abortSignal.removeEventListener("abort", callback); 38572}; 38573
38574// src/listenerMiddleware/task.ts 38575var validateActive = (signal) => { 38576 if (signal.aborted) { 38577 throw new TaskAbortError(signal.reason); 38578 } 38579}; 38580function raceWithSignal(signal, promise) { 38581 let cleanup = noop2; 38582 return new Promise((resolve, reject) => { 38583 const notifyRejection = () => reject(new TaskAbortError(signal.reason)); 38584 if (signal.aborted) { 38585 notifyRejection(); 38586 return; 38587 } 38588 cleanup = addAbortSignalListener(signal, notifyRejection); 38589 promise.finally(() => cleanup()).then(resolve, reject); 38590 }).finally(() => { 38591 cleanup = noop2; 38592 }); 38593} 38594var runTask = async (task2, cleanUp) => { 38595 try { 38596 await Promise.resolve(); 38597 const value = await task2(); 38598 return { 38599 status: "ok", 38600 value 38601 }; 38602 } catch (error) { 38603 return { 38604 status: error instanceof TaskAbortError ? "cancelled" : "rejected", 38605 error 38606 }; 38607 } finally { 38608 cleanUp?.(); 38609 } 38610}; 38611var createPause = (signal) => { 38612 return (promise) => { 38613 return catchRejection(raceWithSignal(signal, promise).then((output) => { 38614 validateActive(signal); 38615 return output; 38616 })); 38617 }; 38618}; 38619var createDelay = (signal) => { 38620 const pause = createPause(signal); 38621 return (timeoutMs) => { 38622 return pause(new Promise((resolve) => setTimeout(resolve, timeoutMs))); 38623 }; 38624}; 38625
38626// src/listenerMiddleware/index.ts 38627var { 38628 assign: redux_toolkit_modern_assign 38629} = Object; 38630var INTERNAL_NIL_TOKEN = {}; 38631var alm = "listenerMiddleware"; 38632var createFork = (parentAbortSignal, parentBlockingPromises) => { 38633 const linkControllers = (controller) => addAbortSignalListener(parentAbortSignal, () => controller.abort(parentAbortSignal.reason)); 38634 return (taskExecutor, opts) => { 38635 assertFunction(taskExecutor, "taskExecutor"); 38636 const childAbortController = new AbortController(); 38637 linkControllers(childAbortController); 38638 const result = runTask(async () => { 38639 validateActive(parentAbortSignal); 38640 validateActive(childAbortController.signal); 38641 const result2 = await taskExecutor({ 38642 pause: createPause(childAbortController.signal), 38643 delay: createDelay(childAbortController.signal), 38644 signal: childAbortController.signal 38645 }); 38646 validateActive(childAbortController.signal); 38647 return result2; 38648 }, () => childAbortController.abort(taskCompleted)); 38649 if (opts?.autoJoin) { 38650 parentBlockingPromises.push(result.catch(noop2)); 38651 } 38652 return { 38653 result: createPause(parentAbortSignal)(result), 38654 cancel() { 38655 childAbortController.abort(taskCancelled); 38656 } 38657 }; 38658 }; 38659}; 38660var createTakePattern = (startListening, signal) => { 38661 const take = async (predicate, timeout) => { 38662 validateActive(signal); 38663 let unsubscribe = () => { 38664 }; 38665 const tuplePromise = new Promise((resolve, reject) => { 38666 let stopListening = startListening({ 38667 predicate, 38668 effect: (action, listenerApi) => { 38669 listenerApi.unsubscribe(); 38670 resolve([action, listenerApi.getState(), listenerApi.getOriginalState()]); 38671 } 38672 }); 38673 unsubscribe = () => { 38674 stopListening(); 38675 reject(); 38676 }; 38677 }); 38678 const promises = [tuplePromise]; 38679 if (timeout != null) { 38680 promises.push(new Promise((resolve) => setTimeout(resolve, timeout, null))); 38681 } 38682 try { 38683 const output = await raceWithSignal(signal, Promise.race(promises)); 38684 validateActive(signal); 38685 return output; 38686 } finally { 38687 unsubscribe(); 38688 } 38689 }; 38690 return ((predicate, timeout) => catchRejection(take(predicate, timeout))); 38691}; 38692var getListenerEntryPropsFrom = (options) => { 38693 let { 38694 type, 38695 actionCreator, 38696 matcher, 38697 predicate, 38698 effect 38699 } = options; 38700 if (type) { 38701 predicate = createAction(type).match; 38702 } else if (actionCreator) { 38703 type = actionCreator.type; 38704 predicate = actionCreator.match; 38705 } else if (matcher) { 38706 predicate = matcher; 38707 } else if (predicate) { 38708 } else { 38709 throw new Error( true ? formatProdErrorMessage(21) : 0); 38710 } 38711 assertFunction(effect, "options.listener"); 38712 return { 38713 predicate, 38714 type, 38715 effect 38716 }; 38717}; 38718var createListenerEntry = /* @__PURE__ */ redux_toolkit_modern_assign((options) => { 38719 const { 38720 type, 38721 predicate, 38722 effect 38723 } = getListenerEntryPropsFrom(options); 38724 const entry = { 38725 id: nanoid(), 38726 effect, 38727 type, 38728 predicate, 38729 pending: /* @__PURE__ */ new Set(), 38730 unsubscribe: () => { 38731 throw new Error( true ? formatProdErrorMessage(22) : 0); 38732 } 38733 }; 38734 return entry; 38735}, { 38736 withTypes: () => createListenerEntry 38737}); 38738var findListenerEntry = (listenerMap, options) => { 38739 const { 38740 type, 38741 effect, 38742 predicate 38743 } = getListenerEntryPropsFrom(options); 38744 return Array.from(listenerMap.values()).find((entry) => { 38745 const matchPredicateOrType = typeof type === "string" ? entry.type === type : entry.predicate === predicate; 38746 return matchPredicateOrType && entry.effect === effect; 38747 }); 38748}; 38749var cancelActiveListeners = (entry) => { 38750 entry.pending.forEach((controller) => { 38751 controller.abort(listenerCancelled); 38752 }); 38753}; 38754var createClearListenerMiddleware = (listenerMap, executingListeners) => { 38755 return () => { 38756 for (const listener2 of executingListeners.keys()) { 38757 cancelActiveListeners(listener2); 38758 } 38759 listenerMap.clear(); 38760 }; 38761}; 38762var safelyNotifyError = (errorHandler, errorToNotify, errorInfo) => { 38763 try { 38764 errorHandler(errorToNotify, errorInfo); 38765 } catch (errorHandlerError) { 38766 setTimeout(() => { 38767 throw errorHandlerError; 38768 }, 0); 38769 } 38770}; 38771var addListener = /* @__PURE__ */ redux_toolkit_modern_assign(/* @__PURE__ */ createAction(`${alm}/add`), {
38772 withTypes: () => addListener 38773}); 38774var clearAllListeners = /* @__PURE__ */ (/* unused pure expression or super */ null && (createAction(`${alm}/removeAll`))); 38775var removeListener = /* @__PURE__ */ redux_toolkit_modern_assign(/* @__PURE__ */ createAction(`${alm}/remove`), { 38776 withTypes: () => removeListener 38777}); 38778var defaultErrorHandler = (...args) => { 38779 console.error(`${alm}/error`, ...args); 38780}; 38781var createListenerMiddleware = (middlewareOptions = {}) => { 38782 const listenerMap = /* @__PURE__ */ new Map(); 38783 const executingListeners = /* @__PURE__ */ new Map(); 38784 const trackExecutingListener = (entry) => { 38785 const count = executingListeners.get(entry) ?? 0; 38786 executingListeners.set(entry, count + 1); 38787 }; 38788 const untrackExecutingListener = (entry) => { 38789 const count = executingListeners.get(entry) ?? 1; 38790 if (count === 1) { 38791 executingListeners.delete(entry); 38792 } else { 38793 executingListeners.set(entry, count - 1); 38794 } 38795 }; 38796 const { 38797 extra, 38798 onError = defaultErrorHandler 38799 } = middlewareOptions; 38800 assertFunction(onError, "onError"); 38801 const insertEntry = (entry) => { 38802 entry.unsubscribe = () => listenerMap.delete(entry.id); 38803 listenerMap.set(entry.id, entry); 38804 return (cancelOptions) => { 38805 entry.unsubscribe(); 38806 if (cancelOptions?.cancelActive) { 38807 cancelActiveListeners(entry); 38808 } 38809 }; 38810 }; 38811 const startListening = ((options) => { 38812 const entry = findListenerEntry(listenerMap, options) ?? createListenerEntry(options); 38813 return insertEntry(entry); 38814 }); 38815 redux_toolkit_modern_assign(startListening, { 38816 withTypes: () => startListening 38817 }); 38818 const stopListening = (options) => { 38819 const entry = findListenerEntry(listenerMap, options); 38820 if (entry) { 38821 entry.unsubscribe(); 38822 if (options.cancelActive) { 38823 cancelActiveListeners(entry); 38824 } 38825 } 38826 return !!entry; 38827 }; 38828 redux_toolkit_modern_assign(stopListening, { 38829 withTypes: () => stopListening 38830 }); 38831 const notifyListener = async (entry, action, api, getOriginalState) => { 38832 const internalTaskController = new AbortController(); 38833 const take = createTakePattern(startListening, internalTaskController.signal); 38834 const autoJoinPromises = []; 38835 try { 38836 entry.pending.add(internalTaskController); 38837 trackExecutingListener(entry); 38838 await Promise.resolve(entry.effect( 38839 action, 38840 // Use assign() rather than ... to avoid extra helper functions added to bundle 38841 redux_toolkit_modern_assign({}, api, { 38842 getOriginalState, 38843 condition: (predicate, timeout) => take(predicate, timeout).then(Boolean), 38844 take, 38845 delay: createDelay(internalTaskController.signal), 38846 pause: createPause(internalTaskController.signal), 38847 extra, 38848 signal: internalTaskController.signal, 38849 fork: createFork(internalTaskController.signal, autoJoinPromises), 38850 unsubscribe: entry.unsubscribe, 38851 subscribe: () => { 38852 listenerMap.set(entry.id, entry); 38853 }, 38854 cancelActiveListeners: () => { 38855 entry.pending.forEach((controller, _, set) => { 38856 if (controller !== internalTaskController) { 38857 controller.abort(listenerCancelled); 38858 set.delete(controller); 38859 } 38860 }); 38861 }, 38862 cancel: () => { 38863 internalTaskController.abort(listenerCancelled); 38864 entry.pending.delete(internalTaskController); 38865 }, 38866 throwIfCancelled: () => { 38867 validateActive(internalTaskController.signal); 38868 } 38869 }) 38870 )); 38871 } catch (listenerError) { 38872 if (!(listenerError instanceof TaskAbortError)) { 38873 safelyNotifyError(onError, listenerError, { 38874 raisedBy: "effect" 38875 }); 38876 } 38877 } finally { 38878 await Promise.all(autoJoinPromises); 38879 internalTaskController.abort(listenerCompleted); 38880 untrackExecutingListener(entry); 38881 entry.pending.delete(internalTaskController); 38882 } 38883 }; 38884 const clearListenerMiddleware = createClearListenerMiddleware(listenerMap, executingListeners); 38885 const middleware = (api) => (next) => (action) => { 38886 if (!isAction(action)) { 38887 return next(action); 38888 } 38889 if (addListener.match(action)) { 38890 return startListening(action.payload); 38891 } 38892 if (clearAllListeners.match(action)) { 38893 clearListenerMiddleware(); 38894 return; 38895 } 38896 if (removeListener.match(action)) { 38897 return stopListening(action.payload); 38898 } 38899 let originalState = api.getState(); 38900 const getOriginalState = () => { 38901 if (originalState === INTERNAL_NIL_TOKEN) { 38902 throw new Error( true ? formatProdErrorMessage(23) : 0); 38903 } 38904 return originalState; 38905 }; 38906 let result; 38907 try { 38908 result = next(action); 38909 if (listenerMap.size > 0) { 38910 const currentState = api.getState(); 38911 const listenerEntries = Array.from(listenerMap.values()); 38912 for (const entry of listenerEntries) { 38913 let runListener = false;
38914 try { 38915 runListener = entry.predicate(action, currentState, originalState); 38916 } catch (predicateError) { 38917 runListener = false; 38918 safelyNotifyError(onError, predicateError, { 38919 raisedBy: "predicate" 38920 }); 38921 } 38922 if (!runListener) { 38923 continue; 38924 } 38925 notifyListener(entry, action, api, getOriginalState); 38926 } 38927 } 38928 } finally { 38929 originalState = INTERNAL_NIL_TOKEN; 38930 } 38931 return result; 38932 }; 38933 return { 38934 middleware, 38935 startListening, 38936 stopListening, 38937 clearListeners: clearListenerMiddleware 38938 }; 38939}; 38940
38941// src/dynamicMiddleware/index.ts 38942var createMiddlewareEntry = (middleware) => ({ 38943 middleware, 38944 applied: /* @__PURE__ */ new Map() 38945}); 38946var matchInstance = (instanceId) => (action) => action?.meta?.instanceId === instanceId; 38947var createDynamicMiddleware = () => { 38948 const instanceId = nanoid(); 38949 const middlewareMap = /* @__PURE__ */ new Map(); 38950 const withMiddleware = Object.assign(createAction("dynamicMiddleware/add", (...middlewares) => ({ 38951 payload: middlewares, 38952 meta: { 38953 instanceId 38954 } 38955 })), { 38956 withTypes: () => withMiddleware 38957 }); 38958 const addMiddleware = Object.assign(function addMiddleware2(...middlewares) { 38959 middlewares.forEach((middleware2) => { 38960 getOrInsertComputed(middlewareMap, middleware2, createMiddlewareEntry); 38961 }); 38962 }, { 38963 withTypes: () => addMiddleware 38964 }); 38965 const getFinalMiddleware = (api) => { 38966 const appliedMiddleware = Array.from(middlewareMap.values()).map((entry) => getOrInsertComputed(entry.applied, api, entry.middleware)); 38967 return compose(...appliedMiddleware); 38968 }; 38969 const isWithMiddleware = isAllOf(withMiddleware, matchInstance(instanceId)); 38970 const middleware = (api) => (next) => (action) => { 38971 if (isWithMiddleware(action)) { 38972 addMiddleware(...action.payload); 38973 return api.dispatch; 38974 } 38975 return getFinalMiddleware(api)(next)(action); 38976 }; 38977 return { 38978 middleware, 38979 addMiddleware, 38980 withMiddleware, 38981 instanceId 38982 }; 38983}; 38984
38985// src/combineSlices.ts 38986 38987var isSliceLike = (maybeSliceLike) => "reducerPath" in maybeSliceLike && typeof maybeSliceLike.reducerPath === "string"; 38988var getReducers = (slices) => slices.flatMap((sliceOrMap) => isSliceLike(sliceOrMap) ? [[sliceOrMap.reducerPath, sliceOrMap.reducer]] : Object.entries(sliceOrMap)); 38989var ORIGINAL_STATE = /* @__PURE__ */ (/* unused pure expression or super */ null && (Symbol.for("rtk-state-proxy-original"))); 38990var isStateProxy = (value) => !!value && !!value[ORIGINAL_STATE]; 38991var stateProxyMap = /* @__PURE__ */ new WeakMap(); 38992var createStateProxy = (state, reducerMap, initialStateCache) => getOrInsertComputed(stateProxyMap, state, () => new Proxy(state, { 38993 get: (target, prop, receiver) => { 38994 if (prop === ORIGINAL_STATE) return target; 38995 const result = Reflect.get(target, prop, receiver); 38996 if (typeof result === "undefined") { 38997 const cached = initialStateCache[prop]; 38998 if (typeof cached !== "undefined") return cached; 38999 const reducer = reducerMap[prop]; 39000 if (reducer) { 39001 const reducerResult = reducer(void 0, { 39002 type: nanoid() 39003 }); 39004 if (typeof reducerResult === "undefined") { 39005 throw new Error( true ? formatProdErrorMessage(24) : 0); 39006 } 39007 initialStateCache[prop] = reducerResult; 39008 return reducerResult; 39009 } 39010 } 39011 return result; 39012 } 39013})); 39014var original = (state) => { 39015 if (!isStateProxy(state)) { 39016 throw new Error( true ? formatProdErrorMessage(25) : 0); 39017 } 39018 return state[ORIGINAL_STATE]; 39019}; 39020var emptyObject = {}; 39021var noopReducer = (state = emptyObject) => state; 39022function combineSlices(...slices) { 39023 const reducerMap = Object.fromEntries(getReducers(slices)); 39024 const getReducer = () => Object.keys(reducerMap).length ? combineReducers2(reducerMap) : noopReducer; 39025 let reducer = getReducer(); 39026 function combinedReducer(state, action) { 39027 return reducer(state, action); 39028 } 39029 combinedReducer.withLazyLoadedSlices = () => combinedReducer; 39030 const initialStateCache = {}; 39031 const inject = (slice, config = {}) => { 39032 const { 39033 reducerPath, 39034 reducer: reducerToInject 39035 } = slice; 39036 const currentReducer = reducerMap[reducerPath]; 39037 if (!config.overrideExisting && currentReducer && currentReducer !== reducerToInject) { 39038 if (typeof process !== "undefined" && "production" === "development") // removed by dead control flow 39039{} 39040 return combinedReducer; 39041 } 39042 if (config.overrideExisting && currentReducer !== reducerToInject) { 39043 delete initialStateCache[reducerPath]; 39044 } 39045 reducerMap[reducerPath] = reducerToInject; 39046 reducer = getReducer(); 39047 return combinedReducer; 39048 }; 39049 const selector = Object.assign(function makeSelector(selectorFn, selectState) { 39050 return function selector2(state, ...args) { 39051 return selectorFn(createStateProxy(selectState ? selectState(state, ...args) : state, reducerMap, initialStateCache), ...args); 39052 }; 39053 }, { 39054 original 39055 }); 39056 return Object.assign(combinedReducer, { 39057 inject, 39058 selector 39059 }); 39060} 39061
39062// src/formatProdErrorMessage.ts 39063function formatProdErrorMessage(code) { 39064 return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `; 39065} 39066 39067//# sourceMappingURL=redux-toolkit.modern.mjs.map 39068;// ./node_modules/@zengenti/contensis-react-base/esm/slice-C6JLQik8.js 39069 39070 39071const i18nSlice = createSlice({ 39072 name: 'i18n', 39073 initialState: { 39074 currentLanguage: '', 39075 dictionary: {}, 39076 locales: {}, 39077 routes: {}, 39078 primaryLanguage: '', 39079 supportedLanguages: [], 39080 resolver: undefined, 39081 error: undefined 39082 }, 39083 reducers: { 39084 GET_ENTRY_URI_ERROR(draft, { 39085 payload 39086 }) { 39087 draft.error = payload; 39088 }, 39089 INIT_LOCALES(draft, { 39090 payload 39091 }) { 39092 draft.locales = payload.locales; 39093 draft.routes = payload.routes; 39094 draft.primaryLanguage = payload.primaryLanguage; 39095 draft.supportedLanguages = payload.supportedLanguages; 39096 if (payload.resolver) draft.resolver = payload.resolver; 39097 }, 39098 SET_LANGUAGE(draft, { 39099 payload 39100 }) { 39101 draft.currentLanguage = payload.language; 39102 if (payload.dictionary) draft.dictionary = payload.dictionary; 39103 }, 39104 SET_LOCALES(draft, { 39105 payload 39106 }) { 39107 // Sort locales object by keys alphabetically 39108 const sortedLocales = Object.keys(payload.locales || {}).sort().reduce((sorted, key) => { 39109 sorted[key] = payload.locales[key]; 39110 return sorted; 39111 }, {}); 39112 draft.locales = sortedLocales; 39113 draft.primaryLanguage = payload.primaryLanguage; 39114 draft.supportedLanguages = [...(payload.supportedLanguages || [])].sort(); 39115 if (payload.resolver) draft.resolver = payload.resolver; 39116 }, 39117 /** UPDATE_LANGUAGE action triggers updateLanguage saga and ends with SET_LANGUAGE */ 39118 UPDATE_LANGUAGE(_draft, _) {} 39119 } 39120}); 39121const { 39122 actions, 39123 reducer, 39124 getInitialState 39125} = i18nSlice; 39126 39127// Alias some nicer named exports for the actions 39128const updateLanguage = actions.UPDATE_LANGUAGE; 39129 39130 39131//# sourceMappingURL=slice-C6JLQik8.js.map 39132 39133 39134/***/ }, 39135 39136/***/ 95137 39137(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 39138 39139"use strict"; 39140 39141// EXPORTS 39142__webpack_require__.d(__webpack_exports__, { 39143 G: () => (/* binding */ GET_NODE_TREE), 39144 S: () => (/* binding */ SET_NODE_TREE), 39145 a: () => (/* binding */ GET_NODE_TREE_ERROR), 39146 b: () => (/* binding */ SET_VERSION), 39147 c: () => (/* binding */ SET_VERSION_STATUS), 39148 d: () => (/* binding */ createStore), 39149 n: () => (/* binding */ navigation), 39150 r: () => (/* binding */ reduxStore),
39151 v: () => (/* binding */ version), 39152 w: () => (/* binding */ wrapSagasInGenerator) 39153}); 39154 39155// EXTERNAL MODULE: ./node_modules/redux/dist/redux.mjs 39156var redux = __webpack_require__(93079); 39157;// ./node_modules/redux-thunk/dist/redux-thunk.mjs
vendor: 5,543 bytes, lines 39158-39312
39158// src/index.ts 39159function createThunkMiddleware(extraArgument) { 39160 const middleware = ({ dispatch, getState }) => (next) => (action) => { 39161 if (typeof action === "function") { 39162 return action(dispatch, getState, extraArgument); 39163 } 39164 return next(action); 39165 }; 39166 return middleware; 39167} 39168var thunk = createThunkMiddleware(); 39169var withExtraArgument = (/* unused pure expression or super */ null && (createThunkMiddleware)); 39170 39171 39172// EXTERNAL MODULE: ./node_modules/redux-saga/dist/redux-saga-core-npm-proxy.esm.js + 2 modules 39173var redux_saga_core_npm_proxy_esm = __webpack_require__(27701); 39174// EXTERNAL MODULE: ./node_modules/react/index.js 39175var react = __webpack_require__(96540); 39176// EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js 39177var hoist_non_react_statics_cjs = __webpack_require__(4146); 39178// EXTERNAL MODULE: ./node_modules/invariant/browser.js 39179var browser = __webpack_require__(20311); 39180var browser_default = /*#__PURE__*/__webpack_require__.n(browser); 39181// EXTERNAL MODULE: ./node_modules/lodash/isEmpty.js 39182var isEmpty = __webpack_require__(62193); 39183// EXTERNAL MODULE: ./node_modules/lodash/isFunction.js 39184var isFunction = __webpack_require__(1882); 39185var isFunction_default = /*#__PURE__*/__webpack_require__.n(isFunction); 39186// EXTERNAL MODULE: ./node_modules/lodash/isString.js 39187var isString = __webpack_require__(85015); 39188// EXTERNAL MODULE: ./node_modules/lodash/conformsTo.js 39189var conformsTo = __webpack_require__(69048); 39190var conformsTo_default = /*#__PURE__*/__webpack_require__.n(conformsTo); 39191// EXTERNAL MODULE: ./node_modules/lodash/isObject.js 39192var isObject = __webpack_require__(23805); 39193// EXTERNAL MODULE: ./node_modules/lodash/isNumber.js 39194var isNumber = __webpack_require__(98023); 39195;// ./node_modules/redux-injectors-19/dist/index.esm.js 39196/* unused harmony import specifier */ var React; 39197/* unused harmony import specifier */ var hoistNonReactStatics; 39198/* unused harmony import specifier */ var ReactReduxContext; 39199/* unused harmony import specifier */ var useStore; 39200/* unused harmony import specifier */ var invariant; 39201/* unused harmony import specifier */ var index_esm_isEmpty; 39202/* unused harmony import specifier */ var index_esm_isFunction; 39203/* unused harmony import specifier */ var index_esm_isString; 39204/* unused harmony import specifier */ var index_esm_conformsTo; 39205/* unused harmony import specifier */ var index_esm_isObject; 39206/* unused harmony import specifier */ var index_esm_isNumber; 39207 39208 39209 39210 39211 39212 39213 39214 39215 39216 39217 39218/** 39219 * Forces a reload of the injected reducers. i.e. Causes `createReducer` to be 39220 * called again with the injected reducers. Useful for hot-reloading. 39221 * 39222 * @param store The redux store that has been configured with 39223 * `createInjectorsEnhancer` 39224 * @example 39225 * forceReducerReload(store); 39226 * 39227 * @public 39228 */ 39229function forceReducerReload(store) { 39230 store.replaceReducer(store.createReducer(store.injectedReducers)); 39231} 39232 39233function _arrayLikeToArray(r, a) { 39234 (null == a || a > r.length) && (a = r.length); 39235 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; 39236 return n; 39237} 39238function _arrayWithHoles(r) { 39239 if (Array.isArray(r)) return r; 39240} 39241function _assertThisInitialized(e) { 39242 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 39243 return e; 39244} 39245function _callSuper(t, o, e) { 39246 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); 39247} 39248function _classCallCheck(a, n) { 39249 if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); 39250} 39251function _defineProperties(e, r) { 39252 for (var t = 0; t < r.length; t++) { 39253 var o = r[t]; 39254 o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); 39255 } 39256} 39257function _createClass(e, r, t) { 39258 return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { 39259 writable: !1 39260 }), e; 39261} 39262function _defineProperty(e, r, t) { 39263 return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { 39264 value: t, 39265 enumerable: !0, 39266 configurable: !0, 39267 writable: !0 39268 }) : e[r] = t, e; 39269} 39270function _getPrototypeOf(t) { 39271 return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { 39272 return t.__proto__ || Object.getPrototypeOf(t); 39273 }, _getPrototypeOf(t); 39274} 39275function _inherits(t, e) { 39276 if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); 39277 t.prototype = Object.create(e && e.prototype, { 39278 constructor: { 39279 value: t, 39280 writable: !0, 39281 configurable: !0 39282 } 39283 }), Object.defineProperty(t, "prototype", { 39284 writable: !1 39285 }), e && _setPrototypeOf(t, e); 39286} 39287function _isNativeReflectConstruct() { 39288 try { 39289 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); 39290 } catch (t) {} 39291 return (_isNativeReflectConstruct = function () { 39292 return !!t; 39293 })(); 39294} 39295function _iterableToArrayLimit(r, l) { 39296 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; 39297 if (null != t) { 39298 var e, 39299 n, 39300 i, 39301 u, 39302 a = [], 39303 f = !0, 39304 o = !1; 39305 try { 39306 if (i = (t = t.call(r)).next, 0 === l) { 39307 if (Object(t) !== t) return; 39308 f = !1; 39309 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); 39310 } catch (r) { 39311 o = !0, n = r; 39312 } finally {
39313 try { 39314 if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; 39315 } finally { 39316 if (o) throw n; 39317 } 39318 } 39319 return a; 39320 } 39321} 39322function _nonIterableRest() { 39323 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 39324} 39325function ownKeys(e, r) { 39326 var t = Object.keys(e); 39327 if (Object.getOwnPropertySymbols) { 39328 var o = Object.getOwnPropertySymbols(e); 39329 r && (o = o.filter(function (r) { 39330 return Object.getOwnPropertyDescriptor(e, r).enumerable; 39331 })), t.push.apply(t, o); 39332 } 39333 return t; 39334} 39335function _objectSpread2(e) { 39336 for (var r = 1; r < arguments.length; r++) { 39337 var t = null != arguments[r] ? arguments[r] : {}; 39338 r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { 39339 _defineProperty(e, r, t[r]); 39340 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { 39341 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); 39342 }); 39343 } 39344 return e; 39345} 39346function _possibleConstructorReturn(t, e) { 39347 if (e && ("object" == typeof e || "function" == typeof e)) return e; 39348 if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); 39349 return _assertThisInitialized(t); 39350} 39351function _setPrototypeOf(t, e) { 39352 return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { 39353 return t.__proto__ = e, t; 39354 }, _setPrototypeOf(t, e); 39355} 39356function _slicedToArray(r, e) { 39357 return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); 39358} 39359function _toPrimitive(t, r) { 39360 if ("object" != typeof t || !t) return t; 39361 var e = t[Symbol.toPrimitive]; 39362 if (void 0 !== e) { 39363 var i = e.call(t, r || "default"); 39364 if ("object" != typeof i) return i; 39365 throw new TypeError("@@toPrimitive must return a primitive value."); 39366 } 39367 return ("string" === r ? String : Number)(t); 39368} 39369function _toPropertyKey(t) { 39370 var i = _toPrimitive(t, "string"); 39371 return "symbol" == typeof i ? i : i + ""; 39372} 39373function _unsupportedIterableToArray(r, a) { 39374 if (r) { 39375 if ("string" == typeof r) return _arrayLikeToArray(r, a); 39376 var t = {}.toString.call(r).slice(8, -1); 39377 return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; 39378 } 39379} 39380 39381/** 39382 * Validates the redux store is set up properly to work with this library. 39383 */ 39384function checkStore(store) { 39385 var shape = { 39386 dispatch: index_esm_isFunction, 39387 subscribe: index_esm_isFunction, 39388 getState: index_esm_isFunction, 39389 replaceReducer: index_esm_isFunction, 39390 runSaga: index_esm_isFunction, 39391 createReducer: index_esm_isFunction, 39392 injectedReducers: index_esm_isObject, 39393 injectedSagas: index_esm_isObject 39394 }; 39395 invariant(index_esm_conformsTo(store, shape), '(redux-injectors...) checkStore: Expected a redux store that has been configured for use with redux-injectors.'); 39396} 39397 39398function injectReducerFactory(store, isValid) { 39399 return function injectReducer(key, reducer) { 39400 if (!isValid) checkStore(store); 39401 invariant(index_esm_isString(key) && !index_esm_isEmpty(key) && index_esm_isFunction(reducer), '(redux-injectors...) injectReducer: Expected `reducer` to be a reducer function'); 39402 39403 // Check `store.injectedReducers[key] === reducer` for hot reloading when a key is the same but a reducer is different 39404 if (Reflect.has(store.injectedReducers, key) && store.injectedReducers[key] === reducer) return; 39405 store.injectedReducers[key] = reducer; // eslint-disable-line no-param-reassign 39406 store.replaceReducer(store.createReducer(store.injectedReducers)); 39407 }; 39408} 39409function getInjectors$1(store) { 39410 checkStore(store); 39411 return { 39412 injectReducer: injectReducerFactory(store, true) 39413 }; 39414} 39415 39416/** 39417 * A higher-order component that dynamically injects a reducer when the 39418 * component is instantiated 39419 * 39420 * @param {Object} params 39421 * @param {string} params.key The key to inject the reducer under 39422 * @param {function} params.reducer The reducer that will be injected 39423 * 39424 * @example 39425 * 39426 * class BooksManager extends React.PureComponent { 39427 * render() { 39428 * return null; 39429 * } 39430 * } 39431 * 39432 * export default injectReducer({ key: "books", reducer: booksReducer })(BooksManager) 39433 * 39434 * @public 39435 */ 39436var injectReducer = (function (_ref) { 39437 var key = _ref.key, 39438 reducer = _ref.reducer; 39439 return function (WrappedComponent) { 39440 var ReducerInjector = /*#__PURE__*/function (_React$Component) { 39441 function ReducerInjector(props, context) { 39442 var _this; 39443 _classCallCheck(this, ReducerInjector); 39444 _this = _callSuper(this, ReducerInjector, [props, context]); 39445 getInjectors$1(context.store).injectReducer(key, reducer); 39446 return _this; 39447 } 39448 _inherits(ReducerInjector, _React$Component); 39449 return _createClass(ReducerInjector, [{ 39450 key: "render", 39451 value: function render() { 39452 return /*#__PURE__*/React.createElement(WrappedComponent, this.props); 39453 } 39454 }]); 39455 }(React.Component); 39456 _defineProperty(ReducerInjector, "WrappedComponent", WrappedComponent); 39457 _defineProperty(ReducerInjector, "contextType", ReactReduxContext); 39458 _defineProperty(ReducerInjector, "displayName", "withReducer(".concat(WrappedComponent.displayName || WrappedComponent.name || 'Component', ")")); 39459 return hoistNonReactStatics(ReducerInjector, WrappedComponent); 39460 }; 39461}); 39462 39463/** 39464 * A react hook that dynamically injects a reducer when the hook is run 39465 * 39466 * @param {Object} params 39467 * @param {string} params.key The key to inject the reducer under 39468 * @param {function} params.reducer The reducer that will be injected 39469 * 39470 * @example 39471 * 39472 * function BooksManager() { 39473 * useInjectReducer({ key: "books", reducer: booksReducer }) 39474 * 39475 * return null; 39476 * } 39477 * 39478 * @returns {boolean} flag indicating whether or not the reducer has finished injecting 39479 * @public 39480 */ 39481var useInjectReducer = function useInjectReducer(_ref2) { 39482 var key = _ref2.key, 39483 reducer = _ref2.reducer; 39484 var store = useStore(); 39485 var _React$useState = React.useState(false), 39486 _React$useState2 = _slicedToArray(_React$useState, 2), 39487 isInjected = _React$useState2[0], 39488 setIsInjected = _React$useState2[1]; 39489 React.useLayoutEffect(function () { 39490 getInjectors$1(store).injectReducer(key, reducer); 39491 setIsInjected(true); 39492 }, []); 39493 return isInjected; 39494}; 39495
39496var RESTART_ON_REMOUNT = '@@saga-injector/restart-on-remount'; 39497var DAEMON = '@@saga-injector/daemon'; 39498var ONCE_TILL_UNMOUNT = '@@saga-injector/once-till-unmount'; 39499var COUNTER = '@@saga-injector/counter'; 39500 39501/** 39502 * An enum of all the possible saga injection behaviours 39503 * 39504 * @property {String} RESTART_ON_REMOUNT The saga will be started on component instantiation and cancelled with 39505 * `task.cancel()` on component unmount for improved performance. 39506 * @property {String} DAEMON Causes the saga to be started on component instantiation and never canceled 39507 * or started again. 39508 * @property {String} ONCE_TILL_UNMOUNT Behaves like 'RESTART_ON_REMOUNT' but never runs it again. 39509 * @property {String} COUNTER Similar to 'RESTART_ON_REMOUNT' except the 39510 * saga will be mounted only once on first inject and ejected when all injectors are unmounted. 39511 * This enables you to have multiple injectors with the same saga and key and only one instance of the saga will run. 39512 * 39513 * @enum 39514 * @public 39515 */ 39516var SagaInjectionModes = { 39517 RESTART_ON_REMOUNT: RESTART_ON_REMOUNT, 39518 DAEMON: DAEMON, 39519 ONCE_TILL_UNMOUNT: ONCE_TILL_UNMOUNT, 39520 COUNTER: COUNTER 39521}; 39522 39523var allowedModes = [RESTART_ON_REMOUNT, DAEMON, ONCE_TILL_UNMOUNT, COUNTER]; 39524var checkKey = function checkKey(key) { 39525 return invariant(index_esm_isString(key) && !index_esm_isEmpty(key), '(redux-injectors...) injectSaga: Expected `key` to be a non empty string'); 39526}; 39527var checkDescriptor = function checkDescriptor(descriptor) { 39528 var shape = { 39529 saga: index_esm_isFunction, 39530 mode: function mode(_mode) { 39531 return index_esm_isString(_mode) && allowedModes.includes(_mode); 39532 }, 39533 count: index_esm_isNumber 39534 }; 39535 invariant(index_esm_conformsTo(descriptor, shape), '(redux-injectors...) injectSaga: Expected a valid saga descriptor'); 39536}; 39537function injectSagaFactory(store, isValid) { 39538 return function injectSaga(key) { 39539 var descriptor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 39540 if (!isValid) checkStore(store); 39541 var newDescriptor = _objectSpread2(_objectSpread2({}, descriptor), {}, { 39542 mode: descriptor.mode || DAEMON, 39543 count: 0 39544 }); 39545 var saga = newDescriptor.saga, 39546 mode = newDescriptor.mode; 39547 checkKey(key); 39548 checkDescriptor(newDescriptor); 39549 var hasSaga = Reflect.has(store.injectedSagas, key); 39550 if (false) // removed by dead control flow 39551{ var oldDescriptor; } 39552 if (mode === COUNTER) { 39553 // COUNTER must be added if saga is done 39554 if (store.injectedSagas[key] === 'done') hasSaga = false; 39555 var oldCounterValue = 0; 39556 if (hasSaga) { 39557 oldCounterValue = Math.max(store.injectedSagas[key].count || 0, 0); 39558 } 39559 newDescriptor.count = oldCounterValue + 1; 39560 } 39561 if (!hasSaga || hasSaga && mode !== DAEMON && mode !== ONCE_TILL_UNMOUNT && mode !== COUNTER) { 39562 /* eslint-disable no-param-reassign */ 39563 store.injectedSagas[key] = _objectSpread2(_objectSpread2({}, newDescriptor), {}, { 39564 task: store.runSaga(saga) 39565 }); 39566 /* eslint-enable no-param-reassign */ 39567 } else if (hasSaga && mode === COUNTER) { 39568 // increment num of sagas that wants to be injected 39569 /* eslint-disable no-param-reassign */ 39570 store.injectedSagas[key].count = newDescriptor.count; 39571 } 39572 }; 39573} 39574function ejectSagaFactory(store, isValid) { 39575 return function ejectSaga(key) { 39576 if (!isValid) checkStore(store); 39577 checkKey(key); 39578 if (Reflect.has(store.injectedSagas, key)) { 39579 var descriptor = store.injectedSagas[key]; 39580 if (!descriptor.mode) { 39581 return; 39582 } 39583 if (descriptor.mode === COUNTER) { 39584 descriptor.count -= 1; 39585 if (descriptor.count > 0) return; 39586 descriptor.task.cancel(); 39587 delete store.injectedSagas[key]; 39588 } else if (descriptor.mode !== DAEMON) { 39589 descriptor.task.cancel(); 39590 // Clean up in production; in development we need `descriptor.saga` for hot reloading 39591 if (true) { 39592 // Need some value to be able to detect `ONCE_TILL_UNMOUNT` sagas in `injectSaga` 39593 store.injectedSagas[key] = 'done'; // eslint-disable-line no-param-reassign 39594 } 39595 } 39596 } 39597 }; 39598} 39599function getInjectors(store) { 39600 checkStore(store); 39601 return { 39602 injectSaga: injectSagaFactory(store, true), 39603 ejectSaga: ejectSagaFactory(store, true) 39604 }; 39605} 39606 39607/** 39608 * A higher-order component that dynamically injects a saga when the component 39609 * is instantiated. There are several possible "modes" / "behaviours" that 39610 * dictate how and when the saga should be injected and ejected 39611 * 39612 * @param {Object} params 39613 * @param {string} params.key The key to inject the saga under
39614 * @param {function} params.saga The saga that will be injected 39615 * @param {string} [params.mode] The injection behaviour to use. The default is 39616 * `SagaInjectionModes.DAEMON` which causes the saga to be started on component 39617 * instantiation and never canceled or started again. @see 39618 * {@link SagaInjectionModes} for the other possible modes. 39619 * 39620 * @example 39621 * 39622 * class BooksManager extends React.PureComponent { 39623 * render() { 39624 * return null; 39625 * } 39626 * } 39627 * 39628 * export default injectSaga({ key: "books", saga: booksSaga })(BooksManager) 39629 * 39630 * @public 39631 * 39632 */ 39633var injectSaga = (function (_ref) { 39634 var key = _ref.key, 39635 saga = _ref.saga, 39636 mode = _ref.mode; 39637 return function (WrappedComponent) { 39638 var InjectSaga = /*#__PURE__*/function (_React$Component) { 39639 function InjectSaga(props, context) { 39640 var _this; 39641 _classCallCheck(this, InjectSaga); 39642 _this = _callSuper(this, InjectSaga, [props, context]); 39643 _this.injectors = getInjectors(context.store); 39644 _this.injectors.injectSaga(key, { 39645 saga: saga, 39646 mode: mode 39647 }); 39648 return _this; 39649 } 39650 _inherits(InjectSaga, _React$Component); 39651 return _createClass(InjectSaga, [{ 39652 key: "componentWillUnmount", 39653 value: function componentWillUnmount() { 39654 this.injectors.ejectSaga(key); 39655 } 39656 }, { 39657 key: "render", 39658 value: function render() { 39659 return /*#__PURE__*/React.createElement(WrappedComponent, this.props); 39660 } 39661 }]); 39662 }(React.Component); 39663 _defineProperty(InjectSaga, "WrappedComponent", WrappedComponent); 39664 _defineProperty(InjectSaga, "contextType", ReactReduxContext); 39665 _defineProperty(InjectSaga, "displayName", "withSaga(".concat(WrappedComponent.displayName || WrappedComponent.name || 'Component', ")")); 39666 return hoistNonReactStatics(InjectSaga, WrappedComponent); 39667 }; 39668}); 39669 39670/** 39671 * A react hook that dynamically injects a saga when the hook is run 39672 * 39673 * @param {Object} params 39674 * @param {string} params.key The key to inject the saga under 39675 * @param {function} params.saga The saga that will be injected 39676 * 39677 * @example 39678 * 39679 * function BooksManager() { 39680 * useInjectSaga({ key: "books", saga: booksSaga }) 39681 * 39682 * return null; 39683 * } 39684 * 39685 * @returns {boolean} flag indicating whether or not the saga has finished injecting 39686 * @public 39687 */ 39688var useInjectSaga = function useInjectSaga(_ref2) { 39689 var key = _ref2.key, 39690 saga = _ref2.saga; 39691 var store = useStore(); 39692 var _React$useState = React.useState(false), 39693 _React$useState2 = _slicedToArray(_React$useState, 2), 39694 isInjected = _React$useState2[0], 39695 setIsInjected = _React$useState2[1]; 39696 React.useLayoutEffect(function () { 39697 getInjectors(store).injectSaga(key, { 39698 saga: saga, 39699 mode: SagaInjectionModes.COUNTER 39700 }); 39701 setIsInjected(true); 39702 return function () { 39703 getInjectors(store).ejectSaga(key); 39704 }; 39705 }, []); 39706 return isInjected; 39707}; 39708 39709/** 39710 * Creates a store enhancer that when applied will setup the store to allow the 39711 * injectors to work properly 39712 * 39713 * @param {Object} params 39714 * @param {function} params.runSaga A function that runs a saga. Should usually be `sagaMiddleware.run` 39715 * @param {function} params.createReducer A function that should create and 39716 * return the root reducer. It's passed the injected reducers as the first 39717 * parameter. These should be added to the root reducer using `combineReducer` 39718 * or a similar method. 39719 * 39720 * @example 39721 * 39722 * import { createStore } from "redux" 39723 * import { createInjectorsEnhancer } from "redux-injectors" 39724 * 39725 * function createReducer(injectedReducers = {}) { 39726 * const rootReducer = combineReducers({ 39727 * ...injectedReducers, 39728 * // other non-injected reducers can go here... 39729 * }); 39730 * 39731 * return rootReducer 39732 * } 39733 * const runSaga = sagaMiddleware.run 39734 * 39735 * const store = createStore( 39736 * createReducer(), 39737 * initialState, 39738 * createInjectorsEnhancer({ 39739 * createReducer, 39740 * runSaga, 39741 * }) 39742 * ) 39743 * 39744 * @public 39745 */ 39746function createInjectorsEnhancer(params) { 39747 browser_default()(conformsTo_default()(params, { 39748 runSaga: (isFunction_default()), 39749 createReducer: (isFunction_default()) 39750 }), '(redux-injectors...) createInjectorsEnhancer: params `runSaga` and ' + '`createReducer` are required.'); 39751 return function (createStore) { 39752 return function () { 39753 var store = createStore.apply(void 0, arguments);
39754 return _objectSpread2(_objectSpread2({}, store), {}, { 39755 createReducer: params.createReducer, 39756 runSaga: params.runSaga, 39757 injectedReducers: {}, 39758 // Reducer registry 39759 injectedSagas: {} // Saga registry 39760 }); 39761 }; 39762 }; 39763} 39764 39765/** 39766 * Creates a "manager" component that will inject the provided reducer and saga 39767 * when mounted. It only renders its children after both the reducer and saga 39768 * have been injected. This is the recommended way to use redux-injectors. 39769 * 39770 * @param {Object} options 39771 * @param {string} options.name The name to give the manager that shows up in the react devtools 39772 * @param {string} options.key The key to inject the reducer under 39773 * @param {function} [options.reducer] The reducer that will be injected 39774 * @param {function} [options.saga] The saga that will be injected 39775 * 39776 * @example 39777 * 39778 * const BooksManager = createManager({ name: "BooksManager", key: "books", reducer: booksReducer, saga: booksSaga }) 39779 * 39780 * @returns {ComponentType<{ children: ReactNode }>} The manager 39781 * @public 39782 */ 39783function createManager(_ref) { 39784 var name = _ref.name, 39785 key = _ref.key, 39786 reducer = _ref.reducer, 39787 saga = _ref.saga; 39788 function Manager(props) { 39789 /* eslint-disable react-hooks/rules-of-hooks */ 39790 39791 var isReducerInjected = reducer ? useInjectReducer({ 39792 key: key, 39793 reducer: reducer 39794 }) : true; 39795 var isSagaInjected = saga ? useInjectSaga({ 39796 key: key, 39797 saga: saga 39798 }) : true; 39799 39800 /* eslint-enable */ 39801 39802 return isReducerInjected && isSagaInjected ? props.children : null; 39803 } 39804 Manager.displayName = name; 39805 return Manager; 39806} 39807 39808 39809 39810// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/slice-C6JLQik8.js + 1 modules 39811var slice_C6JLQik8 = __webpack_require__(60218); 39812// EXTERNAL MODULE: ./node_modules/immer/dist/immer.mjs 39813var immer = __webpack_require__(73575); 39814// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/selectors-Dj45vPZR.js 39815var selectors_Dj45vPZR = __webpack_require__(23790); 39816// EXTERNAL MODULE: ./node_modules/@redux-saga/core/dist/redux-saga-effects.esm.js 39817var redux_saga_effects_esm = __webpack_require__(85118); 39818;// ./node_modules/@zengenti/contensis-react-base/esm/store-Cxe7mlLh.js 39819 39820 39821 39822 39823 39824 39825 39826 39827 39828const ACTION_PREFIX = '@NAVIGATION/'; 39829const GET_NODE_TREE = `${ACTION_PREFIX}_GET_NODE_TREE`; 39830const SET_NODE_TREE = `${ACTION_PREFIX}_SET_NODE_TREE`; 39831const GET_NODE_TREE_ERROR = `${ACTION_PREFIX}_GET_NODE_TREE_ERROR`; 39832 39833var navigation = /*#__PURE__*/Object.freeze({ 39834 __proto__: null, 39835 GET_NODE_TREE: GET_NODE_TREE, 39836 GET_NODE_TREE_ERROR: GET_NODE_TREE_ERROR, 39837 SET_NODE_TREE: SET_NODE_TREE 39838}); 39839 39840const initialState$2 = { 39841 root: null, 39842 error: { 39843 isError: false, 39844 message: null 39845 }, 39846 isReady: false 39847}; 39848var NavigationReducer = (0,immer/* produce */.jM)((state, action) => { 39849 switch (action.type) { 39850 case SET_NODE_TREE: 39851 { 39852 state.root = action.nodes; 39853 state.isReady = true; 39854 return; 39855 } 39856 case GET_NODE_TREE_ERROR: 39857 { 39858 state.error.isError = true; 39859 state.error.message = action.error || 'Unknown error occurred'; 39860 return; 39861 } 39862 default: 39863 return; 39864 } 39865}, initialState$2); 39866 39867const initialState$1 = { 39868 canonicalPath: null, 39869 currentHostname: null, 39870 currentPath: '/', 39871 currentNode: {}, 39872 currentNodeAncestors: [], 39873 currentProject: 'unknown', 39874 entryID: null, 39875 entry: null, 39876 error: undefined, 39877 isError: false, 39878 isLoading: false, 39879 isLivePreview: false, 39880 location: {}, 39881 mappedEntry: null, 39882 notFound: false, 39883 ssrHostname: null, 39884 staticRoute: null, 39885 statusCode: 200, 39886 surrogateKeys: [], 39887 apiCalls: [] 39888}; 39889var RoutingReducer = (0,immer/* produce */.jM)((state, action) => { 39890 switch (action.type) { 39891 case selectors_Dj45vPZR.S: 39892 { 39893 state.currentNodeAncestors = action.ancestors; 39894 return; 39895 } 39896 case selectors_Dj45vPZR.q: 39897 { 39898 const { 39899 entry, 39900 error, 39901 mappedEntry, 39902 node = {}, 39903 isError = false, 39904 isLoading = false, 39905 notFound = false, 39906 statusCode, 39907 currentPath 39908 } = action; 39909 let defaultStatus = 200; 39910 if (notFound === true && isError === false) defaultStatus = 404;else if (isError === true) defaultStatus = statusCode || 500; 39911 if (!entry) { 39912 state.entryID = null; 39913 state.entry = null; 39914 state.error = error; 39915 state.mappedEntry = null; 39916 state.isError = isError; 39917 state.isLoading = isLoading; 39918 state.notFound = notFound; 39919 state.statusCode = statusCode || defaultStatus; 39920 state.canonicalPath = currentPath; 39921 } else { 39922 state.entryID = action.id; 39923 state.entry = entry; 39924 state.error = error; 39925 state.isError = isError; 39926 state.isLoading = isLoading; 39927 state.notFound = notFound; 39928 state.statusCode = statusCode || defaultStatus; 39929 state.canonicalPath = entry.sys.uri || currentPath; 39930 if (mappedEntry && Object.keys(mappedEntry).length > 0) { 39931 state.mappedEntry = mappedEntry; 39932 // Don't truncate the raw entry data when in live preview mode, 39933 // as we want to be able to update it with new "patch" data coming 39934 // passed in via the live preview iframe. 39935 // In regular routes, the full entry data is not needed after mapping. 39936 if (!state.isLivePreview) state.entry = { 39937 sys: entry.sys 39938 }; 39939 } 39940 } 39941 if (!node) { 39942 state.currentNode = null; 39943 } else { 39944 // On Set Node, we reset all dependants. 39945 state.currentNode = node; 39946 // eslint-disable-next-line @typescript-eslint/no-unused-vars 39947 const { 39948 entry, 39949 ...nodeWithoutEntry 39950 } = node; // We have the entry stored elsewhere, so lets not keep it twice. 39951 state.currentNode = nodeWithoutEntry; 39952 } 39953 return; 39954 } 39955 case selectors_Dj45vPZR.U: 39956 { 39957 state.isLoading = action.isLoading; 39958 return; 39959 } 39960 case selectors_Dj45vPZR.r: 39961 { 39962 let staticRoute = {}; 39963 if (action.staticRoute) { 39964 staticRoute = { 39965 ...action.staticRoute 39966 }; 39967 } 39968 if (action.path) { 39969 var _state$entry; 39970 // Don't run a path update on initial load as we allready should have it in redux 39971 const entryUri = state === null || state === void 0 || (_state$entry = state.entry) === null || _state$entry === void 0 || (_state$entry = _state$entry.sys) === null || _state$entry === void 0 ? void 0 : _state$entry.uri; 39972 if (entryUri !== action.path) { 39973 state.currentPath = action.path; 39974 state.location = action.location; 39975 state.staticRoute = { 39976 ...staticRoute, 39977 route: { 39978 ...staticRoute.route, 39979 element: null 39980 } 39981 }; 39982 state.isLoading = typeof window !== 'undefined'; 39983 } else { 39984 state.location = action.location; 39985 state.staticRoute = { 39986 ...staticRoute, 39987 route: { 39988 ...staticRoute.route, 39989 element: null 39990 } 39991 }; 39992 } 39993 } 39994 // The default value is false, but if we've activated live preview for this route, 39995 // we want it to persist for the life of the session so we don't reset it back to 39996 // false on subsequent CSR navigation. 39997 if (action.location.search.includes('livePreview=true')) { 39998 state.isLivePreview = true; 39999 } 40000 return; 40001 } 40002 case selectors_Dj45vPZR.s: 40003 {
40004 state.nextPath = action.path; 40005 return; 40006 } 40007 case selectors_Dj45vPZR.t: 40008 { 40009 // Can be null in some cases like the homepage. 40010 let currentNodeSiblingParent = null; 40011 if (action.siblings && action.siblings.length > 0) { 40012 currentNodeSiblingParent = action.siblings[0].parentId; 40013 } 40014 state.currentNodeSiblings = action.siblings; 40015 state.currentNodeSiblingsParent = currentNodeSiblingParent; 40016 return; 40017 } 40018 case selectors_Dj45vPZR.o: 40019 { 40020 const { 40021 surrogateKeys, 40022 type: _type, 40023 ...call 40024 } = action; 40025 if (call.context === 'ssr' && (surrogateKeys === null || surrogateKeys === void 0 ? void 0 : surrogateKeys.length) > 0) { 40026 const allKeys = [...(state.surrogateKeys || []), ...surrogateKeys]; 40027 state.surrogateKeys = [...new Set(allKeys)]; 40028 call.surrogateKeys = surrogateKeys; 40029 } 40030 state.apiCalls = [...(state.apiCalls || []), call]; 40031 return; 40032 } 40033 case selectors_Dj45vPZR.u: 40034 { 40035 state.currentProject = action.project; 40036 state.allowedGroups = action.allowedGroups; 40037 state.ssrHostname = state.currentHostname || action.hostname; 40038 state.currentHostname = action.hostname; 40039 return; 40040 } 40041 default: 40042 return state; 40043 } 40044}, initialState$1); 40045 40046const VERSION_PREFIX = '@VERSION/'; 40047const SET_VERSION = `${VERSION_PREFIX}SET_VERSION`; 40048const SET_VERSION_STATUS = `${VERSION_PREFIX}SET_VERSION_STATUS`; 40049 40050var version = /*#__PURE__*/Object.freeze({ 40051 __proto__: null, 40052 SET_VERSION: SET_VERSION, 40053 SET_VERSION_STATUS: SET_VERSION_STATUS 40054}); 40055 40056const initialState = { 40057 commitRef: null, 40058 buildNo: null, 40059 contensisVersionStatus: null 40060}; 40061var VersionReducer = (0,immer/* produce */.jM)((state, action) => { 40062 switch (action.type) { 40063 case SET_VERSION_STATUS: 40064 { 40065 state.contensisVersionStatus = action.status; 40066 return; 40067 } 40068 case SET_VERSION: 40069 { 40070 state.commitRef = action.commitRef; 40071 state.buildNo = action.buildNo; 40072 return; 40073 } 40074 default: 40075 return; 40076 } 40077}, initialState); 40078 40079const wrapSagasInGenerator = function (sagas) { 40080 if (Array.isArray(sagas)) return function* rootSaga() { 40081 yield (0,redux_saga_effects_esm/* all */.Q7)(sagas); 40082 }; 40083 return sagas; 40084}; 40085 40086/** 40087 * This middleware captures 'CALL_HISTORY_METHOD' actions to redirect to the 40088 * provided history object. This will prevent these actions from reaching your 40089 * reducer or any middleware that comes after this one. 40090 */ 40091/* eslint-disable no-unused-vars */ 40092const routerMiddleware = history => store => next => action => { 40093 if (action.type !== 'CALL_HISTORY_METHOD') { 40094 return next(action); 40095 } 40096 const { 40097 payload: { 40098 method, 40099 args 40100 } 40101 } = action; 40102 history[method](...args); 40103}; 40104 40105/** A no-op reducer to serve for server-rendered reducers 40106 * that are re-injected client-side */ 40107const stubReducer = (state = null) => state; 40108let reduxStore; 40109var createStore = async (featureReducers, initialState, history, stateType) => { 40110 let reduxDevToolsMiddleware = f => f; 40111 if (typeof window != 'undefined') { 40112 reduxDevToolsMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f; 40113 } 40114 const sagaMiddleware = (0,redux_saga_core_npm_proxy_esm/* default */.Ay)(); 40115 const reducers = { 40116 i18n: slice_C6JLQik8.i.reducer, 40117 navigation: NavigationReducer, 40118 routing: RoutingReducer, 40119 user: selectors_Dj45vPZR.v, 40120 version: VersionReducer, 40121 ...featureReducers 40122 }; 40123 40124 // Reassign the combiner and fromJS functions when 40125 // stateType is 'immutable' with dynamic imports 40126 let combiner = redux/* combineReducers */.HY; 40127 let fromJS = obj => obj; 40128 globalThis.STATE_TYPE = stateType; 40129 if (stateType === 'immutable') { 40130 globalThis.immutable = await __webpack_require__.e(/* import() | immutable */ 95197).then(__webpack_require__.bind(__webpack_require__, 49568)); 40131 fromJS = (await Promise.all(/* import() | from-js */[__webpack_require__.e(95197), __webpack_require__.e(64557)]).then(__webpack_require__.bind(__webpack_require__, 72632))).default; 40132 combiner = (await Promise.all(/* import() | redux-immutable */[__webpack_require__.e(95197), __webpack_require__.e(52608)]).then(__webpack_require__.bind(__webpack_require__, 89593))).combineReducers; 40133 } 40134 const createReducer = (injectedReducers = {}) => {
40135 const rootReducer = combiner({ 40136 ...injectedReducers, 40137 // other non-injected reducers go here 40138 ...reducers 40139 }); 40140 return rootReducer; 40141 }; 40142 const store = initialState => { 40143 const runSaga = sagaMiddleware.run; 40144 40145 // Track the initial set of sagas here 40146 const initialSagas = new Set(); 40147 40148 // Patch the runSaga function to capture and track the sagas 40149 // passed as a raw array of effects 40150 const patchedRunSaga = sagas => { 40151 // Only track the saga the first time it is run 40152 if (Array.isArray(sagas)) { 40153 for (const saga of sagas) if (!initialSagas.has(saga)) { 40154 initialSagas.add(saga); 40155 } 40156 } else { 40157 if (!initialSagas.has(sagas)) { 40158 initialSagas.add(sagas); 40159 } 40160 } 40161 const rootSaga = wrapSagasInGenerator(sagas); 40162 40163 // Run the saga as usual 40164 return runSaga(rootSaga); 40165 }; 40166 40167 // Assign stub reducers for any missing reducers that have been 40168 // injected server-side and will be re-injected client-side 40169 const injectReducers = {}; 40170 for (const key of Object.keys(initialState || {})) { 40171 if (!(key in reducers)) injectReducers[key] = stubReducer; 40172 } 40173 const middleware = (0,redux/* compose */.Zz)((0,redux/* applyMiddleware */.Tw)(thunk, sagaMiddleware, routerMiddleware(history)), createInjectorsEnhancer({ 40174 createReducer, 40175 // Assign patched runSaga to store 40176 runSaga 40177 }), reduxDevToolsMiddleware); 40178 const store = (0,redux/* createStore */.y$)(createReducer(injectReducers), initialState, middleware); 40179 store.runSaga = patchedRunSaga; // Assign patched runSaga to the store 40180 store.close = () => store.dispatch(redux_saga_core_npm_proxy_esm/* END */.Kp); 40181 store.initialSagas = initialSagas; // Store the initial sagas set 40182 40183 return store; 40184 }; 40185 reduxStore = store(fromJS(initialState)); 40186 return reduxStore; 40187}; 40188 40189 40190//# sourceMappingURL=store-Cxe7mlLh.js.map 40191 40192 40193/***/ }, 40194 40195/***/ 12846 40196(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 40197 40198"use strict"; 40199/* harmony export */ __webpack_require__.d(__webpack_exports__, { 40200/* harmony export */ a: () => (/* binding */ areArraysEqualSets), 40201/* harmony export */ b: () => (/* binding */ cleanseFieldIdForAggregation), 40202/* harmony export */ c: () => (/* binding */ callCustomApi), 40203/* harmony export */ d: () => (/* binding */ convertKeyForAggregation), 40204/* harmony export */ e: () => (/* binding */ extractQuotedPhrases), 40205/* harmony export */ f: () => (/* binding */ fixFreeTextForElastic), 40206/* harmony export */ g: () => (/* binding */ getItemsFromResult), 40207/* harmony export */ h: () => (/* binding */ routeParams), 40208/* harmony export */ i: () => (/* binding */ toArray), 40209/* harmony export */ r: () => (/* binding */ removeEmptyAttributes), 40210/* harmony export */ t: () => (/* binding */ timedSearch) 40211/* harmony export */ }); 40212/* harmony import */ var query_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17276); 40213/* harmony import */ var _ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22255); 40214 40215 40216 40217const now = () => { 40218 if (typeof window == 'undefined') { 40219 return Date.now(); 40220 } 40221 return window.performance.now(); 40222}; 40223 40224// [query-string v8+] When upgrading to v8+: ESM-only, no default export, requires Node >=20.19.0 40225function fixFreeTextForElastic(s) { 40226 const illegalChars = ['>', '<', '=', '|', '!', '{', '}', '[', ']', '^', '~', '*', '?', ':', '\\', '/']; 40227 const illegalRegEx = new RegExp(illegalChars.map(c => '\\' + c).join('|'), 'g'); 40228 s = s.replace(illegalRegEx, ''); 40229 // s = s.replace(encodedRegEx, ''); // (m) => '\\\\' + m); 40230 40231 return s; 40232} 40233/** `convertKeyForAggregation` and `parseKeyForAggregation` exists to prevent an 40234 * auto-generated aggregation using a reserved keyword because Elasticsearch has a list of 40235 * reserved keywords when it parses the response: 40236 * `'location' is one of the reserved aggregation keywords we use a heuristics based 40237 * response parser and using these reserved keywords could throw its heuristics off 40238 * course. We are working on a solution in Elasticsearch itself to make the response 40239 * parseable. For now these are all the reserved keywords: after_key, _as_string, 40240 * bg_count, bottom_right, bounds, buckets, count, doc_count, doc_count_error_upper_bound, 40241 * fields, from, top, type, from_as_string, hits, key, key_as_string, keys, location, 40242 * max_score, meta, min, min_length, score, sum_other_doc_count, to, to_as_string, top_left, 40243 * total, value, value_as_string, values, geometry, properties` 40244 */ 40245const convertKeyForAggregation = key => `sf_${key}`; 40246const cleanseFieldIdForAggregation = fieldId => fieldId.replaceAll('[]', ''); 40247const timedSearch = async (query, linkDepth = 0, projectId, 40248// get api instance from SSR context that is connected to the current request in SSR, 40249// fall back to the imported cachedSearch api that is not connected to the current SSR context 40250ssr = { 40251 api: _ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_1__.c 40252}) => { 40253 if (!query) return null; 40254 let duration = 0; 40255 const start = now(); 40256 const payload = await ssr.api.search(query, linkDepth, projectId); 40257 const end = now(); 40258 duration = Number((end - start).toFixed(2)); 40259 return { 40260 duration, 40261 payload 40262 }; 40263}; 40264const getItemsFromResult = result => { 40265 const { 40266 payload 40267 } = result || {}; 40268 if (payload) { 40269 if (Array.isArray(payload)) return payload; 40270 if (Array.isArray(payload.items)) return payload.items; 40271 return payload; 40272 } 40273 return []; 40274}; 40275const extractQuotedPhrases = searchTerm => { 40276 const pattern = new RegExp(/(?=["'])(?:"[^"\\]*(?:\\[\s\S][^"\\]*)*"|'[^'\\]*(?:\\[\s\S][^'\\]*)*')/gm); 40277 return (searchTerm.match(pattern) || []).map(match => match.replace(/"/g, '')); 40278}; 40279const buildUrl = (route, params) => { 40280 // [query-string v6+] BEHAVIOUR CHANGE: sort defaults to true â output key order is now alphabetical. 40281 // Pass { sort: false } if URL key order matters for cache keys or string comparison downstream. 40282 const qs = (0,query_string__WEBPACK_IMPORTED_MODULE_0__.stringify)(params); 40283 const path = qs ? `${route}${route.includes('?') ? '&' : '?'}${qs}` : route; 40284 return path; 40285}; 40286 40287/** 40288 * Returns all params from the current route query string or static route 40289 * Supply static route argument if reading parameters from the route path 40290 * Supply location argument for the params to be read in SSR 40291 * @param staticRoute Matched static route from react-router 5 or 6
40292 * @param location location object containing at least pathname and search 40293 * @returns Keyed params object 40294 */ 40295const routeParams = (staticRoute, location) => { 40296 var _staticRoute$match; 40297 // match.params is react-router-config/react-router@5 style 40298 // params is supplied with RouteObject in react-router@6 40299 const pathParams = (staticRoute === null || staticRoute === void 0 || (_staticRoute$match = staticRoute.match) === null || _staticRoute$match === void 0 ? void 0 : _staticRoute$match.params) || (staticRoute === null || staticRoute === void 0 ? void 0 : staticRoute.params) || {}; 40300 const queryParams = (0,query_string__WEBPACK_IMPORTED_MODULE_0__.parse)(typeof window !== 'undefined' ? window.location.search : (location === null || location === void 0 ? void 0 : location.search) || ''); 40301 return { 40302 ...pathParams, 40303 ...queryParams 40304 }; 40305}; 40306const callCustomApi = async (customApi, filters, 40307// get api instance from SSR context that is connected to the current request in SSR, 40308// fall back to the imported cachedSearch api that is not connected to the current SSR context 40309ssr = { 40310 api: _ContensisDeliveryApi_Czq1gBOi_js__WEBPACK_IMPORTED_MODULE_1__.c 40311}) => { 40312 const apiUri = customApi.uri || ''; 40313 let uri = buildUrl(apiUri, filters); 40314 if (!uri) throw new Error('uri is required to use customApi'); 40315 if (typeof window == 'undefined') { 40316 if (!uri.startsWith('http')) uri = `http://localhost:3001${uri}`; 40317 const response = await fetch(uri); 40318 return await response.json(); 40319 } 40320 const response = await ssr.api.fetch(uri); 40321 return await response.clone().json(); 40322}; 40323const removeEmptyAttributes = obj => { 40324 Object.entries(obj).forEach(([key, val]) => val && typeof val === 'object' && removeEmptyAttributes(val) || (typeof val === 'undefined' || val === null || val === '') && delete obj[key]); 40325 return obj; 40326}; 40327const toArray = (obj, seperator = ',') => typeof obj === 'undefined' || obj === null ? obj : Array.isArray(obj) ? obj : obj.split(seperator); 40328 40329// assumes array elements are primitive types 40330const areArraysEqualSets = (a1, a2) => { 40331 const superSet = {}; 40332 for (const ai of a1) { 40333 const e = ai + typeof ai; 40334 superSet[e] = 1; 40335 } 40336 for (const ai of a2) { 40337 const e = ai + typeof ai; 40338 if (!superSet[e]) { 40339 return false; 40340 } 40341 superSet[e] = 2; 40342 } 40343 for (const e in superSet) { 40344 if (superSet[e] === 1) { 40345 return false; 40346 } 40347 } 40348 return true; 40349}; 40350 40351 40352//# sourceMappingURL=util-DHWbLSvO.js.map 40353 40354 40355/***/ }, 40356 40357/***/ 73580 40358(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 40359 40360"use strict";
40361// ESM COMPAT FLAG 40362__webpack_require__.r(__webpack_exports__); 40363 40364// EXPORTS 40365__webpack_require__.d(__webpack_exports__, { 40366 Helmet: () => (/* reexport */ index_esm/* Helmet */.mg), 40367 HelmetProvider: () => (/* reexport */ index_esm/* HelmetProvider */.vd), 40368 NoSSR: () => (/* binding */ NoSSR), 40369 SSRContextProvider: () => (/* reexport */ SSRContext_DqqZUlqT.S), 40370 VersionInfo: () => (/* reexport */ VersionInfo_BinQYaU1.V), 40371 cachedSearch: () => (/* reexport */ ContensisDeliveryApi_Czq1gBOi.c), 40372 cachedSearchWithContext: () => (/* reexport */ ContensisDeliveryApi_Czq1gBOi.a), 40373 cachedSearchWithCookies: () => (/* reexport */ ContensisDeliveryApi_Czq1gBOi.b), 40374 deliveryApi: () => (/* reexport */ ContensisDeliveryApi_Czq1gBOi.d), 40375 deliveryApiWithCookies: () => (/* reexport */ ContensisDeliveryApi_Czq1gBOi.e), 40376 entryMapper: () => (/* binding */ entryMapper), 40377 getClientConfig: () => (/* reexport */ ContensisDeliveryApi_Czq1gBOi.g), 40378 getSubsitePath: () => (/* reexport */ SSRContext_DqqZUlqT.g), 40379 jpath: () => (/* reexport */ jsonpath_mapper/* jpath */.oA), 40380 mapComposer: () => (/* binding */ mapComposer), 40381 mapEntries: () => (/* binding */ mapEntries), 40382 mapJson: () => (/* reexport */ jsonpath_mapper/* default */.Ay), 40383 setCachingHeaders: () => (/* reexport */ setCachingHeaders), 40384 stringifyStrings: () => (/* reexport */ VersionInfo_BinQYaU1.s), 40385 urls: () => (/* reexport */ urls), 40386 useComposerMapper: () => (/* binding */ useComposerMapper), 40387 useDeliveryApi: () => (/* reexport */ SSRContext_DqqZUlqT.u), 40388 useEntriesMapper: () => (/* binding */ useEntriesMapper), 40389 useEntryMapper: () => (/* binding */ useEntryMapper), 40390 useHistory: () => (/* binding */ useHistory), 40391 useIsClient: () => (/* binding */ useIsClient), 40392 useMapper: () => (/* binding */ useMapper), 40393 useSSRContext: () => (/* reexport */ SSRContext_DqqZUlqT.a) 40394}); 40395 40396;// ./node_modules/@zengenti/contensis-react-base/esm/urls-tLxo_skx.js 40397const setCachingHeaders = (response, { 40398 cacheControl = 'private', 40399 surrogateControl = '3600' 40400}, method = 'header') => { 40401 if (cacheControl) response[method]('Cache-Control', cacheControl); 40402 if (surrogateControl) response[method]('Surrogate-Control', `max-age=${surrogateControl.toString()}`); 40403}; 40404 40405const urls = (alias, project) => { 40406 const projectAndAlias = project && project.toLowerCase() !== 'website' ? `${project.toLowerCase()}-${alias}` : alias; 40407 return { 40408 api: `https://api-${alias}.cloud.contensis.com`, 40409 cms: `https://cms-${alias}.cloud.contensis.com`, 40410 liveWeb: `https://live-${projectAndAlias}.cloud.contensis.com`, 40411 previewWeb: `https://preview-${projectAndAlias}.cloud.contensis.com`, 40412 iisWeb: `https://iis-live-${projectAndAlias}.cloud.contensis.com`, 40413 iisPreviewWeb: `https://iis-preview-${projectAndAlias}.cloud.contensis.com` 40414 }; 40415}; 40416 40417 40418//# sourceMappingURL=urls-tLxo_skx.js.map 40419 40420// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/ContensisDeliveryApi-Czq1gBOi.js 40421var ContensisDeliveryApi_Czq1gBOi = __webpack_require__(22255); 40422// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/SSRContext-DqqZUlqT.js 40423var SSRContext_DqqZUlqT = __webpack_require__(2460); 40424// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/VersionInfo-BinQYaU1.js 40425var VersionInfo_BinQYaU1 = __webpack_require__(23367); 40426// EXTERNAL MODULE: ./node_modules/react/index.js 40427var react = __webpack_require__(96540); 40428// EXTERNAL MODULE: ./node_modules/react-helmet-async/lib/index.esm.js 40429var index_esm = __webpack_require__(85902); 40430// EXTERNAL MODULE: ./node_modules/jsonpath-mapper/dist/jsonpath-mapper.mjs + 1 modules 40431var jsonpath_mapper = __webpack_require__(47149); 40432// EXTERNAL MODULE: ./node_modules/react-router-dom/node_modules/react-router/dist/index.js 40433var dist = __webpack_require__(20913); 40434// EXTERNAL MODULE: ./node_modules/contensis-delivery-api/lib/index.js 40435var lib = __webpack_require__(15575); 40436// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/node_modules/query-string/index.js 40437var query_string = __webpack_require__(17276); 40438// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/selectors-Dj45vPZR.js 40439var selectors_Dj45vPZR = __webpack_require__(23790); 40440// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/store-Cxe7mlLh.js + 2 modules 40441var store_Cxe7mlLh = __webpack_require__(95137); 40442// EXTERNAL MODULE: ./node_modules/redux-saga/dist/redux-saga-core-npm-proxy.esm.js + 2 modules 40443var redux_saga_core_npm_proxy_esm = __webpack_require__(27701); 40444// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/slice-C6JLQik8.js + 1 modules 40445var slice_C6JLQik8 = __webpack_require__(60218); 40446// EXTERNAL MODULE: ./node_modules/@redux-saga/core/dist/redux-saga-effects.esm.js 40447var redux_saga_effects_esm = __webpack_require__(85118); 40448// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/CookieHelper.class-C6rTRl_1.js 40449var CookieHelper_class_C6rTRl_1 = __webpack_require__(26240); 40450// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/_commonjsHelpers-BFTU3MAI.js 40451var _commonjsHelpers_BFTU3MAI = __webpack_require__(90912); 40452// EXTERNAL MODULE: ./node_modules/@zengenti/contensis-react-base/esm/version-hQnuV0n7.js 40453var version_hQnuV0n7 = __webpack_require__(81452); 40454;// ./node_modules/@zengenti/contensis-react-base/esm/util.js 40455 40456 40457 40458 40459 40460 40461 40462 40463 40464 40465 40466 40467 40468 40469 40470 40471 40472 40473 40474 40475 40476 40477 40478 40479 40480 40481 40482 40483 40484 40485/** 40486 * 40487 * @param {object} json The source object we wish to transform 40488 * @param {object} template The mapping template we wish to apply to the source 40489 * object to generate the intended target object 40490 */ 40491const useMapper = (json, template) => { 40492 return template ? (0,jsonpath_mapper/* default */.Ay)(json || {}, template) : json; 40493};
40494const chooseMapperByFieldValue = (entry, mappers, field = 'sys.contentTypeId') => { 40495 const fieldValue = (0,jsonpath_mapper/* jpath */.oA)(field, entry || {}); 40496 return mappers[fieldValue] || mappers.default || {}; 40497}; 40498 40499/** 40500 * useEntriesMapper hook to take a list of entries from Delivery API along 40501 * with mappers for each contentTypeId and return an array of mapped objects 40502 * @param {any} entry The source entry we wish to transform 40503 * @param {object} mappers Object with keys containing mapper templates, 40504 * the key name matching sys.contentTypeId 40505 * @param {string} field Only include if we need to match content based on 40506 * a field other than sys.contentTypeId in the source data 40507 * @returns {object} Object transformed using a matched content type or 40508 * a default mapper template, returns an empty object if no mapper template 40509 * couild be applied. 40510 */ 40511const useEntriesMapper = (entry, mappers, field = 'sys.contentTypeId') => { 40512 const mapper = chooseMapperByFieldValue(entry, mappers, field); 40513 return useMapper(entry, mapper); 40514}; 40515 40516/** 40517 * Deprecated: due to misleading name, use the hook useEntriesMapper instead 40518 */ 40519const useEntryMapper = useEntriesMapper; 40520 40521/** 40522 * mapEntries mapping function to take a list of entries from Delivery API along 40523 * with mappers for each contentTypeId and return an array of mapped objects 40524 * @param {any} entry The source entry we wish to transform 40525 * @param {object} mappers Object with keys containing mapper templates, 40526 * the key name matching sys.contentTypeId 40527 * @param {string} field Only include if we need to match content based on 40528 * a field other than sys.contentTypeId in the source data 40529 * @returns {object} Object transformed using a matched content type or 40530 * a default mapper template, returns an empty object if no mapper template 40531 * couild be applied. 40532 */ 40533const mapEntries = (entries, mappers, field = 'sys.contentTypeId') => entries.map(entry => { 40534 const mapper = chooseMapperByFieldValue(entry, mappers, field); 40535 return mapper ? (0,jsonpath_mapper/* default */.Ay)(entry || {}, mapper) : entry; 40536}); 40537 40538/** 40539 * mapComposer mapping function to take a composer field from Delivery API along 40540 * with mappers for each Composer Item "type" and return an array of mapped components 40541 * @param {array} composer Composer field array of Composer Items 40542 * @param {object} mappers A keyed object with each key matching the Composer Item "type" 40543 * @returns {array} Array of mapped objects transformed using a matched Composer Item "type" mapping 40544 * or null. Injects a "_type" property into each transformed object in the array to indicate 40545 * where the mapping originated and for what component the mapped object is representing 40546 */ 40547const mapComposer = (composer, mappers) => Array.isArray(composer) ? composer.map((composerItem, index) => { 40548 const itemValue = composerItem.value; 40549 const mapper = mappers[composerItem.type] || mappers.default; 40550 if (mapper) { 40551 // Add some fields into the composer item mapper and return object 40552 const addedFields = { 40553 _type: composerItem.type, 40554 _index: index 40555 }; 40556 40557 // Add fields and $root item into the composer item source object 40558 // for use inside each item mapping, for arrays we inject the added fields 40559 // into the first array item. This is useful if we require any of 40560 // composerItem.type, composerItem index/position and composer $root 40561 // in scope to influence any composer item's mapping logic 40562 const sourceObject = itemValue && Array.isArray(itemValue) ? itemValue.map((iv, idx) => idx !== 0 ? iv : typeof iv === 'object' ? { 40563 ...addedFields, 40564 ...iv, 40565 $root: composer 40566 } : iv) : typeof itemValue === 'object' ? { 40567 ...addedFields, 40568 ...itemValue, 40569 $root: composer 40570 } : itemValue || {}; 40571 40572 // Apply the composer item mapping 40573 const mappedFields = (0,jsonpath_mapper/* default */.Ay)(sourceObject, mapper); 40574 40575 // Add the extra fields in with the return object 40576 return mappedFields && typeof mappedFields === 'object' ? { 40577 ...mappedFields, 40578 ...addedFields 40579 } : mappedFields; 40580 } else return {}; 40581}) : composer || []; 40582 40583/** 40584 * useComposerMapper hook to take a composer field from Delivery API along 40585 * with mappers for each Composer Item "type" and return an array of mapped components 40586 * @param {array} composer Composer field array of Composer Items 40587 * @param {object} mappers A keyed object with each key matching the Composer Item "type" 40588 * @returns {array} Array of mapped objects transformed using a matched Composer Item "type" mapping 40589 * or null. Injects a "_type" property into each transformed object in the array to indicate 40590 * where the mapping originated and for what component the mapped object is representing 40591 */ 40592const useComposerMapper = (composer = [], mappers) => mapComposer(composer, mappers); 40593 40594/** 40595 * entryMapper will return a function to satisfy an entryMapper when defining app route 40596 * this is essentially a shorthand function to prevent boilerplate repetition inside your routes file 40597 * you do not need to use this function should you wish to map your entry via raw JS functions 40598 * @param mapping the jsonpath-mapper mapping template to apply when the route is resolved 40599 * @returns {mappedEntry} 40600 */ 40601const entryMapper = mapping => (node, state) => (0,jsonpath_mapper/* default */.Ay)({ 40602 ...node, 40603 ...(node.entry || {}), 40604 state 40605}, mapping); 40606
40607// hooks/useIsClient.ts 40608/** 40609 * A hook that returns true only when the component has mounted in the browser client 40610 * Used to prevent SSR render and defer rendering to client-side to safely refernce 40611 * browser-only apis or avoid React Hydration errors 40612 */ 40613const useIsClient = () => { 40614 const [isClient, setIsClient] = (0,react.useState)(false); 40615 (0,react.useEffect)(() => setIsClient(true), []); 40616 return isClient; 40617}; 40618 40619/** 40620 * NoSSR component to prevent children from rendering on the server. 40621 * Renders children only after component has mounted in the browser. 40622 */ 40623const NoSSR = ({ 40624 children 40625}) => { 40626 const isClient = useIsClient(); 40627 if (!isClient) return null; 40628 return /*#__PURE__*/react.createElement(react.Fragment, null, children); 40629}; 40630 40631/** @deprecated ponyfill for useHistory hook in react-router v5 removed in v6 */ 40632const useHistory = () => { 40633 const navigate = (0,dist/* useNavigate */.Zp)(); 40634 const location = (0,dist/* useLocation */.zy)(); 40635 return { 40636 push: navigate, 40637 replace: navigate, 40638 location 40639 }; 40640}; 40641 40642 40643//# sourceMappingURL=util.js.map 40644 40645 40646/***/ }, 40647 40648/***/ 9348 40649(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 40650 40651"use strict"; 40652/* harmony export */ __webpack_require__.d(__webpack_exports__, { 40653/* harmony export */ a: () => (/* binding */ injectRedux), 40654/* harmony export */ c: () => (/* binding */ setVersionStatus), 40655/* harmony export */ h: () => (/* binding */ hasNavigationTree),
40656/* harmony export */ n: () => (/* binding */ navigation), 40657/* harmony export */ v: () => (/* binding */ version) 40658/* harmony export */ }); 40659/* unused harmony exports b, i, s, u */ 40660/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23790); 40661/* harmony import */ var _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95137); 40662 40663 40664 40665const hasNavigationTree = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['navigation', 'isReady']); 40666const selectNavigationRoot = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['navigation', 'root']); 40667const selectNavigationChildren = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['navigation', 'root', 'children']); 40668const selectNavigationDepends = () => []; 40669 40670var navigation = /*#__PURE__*/Object.freeze({ 40671 __proto__: null, 40672 hasNavigationTree: hasNavigationTree, 40673 selectNavigationChildren: selectNavigationChildren, 40674 selectNavigationDepends: selectNavigationDepends, 40675 selectNavigationRoot: selectNavigationRoot 40676}); 40677 40678const injectReducer = ({ 40679 key, 40680 reducer 40681}, store = _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_1__.r) => { 40682 if (Reflect.has(store.injectedReducers, key) && store.injectedReducers[key] === reducer) return; 40683 store.injectedReducers[key] = reducer; 40684 store.replaceReducer(store.createReducer(store.injectedReducers)); 40685}; 40686const injectSaga = ({ 40687 key, 40688 saga 40689}, store = _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_1__.r) => { 40690 // Proceed with the injection as usual if it's not a duplicate 40691 let hasSaga = Reflect.has(store.injectedSagas, key); 40692 if (false) // removed by dead control flow 40693{} 40694 if (!hasSaga) { 40695 // Check if the saga has already been added in the initial sagas 40696 const injectEffects = []; 40697 for (const effect of saga) { 40698 // Inject this saga effect if it's not already present 40699 if (!store.initialSagas.has(effect)) injectEffects.push(effect); 40700 } 40701 const rootSaga = (0,_store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_1__.w)(injectEffects); 40702 store.injectedSagas[key] = { 40703 key, 40704 saga: saga, 40705 task: store.runSaga(rootSaga) 40706 }; 40707 } 40708}; 40709 40710const injectRedux = ({ 40711 key, 40712 reducer, 40713 saga 40714}, store = _store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_1__.r) => { 40715 // console.info('injectRedux, key: ', key); 40716 if (reducer) injectReducer({ 40717 key, 40718 reducer 40719 }, store); 40720 if (saga) injectSaga({ 40721 key, 40722 saga 40723 }, store); 40724}; 40725const useInjectRedux = (/* unused pure expression or super */ null && (injectRedux)); 40726 40727const setVersion = (commitRef, buildNo) => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.w)(_store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_1__.b, { 40728 commitRef, 40729 buildNo 40730}); 40731const setVersionStatus = status => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.w)(_store_Cxe7mlLh_js__WEBPACK_IMPORTED_MODULE_1__.c, { 40732 status 40733}); 40734 40735var version = /*#__PURE__*/Object.freeze({ 40736 __proto__: null, 40737 setVersion: setVersion, 40738 setVersionStatus: setVersionStatus 40739}); 40740 40741 40742//# sourceMappingURL=version-Cy-gb20a.js.map 40743 40744 40745/***/ }, 40746 40747/***/ 81452 40748(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 40749 40750"use strict"; 40751/* harmony export */ __webpack_require__.d(__webpack_exports__, { 40752/* harmony export */ a: () => (/* binding */ selectCommitRef), 40753/* harmony export */ b: () => (/* binding */ selectVersionStatus), 40754/* harmony export */ s: () => (/* binding */ selectBuildNumber), 40755/* harmony export */ v: () => (/* binding */ version) 40756/* harmony export */ }); 40757/* harmony import */ var _selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23790); 40758 40759 40760const selectCommitRef = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['version', 'commitRef']); 40761const selectBuildNumber = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['version', 'buildNo']); 40762const selectVersionStatus = state => (0,_selectors_Dj45vPZR_js__WEBPACK_IMPORTED_MODULE_0__.x)(state, ['version', 'contensisVersionStatus']); 40763 40764var version = /*#__PURE__*/Object.freeze({ 40765 __proto__: null, 40766 selectBuildNumber: selectBuildNumber, 40767 selectCommitRef: selectCommitRef, 40768 selectVersionStatus: selectVersionStatus 40769}); 40770 40771 40772//# sourceMappingURL=version-hQnuV0n7.js.map 40773 40774 40775/***/ }, 40776 40777/***/ 17276 40778(__unused_webpack_module, exports, __webpack_require__) { 40779 40780"use strict"; 40781 40782const strictUriEncode = __webpack_require__(31161); 40783const decodeComponent = __webpack_require__(30454); 40784const splitOnFirst = __webpack_require__(528); 40785const filterObject = __webpack_require__(73055); 40786 40787const isNullOrUndefined = value => value === null || value === undefined; 40788 40789const encodeFragmentIdentifier = Symbol('encodeFragmentIdentifier'); 40790 40791function encoderForArrayFormat(options) { 40792 switch (options.arrayFormat) { 40793 case 'index': 40794 return key => (result, value) => { 40795 const index = result.length; 40796 40797 if ( 40798 value === undefined || 40799 (options.skipNull && value === null) || 40800 (options.skipEmptyString && value === '') 40801 ) { 40802 return result; 40803 } 40804 40805 if (value === null) { 40806 return [...result, [encode(key, options), '[', index, ']'].join('')]; 40807 } 40808 40809 return [ 40810 ...result, 40811 [encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('') 40812 ]; 40813 }; 40814 40815 case 'bracket': 40816 return key => (result, value) => { 40817 if ( 40818 value === undefined || 40819 (options.skipNull && value === null) || 40820 (options.skipEmptyString && value === '') 40821 ) { 40822 return result; 40823 } 40824 40825 if (value === null) { 40826 return [...result, [encode(key, options), '[]'].join('')]; 40827 } 40828 40829 return [...result, [encode(key, options), '[]=', encode(value, options)].join('')]; 40830 }; 40831 40832 case 'colon-list-separator': 40833 return key => (result, value) => { 40834 if ( 40835 value === undefined || 40836 (options.skipNull && value === null) || 40837 (options.skipEmptyString && value === '') 40838 ) { 40839 return result; 40840 } 40841 40842 if (value === null) { 40843 return [...result, [encode(key, options), ':list='].join('')]; 40844 } 40845 40846 return [...result, [encode(key, options), ':list=', encode(value, options)].join('')]; 40847 }; 40848 40849 case 'comma': 40850 case 'separator': 40851 case 'bracket-separator': {
40852 const keyValueSep = options.arrayFormat === 'bracket-separator' ? 40853 '[]=' : 40854 '='; 40855 40856 return key => (result, value) => { 40857 if ( 40858 value === undefined || 40859 (options.skipNull && value === null) || 40860 (options.skipEmptyString && value === '') 40861 ) { 40862 return result; 40863 } 40864 40865 // Translate null to an empty string so that it doesn't serialize as 'null' 40866 value = value === null ? '' : value; 40867 40868 if (result.length === 0) { 40869 return [[encode(key, options), keyValueSep, encode(value, options)].join('')]; 40870 } 40871 40872 return [[result, encode(value, options)].join(options.arrayFormatSeparator)]; 40873 }; 40874 } 40875 40876 default: 40877 return key => (result, value) => { 40878 if ( 40879 value === undefined || 40880 (options.skipNull && value === null) || 40881 (options.skipEmptyString && value === '') 40882 ) { 40883 return result; 40884 } 40885 40886 if (value === null) { 40887 return [...result, encode(key, options)]; 40888 } 40889 40890 return [...result, [encode(key, options), '=', encode(value, options)].join('')]; 40891 }; 40892 } 40893} 40894 40895function parserForArrayFormat(options) { 40896 let result; 40897 40898 switch (options.arrayFormat) { 40899 case 'index': 40900 return (key, value, accumulator) => { 40901 result = /\[(\d*)\]$/.exec(key); 40902 40903 key = key.replace(/\[\d*\]$/, ''); 40904 40905 if (!result) { 40906 accumulator[key] = value; 40907 return; 40908 } 40909 40910 if (accumulator[key] === undefined) { 40911 accumulator[key] = {}; 40912 } 40913 40914 accumulator[key][result[1]] = value; 40915 }; 40916 40917 case 'bracket': 40918 return (key, value, accumulator) => { 40919 result = /(\[\])$/.exec(key); 40920 key = key.replace(/\[\]$/, ''); 40921 40922 if (!result) { 40923 accumulator[key] = value; 40924 return; 40925 } 40926 40927 if (accumulator[key] === undefined) { 40928 accumulator[key] = [value]; 40929 return; 40930 } 40931 40932 accumulator[key] = [].concat(accumulator[key], value); 40933 }; 40934 40935 case 'colon-list-separator': 40936 return (key, value, accumulator) => { 40937 result = /(:list)$/.exec(key); 40938 key = key.replace(/:list$/, ''); 40939 40940 if (!result) { 40941 accumulator[key] = value; 40942 return; 40943 } 40944 40945 if (accumulator[key] === undefined) { 40946 accumulator[key] = [value]; 40947 return; 40948 } 40949 40950 accumulator[key] = [].concat(accumulator[key], value); 40951 }; 40952 40953 case 'comma': 40954 case 'separator': 40955 return (key, value, accumulator) => { 40956 const isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator); 40957 const isEncodedArray = (typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator)); 40958 value = isEncodedArray ? decode(value, options) : value; 40959 const newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options); 40960 accumulator[key] = newValue; 40961 }; 40962 40963 case 'bracket-separator': 40964 return (key, value, accumulator) => { 40965 const isArray = /(\[\])$/.test(key); 40966 key = key.replace(/\[\]$/, ''); 40967 40968 if (!isArray) { 40969 accumulator[key] = value ? decode(value, options) : value; 40970 return; 40971 } 40972 40973 const arrayValue = value === null ? 40974 [] : 40975 value.split(options.arrayFormatSeparator).map(item => decode(item, options)); 40976 40977 if (accumulator[key] === undefined) { 40978 accumulator[key] = arrayValue; 40979 return; 40980 } 40981 40982 accumulator[key] = [].concat(accumulator[key], arrayValue); 40983 }; 40984 40985 default: 40986 return (key, value, accumulator) => { 40987 if (accumulator[key] === undefined) { 40988 accumulator[key] = value; 40989 return; 40990 } 40991 40992 accumulator[key] = [].concat(accumulator[key], value); 40993 }; 40994 } 40995} 40996 40997function validateArrayFormatSeparator(value) { 40998 if (typeof value !== 'string' || value.length !== 1) { 40999 throw new TypeError('arrayFormatSeparator must be single character string'); 41000 } 41001} 41002 41003function encode(value, options) { 41004 if (options.encode) { 41005 return options.strict ? strictUriEncode(value) : encodeURIComponent(value); 41006 } 41007 41008 return value; 41009} 41010 41011function decode(value, options) { 41012 if (options.decode) { 41013 return decodeComponent(value); 41014 } 41015 41016 return value; 41017} 41018 41019function keysSorter(input) { 41020 if (Array.isArray(input)) { 41021 return input.sort(); 41022 } 41023 41024 if (typeof input === 'object') { 41025 return keysSorter(Object.keys(input)) 41026 .sort((a, b) => Number(a) - Number(b)) 41027 .map(key => input[key]); 41028 } 41029 41030 return input; 41031} 41032 41033function removeHash(input) { 41034 const hashStart = input.indexOf('#'); 41035 if (hashStart !== -1) { 41036 input = input.slice(0, hashStart); 41037 } 41038 41039 return input; 41040} 41041 41042function getHash(url) { 41043 let hash = ''; 41044 const hashStart = url.indexOf('#'); 41045 if (hashStart !== -1) { 41046 hash = url.slice(hashStart); 41047 } 41048 41049 return hash; 41050} 41051 41052function extract(input) { 41053 input = removeHash(input); 41054 const queryStart = input.indexOf('?'); 41055 if (queryStart === -1) { 41056 return ''; 41057 } 41058 41059 return input.slice(queryStart + 1); 41060} 41061 41062function parseValue(value, options) { 41063 if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) { 41064 value = Number(value); 41065 } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) { 41066 value = value.toLowerCase() === 'true'; 41067 } 41068 41069 return value; 41070} 41071 41072function parse(query, options) { 41073 options = Object.assign({ 41074 decode: true, 41075 sort: true, 41076 arrayFormat: 'none', 41077 arrayFormatSeparator: ',', 41078 parseNumbers: false,
41079 parseBooleans: false 41080 }, options); 41081 41082 validateArrayFormatSeparator(options.arrayFormatSeparator); 41083 41084 const formatter = parserForArrayFormat(options); 41085 41086 // Create an object with no prototype 41087 const ret = Object.create(null); 41088 41089 if (typeof query !== 'string') { 41090 return ret; 41091 } 41092 41093 query = query.trim().replace(/^[?#&]/, ''); 41094 41095 if (!query) { 41096 return ret; 41097 } 41098 41099 for (const param of query.split('&')) { 41100 if (param === '') { 41101 continue; 41102 } 41103 41104 let [key, value] = splitOnFirst(options.decode ? param.replace(/\+/g, ' ') : param, '='); 41105 41106 // Missing `=` should be `null`: 41107 // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters 41108 value = value === undefined ? null : ['comma', 'separator', 'bracket-separator'].includes(options.arrayFormat) ? value : decode(value, options); 41109 formatter(decode(key, options), value, ret); 41110 } 41111 41112 for (const key of Object.keys(ret)) { 41113 const value = ret[key]; 41114 if (typeof value === 'object' && value !== null) { 41115 for (const k of Object.keys(value)) { 41116 value[k] = parseValue(value[k], options); 41117 } 41118 } else { 41119 ret[key] = parseValue(value, options); 41120 } 41121 } 41122 41123 if (options.sort === false) { 41124 return ret; 41125 } 41126 41127 return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => { 41128 const value = ret[key]; 41129 if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) { 41130 // Sort object keys, not values 41131 result[key] = keysSorter(value); 41132 } else { 41133 result[key] = value; 41134 } 41135 41136 return result; 41137 }, Object.create(null)); 41138} 41139 41140exports.extract = extract; 41141exports.parse = parse; 41142 41143exports.stringify = (object, options) => { 41144 if (!object) { 41145 return ''; 41146 } 41147 41148 options = Object.assign({ 41149 encode: true, 41150 strict: true, 41151 arrayFormat: 'none', 41152 arrayFormatSeparator: ',' 41153 }, options); 41154 41155 validateArrayFormatSeparator(options.arrayFormatSeparator); 41156 41157 const shouldFilter = key => ( 41158 (options.skipNull && isNullOrUndefined(object[key])) || 41159 (options.skipEmptyString && object[key] === '') 41160 ); 41161 41162 const formatter = encoderForArrayFormat(options); 41163 41164 const objectCopy = {}; 41165 41166 for (const key of Object.keys(object)) { 41167 if (!shouldFilter(key)) { 41168 objectCopy[key] = object[key]; 41169 } 41170 } 41171 41172 const keys = Object.keys(objectCopy); 41173 41174 if (options.sort !== false) { 41175 keys.sort(options.sort); 41176 } 41177 41178 return keys.map(key => { 41179 const value = object[key]; 41180 41181 if (value === undefined) { 41182 return ''; 41183 } 41184 41185 if (value === null) { 41186 return encode(key, options); 41187 } 41188 41189 if (Array.isArray(value)) { 41190 if (value.length === 0 && options.arrayFormat === 'bracket-separator') { 41191 return encode(key, options) + '[]'; 41192 } 41193 41194 return value 41195 .reduce(formatter(key), []) 41196 .join('&'); 41197 } 41198 41199 return encode(key, options) + '=' + encode(value, options); 41200 }).filter(x => x.length > 0).join('&'); 41201}; 41202 41203exports.parseUrl = (url, options) => { 41204 options = Object.assign({ 41205 decode: true 41206 }, options); 41207 41208 const [url_, hash] = splitOnFirst(url, '#'); 41209 41210 return Object.assign( 41211 { 41212 url: url_.split('?')[0] || '', 41213 query: parse(extract(url), options) 41214 }, 41215 options && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {} 41216 ); 41217}; 41218 41219exports.stringifyUrl = (object, options) => { 41220 options = Object.assign({ 41221 encode: true, 41222 strict: true, 41223 [encodeFragmentIdentifier]: true 41224 }, options); 41225 41226 const url = removeHash(object.url).split('?')[0] || ''; 41227 const queryFromUrl = exports.extract(object.url); 41228 const parsedQueryFromUrl = exports.parse(queryFromUrl, {sort: false}); 41229 41230 const query = Object.assign(parsedQueryFromUrl, object.query); 41231 let queryString = exports.stringify(query, options); 41232 if (queryString) { 41233 queryString = `?${queryString}`; 41234 } 41235 41236 let hash = getHash(object.url); 41237 if (object.fragmentIdentifier) { 41238 hash = `#${options[encodeFragmentIdentifier] ? encode(object.fragmentIdentifier, options) : object.fragmentIdentifier}`; 41239 } 41240 41241 return `${url}${queryString}${hash}`; 41242}; 41243 41244exports.pick = (input, filter, options) => { 41245 options = Object.assign({ 41246 parseFragmentIdentifier: true, 41247 [encodeFragmentIdentifier]: false 41248 }, options); 41249 41250 const {url, query, fragmentIdentifier} = exports.parseUrl(input, options); 41251 return exports.stringifyUrl({ 41252 url, 41253 query: filterObject(query, filter), 41254 fragmentIdentifier 41255 }, options); 41256}; 41257 41258exports.exclude = (input, filter, options) => { 41259 const exclusionFilter = Array.isArray(filter) ? key => !filter.includes(key) : (key, value) => !filter(key, value); 41260 41261 return exports.pick(input, exclusionFilter, options); 41262}; 41263 41264 41265/***/ }, 41266 41267/***/ 31161 41268(module) { 41269 41270"use strict"; 41271 41272module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`); 41273 41274 41275/***/ }, 41276 41277/***/ 19511 41278(module, __unused_webpack_exports, __webpack_require__) { 41279 41280"use strict"; 41281 41282 41283var callBound = __webpack_require__(38075); 41284var $byteLength = callBound('ArrayBuffer.prototype.byteLength', true); 41285 41286var isArrayBuffer = __webpack_require__(84670); 41287 41288/** @type {import('.')} */ 41289module.exports = function byteLength(ab) { 41290 if (!isArrayBuffer(ab)) { 41291 return NaN; 41292 } 41293 return $byteLength ? $byteLength(ab) : ab.byteLength; 41294};
vendor: 4,883 bytes, lines 41294-41514
41294 // in node < 0.11, byteLength is an own nonconfigurable property 41295 41296 41297/***/ }, 41298 41299/***/ 6554 41300(module, __unused_webpack_exports, __webpack_require__) { 41301 41302"use strict"; 41303 41304 41305var possibleNames = __webpack_require__(76578); 41306 41307var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis; 41308 41309/** @type {import('.')} */ 41310module.exports = function availableTypedArrays() { 41311 var /** @type {ReturnType<typeof availableTypedArrays>} */ out = []; 41312 for (var i = 0; i < possibleNames.length; i++) { 41313 if (typeof g[possibleNames[i]] === 'function') { 41314 // @ts-expect-error 41315 out[out.length] = possibleNames[i]; 41316 } 41317 } 41318 return out; 41319}; 41320 41321 41322/***/ }, 41323 41324/***/ 13144 41325(module, __unused_webpack_exports, __webpack_require__) { 41326 41327"use strict"; 41328 41329 41330var bind = __webpack_require__(66743); 41331 41332var $apply = __webpack_require__(11002); 41333var $call = __webpack_require__(10076); 41334var $reflectApply = __webpack_require__(47119); 41335 41336/** @type {import('./actualApply')} */ 41337module.exports = $reflectApply || bind.call($call, $apply); 41338 41339 41340/***/ }, 41341 41342/***/ 11002 41343(module) { 41344 41345"use strict"; 41346 41347 41348/** @type {import('./functionApply')} */ 41349module.exports = Function.prototype.apply; 41350 41351 41352/***/ }, 41353 41354/***/ 10076 41355(module) { 41356 41357"use strict"; 41358 41359 41360/** @type {import('./functionCall')} */ 41361module.exports = Function.prototype.call; 41362 41363 41364/***/ }, 41365 41366/***/ 73126 41367(module, __unused_webpack_exports, __webpack_require__) { 41368 41369"use strict"; 41370 41371 41372var bind = __webpack_require__(66743); 41373var $TypeError = __webpack_require__(69675); 41374 41375var $call = __webpack_require__(10076); 41376var $actualApply = __webpack_require__(13144); 41377 41378/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ 41379module.exports = function callBindBasic(args) { 41380 if (args.length < 1 || typeof args[0] !== 'function') { 41381 throw new $TypeError('a function is required'); 41382 } 41383 return $actualApply(bind, $call, args); 41384}; 41385 41386 41387/***/ }, 41388 41389/***/ 47119 41390(module) { 41391 41392"use strict"; 41393 41394 41395/** @type {import('./reflectApply')} */ 41396module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; 41397 41398 41399/***/ }, 41400 41401/***/ 38075 41402(module, __unused_webpack_exports, __webpack_require__) { 41403 41404"use strict"; 41405 41406 41407var GetIntrinsic = __webpack_require__(70453); 41408 41409var callBind = __webpack_require__(10487); 41410 41411var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); 41412 41413module.exports = function callBoundIntrinsic(name, allowMissing) { 41414 var intrinsic = GetIntrinsic(name, !!allowMissing); 41415 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 41416 return callBind(intrinsic); 41417 } 41418 return intrinsic; 41419}; 41420 41421 41422/***/ }, 41423 41424/***/ 10487 41425(module, __unused_webpack_exports, __webpack_require__) { 41426 41427"use strict"; 41428 41429 41430var bind = __webpack_require__(66743); 41431var GetIntrinsic = __webpack_require__(70453); 41432var setFunctionLength = __webpack_require__(96897); 41433 41434var $TypeError = __webpack_require__(69675); 41435var $apply = GetIntrinsic('%Function.prototype.apply%'); 41436var $call = GetIntrinsic('%Function.prototype.call%'); 41437var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); 41438 41439var $defineProperty = __webpack_require__(30655); 41440var $max = GetIntrinsic('%Math.max%'); 41441 41442module.exports = function callBind(originalFunction) { 41443 if (typeof originalFunction !== 'function') { 41444 throw new $TypeError('a function is required'); 41445 } 41446 var func = $reflectApply(bind, $call, arguments); 41447 return setFunctionLength( 41448 func, 41449 1 + $max(0, originalFunction.length - (arguments.length - 1)), 41450 true 41451 ); 41452}; 41453 41454var applyBind = function applyBind() { 41455 return $reflectApply(bind, $apply, arguments); 41456}; 41457 41458if ($defineProperty) { 41459 $defineProperty(module.exports, 'apply', { value: applyBind }); 41460} else { 41461 module.exports.apply = applyBind; 41462} 41463 41464 41465/***/ }, 41466 41467/***/ 36556 41468(module, __unused_webpack_exports, __webpack_require__) { 41469 41470"use strict"; 41471 41472 41473var GetIntrinsic = __webpack_require__(70453); 41474 41475var callBindBasic = __webpack_require__(73126); 41476 41477/** @type {(thisArg: string, searchString: string, position?: number) => number} */ 41478var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); 41479 41480/** @type {import('.')} */ 41481module.exports = function callBoundIntrinsic(name, allowMissing) { 41482 /* eslint no-extra-parens: 0 */ 41483 41484 var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); 41485 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 41486 return callBindBasic(/** @type {const} */ ([intrinsic])); 41487 } 41488 return intrinsic; 41489}; 41490 41491 41492/***/ }, 41493 41494/***/ 32485 41495(module, exports) { 41496 41497var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 41498 Copyright (c) 2018 Jed Watson. 41499 Licensed under the MIT License (MIT), see 41500 http://jedwatson.github.io/classnames 41501*/ 41502/* global define */ 41503 41504(function () { 41505 'use strict'; 41506 41507 var hasOwn = {}.hasOwnProperty; 41508 41509 function classNames () { 41510 var classes = ''; 41511 41512 for (var i = 0; i < arguments.length; i++) { 41513 var arg = arguments[i]; 41514 if (arg) {
41515 classes = appendClass(classes, parseValue(arg)); 41516 } 41517 } 41518 41519 return classes; 41520 } 41521 41522 function parseValue (arg) { 41523 if (typeof arg === 'string' || typeof arg === 'number') { 41524 return arg; 41525 } 41526 41527 if (typeof arg !== 'object') { 41528 return ''; 41529 } 41530 41531 if (Array.isArray(arg)) { 41532 return classNames.apply(null, arg); 41533 } 41534 41535 if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { 41536 return arg.toString(); 41537 } 41538 41539 var classes = ''; 41540 41541 for (var key in arg) { 41542 if (hasOwn.call(arg, key) && arg[key]) { 41543 classes = appendClass(classes, key); 41544 } 41545 } 41546 41547 return classes; 41548 } 41549 41550 function appendClass (value, newClass) { 41551 if (!newClass) { 41552 return value; 41553 } 41554 41555 if (value) { 41556 return value + ' ' + newClass; 41557 } 41558 41559 return value + newClass; 41560 } 41561 41562 if ( true && module.exports) { 41563 classNames.default = classNames; 41564 module.exports = classNames; 41565 } else if (true) { 41566 // register as 'classnames', consistent with npm package name 41567 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 41568 return classNames; 41569 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 41570 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 41571 } else // removed by dead control flow 41572{} 41573}()); 41574 41575 41576/***/ }, 41577 41578/***/ 94501 41579(__unused_webpack_module, exports, __webpack_require__) { 41580 41581"use strict"; 41582 41583Object.defineProperty(exports, "__esModule", ({ value: true })); 41584exports.HttpClient = void 0; 41585var utils_1 = __webpack_require__(25201); 41586var HttpClient = /** @class */ (function () { 41587 function HttpClient(paramsProvider, fetchFn) { 41588 this.paramsProvider = paramsProvider; 41589 this.fetchFn = fetchFn; 41590 } 41591 HttpClient.prototype.request = function (url, request) { 41592 if (request === void 0) { request = {}; } 41593 var params = this.paramsProvider.getParams(); 41594 var isRelativeRequestUrl = !params.rootUrl || params.rootUrl === '/'; 41595 if (!(0, utils_1.isBrowser)() && isRelativeRequestUrl) { 41596 throw new Error('You cannot specify a relative root url if not in a browser context.'); 41597 } 41598 request.method = request.method || (!!request.body ? 'POST' : 'GET'); 41599 if (!isRelativeRequestUrl) { 41600 request.mode = 'cors'; 41601 } 41602 request.headers = request.headers || {}; 41603 var headers = request.headers; 41604 if (!headers.accessToken && !!params.accessToken) { 41605 headers.accessToken = params.accessToken; 41606 } 41607 if (params.clientType === 'none' && !headers.accessToken) { 41608 throw new Error("If the property clientType is set to \"".concat(params.clientType, "\" then the property accessToken must be provided.")); 41609 } 41610 if (params.clientType === 'client_credentials' && !params.clientDetails) { 41611 throw new Error("If the property client type is set to \"".concat(params.clientType, "\" then the property clientDetails must be set to a ClientCredentialsGrant value.")); 41612 } 41613 if (!!params.defaultHeaders) { 41614 var keys = Object.keys(params.defaultHeaders); 41615 keys.forEach(function (key) { 41616 if (!headers[key] && !!params.defaultHeaders[key]) { 41617 headers[key] = params.defaultHeaders[key]; 41618 } 41619 }); 41620 } 41621 var requestUrl = isRelativeRequestUrl ? "".concat(url) : "".concat(params.rootUrl).concat(url); 41622 return this.fetchFn(requestUrl, request) 41623 .then(function (response) { 41624 var responseHandlerFunction = null; 41625 if (!!params.responseHandler) { 41626 if (!!params.responseHandler['*']) { 41627 responseHandlerFunction = params.responseHandler['*']; 41628 } 41629 if (!!params.responseHandler[response.status]) { 41630 responseHandlerFunction = params.responseHandler[response.status]; 41631 } 41632 } 41633 var responseContext = { 41634 status: response.status, 41635 statusText: response.statusText, 41636 url: response.url, 41637 data: null 41638 }; 41639 return response 41640 .text() 41641 .then(function (text) { 41642 return !!text && text.length && text.length > 0 ? JSON.parse(text) : {}; 41643 }) 41644 .then(function (result) { 41645 responseContext.data = result; 41646 if (response.ok) { 41647 if (!!responseHandlerFunction) { 41648 responseHandlerFunction(response, responseContext); 41649 } 41650 return result; 41651 } 41652 return !!responseHandlerFunction ? 41653 responseHandlerFunction(response, responseContext) 41654 : Promise.reject(responseContext); 41655 }, function (reason) { 41656 responseContext.data = reason; 41657 return !!responseHandlerFunction ? 41658 responseHandlerFunction(response, responseContext) 41659 : Promise.reject(responseContext); 41660 }); 41661 }) 41662 .then(function (result) { return result; }); 41663 }; 41664 return HttpClient; 41665}()); 41666exports.HttpClient = HttpClient; 41667 41668 41669/***/ }, 41670 41671/***/ 54749 41672(__unused_webpack_module, exports, __webpack_require__) { 41673 41674"use strict"; 41675 41676Object.defineProperty(exports, "__esModule", ({ value: true })); 41677var tslib_1 = __webpack_require__(8674);
41678tslib_1.__exportStar(__webpack_require__(94501), exports); 41679tslib_1.__exportStar(__webpack_require__(53498), exports); 41680 41681 41682/***/ }, 41683 41684/***/ 53498 41685(__unused_webpack_module, exports, __webpack_require__) { 41686 41687"use strict"; 41688 41689Object.defineProperty(exports, "__esModule", ({ value: true })); 41690exports.UrlBuilder = void 0; 41691var tslib_1 = __webpack_require__(8674); 41692var utils_1 = __webpack_require__(25201); 41693var UrlBuilder = /** @class */ (function () { 41694 function UrlBuilder(url, query) { 41695 this.url = url; 41696 this.query = query; 41697 this.paramMatcher = /(:\b\D\w*)/g; 41698 this.options = {}; 41699 this.mappers = {}; 41700 } 41701 UrlBuilder.create = function (url, query) { 41702 if (query === void 0) { query = null; } 41703 return new UrlBuilder(url, query); 41704 }; 41705 UrlBuilder.prototype.addOptions = function (options, defaultParamName) { 41706 if (defaultParamName === void 0) { defaultParamName = null; } 41707 if ((0, utils_1.isString)(options) && !!defaultParamName) { 41708 this.options[defaultParamName] = options; 41709 } 41710 else { 41711 this.options = tslib_1.__assign(tslib_1.__assign({}, this.options), options); 41712 } 41713 return this; 41714 }; 41715 UrlBuilder.prototype.setParams = function (clientParams) { 41716 this.clientParams = clientParams; 41717 return this; 41718 }; 41719 UrlBuilder.prototype.addMappers = function (mappers) { 41720 var _this = this; 41721 if (mappers) { 41722 Object.keys(mappers).forEach(function (key) { 41723 _this.mappers[key] = mappers[key]; 41724 }); 41725 } 41726 return this; 41727 }; 41728 UrlBuilder.prototype.toUrl = function () { 41729 var _this = this; 41730 var namedParams = {}; 41731 var urlTemplate = typeof this.url === 'function' ? this.url(this.options, this.clientParams) : this.url; 41732 var paramNames = urlTemplate.match(this.paramMatcher); 41733 if (paramNames) { 41734 paramNames.forEach(function (paramName) { 41735 var key = paramName.substring(1); 41736 var value = null; 41737 if ((0, utils_1.hasProp)(_this.options, key) 41738 && _this.options[key] !== null) { 41739 value = _this.options[key]; 41740 } 41741 else if ((0, utils_1.hasProp)(_this.clientParams, key) 41742 && _this.clientParams[key] !== null) { 41743 value = _this.clientParams[key]; 41744 } 41745 var mapperValue = null; 41746 if (_this.mappers[paramName]) { 41747 mapperValue = _this.mappers[paramName](value, _this.options, _this.clientParams); 41748 } 41749 namedParams[paramName] = mapperValue !== null ? mapperValue : value; 41750 }); 41751 } 41752 var query = {}; 41753 if (this.query) { 41754 query = tslib_1.__assign({}, this.query); 41755 Object.keys(this.query).forEach(function (paramName) { 41756 var value = query[paramName]; 41757 if ((0, utils_1.hasProp)(_this.options, paramName) 41758 && _this.options[paramName] !== null) { 41759 value = _this.options[paramName]; 41760 } 41761 else if ((0, utils_1.hasProp)(_this.clientParams, paramName) 41762 && _this.clientParams[paramName] !== null) { 41763 value = _this.clientParams[paramName]; 41764 } 41765 query[paramName] = _this.mappers[paramName] ? 41766 _this.mappers[paramName](value, _this.options, _this.clientParams) : value; 41767 }); 41768 } 41769 var url = Object.keys(namedParams) 41770 .reduce(function (url, key) { return url.replace(key, namedParams[key]); }, urlTemplate); 41771 var queryString = (0, utils_1.toQuery)(query); 41772 return "".concat(url).concat(queryString); 41773 }; 41774 return UrlBuilder; 41775}()); 41776exports.UrlBuilder = UrlBuilder; 41777 41778 41779/***/ }, 41780 41781/***/ 41416 41782(__unused_webpack_module, exports, __webpack_require__) { 41783 41784"use strict"; 41785 41786Object.defineProperty(exports, "__esModule", ({ value: true })); 41787var tslib_1 = __webpack_require__(8674);
41788tslib_1.__exportStar(__webpack_require__(54749), exports); 41789tslib_1.__exportStar(__webpack_require__(32439), exports); 41790tslib_1.__exportStar(__webpack_require__(25201), exports); 41791 41792 41793/***/ }, 41794 41795/***/ 60894 41796(__unused_webpack_module, exports) { 41797 41798"use strict"; 41799 41800Object.defineProperty(exports, "__esModule", ({ value: true })); 41801 41802 41803/***/ }, 41804 41805/***/ 55384 41806(__unused_webpack_module, exports) { 41807 41808"use strict"; 41809 41810Object.defineProperty(exports, "__esModule", ({ value: true })); 41811 41812 41813/***/ }, 41814 41815/***/ 77191 41816(__unused_webpack_module, exports) { 41817 41818"use strict"; 41819 41820Object.defineProperty(exports, "__esModule", ({ value: true })); 41821 41822 41823/***/ }, 41824 41825/***/ 93682 41826(__unused_webpack_module, exports) { 41827 41828"use strict"; 41829 41830Object.defineProperty(exports, "__esModule", ({ value: true })); 41831 41832 41833/***/ }, 41834 41835/***/ 2432 41836(__unused_webpack_module, exports) { 41837 41838"use strict"; 41839 41840Object.defineProperty(exports, "__esModule", ({ value: true })); 41841 41842 41843/***/ }, 41844 41845/***/ 13821 41846(__unused_webpack_module, exports) { 41847 41848"use strict"; 41849 41850Object.defineProperty(exports, "__esModule", ({ value: true })); 41851 41852 41853/***/ }, 41854 41855/***/ 33413 41856(__unused_webpack_module, exports) { 41857 41858"use strict"; 41859 41860Object.defineProperty(exports, "__esModule", ({ value: true })); 41861 41862 41863/***/ }, 41864 41865/***/ 31602 41866(__unused_webpack_module, exports) { 41867 41868"use strict"; 41869 41870Object.defineProperty(exports, "__esModule", ({ value: true })); 41871 41872 41873/***/ }, 41874 41875/***/ 45921 41876(__unused_webpack_module, exports) { 41877 41878"use strict"; 41879 41880Object.defineProperty(exports, "__esModule", ({ value: true })); 41881 41882 41883/***/ }, 41884 41885/***/ 19910 41886(__unused_webpack_module, exports) { 41887 41888"use strict"; 41889 41890Object.defineProperty(exports, "__esModule", ({ value: true })); 41891 41892 41893/***/ }, 41894 41895/***/ 55607 41896(__unused_webpack_module, exports) { 41897 41898"use strict"; 41899 41900Object.defineProperty(exports, "__esModule", ({ value: true })); 41901 41902 41903/***/ }, 41904 41905/***/ 231 41906(__unused_webpack_module, exports) { 41907 41908"use strict"; 41909 41910Object.defineProperty(exports, "__esModule", ({ value: true })); 41911 41912 41913/***/ }, 41914 41915/***/ 40603 41916(__unused_webpack_module, exports) { 41917 41918"use strict"; 41919 41920Object.defineProperty(exports, "__esModule", ({ value: true })); 41921 41922 41923/***/ }, 41924 41925/***/ 109 41926(__unused_webpack_module, exports) { 41927 41928"use strict"; 41929 41930Object.defineProperty(exports, "__esModule", ({ value: true })); 41931 41932 41933/***/ }, 41934 41935/***/ 32522 41936(__unused_webpack_module, exports) { 41937 41938"use strict"; 41939 41940Object.defineProperty(exports, "__esModule", ({ value: true })); 41941 41942 41943/***/ }, 41944 41945/***/ 32240 41946(__unused_webpack_module, exports) { 41947 41948"use strict"; 41949 41950Object.defineProperty(exports, "__esModule", ({ value: true })); 41951 41952 41953/***/ }, 41954 41955/***/ 96886 41956(__unused_webpack_module, exports) { 41957 41958"use strict"; 41959 41960Object.defineProperty(exports, "__esModule", ({ value: true })); 41961 41962 41963/***/ }, 41964 41965/***/ 11050 41966(__unused_webpack_module, exports) { 41967 41968"use strict"; 41969 41970Object.defineProperty(exports, "__esModule", ({ value: true })); 41971 41972 41973/***/ }, 41974 41975/***/ 60517 41976(__unused_webpack_module, exports) { 41977 41978"use strict"; 41979 41980Object.defineProperty(exports, "__esModule", ({ value: true })); 41981 41982 41983/***/ }, 41984 41985/***/ 20198 41986(__unused_webpack_module, exports) { 41987 41988"use strict"; 41989 41990Object.defineProperty(exports, "__esModule", ({ value: true })); 41991 41992 41993/***/ }, 41994 41995/***/ 77558 41996(__unused_webpack_module, exports) { 41997 41998"use strict"; 41999 42000Object.defineProperty(exports, "__esModule", ({ value: true })); 42001 42002 42003/***/ }, 42004 42005/***/ 87582 42006(__unused_webpack_module, exports) { 42007 42008"use strict"; 42009 42010Object.defineProperty(exports, "__esModule", ({ value: true })); 42011 42012 42013/***/ }, 42014 42015/***/ 47395 42016(__unused_webpack_module, exports) { 42017 42018"use strict"; 42019 42020Object.defineProperty(exports, "__esModule", ({ value: true })); 42021 42022 42023/***/ }, 42024 42025/***/ 56922 42026(__unused_webpack_module, exports) { 42027 42028"use strict"; 42029 42030Object.defineProperty(exports, "__esModule", ({ value: true })); 42031 42032 42033/***/ }, 42034 42035/***/ 44181 42036(__unused_webpack_module, exports) { 42037 42038"use strict"; 42039 42040Object.defineProperty(exports, "__esModule", ({ value: true })); 42041 42042 42043/***/ }, 42044 42045/***/ 24656 42046(__unused_webpack_module, exports, __webpack_require__) { 42047 42048"use strict"; 42049 42050Object.defineProperty(exports, "__esModule", ({ value: true })); 42051exports.ContensisAuthenticationError = exports.ContensisApplicationError = void 0; 42052var tslib_1 = __webpack_require__(8674); 42053var ContensisApplicationError = /** @class */ (function (_super) { 42054 tslib_1.__extends(ContensisApplicationError, _super); 42055 function ContensisApplicationError(message) { 42056 var _newTarget = this.constructor; 42057 var _this = _super.call(this, message) || this; 42058 _this.name = 'ContensisApplicationError'; 42059 Object.setPrototypeOf(_this, _newTarget.prototype); 42060 return _this; 42061 } 42062 return ContensisApplicationError; 42063}(Error)); 42064exports.ContensisApplicationError = ContensisApplicationError; 42065var ContensisAuthenticationError = /** @class */ (function (_super) { 42066 tslib_1.__extends(ContensisAuthenticationError, _super); 42067 function ContensisAuthenticationError(message) { 42068 var _newTarget = this.constructor; 42069 var _this = _super.call(this, message) || this; 42070 _this.name = 'ContensisAuthenticationError'; 42071 Object.setPrototypeOf(_this, _newTarget.prototype); 42072 return _this; 42073 } 42074 return ContensisAuthenticationError; 42075}(Error)); 42076exports.ContensisAuthenticationError = ContensisAuthenticationError; 42077 42078 42079/***/ }, 42080 42081/***/ 32439 42082(__unused_webpack_module, exports, __webpack_require__) { 42083 42084"use strict"; 42085 42086Object.defineProperty(exports, "__esModule", ({ value: true })); 42087var tslib_1 = __webpack_require__(8674);
42088tslib_1.__exportStar(__webpack_require__(60894), exports); 42089tslib_1.__exportStar(__webpack_require__(55384), exports); 42090tslib_1.__exportStar(__webpack_require__(24656), exports); 42091tslib_1.__exportStar(__webpack_require__(77191), exports); 42092tslib_1.__exportStar(__webpack_require__(93682), exports); 42093tslib_1.__exportStar(__webpack_require__(45921), exports); 42094tslib_1.__exportStar(__webpack_require__(13821), exports); 42095tslib_1.__exportStar(__webpack_require__(33413), exports); 42096tslib_1.__exportStar(__webpack_require__(2432), exports); 42097tslib_1.__exportStar(__webpack_require__(31602), exports); 42098tslib_1.__exportStar(__webpack_require__(19910), exports); 42099tslib_1.__exportStar(__webpack_require__(55607), exports); 42100tslib_1.__exportStar(__webpack_require__(231), exports); 42101tslib_1.__exportStar(__webpack_require__(40603), exports); 42102tslib_1.__exportStar(__webpack_require__(109), exports); 42103tslib_1.__exportStar(__webpack_require__(32522), exports); 42104tslib_1.__exportStar(__webpack_require__(96886), exports); 42105tslib_1.__exportStar(__webpack_require__(32240), exports); 42106tslib_1.__exportStar(__webpack_require__(11050), exports); 42107tslib_1.__exportStar(__webpack_require__(60517), exports); 42108tslib_1.__exportStar(__webpack_require__(20198), exports); 42109tslib_1.__exportStar(__webpack_require__(76896), exports); 42110tslib_1.__exportStar(__webpack_require__(77558), exports); 42111tslib_1.__exportStar(__webpack_require__(87582), exports); 42112tslib_1.__exportStar(__webpack_require__(47395), exports); 42113tslib_1.__exportStar(__webpack_require__(56922), exports); 42114tslib_1.__exportStar(__webpack_require__(44181), exports); 42115 42116 42117/***/ }, 42118 42119/***/ 46566 42120(__unused_webpack_module, exports) { 42121 42122"use strict"; 42123 42124Object.defineProperty(exports, "__esModule", ({ value: true })); 42125; 42126 42127 42128/***/ }, 42129 42130/***/ 51693 42131(__unused_webpack_module, exports) { 42132 42133"use strict"; 42134 42135Object.defineProperty(exports, "__esModule", ({ value: true })); 42136 42137 42138/***/ }, 42139 42140/***/ 73526 42141(__unused_webpack_module, exports) { 42142 42143"use strict"; 42144 42145Object.defineProperty(exports, "__esModule", ({ value: true })); 42146 42147 42148/***/ }, 42149 42150/***/ 52046 42151(__unused_webpack_module, exports) { 42152 42153"use strict"; 42154 42155Object.defineProperty(exports, "__esModule", ({ value: true })); 42156 42157 42158/***/ }, 42159 42160/***/ 48437 42161(__unused_webpack_module, exports) { 42162 42163"use strict"; 42164 42165Object.defineProperty(exports, "__esModule", ({ value: true })); 42166 42167 42168/***/ }, 42169 42170/***/ 96213 42171(__unused_webpack_module, exports) { 42172 42173"use strict"; 42174 42175Object.defineProperty(exports, "__esModule", ({ value: true })); 42176 42177 42178/***/ }, 42179 42180/***/ 31892 42181(__unused_webpack_module, exports) { 42182 42183"use strict"; 42184 42185Object.defineProperty(exports, "__esModule", ({ value: true })); 42186 42187 42188/***/ }, 42189 42190/***/ 20073 42191(__unused_webpack_module, exports) { 42192 42193"use strict"; 42194 42195Object.defineProperty(exports, "__esModule", ({ value: true })); 42196exports.ExpressionTimePrecisionEnum = void 0; 42197exports.ExpressionTimePrecisionEnum = { 42198 Minutes: 'minutes', 42199 Seconds: 'seconds', 42200 Exact: 'exact' 42201}; 42202 42203 42204/***/ }, 42205 42206/***/ 12311 42207(__unused_webpack_module, exports) { 42208 42209"use strict"; 42210 42211Object.defineProperty(exports, "__esModule", ({ value: true })); 42212exports.ExpressionValueTypeEnum = void 0; 42213exports.ExpressionValueTypeEnum = { 42214 Single: 'single', 42215 Array: 'array', 42216 Unknown: 'unknown' 42217}; 42218 42219 42220/***/ }, 42221 42222/***/ 60998 42223(__unused_webpack_module, exports) { 42224 42225"use strict"; 42226 42227Object.defineProperty(exports, "__esModule", ({ value: true })); 42228 42229 42230/***/ }, 42231 42232/***/ 21423 42233(__unused_webpack_module, exports) { 42234 42235"use strict"; 42236 42237Object.defineProperty(exports, "__esModule", ({ value: true })); 42238exports.FreeTextSearchOperatorTypeEnum = void 0; 42239exports.FreeTextSearchOperatorTypeEnum = { 42240 And: 'and', 42241 Or: 'or' 42242}; 42243 42244 42245/***/ }, 42246 42247/***/ 52009 42248(__unused_webpack_module, exports) { 42249 42250"use strict"; 42251 42252Object.defineProperty(exports, "__esModule", ({ value: true })); 42253 42254 42255/***/ }, 42256 42257/***/ 69378 42258(__unused_webpack_module, exports) { 42259 42260"use strict"; 42261 42262Object.defineProperty(exports, "__esModule", ({ value: true })); 42263 42264 42265/***/ }, 42266 42267/***/ 93879 42268(__unused_webpack_module, exports) { 42269 42270"use strict"; 42271 42272Object.defineProperty(exports, "__esModule", ({ value: true })); 42273 42274 42275/***/ }, 42276 42277/***/ 52597 42278(__unused_webpack_module, exports, __webpack_require__) { 42279 42280"use strict"; 42281 42282Object.defineProperty(exports, "__esModule", ({ value: true })); 42283exports.ManagementQuery = void 0; 42284var Operators_1 = __webpack_require__(67813); 42285var QueryTypes_1 = __webpack_require__(45479); 42286var ManagementQuery = /** @class */ (function () { 42287 function ManagementQuery() { 42288 var whereExpressions = []; 42289 for (var _i = 0; _i < arguments.length; _i++) { 42290 whereExpressions[_i] = arguments[_i]; 42291 } 42292 this.where = new Operators_1.WhereExpression(); 42293 this.orderBy = []; 42294 this.pageIndex = 0; 42295 this.pageSize = 20; 42296 this.includeArchived = false; 42297 this.includeDeleted = false; 42298 this.aggregations = {}; 42299 if (whereExpressions) { 42300 this.where.addRange(whereExpressions); 42301 } 42302 } 42303 ManagementQuery.prototype.toJSON = function () { 42304 var result = {}; 42305 result.pageIndex = this.pageIndex; 42306 result.pageSize = this.pageSize; 42307 var orderByDtos = (0, QueryTypes_1.serializeOrder)(this.orderBy); 42308 if (orderByDtos && orderByDtos.length > 0) { 42309 result.orderBy = orderByDtos; 42310 } 42311 result.where = this.where; 42312 result.includeArchived = this.includeArchived; 42313 result.includeDeleted = this.includeDeleted; 42314 if (Object.keys(this.aggregations || {}).length) 42315 result.aggregations = this.aggregations; 42316 return result; 42317 }; 42318 return ManagementQuery; 42319}()); 42320exports.ManagementQuery = ManagementQuery; 42321 42322 42323/***/ }, 42324 42325/***/ 93401
42326(__unused_webpack_module, exports) { 42327 42328"use strict"; 42329 42330Object.defineProperty(exports, "__esModule", ({ value: true })); 42331exports.ManagementZenqlQuery = void 0; 42332var ManagementZenqlQuery = /** @class */ (function () { 42333 function ManagementZenqlQuery(zenql) { 42334 this.zenql = ''; 42335 this.pageIndex = 0; 42336 this.pageSize = 20; 42337 this.includeArchived = false; 42338 this.includeDeleted = false; 42339 this.aggregations = {}; 42340 this.zenql = zenql; 42341 } 42342 ManagementZenqlQuery.prototype.toJSON = function () { 42343 var result = {}; 42344 result.pageIndex = this.pageIndex; 42345 result.pageSize = this.pageSize; 42346 result.zenql = this.zenql; 42347 result.includeArchived = this.includeArchived; 42348 result.includeDeleted = this.includeDeleted; 42349 if (Object.keys(this.aggregations || {}).length) 42350 result.aggregations = this.aggregations; 42351 return result; 42352 }; 42353 return ManagementZenqlQuery; 42354}()); 42355exports.ManagementZenqlQuery = ManagementZenqlQuery; 42356 42357 42358/***/ }, 42359 42360/***/ 7622 42361(__unused_webpack_module, exports) { 42362 42363"use strict"; 42364 42365Object.defineProperty(exports, "__esModule", ({ value: true })); 42366exports.OperatorTypeEnum = void 0; 42367exports.OperatorTypeEnum = { 42368 And: 'and', 42369 Between: 'between', 42370 Contains: 'contains', 42371 EndsWith: 'endsWith', 42372 EqualTo: 'equalTo', 42373 Exists: 'exists', 42374 FreeText: 'freeText', 42375 GreaterThan: 'greaterThan', 42376 GreaterThanOrEqualTo: 'greaterThanOrEqualTo', 42377 In: 'in', 42378 LessThan: 'lessThan', 42379 LessThanOrEqualTo: 'lessThanOrEqualTo', 42380 Not: 'not', 42381 Or: 'or', 42382 StartsWith: 'startsWith', 42383 Where: 'where', 42384 DistanceWithin: 'distanceWithin' 42385}; 42386 42387 42388/***/ }, 42389 42390/***/ 67813 42391(__unused_webpack_module, exports, __webpack_require__) { 42392 42393"use strict"; 42394 42395Object.defineProperty(exports, "__esModule", ({ value: true })); 42396exports.Operators = exports.WhereExpression = exports.LogicalExpression = exports.ExpressionBase = void 0; 42397var tslib_1 = __webpack_require__(8674); 42398var __1 = __webpack_require__(32439); 42399var utils_1 = __webpack_require__(25201); 42400var ExpressionTimePrecision_1 = __webpack_require__(20073); 42401var FreeTextSearchOperatorType_1 = __webpack_require__(21423); 42402var ExpressionBase = /** @class */ (function () { 42403 function ExpressionBase(fieldName, values, operatorName, valueType) { 42404 if (values === void 0) { values = []; } 42405 this.fieldName = fieldName; 42406 this.values = values; 42407 this.operatorName = operatorName; 42408 this.valueType = valueType; 42409 this._weight = 0; 42410 } 42411 ExpressionBase.prototype.addValue = function (value) { 42412 this.values[this.values.length] = value; 42413 return this; 42414 }; 42415 ExpressionBase.prototype.weight = function (weight) { 42416 this._weight = weight; 42417 return this; 42418 }; 42419 ExpressionBase.prototype.toJSON = function () { 42420 var result = {}; 42421 if (this.fieldName) { 42422 result.field = this.fieldName; 42423 } 42424 if (this.valueType === __1.ExpressionValueTypeEnum.Single) { 42425 result[this.operatorName] = this.values[0]; 42426 } 42427 else if (this.valueType === __1.ExpressionValueTypeEnum.Array) { 42428 result[this.operatorName] = this.values; 42429 } 42430 else if (this.values && (this.values.length === 1)) { 42431 result[this.operatorName] = this.values[0]; 42432 } 42433 else { 42434 result[this.operatorName] = this.values; 42435 } 42436 if (this._weight && (this._weight > 1)) { 42437 result.weight = this._weight; 42438 } 42439 return result; 42440 }; 42441 return ExpressionBase; 42442}()); 42443exports.ExpressionBase = ExpressionBase; 42444var LogicalExpression = /** @class */ (function (_super) { 42445 tslib_1.__extends(LogicalExpression, _super); 42446 function LogicalExpression(values, operatorName, valueType) { 42447 if (values === void 0) { values = []; } 42448 return _super.call(this, null, values, operatorName, __1.ExpressionValueTypeEnum.Array) || this; 42449 } 42450 LogicalExpression.prototype.getItem = function (index) { 42451 return this.values[index]; 42452 }; 42453 LogicalExpression.prototype.setItem = function (index, item) { 42454 this.values[index] = item; 42455 return this; 42456 }; 42457 LogicalExpression.prototype.add = function (item) { 42458 this.values[this.values.length] = item; 42459 return this; 42460 }; 42461 LogicalExpression.prototype.addRange = function (items) { 42462 Array.prototype.push.apply(this.values, items); 42463 return this; 42464 }; 42465 LogicalExpression.prototype.indexOf = function (item) { 42466 return this.values.indexOf(item); 42467 }; 42468 LogicalExpression.prototype.insert = function (index, item) { 42469 this.values.splice(index, 0, item); 42470 return this; 42471 }; 42472 LogicalExpression.prototype.remove = function (item) { 42473 var index = this.indexOf(item); 42474 if (index >= 0) { 42475 this.removeAt(index); 42476 return true; 42477 } 42478 return false; 42479 }; 42480 LogicalExpression.prototype.removeAt = function (index) { 42481 this.values.splice(index, 1); 42482 return this; 42483 }; 42484 LogicalExpression.prototype.clear = function () { 42485 this.values.length = 0; 42486 return this; 42487 }; 42488 LogicalExpression.prototype.contains = function (item) { 42489 return (this.indexOf(item) >= 0); 42490 }; 42491 LogicalExpression.prototype.count = function () { 42492 return this.values.length; 42493 }; 42494 return LogicalExpression; 42495}(ExpressionBase)); 42496exports.LogicalExpression = LogicalExpression; 42497var AndExpression = /** @class */ (function (_super) { 42498 tslib_1.__extends(AndExpression, _super); 42499 function AndExpression(values) { 42500 return _super.call(this, values, __1.OperatorTypeEnum.And, __1.ExpressionValueTypeEnum.Array) || this; 42501 } 42502 return AndExpression; 42503}(LogicalExpression)); 42504var BetweenExpression = /** @class */ (function (_super) { 42505 tslib_1.__extends(BetweenExpression, _super); 42506 function BetweenExpression(fieldName, minimum, maximum, timePrecision) { 42507 return _super.call(this, fieldName, (0, utils_1.fixDates)([minimum, maximum], timePrecision), __1.OperatorTypeEnum.Between, __1.ExpressionValueTypeEnum.Array) || this; 42508 } 42509 return BetweenExpression; 42510}(ExpressionBase)); 42511var ContainsExpression = /** @class */ (function (_super) { 42512 tslib_1.__extends(ContainsExpression, _super); 42513 function ContainsExpression(fieldName, value) { 42514 return _super.call(this, fieldName, [value], __1.OperatorTypeEnum.Contains, __1.ExpressionValueTypeEnum.Single) || this; 42515 } 42516 return ContainsExpression; 42517}(ExpressionBase)); 42518var DistanceWithinExpression = /** @class */ (function (_super) { 42519 tslib_1.__extends(DistanceWithinExpression, _super); 42520 function DistanceWithinExpression(fieldName, value) { 42521 return _super.call(this, fieldName, [value], __1.OperatorTypeEnum.DistanceWithin, __1.ExpressionValueTypeEnum.Single) || this; 42522 } 42523 return DistanceWithinExpression; 42524}(ExpressionBase)); 42525var EndsWithExpression = /** @class */ (function (_super) { 42526 tslib_1.__extends(EndsWithExpression, _super); 42527 function EndsWithExpression(fieldName, value) { 42528 return _super.call(this, fieldName, [value], __1.OperatorTypeEnum.EndsWith, __1.ExpressionValueTypeEnum.Single) || this; 42529 } 42530 return EndsWithExpression; 42531}(ExpressionBase)); 42532var EqualToExpression = /** @class */ (function (_super) { 42533 tslib_1.__extends(EqualToExpression, _super); 42534 function EqualToExpression(fieldName, value) { 42535 return _super.call(this, fieldName, [value], __1.OperatorTypeEnum.EqualTo, __1.ExpressionValueTypeEnum.Single) || this; 42536 } 42537 return EqualToExpression; 42538}(ExpressionBase)); 42539var ExistsExpression = /** @class */ (function (_super) { 42540 tslib_1.__extends(ExistsExpression, _super); 42541 function ExistsExpression(fieldName, value) { 42542 return _super.call(this, fieldName, [value], __1.OperatorTypeEnum.Exists, __1.ExpressionValueTypeEnum.Single) || this; 42543 } 42544 return ExistsExpression; 42545}(ExpressionBase)); 42546var FreeTextExpression = /** @class */ (function (_super) { 42547 tslib_1.__extends(FreeTextExpression, _super); 42548 function FreeTextExpression(fieldName, value) { 42549 return _super.call(this, fieldName, [value], __1.OperatorTypeEnum.FreeText, __1.ExpressionValueTypeEnum.Single) || this; 42550 } 42551 return FreeTextExpression; 42552}(ExpressionBase)); 42553var GreaterThanExpression = /** @class */ (function (_super) { 42554 tslib_1.__extends(GreaterThanExpression, _super); 42555 function GreaterThanExpression(fieldName, value, timePrecision) { 42556 return _super.call(this, fieldName, (0, utils_1.fixDates)([value], timePrecision), __1.OperatorTypeEnum.GreaterThan, __1.ExpressionValueTypeEnum.Single) || this; 42557 } 42558 return GreaterThanExpression; 42559}(ExpressionBase)); 42560var GreaterThanOrEqualToExpression = /** @class */ (function (_super) { 42561 tslib_1.__extends(GreaterThanOrEqualToExpression, _super); 42562 function GreaterThanOrEqualToExpression(fieldName, value, timePrecision) { 42563 return _super.call(this, fieldName, (0, utils_1.fixDates)([value], timePrecision), __1.OperatorTypeEnum.GreaterThanOrEqualTo, __1.ExpressionValueTypeEnum.Single) || this; 42564 } 42565 return GreaterThanOrEqualToExpression; 42566}(ExpressionBase)); 42567var InExpression = /** @class */ (function (_super) { 42568 tslib_1.__extends(InExpression, _super); 42569 function InExpression(fieldName, values) { 42570 return _super.call(this, fieldName, values, __1.OperatorTypeEnum.In, __1.ExpressionValueTypeEnum.Array) || this; 42571 } 42572 return InExpression; 42573}(ExpressionBase)); 42574var LessThanExpression = /** @class */ (function (_super) { 42575 tslib_1.__extends(LessThanExpression, _super); 42576 function LessThanExpression(fieldName, value, timePrecision) { 42577 return _super.call(this, fieldName, (0, utils_1.fixDates)([value], timePrecision), __1.OperatorTypeEnum.LessThan, __1.ExpressionValueTypeEnum.Single) || this; 42578 } 42579 return LessThanExpression; 42580}(ExpressionBase)); 42581var LessThanOrEqualToExpression = /** @class */ (function (_super) { 42582 tslib_1.__extends(LessThanOrEqualToExpression, _super); 42583 function LessThanOrEqualToExpression(fieldName, value, timePrecision) { 42584 return _super.call(this, fieldName, (0, utils_1.fixDates)([value], timePrecision), __1.OperatorTypeEnum.LessThanOrEqualTo, __1.ExpressionValueTypeEnum.Single) || this; 42585 } 42586 return LessThanOrEqualToExpression; 42587}(ExpressionBase)); 42588var NotExpression = /** @class */ (function (_super) { 42589 tslib_1.__extends(NotExpression, _super); 42590 function NotExpression(value) { 42591 return _super.call(this, [value], __1.OperatorTypeEnum.Not, __1.ExpressionValueTypeEnum.Single) || this; 42592 } 42593 return NotExpression; 42594}(LogicalExpression)); 42595var OrExpression = /** @class */ (function (_super) { 42596 tslib_1.__extends(OrExpression, _super); 42597 function OrExpression(values) { 42598 return _super.call(this, values, __1.OperatorTypeEnum.Or, __1.ExpressionValueTypeEnum.Array) || this; 42599 } 42600 return OrExpression; 42601}(LogicalExpression)); 42602var StartsWithExpression = /** @class */ (function (_super) { 42603 tslib_1.__extends(StartsWithExpression, _super); 42604 function StartsWithExpression(fieldName, value) { 42605 return _super.call(this, fieldName, [value], __1.OperatorTypeEnum.StartsWith, __1.ExpressionValueTypeEnum.Single) || this; 42606 } 42607 return StartsWithExpression; 42608}(ExpressionBase)); 42609var WhereExpression = /** @class */ (function (_super) { 42610 tslib_1.__extends(WhereExpression, _super); 42611 function WhereExpression(values) { 42612 if (values === void 0) { values = []; } 42613 return _super.call(this, values, __1.OperatorTypeEnum.Where, __1.ExpressionValueTypeEnum.Array) || this; 42614 } 42615 WhereExpression.prototype.toJSON = function () { 42616 var result = _super.prototype.toJSON.call(this); 42617 return result[__1.OperatorTypeEnum.Where]; 42618 }; 42619 return WhereExpression; 42620}(LogicalExpression)); 42621exports.WhereExpression = WhereExpression; 42622var Operators = /** @class */ (function () { 42623 function Operators() { 42624 } 42625 Operators.prototype.and = function () { 42626 var values = []; 42627 for (var _i = 0; _i < arguments.length; _i++) { 42628 values[_i] = arguments[_i]; 42629 } 42630 return new AndExpression(values); 42631 }; 42632 Operators.prototype.between = function (name, minimum, maximum, timePrecision) { 42633 if (timePrecision === void 0) { timePrecision = ExpressionTimePrecision_1.ExpressionTimePrecisionEnum.Minutes; } 42634 return new BetweenExpression(name, minimum, maximum, timePrecision); 42635 }; 42636 Operators.prototype.contains = function (name, value) { 42637 return new ContainsExpression(name, value); 42638 }; 42639 Operators.prototype.distanceWithin = function (name, lat, lon, distance) { 42640 return new DistanceWithinExpression(name, { lat: lat, lon: lon, distance: distance }); 42641 }; 42642 Operators.prototype.endsWith = function (name, value) { 42643 return new EndsWithExpression(name, value); 42644 }; 42645 Operators.prototype.equalTo = function (name, value) { 42646 return new EqualToExpression(name, value); 42647 }; 42648 Operators.prototype.exists = function (name, value) { 42649 return new ExistsExpression(name, value); 42650 }; 42651 Operators.prototype.freeText = function (name, term, fuzzy, operator) { 42652 if (fuzzy === void 0) { fuzzy = false; } 42653 if (operator === void 0) { operator = FreeTextSearchOperatorType_1.FreeTextSearchOperatorTypeEnum.And; } 42654 return new FreeTextExpression(name, { term: term, fuzzy: fuzzy, operator: operator }); 42655 }; 42656 Operators.prototype.greaterThan = function (name, value, timePrecision) { 42657 if (timePrecision === void 0) { timePrecision = ExpressionTimePrecision_1.ExpressionTimePrecisionEnum.Minutes; } 42658 return new GreaterThanExpression(name, value, timePrecision); 42659 }; 42660 Operators.prototype.greaterThanOrEqualTo = function (name, value, timePrecision) { 42661 if (timePrecision === void 0) { timePrecision = ExpressionTimePrecision_1.ExpressionTimePrecisionEnum.Minutes; } 42662 return new GreaterThanOrEqualToExpression(name, value, timePrecision); 42663 }; 42664 Operators.prototype.in = function (name) { 42665 var values = []; 42666 for (var _i = 1; _i < arguments.length; _i++) { 42667 values[_i - 1] = arguments[_i]; 42668 } 42669 return new InExpression(name, values); 42670 }; 42671 Operators.prototype.lessThan = function (name, value, timePrecision) { 42672 if (timePrecision === void 0) { timePrecision = ExpressionTimePrecision_1.ExpressionTimePrecisionEnum.Minutes; } 42673 return new LessThanExpression(name, value, timePrecision); 42674 }; 42675 Operators.prototype.lessThanOrEqualTo = function (name, value, timePrecision) { 42676 if (timePrecision === void 0) { timePrecision = ExpressionTimePrecision_1.ExpressionTimePrecisionEnum.Minutes; } 42677 return new LessThanOrEqualToExpression(name, value, timePrecision); 42678 }; 42679 Operators.prototype.not = function (expression) { 42680 return new NotExpression(expression); 42681 }; 42682 Operators.prototype.or = function () { 42683 var values = []; 42684 for (var _i = 0; _i < arguments.length; _i++) { 42685 values[_i] = arguments[_i]; 42686 } 42687 return new OrExpression(values); 42688 }; 42689 Operators.prototype.startsWith = function (name, value) { 42690 return new StartsWithExpression(name, value); 42691 }; 42692 return Operators; 42693}()); 42694exports.Operators = Operators; 42695 42696 42697/***/ }, 42698 42699/***/ 25259 42700(__unused_webpack_module, exports, __webpack_require__) { 42701 42702"use strict"; 42703 42704Object.defineProperty(exports, "__esModule", ({ value: true })); 42705exports.OrderByFactory = void 0; 42706var Ordering_1 = __webpack_require__(66834); 42707var OrderByFactory = /** @class */ (function () { 42708 function OrderByFactory() { 42709 } 42710 OrderByFactory.prototype.asc = function (fieldName) { 42711 return (new Ordering_1.Ordering()).asc(fieldName); 42712 }; 42713 OrderByFactory.prototype.desc = function (fieldName) { 42714 return (new Ordering_1.Ordering()).desc(fieldName); 42715 }; 42716 return OrderByFactory;
42717}()); 42718exports.OrderByFactory = OrderByFactory; 42719 42720 42721/***/ }, 42722 42723/***/ 66834 42724(__unused_webpack_module, exports) { 42725 42726"use strict"; 42727 42728Object.defineProperty(exports, "__esModule", ({ value: true })); 42729exports.Ordering = void 0; 42730var Ordering = /** @class */ (function () { 42731 function Ordering() { 42732 this._items = []; 42733 } 42734 Ordering.prototype.asc = function (fieldName) { 42735 this._items.push({ 'asc': fieldName }); 42736 return this; 42737 }; 42738 Ordering.prototype.desc = function (fieldName) { 42739 this._items.push({ 'desc': fieldName }); 42740 return this; 42741 }; 42742 Ordering.prototype.toArray = function () { 42743 return this._items; 42744 }; 42745 return Ordering; 42746}()); 42747exports.Ordering = Ordering; 42748 42749 42750/***/ }, 42751 42752/***/ 60205 42753(__unused_webpack_module, exports) { 42754 42755"use strict"; 42756 42757Object.defineProperty(exports, "__esModule", ({ value: true })); 42758 42759 42760/***/ }, 42761 42762/***/ 7700 42763(__unused_webpack_module, exports) { 42764 42765"use strict"; 42766 42767Object.defineProperty(exports, "__esModule", ({ value: true })); 42768 42769 42770/***/ }, 42771 42772/***/ 64027 42773(__unused_webpack_module, exports) { 42774 42775"use strict"; 42776 42777Object.defineProperty(exports, "__esModule", ({ value: true })); 42778 42779 42780/***/ }, 42781 42782/***/ 45479 42783(__unused_webpack_module, exports, __webpack_require__) { 42784 42785"use strict"; 42786 42787Object.defineProperty(exports, "__esModule", ({ value: true })); 42788exports.serializeOrder = exports.OrderBy = exports.Op = void 0; 42789var Operators_1 = __webpack_require__(67813); 42790var OrderByFactory_1 = __webpack_require__(25259); 42791var Ordering_1 = __webpack_require__(66834); 42792exports.Op = new Operators_1.Operators(); 42793exports.OrderBy = new OrderByFactory_1.OrderByFactory(); 42794function toOrderByDto(value) { 42795 var _a; 42796 if (!value) { 42797 return null; 42798 } 42799 if (typeof value === 'string') { 42800 var firstChar = value.substring(0, 1); 42801 if (firstChar === '+' || firstChar === '-') { 42802 var direction = (firstChar === '-') ? 'desc' : 'asc'; 42803 return _a = {}, _a[direction] = value.substring(1), _a; 42804 } 42805 return { 'asc': value }; 42806 } 42807 return value; 42808} 42809function serializeOrder(orderBy) { 42810 if (!orderBy) { 42811 return []; 42812 } 42813 if (typeof orderBy === 'string') { 42814 var o = toOrderByDto(orderBy); 42815 return !!o ? [o] : []; 42816 } 42817 if (Array.isArray(orderBy)) { 42818 return orderBy.map(toOrderByDto).filter(function (o) { return !!o; }); 42819 } 42820 var orderByAsOrdering = orderBy instanceof Ordering_1.Ordering ? orderBy : null; 42821 if (orderByAsOrdering === null) { 42822 return []; 42823 } 42824 return orderByAsOrdering.toArray(); 42825} 42826exports.serializeOrder = serializeOrder; 42827 42828 42829/***/ }, 42830 42831/***/ 38158 42832(__unused_webpack_module, exports) { 42833 42834"use strict"; 42835 42836Object.defineProperty(exports, "__esModule", ({ value: true })); 42837exports.ZenqlQuery = void 0; 42838var ZenqlQuery = /** @class */ (function () { 42839 function ZenqlQuery(zenql) { 42840 this.zenql = ''; 42841 this.pageIndex = 0; 42842 this.pageSize = 20; 42843 this.fieldLinkDepths = {}; 42844 this.fields = []; 42845 this.aggregations = {}; 42846 this.zenql = zenql; 42847 } 42848 ZenqlQuery.prototype.toJSON = function () { 42849 var result = {}; 42850 result.pageIndex = this.pageIndex; 42851 result.pageSize = this.pageSize; 42852 result.zenql = this.zenql; 42853 if (this.fields && this.fields.length > 0) { 42854 result.fields = this.fields; 42855 } 42856 if (this.fieldLinkDepths && Object.keys(this.fieldLinkDepths).length > 0) { 42857 result.fieldLinkDepths = this.fieldLinkDepths; 42858 } 42859 if (this.aggregations && Object.keys(this.aggregations).length > 0) { 42860 result.aggregations = this.aggregations; 42861 } 42862 return result; 42863 }; 42864 return ZenqlQuery; 42865}()); 42866exports.ZenqlQuery = ZenqlQuery; 42867 42868 42869/***/ }, 42870 42871/***/ 76896 42872(__unused_webpack_module, exports, __webpack_require__) { 42873 42874"use strict"; 42875 42876Object.defineProperty(exports, "__esModule", ({ value: true })); 42877var tslib_1 = __webpack_require__(8674); 42878tslib_1.__exportStar(__webpack_require__(46566), exports);
42879tslib_1.__exportStar(__webpack_require__(51693), exports); 42880tslib_1.__exportStar(__webpack_require__(73526), exports); 42881tslib_1.__exportStar(__webpack_require__(52046), exports); 42882tslib_1.__exportStar(__webpack_require__(48437), exports); 42883tslib_1.__exportStar(__webpack_require__(96213), exports); 42884tslib_1.__exportStar(__webpack_require__(31892), exports); 42885tslib_1.__exportStar(__webpack_require__(12311), exports); 42886tslib_1.__exportStar(__webpack_require__(60998), exports); 42887tslib_1.__exportStar(__webpack_require__(21423), exports); 42888tslib_1.__exportStar(__webpack_require__(52009), exports); 42889tslib_1.__exportStar(__webpack_require__(69378), exports); 42890tslib_1.__exportStar(__webpack_require__(93879), exports); 42891tslib_1.__exportStar(__webpack_require__(52597), exports); 42892tslib_1.__exportStar(__webpack_require__(93401), exports); 42893tslib_1.__exportStar(__webpack_require__(67813), exports); 42894tslib_1.__exportStar(__webpack_require__(7622), exports); 42895tslib_1.__exportStar(__webpack_require__(60205), exports); 42896tslib_1.__exportStar(__webpack_require__(34784), exports); 42897tslib_1.__exportStar(__webpack_require__(7700), exports); 42898tslib_1.__exportStar(__webpack_require__(64027), exports); 42899tslib_1.__exportStar(__webpack_require__(45479), exports); 42900tslib_1.__exportStar(__webpack_require__(38158), exports); 42901 42902 42903/***/ }, 42904 42905/***/ 34784 42906(__unused_webpack_module, exports, __webpack_require__) { 42907 42908"use strict"; 42909 42910Object.defineProperty(exports, "__esModule", ({ value: true })); 42911exports.Query = void 0; 42912var Operators_1 = __webpack_require__(67813); 42913var QueryTypes_1 = __webpack_require__(45479); 42914var Query = /** @class */ (function () { 42915 function Query() { 42916 var whereExpressions = []; 42917 for (var _i = 0; _i < arguments.length; _i++) { 42918 whereExpressions[_i] = arguments[_i]; 42919 } 42920 this.where = new Operators_1.WhereExpression(); 42921 this.orderBy = []; 42922 this.pageIndex = 0; 42923 this.pageSize = 20; 42924 this.fieldLinkDepths = {}; 42925 this.fields = []; 42926 this.aggregations = {}; 42927 if (whereExpressions) { 42928 this.where.addRange(whereExpressions); 42929 } 42930 } 42931 Query.prototype.toJSON = function () { 42932 var result = {}; 42933 result.pageIndex = this.pageIndex; 42934 result.pageSize = this.pageSize; 42935 var orderByDtos = (0, QueryTypes_1.serializeOrder)(this.orderBy); 42936 if (orderByDtos && orderByDtos.length > 0) { 42937 result.orderBy = orderByDtos; 42938 } 42939 result.where = this.where; 42940 if (this.fields && this.fields.length > 0) { 42941 result.fields = this.fields; 42942 } 42943 if (this.fieldLinkDepths && Object.keys(this.fieldLinkDepths).length > 0) { 42944 result.fieldLinkDepths = this.fieldLinkDepths; 42945 } 42946 if (this.aggregations && Object.keys(this.aggregations).length > 0) { 42947 result.aggregations = this.aggregations; 42948 } 42949 return result; 42950 }; 42951 return Query; 42952}()); 42953exports.Query = Query; 42954 42955 42956/***/ }, 42957 42958/***/ 25201 42959(__unused_webpack_module, exports, __webpack_require__) { 42960 42961"use strict"; 42962 42963Object.defineProperty(exports, "__esModule", ({ value: true })); 42964exports.fixDates = exports.defaultMapperForLatestVersionStatus = exports.defaultMapperForPublishedVersionStatus = exports.defaultMapperForLanguage = exports.isNodejs = exports.isIE = exports.isBrowser = exports.isString = exports.toQuery = exports.hasProp = void 0; 42965var isNode = __webpack_require__(74021); 42966function hasProp(o, key) { 42967 return !!o && typeof o[key] !== 'undefined'; 42968} 42969exports.hasProp = hasProp; 42970function toQuery(values, dontSort) { 42971 if (dontSort === void 0) { dontSort = false; } 42972 var keys = Object 42973 .keys(values) 42974 .filter(function (key) { 42975 return key && (values[key] !== null) 42976 && (values[key] !== '') 42977 && (Array.isArray(values[key]) ? values[key].length > 0 : true); 42978 }); 42979 if (!dontSort) { 42980 keys.sort(); // sort keys for easier testing 42981 } 42982 var query = keys 42983 .map(function (key) { return encodeURIComponent(key) + '=' + encodeURIComponent(values[key]); }); 42984 return (query.length > 0) 42985 ? '?' + query.join('&') 42986 : ''; 42987} 42988exports.toQuery = toQuery; 42989function isString(obj) { 42990 return typeof obj === 'string' || obj instanceof String; 42991} 42992exports.isString = isString; 42993/** Checks if the runtime context is a browser */ 42994function isBrowser() { 42995 return typeof window !== 'undefined'; 42996} 42997exports.isBrowser = isBrowser; 42998/** 42999 * Checks if the current browser is IE. 43000 * 43001 * Support: IE 9-11 only 43002 * documentMode is an IE-only property
43003 * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx 43004 */ 43005function isIE() { 43006 var msie; // holds major version number for IE, or NaN if UA is not IE. 43007 msie = (window && window.document && window.document.documentMode) ? window.document.documentMode : null; 43008 return !!msie && msie <= 11; 43009} 43010exports.isIE = isIE; 43011/** Checks if the runtime context is Node.js */ 43012function isNodejs() { 43013 return isNode; 43014} 43015exports.isNodejs = isNodejs; 43016var defaultMapperForLanguage = function (value, options, params) { 43017 return !value && !!params ? params.language : value; 43018}; 43019exports.defaultMapperForLanguage = defaultMapperForLanguage; 43020var defaultMapperForPublishedVersionStatus = function (value, options, params) { 43021 return (value === 'published') ? null : value; 43022}; 43023exports.defaultMapperForPublishedVersionStatus = defaultMapperForPublishedVersionStatus; 43024var defaultMapperForLatestVersionStatus = function (value, options, params) { 43025 return (value === 'latest') ? null : value; 43026}; 43027exports.defaultMapperForLatestVersionStatus = defaultMapperForLatestVersionStatus; 43028/** 43029 * Prevent users from unintentionally providing date values with seconds or milliseconds that break request caching. 43030 * For each top-level entry in the `values` array that is a Date object or a string 43031 * that can be parsed as a date, the value is normalized according to `timePrecision`: 43032 * - `'minutes'`: seconds and milliseconds are set to 0. 43033 * - `'seconds'`: seconds are preserved and milliseconds are set to 0. 43034 * - `'exact'`: the original value is preserved unchanged. 43035 * @param values - array of values provided to the query operator; each top-level Date or date-like string will be transformed 43036 * @param timePrecision - controls how precisely time information is preserved: `'minutes'`, `'seconds'`, or `'exact'` 43037 */ 43038var fixDates = function (values, timePrecision) { 43039 if (timePrecision === 'exact') 43040 return values; 43041 try { 43042 return values.map(function (value) { 43043 var fixDate = value instanceof Date 43044 ? value 43045 : ((isString(value) && !isNaN(Date.parse(value))) 43046 ? new Date(value) : null); 43047 if (!fixDate) 43048 return value; 43049 // Preserve timezone by manipulating UTC fields 43050 var year = fixDate.getUTCFullYear(); 43051 var month = fixDate.getUTCMonth(); 43052 var date = fixDate.getUTCDate(); 43053 var hours = fixDate.getUTCHours(); 43054 var minutes = fixDate.getUTCMinutes(); 43055 var seconds = timePrecision === 'minutes' ? 0 : fixDate.getUTCSeconds(); 43056 var ms = (timePrecision === 'minutes' || timePrecision === 'seconds') 43057 ? 0 : fixDate.getUTCMilliseconds(); 43058 return new Date(Date.UTC(year, month, date, hours, minutes, seconds, ms)); 43059 }); 43060 } 43061 catch (e) { 43062 // if any error occurs just return the original values 43063 // TODO: remove the console warning after we are confident there are no issues with the date manipulation logic 43064 console.warn('fixDates failed', e); 43065 return values; 43066 } 43067}; 43068exports.fixDates = fixDates; 43069 43070 43071/***/ }, 43072 43073/***/ 99763 43074(__unused_webpack_module, exports) { 43075 43076"use strict"; 43077 43078Object.defineProperty(exports, "__esModule", ({ value: true })); 43079exports.ClientConfig = void 0; 43080class ClientConfig { 43081 constructor(currentConfig, previousConfig) { 43082 this.currentConfig = currentConfig; 43083 this.previousConfig = previousConfig; 43084 this.rootUrl = null; 43085 this.accessToken = null; 43086 this.clientType = null; 43087 this.clientDetails = null; 43088 this.defaultHeaders = null; 43089 this.projectId = null; 43090 this.language = null; 43091 this.versionStatus = 'published'; 43092 this.pageSize = 25; 43093 this.responseHandler = null; 43094 this.fetchFn = null; 43095 this.rootUrl = this.getValue((c) => c.rootUrl); 43096 this.accessToken = this.getValue((c) => c.accessToken); 43097 this.clientType = this.getValue((c) => c.clientType); 43098 this.clientDetails = this.getValue((c) => c.clientDetails); 43099 this.defaultHeaders = this.getValue((c) => c.defaultHeaders); 43100 this.projectId = this.getValue((c) => c.projectId); 43101 this.language = this.getValue((c) => c.language); 43102 this.versionStatus = this.getValue((c) => c.versionStatus); 43103 this.pageSize = this.getValue((c) => c.pageSize); 43104 this.responseHandler = this.getValue((c) => c.responseHandler); 43105 this.fetchFn = this.getValue((c) => c.fetchFn); 43106 while (this.rootUrl && this.rootUrl.substr(this.rootUrl.length - 1, 1) === '/') { 43107 this.rootUrl = this.rootUrl.substr(0, this.rootUrl.length - 1); 43108 } 43109 } 43110 toParams() { 43111 return { 43112 rootUrl: this.rootUrl, 43113 accessToken: this.accessToken, 43114 clientType: this.clientType, 43115 clientDetails: this.clientDetails, 43116 defaultHeaders: this.defaultHeaders, 43117 language: this.language, 43118 versionStatus: this.versionStatus, 43119 projectId: this.projectId, 43120 pageIndex: 0, 43121 pageSize: this.pageSize, 43122 responseHandler: this.responseHandler 43123 }; 43124 } 43125 getValue(getter) { 43126 let result = null; 43127 if (this.currentConfig) { 43128 result = getter(this.currentConfig); 43129 } 43130 if (this.previousConfig && !result) { 43131 result = getter(this.previousConfig); 43132 } 43133 return result || getter(this); 43134 } 43135} 43136exports.ClientConfig = ClientConfig; 43137 43138 43139/***/ }, 43140 43141/***/ 89728 43142(__unused_webpack_module, exports, __webpack_require__) { 43143 43144"use strict"; 43145 43146Object.defineProperty(exports, "__esModule", ({ value: true })); 43147exports.Client = void 0; 43148const entry_operations_1 = __webpack_require__(76855); 43149const content_type_operations_1 = __webpack_require__(1400); 43150const project_operations_1 = __webpack_require__(17230); 43151const taxonomy_operations_1 = __webpack_require__(85723); 43152const client_config_1 = __webpack_require__(99763); 43153const node_operations_1 = __webpack_require__(6360); 43154const contensis_core_api_1 = __webpack_require__(41416); 43155const Scopes = __webpack_require__(21194); 43156const cross_fetch_1 = __webpack_require__(74945); 43157const browserGlobal = typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : null; 43158const defaultFetch = browserGlobal ? browserGlobal.fetch.bind(browserGlobal) : cross_fetch_1.default; 43159const ContensisClassicTokenKey = 'x-contensis-classic-token'; 43160class Client { 43161 static create(config = null) { 43162 return new Client(config); 43163 } 43164 static configure(config) { 43165 Client.defaultClientConfig = new client_config_1.ClientConfig(config, Client.defaultClientConfig); 43166 } 43167 constructor(config = null) { 43168 this.clientConfig = null; 43169 this.clientConfig = new client_config_1.ClientConfig(config, Client.defaultClientConfig); 43170 this.fetchFn = !this.clientConfig.fetchFn ? defaultFetch : this.clientConfig.fetchFn; 43171 this.httpClient = new contensis_core_api_1.HttpClient(this, this.fetchFn); 43172 this.entries = new entry_operations_1.EntryOperations(this.httpClient, this); 43173 this.project = new project_operations_1.ProjectOperations(this.httpClient, this); 43174 this.contentTypes = new content_type_operations_1.ContentTypeOperations(this.httpClient, this); 43175 this.nodes = new node_operations_1.NodeOperations(this.httpClient, this); 43176 this.taxonomy = new taxonomy_operations_1.TaxonomyOperations(this.httpClient, this); 43177 } 43178 getParams() { 43179 return this.clientConfig.toParams(); 43180 } 43181 getHeaders(contentType = 'application/json') { 43182 let headers = { 43183 Accept: 'application/json' 43184 }; 43185 if (!!contentType) { 43186 headers['Content-Type'] = contentType; 43187 } 43188 if (!this.clientConfig.accessToken) { 43189 headers['Authorization'] = `Bearer ${this.bearerToken}`; 43190 } 43191 return headers; 43192 } 43193 isBearerTokenExpired() { 43194 if (!!this.bearerToken && !!this.bearerTokenExpiryDate) { 43195 const approxCurrentDate = new Date((new Date()).getTime() + 60 * 1000); 43196 if (approxCurrentDate < this.bearerTokenExpiryDate) { 43197 return false; 43198 } 43199 } 43200 return true; 43201 } 43202 isRefreshTokenExpired() { 43203 if (!!this.refreshToken && !!this.refreshTokenExpiryDate) { 43204 const approxCurrentDate = new Date((new Date()).getTime() + 60 * 1000); 43205 if (approxCurrentDate < this.refreshTokenExpiryDate) { 43206 return false; 43207 } 43208 } 43209 return true; 43210 } 43211 ensureIsAuthorized() { 43212 if (!!this.clientConfig.accessToken) { 43213 return Promise.resolve(''); 43214 } 43215 if (!this.isBearerTokenExpired()) { 43216 return Promise.resolve(this.bearerToken); 43217 } 43218 return this.authenticate() 43219 .then(() => this.bearerToken) 43220 .catch((error) => {
43221 if (error instanceof contensis_core_api_1.ContensisAuthenticationError) { 43222 throw error; 43223 } 43224 throw new contensis_core_api_1.ContensisApplicationError(error.message); 43225 }); 43226 } 43227 authenticate() { 43228 const AuthPayload = this.getAuthenticatePayload(); 43229 const AuthData = Object.keys(AuthPayload) 43230 .map(key => { 43231 return encodeURIComponent(key) + '=' + encodeURIComponent(AuthPayload[key]); 43232 }) 43233 .join('&'); 43234 let rootUrl = !!this.clientConfig.rootUrl ? this.clientConfig.rootUrl : ''; 43235 return this.fetchFn(`${rootUrl}/authenticate/connect/token`, { 43236 method: 'POST', 43237 // mode: 'cors', 43238 // cache: 'no-cache', 43239 // credentials: 'same-origin', 43240 headers: { 43241 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 43242 }, 43243 body: AuthData, 43244 }) 43245 .then(async (response) => { 43246 let responseData = await response.json(); 43247 return { response, responseData }; 43248 }) 43249 .then(responseAndData => { 43250 let { response, responseData } = responseAndData; 43251 if (!response.ok) { 43252 throw new contensis_core_api_1.ContensisAuthenticationError(!!responseData.error ? responseData.error : JSON.stringify(responseData)); 43253 } 43254 this.bearerToken = responseData.access_token; 43255 const expiresInSeconds = responseData.expires_in; 43256 const currentDate = new Date(); 43257 this.bearerTokenExpiryDate = new Date(currentDate.getTime() + expiresInSeconds * 1000); 43258 if (!!responseData.refresh_token) { 43259 this.refreshToken = responseData.refresh_token; 43260 this.refreshTokenExpiryDate = new Date(currentDate.getTime() + 15 * 24 * 3600 * 1000); // 15 days 43261 } 43262 else { 43263 this.refreshToken = null; 43264 this.refreshTokenExpiryDate = null; 43265 } 43266 if (!!response.headers && response.headers.has(ContensisClassicTokenKey)) { 43267 this.contensisClassicToken = response.headers.get(ContensisClassicTokenKey); 43268 } 43269 else { 43270 this.contensisClassicToken = null; 43271 } 43272 }); 43273 } 43274 getAuthenticatePayload() { 43275 let payload = { 43276 scope: this.clientConfig.clientType === 'client_credentials' ? Scopes.getResourcesScopes() : Scopes.getAllScopes(), 43277 }; 43278 if (this.clientConfig.clientType !== 'none') { 43279 payload['grant_type'] = this.clientConfig.clientType; 43280 } 43281 if (this.clientConfig.clientType === 'client_credentials') { 43282 let clientDetails = this.clientConfig.clientDetails; 43283 payload['client_id'] = clientDetails.clientId; 43284 payload['client_secret'] = clientDetails.clientSecret; 43285 } 43286 else if (this.clientConfig.clientType === 'contensis_classic') { 43287 let clientDetails = this.clientConfig.clientDetails; 43288 payload['username'] = clientDetails.username; 43289 payload['password'] = clientDetails.password; 43290 } 43291 else if (this.clientConfig.clientType === 'contensis_classic_refresh_token') { 43292 let clientDetails = this.clientConfig.clientDetails; 43293 payload['refresh_token'] = clientDetails.refreshToken; 43294 } 43295 return payload; 43296 } 43297} 43298exports.Client = Client; 43299Client.defaultClientConfig = null; 43300 43301 43302/***/ }, 43303 43304/***/ 21194 43305(__unused_webpack_module, exports) { 43306 43307"use strict"; 43308 43309Object.defineProperty(exports, "__esModule", ({ value: true })); 43310exports.getResourcesScopes = exports.getAllScopes = void 0; 43311const Resources = [ 43312 'Security_Administrator', 43313 'ContentType_Read', 43314 'ContentType_Write', 43315 'ContentType_Delete', 43316 'Entry_Read', 43317 'Entry_Write', 43318 'Entry_Delete', 43319 'Project_Read', 43320 'Project_Write', 43321 'Project_Delete', 43322 'Workflow_Administrator' 43323]; 43324const OfflineAccess = 'offline_access'; 43325const OpenId = 'openid'; 43326function getAllScopes() { 43327 return [OpenId, OfflineAccess, ...Resources].join(' '); 43328} 43329exports.getAllScopes = getAllScopes; 43330function getResourcesScopes() { 43331 return Resources.join(' '); 43332} 43333exports.getResourcesScopes = getResourcesScopes; 43334 43335 43336/***/ }, 43337 43338/***/ 1400 43339(__unused_webpack_module, exports, __webpack_require__) { 43340 43341"use strict"; 43342 43343Object.defineProperty(exports, "__esModule", ({ value: true })); 43344exports.ContentTypeOperations = void 0; 43345const contensis_core_api_1 = __webpack_require__(41416); 43346class ContentTypeOperations { 43347 constructor(httpClient, contensisClient) { 43348 this.httpClient = httpClient; 43349 this.contensisClient = contensisClient; 43350 } 43351 get(contentTypeId) { 43352 let url = contensis_core_api_1.UrlBuilder.create('/api/delivery/projects/:projectId/contentTypes/:contentTypeId') 43353 .addOptions(contentTypeId, 'contentTypeId') 43354 .setParams(this.contensisClient.getParams()) 43355 .toUrl(); 43356 return this.contensisClient.ensureIsAuthorized().then(() => { 43357 return this.httpClient.request(url, { 43358 headers: this.contensisClient.getHeaders() 43359 }); 43360 }); 43361 } 43362} 43363exports.ContentTypeOperations = ContentTypeOperations; 43364 43365 43366/***/ }, 43367 43368/***/ 1121 43369(__unused_webpack_module, exports, __webpack_require__) { 43370 43371"use strict"; 43372 43373Object.defineProperty(exports, "__esModule", ({ value: true })); 43374exports.DeferredEntry = void 0; 43375const contensis_core_api_1 = __webpack_require__(41416); 43376class DeferredEntry { 43377 constructor(sys, versionStatus) { 43378 this.sys = sys; 43379 this.versionStatus = versionStatus; 43380 this.promise = new Promise((resolve, reject) => { 43381 this.resolve = resolve; 43382 this.reject = reject; 43383 }); 43384 this.expression = contensis_core_api_1.Op.and(contensis_core_api_1.Op.equalTo('sys.id', sys.id), contensis_core_api_1.Op.equalTo('sys.language', sys.language), contensis_core_api_1.Op.equalTo('sys.versionStatus', this.versionStatus)); 43385 } 43386 is(sys) { 43387 return !!(sys && sys.id && sys.language && (sys.id === this.sys.id) && (sys.language === this.sys.language)); 43388 } 43389} 43390exports.DeferredEntry = DeferredEntry; 43391 43392 43393/***/ }, 43394 43395/***/ 76855 43396(__unused_webpack_module, exports, __webpack_require__) { 43397 43398"use strict"; 43399 43400Object.defineProperty(exports, "__esModule", ({ value: true })); 43401exports.EntryOperations = void 0; 43402const tslib_1 = __webpack_require__(8674); 43403const link_resolver_1 = __webpack_require__(59573); 43404const contensis_core_api_1 = __webpack_require__(41416); 43405const defaultListUrl = `/api/delivery/projects/:projectId/entries`; 43406let listUrl = (options, params) => { 43407 return !!options.contentTypeId 43408 ? `/api/delivery/projects/:projectId/contentTypes/:contentTypeId/entries` 43409 : defaultListUrl; 43410}; 43411let getMappers = { 43412 language: contensis_core_api_1.defaultMapperForLanguage, 43413 versionStatus: contensis_core_api_1.defaultMapperForPublishedVersionStatus, 43414 fields: (value) => (value && value.length > 0 ? value : null), 43415 linkDepth: (value) => (value && value > 0 ? value : null), 43416 fieldLinkDepths: (value) => Object.keys(value || {}).length > 0 ? JSON.stringify(value) : null, 43417};
43418let listMappers = Object.assign(Object.assign({}, getMappers), { order: (value) => (value && value.length > 0) ? value : null, pageIndex: (value, options, params) => (options && options.pageOptions && options.pageOptions.pageIndex) || (params.pageIndex), pageSize: (value, options, params) => (options && options.pageOptions && options.pageOptions.pageSize) || (params.pageSize) }); 43419let searchMappers = { 43420 aggregations: (value) => Object.keys(value || {}).length > 0 ? JSON.stringify(value) : null, 43421 linkDepth: (value) => (value && (value > 0)) ? value : null, 43422 fieldLinkDepths: (value) => Object.keys(value || {}).length > 0 ? JSON.stringify(value) : null, 43423}; 43424class EntryOperations { 43425 constructor(httpClient, contensisClient) { 43426 this.httpClient = httpClient; 43427 this.contensisClient = contensisClient; 43428 } 43429 get(idOrOptions) { 43430 let url = contensis_core_api_1.UrlBuilder.create('/api/delivery/projects/:projectId/entries/:id', { language: null, versionStatus: null, linkDepth: null, fieldLinkDepths: null, fields: null }) 43431 .addOptions(idOrOptions, 'id') 43432 .setParams(this.contensisClient.getParams()) 43433 .addMappers(getMappers) 43434 .toUrl(); 43435 return this.contensisClient.ensureIsAuthorized().then(() => { 43436 return this.httpClient.request(url, { 43437 headers: this.contensisClient.getHeaders() 43438 }); 43439 }); 43440 } 43441 list(contentTypeIdOrOptions) { 43442 let url = contensis_core_api_1.UrlBuilder.create(listUrl, { language: null, versionStatus: null, linkDepth: null, order: null, fieldLinkDepths: null, fields: null, pageIndex: null, pageSize: null }) 43443 .addOptions(contentTypeIdOrOptions, 'contentTypeId') 43444 .setParams(this.contensisClient.getParams()) 43445 .addMappers(listMappers) 43446 .toUrl(); 43447 return this.contensisClient.ensureIsAuthorized().then(() => { 43448 return this.httpClient.request(url, { 43449 headers: this.contensisClient.getHeaders() 43450 }); 43451 }); 43452 } 43453 search(query, linkDepth = 0) { 43454 if (!query) { 43455 return new Promise((resolve) => { resolve(null); }); 43456 } 43457 let deliveryQuery = query instanceof contensis_core_api_1.Query ? query : null; 43458 // use duck-typing for backwards compatibility pre v1.2.0 43459 if (deliveryQuery !== null || !!query.where || !!query.orderBy) { 43460 return this.searchUsingQuery(deliveryQuery || query, linkDepth); 43461 } 43462 let zenqlQuery = query instanceof contensis_core_api_1.ZenqlQuery ? query : null; 43463 if (zenqlQuery === null) { 43464 if (typeof query === 'string') { 43465 zenqlQuery = new contensis_core_api_1.ZenqlQuery(query); 43466 } 43467 else { 43468 throw new Error('A valid query needs to be specified.'); 43469 } 43470 } 43471 let params = this.contensisClient.getParams(); 43472 let pageSize = params.pageSize || 25; 43473 let pageIndex = params.pageIndex || 0; 43474 let fields = []; 43475 let fieldLinkDepths = {}; 43476 pageSize = zenqlQuery.pageSize || pageSize; 43477 pageIndex = zenqlQuery.pageIndex || pageIndex; 43478 fields = zenqlQuery.fields || fields; 43479 fieldLinkDepths = zenqlQuery.fieldLinkDepths || fieldLinkDepths; 43480 // eslint-disable-next-line @typescript-eslint/no-unused-vars 43481 let { accessToken, projectId, language, responseHandler, rootUrl, versionStatus } = params, requestParams = tslib_1.__rest(params, ["accessToken", "projectId", "language", "responseHandler", "rootUrl", "versionStatus"]); 43482 let payload = Object.assign(Object.assign({}, requestParams), { aggregations: zenqlQuery.aggregations, fieldLinkDepths, 43483 linkDepth, 43484 pageSize, 43485 pageIndex, zenql: zenqlQuery.zenql }); 43486 if (fields && fields.length > 0) { 43487 payload['fields'] = fields; 43488 } 43489 let url = contensis_core_api_1.UrlBuilder.create(defaultListUrl, Object.assign({}, payload)) 43490 .setParams(Object.assign(Object.assign({}, payload), { projectId })) 43491 .addMappers(searchMappers) 43492 .toUrl(); 43493 return this.contensisClient.ensureIsAuthorized().then(() => { 43494 return this.httpClient.request(url, { 43495 method: 'GET', 43496 headers: this.contensisClient.getHeaders('application/json; charset=utf-8') 43497 }); 43498 }); 43499 } 43500 resolve(entryOrList, fields = null) { 43501 let params = this.contensisClient.getParams(); 43502 let resolver = new link_resolver_1.LinkResolver(entryOrList, fields, params.versionStatus, (query) => this.search(query)); 43503 return resolver.resolve(); 43504 } 43505 searchUsingQuery(query, linkDepth = 0) { 43506 if (!query) { 43507 return new Promise((resolve) => { resolve(null); }); 43508 } 43509 let deliveryQuery = query; 43510 let params = this.contensisClient.getParams(); 43511 let pageSize = params.pageSize || 25; 43512 let pageIndex = params.pageIndex || 0; 43513 let fields = []; 43514 let fieldLinkDepths = {}; 43515 pageSize = deliveryQuery.pageSize || pageSize; 43516 pageIndex = deliveryQuery.pageIndex || pageIndex; 43517 fields = deliveryQuery.fields || fields; 43518 fieldLinkDepths = deliveryQuery.fieldLinkDepths || fieldLinkDepths; 43519 let orderBy = (deliveryQuery.orderBy && (deliveryQuery.orderBy._items || deliveryQuery.orderBy)); 43520 // eslint-disable-next-line @typescript-eslint/no-unused-vars 43521 let { accessToken, projectId, language, responseHandler, rootUrl, versionStatus }
43521 = params, requestParams = tslib_1.__rest(params, ["accessToken", "projectId", "language", "responseHandler", "rootUrl", "versionStatus"]); 43522 let payload = Object.assign(Object.assign({}, requestParams), { aggregations: deliveryQuery.aggregations, fieldLinkDepths, 43523 linkDepth, 43524 pageSize, 43525 pageIndex, where: JSON.stringify(deliveryQuery.where) }); 43526 if (fields && fields.length > 0) { 43527 payload['fields'] = fields; 43528 } 43529 if (deliveryQuery.orderBy && (!Array.isArray(deliveryQuery.orderBy) || deliveryQuery.orderBy.length > 0)) { 43530 payload['orderBy'] = JSON.stringify(orderBy); 43531 } 43532 let url = contensis_core_api_1.UrlBuilder.create('/api/delivery/projects/:projectId/entries/search', Object.assign({}, payload)) 43533 .setParams(Object.assign(Object.assign({}, payload), { projectId })) 43534 .addMappers(searchMappers) 43535 .toUrl(); 43536 if (url.length > 8000 || ((0, contensis_core_api_1.isBrowser)() && (0, contensis_core_api_1.isIE)() && url.length > 2083)) { 43537 return this.searchUsingPost(query, linkDepth); 43538 } 43539 return this.contensisClient.ensureIsAuthorized().then(() => { 43540 return this.httpClient.request(url, { 43541 method: 'GET', 43542 headers: this.contensisClient.getHeaders('application/json; charset=utf-8') 43543 }); 43544 }); 43545 } 43546 searchUsingPost(query, linkDepth = 0) { 43547 if (!query) { 43548 return new Promise((resolve) => { resolve(null); }); 43549 } 43550 let params = this.contensisClient.getParams(); 43551 query.pageSize = query.pageSize || params.pageSize; 43552 query.pageIndex = query.pageIndex || 0; 43553 let url = contensis_core_api_1.UrlBuilder.create('/api/delivery/projects/:projectId/entries/search', { linkDepth, fieldLinkDepths: query.fieldLinkDepths }) 43554 .setParams(this.contensisClient.getParams()) 43555 .addMappers(searchMappers) 43556 .toUrl(); 43557 return this.contensisClient.ensureIsAuthorized().then(() => { 43558 // Clone the query instance so we can remove the fieldLinkDepths 43559 // from the POST body without mutating the supplied query arg 43560 const clone = Object.assign(Object.create(Object.getPrototypeOf(query)), query); 43561 delete clone.fieldLinkDepths; 43562 return this.httpClient.request(url, { 43563 method: 'POST', 43564 headers: this.contensisClient.getHeaders('application/json; charset=utf-8'), 43565 body: JSON.stringify(clone) 43566 }); 43567 }); 43568 } 43569} 43570exports.EntryOperations = EntryOperations; 43571 43572 43573/***/ }, 43574 43575/***/ 11987 43576(__unused_webpack_module, exports) { 43577 43578"use strict"; 43579 43580Object.defineProperty(exports, "__esModule", ({ value: true })); 43581exports.EntryResolver = void 0; 43582function isUnresolvedEntry(value) { 43583 if (value && value.sys && value.sys.id) { 43584 let keys = Object.keys(value); 43585 return (keys.length === 1); 43586 } 43587 return false; 43588} 43589function isUnresolvedImage(value) { 43590 if (value && value.asset) { 43591 let keys = Object.keys(value); 43592 return (keys.length <= 2) && isUnresolvedEntry(value.asset); 43593 } 43594 return false; 43595} 43596function isComposer(value) { 43597 if (Array.isArray(value) && (value.length > 0)) { 43598 return isComposerItem(value[0]); 43599 } 43600 return false; 43601} 43602function isComposerItem(value) { 43603 if (value && value.type && value.value) { 43604 let keys = Object.keys(value); 43605 return (keys.length === 2); 43606 } 43607 return false; 43608} 43609class EntryResolver { 43610 constructor(entry, paths, getEntry) { 43611 this.entry = entry; 43612 this.paths = paths; 43613 this.getEntry = getEntry; 43614 } 43615 resolve() { 43616 let paths = this.paths || Object.keys(this.entry); 43617 let promises = paths.map(path => { 43618 let parts = path.split('.'); 43619 let field = parts.shift(); 43620 let promise = null; 43621 let value = this.entry[field]; 43622 if (value) { 43623 promise = this.resolveField(value); 43624 if (!promise && isComposer(value)) { 43625 let composerType = (parts.length > 0) ? parts.shift() : null; 43626 promise = this.resolveComposerField(value, composerType); 43627 } 43628 } 43629 promise = !promise 43630 ? Promise.resolve(null) 43631 : promise.then(resolvedValue => { 43632 this.entry[field] = resolvedValue.value; 43633 return resolvedValue; 43634 }); 43635 return promise.then(v => { 43636 return this.next(v, parts.join('.')); 43637 }); 43638 }); 43639 return Promise.all(promises).then(values => { 43640 return this.entry; 43641 }); 43642 } 43643 next(resolvedEntry, path) { 43644 if (!path || !resolvedEntry || !resolvedEntry.entries || (resolvedEntry.entries.length <= 0)) { 43645 return Promise.resolve(resolvedEntry); 43646 } 43647 let promises = resolvedEntry.entries.map(entry => { 43648 let resolver = new EntryResolver(entry, [path], (id, language) => this.getEntry(id, language)); 43649 return resolver.resolve(); 43650 }); 43651 return Promise.all(promises); 43652 } 43653 resolveField(value) { 43654 if (isUnresolvedEntry(value)) { 43655 return this.resolveEntry(value); 43656 } 43657 if (isUnresolvedImage(value)) { 43658 return this.resolveImage(value); 43659 } 43660 if (Array.isArray(value)) { 43661 let isResolving = false; 43662 let promises = value.map(item => { 43663 if (isUnresolvedEntry(item)) { 43664 isResolving = true; 43665 return this.resolveEntry(item); 43666 } 43667 if (isUnresolvedImage(item)) { 43668 isResolving = true; 43669 return this.resolveImage(item); 43670 } 43671 return Promise.resolve({ entries: [], value: item });
43672 }); 43673 if (isResolving) { 43674 return Promise.all(promises).then((resolvedEntries) => { 43675 let list = []; 43676 let entries = []; 43677 for (let e of resolvedEntries) { 43678 list.push(e.value); 43679 entries = entries.concat(e.entries); 43680 } 43681 return { entries, value: list }; 43682 }); 43683 } 43684 } 43685 return null; 43686 } 43687 resolveComposerField(value, type) { 43688 if (Array.isArray(value)) { 43689 let isResolving = false; 43690 let promises = value.map(item => { 43691 if (isComposerItem(item)) { 43692 if (!type || (type === item.type)) { 43693 let itemPromise = this.resolveField(item.value); 43694 if (itemPromise) { 43695 isResolving = true; 43696 return itemPromise.then((v) => { 43697 item.value = v; 43698 return item; 43699 }); 43700 } 43701 } 43702 } 43703 return Promise.resolve({ entries: [], value: item }); 43704 }); 43705 if (isResolving) { 43706 return Promise.all(promises).then((resolvedEntries) => { 43707 let list = []; 43708 let entries = []; 43709 for (let e of resolvedEntries) { 43710 list.push(e.value); 43711 entries = entries.concat(e.entries); 43712 } 43713 return { entries, value: list }; 43714 }); 43715 } 43716 } 43717 return null; 43718 } 43719 async resolveEntry(value) { 43720 if (value && value.sys && value.sys.id) { 43721 let language = value.sys.language || this.entry.sys.language; 43722 let entry = await this.getEntry(value.sys.id, language); 43723 return { entries: [entry], value: entry }; 43724 } 43725 return Promise.resolve({ entries: [], value }); 43726 } 43727 resolveImage(value) { 43728 if (value && value.asset && value.asset.sys && value.asset.sys.id) { 43729 let language = value.asset.sys.language || this.entry.sys.language; 43730 return this.getEntry(value.asset.sys.id, language) 43731 .then((image) => { 43732 value.asset = image; 43733 return { entries: [image], value }; 43734 }); 43735 } 43736 return Promise.resolve({ entries: [], value }); 43737 } 43738} 43739exports.EntryResolver = EntryResolver; 43740 43741 43742/***/ }, 43743 43744/***/ 59573 43745(__unused_webpack_module, exports, __webpack_require__) { 43746 43747"use strict"; 43748 43749Object.defineProperty(exports, "__esModule", ({ value: true })); 43750exports.LinkResolver = void 0; 43751const list_resolver_1 = __webpack_require__(72973); 43752class LinkResolver { 43753 constructor(entryOrList, paths, versionStatus, search) { 43754 this.entryOrList = entryOrList; 43755 this.paths = paths; 43756 this.versionStatus = versionStatus; 43757 this.search = search; 43758 } 43759 resolve() { 43760 let entries = this.getEntries(); 43761 let promise = Promise.resolve([]); 43762 if (entries.length > 0) { 43763 let listResolver = new list_resolver_1.ListResolver(entries, this.paths, this.versionStatus, this.search); 43764 promise = listResolver.resolve(); 43765 } 43766 return promise.then(() => this.entryOrList); 43767 } 43768 getEntries() { 43769 let entryOrList = this.entryOrList; 43770 if (!entryOrList) { 43771 return []; 43772 } 43773 if (Array.isArray(entryOrList)) { 43774 return entryOrList; 43775 } 43776 if (entryOrList.items && Array.isArray(entryOrList.items)) { 43777 return entryOrList.items; 43778 } 43779 return [entryOrList]; 43780 } 43781} 43782exports.LinkResolver = LinkResolver; 43783 43784 43785/***/ }, 43786 43787/***/ 72973 43788(__unused_webpack_module, exports, __webpack_require__) { 43789 43790"use strict"; 43791 43792Object.defineProperty(exports, "__esModule", ({ value: true })); 43793exports.ListResolver = void 0; 43794const contensis_core_api_1 = __webpack_require__(41416); 43795const DeferredEntry_1 = __webpack_require__(1121); 43796const entry_resolver_1 = __webpack_require__(11987); 43797class ListResolver { 43798 constructor(entries, paths, versionStatus, search) { 43799 this.entries = entries; 43800 this.paths = paths; 43801 this.versionStatus = versionStatus; 43802 this.search = search; 43803 this.deferredEntries = []; 43804 } 43805 resolve() { 43806 this.deferredEntries = []; 43807 let promises = this.entries.map(entry => { 43808 let resolver = new entry_resolver_1.EntryResolver(entry, this.paths, (id, language) => this.getEntry(id, language)); 43809 return resolver.resolve(); 43810 }); 43811 return this.nestedSearch().then(_ => { 43812 return Promise.all(promises).then(_ => { 43813 return this.entries; 43814 }); 43815 }); 43816 } 43817 getEntry(id, language) { 43818 let deferredEntry = new DeferredEntry_1.DeferredEntry({ id, language }, this.versionStatus); 43819 this.deferredEntries.push(deferredEntry); 43820 return deferredEntry.promise; 43821 } 43822 nestedSearch() { 43823 let expressions = this.deferredEntries.map(g => g.expression); 43824 let query = new contensis_core_api_1.Query(contensis_core_api_1.Op.or(...expressions)); 43825 query.pageIndex = 0; 43826 query.pageSize = expressions.length; 43827 return this.search(query).then((list) => { 43828 let allDeferredEntries = this.deferredEntries; 43829 this.deferredEntries = []; 43830 let promises = []; 43831 for (let item of list.items) { 43832 let deferredEntries = allDeferredEntries.filter(deferredEntry => deferredEntry.is(item.sys)); 43833 for (let deferredEntry of deferredEntries) { 43834 deferredEntry.resolve(item); 43835 promises.push(deferredEntry.promise); 43836 } 43837 } 43838 if (promises.length === 0) { 43839 for (let deferredEntry of allDeferredEntries) { 43840 deferredEntry.resolve(null); 43841 } 43842 return Promise.resolve(list); 43843 } 43844 return Promise.all(promises).then(() => Promise.resolve(list)); 43845 }) 43846 .then(value => { 43847 return (this.deferredEntries.length > 0) ? this.nestedSearch() : value; 43848 }); 43849 } 43850} 43851exports.ListResolver = ListResolver; 43852 43853 43854/***/ }, 43855 43856/***/ 15575 43857(__unused_webpack_module, exports, __webpack_require__) { 43858 43859"use strict"; 43860 43861Object.defineProperty(exports, "__esModule", ({ value: true })); 43862exports.Client = exports.ZenqlQuery = exports.Query = exports.OrderBy = exports.Op = void 0; 43863const tslib_1 = __webpack_require__(8674); 43864var contensis_core_api_1 = __webpack_require__(41416); 43865Object.defineProperty(exports, "Op", ({ enumerable: true, get: function () { return contensis_core_api_1.Op; } })); 43866Object.defineProperty(exports, "OrderBy", ({ enumerable: true, get: function () { return contensis_core_api_1.OrderBy; } })); 43867Object.defineProperty(exports, "Query", ({ enumerable: true, get: function () { return contensis_core_api_1.Query; } })); 43868Object.defineProperty(exports, "ZenqlQuery", ({ enumerable: true, get: function () { return contensis_core_api_1.Ze
43868nqlQuery; } })); 43869var client_1 = __webpack_require__(89728); 43870Object.defineProperty(exports, "Client", ({ enumerable: true, get: function () { return client_1.Client; } })); 43871tslib_1.__exportStar(__webpack_require__(93338), exports); 43872 43873 43874/***/ }, 43875 43876/***/ 24617 43877(__unused_webpack_module, exports) { 43878 43879"use strict"; 43880 43881Object.defineProperty(exports, "__esModule", ({ value: true })); 43882 43883 43884/***/ }, 43885 43886/***/ 11608 43887(__unused_webpack_module, exports) { 43888 43889"use strict"; 43890 43891Object.defineProperty(exports, "__esModule", ({ value: true })); 43892 43893 43894/***/ }, 43895 43896/***/ 1907 43897(__unused_webpack_module, exports) { 43898 43899"use strict"; 43900 43901Object.defineProperty(exports, "__esModule", ({ value: true })); 43902 43903 43904/***/ }, 43905 43906/***/ 2517 43907(__unused_webpack_module, exports) { 43908 43909"use strict"; 43910 43911Object.defineProperty(exports, "__esModule", ({ value: true })); 43912 43913 43914/***/ }, 43915 43916/***/ 81234 43917(__unused_webpack_module, exports) { 43918 43919"use strict"; 43920 43921Object.defineProperty(exports, "__esModule", ({ value: true })); 43922 43923 43924/***/ }, 43925 43926/***/ 1333 43927(__unused_webpack_module, exports) { 43928 43929"use strict"; 43930 43931Object.defineProperty(exports, "__esModule", ({ value: true })); 43932 43933 43934/***/ }, 43935 43936/***/ 42812 43937(__unused_webpack_module, exports) { 43938 43939"use strict"; 43940 43941Object.defineProperty(exports, "__esModule", ({ value: true })); 43942 43943 43944/***/ }, 43945 43946/***/ 74854 43947(__unused_webpack_module, exports) { 43948 43949"use strict"; 43950 43951Object.defineProperty(exports, "__esModule", ({ value: true })); 43952 43953 43954/***/ }, 43955 43956/***/ 81155 43957(__unused_webpack_module, exports) { 43958 43959"use strict"; 43960 43961Object.defineProperty(exports, "__esModule", ({ value: true })); 43962 43963 43964/***/ }, 43965 43966/***/ 47408 43967(__unused_webpack_module, exports) { 43968 43969"use strict"; 43970 43971Object.defineProperty(exports, "__esModule", ({ value: true })); 43972 43973 43974/***/ }, 43975 43976/***/ 46730 43977(__unused_webpack_module, exports) { 43978 43979"use strict"; 43980 43981Object.defineProperty(exports, "__esModule", ({ value: true })); 43982 43983 43984/***/ }, 43985 43986/***/ 25895 43987(__unused_webpack_module, exports) { 43988 43989"use strict"; 43990 43991Object.defineProperty(exports, "__esModule", ({ value: true })); 43992 43993 43994/***/ }, 43995 43996/***/ 9815 43997(__unused_webpack_module, exports) { 43998 43999"use strict"; 44000 44001Object.defineProperty(exports, "__esModule", ({ value: true })); 44002 44003 44004/***/ }, 44005 44006/***/ 54809 44007(__unused_webpack_module, exports) { 44008 44009"use strict"; 44010 44011Object.defineProperty(exports, "__esModule", ({ value: true })); 44012 44013 44014/***/ }, 44015 44016/***/ 66982 44017(__unused_webpack_module, exports) { 44018 44019"use strict"; 44020 44021Object.defineProperty(exports, "__esModule", ({ value: true })); 44022 44023 44024/***/ }, 44025 44026/***/ 39151 44027(__unused_webpack_module, exports) { 44028 44029"use strict"; 44030 44031Object.defineProperty(exports, "__esModule", ({ value: true })); 44032 44033 44034/***/ }, 44035 44036/***/ 72355 44037(__unused_webpack_module, exports) { 44038 44039"use strict"; 44040 44041Object.defineProperty(exports, "__esModule", ({ value: true })); 44042 44043 44044/***/ }, 44045 44046/***/ 72902 44047(__unused_webpack_module, exports) { 44048 44049"use strict"; 44050 44051Object.defineProperty(exports, "__esModule", ({ value: true })); 44052 44053 44054/***/ }, 44055 44056/***/ 63812 44057(__unused_webpack_module, exports) { 44058 44059"use strict"; 44060 44061Object.defineProperty(exports, "__esModule", ({ value: true })); 44062 44063 44064/***/ }, 44065 44066/***/ 20432 44067(__unused_webpack_module, exports) { 44068 44069"use strict"; 44070 44071Object.defineProperty(exports, "__esModule", ({ value: true })); 44072 44073 44074/***/ }, 44075 44076/***/ 40005 44077(__unused_webpack_module, exports) { 44078 44079"use strict"; 44080 44081Object.defineProperty(exports, "__esModule", ({ value: true })); 44082 44083 44084/***/ }, 44085 44086/***/ 85002 44087(__unused_webpack_module, exports) { 44088 44089"use strict"; 44090 44091Object.defineProperty(exports, "__esModule", ({ value: true })); 44092 44093 44094/***/ }, 44095 44096/***/ 26334 44097(__unused_webpack_module, exports) { 44098 44099"use strict"; 44100 44101Object.defineProperty(exports, "__esModule", ({ value: true })); 44102 44103 44104/***/ }, 44105 44106/***/ 1402 44107(__unused_webpack_module, exports) { 44108 44109"use strict"; 44110 44111Object.defineProperty(exports, "__esModule", ({ value: true })); 44112 44113 44114/***/ }, 44115 44116/***/ 73897 44117(__unused_webpack_module, exports) { 44118 44119"use strict"; 44120 44121Object.defineProperty(exports, "__esModule", ({ value: true })); 44122 44123 44124/***/ }, 44125 44126/***/ 78634 44127(__unused_webpack_module, exports) { 44128 44129"use strict"; 44130 44131Object.defineProperty(exports, "__esModule", ({ value: true })); 44132 44133 44134/***/ }, 44135 44136/***/ 644 44137(__unused_webpack_module, exports) { 44138 44139"use strict"; 44140 44141Object.defineProperty(exports, "__esModule", ({ value: true })); 44142 44143 44144/***/ }, 44145 44146/***/ 31371
44147(__unused_webpack_module, exports) { 44148 44149"use strict"; 44150 44151Object.defineProperty(exports, "__esModule", ({ value: true })); 44152 44153 44154/***/ }, 44155 44156/***/ 78062 44157(__unused_webpack_module, exports) { 44158 44159"use strict"; 44160 44161Object.defineProperty(exports, "__esModule", ({ value: true })); 44162 44163 44164/***/ }, 44165 44166/***/ 52454 44167(__unused_webpack_module, exports) { 44168 44169"use strict"; 44170 44171Object.defineProperty(exports, "__esModule", ({ value: true })); 44172 44173 44174/***/ }, 44175 44176/***/ 58834 44177(__unused_webpack_module, exports) { 44178 44179"use strict"; 44180 44181Object.defineProperty(exports, "__esModule", ({ value: true })); 44182 44183 44184/***/ }, 44185 44186/***/ 44727 44187(__unused_webpack_module, exports) { 44188 44189"use strict"; 44190 44191Object.defineProperty(exports, "__esModule", ({ value: true })); 44192 44193 44194/***/ }, 44195 44196/***/ 96781 44197(__unused_webpack_module, exports) { 44198 44199"use strict"; 44200 44201Object.defineProperty(exports, "__esModule", ({ value: true })); 44202 44203 44204/***/ }, 44205 44206/***/ 6919 44207(__unused_webpack_module, exports) { 44208 44209"use strict"; 44210 44211Object.defineProperty(exports, "__esModule", ({ value: true })); 44212 44213 44214/***/ }, 44215 44216/***/ 5997 44217(__unused_webpack_module, exports) { 44218 44219"use strict"; 44220 44221Object.defineProperty(exports, "__esModule", ({ value: true })); 44222 44223 44224/***/ }, 44225 44226/***/ 13811 44227(__unused_webpack_module, exports) { 44228 44229"use strict"; 44230 44231Object.defineProperty(exports, "__esModule", ({ value: true })); 44232 44233 44234/***/ }, 44235 44236/***/ 75236 44237(__unused_webpack_module, exports) { 44238 44239"use strict"; 44240 44241Object.defineProperty(exports, "__esModule", ({ value: true })); 44242 44243 44244/***/ }, 44245 44246/***/ 7461 44247(__unused_webpack_module, exports) { 44248 44249"use strict"; 44250 44251Object.defineProperty(exports, "__esModule", ({ value: true })); 44252 44253 44254/***/ }, 44255 44256/***/ 68672 44257(__unused_webpack_module, exports) { 44258 44259"use strict"; 44260 44261Object.defineProperty(exports, "__esModule", ({ value: true })); 44262 44263 44264/***/ }, 44265 44266/***/ 93338 44267(__unused_webpack_module, exports, __webpack_require__) { 44268 44269"use strict"; 44270 44271Object.defineProperty(exports, "__esModule", ({ value: true })); 44272const tslib_1 = __webpack_require__(8674); 44273tslib_1.__exportStar(__webpack_require__(24617), exports); 44274tslib_1.__exportStar(__webpack_require__(11608), exports); 44275tslib_1.__exportStar(__webpack_require__(1907), exports); 44276tslib_1.__exportStar(__webpack_require__(2517), exports); 44277tslib_1.__exportStar(__webpack_require__(81234), exports); 44278tslib_1.__exportStar(__webpack_require__(1333), exports); 44279tslib_1.__exportStar(__webpack_require__(42812), exports); 44280tslib_1.__exportStar(__webpack_require__(74854), exports); 44281tslib_1.__exportStar(__webpack_require__(81155), exports); 44282tslib_1.__exportStar(__webpack_require__(47408), exports); 44283tslib_1.__exportStar(__webpack_require__(46730), exports); 44284tslib_1.__exportStar(__webpack_require__(25895), exports); 44285tslib_1.__exportStar(__webpack_require__(9815), exports); 44286tslib_1.__exportStar(__webpack_require__(54809), exports); 44287tslib_1.__exportStar(__webpack_require__(66982), exports); 44288tslib_1.__exportStar(__webpack_require__(39151), exports); 44289tslib_1.__exportStar(__webpack_require__(72355), exports); 44290tslib_1.__exportStar(__webpack_require__(72902), exports); 44291tslib_1.__exportStar(__webpack_require__(63812), exports); 44292tslib_1.__exportStar(__webpack_require__(20432), exports); 44293tslib_1.__exportStar(__webpack_require__(40005), exports); 44294tslib_1.__exportStar(__webpack_require__(85002), exports); 44295tslib_1.__exportStar(__webpack_require__(26334), exports); 44296tslib_1.__exportStar(__webpack_require__(1402), exports); 44297tslib_1.__exportStar(__webpack_require__(73897), exports); 44298tslib_1.__exportStar(__webpack_require__(78634), exports); 44299tslib_1.__exportStar(__webpack_require__(644), exports); 44300tslib_1.__exportStar(__webpack_require__(31371), exports); 44301tslib_1.__exportStar(__webpack_require__(78062), exports); 44302tslib_1.__exportStar(__webpack_require__(52454), exports); 44303tslib_1.__exportStar(__webpack_require__(58834), exports); 44304tslib_1.__exportStar(__webpack_require__(44727), exports); 44305tslib_1.__exportStar(__webpack_require__(96781), exports); 44306tslib_1.__exportStar(__webpack_require__(6919), exports); 44307tslib_1.__exportStar(__webpack_require__(5997), exports); 44308tslib_1.__exportStar(__webpack_require__(13811), exports);
44309tslib_1.__exportStar(__webpack_require__(75236), exports); 44310tslib_1.__exportStar(__webpack_require__(7461), exports); 44311tslib_1.__exportStar(__webpack_require__(68672), exports); 44312 44313 44314/***/ }, 44315 44316/***/ 6360 44317(__unused_webpack_module, exports, __webpack_require__) { 44318 44319"use strict"; 44320 44321Object.defineProperty(exports, "__esModule", ({ value: true })); 44322exports.NodeOperations = void 0; 44323const contensis_core_api_1 = __webpack_require__(41416); 44324const nodeDefaultOptionsMappers = { 44325 language: contensis_core_api_1.defaultMapperForLanguage, 44326 versionStatus: contensis_core_api_1.defaultMapperForPublishedVersionStatus, 44327 entryFields: (value) => (value && value.length > 0 ? value : null), 44328 entryLinkDepth: (value) => (value && value > 0 ? value : null), 44329 entryFieldLinkDepths: (value) => Object.keys(value || {}).length > 0 ? JSON.stringify(value) : null, 44330}; 44331const nodeDefaultWithDepthOptionsMappers = Object.assign(Object.assign({}, nodeDefaultOptionsMappers), { depth: (value) => (value && (value > 0)) ? value : null }); 44332const nodeGetByPathOptions = Object.assign(Object.assign({}, nodeDefaultWithDepthOptionsMappers), { allowPartialMatch: (value) => (!!value) ? true : null }); 44333const nodeGetByEntryOptions = Object.assign(Object.assign({}, nodeDefaultWithDepthOptionsMappers), { canonicalOnly: (value) => value ? true : null, entryId: (value) => value ? value : null }); 44334const nodeGetAncestorAtLevelOptionsMappers = Object.assign(Object.assign({}, nodeDefaultWithDepthOptionsMappers), { startLevel: (value) => (value && (value > 0)) ? value : null }); 44335const nodeGetAncestorsOptionsMappers = Object.assign(Object.assign({}, nodeDefaultOptionsMappers), { startLevel: (value) => (value && (value > 0)) ? value : null }); 44336class NodeOperations { 44337 constructor(httpClient, contensisClient) { 44338 this.httpClient = httpClient; 44339 this.contensisClient = contensisClient; 44340 if (!this.httpClient || !this.contensisClient) { 44341 throw new Error('The class was not initialised correctly.'); 44342 } 44343 } 44344 async getRoot(options) { 44345 const url = contensis_core_api_1.UrlBuilder.create('/api/delivery/projects/:projectId/nodes/root', { language: null, depth: null, versionStatus: null, entryFields: null, entryLinkDepth: null, entryFieldLinkDepths: null }) 44346 .addOptions(options) 44347 .setParams(this.contensisClient.getParams()) 44348 .addMappers(nodeDefaultWithDepthOptionsMappers) 44349 .toUrl(); 44350 await this.contensisClient.ensureIsAuthorized(); 44351 return await this.httpClient.request(url, { 44352 headers: this.contensisClient.getHeaders() 44353 }); 44354 } 44355 async get(idOrPathOrOptions) { 44356 const validationMessage = 'A valid node id or path needs to be specified.'; 44357 if (((0, contensis_core_api_1.isString)(idOrPathOrOptions) && !idOrPathOrOptions) 44358 || (typeof idOrPathOrOptions === 'object' && 44359 (idOrPathOrOptions === null || (!idOrPathOrOptions.id && !idOrPathOrOptions.path)))) { 44360 throw new Error(validationMessage); 44361 } 44362 const isPath = ((0, contensis_core_api_1.isString)(idOrPathOrOptions) && idOrPathOrOptions.startsWith('/')) 44363 || (!!idOrPathOrOptions && !!idOrPathOrOptions.path); 44364 const urlTemplate = isPath ? '/api/delivery/projects/:projectId/nodes:path' : '/api/delivery/projects/:projectId/nodes/:id'; 44365 const url = contensis_core_api_1.UrlBuilder.create(urlTemplate, { language: null, depth: null, versionStatus: null, entryFields: null, entryLinkDepth: null, entryFieldLinkDepths: null, allowPartialMatch: null }) 44366 .addOptions(idOrPathOrOptions, isPath ? 'path' : 'id') 44367 .setParams(this.contensisClient.getParams()) 44368 .addMappers(nodeGetByPathOptions) 44369 .toUrl(); 44370 await this.contensisClient.ensureIsAuthorized(); 44371 return await this.httpClient.request(url, { 44372 headers: this.contensisClient.getHeaders() 44373 }); 44374 } 44375 async getByEntry(entryIdOrEntryOrOptions) {
44376 const validationMessage = 'A valid entry id needs to be specified.'; 44377 if ((0, contensis_core_api_1.isString)(entryIdOrEntryOrOptions) && !entryIdOrEntryOrOptions) { 44378 throw new Error(validationMessage); 44379 } 44380 if (typeof entryIdOrEntryOrOptions === 'object') { 44381 if (entryIdOrEntryOrOptions === null) { 44382 throw new Error(validationMessage); 44383 } 44384 if (!entryIdOrEntryOrOptions.entryId 44385 && (!entryIdOrEntryOrOptions.entry 44386 || !entryIdOrEntryOrOptions.entry.sys 44387 || !entryIdOrEntryOrOptions.entry.sys.id) 44388 && (!entryIdOrEntryOrOptions.sys || !entryIdOrEntryOrOptions.sys.id)) { 44389 throw new Error(validationMessage); 44390 } 44391 } 44392 let entryId = null; 44393 if ((0, contensis_core_api_1.isString)(entryIdOrEntryOrOptions)) { 44394 entryId = entryIdOrEntryOrOptions; 44395 } 44396 else if (typeof entryIdOrEntryOrOptions === 'object') { 44397 if (!!entryIdOrEntryOrOptions.sys) { 44398 entryId = entryIdOrEntryOrOptions.sys.id; 44399 } 44400 if (!!entryIdOrEntryOrOptions.entry && !!entryIdOrEntryOrOptions.entry.sys) { 44401 entryId = entryIdOrEntryOrOptions.entry.sys.id; 44402 } 44403 } 44404 const url = contensis_core_api_1.UrlBuilder 44405 .create('/api/delivery/projects/:projectId/nodes/', { canonicalOnly: null, depth: null, entryFields: null, entryFieldLinkDepths: null, entryLinkDepth: null, entryId: null, language: null, versionStatus: null }) 44406 .addOptions(entryId, 'entryId') 44407 .addOptions(entryIdOrEntryOrOptions) 44408 .setParams(this.contensisClient.getParams()) 44409 .addMappers(nodeGetByEntryOptions) 44410 .toUrl(); 44411 await this.contensisClient.ensureIsAuthorized(); 44412 return await this.httpClient.request(url, { 44413 headers: this.contensisClient.getHeaders() 44414 }); 44415 } 44416 async getChildren(idOrNodeOrOptions) { 44417 this.validateNodeId(idOrNodeOrOptions); 44418 const nodeId = this.getNodeIdFromOptions(idOrNodeOrOptions); 44419 const url = contensis_core_api_1.UrlBuilder 44420 .create('/api/delivery/projects/:projectId/nodes/:id/children', { language: null, versionStatus: null, entryFields: null, entryLinkDepth: null, entryFieldLinkDepths: null }) 44421 .addOptions(nodeId, 'id') 44422 .addOptions(idOrNodeOrOptions) 44423 .setParams(this.contensisClient.getParams()) 44424 .addMappers(nodeDefaultOptionsMappers) 44425 .toUrl(); 44426 await this.contensisClient.ensureIsAuthorized(); 44427 return await this.httpClient.request(url, { 44428 headers: this.contensisClient.getHeaders() 44429 }); 44430 } 44431 async getParent(idOrNodeOrOptions) { 44432 this.validateNodeId(idOrNodeOrOptions); 44433 const nodeId = this.getNodeIdFromOptions(idOrNodeOrOptions); 44434 const url = contensis_core_api_1.UrlBuilder 44435 .create('/api/delivery/projects/:projectId/nodes/:id/parent', { language: null, depth: null, versionStatus: null, entryFields: null, entryLinkDepth: null, entryFieldLinkDepths: null }) 44436 .addOptions(nodeId, 'id') 44437 .addOptions(idOrNodeOrOptions) 44438 .setParams(this.contensisClient.getParams()) 44439 .addMappers(nodeDefaultWithDepthOptionsMappers) 44440 .toUrl(); 44441 await this.contensisClient.ensureIsAuthorized(); 44442 return await this.httpClient.request(url, { 44443 headers: this.contensisClient.getHeaders() 44444 }); 44445 } 44446 async getAncestorAtLevel(options) { 44447 this.validateNodeId(options); 44448 const nodeId = this.getNodeIdFromOptions(options); 44449 const url = contensis_core_api_1.UrlBuilder 44450 .create('/api/delivery/projects/:projectId/nodes/:id/ancestors', { language: null, startLevel: null, depth: null, versionStatus: null, entryFields: null, entryLinkDepth: null, entryFieldLinkDepths: null }) 44451 .addOptions(nodeId, 'id') 44452 .addOptions(options) 44453 .setParams(this.contensisClient.getParams()) 44454 .addMappers(nodeGetAncestorAtLevelOptionsMappers) 44455 .toUrl(); 44456 await this.contensisClient.ensureIsAuthorized(); 44457 return await this.httpClient.request(url, { 44458 headers: this.contensisClient.getHeaders() 44459 }); 44460 }
44461 async getAncestors(idOrNodeOrOptions) { 44462 this.validateNodeId(idOrNodeOrOptions); 44463 const nodeId = this.getNodeIdFromOptions(idOrNodeOrOptions); 44464 const url = contensis_core_api_1.UrlBuilder 44465 .create('/api/delivery/projects/:projectId/nodes/:id/ancestors', { language: null, startLevel: null, versionStatus: null, entryFields: null, entryLinkDepth: null, entryFieldLinkDepths: null }) 44466 .addOptions(nodeId, 'id') 44467 .addOptions(idOrNodeOrOptions) 44468 .setParams(this.contensisClient.getParams()) 44469 .addMappers(nodeGetAncestorsOptionsMappers) 44470 .toUrl(); 44471 await this.contensisClient.ensureIsAuthorized(); 44472 return await this.httpClient.request(url, { 44473 headers: this.contensisClient.getHeaders() 44474 }); 44475 } 44476 async getSiblings(idOrNodeOrOptions) { 44477 this.validateNodeId(idOrNodeOrOptions); 44478 const nodeId = this.getNodeIdFromOptions(idOrNodeOrOptions); 44479 const url = contensis_core_api_1.UrlBuilder 44480 .create('/api/delivery/projects/:projectId/nodes/:id/siblings', { language: null, versionStatus: null, entryFields: null, entryLinkDepth: null, entryFieldLinkDepths: null }) 44481 .addOptions(nodeId, 'id') 44482 .addOptions(idOrNodeOrOptions) 44483 .setParams(this.contensisClient.getParams()) 44484 .addMappers(nodeDefaultOptionsMappers) 44485 .toUrl(); 44486 await this.contensisClient.ensureIsAuthorized(); 44487 return await this.httpClient.request(url, { 44488 headers: this.contensisClient.getHeaders() 44489 }); 44490 } 44491 validateNodeId(idOrNodeOrOptions) { 44492 const validationMessage = 'A valid node id needs to be specified.'; 44493 if ((0, contensis_core_api_1.isString)(idOrNodeOrOptions) && !idOrNodeOrOptions) { 44494 throw new Error(validationMessage); 44495 } 44496 if (typeof idOrNodeOrOptions === 'object') { 44497 if (idOrNodeOrOptions === null) { 44498 throw new Error(validationMessage); 44499 } 44500 if (!idOrNodeOrOptions.id 44501 && (!idOrNodeOrOptions.node 44502 || !idOrNodeOrOptions.node.id)) { 44503 throw new Error(validationMessage); 44504 } 44505 } 44506 } 44507 getNodeIdFromOptions(idOrNodeOrOptions) { 44508 let nodeId = null; 44509 if ((0, contensis_core_api_1.isString)(idOrNodeOrOptions)) { 44510 nodeId = idOrNodeOrOptions; 44511 } 44512 else if (typeof idOrNodeOrOptions === 'object') { 44513 if (!!idOrNodeOrOptions.id) { 44514 nodeId = idOrNodeOrOptions.id; 44515 } 44516 else if (!!idOrNodeOrOptions.node) { 44517 nodeId = idOrNodeOrOptions.node.id; 44518 } 44519 } 44520 return nodeId; 44521 } 44522} 44523exports.NodeOperations = NodeOperations; 44524 44525 44526/***/ }, 44527 44528/***/ 17230 44529(__unused_webpack_module, exports, __webpack_require__) { 44530 44531"use strict"; 44532 44533Object.defineProperty(exports, "__esModule", ({ value: true })); 44534exports.ProjectOperations = void 0; 44535const contensis_core_api_1 = __webpack_require__(41416); 44536class ProjectOperations { 44537 constructor(httpClient, contensisClient) { 44538 this.httpClient = httpClient; 44539 this.contensisClient = contensisClient; 44540 } 44541 get() { 44542 let url = contensis_core_api_1.UrlBuilder.create('/api/delivery/projects/:projectId') 44543 .setParams(this.contensisClient.getParams()) 44544 .toUrl(); 44545 return this.contensisClient.ensureIsAuthorized().then(() => { 44546 return this.httpClient.request(url, { 44547 headers: this.contensisClient.getHeaders() 44548 }); 44549 }); 44550 } 44551} 44552exports.ProjectOperations = ProjectOperations; 44553 44554 44555/***/ }, 44556 44557/***/ 85723 44558(__unused_webpack_module, exports, __webpack_require__) { 44559 44560"use strict"; 44561 44562Object.defineProperty(exports, "__esModule", ({ value: true })); 44563exports.TaxonomyOperations = void 0; 44564const contensis_core_api_1 = __webpack_require__(41416); 44565let taxonomyMappers = { 44566 order: (value) => (value === 'defined') ? value : null 44567}; 44568class TaxonomyOperations { 44569 constructor(httpClient, contensisClient) { 44570 this.httpClient = httpClient; 44571 this.contensisClient = contensisClient; 44572 } 44573 getNodeByKey(key) { 44574 let url = contensis_core_api_1.UrlBuilder.create('/api/delivery/projects/:projectId/taxonomy/nodes/:key', { order: null, childDepth: null, language: null }) 44575 .addOptions(key, 'key') 44576 .setParams(this.contensisClient.getParams()) 44577 .addMappers(taxonomyMappers) 44578 .toUrl(); 44579 return this.contensisClient.ensureIsAuthorized().then(() => { 44580 return this.httpClient.request(url, { 44581 headers: this.contensisClient.getHeaders() 44582 }); 44583 }); 44584 } 44585 getNodeByPath(path) { 44586 let url = contensis_core_api_1.UrlBuilder.create('/api/delivery/projects/:projectId/taxonomy/nodes', { order: null, childDepth: null, language: null, path: null }) 44587 .addOptions(path, 'path') 44588 .setParams(this.contensisClient.getParams()) 44589 .addMappers(taxonomyMappers) 44590 .toUrl(); 44591 return this.contensisClient.ensureIsAuthorized().then(() => { 44592 return this.httpClient.request(url, { 44593 headers: this.contensisClient.getHeaders() 44594 }); 44595 }); 44596 } 44597 resolveChildren(node) { 44598 let resolveOptions = node; 44599 let taxonomyNodeOrKey = null; 44600 let getNodeByKeyOptions = { childDepth: 1 }; 44601 if (resolveOptions.node) { 44602 taxonomyNodeOrKey = resolveOptions.node; 44603 getNodeByKeyOptions = { childDepth: resolveOptions.childDepth || 1, order: resolveOptions.order, language: resolveOptions.language }; 44604 } 44605 else if (resolveOptions.key) { 44606 if (node.path) { 44607 taxonomyNodeOrKey = node; 44608 } 44609 else { 44610 taxonomyNodeOrKey = resolveOptions.key; 44611 getNodeByKeyOptions = { childDepth: resolveOptions.childDepth || 1, order: resolveOptions.order, language: resolveOptions.language }; 44612 } 44613 } 44614 else { 44615 taxonomyNodeOrKey = node; 44616 } 44617 if (typeof taxonomyNodeOrKey === 'string') { 44618 return this.getNodeByKey(Object.assign(Object.assign({}, getNodeByKeyOptions), { key: taxonomyNodeOrKey })); 44619 } 44620 if (!taxonomyNodeOrKey.hasChildren) { 44621 return Promise.resolve(Object.assign(Object.assign({}, taxonomyNodeOrKey), { children: [] })); 44622 } 44623 else if (taxonomyNodeOrKey.children && (taxonomyNodeOrKey.children.length > 0)) { 44624 return Promise.resolve(Object.assign({}, taxonomyNodeOrKey)); 44625 } 44626 return this.getNodeByKey(Object.assign(Object.assign({}, getNodeByKeyOptions), { key: taxonomyNodeOrKey.key })); 44627 } 44628} 44629exports.TaxonomyOperations = TaxonomyOperations; 44630 44631 44632/***/ }, 44633 44634/***/ 74945 44635(module, exports, __webpack_require__) { 44636 44637// Save global object in a variable 44638var __global__ = 44639(typeof globalThis !== 'undefined' && globalThis) || 44640(typeof self !== 'undefined' && self) || 44641(typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g); 44642// Create an object that extends from __global__ without the fetch function 44643var __globalThis__ = (function () { 44644function F() { 44645this.fetch = false;
44646this.DOMException = __global__.DOMException 44647} 44648F.prototype = __global__; // Needed for feature detection on whatwg-fetch's code 44649return new F(); 44650})(); 44651// Wraps whatwg-fetch with a function scope to hijack the global object 44652// "globalThis" that's going to be patched 44653(function(globalThis) { 44654 44655var irrelevant = (function (exports) { 44656 44657 /* eslint-disable no-prototype-builtins */ 44658 var g = 44659 (typeof globalThis !== 'undefined' && globalThis) || 44660 (typeof self !== 'undefined' && self) || 44661 // eslint-disable-next-line no-undef 44662 (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g
vendor: 19,290 bytes, lines 44662-45306
44662) || 44663 {}; 44664 44665 var support = { 44666 searchParams: 'URLSearchParams' in g, 44667 iterable: 'Symbol' in g && 'iterator' in Symbol, 44668 blob: 44669 'FileReader' in g && 44670 'Blob' in g && 44671 (function() { 44672 try { 44673 new Blob(); 44674 return true 44675 } catch (e) { 44676 return false 44677 } 44678 })(), 44679 formData: 'FormData' in g, 44680 arrayBuffer: 'ArrayBuffer' in g 44681 }; 44682 44683 function isDataView(obj) { 44684 return obj && DataView.prototype.isPrototypeOf(obj) 44685 } 44686 44687 if (support.arrayBuffer) { 44688 var viewClasses = [ 44689 '[object Int8Array]', 44690 '[object Uint8Array]', 44691 '[object Uint8ClampedArray]', 44692 '[object Int16Array]', 44693 '[object Uint16Array]', 44694 '[object Int32Array]', 44695 '[object Uint32Array]', 44696 '[object Float32Array]', 44697 '[object Float64Array]' 44698 ]; 44699 44700 var isArrayBufferView = 44701 ArrayBuffer.isView || 44702 function(obj) { 44703 return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 44704 }; 44705 } 44706 44707 function normalizeName(name) { 44708 if (typeof name !== 'string') { 44709 name = String(name); 44710 } 44711 if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') { 44712 throw new TypeError('Invalid character in header field name: "' + name + '"') 44713 } 44714 return name.toLowerCase() 44715 } 44716 44717 function normalizeValue(value) { 44718 if (typeof value !== 'string') { 44719 value = String(value); 44720 } 44721 return value 44722 } 44723 44724 // Build a destructive iterator for the value list 44725 function iteratorFor(items) { 44726 var iterator = { 44727 next: function() { 44728 var value = items.shift(); 44729 return {done: value === undefined, value: value} 44730 } 44731 }; 44732 44733 if (support.iterable) { 44734 iterator[Symbol.iterator] = function() { 44735 return iterator 44736 }; 44737 } 44738 44739 return iterator 44740 } 44741 44742 function Headers(headers) { 44743 this.map = {}; 44744 44745 if (headers instanceof Headers) { 44746 headers.forEach(function(value, name) { 44747 this.append(name, value); 44748 }, this); 44749 } else if (Array.isArray(headers)) { 44750 headers.forEach(function(header) { 44751 if (header.length != 2) { 44752 throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length) 44753 } 44754 this.append(header[0], header[1]); 44755 }, this); 44756 } else if (headers) { 44757 Object.getOwnPropertyNames(headers).forEach(function(name) { 44758 this.append(name, headers[name]); 44759 }, this); 44760 } 44761 } 44762 44763 Headers.prototype.append = function(name, value) { 44764 name = normalizeName(name); 44765 value = normalizeValue(value); 44766 var oldValue = this.map[name]; 44767 this.map[name] = oldValue ? oldValue + ', ' + value : value; 44768 }; 44769 44770 Headers.prototype['delete'] = function(name) { 44771 delete this.map[normalizeName(name)]; 44772 }; 44773 44774 Headers.prototype.get = function(name) { 44775 name = normalizeName(name); 44776 return this.has(name) ? this.map[name] : null 44777 }; 44778 44779 Headers.prototype.has = function(name) { 44780 return this.map.hasOwnProperty(normalizeName(name)) 44781 }; 44782 44783 Headers.prototype.set = function(name, value) { 44784 this.map[normalizeName(name)] = normalizeValue(value); 44785 }; 44786 44787 Headers.prototype.forEach = function(callback, thisArg) { 44788 for (var name in this.map) { 44789 if (this.map.hasOwnProperty(name)) { 44790 callback.call(thisArg, this.map[name], name, this); 44791 } 44792 } 44793 }; 44794 44795 Headers.prototype.keys = function() { 44796 var items = []; 44797 this.forEach(function(value, name) { 44798 items.push(name); 44799 }); 44800 return iteratorFor(items) 44801 }; 44802 44803 Headers.prototype.values = function() { 44804 var items = []; 44805 this.forEach(function(value) { 44806 items.push(value); 44807 }); 44808 return iteratorFor(items) 44809 }; 44810 44811 Headers.prototype.entries = function() { 44812 var items = []; 44813 this.forEach(function(value, name) { 44814 items.push([name, value]); 44815 }); 44816 return iteratorFor(items) 44817 }; 44818 44819 if (support.iterable) { 44820 Headers.prototype[Symbol.iterator] = Headers.prototype.entries; 44821 } 44822 44823 function consumed(body) { 44824 if (body._noBody) return 44825 if (body.bodyUsed) { 44826 return Promise.reject(new TypeError('Already read')) 44827 } 44828 body.bodyUsed = true; 44829 } 44830 44831 function fileReaderReady(reader) { 44832 return new Promise(function(resolve, reject) { 44833 reader.onload = function() { 44834 resolve(reader.result); 44835 }; 44836 reader.onerror = function() { 44837 reject(reader.error); 44838 }; 44839 }) 44840 } 44841 44842 function readBlobAsArrayBuffer(blob) { 44843 var reader = new FileReader(); 44844 var promise = fileReaderReady(reader); 44845 reader.readAsArrayBuffer(blob); 44846 return promise 44847 } 44848 44849 function readBlobAsText(blob) { 44850 var reader = new FileReader(); 44851 var promise = fileReaderReady(reader); 44852 var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type); 44853 var encoding = match ? match[1] : 'utf-8'; 44854 reader.readAsText(blob, encoding); 44855 return promise 44856 } 44857 44858 function readArrayBufferAsText(buf) { 44859 var view = new Uint8Array(buf); 44860 var chars = new Array(view.length); 44861 44862 for (var i = 0; i < view.length; i++) { 44863 chars[i] = String.fromCharCode(view[i]); 44864 } 44865 return chars.join('') 44866 } 44867 44868 function bufferClone(buf) { 44869 if (buf.slice) { 44870 return buf.slice(0) 44871 } else { 44872 var view = new Uint8Array(buf.byteLength); 44873 view.set(new Uint8Array(buf)); 44874 return view.buffer 44875 } 44876 } 44877 44878 function Body() { 44879 this.bodyUsed = false; 44880 44881 this._initBody = function(body) { 44882 /* 44883 fetch-mock wraps the Response object in an ES6 Proxy to 44884 provide useful test harness features such as flush. However, on 44885 ES5 browsers without fetch or Proxy support pollyfills must be used; 44886 the proxy-pollyfill is unable to proxy an attribute unless it exists 44887 on the object before the Proxy is created. This change ensures 44888 Response.bodyUsed exists on the instance, while maintaining the 44889 semantic of setting Request.bodyUsed in the constructor before 44890 _initBody is called. 44891 */ 44892 // eslint-disable-next-line no-self-assign 44893 this.bodyUsed = this.bodyUsed; 44894 this._bodyInit = body; 44895 if (!body) { 44896 this._noBody = true; 44897 this._bodyText = ''; 44898 } else if (typeof body === 'string') { 44899 this._bodyText = body; 44900 } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { 44901 this._bodyBlob = body; 44902 } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { 44903 this._bodyFormData = body; 44904 } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { 44905 this._bodyText = body.toString(); 44906 } else if (support.arrayBuffer && support.blob && isDataView(body)) { 44907 this._bodyArrayBuffer = bufferClone(body.buffer); 44908 // IE 10-11 can't handle a DataView body. 44909 this._bodyInit = new Blob([this._bodyArrayBuffer]); 44910 } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { 44911 this._bodyArrayBuffer = bufferClone(body); 44912 } else { 44913 this._bodyText = body = Object.prototype.toString.call(body); 44914 } 44915 44916 if (!this.headers.get('content-type')) { 44917 if (typeof body === 'string') { 44918 this.headers.set('content-type', 'text/plain;charset=UTF-8'); 44919 } else if (this._bodyBlob && this._bodyBlob.type) { 44920 this.headers.set('content-type', this._bodyBlob.type); 44921 } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { 44922 this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); 44923 } 44924 } 44925 }; 44926 44927 if (support.blob) { 44928 this.blob = function() { 44929 var rejected = consumed(this); 44930 if (rejected) { 44931 return rejected 44932 } 44933 44934 if (this._bodyBlob) { 44935 return Promise.resolve(this._bodyBlob) 44936 } else if (this._bodyArrayBuffer) { 44937 return Promise.resolve(new Blob([this._bodyArrayBuffer])) 44938 } else if (this._bodyFormData) { 44939 throw new Error('could not read FormData body as blob') 44940 } else { 44941 return Promise.resolve(new Blob([this._bodyText])) 44942 } 44943 }; 44944 } 44945 44946 this.arrayBuffer = function() { 44947 if (this._bodyArrayBuffer) { 44948 var isConsumed = consumed(this); 44949 if (isConsumed) { 44950 return isConsumed 44951 } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) { 44952 return Promise.resolve( 44953 this._bodyArrayBuffer.buffer.slice( 44954 this._bodyArrayBuffer.byteOffset, 44955 this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength 44956 ) 44957 ) 44958 } else { 44959 return Promise.resolve(this._bodyArrayBuffer) 44960 } 44961 } else if (support.blob) { 44962 return this.blob().then(readBlobAsArrayBuffer) 44963 } else { 44964 throw new Error('could not read as ArrayBuffer') 44965 } 44966 }; 44967 44968 this.text = function() { 44969 var rejected = consumed(this); 44970 if (rejected) { 44971 return rejected 44972 } 44973 44974 if (this._bodyBlob) { 44975 return readBlobAsText(this._bodyBlob) 44976 } else if (this._bodyArrayBuffer) { 44977 return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) 44978 } else if (this._bodyFormData) { 44979 throw new Error('could not read FormData body as text') 44980 } else { 44981 return Promise.resolve(this._bodyText) 44982 } 44983 }; 44984 44985 if (support.formData) { 44986 this.formData = function() { 44987 return this.text().then(decode) 44988 }; 44989 } 44990 44991 this.json = function() { 44992 return this.text().then(JSON.parse) 44993 }; 44994 44995 return this 44996 } 44997 44998 // HTTP methods whose capitalization should be normalized 44999 var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE']; 45000 45001 function normalizeMethod(method) { 45002 var upcased = method.toUpperCase(); 45003 return methods.indexOf(upcased) > -1 ? upcased : method 45004 } 45005 45006 function Request(input, options) { 45007 if (!(this instanceof Request)) { 45008 throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') 45009 } 45010 45011 options = options || {}; 45012 var body = options.body; 45013 45014 if (input instanceof Request) { 45015 if (input.bodyUsed) { 45016 throw new TypeError('Already read') 45017 } 45018 this.url = input.url; 45019 this.credentials = input.credentials; 45020 if (!options.headers) { 45021 this.headers = new Headers(input.headers); 45022 } 45023 this.method = input.method; 45024 this.mode = input.mode; 45025 this.signal = input.signal; 45026 if (!body && input._bodyInit != null) { 45027 body = input._bodyInit; 45028 input.bodyUsed = true; 45029 } 45030 } else { 45031 this.url = String(input); 45032 } 45033 45034 this.credentials = options.credentials || this.credentials || 'same-origin'; 45035 if (options.headers || !this.headers) { 45036 this.headers = new Headers(options.headers); 45037 } 45038 this.method = normalizeMethod(options.method || this.method || 'GET'); 45039 this.mode = options.mode || this.mode || null; 45040 this.signal = options.signal || this.signal || (function () { 45041 if ('AbortController' in g) { 45042 var ctrl = new AbortController(); 45043 return ctrl.signal; 45044 } 45045 }()); 45046 this.referrer = null; 45047 45048 if ((this.method === 'GET' || this.method === 'HEAD') && body) { 45049 throw new TypeError('Body not allowed for GET or HEAD requests') 45050 } 45051 this._initBody(body); 45052 45053 if (this.method === 'GET' || this.method === 'HEAD') { 45054 if (options.cache === 'no-store' || options.cache === 'no-cache') { 45055 // Search for a '_' parameter in the query string 45056 var reParamSearch = /([?&])_=[^&]*/; 45057 if (reParamSearch.test(this.url)) { 45058 // If it already exists then set the value with the current time 45059 this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime()); 45060 } else { 45061 // Otherwise add a new '_' parameter to the end with the current time 45062 var reQueryString = /\?/; 45063 this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime(); 45064 } 45065 } 45066 } 45067 } 45068 45069 Request.prototype.clone = function() { 45070 return new Request(this, {body: this._bodyInit}) 45071 }; 45072 45073 function decode(body) { 45074 var form = new FormData(); 45075 body 45076 .trim() 45077 .split('&') 45078 .forEach(function(bytes) { 45079 if (bytes) { 45080 var split = bytes.split('='); 45081 var name = split.shift().replace(/\+/g, ' '); 45082 var value = split.join('=').replace(/\+/g, ' '); 45083 form.append(decodeURIComponent(name), decodeURIComponent(value)); 45084 } 45085 }); 45086 return form 45087 } 45088 45089 function parseHeaders(rawHeaders) { 45090 var headers = new Headers(); 45091 // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space 45092 // https://tools.ietf.org/html/rfc7230#section-3.2 45093 var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); 45094 // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill 45095 // https://github.com/github/fetch/issues/748 45096 // https://github.com/zloirock/core-js/issues/751 45097 preProcessedHeaders 45098 .split('\r') 45099 .map(function(header) { 45100 return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header 45101 }) 45102 .forEach(function(line) { 45103 var parts = line.split(':'); 45104 var key = parts.shift().trim(); 45105 if (key) { 45106 var value = parts.join(':').trim(); 45107 try { 45108 headers.append(key, value); 45109 } catch (error) { 45110 console.warn('Response ' + error.message); 45111 } 45112 } 45113 }); 45114 return headers 45115 } 45116 45117 Body.call(Request.prototype); 45118 45119 function Response(bodyInit, options) { 45120 if (!(this instanceof Response)) { 45121 throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') 45122 } 45123 if (!options) { 45124 options = {}; 45125 } 45126 45127 this.type = 'default'; 45128 this.status = options.status === undefined ? 200 : options.status; 45129 if (this.status < 200 || this.status > 599) { 45130 throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].") 45131 } 45132 this.ok = this.status >= 200 && this.status < 300; 45133 this.statusText = options.statusText === undefined ? '' : '' + options.statusText; 45134 this.headers = new Headers(options.headers); 45135 this.url = options.url || ''; 45136 this._initBody(bodyInit); 45137 } 45138 45139 Body.call(Response.prototype); 45140 45141 Response.prototype.clone = function() { 45142 return new Response(this._bodyInit, { 45143 status: this.status, 45144 statusText: this.statusText, 45145 headers: new Headers(this.headers), 45146 url: this.url 45147 }) 45148 }; 45149 45150 Response.error = function() { 45151 var response = new Response(null, {status: 200, statusText: ''}); 45152 response.ok = false; 45153 response.status = 0; 45154 response.type = 'error'; 45155 return response 45156 }; 45157 45158 var redirectStatuses = [301, 302, 303, 307, 308]; 45159 45160 Response.redirect = function(url, status) { 45161 if (redirectStatuses.indexOf(status) === -1) { 45162 throw new RangeError('Invalid status code') 45163 } 45164 45165 return new Response(null, {status: status, headers: {location: url}}) 45166 }; 45167 45168 exports.DOMException = g.DOMException; 45169 try { 45170 new exports.DOMException(); 45171 } catch (err) { 45172 exports.DOMException = function(message, name) { 45173 this.message = message; 45174 this.name = name; 45175 var error = Error(message); 45176 this.stack = error.stack; 45177 }; 45178 exports.DOMException.prototype = Object.create(Error.prototype); 45179 exports.DOMException.prototype.constructor = exports.DOMException; 45180 } 45181 45182 function fetch(input, init) { 45183 return new Promise(function(resolve, reject) { 45184 var request = new Request(input, init); 45185 45186 if (request.signal && request.signal.aborted) { 45187 return reject(new exports.DOMException('Aborted', 'AbortError')) 45188 } 45189 45190 var xhr = new XMLHttpRequest(); 45191 45192 function abortXhr() { 45193 xhr.abort(); 45194 } 45195 45196 xhr.onload = function() { 45197 var options = { 45198 statusText: xhr.statusText, 45199 headers: parseHeaders(xhr.getAllResponseHeaders() || '') 45200 }; 45201 // This check if specifically for when a user fetches a file locally from the file system 45202 // Only if the status is out of a normal range 45203 if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) { 45204 options.status = 200; 45205 } else { 45206 options.status = xhr.status; 45207 } 45208 options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); 45209 var body = 'response' in xhr ? xhr.response : xhr.responseText; 45210 setTimeout(function() { 45211 resolve(new Response(body, options)); 45212 }, 0); 45213 }; 45214 45215 xhr.onerror = function() { 45216 setTimeout(function() { 45217 reject(new TypeError('Network request failed')); 45218 }, 0); 45219 }; 45220 45221 xhr.ontimeout = function() { 45222 setTimeout(function() { 45223 reject(new TypeError('Network request timed out')); 45224 }, 0); 45225 }; 45226 45227 xhr.onabort = function() { 45228 setTimeout(function() { 45229 reject(new exports.DOMException('Aborted', 'AbortError')); 45230 }, 0); 45231 }; 45232 45233 function fixUrl(url) { 45234 try { 45235 return url === '' && g.location.href ? g.location.href : url 45236 } catch (e) { 45237 return url 45238 } 45239 } 45240 45241 xhr.open(request.method, fixUrl(request.url), true); 45242 45243 if (request.credentials === 'include') { 45244 xhr.withCredentials = true; 45245 } else if (request.credentials === 'omit') { 45246 xhr.withCredentials = false; 45247 } 45248 45249 if ('responseType' in xhr) { 45250 if (support.blob) { 45251 xhr.responseType = 'blob'; 45252 } else if ( 45253 support.arrayBuffer 45254 ) { 45255 xhr.responseType = 'arraybuffer'; 45256 } 45257 } 45258 45259 if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) { 45260 var names = []; 45261 Object.getOwnPropertyNames(init.headers).forEach(function(name) { 45262 names.push(normalizeName(name)); 45263 xhr.setRequestHeader(name, normalizeValue(init.headers[name])); 45264 }); 45265 request.headers.forEach(function(value, name) { 45266 if (names.indexOf(name) === -1) { 45267 xhr.setRequestHeader(name, value); 45268 } 45269 }); 45270 } else { 45271 request.headers.forEach(function(value, name) { 45272 xhr.setRequestHeader(name, value); 45273 }); 45274 } 45275 45276 if (request.signal) { 45277 request.signal.addEventListener('abort', abortXhr); 45278 45279 xhr.onreadystatechange = function() { 45280 // DONE (success or failure) 45281 if (xhr.readyState === 4) { 45282 request.signal.removeEventListener('abort', abortXhr); 45283 } 45284 }; 45285 } 45286 45287 xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); 45288 }) 45289 } 45290 45291 fetch.polyfill = true; 45292 45293 if (!g.fetch) { 45294 g.fetch = fetch; 45295 g.Headers = Headers; 45296 g.Request = Request; 45297 g.Response = Response; 45298 } 45299 45300 exports.Headers = Headers; 45301 exports.Request = Request; 45302 exports.Response = Response; 45303 exports.fetch = fetch; 45304 45305 Object.defineProperty(exports, '__esModule', { value: true }); 45306
45307 return exports; 45308 45309})({}); 45310})(__globalThis__); 45311// This is a ponyfill, so... 45312__globalThis__.fetch.ponyfill = true; 45313delete __globalThis__.fetch.polyfill; 45314// Choose between native implementation (__global__) or custom implementation (__globalThis__) 45315var ctx = __global__.fetch ? __global__ : __globalThis__; 45316exports = ctx.fetch // To enable: import fetch from 'cross-fetch' 45317exports["default"] = ctx.fetch // For TypeScript consumers without esModuleInterop. 45318exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch' 45319exports.Headers = ctx.Headers 45320exports.Request = ctx.Request 45321exports.Response = ctx.Response 45322module.exports = exports 45323 45324 45325/***/ }, 45326 45327/***/ 30454 45328(module) { 45329 45330"use strict"; 45331 45332var token = '%[a-f0-9]{2}'; 45333var singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi'); 45334var multiMatcher = new RegExp('(' + token + ')+', 'gi'); 45335 45336function decodeComponents(components, split) { 45337 try { 45338 // Try to decode the entire string first 45339 return [decodeURIComponent(components.join(''))]; 45340 } catch (err) { 45341 // Do nothing 45342 } 45343 45344 if (components.length === 1) { 45345 return components; 45346 } 45347 45348 split = split || 1; 45349 45350 // Split the array in 2 parts 45351 var left = components.slice(0, split); 45352 var right = components.slice(split); 45353 45354 return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); 45355} 45356 45357function decode(input) { 45358 try { 45359 return decodeURIComponent(input); 45360 } catch (err) { 45361 var tokens = input.match(singleMatcher) || []; 45362 45363 for (var i = 1; i < tokens.length; i++) { 45364 input = decodeComponents(tokens, i).join(''); 45365 45366 tokens = input.match(singleMatcher) || []; 45367 } 45368 45369 return input; 45370 } 45371} 45372 45373function customDecodeURIComponent(input) { 45374 // Keep track of all the replacements and prefill the map with the `BOM` 45375 var replaceMap = { 45376 '%FE%FF': '\uFFFD\uFFFD', 45377 '%FF%FE': '\uFFFD\uFFFD' 45378 }; 45379 45380 var match = multiMatcher.exec(input); 45381 while (match) { 45382 try { 45383 // Decode as big chunks as possible 45384 replaceMap[match[0]] = decodeURIComponent(match[0]); 45385 } catch (err) { 45386 var result = decode(match[0]); 45387 45388 if (result !== match[0]) { 45389 replaceMap[match[0]] = result; 45390 } 45391 } 45392 45393 match = multiMatcher.exec(input); 45394 } 45395 45396 // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else 45397 replaceMap['%C2'] = '\uFFFD'; 45398 45399 var entries = Object.keys(replaceMap); 45400 45401 for (var i = 0; i < entries.length; i++) { 45402 // Replace all decoded components 45403 var key = entries[i]; 45404 input = input.replace(new RegExp(key, 'g'), replaceMap[key]); 45405 } 45406 45407 return input; 45408} 45409 45410module.exports = function (encodedURI) { 45411 if (typeof encodedURI !== 'string') { 45412 throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`'); 45413 } 45414 45415 try { 45416 encodedURI = encodedURI.replace(/\+/g, ' '); 45417 45418 // Try the built in decoder first 45419 return decodeURIComponent(encodedURI); 45420 } catch (err) { 45421 // Fallback to a more advanced decoder 45422 return customDecodeURIComponent(encodedURI); 45423 } 45424}; 45425 45426 45427/***/ }, 45428 45429/***/ 4982 45430(module, __unused_webpack_exports, __webpack_require__) { 45431 45432"use strict"; 45433 45434 45435var assign = __webpack_require__(6525); 45436var callBound = __webpack_require__(38075); 45437var flags = __webpack_require__(71589); 45438var GetIntrinsic = __webpack_require__(70453); 45439var getIterator = __webpack_require__(48037); 45440var getSideChannel = __webpack_require__(920); 45441var is = __webpack_require__(37653); 45442var isArguments = __webpack_require__(47244); 45443var isArray = __webpack_require__(64634); 45444var isArrayBuffer = __webpack_require__(84670); 45445var isDate = __webpack_require__(62120); 45446var isRegex = __webpack_require__(14035); 45447var isSharedArrayBuffer = __webpack_require__(37070); 45448var objectKeys = __webpack_require__(1189); 45449var whichBoxedPrimitive = __webpack_require__(81539); 45450var whichCollection = __webpack_require__(60593); 45451var whichTypedArray = __webpack_require__(25767); 45452var byteLength = __webpack_require__(19511); 45453 45454var sabByteLength = callBound('SharedArrayBuffer.prototype.byteLength', true); 45455 45456var $getTime = callBound('Date.prototype.getTime'); 45457var gPO = Object.getPrototypeOf; 45458var $objToString = callBound('Object.prototype.toString'); 45459 45460var $Set = GetIntrinsic('%Set%', true); 45461var $mapHas = callBound('Map.prototype.has', true); 45462var $mapGet = callBound('Map.prototype.get', true); 45463var $mapSize = callBound('Map.prototype.size', true); 45464var $setAdd = callBound('Set.prototype.add', true); 45465var $setDelete = callBound('Set.prototype.delete', true); 45466var $setHas = callBound('Set.prototype.has', true); 45467var $setSize = callBound('Set.prototype.size', true); 45468 45469// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L401-L414 45470function setHasEqualElement(set, val1, opts, channel) { 45471 var i = getIterator(set); 45472 var result; 45473 while ((result = i.next()) && !result.done) { 45474 if (internalDeepEqual(val1, result.value, opts, channel)) { // eslint-disable-line no-use-before-define 45475 // Remove the matching element to make sure we do not check that again. 45476 $setDelete(set, result.value); 45477 return true; 45478 } 45479 } 45480 45481 return false;
45482} 45483 45484// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L416-L439 45485function findLooseMatchingPrimitives(prim) { 45486 if (typeof prim === 'undefined') { 45487 return null; 45488 } 45489 if (typeof prim === 'object') { // Only pass in null as object! 45490 return void 0; 45491 } 45492 if (typeof prim === 'symbol') { 45493 return false; 45494 } 45495 if (typeof prim === 'string' || typeof prim === 'number') { 45496 // Loose equal entries exist only if the string is possible to convert to a regular number and not NaN. 45497 return +prim === +prim; // eslint-disable-line no-implicit-coercion 45498 } 45499 return true; 45500} 45501 45502// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L449-L460 45503function mapMightHaveLoosePrim(a, b, prim, item, opts, channel) { 45504 var altValue = findLooseMatchingPrimitives(prim); 45505 if (altValue != null) { 45506 return altValue; 45507 } 45508 var curB = $mapGet(b, altValue); 45509 var looseOpts = assign({}, opts, { strict: false }); 45510 if ( 45511 (typeof curB === 'undefined' && !$mapHas(b, altValue)) 45512 // eslint-disable-next-line no-use-before-define 45513 || !internalDeepEqual(item, curB, looseOpts, channel) 45514 ) { 45515 return false; 45516 } 45517 // eslint-disable-next-line no-use-before-define 45518 return !$mapHas(a, altValue) && internalDeepEqual(item, curB, looseOpts, channel); 45519} 45520 45521// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L441-L447 45522function setMightHaveLoosePrim(a, b, prim) { 45523 var altValue = findLooseMatchingPrimitives(prim); 45524 if (altValue != null) { 45525 return altValue; 45526 } 45527 45528 return $setHas(b, altValue) && !$setHas(a, altValue); 45529} 45530 45531// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L518-L533 45532function mapHasEqualEntry(set, map, key1, item1, opts, channel) { 45533 var i = getIterator(set); 45534 var result; 45535 var key2; 45536 while ((result = i.next()) && !result.done) { 45537 key2 = result.value; 45538 if ( 45539 // eslint-disable-next-line no-use-before-define 45540 internalDeepEqual(key1, key2, opts, channel) 45541 // eslint-disable-next-line no-use-before-define 45542 && internalDeepEqual(item1, $mapGet(map, key2), opts, channel) 45543 ) { 45544 $setDelete(set, key2); 45545 return true; 45546 } 45547 } 45548 45549 return false; 45550} 45551 45552function internalDeepEqual(actual, expected, options, channel) { 45553 var opts = options || {}; 45554 45555 // 7.1. All identical values are equivalent, as determined by ===. 45556 if (opts.strict ? is(actual, expected) : actual === expected) { 45557 return true; 45558 } 45559 45560 var actualBoxed = whichBoxedPrimitive(actual); 45561 var expectedBoxed = whichBoxedPrimitive(expected); 45562 if (actualBoxed !== expectedBoxed) { 45563 return false; 45564 } 45565 45566 // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==. 45567 if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) { 45568 return opts.strict ? is(actual, expected) : actual == expected; // eslint-disable-line eqeqeq 45569 } 45570 45571 /* 45572 * 7.4. For all other Object pairs, including Array objects, equivalence is 45573 * determined by having the same number of owned properties (as verified 45574 * with Object.prototype.hasOwnProperty.call), the same set of keys 45575 * (although not necessarily the same order), equivalent values for every 45576 * corresponding key, and an identical 'prototype' property. Note: this 45577 * accounts for both named and indexed properties on Arrays. 45578 */ 45579 // see https://github.com/nodejs/node/commit/d3aafd02efd3a403d646a3044adcf14e63a88d32 for memos/channel inspiration 45580 45581 var hasActual = channel.has(actual); 45582 var hasExpected = channel.has(expected); 45583 var sentinel; 45584 if (hasActual && hasExpected) { 45585 if (channel.get(actual) === channel.get(expected)) { 45586 return true; 45587 } 45588 } else { 45589 sentinel = {}; 45590 } 45591 if (!hasActual) { channel.set(actual, sentinel); } 45592 if (!hasExpected) { channel.set(expected, sentinel); } 45593 45594 // eslint-disable-next-line no-use-before-define 45595 return objEquiv(actual, expected, opts, channel); 45596} 45597 45598function isBuffer(x) { 45599 if (!x || typeof x !== 'object' || typeof x.length !== 'number') { 45600 return false;
45601 } 45602 if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { 45603 return false; 45604 } 45605 if (x.length > 0 && typeof x[0] !== 'number') { 45606 return false; 45607 } 45608 45609 return !!(x.constructor && x.constructor.isBuffer && x.constructor.isBuffer(x)); 45610} 45611 45612function setEquiv(a, b, opts, channel) { 45613 if ($setSize(a) !== $setSize(b)) { 45614 return false; 45615 } 45616 var iA = getIterator(a); 45617 var iB = getIterator(b); 45618 var resultA; 45619 var resultB; 45620 var set; 45621 while ((resultA = iA.next()) && !resultA.done) { 45622 if (resultA.value && typeof resultA.value === 'object') { 45623 if (!set) { set = new $Set(); } 45624 $setAdd(set, resultA.value); 45625 } else if (!$setHas(b, resultA.value)) { 45626 if (opts.strict) { return false; } 45627 if (!setMightHaveLoosePrim(a, b, resultA.value)) { 45628 return false; 45629 } 45630 if (!set) { set = new $Set(); } 45631 $setAdd(set, resultA.value); 45632 } 45633 } 45634 if (set) { 45635 while ((resultB = iB.next()) && !resultB.done) { 45636 // We have to check if a primitive value is already matching and only if it's not, go hunting for it. 45637 if (resultB.value && typeof resultB.value === 'object') { 45638 if (!setHasEqualElement(set, resultB.value, opts.strict, channel)) { 45639 return false; 45640 } 45641 } else if ( 45642 !opts.strict 45643 && !$setHas(a, resultB.value) 45644 && !setHasEqualElement(set, resultB.value, opts.strict, channel) 45645 ) { 45646 return false; 45647 } 45648 } 45649 return $setSize(set) === 0; 45650 } 45651 return true; 45652} 45653 45654function mapEquiv(a, b, opts, channel) { 45655 if ($mapSize(a) !== $mapSize(b)) { 45656 return false; 45657 } 45658 var iA = getIterator(a); 45659 var iB = getIterator(b); 45660 var resultA; 45661 var resultB; 45662 var set; 45663 var key; 45664 var item1; 45665 var item2; 45666 while ((resultA = iA.next()) && !resultA.done) { 45667 key = resultA.value[0]; 45668 item1 = resultA.value[1]; 45669 if (key && typeof key === 'object') { 45670 if (!set) { set = new $Set(); } 45671 $setAdd(set, key); 45672 } else { 45673 item2 = $mapGet(b, key); 45674 if ((typeof item2 === 'undefined' && !$mapHas(b, key)) || !internalDeepEqual(item1, item2, opts, channel)) { 45675 if (opts.strict) { 45676 return false; 45677 } 45678 if (!mapMightHaveLoosePrim(a, b, key, item1, opts, channel)) { 45679 return false; 45680 } 45681 if (!set) { set = new $Set(); } 45682 $setAdd(set, key); 45683 } 45684 } 45685 } 45686 45687 if (set) { 45688 while ((resultB = iB.next()) && !resultB.done) { 45689 key = resultB.value[0]; 45690 item2 = resultB.value[1]; 45691 if (key && typeof key === 'object') { 45692 if (!mapHasEqualEntry(set, a, key, item2, opts, channel)) { 45693 return false; 45694 } 45695 } else if ( 45696 !opts.strict 45697 && (!a.has(key) || !internalDeepEqual($mapGet(a, key), item2, opts, channel)) 45698 && !mapHasEqualEntry(set, a, key, item2, assign({}, opts, { strict: false }), channel) 45699 ) { 45700 return false; 45701 } 45702 } 45703 return $setSize(set) === 0; 45704 } 45705 return true; 45706} 45707 45708function objEquiv(a, b, opts, channel) { 45709 /* eslint max-statements: [2, 100], max-lines-per-function: [2, 120], max-depth: [2, 5], max-lines: [2, 400] */ 45710 var i, key; 45711 45712 if (typeof a !== typeof b) { return false; } 45713 if (a == null || b == null) { return false; } 45714 45715 if ($objToString(a) !== $objToString(b)) { return false; } 45716 45717 if (isArguments(a) !== isArguments(b)) { return false; } 45718 45719 var aIsArray = isArray(a); 45720 var bIsArray = isArray(b); 45721 if (aIsArray !== bIsArray) { return false; } 45722 45723 // TODO: replace when a cross-realm brand check is available 45724 var aIsError = a instanceof Error; 45725 var bIsError = b instanceof Error; 45726 if (aIsError !== bIsError) { return false; } 45727 if (aIsError || bIsError) { 45728 if (a.name !== b.name || a.message !== b.message) { return false; } 45729 } 45730 45731 var aIsRegex = isRegex(a); 45732 var bIsRegex = isRegex(b); 45733 if (aIsRegex !== bIsRegex) { return false; } 45734 if ((aIsRegex || bIsRegex) && (a.source !== b.source || flags(a) !== flags(b))) { 45735 return false; 45736 } 45737 45738 var aIsDate = isDate(a); 45739 var bIsDate = isDate(b); 45740 if (aIsDate !== bIsDate) { return false; } 45741 if (aIsDate || bIsDate) { // && would work too, because both are true or both false here 45742 if ($getTime(a) !== $getTime(b)) { return false; } 45743 } 45744 if (opts.strict && gPO && gPO(a) !== gPO(b)) { return false; } 45745 45746 var aWhich = whichTypedArray(a); 45747 var bWhich = whichTypedArray(b); 45748 if (aWhich !== bWhich) { 45749 return false;
45750 } 45751 if (aWhich || bWhich) { // && would work too, because both are true or both false here 45752 if (a.length !== b.length) { return false; } 45753 for (i = 0; i < a.length; i++) { 45754 if (a[i] !== b[i]) { return false; } 45755 } 45756 return true; 45757 } 45758 45759 var aIsBuffer = isBuffer(a); 45760 var bIsBuffer = isBuffer(b); 45761 if (aIsBuffer !== bIsBuffer) { return false; } 45762 if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here 45763 if (a.length !== b.length) { return false; } 45764 for (i = 0; i < a.length; i++) { 45765 if (a[i] !== b[i]) { return false; } 45766 } 45767 return true; 45768 } 45769 45770 var aIsArrayBuffer = isArrayBuffer(a); 45771 var bIsArrayBuffer = isArrayBuffer(b); 45772 if (aIsArrayBuffer !== bIsArrayBuffer) { return false; } 45773 if (aIsArrayBuffer || bIsArrayBuffer) { // && would work too, because both are true or both false here 45774 if (byteLength(a) !== byteLength(b)) { return false; } 45775 return typeof Uint8Array === 'function' && internalDeepEqual(new Uint8Array(a), new Uint8Array(b), opts, channel); 45776 } 45777 45778 var aIsSAB = isSharedArrayBuffer(a); 45779 var bIsSAB = isSharedArrayBuffer(b); 45780 if (aIsSAB !== bIsSAB) { return false; } 45781 if (aIsSAB || bIsSAB) { // && would work too, because both are true or both false here 45782 if (sabByteLength(a) !== sabByteLength(b)) { return false; } 45783 return typeof Uint8Array === 'function' && internalDeepEqual(new Uint8Array(a), new Uint8Array(b), opts, channel); 45784 } 45785 45786 if (typeof a !== typeof b) { return false; } 45787 45788 var ka = objectKeys(a); 45789 var kb = objectKeys(b); 45790 // having the same number of owned properties (keys incorporates hasOwnProperty) 45791 if (ka.length !== kb.length) { return false; } 45792 45793 // the same set of keys (although not necessarily the same order), 45794 ka.sort(); 45795 kb.sort(); 45796 // ~~~cheap key test 45797 for (i = ka.length - 1; i >= 0; i--) { 45798 if (ka[i] != kb[i]) { return false; } // eslint-disable-line eqeqeq 45799 } 45800 45801 // equivalent values for every corresponding key, and ~~~possibly expensive deep test 45802 for (i = ka.length - 1; i >= 0; i--) { 45803 key = ka[i]; 45804 if (!internalDeepEqual(a[key], b[key], opts, channel)) { return false; } 45805 } 45806 45807 var aCollection = whichCollection(a); 45808 var bCollection = whichCollection(b); 45809 if (aCollection !== bCollection) { 45810 return false; 45811 } 45812 if (aCollection === 'Set' || bCollection === 'Set') { // aCollection === bCollection 45813 return setEquiv(a, b, opts, channel); 45814 } 45815 if (aCollection === 'Map') { // aCollection === bCollection 45816 return mapEquiv(a, b, opts, channel); 45817 } 45818 45819 return true; 45820} 45821 45822module.exports = function deepEqual(a, b, opts) { 45823 return internalDeepEqual(a, b, opts, getSideChannel()); 45824}; 45825 45826 45827/***/ }, 45828 45829/***/ 14744 45830(module) { 45831 45832"use strict"; 45833 45834 45835var isMergeableObject = function isMergeableObject(value) { 45836 return isNonNullObject(value) 45837 && !isSpecial(value) 45838}; 45839 45840function isNonNullObject(value) { 45841 return !!value && typeof value === 'object' 45842} 45843 45844function isSpecial(value) { 45845 var stringValue = Object.prototype.toString.call(value); 45846 45847 return stringValue === '[object RegExp]' 45848 || stringValue === '[object Date]' 45849 || isReactElement(value) 45850} 45851 45852// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25 45853var canUseSymbol = typeof Symbol === 'function' && Symbol.for; 45854var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7; 45855 45856function isReactElement(value) { 45857 return value.$$typeof === REACT_ELEMENT_TYPE 45858} 45859 45860function emptyTarget(val) { 45861 return Array.isArray(val) ? [] : {} 45862} 45863 45864function cloneUnlessOtherwiseSpecified(value, options) { 45865 return (options.clone !== false && options.isMergeableObject(value)) 45866 ? deepmerge(emptyTarget(value), value, options) 45867 : value 45868} 45869 45870function defaultArrayMerge(target, source, options) { 45871 return target.concat(source).map(function(element) { 45872 return cloneUnlessOtherwiseSpecified(element, options) 45873 }) 45874} 45875 45876function getMergeFunction(key, options) { 45877 if (!options.customMerge) { 45878 return deepmerge 45879 } 45880 var customMerge = options.customMerge(key); 45881 return typeof customMerge === 'function' ? customMerge : deepmerge 45882} 45883 45884function getEnumerableOwnPropertySymbols(target) { 45885 return Object.getOwnPropertySymbols 45886 ? Object.getOwnPropertySymbols(target).filter(function(symbol) { 45887 return Object.propertyIsEnumerable.call(target, symbol) 45888 }) 45889 : [] 45890} 45891 45892function getKeys(target) { 45893 return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)) 45894} 45895 45896function propertyIsOnObject(object, property) { 45897 try { 45898 return property in object 45899 } catch(_) { 45900 return false 45901 } 45902} 45903 45904// Protects from prototype poisoning and unexpected merging up the prototype chain.
vendor: 5,924 bytes, lines 45905-46092
45905function propertyIsUnsafe(target, key) { 45906 return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet, 45907 && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain, 45908 && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable. 45909} 45910 45911function mergeObject(target, source, options) { 45912 var destination = {}; 45913 if (options.isMergeableObject(target)) { 45914 getKeys(target).forEach(function(key) { 45915 destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); 45916 }); 45917 } 45918 getKeys(source).forEach(function(key) { 45919 if (propertyIsUnsafe(target, key)) { 45920 return 45921 } 45922 45923 if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { 45924 destination[key] = getMergeFunction(key, options)(target[key], source[key], options); 45925 } else { 45926 destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); 45927 } 45928 }); 45929 return destination 45930} 45931 45932function deepmerge(target, source, options) { 45933 options = options || {}; 45934 options.arrayMerge = options.arrayMerge || defaultArrayMerge; 45935 options.isMergeableObject = options.isMergeableObject || isMergeableObject; 45936 // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge() 45937 // implementations can use it. The caller may not replace it. 45938 options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; 45939 45940 var sourceIsArray = Array.isArray(source); 45941 var targetIsArray = Array.isArray(target); 45942 var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; 45943 45944 if (!sourceAndTargetTypesMatch) { 45945 return cloneUnlessOtherwiseSpecified(source, options) 45946 } else if (sourceIsArray) { 45947 return options.arrayMerge(target, source, options) 45948 } else { 45949 return mergeObject(target, source, options) 45950 } 45951} 45952 45953deepmerge.all = function deepmergeAll(array, options) { 45954 if (!Array.isArray(array)) { 45955 throw new Error('first argument should be an array') 45956 } 45957 45958 return array.reduce(function(prev, next) { 45959 return deepmerge(prev, next, options) 45960 }, {}) 45961}; 45962 45963var deepmerge_1 = deepmerge; 45964 45965module.exports = deepmerge_1; 45966 45967 45968/***/ }, 45969 45970/***/ 30041 45971(module, __unused_webpack_exports, __webpack_require__) { 45972 45973"use strict"; 45974 45975 45976var $defineProperty = __webpack_require__(30655); 45977 45978var $SyntaxError = __webpack_require__(58068); 45979var $TypeError = __webpack_require__(69675); 45980 45981var gopd = __webpack_require__(75795); 45982 45983/** @type {import('.')} */ 45984module.exports = function defineDataProperty( 45985 obj, 45986 property, 45987 value 45988) { 45989 if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { 45990 throw new $TypeError('`obj` must be an object or a function`'); 45991 } 45992 if (typeof property !== 'string' && typeof property !== 'symbol') { 45993 throw new $TypeError('`property` must be a string or a symbol`'); 45994 } 45995 if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { 45996 throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); 45997 } 45998 if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { 45999 throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); 46000 } 46001 if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { 46002 throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); 46003 } 46004 if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { 46005 throw new $TypeError('`loose`, if provided, must be a boolean'); 46006 } 46007 46008 var nonEnumerable = arguments.length > 3 ? arguments[3] : null; 46009 var nonWritable = arguments.length > 4 ? arguments[4] : null; 46010 var nonConfigurable = arguments.length > 5 ? arguments[5] : null; 46011 var loose = arguments.length > 6 ? arguments[6] : false; 46012 46013 /* @type {false | TypedPropertyDescriptor<unknown>} */ 46014 var desc = !!gopd && gopd(obj, property); 46015 46016 if ($defineProperty) { 46017 $defineProperty(obj, property, { 46018 configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, 46019 enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, 46020 value: value, 46021 writable: nonWritable === null && desc ? desc.writable : !nonWritable 46022 }); 46023 } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { 46024 // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable 46025 obj[property] = value; // eslint-disable-line no-param-reassign 46026 } else { 46027 throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); 46028 } 46029}; 46030 46031 46032/***/ }, 46033 46034/***/ 38452 46035(module, __unused_webpack_exports, __webpack_require__) { 46036 46037"use strict"; 46038 46039 46040var keys = __webpack_require__(1189); 46041var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; 46042 46043var toStr = Object.prototype.toString; 46044var concat = Array.prototype.concat; 46045var defineDataProperty = __webpack_require__(30041); 46046 46047var isFunction = function (fn) { 46048 return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; 46049}; 46050 46051var supportsDescriptors = __webpack_require__(30592)(); 46052 46053var defineProperty = function (object, name, value, predicate) { 46054 if (name in object) { 46055 if (predicate === true) { 46056 if (object[name] === value) { 46057 return; 46058 } 46059 } else if (!isFunction(predicate) || !predicate()) { 46060 return; 46061 } 46062 } 46063 46064 if (supportsDescriptors) { 46065 defineDataProperty(object, name, value, true); 46066 } else { 46067 defineDataProperty(object, name, value); 46068 } 46069}; 46070 46071var defineProperties = function (object, map) { 46072 var predicates = arguments.length > 2 ? arguments[2] : {}; 46073 var props = keys(map); 46074 if (hasSymbols) { 46075 props = concat.call(props, Object.getOwnPropertySymbols(map)); 46076 } 46077 for (var i = 0; i < props.length; i += 1) { 46078 defineProperty(object, props[i], map[props[i]], predicates[props[i]]); 46079 } 46080}; 46081 46082defineProperties.supportsDescriptors = !!supportsDescriptors; 46083 46084module.exports = defineProperties; 46085 46086 46087/***/ }, 46088 46089/***/ 74021 46090(module) { 46091 46092module.exports = false;
46093 46094 46095 46096/***/ }, 46097 46098/***/ 7176 46099(module, __unused_webpack_exports, __webpack_require__) { 46100 46101"use strict"; 46102 46103 46104var callBind = __webpack_require__(73126); 46105var gOPD = __webpack_require__(75795); 46106 46107var hasProtoAccessor; 46108try { 46109 // eslint-disable-next-line no-extra-parens, no-proto 46110 hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; 46111} catch (e) { 46112 if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { 46113 throw e; 46114 } 46115} 46116 46117// eslint-disable-next-line no-extra-parens 46118var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); 46119 46120var $Object = Object; 46121var $getPrototypeOf = $Object.getPrototypeOf; 46122 46123/** @type {import('./get')} */ 46124module.exports = desc && typeof desc.get === 'function' 46125 ? callBind([desc.get]) 46126 : typeof $getPrototypeOf === 'function' 46127 ? /** @type {import('./get')} */ function getDunder(value) { 46128 // eslint-disable-next-line eqeqeq 46129 return $getPrototypeOf(value == null ? value : $Object(value)); 46130 } 46131 : false; 46132 46133 46134/***/ }, 46135 46136/***/ 30655 46137(module) { 46138 46139"use strict"; 46140 46141 46142/** @type {import('.')} */ 46143var $defineProperty = Object.defineProperty || false; 46144if ($defineProperty) { 46145 try { 46146 $defineProperty({}, 'a', { value: 1 }); 46147 } catch (e) { 46148 // IE 8 has a broken defineProperty 46149 $defineProperty = false; 46150 } 46151} 46152 46153module.exports = $defineProperty; 46154 46155 46156/***/ }, 46157 46158/***/ 41237 46159(module) { 46160 46161"use strict"; 46162 46163 46164/** @type {import('./eval')} */ 46165module.exports = EvalError; 46166 46167 46168/***/ }, 46169 46170/***/ 69383 46171(module) { 46172 46173"use strict"; 46174 46175 46176/** @type {import('.')} */ 46177module.exports = Error; 46178 46179 46180/***/ }, 46181 46182/***/ 79290 46183(module) { 46184 46185"use strict"; 46186 46187 46188/** @type {import('./range')} */ 46189module.exports = RangeError; 46190 46191 46192/***/ }, 46193 46194/***/ 79538 46195(module) { 46196 46197"use strict"; 46198 46199 46200/** @type {import('./ref')} */ 46201module.exports = ReferenceError; 46202 46203 46204/***/ }, 46205 46206/***/ 58068 46207(module) { 46208 46209"use strict"; 46210 46211 46212/** @type {import('./syntax')} */ 46213module.exports = SyntaxError; 46214 46215 46216/***/ }, 46217 46218/***/ 69675 46219(module) { 46220 46221"use strict"; 46222 46223 46224/** @type {import('./type')} */ 46225module.exports = TypeError; 46226 46227 46228/***/ }, 46229 46230/***/ 35345 46231(module) { 46232 46233"use strict"; 46234 46235 46236/** @type {import('./uri')} */ 46237module.exports = URIError; 46238 46239 46240/***/ }, 46241 46242/***/ 48037 46243(module, __unused_webpack_exports, __webpack_require__) { 46244 46245"use strict"; 46246 46247 46248/* eslint global-require: 0 */ 46249// the code is structured this way so that bundlers can 46250// alias out `has-symbols` to `() => true` or `() => false` if your target 46251// environments' Symbol capabilities are known, and then use 46252// dead code elimination on the rest of this module. 46253// 46254// Similarly, `isarray` can be aliased to `Array.isArray` if 46255// available in all target environments. 46256 46257var isArguments = __webpack_require__(47244); 46258var getStopIterationIterator = __webpack_require__(81820); 46259 46260if (__webpack_require__(64039)() || __webpack_require__(41333)()) { 46261 var $iterator = Symbol.iterator; 46262 // Symbol is available natively or shammed 46263 // natively: 46264 // - Chrome >= 38 46265 // - Edge 12-14?, Edge >= 15 for sure 46266 // - FF >= 36 46267 // - Safari >= 9 46268 // - node >= 0.12 46269 module.exports = function getIterator(iterable) { 46270 // alternatively, `iterable[$iterator]?.()` 46271 if (iterable != null && typeof iterable[$iterator] !== 'undefined') { 46272 return iterable[$iterator](); 46273 } 46274 if (isArguments(iterable)) { 46275 // arguments objects lack Symbol.iterator 46276 // - node 0.12 46277 return Array.prototype[$iterator].call(iterable); 46278 } 46279 }; 46280} else { 46281 // Symbol is not available, native or shammed 46282 var isArray = __webpack_require__(64634); 46283 var isString = __webpack_require__(4761); 46284 var GetIntrinsic = __webpack_require__(70453); 46285 var $Map = GetIntrinsic('%Map%', true); 46286 var $Set = GetIntrinsic('%Set%', true); 46287 var callBound = __webpack_require__(38075); 46288 var $arrayPush = callBound('Array.prototype.push'); 46289 var $charCodeAt = callBound('String.prototype.charCodeAt'); 46290 var $stringSlice = callBound('String.prototype.slice'); 46291 46292 var advanceStringIndex = function advanceStringIndex(S, index) { 46293 var length = S.length; 46294 if ((index + 1) >= length) { 46295 return index + 1; 46296 } 46297 46298 var first = $charCodeAt(S, index); 46299 if (first < 0xD800 || first > 0xDBFF) { 46300 return index + 1; 46301 } 46302 46303 var second = $charCodeAt(S, index + 1); 46304 if (second < 0xDC00 || second > 0xDFFF) { 46305 return index + 1; 46306 } 46307 46308 return index + 2; 46309 }; 46310 46311 var getArrayIterator = function getArrayIterator(arraylike) { 46312 var i = 0; 46313 return { 46314 next: function next() { 46315 var done = i >= arraylike.length; 46316 var value; 46317 if (!done) { 46318 value = arraylike[i]; 46319 i += 1; 46320 } 46321 return { 46322 done: done, 46323 value: value 46324 }; 46325 } 46326 }; 46327 }; 46328 46329 var getNonCollectionIterator = function getNonCollectionIterator(iterable, noPrimordialCollections) { 46330 if (isArray(iterable) || isArguments(iterable)) { 46331 return getArrayIterator(iterable); 46332 } 46333 if (isString(iterable)) { 46334 var i = 0; 46335 return { 46336 next: function next() { 46337 var nextIndex = advanceStringIndex(iterable, i); 46338 var value = $stringSlice(iterable, i, nextIndex); 46339 i = nextIndex; 46340 return { 46341 done: nextIndex > iterable.length, 46342 value: value 46343 }; 46344 } 46345 }; 46346 } 46347 46348 // es6-shim and es-shims' es-map use a string "_es6-shim iterator_" property on different iterables, such as MapIterator.
46349 if (noPrimordialCollections && typeof iterable['_es6-shim iterator_'] !== 'undefined') { 46350 return iterable['_es6-shim iterator_'](); 46351 } 46352 }; 46353 46354 if (!$Map && !$Set) { 46355 // the only language iterables are Array, String, arguments 46356 // - Safari <= 6.0 46357 // - Chrome < 38 46358 // - node < 0.12 46359 // - FF < 13 46360 // - IE < 11 46361 // - Edge < 11 46362 46363 module.exports = function getIterator(iterable) { 46364 if (iterable != null) { 46365 return getNonCollectionIterator(iterable, true); 46366 } 46367 }; 46368 } else { 46369 // either Map or Set are available, but Symbol is not 46370 // - es6-shim on an ES5 browser 46371 // - Safari 6.2 (maybe 6.1?) 46372 // - FF v[13, 36) 46373 // - IE 11 46374 // - Edge 11 46375 // - Safari v[6, 9) 46376 46377 var isMap = __webpack_require__(83802); 46378 var isSet = __webpack_require__(90256); 46379 46380 // Firefox >= 27, IE 11, Safari 6.2 - 9, Edge 11, es6-shim in older envs, all have forEach 46381 var $mapForEach = callBound('Map.prototype.forEach', true); 46382 var $setForEach = callBound('Set.prototype.forEach', true); 46383 if (typeof process === 'undefined' || !process.versions || !process.versions.node) { // "if is not node" 46384 46385 // Firefox 17 - 26 has `.iterator()`, whose iterator `.next()` either 46386 // returns a value, or throws a StopIteration object. These browsers 46387 // do not have any other mechanism for iteration. 46388 var $mapIterator = callBound('Map.prototype.iterator', true); 46389 var $setIterator = callBound('Set.prototype.iterator', true); 46390 } 46391 // Firefox 27-35, and some older es6-shim versions, use a string "@@iterator" property 46392 // this returns a proper iterator object, so we should use it instead of forEach. 46393 // newer es6-shim versions use a string "_es6-shim iterator_" property. 46394 var $mapAtAtIterator = callBound('Map.prototype.@@iterator', true) || callBound('Map.prototype._es6-shim iterator_', true); 46395 var $setAtAtIterator = callBound('Set.prototype.@@iterator', true) || callBound('Set.prototype._es6-shim iterator_', true); 46396 46397 var getCollectionIterator = function getCollectionIterator(iterable) { 46398 if (isMap(iterable)) { 46399 if ($mapIterator) { 46400 return getStopIterationIterator($mapIterator(iterable)); 46401 } 46402 if ($mapAtAtIterator) { 46403 return $mapAtAtIterator(iterable); 46404 } 46405 if ($mapForEach) { 46406 var entries = []; 46407 $mapForEach(iterable, function (v, k) { 46408 $arrayPush(entries, [k, v]); 46409 }); 46410 return getArrayIterator(entries); 46411 } 46412 } 46413 if (isSet(iterable)) { 46414 if ($setIterator) { 46415 return getStopIterationIterator($setIterator(iterable)); 46416 } 46417 if ($setAtAtIterator) { 46418 return $setAtAtIterator(iterable); 46419 } 46420 if ($setForEach) { 46421 var values = []; 46422 $setForEach(iterable, function (v) { 46423 $arrayPush(values, v); 46424 }); 46425 return getArrayIterator(values); 46426 } 46427 } 46428 }; 46429 46430 module.exports = function getIterator(iterable) { 46431 return getCollectionIterator(iterable) || getNonCollectionIterator(iterable); 46432 }; 46433 } 46434} 46435 46436 46437/***/ }, 46438 46439/***/ 79612 46440(module) { 46441 46442"use strict"; 46443 46444 46445/** @type {import('.')} */ 46446module.exports = Object; 46447 46448 46449/***/ }, 46450 46451/***/ 92849 46452(module) { 46453 46454"use strict"; 46455 46456 46457var hasOwn = Object.prototype.hasOwnProperty; 46458var toStr = Object.prototype.toString; 46459var defineProperty = Object.defineProperty; 46460var gOPD = Object.getOwnPropertyDescriptor; 46461 46462var isArray = function isArray(arr) { 46463 if (typeof Array.isArray === 'function') { 46464 return Array.isArray(arr); 46465 } 46466 46467 return toStr.call(arr) === '[object Array]'; 46468}; 46469 46470var isPlainObject = function isPlainObject(obj) { 46471 if (!obj || toStr.call(obj) !== '[object Object]') { 46472 return false; 46473 } 46474 46475 var hasOwnConstructor = hasOwn.call(obj, 'constructor'); 46476 var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); 46477 // Not own constructor property must be Object 46478 if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { 46479 return false; 46480 } 46481 46482 // Own properties are enumerated firstly, so to speed up, 46483 // if last one is own, then all properties are own. 46484 var key; 46485 for (key in obj) { /**/ } 46486 46487 return typeof key === 'undefined' || hasOwn.call(obj, key); 46488}; 46489 46490// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target 46491var setProperty = function setProperty(target, options) { 46492 if (defineProperty && options.name === '__proto__') { 46493 defineProperty(target, options.name, { 46494 enumerable: true, 46495 configurable: true, 46496 value: options.newValue, 46497 writable: true 46498 }); 46499 } else { 46500 target[options.name] = options.newValue; 46501 } 46502}; 46503 46504// Return undefined instead of __proto__ if '__proto__' is not an own property 46505var getProperty = function getProperty(obj, name) { 46506 if (name === '__proto__') { 46507 if (!hasOwn.call(obj, name)) { 46508 return void 0; 46509 } else if (gOPD) { 46510 // In early versions of node, obj['__proto__'] is buggy when obj has 46511 // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. 46512 return gOPD(obj, name).value; 46513 } 46514 } 46515 46516 return obj[name]; 46517}; 46518 46519module.exports = function extend() { 46520 var options, name, src, copy, copyIsArray, clone; 46521 var target = arguments[0]; 46522 var i = 1; 46523 var length = arguments.length; 46524 var deep = false;
vendor: 6,513 bytes, lines 46525-46812
46525 46526 // Handle a deep copy situation 46527 if (typeof target === 'boolean') { 46528 deep = target; 46529 target = arguments[1] || {}; 46530 // skip the boolean and the target 46531 i = 2; 46532 } 46533 if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { 46534 target = {}; 46535 } 46536 46537 for (; i < length; ++i) { 46538 options = arguments[i]; 46539 // Only deal with non-null/undefined values 46540 if (options != null) { 46541 // Extend the base object 46542 for (name in options) { 46543 src = getProperty(target, name); 46544 copy = getProperty(options, name); 46545 46546 // Prevent never-ending loop 46547 if (target !== copy) { 46548 // Recurse if we're merging plain objects or arrays 46549 if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { 46550 if (copyIsArray) { 46551 copyIsArray = false; 46552 clone = src && isArray(src) ? src : []; 46553 } else { 46554 clone = src && isPlainObject(src) ? src : {}; 46555 } 46556 46557 // Never move original objects, clone them 46558 setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); 46559 46560 // Don't bring in undefined values 46561 } else if (typeof copy !== 'undefined') { 46562 setProperty(target, { name: name, newValue: copy }); 46563 } 46564 } 46565 } 46566 } 46567 } 46568 46569 // Return the modified object 46570 return target; 46571}; 46572 46573 46574/***/ }, 46575 46576/***/ 73055 46577(module) { 46578 46579"use strict"; 46580 46581module.exports = function (obj, predicate) { 46582 var ret = {}; 46583 var keys = Object.keys(obj); 46584 var isArr = Array.isArray(predicate); 46585 46586 for (var i = 0; i < keys.length; i++) { 46587 var key = keys[i]; 46588 var val = obj[key]; 46589 46590 if (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) { 46591 ret[key] = val; 46592 } 46593 } 46594 46595 return ret; 46596}; 46597 46598 46599/***/ }, 46600 46601/***/ 82682 46602(module, __unused_webpack_exports, __webpack_require__) { 46603 46604"use strict"; 46605 46606 46607var isCallable = __webpack_require__(69600); 46608 46609var toStr = Object.prototype.toString; 46610var hasOwnProperty = Object.prototype.hasOwnProperty; 46611 46612var forEachArray = function forEachArray(array, iterator, receiver) { 46613 for (var i = 0, len = array.length; i < len; i++) { 46614 if (hasOwnProperty.call(array, i)) { 46615 if (receiver == null) { 46616 iterator(array[i], i, array); 46617 } else { 46618 iterator.call(receiver, array[i], i, array); 46619 } 46620 } 46621 } 46622}; 46623 46624var forEachString = function forEachString(string, iterator, receiver) { 46625 for (var i = 0, len = string.length; i < len; i++) { 46626 // no such thing as a sparse string. 46627 if (receiver == null) { 46628 iterator(string.charAt(i), i, string); 46629 } else { 46630 iterator.call(receiver, string.charAt(i), i, string); 46631 } 46632 } 46633}; 46634 46635var forEachObject = function forEachObject(object, iterator, receiver) { 46636 for (var k in object) { 46637 if (hasOwnProperty.call(object, k)) { 46638 if (receiver == null) { 46639 iterator(object[k], k, object); 46640 } else { 46641 iterator.call(receiver, object[k], k, object); 46642 } 46643 } 46644 } 46645}; 46646 46647var forEach = function forEach(list, iterator, thisArg) { 46648 if (!isCallable(iterator)) { 46649 throw new TypeError('iterator must be a function'); 46650 } 46651 46652 var receiver; 46653 if (arguments.length >= 3) { 46654 receiver = thisArg; 46655 } 46656 46657 if (toStr.call(list) === '[object Array]') { 46658 forEachArray(list, iterator, receiver); 46659 } else if (typeof list === 'string') { 46660 forEachString(list, iterator, receiver); 46661 } else { 46662 forEachObject(list, iterator, receiver); 46663 } 46664}; 46665 46666module.exports = forEach; 46667 46668 46669/***/ }, 46670 46671/***/ 86855 46672(module) { 46673 46674/*! fromentries. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ 46675module.exports = function fromEntries (iterable) { 46676 return [...iterable].reduce((obj, [key, val]) => { 46677 obj[key] = val 46678 return obj 46679 }, {}) 46680} 46681 46682 46683/***/ }, 46684 46685/***/ 89353 46686(module) { 46687 46688"use strict"; 46689 46690 46691/* eslint no-invalid-this: 1 */ 46692 46693var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; 46694var toStr = Object.prototype.toString; 46695var max = Math.max; 46696var funcType = '[object Function]'; 46697 46698var concatty = function concatty(a, b) { 46699 var arr = []; 46700 46701 for (var i = 0; i < a.length; i += 1) { 46702 arr[i] = a[i]; 46703 } 46704 for (var j = 0; j < b.length; j += 1) { 46705 arr[j + a.length] = b[j]; 46706 } 46707 46708 return arr; 46709}; 46710 46711var slicy = function slicy(arrLike, offset) { 46712 var arr = []; 46713 for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { 46714 arr[j] = arrLike[i]; 46715 } 46716 return arr; 46717}; 46718 46719var joiny = function (arr, joiner) { 46720 var str = ''; 46721 for (var i = 0; i < arr.length; i += 1) { 46722 str += arr[i]; 46723 if (i + 1 < arr.length) { 46724 str += joiner; 46725 } 46726 } 46727 return str; 46728}; 46729 46730module.exports = function bind(that) { 46731 var target = this; 46732 if (typeof target !== 'function' || toStr.apply(target) !== funcType) { 46733 throw new TypeError(ERROR_MESSAGE + target); 46734 } 46735 var args = slicy(arguments, 1); 46736 46737 var bound; 46738 var binder = function () { 46739 if (this instanceof bound) { 46740 var result = target.apply( 46741 this, 46742 concatty(args, arguments) 46743 ); 46744 if (Object(result) === result) { 46745 return result; 46746 } 46747 return this; 46748 } 46749 return target.apply( 46750 that, 46751 concatty(args, arguments) 46752 ); 46753 46754 }; 46755 46756 var boundLength = max(0, target.length - args.length); 46757 var boundArgs = []; 46758 for (var i = 0; i < boundLength; i++) { 46759 boundArgs[i] = '$' + i; 46760 } 46761 46762 bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); 46763 46764 if (target.prototype) { 46765 var Empty = function Empty() {}; 46766 Empty.prototype = target.prototype; 46767 bound.prototype = new Empty(); 46768 Empty.prototype = null; 46769 } 46770 46771 return bound; 46772}; 46773 46774 46775/***/ }, 46776 46777/***/ 66743 46778(module, __unused_webpack_exports, __webpack_require__) { 46779 46780"use strict"; 46781 46782 46783var implementation = __webpack_require__(89353); 46784 46785module.exports = Function.prototype.bind || implementation; 46786 46787 46788/***/ }, 46789 46790/***/ 74462 46791(module) { 46792 46793"use strict"; 46794 46795 46796var functionsHaveNames = function functionsHaveNames() { 46797 return typeof function f() {}.name === 'string'; 46798}; 46799 46800var gOPD = Object.getOwnPropertyDescriptor; 46801if (gOPD) { 46802 try { 46803 gOPD([], 'length'); 46804 } catch (e) { 46805 // IE 8 has a broken gOPD 46806 gOPD = null; 46807 } 46808} 46809 46810functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() { 46811 if (!functionsHaveNames() || !gOPD) { 46812 return false;
vendor: 19,016 bytes, lines 46813-47404
46813 } 46814 var desc = gOPD(function () {}, 'name'); 46815 return !!desc && !!desc.configurable; 46816}; 46817 46818var $bind = Function.prototype.bind; 46819 46820functionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() { 46821 return functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== ''; 46822}; 46823 46824module.exports = functionsHaveNames; 46825 46826 46827/***/ }, 46828 46829/***/ 70453 46830(module, __unused_webpack_exports, __webpack_require__) { 46831 46832"use strict"; 46833 46834 46835var undefined; 46836 46837var $Object = __webpack_require__(79612); 46838 46839var $Error = __webpack_require__(69383); 46840var $EvalError = __webpack_require__(41237); 46841var $RangeError = __webpack_require__(79290); 46842var $ReferenceError = __webpack_require__(79538); 46843var $SyntaxError = __webpack_require__(58068); 46844var $TypeError = __webpack_require__(69675); 46845var $URIError = __webpack_require__(35345); 46846 46847var abs = __webpack_require__(71514); 46848var floor = __webpack_require__(58968); 46849var max = __webpack_require__(6188); 46850var min = __webpack_require__(68002); 46851var pow = __webpack_require__(75880); 46852var round = __webpack_require__(70414); 46853var sign = __webpack_require__(73093); 46854 46855var $Function = Function; 46856 46857// eslint-disable-next-line consistent-return 46858var getEvalledConstructor = function (expressionSyntax) { 46859 try { 46860 return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 46861 } catch (e) {} 46862}; 46863 46864var $gOPD = __webpack_require__(75795); 46865var $defineProperty = __webpack_require__(30655); 46866 46867var throwTypeError = function () { 46868 throw new $TypeError(); 46869}; 46870var ThrowTypeError = $gOPD 46871 ? (function () { 46872 try { 46873 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 46874 arguments.callee; // IE 8 does not throw here 46875 return throwTypeError; 46876 } catch (calleeThrows) { 46877 try { 46878 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 46879 return $gOPD(arguments, 'callee').get; 46880 } catch (gOPDthrows) { 46881 return throwTypeError; 46882 } 46883 } 46884 }()) 46885 : throwTypeError; 46886 46887var hasSymbols = __webpack_require__(64039)(); 46888 46889var getProto = __webpack_require__(93628); 46890var $ObjectGPO = __webpack_require__(71064); 46891var $ReflectGPO = __webpack_require__(48648); 46892 46893var $apply = __webpack_require__(11002); 46894var $call = __webpack_require__(10076); 46895 46896var needsEval = {}; 46897 46898var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); 46899 46900var INTRINSICS = { 46901 __proto__: null, 46902 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 46903 '%Array%': Array, 46904 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 46905 '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, 46906 '%AsyncFromSyncIteratorPrototype%': undefined, 46907 '%AsyncFunction%': needsEval, 46908 '%AsyncGenerator%': needsEval, 46909 '%AsyncGeneratorFunction%': needsEval, 46910 '%AsyncIteratorPrototype%': needsEval, 46911 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 46912 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 46913 '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, 46914 '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, 46915 '%Boolean%': Boolean, 46916 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 46917 '%Date%': Date, 46918 '%decodeURI%': decodeURI, 46919 '%decodeURIComponent%': decodeURIComponent, 46920 '%encodeURI%': encodeURI, 46921 '%encodeURIComponent%': encodeURIComponent, 46922 '%Error%': $Error, 46923 '%eval%': eval, // eslint-disable-line no-eval 46924 '%EvalError%': $EvalError, 46925 '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, 46926 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 46927 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 46928 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 46929 '%Function%': $Function, 46930 '%GeneratorFunction%': needsEval, 46931 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 46932 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 46933 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 46934 '%isFinite%': isFinite, 46935 '%isNaN%': isNaN, 46936 '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, 46937 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 46938 '%Map%': typeof Map === 'undefined' ? undefined : Map, 46939 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), 46940 '%Math%': Math, 46941 '%Number%': Number, 46942 '%Object%': $Object, 46943 '%Object.getOwnPropertyDescriptor%': $gOPD, 46944 '%parseFloat%': parseFloat, 46945 '%parseInt%': parseInt, 46946 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 46947 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 46948 '%RangeError%': $RangeError, 46949 '%ReferenceError%': $ReferenceError, 46950 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 46951 '%RegExp%': RegExp, 46952 '%Set%': typeof Set === 'undefined' ? undefined : Set, 46953 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), 46954 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 46955 '%String%': String, 46956 '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, 46957 '%Symbol%': hasSymbols ? Symbol : undefined, 46958 '%SyntaxError%': $SyntaxError, 46959 '%ThrowTypeError%': ThrowTypeError, 46960 '%TypedArray%': TypedArray, 46961 '%TypeError%': $TypeError, 46962 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 46963 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 46964 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 46965 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 46966 '%URIError%': $URIError, 46967 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 46968 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 46969 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, 46970 46971 '%Function.prototype.call%': $call, 46972 '%Function.prototype.apply%': $apply, 46973 '%Object.defineProperty%': $defineProperty, 46974 '%Object.getPrototypeOf%': $ObjectGPO, 46975 '%Math.abs%': abs, 46976 '%Math.floor%': floor, 46977 '%Math.max%': max, 46978 '%Math.min%': min, 46979 '%Math.pow%': pow, 46980 '%Math.round%': round, 46981 '%Math.sign%': sign, 46982 '%Reflect.getPrototypeOf%': $ReflectGPO 46983}; 46984 46985if (getProto) { 46986 try { 46987 null.error; // eslint-disable-line no-unused-expressions 46988 } catch (e) { 46989 // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 46990 var errorProto = getProto(getProto(e)); 46991 INTRINSICS['%Error.prototype%'] = errorProto; 46992 } 46993} 46994 46995var doEval = function doEval(name) { 46996 var value; 46997 if (name === '%AsyncFunction%') { 46998 value = getEvalledConstructor('async function () {}'); 46999 } else if (name === '%GeneratorFunction%') { 47000 value = getEvalledConstructor('function* () {}'); 47001 } else if (name === '%AsyncGeneratorFunction%') { 47002 value = getEvalledConstructor('async function* () {}'); 47003 } else if (name === '%AsyncGenerator%') { 47004 var fn = doEval('%AsyncGeneratorFunction%'); 47005 if (fn) { 47006 value = fn.prototype; 47007 } 47008 } else if (name === '%AsyncIteratorPrototype%') { 47009 var gen = doEval('%AsyncGenerator%'); 47010 if (gen && getProto) { 47011 value = getProto(gen.prototype); 47012 } 47013 } 47014 47015 INTRINSICS[name] = value; 47016 47017 return value; 47018}; 47019 47020var LEGACY_ALIASES = { 47021 __proto__: null, 47022 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 47023 '%ArrayPrototype%': ['Array', 'prototype'], 47024 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 47025 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 47026 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 47027 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 47028 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 47029 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 47030 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 47031 '%BooleanPrototype%': ['Boolean', 'prototype'], 47032 '%DataViewPrototype%': ['DataView', 'prototype'], 47033 '%DatePrototype%': ['Date', 'prototype'], 47034 '%ErrorPrototype%': ['Error', 'prototype'], 47035 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 47036 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 47037 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 47038 '%FunctionPrototype%': ['Function', 'prototype'], 47039 '%Generator%': ['GeneratorFunction', 'prototype'], 47040 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 47041 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 47042 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 47043 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 47044 '%JSONParse%': ['JSON', 'parse'], 47045 '%JSONStringify%': ['JSON', 'stringify'], 47046 '%MapPrototype%': ['Map', 'prototype'], 47047 '%NumberPrototype%': ['Number', 'prototype'], 47048 '%ObjectPrototype%': ['Object', 'prototype'], 47049 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 47050 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 47051 '%PromisePrototype%': ['Promise', 'prototype'], 47052 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 47053 '%Promise_all%': ['Promise', 'all'], 47054 '%Promise_reject%': ['Promise', 'reject'], 47055 '%Promise_resolve%': ['Promise', 'resolve'], 47056 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 47057 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 47058 '%RegExpPrototype%': ['RegExp', 'prototype'], 47059 '%SetPrototype%': ['Set', 'prototype'], 47060 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 47061 '%StringPrototype%': ['String', 'prototype'], 47062 '%SymbolPrototype%': ['Symbol', 'prototype'], 47063 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 47064 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 47065 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 47066 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 47067 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 47068 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 47069 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 47070 '%URIErrorPrototype%': ['URIError', 'prototype'], 47071 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 47072 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 47073}; 47074 47075var bind = __webpack_require__(66743); 47076var hasOwn = __webpack_require__(9957); 47077var $concat = bind.call($call, Array.prototype.concat); 47078var $spliceApply = bind.call($apply, Array.prototype.splice); 47079var $replace = bind.call($call, String.prototype.replace); 47080var $strSlice = bind.call($call, String.prototype.slice); 47081var $exec = bind.call($call, RegExp.prototype.exec); 47082 47083/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 47084var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 47085var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 47086var stringToPath = function stringToPath(string) { 47087 var first = $strSlice(string, 0, 1); 47088 var last = $strSlice(string, -1); 47089 if (first === '%' && last !== '%') { 47090 throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); 47091 } else if (last === '%' && first !== '%') { 47092 throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); 47093 } 47094 var result = []; 47095 $replace(string, rePropName, function (match, number, quote, subString) { 47096 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 47097 }); 47098 return result; 47099}; 47100/* end adaptation */ 47101 47102var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 47103 var intrinsicName = name; 47104 var alias; 47105 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 47106 alias = LEGACY_ALIASES[intrinsicName]; 47107 intrinsicName = '%' + alias[0] + '%'; 47108 } 47109 47110 if (hasOwn(INTRINSICS, intrinsicName)) { 47111 var value = INTRINSICS[intrinsicName]; 47112 if (value === needsEval) { 47113 value = doEval(intrinsicName); 47114 } 47115 if (typeof value === 'undefined' && !allowMissing) { 47116 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 47117 } 47118 47119 return { 47120 alias: alias, 47121 name: intrinsicName, 47122 value: value 47123 }; 47124 } 47125 47126 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 47127}; 47128 47129module.exports = function GetIntrinsic(name, allowMissing) { 47130 if (typeof name !== 'string' || name.length === 0) { 47131 throw new $TypeError('intrinsic name must be a non-empty string'); 47132 } 47133 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 47134 throw new $TypeError('"allowMissing" argument must be a boolean'); 47135 } 47136 47137 if ($exec(/^%?[^%]*%?$/, name) === null) { 47138 throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); 47139 } 47140 var parts = stringToPath(name); 47141 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 47142 47143 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 47144 var intrinsicRealName = intrinsic.name; 47145 var value = intrinsic.value; 47146 var skipFurtherCaching = false; 47147 47148 var alias = intrinsic.alias; 47149 if (alias) { 47150 intrinsicBaseName = alias[0]; 47151 $spliceApply(parts, $concat([0, 1], alias)); 47152 } 47153 47154 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 47155 var part = parts[i]; 47156 var first = $strSlice(part, 0, 1); 47157 var last = $strSlice(part, -1); 47158 if ( 47159 ( 47160 (first === '"' || first === "'" || first === '`') 47161 || (last === '"' || last === "'" || last === '`') 47162 ) 47163 && first !== last 47164 ) { 47165 throw new $SyntaxError('property names with quotes must have matching quotes'); 47166 } 47167 if (part === 'constructor' || !isOwn) { 47168 skipFurtherCaching = true; 47169 } 47170 47171 intrinsicBaseName += '.' + part; 47172 intrinsicRealName = '%' + intrinsicBaseName + '%'; 47173 47174 if (hasOwn(INTRINSICS, intrinsicRealName)) { 47175 value = INTRINSICS[intrinsicRealName]; 47176 } else if (value != null) { 47177 if (!(part in value)) { 47178 if (!allowMissing) { 47179 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 47180 } 47181 return void undefined; 47182 } 47183 if ($gOPD && (i + 1) >= parts.length) { 47184 var desc = $gOPD(value, part); 47185 isOwn = !!desc; 47186 47187 // By convention, when a data property is converted to an accessor 47188 // property to emulate a data property that does not suffer from 47189 // the override mistake, that accessor's getter is marked with 47190 // an `originalValue` property. Here, when we detect this, we 47191 // uphold the illusion by pretending to see that original data 47192 // property, i.e., returning the value rather than the getter 47193 // itself. 47194 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 47195 value = desc.get; 47196 } else { 47197 value = value[part]; 47198 } 47199 } else { 47200 isOwn = hasOwn(value, part); 47201 value = value[part]; 47202 } 47203 47204 if (isOwn && !skipFurtherCaching) { 47205 INTRINSICS[intrinsicRealName] = value; 47206 } 47207 } 47208 } 47209 return value; 47210}; 47211 47212 47213/***/ }, 47214 47215/***/ 71064 47216(module, __unused_webpack_exports, __webpack_require__) { 47217 47218"use strict"; 47219 47220 47221var $Object = __webpack_require__(79612); 47222 47223/** @type {import('./Object.getPrototypeOf')} */ 47224module.exports = $Object.getPrototypeOf || null; 47225 47226 47227/***/ }, 47228 47229/***/ 48648 47230(module) { 47231 47232"use strict"; 47233 47234 47235/** @type {import('./Reflect.getPrototypeOf')} */ 47236module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; 47237 47238 47239/***/ }, 47240 47241/***/ 93628 47242(module, __unused_webpack_exports, __webpack_require__) { 47243 47244"use strict"; 47245 47246 47247var reflectGetProto = __webpack_require__(48648); 47248var originalGetProto = __webpack_require__(71064); 47249 47250var getDunderProto = __webpack_require__(7176); 47251 47252/** @type {import('.')} */ 47253module.exports = reflectGetProto 47254 ? function getProto(O) { 47255 // @ts-expect-error TS can't narrow inside a closure, for some reason 47256 return reflectGetProto(O); 47257 } 47258 : originalGetProto 47259 ? function getProto(O) { 47260 if (!O || (typeof O !== 'object' && typeof O !== 'function')) { 47261 throw new TypeError('getProto: not an object'); 47262 } 47263 // @ts-expect-error TS can't narrow inside a closure, for some reason 47264 return originalGetProto(O); 47265 } 47266 : getDunderProto 47267 ? function getProto(O) { 47268 // @ts-expect-error TS can't narrow inside a closure, for some reason 47269 return getDunderProto(O); 47270 } 47271 : null; 47272 47273 47274/***/ }, 47275 47276/***/ 6549 47277(module) { 47278 47279"use strict"; 47280 47281 47282/** @type {import('./gOPD')} */ 47283module.exports = Object.getOwnPropertyDescriptor; 47284 47285 47286/***/ }, 47287 47288/***/ 75795 47289(module, __unused_webpack_exports, __webpack_require__) { 47290 47291"use strict"; 47292 47293 47294/** @type {import('.')} */ 47295var $gOPD = __webpack_require__(6549); 47296 47297if ($gOPD) { 47298 try { 47299 $gOPD([], 'length'); 47300 } catch (e) { 47301 // IE 8 has a broken gOPD 47302 $gOPD = null; 47303 } 47304} 47305 47306module.exports = $gOPD; 47307 47308 47309/***/ }, 47310 47311/***/ 29790 47312(module) { 47313 47314"use strict"; 47315 47316 47317var $BigInt = typeof BigInt !== 'undefined' && BigInt; 47318 47319module.exports = function hasNativeBigInts() { 47320 return typeof $BigInt === 'function' 47321 && typeof BigInt === 'function' 47322 && typeof $BigInt(42) === 'bigint' // eslint-disable-line no-magic-numbers 47323 && typeof BigInt(42) === 'bigint'; // eslint-disable-line no-magic-numbers 47324}; 47325 47326 47327/***/ }, 47328 47329/***/ 30592 47330(module, __unused_webpack_exports, __webpack_require__) { 47331 47332"use strict"; 47333 47334 47335var $defineProperty = __webpack_require__(30655); 47336 47337var hasPropertyDescriptors = function hasPropertyDescriptors() { 47338 return !!$defineProperty; 47339}; 47340 47341hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { 47342 // node v0.6 has a bug where array lengths can be Set but not Defined 47343 if (!$defineProperty) { 47344 return null; 47345 } 47346 try { 47347 return $defineProperty([], 'length', { value: 1 }).length !== 1; 47348 } catch (e) { 47349 // In Firefox 4-22, defining length on an array throws an exception. 47350 return true; 47351 } 47352}; 47353 47354module.exports = hasPropertyDescriptors; 47355 47356 47357/***/ }, 47358 47359/***/ 64039 47360(module, __unused_webpack_exports, __webpack_require__) { 47361 47362"use strict"; 47363 47364 47365var origSymbol = typeof Symbol !== 'undefined' && Symbol; 47366var hasSymbolSham = __webpack_require__(41333); 47367 47368/** @type {import('.')} */ 47369module.exports = function hasNativeSymbols() { 47370 if (typeof origSymbol !== 'function') { return false; } 47371 if (typeof Symbol !== 'function') { return false; } 47372 if (typeof origSymbol('foo') !== 'symbol') { return false; } 47373 if (typeof Symbol('bar') !== 'symbol') { return false; } 47374 47375 return hasSymbolSham(); 47376}; 47377 47378 47379/***/ }, 47380 47381/***/ 41333 47382(module) { 47383 47384"use strict"; 47385 47386 47387/** @type {import('./shams')} */ 47388/* eslint complexity: [2, 18], max-statements: [2, 33] */ 47389module.exports = function hasSymbols() { 47390 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 47391 if (typeof Symbol.iterator === 'symbol') { return true; } 47392 47393 /** @type {{ [k in symbol]?: unknown }} */ 47394 var obj = {}; 47395 var sym = Symbol('test'); 47396 var symObj = Object(sym); 47397 if (typeof sym === 'string') { return false; } 47398 47399 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 47400 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 47401 47402 // temp disabled per https://github.com/ljharb/object.assign/issues/17 47403 // if (sym instanceof Symbol) { return false; } 47404 // temp disabled per https://github.com/WebReflection/get-own-property-symbol
47404s/issues/4 47405 // if (!(symObj instanceof Symbol)) { return false; } 47406 47407 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 47408 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 47409 47410 var symVal = 42; 47411 obj[sym] = symVal; 47412 for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop 47413 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 47414 47415 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 47416 47417 var syms = Object.getOwnPropertySymbols(obj); 47418 if (syms.length !== 1 || syms[0] !== sym) { return false; } 47419 47420 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 47421 47422 if (typeof Object.getOwnPropertyDescriptor === 'function') { 47423 // eslint-disable-next-line no-extra-parens 47424 var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); 47425 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 47426 } 47427 47428 return true; 47429}; 47430 47431 47432/***/ }, 47433 47434/***/ 49092 47435(module, __unused_webpack_exports, __webpack_require__) { 47436 47437"use strict"; 47438 47439 47440var hasSymbols = __webpack_require__(41333); 47441 47442/** @type {import('.')} */ 47443module.exports = function hasToStringTagShams() { 47444 return hasSymbols() && !!Symbol.toStringTag; 47445}; 47446 47447 47448/***/ }, 47449 47450/***/ 9957 47451(module, __unused_webpack_exports, __webpack_require__) { 47452 47453"use strict"; 47454 47455 47456var call = Function.prototype.call; 47457var $hasOwn = Object.prototype.hasOwnProperty; 47458var bind = __webpack_require__(66743); 47459 47460/** @type {import('.')} */ 47461module.exports = bind.call(call, $hasOwn); 47462 47463 47464/***/ }, 47465 47466/***/ 4146 47467(module, __unused_webpack_exports, __webpack_require__) { 47468 47469"use strict"; 47470 47471 47472var reactIs = __webpack_require__(44363); 47473 47474/** 47475 * Copyright 2015, Yahoo! Inc. 47476 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. 47477 */ 47478var REACT_STATICS = { 47479 childContextTypes: true, 47480 contextType: true, 47481 contextTypes: true, 47482 defaultProps: true, 47483 displayName: true, 47484 getDefaultProps: true, 47485 getDerivedStateFromError: true, 47486 getDerivedStateFromProps: true, 47487 mixins: true, 47488 propTypes: true, 47489 type: true 47490}; 47491var KNOWN_STATICS = { 47492 name: true, 47493 length: true, 47494 prototype: true, 47495 caller: true, 47496 callee: true, 47497 arguments: true, 47498 arity: true 47499}; 47500var FORWARD_REF_STATICS = { 47501 '$$typeof': true, 47502 render: true, 47503 defaultProps: true, 47504 displayName: true, 47505 propTypes: true 47506}; 47507var MEMO_STATICS = { 47508 '$$typeof': true, 47509 compare: true, 47510 defaultProps: true, 47511 displayName: true, 47512 propTypes: true, 47513 type: true 47514}; 47515var TYPE_STATICS = {}; 47516TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; 47517TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; 47518 47519function getStatics(component) { 47520 // React v16.11 and below 47521 if (reactIs.isMemo(component)) { 47522 return MEMO_STATICS; 47523 } // React v16.12 and above 47524 47525 47526 return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; 47527} 47528 47529var defineProperty = Object.defineProperty; 47530var getOwnPropertyNames = Object.getOwnPropertyNames; 47531var getOwnPropertySymbols = Object.getOwnPropertySymbols; 47532var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 47533var getPrototypeOf = Object.getPrototypeOf; 47534var objectPrototype = Object.prototype; 47535function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { 47536 if (typeof sourceComponent !== 'string') { 47537 // don't hoist over string (html) components 47538 if (objectPrototype) { 47539 var inheritedComponent = getPrototypeOf(sourceComponent); 47540 47541 if (inheritedComponent && inheritedComponent !== objectPrototype) { 47542 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); 47543 } 47544 } 47545 47546 var keys = getOwnPropertyNames(sourceComponent); 47547 47548 if (getOwnPropertySymbols) { 47549 keys = keys.concat(getOwnPropertySymbols(sourceComponent)); 47550 } 47551 47552 var targetStatics = getStatics(targetComponent); 47553 var sourceStatics = getStatics(sourceComponent); 47554 47555 for (var i = 0; i < keys.length; ++i) { 47556 var key = keys[i]; 47557 47558 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { 47559 var descriptor = getOwnPropertyDescriptor(sourceComponent, key); 47560 47561 try { 47562 // Avoid failures from read-only properties 47563 defineProperty(targetComponent, key, descriptor); 47564 } catch (e) {} 47565 } 47566 } 47567 } 47568 47569 return targetComponent; 47570} 47571 47572module.exports = hoistNonReactStatics; 47573 47574
47575/***/ }, 47576 47577/***/ 73575 47578(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 47579 47580"use strict"; 47581/* harmony export */ __webpack_require__.d(__webpack_exports__, { 47582/* harmony export */ Qx: () => (/* binding */ isDraft), 47583/* harmony export */ a6: () => (/* binding */ isDraftable), 47584/* harmony export */ jM: () => (/* binding */ produce), 47585/* harmony export */ ss: () => (/* binding */ current) 47586/* harmony export */ }); 47587/* unused harmony exports Immer, applyPatches, castDraft, castImmutable, createDraft, enableArrayMethods, enableMapSet, enablePatches, finishDraft, freeze, immerable, nothing, original, produceWithPatches, setAutoFreeze, setUseStrictIteration, setUseStrictShallowCopy */
47588// src/utils/env.ts 47589var NOTHING = Symbol.for("immer-nothing"); 47590var DRAFTABLE = Symbol.for("immer-draftable"); 47591var DRAFT_STATE = Symbol.for("immer-state"); 47592
47593// src/utils/errors.ts 47594var errors = false ? 0 : []; 47595function die(error, ...args) { 47596 if (false) // removed by dead control flow 47597{} 47598 throw new Error( 47599 `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf` 47600 ); 47601} 47602
vendor: 5,140 bytes, lines 47603-47771
47603// src/utils/common.ts 47604var O = Object; 47605var getPrototypeOf = O.getPrototypeOf; 47606var CONSTRUCTOR = "constructor"; 47607var PROTOTYPE = "prototype"; 47608var CONFIGURABLE = "configurable"; 47609var ENUMERABLE = "enumerable"; 47610var WRITABLE = "writable"; 47611var VALUE = "value"; 47612var isDraft = (value) => !!value && !!value[DRAFT_STATE]; 47613function isDraftable(value) { 47614 if (!value) 47615 return false; 47616 return isPlainObject(value) || isArray(value) || !!value[DRAFTABLE] || !!value[CONSTRUCTOR]?.[DRAFTABLE] || isMap(value) || isSet(value); 47617} 47618var objectCtorString = O[PROTOTYPE][CONSTRUCTOR].toString(); 47619var cachedCtorStrings = /* @__PURE__ */ new WeakMap(); 47620function isPlainObject(value) { 47621 if (!value || !isObjectish(value)) 47622 return false; 47623 const proto = getPrototypeOf(value); 47624 if (proto === null || proto === O[PROTOTYPE]) 47625 return true; 47626 const Ctor = O.hasOwnProperty.call(proto, CONSTRUCTOR) && proto[CONSTRUCTOR]; 47627 if (Ctor === Object) 47628 return true; 47629 if (!isFunction(Ctor)) 47630 return false; 47631 let ctorString = cachedCtorStrings.get(Ctor); 47632 if (ctorString === void 0) { 47633 ctorString = Function.toString.call(Ctor); 47634 cachedCtorStrings.set(Ctor, ctorString); 47635 } 47636 return ctorString === objectCtorString; 47637} 47638function original(value) { 47639 if (!isDraft(value)) 47640 die(15, value); 47641 return value[DRAFT_STATE].base_; 47642} 47643function each(obj, iter, strict = true) { 47644 if (getArchtype(obj) === 0 /* Object */) { 47645 const keys = strict ? Reflect.ownKeys(obj) : O.keys(obj); 47646 keys.forEach((key) => { 47647 iter(key, obj[key], obj); 47648 }); 47649 } else { 47650 obj.forEach((entry, index) => iter(index, entry, obj)); 47651 } 47652} 47653function getArchtype(thing) { 47654 const state = thing[DRAFT_STATE]; 47655 return state ? state.type_ : isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */; 47656} 47657var has = (thing, prop, type = getArchtype(thing)) => type === 2 /* Map */ ? thing.has(prop) : O[PROTOTYPE].hasOwnProperty.call(thing, prop); 47658var get = (thing, prop, type = getArchtype(thing)) => ( 47659 // @ts-ignore 47660 type === 2 /* Map */ ? thing.get(prop) : thing[prop] 47661); 47662var set = (thing, propOrOldValue, value, type = getArchtype(thing)) => { 47663 if (type === 2 /* Map */) 47664 thing.set(propOrOldValue, value); 47665 else if (type === 3 /* Set */) { 47666 thing.add(value); 47667 } else 47668 thing[propOrOldValue] = value; 47669}; 47670function is(x, y) { 47671 if (x === y) { 47672 return x !== 0 || 1 / x === 1 / y; 47673 } else { 47674 return x !== x && y !== y; 47675 } 47676} 47677var isArray = Array.isArray; 47678var isMap = (target) => target instanceof Map; 47679var isSet = (target) => target instanceof Set; 47680var isObjectish = (target) => typeof target === "object"; 47681var isFunction = (target) => typeof target === "function"; 47682var isBoolean = (target) => typeof target === "boolean"; 47683function isArrayIndex(value) { 47684 const n = +value; 47685 return Number.isInteger(n) && String(n) === value; 47686} 47687var getProxyDraft = (value) => { 47688 if (!isObjectish(value)) 47689 return null; 47690 return value?.[DRAFT_STATE]; 47691}; 47692var latest = (state) => state.copy_ || state.base_; 47693var getValue = (value) => { 47694 const proxyDraft = getProxyDraft(value); 47695 return proxyDraft ? proxyDraft.copy_ ?? proxyDraft.base_ : value; 47696}; 47697var getFinalValue = (state) => state.modified_ ? state.copy_ : state.base_; 47698function shallowCopy(base, strict) { 47699 if (isMap(base)) { 47700 return new Map(base); 47701 } 47702 if (isSet(base)) { 47703 return new Set(base); 47704 } 47705 if (isArray(base)) 47706 return Array[PROTOTYPE].slice.call(base); 47707 const isPlain = isPlainObject(base); 47708 if (strict === true || strict === "class_only" && !isPlain) { 47709 const descriptors = O.getOwnPropertyDescriptors(base); 47710 delete descriptors[DRAFT_STATE]; 47711 let keys = Reflect.ownKeys(descriptors); 47712 for (let i = 0; i < keys.length; i++) { 47713 const key = keys[i]; 47714 const desc = descriptors[key]; 47715 if (desc[WRITABLE] === false) { 47716 desc[WRITABLE] = true; 47717 desc[CONFIGURABLE] = true; 47718 } 47719 if (desc.get || desc.set) 47720 descriptors[key] = { 47721 [CONFIGURABLE]: true, 47722 [WRITABLE]: true, 47723 // could live with !!desc.set as well here... 47724 [ENUMERABLE]: desc[ENUMERABLE], 47725 [VALUE]: base[key] 47726 }; 47727 } 47728 return O.create(getPrototypeOf(base), descriptors); 47729 } else { 47730 const proto = getPrototypeOf(base); 47731 if (proto !== null && isPlain) { 47732 return { ...base }; 47733 } 47734 const obj = O.create(proto); 47735 return O.assign(obj, base); 47736 } 47737} 47738function freeze(obj, deep = false) { 47739 if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) 47740 return obj; 47741 if (getArchtype(obj) > 1) { 47742 O.defineProperties(obj, { 47743 set: dontMutateMethodOverride, 47744 add: dontMutateMethodOverride, 47745 clear: dontMutateMethodOverride, 47746 delete: dontMutateMethodOverride 47747 }); 47748 } 47749 O.freeze(obj); 47750 if (deep) 47751 each( 47752 obj, 47753 (_key, value) => { 47754 freeze(value, true); 47755 }, 47756 false 47757 ); 47758 return obj; 47759} 47760function dontMutateFrozenCollections() { 47761 die(2); 47762} 47763var dontMutateMethodOverride = { 47764 [VALUE]: dontMutateFrozenCollections 47765}; 47766function isFrozen(obj) { 47767 if (obj === null || !isObjectish(obj)) 47768 return true; 47769 return O.isFrozen(obj); 47770} 47771
47772// src/utils/plugins.ts 47773var PluginMapSet = "MapSet"; 47774var PluginPatches = "Patches"; 47775var PluginArrayMethods = "ArrayMethods"; 47776var plugins = {}; 47777function getPlugin(pluginKey) { 47778 const plugin = plugins[pluginKey]; 47779 if (!plugin) { 47780 die(0, pluginKey); 47781 } 47782 return plugin; 47783} 47784var isPluginLoaded = (pluginKey) => !!plugins[pluginKey]; 47785function loadPlugin(pluginKey, implementation) { 47786 if (!plugins[pluginKey]) 47787 plugins[pluginKey] = implementation; 47788}
vendor: 11,544 bytes, lines 47788-48159
47788 47789 47790// src/core/scope.ts 47791var currentScope; 47792var getCurrentScope = () => currentScope; 47793var createScope = (parent_, immer_) => ({ 47794 drafts_: [], 47795 parent_, 47796 immer_, 47797 // Whenever the modified draft contains a draft from another scope, we 47798 // need to prevent auto-freezing so the unowned draft can be finalized. 47799 canAutoFreeze_: true, 47800 unfinalizedDrafts_: 0, 47801 handledSet_: /* @__PURE__ */ new Set(), 47802 processedForPatches_: /* @__PURE__ */ new Set(), 47803 mapSetPlugin_: isPluginLoaded(PluginMapSet) ? getPlugin(PluginMapSet) : void 0, 47804 arrayMethodsPlugin_: isPluginLoaded(PluginArrayMethods) ? getPlugin(PluginArrayMethods) : void 0 47805}); 47806function usePatchesInScope(scope, patchListener) { 47807 if (patchListener) { 47808 scope.patchPlugin_ = getPlugin(PluginPatches); 47809 scope.patches_ = []; 47810 scope.inversePatches_ = []; 47811 scope.patchListener_ = patchListener; 47812 } 47813} 47814function revokeScope(scope) { 47815 leaveScope(scope); 47816 scope.drafts_.forEach(revokeDraft); 47817 scope.drafts_ = null; 47818} 47819function leaveScope(scope) { 47820 if (scope === currentScope) { 47821 currentScope = scope.parent_; 47822 } 47823} 47824var enterScope = (immer2) => currentScope = createScope(currentScope, immer2); 47825function revokeDraft(draft) { 47826 const state = draft[DRAFT_STATE]; 47827 if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */) 47828 state.revoke_(); 47829 else 47830 state.revoked_ = true; 47831} 47832 47833// src/core/finalize.ts 47834function processResult(result, scope) { 47835 scope.unfinalizedDrafts_ = scope.drafts_.length; 47836 const baseDraft = scope.drafts_[0]; 47837 const isReplaced = result !== void 0 && result !== baseDraft; 47838 if (isReplaced) { 47839 if (baseDraft[DRAFT_STATE].modified_) { 47840 revokeScope(scope); 47841 die(4); 47842 } 47843 if (isDraftable(result)) { 47844 result = finalize(scope, result); 47845 } 47846 const { patchPlugin_ } = scope; 47847 if (patchPlugin_) { 47848 patchPlugin_.generateReplacementPatches_( 47849 baseDraft[DRAFT_STATE].base_, 47850 result, 47851 scope 47852 ); 47853 } 47854 } else { 47855 result = finalize(scope, baseDraft); 47856 } 47857 maybeFreeze(scope, result, true); 47858 revokeScope(scope); 47859 if (scope.patches_) { 47860 scope.patchListener_(scope.patches_, scope.inversePatches_); 47861 } 47862 return result !== NOTHING ? result : void 0; 47863} 47864function finalize(rootScope, value) { 47865 if (isFrozen(value)) 47866 return value; 47867 const state = value[DRAFT_STATE]; 47868 if (!state) { 47869 const finalValue = handleValue(value, rootScope.handledSet_, rootScope); 47870 return finalValue; 47871 } 47872 if (!isSameScope(state, rootScope)) { 47873 return value; 47874 } 47875 if (!state.modified_) { 47876 return state.base_; 47877 } 47878 if (!state.finalized_) { 47879 const { callbacks_ } = state; 47880 if (callbacks_) { 47881 while (callbacks_.length > 0) { 47882 const callback = callbacks_.pop(); 47883 callback(rootScope); 47884 } 47885 } 47886 generatePatchesAndFinalize(state, rootScope); 47887 } 47888 return state.copy_; 47889} 47890function maybeFreeze(scope, value, deep = false) { 47891 if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) { 47892 freeze(value, deep); 47893 } 47894} 47895function markStateFinalized(state) { 47896 state.finalized_ = true; 47897 state.scope_.unfinalizedDrafts_--; 47898} 47899var isSameScope = (state, rootScope) => state.scope_ === rootScope; 47900var EMPTY_LOCATIONS_RESULT = []; 47901function updateDraftInParent(parent, draftValue, finalizedValue, originalKey) { 47902 const parentCopy = latest(parent); 47903 const parentType = parent.type_; 47904 if (originalKey !== void 0) { 47905 const currentValue = get(parentCopy, originalKey, parentType); 47906 if (currentValue === draftValue) { 47907 set(parentCopy, originalKey, finalizedValue, parentType); 47908 return; 47909 } 47910 } 47911 if (!parent.draftLocations_) { 47912 const draftLocations = parent.draftLocations_ = /* @__PURE__ */ new Map(); 47913 each(parentCopy, (key, value) => { 47914 if (isDraft(value)) { 47915 const keys = draftLocations.get(value) || []; 47916 keys.push(key); 47917 draftLocations.set(value, keys); 47918 } 47919 }); 47920 } 47921 const locations = parent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT; 47922 for (const location of locations) { 47923 set(parentCopy, location, finalizedValue, parentType); 47924 } 47925} 47926function registerChildFinalizationCallback(parent, child, key) { 47927 parent.callbacks_.push(function childCleanup(rootScope) { 47928 const state = child; 47929 if (!state || !isSameScope(state, rootScope)) { 47930 return; 47931 } 47932 rootScope.mapSetPlugin_?.fixSetContents(state); 47933 const finalizedValue = getFinalValue(state); 47934 updateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key); 47935 generatePatchesAndFinalize(state, rootScope); 47936 }); 47937} 47938function generatePatchesAndFinalize(state, rootScope) { 47939 const shouldFinalize = state.modified_ && !state.finalized_ && (state.type_ === 3 /* Set */ || state.type_ === 1 /* Array */ && state.allIndicesReassigned_ || (state.assigned_?.size ?? 0) > 0); 47940 if (shouldFinalize) { 47941 const { patchPlugin_ } = rootScope; 47942 if (patchPlugin_) { 47943 const basePath = patchPlugin_.getPath(state); 47944 if (basePath) { 47945 patchPlugin_.generatePatches_(state, basePath, rootScope); 47946 } 47947 } 47948 markStateFinalized(state); 47949 } 47950} 47951function handleCrossReference(target, key, value) { 47952 const { scope_ } = target; 47953 if (isDraft(value)) { 47954 const state = value[DRAFT_STATE]; 47955 if (isSameScope(state, scope_)) { 47956 state.callbacks_.push(function crossReferenceCleanup() { 47957 prepareCopy(target); 47958 const finalizedValue = getFinalValue(state); 47959 updateDraftInParent(target, value, finalizedValue, key); 47960 }); 47961 } 47962 } else if (isDraftable(value)) { 47963 target.callbacks_.push(function nestedDraftCleanup() { 47964 const targetCopy = latest(target); 47965 if (target.type_ === 3 /* Set */) { 47966 if (targetCopy.has(value)) { 47967 handleValue(value, scope_.handledSet_, scope_); 47968 } 47969 } else { 47970 if (get(targetCopy, key, target.type_) === value) { 47971 if (scope_.drafts_.length > 1 && (target.assigned_.get(key) ?? false) === true && target.copy_) { 47972 handleValue( 47973 get(target.copy_, key, target.type_), 47974 scope_.handledSet_, 47975 scope_ 47976 ); 47977 } 47978 } 47979 } 47980 }); 47981 } 47982} 47983function handleValue(target, handledSet, rootScope) { 47984 if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) { 47985 return target; 47986 } 47987 if (isDraft(target) || handledSet.has(target) || !isDraftable(target) || isFrozen(target)) { 47988 return target; 47989 } 47990 handledSet.add(target); 47991 each(target, (key, value) => { 47992 if (isDraft(value)) { 47993 const state = value[DRAFT_STATE]; 47994 if (isSameScope(state, rootScope)) { 47995 const updatedValue = getFinalValue(state); 47996 set(target, key, updatedValue, target.type_); 47997 markStateFinalized(state); 47998 } 47999 } else if (isDraftable(value)) { 48000 handleValue(value, handledSet, rootScope); 48001 } 48002 }); 48003 return target; 48004} 48005 48006// src/core/proxy.ts 48007function createProxyProxy(base, parent) { 48008 const baseIsArray = isArray(base); 48009 const state = { 48010 type_: baseIsArray ? 1 /* Array */ : 0 /* Object */, 48011 // Track which produce call this is associated with. 48012 scope_: parent ? parent.scope_ : getCurrentScope(), 48013 // True for both shallow and deep changes. 48014 modified_: false, 48015 // Used during finalization. 48016 finalized_: false, 48017 // Track which properties have been assigned (true) or deleted (false). 48018 // actually instantiated in `prepareCopy()` 48019 assigned_: void 0, 48020 // The parent draft state. 48021 parent_: parent, 48022 // The base state. 48023 base_: base, 48024 // The base proxy. 48025 draft_: null, 48026 // set below 48027 // The base copy with any updated values. 48028 copy_: null, 48029 // Called by the `produce` function. 48030 revoke_: null, 48031 isManual_: false, 48032 // `callbacks` actually gets assigned in `createProxy` 48033 callbacks_: void 0 48034 }; 48035 let target = state; 48036 let traps = objectTraps; 48037 if (baseIsArray) { 48038 target = [state]; 48039 traps = arrayTraps; 48040 } 48041 const { revoke, proxy } = Proxy.revocable(target, traps); 48042 state.draft_ = proxy; 48043 state.revoke_ = revoke; 48044 return [proxy, state]; 48045} 48046var objectTraps = { 48047 get(state, prop) { 48048 if (prop === DRAFT_STATE) 48049 return state; 48050 let arrayPlugin = state.scope_.arrayMethodsPlugin_; 48051 const isArrayWithStringProp = state.type_ === 1 /* Array */ && typeof prop === "string"; 48052 if (isArrayWithStringProp) { 48053 if (arrayPlugin?.isArrayOperationMethod(prop)) { 48054 return arrayPlugin.createMethodInterceptor(state, prop); 48055 } 48056 } 48057 const source = latest(state); 48058 if (!has(source, prop, state.type_)) { 48059 return readPropFromProto(state, source, prop); 48060 } 48061 const value = source[prop]; 48062 if (state.finalized_ || !isDraftable(value)) { 48063 return value; 48064 } 48065 if (isArrayWithStringProp && state.operationMethod && arrayPlugin?.isMutatingArrayMethod( 48066 state.operationMethod 48067 ) && isArrayIndex(prop)) { 48068 return value; 48069 } 48070 if (value === peek(state.base_, prop)) { 48071 prepareCopy(state); 48072 const childKey = state.type_ === 1 /* Array */ ? +prop : prop; 48073 const childDraft = createProxy(state.scope_, value, state, childKey); 48074 return state.copy_[childKey] = childDraft; 48075 } 48076 return value; 48077 }, 48078 has(state, prop) { 48079 return prop in latest(state); 48080 }, 48081 ownKeys(state) { 48082 return Reflect.ownKeys(latest(state)); 48083 }, 48084 set(state, prop, value) { 48085 const desc = getDescriptorFromProto(latest(state), prop); 48086 if (desc?.set) { 48087 desc.set.call(state.draft_, value); 48088 return true; 48089 } 48090 if (!state.modified_) { 48091 const current2 = peek(latest(state), prop); 48092 const currentState = current2?.[DRAFT_STATE]; 48093 if (currentState && currentState.base_ === value) { 48094 state.copy_[prop] = value; 48095 state.assigned_.set(prop, false); 48096 return true; 48097 } 48098 if (is(value, current2) && (value !== void 0 || has(state.base_, prop, state.type_))) 48099 return true; 48100 prepareCopy(state); 48101 markChanged(state); 48102 } 48103 if (state.copy_[prop] === value && // special case: handle new props with value 'undefined' 48104 (value !== void 0 || prop in state.copy_) || // special case: NaN 48105 Number.isNaN(value) && Number.isNaN(state.copy_[prop])) 48106 return true; 48107 state.copy_[prop] = value; 48108 state.assigned_.set(prop, true); 48109 handleCrossReference(state, prop, value); 48110 return true; 48111 }, 48112 deleteProperty(state, prop) { 48113 prepareCopy(state); 48114 if (peek(state.base_, prop) !== void 0 || prop in state.base_) { 48115 state.assigned_.set(prop, false); 48116 markChanged(state); 48117 } else { 48118 state.assigned_.delete(prop); 48119 } 48120 if (state.copy_) { 48121 delete state.copy_[prop]; 48122 } 48123 return true; 48124 }, 48125 // Note: We never coerce `desc.value` into an Immer draft, because we can't make 48126 // the same guarantee in ES5 mode. 48127 getOwnPropertyDescriptor(state, prop) { 48128 const owner = latest(state); 48129 const desc = Reflect.getOwnPropertyDescriptor(owner, prop); 48130 if (!desc) 48131 return desc; 48132 return { 48133 [WRITABLE]: true, 48134 [CONFIGURABLE]: state.type_ !== 1 /* Array */ || prop !== "length", 48135 [ENUMERABLE]: desc[ENUMERABLE], 48136 [VALUE]: owner[prop] 48137 }; 48138 }, 48139 defineProperty() { 48140 die(11); 48141 }, 48142 getPrototypeOf(state) { 48143 return getPrototypeOf(state.base_); 48144 }, 48145 setPrototypeOf() { 48146 die(12); 48147 } 48148}; 48149var arrayTraps = {}; 48150for (let key in objectTraps) { 48151 let fn = objectTraps[key]; 48152 arrayTraps[key] = function() { 48153 const args = arguments; 48154 args[0] = args[0][0]; 48155 return fn.apply(this, args); 48156 }; 48157} 48158arrayTraps.deleteProperty = function(state, prop) { 48159
48159if (false) 48160 // removed by dead control flow 48161{} 48162 return arrayTraps.set.call(this, state, prop, void 0); 48163}; 48164arrayTraps.set = function(state, prop, value) { 48165 if (false) 48166 // removed by dead control flow 48167{}
vendor: 4,385 bytes, lines 48167-48299
48167 48168 return objectTraps.set.call(this, state[0], prop, value, state[0]); 48169}; 48170function peek(draft, prop) { 48171 const state = draft[DRAFT_STATE]; 48172 const source = state ? latest(state) : draft; 48173 return source[prop]; 48174} 48175function readPropFromProto(state, source, prop) { 48176 const desc = getDescriptorFromProto(source, prop); 48177 return desc ? VALUE in desc ? desc[VALUE] : ( 48178 // This is a very special case, if the prop is a getter defined by the 48179 // prototype, we should invoke it with the draft as context! 48180 desc.get?.call(state.draft_) 48181 ) : void 0; 48182} 48183function getDescriptorFromProto(source, prop) { 48184 if (!(prop in source)) 48185 return void 0; 48186 let proto = getPrototypeOf(source); 48187 while (proto) { 48188 const desc = Object.getOwnPropertyDescriptor(proto, prop); 48189 if (desc) 48190 return desc; 48191 proto = getPrototypeOf(proto); 48192 } 48193 return void 0; 48194} 48195function markChanged(state) { 48196 if (!state.modified_) { 48197 state.modified_ = true; 48198 if (state.parent_) { 48199 markChanged(state.parent_); 48200 } 48201 } 48202} 48203function prepareCopy(state) { 48204 if (!state.copy_) { 48205 state.assigned_ = /* @__PURE__ */ new Map(); 48206 state.copy_ = shallowCopy( 48207 state.base_, 48208 state.scope_.immer_.useStrictShallowCopy_ 48209 ); 48210 } 48211} 48212 48213// src/core/immerClass.ts 48214var Immer2 = class { 48215 constructor(config) { 48216 this.autoFreeze_ = true; 48217 this.useStrictShallowCopy_ = false; 48218 this.useStrictIteration_ = false; 48219 /** 48220 * The `produce` function takes a value and a "recipe function" (whose 48221 * return value often depends on the base state). The recipe function is 48222 * free to mutate its first argument however it wants. All mutations are 48223 * only ever applied to a __copy__ of the base state. 48224 * 48225 * Pass only a function to create a "curried producer" which relieves you 48226 * from passing the recipe function every time. 48227 * 48228 * Only plain objects and arrays are made mutable. All other objects are 48229 * considered uncopyable. 48230 * 48231 * Note: This function is __bound__ to its `Immer` instance. 48232 * 48233 * @param {any} base - the initial state 48234 * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified 48235 * @param {Function} patchListener - optional function that will be called with all the patches produced here 48236 * @returns {any} a new state, or the initial state if nothing was modified 48237 */ 48238 this.produce = (base, recipe, patchListener) => { 48239 if (isFunction(base) && !isFunction(recipe)) { 48240 const defaultBase = recipe; 48241 recipe = base; 48242 const self = this; 48243 return function curriedProduce(base2 = defaultBase, ...args) { 48244 return self.produce(base2, (draft) => recipe.call(this, draft, ...args)); 48245 }; 48246 } 48247 if (!isFunction(recipe)) 48248 die(6); 48249 if (patchListener !== void 0 && !isFunction(patchListener)) 48250 die(7); 48251 let result; 48252 if (isDraftable(base)) { 48253 const scope = enterScope(this); 48254 const proxy = createProxy(scope, base, void 0); 48255 let hasError = true; 48256 try { 48257 result = recipe(proxy); 48258 hasError = false; 48259 } finally { 48260 if (hasError) 48261 revokeScope(scope); 48262 else 48263 leaveScope(scope); 48264 } 48265 usePatchesInScope(scope, patchListener); 48266 return processResult(result, scope); 48267 } else if (!base || !isObjectish(base)) { 48268 result = recipe(base); 48269 if (result === void 0) 48270 result = base; 48271 if (result === NOTHING) 48272 result = void 0; 48273 if (this.autoFreeze_) 48274 freeze(result, true); 48275 if (patchListener) { 48276 const p = []; 48277 const ip = []; 48278 getPlugin(PluginPatches).generateReplacementPatches_(base, result, { 48279 patches_: p, 48280 inversePatches_: ip 48281 }); 48282 patchListener(p, ip); 48283 } 48284 return result; 48285 } else 48286 die(1, base); 48287 }; 48288 this.produceWithPatches = (base, recipe) => { 48289 if (isFunction(base)) { 48290 return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args)); 48291 } 48292 let patches, inversePatches; 48293 const result = this.produce(base, recipe, (p, ip) => { 48294 patches = p; 48295 inversePatches = ip; 48296 }); 48297 return [result, patches, inversePatches]; 48298 }; 48299 if (isBoolean
48299(config?.autoFreeze)) 48300 this.setAutoFreeze(config.autoFreeze); 48301 if (isBoolean(config?.useStrictShallowCopy)) 48302 this.setUseStrictShallowCopy(config.useStrictShallowCopy); 48303 if (isBoolean
vendor: 3,572 bytes, lines 48303-48429
48303(config?.useStrictIteration)) 48304 this.setUseStrictIteration(config.useStrictIteration); 48305 } 48306 createDraft(base) { 48307 if (!isDraftable(base)) 48308 die(8); 48309 if (isDraft(base)) 48310 base = current(base); 48311 const scope = enterScope(this); 48312 const proxy = createProxy(scope, base, void 0); 48313 proxy[DRAFT_STATE].isManual_ = true; 48314 leaveScope(scope); 48315 return proxy; 48316 } 48317 finishDraft(draft, patchListener) { 48318 const state = draft && draft[DRAFT_STATE]; 48319 if (!state || !state.isManual_) 48320 die(9); 48321 const { scope_: scope } = state; 48322 usePatchesInScope(scope, patchListener); 48323 return processResult(void 0, scope); 48324 } 48325 /** 48326 * Pass true to automatically freeze all copies created by Immer. 48327 * 48328 * By default, auto-freezing is enabled. 48329 */ 48330 setAutoFreeze(value) { 48331 this.autoFreeze_ = value; 48332 } 48333 /** 48334 * Pass true to enable strict shallow copy. 48335 * 48336 * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties. 48337 */ 48338 setUseStrictShallowCopy(value) { 48339 this.useStrictShallowCopy_ = value; 48340 } 48341 /** 48342 * Pass false to use faster iteration that skips non-enumerable properties 48343 * but still handles symbols for compatibility. 48344 * 48345 * By default, strict iteration is enabled (includes all own properties). 48346 */ 48347 setUseStrictIteration(value) { 48348 this.useStrictIteration_ = value; 48349 } 48350 shouldUseStrictIteration() { 48351 return this.useStrictIteration_; 48352 } 48353 applyPatches(base, patches) { 48354 let i; 48355 for (i = patches.length - 1; i >= 0; i--) { 48356 const patch = patches[i]; 48357 if (patch.path.length === 0 && patch.op === "replace") { 48358 base = patch.value; 48359 break; 48360 } 48361 } 48362 if (i > -1) { 48363 patches = patches.slice(i + 1); 48364 } 48365 const applyPatchesImpl = getPlugin(PluginPatches).applyPatches_; 48366 if (isDraft(base)) { 48367 return applyPatchesImpl(base, patches); 48368 } 48369 return this.produce( 48370 base, 48371 (draft) => applyPatchesImpl(draft, patches) 48372 ); 48373 } 48374}; 48375function createProxy(rootScope, value, parent, key) { 48376 const [draft, state] = isMap(value) ? getPlugin(PluginMapSet).proxyMap_(value, parent) : isSet(value) ? getPlugin(PluginMapSet).proxySet_(value, parent) : createProxyProxy(value, parent); 48377 const scope = parent?.scope_ ?? getCurrentScope(); 48378 scope.drafts_.push(draft); 48379 state.callbacks_ = parent?.callbacks_ ?? []; 48380 state.key_ = key; 48381 if (parent && key !== void 0) { 48382 registerChildFinalizationCallback(parent, state, key); 48383 } else { 48384 state.callbacks_.push(function rootDraftCleanup(rootScope2) { 48385 rootScope2.mapSetPlugin_?.fixSetContents(state); 48386 const { patchPlugin_ } = rootScope2; 48387 if (state.modified_ && patchPlugin_) { 48388 patchPlugin_.generatePatches_(state, [], rootScope2); 48389 } 48390 }); 48391 } 48392 return draft; 48393} 48394 48395// src/core/current.ts 48396function current(value) { 48397 if (!isDraft(value)) 48398 die(10, value); 48399 return currentImpl(value); 48400} 48401function currentImpl(value) { 48402 if (!isDraftable(value) || isFrozen(value)) 48403 return value; 48404 const state = value[DRAFT_STATE]; 48405 let copy; 48406 let strict = true; 48407 if (state) { 48408 if (!state.modified_) 48409 return state.base_; 48410 state.finalized_ = true; 48411 copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_); 48412 strict = state.scope_.immer_.shouldUseStrictIteration(); 48413 } else { 48414 copy = shallowCopy(value, true); 48415 } 48416 each( 48417 copy, 48418 (key, childValue) => { 48419 set(copy, key, currentImpl(childValue)); 48420 }, 48421 strict 48422 ); 48423 if (state) { 48424 state.finalized_ = false; 48425 } 48426 return copy; 48427} 48428 48429// src/
48429plugins/patches.ts 48430function enablePatches() { 48431 const errorOffset = 16; 48432 if (false) // removed by dead control flow 48433{} 48434 function getPath(state, path = []) { 48435 if (state.key_ !== void 0) { 48436 const parentCopy = state.parent_.copy_ ?? state.parent_.base_; 48437 const proxyDraft = getProxyDraft(get(parentCopy, state.key_)); 48438 const valueAtKey = get(parentCopy, state.key_); 48439 if (valueAtKey === void 0) { 48440 return null; 48441 } 48442 if (valueAtKey !== state.draft_ && valueAtKey !== state.base_ && valueAtKey !== state.copy_) { 48443 return null; 48444 } 48445 if (proxyDraft != null && proxyDraft.base_ !== state.base_) { 48446 return null; 48447 } 48448 const isSet2 = state.parent_.type_ === 3 /* Set */; 48449 let key; 48450 if (isSet2) { 48451 const setParent = state.parent_; 48452 key = Array.from(setParent.drafts_.keys()).indexOf(state.key_); 48453 } else { 48454 key = state.key_; 48455 } 48456 if (!(isSet2 && parentCopy.size > key || has(parentCopy, key))) { 48457 return null; 48458 } 48459 path.push(key); 48460 } 48461 if (state.parent_) { 48462 return getPath(state.parent_, path); 48463 } 48464 path.reverse(); 48465 try { 48466 resolvePath(state.copy_, path); 48467 } catch (e) { 48468 return null; 48469 } 48470 return path; 48471 } 48472 function resolvePath(base, path) {
vendor: 7,571 bytes, lines 48473-48725
48473 let current2 = base; 48474 for (let i = 0; i < path.length - 1; i++) { 48475 const key = path[i]; 48476 current2 = get(current2, key); 48477 if (!isObjectish(current2) || current2 === null) { 48478 throw new Error(`Cannot resolve path at '${path.join("/")}'`); 48479 } 48480 } 48481 return current2; 48482 } 48483 const REPLACE = "replace"; 48484 const ADD = "add"; 48485 const REMOVE = "remove"; 48486 function generatePatches_(state, basePath, scope) { 48487 if (state.scope_.processedForPatches_.has(state)) { 48488 return; 48489 } 48490 state.scope_.processedForPatches_.add(state); 48491 const { patches_, inversePatches_ } = scope; 48492 switch (state.type_) { 48493 case 0 /* Object */: 48494 case 2 /* Map */: 48495 return generatePatchesFromAssigned( 48496 state, 48497 basePath, 48498 patches_, 48499 inversePatches_ 48500 ); 48501 case 1 /* Array */: 48502 return generateArrayPatches( 48503 state, 48504 basePath, 48505 patches_, 48506 inversePatches_ 48507 ); 48508 case 3 /* Set */: 48509 return generateSetPatches( 48510 state, 48511 basePath, 48512 patches_, 48513 inversePatches_ 48514 ); 48515 } 48516 } 48517 function generateArrayPatches(state, basePath, patches, inversePatches) { 48518 let { base_, assigned_ } = state; 48519 let copy_ = state.copy_; 48520 if (copy_.length < base_.length) { 48521 ; 48522 [base_, copy_] = [copy_, base_]; 48523 [patches, inversePatches] = [inversePatches, patches]; 48524 } 48525 const allReassigned = state.allIndicesReassigned_ === true; 48526 for (let i = 0; i < base_.length; i++) { 48527 const copiedItem = copy_[i]; 48528 const baseItem = base_[i]; 48529 const isAssigned = allReassigned || assigned_?.get(i.toString()); 48530 if (isAssigned && copiedItem !== baseItem) { 48531 const childState = copiedItem?.[DRAFT_STATE]; 48532 if (childState && childState.modified_) { 48533 continue; 48534 } 48535 const path = basePath.concat([i]); 48536 patches.push({ 48537 op: REPLACE, 48538 path, 48539 // Need to maybe clone it, as it can in fact be the original value 48540 // due to the base/copy inversion at the start of this function 48541 value: clonePatchValueIfNeeded(copiedItem) 48542 }); 48543 inversePatches.push({ 48544 op: REPLACE, 48545 path, 48546 value: clonePatchValueIfNeeded(baseItem) 48547 }); 48548 } 48549 } 48550 for (let i = base_.length; i < copy_.length; i++) { 48551 const path = basePath.concat([i]); 48552 patches.push({ 48553 op: ADD, 48554 path, 48555 // Need to maybe clone it, as it can in fact be the original value 48556 // due to the base/copy inversion at the start of this function 48557 value: clonePatchValueIfNeeded(copy_[i]) 48558 }); 48559 } 48560 for (let i = copy_.length - 1; base_.length <= i; --i) { 48561 const path = basePath.concat([i]); 48562 inversePatches.push({ 48563 op: REMOVE, 48564 path 48565 }); 48566 } 48567 } 48568 function generatePatchesFromAssigned(state, basePath, patches, inversePatches) { 48569 const { base_, copy_, type_ } = state; 48570 each(state.assigned_, (key, assignedValue) => { 48571 const origValue = get(base_, key, type_); 48572 const value = get(copy_, key, type_); 48573 const op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD; 48574 if (origValue === value && op === REPLACE) 48575 return; 48576 const path = basePath.concat(key); 48577 patches.push( 48578 op === REMOVE ? { op, path } : { op, path, value: clonePatchValueIfNeeded(value) } 48579 ); 48580 inversePatches.push( 48581 op === ADD ? { op: REMOVE, path } : op === REMOVE ? { op: ADD, path, value: clonePatchValueIfNeeded(origValue) } : { op: REPLACE, path, value: clonePatchValueIfNeeded(origValue) } 48582 ); 48583 }); 48584 } 48585 function generateSetPatches(state, basePath, patches, inversePatches) { 48586 let { base_, copy_ } = state; 48587 let i = 0; 48588 base_.forEach((value) => { 48589 if (!copy_.has(value)) { 48590 const path = basePath.concat([i]); 48591 patches.push({ 48592 op: REMOVE, 48593 path, 48594 value 48595 }); 48596 inversePatches.unshift({ 48597 op: ADD, 48598 path, 48599 value 48600 }); 48601 } 48602 i++; 48603 }); 48604 i = 0; 48605 copy_.forEach((value) => { 48606 if (!base_.has(value)) { 48607 const path = basePath.concat([i]); 48608 patches.push({ 48609 op: ADD, 48610 path, 48611 value 48612 }); 48613 inversePatches.unshift({ 48614 op: REMOVE, 48615 path, 48616 value 48617 }); 48618 } 48619 i++; 48620 }); 48621 } 48622 function generateReplacementPatches_(baseValue, replacement, scope) { 48623 const { patches_, inversePatches_ } = scope; 48624 patches_.push({ 48625 op: REPLACE, 48626 path: [], 48627 value: replacement === NOTHING ? void 0 : replacement 48628 }); 48629 inversePatches_.push({ 48630 op: REPLACE, 48631 path: [], 48632 value: baseValue 48633 }); 48634 } 48635 function applyPatches_(draft, patches) { 48636 patches.forEach((patch) => { 48637 const { path, op } = patch; 48638 let base = draft; 48639 for (let i = 0; i < path.length - 1; i++) { 48640 const parentType = getArchtype(base); 48641 let p = path[i]; 48642 if (typeof p !== "string" && typeof p !== "number") { 48643 p = "" + p; 48644 } 48645 if ((parentType === 0 /* Object */ || parentType === 1 /* Array */) && (p === "__proto__" || p === CONSTRUCTOR)) 48646 die(errorOffset + 3); 48647 if (isFunction(base) && p === PROTOTYPE) 48648 die(errorOffset + 3); 48649 base = get(base, p); 48650 if (!isObjectish(base)) 48651 die(errorOffset + 2, path.join("/")); 48652 } 48653 const type = getArchtype(base); 48654 const value = deepClonePatchValue(patch.value); 48655 const key = path[path.length - 1]; 48656 switch (op) { 48657 case REPLACE: 48658 switch (type) { 48659 case 2 /* Map */: 48660 return base.set(key, value); 48661 case 3 /* Set */: 48662 die(errorOffset); 48663 default: 48664 return base[key] = value; 48665 } 48666 case ADD: 48667 switch (type) { 48668 case 1 /* Array */: 48669 return key === "-" ? base.push(value) : base.splice(key, 0, value); 48670 case 2 /* Map */: 48671 return base.set(key, value); 48672 case 3 /* Set */: 48673 return base.add(value); 48674 default: 48675 return base[key] = value; 48676 } 48677 case REMOVE: 48678 switch (type) { 48679 case 1 /* Array */: 48680 return base.splice(key, 1); 48681 case 2 /* Map */: 48682 return base.delete(key); 48683 case 3 /* Set */: 48684 return base.delete(patch.value); 48685 default: 48686 return delete base[key]; 48687 } 48688 default: 48689 die(errorOffset + 1, op); 48690 } 48691 }); 48692 return draft; 48693 } 48694 function deepClonePatchValue(obj) { 48695 if (!isDraftable(obj)) 48696 return obj; 48697 if (isArray(obj)) 48698 return obj.map(deepClonePatchValue); 48699 if (isMap(obj)) 48700 return new Map( 48701 Array.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)]) 48702 ); 48703 if (isSet(obj)) 48704 return new Set(Array.from(obj).map(deepClonePatchValue)); 48705 const cloned = Object.create(getPrototypeOf(obj)); 48706 for (const key in obj) 48707 cloned[key] = deepClonePatchValue(obj[key]); 48708 if (has(obj, DRAFTABLE)) 48709 cloned[DRAFTABLE] = obj[DRAFTABLE]; 48710 return cloned; 48711 } 48712 function clonePatchValueIfNeeded(obj) { 48713 if (isDraft(obj)) { 48714 return deepClonePatchValue(obj); 48715 } else 48716 return obj; 48717 } 48718 loadPlugin(PluginPatches, { 48719 applyPatches_, 48720 generatePatches_, 48721 generateReplacementPatches_, 48722 getPath 48723 }); 48724} 48725
48726// src/plugins/mapset.ts 48727function enableMapSet() { 48728 class DraftMap extends Map { 48729 constructor(target, parent) { 48730 super(); 48731 this[DRAFT_STATE] = { 48732 type_: 2 /* Map */, 48733 parent_: parent, 48734 scope_: parent ? parent.scope_ : getCurrentScope(), 48735 modified_: false, 48736 finalized_: false, 48737 copy_: void 0, 48738 assigned_: void 0, 48739 base_: target, 48740 draft_: this, 48741 isManual_: false, 48742 revoked_: false, 48743 callbacks_: [] 48744 }; 48745 } 48746 get size() { 48747 return latest(this[DRAFT_STATE]).size; 48748 } 48749 has(key) { 48750 return latest(this[DRAFT_STATE]).has(key); 48751 } 48752 set(key, value) { 48753 const state = this[DRAFT_STATE]; 48754 assertUnrevoked(state); 48755 if (!latest(state).has(key) || latest(state).get(key) !== value) { 48756 prepareMapCopy(state); 48757 markChanged(state); 48758 state.assigned_.set(key, true); 48759 state.copy_.set(key, value); 48760 state.assigned_.set(key, true); 48761 handleCrossReference(state, key, value); 48762 } 48763 return this; 48764 } 48765 delete(key) { 48766 if (!this.has(key)) { 48767 return false; 48768 } 48769 const state = this[DRAFT_STATE]; 48770 assertUnrevoked(state); 48771 prepareMapCopy(state); 48772 markChanged(state); 48773 if (state.base_.has(key)) { 48774 state.assigned_.set(key, false); 48775 } else { 48776 state.assigned_.delete(key); 48777 } 48778 state.copy_.delete(key); 48779 return true; 48780 } 48781 clear() { 48782 const state = this[DRAFT_STATE]; 48783 assertUnrevoked(state); 48784 if (latest(state).size) { 48785 prepareMapCopy(state); 48786 markChanged(state); 48787 state.assigned_ = /* @__PURE__ */ new Map(); 48788 each(state.base_, (key) => { 48789 state.assigned_.set(key, false); 48790 }); 48791 state.copy_.clear(); 48792 } 48793 } 48794 forEach(cb, thisArg) { 48795 const state = this[DRAFT_STATE]; 48796 latest(state).forEach((_value, key, _map) => { 48797 cb.call(thisArg, this.get(key), key, this); 48798 }); 48799 } 48800 get(key) { 48801 const state = this[DRAFT_STATE]; 48802 assertUnrevoked(state); 48803 const value = latest(state).get(key); 48804 if (state.finalized_ || !isDraftable(value)) { 48805 return value; 48806 } 48807 if (value !== state.base_.get(key)) { 48808 return value; 48809 } 48810 const draft = createProxy(state.scope_, value, state, key); 48811 prepareMapCopy(state); 48812 state.copy_.set(key, draft); 48813 return draft; 48814 } 48815 keys() { 48816 return latest(this[DRAFT_STATE]).keys(); 48817 } 48818 values() { 48819 const iterator = this.keys(); 48820 return { 48821 [Symbol.iterator]: () => this.values(), 48822 next: () => { 48823 const r = iterator.next(); 48824 if (r.done) 48825 return r; 48826 const value = this.get(r.value); 48827 return { 48828 done: false, 48829 value 48830 }; 48831 } 48832 }; 48833 } 48834 entries() { 48835 const iterator = this.keys(); 48836 return { 48837 [Symbol.iterator]: () => this.entries(), 48838 next: () => { 48839 const r = iterator.next(); 48840 if (r.done) 48841 return r; 48842 const value = this.get(r.value); 48843 return { 48844 done: false, 48845 value: [r.value, value] 48846 }; 48847 } 48848 }; 48849 } 48850 [(DRAFT_STATE, Symbol.iterator)]() { 48851 return this.entries(); 48852 } 48853 } 48854 function proxyMap_(target, parent) { 48855 const map = new DraftMap(target, parent); 48856 return [map, map[DRAFT_STATE]]; 48857 } 48858 function prepareMapCopy(state) { 48859 if (!state.copy_) { 48860 state.assigned_ = /* @__PURE__ */ new Map(); 48861 state.copy_ = new Map(state.base_); 48862 } 48863 } 48864 class DraftSet extends Set { 48865 constructor(target, parent) { 48866 super(); 48867 this[DRAFT_STATE] = { 48868 type_: 3 /* Set */, 48869 parent_: parent, 48870 scope_: parent ? parent.scope_ : getCurrentScope(), 48871 modified_: false, 48872 finalized_: false, 48873 copy_: void 0, 48874 base_: target, 48875 draft_: this, 48876 drafts_: /* @__PURE__ */ new Map(), 48877 revoked_: false, 48878 isManual_: false, 48879 assigned_: void 0, 48880 callbacks_: [] 48881 }; 48882 } 48883 get size() { 48884 return latest(this[DRAFT_STATE]).size; 48885 } 48886 has(value) { 48887 const state = this[DRAFT_STATE]; 48888 assertUnrevoked(state); 48889 if (!state.copy_) { 48890 return state.base_.has(value); 48891 } 48892 if (state.copy_.has(value)) 48893 return true; 48894 if (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value))) 48895 return true; 48896 return false;
48897 } 48898 add(value) { 48899 const state = this[DRAFT_STATE]; 48900 assertUnrevoked(state); 48901 if (!this.has(value)) { 48902 prepareSetCopy(state); 48903 markChanged(state); 48904 state.copy_.add(value); 48905 handleCrossReference(state, value, value); 48906 } 48907 return this; 48908 } 48909 delete(value) { 48910 if (!this.has(value)) { 48911 return false; 48912 } 48913 const state = this[DRAFT_STATE]; 48914 assertUnrevoked(state); 48915 prepareSetCopy(state); 48916 markChanged(state); 48917 return state.copy_.delete(value) || (state.drafts_.has(value) ? state.copy_.delete(state.drafts_.get(value)) : ( 48918 /* istanbul ignore next */ 48919 false 48920 )); 48921 } 48922 clear() { 48923 const state = this[DRAFT_STATE]; 48924 assertUnrevoked(state); 48925 if (latest(state).size) { 48926 prepareSetCopy(state); 48927 markChanged(state); 48928 state.copy_.clear(); 48929 } 48930 } 48931 values() { 48932 const state = this[DRAFT_STATE]; 48933 assertUnrevoked(state); 48934 prepareSetCopy(state); 48935 return state.copy_.values(); 48936 } 48937 entries() { 48938 const state = this[DRAFT_STATE]; 48939 assertUnrevoked(state); 48940 prepareSetCopy(state); 48941 return state.copy_.entries(); 48942 } 48943 keys() { 48944 return this.values(); 48945 } 48946 [(DRAFT_STATE, Symbol.iterator)]() { 48947 return this.values(); 48948 } 48949 forEach(cb, thisArg) { 48950 const iterator = this.values(); 48951 let result = iterator.next(); 48952 while (!result.done) { 48953 cb.call(thisArg, result.value, result.value, this); 48954 result = iterator.next(); 48955 } 48956 } 48957 } 48958 function proxySet_(target, parent) { 48959 const set2 = new DraftSet(target, parent); 48960 return [set2, set2[DRAFT_STATE]]; 48961 } 48962 function prepareSetCopy(state) { 48963 if (!state.copy_) { 48964 state.copy_ = /* @__PURE__ */ new Set(); 48965 state.base_.forEach((value) => { 48966 if (isDraftable(value)) { 48967 const draft = createProxy(state.scope_, value, state, value); 48968 state.drafts_.set(value, draft); 48969 state.copy_.add(draft); 48970 } else { 48971 state.copy_.add(value); 48972 } 48973 }); 48974 } 48975 } 48976 function assertUnrevoked(state) { 48977 if (state.revoked_)
48978 die(3, JSON.stringify(latest(state))); 48979 } 48980 function fixSetContents(target) { 48981 if (target.type_ === 3 /* Set */ && target.copy_) { 48982 const copy = new Set(target.copy_); 48983 target.copy_.clear(); 48984 copy.forEach((value) => { 48985 target.copy_.add(getValue(value)); 48986 }); 48987 } 48988 } 48989 loadPlugin(PluginMapSet, { proxyMap_, proxySet_, fixSetContents }); 48990} 48991
48992// src/plugins/arrayMethods.ts 48993function enableArrayMethods() { 48994 const SHIFTING_METHODS = /* @__PURE__ */ new Set(["shift", "unshift"]); 48995 const QUEUE_METHODS = /* @__PURE__ */ new Set(["push", "pop"]); 48996 const RESULT_RETURNING_METHODS = /* @__PURE__ */ new Set([ 48997 ...QUEUE_METHODS, 48998 ...SHIFTING_METHODS 48999 ]); 49000 const REORDERING_METHODS = /* @__PURE__ */ new Set(["reverse", "sort"]); 49001 const MUTATING_METHODS = /* @__PURE__ */ new Set([ 49002 ...RESULT_RETURNING_METHODS, 49003 ...REORDERING_METHODS, 49004 "splice" 49005 ]); 49006 const FIND_METHODS = /* @__PURE__ */ new Set(["find", "findLast"]); 49007 const NON_MUTATING_METHODS = /* @__PURE__ */ new Set([ 49008 "filter", 49009 "slice", 49010 "concat", 49011 "flat", 49012 ...FIND_METHODS, 49013 "findIndex", 49014 "findLastIndex", 49015 "some", 49016 "every", 49017 "indexOf", 49018 "lastIndexOf", 49019 "includes", 49020 "join", 49021 "toString", 49022 "toLocaleString" 49023 ]); 49024 function isMutatingArrayMethod(method) { 49025 return MUTATING_METHODS.has(method); 49026 } 49027 function isNonMutatingArrayMethod(method) { 49028 return NON_MUTATING_METHODS.has(method); 49029 } 49030 function isArrayOperationMethod(method) { 49031 return isMutatingArrayMethod(method) || isNonMutatingArrayMethod(method); 49032 } 49033 function enterOperation(state, method) { 49034 state.operationMethod = method; 49035 } 49036 function exitOperation(state) { 49037 state.operationMethod = void 0; 49038 } 49039 function executeArrayMethod(state, operation, markLength = true) { 49040 prepareCopy(state); 49041 const result = operation(); 49042 markChanged(state); 49043 if (markLength) 49044 state.assigned_.set("length", true); 49045 return result; 49046 } 49047 function markAllIndicesReassigned(state) { 49048 state.allIndicesReassigned_ = true; 49049 } 49050 function normalizeSliceIndex(index, length) { 49051 if (index < 0) { 49052 return Math.max(length + index, 0); 49053 } 49054 return Math.min(index, length); 49055 } 49056 function handleInsertedValues(state, startIndex, values) { 49057 for (let i = 0; i < values.length; i++) { 49058 const index = startIndex + i; 49059 state.assigned_.set(index, true); 49060 handleCrossReference(state, index, values[i]); 49061 } 49062 } 49063 function handleSimpleOperation(state, method, args) { 49064 return executeArrayMethod(state, () => { 49065 const lengthBefore = state.copy_.length; 49066 const result = state.copy_[method](...args); 49067 if (SHIFTING_METHODS.has(method)) { 49068 markAllIndicesReassigned(state); 49069 } 49070 if (method === "push" && args.length > 0) { 49071 handleInsertedValues(state, lengthBefore, args); 49072 } else if (method === "unshift" && args.length > 0) { 49073 handleInsertedValues(state, 0, args); 49074 } 49075 return RESULT_RETURNING_METHODS.has(method) ? result : state.draft_; 49076 }); 49077 } 49078 function handleReorderingOperation(state, method, args) { 49079 return executeArrayMethod( 49080 state, 49081 () => { 49082 ; 49083 state.copy_[method](...args); 49084 markAllIndicesReassigned(state); 49085 return state.draft_; 49086 }, 49087 false 49088 ); 49089 } 49090 function createMethodInterceptor(state, originalMethod) { 49091 return function interceptedMethod(...args) { 49092 const method = originalMethod; 49093 enterOperation(state, method); 49094 try { 49095 if (isMutatingArrayMethod(method)) { 49096 if (RESULT_RETURNING_METHODS.has(method)) { 49097 return handleSimpleOperation(state, method, args); 49098 } 49099 if (REORDERING_METHODS.has(method)) { 49100 return handleReorderingOperation(state, method, args); 49101 } 49102 if (method === "splice") { 49103 const res = executeArrayMethod( 49104 state, 49105 () => state.copy_.splice(...args) 49106 ); 49107 markAllIndicesReassigned(state); 49108 if (args.length > 2) { 49109 const startIndex = normalizeSliceIndex( 49110 args[0] ?? 0, 49111 state.copy_.length 49112 ); 49113 handleInsertedValues(state, startIndex, args.slice(2)); 49114 } 49115 return res; 49116 } 49117 } else { 49118 return handleNonMutatingOperation(state, method, args); 49119 } 49120 } finally { 49121 exitOperation(state); 49122 } 49123 }; 49124 } 49125 function handleNonMutatingOperation(state, method, args) { 49126 const source = latest(state); 49127 if (method === "filter") { 49128 const predicate = args[0]; 49129 const result = []; 49130 for (let i = 0; i < source.length; i++) { 49131 if (predicate(source[i], i, source)) { 49132 result.push(state.draft_[i]); 49133 } 49134 } 49135 return result; 49136 } 49137 if (FIND_METHODS.has(method)) { 49138 const predicate = args[0]; 49139 const isForward = method === "find"; 49140 const step = isForward ? 1 : -1; 49141 const start = isForward ? 0 : source.length - 1; 49142 for (let i = start; i >= 0 && i < source.length; i += step) { 49143 if (predicate(source[i], i, source)) { 49144 return state.draft_[i]; 49145 } 49146 } 49147 return void 0; 49148 } 49149 if (method === "slice") { 49150 const rawStart = args[0] ?? 0; 49151 const rawEnd = args[1] ?? source.length; 49152 const start = normalizeSliceIndex(rawStart, source.length); 49153 const end = normalizeSliceIndex(rawEnd, source.length); 49154 const result = []; 49155 for (let i = start; i < end; i++) { 49156 result.push(state.draft_[i]); 49157 } 49158 return result; 49159 } 49160 return source[method](...args); 49161 } 49162 loadPlugin(PluginArrayMethods, { 49163 createMethodInterceptor, 49164 isArrayOperationMethod, 49165 isMutatingArrayMethod 49166 }); 49167} 49168
vendor: 6,403 bytes, lines 49169-49459
49169// src/immer.ts 49170var immer = new Immer2(); 49171var produce = immer.produce; 49172var produceWithPatches = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.produceWithPatches.bind(immer))); 49173var setAutoFreeze = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.setAutoFreeze.bind(immer))); 49174var setUseStrictShallowCopy = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.setUseStrictShallowCopy.bind(immer))); 49175var setUseStrictIteration = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.setUseStrictIteration.bind(immer))); 49176var applyPatches = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.applyPatches.bind(immer))); 49177var createDraft = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.createDraft.bind(immer))); 49178var finishDraft = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.finishDraft.bind(immer))); 49179var castDraft = (value) => value; 49180var castImmutable = (value) => value; 49181 49182//# sourceMappingURL=immer.mjs.map 49183 49184/***/ }, 49185 49186/***/ 19788 49187(module) { 49188 49189// http://www.w3.org/TR/CSS21/grammar.html 49190// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027 49191var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; 49192 49193var NEWLINE_REGEX = /\n/g; 49194var WHITESPACE_REGEX = /^\s*/; 49195 49196// declaration 49197var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; 49198var COLON_REGEX = /^:\s*/; 49199var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; 49200var SEMICOLON_REGEX = /^[;\s]*/; 49201 49202// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill 49203var TRIM_REGEX = /^\s+|\s+$/g; 49204 49205// strings 49206var NEWLINE = '\n'; 49207var FORWARD_SLASH = '/'; 49208var ASTERISK = '*'; 49209var EMPTY_STRING = ''; 49210 49211// types 49212var TYPE_COMMENT = 'comment'; 49213var TYPE_DECLARATION = 'declaration'; 49214 49215/** 49216 * @param {String} style 49217 * @param {Object} [options] 49218 * @return {Object[]} 49219 * @throws {TypeError} 49220 * @throws {Error} 49221 */ 49222module.exports = function(style, options) { 49223 if (typeof style !== 'string') { 49224 throw new TypeError('First argument must be a string'); 49225 } 49226 49227 if (!style) return []; 49228 49229 options = options || {}; 49230 49231 /** 49232 * Positional. 49233 */ 49234 var lineno = 1; 49235 var column = 1; 49236 49237 /** 49238 * Update lineno and column based on `str`. 49239 * 49240 * @param {String} str 49241 */ 49242 function updatePosition(str) { 49243 var lines = str.match(NEWLINE_REGEX); 49244 if (lines) lineno += lines.length; 49245 var i = str.lastIndexOf(NEWLINE); 49246 column = ~i ? str.length - i : column + str.length; 49247 } 49248 49249 /** 49250 * Mark position and patch `node.position`. 49251 * 49252 * @return {Function} 49253 */ 49254 function position() { 49255 var start = { line: lineno, column: column }; 49256 return function(node) { 49257 node.position = new Position(start); 49258 whitespace(); 49259 return node; 49260 }; 49261 } 49262 49263 /** 49264 * Store position information for a node. 49265 * 49266 * @constructor 49267 * @property {Object} start 49268 * @property {Object} end 49269 * @property {undefined|String} source 49270 */ 49271 function Position(start) { 49272 this.start = start; 49273 this.end = { line: lineno, column: column }; 49274 this.source = options.source; 49275 } 49276 49277 /** 49278 * Non-enumerable source string. 49279 */ 49280 Position.prototype.content = style; 49281 49282 var errorsList = []; 49283 49284 /** 49285 * Error `msg`. 49286 * 49287 * @param {String} msg 49288 * @throws {Error} 49289 */ 49290 function error(msg) { 49291 var err = new Error( 49292 options.source + ':' + lineno + ':' + column + ': ' + msg 49293 ); 49294 err.reason = msg; 49295 err.filename = options.source; 49296 err.line = lineno; 49297 err.column = column; 49298 err.source = style; 49299 49300 if (options.silent) { 49301 errorsList.push(err); 49302 } else { 49303 throw err; 49304 } 49305 } 49306 49307 /** 49308 * Match `re` and return captures. 49309 * 49310 * @param {RegExp} re 49311 * @return {undefined|Array} 49312 */ 49313 function match(re) { 49314 var m = re.exec(style); 49315 if (!m) return; 49316 var str = m[0]; 49317 updatePosition(str); 49318 style = style.slice(str.length); 49319 return m; 49320 } 49321 49322 /** 49323 * Parse whitespace. 49324 */ 49325 function whitespace() { 49326 match(WHITESPACE_REGEX); 49327 } 49328 49329 /** 49330 * Parse comments. 49331 * 49332 * @param {Object[]} [rules] 49333 * @return {Object[]} 49334 */ 49335 function comments(rules) { 49336 var c; 49337 rules = rules || []; 49338 while ((c = comment())) { 49339 if (c !== false) { 49340 rules.push(c); 49341 } 49342 } 49343 return rules; 49344 } 49345 49346 /** 49347 * Parse comment. 49348 * 49349 * @return {Object} 49350 * @throws {Error} 49351 */ 49352 function comment() { 49353 var pos = position(); 49354 if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return; 49355 49356 var i = 2; 49357 while ( 49358 EMPTY_STRING != style.charAt(i) && 49359 (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1)) 49360 ) { 49361 ++i; 49362 } 49363 i += 2; 49364 49365 if (EMPTY_STRING === style.charAt(i - 1)) { 49366 return error('End of comment missing'); 49367 } 49368 49369 var str = style.slice(2, i - 2); 49370 column += 2; 49371 updatePosition(str); 49372 style = style.slice(i); 49373 column += 2; 49374 49375 return pos({ 49376 type: TYPE_COMMENT, 49377 comment: str 49378 }); 49379 } 49380 49381 /** 49382 * Parse declaration. 49383 * 49384 * @return {Object} 49385 * @throws {Error} 49386 */ 49387 function declaration() { 49388 var pos = position(); 49389 49390 // prop 49391 var prop = match(PROPERTY_REGEX); 49392 if (!prop) return; 49393 comment(); 49394 49395 // : 49396 if (!match(COLON_REGEX)) return error("property missing ':'"); 49397 49398 // val 49399 var val = match(VALUE_REGEX); 49400 49401 var ret = pos({ 49402 type: TYPE_DECLARATION, 49403 property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)), 49404 value: val 49405 ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) 49406 : EMPTY_STRING 49407 }); 49408 49409 // ; 49410 match(SEMICOLON_REGEX); 49411 49412 return ret; 49413 } 49414 49415 /** 49416 * Parse declarations. 49417 * 49418 * @return {Object[]} 49419 */ 49420 function declarations() { 49421 var decls = []; 49422 49423 comments(decls); 49424 49425 // declarations 49426 var decl; 49427 while ((decl = declaration())) { 49428 if (decl !== false) { 49429 decls.push(decl); 49430 comments(decls); 49431 } 49432 } 49433 49434 return decls; 49435 } 49436 49437 whitespace(); 49438 return declarations(); 49439}; 49440 49441/** 49442 * Trim `str`. 49443 * 49444 * @param {String} str 49445 * @return {String} 49446 */ 49447function trim(str) { 49448 return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING; 49449} 49450 49451 49452/***/ }, 49453 49454/***/ 77002 49455(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 49456 49457"use strict"; 49458/* harmony export */ __webpack_require__.d(__webpack_exports__, { 49459/* harmony export */ dG: () => (/* binding */ Or)
49460/* harmony export */ }); 49461/* unused harmony exports RAGProvider, useRAGConversation, useRAGConversationContext, useRAGResponse, useRAGResponseContext */ 49462/* unused harmony import specifier */ var G; 49463/* unused harmony import specifier */ var oe; 49464/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 49465/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40961); 49466 49467 49468var Ce = function() { 49469 return Ce = Object.assign || function(t) { 49470 for (var e, r = 1, a = arguments.length; r < a; r++) for (var o in e = arguments[r]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); 49471 return t; 49472 }, Ce.apply(this, arguments); 49473}, Te, Nt = function(t) { 49474 var e; 49475 t ? (function(r) { 49476 if (r) for (; r.lastChild; ) r.lastChild.remove(); 49477 })(typeof t == "string" ? document.getElementById(t) : t) : (e = document.querySelector(".grecaptcha-badge")) && e.parentNode && document.body.removeChild(e.parentNode); 49478}, Ct = function(t, e) { 49479 Nt(e), window.___grecaptcha_cfg = void 0; 49480 var r = document.querySelector("#" + t); 49481 r && r.remove(), (function() { 49482 var a = document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'); 49483 a && a.remove(); 49484 })(); 49485}, Tt = function(t) { 49486 var e = t.render, r = t.onLoadCallbackName, a = t.language, o = t.onLoad, i = t.useRecaptchaNet, n = t.useEnterprise, f = t.scriptProps, c = f === void 0 ? {} : f, m = c.nonce, p = m === void 0 ? "" : m, g = c.defer, S = g !== void 0 && g, b = c.async, P = b !== void 0 && b, T = c.id, x = T === void 0 ? "" : T, A = c.appendTo, M = x || "google-recaptcha-v3"; 49487 if ((function(N) { 49488 return !!document.querySelector("#" + N); 49489 })(M)) o(); 49490 else { 49491 var O = (function(N) { 49492 return "https://www." + (N.useRecaptchaNet ? "recaptcha.net" : "google.com") + "/recaptcha/" + (N.useEnterprise ? "enterprise.js" : "api.js"); 49493 })({ useEnterprise: n, useRecaptchaNet: i }), y = document.createElement("script"); 49494 y.id = M, y.src = O + "?render=" + e + (e === "explicit" ? "&onload=" + r : "") + (a ? "&hl=" + a : ""), p && (y.nonce = p), y.defer = !!S, y.async = !!P, y.onload = o, (A === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(y); 49495 } 49496}, _e = function(t) { 49497 typeof process < "u" && process.env && "production" !== "production" || console.warn(t); 49498}; 49499(function(t) { 49500 t.SCRIPT_NOT_AVAILABLE = "Recaptcha script is not available"; 49501})(Te || (Te = {})); 49502var ze = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ executeRecaptcha: function() { 49503 throw Error("GoogleReCaptcha Context has not yet been implemented, if you are using useGoogleReCaptcha hook, make sure the hook is called inside component wrapped by GoogleRecaptchaProvider"); 49504} }); 49505ze.Consumer; 49506function Rt(t) { 49507 var e = t.reCaptchaKey, r = t.useEnterprise, a = r !== void 0 && r, o = t.useRecaptchaNet, i = o !== void 0 && o, n = t.scriptProps, f = t.language, c = t.container, m = t.children, p = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), g = p[0], S = p[1], b = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(e), P = JSON.stringify(n), T = JSON.stringify(c?.parameters); 49508 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((function() { 49509 if (e) { 49510 var M = n?.id || "google-recaptcha-v3", O = n?.onLoadCallbackName || "onRecaptchaLoadCallback"; 49511 return window[O] = function() { 49512 var y = a ? window.grecaptcha.enterprise : window.grecaptcha, N = Ce({ badge: "inline", size: "invisible", sitekey: e }, c?.parameters || {}); 49513 b.current = y.render(c?.element, N); 49514 }, Tt({ render: c?.element ? "explicit" : e, onLoadCallbackName: O, useEnterprise: a, useRecaptchaNet: i, scriptProps: n, language: f, onLoad: function() { 49515 if (window && window.grecaptcha) { 49516 var y = a ? window.grecaptcha.enterprise : window.grecaptcha; 49517 y.ready((function() { 49518 S(y); 49519 })); 49520 } else _e("<GoogleRecaptchaProvider /> " + Te.SCRIPT_NOT_AVAILABLE); 49521 } }), function() { 49522 Ct(M, c?.element); 49523 }; 49524 } 49525 _e("<GoogleReCaptchaProvider /> recaptcha key not provided"); 49526 }), [a, i, P, T, f, e, c?.element]); 49527 var x = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((function(M) { 49528 if (!g || !g.execute) throw new Error("<GoogleReCaptchaProvider /> Google Recaptcha has not been loaded"); 49529 return g.execute(b.current, { action: M }); 49530 }), [g, b]), A = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((function() { 49531 return { executeRecaptcha: g ? x : void 0, container: c?.element }; 49532 }), [x, g, c?.element]); 49533 return react__WEBPACK_IMPORTED_MODULE_0__.createElement(ze.Provider, { value: A }, m); 49534} 49535var We = function() { 49536 return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ze); 49537}; 49538function Xe(t, e) { 49539 return t(e = { exports: {} }, e.exports), e.exports; 49540} 49541var B = typeof Symbol == "function" && Symbol.for, Re = B ? /* @__P
49541URE__ */ Symbol.for("react.element") : 60103, Fe = B ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, se = B ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, le = B ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, ce = B ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, ue = B ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, de = B ? /* @__PURE__ */ Symbol.for("react.context") : 60110, Pe = B ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, be = B ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, fe = B ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, pe = B ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, Ft = B ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, me = B ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, ge = B ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, Pt = B ? /* @__PURE__ */ Symbol.for("react.block") : 60121, At = B ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, It = B ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, $t = B ? /* @__PURE__ */ Symbol.for("react.scope") : 60119; 49542function Y(t) { 49543 if (typeof t == "object" && t !== null) { 49544 var e = t.$$typeof; 49545 switch (e) { 49546 case Re: 49547 switch (t = t.type) { 49548 case Pe: 49549 case be: 49550 case se: 49551 case ce: 49552 case le: 49553 case pe: 49554 return t; 49555 default: 49556 switch (t = t && t.$$typeof) { 49557 case de: 49558 case fe: 49559 case ge: 49560 case me: 49561 case ue: 49562 return t; 49563 default: 49564 return e; 49565 } 49566 } 49567 case Fe: 49568 return e; 49569 } 49570 } 49571} 49572function De(t) { 49573 return Y(t) === be; 49574} 49575var Mt = { AsyncMode: Pe, ConcurrentMode: be, ContextConsumer: de, ContextProvider: ue, Element: Re, ForwardRef: fe, Fragment: se, Lazy: ge, Memo: me, Portal: Fe, Profiler: ce, StrictMode: le, Suspense: pe, isAsyncMode: function(t) { 49576 return De(t) || Y(t) === Pe; 49577}, isConcurrentMode: De, isContextConsumer: function(t) { 49578 return Y(t) === de; 49579}, isContextProvider: function(t) { 49580 return Y(t) === ue; 49581}, isElement: function(t) { 49582 return typeof t == "object" && t !== null && t.$$typeof === Re; 49583}, isForwardRef: function(t) { 49584 return Y(t) === fe; 49585}, isFragment: function(t) { 49586 return Y(t) === se; 49587}, isLazy: function(t) { 49588 return Y(t) === ge; 49589}, isMemo: function(t) { 49590 return Y(t) === me; 49591}, isPortal: function(t) { 49592 return Y(t) === Fe; 49593}, isProfiler: function(t) { 49594 return Y(t) === ce; 49595}, isStrictMode: function(t) { 49596 return Y(t) === le; 49597}, isSuspense: function(t) { 49598 return Y(t) === pe; 49599}, isValidElementType: function(t) { 49600 return typeof t == "string" || typeof t == "function" || t === se || t === be || t === ce || t === le || t === pe || t === Ft || typeof t == "object" && t !== null && (t.$$typeof === ge || t.$$typeof === me || t.$$typeof === ue || t.$$typeof === de || t.$$typeof === fe || t.$$typeof === At || t.$$typeof === It || t.$$typeof === $t || t.$$typeof === Pt); 49601}, typeOf: Y }, $ = Xe((function(t, e) { 49602 false && 0; 49603})), Le = ($.AsyncMode, $.ConcurrentMode, $.ContextConsumer, $.ContextProvider, $.Element, $.ForwardRef, $.Fragment, $.Lazy, $.Memo, $.Portal, $.Profiler, $.StrictMode, $.Suspense, $.isAsyncMode, $.isConcurrentMode, $.isContextConsumer, $.isContextProvider, $.isElement, $.isForwardRef, $.isFragment, $.isLazy, $.isMemo, $.isPortal, $.isProfiler, $.isStrictMode, $.isSuspense, $.isValidElementType, $.typeOf, Xe((function(t) { 49604 true ? t.exports = Mt : 0; 49605}))), zt = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, Be = {}; 49606Be[Le.ForwardRef] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, Be[Le.Memo] = zt; 49607const Ze = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null), Ot = ({ 49608 children: t, 49609 baseUrl: e, 49610 config: r, 49611 recaptchaSiteKey: a 49612}) => { 49613 const o = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Ze.Provider, { value: { config: r, baseUrl: e, recaptchaSiteKey: a } }, t);
49614 return a ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 49615 Rt, 49616 { 49617 reCaptchaKey: a, 49618 scriptProps: { async: !0, defer: !0, appendTo: "head" } 49619 }, 49620 o 49621 ) : o; 49622}, Je = () => { 49623 const t = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Ze); 49624 if (!t) throw new Error("useRAGConfig must be used within RAGProvider"); 49625 return t; 49626}; 49627function Qe(t) { 49628 const [e, r] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0); 49629 return (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 49630 let a; 49631 return t && (a = setInterval(() => { 49632 r((o) => o + 100); 49633 }, 100)), () => clearInterval(a); 49634 }, [t]), { elapsed: e, setElapsed: r }; 49635} 49636const jt = (t, e, r) => { 49637 const [a, o] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]), [i, n] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1), [f, c] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), { executeRecaptcha: m } = We(), { elapsed: p, setElapsed: g } = Qe(i), S = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)( 49638 async (b, P) => { 49639 let T = null; 49640 if (r) 49641 try { 49642 m && (T = await m("rag_search")); 49643 } catch { 49644 console.warn("reCAPTCHA skipped: no provider found"); 49645 } 49646 o((x) => [...x, { role: "user", content: b }]), n(!0), g(0), c(null);
49647 try { 49648 const x = new URLSearchParams({ 49649 question: b, 49650 config: t, 49651 history: String(!0), 49652 stream: String(!0) 49653 }); 49654 P && P?.length >= 1 && x.set("sections", P.join(",")); 49655 const A = x.toString(), M = new Headers({ Accept: "text/event-stream" }); 49656 T && M.append("X-Recaptcha-Token", T); 49657 const O = localStorage.getItem("rag-session-id"); 49658 O && M.append("X-Session-Id", O); 49659 const y = await fetch(`${e}/query-collection?${A}`, { 49660 method: "GET", 49661 headers: M 49662 }); 49663 if (!y.ok) { 49664 let I = `Request failed (${y.status})`; 49665 try { 49666 I = (await y.json())?.message ?? I; 49667 } catch { 49668 const j = await y.text(); 49669 j && (I = j); 49670 } 49671 throw new Error(I); 49672 } 49673 if (y.headers.has("X-Session-Id") && localStorage.setItem( 49674 "rag-session-id", 49675 y.headers.get("X-Session-Id") 49676 ), !y.body) throw new Error("No response body"); 49677 const N = y.body.getReader(), H = new TextDecoder("utf-8"); 49678 let k = "", z = ""; 49679 for (o((I) => [...I, { role: "assistant", content: "" }]); ; ) { 49680 const { value: I, done: j } = await N.read(); 49681 if (j) break; 49682 k += H.decode(I, { stream: !0 }); 49683 const D = k.split(` 49684 49685`); 49686 k = D.pop() || ""; 49687 for (const _ of D) { 49688 if (_.startsWith("event: done")) { 49689 n(!1), g(0); 49690 return; 49691 } 49692 if (_.startsWith("data:")) 49693 try { 49694 const w = JSON.parse(_.replace("data: ", "")); 49695 w?.content && (z += w.content, o((s) => { 49696 const l = [...s]; 49697 return l[l.length - 1] = { 49698 role: "assistant", 49699 content: z 49700 }, l; 49701 })); 49702 } catch (w) { 49703 console.error("Failed to parse SSE chunk", w, _); 49704 } 49705 } 49706 } 49707 n(!1), g(0); 49708 } catch (x) { 49709 const A = x instanceof Error && x.message ? x.message : "Something went wrong"; 49710 console.error(x), c(A), n(!1), g(0); 49711 } 49712 }, 49713 [t, e, r, m, g] 49714 ); 49715 return { messages: a, loading: i, error: f, elapsed: p, ask: S }; 49716}, _t = (/* unused pure expression or super */ null && (!1)), Dt = (/* unused pure expression or super */ null && (!0)), Lt = (t, e, r) => { 49717 const [a, o] = G(""), [i, n] = G(!1), [f, c] = G(null), { executeRecaptcha: m } = We(), { elapsed: p, setElapsed: g } = Qe(i), S = oe( 49718 async (b, P) => { 49719 let T = null; 49720 if (r) 49721 try { 49722 m && (T = await m("rag_search")); 49723 } catch { 49724 console.warn("reCAPTCHA skipped: no provider found"); 49725 } 49726 n(!0), c(null), g(0), o(""); 49727 try { 49728 const x = new URLSearchParams({ 49729 question: b, 49730 config: t, 49731 history: String(_t), 49732 stream: String(Dt) 49733 }); 49734 P && P?.length >= 1 && x.set("sections", P.join(",")); 49735 const A = x.toString(), M = new Headers({ Accept: "text/event-stream" }); 49736 T && M.append("X-Recaptcha-Token", T); 49737 const O = localStorage.getItem("rag-session-id"); 49738 O && M.append("X-Session-Id", O); 49739 const y = await fetch(`${e}/query-collection?${A}`, { 49740 method: "GET", 49741 headers: M 49742 }); 49743 if (!y.ok) { 49744 let z = `Request failed (${y.status})`; 49745 try { 49746 z = (await y.json())?.message ?? z; 49747 } catch { 49748 const I = await y.text(); 49749 I && (z = I); 49750 } 49751 throw new Error(z); 49752 } 49753 if (y.headers.has("X-Session-Id") && localStorage.setItem( 49754 "rag-session-id", 49755 y.headers.get("X-Session-Id") 49756 ), !y.body) throw new Error("No payload body"); 49757 const N = y.body.getReader(), H = new TextDecoder("utf-8"); 49758 let k = ""; 49759 for (; ; ) { 49760 const { value: z, done: I } = await N.read(); 49761 if (I) break; 49762 k += H.decode(z, { stream: !0 }); 49763 const j = k.split(` 49764 49765`); 49766 k = j.pop() || ""; 49767 for (const D of j) { 49768 if (D.startsWith("event: done")) { 49769 n(!1), g(0); 49770 return; 49771 } 49772 if (D.startsWith("data:")) 49773 try { 49774 const _ = JSON.parse(D.replace("data: ", "")); 49775 _?.content && o((w) => w + _.content); 49776 } catch (_) { 49777 console.error("Failed to parse SSE chunk", _, D); 49778 } 49779 } 49780 } 49781 n(!1), g(0); 49782 } catch (x) { 49783 const A = x instanceof Error && x.message ? x.message : "Something went wrong"; 49784 console.error(x), c(A), g(0), n(!1); 49785 } 49786 }, 49787 [t, e, r, m, g] 49788 ); 49789 return { response: a, loading: i, elapsed: p, error: f, ask: S }; 49790}, zr = () => { 49791 const { config: t, baseUrl: e, recaptchaSiteKey: r } = Je(); 49792 return Lt(t, e, r); 49793}, Bt = () => { 49794 const { config: t, baseUrl: e, recaptchaSiteKey: r } = Je(); 49795 return jt(t, e, r); 49796}; 49797function et(t) { 49798 const e = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); 49799 function r(o) { 49800 const i = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(e); 49801 if (i === null) 49802 throw new Error( 49803 `<${o}> must be used within <${t}>` 49804 ); 49805 return i; 49806 } 49807 function a() { 49808 return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(e); 49809 } 49810 return [e.Provider, r, a]; 49811} 49812const [tt, W] = et("Search.Root"), [Ht, Oe, rt] = et("Search.Modes"); 49813function at({ 49814 prop: t, 49815 defaultProp: e, 49816 onChange: r 49817}) { 49818 const a = t !== void 0, [o, i] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(e), n = a ? t : o, f = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(r); 49819 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 49820 f.current = r; 49821 }, [r]); 49822 const c = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(n); 49823 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 49824 c.current = n; 49825 }, [n]); 49826 const m = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)( 49827 (p) => { 49828 const g = typeof p == "function" ? p(c.current) : p; 49829 a || i(g), f.current?.(g); 49830 }, 49831 [a] 49832 ); 49833 return [n, m]; 49834} 49835var nt = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not
49835(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], ye = /* @__PURE__ */ nt.join(","), ot = typeof Element > "u", te = ot ? function() { 49836} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, ve = !ot && Element.prototype.getRootNode ? function(t) { 49837 var e; 49838 return t == null || (e = t.getRootNode) === null || e === void 0 ? void 0 : e.call(t); 49839} : function(t) { 49840 return t?.ownerDocument; 49841}, we = function(e, r) { 49842 var a; 49843 r === void 0 && (r = !0); 49844 var o = e == null || (a = e.getAttribute) === null || a === void 0 ? void 0 : a.call(e, "inert"), i = o === "" || o === "true", n = i || r && e && // closest does not exist on shadow roots, so we fall back to a manual 49845 // lookup upward, in case it is not defined. 49846 (typeof e.closest == "function" ? e.closest("[inert]") : we(e.parentNode)); 49847 return n; 49848}, qt = function(e) { 49849 var r, a = e == null || (r = e.getAttribute) === null || r === void 0 ? void 0 : r.call(e, "contenteditable"); 49850 return a === "" || a === "true"; 49851}, it = function(e, r, a) { 49852 if (we(e)) 49853 return []; 49854 var o = Array.prototype.slice.apply(e.querySelectorAll(ye)); 49855 return r && te.call(e, ye) && o.unshift(e), o = o.filter(a), o; 49856}, xe = function(e, r, a) { 49857 for (var o = [], i = Array.from(e); i.length; ) { 49858 var n = i.shift(); 49859 if (!we(n, !1)) 49860 if (n.tagName === "SLOT") { 49861 var f = n.assignedElements(), c = f.length ? f : n.children, m = xe(c, !0, a); 49862 a.flatten ? o.push.apply(o, m) : o.push({ 49863 scopeParent: n, 49864 candidates: m 49865 }); 49866 } else { 49867 var p = te.call(n, ye); 49868 p && a.filter(n) && (r || !e.includes(n)) && o.push(n); 49869 var g = n.shadowRoot || // check for an undisclosed shadow 49870 typeof a.getShadowRoot == "function" && a.getShadowRoot(n), S = !we(g, !1) && (!a.shadowRootFilter || a.shadowRootFilter(n)); 49871 if (g && S) { 49872 var b = xe(g === !0 ? n.children : g.children, !0, a); 49873 a.flatten ? o.push.apply(o, b) : o.push({ 49874 scopeParent: n, 49875 candidates: b 49876 }); 49877 } else 49878 i.unshift.apply(i, n.children); 49879 } 49880 } 49881 return o; 49882}, st = function(e) { 49883 return !isNaN(parseInt(e.getAttribute("tabindex"), 10)); 49884}, ee = function(e) { 49885 if (!e) 49886 throw new Error("No node provided"); 49887 return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || qt(e)) && !st(e) ? 0 : e.tabIndex; 49888}, Gt = function(e, r) { 49889 var a = ee(e); 49890 return a < 0 && r && !st(e) ? 0 : a; 49891}, Kt = function(e, r) { 49892 return e.tabIndex === r.tabIndex ? e.documentOrder - r.documentOrder : e.tabIndex - r.tabIndex; 49893}, lt = function(e) { 49894 return e.tagName === "INPUT"; 49895}, Vt = function(e) { 49896 return lt(e) && e.type === "hidden"; 49897}, Yt = function(e) { 49898 var r = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(a) { 49899 return a.tagName === "SUMMARY"; 49900 }); 49901 return r; 49902}, Ut = function(e, r) { 49903 for (var a = 0; a < e.length; a++) 49904 if (e[a].checked && e[a].form === r) 49905 return e[a]; 49906}, Wt = function(e) { 49907 if (!e.name) 49908 return !0; 49909 var r = e.form || ve(e), a = function(f) { 49910 return r.querySelectorAll('input[type="radio"][name="' + f + '"]'); 49911 }, o; 49912 if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function") 49913 o = a(window.CSS.escape(e.name)); 49914 else 49915 try { 49916 o = a(e.name); 49917 } catch (n) { 49918 return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", n.message), !1; 49919 } 49920 var i = Ut(o, e.form); 49921 return !i || i === e; 49922}, Xt = function(e) { 49923 return lt(e) && e.type === "radio"; 49924}, Zt = function(e) { 49925 return Xt(e) && !Wt(e); 49926}, Jt = function(e) { 49927 var r, a = e && ve(e), o = (r = a) === null || r === void 0 ? void 0 : r.host, i = !1; 49928 if (a && a !== e) { 49929 var n, f, c; 49930 for (i = !!((n = o) !== null && n !== void 0 && (f = n.ownerDocument) !== null && f !== void 0 && f.contains(o) || e != null && (c = e.ownerDocument) !== null && c !== void 0 && c.contains(e)); !i && o; ) { 49931 var m, p, g; 49932 a = ve(o), o = (m = a) === null || m === void 0 ? void 0 : m.host, i = !!((p = o) !== null && p !== void 0 && (g = p.ownerDocument) !== null && g !== void 0 && g.contains(o)); 49933 } 49934 } 49935 return i; 49936}, He = function(e) { 49937 var r = e.getBoundingClientRect(), a = r.width, o = r.height; 49938 return a === 0 && o === 0; 49939}, Qt = function(e, r) { 49940 var a = r.displayCheck, o = r.getShadowRoot; 49941 if (a === "full-native" && "checkVisibility" in e) { 49942 var i = e.checkVisibility({ 49943 // Checking opacity might be desirable for some use cases, but natively, 49944 // opacity zero elements _are_ focusable and tabbable. 49945 checkOpacity: !1, 49946 opacityProperty: !1, 49947 contentVisibilityAuto: !0, 49948 visibilityProperty: !0, 49949 // This is an alias for `visibilityProperty`. Contemporary browsers 49950 // support both. However, this alias has wider browser support (Chrome 49951 // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so 49952 // we include it anyway. 49953 checkVisibilityCSS: !0 49954 }); 49955 return !i; 49956 } 49957 if (getComputedStyle(e).visibility === "hidden") 49958 return !0; 49959 var n = te.call(e, "details>summary:first-of-type"), f = n ? e.parentElement : e; 49960 if (te.call(f, "details:not([open]) *")) 49961 return !0; 49962 if (!a || a === "full" || // full-native can run this branch when it falls through in case 49963 // Element#checkVisibility is unsupported 49964 a === "full-native" || a === "legacy-full") { 49965 if (typeof o == "function") { 49966 for (var c = e; e; ) { 49967 var m = e.parentElement, p = ve(e); 49968 if (m && !m.shadowRoot && o(m) === !0) 49969 return He(e); 49970 e.assignedSlot ? e = e.assignedSlot : !m && p !== e.ownerDocument ? e = p.host : e = m; 49971 } 49972 e = c; 49973 } 49974 if (Jt(e)) 49975 return !e.getClientRects().length; 49976 if (a !== "legacy-full") 49977 return !0; 49978 } else if (a === "non-zero-area") 49979 return He(e); 49980 return !1; 49981}, er = function(e) {
49982 if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName)) 49983 for (var r = e.parentElement; r; ) { 49984 if (r.tagName === "FIELDSET" && r.disabled) { 49985 for (var a = 0; a < r.children.length; a++) { 49986 var o = r.children.item(a); 49987 if (o.tagName === "LEGEND") 49988 return te.call(r, "fieldset[disabled] *") ? !0 : !o.contains(e); 49989 } 49990 return !0; 49991 } 49992 r = r.parentElement; 49993 } 49994 return !1; 49995}, ke = function(e, r) { 49996 return !(r.disabled || Vt(r) || Qt(r, e) || // For a details element with a summary, the summary element gets the focus 49997 Yt(r) || er(r)); 49998}, Ae = function(e, r) { 49999 return !(Zt(r) || ee(r) < 0 || !ke(e, r)); 50000}, tr = function(e) { 50001 var r = parseInt(e.getAttribute("tabindex"), 10); 50002 return !!(isNaN(r) || r >= 0); 50003}, ct = function(e) { 50004 var r = [], a = []; 50005 return e.forEach(function(o, i) { 50006 var n = !!o.scopeParent, f = n ? o.scopeParent : o, c = Gt(f, n), m = n ? ct(o.candidates) : f; 50007 c === 0 ? n ? r.push.apply(r, m) : r.push(f) : a.push({ 50008 documentOrder: i, 50009 tabIndex: c, 50010 item: o, 50011 isScope: n, 50012 content: m 50013 }); 50014 }), a.sort(Kt).reduce(function(o, i) { 50015 return i.isScope ? o.push.apply(o, i.content) : o.push(i.content), o; 50016 }, []).concat(r); 50017}, rr = function(e, r) { 50018 r = r || {}; 50019 var a; 50020 return r.getShadowRoot ? a = xe([e], r.includeContainer, { 50021 filter: Ae.bind(null, r), 50022 flatten: !1, 50023 getShadowRoot: r.getShadowRoot, 50024 shadowRootFilter: tr 50025 }) : a = it(e, r.includeContainer, Ae.bind(null, r)), ct(a); 50026}, ar = function(e, r) { 50027 r = r || {}; 50028 var a; 50029 return r.getShadowRoot ? a = xe([e], r.includeContainer, { 50030 filter: ke.bind(null, r), 50031 flatten: !0, 50032 getShadowRoot: r.getShadowRoot 50033 }) : a = it(e, r.includeContainer, ke.bind(null, r)), a; 50034}, re = function(e, r) { 50035 if (r = r || {}, !e) 50036 throw new Error("No node provided"); 50037 return te.call(e, ye) === !1 ? !1 : Ae(r, e); 50038}, nr = /* @__PURE__ */ nt.concat("iframe:not([inert]):not([inert] *)").join(","), Ne = function(e, r) { 50039 if (r = r || {}, !e) 50040 throw new Error("No node provided"); 50041 return te.call(e, nr) === !1 ? !1 : ke(r, e); 50042}; 50043function Ie(t, e) { 50044 (e == null || e > t.length) && (e = t.length); 50045 for (var r = 0, a = Array(e); r < e; r++) a[r] = t[r]; 50046 return a; 50047} 50048function or(t) { 50049 if (Array.isArray(t)) return Ie(t); 50050} 50051function qe(t, e) { 50052 var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; 50053 if (!r) { 50054 if (Array.isArray(t) || (r = ut(t)) || e) { 50055 r && (t = r); 50056 var a = 0, o = function() { 50057 }; 50058 return { 50059 s: o, 50060 n: function() { 50061 return a >= t.length ? { 50062 done: !0 50063 } : { 50064 done: !1, 50065 value: t[a++] 50066 }; 50067 }, 50068 e: function(c) { 50069 throw c; 50070 }, 50071 f: o 50072 }; 50073 } 50074 throw new TypeError(`Invalid attempt to iterate non-iterable instance. 50075In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); 50076 } 50077 var i, n = !0, f = !1; 50078 return { 50079 s: function() { 50080 r = r.call(t); 50081 }, 50082 n: function() { 50083 var c = r.next(); 50084 return n = c.done, c; 50085 }, 50086 e: function(c) { 50087 f = !0, i = c; 50088 }, 50089 f: function() { 50090 try { 50091 n || r.return == null || r.return(); 50092 } finally { 50093 if (f) throw i; 50094 } 50095 } 50096 }; 50097} 50098function ir(t, e, r) { 50099 return (e = dr(e)) in t ? Object.defineProperty(t, e, { 50100 value: r, 50101 enumerable: !0, 50102 configurable: !0, 50103 writable: !0 50104 }) : t[e] = r, t; 50105} 50106function sr(t) { 50107 if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t); 50108} 50109function lr() { 50110 throw new TypeError(`Invalid attempt to spread non-iterable instance. 50111In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); 50112} 50113function Ge(t, e) { 50114 var r = Object.keys(t); 50115 if (Object.getOwnPropertySymbols) { 50116 var a = Object.getOwnPropertySymbols(t); 50117 e && (a = a.filter(function(o) { 50118 return Object.getOwnPropertyDescriptor(t, o).enumerable; 50119 })), r.push.apply(r, a); 50120 } 50121 return r; 50122} 50123function Ke(t) { 50124 for (var e = 1; e < arguments.length; e++) { 50125 var r = arguments[e] != null ? arguments[e] : {};
50126 e % 2 ? Ge(Object(r), !0).forEach(function(a) { 50127 ir(t, a, r[a]); 50128 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Ge(Object(r)).forEach(function(a) { 50129 Object.defineProperty(t, a, Object.getOwnPropertyDescriptor(r, a)); 50130 }); 50131 } 50132 return t; 50133} 50134function cr(t) { 50135 return or(t) || sr(t) || ut(t) || lr(); 50136} 50137function ur(t, e) { 50138 if (typeof t != "object" || !t) return t; 50139 var r = t[Symbol.toPrimitive]; 50140 if (r !== void 0) { 50141 var a = r.call(t, e); 50142 if (typeof a != "object") return a; 50143 throw new TypeError("@@toPrimitive must return a primitive value."); 50144 } 50145 return (e === "string" ? String : Number)(t); 50146} 50147function dr(t) { 50148 var e = ur(t, "string"); 50149 return typeof e == "symbol" ? e : e + ""; 50150} 50151function ut(t, e) { 50152 if (t) { 50153 if (typeof t == "string") return Ie(t, e); 50154 var r = {}.toString.call(t).slice(8, -1); 50155 return r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set" ? Array.from(t) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Ie(t, e) : void 0; 50156 } 50157} 50158var X = { 50159 // Returns the trap from the top of the stack. 50160 getActiveTrap: function(e) { 50161 return e?.length > 0 ? e[e.length - 1] : null; 50162 }, 50163 // Pauses the currently active trap, then adds a new trap to the stack. 50164 activateTrap: function(e, r) { 50165 var a = X.getActiveTrap(e); 50166 r !== a && X.pauseTrap(e); 50167 var o = e.indexOf(r); 50168 o === -1 || e.splice(o, 1), e.push(r); 50169 }, 50170 // Removes the trap from the top of the stack, then unpauses the next trap down. 50171 deactivateTrap: function(e, r) { 50172 var a = e.indexOf(r); 50173 a !== -1 && e.splice(a, 1), X.unpauseTrap(e); 50174 }, 50175 // Pauses the trap at the top of the stack. 50176 pauseTrap: function(e) { 50177 var r = X.getActiveTrap(e); 50178 r?._setPausedState(!0); 50179 }, 50180 // Unpauses the trap at the top of the stack. 50181 unpauseTrap: function(e) { 50182 var r = X.getActiveTrap(e); 50183 r && !r._isManuallyPaused() && r._setPausedState(!1); 50184 } 50185}, fr = function(e) { 50186 return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function"; 50187}, pr = function(e) { 50188 return e?.key === "Escape" || e?.key === "Esc" || e?.keyCode === 27; 50189}, ne = function(e) { 50190 return e?.key === "Tab" || e?.keyCode === 9; 50191}, mr = function(e) { 50192 return ne(e) && !e.shiftKey; 50193}, gr = function(e) { 50194 return ne(e) && e.shiftKey; 50195}, Ve = function(e) { 50196 return setTimeout(e, 0); 50197}, ae = function(e) { 50198 for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++) 50199 a[o - 1] = arguments[o]; 50200 return typeof e == "function" ? e.apply(void 0, a) : e; 50201}, ie = function(e) { 50202 return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target; 50203}, hr = [], br = function(e, r) { 50204 var a = r?.document || document, o = r?.trapStack || hr, i = Ke({ 50205 returnFocusOnDeactivate: !0, 50206 escapeDeactivates: !0, 50207 delayInitialFocus: !0, 50208 isolateSubtrees: !1, 50209 isKeyForward: mr, 50210 isKeyBackward: gr 50211 }, r), n = { 50212 // containers given to createFocusTrap() 50213 /** @type {Array<HTMLElement>} */ 50214 containers: [], 50215 // list of objects identifying tabbable nodes in `containers` in the trap 50216 // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap 50217 // is active, but the trap should never get to a state where there isn't at least one group 50218 // with at least one tabbable node in it (that would lead to an error condition that would 50219 // result in an error being thrown) 50220 /** @type {Array<{ 50221 * container: HTMLElement, 50222 * tabbableNodes: Array<HTMLElement>, // empty if none 50223 * focusableNodes: Array<HTMLElement>, // empty if none 50224 * posTabIndexesFound: boolean, 50225 * firstTabbableNode: HTMLElement|undefined, 50226 * lastTabbableNode: HTMLElement|undefined, 50227 * firstDomTabbableNode: HTMLElement|undefined, 50228 * lastDomTabbableNode: HTMLElement|undefined, 50229 * nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined 50230 * }>} 50231 */ 50232 containerGroups: [], 50233 // same order/length as `containers` list 50234 // references to objects in `containerGroups`, but only those that actually have 50235 // tabbable nodes in them 50236 // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__ 50237 // the same length 50238 tabbableGroups: [], 50239 // references to nodes that are siblings to the ancestors of this trap's containers. 50240 /** @type {Set<HTMLElement>} */ 50241 adjacentElements: /* @__PURE__ */ new Set(), 50242 // references to nodes that were inert or aria-hidden before the trap was activated. 50243 /** @type {Set<HTMLElement>} */ 50244 alreadySilent: /* @__PURE__ */ new Set(), 50245 nodeFocusedBeforeActivation: null, 50246 mostRecentlyFocusedNode: null, 50247 active: !1, 50248 paused: !1, 50249 manuallyPaused: !1, 50250 // timer ID for when delayInitialFocus is true and initial focus in this trap 50251 // has been delayed during activation 50252 delayInitialFocusTimer: void 0, 50253 // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any 50254 recentNavEvent: void 0 50255 }, f, c = function(s, l, h) { 50256 return s && s[l] !== void 0 ? s[l] : i[h || l]; 50257 }, m = function(s, l) { 50258 var h = typeof l?.composedPath == "function" ? l.composedPath() : void 0; 50259 return n.containerGroups.findIndex(function(C) { 50260 var E = C.container, R = C.tabbableNodes; 50261 return E.contains(s) || h?.includes(E) || R.find(function(v) { 50262 return v === s; 50263 }); 50264 }); 50265 }, p = function(s) { 50266 var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = l.hasFallback, C = h === void 0 ? !1 : h, E = l.params, R = E === void 0 ? [] : E, v = i[s]; 50267 if (typeof v == "function" && (v = v.apply(void 0, cr(R))), v === !0 && (v = void 0), !v) { 50268 if (v === void 0 || v === !1) 50269 return v; 50270 throw new Error("`".concat(s, "` was specified but was not a node, or did not return a node")); 50271 } 50272 var d = v; 50273 if (typeof v == "string") {
50274 try { 50275 d = a.querySelector(v); 50276 } catch (F) { 50277 throw new Error("`".concat(s, '` appears to be an invalid selector; error="').concat(F.message, '"')); 50278 } 50279 if (!d && !C) 50280 throw new Error("`".concat(s, "` as selector refers to no known node")); 50281 } 50282 return d; 50283 }, g = function() { 50284 var s = p("initialFocus", { 50285 hasFallback: !0 50286 }); 50287 if (s === !1) 50288 return !1; 50289 if (s === void 0 || s && !Ne(s, i.tabbableOptions)) 50290 if (m(a.activeElement) >= 0) 50291 s = a.activeElement; 50292 else { 50293 var l = n.tabbableGroups[0], h = l && l.firstTabbableNode; 50294 s = h || p("fallbackFocus"); 50295 } 50296 else s === null && (s = p("fallbackFocus")); 50297 if (!s) 50298 throw new Error("Your focus-trap needs to have at least one focusable element"); 50299 return s; 50300 }, S = function() { 50301 if (n.containerGroups = n.containers.map(function(s) { 50302 var l = rr(s, i.tabbableOptions), h = ar(s, i.tabbableOptions), C = l.length > 0 ? l[0] : void 0, E = l.length > 0 ? l[l.length - 1] : void 0, R = h.find(function(F) { 50303 return re(F); 50304 }), v = h.slice().reverse().find(function(F) { 50305 return re(F); 50306 }), d = !!l.find(function(F) { 50307 return ee(F) > 0; 50308 }); 50309 return { 50310 container: s, 50311 tabbableNodes: l, 50312 focusableNodes: h, 50313 /** True if at least one node with positive `tabindex` was found in this container. */ 50314 posTabIndexesFound: d, 50315 /** First tabbable node in container, __tabindex__ order; `undefined` if none. */ 50316 firstTabbableNode: C, 50317 /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */ 50318 lastTabbableNode: E, 50319 // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out 50320 // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition 50321 // because that API doesn't work with Shadow DOM as well as it should (@see 50322 // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
50323 // to address an edge case related to positive tabindex support, this seems like a much easier, 50324 // "close enough most of the time" alternative for positive tabindexes which should generally 50325 // be avoided anyway... 50326 /** First tabbable node in container, __DOM__ order; `undefined` if none. */ 50327 firstDomTabbableNode: R, 50328 /** Last tabbable node in container, __DOM__ order; `undefined` if none. */ 50329 lastDomTabbableNode: v, 50330 /** 50331 * Finds the __tabbable__ node that follows the given node in the specified direction, 50332 * in this container, if any. 50333 * @param {HTMLElement} node 50334 * @param {boolean} [forward] True if going in forward tab order; false if going 50335 * in reverse. 50336 * @returns {HTMLElement|undefined} The next tabbable node, if any. 50337 */ 50338 nextTabbableNode: function(L) { 50339 var V = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, U = l.indexOf(L); 50340 return U < 0 ? V ? h.slice(h.indexOf(L) + 1).find(function(Q) { 50341 return re(Q); 50342 }) : h.slice(0, h.indexOf(L)).reverse().find(function(Q) { 50343 return re(Q); 50344 }) : l[U + (V ? 1 : -1)]; 50345 } 50346 }; 50347 }), n.tabbableGroups = n.containerGroups.filter(function(s) { 50348 return s.tabbableNodes.length > 0; 50349 }), n.tabbableGroups.length <= 0 && !p("fallbackFocus")) 50350 throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times"); 50351 if (n.containerGroups.find(function(s) { 50352 return s.posTabIndexesFound; 50353 }) && n.containerGroups.length > 1) 50354 throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps."); 50355 }, b = function(s) { 50356 var l = s.activeElement; 50357 if (l) 50358 return l.shadowRoot && l.shadowRoot.activeElement !== null ? b(l.shadowRoot) : l; 50359 }, P = function(s) { 50360 if (s !== !1 && s !== b(document)) { 50361 if (!s || !s.focus) { 50362 P(g()); 50363 return; 50364 } 50365 s.focus({ 50366 preventScroll: !!i.preventScroll 50367 }), n.mostRecentlyFocusedNode = s, fr(s) && s.select(); 50368 } 50369 }, T = function(s) { 50370 var l = p("setReturnFocus", { 50371 params: [s] 50372 }); 50373 return l || (l === !1 ? !1 : s); 50374 }, x = function(s) { 50375 var l = s.target, h = s.event, C = s.isBackward, E = C === void 0 ? !1 : C; 50376 l = l || ie(h), S(); 50377 var R = null; 50378 if (n.tabbableGroups.length > 0) { 50379 var v = m(l, h), d = v >= 0 ? n.containerGroups[v] : void 0; 50380 if (v < 0) 50381 E ? R = n.tabbableGroups[n.tabbableGroups.length - 1].lastTabbableNode : R = n.tabbableGroups[0].firstTabbableNode; 50382 else if (E) { 50383 var F = n.tabbableGroups.findIndex(function(Se) { 50384 var Ee = Se.firstTabbableNode; 50385 return l === Ee; 50386 }); 50387 if (F < 0 && (d.container === l || Ne(l, i.tabbableOptions) && !re(l, i.tabbableOptions) && !d.nextTabbableNode(l, !1)) && (F = v), F >= 0) { 50388 var L = F === 0 ? n.tabbableGroups.length - 1 : F - 1, V = n.tabbableGroups[L]; 50389 R = ee(l) >= 0 ? V.lastTabbableNode : V.lastDomTabbableNode; 50390 } else ne(h) || (R = d.nextTabbableNode(l, !1)); 50391 } else { 50392 var U = n.tabbableGroups.findIndex(function(Se) { 50393 var Ee = Se.lastTabbableNode; 50394 return l === Ee; 50395 }); 50396 if (U < 0 && (d.container === l || Ne(l, i.tabbableOptions) && !re(l, i.tabbableOptions) && !d.nextTabbableNode(l)) && (U = v), U >= 0) { 50397 var Q = U === n.tabbableGroups.length - 1 ? 0 : U + 1, J = n.tabbableGroups[Q]; 50398 R = ee(l) >= 0 ? J.firstTabbableNode : J.firstDomTabbableNode; 50399 } else ne(h) || (R = d.nextTabbableNode(l)); 50400 } 50401 } else 50402 R = p("fallbackFocus"); 50403 return R; 50404 }, A = function(s) { 50405 var l = ie(s); 50406 if (!(m(l, s) >= 0)) { 50407 if (ae(i.clickOutsideDeactivates, s)) { 50408 f.deactivate({ 50409 // NOTE: by setting `returnFocus: false`, deactivate() will do nothing, 50410 // which will result in the outside click setting focus to the node 50411 // that was clicked (and if not focusable, to "nothing"); by setting 50412 // `returnFocus: true`, we'll attempt to re-focus the node originally-focused 50413 // on activation (or the configured `setReturnFocus` node), whether the 50414 // outside click was on a focusable node or not 50415 returnFocus: i.returnFocusOnDeactivate 50416 }); 50417 return; 50418 } 50419 ae(i.allowOutsideClick, s) || s.preventDefault(); 50420 } 50421 }, M = function(s) { 50422 var l = ie(s), h = m(l, s) >= 0; 50423 if (h || l instanceof Document) 50424 h && (n.mostRecentlyFocusedNode = l); 50425 else { 50426 s.stopImmediatePropagation(); 50427 var C, E = !0; 50428 if (n.mostRecentlyFocusedNode) 50429 if (ee(n.mostRecentlyFocusedNode) > 0) { 50430 var R = m(n.mostRecentlyFocusedNode), v = n.containerGroups[R].tabbableNodes; 50431 if (v.length > 0) { 50432 var d = v.findIndex(function(F) { 50433 return F === n.mostRecentlyFocusedNode; 50434 }); 50435 d >= 0 && (i.isKeyForward(n.recentNavEvent) ? d + 1 < v.length && (C = v[d + 1], E = !1) : d - 1 >= 0 && (C = v[d - 1], E = !1)); 50436 } 50437 } else 50438 n.containerGroups.some(function(F) { 50439 return F.tabbableNodes.some(function(L) { 50440 return ee(L) > 0; 50441 }); 50442 }) || (E = !1); 50443 else 50444 E = !1; 50445 E && (C = x({ 50446 // move FROM the MRU node, not event-related node (which will be the node that is 50447 // outside the trap causing the focus escape we're trying to fix) 50448 target: n.mostRecentlyFocusedNode, 50449 isBackward: i.isKeyBackward(n.recentNavEvent) 50450 })), P(C || n.mostRecentlyFocusedNode || g()); 50451 } 50452 n.recentNavEvent = void 0; 50453 }, O = function(s) { 50454 var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; 50455 n.recentNavEvent = s; 50456 var h = x({ 50457 event: s, 50458 isBackward: l 50459 }); 50460 h && (ne(s) && s.preventDefault(), P(h)); 50461 }, y = function(s) { 50462 (i.isKeyForward(s) || i.isKeyBackward(s)) && O(s, i.isKeyBackward(s)); 50463 }, N = function(s) { 50464 pr(s) && ae(i.escapeDeactivates, s) !== !1 && (s.preventDefault(), f.deactivate()); 50465 }, H = function(s) { 50466 var l = ie(s); 50467 m(l, s) >= 0 || ae(i.clickOutsideDeactivates, s) || ae(i.allowOutsideClick, s) || (s.preventDefault(), s.stopImmediatePropagation()); 50468 }, k = function() { 50469 if (n.active) 50470 return X.activateTrap(o, f), n.delayInitialFocusTimer = i.delayInitialFocus ? Ve(function() { 50471 P(g()); 50472 }) : P(g()), a.addEventListener("focusin", M, !0), a.addEventListener("mousedown", A, { 50473 capture: !0, 50474 passive: !1 50475 }), a.addEventListener("touchstart", A, { 50476 capture: !0, 50477 passive: !1 50478 }), a.addEventListener("click", H, { 50479 capture: !0, 50480 passive: !1 50481 }), a.addEventListener("keydown", y, { 50482 capture: !0, 50483 passive: !1 50484 }), a.addEventListener("keydown", N), f; 50485 }, z = function(s) { 50486 n.active && !n.paused && f._setSubtreeIsolation(!1), n.adjacentElements.clear(), n.alreadySilent.clear(); 50487 var l = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), C = qe(s), E; 50488 try { 50489 for (C.s();
50489 !(E = C.n()).done; ) { 50490 var R = E.value; 50491 l.add(R); 50492 for (var v = typeof ShadowRoot < "u" && R.getRootNode() instanceof ShadowRoot, d = R; d; ) { 50493 l.add(d); 50494 var F = d.parentElement, L = []; 50495 F ? L = F.children : !F && v && (L = d.getRootNode().children, F = d.getRootNode().host, v = typeof ShadowRoot < "u" && F.getRootNode() instanceof ShadowRoot); 50496 var V = qe(L), U; 50497 try { 50498 for (V.s(); !(U = V.n()).done; ) { 50499 var Q = U.value; 50500 h.add(Q); 50501 } 50502 } catch (J) { 50503 V.e(J); 50504 } finally { 50505 V.f(); 50506 } 50507 d = F; 50508 } 50509 } 50510 } catch (J) { 50511 C.e(J); 50512 } finally { 50513 C.f(); 50514 } 50515 l.forEach(function(J) { 50516 h.delete(J); 50517 }), n.adjacentElements = h; 50518 }, I = function() { 50519 if (n.active) 50520 return a.removeEventListener("focusin", M, !0), a.removeEventListener("mousedown", A, !0), a.removeEventListener("touchstart", A, !0), a.removeEventListener("click", H, !0), a.removeEventListener("keydown", y, !0), a.removeEventListener("keydown", N), f; 50521 }, j = function(s) { 50522 var l = s.some(function(h) { 50523 var C = Array.from(h.removedNodes); 50524 return C.some(function(E) { 50525 return E === n.mostRecentlyFocusedNode; 50526 }); 50527 }); 50528 l && P(g()); 50529 }, D = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(j) : void 0, _ = function() { 50530 D && (D.disconnect(), n.active && !n.paused && n.containers.map(function(s) { 50531 D.observe(s, { 50532 subtree: !0, 50533 childList: !0 50534 }); 50535 })); 50536 }; 50537 return f = { 50538 get active() { 50539 return n.active; 50540 }, 50541 get paused() { 50542 return n.paused; 50543 }, 50544 activate: function(s) { 50545 if (n.active) 50546 return this; 50547 var l = c(s, "onActivate"), h = c(s, "onPostActivate"), C = c(s, "checkCanFocusTrap"), E = X.getActiveTrap(o), R = !1; 50548 if (E && !E.paused) { 50549 var v; 50550 (v = E._setSubtreeIsolation) === null || v === void 0 || v.call(E, !1), R = !0; 50551 } 50552 try { 50553 C || S(), n.active = !0, n.paused = !1, n.nodeFocusedBeforeActivation = b(a), l?.(); 50554 var d = function() { 50555 C && S(), k(), _(), i.isolateSubtrees && f._setSubtreeIsolation(!0), h?.(); 50556 }; 50557 if (C) 50558 return C(n.containers.concat()).then(d, d), this; 50559 d(); 50560 } catch (L) { 50561 if (E === X.getActiveTrap(o) && R) { 50562 var F; 50563 (F = E._setSubtreeIsolation) === null || F === void 0 || F.call(E, !0); 50564 } 50565 throw L; 50566 } 50567 return this; 50568 }, 50569 deactivate: function(s) { 50570 if (!n.active) 50571 return this; 50572 var l = Ke({ 50573 onDeactivate: i.onDeactivate, 50574 onPostDeactivate: i.onPostDeactivate, 50575 checkCanReturnFocus: i.checkCanReturnFocus 50576 }, s); 50577 clearTimeout(n.delayInitialFocusTimer), n.delayInitialFocusTimer = void 0, n.paused || f._setSubtreeIsolation(!1), n.alreadySilent.clear(), I(), n.active = !1, n.paused = !1, _(), X.deactivateTrap(o, f); 50578 var h = c(l, "onDeactivate"), C = c(l, "onPostDeactivate"), E = c(l, "checkCanReturnFocus"), R = c(l, "returnFocus", "returnFocusOnDeactivate"); 50579 h?.(); 50580 var v = function() { 50581 Ve(function() { 50582 R && P(T(n.nodeFocusedBeforeActivation)), C?.(); 50583 }); 50584 }; 50585 return R && E ? (E(T(n.nodeFocusedBeforeActivation)).then(v, v), this) : (v(), this); 50586 }, 50587 pause: function(s) { 50588 return n.active ? (n.manuallyPaused = !0, this._setPausedState(!0, s)) : this; 50589 }, 50590 unpause: function(s) { 50591 return n.active ? (n.manuallyPaused = !1, o[o.length - 1] !== this ? this : this._setPausedState(!1, s)) : this; 50592 }, 50593 updateContainerElements: function(s) { 50594 var l = [].concat(s).filter(Boolean); 50595 return n.containers = l.map(function(h) { 50596 return typeof h == "string" ? a.querySelector(h) : h; 50597 }), i.isolateSubtrees && z(n.containers), n.active && (S(), i.isolateSubtrees && !n.paused && f._setSubtreeIsolation(!0)), _(), this; 50598 } 50599 }, Object.defineProperties(f, { 50600 _isManuallyPaused: { 50601 value: function() { 50602 return n.manuallyPaused; 50603 } 50604 }, 50605 _setPausedState: { 50606 value: function(s, l) { 50607 if (n.paused === s) 50608 return this; 50609 if (n.paused = s, s) { 50610 var h = c(l, "onPause"), C = c(l, "onPostPause"); 50611 h?.(), I(), _(), f._setSubtreeIsolation(!1), C?.(); 50612 } else { 50613 var E = c(l, "onUnpause"), R = c(l, "onPostUnpause"); 50614 E?.(), f._setSubtreeIsolation(!0), S(), k(), _(), R?.(); 50615 } 50616 return this; 50617 } 50618 }, 50619 _setSubtreeIsolation: { 50620 value: function(s) {
50621 i.isolateSubtrees && n.adjacentElements.forEach(function(l) { 50622 var h; 50623 s ? i.isolateSubtrees === "aria-hidden" ? ((l.ariaHidden === "true" || ((h = l.getAttribute("aria-hidden")) === null || h === void 0 ? void 0 : h.toLowerCase()) === "true") && n.alreadySilent.add(l), l.setAttribute("aria-hidden", "true")) : ((l.inert || l.hasAttribute("inert")) && n.alreadySilent.add(l), l.setAttribute("inert", !0)) : n.alreadySilent.has(l) || (i.isolateSubtrees === "aria-hidden" ? l.removeAttribute("aria-hidden") : l.removeAttribute("inert")); 50624 }); 50625 } 50626 } 50627 }), f.updateContainerElements(e), f; 50628}; 50629function yr(t, e) { 50630 const r = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), a = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), o = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), i = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(t), n = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(e); 50631 return (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 50632 i.current = t; 50633 }, [t]), (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 50634 n.current = e; 50635 }, [e]), (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 50636 if (!e || !r.current) return; 50637 a.current = document.activeElement; 50638 const f = br(r.current, { 50639 fallbackFocus: r.current, 50640 initialFocus: () => r.current?.querySelector("textarea") ?? r.current, 50641 escapeDeactivates: !0, 50642 allowOutsideClick: !0, 50643 clickOutsideDeactivates: (c) => !!!c.target.closest("[data-insytful-toggle]"), 50644 onDeactivate: () => { 50645 n.current && i.current(!1); 50646 }, 50647 returnFocusOnDeactivate: !1 50648 }); 50649 return o.current = f, f.activate(), () => { 50650 f.deactivate(), o.current = null, a.current?.focus(); 50651 }; 50652 }, [e]), { elModalRef: r }; 50653} 50654const vr = (t, e = !1) => { 50655 const r = window.fetch; 50656 return window.fetch = async (a, o) => { 50657 if ((typeof a == "string" ? a : a.toString()).startsWith(t)) { 50658 const n = [ 50659 `# Heading 1 50660 50661`, 50662 "Second-level", 50663 " heading", 50664 " paragraph", 50665 " text", 50666 " under", 50667 " H1.", 50668 ` 50669 50670`, 50671 `# Heading 2 50672 50673`, 50674 "Second-level", 50675 " heading", 50676 " paragraph", 50677 " text", 50678 " under", 50679 " H2.", 50680 ` 50681 50682`, 50683 `## Heading 3 50684 50685`, 50686 "Some", 50687 " more", 50688 " paragraph", 50689 " text", 50690 " under", 50691 " H3.", 50692 ` 50693 50694`, 50695 `### Heading 4 50696 50697`, 50698 "Example", 50699 " paragraph", 50700 " for", 50701 " H4.", 50702 ` 50703 50704`, 50705 `#### Heading 5 50706 50707`, 50708 "Example", 50709 " paragraph", 50710 " for", 50711 " H5.", 50712 ` 50713 50714`, 50715 `##### Heading 6 50716 50717`, 50718 "Example", 50719 " paragraph", 50720 " for", 50721 " H6.", 50722 ` 50723 50724`, 50725 "Regular", 50726 " paragraph", 50727 " text", 50728 " with", 50729 " some", 50730 " inline", 50731 " `code`", 50732 " and", 50733 " a", 50734 " [link](https://example.com).", 50735 ` 50736 50737`, 50738 "> This", 50739 " is", 50740 " a", 50741 " blockquote", 50742 " example.", 50743 ` 50744 50745`, 50746 "- First", 50747 " unordered", 50748 " list", 50749 ` item 50750`, 50751 "- Second", 50752 " unordered", 50753 " list", 50754 ` item 50755`, 50756 "- Third", 50757 " unordered", 50758 " list", 50759 ` item 50760 50761`, 50762 "1. First", 50763 " ordered", 50764 " list", 50765 ` item 50766`, 50767 "2. Second", 50768 " ordered", 50769 " list", 50770 ` item 50771`, 50772 "3. Third", 50773 " ordered", 50774 " list", 50775 ` item 50776 50777`, 50778 "```javascript\n", 50779 `console.log("Hello, AI Search!"); 50780`, 50781 "```\n\n", 50782 "End", 50783 " of", 50784 " mock", 50785 " response.", 50786 ` 50787` 50788 ], f = new ReadableStream({ 50789 async start(c) { 50790 const m = new TextEncoder(); 50791 e && await new Promise((p) => setTimeout(p, 8e3)); 50792 for (const p of n) { 50793 const g = `data: ${JSON.stringify({ content: p })} 50794 50795`; 50796 c.enqueue(m.encode(g)), await new Promise((S) => setTimeout(S, 30)); 50797 } 50798 c.enqueue(m.encode(`event: done 50799data: {} 50800 50801`)), c.close(); 50802 } 50803 }); 50804 return new Response(f, { 50805 status: 200, 50806 headers: { "Content-Type": "text/event-stream" } 50807 }); 50808 } 50809 return r(a, o); 50810 }, () => { 50811 window.fetch = r; 50812 }; 50813}, wr = (t = !1, e) => { 50814 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 50815 if (t) 50816 return vr(e, t); 50817 }, [t, e]); 50818}, xr = `*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;
50818--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}
50818input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-\\[-2px\\]{left:-2px;right:-2px}.-bottom-\\[10px\\]{bottom:-10px}.bottom-0{bottom:0}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-1{left:.25rem}.left-1\\/2{left:50%}.left-\\[16px\\]{left:16px}.right-0{right:0}.right-6{right:1.5rem}.right-\\[8px\\]{right:8px}.top-0{top:0}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-\\[14px\\]{top:14px}.top-\\[18px\\]{top:18px}.top-\\[2px\\]{top:2px}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-\\[1000\\]{z-index:1000}.float-left{float:left}.m-0{margin:0}.mx-auto{margin-left:auto;margin-right:auto}.mb-3{margin-bottom:.75rem}.mr-\\[12px\\]{margin-right:12px}.mt-2{margin-top:.5rem}.mt-6{margin-top:1.5rem}.mt-\\[8px\\]{margin-top:8px}.mt-auto{margin-top:auto}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.h-14{height:3.5rem}.h-8{height:2rem}.h-\\[40px\\]{height:40px}.h-\\[42px\\]{height:42px}.h-\\[88px\\]{height:88px}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.max-h-\\[240px\\]{max-height:240px}.min-h-0{min-height:0px}.min-h-\\[48px\\]{min-height:48px}.min-h-\\[500px\\]{min-height:500px}.min-h-\\[62px\\]{min-height:62px}.min-h-screen{min-height:100vh}.w-14{width:3.5rem}.w-8{width:2rem}.w-\\[40px\\]{width:40px}.w-\\[42px\\]{width:42px}.w-\\[70\\%\\]{width:70%}.w-\\[90\\%\\]{width:90%}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\\[42px\\]{min-width:42px}.max-w-\\[1920px\\]{max-width:1920px}.max-w-\\[784px\\]{max-width:784px}.max-w-\\[var\\(--insytful-modal-max-width\\)\\]{max-width:var(--insytful-modal-max-width)}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-x-1{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes skeleton-shimmer{0%{background-position:-200% 0}to{background-position:300% 0}}.animate-skeleton-shimmer{animation:skeleton-shimmer 1.5s ease-in-out infinite}@keyframes slide-to-bounce-animate{0%,40%{transform:translateY(0)}50%{transform:translateY(8px)}60%{transform:translateY(-2px)}70%,to{transform:translateY(0)}}.animate-slide-to-bounce-animate{animation:slide-to-bounce-animate 2s ease-in-out infinite}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}
50818.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\\[10px\\]{gap:10px}.gap-\\[12px\\]{gap:12px}.gap-\\[16px\\]{gap:16px}.gap-\\[24px\\]{gap:24px}.gap-\\[2px\\]{gap:2px}.gap-\\[32px\\]{gap:32px}.gap-\\[8px\\]{gap:8px}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.self-stretch{align-self:stretch}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-\\[12px\\]{border-radius:12px}.rounded-\\[16px\\]{border-radius:16px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.rounded-\\[var\\(--insytful-btn-prompt-radius\\)\\]{border-radius:var(--insytful-btn-prompt-radius)}.rounded-\\[var\\(--insytful-callout-error-cta-border-radius\\)\\]{border-radius:var(--insytful-callout-error-cta-border-radius)}.rounded-\\[var\\(--insytful-input-card-radius\\)\\]{border-radius:var(--insytful-input-card-radius)}.rounded-full{border-radius:9999px}
50818.rounded-none{border-radius:0}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l-\\[4px\\]{border-left-width:4px}.border-none{border-style:none}.border-\\[\\#acbeef\\]{--tw-border-opacity: 1;border-color:rgb(172 190 239 / var(--tw-border-opacity, 1))}.border-\\[var\\(--insytful-callout-error-border\\)\\]{border-color:var(--insytful-callout-error-border)}.border-\\[var\\(--insytful-input-card-border\\)\\]{border-color:var(--insytful-input-card-border)}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.bg-\\[\\#5128c3\\]{--tw-bg-opacity: 1;background-color:rgb(81 40 195 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F2EFF8\\]{--tw-bg-opacity: 1;background-color:rgb(242 239 248 / var(--tw-bg-opacity, 1))}.bg-\\[var\\(--insytful-btn-icon-search-bg-default\\)\\]{background-color:var(--insytful-btn-icon-search-bg-default)}.bg-\\[var\\(--insytful-btn-prompt-bg-default\\)\\]{background-color:var(--insytful-btn-prompt-bg-default)}.bg-\\[var\\(--insytful-callout-error-bg\\)\\]{background-color:var(--insytful-callout-error-bg)}.bg-\\[var\\(--insytful-callout-error-cta-bg\\)\\]{background-color:var(--insytful-callout-error-cta-bg)}.bg-\\[var\\(--insytful-input-card-bg\\)\\]{background-color:var(--insytful-input-card-bg)}.bg-\\[var\\(--insytful-modal-bg\\)\\]{background-color:var(--insytful-modal-bg)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-\\[var\\(--insytful-semantic-search-field-ai-gradient-start\\)\\]{--tw-gradient-from: var(--insytful-semantic-search-field-ai-gradient-start) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-\\[var\\(--insytful-semantic-search-field-ai-gradient-end\\)\\]{--tw-gradient-to: var(--insytful-semantic-search-field-ai-gradient-end) var(--tw-gradient-to-position)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[16px\\]{padding:16px}.p-\\[4px\\]{padding:4px}.p-\\[8px\\]{padding:8px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.px-\\[8px\\]{padding-left:8px;padding-right:8px}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-\\[12px\\]{padding-top:12px;padding-bottom:12px}.py-\\[16px\\]{padding-top:16px;padding-bottom:16px}.py-\\[4px\\]{padding-top:4px;padding-bottom:4px}.py-\\[8px\\]{padding-top:8px;padding-bottom:8px}.pb-0{padding-bottom:0}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-6{padding-bottom:1.5rem}.pb-\\[12px\\]{padding-bottom:12px}.pb-\\[24px\\]{padding-bottom:24px}.pl-6{padding-left:1.5rem}.pl-\\[32px\\]{padding-left:32px}.pl-\\[48px\\]{padding-left:48px}.pr-\\[48px\\]{padding-right:48px}.pr-\\[64px\\]{padding-right:64px}.pt-1{padding-top:.25rem}.pt-3{padding-top:.75rem}.pt-\\[12px\\]{padding-top:12px}.pt-\\[32px\\]{padding-top:32px}.text-left{text-align:left}.text-center{text-align:center}.font-\\[\\'Inter\\'\\,sans-serif\\]{font-family:Inter,sans-serif}.font-\\[\\'Source_Sans_3\\'\\,sans-serif\\]{font-family:"Source Sans 3",sans-serif}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[16px\\]{font-size:16px}.text-\\[1em\\]{font-size:1em}.text-\\[24px\\]{font-size:24px}.text-\\[44px\\]{font-size:44px}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-6{line-height:1.5rem}.leading-\\[24px\\]{line-height:24px}.leading-\\[2\\]{line-height:2}.leading-\\[32px\\]{line-height:32px}.leading-\\[52px\\]{line-height:52px}.tracking-\\[-0\\.54px\\]{letter-spacing:-.54px}.tracking-\\[-1\\.32px\\]{letter-spacing:-1.32px}.text-\\[\\#222\\]{--tw-text-opacity: 1;color:rgb(34 34 34 / var(--tw-text-opacity, 1))}.text-\\[\\#333\\]{--tw-text-opacity: 1;color:rgb(51 51 51 / var(--tw-text-opacity, 1))}
50818.text-\\[\\#6b6b6b\\]{--tw-text-opacity: 1;color:rgb(107 107 107 / var(--tw-text-opacity, 1))}.text-\\[var\\(--insytful-btn-prompt-text\\)\\]{color:var(--insytful-btn-prompt-text)}.text-\\[var\\(--insytful-callout-error-cta-text\\)\\]{color:var(--insytful-callout-error-cta-text)}.text-\\[var\\(--insytful-callout-error-text\\)\\]{color:var(--insytful-callout-error-text)}.text-\\[var\\(--insytful-disclaimer-text\\)\\]{color:var(--insytful-disclaimer-text)}.text-\\[var\\(--insytful-text-default\\)\\]{color:var(--insytful-text-default)}.text-\\[var\\(--insytful-typing-indicator-text\\)\\]{color:var(--insytful-typing-indicator-text)}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.underline-offset-2{text-underline-offset:2px}.opacity-50{opacity:.5}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
50818--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_2px_8px_0_rgba\\(0\\,0\\,0\\,0\\.15\\)\\]{--tw-shadow: 0 2px 8px 0 rgba(0,0,0,.15);--tw-shadow-colored: 0 2px 8px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_12px_24px_rgba\\(0\\,0\\,0\\,0\\.2\\)\\]{--tw-shadow: 0px 12px 24px rgba(0,0,0,.2);--tw-shadow-colored: 0px 12px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_24px_32px_0px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow: 0px 24px 32px 0px rgba(0,0,0,.08);--tw-shadow-colored: 0px 24px 32px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
50818--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-\\[14px\\]{--tw-blur: blur(14px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\\[-webkit-mask-image\\:linear-gradient\\(to_bottom\\,black_0\\%\\,black_90\\%\\,rgba\\(0\\,0\\,0\\,0\\.3\\)_100\\%\\)\\]{-webkit-mask-image:linear-gradient(to bottom,black 0%,black 90%,rgba(0,0,0,.3) 100%)}.\\[a-zA-Z\\:_\\]{a-z-a--z:}.\\[mask-image\\:linear-gradient\\(to_bottom\\,black_0\\%\\,black_90\\%\\,rgba\\(0\\,0\\,0\\,0\\.3\\)_100\\%\\)\\]{-webkit-mask-image:linear-gradient(to bottom,black 0%,black 90%,rgba(0,0,0,.3) 100%);mask-image:linear-gradient(to bottom,#000 0% 90%,#0000004d)}:host,:root,.insytful-root{font-size:var(--insytful-base-font-size, 1rem);line-height:1.5;font-family:var(--insytful-font-family);--insytful-font-family: system-ui, -apple-system, sans-serif;--insytful-text-default: #333333;--insytful-text-muted: #6c6c6c;--insytful-text-link-default: #1d70b8;--insytful-text-link-hover: #184b76;--insytful-brand-primary: #195491;--insytful-modal-bg: #ffffff;--insytful-modal-max-width: 784px;--insytful-modal-radius: 0px;--insytful-widget-width: 380px;--insytful-widget-height: 600px;--insytful-widget-inset-bottom: 24px;--insytful-widget-inset-right: 24px;--insytful-widget-radius: 16px;--insytful-widget-shadow: 0px 12px 40px rgba(0, 0, 0, .16);--insytful-btn-prompt-bg-default: #e2eefa;--insytful-btn-prompt-bg-hover: #c8daec;--insytful-btn-prompt-text: #333333;--insytful-btn-prompt-radius: 12px;--insytful-btn-prompt-focus: var(--insytful-semantic-focus-ring);--insytful-input-card-bg: #ffffff;--insytful-input-card-radius: 16px;--insytful-input-card-border: var(--insytful-semantic-search-field-stroke);--insytful-input-card-border-width: 1px;--insytful-btn-icon-search-bg-default: #2e3339;--insytful-btn-icon-search-bg-hover: #3c444d;--insytful-btn-icon-search-bg-disabled: #e7e7e7;--insytful-btn-icon-search-icon: #ffffff;--insytful-btn-close-bg: transparent;--insytful-btn-close-bg-hover: #f2f2f2;--insytful-btn-close-icon: var(--insytful-text-default);--insytful-btn-close-size: 40px;--insytful-typing-indicator-text: var(--insytful-text-muted);--insytful-disclaimer-text: var(--insytful-text-muted);--insytful-skeleton-bg: #e8e8e8;--insytful-skeleton-shimmer: linear-gradient(90deg, transparent, rgba(255, 255, 255, .4), transparent);--insytful-callout-error-border: #d93025;--insytful-callout-error-bg: #fce8e6;--insytful-callout-error-text: #333333;--insytful-callout-error-cta-bg: #2e3339;--insytful-callout-error-cta-text: #ffffff;--insytful-callout-error-cta-border-radius: 4px;--insytful-semantic-search-field-stroke: #333333;--insytful-semantic-search-field-ai-gradient-start: #35d2c5;--insytful-semantic-search-field-ai-gradient-end: #1d70b8;--insytful-semantic-search-field-focus: #35d2c5;--insytful-semantic-focus-ring: var(--insytful-semantic-search-field-focus);--insytful-semantic-focus-ring-width: 3px;--insytful-semantic-focus-ring-offset: 4px;--insytful-search-transition-duration: .2s;--insytful-search-transition-easing: ease;--insytful-search-transition-duration-dev: 5s}.insytful-search-close{position:absolute;top:12px;right:12px;width:var(--insytful-btn-close-size);height:var(--insytful-btn-close-size);display:flex;align-items:center;justify-content:center;background:var(--insytful-btn-close-bg);color:var(--insytful-btn-close-icon);border:none;border-radius:9999px;cursor:pointer;padding:0;z-index:10}.insytful-search-close:hover{background:var(--insytful-btn-close-bg-hover)}.insytful-search-close:focus{outline:var(--insytful-semantic-focus-ring-width, 3px) solid var(--insytful-semantic-focus-ring);outline-offset:var(--insytful-semantic-focus-ring-offset, 4px)}.insytful-search-close svg{width:20px;height:20px;stroke:currentColor;fill:none}.insytful-search-dialog-outer:has(.insytful-search-close) .insytful-search-dialog-inner{padding-top:60px}.insytful-search-dialog-outer[data-insytful-variant=widget]{width:var(--insytful-widget-width);height:var(--insytful-widget-height);max-height:calc(100vh - (var(--insytful-widget-inset-bottom) * 2));bottom:var(--insytful-widget-inset-bottom);right:var(--insytful-widget-inset-right);border-radius:var(--insytful-widget-radius);box-shadow:var(--insytful-widget-shadow);transform:translateY(12px) scale(.98);transform-origin:bottom right}.insytful-search-dialog-outer[data-insytful-variant=widget].insytful-search-dialog-open{transform:translateY(0) scale(1)}.insytful-search-dialog-outer[data-insytful-variant=widget] .insytful-search-empty-state-title{font-size:24px;line-height:32px}.insytful-search-dialog-outer[data-insytful-variant=widget] .insytful-search-empty-state-text{font-size:14px;line-height:24px}.insytful-search-dialog-outer[data-insytful-variant=widget] .insytful-search-suggestions-item-btn{padding:8px;font-size:14px}.insytful-search-dialog-outer[data-insytful-variant=widget] .insytful-search-message-content-outer{font-size:1em}.insytful-search-dialog-outer[data-insytful-variant=widget] .insytful-search-message-content-inner{display:flex;gap:12px}.insytful-search-dialog-outer[data-insytful-variant=widget] .insytful-search-message-logo-aside{display:none}.insytful-search-dialog-outer[data-insytful-variant=widget] .insytful-search-message-logo-inline{display:block}.insytful-search-message-input-textarea:focus{outline:var(--insytful-semantic-focus-ring-width, 3px) solid var(--insytful-semantic-focus-ring);outline-offset:var(--insytful-semantic-focus-ring-offset, 4px)}.insytful-search-message-input:has(.insytful-search-message-input-bg) .insytful-search-message-input-textarea:focus{outline:none}.insytful-search-message-input:has(.insytful-search-message-input-textarea:focus) .insytful-search-message-input-bg{outline:var(--insytful-semantic-focus-ring-width, 3px) solid var(--insytful-semantic-focus-ring);outline-offset:var(--insytful-semantic-focus-ring-offset, 4px)}.insytful-search-message-input-btn:focus{outline:var(--insytful-semantic-focus-ring-width, 3px) solid var(--insytful-semantic-focus-ring);outline-offset:var(--insytful-semantic-focus-ring-offset, 4px)}.insytful-search-error-callout-btn:focus,.insytful-search-error-callout-cta:focus{outline:var(--insytful-semantic-focus-ring-width, 3px) solid var(--insytful-semantic-focus-ring);outline-offset:var(--insytful-semantic-focus-ring-offset, 4px)}.insytful-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.insytful-search-message-content h2{font-size:1.5em;font-weight:600;line-height:1.333;color:var(--insytful-text-default);margin-top:0;margin-bottom:.5em}.insytful-search-message-content h3{font-size:1.25em;font-weight:600;line-height:1.4;color:var(--insytful-text-default);margin-top:1em;margin-bottom:.4em}.insytful-search-message-content h4{font-size:1.125em;font-weight:600;line-height:1.333;color:var(--insytful-text-default);margin-top:.875em;margin-bottom:.5em}.insytful-search-message-content p{margin-bottom:1em;line-height:1.75;color:var(--insytful-text-default)}.insytful-search-message-content a{color:var(--insytful-text-link-default);text-decoration:underline;font-weight:500}.insytful-search-message-content a:hover{color:var(--insytful-text-link-hover);text-decoration:none}.insytful-search-message-content a:focus{outline:var(--insytful-semantic-focus-ring-width, 3px) solid var(--insytful-semantic-focus-ring);outline-offset:var(--insytful-semantic-focus-ring-offset, 4px)}.insytful-search-message-content ul{list-style-type:disc;margin-left:1.5em;margin-bottom:1em}.insytful-search-message-content ol{list-style-type:decimal;margin-left:1.5em;margin-bottom:1em}.insytful-search-message-content li{margin-bottom:.5em;line-height:1.6;padding-left:.25em}.insytful-search-message-content strong{font-weight:700}.insytful-search-message-content em{font-style:italic}.insytful-search-message-content code{background-color:#f7fafc;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:monospace;font-size:.875em}.insytful-search-message-content pre{background-color:#2d3748;color:#e2e8f0;border-radius:8px;padding:1em;overflow-x:auto;margin-bottom:1em}.insytful-search-message-content pre code{background:transparent;border:none;color:inherit;padding:0}.insytful-search-message-content blockquote{border-left:4px solid var(--insytful-brand-primary);padding:.75em 1em;margin:1em 0;font-style:italic;color:var(--insytful-text-muted);background-color:#f7fafc;border-radius:0 4px 4px 0}.insytful-search-message-content blockquote p{margin:0}.insytful-search-message-content hr{margin-top:1.5em;margin-bottom:1.5em}.insytful-search-dialog-inner:has(.insytful-search-suggestions-outer[data-position=below])>.insytful-search-message-input{order:1}.insytful-search-dialog-inner:has(.insytful-search-suggestions-outer[data-position=below])>.insytful-search-disclaimer-inner{order:3}.insytful-search-skeleton-bar{background:var(--insytful-skeleton-bg);background-size:200% 100%;border-radius:4px;
50818height:1em}.insytful-search-skeleton-bar.animate-skeleton-shimmer{background-image:var(--insytful-skeleton-shimmer)}.insytful-search-skeleton span{font-size:.875em;color:var(--insytful-text-muted);margin-top:.5em}.insytful-search-skeleton-text-transition{display:inline-block;animation:skeleton-text-entrance .3s ease-out}@keyframes skeleton-text-entrance{0%{opacity:0;transform:translateY(-1px)}to{opacity:1;transform:translateY(0)}}.insytful-search-messages-inner{position:relative}.insytful-search-response-wrapper{position:relative;width:100%}.insytful-search-skeleton{position:absolute;top:0;left:0;right:0;z-index:1;margin:0;opacity:1}.insytful-search-skeleton.fade-out{animation:skeleton-fade-out var(--insytful-search-transition-duration) var(--insytful-search-transition-easing) forwards}@keyframes skeleton-fade-out{0%{opacity:1}to{opacity:0}}@keyframes skeleton-dots{0%,20%{opacity:0}50%{opacity:1}80%,to{opacity:0}}.animate-skeleton-dots{animation:skeleton-dots 1.5s ease-in-out infinite}@media(prefers-reduced-motion:reduce){:host,:root,.insytful-root{--insytful-search-transition-duration: 0ms}.insytful-search-dialog-outer,.insytful-search-mode-transition{transition-duration:0ms!important}.insytful-search-messages-icon,.insytful-search-skeleton-bar{animation:none!important}}@keyframes dot-animate{0%{content:"."}25%{content:".."}50%{content:"..."}75%{content:"."}to{content:".."}}.after\\:animate-dot-animate:after{content:var(--tw-content);animation:dot-animate 1.5s steps(1,end) infinite}.hover\\:bg-\\[var\\(--insytful-btn-icon-search-bg-hover\\)\\]:hover{background-color:var(--insytful-btn-icon-search-bg-hover)}.hover\\:bg-\\[var\\(--insytful-btn-prompt-bg-hover\\)\\]:hover{background-color:var(--insytful-btn-prompt-bg-hover)}.hover\\:text-\\[\\#333\\]:hover{--tw-text-opacity: 1;color:rgb(51 51 51 / var(--tw-text-opacity, 1))}.hover\\:text-blue-900:hover{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:opacity-90:hover{opacity:.9}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-sha
50818dow, 0 0 #0000)}.focus\\:ring-\\[length\\:var\\(--insytful-semantic-focus-ring-width\\,3px\\)\\]:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(var(--insytful-semantic-focus-ring-width,3px) + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-inset:focus{--tw-ring-inset: inset}.focus\\:ring-\\[var\\(--insytful-btn-prompt-focus\\)\\]:focus{--tw-ring-color: var(--insytful-btn-prompt-focus)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:focus-within .group-focus-within\\:opacity-60{opacity:.6}.group:focus-within .group-focus-within\\:opacity-80{opacity:.8}@media(min-width:768px){.md\\:mt-auto{margin-top:auto}.md\\:block{display:block}.md\\:hidden{display:none}.md\\:justify-center{justify-content:center}.md\\:gap-0{gap:0px}.md\\:gap-\\[16px\\]{gap:16px}.md\\:gap-\\[24px\\]{gap:24px}.md\\:gap-\\[32px\\]{gap:32px}.md\\:px-\\[16px\\]{padding-left:16px;padding-right:16px}.md\\:py-\\[12px\\]{padding-top:12px;padding-bottom:12px}.md\\:text-\\[1\\.25em\\]{font-size:1.25em}.md\\:text-\\[14px\\]{font-size:14px}.md\\:text-\\[18px\\]{font-size:18px}.md\\:text-\\[20px\\]{font-size:20px}.md\\:text-\\[56px\\]{font-size:56px}.md\\:leading-\\[32px\\]{line-height:32px}.md\\:leading-\\[64px\\]{line-height:64px}}@media(min-width:1024px){.lg\\:mx-auto{margin-left:auto;margin-right:auto}.lg\\:mt-16{margin-top:4rem}.lg\\:mt-6{margin-top:1.5rem}.lg\\:mt-auto{margin-top:auto}.lg\\:h-\\[120px\\]{height:120px}.lg\\:max-w-\\[1000px\\]{max-width:1000px}.lg\\:max-w-\\[610px\\]{max-width:610px}.lg\\:gap-10{gap:2.5rem}.lg\\:gap-4{gap:1rem}.lg\\:rounded-\\[16px\\]{border-radius:16px}.lg\\:py-\\[200px\\]{padding-top:200px;padding-bottom:200px}.lg\\:text-\\[18px\\]{font-size:18px}.lg\\:text-\\[88px\\]{font-size:88px}.lg\\:leading-\\[26px\\]{line-height:26px}.lg\\:leading-\\[96px\\]{line-height:96px}.lg\\:tracking-\\[-0\\.72px\\]{letter-spacing:-.72px}.lg\\:tracking-\\[-2\\.64px\\]{letter-spacing:-2.64px}}`; 50819if (typeof window < "u") 50820 try { 50821 localStorage.removeItem("rag-session-id"); 50822 } catch { 50823 } 50824let kr = 0; 50825const $e = typeof react__WEBPACK_IMPORTED_MODULE_0__.useId == "function" ? (t) => `${t}-${react__WEBPACK_IMPORTED_MODULE_0__.useId()}` : (t) => { 50826 const [e] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => `${t}-${++kr}`); 50827 return e; 50828}; 50829function dt({ 50830 children: t, 50831 options: e, 50832 open: r, 50833 defaultOpen: a = !1, 50834 onOpenChange: o, 50835 theme: i, 50836 renderMarkdown: n, 50837 logo: f, 50838 isDevMode: c = !1, 50839 variant: m = "modal", 50840 offsets: p 50841}) { 50842 const [g, S] = at({ 50843 prop: r, 50844 defaultProp: a, 50845 onChange: o 50846 }), b = $e("insytful-search-heading"), P = $e("insytful-search-description"), T = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => e, [e.config, e.baseUrl, e.recaptchaSiteKey]), x = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => p, [p?.top, p?.left, p?.right]); 50847 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 50848 Ot, 50849 { 50850 key: T.config || "default", 50851 config: T.config || "", 50852 baseUrl: T.baseUrl, 50853 recaptchaSiteKey: T.recaptchaSiteKey 50854 }, 50855 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 50856 Sr, 50857 { 50858 open: g, 50859 setOpen: S, 50860 titleId: b, 50861 descriptionId: P, 50862 options: T, 50863 theme: i, 50864 renderMarkdown: n, 50865 logo: f, 50866 isDevMode: c, 50867 variant: m, 50868 offsets: x 50869 }, 50870 t 50871 ) 50872 ); 50873} 50874dt.displayName = "Search.Root"; 50875function Sr({ 50876 children: t, 50877 open: e, 50878 setOpen: r, 50879 titleId: a, 50880 descriptionId: o, 50881 options: i, 50882 theme: n, 50883 renderMarkdown: f, 50884 logo: c, 50885 isDevMode: m, 50886 variant: p, 50887 offsets: g 50888}) { 50889 const { messages: S, loading: b, elapsed: P, error: T, ask: x } = Bt(); 50890 wr(m, i.baseUrl); 50891 const A = p === "modal", M = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(""), O = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(""), y = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0); 50892 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 50893 if (!(typeof window > "u" || !A)) { 50894 if (e) { 50895 y.current = window.scrollY, M.current = document.body.style.overflow, O.current = document.body.style.paddingRight; 50896 const z = window.innerWidth - document.documentElement.clientWidth; 50897 document.body.style.overflow = "hidden", document.body.style.paddingRight = `${z}px`, window.scrollTo(0, 0); 50898 } else 50899 document.body.style.overflow = M.current, document.body.style.paddingRight = O.current, window.scrollTo(0, y.current); 50900 return () => { 50901 document.body.style.overflow = M.current, document.body.style.paddingRight = O.current; 50902 }; 50903 } 50904 }, [e, A]); 50905 const [N, H] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0); 50906 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 50907 if (typeof window > "u" || !e || !A) return; 50908 const z = document.querySelectorAll("[data-insytful-modal-offset]"), I = () => { 50909 let D = 0; 50910 z.forEach((_) => D += _.offsetHeight), H(D); 50911 }; 50912 I(); 50913 const j = new ResizeObserver(I); 50914 return z.forEach((D) => j.observe(D)), () => j.disconnect(); 50915 }, [e, A]); 50916 const k = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ 50917 open: e, 50918 onOpenChange: r, 50919 titleId: a, 50920 descriptionId: o, 50921 options: i, 50922 messages: S, 50923 loading: b, 50924 elapsed: P, 50925 error: T, 50926 onSend: x, 50927 renderMarkdown: f, 50928 logo: c, 50929 isDevMode: m, 50930 variant: p, 50931 theme: n, 50932 offsets: g, 50933 computedOffsetHeight: N 50934 }), [ 50935 e, 50936 r, 50937 a, 50938 o, 50939 i, 50940 S, 50941 b, 50942 P, 50943 T, 50944 x, 50945 f, 50946 c, 50947 m, 50948 p, 50949 n, 50950 g, 50951 N 50952 ]); 50953 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(tt, { value: k }, t); 50954} 50955function ft({ children: t }) { 50956 const e = W("Search.Portal"), { open: r, titleId: a, descriptionId: o, theme: i, variant: n, offsets: f, computedOffsetHeight: c } = e, m = n === "widget", { elModalRef: p }
50956 = yr(e.onOpenChange, r), g = $e("insytful-ai-modal-portal"), S = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), b = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [P, T] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1); 50957 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 50958 if (typeof window > "u") return; 50959 const O = document.createElement("div"); 50960 O.id = g; 50961 const y = O.attachShadow({ mode: "open" }), N = document.createElement("style"); 50962 N.textContent = xr; 50963 const H = document.createElement("style"); 50964 i && (H.textContent = i); 50965 const k = document.createElement("div"); 50966 return k.className = "insytful-root", y.append(N, H, k), document.body.appendChild(O), S.current = k, b.current = H, T(!0), () => { 50967 O.parentNode && document.body.removeChild(O); 50968 }; 50969 }, []), (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 50970 b.current && (b.current.textContent = i ?? ""); 50971 }, [i]); 50972 const { left: x = 0, right: A = 0 } = f || {}, M = f?.top ?? c; 50973 return !P || !S.current ? null : react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal( 50974 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 50975 "div", 50976 { 50977 tabIndex: -1, 50978 id: "insytful-search-dialog", 50979 ref: p, 50980 role: "dialog", 50981 "aria-modal": r || void 0, 50982 "aria-labelledby": a, 50983 "aria-describedby": o, 50984 ...r ? {} : { inert: "" }, 50985 "data-insytful-variant": n, 50986 className: `insytful-search-dialog-outer fixed flex flex-col bg-[var(--insytful-modal-bg)] overflow-hidden pb-0 ${r ? "insytful-search-dialog-open" : "insytful-search-dialog-closed"}`, 50987 style: { 50988 zIndex: "var(--insytful-z-index, 999)",
50989 // Widget geometry (corner-anchored size/position) is driven entirely 50990 // by CSS custom properties in main.css, not by offset/top math. 50991 ...m ? {} : { 50992 top: typeof M == "number" ? `${M}px` : M, 50993 left: x, 50994 right: A, 50995 bottom: 0 50996 }, 50997 opacity: r ? 1 : 0, 50998 visibility: r ? "visible" : "hidden", 50999 pointerEvents: r ? "auto" : "none", 51000 transition: `opacity var(--insytful-search-transition-duration, 200ms) var(--insytful-search-transition-easing, ease)${m ? ", transform var(--insytful-search-transition-duration, 200ms) var(--insytful-search-transition-easing, ease)" : ""}, visibility 0s linear ${r ? "0s" : "var(--insytful-search-transition-duration, 200ms)"}` 51001 } 51002 }, 51003 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51004 "div", 51005 { 51006 className: `insytful-search-dialog-inner px-4 w-full mx-auto flex flex-col h-full justify-start gap-[24px] pt-[32px] ${m ? "" : "min-h-[500px] md:justify-center md:gap-[32px]"}` 51007 }, 51008 t 51009 ) 51010 ), 51011 // eslint-disable-next-line react-hooks/refs 51012 S.current 51013 ); 51014} 51015ft.displayName = "Search.Portal"; 51016const pt = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)( 51017 function({ children: e, asChild: r = !1, onClick: a, ...o }, i) { 51018 const { open: n, onOpenChange: f } = W("Search.Trigger"), m = { 51019 "data-insytful-toggle": "", 51020 "aria-expanded": n, 51021 "data-state": n ? "open" : "closed", 51022 onClick: (p) => { 51023 a?.(p), p.defaultPrevented || f(!n); 51024 }, 51025 ...o 51026 }; 51027 if (r && react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(e)) { 51028 const p = e.props.onClick; 51029 return react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(e, { 51030 ...m, 51031 onClick: (g) => { 51032 p?.(g), g.defaultPrevented || f(!n); 51033 }, 51034 ref: i 51035 }); 51036 } 51037 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("button", { ref: i, type: "button", ...m }, e); 51038 } 51039); 51040pt.displayName = "Search.Trigger"; 51041function Er() { 51042 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51043 "svg", 51044 { 51045 xmlns: "http://www.w3.org/2000/svg", 51046 width: "20", 51047 height: "20", 51048 viewBox: "0 0 24 24", 51049 fill: "none", 51050 stroke: "currentColor", 51051 strokeWidth: 2, 51052 strokeLinecap: "round", 51053 strokeLinejoin: "round", 51054 "aria-hidden": "true", 51055 focusable: "false" 51056 }, 51057 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { d: "M18 6 6 18M6 6l12 12" }) 51058 ); 51059} 51060const mt = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)( 51061 function({ children: e, asChild: r = !1, onClick: a, className: o, ...i }, n) { 51062 const { onOpenChange: f } = W("Search.Close"), c = (p) => { 51063 a?.(p), p.defaultPrevented || f(!1); 51064 }, m = { 51065 "aria-label": i["aria-label"] ?? "Close search", 51066 onClick: c, 51067 ...i 51068 }; 51069 if (r && react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(e)) { 51070 const p = e, g = p.props.onClick, S = p.props.className ?? ""; 51071 return react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(p, { 51072 ...m, 51073 className: `${S} ${o ?? ""}`.trim() || void 0, 51074 onClick: (b) => { 51075 g?.(b), b.defaultPrevented || f(!1); 51076 }, 51077 ref: n 51078 }); 51079 } 51080 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51081 "button", 51082 { 51083 ref: n, 51084 type: "button", 51085 className: `insytful-search-close ${o ?? ""}`.trim(), 51086 ...m 51087 },
51088 e ?? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Er, null) 51089 ); 51090 } 51091); 51092mt.displayName = "Search.Close"; 51093function gt({ children: t, className: e }) { 51094 const { titleId: r } = W("Search.Title"); 51095 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51096 "h1", 51097 { 51098 id: r, 51099 className: `insytful-search-empty-state-title text-[var(--insytful-text-default)] text-[24px] leading-[32px] font-bold md:text-[56px] md:leading-[64px] text-center ${e ?? ""}` 51100 }, 51101 t 51102 ); 51103} 51104gt.displayName = "Search.Title"; 51105function ht({ 51106 children: t, 51107 className: e 51108}) { 51109 const { descriptionId: r } = W("Search.Description"); 51110 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51111 "p", 51112 { 51113 id: r, 51114 className: `insytful-search-empty-state-text text-[var(--insytful-text-default)] text-[14px] leading-[24px] font-normal md:text-[20px] md:leading-[32px] text-center ${e ?? ""}` 51115 }, 51116 t 51117 ); 51118} 51119ht.displayName = "Search.Description"; 51120function bt({ className: t, embedded: e = !1, placeholder: r, onSubmit: a }) { 51121 const { onSend: o, loading: i, messages: n } = W("Search.Input"), f = rt(), c = f ? f.mode !== "ai" : !1, [m, p] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(""), g = n.length > 0, S = async () => { 51122 const b = m.trim(); 51123 if (b) { 51124 if (p(""), a) { 51125 a(b); 51126 return; 51127 } 51128 try { 51129 await o(b); 51130 } catch { 51131 p(b); 51132 } 51133 } 51134 }; 51135 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51136 "form", 51137 { 51138 onSubmit: (b) => { 51139 b.stopPropagation(), b.preventDefault(), S(); 51140 }, 51141 className: `insytful-search-message-input w-full relative flex ${e ? "" : "max-w-[var(--insytful-modal-max-width)] mx-auto"} ${t ?? ""}` 51142 }, 51143 c ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: `insytful-search-message-input-icon absolute ${e ? "top-[14px] left-0" : "top-[18px] left-[16px]"} z-20` }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51144 "svg", 51145 { 51146 focusable: "false", 51147 "aria-hidden": "true", 51148 role: "presentation", 51149 xmlns: "http://www.w3.org/2000/svg", 51150 width: "24", 51151 height: "24",
51152 viewBox: "0 0 24 24", 51153 fill: "none" 51154 }, 51155 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51156 "path", 51157 { 51158 fill: "var(--insytful-text-default)", 51159 d: "M11.27 18.54c1.613-.001 3.18-.541 4.45-1.535L19.715 21 21 19.715l-3.995-3.995a7.225 7.225 0 0 0 1.535-4.45C18.54 7.26 15.279 4 11.27 4 7.262 4 4 7.261 4 11.27c0 4.008 3.262 7.27 7.27 7.27Zm0-12.723a5.458 5.458 0 0 1 5.453 5.453 5.458 5.458 0 0 1-5.453 5.452 5.458 5.458 0 0 1-5.452-5.452 5.458 5.458 0 0 1 5.452-5.453Z" 51160 } 51161 ) 51162 )) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: `insytful-search-message-input-icon absolute ${e ? "top-[14px] left-0" : "top-[18px] left-[16px]"} z-20` }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51163 "svg", 51164 { 51165 focusable: "false", 51166 "aria-hidden": "true", 51167 role: "presentation", 51168 xmlns: "http://www.w3.org/2000/svg", 51169 width: "24", 51170 height: "24", 51171 viewB
51171ox: "0 0 24 24", 51172 fill: "none" 51173 }, 51174 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51175 "path", 51176 { 51177 fill: "var(--insytful-text-default)", 51178 d: "M10.6 9.6 9 15 7.4 9.6 2 8l5.4-1.6L9 1l1.6 5.4L16 8l-5.4 1.6Zm6.4 4.6 4-2.2-2.2 4 2.2 4-4-2.2-4 2.2 2.2-4-2.2-4 4 2.2ZM10 16l-1.7 3 1.7 3-3-1.7L4 22l1.7-3L4 16l3 1.7 3-1.7Z" 51179 } 51180 ) 51181 )), 51182 !c && !e && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-message-input-bg absolute inset-0 h-full w-full max-w-[var(--insytful-modal-max-width)] rounded-[var(--insytful-input-card-radius)] group-focus-within:opacity-80" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51183 "div", 51184 { 51185 className: `pointer-events-none absolute inset-x-[-2px] top-[2px] -bottom-[10px] rounded-[var(--insytful-input-card-radius)] opacity-50 blur-[14px] transition-opacity z-0 ${g ? "" : "bg-gradient-to-b from-[var(--insytful-semantic-search-field-ai-gradient-start)] to-[var(--insytful-semantic-search-field-ai-gradient-end)]"}`, 51186 "aria-hidden": "true" 51187 } 51188 )), 51189 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51190 "textarea", 51191 { 51192 rows: 1, 51193 value: m, 51194 disabled: i, 51195 placeholder: r ?? (c ? "Search" : "Ask a question"), 51196 "aria-label": c ? "Search" : "Ask a question", 51197 onChange: (b) => p(b.target.value), 51198 onKeyDown: (b) => { 51199 b.key === "Enter" && !b.shiftKey && (b.preventDefault(), b.stopPropagation(), S()); 51200 }, 51201 className: `insytful-search-message-input-textarea relative z-10 w-full resize-none bg-[var(--insytful-input-card-bg)] max-h-[240px] overflow-y-auto ${e ? "py-[12px] min-h-[48px] border-0 rounded-none pr-[48px] pl-[32px]" : "py-[16px] min-h-[62px] pl-[48px] pr-[64px] rounded-[var(--insytful-input-card-radius)] border border-[var(--insytful-input-card-border)]"}` 51202 } 51203 ), 51204 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51205 "button", 51206 { 51207 type: "submit", 51208 disabled: i, 51209 className: `insytful-search-message-input-btn z-20 absolute ${e ? "right-0" : "right-[8px]"} top-1/2 -translate-y-1/2 w-[40px] h-[40px] rounded-full flex items-center justify-center bg-[var(--insytful-btn-icon-search-bg-default)] text-white border-none cursor-pointer hover:bg-[var(--insytful-btn-icon-search-bg-hover)] disabled:cursor-not-allowed disabled:opacity-50`, 51210 "aria-label": c ? "Search" : "Send message" 51211 },
51212 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51213 "svg", 51214 { 51215 xmlns: "http://www.w3.org/2000/svg", 51216 width: "16", 51217 height: "16", 51218 fill: "none", 51219 viewBox: "0 0 16 16" 51220 }, 51221 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", { clipPath: "url(#a)" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51222 "path", 51223 { 51224 fill: "var(--insytful-btn-icon-search-icon)", 51225 d: "M15.991 8a1.606 1.606 0 0 0-.543-1.2L7.996.24a.96.96 0 0 0-1.267 1.442l5.758 5.067a.166.166 0 0 1 .046.183.167.167 0 0 1-.156.108H.967a.96.96 0 1 0 0 1.92h11.408a.167.167 0 0 1 .11.292l-5.758 5.067a.96.96 0 1 0 1.267 1.44L15.448 9.2A1.606 1.606 0 0 0 15.99 8Z" 51226 } 51227 )), 51228 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", { id: "a" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51229 "path", 51230 { 51231 fill: "var(--insytful-btn-icon-search-icon)", 51232 d: "M0 0h16v16H0z" 51233 } 51234 ))) 51235 ) 51236 ) 51237 ); 51238} 51239bt.displayName = "Search.Input"; 51240function je(t) { 51241 let e = 0; 51242 for (let r = 0; r < t.length; r++) 51243 e = (e << 5) - e + t.charCodeAt(r), e |= 0; 51244 return e.toString(); 51245} 51246const Nr = [ 51247 { from: 0, to: "Infinity", text: "Generating Response..." } 51248]; 51249function Cr({ text: t }) { 51250 if (!t.includes("...")) return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, t); 51251 const [r, a] = t.split("..."); 51252 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, r, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "animate-skeleton-dots" }, "."), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "animate-skeleton-dots", style: { animationDelay: "0.2s" } }, "."), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "animate-skeleton-dots", style: { animationDelay: "0.4s" } }, "."), a); 51253} 51254function Tr(t, e) { 51255 for (const r of t) { 51256 const a = r.to === "Infinity" ? 1 / 0 : r.to ?? 1 / 0; 51257 if (e >= r.from && e < a) 51258 return r.text; 51259 } 51260 return t[t.length - 1]?.text || "Generating Response..."; 51261} 51262const Rr = ({ 51263 messages: t = Nr, 51264 elapsed: e = 0 51265}) => { 51266 const r = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)( 51267 () => Tr(t, e), 51268 [t, e] 51269 ); 51270 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-skeleton-content flex flex-col gap-[8px] w-full" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-skeleton-bar animate-skeleton-shimmer w-full" }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-skeleton-bar animate-skeleton-shimmer w-[90%]" }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-skeleton-bar animate-skeleton-shimmer w-[70%]" }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51271 "span", 51272 { 51273 key: r, 51274 className: "insytful-search-skeleton-text insytful-search-skeleton-text-transition" 51275 }, 51276 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Cr, { text: r }) 51277 )); 51278}; 51279function Ye(t) { 51280 return t.replace(/^(#{1,5})\s/gm, (e, r) => `${r}# `); 51281} 51282function Fr({ 51283 message: t, 51284 logo: e, 51285 renderContent: r, 51286 showSkeleton: a, 51287 elapsed: o, 51288 searching: i 51289}) { 51290 const n = t.role === "user", f = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)( 51291 () => t.content.split(` 51292 51293`), 51294 [t.content] 51295 ); 51296 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51297 "li", 51298 { 51299 className: `insytful-search-message flex items-start gap-[24px] w-full max-w-full ${n ? "flex-row-reverse" : "flex-row"}`, 51300 "data-role": t.role 51301 },
51302 e && !n && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-message-logo insytful-search-message-logo-aside flex-shrink-0 hidden md:block" }, e), 51303 n ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51304 "div", 51305 { 51306 style: { overflowWrap: "anywhere", wordBreak: "break-word" }, 51307 className: "insytful-search-message-content-outer text-[1em] md:text-[1.25em] leading-[2] rounded-[16px] flex flex-col justify-center items-end px-[16px] py-[12px] gap-[10px] bg-[var(--insytful-btn-prompt-bg-default)] text-[var(--insytful-text-default)]" 51308 }, 51309 t.content 51310 ) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51311 "div", 51312 { 51313 style: { overflowWrap: "anywhere", wordBreak: "break-word" }, 51314 className: "insytful-search-message-content-outer w-full text-[1em] md:text-[1.25em] leading-[2] rounded-[16px] text-[var(--insytful-text-default)]" 51315 }, 51316 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-message-content-inner flex items-start gap-[12px] md:block md:gap-0" }, e && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-message-logo insytful-search-message-logo-inline flex-shrink-0 md:hidden" }, e), a ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Rr, { elapsed: o, messages: i || [] }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-message-content" }, r ? r(Ye(f[0])) : f[0])), 51317 !a && f.slice(1).map((c, m) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51318 "div", 51319 { 51320 key: `${m}-${je(c)}`, 51321 className: "insytful-search-message-content mt-[8px]" 51322 }, 51323 r ? r(Ye(c)) : c 51324 )) 51325 ) 51326 ); 51327} 51328function Pr(t, e, r) { 51329 r.style.transition = "none", r.style.height = `${t.clientHeight}px`, requestAnimationFrame(() => { 51330 requestAnimationFrame(() => { 51331 const a = e.getBoundingClientRect(), o = t.getBoundingClientRect(), i = t.scrollTop + (a.top - o.top); 51332 t.scrollTo({ 51333 top: i, 51334 behavior: "smooth" 51335 }); 51336 }); 51337 }); 51338} 51339function Ar({ 51340 title: t = "Something went wrong", 51341 text: e = "Failed to fetch", 51342 cta: r, 51343 onSwitchClassic: a 51344}) { 51345 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-error-callout-inner flex items-start flex-col gap-[12px] p-[16px] border-l-[4px] border-[var(--insytful-callout-error-border)] bg-[var(--insytful-callout-error-bg)] rounded-r-lg max-w-full w-full" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-error-callout-content flex-1 gap-[8px] flex flex-col" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "insytful-search-error-callout-title font-semibold text-[var(--insytful-callout-error-text)] m-0" }, t), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "insytful-search-error-callout-text text-[var(--insytful-callout-error-text)] m-0" }, e)), r ? (() => { 51346 const o = r.path.startsWith("https://www"); 51347 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51348 "a", 51349 { 51350 href: r.path, 51351 ...o ? { target: "_blank", rel: "noopener noreferrer" } : {}, 51352 className: "insytful-search-error-callout-cta inline-flex items-center justify-center rounded-[var(--insytful-callout-error-cta-border-radius)] bg-[var(--insytful-callout-error-cta-bg)] px-[16px] py-[8px] text-[14px] font-medium text-[var(--insytful-callout-error-cta-text)] no-underline transition-opacity hover:opacity-90" 51353 }, 51354 r.text,
51355 o && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "insytful-sr-only" }, " (opens in a new tab)") 51356 ); 51357 })() : a ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51358 "button", 51359 { 51360 onClick: a, 51361 className: "insytful-search-error-callout-btn underline text-[var(--insytful-callout-error-text)] hover:text-[var(--insytful-callout-error-text)]/80 hover:no-underline text-[14px] font-medium" 51362 }, 51363 "Try classic?" 51364 ) : null); 51365} 51366function yt({ 51367 className: t, 51368 searching: e, 51369 children: r 51370}) { 51371 const { messages: a, loading: o, elapsed: i, error: n, renderMarkdown: f, logo: c, open: m } = W("Search.Messages"), p = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), g = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [S, b] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1), [P, T] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1), x = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0); 51372 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 51373 const k = p.current; 51374 if (!k) return; 51375 const z = () => { 51376 const w = k.scrollHeight > k.clientHeight; 51377 b((s) => s === w ? s : w); 51378 }, I = () => { 51379 z(); 51380 const w = k.scrollTop + k.clientHeight >= k.scrollHeight - 40, s = Date.now() - x.current < 800; 51381 w && !s && k.scrollHeight > k.clientHeight && T(!0); 51382 }; 51383 z(), k.addEventListener("scroll", I), window.addEventListener("resize", z); 51384 const j = k.querySelector( 51385 ".insytful-search-messages-inner" 51386 ); 51387 let D = 0; 51388 const _ = j ? new ResizeObserver(() => { 51389 cancelAnimationFrame(D), D = requestAnimationFrame(z); 51390 }) : null; 51391 return _ && j && _.observe(j), () => { 51392 k.removeEventListener("scroll", I), window.removeEventListener("resize", z), _ && _.disconnect(), cancelAnimationFrame(D); 51393 }; 51394 }, [a.length]); 51395 const A = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => o && (a.length === 0 || a[a.length - 1].role === "user") ? [...a, { role: "assistant", content: "" }] : a, [a, o]), O = !![...A].reverse().find((k) => k.role === "assistant")?.content, y = o && !O && !n, N = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0); 51396 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 51397 if (a.length === 0 || !m) return; 51398 const k = p.current; 51399 if (a.length > N.current && a[a.length - 1].role === "user" && (T(!1), N.current > 0 && k && g.current)) { 51400 const I = k.querySelectorAll( 51401 ".insytful-search-message[data-role='user']" 51402 ), j = I[I.length - 1]; 51403 j && (x.current = Date.now(), Pr(k, j, g.current)); 51404 } 51405 N.current = a.length; 51406 }, [a.length, m]), (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 51407 (!o || n) && g.current && (g.current.style.transition = n ? "none" : "height 500ms ease-out", g.current.style.height = "0px"); 51408 }, [o, n]); 51409 const H = S && !P && !y; 51410 return (!a || a.length === 0) && !o ? null : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51411 "div", 51412 { 51413 className: `flex-1 min-h-0 relative w-full max-w-full ${t ?? ""}` 51414 }, 51415 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51416 "div", 51417 { 51418 ref: p, 51419 className: `overflow-y-auto insytful-search-messages-container-scroll h-full w-full ${H ? "[mask-image:linear-gradient(to_bottom,black_0%,black_90%,rgba(0,0,0,0.3)_100%)] [-webkit-mask-image:linear-gradient(to_bottom,black_0%,black_90%,rgba(0,0,0,0.3)_100%)]" : ""}` 51420 },
51421 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "insytful-search-messages-outer w-full max-w-[var(--insytful-modal-max-width)] mx-auto" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("ul", { className: "insytful-search-messages-inner flex flex-col gap-[32px] max-w-full w-full p-0 m-0 list-none" }, A.map((k, z) => { 51422 const j = z === A.length - 1 && k.role === "assistant"; 51423 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51424 Fr, 51425 { 51426 key: `${z}-${je(k.content)}`, 51427 renderContent: f, 51428 logo: c, 51429 message: k, 51430 showSkeleton: j && y, 51431 elapsed: i, 51432 searching: e 51433 } 51434 ); 51435 })), r, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { ref: g, className: "insytful-search-scroll-spacer", "aria-hidden": "true" })) 51436 ), 51437 H && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "w-full max-w-[var(--insytful-modal-max-width)] mx-auto absolute left-1/2 -translate-x-1/2 bottom-0 flex flex-col justify-center items-center" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51438 "div", 51439 { 51440 key: `slide-icon-${a.length}`, 51441 className: "insytful-search-messages-icon min-w-[42px] h-[42px] w-[42px] rounded-full border border-gray-200 flex items-center justify-center p-[8px] shadow-[0_2px_8px_0_rgba(0,0,0,0.15)] animate-slide-to-bounce-animate bg-white z-20" 51442 },
51443 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51444 "svg", 51445 { 51446 xmlns: "http://www.w3.org/2000/svg", 51447 width: "24", 51448 height: "24", 51449 viewBox: "0 0 24 24", 51450 fill: "none" 51451 }, 51452 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51453 "path", 51454 { 51455 stroke: "#333", 51456 strokeLinecap: "round", 51457 strokeLinejoin: "round", 51458 strokeWidth: "2", 51459 d: "M12 5v14M19 12l-7 7-7-7" 51460 } 51461 ) 51462 ) 51463 )) 51464 ); 51465} 51466yt.displayName = "Search.Messages"; 51467function vt({ items: t, className: e, position: r = "above" }) { 51468 const { onSend: a } = W("Search.Suggestions"); 51469 if (!t || t.length <= 0) return null; 51470 const o = r === "below" ? { order: 2 } : void 0; 51471 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51472 "div", 51473 { 51474 "data-position": r, 51475 style: o, 51476 className: `insytful-search-suggestions-outer w-full overflow-hidden self-stretch ${e ?? ""}` 51477 }, 51478 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("ul", { className: "insytful-search-suggestions-inner flex gap-[16px] w-full min-w-0 flex-wrap justify-center p-0 m-0 list-none" }, t.map((i, n) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51479 "li", 51480 { 51481 key: `${n}-${je(i)}`, 51482 className: "insytful-search-suggestions-item" 51483 },
51484 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51485 "button", 51486 { 51487 type: "button", 51488 onClick: () => a(i), 51489 className: "insytful-search-suggestions-item-btn bg-[var(--insytful-btn-prompt-bg-default)] text-[var(--insytful-btn-prompt-text)] whitespace-nowrap transition-colors hover:bg-[var(--insytful-btn-prompt-bg-hover)] py-[8px] px-[8px] md:py-[12px] md:px-[16px] text-[14px] md:text-[18px] leading-[24px] rounded-[var(--insytful-btn-prompt-radius)] focus:outline-none focus:ring-[length:var(--insytful-semantic-focus-ring-width,3px)] focus:ring-inset focus:ring-[var(--insytful-btn-prompt-focus)]" 51490 }, 51491 i 51492 ) 51493 ))) 51494 ); 51495} 51496vt.displayName = "Search.Suggestions"; 51497function wt({ 51498 children: t, 51499 className: e 51500}) { 51501 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 51502 "div", 51503 { 51504 className: `insytful-search-disclaimer-inner text-sm leading-6 font-normal text-center text-[var(--insytful-disclaimer-text)] ${e ?? ""}` 51505 }, 51506 t 51507 ); 51508} 51509wt.displayName = "Search.Disclaimer"; 51510function xt({ 51511 children: t, 51512 value: e, 51513 defaultValue: r = "ai", 51514 onValueChange: a 51515}) { 51516 const [o, i] = at({ 51517 prop: e, 51518 defaultProp: r, 51519 onChange: a 51520 }), n = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)( 51521 () => ({ mode: o, onSwitchMode: i }), 51522 [o, i] 51523 ); 51524 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Ht, { value: n }, t); 51525} 51526xt.displayName = "Search.Modes"; 51527function kt({ 51528 children: t, 51529 name: e, 51530 path: r, 51531 onNavigate: a 51532}) { 51533 const { mode: o } = Oe("Search.Mode"), { onOpenChange: i } = W("Search.Mode"), n = o === e, f = !!r, c = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)( 51534 async (m) => { 51535 if (!r) return; 51536 const p = encodeURIComponent(m); 51537 try { 51538 if (new URL(`${r}${p}`, window.location.origin).origin !== window.location.origin) { 51539 console.error( 51540 "[Insytful] Navigation blocked: path must be same-origin" 51541 ); 51542 return; 51543 } 51544 } catch { 51545 console.error("[Insytful] Navigation blocked: invalid path"); 51546 return; 51547 } 51548 i(!1), a ? a(`${r}${p}`) : window.location.href = `${r}${p}`; 51549 }, 51550 [r, a, i] 51551 ); 51552 return n ? f ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Ir, { onSend: c }, t) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, t) : null; 51553} 51554kt.displayName = "Search.Mode"; 51555function Ir({ 51556 children: t, 51557 onSend: e 51558}) { 51559 const r = W("Search.Mode"), a = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)( 51560 () => ({ ...r, onSend: e }), 51561 [r, e] 51562 ); 51563 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(tt, { value: a }, t); 51564} 51565function St({ children: t }) { 51566 const { mode: e, onSwitchMode: r } = Oe("Search.ModeSwitch");
51567 return typeof t == "function" ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, t({ mode: e, onSwitch: r })) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, t); 51568} 51569St.displayName = "Search.ModeSwitch"; 51570const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 51571 __proto__: null, 51572 Close: mt, 51573 Description: ht, 51574 Disclaimer: wt, 51575 ErrorCallout: Ar, 51576 Input: bt, 51577 Messages: yt, 51578 Mode: kt, 51579 ModeSwitch: St, 51580 Modes: xt, 51581 Portal: ft, 51582 Root: dt, 51583 Suggestions: vt, 51584 Title: gt, 51585 Trigger: pt, 51586 useModeContext: Oe, 51587 useModeContextSafe: rt, 51588 useSearchContext: W 51589}, Symbol.toStringTag, { value: "Module" })); 51590 51591 51592 51593/***/ }, 51594 51595/***/ 20063 51596(module, __unused_webpack_exports, __webpack_require__) { 51597 51598"use strict"; 51599 51600 51601var hasOwn = __webpack_require__(9957); 51602var channel = __webpack_require__(920)(); 51603 51604var $TypeError = __webpack_require__(69675); 51605 51606var SLOT = { 51607 assert: function (O, slot) { 51608 if (!O || (typeof O !== 'object' && typeof O !== 'function')) { 51609 throw new $TypeError('`O` is not an object'); 51610 } 51611 if (typeof slot !== 'string') { 51612 throw new $TypeError('`slot` must be a string'); 51613 } 51614 channel.assert(O); 51615 if (!SLOT.has(O, slot)) { 51616 throw new $TypeError('`' + slot + '` is not present on `O`'); 51617 } 51618 }, 51619 get: function (O, slot) { 51620 if (!O || (typeof O !== 'object' && typeof O !== 'function')) { 51621 throw new $TypeError('`O` is not an object'); 51622 } 51623 if (typeof slot !== 'string') { 51624 throw new $TypeError('`slot` must be a string'); 51625 } 51626 var slots = channel.get(O); 51627 return slots && slots['$' + slot]; 51628 }, 51629 has: function (O, slot) { 51630 if (!O || (typeof O !== 'object' && typeof O !== 'function')) { 51631 throw new $TypeError('`O` is not an object'); 51632 } 51633 if (typeof slot !== 'string') { 51634 throw new $TypeError('`slot` must be a string'); 51635 } 51636 var slots = channel.get(O); 51637 return !!slots && hasOwn(slots, '$' + slot); 51638 }, 51639 set: function (O, slot, V) { 51640 if (!O || (typeof O !== 'object' && typeof O !== 'function')) { 51641 throw new $TypeError('`O` is not an object'); 51642 } 51643 if (typeof slot !== 'string') { 51644 throw new $TypeError('`slot` must be a string'); 51645 } 51646 var slots = channel.get(O); 51647 if (!slots) { 51648 slots = {}; 51649 channel.set(O, slots); 51650 } 51651 slots['$' + slot] = V; 51652 } 51653}; 51654 51655if (Object.freeze) { 51656 Object.freeze(SLOT); 51657} 51658 51659module.exports = SLOT; 51660 51661 51662/***/ }, 51663 51664/***/ 20311 51665(module) { 51666 51667"use strict"; 51668/** 51669 * Copyright (c) 2013-present, Facebook, Inc. 51670 * 51671 * This source code is licensed under the MIT license found in the 51672 * LICENSE file in the root directory of this source tree. 51673 */ 51674 51675 51676 51677/** 51678 * Use invariant() to assert state which your program assumes to be true. 51679 * 51680 * Provide sprintf-style format (only %s is supported) and arguments 51681 * to provide information about what broke and what you were 51682 * expecting. 51683 * 51684 * The invariant message will be stripped in production, but the invariant 51685 * will remain to ensure logic does not differ in production. 51686 */ 51687 51688var invariant = function(condition, format, a, b, c, d, e, f) { 51689 if (false) // removed by dead control flow 51690{} 51691 51692 if (!condition) { 51693 var error; 51694 if (format === undefined) { 51695 error = new Error( 51696 'Minified exception occurred; use the non-minified dev environment ' + 51697 'for the full error message and additional helpful warnings.' 51698 ); 51699 } else { 51700 var args = [a, b, c, d, e, f]; 51701 var argIndex = 0; 51702 error = new Error( 51703 format.replace(/%s/g, function() { return args[argIndex++]; }) 51704 ); 51705 error.name = 'Invariant Violation'; 51706 } 51707 51708 error.framesToPop = 1; // we don't care about invariant's own frame 51709 throw error; 51710 } 51711}; 51712 51713module.exports = invariant; 51714 51715 51716/***/ }, 51717 51718/***/ 47244 51719(module, __unused_webpack_exports, __webpack_require__) { 51720 51721"use strict"; 51722 51723 51724var hasToStringTag = __webpack_require__(49092)(); 51725var callBound = __webpack_require__(38075); 51726 51727var $toString = callBound('Object.prototype.toString'); 51728 51729var isStandardArguments = function isArguments(value) { 51730 if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) { 51731 return false;
vendor: 8,305 bytes, lines 51732-52063
51732 } 51733 return $toString(value) === '[object Arguments]'; 51734}; 51735 51736var isLegacyArguments = function isArguments(value) { 51737 if (isStandardArguments(value)) { 51738 return true; 51739 } 51740 return value !== null && 51741 typeof value === 'object' && 51742 typeof value.length === 'number' && 51743 value.length >= 0 && 51744 $toString(value) !== '[object Array]' && 51745 $toString(value.callee) === '[object Function]'; 51746}; 51747 51748var supportsStandardArguments = (function () { 51749 return isStandardArguments(arguments); 51750}()); 51751 51752isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests 51753 51754module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; 51755 51756 51757/***/ }, 51758 51759/***/ 84670 51760(module, __unused_webpack_exports, __webpack_require__) { 51761 51762"use strict"; 51763 51764 51765var callBind = __webpack_require__(10487); 51766var callBound = __webpack_require__(38075); 51767var GetIntrinsic = __webpack_require__(70453); 51768 51769var $ArrayBuffer = GetIntrinsic('%ArrayBuffer%', true); 51770/** @type {undefined | ((receiver: ArrayBuffer) => number) | ((receiver: unknown) => never)} */ 51771var $byteLength = callBound('ArrayBuffer.prototype.byteLength', true); 51772var $toString = callBound('Object.prototype.toString'); 51773 51774// in node 0.10, ArrayBuffers have no prototype methods, but have an own slot-checking `slice` method 51775var abSlice = !!$ArrayBuffer && !$byteLength && new $ArrayBuffer(0).slice; 51776var $abSlice = !!abSlice && callBind(abSlice); 51777 51778/** @type {import('.')} */ 51779module.exports = $byteLength || $abSlice 51780 ? function isArrayBuffer(obj) { 51781 if (!obj || typeof obj !== 'object') { 51782 return false; 51783 } 51784 try { 51785 if ($byteLength) { 51786 // @ts-expect-error no idea why TS can't handle the overload 51787 $byteLength(obj); 51788 } else { 51789 // @ts-expect-error TS chooses not to type-narrow inside a closure 51790 $abSlice(obj, 0); 51791 } 51792 return true; 51793 } catch (e) { 51794 return false; 51795 } 51796 } 51797 : $ArrayBuffer 51798 // in node 0.8, ArrayBuffers have no prototype or own methods, but also no Symbol.toStringTag 51799 ? function isArrayBuffer(obj) { 51800 return $toString(obj) === '[object ArrayBuffer]'; 51801 } 51802 : function isArrayBuffer(obj) { // eslint-disable-line no-unused-vars 51803 return false; 51804 }; 51805 51806 51807/***/ }, 51808 51809/***/ 39803 51810(module, __unused_webpack_exports, __webpack_require__) { 51811 51812"use strict"; 51813 51814 51815var hasBigInts = __webpack_require__(29790)(); 51816 51817if (hasBigInts) { 51818 var bigIntValueOf = BigInt.prototype.valueOf; 51819 var tryBigInt = function tryBigIntObject(value) { 51820 try { 51821 bigIntValueOf.call(value); 51822 return true; 51823 } catch (e) { 51824 } 51825 return false; 51826 }; 51827 51828 module.exports = function isBigInt(value) { 51829 if ( 51830 value === null 51831 || typeof value === 'undefined' 51832 || typeof value === 'boolean' 51833 || typeof value === 'string' 51834 || typeof value === 'number' 51835 || typeof value === 'symbol' 51836 || typeof value === 'function' 51837 ) { 51838 return false; 51839 } 51840 if (typeof value === 'bigint') { 51841 return true; 51842 } 51843 51844 return tryBigInt(value); 51845 }; 51846} else { 51847 module.exports = function isBigInt(value) { 51848 return false && 0; 51849 }; 51850} 51851 51852 51853/***/ }, 51854 51855/***/ 75128 51856(module, __unused_webpack_exports, __webpack_require__) { 51857 51858"use strict"; 51859 51860 51861var callBound = __webpack_require__(38075); 51862var $boolToStr = callBound('Boolean.prototype.toString'); 51863var $toString = callBound('Object.prototype.toString'); 51864 51865var tryBooleanObject = function booleanBrandCheck(value) { 51866 try { 51867 $boolToStr(value); 51868 return true; 51869 } catch (e) { 51870 return false; 51871 } 51872}; 51873var boolClass = '[object Boolean]'; 51874var hasToStringTag = __webpack_require__(49092)(); 51875 51876module.exports = function isBoolean(value) { 51877 if (typeof value === 'boolean') { 51878 return true; 51879 } 51880 if (value === null || typeof value !== 'object') { 51881 return false; 51882 } 51883 return hasToStringTag && Symbol.toStringTag in value ? tryBooleanObject(value) : $toString(value) === boolClass; 51884}; 51885 51886 51887/***/ }, 51888 51889/***/ 87206 51890(module) { 51891 51892/*! 51893 * Determine if an object is a Buffer 51894 * 51895 * @author Feross Aboukhadijeh <https://feross.org> 51896 * @license MIT 51897 */ 51898 51899module.exports = function isBuffer (obj) { 51900 return obj != null && obj.constructor != null && 51901 typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) 51902} 51903 51904 51905/***/ }, 51906 51907/***/ 69600 51908(module) { 51909 51910"use strict"; 51911 51912 51913var fnToStr = Function.prototype.toString; 51914var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; 51915var badArrayLike; 51916var isCallableMarker; 51917if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { 51918 try { 51919 badArrayLike = Object.defineProperty({}, 'length', { 51920 get: function () { 51921 throw isCallableMarker; 51922 } 51923 }); 51924 isCallableMarker = {}; 51925 // eslint-disable-next-line no-throw-literal 51926 reflectApply(function () { throw 42; }, null, badArrayLike); 51927 } catch (_) { 51928 if (_ !== isCallableMarker) { 51929 reflectApply = null; 51930 } 51931 } 51932} else { 51933 reflectApply = null; 51934} 51935 51936var constructorRegex = /^\s*class\b/; 51937var isES6ClassFn = function isES6ClassFunction(value) { 51938 try { 51939 var fnStr = fnToStr.call(value); 51940 return constructorRegex.test(fnStr); 51941 } catch (e) { 51942 return false; // not a function 51943 } 51944}; 51945 51946var tryFunctionObject = function tryFunctionToStr(value) { 51947 try { 51948 if (isES6ClassFn(value)) { return false; } 51949 fnToStr.call(value); 51950 return true; 51951 } catch (e) { 51952 return false; 51953 } 51954}; 51955var toStr = Object.prototype.toString; 51956var objectClass = '[object Object]'; 51957var fnClass = '[object Function]'; 51958var genClass = '[object GeneratorFunction]'; 51959var ddaClass = '[object HTMLAllCollection]'; // IE 11 51960var ddaClass2 = '[object HTML document.all class]'; 51961var ddaClass3 = '[object HTMLCollection]'; // IE 9-10 51962var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` 51963 51964var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing 51965 51966var isDDA = function isDocumentDotAll() { return false; }; 51967if (typeof document === 'object') { 51968 // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly 51969 var all = document.all; 51970 if (toStr.call(all) === toStr.call(document.all)) { 51971 isDDA = function isDocumentDotAll(value) { 51972 /* globals document: false */ 51973 // in IE 6-8, typeof document.all is "object" and it's truthy 51974 if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { 51975 try { 51976 var str = toStr.call(value); 51977 return ( 51978 str === ddaClass 51979 || str === ddaClass2 51980 || str === ddaClass3 // opera 12.16 51981 || str === objectClass // IE 6-8 51982 ) && value('') == null; // eslint-disable-line eqeqeq 51983 } catch (e) { /**/ } 51984 } 51985 return false; 51986 }; 51987 } 51988} 51989 51990module.exports = reflectApply 51991 ? function isCallable(value) { 51992 if (isDDA(value)) { return true; } 51993 if (!value) { return false; } 51994 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 51995 try { 51996 reflectApply(value, null, badArrayLike); 51997 } catch (e) { 51998 if (e !== isCallableMarker) { return false; } 51999 } 52000 return !isES6ClassFn(value) && tryFunctionObject(value); 52001 } 52002 : function isCallable(value) { 52003 if (isDDA(value)) { return true; } 52004 if (!value) { return false; } 52005 if (typeof value !== 'function' && typeof value !== 'object') { return false; } 52006 if (hasToStringTag) { return tryFunctionObject(value); } 52007 if (isES6ClassFn(value)) { return false; } 52008 var strClass = toStr.call(value); 52009 if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; } 52010 return tryFunctionObject(value); 52011 }; 52012 52013 52014/***/ }, 52015 52016/***/ 62120 52017(module, __unused_webpack_exports, __webpack_require__) { 52018 52019"use strict"; 52020 52021 52022var getDay = Date.prototype.getDay; 52023var tryDateObject = function tryDateGetDayCall(value) { 52024 try { 52025 getDay.call(value); 52026 return true; 52027 } catch (e) { 52028 return false; 52029 } 52030}; 52031 52032var toStr = Object.prototype.toString; 52033var dateClass = '[object Date]'; 52034var hasToStringTag = __webpack_require__(49092)(); 52035 52036module.exports = function isDateObject(value) { 52037 if (typeof value !== 'object' || value === null) { 52038 return false; 52039 } 52040 return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; 52041}; 52042 52043 52044/***/ }, 52045 52046/***/ 83802 52047(module) { 52048 52049"use strict"; 52050 52051 52052/** @const */ 52053var $Map = typeof Map === 'function' && Map.prototype ? Map : null; 52054var $Set = typeof Set === 'function' && Set.prototype ? Set : null; 52055 52056var exported; 52057 52058if (!$Map) { 52059 /** @type {import('.')} */ 52060 // eslint-disable-next-line no-unused-vars 52061 exported = function isMap(x) { 52062 // `Map` is not present in this environment. 52063 return false;
52064 }; 52065} 52066 52067var $mapHas = $Map ? Map.prototype.has : null; 52068var $setHas = $Set ? Set.prototype.has : null; 52069if (!exported && !$mapHas) { 52070 /** @type {import('.')} */ 52071 // eslint-disable-next-line no-unused-vars 52072 exported = function isMap(x) { 52073 // `Map` does not have a `has` method 52074 return false; 52075 }; 52076} 52077 52078/** @type {import('.')} */ 52079module.exports = exported || function isMap(x) { 52080 if (!x || typeof x !== 'object') { 52081 return false; 52082 } 52083 try { 52084 $mapHas.call(x); 52085 if ($setHas) { 52086 try { 52087 $setHas.call(x); 52088 } catch (e) { 52089 return true; 52090 } 52091 } 52092 // @ts-expect-error TS can't figure out that $Map is always truthy here 52093 return x instanceof $Map; // core-js workaround, pre-v2.5.0 52094 } catch (e) {} 52095 return false; 52096}; 52097 52098 52099/***/ }, 52100 52101/***/ 21703 52102(module, __unused_webpack_exports, __webpack_require__) { 52103 52104"use strict"; 52105 52106 52107var numToStr = Number.prototype.toString; 52108var tryNumberObject = function tryNumberObject(value) { 52109 try { 52110 numToStr.call(value); 52111 return true; 52112 } catch (e) { 52113 return false; 52114 } 52115}; 52116var toStr = Object.prototype.toString; 52117var numClass = '[object Number]'; 52118var hasToStringTag = __webpack_require__(49092)(); 52119 52120module.exports = function isNumberObject(value) { 52121 if (typeof value === 'number') { 52122 return true; 52123 } 52124 if (typeof value !== 'object') { 52125 return false; 52126 } 52127 return hasToStringTag ? tryNumberObject(value) : toStr.call(value) === numClass; 52128}; 52129 52130 52131/***/ }, 52132 52133/***/ 14035 52134(module, __unused_webpack_exports, __webpack_require__) { 52135 52136"use strict"; 52137 52138 52139var callBound = __webpack_require__(38075); 52140var hasToStringTag = __webpack_require__(49092)(); 52141var has; 52142var $exec; 52143var isRegexMarker; 52144var badStringifier; 52145 52146if (hasToStringTag) { 52147 has = callBound('Object.prototype.hasOwnProperty'); 52148 $exec = callBound('RegExp.prototype.exec'); 52149 isRegexMarker = {}; 52150 52151 var throwRegexMarker = function () { 52152 throw isRegexMarker; 52153 }; 52154 badStringifier = { 52155 toString: throwRegexMarker, 52156 valueOf: throwRegexMarker 52157 }; 52158 52159 if (typeof Symbol.toPrimitive === 'symbol') { 52160 badStringifier[Symbol.toPrimitive] = throwRegexMarker; 52161 } 52162} 52163 52164var $toString = callBound('Object.prototype.toString'); 52165var gOPD = Object.getOwnPropertyDescriptor; 52166var regexClass = '[object RegExp]'; 52167 52168module.exports = hasToStringTag 52169 // eslint-disable-next-line consistent-return 52170 ? function isRegex(value) { 52171 if (!value || typeof value !== 'object') { 52172 return false; 52173 } 52174 52175 var descriptor = gOPD(value, 'lastIndex'); 52176 var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); 52177 if (!hasLastIndexDataProperty) { 52178 return false; 52179 } 52180 52181 try { 52182 $exec(value, badStringifier); 52183 } catch (e) { 52184 return e === isRegexMarker; 52185 } 52186 } 52187 : function isRegex(value) { 52188 // In older browsers, typeof regex incorrectly returns 'function' 52189 if (!value || (typeof value !== 'object' && typeof value !== 'function')) { 52190 return false; 52191 } 52192 52193 return $toString(value) === regexClass; 52194 }; 52195 52196 52197/***/ }, 52198 52199/***/ 90256 52200(module) { 52201 52202"use strict"; 52203 52204 52205var $Map = typeof Map === 'function' && Map.prototype ? Map : null; 52206var $Set = typeof Set === 'function' && Set.prototype ? Set : null; 52207 52208var exported; 52209 52210if (!$Set) { 52211 /** @type {import('.')} */ 52212 // eslint-disable-next-line no-unused-vars 52213 exported = function isSet(x) { 52214 // `Set` is not present in this environment. 52215 return false; 52216 }; 52217} 52218 52219var $mapHas = $Map ? Map.prototype.has : null; 52220var $setHas = $Set ? Set.prototype.has : null; 52221if (!exported && !$setHas) { 52222 /** @type {import('.')} */ 52223 // eslint-disable-next-line no-unused-vars 52224 exported = function isSet(x) { 52225 // `Set` does not have a `has` method 52226 return false; 52227 }; 52228} 52229 52230/** @type {import('.')} */ 52231module.exports = exported || function isSet(x) { 52232 if (!x || typeof x !== 'object') { 52233 return false; 52234 } 52235 try { 52236 $setHas.call(x); 52237 if ($mapHas) { 52238 try { 52239 $mapHas.call(x); 52240 } catch (e) { 52241 return true; 52242 } 52243 } 52244 // @ts-expect-error TS can't figure out that $Set is always truthy here 52245 return x instanceof $Set; // core-js workaround, pre-v2.5.0 52246 } catch (e) {} 52247 return false; 52248}; 52249 52250 52251/***/ }, 52252 52253/***/ 37070 52254(module, __unused_webpack_exports, __webpack_require__) { 52255 52256"use strict"; 52257 52258 52259var callBound = __webpack_require__(38075); 52260 52261var $byteLength = callBound('SharedArrayBuffer.prototype.byteLength', true); 52262 52263/** @type {import('.')} */ 52264module.exports = $byteLength 52265 ? function isSharedArrayBuffer(obj) { 52266 if (!obj || typeof obj !== 'object') { 52267 return false;
52268 } 52269 try { 52270 $byteLength(obj); 52271 return true; 52272 } catch (e) { 52273 return false; 52274 } 52275 } 52276 : function isSharedArrayBuffer(obj) { // eslint-disable-line no-unused-vars 52277 return false; 52278 }; 52279 52280 52281/***/ }, 52282 52283/***/ 4761 52284(module, __unused_webpack_exports, __webpack_require__) { 52285 52286"use strict"; 52287 52288 52289var strValue = String.prototype.valueOf; 52290var tryStringObject = function tryStringObject(value) { 52291 try { 52292 strValue.call(value); 52293 return true; 52294 } catch (e) { 52295 return false; 52296 } 52297}; 52298var toStr = Object.prototype.toString; 52299var strClass = '[object String]'; 52300var hasToStringTag = __webpack_require__(49092)(); 52301 52302module.exports = function isString(value) { 52303 if (typeof value === 'string') { 52304 return true; 52305 } 52306 if (typeof value !== 'object') { 52307 return false; 52308 } 52309 return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass; 52310}; 52311 52312 52313/***/ }, 52314 52315/***/ 93612 52316(module, __unused_webpack_exports, __webpack_require__) { 52317 52318"use strict"; 52319 52320 52321var toStr = Object.prototype.toString; 52322var hasSymbols = __webpack_require__(64039)(); 52323 52324if (hasSymbols) { 52325 var symToStr = Symbol.prototype.toString; 52326 var symStringRegex = /^Symbol\(.*\)$/; 52327 var isSymbolObject = function isRealSymbolObject(value) { 52328 if (typeof value.valueOf() !== 'symbol') { 52329 return false; 52330 } 52331 return symStringRegex.test(symToStr.call(value)); 52332 }; 52333 52334 module.exports = function isSymbol(value) { 52335 if (typeof value === 'symbol') { 52336 return true; 52337 } 52338 if (toStr.call(value) !== '[object Symbol]') { 52339 return false; 52340 } 52341 try { 52342 return isSymbolObject(value); 52343 } catch (e) { 52344 return false; 52345 } 52346 }; 52347} else { 52348 52349 module.exports = function isSymbol(value) { 52350 // this environment does not support Symbols. 52351 return false && 0; 52352 }; 52353} 52354 52355 52356/***/ }, 52357 52358/***/ 87842 52359(module) { 52360 52361"use strict"; 52362 52363 52364var $WeakMap = typeof WeakMap === 'function' && WeakMap.prototype ? WeakMap : null; 52365var $WeakSet = typeof WeakSet === 'function' && WeakSet.prototype ? WeakSet : null; 52366 52367var exported; 52368 52369if (!$WeakMap) { 52370 /** @type {import('.')} */ 52371 // eslint-disable-next-line no-unused-vars 52372 exported = function isWeakMap(x) { 52373 // `WeakMap` is not present in this environment. 52374 return false; 52375 }; 52376} 52377 52378var $mapHas = $WeakMap ? $WeakMap.prototype.has : null; 52379var $setHas = $WeakSet ? $WeakSet.prototype.has : null; 52380if (!exported && !$mapHas) { 52381 /** @type {import('.')} */ 52382 // eslint-disable-next-line no-unused-vars 52383 exported = function isWeakMap(x) { 52384 // `WeakMap` does not have a `has` method 52385 return false; 52386 }; 52387} 52388 52389/** @type {import('.')} */ 52390module.exports = exported || function isWeakMap(x) { 52391 if (!x || typeof x !== 'object') { 52392 return false; 52393 } 52394 try { 52395 $mapHas.call(x, $mapHas); 52396 if ($setHas) { 52397 try { 52398 $setHas.call(x, $setHas); 52399 } catch (e) { 52400 return true; 52401 } 52402 } 52403 // @ts-expect-error TS can't figure out that $WeakMap is always truthy here 52404 return x instanceof $WeakMap; // core-js workaround, pre-v3 52405 } catch (e) {} 52406 return false; 52407}; 52408 52409 52410/***/ }, 52411 52412/***/ 12648 52413(module, __unused_webpack_exports, __webpack_require__) { 52414 52415"use strict"; 52416 52417 52418var GetIntrinsic = __webpack_require__(70453); 52419var callBound = __webpack_require__(38075); 52420 52421var $WeakSet = GetIntrinsic('%WeakSet%', true); 52422 52423var $setHas = callBound('WeakSet.prototype.has', true); 52424 52425if ($setHas) { 52426 var $mapHas = callBound('WeakMap.prototype.has', true); 52427 52428 /** @type {import('.')} */ 52429 module.exports = function isWeakSet(x) { 52430 if (!x || typeof x !== 'object') { 52431 return false; 52432 } 52433 try { 52434 $setHas(x, $setHas); 52435 if ($mapHas) { 52436 try { 52437 $mapHas(x, $mapHas); 52438 } catch (e) { 52439 return true; 52440 } 52441 } 52442 // @ts-expect-error TS can't figure out that $WeakSet is always truthy here 52443 return x instanceof $WeakSet; // core-js workaround, pre-v3 52444 } catch (e) {} 52445 return false; 52446 }; 52447} else { 52448 /** @type {import('.')} */ 52449 // eslint-disable-next-line no-unused-vars 52450 module.exports = function isWeakSet(x) { 52451 // `WeakSet` does not exist, or does not have a `has` method 52452 return false; 52453 }; 52454} 52455 52456 52457/***/ }, 52458 52459/***/ 64634 52460(module) { 52461 52462var toString = {}.toString; 52463 52464module.exports = Array.isArray || function (arr) { 52465 return toString.call(arr) == '[object Array]'; 52466}; 52467 52468 52469/***/ }, 52470 52471/***/ 60328 52472(module, __unused_webpack_exports, __webpack_require__) { 52473 52474// the whatwg-fetch polyfill installs the fetch() function 52475// on the global object (window or self) 52476// 52477// Return that as the export for use in Webpack, Browserify etc. 52478__webpack_require__(78624); 52479module.exports = self.fetch.bind(self); 52480 52481 52482/***/ }, 52483 52484/***/ 47149 52485(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 52486 52487"use strict"; 52488 52489// EXPORTS 52490__webpack_require__.d(__webpack_exports__, { 52491 Ay: () => (/* binding */ mapJson), 52492 oA: () => (/* binding */ jpath) 52493}); 52494 52495// UNUSED EXPORTS: mapJsonAsync 52496 52497;// ./node_modules/jsonpath-plus/dist/index-browser-esm.js 52498/** 52499 * @implements {IHooks} 52500 */ 52501class Hooks { 52502 /** 52503 * @callback HookCallback 52504 * @this {*|Jsep} this 52505 * @param {Jsep} env 52506 * @returns: void 52507 */ 52508 /** 52509 * Adds the given callback to the list of callbacks for the given hook. 52510 * 52511 * The callback will be invoked when the hook it is registered for is run. 52512 * 52513 * One callback function can be registered to multiple hooks and the same hook multiple times. 52514 * 52515 * @param {string|object} name The name of the hook, or an object of callbacks keyed by name 52516 * @param {HookCallback|boolean} callback The callback function which is given environment variables. 52517 * @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom) 52518 * @public 52519 */ 52520 add(name, callback, first) { 52521 if (typeof arguments[0] != 'string') { 52522 // Multiple hook callbacks, keyed by name 52523 for (let name in arguments[0]) { 52524 this.add(name, arguments[0][name], arguments[1]); 52525 } 52526 } else {
52527 (Array.isArray(name) ? name : [name]).forEach(function (name) { 52528 this[name] = this[name] || []; 52529 if (callback) { 52530 this[name][first ? 'unshift' : 'push'](callback); 52531 } 52532 }, this); 52533 } 52534 } 52535 52536 /** 52537 * Runs a hook invoking all registered callbacks with the given environment variables. 52538 * 52539 * Callbacks will be invoked synchronously and in the order in which they were registered. 52540 * 52541 * @param {string} name The name of the hook. 52542 * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered. 52543 * @public 52544 */ 52545 run(name, env) { 52546 this[name] = this[name] || []; 52547 this[name].forEach(function (callback) { 52548 callback.call(env && env.context ? env.context : env, env); 52549 }); 52550 } 52551} 52552 52553/** 52554 * @implements {IPlugins} 52555 */ 52556class Plugins { 52557 constructor(jsep) { 52558 this.jsep = jsep; 52559 this.registered = {}; 52560 } 52561 52562 /** 52563 * @callback PluginSetup 52564 * @this {Jsep} jsep 52565 * @returns: void 52566 */ 52567 /** 52568 * Adds the given plugin(s) to the registry 52569 * 52570 * @param {object} plugins 52571 * @param {string} plugins.name The name of the plugin 52572 * @param {PluginSetup} plugins.init The init function 52573 * @public 52574 */ 52575 register() { 52576 for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) { 52577 plugins[_key] = arguments[_key]; 52578 } 52579 plugins.forEach(plugin => { 52580 if (typeof plugin !== 'object' || !plugin.name || !plugin.init) { 52581 throw new Error('Invalid JSEP plugin format'); 52582 } 52583 if (this.registered[plugin.name]) { 52584 // already registered. Ignore. 52585 return; 52586 } 52587 plugin.init(this.jsep); 52588 this.registered[plugin.name] = plugin; 52589 }); 52590 } 52591} 52592 52593// JavaScript Expression Parser (JSEP) 1.4.0 52594 52595class Jsep { 52596 /** 52597 * @returns {string} 52598 */ 52599 static get version() { 52600 // To be filled in by the template 52601 return '1.4.0'; 52602 } 52603 52604 /** 52605 * @returns {string} 52606 */ 52607 static toString() { 52608 return 'JavaScript Expression Parser (JSEP) v' + Jsep.version; 52609 } 52610 // ==================== CONFIG ================================ 52611 /** 52612 * @method addUnaryOp 52613 * @param {string} op_name The name of the unary op to add 52614 * @returns {Jsep} 52615 */ 52616 static addUnaryOp(op_name) { 52617 Jsep.max_unop_len = Math.max(op_name.length, Jsep.max_unop_len); 52618 Jsep.unary_ops[op_name] = 1; 52619 return Jsep; 52620 } 52621 52622 /** 52623 * @method jsep.addBinaryOp 52624 * @param {string} op_name The name of the binary op to add 52625 * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence 52626 * @param {boolean} [isRightAssociative=false] whether operator is right-associative 52627 * @returns {Jsep} 52628 */ 52629 static addBinaryOp(op_name, precedence, isRightAssociative) { 52630 Jsep.max_binop_len = Math.max(op_name.length, Jsep.max_binop_len); 52631 Jsep.binary_ops[op_name] = precedence; 52632 if (isRightAssociative) { 52633 Jsep.right_associative.add(op_name); 52634 } else { 52635 Jsep.right_associative.delete(op_name); 52636 } 52637 return Jsep; 52638 } 52639 52640 /** 52641 * @method addIdentifierChar 52642 * @param {string} char The additional character to treat as a valid part of an identifier 52643 * @returns {Jsep} 52644 */ 52645 static addIdentifierChar(char) { 52646 Jsep.additional_identifier_chars.add(char); 52647 return Jsep; 52648 } 52649 52650 /** 52651 * @method addLiteral 52652 * @param {string} literal_name The name of the literal to add 52653 * @param {*} literal_value The value of the literal 52654 * @returns {Jsep} 52655 */ 52656 static addLiteral(literal_name, literal_value) { 52657 Jsep.literals[literal_name] = literal_value; 52658 return Jsep; 52659 } 52660 52661 /** 52662 * @method removeUnaryOp 52663 * @param {string} op_name The name of the unary op to remove 52664 * @returns {Jsep} 52665 */ 52666 static removeUnaryOp(op_name) { 52667 delete Jsep.unary_ops[op_name]; 52668 if (op_name.length === Jsep.max_unop_len) { 52669 Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops); 52670 } 52671 return Jsep; 52672 } 52673 52674 /** 52675 * @method removeAllUnaryOps 52676 * @returns {Jsep} 52677 */ 52678 static removeAllUnaryOps() { 52679 Jsep.unary_ops = {}; 52680 Jsep.max_unop_len = 0; 52681 return Jsep; 52682 } 52683 52684 /** 52685 * @method removeIdentifierChar 52686 * @param {string} char The additional character to stop treating as a valid part of an identifier 52687 * @returns {Jsep} 52688 */ 52689 static removeIdentifierChar(char) { 52690 Jsep.additional_identifier_chars.delete(char); 52691 return Jsep; 52692 } 52693 52694 /** 52695 * @method removeBinaryOp 52696 * @param {string} op_name The name of the binary op to remove 52697 * @returns {Jsep} 52698 */ 52699 static removeBinaryOp(op_name) {
52700 delete Jsep.binary_ops[op_name]; 52701 if (op_name.length === Jsep.max_binop_len) { 52702 Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops); 52703 } 52704 Jsep.right_associative.delete(op_name); 52705 return Jsep; 52706 } 52707 52708 /** 52709 * @method removeAllBinaryOps 52710 * @returns {Jsep} 52711 */ 52712 static removeAllBinaryOps() { 52713 Jsep.binary_ops = {}; 52714 Jsep.max_binop_len = 0; 52715 return Jsep; 52716 } 52717 52718 /** 52719 * @method removeLiteral 52720 * @param {string} literal_name The name of the literal to remove 52721 * @returns {Jsep} 52722 */ 52723 static removeLiteral(literal_name) { 52724 delete Jsep.literals[literal_name]; 52725 return Jsep; 52726 } 52727 52728 /** 52729 * @method removeAllLiterals 52730 * @returns {Jsep} 52731 */ 52732 static removeAllLiterals() { 52733 Jsep.literals = {}; 52734 return Jsep; 52735 } 52736 // ==================== END CONFIG ============================ 52737 52738 /** 52739 * @returns {string} 52740 */ 52741 get char() { 52742 return this.expr.charAt(this.index); 52743 } 52744 52745 /** 52746 * @returns {number} 52747 */ 52748 get code() { 52749 return this.expr.charCodeAt(this.index); 52750 } 52751 /** 52752 * @param {string} expr a string with the passed in express 52753 * @returns Jsep 52754 */ 52755 constructor(expr) { 52756 // `index` stores the character number we are currently at 52757 // All of the gobbles below will modify `index` as we move along 52758 this.expr = expr; 52759 this.index = 0; 52760 } 52761 52762 /** 52763 * static top-level parser 52764 * @returns {jsep.Expression} 52765 */ 52766 static parse(expr) { 52767 return new Jsep(expr).parse(); 52768 } 52769 52770 /** 52771 * Get the longest key length of any object 52772 * @param {object} obj 52773 * @returns {number} 52774 */ 52775 static getMaxKeyLen(obj) { 52776 return Math.max(0, ...Object.keys(obj).map(k => k.length)); 52777 } 52778 52779 /** 52780 * `ch` is a character code in the next three functions 52781 * @param {number} ch 52782 * @returns {boolean} 52783 */ 52784 static isDecimalDigit(ch) { 52785 return ch >= 48 && ch <= 57; // 0...9 52786 } 52787 52788 /** 52789 * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float. 52790 * @param {string} op_val 52791 * @returns {number} 52792 */ 52793 static binaryPrecedence(op_val) { 52794 return Jsep.binary_ops[op_val] || 0; 52795 } 52796 52797 /** 52798 * Looks for start of identifier 52799 * @param {number} ch 52800 * @returns {boolean} 52801 */ 52802 static isIdentifierStart(ch) { 52803 return ch >= 65 && ch <= 90 || 52804 // A...Z 52805 ch >= 97 && ch <= 122 || 52806 // a...z 52807 ch >= 128 && !Jsep.binary_ops[String.fromCharCode(ch)] || 52808 // any non-ASCII that is not an operator 52809 Jsep.additional_identifier_chars.has(String.fromCharCode(ch)); // additional characters 52810 } 52811 52812 /** 52813 * @param {number} ch 52814 * @returns {boolean} 52815 */ 52816 static isIdentifierPart(ch) { 52817 return Jsep.isIdentifierStart(ch) || Jsep.isDecimalDigit(ch); 52818 } 52819 52820 /** 52821 * throw error at index of the expression 52822 * @param {string} message 52823 * @throws 52824 */ 52825 throwError(message) { 52826 const error = new Error(message + ' at character ' + this.index); 52827 error.index = this.index; 52828 error.description = message; 52829 throw error; 52830 } 52831 52832 /** 52833 * Run a given hook 52834 * @param {string} name 52835 * @param {jsep.Expression|false} [node] 52836 * @returns {?jsep.Expression} 52837 */ 52838 runHook(name, node) { 52839 if (Jsep.hooks[name]) { 52840 const env = { 52841 context: this, 52842 node 52843 }; 52844 Jsep.hooks.run(name, env); 52845 return env.node; 52846 } 52847 return node; 52848 } 52849 52850 /** 52851 * Runs a given hook until one returns a node 52852 * @param {string} name 52853 * @returns {?jsep.Expression} 52854 */ 52855 searchHook(name) { 52856 if (Jsep.hooks[name]) { 52857 const env = { 52858 context: this 52859 }; 52860 Jsep.hooks[name].find(function (callback) { 52861 callback.call(env.context, env); 52862 return env.node; 52863 }); 52864 return env.node; 52865 } 52866 } 52867 52868 /** 52869 * Push `index` up to the next non-space character 52870 */ 52871 gobbleSpaces() {
52872 let ch = this.code; 52873 // Whitespace 52874 while (ch === Jsep.SPACE_CODE || ch === Jsep.TAB_CODE || ch === Jsep.LF_CODE || ch === Jsep.CR_CODE) { 52875 ch = this.expr.charCodeAt(++this.index); 52876 } 52877 this.runHook('gobble-spaces'); 52878 } 52879 52880 /** 52881 * Top-level method to parse all expressions and returns compound or single node 52882 * @returns {jsep.Expression} 52883 */ 52884 parse() { 52885 this.runHook('before-all'); 52886 const nodes = this.gobbleExpressions(); 52887 52888 // If there's only one expression just try returning the expression 52889 const node = nodes.length === 1 ? nodes[0] : { 52890 type: Jsep.COMPOUND, 52891 body: nodes 52892 }; 52893 return this.runHook('after-all', node); 52894 } 52895 52896 /** 52897 * top-level parser (but can be reused within as well) 52898 * @param {number} [untilICode] 52899 * @returns {jsep.Expression[]} 52900 */ 52901 gobbleExpressions(untilICode) { 52902 let nodes = [], 52903 ch_i, 52904 node; 52905 while (this.index < this.expr.length) { 52906 ch_i = this.code; 52907 52908 // Expressions can be separated by semicolons, commas, or just inferred without any 52909 // separators 52910 if (ch_i === Jsep.SEMCOL_CODE || ch_i === Jsep.COMMA_CODE) { 52911 this.index++; // ignore separators 52912 } else { 52913 // Try to gobble each expression individually 52914 if (node = this.gobbleExpression()) { 52915 nodes.push(node); 52916 // If we weren't able to find a binary expression and are out of room, then 52917 // the expression passed in probably has too much 52918 } else if (this.index < this.expr.length) { 52919 if (ch_i === untilICode) { 52920 break; 52921 } 52922 this.throwError('Unexpected "' + this.char + '"'); 52923 } 52924 } 52925 } 52926 return nodes; 52927 } 52928 52929 /** 52930 * The main parsing function. 52931 * @returns {?jsep.Expression} 52932 */ 52933 gobbleExpression() { 52934 const node = this.searchHook('gobble-expression') || this.gobbleBinaryExpression(); 52935 this.gobbleSpaces(); 52936 return this.runHook('after-expression', node); 52937 } 52938 52939 /** 52940 * Search for the operation portion of the string (e.g. `+`, `===`) 52941 * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`) 52942 * and move down from 3 to 2 to 1 character until a matching binary operation is found 52943 * then, return that binary operation 52944 * @returns {string|boolean} 52945 */ 52946 gobbleBinaryOp() { 52947 this.gobbleSpaces(); 52948 let to_check = this.expr.substr(this.index, Jsep.max_binop_len); 52949 let tc_len = to_check.length; 52950 while (tc_len > 0) { 52951 // Don't accept a binary op when it is an identifier. 52952 // Binary ops that start with a identifier-valid character must be followed 52953 // by a non identifier-part valid character 52954 if (Jsep.binary_ops.hasOwnProperty(to_check) && (!Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) { 52955 this.index += tc_len; 52956 return to_check; 52957 } 52958 to_check = to_check.substr(0, --tc_len); 52959 } 52960 return false; 52961 } 52962 52963 /** 52964 * This function is responsible for gobbling an individual expression, 52965 * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)` 52966 * @returns {?jsep.BinaryExpression} 52967 */ 52968 gobbleBinaryExpression() { 52969 let node, biop, prec, stack, biop_info, left, right, i, cur_bi
52969op; 52970 52971 // First, try to get the leftmost thing 52972 // Then, check to see if there's a binary operator operating on that leftmost thing 52973 // Don't gobbleBinaryOp without a left-hand-side 52974 left = this.gobbleToken(); 52975 if (!left) { 52976 return left; 52977 } 52978 biop = this.gobbleBinaryOp(); 52979 52980 // If there wasn't a binary operator, just return the leftmost node 52981 if (!biop) { 52982 return left; 52983 } 52984 52985 // Otherwise, we need to start a stack to properly place the binary operations in their 52986 // precedence structure 52987 biop_info = { 52988 value: biop, 52989 prec: Jsep.binaryPrecedence(biop), 52990 right_a: Jsep.right_associative.has(biop) 52991 }; 52992 right = this.gobbleToken(); 52993 if (!right) { 52994 this.throwError("Expected expression after " + biop); 52995 } 52996 stack = [left, biop_info, right]; 52997 52998 // Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm) 52999 while (biop = this.gobbleBinaryOp()) { 53000 prec = Jsep.binaryPrecedence(biop); 53001 if (prec === 0) { 53002 this.index -= biop.length; 53003 break; 53004 } 53005 biop_info = { 53006 value: biop, 53007 prec, 53008 right_a: Jsep.right_associative.has(biop) 53009 }; 53010 cur_biop = biop; 53011 53012 // Reduce: make a binary expression from the three topmost entries. 53013 const comparePrev = prev => biop_info.right_a && prev.right_a ? prec > prev.prec : prec <= prev.prec; 53014 while (stack.length > 2 && comparePrev(stack[stack.length - 2])) { 53015 right = stack.pop(); 53016 biop = stack.pop().value; 53017 left = stack.pop(); 53018 node = { 53019 type: Jsep.BINARY_EXP, 53020 operator: biop, 53021 left, 53022 right 53023 }; 53024 stack.push(node); 53025 } 53026 node = this.gobbleToken(); 53027 if (!node) { 53028 this.throwError("Expected expression after " + cur_biop); 53029 } 53030 stack.push(biop_info, node); 53031 } 53032 i = stack.length - 1; 53033 node = stack[i]; 53034 while (i > 1) { 53035 node = { 53036 type: Jsep.BINARY_EXP, 53037 operator: stack[i - 1].value, 53038 left: stack[i - 2], 53039 right: node 53040 }; 53041 i -= 2; 53042 } 53043 return node; 53044 } 53045 53046 /** 53047 * An individual part of a binary expression: 53048 * e.g. `foo.bar(baz)`, `1`, `"abc"`, `(a % 2)` (because it's in parenthesis) 53049 * @returns {boolean|jsep.Expression} 53050 */ 53051 gobbleToken() {
53052 let ch, to_check, tc_len, node; 53053 this.gobbleSpaces(); 53054 node = this.searchHook('gobble-token'); 53055 if (node) { 53056 return this.runHook('after-token', node); 53057 } 53058 ch = this.code; 53059 if (Jsep.isDecimalDigit(ch) || ch === Jsep.PERIOD_CODE) { 53060 // Char code 46 is a dot `.` which can start off a numeric literal 53061 return this.gobbleNumericLiteral(); 53062 } 53063 if (ch === Jsep.SQUOTE_CODE || ch === Jsep.DQUOTE_CODE) { 53064 // Single or double quotes 53065 node = this.gobbleStringLiteral(); 53066 } else if (ch === Jsep.OBRACK_CODE) { 53067 node = this.gobbleArray(); 53068 } else { 53069 to_check = this.expr.substr(this.index, Jsep.max_unop_len); 53070 tc_len = to_check.length; 53071 while (tc_len > 0) { 53072 // Don't accept an unary op when it is an identifier. 53073 // Unary ops that start with a identifier-valid character must be followed 53074 // by a non identifier-part valid character 53075 if (Jsep.unary_ops.hasOwnProperty(to_check) && (!Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) { 53076 this.index += tc_len; 53077 const argument = this.gobbleToken(); 53078 if (!argument) { 53079 this.throwError('missing unaryOp argument'); 53080 } 53081 return this.runHook('after-token', { 53082 type: Jsep.UNARY_EXP, 53083 operator: to_check, 53084 argument, 53085 prefix: true 53086 }); 53087 } 53088 to_check = to_check.substr(0, --tc_len); 53089 } 53090 if (Jsep.isIdentifierStart(ch)) { 53091 node = this.gobbleIdentifier(); 53092 if (Jsep.literals.hasOwnProperty(node.name)) { 53093 node = { 53094 type: Jsep.LITERAL, 53095 value: Jsep.literals[node.name], 53096 raw: node.name 53097 }; 53098 } else if (node.name === Jsep.this_str) { 53099 node = { 53100 type: Jsep.THIS_EXP 53101 }; 53102 } 53103 } else if (ch === Jsep.OPAREN_CODE) { 53104 // open parenthesis 53105 node = this.gobbleGroup(); 53106 } 53107 } 53108 if (!node) { 53109 return this.runHook('after-token', false); 53110 } 53111 node = this.gobbleTokenProperty(node); 53112 return this.runHook('after-token', node); 53113 } 53114 53115 /** 53116 * Gobble properties of of identifiers/strings/arrays/groups. 53117 * e.g. `foo`, `bar.baz`, `foo['bar'].baz` 53118 * It also gobbles function calls: 53119 * e.g. `Math.acos(obj.angle)` 53120 * @param {jsep.Expression} node 53121 * @returns {jsep.Expression} 53122 */ 53123 gobbleTokenProperty(node) { 53124 this.gobbleSpaces(); 53125 let ch = this.code; 53126 while (ch === Jsep.PERIOD_CODE || ch === Jsep.OBRACK_CODE || ch === Jsep.OPAREN_CODE || ch === Jsep.QUMARK_CODE) { 53127 let optional; 53128 if (ch === Jsep.QUMARK_CODE) { 53129 if (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE) { 53130 break; 53131 } 53132 optional = true; 53133 this.index += 2; 53134 this.gobbleSpaces(); 53135 ch = this.code; 53136 } 53137 this.index++; 53138 if (ch === Jsep.OBRACK_CODE) { 53139 node = { 53140 type: Jsep.MEMBER_EXP, 53141 computed: true, 53142 object: node, 53143 property: this.gobbleExpression() 53144 }; 53145 if (!node.property) { 53146 this.throwError('Unexpected "' + this.char + '"'); 53147 } 53148 this.gobbleSpaces(); 53149 ch = this.code; 53150 if (ch !== Jsep.CBRACK_CODE) { 53151 this.throwError('Unclosed ['); 53152 } 53153 this.index++; 53154 } else if (ch === Jsep.OPAREN_CODE) { 53155 // A function call is being made; gobble all the arguments 53156 node = { 53157 type: Jsep.CALL_EXP, 53158 'arguments': this.gobbleArguments(Jsep.CPAREN_CODE), 53159 callee: node 53160 }; 53161 } else if (ch === Jsep.PERIOD_CODE || optional) { 53162 if (optional) { 53163 this.index--; 53164 } 53165 this.gobbleSpaces(); 53166 node = { 53167 type: Jsep.MEMBER_EXP, 53168 computed: false, 53169 object: node, 53170 property: this.gobbleIdentifier() 53171 }; 53172 } 53173 if (optional) { 53174 node.optional = true; 53175 }
53175 // else leave undefined for compatibility with esprima 53176 53177 this.gobbleSpaces(); 53178 ch = this.code; 53179 } 53180 return node; 53181 } 53182 53183 /** 53184 * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to 53185 * keep track of everything in the numeric literal and then calling `parseFloat` on that string 53186 * @returns {jsep.Literal} 53187 */ 53188 gobbleNumericLiteral() { 53189 let number = '', 53190 ch, 53191 chCode; 53192 while (Jsep.isDecimalDigit(this.code)) { 53193 number += this.expr.charAt(this.index++); 53194 } 53195 if (this.code === Jsep.PERIOD_CODE) { 53196 // can start with a decimal marker 53197 number += this.expr.charAt(this.index++); 53198 while (Jsep.isDecimalDigit(this.code)) { 53199 number += this.expr.charAt(this.index++); 53200 } 53201 } 53202 ch = this.char; 53203 if (ch === 'e' || ch === 'E') { 53204 // exponent marker 53205 number += this.expr.charAt(this.index++); 53206 ch = this.char; 53207 if (ch === '+' || ch === '-') { 53208 // exponent sign 53209 number += this.expr.charAt(this.index++); 53210 } 53211 while (Jsep.isDecimalDigit(this.code)) { 53212 // exponent itself 53213 number += this.expr.charAt(this.index++); 53214 } 53215 if (!Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1))) { 53216 this.throwError('Expected exponent (' + number + this.char + ')'); 53217 } 53218 } 53219 chCode = this.code; 53220 53221 // Check to make sure this isn't a variable name that start with a number (123abc) 53222 if (Jsep.isIdentifierStart(chCode)) { 53223 this.throwError('Variable names cannot start with a number (' + number + this.char + ')'); 53224 } else if (chCode === Jsep.PERIOD_CODE || number.length === 1 && number.charCodeAt(0) === Jsep.PERIOD_CODE) { 53225 this.throwError('Unexpected period'); 53226 } 53227 return { 53228 type: Jsep.LITERAL, 53229 value: parseFloat(number), 53230 raw: number 53231 }; 53232 } 53233 53234 /** 53235 * Parses a string literal, staring with single or double quotes with basic support for escape codes 53236 * e.g. `"hello world"`, `'this is\nJSEP'` 53237 * @returns {jsep.Literal} 53238 */ 53239 gobbleStringLiteral() { 53240 let str = ''; 53241 const startIndex = this.index; 53242 const quote = this.expr.charAt(this.index++); 53243 let closed = false; 53244 while (this.index < this.expr.length) { 53245 let ch = this.expr.charAt(this.index++); 53246 if (ch === quote) { 53247 closed = true; 53248 break; 53249 } else if (ch === '\\') { 53250 // Check for all of the common escape codes 53251 ch = this.expr.charAt(this.index++); 53252 switch (ch) { 53253 case 'n': 53254 str += '\n'; 53255 break; 53256 case 'r': 53257 str += '\r'; 53258 break; 53259 case 't': 53260 str += '\t'; 53261 break; 53262 case 'b': 53263 str += '\b'; 53264 break; 53265 case 'f': 53266 str += '\f'; 53267 break; 53268 case 'v': 53269 str += '\x0B'; 53270 break; 53271 default: 53272 str += ch; 53273 } 53274 } else { 53275 str += ch; 53276 } 53277 } 53278 if (!closed) { 53279 this.throwError('Unclosed quote after "' + str + '"'); 53280 } 53281 return { 53282 type: Jsep.LITERAL, 53283 value: str, 53284 raw: this.expr.substring(startIndex, this.index) 53285 }; 53286 } 53287 53288 /** 53289 * Gobbles only identifiers 53290 * e.g.: `foo`, `_value`, `$x1` 53291 * Also, this function checks if that identifier is a literal: 53292 * (e.g. `true`, `false`, `null`) or `this` 53293 * @returns {jsep.Identifier} 53294 */ 53295 gobbleIdentifier() {
53296 let ch = this.code, 53297 start = this.index; 53298 if (Jsep.isIdentifierStart(ch)) { 53299 this.index++; 53300 } else { 53301 this.throwError('Unexpected ' + this.char); 53302 } 53303 while (this.index < this.expr.length) { 53304 ch = this.code; 53305 if (Jsep.isIdentifierPart(ch)) { 53306 this.index++; 53307 } else { 53308 break; 53309 } 53310 } 53311 return { 53312 type: Jsep.IDENTIFIER, 53313 name: this.expr.slice(start, this.index) 53314 }; 53315 } 53316 53317 /** 53318 * Gobbles a list of arguments within the context of a function call 53319 * or array literal. This function also assumes that the opening character 53320 * `(` or `[` has already been gobbled, and gobbles expressions and commas 53321 * until the terminator character `)` or `]` is encountered. 53322 * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]` 53323 * @param {number} termination 53324 * @returns {jsep.Expression[]} 53325 */ 53326 gobbleArguments(termination) { 53327 const args = []; 53328 let closed = false; 53329 let separator_count = 0; 53330 while (this.index < this.expr.length) { 53331 this.gobbleSpaces(); 53332 let ch_i = this.code; 53333 if (ch_i === termination) { 53334 // done parsing 53335 closed = true; 53336 this.index++; 53337 if (termination === Jsep.CPAREN_CODE && separator_count && separator_count >= args.length) { 53338 this.throwError('Unexpected token ' + String.fromCharCode(termination)); 53339 } 53340 break; 53341 } else if (ch_i === Jsep.COMMA_CODE) { 53342 // between expressions 53343 this.index++; 53344 separator_count++; 53345 if (separator_count !== args.length) { 53346 // missing argument 53347 if (termination === Jsep.CPAREN_CODE) { 53348 this.throwError('Unexpected token ,'); 53349 } else if (termination === Jsep.CBRACK_CODE) { 53350 for (let arg = args.length; arg < separator_count; arg++) { 53351 args.push(null); 53352 } 53353 } 53354 } 53355 } else if (args.length !== separator_count && separator_count !== 0) { 53356 // NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments 53357 this.throwError('Expected comma'); 53358 } else { 53359 const node = this.gobbleExpression(); 53360 if (!node || node.type === Jsep.COMPOUND) { 53361 this.throwError('Expected comma'); 53362 } 53363 args.push(node); 53364 } 53365 } 53366 if (!closed) { 53367 this.throwError('Expected ' + String.fromCharCode(termination)); 53368 } 53369 return args; 53370 } 53371 53372 /** 53373 * Responsible for parsing a group of things within parentheses `()` 53374 * that have no identifier in front (so not a function call) 53375 * This function assumes that it needs to gobble the opening parenthesis 53376 * and then tries to gobble everything within that parenthesis, assuming 53377 * that the next thing it should see is the close parenthesis. If not, 53378 * then the expression probably doesn't have a `)` 53379 * @returns {boolean|jsep.Expression} 53380 */ 53381 gobbleGroup() { 53382 this.index++; 53383 let nodes = this.gobbleExpressions(Jsep.CPAREN_CODE); 53384 if (this.code === Jsep.CPAREN_CODE) { 53385 this.index++; 53386 if (nodes.length === 1) { 53387 return nodes[0]; 53388 } else if (!nodes.length) { 53389 return false; 53390 } else { 53391 return { 53392 type: Jsep.SEQUENCE_EXP, 53393 expressions: nodes 53394 }; 53395 } 53396 } else { 53397 this.throwError('Unclosed ('); 53398 } 53399 } 53400 53401 /** 53402 * Responsible for parsing Array literals `[1, 2, 3]` 53403 * This function assumes that it needs to gobble the opening bracket 53404 * and then tries to gobble the expressions as arguments. 53405 * @returns {jsep.ArrayExpression} 53406 */ 53407 gobbleArray() { 53408 this.index++; 53409 return { 53410 type: Jsep.ARRAY_EXP, 53411 elements: this.gobbleArguments(Jsep.CBRACK_CODE) 53412 }; 53413 } 53414} 53415 53416// Static fields: 53417const hooks = new Hooks(); 53418Object.assign(Jsep, { 53419 hooks, 53420 plugins: new Plugins(Jsep), 53421 // Node Types 53422 // ---------- 53423 // This is the full set of types that any JSEP node can be. 53424 // Store them here to save space when minified 53425 COMPOUND: 'Compound', 53426 SEQUENCE_EXP: 'SequenceExpression', 53427 IDENTIFIER: 'Identifier', 53428 MEMBER_EXP: 'MemberExpression', 53429 LITERAL: 'Literal', 53430 THIS_EXP: 'ThisExpression', 53431 CALL_EXP: 'CallExpression', 53432 UNARY_EXP: 'UnaryExpression', 53433 BINARY_EXP: 'BinaryExpression', 53434 ARRAY_EXP: 'ArrayExpression', 53435 TAB_CODE: 9, 53436 LF_CODE: 10, 53437 CR_CODE: 13, 53438 SPACE_CODE: 32, 53439 PERIOD_CODE: 46, 53440 // '.' 53441 COMMA_CODE: 44, 53442 // ',' 53443 SQUOTE_CODE: 39, 53444 // single quote 53445 DQUOTE_CODE: 34, 53446 // double quotes 53447 OPAREN_CODE: 40, 53448 // ( 53449 CPAREN_CODE: 41, 53450 // ) 53451 OBRACK_CODE: 91, 53452 // [ 53453 CBRACK_CODE: 93, 53454 // ] 53455 QUMARK_CODE: 63, 53456 // ? 53457 SEMCOL_CODE: 59, 53458 // ; 53459 COLON_CODE: 58, 53460 // : 53461 53462 // Operations 53463 // ---------- 53464 // Use a quickly-accessible map to store all of the unary operators 53465 // Values are set to `1` (it really doesn't matter) 53466 unary_ops: { 53467 '-': 1, 53468 '!': 1, 53469 '~': 1, 53470 '+': 1 53471 },
53472 // Also use a map for the binary operations but set their values to their 53473 // binary precedence for quick reference (higher number = higher precedence) 53474 // see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence) 53475 binary_ops: { 53476 '||': 1, 53477 '??': 1, 53478 '&&': 2, 53479 '|': 3, 53480 '^': 4, 53481 '&': 5, 53482 '==': 6, 53483 '!=': 6, 53484 '===': 6, 53485 '!==': 6, 53486 '<': 7, 53487 '>': 7, 53488 '<=': 7, 53489 '>=': 7, 53490 '<<': 8, 53491 '>>': 8, 53492 '>>>': 8, 53493 '+': 9, 53494 '-': 9, 53495 '*': 10, 53496 '/': 10, 53497 '%': 10, 53498 '**': 11 53499 }, 53500 // sets specific binary_ops as right-associative 53501 right_associative: new Set(['**']), 53502 // Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char) 53503 additional_identifier_chars: new Set(['$', '_']), 53504 // Literals 53505 // ---------- 53506 // Store the values to return for the various literals we may encounter 53507 literals: { 53508 'true': true, 53509 'false': false, 53510 'null': null 53511 }, 53512 // Except for `this`, which is special. This could be changed to something like `'self'` as well 53513 this_str: 'this' 53514}); 53515Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops); 53516Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops); 53517 53518// Backward Compatibility: 53519const jsep = expr => new Jsep(expr).parse(); 53520const stdClassProps = Object.getOwnPropertyNames(class Test {}); 53521Object.getOwnPropertyNames(Jsep).filter(prop => !stdClassProps.includes(prop) && jsep[prop] === undefined).forEach(m => { 53522 jsep[m] = Jsep[m]; 53523}); 53524jsep.Jsep = Jsep; // allows for const { Jsep } = require('jsep'); 53525 53526const CONDITIONAL_EXP = 'ConditionalExpression'; 53527var ternary = { 53528 name: 'ternary', 53529 init(jsep) { 53530 // Ternary expression: test ? consequent : alternate 53531 jsep.hooks.add('after-expression', function gobbleTernary(env) { 53532 if (env.node && this.code === jsep.QUMARK_CODE) { 53533 this.index++; 53534 const test = env.node; 53535 const consequent = this.gobbleExpression(); 53536 if (!consequent) { 53537 this.throwError('Expected expression'); 53538 } 53539 this.gobbleSpaces(); 53540 if (this.code === jsep.COLON_CODE) { 53541 this.index++; 53542 const alternate = this.gobbleExpression(); 53543 if (!alternate) { 53544 this.throwError('Expected expression'); 53545 } 53546 env.node = { 53547 type: CONDITIONAL_EXP, 53548 test, 53549 consequent, 53550 alternate 53551 }; 53552 53553 // check for operators of higher priority than ternary (i.e. assignment) 53554 // jsep sets || at 1, and assignment at 0.9, and conditional should be between them 53555 if (test.operator && jsep.binary_ops[test.operator] <= 0.9) { 53556 let newTest = test; 53557 while (newTest.right.operator && jsep.binary_ops[newTest.right.operator] <= 0.9) { 53558 newTest = newTest.right; 53559 } 53560 env.node.test = newTest.right; 53561 newTest.right = env.node; 53562 env.node = test; 53563 } 53564 } else { 53565 this.throwError('Expected :'); 53566 } 53567 } 53568 }); 53569 } 53570}; 53571 53572// Add default plugins: 53573 53574jsep.plugins.register(ternary); 53575 53576const FSLASH_CODE = 47; // '/' 53577const BSLASH_CODE = 92; // '\\' 53578 53579var index = { 53580 name: 'regex', 53581 init(jsep) { 53582 // Regex literal: /abc123/ig 53583 jsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) { 53584 if (this.code === FSLASH_CODE) { 53585 const patternIndex = ++this.index; 53586 let inCharSet = false; 53587 while (this.index < this.expr.length) { 53588 if (this.code === FSLASH_CODE && !inCharSet) { 53589 const pattern = this.expr.slice(patternIndex, this.index); 53590 let flags = ''; 53591 while (++this.index < this.expr.length) { 53592 const code = this.code; 53593 if (code >= 97 && code <= 122 // a...z 53594 || code >= 65 && code <= 90 // A...Z 53595 || code >= 48 && code <= 57) { 53596 // 0-9 53597 flags += this.char; 53598 } else { 53599 break; 53600 } 53601 } 53602 let value; 53603 try { 53604 value = new RegExp(pattern, flags); 53605 } catch (e) { 53606 this.throwError(e.message); 53607 } 53608 env.node = { 53609 type: jsep.LITERAL, 53610 value, 53611 raw: this.expr.slice(patternIndex - 1, this.index) 53612 }; 53613 53614 // allow . [] and () after regex: /regex/.test(a) 53615 env.node = this.gobbleTokenProperty(env.node); 53616 return env.node; 53617 } 53618 if (this.code === jsep.OBRACK_CODE) { 53619 inCharSet = true; 53620 } else if (inCharSet && this.code === jsep.CBRACK_CODE) { 53621 inCharSet = false;
53622 } 53623 this.index += this.code === BSLASH_CODE ? 2 : 1; 53624 } 53625 this.throwError('Unclosed Regex'); 53626 } 53627 }); 53628 } 53629}; 53630 53631const PLUS_CODE = 43; // + 53632const MINUS_CODE = 45; // - 53633 53634const index_browser_esm_plugin = { 53635 name: 'assignment', 53636 assignmentOperators: new Set(['=', '*=', '**=', '/=', '%=', '+=', '-=', '<<=', '>>=', '>>>=', '&=', '^=', '|=', '||=', '&&=', '??=']), 53637 updateOperators: [PLUS_CODE, MINUS_CODE], 53638 assignmentPrecedence: 0.9, 53639 init(jsep) { 53640 const updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP]; 53641 index_browser_esm_plugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, index_browser_esm_plugin.assignmentPrecedence, true)); 53642 jsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) { 53643 const code = this.code; 53644 if (index_browser_esm_plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) { 53645 this.index += 2; 53646 env.node = { 53647 type: 'UpdateExpression', 53648 operator: code === PLUS_CODE ? '++' : '--', 53649 argument: this.gobbleTokenProperty(this.gobbleIdentifier()), 53650 prefix: true 53651 }; 53652 if (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) { 53653 this.throwError(`Unexpected ${env.node.operator}`); 53654 } 53655 } 53656 }); 53657 jsep.hooks.add('after-token', function gobbleUpdatePostfix(env) { 53658 if (env.node) { 53659 const code = this.code; 53660 if (index_browser_esm_plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) { 53661 if (!updateNodeTypes.includes(env.node.type)) { 53662 this.throwError(`Unexpected ${env.node.operator}`); 53663 } 53664 this.index += 2; 53665 env.node = { 53666 type: 'UpdateExpression', 53667 operator: code === PLUS_CODE ? '++' : '--', 53668 argument: env.node, 53669 prefix: false 53670 }; 53671 } 53672 } 53673 }); 53674 jsep.hooks.add('after-expression', function gobbleAssignment(env) { 53675 if (env.node) { 53676 // Note: Binaries can be chained in a single expression to respect 53677 // operator precedence (i.e. a = b = 1 + 2 + 3) 53678 // Update all binary assignment nodes in the tree 53679 updateBinariesToAssignments(env.node); 53680 } 53681 }); 53682 function updateBinariesToAssignments(node) { 53683 if (index_browser_esm_plugin.assignmentOperators.has(node.operator)) { 53684 node.type = 'AssignmentExpression'; 53685 updateBinariesToAssignments(node.left); 53686 updateBinariesToAssignments(node.right); 53687 } else if (!node.operator) { 53688 Object.values(node).forEach(val => { 53689 if (val && typeof val === 'object') { 53690 updateBinariesToAssignments(val); 53691 } 53692 }); 53693 } 53694 } 53695 } 53696}; 53697 53698/* eslint-disable no-bitwise -- Convenient */ 53699 53700// register plugins 53701jsep.plugins.register(index, index_browser_esm_plugin); 53702jsep.addUnaryOp('typeof'); 53703jsep.addUnaryOp('void'); 53704jsep.addLiteral('null', null); 53705jsep.addLiteral('undefined', undefined); 53706const BLOCKED_PROTO_PROPERTIES = new Set(['constructor', '__proto__', '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__']); 53707const SafeEval = { 53708 /** 53709 * @param {jsep.Expression} ast 53710 * @param {Record<string, any>} subs 53711 */ 53712 evalAst(ast, subs) { 53713 switch (ast.type) { 53714 case 'BinaryExpression': 53715 case 'LogicalExpression': 53716 return SafeEval.evalBinaryExpression(ast, subs); 53717 case 'Compound': 53718 return SafeEval.evalCompound(ast, subs); 53719 case 'ConditionalExpression': 53720 return SafeEval.evalConditionalExpression(ast, subs); 53721 case 'Identifier': 53722 return SafeEval.evalIdentifier(ast, subs); 53723 case 'Literal': 53724 return SafeEval.evalLiteral(ast, subs);
53725 case 'MemberExpression': 53726 return SafeEval.evalMemberExpression(ast, subs); 53727 case 'UnaryExpression': 53728 return SafeEval.evalUnaryExpression(ast, subs); 53729 case 'ArrayExpression': 53730 return SafeEval.evalArrayExpression(ast, subs); 53731 case 'CallExpression': 53732 return SafeEval.evalCallExpression(ast, subs); 53733 case 'AssignmentExpression': 53734 return SafeEval.evalAssignmentExpression(ast, subs); 53735 default: 53736 throw SyntaxError('Unexpected expression', ast); 53737 } 53738 }, 53739 evalBinaryExpression(ast, subs) { 53740 const result = { 53741 '||': (a, b) => a || b(), 53742 '&&': (a, b) => a && b(), 53743 '|': (a, b) => a | b(), 53744 '^': (a, b) => a ^ b(), 53745 '&': (a, b) => a & b(), 53746 // eslint-disable-next-line eqeqeq -- API 53747 '==': (a, b) => a == b(), 53748 // eslint-disable-next-line eqeqeq -- API 53749 '!=': (a, b) => a != b(), 53750 '===': (a, b) => a === b(), 53751 '!==': (a, b) => a !== b(), 53752 '<': (a, b) => a < b(), 53753 '>': (a, b) => a > b(), 53754 '<=': (a, b) => a <= b(), 53755 '>=': (a, b) => a >= b(), 53756 '<<': (a, b) => a << b(), 53757 '>>': (a, b) => a >> b(), 53758 '>>>': (a, b) => a >>> b(), 53759 '+': (a, b) => a + b(), 53760 '-': (a, b) => a - b(), 53761 '*': (a, b) => a * b(), 53762 '/': (a, b) => a / b(), 53763 '%': (a, b) => a % b() 53764 }[ast.operator](SafeEval.evalAst(ast.left, subs), () => SafeEval.evalAst(ast.right, subs)); 53765 return result; 53766 }, 53767 evalCompound(ast, subs) { 53768 let last; 53769 for (let i = 0; i < ast.body.length; i++) { 53770 if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(ast.body[i].name) && ast.body[i + 1] && ast.body[i + 1].type === 'AssignmentExpression') { 53771 // var x=2; is detected as 53772 // [{Identifier var}, {AssignmentExpression x=2}] 53773 // eslint-disable-next-line @stylistic/max-len -- Long 53774 // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient 53775 i += 1; 53776 } 53777 const expr = ast.body[i]; 53778 last = SafeEval.evalAst(expr, subs); 53779 } 53780 return last; 53781 }, 53782 evalConditionalExpression(ast, subs) { 53783 if (SafeEval.evalAst(ast.test, subs)) { 53784 return SafeEval.evalAst(ast.consequent, subs); 53785 } 53786 return SafeEval.evalAst(ast.alternate, subs); 53787 }, 53788 evalIdentifier(ast, subs) { 53789 if (Object.hasOwn(subs, ast.name)) { 53790 return subs[ast.name]; 53791 } 53792 throw ReferenceError(`${ast.name} is not defined`); 53793 }, 53794 evalLiteral(ast) { 53795 return ast.value; 53796 }, 53797 evalMemberExpression(ast, subs) { 53798 const prop = String( 53799 // NOTE: `String(value)` throws error when 53800 // value has overwritten the toString method to return non-string 53801 // i.e. `value = {toString: () => []}` 53802 ast.computed ? SafeEval.evalAst(ast.property) // `object[property]` 53803 : ast.property.name // `object.property` property is Identifier 53804 ); 53805 const obj = SafeEval.evalAst(ast.object, subs); 53806 if (obj === undefined || obj === null) { 53807 throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); 53808 } 53809 if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) { 53810 throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); 53811 } 53812 const result = obj[prop]; 53813 if (typeof result === 'function') { 53814 return result.bind(obj); // arrow functions aren't affected by bind. 53815 } 53816 return result; 53817 }, 53818 evalUnaryExpression(ast, subs) { 53819 const result = { 53820 '-': a => -SafeEval.evalAst(a, subs), 53821 '!': a => !SafeEval.evalAst(a, subs), 53822 '~': a => ~SafeEval.evalAst(a, subs), 53823 // eslint-disable-next-line no-implicit-coercion -- API 53824 '+': a => +SafeEval.evalAst(a, subs), 53825 typeof: a => typeof SafeEval.evalAst(a, subs), 53826 // eslint-disable-next-line no-void, sonarjs/void-use -- feature 53827 void: a => void SafeEval.evalAst(a, subs) 53828 }[ast.operator](ast.argument); 53829 return result; 53830 }, 53831 evalArrayExpression(ast, subs) { 53832 return ast.elements.map(el => SafeEval.evalAst(el, subs)); 53833 }, 53834 evalCallExpression(ast, subs) { 53835 const args = ast.arguments.map(arg => SafeEval.evalAst(arg, subs)); 53836 const func = SafeEval.evalAst(ast.callee, subs); 53837 /* c8 ignore start */ 53838 if (func === Function) { 53839 // unreachable since BLOCKED_PROTO_PROPERTIES includes 'constructor' 53840 throw new Error('Function constructor is disabled'); 53841 } 53842 /* c8 ignore end */ 53843 return func(...args); 53844 }, 53845 evalAssignmentExpression(ast, subs) { 53846 if (ast.left.type !== 'Identifier') { 53847 throw SyntaxError('Invalid left-hand side in assignment'); 53848 } 53849 const id = ast.left.name;
53850 const value = SafeEval.evalAst(ast.right, subs); 53851 subs[id] = value; 53852 return subs[id]; 53853 } 53854}; 53855 53856/** 53857 * A replacement for NodeJS' VM.Script which is also {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | Content Security Policy} friendly. 53858 */ 53859class SafeScript { 53860 /** 53861 * @param {string} expr Expression to evaluate 53862 */ 53863 constructor(expr) { 53864 this.code = expr; 53865 this.ast = jsep(this.code); 53866 } 53867 53868 /** 53869 * @param {object} context Object whose items will be added 53870 * to evaluation 53871 * @returns {EvaluatedResult} Result of evaluated code 53872 */ 53873 runInNewContext(context) { 53874 // `Object.create(null)` creates a prototypeless object 53875 const keyMap = Object.assign(Object.create(null), context); 53876 return SafeEval.evalAst(this.ast, keyMap); 53877 } 53878} 53879 53880/* eslint-disable camelcase -- Convenient for escaping */ 53881 53882 53883/** 53884 * @typedef {null|boolean|number|string|object|GenericArray} JSONObject 53885 */ 53886 53887/** 53888 * @typedef {any} AnyItem 53889 */ 53890 53891/** 53892 * @typedef {any} AnyResult 53893 */ 53894 53895/** 53896 * Copies array and then pushes item into it. 53897 * @param {GenericArray} arr Array to copy and into which to push 53898 * @param {AnyItem} item Array item to add (to end) 53899 * @returns {GenericArray} Copy of the original array 53900 */ 53901function push(arr, item) { 53902 arr = arr.slice(); 53903 arr.push(item); 53904 return arr; 53905} 53906/** 53907 * Copies array and then unshifts item into it. 53908 * @param {AnyItem} item Array item to add (to beginning) 53909 * @param {GenericArray} arr Array to copy and into which to unshift 53910 * @returns {GenericArray} Copy of the original array 53911 */ 53912function unshift(item, arr) { 53913 arr = arr.slice(); 53914 arr.unshift(item); 53915 return arr; 53916} 53917 53918/** 53919 * Caught when JSONPath is used without `new` but rethrown if with `new` 53920 * @extends Error 53921 */ 53922class NewError extends Error { 53923 /** 53924 * @param {AnyResult} value The evaluated scalar value 53925 */ 53926 constructor(value) { 53927 super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)'); 53928 this.avoidNew = true; 53929 this.value = value; 53930 this.name = 'NewError'; 53931 } 53932} 53933 53934/** 53935* @typedef {object} ReturnObject 53936* @property {string} path 53937* @property {JSONObject} value 53938* @property {object|GenericArray} parent 53939* @property {string} parentProperty 53940*/ 53941 53942/** 53943* @callback JSONPathCallback 53944* @param {string|object} preferredOutput 53945* @param {"value"|"property"} type 53946* @param {ReturnObject} fullRetObj 53947* @returns {void} 53948*/ 53949 53950/** 53951* @callback OtherTypeCallback 53952* @param {JSONObject} val 53953* @param {string} path 53954* @param {object|GenericArray} parent 53955* @param {string} parentPropName 53956* @returns {boolean} 53957*/ 53958 53959/** 53960 * @typedef {any} ContextItem 53961 */ 53962 53963/** 53964 * @typedef {any} EvaluatedResult 53965 */ 53966 53967/** 53968* @callback EvalCallback 53969* @param {string} code 53970* @param {ContextItem} context 53971* @returns {EvaluatedResult} 53972*/ 53973 53974/** 53975 * @typedef {typeof SafeScript} EvalClass 53976 */ 53977 53978/** 53979 * @typedef {object} JSONPathOptions 53980 * @property {JSON} json 53981 * @property {string|string[]} path 53982 * @property {"value"|"path"|"pointer"|"parent"|"parentProperty"| 53983 * "all"} [resultType="value"] 53984 * @property {boolean} [flatten=false] 53985 * @property {boolean} [wrap=true] 53986 * @property {object} [sandbox={}] 53987 * @property {EvalCallback|EvalClass|'safe'|'native'| 53988 * boolean} [eval = 'safe'] 53989 * @property {object|GenericArray|null} [parent=null] 53990 * @property {string|null} [parentProperty=null] 53991 * @property {JSONPathCallback} [callback] 53992 * @property {OtherTypeCallback} [otherTypeCallback] Defaults to 53993 * function which throws on encountering `@other` 53994 * @property {boolean} [autostart=true] 53995 */ 53996 53997/** 53998 * @param {string|JSONPathOptions} opts If a string, will be treated as `expr` 53999 * @param {string} [expr] JSON path to evaluate 54000 * @param {JSON} [obj] JSON object to evaluate against 54001 * @param {JSONPathCallback} [callback] Passed 3 arguments: 1) desired payload 54002 * per `resultType`, 2) `"value"|"property"`, 3) Full returned object with 54003 * all payloads 54004 * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end 54005 * of one's query, this will be invoked with the value of the item, its 54006 * path, its parent, and its parent's property name, and it should return 54007 * a boolean indicating whether the supplied value belongs to the "other" 54008 * type or not (or it may handle transformations and return `false`). 54009 * @returns {JSONPath} 54010 * @class 54011 */
54012function JSONPath(opts, expr, obj, callback, otherTypeCallback) { 54013 // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class 54014 if (!(this instanceof JSONPath)) { 54015 try { 54016 return new JSONPath(opts, expr, obj, callback, otherTypeCallback); 54017 } catch (e) { 54018 if (!e.avoidNew) { 54019 throw e; 54020 } 54021 return e.value; 54022 } 54023 } 54024 if (typeof opts === 'string') { 54025 otherTypeCallback = callback; 54026 callback = obj; 54027 obj = expr; 54028 expr = opts; 54029 opts = null; 54030 } 54031 const optObj = opts && typeof opts === 'object'; 54032 opts = opts || {}; 54033 this.json = opts.json || obj; 54034 this.path = opts.path || expr; 54035 this.resultType = opts.resultType || 'value'; 54036 this.flatten = opts.flatten || false; 54037 this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true; 54038 this.sandbox = opts.sandbox || {}; 54039 this.eval = opts.eval === undefined ? 'safe' : opts.eval; 54040 this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors; 54041 this.parent = opts.parent || null; 54042 this.parentProperty = opts.parentProperty || null; 54043 this.callback = opts.callback || callback || null; 54044 this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { 54045 throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.'); 54046 }; 54047 if (opts.autostart !== false) { 54048 const args = { 54049 path: optObj ? opts.path : expr 54050 }; 54051 if (!optObj) { 54052 args.json = obj; 54053 } else if ('json' in opts) { 54054 args.json = opts.json; 54055 } 54056 const ret = this.evaluate(args); 54057 if (!ret || typeof ret !== 'object') { 54058 throw new NewError(ret); 54059 } 54060 return ret; 54061 } 54062} 54063 54064// PUBLIC METHODS 54065JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) { 54066 let currParent = this.parent, 54067 currParentProperty = this.parentProperty; 54068 let { 54069 flatten, 54070 wrap 54071 } = this; 54072 this.currResultType = this.resultType; 54073 this.currEval = this.eval; 54074 this.currSandbox = this.sandbox; 54075 callback = callback || this.callback; 54076 this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; 54077 json = json || this.json; 54078 expr = expr || this.path; 54079 if (expr && typeof expr === 'object' && !Array.isArray(expr)) { 54080 if (!expr.path && expr.path !== '') { 54081 throw new TypeError('You must supply a "path" property when providing an object ' + 'argument to JSONPath.evaluate().'); 54082 } 54083 if (!Object.hasOwn(expr, 'json')) { 54084 throw new TypeError('You must supply a "json" property when providing an object ' + 'argument to JSONPath.evaluate().'); 54085 } 54086 ({ 54087 json 54088 } = expr); 54089 flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten; 54090 this.currResultType = Object.hasOwn(expr, 'resultType') ? expr.resultType : this.currResultType; 54091 this.currSandbox = Object.hasOwn(expr, 'sandbox') ? expr.sandbox : this.currSandbox; 54092 wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap; 54093 this.currEval = Object.hasOwn(expr, 'eval') ? expr.eval : this.currEval; 54094 callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback; 54095 this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback; 54096 currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent; 54097 currParentProperty = Object.hasOwn(expr, 'parentProperty') ? expr.parentProperty : currParentProperty; 54098 expr = expr.path; 54099 } 54100 currParent = currParent || null; 54101 currParentProperty = currParentProperty || null; 54102 if (Array.isArray(expr)) { 54103 expr = JSONPath.toPathString(expr); 54104 } 54105 if (!expr && expr !== '' || !json) { 54106 return undefined; 54107 } 54108 const exprList = JSONPath.toPathArray(expr); 54109 if (exprList[0] === '$' && exprList.length > 1) { 54110 exprList.shift(); 54111 } 54112 this._hasParentSelector = null; 54113 const result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) { 54114 return ea && !ea.isParentSelector; 54115 }); 54116 if (!result.length) { 54117 return wrap ? [] : undefined; 54118 } 54119 if (!wrap && result.length === 1 && !result[0].hasArrExpr) { 54120 return this._getPreferredOutput(result[0]); 54121 } 54122 return result.reduce((rslt, ea) => { 54123 const valOrPath = this._getPreferredOutput(ea); 54124 if (flatten && Array.isArray(valOrPath)) { 54125 rslt = rslt.concat(valOrPath); 54126 } else { 54127 rslt.push(valOrPath); 54128 } 54129 return rslt; 54130 }, []); 54131}; 54132 54133// PRIVATE METHODS 54134 54135JSONPath.prototype._getPreferredOutput = function (ea) { 54136 const resultType = this.currResultType; 54137 switch (resultType) { 54138 case 'all': 54139 { 54140 const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); 54141 ea.pointer = JSONPath.toPointer(path); 54142 ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path); 54143 return ea; 54144 } 54145 case 'value': 54146 case 'parent': 54147 case 'parentProperty': 54148 return ea[resultType]; 54149 case 'path': 54150 return JSONPath.toPathString(ea[resultType]); 54151 case 'pointer': 54152 return JSONPath.toPointer(ea.path); 54153 default: 54154 throw new TypeError('Unknown result type'); 54155 } 54156}; 54157JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) { 54158 if (callback) { 54159 const preferredOutput = this._getPreferredOutput(fullRetObj); 54160 fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); 54161 // eslint-disable-next-line n/callback-return -- No need to return 54162 callback(preferredOutput, type, fullRetObj); 54163 } 54164}; 54165 54166/** 54167 * 54168 * @param {string} expr 54169 * @param {JSONObject} val 54170 * @param {string} path 54171 * @param {object|GenericArray} parent 54172 * @param {string} parentPropName 54173 * @param {JSONPathCallback} callback 54174 * @param {boolean} hasArrExpr 54175 * @param {boolean} literalPriority 54176 * @returns {ReturnObject|ReturnObject[]} 54177 */ 54178JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) { 54179 // No expr to follow? return path and value as the result of 54180 // this trace branch 54181 let retObj; 54182 if (!expr.length) { 54183 retObj = { 54184 path, 54185 value: val, 54186 parent, 54187 parentProperty: parentPropName, 54188 hasArrExpr 54189 }; 54190 this._handleCallback(retObj, callback, 'value'); 54191 return retObj; 54192 } 54193 const loc = expr[0], 54194 x = expr.slice(1); 54195 54196 // We need to gather the return value of recursive trace calls in order to 54197 // do the parent sel computation.
54198 const ret = []; 54199 /** 54200 * 54201 * @param {ReturnObject|ReturnObject[]} elems 54202 * @returns {void} 54203 */ 54204 function addRet(elems) { 54205 if (Array.isArray(elems)) { 54206 // This was causing excessive stack size in Node (with or 54207 // without Babel) against our performance test: 54208 // `ret.push(...elems);` 54209 elems.forEach(t => { 54210 ret.push(t); 54211 }); 54212 } else { 54213 ret.push(elems); 54214 } 54215 } 54216 if ((typeof loc !== 'string' || literalPriority) && val && Object.hasOwn(val, loc)) { 54217 // simple case--directly follow property 54218 addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr)); 54219 // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if` 54220 } else if (loc === '*') { 54221 // all child properties 54222 this._walk(val, m => { 54223 addRet(this._trace(x, val[m], push(path, m), val, m, callback, true, true)); 54224 }); 54225 } else if (loc === '..') { 54226 // all descendent parent properties 54227 // Check remaining expression with val's immediate children 54228 addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr)); 54229 this._walk(val, m => { 54230 // We don't join m and x here because we only want parents, 54231 // not scalar values 54232 if (typeof val[m] === 'object') { 54233 // Keep going with recursive descent on val's 54234 // object children 54235 addRet(this._trace(expr.slice(), val[m], push(path, m), val, m, callback, true)); 54236 } 54237 }); 54238 // The parent sel computation is handled in the frame above using the 54239 // ancestor object of val 54240 } else if (loc === '^') { 54241 // This is not a final endpoint, so we do not invoke the callback here 54242 this._hasParentSelector = true; 54243 return { 54244 path: path.slice(0, -1), 54245 expr: x, 54246 isParentSelector: true 54247 }; 54248 } else if (loc === '~') { 54249 // property name 54250 retObj = { 54251 path: push(path, loc), 54252 value: parentPropName, 54253 parent, 54254 parentProperty: null 54255 }; 54256 this._handleCallback(retObj, callback, 'property'); 54257 return retObj; 54258 } else if (loc === '$') { 54259 // root only 54260 addRet(this._trace(x, val, path, null, null, callback, hasArrExpr)); 54261 } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { 54262 // [start:end:step] Python slice syntax 54263 addRet(this._slice(loc, x, val, path, parent, parentPropName, callback)); 54264 } else if (loc.indexOf('?(') === 0) { 54265 // [?(expr)] (filtering) 54266 if (this.currEval === false) { 54267 throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); 54268 } 54269 const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1'); 54270 // check for a nested filter expression 54271 const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); 54272 if (nested) { 54273 // find if there are matches in the nested expression 54274 // add them to the result set if there is at least one match 54275 this._walk(val, m => { 54276 const npath = [nested[2]]; 54277 const nvalue = nested[1] ? val[m][nested[1]] : val[m]; 54278 const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true); 54279 if (filterResults.length > 0) { 54280 addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); 54281 } 54282 }); 54283 } else { 54284 this._walk(val, m => { 54285 if (this._eval(safeLoc, val[m], m, path, parent, parentPropName)) { 54286 addRet(this._trace(x, val[m], push(path, m), val, m, callback, true)); 54287 } 54288 }); 54289 } 54290 } else if (loc[0] === '(') { 54291 // [(expr)] (dynamic property/index) 54292 if (this.currEval === false) { 54293 throw new Error('Eval [(expr)] prevented in JSONPath expression.'); 54294 } 54295 // As this will resolve to a property name (but we don't know it 54296 // yet), property and parent information is relative to the 54297 // parent of the property to which this expression will resolve 54298 addRet(this._trace(unshift(this._eval(loc, val, path.at(-1), path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback, hasArrExpr)); 54299 } else if (loc[0] === '@') { 54300 // value type: @boolean(), etc. 54301 let addType = false;
54302 const valueType = loc.slice(1, -2); 54303 switch (valueType) { 54304 case 'scalar': 54305 if (!val || !['object', 'function'].includes(typeof val)) { 54306 addType = true; 54307 } 54308 break; 54309 case 'boolean': 54310 case 'string': 54311 case 'undefined': 54312 case 'function': 54313 if (typeof val === valueType) { 54314 addType = true; 54315 } 54316 break; 54317 case 'integer': 54318 if (Number.isFinite(val) && !(val % 1)) { 54319 addType = true; 54320 } 54321 break; 54322 case 'number': 54323 if (Number.isFinite(val)) { 54324 addType = true; 54325 } 54326 break; 54327 case 'nonFinite': 54328 if (typeof val === 'number' && !Number.isFinite(val)) { 54329 addType = true; 54330 } 54331 break; 54332 case 'object': 54333 if (val && typeof val === valueType) { 54334 addType = true; 54335 } 54336 break; 54337 case 'array': 54338 if (Array.isArray(val)) { 54339 addType = true; 54340 } 54341 break; 54342 case 'other': 54343 addType = this.currOtherTypeCallback(val, path, parent, parentPropName); 54344 break; 54345 case 'null': 54346 if (val === null) { 54347 addType = true; 54348 } 54349 break; 54350 /* c8 ignore next 2 */ 54351 default: 54352 throw new TypeError('Unknown value type ' + valueType); 54353 } 54354 if (addType) { 54355 retObj = { 54356 path, 54357 value: val, 54358 parent, 54359 parentProperty: parentPropName 54360 }; 54361 this._handleCallback(retObj, callback, 'value'); 54362 return retObj; 54363 } 54364 // `-escaped property 54365 } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) { 54366 const locProp = loc.slice(1); 54367 addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true)); 54368 } else if (loc.includes(',')) { 54369 // [name1,name2,...] 54370 const parts = loc.split(','); 54371 for (const part of parts) { 54372 addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true)); 54373 } 54374 // simple case--directly follow property 54375 } else if (!literalPriority && val && Object.hasOwn(val, loc)) { 54376 addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr, true)); 54377 } 54378 54379 // We check the resulting values for parent selections. For parent 54380 // selections we discard the value object and continue the trace with the 54381 // current val object 54382 if (this._hasParentSelector) { 54383 for (let t = 0; t < ret.length; t++) { 54384 const rett = ret[t]; 54385 if (rett && rett.isParentSelector) { 54386 const tmp = this._trace(rett.expr, val, rett.path, parent, parentPropName, callback, hasArrExpr); 54387 if (Array.isArray(tmp)) { 54388 ret[t] = tmp[0]; 54389 const tl = tmp.length; 54390 for (let tt = 1; tt < tl; tt++) { 54391 // eslint-disable-next-line @stylistic/max-len -- Long 54392 // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient 54393 t++; 54394 ret.splice(t, 0, tmp[tt]); 54395 } 54396 } else { 54397 ret[t] = tmp; 54398 } 54399 } 54400 } 54401 } 54402 return ret; 54403}; 54404JSONPath.prototype._walk = function (val, f) { 54405 if (Array.isArray(val)) { 54406 const n = val.length; 54407 for (let i = 0; i < n; i++) { 54408 f(i); 54409 } 54410 } else if (val && typeof val === 'object') { 54411 Object.keys(val).forEach(m => { 54412 f(m); 54413 }); 54414 } 54415}; 54416JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) { 54417 if (!Array.isArray(val)) { 54418 return undefined; 54419 } 54420 const len = val.length, 54421 parts = loc.split(':'), 54422 step = parts[2] && Number.parseInt(parts[2]) || 1; 54423 let start = parts[0] && Number.parseInt(parts[0]) || 0, 54424 end = parts[1] && Number.parseInt(parts[1]) || len; 54425 start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); 54426 end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); 54427 const ret = []; 54428 for (let i = start; i < end; i += step) { 54429 const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true); 54430 // Should only be possible to be an array here since first part of 54431 // ``unshift(i, expr)` passed in above would not be empty, nor `~`, 54432 // nor begin with `@` (as could return objects) 54433 // This was causing excessive stack size in Node (with or 54434 // without Babel) against our performance test: `ret.push(...tmp);` 54435 tmp.forEach(t => {
54436 ret.push(t); 54437 }); 54438 } 54439 return ret; 54440}; 54441JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) { 54442 this.currSandbox._$_parentProperty = parentPropName; 54443 this.currSandbox._$_parent = parent; 54444 this.currSandbox._$_property = _vname; 54445 this.currSandbox._$_root = this.json; 54446 this.currSandbox._$_v = _v; 54447 const containsPath = code.includes('@path'); 54448 if (containsPath) { 54449 this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname])); 54450 } 54451 const scriptCacheKey = this.currEval + 'Script:' + code; 54452 if (!JSONPath.cache[scriptCacheKey]) { 54453 let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1'); 54454 if (containsPath) { 54455 script = script.replaceAll('@path', '_$_path'); 54456 } 54457 if (this.currEval === 'safe' || this.currEval === true || this.currEval === undefined) { 54458 JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script); 54459 } else if (this.currEval === 'native') { 54460 JSONPath.cache[scriptCacheKey] = new this.vm.Script(script); 54461 } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) { 54462 const CurrEval = this.currEval; 54463 JSONPath.cache[scriptCacheKey] = new CurrEval(script); 54464 } else if (typeof this.currEval === 'function') { 54465 JSONPath.cache[scriptCacheKey] = { 54466 runInNewContext: context => this.currEval(script, context) 54467 }; 54468 } else { 54469 throw new TypeError(`Unknown "eval" property "${this.currEval}"`); 54470 } 54471 } 54472 try { 54473 return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox); 54474 } catch (e) { 54475 if (this.ignoreEvalErrors) { 54476 return false; 54477 } 54478 throw new Error('jsonPath: ' + e.message + ': ' + code); 54479 } 54480}; 54481 54482// PUBLIC CLASS PROPERTIES AND METHODS 54483 54484// Could store the cache object itself 54485JSONPath.cache = {}; 54486 54487/** 54488 * @param {string[]} pathArr Array to convert 54489 * @returns {string} The path string 54490 */ 54491JSONPath.toPathString = function (pathArr) { 54492 const x = pathArr, 54493 n = x.length; 54494 let p = '$'; 54495 for (let i = 1; i < n; i++) { 54496 if (!/^(~|\^|@.*?\(\))$/u.test(x[i])) { 54497 p += /^[0-9*]+$/u.test(x[i]) ? '[' + x[i] + ']' : "['" + x[i] + "']"; 54498 } 54499 } 54500 return p; 54501}; 54502 54503/** 54504 * @param {string} pointer JSON Path 54505 * @returns {string} JSON Pointer 54506 */ 54507JSONPath.toPointer = function (pointer) { 54508 const x = pointer, 54509 n = x.length; 54510 let p = ''; 54511 for (let i = 1; i < n; i++) { 54512 if (!/^(~|\^|@.*?\(\))$/u.test(x[i])) { 54513 p += '/' + x[i].toString().replaceAll('~', '~0').replaceAll('/', '~1'); 54514 } 54515 } 54516 return p; 54517}; 54518 54519/** 54520 * @param {string} expr Expression to convert 54521 * @returns {string[]} 54522 */ 54523JSONPath.toPathArray = function (expr) { 54524 const { 54525 cache 54526 } = JSONPath; 54527 if (cache[expr]) { 54528 return cache[expr].concat(); 54529 } 54530 const subx = []; 54531 const normalized = expr 54532 // Properties 54533 .replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ';$&;') 54534 // Parenthetical evaluations (filtering and otherwise), directly 54535 // within brackets or single quotes 54536 .replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function ($0, $1) { 54537 return '[#' + (subx.push($1) - 1) + ']'; 54538 }) 54539 // Escape periods and tildes within properties 54540 .replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function ($0, prop) { 54541 return "['" + prop.replaceAll('.', '%@%').replaceAll('~', '%%@@%%') + "']"; 54542 }) 54543 // Properties operator 54544 .replaceAll('~', ';~;') 54545 // Split by property boundaries 54546 .replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ';') 54547 // Reinsert periods within properties 54548 .replaceAll('%@%', '.') 54549 // Reinsert tildes within properties 54550 .replaceAll('%%@@%%', '~') 54551 // Parent 54552 .replaceAll(/(?:;)?(\^+)(?:;)?/gu, function ($0, ups) { 54553 return ';' + ups.split('').join(';') + ';'; 54554 }) 54555 // Descendents 54556 .replaceAll(/;;;|;;/gu, ';..;') 54557 // Remove trailing 54558 .replaceAll(/;$|'?\]|'$/gu, ''); 54559 const exprList = normalized.split(';').map(function (exp) { 54560 const match = exp.match(/#(\d+)/u); 54561 return !match || !match[1] ? exp : subx[match[1]]; 54562 }); 54563 cache[expr] = exprList; 54564 return cache[expr].concat(); 54565}; 54566JSONPath.prototype.safeVm = { 54567 Script: SafeScript 54568}; 54569 54570/** 54571 * @typedef {any} ContextItem 54572 */ 54573 54574/** 54575 * @typedef {any} EvaluatedResult 54576 */ 54577 54578/** 54579 * @callback ConditionCallback 54580 * @param {ContextItem} item 54581 * @returns {boolean} 54582 */ 54583
54584/** 54585 * Copy items out of one array into another. 54586 * @param {GenericArray} source Array with items to copy 54587 * @param {GenericArray} target Array to which to copy 54588 * @param {ConditionCallback} conditionCb Callback passed the current item; 54589 * will move item if evaluates to `true` 54590 * @returns {void} 54591 */ 54592const moveToAnotherArray = function (source, target, conditionCb) { 54593 const il = source.length; 54594 for (let i = 0; i < il; i++) { 54595 const item = source[i]; 54596 if (conditionCb(item)) { 54597 // eslint-disable-next-line @stylistic/max-len -- Long 54598 // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient 54599 target.push(source.splice(i--, 1)[0]); 54600 } 54601 } 54602}; 54603 54604/** 54605 * In-browser replacement for NodeJS' VM.Script. 54606 */ 54607class Script { 54608 /** 54609 * @param {string} expr Expression to evaluate 54610 */ 54611 constructor(expr) { 54612 this.code = expr; 54613 } 54614 54615 /** 54616 * @param {object} context Object whose items will be added 54617 * to evaluation 54618 * @returns {EvaluatedResult} Result of evaluated code 54619 */ 54620 runInNewContext(context) { 54621 let expr = this.code; 54622 const keys = Object.keys(context); 54623 const funcs = []; 54624 moveToAnotherArray(keys, funcs, key => { 54625 return typeof context[key] === 'function'; 54626 }); 54627 const values = keys.map(vr => { 54628 return context[vr]; 54629 }); 54630 const funcString = funcs.reduce((s, func) => { 54631 let fString = context[func].toString(); 54632 if (!/function/u.test(fString)) { 54633 fString = 'function ' + fString; 54634 } 54635 return 'var ' + func + '=' + fString + ';' + s; 54636 }, ''); 54637 expr = funcString + expr; 54638 54639 // Mitigate http://perfectionkills.com/global-eval-what-are-the-options/#new_function 54640 if (!/(['"])use strict\1/u.test(expr) && !keys.includes('arguments')) { 54641 expr = 'var arguments = undefined;' + expr; 54642 } 54643 54644 // Remove last semi so `return` will be inserted before 54645 // the previous one instead, allowing for the return 54646 // of a bare ending expression 54647 expr = expr.replace(/;\s*$/u, ''); 54648 54649 // Insert `return` 54650 const lastStatementEnd = expr.lastIndexOf(';'); 54651 const code = lastStatementEnd !== -1 ? expr.slice(0, lastStatementEnd + 1) + ' return ' + expr.slice(lastStatementEnd + 1) : ' return ' + expr; 54652 54653 // eslint-disable-next-line no-new-func -- User's choice 54654 return new Function(...keys, code)(...values); 54655 } 54656} 54657JSONPath.prototype.vm = { 54658 Script 54659}; 54660 54661 54662 54663// EXTERNAL MODULE: ./node_modules/fromentries/index.js 54664var fromentries = __webpack_require__(86855); 54665var fromentries_default = /*#__PURE__*/__webpack_require__.n(fromentries); 54666;// ./node_modules/jsonpath-mapper/dist/jsonpath-mapper.mjs 54667/* unused harmony import specifier */ var fromEntries; 54668 54669 54670 54671const jpath = (query, json) => { 54672 const result = JSONPath({ 54673 path: `$${query.startsWith('.') ? '' : '.'}${query}`, 54674 json: json, 54675 }); 54676 if (result.length > 1 || 54677 (query.match(/\[.*?\]/) && !query.match(/\[[0-9]\]/))) 54678 return result; 54679 return result[0]; 54680}; 54681const isArray = (val) => val && Array.isArray(val); 54682const isWireFunction = (val) => typeof val === 'function'; 54683const isNull = (val) => val === null; 54684const isUndefined = (val) => typeof val === 'undefined'; 54685const isNullOrUndefined = (val) => { 54686 if (isUndefined(val)) 54687 return true; 54688 if (isNull(val)) 54689 return true; 54690 return false; 54691}; 54692const isNumber = (val) => typeof val === 'number'; 54693const isMapperFunctions = (val) => typeof val === 'object' && '$path' in val; 54694const isObject = (val) => typeof val === 'object'; 54695const isString = (val) => typeof val === 'string'; 54696const tryMultiple$1 = (json, arr, $root, findMultiple) => { 54697 const result = findMultiple(json, arr, $root).filter(r => isNumber(r) || r); 54698 if (arr.every(i => (typeof i === "string"))) 54699 return result.length > 0 ? result[0] : null; 54700 return result; 54701}; 54702 54703const formatResult$1 = (value, $formatting, $root) => isWireFunction($formatting) 54704 ? $formatting(value, $root) 54705 : isObject($formatting) 54706 ? mapObject$1(value, $formatting, $root) 54707 : value; 54708const handleMapperFunctions$1 = async ([k, v], json, $root) => { 54709 let val, formatted, finalVal; 54710 if (isString(v.$path)) { 54711 val = jpath(v.$path, json); 54712 } 54713 if (isArray(v.$path)) { 54714 val = await tryMultiple(json, v.$path, $root, findMultiple$1); 54715 } 54716 if (!isUndefined(v.$formatting) && !isNullOrUndefined(val)) { 54717 if (isArray(val)) { 54718 formatted = await Promise.all(val.map(async (inner) => !isUndefined(v.$formatting) && 54719 (await formatResult$1(inner, v.$formatting, $root)))); 54720 } 54721 else { 54722 formatted = await formatResult$1(val, v.$formatting, $root); 54723 } 54724 val = formatted; 54725 } 54726 if (v.$return) { 54727 finalVal = await formatResult$1(val, v.$return, $root); 54728 } 54729 else { 54730 finalVal = val; 54731 } 54732 if (!isUndefined(v.$default) && isNullOrUndefined(finalVal)) { 54733 if (isWireFunction(v.$default)) { 54734 finalVal = await v.$default(json, $root); 54735 } 54736 else { 54737 finalVal = v.$default; 54738 } 54739 } 54740 if (v.$disable && 54741 isWireFunction(v.$disable) && 54742 (await v.$disable(finalVal, $root))) { 54743 return null; 54744 } 54745 return finalVal; 54746}; 54747const mapElement$1 = async ([k, v], json, $root) => { 54748 if (isNullOrUndefined(v) || v === '') 54749 return [k, undefined]; 54750 if (isString(v)) { 54751 return [k, jpath(v, json)]; 54752 } 54753 if (isWireFunction(v)) { 54754 return [k, await v(json, $root)]; 54755 } 54756 if (isArray(v)) { 54757 return [k, await tryMultiple(json, v, $root, findMultiple$1)]; 54758 } 54759 if (isMapperFunctions(v)) { 54760 return [k, await handleMapperFunctions$1([k, v], json, $root)]; 54761 } 54762 if (typeof v === 'object') 54763 return [k, await mapObject$1(json, v, $root)]; 54764 return [k, v]; 54765}; 54766const mapObject$1 = async (json, obj, $root) => { 54767 const objectAsEntries = (await Promise.all(Object.entries(obj).map(async ([k, v]) => await mapElement$1([k, v], json, $root)))).filter(([, v]) => v !== null); 54768 return fromEntries(objectAsEntries); 54769}; 54770const mapArray$1 = async (json, arr, $root) => { 54771 return (await Promise.all(arr.map(async (v) => await mapObject$1(json, v, $root)))); 54772}; 54773const findMultiple$1 = (json, arr, $root) => { 54774 const results = arr.map(async (inner, i) => { 54775 if (isString(inner)) 54776 return jpath(inner, json); 54777 if (isWireFunction(inner)) 54778 return await inner(json, $root); 54779 if (isArray(inner)) 54780 return await tryMultiple(json, inner, $root, findMultiple$1); 54781 if (isMapperFunctions(inner)) 54782 return await handleMapperFunctions$1([i.toString(), inner], json, $root); 54783 if (typeof inner === 'object') 54784 return await mapObject$1(json, inner, $root); 54785 }); 54786 return results; 54787}; 54788const tryMultiple = async (json, arr, $root, findMultiple) => { 54789 const result = (await Promise.all(findMultiple(json, arr, $root))) 54790 .filter(r => isNumber(r) || r); 54791 if (arr.every((i) => typeof i === 'string')) 54792 return result.length > 0 ? result[0] : null; 54793 return result; 54794}; 54795const mapJson$1 = async (json, template) => { 54796 const $root = json; 54797 if (typeof template === 'function') { 54798 return await template(json); 54799 } 54800 if (isArray(template)) { 54801 return await mapArray$1(json, template, $root); 54802 } 54803 return await mapObject$1(json, template, $root); 54804}; 54805 54806const formatResult = (value, $formatting, $root) => isWireFunction($formatting) 54807 ? $formatting(value, $root) 54808 : isObject($formatting) 54809 ? mapObject(value, $formatting, $root) 54810 : value; 54811const handleMapperFunctions = ([k, v], json, $root) => { 54812 let val, formatted, finalVal; 54813 if (isString(v.$path)) { 54814 val = jpath(v.$path, json); 54815 } 54816 if (isArray(v.$path)) { 54817 val = tryMultiple$1(json, v.$path, $root, findMultiple); 54818 } 54819 if (!isUndefined(v.$formatting) && !isNullOrUndefined(val)) { 54820 if (isArray(val)) { 54821 formatted = val.map((inner) => !isUndefined(v.$formatting) && 54822 formatResult(inner, v.$formatting, $root)); 54823 } 54824 else { 54825 formatted = formatResult(val, v.$formatting, $root); 54826 } 54827 val = formatted; 54828 } 54829 if (v.$return) { 54830 finalVal = formatResult(val, v.$return, $root); 54831 } 54832 else { 54833 finalVal = val; 54834 } 54835 if (!isUndefined(v.$default) && isNullOrUndefined(finalVal)) { 54836 if (isWireFunction(v.$default)) { 54837 finalVal = v.$default(json, $root); 54838 } 54839 else { 54840 finalVal = v.$default; 54841 } 54842 } 54843 if (v.$disable && isWireFunction(v.$disable) && v.$disable(finalVal, $root)) { 54844 return null; 54845 } 54846 return finalVal; 54847}; 54848const mapElement = ([k, v], json, $root) => { 54849 if (isNullOrUndefined(v) || v === '') 54850 return [k, undefined]; 54851 if (isString(v)) { 54852 return [k, jpath(v, json)]; 54853 } 54854 if (isWireFunction(v)) { 54855 return [k, v(json, $root)]; 54856 } 54857 if (isArray(v)) {
54858 return [k, tryMultiple$1(json, v, $root, findMultiple)]; 54859 } 54860 if (isMapperFunctions(v)) { 54861 return [k, handleMapperFunctions([k, v], json, $root)]; 54862 } 54863 if (typeof v === 'object') 54864 return [k, mapObject(json, v, $root)]; 54865 return [k, v]; 54866}; 54867const mapObject = (json, obj, $root) => { 54868 const objectAsEntries = Object.entries(obj) 54869 .map(([k, v]) => mapElement([k, v], json, $root)) 54870 .filter((obj) => isArray(obj) && obj[1] !== null); 54871 return fromentries_default()(objectAsEntries); 54872}; 54873const mapArray = (json, arr, $root) => { 54874 return arr.map((v) => mapObject(json, v, $root)); 54875}; 54876const findMultiple = (json, arr, $root) => { 54877 const results = arr.map((inner, i) => { 54878 if (isString(inner)) 54879 return jpath(inner, json); 54880 if (isWireFunction(inner)) 54881 return inner(json, $root); 54882 if (isArray(inner)) 54883 return tryMultiple$1(json, inner, $root, findMultiple); 54884 if (isMapperFunctions(inner)) 54885 return handleMapperFunctions([i.toString(), inner], json, $root); 54886 if (typeof inner === 'object') 54887 return mapObject(json, inner, $root); 54888 }); 54889 return results; 54890}; 54891const mapJson = (json, template) => { 54892 const $root = json; 54893 if (typeof template === 'function') { 54894 return template(json); 54895 } 54896 if (isArray(template)) { 54897 return mapArray(json, template, $root); 54898 } 54899 return mapObject(json, template, $root); 54900}; 54901 54902 54903 54904 54905/***/ }, 54906 54907/***/ 55580 54908(module, __unused_webpack_exports, __webpack_require__) { 54909 54910var getNative = __webpack_require__(56110), 54911 root = __webpack_require__(9325); 54912 54913/* Built-in method references that are verified to be native. */ 54914var DataView = getNative(root, 'DataView'); 54915 54916module.exports = DataView; 54917 54918 54919/***/ }, 54920 54921/***/ 68223 54922(module, __unused_webpack_exports, __webpack_require__) { 54923 54924var getNative = __webpack_require__(56110), 54925 root = __webpack_require__(9325); 54926 54927/* Built-in method references that are verified to be native. */ 54928var Map = getNative(root, 'Map'); 54929 54930module.exports = Map; 54931 54932 54933/***/ }, 54934 54935/***/ 32804 54936(module, __unused_webpack_exports, __webpack_require__) { 54937 54938var getNative = __webpack_require__(56110), 54939 root = __webpack_require__(9325); 54940 54941/* Built-in method references that are verified to be native. */ 54942var Promise = getNative(root, 'Promise'); 54943 54944module.exports = Promise; 54945 54946 54947/***/ }, 54948 54949/***/ 76545 54950(module, __unused_webpack_exports, __webpack_require__) { 54951 54952var getNative = __webpack_require__(56110), 54953 root = __webpack_require__(9325); 54954 54955/* Built-in method references that are verified to be native. */ 54956var Set = getNative(root, 'Set'); 54957 54958module.exports = Set; 54959 54960 54961/***/ }, 54962 54963/***/ 51873 54964(module, __unused_webpack_exports, __webpack_require__) { 54965 54966var root = __webpack_require__(9325); 54967 54968/** Built-in value references. */ 54969var Symbol = root.Symbol; 54970 54971module.exports = Symbol; 54972 54973 54974/***/ }, 54975 54976/***/ 28303 54977(module, __unused_webpack_exports, __webpack_require__) { 54978 54979var getNative = __webpack_require__(56110), 54980 root = __webpack_require__(9325); 54981 54982/* Built-in method references that are verified to be native. */ 54983var WeakMap = getNative(root, 'WeakMap'); 54984 54985module.exports = WeakMap; 54986 54987 54988/***/ }, 54989 54990/***/ 70695 54991(module, __unused_webpack_exports, __webpack_require__) { 54992 54993var baseTimes = __webpack_require__(78096), 54994 isArguments = __webpack_require__(72428), 54995 isArray = __webpack_require__(56449), 54996 isBuffer = __webpack_require__(3656), 54997 isIndex = __webpack_require__(30361), 54998 isTypedArray = __webpack_require__(37167); 54999 55000/** Used for built-in method references. */ 55001var objectProto = Object.prototype; 55002 55003/** Used to check objects for own properties. */ 55004var hasOwnProperty = objectProto.hasOwnProperty; 55005 55006/** 55007 * Creates an array of the enumerable property names of the array-like `value`. 55008 * 55009 * @private 55010 * @param {*} value The value to query. 55011 * @param {boolean} inherited Specify returning inherited property names. 55012 * @returns {Array} Returns the array of property names. 55013 */ 55014function arrayLikeKeys(value, inherited) { 55015 var isArr = isArray(value), 55016 isArg = !isArr && isArguments(value),
vendor: 4,546 bytes, lines 55017-55183
55017 isBuff = !isArr && !isArg && isBuffer(value), 55018 isType = !isArr && !isArg && !isBuff && isTypedArray(value), 55019 skipIndexes = isArr || isArg || isBuff || isType, 55020 result = skipIndexes ? baseTimes(value.length, String) : [], 55021 length = result.length; 55022 55023 for (var key in value) { 55024 if ((inherited || hasOwnProperty.call(value, key)) && 55025 !(skipIndexes && ( 55026 // Safari 9 has enumerable `arguments.length` in strict mode. 55027 key == 'length' || 55028 // Node.js 0.10 has enumerable non-index properties on buffers. 55029 (isBuff && (key == 'offset' || key == 'parent')) || 55030 // PhantomJS 2 has enumerable non-index properties on typed arrays. 55031 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || 55032 // Skip index properties. 55033 isIndex(key, length) 55034 ))) { 55035 result.push(key); 55036 } 55037 } 55038 return result; 55039} 55040 55041module.exports = arrayLikeKeys; 55042 55043 55044/***/ }, 55045 55046/***/ 65082 55047(module) { 55048 55049/** 55050 * The base implementation of `_.conformsTo` which accepts `props` to check. 55051 * 55052 * @private 55053 * @param {Object} object The object to inspect. 55054 * @param {Object} source The object of property predicates to conform to. 55055 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 55056 */ 55057function baseConformsTo(object, source, props) { 55058 var length = props.length; 55059 if (object == null) { 55060 return !length; 55061 } 55062 object = Object(object); 55063 while (length--) { 55064 var key = props[length], 55065 predicate = source[key], 55066 value = object[key]; 55067 55068 if ((value === undefined && !(key in object)) || !predicate(value)) { 55069 return false; 55070 } 55071 } 55072 return true; 55073} 55074 55075module.exports = baseConformsTo; 55076 55077 55078/***/ }, 55079 55080/***/ 72552 55081(module, __unused_webpack_exports, __webpack_require__) { 55082 55083var Symbol = __webpack_require__(51873), 55084 getRawTag = __webpack_require__(659), 55085 objectToString = __webpack_require__(59350); 55086 55087/** `Object#toString` result references. */ 55088var nullTag = '[object Null]', 55089 undefinedTag = '[object Undefined]'; 55090 55091/** Built-in value references. */ 55092var symToStringTag = Symbol ? Symbol.toStringTag : undefined; 55093 55094/** 55095 * The base implementation of `getTag` without fallbacks for buggy environments. 55096 * 55097 * @private 55098 * @param {*} value The value to query. 55099 * @returns {string} Returns the `toStringTag`. 55100 */ 55101function baseGetTag(value) { 55102 if (value == null) { 55103 return value === undefined ? undefinedTag : nullTag; 55104 } 55105 return (symToStringTag && symToStringTag in Object(value)) 55106 ? getRawTag(value) 55107 : objectToString(value); 55108} 55109 55110module.exports = baseGetTag; 55111 55112 55113/***/ }, 55114 55115/***/ 27534 55116(module, __unused_webpack_exports, __webpack_require__) { 55117 55118var baseGetTag = __webpack_require__(72552), 55119 isObjectLike = __webpack_require__(40346); 55120 55121/** `Object#toString` result references. */ 55122var argsTag = '[object Arguments]'; 55123 55124/** 55125 * The base implementation of `_.isArguments`. 55126 * 55127 * @private 55128 * @param {*} value The value to check. 55129 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 55130 */ 55131function baseIsArguments(value) { 55132 return isObjectLike(value) && baseGetTag(value) == argsTag; 55133} 55134 55135module.exports = baseIsArguments; 55136 55137 55138/***/ }, 55139 55140/***/ 45083 55141(module, __unused_webpack_exports, __webpack_require__) { 55142 55143var isFunction = __webpack_require__(1882), 55144 isMasked = __webpack_require__(87296), 55145 isObject = __webpack_require__(23805), 55146 toSource = __webpack_require__(47473); 55147 55148/** 55149 * Used to match `RegExp` 55150 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 55151 */ 55152var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 55153 55154/** Used to detect host constructors (Safari). */ 55155var reIsHostCtor = /^\[object .+?Constructor\]$/; 55156 55157/** Used for built-in method references. */ 55158var funcProto = Function.prototype, 55159 objectProto = Object.prototype; 55160 55161/** Used to resolve the decompiled source of functions. */ 55162var funcToString = funcProto.toString; 55163 55164/** Used to check objects for own properties. */ 55165var hasOwnProperty = objectProto.hasOwnProperty; 55166 55167/** Used to detect if a method is native. */ 55168var reIsNative = RegExp('^' + 55169 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 55170 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 55171); 55172 55173/** 55174 * The base implementation of `_.isNative` without bad shim checks. 55175 * 55176 * @private 55177 * @param {*} value The value to check. 55178 * @returns {boolean} Returns `true` if `value` is a native function, 55179 * else `false`. 55180 */ 55181function baseIsNative(value) { 55182 if (!isObject(value) || isMasked(value)) { 55183 return false;
vendor: 19,930 bytes, lines 55184-55993
55184 } 55185 var pattern = isFunction(value) ? reIsNative : reIsHostCtor; 55186 return pattern.test(toSource(value)); 55187} 55188 55189module.exports = baseIsNative; 55190 55191 55192/***/ }, 55193 55194/***/ 4901 55195(module, __unused_webpack_exports, __webpack_require__) { 55196 55197var baseGetTag = __webpack_require__(72552), 55198 isLength = __webpack_require__(30294), 55199 isObjectLike = __webpack_require__(40346); 55200 55201/** `Object#toString` result references. */ 55202var argsTag = '[object Arguments]', 55203 arrayTag = '[object Array]', 55204 boolTag = '[object Boolean]', 55205 dateTag = '[object Date]', 55206 errorTag = '[object Error]', 55207 funcTag = '[object Function]', 55208 mapTag = '[object Map]', 55209 numberTag = '[object Number]', 55210 objectTag = '[object Object]', 55211 regexpTag = '[object RegExp]', 55212 setTag = '[object Set]', 55213 stringTag = '[object String]', 55214 weakMapTag = '[object WeakMap]'; 55215 55216var arrayBufferTag = '[object ArrayBuffer]', 55217 dataViewTag = '[object DataView]', 55218 float32Tag = '[object Float32Array]', 55219 float64Tag = '[object Float64Array]', 55220 int8Tag = '[object Int8Array]', 55221 int16Tag = '[object Int16Array]', 55222 int32Tag = '[object Int32Array]', 55223 uint8Tag = '[object Uint8Array]', 55224 uint8ClampedTag = '[object Uint8ClampedArray]', 55225 uint16Tag = '[object Uint16Array]', 55226 uint32Tag = '[object Uint32Array]'; 55227 55228/** Used to identify `toStringTag` values of typed arrays. */ 55229var typedArrayTags = {}; 55230typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = 55231typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = 55232typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = 55233typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = 55234typedArrayTags[uint32Tag] = true; 55235typedArrayTags[argsTag] = typedArrayTags[arrayTag] = 55236typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = 55237typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = 55238typedArrayTags[errorTag] = typedArrayTags[funcTag] = 55239typedArrayTags[mapTag] = typedArrayTags[numberTag] = 55240typedArrayTags[objectTag] = typedArrayTags[regexpTag] = 55241typedArrayTags[setTag] = typedArrayTags[stringTag] = 55242typedArrayTags[weakMapTag] = false; 55243 55244/** 55245 * The base implementation of `_.isTypedArray` without Node.js optimizations. 55246 * 55247 * @private 55248 * @param {*} value The value to check. 55249 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 55250 */ 55251function baseIsTypedArray(value) { 55252 return isObjectLike(value) && 55253 isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 55254} 55255 55256module.exports = baseIsTypedArray; 55257 55258 55259/***/ }, 55260 55261/***/ 88984 55262(module, __unused_webpack_exports, __webpack_require__) { 55263 55264var isPrototype = __webpack_require__(55527), 55265 nativeKeys = __webpack_require__(3650); 55266 55267/** Used for built-in method references. */ 55268var objectProto = Object.prototype; 55269 55270/** Used to check objects for own properties. */ 55271var hasOwnProperty = objectProto.hasOwnProperty; 55272 55273/** 55274 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 55275 * 55276 * @private 55277 * @param {Object} object The object to query. 55278 * @returns {Array} Returns the array of property names. 55279 */ 55280function baseKeys(object) { 55281 if (!isPrototype(object)) { 55282 return nativeKeys(object); 55283 } 55284 var result = []; 55285 for (var key in Object(object)) { 55286 if (hasOwnProperty.call(object, key) && key != 'constructor') { 55287 result.push(key); 55288 } 55289 } 55290 return result; 55291} 55292 55293module.exports = baseKeys; 55294 55295 55296/***/ }, 55297 55298/***/ 78096 55299(module) { 55300 55301/** 55302 * The base implementation of `_.times` without support for iteratee shorthands 55303 * or max array length checks. 55304 * 55305 * @private 55306 * @param {number} n The number of times to invoke `iteratee`. 55307 * @param {Function} iteratee The function invoked per iteration. 55308 * @returns {Array} Returns the array of results. 55309 */ 55310function baseTimes(n, iteratee) { 55311 var index = -1, 55312 result = Array(n); 55313 55314 while (++index < n) { 55315 result[index] = iteratee(index); 55316 } 55317 return result; 55318} 55319 55320module.exports = baseTimes; 55321 55322 55323/***/ }, 55324 55325/***/ 27301 55326(module) { 55327 55328/** 55329 * The base implementation of `_.unary` without support for storing metadata. 55330 * 55331 * @private 55332 * @param {Function} func The function to cap arguments for. 55333 * @returns {Function} Returns the new capped function. 55334 */ 55335function baseUnary(func) { 55336 return function(value) { 55337 return func(value); 55338 }; 55339} 55340 55341module.exports = baseUnary; 55342 55343 55344/***/ }, 55345 55346/***/ 55481 55347(module, __unused_webpack_exports, __webpack_require__) { 55348 55349var root = __webpack_require__(9325); 55350 55351/** Used to detect overreaching core-js shims. */ 55352var coreJsData = root['__core-js_shared__']; 55353 55354module.exports = coreJsData; 55355 55356 55357/***/ }, 55358 55359/***/ 34840 55360(module, __unused_webpack_exports, __webpack_require__) { 55361 55362/** Detect free variable `global` from Node.js. */ 55363var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; 55364 55365module.exports = freeGlobal; 55366 55367 55368/***/ }, 55369 55370/***/ 56110 55371(module, __unused_webpack_exports, __webpack_require__) { 55372 55373var baseIsNative = __webpack_require__(45083), 55374 getValue = __webpack_require__(10392); 55375 55376/** 55377 * Gets the native function at `key` of `object`. 55378 * 55379 * @private 55380 * @param {Object} object The object to query. 55381 * @param {string} key The key of the method to get. 55382 * @returns {*} Returns the function if it's native, else `undefined`. 55383 */ 55384function getNative(object, key) { 55385 var value = getValue(object, key); 55386 return baseIsNative(value) ? value : undefined; 55387} 55388 55389module.exports = getNative; 55390 55391 55392/***/ }, 55393 55394/***/ 659 55395(module, __unused_webpack_exports, __webpack_require__) { 55396 55397var Symbol = __webpack_require__(51873); 55398 55399/** Used for built-in method references. */ 55400var objectProto = Object.prototype; 55401 55402/** Used to check objects for own properties. */ 55403var hasOwnProperty = objectProto.hasOwnProperty; 55404 55405/** 55406 * Used to resolve the 55407 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 55408 * of values. 55409 */ 55410var nativeObjectToString = objectProto.toString; 55411 55412/** Built-in value references. */ 55413var symToStringTag = Symbol ? Symbol.toStringTag : undefined; 55414 55415/** 55416 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 55417 * 55418 * @private 55419 * @param {*} value The value to query. 55420 * @returns {string} Returns the raw `toStringTag`. 55421 */ 55422function getRawTag(value) { 55423 var isOwn = hasOwnProperty.call(value, symToStringTag), 55424 tag = value[symToStringTag]; 55425 55426 try { 55427 value[symToStringTag] = undefined; 55428 var unmasked = true; 55429 } catch (e) {} 55430 55431 var result = nativeObjectToString.call(value); 55432 if (unmasked) { 55433 if (isOwn) { 55434 value[symToStringTag] = tag; 55435 } else { 55436 delete value[symToStringTag]; 55437 } 55438 } 55439 return result; 55440} 55441 55442module.exports = getRawTag; 55443 55444 55445/***/ }, 55446 55447/***/ 5861 55448(module, __unused_webpack_exports, __webpack_require__) { 55449 55450var DataView = __webpack_require__(55580), 55451 Map = __webpack_require__(68223), 55452 Promise = __webpack_require__(32804), 55453 Set = __webpack_require__(76545), 55454 WeakMap = __webpack_require__(28303), 55455 baseGetTag = __webpack_require__(72552), 55456 toSource = __webpack_require__(47473); 55457 55458/** `Object#toString` result references. */ 55459var mapTag = '[object Map]', 55460 objectTag = '[object Object]', 55461 promiseTag = '[object Promise]', 55462 setTag = '[object Set]', 55463 weakMapTag = '[object WeakMap]'; 55464 55465var dataViewTag = '[object DataView]'; 55466 55467/** Used to detect maps, sets, and weakmaps. */ 55468var dataViewCtorString = toSource(DataView), 55469 mapCtorString = toSource(Map), 55470 promiseCtorString = toSource(Promise), 55471 setCtorString = toSource(Set), 55472 weakMapCtorString = toSource(WeakMap); 55473 55474/** 55475 * Gets the `toStringTag` of `value`. 55476 * 55477 * @private 55478 * @param {*} value The value to query. 55479 * @returns {string} Returns the `toStringTag`. 55480 */ 55481var getTag = baseGetTag; 55482 55483// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 55484if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || 55485 (Map && getTag(new Map) != mapTag) || 55486 (Promise && getTag(Promise.resolve()) != promiseTag) || 55487 (Set && getTag(new Set) != setTag) || 55488 (WeakMap && getTag(new WeakMap) != weakMapTag)) { 55489 getTag = function(value) { 55490 var result = baseGetTag(value), 55491 Ctor = result == objectTag ? value.constructor : undefined, 55492 ctorString = Ctor ? toSource(Ctor) : ''; 55493 55494 if (ctorString) { 55495 switch (ctorString) { 55496 case dataViewCtorString: return dataViewTag; 55497 case mapCtorString: return mapTag; 55498 case promiseCtorString: return promiseTag; 55499 case setCtorString: return setTag; 55500 case weakMapCtorString: return weakMapTag; 55501 } 55502 } 55503 return result; 55504 }; 55505} 55506 55507module.exports = getTag; 55508 55509 55510/***/ }, 55511 55512/***/ 10392 55513(module) { 55514 55515/** 55516 * Gets the value at `key` of `object`. 55517 * 55518 * @private 55519 * @param {Object} [object] The object to query. 55520 * @param {string} key The key of the property to get. 55521 * @returns {*} Returns the property value. 55522 */ 55523function getValue(object, key) { 55524 return object == null ? undefined : object[key]; 55525} 55526 55527module.exports = getValue; 55528 55529 55530/***/ }, 55531 55532/***/ 30361 55533(module) { 55534 55535/** Used as references for various `Number` constants. */ 55536var MAX_SAFE_INTEGER = 9007199254740991; 55537 55538/** Used to detect unsigned integer values. */ 55539var reIsUint = /^(?:0|[1-9]\d*)$/; 55540 55541/** 55542 * Checks if `value` is a valid array-like index. 55543 * 55544 * @private 55545 * @param {*} value The value to check. 55546 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 55547 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 55548 */ 55549function isIndex(value, length) { 55550 var type = typeof value; 55551 length = length == null ? MAX_SAFE_INTEGER : length; 55552 55553 return !!length && 55554 (type == 'number' || 55555 (type != 'symbol' && reIsUint.test(value))) && 55556 (value > -1 && value % 1 == 0 && value < length); 55557} 55558 55559module.exports = isIndex; 55560 55561 55562/***/ }, 55563 55564/***/ 87296 55565(module, __unused_webpack_exports, __webpack_require__) { 55566 55567var coreJsData = __webpack_require__(55481); 55568 55569/** Used to detect methods masquerading as native. */ 55570var maskSrcKey = (function() { 55571 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 55572 return uid ? ('Symbol(src)_1.' + uid) : ''; 55573}()); 55574 55575/** 55576 * Checks if `func` has its source masked. 55577 * 55578 * @private 55579 * @param {Function} func The function to check. 55580 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 55581 */ 55582function isMasked(func) { 55583 return !!maskSrcKey && (maskSrcKey in func); 55584} 55585 55586module.exports = isMasked; 55587 55588 55589/***/ }, 55590 55591/***/ 55527 55592(module) { 55593 55594/** Used for built-in method references. */ 55595var objectProto = Object.prototype; 55596 55597/** 55598 * Checks if `value` is likely a prototype object. 55599 * 55600 * @private 55601 * @param {*} value The value to check. 55602 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 55603 */ 55604function isPrototype(value) { 55605 var Ctor = value && value.constructor, 55606 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; 55607 55608 return value === proto; 55609} 55610 55611module.exports = isPrototype; 55612 55613 55614/***/ }, 55615 55616/***/ 3650 55617(module, __unused_webpack_exports, __webpack_require__) { 55618 55619var overArg = __webpack_require__(74335); 55620 55621/* Built-in method references for those with the same name as other `lodash` methods. */ 55622var nativeKeys = overArg(Object.keys, Object); 55623 55624module.exports = nativeKeys; 55625 55626 55627/***/ }, 55628 55629/***/ 86009 55630(module, exports, __webpack_require__) { 55631 55632/* module decorator */ module = __webpack_require__.nmd(module); 55633var freeGlobal = __webpack_require__(34840); 55634 55635/** Detect free variable `exports`. */ 55636var freeExports = true && exports && !exports.nodeType && exports; 55637 55638/** Detect free variable `module`. */ 55639var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; 55640 55641/** Detect the popular CommonJS extension `module.exports`. */ 55642var moduleExports = freeModule && freeModule.exports === freeExports; 55643 55644/** Detect free variable `process` from Node.js. */ 55645var freeProcess = moduleExports && freeGlobal.process; 55646 55647/** Used to access faster Node.js helpers. */ 55648var nodeUtil = (function() { 55649 try { 55650 // Use `util.types` for Node.js 10+. 55651 var types = freeModule && freeModule.require && freeModule.require('util').types; 55652 55653 if (types) { 55654 return types; 55655 } 55656 55657 // Legacy `process.binding('util')` for Node.js < 10. 55658 return freeProcess && freeProcess.binding && freeProcess.binding('util'); 55659 } catch (e) {} 55660}()); 55661 55662module.exports = nodeUtil; 55663 55664 55665/***/ }, 55666 55667/***/ 59350 55668(module) { 55669 55670/** Used for built-in method references. */ 55671var objectProto = Object.prototype; 55672 55673/** 55674 * Used to resolve the 55675 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 55676 * of values. 55677 */ 55678var nativeObjectToString = objectProto.toString; 55679 55680/** 55681 * Converts `value` to a string using `Object.prototype.toString`. 55682 * 55683 * @private 55684 * @param {*} value The value to convert. 55685 * @returns {string} Returns the converted string. 55686 */ 55687function objectToString(value) { 55688 return nativeObjectToString.call(value); 55689} 55690 55691module.exports = objectToString; 55692 55693 55694/***/ }, 55695 55696/***/ 74335 55697(module) { 55698 55699/** 55700 * Creates a unary function that invokes `func` with its argument transformed. 55701 * 55702 * @private 55703 * @param {Function} func The function to wrap. 55704 * @param {Function} transform The argument transform. 55705 * @returns {Function} Returns the new function. 55706 */ 55707function overArg(func, transform) { 55708 return function(arg) { 55709 return func(transform(arg)); 55710 }; 55711} 55712 55713module.exports = overArg; 55714 55715 55716/***/ }, 55717 55718/***/ 9325 55719(module, __unused_webpack_exports, __webpack_require__) { 55720 55721var freeGlobal = __webpack_require__(34840); 55722 55723/** Detect free variable `self`. */ 55724var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 55725 55726/** Used as a reference to the global object. */ 55727var root = freeGlobal || freeSelf || Function('return this')(); 55728 55729module.exports = root; 55730 55731 55732/***/ }, 55733 55734/***/ 47473 55735(module) { 55736 55737/** Used for built-in method references. */ 55738var funcProto = Function.prototype; 55739 55740/** Used to resolve the decompiled source of functions. */ 55741var funcToString = funcProto.toString; 55742 55743/** 55744 * Converts `func` to its source code. 55745 * 55746 * @private 55747 * @param {Function} func The function to convert. 55748 * @returns {string} Returns the source code. 55749 */ 55750function toSource(func) { 55751 if (func != null) { 55752 try { 55753 return funcToString.call(func); 55754 } catch (e) {} 55755 try { 55756 return (func + ''); 55757 } catch (e) {} 55758 } 55759 return ''; 55760} 55761 55762module.exports = toSource; 55763 55764 55765/***/ }, 55766 55767/***/ 69048 55768(module, __unused_webpack_exports, __webpack_require__) { 55769 55770var baseConformsTo = __webpack_require__(65082), 55771 keys = __webpack_require__(95950); 55772 55773/** 55774 * Checks if `object` conforms to `source` by invoking the predicate 55775 * properties of `source` with the corresponding property values of `object`. 55776 * 55777 * **Note:** This method is equivalent to `_.conforms` when `source` is 55778 * partially applied. 55779 * 55780 * @static 55781 * @memberOf _ 55782 * @since 4.14.0 55783 * @category Lang 55784 * @param {Object} object The object to inspect. 55785 * @param {Object} source The object of property predicates to conform to. 55786 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 55787 * @example 55788 * 55789 * var object = { 'a': 1, 'b': 2 }; 55790 * 55791 * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); 55792 * // => true 55793 * 55794 * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); 55795 * // => false 55796 */ 55797function conformsTo(object, source) { 55798 return source == null || baseConformsTo(object, source, keys(source)); 55799} 55800 55801module.exports = conformsTo; 55802 55803 55804/***/ }, 55805 55806/***/ 72428 55807(module, __unused_webpack_exports, __webpack_require__) { 55808 55809var baseIsArguments = __webpack_require__(27534), 55810 isObjectLike = __webpack_require__(40346); 55811 55812/** Used for built-in method references. */ 55813var objectProto = Object.prototype; 55814 55815/** Used to check objects for own properties. */ 55816var hasOwnProperty = objectProto.hasOwnProperty; 55817 55818/** Built-in value references. */ 55819var propertyIsEnumerable = objectProto.propertyIsEnumerable; 55820 55821/** 55822 * Checks if `value` is likely an `arguments` object. 55823 * 55824 * @static 55825 * @memberOf _ 55826 * @since 0.1.0 55827 * @category Lang 55828 * @param {*} value The value to check. 55829 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 55830 * else `false`. 55831 * @example 55832 * 55833 * _.isArguments(function() { return arguments; }()); 55834 * // => true 55835 * 55836 * _.isArguments([1, 2, 3]); 55837 * // => false 55838 */ 55839var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { 55840 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && 55841 !propertyIsEnumerable.call(value, 'callee'); 55842}; 55843 55844module.exports = isArguments; 55845 55846 55847/***/ }, 55848 55849/***/ 56449 55850(module) { 55851 55852/** 55853 * Checks if `value` is classified as an `Array` object. 55854 * 55855 * @static 55856 * @memberOf _ 55857 * @since 0.1.0 55858 * @category Lang 55859 * @param {*} value The value to check. 55860 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 55861 * @example 55862 * 55863 * _.isArray([1, 2, 3]); 55864 * // => true 55865 * 55866 * _.isArray(document.body.children); 55867 * // => false 55868 * 55869 * _.isArray('abc'); 55870 * // => false 55871 * 55872 * _.isArray(_.noop); 55873 * // => false 55874 */ 55875var isArray = Array.isArray; 55876 55877module.exports = isArray; 55878 55879 55880/***/ }, 55881 55882/***/ 64894 55883(module, __unused_webpack_exports, __webpack_require__) { 55884 55885var isFunction = __webpack_require__(1882), 55886 isLength = __webpack_require__(30294); 55887 55888/** 55889 * Checks if `value` is array-like. A value is considered array-like if it's 55890 * not a function and has a `value.length` that's an integer greater than or 55891 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 55892 * 55893 * @static 55894 * @memberOf _ 55895 * @since 4.0.0 55896 * @category Lang 55897 * @param {*} value The value to check. 55898 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 55899 * @example 55900 * 55901 * _.isArrayLike([1, 2, 3]); 55902 * // => true 55903 * 55904 * _.isArrayLike(document.body.children); 55905 * // => true 55906 * 55907 * _.isArrayLike('abc'); 55908 * // => true 55909 * 55910 * _.isArrayLike(_.noop); 55911 * // => false 55912 */ 55913function isArrayLike(value) { 55914 return value != null && isLength(value.length) && !isFunction(value); 55915} 55916 55917module.exports = isArrayLike; 55918 55919 55920/***/ }, 55921 55922/***/ 3656 55923(module, exports, __webpack_require__) { 55924 55925/* module decorator */ module = __webpack_require__.nmd(module); 55926var root = __webpack_require__(9325), 55927 stubFalse = __webpack_require__(89935); 55928 55929/** Detect free variable `exports`. */ 55930var freeExports = true && exports && !exports.nodeType && exports; 55931 55932/** Detect free variable `module`. */ 55933var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; 55934 55935/** Detect the popular CommonJS extension `module.exports`. */ 55936var moduleExports = freeModule && freeModule.exports === freeExports; 55937 55938/** Built-in value references. */ 55939var Buffer = moduleExports ? root.Buffer : undefined; 55940 55941/* Built-in method references for those with the same name as other `lodash` methods. */ 55942var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; 55943 55944/** 55945 * Checks if `value` is a buffer. 55946 * 55947 * @static 55948 * @memberOf _ 55949 * @since 4.3.0 55950 * @category Lang 55951 * @param {*} value The value to check. 55952 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 55953 * @example 55954 * 55955 * _.isBuffer(new Buffer(2)); 55956 * // => true 55957 * 55958 * _.isBuffer(new Uint8Array(2)); 55959 * // => false 55960 */ 55961var isBuffer = nativeIsBuffer || stubFalse; 55962 55963module.exports = isBuffer; 55964 55965 55966/***/ }, 55967 55968/***/ 62193 55969(module, __unused_webpack_exports, __webpack_require__) { 55970 55971var baseKeys = __webpack_require__(88984), 55972 getTag = __webpack_require__(5861), 55973 isArguments = __webpack_require__(72428), 55974 isArray = __webpack_require__(56449), 55975 isArrayLike = __webpack_require__(64894), 55976 isBuffer = __webpack_require__(3656), 55977 isPrototype = __webpack_require__(55527), 55978 isTypedArray = __webpack_require__(37167); 55979 55980/** `Object#toString` result references. */ 55981var mapTag = '[object Map]', 55982 setTag = '[object Set]'; 55983 55984/** Used for built-in method references. */ 55985var objectProto = Object.prototype; 55986 55987/** Used to check objects for own properties. */ 55988var hasOwnProperty = objectProto.hasOwnProperty; 55989 55990/** 55991 * Checks if `value` is an empty object, collection, map, or set. 55992 * 55993 * Objects are considered empty if they have no own enumerable str
55993ing keyed 55994 * properties. 55995 * 55996 * Array-like values such as `arguments` objects, arrays, buffers, strings, or 55997 * jQuery-like collections are considered empty if they have a `length` of `0`. 55998 * Similarly, maps and sets are considered empty if they have a `size` of `0`. 55999 * 56000 * @static 56001 * @memberOf _ 56002 * @since 0.1.0 56003 * @category Lang 56004 * @param {*} value The value to check. 56005 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 56006 * @example 56007 * 56008 * _.isEmpty(null); 56009 * // => true 56010 * 56011 * _.isEmpty(true); 56012 * // => true 56013 * 56014 * _.isEmpty(1); 56015 * // => true 56016 * 56017 * _.isEmpty([1, 2, 3]); 56018 * // => false 56019 * 56020 * _.isEmpty({ 'a': 1 }); 56021 * // => false 56022 */ 56023function isEmpty(value) { 56024 if (value == null) { 56025 return true; 56026 } 56027 if (isArrayLike(value) && 56028 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || 56029 isBuffer(value) || isTypedArray(value) || isArguments(value))) { 56030 return !value.length; 56031 } 56032 var tag = getTag(value); 56033 if (tag == mapTag || tag == setTag) { 56034 return !value.size; 56035 } 56036 if (isPrototype(value)) { 56037 return !baseKeys(value).length; 56038 } 56039 for (var key in value) { 56040 if (hasOwnProperty.call(value, key)) { 56041 return false; 56042 } 56043 } 56044 return true; 56045} 56046 56047module.exports = isEmpty; 56048 56049 56050/***/ }, 56051 56052/***/ 1882 56053(module, __unused_webpack_exports, __webpack_require__) { 56054 56055var baseGetTag = __webpack_require__(72552), 56056 isObject = __webpack_require__(23805); 56057 56058/** `Object#toString` result references. */ 56059var asyncTag = '[object AsyncFunction]', 56060 funcTag = '[object Function]', 56061 genTag = '[object GeneratorFunction]', 56062 proxyTag = '[object Proxy]'; 56063 56064/** 56065 * Checks if `value` is classified as a `Function` object. 56066 * 56067 * @static 56068 * @memberOf _ 56069 * @since 0.1.0 56070 * @category Lang 56071 * @param {*} value The value to check. 56072 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 56073 * @example 56074 * 56075 * _.isFunction(_); 56076 * // => true 56077 * 56078 * _.isFunction(/abc/); 56079 * // => false 56080 */ 56081function isFunction(value) { 56082 if (!isObject(value)) { 56083 return false; 56084 } 56085 // The use of `Object#toString` avoids issues with the `typeof` operator 56086 // in Safari 9 which returns 'object' for typed arrays and other constructors. 56087 var tag = baseGetTag(value); 56088 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 56089} 56090 56091module.exports = isFunction; 56092 56093 56094/***/ }, 56095 56096/***/ 30294 56097(module) { 56098 56099/** Used as references for various `Number` constants. */ 56100var MAX_SAFE_INTEGER = 9007199254740991; 56101 56102/** 56103 * Checks if `value` is a valid array-like length. 56104 * 56105 * **Note:** This method is loosely based on 56106 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 56107 * 56108 * @static 56109 * @memberOf _ 56110 * @since 4.0.0 56111 * @category Lang 56112 * @param {*} value The value to check. 56113 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 56114 * @example 56115 * 56116 * _.isLength(3); 56117 * // => true 56118 * 56119 * _.isLength(Number.MIN_VALUE); 56120 * // => false 56121 * 56122 * _.isLength(Infinity); 56123 * // => false 56124 * 56125 * _.isLength('3'); 56126 * // => false 56127 */ 56128function isLength(value) { 56129 return typeof value == 'number' && 56130 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 56131} 56132 56133module.exports = isLength; 56134 56135 56136/***/ }, 56137 56138/***/ 98023 56139(module, __unused_webpack_exports, __webpack_require__) { 56140 56141var baseGetTag = __webpack_require__(72552), 56142 isObjectLike = __webpack_require__(40346); 56143 56144/** `Object#toString` result references. */ 56145var numberTag = '[object Number]'; 56146 56147/** 56148 * Checks if `value` is classified as a `Number` primitive or object. 56149 * 56150 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are 56151 * classified as numbers, use the `_.isFinite` method. 56152 * 56153 * @static 56154 * @memberOf _ 56155 * @since 0.1.0 56156 * @category Lang 56157 * @param {*} value The value to check. 56158 * @returns {boolean} Returns `true` if `value` is a number, else `false`. 56159 * @example 56160 * 56161 * _.isNumber(3); 56162 * // => true 56163 * 56164 * _.isNumber(Number.MIN_VALUE); 56165 * // => true 56166 * 56167 * _.isNumber(Infinity); 56168 * // => true 56169 * 56170 * _.isNumber('3'); 56171 * // => false 56172 */ 56173function isNumber(value) { 56174 return typeof value == 'number' || 56175 (isObjectLike(value) && baseGetTag(value) == numberTag); 56176} 56177 56178module.exports = isNumber; 56179 56180 56181/***/ }, 56182 56183/***/ 23805 56184(module) { 56185 56186/** 56187 * Checks if `value` is the 56188 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 56189 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 56190 * 56191 * @static 56192 * @memberOf _ 56193 * @since 0.1.0 56194 * @category Lang 56195 * @param {*} value The value to check. 56196 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 56197 * @example 56198 * 56199 * _.isObject({}); 56200 * // => true 56201 * 56202 * _.isObject([1, 2, 3]); 56203 * // => true 56204 * 56205 * _.isObject(_.noop); 56206 * // => true 56207 * 56208 * _.isObject(null); 56209 * // => false 56210 */ 56211function isObject(value) { 56212 var type = typeof value; 56213 return value != null && (type == 'object' || type == 'function'); 56214} 56215 56216module.exports = isObject; 56217 56218 56219/***/ }, 56220 56221/***/ 40346 56222(module) { 56223 56224/** 56225 * Checks if `value` is object-like. A value is object-like if it's not `null` 56226 * and has a `typeof` result of "object". 56227 * 56228 * @static 56229 * @memberOf _ 56230 * @since 4.0.0 56231 * @category Lang 56232 * @param {*} value The value to check. 56233 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 56234 * @example 56235 * 56236 * _.isObjectLike({}); 56237 * // => true 56238 * 56239 * _.isObjectLike([1, 2, 3]); 56240 * // => true 56241 * 56242 * _.isObjectLike(_.noop); 56243 * // => false 56244 * 56245 * _.isObjectLike(null); 56246 * // => false 56247 */ 56248function isObjectLike(value) { 56249 return value != null && typeof value == 'object'; 56250} 56251 56252module.exports = isObjectLike; 56253 56254 56255/***/ }, 56256 56257/***/ 85015 56258(module, __unused_webpack_exports, __webpack_require__) { 56259 56260var baseGetTag = __webpack_require__(72552), 56261 isArray = __webpack_require__(56449), 56262 isObjectLike = __webpack_require__(40346); 56263 56264/** `Object#toString` result references. */ 56265var stringTag = '[object String]'; 56266 56267/** 56268 * Checks if `value` is classified as a `String` primitive or object. 56269 * 56270 * @static 56271 * @since 0.1.0 56272 * @memberOf _ 56273 * @category Lang 56274 * @param {*} value The value to check. 56275 * @returns {boolean} Returns `true` if `value` is a string, else `false`. 56276 * @example 56277 * 56278 * _.isString('abc'); 56279 * // => true 56280 * 56281 * _.isString(1); 56282 * // => false 56283 */ 56284function isString(value) { 56285 return typeof value == 'string' || 56286 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); 56287} 56288 56289module.exports = isString; 56290 56291 56292/***/ }, 56293 56294/***/ 37167 56295(module, __unused_webpack_exports, __webpack_require__) { 56296 56297var baseIsTypedArray = __webpack_require__(4901), 56298 baseUnary = __webpack_require__(27301), 56299 nodeUtil = __webpack_require__(86009); 56300 56301/* Node.js helper references. */ 56302var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 56303 56304/** 56305 * Checks if `value` is classified as a typed array.
56306 * 56307 * @static 56308 * @memberOf _ 56309 * @since 3.0.0 56310 * @category Lang 56311 * @param {*} value The value to check. 56312 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 56313 * @example 56314 * 56315 * _.isTypedArray(new Uint8Array); 56316 * // => true 56317 * 56318 * _.isTypedArray([]); 56319 * // => false 56320 */ 56321var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 56322 56323module.exports = isTypedArray; 56324 56325 56326/***/ }, 56327 56328/***/ 95950 56329(module, __unused_webpack_exports, __webpack_require__) { 56330 56331var arrayLikeKeys = __webpack_require__(70695), 56332 baseKeys = __webpack_require__(88984), 56333 isArrayLike = __webpack_require__(64894); 56334 56335/** 56336 * Creates an array of the own enumerable property names of `object`. 56337 * 56338 * **Note:** Non-object values are coerced to objects. See the 56339 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 56340 * for more details. 56341 * 56342 * @static 56343 * @since 0.1.0 56344 * @memberOf _ 56345 * @category Object 56346 * @param {Object} object The object to query. 56347 * @returns {Array} Returns the array of property names. 56348 * @example 56349 * 56350 * function Foo() { 56351 * this.a = 1; 56352 * this.b = 2; 56353 * } 56354 * 56355 * Foo.prototype.c = 3; 56356 * 56357 * _.keys(new Foo); 56358 * // => ['a', 'b'] (iteration order is not guaranteed) 56359 * 56360 * _.keys('hi'); 56361 * // => ['0', '1'] 56362 */ 56363function keys(object) { 56364 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 56365} 56366 56367module.exports = keys; 56368 56369 56370/***/ }, 56371 56372/***/ 89935 56373(module) { 56374 56375/** 56376 * This method returns `false`. 56377 * 56378 * @static 56379 * @memberOf _ 56380 * @since 4.13.0 56381 * @category Util 56382 * @returns {boolean} Returns `false`. 56383 * @example 56384 * 56385 * _.times(2, _.stubFalse); 56386 * // => [false, false] 56387 */ 56388function stubFalse() { 56389 return false; 56390} 56391 56392module.exports = stubFalse; 56393 56394 56395/***/ }, 56396 56397/***/ 73065 56398(module, exports, __webpack_require__) { 56399 56400var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* 56401* loglevel - https://github.com/pimterry/loglevel 56402* 56403* Copyright (c) 2013 Tim Perry 56404* Licensed under the MIT license. 56405*/ 56406(function (root, definition) { 56407 "use strict"; 56408 if (true) { 56409 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition), 56410 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 56411 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 56412 __WEBPACK_AMD_DEFINE_FACTORY__), 56413 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 56414 } else // removed by dead control flow
vendor: 10,933 bytes, lines 56415-56760
56415{} 56416}(this, function () { 56417 "use strict"; 56418 56419 // Slightly dubious tricks to cut down minimized file size 56420 var noop = function() {}; 56421 var undefinedType = "undefined"; 56422 var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && ( 56423 /Trident\/|MSIE /.test(window.navigator.userAgent) 56424 ); 56425 56426 var logMethods = [ 56427 "trace", 56428 "debug", 56429 "info", 56430 "warn", 56431 "error" 56432 ]; 56433 56434 var _loggersByName = {}; 56435 var defaultLogger = null; 56436 56437 // Cross-browser bind equivalent that works at least back to IE6 56438 function bindMethod(obj, methodName) { 56439 var method = obj[methodName]; 56440 if (typeof method.bind === 'function') { 56441 return method.bind(obj); 56442 } else { 56443 try { 56444 return Function.prototype.bind.call(method, obj); 56445 } catch (e) { 56446 // Missing bind shim or IE8 + Modernizr, fallback to wrapping 56447 return function() { 56448 return Function.prototype.apply.apply(method, [obj, arguments]); 56449 }; 56450 } 56451 } 56452 } 56453 56454 // Trace() doesn't print the message in IE, so for that case we need to wrap it 56455 function traceForIE() { 56456 if (console.log) { 56457 if (console.log.apply) { 56458 console.log.apply(console, arguments); 56459 } else { 56460 // In old IE, native console methods themselves don't have apply(). 56461 Function.prototype.apply.apply(console.log, [console, arguments]); 56462 } 56463 } 56464 if (console.trace) console.trace(); 56465 } 56466 56467 // Build the best logging method possible for this env 56468 // Wherever possible we want to bind, not wrap, to preserve stack traces 56469 function realMethod(methodName) { 56470 if (methodName === 'debug') { 56471 methodName = 'log'; 56472 } 56473 56474 if (typeof console === undefinedType) { 56475 return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives 56476 } else if (methodName === 'trace' && isIE) { 56477 return traceForIE; 56478 } else if (console[methodName] !== undefined) { 56479 return bindMethod(console, methodName); 56480 } else if (console.log !== undefined) { 56481 return bindMethod(console, 'log'); 56482 } else { 56483 return noop; 56484 } 56485 } 56486 56487 // These private functions always need `this` to be set properly 56488 56489 function replaceLoggingMethods() { 56490 /*jshint validthis:true */ 56491 var level = this.getLevel(); 56492 56493 // Replace the actual methods. 56494 for (var i = 0; i < logMethods.length; i++) { 56495 var methodName = logMethods[i]; 56496 this[methodName] = (i < level) ? 56497 noop : 56498 this.methodFactory(methodName, level, this.name); 56499 } 56500 56501 // Define log.log as an alias for log.debug 56502 this.log = this.debug; 56503 56504 // Return any important warnings. 56505 if (typeof console === undefinedType && level < this.levels.SILENT) { 56506 return "No console available for logging"; 56507 } 56508 } 56509 56510 // In old IE versions, the console isn't present until you first open it. 56511 // We build realMethod() replacements here that regenerate logging methods 56512 function enableLoggingWhenConsoleArrives(methodName) { 56513 return function () { 56514 if (typeof console !== undefinedType) { 56515 replaceLoggingMethods.call(this); 56516 this[methodName].apply(this, arguments); 56517 } 56518 }; 56519 } 56520 56521 // By default, we use closely bound real methods wherever possible, and 56522 // otherwise we wait for a console to appear, and then try again. 56523 function defaultMethodFactory(methodName, _level, _loggerName) { 56524 /*jshint validthis:true */ 56525 return realMethod(methodName) || 56526 enableLoggingWhenConsoleArrives.apply(this, arguments); 56527 } 56528 56529 function Logger(name, factory) { 56530 // Private instance variables. 56531 var self = this; 56532 /** 56533 * The level inherited from a parent logger (or a global default). We 56534 * cache this here rather than delegating to the parent so that it stays 56535 * in sync with the actual logging methods that we have installed (the 56536 * parent could change levels but we might not have rebuilt the loggers 56537 * in this child yet). 56538 * @type {number} 56539 */ 56540 var inheritedLevel; 56541 /** 56542 * The default level for this logger, if any. If set, this overrides 56543 * `inheritedLevel`. 56544 * @type {number|null} 56545 */ 56546 var defaultLevel; 56547 /** 56548 * A user-specific level for this logger. If set, this overrides 56549 * `defaultLevel`. 56550 * @type {number|null} 56551 */ 56552 var userLevel; 56553 56554 var storageKey = "loglevel"; 56555 if (typeof name === "string") { 56556 storageKey += ":" + name; 56557 } else if (typeof name === "symbol") { 56558 storageKey = undefined; 56559 } 56560 56561 function persistLevelIfPossible(levelNum) { 56562 var levelName = (logMethods[levelNum] || 'silent').toUpperCase(); 56563 56564 if (typeof window === undefinedType || !storageKey) return; 56565 56566 // Use localStorage if available 56567 try { 56568 window.localStorage[storageKey] = levelName; 56569 return; 56570 } catch (ignore) {} 56571 56572 // Use session cookie as fallback 56573 try { 56574 window.document.cookie = 56575 encodeURIComponent(storageKey) + "=" + levelName + ";"; 56576 } catch (ignore) {} 56577 } 56578 56579 function getPersistedLevel() { 56580 var storedLevel; 56581 56582 if (typeof window === undefinedType || !storageKey) return; 56583 56584 try { 56585 storedLevel = window.localStorage[storageKey]; 56586 } catch (ignore) {} 56587 56588 // Fallback to cookies if local storage gives us nothing 56589 if (typeof storedLevel === undefinedType) { 56590 try { 56591 var cookie = window.document.cookie; 56592 var cookieName = encodeURIComponent(storageKey); 56593 var location = cookie.indexOf(cookieName + "="); 56594 if (location !== -1) { 56595 storedLevel = /^([^;]+)/.exec( 56596 cookie.slice(location + cookieName.length + 1) 56597 )[1]; 56598 } 56599 } catch (ignore) {} 56600 } 56601 56602 // If the stored level is not valid, treat it as if nothing was stored. 56603 if (self.levels[storedLevel] === undefined) { 56604 storedLevel = undefined; 56605 } 56606 56607 return storedLevel; 56608 } 56609 56610 function clearPersistedLevel() { 56611 if (typeof window === undefinedType || !storageKey) return; 56612 56613 // Use localStorage if available 56614 try { 56615 window.localStorage.removeItem(storageKey); 56616 } catch (ignore) {} 56617 56618 // Use session cookie as fallback 56619 try { 56620 window.document.cookie = 56621 encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; 56622 } catch (ignore) {} 56623 } 56624 56625 function normalizeLevel(input) { 56626 var level = input; 56627 if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) { 56628 level = self.levels[level.toUpperCase()]; 56629 } 56630 if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) { 56631 return level; 56632 } else { 56633 throw new TypeError("log.setLevel() called with invalid level: " + input); 56634 } 56635 } 56636 56637 /* 56638 * 56639 * Public logger API - see https://github.com/pimterry/loglevel for details 56640 * 56641 */ 56642 56643 self.name = name; 56644 56645 self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3, 56646 "ERROR": 4, "SILENT": 5}; 56647 56648 self.methodFactory = factory || defaultMethodFactory; 56649 56650 self.getLevel = function () { 56651 if (userLevel != null) { 56652 return userLevel; 56653 } else if (defaultLevel != null) { 56654 return defaultLevel; 56655 } else { 56656 return inheritedLevel; 56657 } 56658 }; 56659 56660 self.setLevel = function (level, persist) { 56661 userLevel = normalizeLevel(level); 56662 if (persist !== false) { // defaults to true 56663 persistLevelIfPossible(userLevel); 56664 } 56665 56666 // NOTE: in v2, this should call rebuild(), which updates children. 56667 return replaceLoggingMethods.call(self); 56668 }; 56669 56670 self.setDefaultLevel = function (level) { 56671 defaultLevel = normalizeLevel(level); 56672 if (!getPersistedLevel()) { 56673 self.setLevel(level, false); 56674 } 56675 }; 56676 56677 self.resetLevel = function () { 56678 userLevel = null; 56679 clearPersistedLevel(); 56680 replaceLoggingMethods.call(self); 56681 }; 56682 56683 self.enableAll = function(persist) { 56684 self.setLevel(self.levels.TRACE, persist); 56685 }; 56686 56687 self.disableAll = function(persist) { 56688 self.setLevel(self.levels.SILENT, persist); 56689 }; 56690 56691 self.rebuild = function () { 56692 if (defaultLogger !== self) { 56693 inheritedLevel = normalizeLevel(defaultLogger.getLevel()); 56694 } 56695 replaceLoggingMethods.call(self); 56696 56697 if (defaultLogger === self) { 56698 for (var childName in _loggersByName) { 56699 _loggersByName[childName].rebuild(); 56700 } 56701 } 56702 }; 56703 56704 // Initialize all the internal levels. 56705 inheritedLevel = normalizeLevel( 56706 defaultLogger ? defaultLogger.getLevel() : "WARN" 56707 ); 56708 var initialLevel = getPersistedLevel(); 56709 if (initialLevel != null) { 56710 userLevel = normalizeLevel(initialLevel); 56711 } 56712 replaceLoggingMethods.call(self); 56713 } 56714 56715 /* 56716 * 56717 * Top-level API 56718 * 56719 */ 56720 56721 defaultLogger = new Logger(); 56722 56723 defaultLogger.getLogger = function getLogger(name) { 56724 if ((typeof name !== "symbol" && typeof name !== "string") || name === "") { 56725 throw new TypeError("You must supply a name when creating a logger."); 56726 } 56727 56728 var logger = _loggersByName[name]; 56729 if (!logger) { 56730 logger = _loggersByName[name] = new Logger( 56731 name, 56732 defaultLogger.methodFactory 56733 ); 56734 } 56735 return logger; 56736 }; 56737 56738 // Grab the current global log variable in case of overwrite 56739 var _log = (typeof window !== undefinedType) ? window.log : undefined; 56740 defaultLogger.noConflict = function() { 56741 if (typeof window !== undefinedType && 56742 window.log === defaultLogger) { 56743 window.log = _log; 56744 } 56745 56746 return defaultLogger; 56747 }; 56748 56749 defaultLogger.getLoggers = function getLoggers() { 56750 return _loggersByName; 56751 }; 56752 56753 // ES6 default export, for compatibility 56754 defaultLogger['default'] = defaultLogger; 56755 56756 return defaultLogger; 56757})); 56758 56759 56760/***/ }
vendor: 18,097 bytes, lines 56760-57348
56760, 56761 56762/***/ 71514 56763(module) { 56764 56765"use strict"; 56766 56767 56768/** @type {import('./abs')} */ 56769module.exports = Math.abs; 56770 56771 56772/***/ }, 56773 56774/***/ 58968 56775(module) { 56776 56777"use strict"; 56778 56779 56780/** @type {import('./floor')} */ 56781module.exports = Math.floor; 56782 56783 56784/***/ }, 56785 56786/***/ 94459 56787(module) { 56788 56789"use strict"; 56790 56791 56792/** @type {import('./isNaN')} */ 56793module.exports = Number.isNaN || function isNaN(a) { 56794 return a !== a; 56795}; 56796 56797 56798/***/ }, 56799 56800/***/ 6188 56801(module) { 56802 56803"use strict"; 56804 56805 56806/** @type {import('./max')} */ 56807module.exports = Math.max; 56808 56809 56810/***/ }, 56811 56812/***/ 68002 56813(module) { 56814 56815"use strict"; 56816 56817 56818/** @type {import('./min')} */ 56819module.exports = Math.min; 56820 56821 56822/***/ }, 56823 56824/***/ 75880 56825(module) { 56826 56827"use strict"; 56828 56829 56830/** @type {import('./pow')} */ 56831module.exports = Math.pow; 56832 56833 56834/***/ }, 56835 56836/***/ 70414 56837(module) { 56838 56839"use strict"; 56840 56841 56842/** @type {import('./round')} */ 56843module.exports = Math.round; 56844 56845 56846/***/ }, 56847 56848/***/ 73093 56849(module, __unused_webpack_exports, __webpack_require__) { 56850 56851"use strict"; 56852 56853 56854var $isNaN = __webpack_require__(94459); 56855 56856/** @type {import('./sign')} */ 56857module.exports = function sign(number) { 56858 if ($isNaN(number) || number === 0) { 56859 return number; 56860 } 56861 return number < 0 ? -1 : +1; 56862}; 56863 56864 56865/***/ }, 56866 56867/***/ 58859 56868(module, __unused_webpack_exports, __webpack_require__) { 56869 56870var hasMap = typeof Map === 'function' && Map.prototype; 56871var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; 56872var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; 56873var mapForEach = hasMap && Map.prototype.forEach; 56874var hasSet = typeof Set === 'function' && Set.prototype; 56875var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; 56876var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; 56877var setForEach = hasSet && Set.prototype.forEach; 56878var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; 56879var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; 56880var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; 56881var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; 56882var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; 56883var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; 56884var booleanValueOf = Boolean.prototype.valueOf; 56885var objectToString = Object.prototype.toString; 56886var functionToString = Function.prototype.toString; 56887var $match = String.prototype.match; 56888var $slice = String.prototype.slice; 56889var $replace = String.prototype.replace; 56890var $toUpperCase = String.prototype.toUpperCase; 56891var $toLowerCase = String.prototype.toLowerCase; 56892var $test = RegExp.prototype.test; 56893var $concat = Array.prototype.concat; 56894var $join = Array.prototype.join; 56895var $arrSlice = Array.prototype.slice; 56896var $floor = Math.floor; 56897var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; 56898var gOPS = Object.getOwnPropertySymbols; 56899var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; 56900var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; 56901// ie, `has-tostringtag/shams 56902var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') 56903 ? Symbol.toStringTag 56904 : null; 56905var isEnumerable = Object.prototype.propertyIsEnumerable; 56906 56907var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( 56908 [].__proto__ === Array.prototype // eslint-disable-line no-proto 56909 ? function (O) { 56910 return O.__proto__; // eslint-disable-line no-proto 56911 } 56912 : null 56913); 56914 56915function addNumericSeparator(num, str) { 56916 if ( 56917 num === Infinity 56918 || num === -Infinity 56919 || num !== num 56920 || (num && num > -1000 && num < 1000) 56921 || $test.call(/e/, str) 56922 ) { 56923 return str; 56924 } 56925 var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; 56926 if (typeof num === 'number') { 56927 var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) 56928 if (int !== num) { 56929 var intStr = String(int); 56930 var dec = $slice.call(str, intStr.length + 1); 56931 return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); 56932 } 56933 } 56934 return $replace.call(str, sepRegex, '$&_'); 56935} 56936 56937var utilInspect = __webpack_require__(42634); 56938var inspectCustom = utilInspect.custom; 56939var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; 56940 56941var quotes = { 56942 __proto__: null, 56943 'double': '"', 56944 single: "'" 56945}; 56946var quoteREs = { 56947 __proto__: null, 56948 'double': /(["\\])/g, 56949 single: /(['\\])/g 56950}; 56951 56952module.exports = function inspect_(obj, options, depth, seen) { 56953 var opts = options || {}; 56954 56955 if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { 56956 throw new TypeError('option "quoteStyle" must be "single" or "double"'); 56957 } 56958 if ( 56959 has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' 56960 ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity 56961 : opts.maxStringLength !== null 56962 ) 56963 ) { 56964 throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); 56965 } 56966 var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; 56967 if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { 56968 throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); 56969 } 56970 56971 if ( 56972 has(opts, 'indent') 56973 && opts.indent !== null 56974 && opts.indent !== '\t' 56975 && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) 56976 ) { 56977 throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); 56978 } 56979 if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { 56980 throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); 56981 } 56982 var numericSeparator = opts.numericSeparator; 56983 56984 if (typeof obj === 'undefined') { 56985 return 'undefined'; 56986 } 56987 if (obj === null) { 56988 return 'null'; 56989 } 56990 if (typeof obj === 'boolean') { 56991 return obj ? 'true' : 'false'; 56992 } 56993 56994 if (typeof obj === 'string') { 56995 return inspectString(obj, opts); 56996 } 56997 if (typeof obj === 'number') { 56998 if (obj === 0) { 56999 return Infinity / obj > 0 ? '0' : '-0'; 57000 } 57001 var str = String(obj); 57002 return numericSeparator ? addNumericSeparator(obj, str) : str; 57003 } 57004 if (typeof obj === 'bigint') { 57005 var bigIntStr = String(obj) + 'n'; 57006 return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; 57007 } 57008 57009 var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; 57010 if (typeof depth === 'undefined') { depth = 0; } 57011 if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { 57012 return isArray(obj) ? '[Array]' : '[Object]'; 57013 } 57014 57015 var indent = getIndent(opts, depth); 57016 57017 if (typeof seen === 'undefined') { 57018 seen = []; 57019 } else if (indexOf(seen, obj) >= 0) { 57020 return '[Circular]'; 57021 } 57022 57023 function inspect(value, from, noIndent) { 57024 if (from) { 57025 seen = $arrSlice.call(seen); 57026 seen.push(from); 57027 } 57028 if (noIndent) { 57029 var newOpts = { 57030 depth: opts.depth 57031 }; 57032 if (has(opts, 'quoteStyle')) { 57033 newOpts.quoteStyle = opts.quoteStyle; 57034 } 57035 return inspect_(value, newOpts, depth + 1, seen); 57036 } 57037 return inspect_(value, opts, depth + 1, seen); 57038 } 57039 57040 if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable 57041 var name = nameOf(obj); 57042 var keys = arrObjKeys(obj, inspect); 57043 return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); 57044 } 57045 if (isSymbol(obj)) { 57046 var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); 57047 return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; 57048 } 57049 if (isElement(obj)) { 57050 var s = '<' + $toLowerCase.call(String(obj.nodeName)); 57051 var attrs = obj.attributes || []; 57052 for (var i = 0; i < attrs.length; i++) { 57053 s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); 57054 } 57055 s += '>'; 57056 if (obj.childNodes && obj.childNodes.length) { s += '...'; } 57057 s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>'; 57058 return s; 57059 } 57060 if (isArray(obj)) { 57061 if (obj.length === 0) { return '[]'; } 57062 var xs = arrObjKeys(obj, inspect); 57063 if (indent && !singleLineValues(xs)) { 57064 return '[' + indentedJoin(xs, indent) + ']'; 57065 } 57066 return '[ ' + $join.call(xs, ', ') + ' ]'; 57067 } 57068 if (isError(obj)) { 57069 var parts = arrObjKeys(obj, inspect); 57070 if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { 57071 return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; 57072 } 57073 if (parts.length === 0) { return '[' + String(obj) + ']'; } 57074 return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; 57075 } 57076 if (typeof obj === 'object' && customInspect) { 57077 if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { 57078 return utilInspect(obj, { depth: maxDepth - depth }); 57079 } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { 57080 return obj.inspect(); 57081 } 57082 } 57083 if (isMap(obj)) { 57084 var mapParts = []; 57085 if (mapForEach) { 57086 mapForEach.call(obj, function (value, key) { 57087 mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); 57088 }); 57089 } 57090 return collectionOf('Map', mapSize.call(obj), mapParts, indent); 57091 } 57092 if (isSet(obj)) { 57093 var setParts = []; 57094 if (setForEach) { 57095 setForEach.call(obj, function (value) { 57096 setParts.push(inspect(value, obj)); 57097 }); 57098 } 57099 return collectionOf('Set', setSize.call(obj), setParts, indent); 57100 } 57101 if (isWeakMap(obj)) { 57102 return weakCollectionOf('WeakMap'); 57103 } 57104 if (isWeakSet(obj)) { 57105 return weakCollectionOf('WeakSet'); 57106 } 57107 if (isWeakRef(obj)) { 57108 return weakCollectionOf('WeakRef'); 57109 } 57110 if (isNumber(obj)) { 57111 return markBoxed(inspect(Number(obj))); 57112 } 57113 if (isBigInt(obj)) { 57114 return markBoxed(inspect(bigIntValueOf.call(obj))); 57115 } 57116 if (isBoolean(obj)) { 57117 return markBoxed(booleanValueOf.call(obj)); 57118 } 57119 if (isString(obj)) { 57120 return markBoxed(inspect(String(obj))); 57121 } 57122 // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other 57123 /* eslint-env browser */ 57124 if (typeof window !== 'undefined' && obj === window) { 57125 return '{ [object Window] }'; 57126 } 57127 if ( 57128 (typeof globalThis !== 'undefined' && obj === globalThis) 57129 || (typeof __webpack_require__.g !== 'undefined' && obj === __webpack_require__.g) 57130 ) { 57131 return '{ [object globalThis] }'; 57132 } 57133 if (!isDate(obj) && !isRegExp(obj)) { 57134 var ys = arrObjKeys(obj, inspect); 57135 var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; 57136 var protoTag = obj instanceof Object ? '' : 'null prototype'; 57137 var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; 57138 var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; 57139 var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); 57140 if (ys.length === 0) { return tag + '{}'; } 57141 if (indent) { 57142 return tag + '{' + indentedJoin(ys, indent) + '}'; 57143 } 57144 return tag + '{ ' + $join.call(ys, ', ') + ' }'; 57145 } 57146 return String(obj); 57147}; 57148 57149function wrapQuotes(s, defaultStyle, opts) { 57150 var style = opts.quoteStyle || defaultStyle; 57151 var quoteChar = quotes[style]; 57152 return quoteChar + s + quoteChar; 57153} 57154 57155function quote(s) { 57156 return $replace.call(String(s), /"/g, '"'); 57157} 57158 57159function canTrustToString(obj) { 57160 return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); 57161} 57162function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); } 57163function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); } 57164function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); } 57165function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); } 57166function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); } 57167function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); } 57168function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); } 57169 57170// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives 57171function isSymbol(obj) { 57172 if (hasShammedSymbols) { 57173 return obj && typeof obj === 'object' && obj instanceof Symbol; 57174 } 57175 if (typeof obj === 'symbol') { 57176 return true; 57177 } 57178 if (!obj || typeof obj !== 'object' || !symToString) { 57179 return false; 57180 } 57181 try { 57182 symToString.call(obj); 57183 return true; 57184 } catch (e) {} 57185 return false; 57186} 57187 57188function isBigInt(obj) { 57189 if (!obj || typeof obj !== 'object' || !bigIntValueOf) { 57190 return false; 57191 } 57192 try { 57193 bigIntValueOf.call(obj); 57194 return true; 57195 } catch (e) {} 57196 return false; 57197} 57198 57199var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; 57200function has(obj, key) { 57201 return hasOwn.call(obj, key); 57202} 57203 57204function toStr(obj) { 57205 return objectToString.call(obj); 57206} 57207 57208function nameOf(f) { 57209 if (f.name) { return f.name; } 57210 var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); 57211 if (m) { return m[1]; } 57212 return null; 57213} 57214 57215function indexOf(xs, x) { 57216 if (xs.indexOf) { return xs.indexOf(x); } 57217 for (var i = 0, l = xs.length; i < l; i++) { 57218 if (xs[i] === x) { return i; } 57219 } 57220 return -1; 57221} 57222 57223function isMap(x) { 57224 if (!mapSize || !x || typeof x !== 'object') { 57225 return false; 57226 } 57227 try { 57228 mapSize.call(x); 57229 try { 57230 setSize.call(x); 57231 } catch (s) { 57232 return true; 57233 } 57234 return x instanceof Map; // core-js workaround, pre-v2.5.0 57235 } catch (e) {} 57236 return false; 57237} 57238 57239function isWeakMap(x) { 57240 if (!weakMapHas || !x || typeof x !== 'object') { 57241 return false; 57242 } 57243 try { 57244 weakMapHas.call(x, weakMapHas); 57245 try { 57246 weakSetHas.call(x, weakSetHas); 57247 } catch (s) { 57248 return true; 57249 } 57250 return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 57251 } catch (e) {} 57252 return false; 57253} 57254 57255function isWeakRef(x) { 57256 if (!weakRefDeref || !x || typeof x !== 'object') { 57257 return false; 57258 } 57259 try { 57260 weakRefDeref.call(x); 57261 return true; 57262 } catch (e) {} 57263 return false; 57264} 57265 57266function isSet(x) { 57267 if (!setSize || !x || typeof x !== 'object') { 57268 return false; 57269 } 57270 try { 57271 setSize.call(x); 57272 try { 57273 mapSize.call(x); 57274 } catch (m) { 57275 return true; 57276 } 57277 return x instanceof Set; // core-js workaround, pre-v2.5.0 57278 } catch (e) {} 57279 return false; 57280} 57281 57282function isWeakSet(x) { 57283 if (!weakSetHas || !x || typeof x !== 'object') { 57284 return false; 57285 } 57286 try { 57287 weakSetHas.call(x, weakSetHas); 57288 try { 57289 weakMapHas.call(x, weakMapHas); 57290 } catch (s) { 57291 return true; 57292 } 57293 return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 57294 } catch (e) {} 57295 return false; 57296} 57297 57298function isElement(x) { 57299 if (!x || typeof x !== 'object') { return false; } 57300 if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { 57301 return true; 57302 } 57303 return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; 57304} 57305 57306function inspectString(str, opts) { 57307 if (str.length > opts.maxStringLength) { 57308 var remaining = str.length - opts.maxStringLength; 57309 var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); 57310 return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; 57311 } 57312 var quoteRE = quoteREs[opts.quoteStyle || 'single']; 57313 quoteRE.lastIndex = 0; 57314 // eslint-disable-next-line no-control-regex 57315 var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); 57316 return wrapQuotes(s, 'single', opts); 57317} 57318 57319function lowbyte(c) { 57320 var n = c.charCodeAt(0); 57321 var x = { 57322 8: 'b', 57323 9: 't', 57324 10: 'n', 57325 12: 'f', 57326 13: 'r' 57327 }[n]; 57328 if (x) { return '\\' + x; } 57329 return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); 57330} 57331 57332function markBoxed(str) { 57333 return 'Object(' + str + ')'; 57334} 57335 57336function weakCollectionOf(type) { 57337 return type + ' { ? }'; 57338} 57339 57340function collectionOf(type, size, entries, indent) { 57341 var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); 57342 return type + ' (' + size + ') {' + joinedEntries + '}'; 57343} 57344 57345function singleLineValues(xs) { 57346 for (var i = 0; i < xs.length; i++) { 57347 if (indexOf(xs[i], '\n') >= 0) { 57348 return false;
57349 } 57350 } 57351 return true; 57352} 57353 57354function getIndent(opts, depth) { 57355 var baseIndent; 57356 if (opts.indent === '\t') { 57357 baseIndent = '\t'; 57358 } else if (typeof opts.indent === 'number' && opts.indent > 0) { 57359 baseIndent = $join.call(Array(opts.indent + 1), ' '); 57360 } else { 57361 return null; 57362 } 57363 return { 57364 base: baseIndent, 57365 prev: $join.call(Array(depth + 1), baseIndent) 57366 }; 57367} 57368 57369function indentedJoin(xs, indent) { 57370 if (xs.length === 0) { return ''; } 57371 var lineJoiner = '\n' + indent.prev + indent.base; 57372 return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; 57373} 57374 57375function arrObjKeys(obj, inspect) { 57376 var isArr = isArray(obj); 57377 var xs = []; 57378 if (isArr) { 57379 xs.length = obj.length; 57380 for (var i = 0; i < obj.length; i++) { 57381 xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; 57382 } 57383 } 57384 var syms = typeof gOPS === 'function' ? gOPS(obj) : []; 57385 var symMap; 57386 if (hasShammedSymbols) { 57387 symMap = {}; 57388 for (var k = 0; k < syms.length; k++) { 57389 symMap['$' + syms[k]] = syms[k]; 57390 } 57391 } 57392 57393 for (var key in obj) { // eslint-disable-line no-restricted-syntax 57394 if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 57395 if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 57396 if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { 57397 // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section 57398 continue; // eslint-disable-line no-restricted-syntax, no-continue 57399 } else if ($test.call(/[^\w$]/, key)) { 57400 xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); 57401 } else { 57402 xs.push(key + ': ' + inspect(obj[key], obj)); 57403 } 57404 } 57405 if (typeof gOPS === 'function') { 57406 for (var j = 0; j < syms.length; j++) { 57407 if (isEnumerable.call(obj, syms[j])) { 57408 xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); 57409 } 57410 } 57411 } 57412 return xs; 57413} 57414 57415 57416/***/ }, 57417 57418/***/ 89211 57419(module) { 57420 57421"use strict"; 57422 57423 57424var numberIsNaN = function (value) { 57425 return value !== value; 57426}; 57427 57428module.exports = function is(a, b) { 57429 if (a === 0 && b === 0) { 57430 return 1 / a === 1 / b; 57431 } 57432 if (a === b) { 57433 return true; 57434 } 57435 if (numberIsNaN(a) && numberIsNaN(b)) { 57436 return true; 57437 } 57438 return false; 57439}; 57440 57441 57442 57443/***/ }, 57444 57445/***/ 37653 57446(module, __unused_webpack_exports, __webpack_require__) { 57447 57448"use strict"; 57449 57450 57451var define = __webpack_require__(38452); 57452var callBind = __webpack_require__(10487); 57453 57454var implementation = __webpack_require__(89211); 57455var getPolyfill = __webpack_require__(9394); 57456var shim = __webpack_require__(36576); 57457 57458var polyfill = callBind(getPolyfill(), Object); 57459 57460define(polyfill, { 57461 getPolyfill: getPolyfill, 57462 implementation: implementation, 57463 shim: shim 57464}); 57465 57466module.exports = polyfill; 57467 57468 57469/***/ }, 57470 57471/***/ 9394 57472(module, __unused_webpack_exports, __webpack_require__) { 57473 57474"use strict"; 57475 57476 57477var implementation = __webpack_require__(89211); 57478 57479module.exports = function getPolyfill() { 57480 return typeof Object.is === 'function' ? Object.is : implementation; 57481}; 57482 57483 57484/***/ }, 57485 57486/***/ 36576 57487(module, __unused_webpack_exports, __webpack_require__) { 57488 57489"use strict"; 57490 57491 57492var getPolyfill = __webpack_require__(9394); 57493var define = __webpack_require__(38452); 57494 57495module.exports = function shimObjectIs() { 57496 var polyfill = getPolyfill(); 57497 define(Object, { is: polyfill }, { 57498 is: function testObjectIs() { 57499 return Object.is !== polyfill; 57500 } 57501 }); 57502 return polyfill; 57503}; 57504 57505 57506/***/ }, 57507 57508/***/ 28875 57509(module, __unused_webpack_exports, __webpack_require__) { 57510 57511"use strict"; 57512 57513 57514var keysShim; 57515if (!Object.keys) { 57516 // modified from https://github.com/es-shims/es5-shim 57517 var has = Object.prototype.hasOwnProperty; 57518 var toStr = Object.prototype.toString; 57519 var isArgs = __webpack_require__(1093); // eslint-disable-line global-require 57520 var isEnumerable = Object.prototype.propertyIsEnumerable; 57521 var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); 57522 var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); 57523 var dontEnums = [ 57524 'toString',
vendor: 6,442 bytes, lines 57525-57797
57525 'toLocaleString', 57526 'valueOf', 57527 'hasOwnProperty', 57528 'isPrototypeOf', 57529 'propertyIsEnumerable', 57530 'constructor' 57531 ]; 57532 var equalsConstructorPrototype = function (o) { 57533 var ctor = o.constructor; 57534 return ctor && ctor.prototype === o; 57535 }; 57536 var excludedKeys = { 57537 $applicationCache: true, 57538 $console: true, 57539 $external: true, 57540 $frame: true, 57541 $frameElement: true, 57542 $frames: true, 57543 $innerHeight: true, 57544 $innerWidth: true, 57545 $onmozfullscreenchange: true, 57546 $onmozfullscreenerror: true, 57547 $outerHeight: true, 57548 $outerWidth: true, 57549 $pageXOffset: true, 57550 $pageYOffset: true, 57551 $parent: true, 57552 $scrollLeft: true, 57553 $scrollTop: true, 57554 $scrollX: true, 57555 $scrollY: true, 57556 $self: true, 57557 $webkitIndexedDB: true, 57558 $webkitStorageInfo: true, 57559 $window: true 57560 }; 57561 var hasAutomationEqualityBug = (function () { 57562 /* global window */ 57563 if (typeof window === 'undefined') { return false; } 57564 for (var k in window) { 57565 try { 57566 if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { 57567 try { 57568 equalsConstructorPrototype(window[k]); 57569 } catch (e) { 57570 return true; 57571 } 57572 } 57573 } catch (e) { 57574 return true; 57575 } 57576 } 57577 return false; 57578 }()); 57579 var equalsConstructorPrototypeIfNotBuggy = function (o) { 57580 /* global window */ 57581 if (typeof window === 'undefined' || !hasAutomationEqualityBug) { 57582 return equalsConstructorPrototype(o); 57583 } 57584 try { 57585 return equalsConstructorPrototype(o); 57586 } catch (e) { 57587 return false; 57588 } 57589 }; 57590 57591 keysShim = function keys(object) { 57592 var isObject = object !== null && typeof object === 'object'; 57593 var isFunction = toStr.call(object) === '[object Function]'; 57594 var isArguments = isArgs(object); 57595 var isString = isObject && toStr.call(object) === '[object String]'; 57596 var theKeys = []; 57597 57598 if (!isObject && !isFunction && !isArguments) { 57599 throw new TypeError('Object.keys called on a non-object'); 57600 } 57601 57602 var skipProto = hasProtoEnumBug && isFunction; 57603 if (isString && object.length > 0 && !has.call(object, 0)) { 57604 for (var i = 0; i < object.length; ++i) { 57605 theKeys.push(String(i)); 57606 } 57607 } 57608 57609 if (isArguments && object.length > 0) { 57610 for (var j = 0; j < object.length; ++j) { 57611 theKeys.push(String(j)); 57612 } 57613 } else { 57614 for (var name in object) { 57615 if (!(skipProto && name === 'prototype') && has.call(object, name)) { 57616 theKeys.push(String(name)); 57617 } 57618 } 57619 } 57620 57621 if (hasDontEnumBug) { 57622 var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); 57623 57624 for (var k = 0; k < dontEnums.length; ++k) { 57625 if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { 57626 theKeys.push(dontEnums[k]); 57627 } 57628 } 57629 } 57630 return theKeys; 57631 }; 57632} 57633module.exports = keysShim; 57634 57635 57636/***/ }, 57637 57638/***/ 1189 57639(module, __unused_webpack_exports, __webpack_require__) { 57640 57641"use strict"; 57642 57643 57644var slice = Array.prototype.slice; 57645var isArgs = __webpack_require__(1093); 57646 57647var origKeys = Object.keys; 57648var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(28875); 57649 57650var originalKeys = Object.keys; 57651 57652keysShim.shim = function shimObjectKeys() { 57653 if (Object.keys) { 57654 var keysWorksWithArguments = (function () { 57655 // Safari 5.0 bug 57656 var args = Object.keys(arguments); 57657 return args && args.length === arguments.length; 57658 }(1, 2)); 57659 if (!keysWorksWithArguments) { 57660 Object.keys = function keys(object) { // eslint-disable-line func-name-matching 57661 if (isArgs(object)) { 57662 return originalKeys(slice.call(object)); 57663 } 57664 return originalKeys(object); 57665 }; 57666 } 57667 } else { 57668 Object.keys = keysShim; 57669 } 57670 return Object.keys || keysShim; 57671}; 57672 57673module.exports = keysShim; 57674 57675 57676/***/ }, 57677 57678/***/ 1093 57679(module) { 57680 57681"use strict"; 57682 57683 57684var toStr = Object.prototype.toString; 57685 57686module.exports = function isArguments(value) { 57687 var str = toStr.call(value); 57688 var isArgs = str === '[object Arguments]'; 57689 if (!isArgs) { 57690 isArgs = str !== '[object Array]' && 57691 value !== null && 57692 typeof value === 'object' && 57693 typeof value.length === 'number' && 57694 value.length >= 0 && 57695 toStr.call(value.callee) === '[object Function]'; 57696 } 57697 return isArgs; 57698}; 57699 57700 57701/***/ }, 57702 57703/***/ 38403 57704(module, __unused_webpack_exports, __webpack_require__) { 57705 57706"use strict"; 57707 57708 57709// modified from https://github.com/es-shims/es6-shim 57710var objectKeys = __webpack_require__(1189); 57711var hasSymbols = __webpack_require__(41333)(); 57712var callBound = __webpack_require__(38075); 57713var toObject = Object; 57714var $push = callBound('Array.prototype.push'); 57715var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable'); 57716var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null; 57717 57718// eslint-disable-next-line no-unused-vars 57719module.exports = function assign(target, source1) { 57720 if (target == null) { throw new TypeError('target must be an object'); } 57721 var to = toObject(target); // step 1 57722 if (arguments.length === 1) { 57723 return to; // step 2 57724 } 57725 for (var s = 1; s < arguments.length; ++s) { 57726 var from = toObject(arguments[s]); // step 3.a.i 57727 57728 // step 3.a.ii: 57729 var keys = objectKeys(from); 57730 var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols); 57731 if (getSymbols) { 57732 var syms = getSymbols(from); 57733 for (var j = 0; j < syms.length; ++j) { 57734 var key = syms[j]; 57735 if ($propIsEnumerable(from, key)) { 57736 $push(keys, key); 57737 } 57738 } 57739 } 57740 57741 // step 3.a.iii: 57742 for (var i = 0; i < keys.length; ++i) { 57743 var nextKey = keys[i]; 57744 if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2 57745 var propValue = from[nextKey]; // step 3.a.iii.2.a 57746 to[nextKey] = propValue; // step 3.a.iii.2.b 57747 } 57748 } 57749 } 57750 57751 return to; // step 4 57752}; 57753 57754 57755/***/ }, 57756 57757/***/ 6525 57758(module, __unused_webpack_exports, __webpack_require__) { 57759 57760"use strict"; 57761 57762 57763var defineProperties = __webpack_require__(38452); 57764var callBind = __webpack_require__(10487); 57765 57766var implementation = __webpack_require__(38403); 57767var getPolyfill = __webpack_require__(11514); 57768var shim = __webpack_require__(40984); 57769 57770var polyfill = callBind.apply(getPolyfill()); 57771// eslint-disable-next-line no-unused-vars 57772var bound = function assign(target, source1) { 57773 return polyfill(Object, arguments); 57774}; 57775 57776defineProperties(bound, { 57777 getPolyfill: getPolyfill, 57778 implementation: implementation, 57779 shim: shim 57780}); 57781 57782module.exports = bound; 57783 57784 57785/***/ }, 57786 57787/***/ 11514 57788(module, __unused_webpack_exports, __webpack_require__) { 57789 57790"use strict"; 57791 57792 57793var implementation = __webpack_require__(38403); 57794 57795var lacksProperEnumerationOrder = function () { 57796 if (!Object.assign) { 57797 return false;
57798 } 57799 /* 57800 * v8, specifically in node 4.x, has a bug with incorrect property enumeration order 57801 * note: this does not detect the bug unless there's 20 characters 57802 */ 57803 var str = 'abcdefghijklmnopqrst'; 57804 var letters = str.split(''); 57805 var map = {}; 57806 for (var i = 0; i < letters.length; ++i) { 57807 map[letters[i]] = letters[i]; 57808 } 57809 var obj = Object.assign({}, map); 57810 var actual = ''; 57811 for (var k in obj) { 57812 actual += k; 57813 } 57814 return str !== actual; 57815}; 57816 57817var assignHasPendingExceptions = function () { 57818 if (!Object.assign || !Object.preventExtensions) { 57819 return false; 57820 } 57821 /* 57822 * Firefox 37 still has "pending exception" logic in its Object.assign implementation, 57823 * which is 72% slower than our shim, and Firefox 40's native implementation. 57824 */ 57825 var thrower = Object.preventExtensions({ 1: 2 }); 57826 try { 57827 Object.assign(thrower, 'xy'); 57828 } catch (e) { 57829 return thrower[1] === 'y'; 57830 } 57831 return false; 57832}; 57833 57834module.exports = function getPolyfill() { 57835 if (!Object.assign) { 57836 return implementation; 57837 } 57838 if (lacksProperEnumerationOrder()) { 57839 return implementation; 57840 } 57841 if (assignHasPendingExceptions()) { 57842 return implementation; 57843 } 57844 return Object.assign; 57845}; 57846 57847 57848/***/ }, 57849 57850/***/ 40984 57851(module, __unused_webpack_exports, __webpack_require__) { 57852 57853"use strict"; 57854 57855 57856var define = __webpack_require__(38452); 57857var getPolyfill = __webpack_require__(11514); 57858 57859module.exports = function shimAssign() { 57860 var polyfill = getPolyfill(); 57861 define( 57862 Object, 57863 { assign: polyfill }, 57864 { assign: function () { return Object.assign !== polyfill; } } 57865 ); 57866 return polyfill; 57867}; 57868 57869 57870/***/ }, 57871 57872/***/ 26683 57873(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 57874 57875"use strict"; 57876 57877// EXPORTS 57878__webpack_require__.d(__webpack_exports__, { 57879 e$: () => (/* binding */ curriedDarken$1), 57880 Ic: () => (/* binding */ hideVisually), 57881 a: () => (/* binding */ curriedLighten$1), 57882 mI: () => (/* binding */ curriedOpacify$1), 57883 B3: () => (/* binding */ rgba) 57884}); 57885 57886// UNUSED EXPORTS: adjustHue, animation, backgroundImages, backgrounds, between, border, borderColor, borderRadius, borderStyle, borderWidth, buttons, clearFix, complement, cover, cssVar, desaturate, directionalProperty, easeIn, easeInOut, easeOut, ellipsis, em, fluidRange, fontFace, getContrast, getLuminance, getValueAndUnit, grayscale, hiDPI, hideText, hsl, hslToColorString, hsla, important, invert, linearGradient, margin, math, meetsContrastGuidelines, mix, modularScale, normalize, padding, parseToHsl, parseToRgb, position, radialGradient, readableColor, rem, remToPx, retinaImage, rgb, rgbToColorString, saturate, setHue, setLightness, setSaturation, shade, size, stripUnit, textInputs, timingFunctions, tint, toColorString, transitions, transparentize, triangle, wordWrap 57887 57888// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 57889var esm_extends = __webpack_require__(55285); 57890// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js 57891var assertThisInitialized = __webpack_require__(62720); 57892// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js 57893var inheritsLoose = __webpack_require__(48298); 57894;// ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js 57895function _getPrototypeOf(t) { 57896 return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { 57897 return t.__proto__ || Object.getPrototypeOf(t); 57898 }, _getPrototypeOf(t); 57899} 57900 57901// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js 57902var setPrototypeOf = __webpack_require__(96297); 57903;// ./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js 57904function _isNativeFunction(t) { 57905 try { 57906 return -1 !== Function.toString.call(t).indexOf("[native code]"); 57907 } catch (n) { 57908 return "function" == typeof t; 57909 } 57910} 57911 57912;// ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js 57913function _isNativeReflectConstruct() { 57914 try { 57915 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); 57916 } catch (t) {} 57917 return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { 57918 return !!t; 57919 })(); 57920} 57921 57922;// ./node_modules/@babel/runtime/helpers/esm/construct.js 57923 57924 57925function _construct(t, e, r) { 57926 if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); 57927 var o = [null]; 57928 o.push.apply(o, e); 57929 var p = new (t.bind.apply(t, o))(); 57930 return r && (0,setPrototypeOf/* default */.A)(p, r.prototype), p; 57931} 57932 57933;// ./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js 57934 57935 57936 57937 57938function _wrapNativeSuper(t) { 57939 var r = "function" == typeof Map ? new Map() : void 0; 57940 return _wrapNativeSuper = function _wrapNativeSuper(t) { 57941 if (null === t || !_isNativeFunction(t)) return t; 57942 if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); 57943 if (void 0 !== r) { 57944 if (r.has(t)) return r.get(t); 57945 r.set(t, Wrapper); 57946 } 57947 function Wrapper() { 57948 return _construct(t, arguments, _getPrototypeOf(this).constructor); 57949 } 57950 return Wrapper.prototype = Object.create(t.prototype, { 57951 constructor: { 57952 value: Wrapper, 57953 enumerable: !1, 57954 writable: !0, 57955 configurable: !0 57956 } 57957 }), (0,setPrototypeOf/* default */.A)(Wrapper, t); 57958 }, _wrapNativeSuper(t); 57959} 57960 57961;// ./node_modules/polished/dist/polished.esm.js 57962/* unused harmony import specifier */ var _extends; 57963/* unused harmony import specifier */ var _taggedTemplateLiteralLoose; 57964 57965 57966 57967 57968 57969 57970function last() { 57971 var _ref; 57972 return _ref = arguments.length - 1, _ref < 0 || arguments.length <= _ref ? undefined : arguments[_ref]; 57973} 57974function negation(a) { 57975 return -a; 57976} 57977function addition(a, b) { 57978 return a + b; 57979} 57980function subtraction(a, b) { 57981 return a - b; 57982} 57983function multiplication(a, b) { 57984 return a * b; 57985} 57986function division(a, b) { 57987 return a / b; 57988} 57989function max() { 57990 return Math.max.apply(Math, arguments); 57991} 57992function min() { 57993 return Math.min.apply(Math, arguments); 57994} 57995function comma() { 57996 return Array.of.apply(Array, arguments); 57997} 57998var defaultSymbols = { 57999 symbols: { 58000 '*': { 58001 infix: { 58002 symbol: '*', 58003 f: multiplication, 58004 notation: 'infix', 58005 precedence: 4, 58006 rightToLeft: 0, 58007 argCount: 2 58008 }, 58009 symbol: '*', 58010 regSymbol: '\\*' 58011 }, 58012 '/': { 58013 infix: { 58014 symbol: '/', 58015 f: division, 58016 notation: 'infix', 58017 precedence: 4, 58018 rightToLeft: 0, 58019 argCount: 2 58020 }, 58021 symbol: '/', 58022 regSymbol: '/' 58023 }, 58024 '+': { 58025 infix: { 58026 symbol: '+', 58027 f: addition, 58028 notation: 'infix', 58029 precedence: 2, 58030 rightToLeft: 0, 58031 argCount: 2 58032 }, 58033 prefix: { 58034 symbol: '+', 58035 f: last, 58036 notation: 'prefix', 58037 precedence: 3, 58038 rightToLeft: 0, 58039 argCount: 1 58040 }, 58041 symbol: '+', 58042 regSymbol: '\\+' 58043 }, 58044 '-': { 58045 infix: { 58046 symbol: '-', 58047 f: subtraction, 58048 notation: 'infix', 58049 precedence: 2, 58050 rightToLeft: 0, 58051 argCount: 2 58052 }, 58053 prefix: { 58054 symbol: '-', 58055 f: negation, 58056 notation: 'prefix', 58057 precedence: 3, 58058 rightToLeft: 0, 58059 argCount: 1 58060 }, 58061 symbol: '-', 58062 regSymbol: '-' 58063 }, 58064 ',': { 58065 infix: { 58066 symbol: ',', 58067 f: comma, 58068 notation: 'infix', 58069 precedence: 1, 58070 rightToLeft: 0, 58071 argCount: 2 58072 }, 58073 symbol: ',', 58074 regSymbol: ',' 58075 }, 58076 '(': { 58077 prefix: { 58078 symbol: '(', 58079 f: last, 58080 notation: 'prefix', 58081 precedence: 0, 58082 rightToLeft: 0, 58083 argCount: 1 58084 }, 58085 symbol: '(', 58086 regSymbol: '\\(' 58087 }, 58088 ')': { 58089 postfix: { 58090 symbol: ')', 58091 f: undefined, 58092 notation: 'postfix', 58093 precedence: 0, 58094 rightToLeft: 0, 58095 argCount: 1 58096 }, 58097 symbol: ')', 58098 regSymbol: '\\)' 58099 }, 58100 min: { 58101 func: { 58102 symbol: 'min', 58103 f: min, 58104 notation: 'func', 58105 precedence: 0, 58106 rightToLeft: 0, 58107 argCount: 1 58108 }, 58109 symbol: 'min', 58110 regSymbol: 'min\\b' 58111 }, 58112 max: { 58113 func: { 58114 symbol: 'max', 58115 f: max, 58116 notation: 'func', 58117 precedence: 0, 58118 rightToLeft: 0, 58119 argCount: 1 58120 }, 58121 symbol: 'max', 58122 regSymbol: 'max\\b' 58123 } 58124 } 58125}; 58126var defaultSymbolMap = (/* unused pure expression or super */ null && (defaultSymbols)); 58127 58128// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js 58129/** 58130 * Parse errors.md and turn it into a simple hash of code: message 58131 * @private 58132 */ 58133var ERRORS = {
58134 "1": "Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n", 58135 "2": "Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n", 58136 "3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n", 58137 "4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n", 58138 "5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n", 58139 "6": "Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n", 58140 "7": "Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n", 58141 "8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n", 58142 "9": "Please provide a number of steps to the modularScale helper.\n\n", 58143 "10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n", 58144 "11": "Invalid value passed as base to modularScale, expected number or em string but got \"%s\"\n\n", 58145 "12": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got \"%s\" instead.\n\n",
58146 "13": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got \"%s\" instead.\n\n", 58147 "14": "Passed invalid pixel value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n", 58148 "15": "Passed invalid base value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n", 58149 "16": "You must provide a template to this method.\n\n", 58150 "17": "You passed an unsupported selector state to this method.\n\n", 58151 "18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n", 58152 "19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n", 58153 "20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n", 58154 "21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n", 58155 "22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n", 58156 "23": "fontFace expects a name of a font-family.\n\n", 58157 "24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n", 58158 "25": "fontFace expects localFonts to be an array.\n\n", 58159 "26": "fontFace expects fileFormats to be an array.\n\n", 58160 "27": "radialGradient requries at least 2 color-stops to properly render.\n\n", 58161 "28": "Please supply a filename to retinaImage() as the first argument.\n\n", 58162 "29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n", 58163 "30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n", 58164 "31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n", 58165 "32": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n", 58166 "33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n", 58167 "34": "borderRadius expects a radius value as a string or number as the second argument.\n\n", 58168 "35": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n", 58169 "36": "Property must be a string value.\n\n", 58170 "37": "Syntax Error at %s.\n\n", 58171 "38": "Formula contains a function that needs parentheses at %s.\n\n", 58172 "39": "Formula is missing closing parenthesis at %s.\n\n", 58173 "40": "Formula has too many closing parentheses at %s.\n\n", 58174 "41": "All values in a formula must have the same unit or be unitless.\n\n", 58175 "42": "Please provide a number of steps to the modularScale helper.\n\n", 58176 "43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n", 58177 "44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n", 58178 "45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n", 58179 "46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n", 58180 "47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n", 58181 "48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n", 58182 "49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n", 58183 "50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n", 58184 "51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n", 58185 "52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n", 58186 "53": "fontFace expects localFonts to be an array.\n\n", 58187 "54": "fontFace expects fileFormats to be an array.\n\n", 58188 "55": "fontFace expects a name of a font-family.\n\n", 58189 "56": "linearGradient requries at least 2 color-stops to properly render.\n\n", 58190 "57": "radialGradient requries at least 2 color-stops to properly render.\n\n", 58191 "58": "Please supply a filename to retinaImage() as the first argument.\n\n",
58192 "59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n", 58193 "60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n", 58194 "61": "Property must be a string value.\n\n", 58195 "62": "borderRadius expects a radius value as a string or number as the second argument.\n\n", 58196 "63": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n", 58197 "64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n", 58198 "65": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n", 58199 "66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n", 58200 "67": "You must provide a template to this method.\n\n", 58201 "68": "You passed an unsupported selector state to this method.\n\n", 58202 "69": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got %s instead.\n\n", 58203 "70": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got %s instead.\n\n", 58204 "71": "Passed invalid pixel value %s to %s(), please pass a value like \"12px\" or 12.\n\n", 58205 "72": "Passed invalid base value %s to %s(), please pass a value like \"12px\" or 12.\n\n", 58206 "73": "Please provide a valid CSS variable.\n\n", 58207 "74": "CSS variable not found and no default was provided.\n\n", 58208 "75": "important requires a valid style object, got a %s instead.\n\n", 58209 "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n", 58210 "77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n", 58211 "78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n" 58212}; 58213 58214/** 58215 * super basic version of sprintf 58216 * @private 58217 */ 58218function format() { 58219 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 58220 args[_key] = arguments[_key]; 58221 } 58222 var a = args[0]; 58223 var b = []; 58224 var c; 58225 for (c = 1; c < args.length; c += 1) { 58226 b.push(args[c]); 58227 } 58228 b.forEach(function (d) { 58229 a = a.replace(/%[a-z]/, d); 58230 }); 58231 return a; 58232} 58233 58234/** 58235 * Create an error file out of errors.md for development and a simple web link to the full errors 58236 * in production mode. 58237 * @private 58238 */ 58239var PolishedError = /*#__PURE__*/function (_Error) { 58240 (0,inheritsLoose/* default */.A)(PolishedError, _Error); 58241 function PolishedError(code) { 58242 var _this; 58243 if (true) { 58244 _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this; 58245 } else // removed by dead control flow 58246{ var _len2, args, _key2; } 58247 return (0,assertThisInitialized/* default */.A)(_this); 58248 } 58249 return PolishedError; 58250}( /*#__PURE__*/_wrapNativeSuper(Error)); 58251 58252var unitRegExp = /((?!\w)a|na|hc|mc|dg|me[r]?|xe|ni(?![a-zA-Z])|mm|cp|tp|xp|q(?!s)|hv|xamv|nimv|wv|sm|s(?!\D|$)|ged|darg?|nrut)/g; 58253 58254// Merges additional math functionality into the defaults. 58255function mergeSymbolMaps(additionalSymbols) { 58256 var symbolMap = {}; 58257 symbolMap.symbols = additionalSymbols ? _extends({}, defaultSymbolMap.symbols, additionalSymbols.symbols) : _extends({}, defaultSymbolMap.symbols); 58258 return symbolMap; 58259} 58260function exec(operators, values) { 58261 var _ref; 58262 var op = operators.pop(); 58263 values.push(op.f.apply(op, (_ref = []).concat.apply(_ref, values.splice(-op.argCount)))); 58264 return op.precedence; 58265} 58266function calculate(expression, additionalSymbols) { 58267 var symbolMap = mergeSymbolMaps(additionalSymbols); 58268 var match; 58269 var operators = [symbolMap.symbols['('].prefix]; 58270 var values = []; 58271 var pattern = new RegExp( // Pattern for numbers 58272 "\\d+(?:\\.\\d+)?|" + 58273 // ...and patterns for individual operators/function names 58274 Object.keys(symbolMap.symbols).map(function (key) { 58275 return symbolMap.symbols[key]; 58276 }) 58277 // longer symbols should be listed first 58278 // $FlowFixMe 58279 .sort(function (a, b) { 58280 return b.symbol.length - a.symbol.length; 58281 }) 58282 // $FlowFixMe 58283 .map(function (val) { 58284 return val.regSymbol; 58285 }).join('|') + "|(\\S)", 'g'); 58286 pattern.lastIndex = 0; // Reset regular expression object 58287 58288 var afterValue = false;
58289 do { 58290 match = pattern.exec(expression); 58291 var _ref2 = match || [')', undefined], 58292 token = _ref2[0], 58293 bad = _ref2[1]; 58294 var notNumber = symbolMap.symbols[token]; 58295 var notNewValue = notNumber && !notNumber.prefix && !notNumber.func; 58296 var notAfterValue = !notNumber || !notNumber.postfix && !notNumber.infix; 58297 58298 // Check for syntax errors: 58299 if (bad || (afterValue ? notAfterValue : notNewValue)) { 58300 throw new PolishedError(37, match ? match.index : expression.length, expression); 58301 } 58302 if (afterValue) { 58303 // We either have an infix or postfix operator (they should be mutually exclusive) 58304 var curr = notNumber.postfix || notNumber.infix; 58305 do { 58306 var prev = operators[operators.length - 1]; 58307 if ((curr.precedence - prev.precedence || prev.rightToLeft) > 0) break; 58308 // Apply previous operator, since it has precedence over current one 58309 } while (exec(operators, values)); // Exit loop after executing an opening parenthesis or function 58310 afterValue = curr.notation === 'postfix'; 58311 if (curr.symbol !== ')') { 58312 operators.push(curr); 58313 // Postfix always has precedence over any operator that follows after it 58314 if (afterValue) exec(operators, values); 58315 } 58316 } else if (notNumber) { 58317 // prefix operator or function 58318 operators.push(notNumber.prefix || notNumber.func); 58319 if (notNumber.func) { 58320 // Require an opening parenthesis 58321 match = pattern.exec(expression); 58322 if (!match || match[0] !== '(') { 58323 throw new PolishedError(38, match ? match.index : expression.length, expression); 58324 } 58325 } 58326 } else { 58327 // number 58328 values.push(+token); 58329 afterValue = true; 58330 } 58331 } while (match && operators.length); 58332 if (operators.length) { 58333 throw new PolishedError(39, match ? match.index : expression.length, expression); 58334 } else if (match) { 58335 throw new PolishedError(40, match ? match.index : expression.length, expression); 58336 } else { 58337 return values.pop(); 58338 } 58339} 58340function reverseString(str) { 58341 return str.split('').reverse().join(''); 58342} 58343 58344/** 58345 * Helper for doing math with CSS Units. Accepts a formula as a string. All values in the formula must have the same unit (or be unitless). Supports complex formulas utliziing addition, subtraction, multiplication, division, square root, powers, factorial, min, max, as well as parentheses for order of operation. 58346 * 58347 *In cases where you need to do calculations with mixed units where one unit is a [relative length unit](https://developer.mozilla.org/en-US/docs/Web/CSS/length#Relative_length_units), you will want to use [CSS Calc](https://developer.mozilla.org/en-US/docs/Web/CSS/calc). 58348 * 58349 * *warning* While we've done everything possible to ensure math safely evalutes formulas expressed as strings, you should always use extreme caution when passing `math` user provided values. 58350 * @example 58351 * // Styles as object usage 58352 * const styles = { 58353 * fontSize: math('12rem + 8rem'), 58354 * fontSize: math('(12px + 2px) * 3'), 58355 * fontSize: math('3px^2 + sqrt(4)'), 58356 * } 58357 * 58358 * // styled-components usage 58359 * const div = styled.div` 58360 * fontSize: ${math('12rem + 8rem')}; 58361 * fontSize: ${math('(12px + 2px) * 3')}; 58362 * fontSize: ${math('3px^2 + sqrt(4)')}; 58363 * ` 58364 * 58365 * // CSS as JS Output 58366 * 58367 * div: { 58368 * fontSize: '20rem', 58369 * fontSize: '42px', 58370 * fontSize: '11px', 58371 * } 58372 */ 58373function math(formula, additionalSymbols) { 58374 var reversedFormula = reverseString(formula); 58375 var formulaMatch = reversedFormula.match(unitRegExp); 58376 58377 // Check that all units are the same 58378 if (formulaMatch && !formulaMatch.every(function (unit) { 58379 return unit === formulaMatch[0]; 58380 })) { 58381 throw new PolishedError(41); 58382 } 58383 var cleanFormula = reverseString(reversedFormula.replace(unitRegExp, '')); 58384 return "" + calculate(cleanFormula, additionalSymbols) + (formulaMatch ? reverseString(formulaMatch[0]) : ''); 58385} 58386 58387var cssVariableRegex = /--[\S]*/g; 58388 58389/** 58390 * Fetches the value of a passed CSS Variable in the :root scope, or otherwise returns a defaultValue if provided. 58391 * 58392 * @example 58393 * // Styles as object usage 58394 * const styles = { 58395 * 'background': cssVar('--background-color'), 58396 * } 58397 * 58398 * // styled-components usage 58399 * const div = styled.div` 58400 * background: ${cssVar('--background-color')}; 58401 * ` 58402 * 58403 * // CSS in JS Output 58404 * 58405 * element { 58406 * 'background': 'red' 58407 * } 58408 */ 58409function cssVar(cssVariable, defaultValue) { 58410 if (!cssVariable || !cssVariable.match(cssVariableRegex)) { 58411 throw new PolishedError(73); 58412 } 58413 var variableValue; 58414 58415 /* eslint-disable */ 58416 /* istanbul ignore next */ 58417 if (typeof document !== 'undefined' && document.documentElement !== null) { 58418 variableValue = getComputedStyle(document.documentElement).getPropertyValue(cssVariable); 58419 } 58420 /* eslint-enable */ 58421 58422 if (variableValue) { 58423 return variableValue.trim(); 58424 } else if (defaultValue) { 58425 return defaultValue; 58426 } 58427 throw new PolishedError(74); 58428} 58429 58430// @private 58431function capitalizeString(string) { 58432 return string.charAt(0).toUpperCase() + string.slice(1); 58433} 58434 58435var positionMap$1 = (/* unused pure expression or super */ null && (['Top', 'Right', 'Bottom', 'Left'])); 58436function generateProperty(property, position) { 58437 if (!property) return position.toLowerCase(); 58438 var splitProperty = property.split('-'); 58439 if (splitProperty.length > 1) { 58440 splitProperty.splice(1, 0, position); 58441 return splitProperty.reduce(function (acc, val) { 58442 return "" + acc + capitalizeString(val); 58443 }); 58444 } 58445 var joinedProperty = property.replace(/([a-z])([A-Z])/g, "$1" + position + "$2"); 58446 return property === joinedProperty ? "" + property + position : joinedProperty; 58447} 58448function generateStyles(property, valuesWithDefaults) { 58449 var styles = {}; 58450 for (var i = 0; i < valuesWithDefaults.length; i += 1) { 58451 if (valuesWithDefaults[i] || valuesWithDefaults[i] === 0) { 58452 styles[generateProperty(property, positionMap$1[i])] = valuesWithDefaults[i]; 58453 } 58454 } 58455 return styles; 58456} 58457 58458/** 58459 * Enables shorthand for direction-based properties. It accepts a property (hyphenated or camel
58459Cased) and up to four values that map to top, right, bottom, and left, respectively. You can optionally pass an empty string to get only the directional values as properties. You can also optionally pass a null argument for a directional value to ignore it. 58460 * @example 58461 * // Styles as object usage 58462 * const styles = { 58463 * ...directionalProperty('padding', '12px', '24px', '36px', '48px') 58464 * } 58465 * 58466 * // styled-components usage 58467 * const div = styled.div` 58468 * ${directionalProperty('padding', '12px', '24px', '36px', '48px')} 58469 * ` 58470 * 58471 * // CSS as JS Output 58472 * 58473 * div { 58474 * 'paddingTop': '12px', 58475 * 'paddingRight': '24px', 58476 * 'paddingBottom': '36px', 58477 * 'paddingLeft': '48px' 58478 * } 58479 */ 58480function directionalProperty(property) { 58481 for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 58482 values[_key - 1] = arguments[_key]; 58483 } 58484 // prettier-ignore 58485 var firstValue = values[0], 58486 _values$ = values[1], 58487 secondValue = _values$ === void 0 ? firstValue : _values$, 58488 _values$2 = values[2], 58489 thirdValue = _values$2 === void 0 ? firstValue : _values$2, 58490 _values$3 = values[3], 58491 fourthValue = _values$3 === void 0 ? secondValue : _values$3; 58492 var valuesWithDefaults = [firstValue, secondValue, thirdValue, fourthValue]; 58493 return generateStyles(property, valuesWithDefaults); 58494} 58495 58496/** 58497 * Check if a string ends with something 58498 * @private 58499 */ 58500function endsWith(string, suffix) { 58501 return string.substr(-suffix.length) === suffix; 58502} 58503 58504var cssRegex$1 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/; 58505 58506/** 58507 * Returns a given CSS value minus its unit of measure. 58508 * 58509 * @example 58510 * // Styles as object usage 58511 * const styles = { 58512 * '--dimension': stripUnit('100px') 58513 * } 58514 * 58515 * // styled-components usage 58516 * const div = styled.div` 58517 * --dimension: ${stripUnit('100px')}; 58518 * ` 58519 * 58520 * // CSS in JS Output 58521 * 58522 * element { 58523 * '--dimension': 100 58524 * } 58525 */ 58526function stripUnit(value) { 58527 if (typeof value !== 'string') return value; 58528 var matchedValue = value.match(cssRegex$1); 58529 return matchedValue ? parseFloat(value) : value; 58530} 58531 58532/** 58533 * Factory function that creates pixel-to-x converters 58534 * @private 58535 */ 58536var pxtoFactory = function pxtoFactory(to) { 58537 return function (pxval, base) { 58538 if (base === void 0) { 58539 base = '16px'; 58540 } 58541 var newPxval = pxval; 58542 var newBase = base; 58543 if (typeof pxval === 'string') { 58544 if (!endsWith(pxval, 'px')) { 58545 throw new PolishedError(69, to, pxval); 58546 } 58547 newPxval = stripUnit(pxval); 58548 } 58549 if (typeof base === 'string') { 58550 if (!endsWith(base, 'px')) { 58551 throw new PolishedError(70, to, base); 58552 } 58553 newBase = stripUnit(base); 58554 } 58555 if (typeof newPxval === 'string') { 58556 throw new PolishedError(71, pxval, to); 58557 } 58558 if (typeof newBase === 'string') { 58559 throw new PolishedError(72, base, to); 58560 } 58561 return "" + newPxval / newBase + to; 58562 }; 58563}; 58564var pixelsto = pxtoFactory; 58565 58566/** 58567 * Convert pixel value to ems. The default base value is 16px, but can be changed by passing a 58568 * second argument to the function. 58569 * @function 58570 * @param {string|number} pxval 58571 * @param {string|number} [base='16px'] 58572 * @example 58573 * // Styles as object usage 58574 * const styles = { 58575 * 'height': em('16px') 58576 * } 58577 * 58578 * // styled-components usage 58579 * const div = styled.div` 58580 * height: ${em('16px')} 58581 * ` 58582 * 58583 * // CSS in JS Output 58584 * 58585 * element { 58586 * 'height': '1em' 58587 * } 58588 */ 58589var em = pixelsto('em'); 58590var em$1 = (/* unused pure expression or super */ null && (em)); 58591 58592var cssRegex = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/; 58593 58594/** 58595 * Returns a given CSS value and its unit as elements of an array. 58596 * 58597 * @example 58598 * // Styles as object usage 58599 * const styles = { 58600 * '--dimension': getValueAndUnit('100px')[0], 58601 * '--unit': getValueAndUnit('100px')[1], 58602 * } 58603 * 58604 * // styled-components usage 58605 * const div = styled.div` 58606 * --dimension: ${getValueAndUnit('100px')[0]}; 58607 * --unit: ${getValueAndUnit('100px')[1]}; 58608 * ` 58609 * 58610 * // CSS in JS Output 58611 * 58612 * element { 58613 * '--dimension': 100, 58614 * '--unit': 'px', 58615 * } 58616 */ 58617function getValueAndUnit(value) { 58618 if (typeof value !== 'string') return [value, '']; 58619 var matchedValue = value.match(cssRegex); 58620 if (matchedValue) return [parseFloat(value), matchedValue[2]]; 58621 return [value, undefined]; 58622} 58623 58624/** 58625 * Helper for targeting rules in a style block generated by polished modules that need !important-level specificity. Can optionally specify a rule (or rules) to target specific rules. 58626 * 58627 * @example 58628 * // Styles as object usage 58629 * const styles = { 58630 * ...important(cover()) 58631 * } 58632 * 58633 * // styled-components usage 58634 * const div = styled.div` 58635 * ${important(cover())} 58636 * ` 58637 * 58638 * // CSS as JS Output 58639 * 58640 * div: { 58641 * 'position': 'absolute !important', 58642 * 'top': '0 !important', 58643 * 'right: '0 !important', 58644 * 'bottom': '0 !important', 58645 * 'left: '0 !important' 58646 * } 58647 */ 58648function important(styleBlock, rules) { 58649 if (typeof styleBlock !== 'object' || styleBlock === null) { 58650 throw new PolishedError(75, typeof styleBlock); 58651 } 58652 var newStyleBlock = {};
58653 Object.keys(styleBlock).forEach(function (key) { 58654 if (typeof styleBlock[key] === 'object' && styleBlock[key] !== null) { 58655 newStyleBlock[key] = important(styleBlock[key], rules); 58656 } else if (!rules || rules && (rules === key || rules.indexOf(key) >= 0)) { 58657 newStyleBlock[key] = styleBlock[key] + " !important"; 58658 } else { 58659 newStyleBlock[key] = styleBlock[key]; 58660 } 58661 }); 58662 return newStyleBlock; 58663} 58664 58665var ratioNames = { 58666 minorSecond: 1.067, 58667 majorSecond: 1.125, 58668 minorThird: 1.2, 58669 majorThird: 1.25, 58670 perfectFourth: 1.333, 58671 augFourth: 1.414, 58672 perfectFifth: 1.5, 58673 minorSixth: 1.6, 58674 goldenSection: 1.618, 58675 majorSixth: 1.667, 58676 minorSeventh: 1.778, 58677 majorSeventh: 1.875, 58678 octave: 2, 58679 majorTenth: 2.5, 58680 majorEleventh: 2.667, 58681 majorTwelfth: 3, 58682 doubleOctave: 4 58683}; 58684function getRatio(ratioName) { 58685 return ratioNames[ratioName]; 58686} 58687 58688/** 58689 * Establish consistent measurements and spacial relationships throughout your projects by incrementing an em or rem value up or down a defined scale. We provide a list of commonly used scales as pre-defined variables. 58690 * @example 58691 * // Styles as object usage 58692 * const styles = { 58693 * // Increment two steps up the default scale 58694 * 'fontSize': modularScale(2) 58695 * } 58696 * 58697 * // styled-components usage 58698 * const div = styled.div` 58699 * // Increment two steps up the default scale 58700 * fontSize: ${modularScale(2)} 58701 * ` 58702 * 58703 * // CSS in JS Output 58704 * 58705 * element { 58706 * 'fontSize': '1.77689em' 58707 * } 58708 */ 58709function modularScale(steps, base, ratio) { 58710 if (base === void 0) { 58711 base = '1em'; 58712 } 58713 if (ratio === void 0) { 58714 ratio = 1.333; 58715 } 58716 if (typeof steps !== 'number') { 58717 throw new PolishedError(42); 58718 } 58719 if (typeof ratio === 'string' && !ratioNames[ratio]) { 58720 throw new PolishedError(43); 58721 } 58722 var _ref = typeof base === 'string' ? getValueAndUnit(base) : [base, ''], 58723 realBase = _ref[0], 58724 unit = _ref[1]; 58725 var realRatio = typeof ratio === 'string' ? getRatio(ratio) : ratio; 58726 if (typeof realBase === 'string') { 58727 throw new PolishedError(44, base); 58728 } 58729 return "" + realBase * Math.pow(realRatio, steps) + (unit || ''); 58730} 58731 58732/** 58733 * Convert pixel value to rems. The default base value is 16px, but can be changed by passing a 58734 * second argument to the function. 58735 * @function 58736 * @param {string|number} pxval 58737 * @param {string|number} [base='16px'] 58738 * @example 58739 * // Styles as object usage 58740 * const styles = { 58741 * 'height': rem('16px') 58742 * } 58743 * 58744 * // styled-components usage 58745 * const div = styled.div` 58746 * height: ${rem('16px')} 58747 * ` 58748 * 58749 * // CSS in JS Output 58750 * 58751 * element { 58752 * 'height': '1rem' 58753 * } 58754 */ 58755var rem = pixelsto('rem'); 58756var rem$1 = (/* unused pure expression or super */ null && (rem)); 58757 58758var defaultFontSize = 16; 58759function convertBase(base) { 58760 var deconstructedValue = getValueAndUnit(base); 58761 if (deconstructedValue[1] === 'px') { 58762 return parseFloat(base); 58763 } 58764 if (deconstructedValue[1] === '%') { 58765 return parseFloat(base) / 100 * defaultFontSize; 58766 } 58767 throw new PolishedError(78, deconstructedValue[1]); 58768} 58769function getBaseFromDoc() { 58770 /* eslint-disable */ 58771 /* istanbul ignore next */ 58772 if (typeof document !== 'undefined' && document.documentElement !== null) { 58773 var rootFontSize = getComputedStyle(document.documentElement).fontSize; 58774 return rootFontSize ? convertBase(rootFontSize) : defaultFontSize; 58775 } 58776 /* eslint-enable */ 58777 /* istanbul ignore next */ 58778 return defaultFontSize; 58779} 58780 58781/** 58782 * Convert rem values to px. By default, the base value is pulled from the font-size property on the root element (if it is set in % or px). It defaults to 16px if not found on the root. You can also override the base value by providing your own base in % or px. 58783 * @example 58784 * // Styles as object usage 58785 * const styles = { 58786 * 'height': remToPx('1.6rem') 58787 * 'height': remToPx('1.6rem', '10px') 58788 * } 58789 * 58790 * // styled-components usage 58791 * const div = styled.div` 58792 * height: ${remToPx('1.6rem')} 58793 * height: ${remToPx('1.6rem', '10px')} 58794 * ` 58795 * 58796 * // CSS in JS Output 58797 * 58798 * element { 58799 * 'height': '25.6px', 58800 * 'height': '16px', 58801 * } 58802 */ 58803function remToPx(value, base) { 58804 var deconstructedValue = getValueAndUnit(value); 58805 if (deconstructedValue[1] !== 'rem' && deconstructedValue[1] !== '') { 58806 throw new PolishedError(77, deconstructedValue[1]); 58807 } 58808 var newBase = base ? convertBase(base) : getBaseFromDoc(); 58809 return deconstructedValue[0] * newBase + "px"; 58810} 58811 58812var functionsMap$3 = { 58813 back: 'cubic-bezier(0.600, -0.280, 0.735, 0.045)', 58814 circ: 'cubic-bezier(0.600, 0.040, 0.980, 0.335)', 58815 cubic: 'cubic-bezier(0.550, 0.055, 0.675, 0.190)', 58816 expo: 'cubic-bezier(0.950, 0.050, 0.795, 0.035)', 58817 quad: 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', 58818 quart: 'cubic-bezier(0.895, 0.030, 0.685, 0.220)', 58819 quint: 'cubic-bezier(0.755, 0.050, 0.855, 0.060)', 58820 sine: 'cubic-bezier(0.470, 0.000, 0.745, 0.715)' 58821}; 58822 58823/** 58824 * String to represent common easing functions as demonstrated here: (github.com/jaukia/easie). 58825 * 58826 * @example 58827 * // Styles as object usage 58828 * const styles = { 58829 * 'transitionTimingFunction': easeIn('quad') 58830 * } 58831 * 58832 * // styled-components usage 58833 * const div = styled.div` 58834 * transitionTimingFunction: ${easeIn('quad')}; 58835 * ` 58836 * 58837 * // CSS as JS Output 58838 * 58839 * 'div': { 58840 * 'transitionTimingFunction': 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', 58841 * } 58842 */ 58843function easeIn(functionName) { 58844 return functionsMap$3[functionName.toLowerCase().trim()]; 58845} 58846 58847var functionsMap$2 = { 58848 back: 'cubic-bezier(0.680, -0.550, 0.265, 1.550)', 58849 circ: 'cubic-bezier(0.785, 0.135, 0.150, 0.860)', 58850 cubic: 'cubic-bezier(0.645, 0.045, 0.355, 1.000)', 58851 expo: 'cubic-bezier(1.000, 0.000, 0.000, 1.000)', 58852 quad: 'cubic-bezier(0.455, 0.030, 0.515, 0.955)', 58853 quart: 'cubic-bezier(0.770, 0.000, 0.175, 1.000)', 58854 quint: 'cubic-bezier(0.860, 0.000, 0.070, 1.000)', 58855 sine: 'cubic-bezier(0.445, 0.050, 0.550, 0.950)' 58856}; 58857 58858/** 58859 * String to represent common easing functions as demonstrated here: (github.com/jaukia/easie). 58860 * 58861 * @example 58862 * // Styles as object usage 58863 * const styles = { 58864 * 'transitionTimingFunction': easeInOut('quad') 58865 * } 58866 * 58867 * // styled-components usage 58868 * const div = styled.div` 58869 * transitionTimingFunction: ${easeInOut('quad')}; 58870 * ` 58871 * 58872 * // CSS as JS Output 58873 * 58874 * 'div': { 58875 * 'transitionTimingFunction': 'cubic-bezier(0.455, 0.030, 0.515, 0.955)', 58876 * } 58877 */ 58878function easeInOut(functionName) { 58879 return functionsMap$2[functionName.toLowerCase().trim()]; 58880} 58881 58882var functionsMap$1 = { 58883 back: 'cubic-bezier(0.175, 0.885, 0.320, 1.275)', 58884 cubic: 'cubic-bezier(0.215, 0.610, 0.355, 1.000)', 58885 circ: 'cubic-bezier(0.075, 0.820, 0.165, 1.000)', 58886 expo: 'cubic-bezier(0.190, 1.000, 0.220, 1.000)', 58887 quad: 'cubic-bezier(0.250, 0.460, 0.450, 0.940)', 58888 quart: 'cubic-bezier(0.165, 0.840, 0.440, 1.000)', 58889 quint: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)', 58890 sine: 'cubic-bezier(0.390, 0.575, 0.565, 1.000)' 58891}; 58892 58893/** 58894 * String to represent common easing functions as demonstrated here: (github.com/jaukia/easie). 58895 * 58896 * @example 58897 * // Styles as object usage 58898 * const styles = { 58899 * 'transitionTimingFunction': easeOut('quad') 58900 * } 58901 * 58902 * // styled-components usage 58903 * const div = styled.div` 58904 * transitionTimingFunction: ${easeOut('quad')}; 58905 * ` 58906 * 58907 * // CSS as JS Output 58908 * 58909 * 'div': { 58910 * 'transitionTimingFunction': 'cubic-bezier(0.250, 0.460, 0.450, 0.940)', 58911 * } 58912 */ 58913function easeOut(functionName) { 58914 return functionsMap$1[functionName.toLowerCase().trim()]; 58915} 58916 58917/** 58918 * Returns a CSS calc formula for linear interpolation of a property between two values. Accepts optional minScreen (defaults to '320px') and maxScreen (defaults to '1200px'). 58919 * 58920 * @example 58921 * // Styles as object usage 58922 * const styles = { 58923 * fontSize: between('20px', '100px', '400px', '1000px'), 58924 * fontSize: between('20px', '100px') 58925 * } 58926 * 58927 * // styled-components usage 58928 * const div = styled.div` 58929 * fontSize: ${between('20px', '100px', '400px', '1000px')}; 58930 * fontSize: ${between('20px', '100px')} 58931 * ` 58932 * 58933 * // CSS as JS Output 58934 * 58935 * h1: { 58936 * 'fontSize': 'calc(-33.33333333333334px + 13.333333333333334vw)', 58937 * 'fontSize': 'calc(-9.090909090909093px + 9.090909090909092vw)' 58938 * } 58939 */ 58940function between(fromSize, toSize, minScreen, maxScreen) { 58941 if (minScreen === void 0) { 58942 minScreen = '320px'; 58943 } 58944 if (maxScreen === void 0) { 58945 maxScreen = '1200px'; 58946 } 58947 var _getValueAndUnit = getValueAndUnit(fromSize), 58948 unitlessFromSize = _getValueAndUnit[0], 58949 fromSizeUnit = _getValueAndUnit[1]; 58950 var _getValueAndUnit2 = getValueAndUnit(toSize), 58951 unitlessToSize = _getValueAndUnit2[0], 58952 toSizeUnit = _getValueAndUnit2[1]; 58953 var _getValueAndUnit3 = getValueAndUnit(minScreen), 58954 unitlessMinScreen = _getValueAndUnit3[0], 58955 minScreenUnit = _getValueAndUnit3[1]; 58956 var _getValueAndUnit4 = getValueAndUnit(maxScreen), 58957 unitlessMaxScreen = _getValueAndUnit4[0], 58958 maxScreenUnit = _getValueAndUnit4[1]; 58959 if (typeof unitlessMinScreen !== 'number' || typeof unitlessMaxScreen !== 'number' || !minScreenUnit || !maxScreenUnit || minScreenUnit !== maxScreenUnit) { 58960 throw new PolishedError(47); 58961 } 58962 if (typeof unitlessFromSize !== 'number' || typeof unitlessToSize !== 'number' || fromSizeUnit !== toSizeUnit) { 58963 throw new PolishedError(48); 58964 } 58965 if (fromSizeUnit !== minScreenUnit || toSizeUnit !== maxScreenUnit) { 58966 throw new PolishedError(76); 58967 } 58968 var slope = (unitlessFromSize - unitlessToSize) / (unitlessMinScreen - unitlessMaxScreen); 58969 var base = unitlessToSize - slope * unitlessMaxScreen; 58970 return "calc(" + base.toFixed(2) + (fromSizeUnit || '') + " + " + (100 * slope).toFixed(2) + "vw)"; 58971} 58972
58973/** 58974 * CSS to contain a float (credit to CSSMojo). 58975 * 58976 * @example 58977 * // Styles as object usage 58978 * const styles = { 58979 * ...clearFix(), 58980 * } 58981 * 58982 * // styled-components usage 58983 * const div = styled.div` 58984 * ${clearFix()} 58985 * ` 58986 * 58987 * // CSS as JS Output 58988 * 58989 * '&::after': { 58990 * 'clear': 'both', 58991 * 'content': '""', 58992 * 'display': 'table' 58993 * } 58994 */ 58995function clearFix(parent) { 58996 var _ref; 58997 if (parent === void 0) { 58998 parent = '&'; 58999 } 59000 var pseudoSelector = parent + "::after"; 59001 return _ref = {}, _ref[pseudoSelector] = { 59002 clear: 'both', 59003 content: '""', 59004 display: 'table' 59005 }, _ref; 59006} 59007 59008/** 59009 * CSS to fully cover an area. Can optionally be passed an offset to act as a "padding". 59010 * 59011 * @example 59012 * // Styles as object usage 59013 * const styles = { 59014 * ...cover() 59015 * } 59016 * 59017 * // styled-components usage 59018 * const div = styled.div` 59019 * ${cover()} 59020 * ` 59021 * 59022 * // CSS as JS Output 59023 * 59024 * div: { 59025 * 'position': 'absolute', 59026 * 'top': '0', 59027 * 'right: '0', 59028 * 'bottom': '0', 59029 * 'left: '0' 59030 * } 59031 */ 59032function cover(offset) { 59033 if (offset === void 0) { 59034 offset = 0; 59035 } 59036 return { 59037 position: 'absolute', 59038 top: offset, 59039 right: offset, 59040 bottom: offset, 59041 left: offset 59042 }; 59043} 59044 59045/** 59046 * CSS to represent truncated text with an ellipsis. You can optionally pass a max-width and number of lines before truncating. 59047 * 59048 * @example 59049 * // Styles as object usage 59050 * const styles = { 59051 * ...ellipsis('250px') 59052 * } 59053 * 59054 * // styled-components usage 59055 * const div = styled.div` 59056 * ${ellipsis('250px')} 59057 * ` 59058 * 59059 * // CSS as JS Output 59060 * 59061 * div: { 59062 * 'display': 'inline-block', 59063 * 'maxWidth': '250px', 59064 * 'overflow': 'hidden', 59065 * 'textOverflow': 'ellipsis', 59066 * 'whiteSpace': 'nowrap', 59067 * 'wordWrap': 'normal' 59068 * } 59069 */ 59070function ellipsis(width, lines) { 59071 if (lines === void 0) { 59072 lines = 1; 59073 } 59074 var styles = { 59075 display: 'inline-block', 59076 maxWidth: width || '100%', 59077 overflow: 'hidden', 59078 textOverflow: 'ellipsis', 59079 whiteSpace: 'nowrap', 59080 wordWrap: 'normal' 59081 }; 59082 return lines > 1 ? _extends({}, styles, { 59083 WebkitBoxOrient: 'vertical', 59084 WebkitLineClamp: lines, 59085 display: '-webkit-box', 59086 whiteSpace: 'normal' 59087 }) : styles; 59088} 59089 59090function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 59091function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 59092function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 59093/** 59094 * Returns a set of media queries that resizes a property (or set of properties) between a provided fromSize and toSize. Accepts optional minScreen (defaults to '320px') and maxScreen (defaults to '1200px') to constrain the interpolation. 59095 * 59096 * @example 59097 * // Styles as object usage 59098 * const styles = { 59099 * ...fluidRange( 59100 * { 59101 * prop: 'padding', 59102 * fromSize: '20px', 59103 * toSize: '100px', 59104 * }, 59105 * '400px', 59106 * '1000px', 59107 * ) 59108 * } 59109 * 59110 * // styled-components usage 59111 * const div = styled.div` 59112 * ${fluidRange( 59113 * { 59114 * prop: 'padding', 59115 * fromSize: '20px', 59116 * toSize: '100px', 59117 * }, 59118 * '400px', 59119 * '1000px', 59120 * )} 59121 * ` 59122 * 59123 * // CSS as JS Output 59124 * 59125 * div: { 59126 * "@media (min-width: 1000px)": Object { 59127 * "padding": "100px", 59128 * }, 59129 * "@media (min-width: 400px)": Object { 59130 * "padding": "calc(-33.33333333333334px + 13.333333333333334vw)", 59131 * }, 59132 * "padding": "20px", 59133 * } 59134 */ 59135function fluidRange(cssProp, minScreen, maxScreen) { 59136 if (minScreen === void 0) { 59137 minScreen = '320px'; 59138 } 59139 if (maxScreen === void 0) { 59140 maxScreen = '1200px'; 59141 } 59142 if (!Array.isArray(cssProp) && typeof cssProp !== 'object' || cssProp === null) { 59143 throw new PolishedError(49); 59144 } 59145 if (Array.isArray(cssProp)) { 59146 var mediaQueries = {}; 59147 var fallbacks = {}; 59148 for (var _iterator = _createForOfIteratorHelperLoose(cssProp), _step; !(_step = _iterator()).done;) { 59149 var _extends2, _extends3; 59150 var obj = _step.value; 59151 if (!obj.prop || !obj.fromSize || !obj.toSize) { 59152 throw new PolishedError(50); 59153 } 59154 fallbacks[obj.prop] = obj.fromSize; 59155 mediaQueries["@media (min-width: " + minScreen + ")"] = _extends({}, mediaQueries["@media (min-width: " + minScreen + ")"], (_extends2 = {}, _extends2[obj.prop] = between(obj.fromSize, obj.toSize, minScreen, maxScreen), _extends2)); 59156 mediaQueries["@media (min-width: " + maxScreen + ")"] = _extends({}, mediaQueries["@media (min-width: " + maxScreen + ")"], (_extends3 = {}, _extends3[obj.prop] = obj.toSize, _extends3)); 59157 } 59158 return _extends({}, fallbacks, mediaQueries); 59159 } else { 59160 var _ref, _ref2, _ref3; 59161 if (!cssProp.prop || !cssProp.fromSize || !cssProp.toSize) { 59162 throw new PolishedError(51); 59163 } 59164 return _ref3 = {}, _ref3[cssProp.prop] = cssProp.fromSize, _ref3["@media (min-width: " + minScreen + ")"] = (_ref = {}, _ref[cssProp.prop] = between(cssProp.fromSize, cssProp.toSize, minScreen, maxScreen), _ref), _ref3["@media (min-width: " + maxScreen + ")"] = (_ref2 = {}, _ref2[cssProp.prop] = cssProp.toSize, _ref2), _ref3; 59165 } 59166} 59167 59168var dataURIRegex = /^\s*data:([a-z]+\/[a-z-]+(;[a-z-]+=[a-z-]+)?)?(;charset=[a-z0-9-]+)?(;base64)?,[a-z0-9!$&',()*+,;=\-._~:@/?%\s]*\s*$/i; 59169var formatHintMap = { 59170 woff: 'woff', 59171 woff2: 'woff2', 59172 ttf: 'truetype', 59173 otf: 'opentype', 59174 eot: 'embedded-opentype', 59175 svg: 'svg', 59176 svgz: 'svg' 59177}; 59178function generateFormatHint(format, formatHint) { 59179 if (!formatHint) return ''; 59180 return " format(\"" + formatHintMap[format] + "\")"; 59181} 59182function isDataURI(fontFilePath) { 59183 return !!fontFilePath.replace(/\s+/g, ' ').match(dataURIRegex); 59184} 59185function generateFileReferences(fontFilePath, fileFormats, formatHint) { 59186 if (isDataURI(fontFilePath)) { 59187 return "url(\"" + fontFilePath + "\")" + generateFormatHint(fileFormats[0], formatHint); 59188 } 59189 var fileFontReferences = fileFormats.map(function (format) { 59190 return "url(\"" + fontFilePath + "." + format + "\")" + generateFormatHint(format, formatHint); 59191 }); 59192 return fileFontReferences.join(', '); 59193} 59194function generateLocalReferences(localFonts) { 59195 var localFontReferences = localFonts.map(function (font) { 59196 return "local(\"" + font + "\")"; 59197 }); 59198 return localFontReferences.join(', '); 59199} 59200function generateSources(fontFilePath, localFonts, fileFormats, formatHint) { 59201 var fontReferences = []; 59202 if (localFonts) fontReferences.push(generateLocalReferences(localFonts)); 59203 if (fontFilePath) { 59204 fontReferences.push(generateFileReferences(fontFilePath, fileFormats, formatHint)); 59205 } 59206 return fontReferences.join(', '); 59207} 59208 59209/** 59210 * CSS for a @font-face declaration. Defaults to check for local copies of the font on the user's machine. You can disable this by passing `null` to localFonts. 59211 * 59212 * @example 59213 * // Styles as object basic usage 59214 * const styles = { 59215 * ...fontFace({ 59216 * 'fontFamily': 'Sans-Pro', 59217 * 'fontFilePath': 'path/to/file' 59218 * }) 59219 * } 59220 * 59221 * // styled-components basic usage 59222 * const GlobalStyle = createGlobalStyle`${ 59223 * fontFace({ 59224 * 'fontFamily': 'Sans-Pro', 59225 * 'fontFilePath': 'path/to/file' 59226 * } 59227 * )}` 59228 * 59229 * // CSS as JS Output 59230 * 59231 * '@font-face': { 59232 * 'fontFamily': 'Sans-Pro', 59233 * 'src': 'url("path/to/file.eot"), url("path/to/file.woff2"), url("path/to/file.woff"), url("path/to/file.ttf"), url("path/to/file.svg")', 59234 * } 59235 */ 59236 59237function fontFace(_ref) { 59238 var fontFamily = _ref.fontFamily, 59239 fontFilePath = _ref.fontFilePath, 59240 fontStretch = _ref.fontStretch, 59241 fontStyle = _ref.fontStyle, 59242 fontVariant = _ref.fontVariant, 59243 fontWeight = _ref.fontWeight, 59244 _ref$fileFormats = _ref.fileFormats, 59245 fileFormats = _ref$fileFormats === void 0 ? ['eot', 'woff2', 'woff', 'ttf', 'svg'] : _ref$fileFormats, 59246 _ref$formatHint = _ref.formatHint, 59247 formatHint = _ref$formatHint === void 0 ? false : _ref$formatHint, 59248 _ref$localFonts = _ref.localFonts, 59249 localFonts = _ref$localFonts === void 0 ? [fontFamily] : _ref$localFonts, 59250 unicodeRange = _ref.unicodeRange, 59251 fontDisplay = _ref.fontDisplay, 59252 fontVariationSettings = _ref.fontVariationSettings, 59253 fontFeatureSettings = _ref.fontFeatureSettings; 59254 // Error Handling 59255 if (!fontFamily) throw new PolishedError(55); 59256 if (!fontFilePath && !localFonts) { 59257 throw new PolishedError(52); 59258 } 59259 if (localFonts && !Array.isArray(localFonts)) { 59260 throw new PolishedError(53); 59261 } 59262 if (!Array.isArray(fileFormats)) { 59263 throw new PolishedError(54); 59264 } 59265 var fontFaceDeclaration = { 59266 '@font-face': { 59267 fontFamily: fontFamily, 59268 src: generateSources(fontFilePath, localFonts, fileFormats, formatHint), 59269 unicodeRange: unicodeRange, 59270 fontStretch: fontStretch, 59271 fontStyle: fontStyle, 59272 fontVariant: fontVariant, 59273 fontWeight: fontWeight, 59274 fontDisplay: fontDisplay, 59275 fontVariationSettings: fontVariationSettings, 59276 fontFeatureSettings: fontFeatureSettings 59277 } 59278 }; 59279 59280 // Removes undefined fields for cleaner css object. 59281 return JSON.parse(JSON.stringify(fontFaceDeclaration)); 59282} 59283 59284/** 59285 * CSS to hide text to show a background image in a SEO-friendly way. 59286 * 59287 * @example 59288 * // Styles as object usage 59289 * const styles = { 59290 * 'backgroundImage': 'url(logo.png)', 59291 * ...hideText(), 59292 * } 59293 * 59294 * // styled-components usage 59295 * const div = styled.div` 59296 * backgroundImage: url(logo.png); 59297 * ${hideText()}; 59298 * ` 59299 * 59300 * // CSS as JS Output 59301 * 59302 * 'div': { 59303 * 'backgroundImage': 'url(logo.png)', 59304 * 'textIndent': '101%', 59305 * 'overflow': 'hidden', 59306 * 'whiteSpace': 'nowrap', 59307 * } 59308 */ 59309function hideText() { 59310 return { 59311 textIndent: '101%', 59312 overflow: 'hidden', 59313 whiteSpace: 'nowrap' 59314 }; 59315} 59316 59317/** 59318 * CSS to hide content visually but remain accessible to screen readers. 59319 * from [HTML5 Boilerplate](https://github.com/h5bp/html5-boilerplate/blob/9a176f57af1cfe8ec70300da4621fb9b07e5fa31/src/css/main.css#L121) 59320 * 59321 * @example 59322 * // Styles as object usage 59323 * const styles = { 59324 * ...hideVisually(), 59325 * } 59326 * 59327 * // styled-components usage 59328 * const div = styled.div` 59329 * ${hideVisually()}; 59330 * ` 59331 * 59332 * // CSS as JS Output 59333 * 59334 * 'div': { 59335 * 'border': '0', 59336 * 'clip': 'rect(0 0 0 0)', 59337 * 'height': '1px', 59338 * 'margin': '-1px', 59339 * 'overflow': 'hidden', 59340 * 'padding': '0', 59341 * 'position': 'absolute', 59342 * 'whiteSpace': 'nowrap', 59343 * 'width': '1px', 59344 * } 59345 */ 59346function hideVisually() { 59347 return { 59348 border: '0', 59349 clip: 'rect(0 0 0 0)', 59350 height: '1px', 59351 margin: '-1px', 59352 overflow: 'hidden', 59353 padding: '0', 59354 position: 'absolute', 59355 whiteSpace: 'nowrap', 59356 width: '1px' 59357 }; 59358} 59359 59360/** 59361 * Generates a media query to target HiDPI devices. 59362 * 59363 * @example 59364 * // Styles as object usage 59365 * const styles = { 59366 * [hiDPI(1.5)]: { 59367 * width: 200px; 59368 * } 59369 * } 59370 * 59371 * // styled-components usage 59372 * const div = styled.div` 59373 * ${hiDPI(1.5)} { 59374 * width: 200px; 59375 * } 59376 * ` 59377 * 59378 * // CSS as JS Output 59379 * 59380 * '@media only screen and (-webkit-min-device-pixel-ratio: 1.5), 59381 * only screen and (min--moz-device-pixel-ratio: 1.5), 59382 * only screen and (-o-min-device-pixel-ratio: 1.5/1), 59383 * only screen and (min-resolution: 144dpi), 59384 * only screen and (min-resolution: 1.5dppx)': { 59385 * 'width': '200px', 59386 * } 59387 */
59388function hiDPI(ratio) { 59389 if (ratio === void 0) { 59390 ratio = 1.3; 59391 } 59392 return "\n @media only screen and (-webkit-min-device-pixel-ratio: " + ratio + "),\n only screen and (min--moz-device-pixel-ratio: " + ratio + "),\n only screen and (-o-min-device-pixel-ratio: " + ratio + "/1),\n only screen and (min-resolution: " + Math.round(ratio * 96) + "dpi),\n only screen and (min-resolution: " + ratio + "dppx)\n "; 59393} 59394 59395function constructGradientValue(literals) { 59396 var template = ''; 59397 for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 59398 substitutions[_key - 1] = arguments[_key]; 59399 } 59400 for (var i = 0; i < literals.length; i += 1) { 59401 template += literals[i]; 59402 if (i === substitutions.length - 1 && substitutions[i]) { 59403 var definedValues = substitutions.filter(function (substitute) { 59404 return !!substitute; 59405 }); 59406 // Adds leading coma if properties preceed color-stops 59407 if (definedValues.length > 1) { 59408 template = template.slice(0, -1); 59409 template += ", " + substitutions[i]; 59410 // No trailing space if color-stops is the only param provided 59411 } else if (definedValues.length === 1) { 59412 template += "" + substitutions[i]; 59413 } 59414 } else if (substitutions[i]) { 59415 template += substitutions[i] + " "; 59416 } 59417 } 59418 return template.trim(); 59419} 59420 59421var _templateObject$1; 59422/** 59423 * CSS for declaring a linear gradient, including a fallback background-color. The fallback is either the first color-stop or an explicitly passed fallback color. 59424 * 59425 * @example 59426 * // Styles as object usage 59427 * const styles = { 59428 * ...linearGradient({ 59429 colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], 59430 toDirection: 'to top right', 59431 fallback: '#FFF', 59432 }) 59433 * } 59434 * 59435 * // styled-components usage 59436 * const div = styled.div` 59437 * ${linearGradient({ 59438 colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], 59439 toDirection: 'to top right', 59440 fallback: '#FFF', 59441 })} 59442 *` 59443 * 59444 * // CSS as JS Output 59445 * 59446 * div: { 59447 * 'backgroundColor': '#FFF', 59448 * 'backgroundImage': 'linear-gradient(to top right, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', 59449 * } 59450 */ 59451function linearGradient(_ref) { 59452 var colorStops = _ref.colorStops, 59453 fallback = _ref.fallback, 59454 _ref$toDirection = _ref.toDirection, 59455 toDirection = _ref$toDirection === void 0 ? '' : _ref$toDirection; 59456 if (!colorStops || colorStops.length < 2) { 59457 throw new PolishedError(56); 59458 } 59459 return { 59460 backgroundColor: fallback || colorStops[0].replace(/,\s+/g, ',').split(' ')[0].replace(/,(?=\S)/g, ', '), 59461 backgroundImage: constructGradientValue(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteralLoose(["linear-gradient(", "", ")"])), toDirection, colorStops.join(', ').replace(/,(?=\S)/g, ', ')) 59462 }; 59463} 59464 59465/** 59466 * CSS to normalize abnormalities across browsers (normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css) 59467 * 59468 * @example 59469 * // Styles as object usage 59470 * const styles = { 59471 * ...normalize(), 59472 * } 59473 * 59474 * // styled-components usage 59475 * const GlobalStyle = createGlobalStyle`${normalize()}` 59476 * 59477 * // CSS as JS Output 59478 * 59479 * html { 59480 * lineHeight: 1.15, 59481 * textSizeAdjust: 100%, 59482 * } ... 59483 */ 59484function normalize() { 59485 var _ref; 59486 return [(_ref = { 59487 html: { 59488 lineHeight: '1.15', 59489 textSizeAdjust: '100%' 59490 }, 59491 body: { 59492 margin: '0' 59493 }, 59494 main: { 59495 display: 'block' 59496 }, 59497 h1: { 59498 fontSize: '2em', 59499 margin: '0.67em 0' 59500 }, 59501 hr: { 59502 boxSizing: 'content-box', 59503 height: '0', 59504 overflow: 'visible' 59505 }, 59506 pre: { 59507 fontFamily: 'monospace, monospace', 59508 fontSize: '1em' 59509 }, 59510 a: { 59511 backgroundColor: 'transparent' 59512 }, 59513 'abbr[title]': { 59514 borderBottom: 'none', 59515 textDecoration: 'underline' 59516 } 59517 }, _ref["b,\n strong"] = { 59518 fontWeight: 'bolder' 59519 }, _ref["code,\n kbd,\n samp"] = { 59520 fontFamily: 'monospace, monospace', 59521 fontSize: '1em' 59522 }, _ref.small = { 59523 fontSize: '80%' 59524 }, _ref["sub,\n sup"] = { 59525 fontSize: '75%', 59526 lineHeight: '0', 59527 position: 'relative', 59528 verticalAlign: 'baseline' 59529 }, _ref.sub = { 59530 bottom: '-0.25em' 59531 }, _ref.sup = { 59532 top: '-0.5em' 59533 }, _ref.img = { 59534 borderStyle: 'none' 59535 }, _ref["button,\n input,\n optgroup,\n select,\n textarea"] = { 59536 fontFamily: 'inherit', 59537 fontSize: '100%', 59538 lineHeight: '1.15', 59539 margin: '0' 59540 }, _ref["button,\n input"] = { 59541 overflow: 'visible' 59542 }, _ref["button,\n select"] = { 59543 textTransform: 'none' 59544 }, _ref["button,\n html [type=\"button\"],\n [type=\"reset\"],\n [type=\"submit\"]"] = { 59545 WebkitAppearance: 'button' 59546 }, _ref["button::-moz-focus-inner,\n [type=\"button\"]::-moz-focus-inner,\n [type=\"reset\"]::-moz-focus-inner,\n [type=\"submit\"]::-moz-focus-inner"] = { 59547 borderStyle: 'none', 59548 padding: '0' 59549 }, _ref["button:-moz-focusring,\n [type=\"button\"]:-moz-focusring,\n [type=\"reset\"]:-moz-focusring,\n [type=\"submit\"]:-moz-focusring"] = { 59550 outline: '1px dotted ButtonText' 59551 }, _ref.fieldset = { 59552 padding: '0.35em 0.625em 0.75em' 59553 }, _ref.legend = { 59554 boxSizing: 'border-box', 59555 color: 'inherit', 59556 display: 'table', 59557 maxWidth: '100%', 59558 padding: '0', 59559 whiteSpace: 'normal' 59560 }, _ref.progress = { 59561 verticalAlign: 'baseline' 59562 }, _ref.textarea = { 59563 overflow: 'auto' 59564 }, _ref["[type=\"checkbox\"],\n [type=\"radio\"]"] = { 59565 boxSizing: 'border-box', 59566 padding: '0' 59567 }, _ref["[type=\"number\"]::-webkit-inner-spin-button,\n [type=\"number\"]::-webkit-outer-spin-button"] = { 59568 height: 'auto' 59569 }, _ref['[type="search"]'] = { 59570 WebkitAppearance: 'textfield', 59571 outlineOffset: '-2px' 59572 }, _ref['[type="search"]::-webkit-search-decoration'] = { 59573 WebkitAppearance: 'none' 59574 }, _ref['::-webkit-file-upload-button'] = { 59575 WebkitAppearance: 'button', 59576 font: 'inherit' 59577 }, _ref.details = { 59578 display: 'block' 59579 }, _ref.summary = { 59580 display: 'list-item' 59581 }, _ref.template = { 59582 display: 'none' 59583 }, _ref['[hidden]'] = { 59584 display: 'none' 59585 }, _ref), { 59586 'abbr[title]': { 59587 textDecoration: 'underline dotted' 59588 } 59589 }]; 59590} 59591
59592var _templateObject; 59593/** 59594 * CSS for declaring a radial gradient, including a fallback background-color. The fallback is either the first color-stop or an explicitly passed fallback color. 59595 * 59596 * @example 59597 * // Styles as object usage 59598 * const styles = { 59599 * ...radialGradient({ 59600 * colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], 59601 * extent: 'farthest-corner at 45px 45px', 59602 * position: 'center', 59603 * shape: 'ellipse', 59604 * }) 59605 * } 59606 * 59607 * // styled-components usage 59608 * const div = styled.div` 59609 * ${radialGradient({ 59610 * colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], 59611 * extent: 'farthest-corner at 45px 45px', 59612 * position: 'center', 59613 * shape: 'ellipse', 59614 * })} 59615 *` 59616 * 59617 * // CSS as JS Output 59618 * 59619 * div: { 59620 * 'backgroundColor': '#00FFFF', 59621 * 'backgroundImage': 'radial-gradient(center ellipse farthest-corner at 45px 45px, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', 59622 * } 59623 */ 59624function radialGradient(_ref) { 59625 var colorStops = _ref.colorStops, 59626 _ref$extent = _ref.extent, 59627 extent = _ref$extent === void 0 ? '' : _ref$extent, 59628 fallback = _ref.fallback, 59629 _ref$position = _ref.position, 59630 position = _ref$position === void 0 ? '' : _ref$position, 59631 _ref$shape = _ref.shape, 59632 shape = _ref$shape === void 0 ? '' : _ref$shape; 59633 if (!colorStops || colorStops.length < 2) { 59634 throw new PolishedError(57); 59635 } 59636 return { 59637 backgroundColor: fallback || colorStops[0].split(' ')[0], 59638 backgroundImage: constructGradientValue(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["radial-gradient(", "", "", "", ")"])), position, shape, extent, colorStops.join(', ')) 59639 }; 59640} 59641 59642/** 59643 * A helper to generate a retina background image and non-retina 59644 * background image. The retina background image will output to a HiDPI media query. The mixin uses 59645 * a _2x.png filename suffix by default. 59646 * 59647 * @example 59648 * // Styles as object usage 59649 * const styles = { 59650 * ...retinaImage('my-img') 59651 * } 59652 * 59653 * // styled-components usage 59654 * const div = styled.div` 59655 * ${retinaImage('my-img')} 59656 * ` 59657 * 59658 * // CSS as JS Output 59659 * div { 59660 * backgroundImage: 'url(my-img.png)', 59661 * '@media only screen and (-webkit-min-device-pixel-ratio: 1.3), 59662 * only screen and (min--moz-device-pixel-ratio: 1.3), 59663 * only screen and (-o-min-device-pixel-ratio: 1.3/1), 59664 * only screen and (min-resolution: 144dpi), 59665 * only screen and (min-resolution: 1.5dppx)': { 59666 * backgroundImage: 'url(my-img_2x.png)', 59667 * } 59668 * } 59669 */ 59670function retinaImage(filename, backgroundSize, extension, retinaFilename, retinaSuffix) { 59671 var _ref; 59672 if (extension === void 0) { 59673 extension = 'png'; 59674 } 59675 if (retinaSuffix === void 0) { 59676 retinaSuffix = '_2x'; 59677 } 59678 if (!filename) { 59679 throw new PolishedError(58); 59680 } 59681 // Replace the dot at the beginning of the passed extension if one exists 59682 var ext = extension.replace(/^\./, ''); 59683 var rFilename = retinaFilename ? retinaFilename + "." + ext : "" + filename + retinaSuffix + "." + ext; 59684 return _ref = { 59685 backgroundImage: "url(" + filename + "." + ext + ")" 59686 }, _ref[hiDPI()] = _extends({ 59687 backgroundImage: "url(" + rFilename + ")" 59688 }, backgroundSize ? { 59689 backgroundSize: backgroundSize 59690 } : {}), _ref; 59691} 59692 59693/* eslint-disable key-spacing */ 59694var functionsMap = { 59695 easeInBack: 'cubic-bezier(0.600, -0.280, 0.735, 0.045)', 59696 easeInCirc: 'cubic-bezier(0.600, 0.040, 0.980, 0.335)', 59697 easeInCubic: 'cubic-bezier(0.550, 0.055, 0.675, 0.190)', 59698 easeInExpo: 'cubic-bezier(0.950, 0.050, 0.795, 0.035)', 59699 easeInQuad: 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', 59700 easeInQuart: 'cubic-bezier(0.895, 0.030, 0.685, 0.220)', 59701 easeInQuint: 'cubic-bezier(0.755, 0.050, 0.855, 0.060)', 59702 easeInSine: 'cubic-bezier(0.470, 0.000, 0.745, 0.715)', 59703 easeOutBack: 'cubic-bezier(0.175, 0.885, 0.320, 1.275)', 59704 easeOutCubic: 'cubic-bezier(0.215, 0.610, 0.355, 1.000)', 59705 easeOutCirc: 'cubic-bezier(0.075, 0.820, 0.165, 1.000)', 59706 easeOutExpo: 'cubic-bezier(0.190, 1.000, 0.220, 1.000)', 59707 easeOutQuad: 'cubic-bezier(0.250, 0.460, 0.450, 0.940)', 59708 easeOutQuart: 'cubic-bezier(0.165, 0.840, 0.440, 1.000)', 59709 easeOutQuint: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)', 59710 easeOutSine: 'cubic-bezier(0.390, 0.575, 0.565, 1.000)', 59711 easeInOutBack: 'cubic-bezier(0.680, -0.550, 0.265, 1.550)', 59712 easeInOutCirc: 'cubic-bezier(0.785, 0.135, 0.150, 0.860)', 59713 easeInOutCubic: 'cubic-bezier(0.645, 0.045, 0.355, 1.000)', 59714 easeInOutExpo: 'cubic-bezier(1.000, 0.000, 0.000, 1.000)', 59715 easeInOutQuad: 'cubic-bezier(0.455, 0.030, 0.515, 0.955)', 59716 easeInOutQuart: 'cubic-bezier(0.770, 0.000, 0.175, 1.000)', 59717 easeInOutQuint: 'cubic-bezier(0.860, 0.000, 0.070, 1.000)', 59718 easeInOutSine: 'cubic-bezier(0.445, 0.050, 0.550, 0.950)' 59719}; 59720/* eslint-enable key-spacing */ 59721 59722function getTimingFunction(functionName) { 59723 return functionsMap[functionName]; 59724} 59725 59726/** 59727 * String to represent common easing functions as demonstrated here: (github.com/jaukia/easie). 59728 *
59729 * @deprecated - This will be deprecated in v5 in favor of `easeIn`, `easeOut`, `easeInOut`. 59730 * 59731 * @example 59732 * // Styles as object usage 59733 * const styles = { 59734 * 'transitionTimingFunction': timingFunctions('easeInQuad') 59735 * } 59736 * 59737 * // styled-components usage 59738 * const div = styled.div` 59739 * transitionTimingFunction: ${timingFunctions('easeInQuad')}; 59740 * ` 59741 * 59742 * // CSS as JS Output 59743 * 59744 * 'div': { 59745 * 'transitionTimingFunction': 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', 59746 * } 59747 */ 59748 59749function timingFunctions(timingFunction) { 59750 return getTimingFunction(timingFunction); 59751} 59752 59753var getBorderWidth = function getBorderWidth(pointingDirection, height, width) { 59754 var fullWidth = "" + width[0] + (width[1] || ''); 59755 var halfWidth = "" + width[0] / 2 + (width[1] || ''); 59756 var fullHeight = "" + height[0] + (height[1] || ''); 59757 var halfHeight = "" + height[0] / 2 + (height[1] || ''); 59758 switch (pointingDirection) { 59759 case 'top': 59760 return "0 " + halfWidth + " " + fullHeight + " " + halfWidth; 59761 case 'topLeft': 59762 return fullWidth + " " + fullHeight + " 0 0"; 59763 case 'left': 59764 return halfHeight + " " + fullWidth + " " + halfHeight + " 0"; 59765 case 'bottomLeft': 59766 return fullWidth + " 0 0 " + fullHeight; 59767 case 'bottom': 59768 return fullHeight + " " + halfWidth + " 0 " + halfWidth; 59769 case 'bottomRight': 59770 return "0 0 " + fullWidth + " " + fullHeight; 59771 case 'right': 59772 return halfHeight + " 0 " + halfHeight + " " + fullWidth; 59773 case 'topRight': 59774 default: 59775 return "0 " + fullWidth + " " + fullHeight + " 0"; 59776 } 59777}; 59778var getBorderColor = function getBorderColor(pointingDirection, foregroundColor) { 59779 switch (pointingDirection) { 59780 case 'top': 59781 case 'bottomRight': 59782 return { 59783 borderBottomColor: foregroundColor 59784 }; 59785 case 'right': 59786 case 'bottomLeft': 59787 return { 59788 borderLeftColor: foregroundColor 59789 }; 59790 case 'bottom': 59791 case 'topLeft': 59792 return { 59793 borderTopColor: foregroundColor 59794 }; 59795 case 'left': 59796 case 'topRight': 59797 return { 59798 borderRightColor: foregroundColor 59799 }; 59800 default: 59801 throw new PolishedError(59); 59802 } 59803}; 59804 59805/** 59806 * CSS to represent triangle with any pointing direction with an optional background color. 59807 * 59808 * @example 59809 * // Styles as object usage 59810 * 59811 * const styles = { 59812 * ...triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' }) 59813 * } 59814 * 59815 * 59816 * // styled-components usage 59817 * const div = styled.div` 59818 * ${triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' })} 59819 * 59820 * 59821 * // CSS as JS Output 59822 * 59823 * div: { 59824 * 'borderColor': 'transparent transparent transparent red', 59825 * 'borderStyle': 'solid', 59826 * 'borderWidth': '50px 0 50px 100px', 59827 * 'height': '0', 59828 * 'width': '0', 59829 * } 59830 */ 59831function triangle(_ref) { 59832 var pointingDirection = _ref.pointingDirection, 59833 height = _ref.height, 59834 width = _ref.width, 59835 foregroundColor = _ref.foregroundColor, 59836 _ref$backgroundColor = _ref.backgroundColor, 59837 backgroundColor = _ref$backgroundColor === void 0 ? 'transparent' : _ref$backgroundColor; 59838 var widthAndUnit = getValueAndUnit(width); 59839 var heightAndUnit = getValueAndUnit(height); 59840 if (isNaN(heightAndUnit[0]) || isNaN(widthAndUnit[0])) { 59841 throw new PolishedError(60); 59842 } 59843 return _extends({ 59844 width: '0', 59845 height: '0', 59846 borderColor: backgroundColor 59847 }, getBorderColor(pointingDirection, foregroundColor), { 59848 borderStyle: 'solid', 59849 borderWidth: getBorderWidth(pointingDirection, heightAndUnit, widthAndUnit) 59850 }); 59851} 59852 59853/** 59854 * Provides an easy way to change the `wordWrap` property. 59855 * 59856 * @example 59857 * // Styles as object usage 59858 * const styles = { 59859 * ...wordWrap('break-word') 59860 * } 59861 * 59862 * // styled-components usage 59863 * const div = styled.div` 59864 * ${wordWrap('break-word')} 59865 * ` 59866 * 59867 * // CSS as JS Output 59868 * 59869 * const styles = { 59870 * overflowWrap: 'break-word', 59871 * wordWrap: 'break-word', 59872 * wordBreak: 'break-all', 59873 * } 59874 */ 59875function wordWrap(wrap) { 59876 if (wrap === void 0) { 59877 wrap = 'break-word'; 59878 } 59879 var wordBreak = wrap === 'break-word' ? 'break-all' : wrap; 59880 return { 59881 overflowWrap: wrap, 59882 wordWrap: wrap, 59883 wordBreak: wordBreak 59884 }; 59885} 59886 59887function colorToInt(color) { 59888 return Math.round(color * 255); 59889} 59890function convertToInt(red, green, blue) { 59891 return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue); 59892} 59893function hslToRgb(hue, saturation, lightness, convert) { 59894 if (convert === void 0) { 59895 convert = convertToInt; 59896 } 59897 if (saturation === 0) { 59898 // achromatic 59899 return convert(lightness, lightness, lightness); 59900 } 59901 59902 // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV 59903 var huePrime = (hue % 360 + 360) % 360 / 60; 59904 var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation; 59905 var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1)); 59906 var red = 0; 59907 var green = 0; 59908 var blue = 0; 59909 if (huePrime >= 0 && huePrime < 1) { 59910 red = chroma; 59911 green = secondComponent; 59912 } else if (huePrime >= 1 && huePrime < 2) { 59913 red = secondComponent; 59914 green = chroma; 59915 } else if (huePrime >= 2 && huePrime < 3) { 59916 green = chroma; 59917 blue = secondComponent; 59918 } else if (huePrime >= 3 && huePrime < 4) { 59919 green = secondComponent; 59920 blue = chroma; 59921 } else if (huePrime >= 4 && huePrime < 5) { 59922 red = secondComponent; 59923 blue = chroma; 59924 } else if (huePrime >= 5 && huePrime < 6) { 59925 red = chroma; 59926 blue = secondComponent; 59927 } 59928 var lightnessModification = lightness - chroma / 2; 59929 var finalRed = red + lightnessModification; 59930 var finalGreen = green + lightnessModification;
59931 var finalBlue = blue + lightnessModification; 59932 return convert(finalRed, finalGreen, finalBlue); 59933} 59934 59935var namedColorMap = { 59936 aliceblue: 'f0f8ff', 59937 antiquewhite: 'faebd7', 59938 aqua: '00ffff', 59939 aquamarine: '7fffd4', 59940 azure: 'f0ffff', 59941 beige: 'f5f5dc', 59942 bisque: 'ffe4c4', 59943 black: '000', 59944 blanchedalmond: 'ffebcd', 59945 blue: '0000ff', 59946 blueviolet: '8a2be2', 59947 brown: 'a52a2a', 59948 burlywood: 'deb887', 59949 cadetblue: '5f9ea0', 59950 chartreuse: '7fff00', 59951 chocolate: 'd2691e', 59952 coral: 'ff7f50', 59953 cornflowerblue: '6495ed', 59954 cornsilk: 'fff8dc', 59955 crimson: 'dc143c', 59956 cyan: '00ffff', 59957 darkblue: '00008b', 59958 darkcyan: '008b8b', 59959 darkgoldenrod: 'b8860b', 59960 darkgray: 'a9a9a9', 59961 darkgreen: '006400', 59962 darkgrey: 'a9a9a9', 59963 darkkhaki: 'bdb76b', 59964 darkmagenta: '8b008b', 59965 darkolivegreen: '556b2f', 59966 darkorange: 'ff8c00', 59967 darkorchid: '9932cc', 59968 darkred: '8b0000', 59969 darksalmon: 'e9967a', 59970 darkseagreen: '8fbc8f', 59971 darkslateblue: '483d8b', 59972 darkslategray: '2f4f4f', 59973 darkslategrey: '2f4f4f', 59974 darkturquoise: '00ced1', 59975 darkviolet: '9400d3', 59976 deeppink: 'ff1493', 59977 deepskyblue: '00bfff', 59978 dimgray: '696969', 59979 dimgrey: '696969', 59980 dodgerblue: '1e90ff', 59981 firebrick: 'b22222', 59982 floralwhite: 'fffaf0', 59983 forestgreen: '228b22', 59984 fuchsia: 'ff00ff', 59985 gainsboro: 'dcdcdc', 59986 ghostwhite: 'f8f8ff', 59987 gold: 'ffd700', 59988 goldenrod: 'daa520', 59989 gray: '808080', 59990 green: '008000', 59991 greenyellow: 'adff2f', 59992 grey: '808080', 59993 honeydew: 'f0fff0', 59994 hotpink: 'ff69b4', 59995 indianred: 'cd5c5c', 59996 indigo: '4b0082', 59997 ivory: 'fffff0', 59998 khaki: 'f0e68c', 59999 lavender: 'e6e6fa', 60000 lavenderblush: 'fff0f5', 60001 lawngreen: '7cfc00', 60002 lemonchiffon: 'fffacd', 60003 lightblue: 'add8e6', 60004 lightcoral: 'f08080', 60005 lightcyan: 'e0ffff', 60006 lightgoldenrodyellow: 'fafad2', 60007 lightgray: 'd3d3d3', 60008 lightgreen: '90ee90', 60009 lightgrey: 'd3d3d3', 60010 lightpink: 'ffb6c1', 60011 lightsalmon: 'ffa07a', 60012 lightseagreen: '20b2aa', 60013 lightskyblue: '87cefa', 60014 lightslategray: '789', 60015 lightslategrey: '789', 60016 lightsteelblue: 'b0c4de', 60017 lightyellow: 'ffffe0', 60018 lime: '0f0', 60019 limegreen: '32cd32', 60020 linen: 'faf0e6', 60021 magenta: 'f0f', 60022 maroon: '800000', 60023 mediumaquamarine: '66cdaa', 60024 mediumblue: '0000cd', 60025 mediumorchid: 'ba55d3', 60026 mediumpurple: '9370db', 60027 mediumseagreen: '3cb371', 60028 mediumslateblue: '7b68ee', 60029 mediumspringgreen: '00fa9a', 60030 mediumturquoise: '48d1cc', 60031 mediumvioletred: 'c71585', 60032 midnightblue: '191970', 60033 mintcream: 'f5fffa', 60034 mistyrose: 'ffe4e1', 60035 moccasin: 'ffe4b5', 60036 navajowhite: 'ffdead', 60037 navy: '000080', 60038 oldlace: 'fdf5e6', 60039 olive: '808000', 60040 olivedrab: '6b8e23', 60041 orange: 'ffa500', 60042 orangered: 'ff4500', 60043 orchid: 'da70d6', 60044 palegoldenrod: 'eee8aa', 60045 palegreen: '98fb98', 60046 paleturquoise: 'afeeee', 60047 palevioletred: 'db7093', 60048 papayawhip: 'ffefd5', 60049 peachpuff: 'ffdab9', 60050 peru: 'cd853f', 60051 pink: 'ffc0cb', 60052 plum: 'dda0dd', 60053 powderblue: 'b0e0e6', 60054 purple: '800080', 60055 rebeccapurple: '639', 60056 red: 'f00', 60057 rosybrown: 'bc8f8f', 60058 royalblue: '4169e1', 60059 saddlebrown: '8b4513', 60060 salmon: 'fa8072', 60061 sandybrown: 'f4a460', 60062 seagreen: '2e8b57', 60063 seashell: 'fff5ee', 60064 sienna: 'a0522d', 60065 silver: 'c0c0c0', 60066 skyblue: '87ceeb', 60067 slateblue: '6a5acd', 60068 slategray: '708090', 60069 slategrey: '708090', 60070 snow: 'fffafa', 60071 springgreen: '00ff7f', 60072 steelblue: '4682b4', 60073 tan: 'd2b48c', 60074 teal: '008080', 60075 thistle: 'd8bfd8', 60076 tomato: 'ff6347', 60077 turquoise: '40e0d0', 60078 violet: 'ee82ee', 60079 wheat: 'f5deb3', 60080 white: 'fff', 60081 whitesmoke: 'f5f5f5', 60082 yellow: 'ff0', 60083 yellowgreen: '9acd32' 60084}; 60085 60086/** 60087 * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color. 60088 * @private 60089 */ 60090function nameToHex(color) { 60091 if (typeof color !== 'string') return color; 60092 var normalizedColorName = color.toLowerCase(); 60093 return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color; 60094} 60095 60096var hexRegex = /^#[a-fA-F0-9]{6}$/; 60097var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/; 60098var reducedHexRegex = /^#[a-fA-F0-9]{3}$/; 60099var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/; 60100var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i; 60101var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i; 60102var hslRegex = /^hsl\(\s*(\d{0,3}
vendor: 15,607 bytes, lines 60102-60523
60102[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i; 60103var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i; 60104 60105/** 60106 * Returns an RgbColor or RgbaColor object. This utility function is only useful 60107 * if want to extract a color component. With the color util `toColorString` you 60108 * can convert a RgbColor or RgbaColor object back to a string. 60109 * 60110 * @example 60111 * // Assigns `{ red: 255, green: 0, blue: 0 }` to color1 60112 * const color1 = parseToRgb('rgb(255, 0, 0)'); 60113 * // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2 60114 * const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)'); 60115 */ 60116function parseToRgb(color) { 60117 if (typeof color !== 'string') { 60118 throw new PolishedError(3); 60119 } 60120 var normalizedColor = nameToHex(color); 60121 if (normalizedColor.match(hexRegex)) { 60122 return { 60123 red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16), 60124 green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16), 60125 blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16) 60126 }; 60127 } 60128 if (normalizedColor.match(hexRgbaRegex)) { 60129 var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2)); 60130 return { 60131 red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16), 60132 green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16), 60133 blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16), 60134 alpha: alpha 60135 }; 60136 } 60137 if (normalizedColor.match(reducedHexRegex)) { 60138 return { 60139 red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16), 60140 green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16), 60141 blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16) 60142 }; 60143 } 60144 if (normalizedColor.match(reducedRgbaHexRegex)) { 60145 var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2)); 60146 return { 60147 red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16), 60148 green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16), 60149 blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16), 60150 alpha: _alpha 60151 }; 60152 } 60153 var rgbMatched = rgbRegex.exec(normalizedColor); 60154 if (rgbMatched) { 60155 return { 60156 red: parseInt("" + rgbMatched[1], 10), 60157 green: parseInt("" + rgbMatched[2], 10), 60158 blue: parseInt("" + rgbMatched[3], 10) 60159 }; 60160 } 60161 var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50)); 60162 if (rgbaMatched) { 60163 return { 60164 red: parseInt("" + rgbaMatched[1], 10), 60165 green: parseInt("" + rgbaMatched[2], 10), 60166 blue: parseInt("" + rgbaMatched[3], 10), 60167 alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4]) 60168 }; 60169 } 60170 var hslMatched = hslRegex.exec(normalizedColor); 60171 if (hslMatched) { 60172 var hue = parseInt("" + hslMatched[1], 10); 60173 var saturation = parseInt("" + hslMatched[2], 10) / 100; 60174 var lightness = parseInt("" + hslMatched[3], 10) / 100; 60175 var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")"; 60176 var hslRgbMatched = rgbRegex.exec(rgbColorString); 60177 if (!hslRgbMatched) { 60178 throw new PolishedError(4, normalizedColor, rgbColorString); 60179 } 60180 return { 60181 red: parseInt("" + hslRgbMatched[1], 10), 60182 green: parseInt("" + hslRgbMatched[2], 10), 60183 blue: parseInt("" + hslRgbMatched[3], 10) 60184 }; 60185 } 60186 var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50)); 60187 if (hslaMatched) { 60188 var _hue = parseInt("" + hslaMatched[1], 10); 60189 var _saturation = parseInt("" + hslaMatched[2], 10) / 100; 60190 var _lightness = parseInt("" + hslaMatched[3], 10) / 100; 60191 var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")"; 60192 var _hslRgbMatched = rgbRegex.exec(_rgbColorString); 60193 if (!_hslRgbMatched) { 60194 throw new PolishedError(4, normalizedColor, _rgbColorString); 60195 } 60196 return { 60197 red: parseInt("" + _hslRgbMatched[1], 10), 60198 green: parseInt("" + _hslRgbMatched[2], 10), 60199 blue: parseInt("" + _hslRgbMatched[3], 10), 60200 alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4]) 60201 }; 60202 } 60203 throw new PolishedError(5); 60204} 60205 60206function rgbToHsl(color) { 60207 // make sure rgb are contained in a set of [0, 255] 60208 var red = color.red / 255; 60209 var green = color.green / 255; 60210 var blue = color.blue / 255; 60211 var max = Math.max(red, green, blue); 60212 var min = Math.min(red, green, blue); 60213 var lightness = (max + min) / 2; 60214 if (max === min) { 60215 // achromatic 60216 if (color.alpha !== undefined) { 60217 return { 60218 hue: 0, 60219 saturation: 0, 60220 lightness: lightness, 60221 alpha: color.alpha 60222 }; 60223 } else { 60224 return { 60225 hue: 0, 60226 saturation: 0, 60227 lightness: lightness 60228 }; 60229 } 60230 } 60231 var hue; 60232 var delta = max - min; 60233 var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min); 60234 switch (max) { 60235 case red: 60236 hue = (green - blue) / delta + (green < blue ? 6 : 0); 60237 break; 60238 case green: 60239 hue = (blue - red) / delta + 2; 60240 break; 60241 default: 60242 // blue case 60243 hue = (red - green) / delta + 4; 60244 break; 60245 } 60246 hue *= 60; 60247 if (color.alpha !== undefined) { 60248 return { 60249 hue: hue, 60250 saturation: saturation, 60251 lightness: lightness, 60252 alpha: color.alpha 60253 }; 60254 } 60255 return { 60256 hue: hue, 60257 saturation: saturation, 60258 lightness: lightness 60259 }; 60260} 60261 60262/** 60263 * Returns an HslColor or HslaColor object. This utility function is only useful 60264 * if want to extract a color component. With the color util `toColorString` you 60265 * can convert a HslColor or HslaColor object back to a string. 60266 * 60267 * @example 60268 * // Assigns `{ hue: 0, saturation: 1, lightness: 0.5 }` to color1 60269 * const color1 = parseToHsl('rgb(255, 0, 0)'); 60270 * // Assigns `{ hue: 128, saturation: 1, lightness: 0.5, alpha: 0.75 }` to color2 60271 * const color2 = parseToHsl('hsla(128, 100%, 50%, 0.75)'); 60272 */ 60273function parseToHsl(color) { 60274 // Note: At a later stage we can optimize this function as right now a hsl 60275 // color would be parsed converted to rgb values and converted back to hsl. 60276 return rgbToHsl(parseToRgb(color)); 60277} 60278 60279/** 60280 * Reduces hex values if possible e.g. #ff8866 to #f86 60281 * @private 60282 */ 60283var reduceHexValue = function reduceHexValue(value) { 60284 if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) { 60285 return "#" + value[1] + value[3] + value[5]; 60286 } 60287 return value; 60288}; 60289var reduceHexValue$1 = reduceHexValue; 60290 60291function numberToHex(value) { 60292 var hex = value.toString(16); 60293 return hex.length === 1 ? "0" + hex : hex; 60294} 60295 60296function colorToHex(color) { 60297 return numberToHex(Math.round(color * 255)); 60298} 60299function convertToHex(red, green, blue) { 60300 return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue)); 60301} 60302function hslToHex(hue, saturation, lightness) { 60303 return hslToRgb(hue, saturation, lightness, convertToHex); 60304} 60305 60306/** 60307 * Returns a string value for the color. The returned result is the smallest possible hex notation. 60308 * 60309 * @example 60310 * // Styles as object usage 60311 * const styles = { 60312 * background: hsl(359, 0.75, 0.4), 60313 * background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }), 60314 * } 60315 * 60316 * // styled-components usage 60317 * const div = styled.div` 60318 * background: ${hsl(359, 0.75, 0.4)}; 60319 * background: ${hsl({ hue: 360, saturation: 0.75, lightness: 0.4 })}; 60320 * ` 60321 * 60322 * // CSS in JS Output 60323 * 60324 * element { 60325 * background: "#b3191c"; 60326 * background: "#b3191c"; 60327 * } 60328 */ 60329function hsl(value, saturation, lightness) { 60330 if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') { 60331 return hslToHex(value, saturation, lightness); 60332 } else if (typeof value === 'object' && saturation === undefined && lightness === undefined) { 60333 return hslToHex(value.hue, value.saturation, value.lightness); 60334 } 60335 throw new PolishedError(1); 60336} 60337 60338/** 60339 * Returns a string value for the color. The returned result is the smallest possible rgba or hex notation. 60340 * 60341 * @example 60342 * // Styles as object usage 60343 * const styles = { 60344 * background: hsla(359, 0.75, 0.4, 0.7), 60345 * background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 }), 60346 * background: hsla(359, 0.75, 0.4, 1), 60347 * } 60348 * 60349 * // styled-components usage 60350 * const div = styled.div` 60351 * background: ${hsla(359, 0.75, 0.4, 0.7)}; 60352 * background: ${hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 })}; 60353 * background: ${hsla(359, 0.75, 0.4, 1)}; 60354 * ` 60355 * 60356 * // CSS in JS Output 60357 * 60358 * element { 60359 * background: "rgba(179,25,28,0.7)"; 60360 * background: "rgba(179,25,28,0.7)"; 60361 * background: "#b3191c"; 60362 * } 60363 */ 60364function hsla(value, saturation, lightness, alpha) { 60365 if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') { 60366 return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")"; 60367 } else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) { 60368 return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")"; 60369 } 60370 throw new PolishedError(2); 60371} 60372 60373/** 60374 * Returns a string value for the color. The returned result is the smallest possible hex notation. 60375 * 60376 * @example 60377 * // Styles as object usage 60378 * const styles = { 60379 * background: rgb(255, 205, 100), 60380 * background: rgb({ red: 255, green: 205, blue: 100 }), 60381 * } 60382 * 60383 * // styled-components usage 60384 * const div = styled.div` 60385 * background: ${rgb(255, 205, 100)}; 60386 * background: ${rgb({ red: 255, green: 205, blue: 100 })}; 60387 * ` 60388 * 60389 * // CSS in JS Output 60390 * 60391 * element { 60392 * background: "#ffcd64"; 60393 * background: "#ffcd64"; 60394 * } 60395 */ 60396function rgb(value, green, blue) { 60397 if (typeof value === 'number' && typeof green === 'number' && typeof blue === 'number') { 60398 return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue)); 60399 } else if (typeof value === 'object' && green === undefined && blue === undefined) { 60400 return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue)); 60401 } 60402 throw new PolishedError(6); 60403} 60404 60405/** 60406 * Returns a string value for the color. The returned result is the smallest possible rgba or hex notation. 60407 * 60408 * Can also be used to fade a color by passing a hex value or named CSS color along with an alpha value. 60409 * 60410 * @example 60411 * // Styles as object usage 60412 * const styles = { 60413 * background: rgba(255, 205, 100, 0.7), 60414 * background: rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 }), 60415 * background: rgba(255, 205, 100, 1), 60416 * background: rgba('#ffffff', 0.4), 60417 * background: rgba('black', 0.7), 60418 * } 60419 * 60420 * // styled-components usage 60421 * const div = styled.div` 60422 * background: ${rgba(255, 205, 100, 0.7)}; 60423 * background: ${rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 })}; 60424 * background: ${rgba(255, 205, 100, 1)}; 60425 * background: ${rgba('#ffffff', 0.4)}; 60426 * background: ${rgba('black', 0.7)}; 60427 * ` 60428 * 60429 * // CSS in JS Output 60430 * 60431 * element { 60432 * background: "rgba(255,205,100,0.7)"; 60433 * background: "rgba(255,205,100,0.7)"; 60434 * background: "#ffcd64"; 60435 * background: "rgba(255,255,255,0.4)"; 60436 * background: "rgba(0,0,0,0.7)"; 60437 * } 60438 */ 60439function rgba(firstValue, secondValue, thirdValue, fourthValue) { 60440 if (typeof firstValue === 'string' && typeof secondValue === 'number') { 60441 var rgbValue = parseToRgb(firstValue); 60442 return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")"; 60443 } else if (typeof firstValue === 'number' && typeof secondValue === 'number' && typeof thirdValue === 'number' && typeof fourthValue === 'number') { 60444 return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")"; 60445 } else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) { 60446 return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")"; 60447 } 60448 throw new PolishedError(7); 60449} 60450 60451var isRgb = function isRgb(color) { 60452 return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined'); 60453}; 60454var isRgba = function isRgba(color) { 60455 return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number'; 60456}; 60457var isHsl = function isHsl(color) { 60458 return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined'); 60459}; 60460var isHsla = function isHsla(color) { 60461 return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number'; 60462}; 60463 60464/** 60465 * Converts a RgbColor, RgbaColor, HslColor or HslaColor object to a color string. 60466 * This util is useful in case you only know on runtime which color object is 60467 * used. Otherwise we recommend to rely on `rgb`, `rgba`, `hsl` or `hsla`. 60468 * 60469 * @example 60470 * // Styles as object usage 60471 * const styles = { 60472 * background: toColorString({ red: 255, green: 205, blue: 100 }), 60473 * background: toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }), 60474 * background: toColorString({ hue: 240, saturation: 1, lightness: 0.5 }), 60475 * background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }), 60476 * } 60477 * 60478 * // styled-components usage 60479 * const div = styled.div` 60480 * background: ${toColorString({ red: 255, green: 205, blue: 100 })}; 60481 * background: ${toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })}; 60482 * background: ${toColorString({ hue: 240, saturation: 1, lightness: 0.5 })}; 60483 * background: ${toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })}; 60484 * ` 60485 * 60486 * // CSS in JS Output 60487 * element { 60488 * background: "#ffcd64"; 60489 * background: "rgba(255,205,100,0.72)"; 60490 * background: "#00f"; 60491 * background: "rgba(179,25,25,0.72)"; 60492 * } 60493 */ 60494 60495function toColorString(color) { 60496 if (typeof color !== 'object') throw new PolishedError(8); 60497 if (isRgba(color)) return rgba(color); 60498 if (isRgb(color)) return rgb(color); 60499 if (isHsla(color)) return hsla(color); 60500 if (isHsl(color)) return hsl(color); 60501 throw new PolishedError(8); 60502} 60503 60504// Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js 60505// eslint-disable-next-line no-unused-vars 60506// eslint-disable-next-line no-unused-vars 60507// eslint-disable-next-line no-redeclare 60508function curried(f, length, acc) { 60509 return function fn() { 60510 // eslint-disable-next-line prefer-rest-params 60511 var combined = acc.concat(Array.prototype.slice.call(arguments)); 60512 return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined); 60513 }; 60514} 60515 60516// eslint-disable-next-line no-redeclare 60517function curry(f) { 60518 // eslint-disable-line no-redeclare 60519 return curried(f, f.length, []); 60520} 60521 60522/** 60523 * Changes the hue of the color. Hue is a number between 0 to 360. The first
60524 * argument for adjustHue is the amount of degrees the color is rotated around 60525 * the color wheel, always producing a positive hue value. 60526 * 60527 * @example 60528 * // Styles as object usage 60529 * const styles = { 60530 * background: adjustHue(180, '#448'), 60531 * background: adjustHue('180', 'rgba(101,100,205,0.7)'), 60532 * } 60533 * 60534 * // styled-components usage 60535 * const div = styled.div` 60536 * background: ${adjustHue(180, '#448')}; 60537 * background: ${adjustHue('180', 'rgba(101,100,205,0.7)')}; 60538 * ` 60539 * 60540 * // CSS in JS Output 60541 * element { 60542 * background: "#888844"; 60543 * background: "rgba(136,136,68,0.7)"; 60544 * } 60545 */ 60546function adjustHue(degree, color) { 60547 if (color === 'transparent') return color; 60548 var hslColor = parseToHsl(color); 60549 return toColorString((0,esm_extends/* default */.A)({}, hslColor, { 60550 hue: hslColor.hue + parseFloat(degree) 60551 })); 60552} 60553 60554// prettier-ignore 60555var curriedAdjustHue = curry /* ::<number | string, string, string> */(adjustHue); 60556var curriedAdjustHue$1 = (/* unused pure expression or super */ null && (curriedAdjustHue)); 60557 60558/** 60559 * Returns the complement of the provided color. This is identical to adjustHue(180, <color>). 60560 * 60561 * @example 60562 * // Styles as object usage 60563 * const styles = { 60564 * background: complement('#448'), 60565 * background: complement('rgba(204,205,100,0.7)'), 60566 * } 60567 * 60568 * // styled-components usage 60569 * const div = styled.div` 60570 * background: ${complement('#448')}; 60571 * background: ${complement('rgba(204,205,100,0.7)')}; 60572 * ` 60573 * 60574 * // CSS in JS Output 60575 * element { 60576 * background: "#884"; 60577 * background: "rgba(153,153,153,0.7)"; 60578 * } 60579 */ 60580function complement(color) { 60581 if (color === 'transparent') return color; 60582 var hslColor = parseToHsl(color); 60583 return toColorString(_extends({}, hslColor, { 60584 hue: (hslColor.hue + 180) % 360 60585 })); 60586} 60587 60588function guard(lowerBoundary, upperBoundary, value) { 60589 return Math.max(lowerBoundary, Math.min(upperBoundary, value)); 60590} 60591 60592/** 60593 * Returns a string value for the darkened color. 60594 * 60595 * @example 60596 * // Styles as object usage 60597 * const styles = { 60598 * background: darken(0.2, '#FFCD64'), 60599 * background: darken('0.2', 'rgba(255,205,100,0.7)'), 60600 * } 60601 * 60602 * // styled-components usage 60603 * const div = styled.div` 60604 * background: ${darken(0.2, '#FFCD64')}; 60605 * background: ${darken('0.2', 'rgba(255,205,100,0.7)')}; 60606 * ` 60607 * 60608 * // CSS in JS Output 60609 * 60610 * element { 60611 * background: "#ffbd31"; 60612 * background: "rgba(255,189,49,0.7)"; 60613 * } 60614 */ 60615function darken(amount, color) { 60616 if (color === 'transparent') return color; 60617 var hslColor = parseToHsl(color); 60618 return toColorString((0,esm_extends/* default */.A)({}, hslColor, { 60619 lightness: guard(0, 1, hslColor.lightness - parseFloat(amount)) 60620 })); 60621} 60622 60623// prettier-ignore 60624var curriedDarken = curry /* ::<number | string, string, string> */(darken); 60625var curriedDarken$1 = curriedDarken; 60626 60627/** 60628 * Decreases the intensity of a color. Its range is between 0 to 1. The first 60629 * argument of the desaturate function is the amount by how much the color 60630 * intensity should be decreased. 60631 * 60632 * @example 60633 * // Styles as object usage 60634 * const styles = { 60635 * background: desaturate(0.2, '#CCCD64'), 60636 * background: desaturate('0.2', 'rgba(204,205,100,0.7)'), 60637 * } 60638 * 60639 * // styled-components usage 60640 * const div = styled.div` 60641 * background: ${desaturate(0.2, '#CCCD64')}; 60642 * background: ${desaturate('0.2', 'rgba(204,205,100,0.7)')}; 60643 * ` 60644 * 60645 * // CSS in JS Output 60646 * element { 60647 * background: "#b8b979"; 60648 * background: "rgba(184,185,121,0.7)"; 60649 * } 60650 */ 60651function desaturate(amount, color) { 60652 if (color === 'transparent') return color; 60653 var hslColor = parseToHsl(color); 60654 return toColorString((0,esm_extends/* default */.A)({}, hslColor, { 60655 saturation: guard(0, 1, hslColor.saturation - parseFloat(amount)) 60656 })); 60657} 60658 60659// prettier-ignore 60660var curriedDesaturate = curry /* ::<number | string, string, string> */(desaturate); 60661var curriedDesaturate$1 = (/* unused pure expression or super */ null && (curriedDesaturate)); 60662 60663/** 60664 * Returns a number (float) representing the luminance of a color. 60665 * 60666 * @example 60667 * // Styles as object usage 60668 * const styles = { 60669 * background: getLuminance('#CCCD64') >= getLuminance('#0000ff') ? '#CCCD64' : '#0000ff', 60670 * background: getLuminance('rgba(58, 133, 255, 1)') >= getLuminance('rgba(255, 57, 149, 1)') ? 60671 * 'rgba(58, 133, 255, 1)' : 60672 * 'rgba(255, 57, 149, 1)', 60673 * } 60674 * 60675 * // styled-components usage 60676 * const div = styled.div` 60677 * background: ${getLuminance('#CCCD64') >= getLuminance('#0000ff') ? '#CCCD64' : '#0000ff'}; 60678 * background: ${getLuminance('rgba(58, 133, 255, 1)') >= getLuminance('rgba(255, 57, 149, 1)') ? 60679 * 'rgba(58, 133, 255, 1)' : 60680 * 'rgba(255, 57, 149, 1)'}; 60681 * 60682 * // CSS in JS Output 60683 * 60684 * div { 60685 * background: "#CCCD64"; 60686 * background: "rgba(58, 133, 255, 1)"; 60687 * } 60688 */ 60689function getLuminance(color) { 60690 if (color === 'transparent') return 0; 60691 var rgbColor = parseToRgb(color); 60692 var _Object$keys$map = Object.keys(rgbColor).map(function (key) { 60693 var channel = rgbColor[key] / 255; 60694 return channel <= 0.03928 ? channel / 12.92 : Math.pow((ch
60694annel + 0.055) / 1.055, 2.4); 60695 }), 60696 r = _Object$keys$map[0], 60697 g = _Object$keys$map[1], 60698 b = _Object$keys$map[2]; 60699 return parseFloat((0.2126 * r + 0.7152 * g + 0.0722 * b).toFixed(3)); 60700} 60701 60702/** 60703 * Returns the contrast ratio between two colors based on 60704 * [W3's recommended equation for calculating contrast](http://www.w3.org/TR/WCAG20/#contrast-ratiodef). 60705 * 60706 * @example 60707 * const contrastRatio = getContrast('#444', '#fff'); 60708 */ 60709function getContrast(color1, color2) { 60710 var luminance1 = getLuminance(color1); 60711 var luminance2 = getLuminance(color2); 60712 return parseFloat((luminance1 > luminance2 ? (luminance1 + 0.05) / (luminance2 + 0.05) : (luminance2 + 0.05) / (luminance1 + 0.05)).toFixed(2)); 60713} 60714 60715/** 60716 * Converts the color to a grayscale, by reducing its saturation to 0. 60717 * 60718 * @example 60719 * // Styles as object usage 60720 * const styles = { 60721 * background: grayscale('#CCCD64'), 60722 * background: grayscale('rgba(204,205,100,0.7)'), 60723 * } 60724 * 60725 * // styled-components usage 60726 * const div = styled.div` 60727 * background: ${grayscale('#CCCD64')}; 60728 * background: ${grayscale('rgba(204,205,100,0.7)')}; 60729 * ` 60730 * 60731 * // CSS in JS Output 60732 * element { 60733 * background: "#999"; 60734 * background: "rgba(153,153,153,0.7)"; 60735 * } 60736 */ 60737function grayscale(color) { 60738 if (color === 'transparent') return color; 60739 return toColorString(_extends({}, parseToHsl(color), { 60740 saturation: 0 60741 })); 60742} 60743 60744/** 60745 * Converts a HslColor or HslaColor object to a color string. 60746 * This util is useful in case you only know on runtime which color object is 60747 * used. Otherwise we recommend to rely on `hsl` or `hsla`. 60748 * 60749 * @example 60750 * // Styles as object usage 60751 * const styles = { 60752 * background: hslToColorString({ hue: 240, saturation: 1, lightness: 0.5 }), 60753 * background: hslToColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }), 60754 * } 60755 * 60756 * // styled-components usage 60757 * const div = styled.div` 60758 * background: ${hslToColorString({ hue: 240, saturation: 1, lightness: 0.5 })}; 60759 * background: ${hslToColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })}; 60760 * ` 60761 * 60762 * // CSS in JS Output 60763 * element { 60764 * background: "#00f"; 60765 * background: "rgba(179,25,25,0.72)"; 60766 * } 60767 */ 60768function hslToColorString(color) { 60769 if (typeof color === 'object' && typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number') { 60770 if (color.alpha && typeof color.alpha === 'number') { 60771 return hsla({ 60772 hue: color.hue, 60773 saturation: color.saturation, 60774 lightness: color.lightness, 60775 alpha: color.alpha 60776 }); 60777 } 60778 return hsl({ 60779 hue: color.hue, 60780 saturation: color.saturation, 60781 lightness: color.lightness 60782 }); 60783 } 60784 throw new PolishedError(45); 60785} 60786 60787/** 60788 * Inverts the red, green and blue values of a color. 60789 * 60790 * @example 60791 * // Styles as object usage 60792 * const styles = { 60793 * background: invert('#CCCD64'), 60794 * background: invert('rgba(101,100,205,0.7)'), 60795 * } 60796 * 60797 * // styled-components usage 60798 * const div = styled.div` 60799 * background: ${invert('#CCCD64')}; 60800 * background: ${invert('rgba(101,100,205,0.7)')}; 60801 * ` 60802 * 60803 * // CSS in JS Output 60804 * 60805 * element { 60806 * background: "#33329b"; 60807 * background: "rgba(154,155,50,0.7)"; 60808 * } 60809 */ 60810function invert(color) { 60811 if (color === 'transparent') return color; 60812 // parse color string to rgb 60813 var value = parseToRgb(color); 60814 return toColorString(_extends({}, value, { 60815 red: 255 - value.red, 60816 green: 255 - value.green, 60817 blue: 255 - value.blue 60818 })); 60819} 60820 60821/** 60822 * Returns a string value for the lightened color. 60823 * 60824 * @example 60825 * // Styles as object usage 60826 * const styles = { 60827 * background: lighten(0.2, '#CCCD64'), 60828 * background: lighten('0.2', 'rgba(204,205,100,0.7)'), 60829 * } 60830 * 60831 * // styled-components usage 60832 * const div = styled.div` 60833 * background: ${lighten(0.2, '#FFCD64')}; 60834 * background: ${lighten('0.2', 'rgba(204,205,100,0.7)')}; 60835 * ` 60836 * 60837 * // CSS in JS Output 60838 * 60839 * element { 60840 * background: "#e5e6b1"; 60841 * background: "rgba(229,230,177,0.7)"; 60842 * } 60843 */ 60844function lighten(amount, color) { 60845 if (color === 'transparent') return color; 60846 var hslColor = parseToHsl(color); 60847 return toColorString((0,esm_extends/* default */.A)({}, hslColor, { 60848 lightness: guard(0, 1, hslColor.lightness + parseFloat(amount)) 60849 })); 60850} 60851 60852// prettier-ignore 60853var curriedLighten = curry /* ::<number | string, string, string> */(lighten); 60854var curriedLighten$1 = curriedLighten; 60855 60856/** 60857 * Determines which contrast guidelines have been met for two colors. 60858 * Based on the [contrast calculations recommended by W3](https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced.html). 60859 * 60860 * @example 60861 * const scores = meetsContrastGuidelines('#444', '#fff'); 60862 */ 60863function meetsContrastGuidelines(color1, color2) { 60864 var contrastRatio = getContrast(color1, color2); 60865 return { 60866 AA: contrastRatio >= 4.5, 60867 AALarge: contrastRatio >= 3, 60868 AAA: contrastRatio >= 7, 60869 AAALarge: contrastRatio >= 4.5 60870 }; 60871} 60872 60873/** 60874 * Mixes the two provided colors together by calculating the average of each of the RGB components weighted to the first color by the provided weight. 60875 * 60876 * @example 60877 * // Styles as object usage 60878 * const styles = { 60879 * background: mix(0.5, '#f00', '#00f') 60880 * background: mix(0.25, '#f00', '#00f') 60881 * background: mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f') 60882 * } 60883 * 60884 * // styled-components usage 60885 * const div = styled.div` 60886 * background: ${mix(0.5, '#f00', '#00f')}; 60887 * background: ${mix(0.25, '#f00', '#00f')}; 60888 * background: ${mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')}; 60889 * ` 60890 * 60891 * // CSS in JS Output 60892 * 60893 * element {
vendor: 2,986 bytes, lines 60894-60979
60894 * background: "#7f007f"; 60895 * background: "#3f00bf"; 60896 * background: "rgba(63, 0, 191, 0.75)"; 60897 * } 60898 */ 60899function mix(weight, color, otherColor) { 60900 if (color === 'transparent') return otherColor; 60901 if (otherColor === 'transparent') return color; 60902 if (weight === 0) return otherColor; 60903 var parsedColor1 = parseToRgb(color); 60904 var color1 = (0,esm_extends/* default */.A)({}, parsedColor1, { 60905 alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1 60906 }); 60907 var parsedColor2 = parseToRgb(otherColor); 60908 var color2 = (0,esm_extends/* default */.A)({}, parsedColor2, { 60909 alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1 60910 }); 60911 60912 // The formula is copied from the original Sass implementation: 60913 // http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method 60914 var alphaDelta = color1.alpha - color2.alpha; 60915 var x = parseFloat(weight) * 2 - 1; 60916 var y = x * alphaDelta === -1 ? x : x + alphaDelta; 60917 var z = 1 + x * alphaDelta; 60918 var weight1 = (y / z + 1) / 2.0; 60919 var weight2 = 1 - weight1; 60920 var mixedColor = { 60921 red: Math.floor(color1.red * weight1 + color2.red * weight2), 60922 green: Math.floor(color1.green * weight1 + color2.green * weight2), 60923 blue: Math.floor(color1.blue * weight1 + color2.blue * weight2), 60924 alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight)) 60925 }; 60926 return rgba(mixedColor); 60927} 60928 60929// prettier-ignore 60930var curriedMix = curry /* ::<number | string, string, string, string> */(mix); 60931var mix$1 = curriedMix; 60932 60933/** 60934 * Increases the opacity of a color. Its range for the amount is between 0 to 1. 60935 * 60936 * 60937 * @example 60938 * // Styles as object usage 60939 * const styles = { 60940 * background: opacify(0.1, 'rgba(255, 255, 255, 0.9)'); 60941 * background: opacify(0.2, 'hsla(0, 0%, 100%, 0.5)'), 60942 * background: opacify('0.5', 'rgba(255, 0, 0, 0.2)'), 60943 * } 60944 * 60945 * // styled-components usage 60946 * const div = styled.div` 60947 * background: ${opacify(0.1, 'rgba(255, 255, 255, 0.9)')}; 60948 * background: ${opacify(0.2, 'hsla(0, 0%, 100%, 0.5)')}, 60949 * background: ${opacify('0.5', 'rgba(255, 0, 0, 0.2)')}, 60950 * ` 60951 * 60952 * // CSS in JS Output 60953 * 60954 * element { 60955 * background: "#fff"; 60956 * background: "rgba(255,255,255,0.7)"; 60957 * background: "rgba(255,0,0,0.7)"; 60958 * } 60959 */ 60960function opacify(amount, color) { 60961 if (color === 'transparent') return color; 60962 var parsedColor = parseToRgb(color); 60963 var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1; 60964 var colorWithAlpha = (0,esm_extends/* default */.A)({}, parsedColor, { 60965 alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100) 60966 }); 60967 return rgba(colorWithAlpha); 60968} 60969 60970// prettier-ignore 60971var curriedOpacify = curry /* ::<number | string, string, string> */(opacify); 60972var curriedOpacify$1 = curriedOpacify; 60973 60974var defaultReturnIfLightColor = '#000'; 60975var defaultReturnIfDarkColor = '#fff'; 60976 60977/** 60978 * Returns black or white (or optional passed colors) for best 60979 * contrast depending on the luminosity of the given color.
60980 * When passing custom return colors, strict mode ensures that the 60981 * return color always meets or exceeds WCAG level AA or greater. If this test 60982 * fails, the default return color (black or white) is returned in place of the 60983 * custom return color. You can optionally turn off strict mode. 60984 * 60985 * Follows [W3C specs for readability](https://www.w3.org/TR/WCAG20-TECHS/G18.html). 60986 * 60987 * @example 60988 * // Styles as object usage 60989 * const styles = { 60990 * color: readableColor('#000'), 60991 * color: readableColor('black', '#001', '#ff8'), 60992 * color: readableColor('white', '#001', '#ff8'), 60993 * color: readableColor('red', '#333', '#ddd', true) 60994 * } 60995 * 60996 * // styled-components usage 60997 * const div = styled.div` 60998 * color: ${readableColor('#000')}; 60999 * color: ${readableColor('black', '#001', '#ff8')}; 61000 * color: ${readableColor('white', '#001', '#ff8')}; 61001 * color: ${readableColor('red', '#333', '#ddd', true)}; 61002 * ` 61003 * 61004 * // CSS in JS Output 61005 * element { 61006 * color: "#fff"; 61007 * color: "#ff8"; 61008 * color: "#001"; 61009 * color: "#000"; 61010 * } 61011 */ 61012function readableColor(color, returnIfLightColor, returnIfDarkColor, strict) { 61013 if (returnIfLightColor === void 0) { 61014 returnIfLightColor = defaultReturnIfLightColor; 61015 } 61016 if (returnIfDarkColor === void 0) { 61017 returnIfDarkColor = defaultReturnIfDarkColor; 61018 } 61019 if (strict === void 0) { 61020 strict = true; 61021 } 61022 var isColorLight = getLuminance(color) > 0.179; 61023 var preferredReturnColor = isColorLight ? returnIfLightColor : returnIfDarkColor; 61024 if (!strict || getContrast(color, preferredReturnColor) >= 4.5) { 61025 return preferredReturnColor; 61026 } 61027 return isColorLight ? defaultReturnIfLightColor : defaultReturnIfDarkColor; 61028} 61029 61030/** 61031 * Converts a RgbColor or RgbaColor object to a color string. 61032 * This util is useful in case you only know on runtime which color object is 61033 * used. Otherwise we recommend to rely on `rgb` or `rgba`. 61034 * 61035 * @example 61036 * // Styles as object usage 61037 * const styles = { 61038 * background: rgbToColorString({ red: 255, green: 205, blue: 100 }), 61039 * background: rgbToColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }), 61040 * } 61041 * 61042 * // styled-components usage 61043 * const div = styled.div` 61044 * background: ${rgbToColorString({ red: 255, green: 205, blue: 100 })}; 61045 * background: ${rgbToColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })}; 61046 * ` 61047 * 61048 * // CSS in JS Output 61049 * element { 61050 * background: "#ffcd64"; 61051 * background: "rgba(255,205,100,0.72)"; 61052 * } 61053 */ 61054function rgbToColorString(color) { 61055 if (typeof color === 'object' && typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number') { 61056 if (typeof color.alpha === 'number') { 61057 return rgba({ 61058 red: color.red, 61059 green: color.green, 61060 blue: color.blue, 61061 alpha: color.alpha 61062 }); 61063 } 61064 return rgb({ 61065 red: color.red, 61066 green: color.green, 61067 blue: color.blue 61068 }); 61069 } 61070 throw new PolishedError(46); 61071} 61072 61073/** 61074 * Increases the intensity of a color. Its range is between 0 to 1. The first 61075 * argument of the saturate function is the amount by how much the color 61076 * intensity should be increased. 61077 * 61078 * @example 61079 * // Styles as object usage 61080 * const styles = { 61081 * background: saturate(0.2, '#CCCD64'), 61082 * background: saturate('0.2', 'rgba(204,205,100,0.7)'), 61083 * } 61084 * 61085 * // styled-components usage 61086 * const div = styled.div` 61087 * background: ${saturate(0.2, '#FFCD64')}; 61088 * background: ${saturate('0.2', 'rgba(204,205,100,0.7)')}; 61089 * ` 61090 * 61091 * // CSS in JS Output 61092 * 61093 * element { 61094 * background: "#e0e250"; 61095 * background: "rgba(224,226,80,0.7)"; 61096 * } 61097 */ 61098function saturate(amount, color) { 61099 if (color === 'transparent') return color; 61100 var hslColor = parseToHsl(color); 61101 return toColorString((0,esm_extends/* default */.A)({}, hslColor, { 61102 saturation: guard(0, 1, hslColor.saturation + parseFloat(amount)) 61103 })); 61104} 61105 61106// prettier-ignore 61107var curriedSaturate = curry /* ::<number | string, string, string> */(saturate); 61108var curriedSaturate$1 = (/* unused pure expression or super */ null && (curriedSaturate)); 61109 61110/** 61111 * Sets the hue of a color to the provided value. The hue range can be 61112 * from 0 and 359. 61113 * 61114 * @example 61115 * // Styles as object usage 61116 * const styles = { 61117 * background: setHue(42, '#CCCD64'), 61118 * background: setHue('244', 'rgba(204,205,100,0.7)'), 61119 * } 61120 * 61121 * // styled-components usage 61122 * const div = styled.div` 61123 * background: ${setHue(42, '#CCCD64')}; 61124 * background: ${setHue('244', 'rgba(204,205,100,0.7)')}; 61125 * ` 61126 * 61127 * // CSS in JS Output 61128 * element { 61129 * background: "#cdae64"; 61130 * background: "rgba(107,100,205,0.7)"; 61131 * } 61132 */ 61133function setHue(hue, color) { 61134 if (color === 'transparent') return color; 61135 return toColorString((0,esm_extends/* default */.A)({}, parseToHsl(color), { 61136 hue: parseFloat(hue) 61137 })); 61138} 61139 61140// prettier-ignore 61141var curriedSetHue = curry /* ::<number | string, string, string> */(setHue); 61142var curriedSetHue$1 = (/* unused pure expression or super */ null && (curriedSetHue)); 61143 61144/** 61145 * Sets the lightness of a color to the provided value. The lightness range can be 61146 * from 0 and 1. 61147 * 61148 * @example 61149 * // Styles as object usage 61150 * const styles = { 61151 * background: setLightness(0.2, '#CCCD64'), 61152 * background: setLightness('0.75', 'rgba(204,205,100,0.7)'), 61153 * } 61154 * 61155 * // styled-components usage 61156 * const div = styled.div`
61157 * background: ${setLightness(0.2, '#CCCD64')}; 61158 * background: ${setLightness('0.75', 'rgba(204,205,100,0.7)')}; 61159 * ` 61160 * 61161 * // CSS in JS Output 61162 * element { 61163 * background: "#4d4d19"; 61164 * background: "rgba(223,224,159,0.7)"; 61165 * } 61166 */ 61167function setLightness(lightness, color) { 61168 if (color === 'transparent') return color; 61169 return toColorString((0,esm_extends/* default */.A)({}, parseToHsl(color), { 61170 lightness: parseFloat(lightness) 61171 })); 61172} 61173 61174// prettier-ignore 61175var curriedSetLightness = curry /* ::<number | string, string, string> */(setLightness); 61176var curriedSetLightness$1 = (/* unused pure expression or super */ null && (curriedSetLightness)); 61177 61178/** 61179 * Sets the saturation of a color to the provided value. The saturation range can be 61180 * from 0 and 1. 61181 * 61182 * @example 61183 * // Styles as object usage 61184 * const styles = { 61185 * background: setSaturation(0.2, '#CCCD64'), 61186 * background: setSaturation('0.75', 'rgba(204,205,100,0.7)'), 61187 * } 61188 * 61189 * // styled-components usage 61190 * const div = styled.div` 61191 * background: ${setSaturation(0.2, '#CCCD64')}; 61192 * background: ${setSaturation('0.75', 'rgba(204,205,100,0.7)')}; 61193 * ` 61194 * 61195 * // CSS in JS Output 61196 * element { 61197 * background: "#adad84"; 61198 * background: "rgba(228,229,76,0.7)"; 61199 * } 61200 */ 61201function setSaturation(saturation, color) { 61202 if (color === 'transparent') return color; 61203 return toColorString((0,esm_extends/* default */.A)({}, parseToHsl(color), { 61204 saturation: parseFloat(saturation) 61205 })); 61206} 61207 61208// prettier-ignore 61209var curriedSetSaturation = curry /* ::<number | string, string, string> */(setSaturation); 61210var curriedSetSaturation$1 = (/* unused pure expression or super */ null && (curriedSetSaturation)); 61211 61212/** 61213 * Shades a color by mixing it with black. `shade` can produce 61214 * hue shifts, where as `darken` manipulates the luminance channel and therefore 61215 * doesn't produce hue shifts. 61216 * 61217 * @example 61218 * // Styles as object usage 61219 * const styles = { 61220 * background: shade(0.25, '#00f') 61221 * } 61222 * 61223 * // styled-components usage 61224 * const div = styled.div` 61225 * background: ${shade(0.25, '#00f')}; 61226 * ` 61227 * 61228 * // CSS in JS Output 61229 * 61230 * element { 61231 * background: "#00003f"; 61232 * } 61233 */ 61234 61235function shade(percentage, color) { 61236 if (color === 'transparent') return color; 61237 return mix$1(parseFloat(percentage), 'rgb(0, 0, 0)', color); 61238} 61239 61240// prettier-ignore 61241var curriedShade = curry /* ::<number | string, string, string> */(shade); 61242var curriedShade$1 = (/* unused pure expression or super */ null && (curriedShade)); 61243 61244/** 61245 * Tints a color by mixing it with white. `tint` can produce 61246 * hue shifts, where as `lighten` manipulates the luminance channel and therefore 61247 * doesn't produce hue shifts. 61248 * 61249 * @example 61250 * // Styles as object usage 61251 * const styles = { 61252 * background: tint(0.25, '#00f') 61253 * } 61254 * 61255 * // styled-components usage 61256 * const div = styled.div` 61257 * background: ${tint(0.25, '#00f')}; 61258 * ` 61259 * 61260 * // CSS in JS Output 61261 * 61262 * element { 61263 * background: "#bfbfff"; 61264 * } 61265 */ 61266 61267function tint(percentage, color) { 61268 if (color === 'transparent') return color; 61269 return mix$1(parseFloat(percentage), 'rgb(255, 255, 255)', color); 61270} 61271 61272// prettier-ignore 61273var curriedTint = curry /* ::<number | string, string, string> */(tint); 61274var curriedTint$1 = (/* unused pure expression or super */ null && (curriedTint)); 61275 61276/** 61277 * Decreases the opacity of a color. Its range for the amount is between 0 to 1. 61278 * 61279 * 61280 * @example 61281 * // Styles as object usage 61282 * const styles = { 61283 * background: transparentize(0.1, '#fff'), 61284 * background: transparentize(0.2, 'hsl(0, 0%, 100%)'), 61285 * background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'), 61286 * } 61287 * 61288 * // styled-components usage 61289 * const div = styled.div` 61290 * background: ${transparentize(0.1, '#fff')}; 61291 * background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')}; 61292 * background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')}; 61293 * ` 61294 * 61295 * // CSS in JS Output 61296 * 61297 * element { 61298 * background: "rgba(255,255,255,0.9)"; 61299 * background: "rgba(255,255,255,0.8)"; 61300 * background: "rgba(255,0,0,0.3)"; 61301 * } 61302 */ 61303function transparentize(amount, color) { 61304 if (color === 'transparent') return color; 61305 var parsedColor = parseToRgb(color); 61306 var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1; 61307 var colorWithAlpha = (0,esm_extends/* default */.A)({}, parsedColor, {
61308 alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100) 61309 }); 61310 return rgba(colorWithAlpha); 61311} 61312 61313// prettier-ignore 61314var curriedTransparentize = curry /* ::<number | string, string, string> */(transparentize); 61315var curriedTransparentize$1 = (/* unused pure expression or super */ null && (curriedTransparentize)); 61316 61317/** 61318 * Shorthand for easily setting the animation property. Allows either multiple arrays with animations 61319 * or a single animation spread over the arguments. 61320 * @example 61321 * // Styles as object usage 61322 * const styles = { 61323 * ...animation(['rotate', '1s', 'ease-in-out'], ['colorchange', '2s']) 61324 * } 61325 * 61326 * // styled-components usage 61327 * const div = styled.div` 61328 * ${animation(['rotate', '1s', 'ease-in-out'], ['colorchange', '2s'])} 61329 * ` 61330 * 61331 * // CSS as JS Output 61332 * 61333 * div { 61334 * 'animation': 'rotate 1s ease-in-out, colorchange 2s' 61335 * } 61336 * @example 61337 * // Styles as object usage 61338 * const styles = { 61339 * ...animation('rotate', '1s', 'ease-in-out') 61340 * } 61341 * 61342 * // styled-components usage 61343 * const div = styled.div` 61344 * ${animation('rotate', '1s', 'ease-in-out')} 61345 * ` 61346 * 61347 * // CSS as JS Output 61348 * 61349 * div { 61350 * 'animation': 'rotate 1s ease-in-out' 61351 * } 61352 */ 61353function animation() { 61354 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 61355 args[_key] = arguments[_key]; 61356 } 61357 // Allow single or multiple animations passed 61358 var multiMode = Array.isArray(args[0]); 61359 if (!multiMode && args.length > 8) { 61360 throw new PolishedError(64); 61361 } 61362 var code = args.map(function (arg) { 61363 if (multiMode && !Array.isArray(arg) || !multiMode && Array.isArray(arg)) { 61364 throw new PolishedError(65); 61365 } 61366 if (Array.isArray(arg) && arg.length > 8) { 61367 throw new PolishedError(66); 61368 } 61369 return Array.isArray(arg) ? arg.join(' ') : arg; 61370 }).join(', '); 61371 return { 61372 animation: code 61373 }; 61374} 61375 61376/** 61377 * Shorthand that accepts any number of backgroundImage values as parameters for creating a single background statement. 61378 * @example 61379 * // Styles as object usage 61380 * const styles = { 61381 * ...backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)') 61382 * } 61383 * 61384 * // styled-components usage 61385 * const div = styled.div` 61386 * ${backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)')} 61387 * ` 61388 * 61389 * // CSS as JS Output 61390 * 61391 * div { 61392 * 'backgroundImage': 'url("/image/background.jpg"), linear-gradient(red, green)' 61393 * } 61394 */ 61395function backgroundImages() { 61396 for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) { 61397 properties[_key] = arguments[_key]; 61398 } 61399 return { 61400 backgroundImage: properties.join(', ') 61401 }; 61402} 61403 61404/** 61405 * Shorthand that accepts any number of background values as parameters for creating a single background statement. 61406 * @example 61407 * // Styles as object usage 61408 * const styles = { 61409 * ...backgrounds('url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat') 61410 * } 61411 * 61412 * // styled-components usage 61413 * const div = styled.div` 61414 * ${backgrounds('url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat')} 61415 * ` 61416 * 61417 * // CSS as JS Output 61418 * 61419 * div { 61420 * 'background': 'url("/image/background.jpg"), linear-gradient(red, green), center no-repeat' 61421 * } 61422 */ 61423function backgrounds() { 61424 for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) { 61425 properties[_key] = arguments[_key]; 61426 } 61427 return { 61428 background: properties.join(', ') 61429 }; 61430} 61431 61432var sideMap = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); 61433 61434/** 61435 * Shorthand for the border property that splits out individual properties for use with tools like Fela and Styletron. A side keyword can optionally be passed to target only one side's border properties. 61436 * 61437 * @example 61438 * // Styles as object usage 61439 * const styles = { 61440 * ...border('1px', 'solid', 'red') 61441 * } 61442 * 61443 * // styled-components usage 61444 * const div = styled.div` 61445 * ${border('1px', 'solid', 'red')} 61446 * ` 61447 * 61448 * // CSS as JS Output 61449 * 61450 * div { 61451 * 'borderColor': 'red', 61452 * 'borderStyle': 'solid', 61453 * 'borderWidth': `1px`, 61454 * } 61455 * 61456 * // Styles as object usage 61457 * const styles = { 61458 * ...border('top', '1px', 'solid', 'red') 61459 * } 61460 * 61461 * // styled-components usage 61462 * const div = styled.div` 61463 * ${border('top', '1px', 'solid', 'red')} 61464 * ` 61465 * 61466 * // CSS as JS Output 61467 * 61468 * div { 61469 * 'borderTopColor': 'red', 61470 * 'borderTopStyle': 'solid', 61471 * 'borderTopWidth': `1px`, 61472 * } 61473 */ 61474 61475function border(sideKeyword) { 61476 for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 61477 values[_key - 1] = arguments[_key]; 61478 } 61479 if (typeof sideKeyword === 'string' && sideMap.indexOf(sideKeyword) >= 0) { 61480 var _ref; 61481 return _ref = {}, _ref["border" + capitalizeString(sideKeyword) + "Width"] = values[0], _ref["border" + capitalizeString(sideKeyword) + "Style"] = values[1], _ref["border" + capitalizeString(sideKeyword) + "Color"] = values[2], _ref; 61482 } else { 61483 values.unshift(sideKeyword); 61484 return { 61485 borderWidth: values[0], 61486 borderStyle: values[1], 61487 borderColor: values[2] 61488 }; 61489 } 61490} 61491 61492/** 61493 * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. 61494 * @example 61495 * // Styles as object usage 61496 * const styles = { 61497 * ...borderColor('red', 'green', 'blue', 'yellow') 61498 * } 61499 * 61500 * // styled-components usage 61501 * const div = styled.div` 61502 * ${borderColor('red', 'green', 'blue', 'yellow')} 61503 * ` 61504 * 61505 * // CSS as JS Output 61506 * 61507 * div { 61508 * 'borderTopColor': 'red', 61509 * 'borderRightColor': 'green', 61510 * 'borderBottomColor': 'blue', 61511 * 'borderLeftColor': 'yellow' 61512 * } 61513 */ 61514function borderColor() { 61515 for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { 61516 values[_key] = arguments[_key]; 61517 } 61518 return directionalProperty.apply(void 0, ['borderColor'].concat(values)); 61519} 61520 61521/** 61522 * Shorthand that accepts a value for side and a value for radius and applies the radius value to both corners of the side. 61523 * @example 61524 * // Styles as object usage 61525 * const styles = { 61526 * ...borderRadius('top', '5px') 61527 * } 61528 * 61529 * // styled-components usage 61530 * const div = styled.div` 61531 * ${borderRadius('top', '5px')} 61532 * ` 61533 * 61534 * // CSS as JS Output 61535 * 61536 * div { 61537 * 'borderTopRightRadius': '5px', 61538 * 'borderTopLeftRadius': '5px', 61539 * } 61540 */ 61541function borderRadius(side, radius) { 61542 var uppercaseSide = capitalizeString(side); 61543 if (!radius && radius !== 0) { 61544 throw new PolishedError(62); 61545 } 61546 if (uppercaseSide === 'Top' || uppercaseSide === 'Bottom') { 61547 var _ref; 61548 return _ref = {}
61548, _ref["border" + uppercaseSide + "RightRadius"] = radius, _ref["border" + uppercaseSide + "LeftRadius"] = radius, _ref; 61549 } 61550 if (uppercaseSide === 'Left' || uppercaseSide === 'Right') { 61551 var _ref2; 61552 return _ref2 = {}, _ref2["borderTop" + uppercaseSide + "Radius"] = radius, _ref2["borderBottom" + uppercaseSide + "Radius"] = radius, _ref2; 61553 } 61554 throw new PolishedError(63); 61555} 61556 61557/** 61558 * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. 61559 * @example 61560 * // Styles as object usage 61561 * const styles = { 61562 * ...borderStyle('solid', 'dashed', 'dotted', 'double') 61563 * } 61564 * 61565 * // styled-components usage 61566 * const div = styled.div` 61567 * ${borderStyle('solid', 'dashed', 'dotted', 'double')} 61568 * ` 61569 * 61570 * // CSS as JS Output 61571 * 61572 * div { 61573 * 'borderTopStyle': 'solid', 61574 * 'borderRightStyle': 'dashed', 61575 * 'borderBottomStyle': 'dotted', 61576 * 'borderLeftStyle': 'double' 61577 * } 61578 */ 61579function borderStyle() { 61580 for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { 61581 values[_key] = arguments[_key]; 61582 } 61583 return directionalProperty.apply(void 0, ['borderStyle'].concat(values)); 61584} 61585 61586/** 61587 * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. 61588 * @example 61589 * // Styles as object usage 61590 * const styles = { 61591 * ...borderWidth('12px', '24px', '36px', '48px') 61592 * } 61593 * 61594 * // styled-components usage 61595 * const div = styled.div` 61596 * ${borderWidth('12px', '24px', '36px', '48px')} 61597 * ` 61598 * 61599 * // CSS as JS Output 61600 * 61601 * div { 61602 * 'borderTopWidth': '12px', 61603 * 'borderRightWidth': '24px', 61604 * 'borderBottomWidth': '36px', 61605 * 'borderLeftWidth': '48px' 61606 * } 61607 */ 61608function borderWidth() { 61609 for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { 61610 values[_key] = arguments[_key]; 61611 } 61612 return directionalProperty.apply(void 0, ['borderWidth'].concat(values)); 61613} 61614 61615function generateSelectors(template, state) { 61616 var stateSuffix = state ? ":" + state : ''; 61617 return template(stateSuffix); 61618} 61619 61620/** 61621 * Function helper that adds an array of states to a template of selectors. Used in textInputs and buttons. 61622 * @private 61623 */ 61624function statefulSelectors(states, template, stateMap) { 61625 if (!template) throw new PolishedError(67); 61626 if (states.length === 0) return generateSelectors(template, null); 61627 var selectors = []; 61628 for (var i = 0; i < states.length; i += 1) { 61629 if (stateMap && stateMap.indexOf(states[i]) < 0) { 61630 throw new PolishedError(68); 61631 } 61632 selectors.push(generateSelectors(template, states[i])); 61633 } 61634 selectors = selectors.join(','); 61635 return selectors; 61636} 61637 61638var stateMap$1 = (/* unused pure expression or super */ null && ([undefined, null, 'active', 'focus', 'hover'])); 61639function template$1(state) { 61640 return "button" + state + ",\n input[type=\"button\"]" + state + ",\n input[type=\"reset\"]" + state + ",\n input[type=\"submit\"]" + state; 61641} 61642 61643/** 61644 * Populates selectors that target all buttons. You can pass optional states to append to the selectors. 61645 * @example 61646 * // Styles as object usage 61647 * const styles = { 61648 * [buttons('active')]: { 61649 * 'border': 'none' 61650 * } 61651 * } 61652 * 61653 * // styled-components usage 61654 * const div = styled.div` 61655 * > ${buttons('active')} { 61656 * border: none; 61657 * } 61658 * ` 61659 * 61660 * // CSS in JS Output 61661 * 61662 * 'button:active, 61663 * 'input[type="button"]:active, 61664 * 'input[type=\"reset\"]:active, 61665 * 'input[type=\"submit\"]:active: { 61666 * 'border': 'none' 61667 * } 61668 */ 61669function buttons() { 61670 for (var _len = arguments.length, states = new Array(_len), _key = 0; _key < _len; _key++) { 61671 states[_key] = arguments[_key]; 61672 } 61673 return statefulSelectors(states, template$1, stateMap$1); 61674} 61675 61676/** 61677 * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. 61678 * @example 61679 * // Styles as object usage 61680 * const styles = { 61681 * ...margin('12px', '24px', '36px', '48px') 61682 * } 61683 * 61684 * // styled-components usage 61685 * const div = styled.div` 61686 * ${margin('12px', '24px', '36px', '48px')} 61687 * ` 61688 * 61689 * // CSS as JS Output 61690 * 61691 * div { 61692 * 'marginTop': '12px', 61693 * 'marginRight': '24px', 61694 * 'marginBottom': '36px', 61695 * 'marginLeft': '48px' 61696 * } 61697 */ 61698function margin() { 61699 for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { 61700 values[_key] = arguments[_key]; 61701 } 61702 return directionalProperty.apply(void 0, ['margin'].concat(values)); 61703} 61704 61705/** 61706 * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. 61707 * @example 61708 * // Styles as object usage 61709 * const styles = { 61710 * ...padding('12px', '24px', '36px', '48px') 61711 * } 61712 * 61713 * // styled-components usage 61714 * const div = styled.div` 61715 * ${padding('12px', '24px', '36px', '48px')} 61716 * ` 61717 * 61718 * // CSS as JS Output 61719 * 61720 * div { 61721 * 'paddingTop': '12px', 61722 * 'paddingRight': '24px', 61723 * 'paddingBottom': '36px', 61724 * 'paddingLeft': '48px' 61725 * } 61726 */ 61727function padding() { 61728 for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { 61729 values[_key] = arguments[_key]; 61730 } 61731 return directionalProperty.apply(void 0, ['padding'].concat(values)); 61732} 61733 61734var positionMap = (/* unused pure expression or super */ null && (['absolute', 'fixed', 'relative', 'static', 'sticky'])); 61735 61736/** 61737 * Shorthand accepts up to five values, including null to skip a value, and maps them to their respective directions. The first value can optionally be a position keyword. 61738 * @example 61739 * // Styles as object usage 61740 * const styles = { 61741 * ...position('12px', '24px', '36px', '48px') 61742 * } 61743 * 61744 * // styled-components usage 61745 * const div = styled.div` 61746 * ${position('12px', '24px', '36px', '48px')} 61747 * ` 61748 * 61749 * // CSS as JS Output 61750 * 61751 * div { 61752 * 'top': '12px', 61753 * 'right': '24px', 61754 * 'bottom': '36px', 61755 * 'left': '48px' 61756 * } 61757 * 61758 * // Styles as object usage 61759 * const styles = { 61760 * ...position('absolute', '12px', '24px', '36px', '48px') 61761 * } 61762 * 61763 * // styled-components usage 61764 * const div = styled.div` 61765 * ${position('absolute', '12px', '24px', '36px', '48px')} 61766 * ` 61767 * 61768 * // CSS as JS Output 61769 * 61770 * div { 61771 * 'position': 'absolute', 61772 * 'top': '12px', 61773 * 'right': '24px', 61774 * 'bottom': '36px', 61775 * 'left': '48px' 61776 * } 61777 */ 61778function position(firstValue) { 61779 for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 61780 values[_key - 1] = arguments[_key]; 61781 } 61782 if (positionMap.indexOf(firstValue) >= 0 && firstValue) { 61783 return _extends({}, directionalProperty.apply(void 0, [''].concat(values)), { 61784 position: firstValue 61785 }); 61786 } else {
61787 return directionalProperty.apply(void 0, ['', firstValue].concat(values)); 61788 } 61789} 61790 61791/** 61792 * Shorthand to set the height and width properties in a single statement. 61793 * @example 61794 * // Styles as object usage 61795 * const styles = { 61796 * ...size('300px', '250px') 61797 * } 61798 * 61799 * // styled-components usage 61800 * const div = styled.div` 61801 * ${size('300px', '250px')} 61802 * ` 61803 * 61804 * // CSS as JS Output 61805 * 61806 * div { 61807 * 'height': '300px', 61808 * 'width': '250px', 61809 * } 61810 */ 61811function size(height, width) { 61812 if (width === void 0) { 61813 width = height; 61814 } 61815 return { 61816 height: height, 61817 width: width 61818 }; 61819} 61820 61821var stateMap = (/* unused pure expression or super */ null && ([undefined, null, 'active', 'focus', 'hover'])); 61822function template(state) { 61823 return "input[type=\"color\"]" + state + ",\n input[type=\"date\"]" + state + ",\n input[type=\"datetime\"]" + state + ",\n input[type=\"datetime-local\"]" + state + ",\n input[type=\"email\"]" + state + ",\n input[type=\"month\"]" + state + ",\n input[type=\"number\"]" + state + ",\n input[type=\"password\"]" + state + ",\n input[type=\"search\"]" + state + ",\n input[type=\"tel\"]" + state + ",\n input[type=\"text\"]" + state + ",\n input[type=\"time\"]" + state + ",\n input[type=\"url\"]" + state + ",\n input[type=\"week\"]" + state + ",\n input:not([type])" + state + ",\n textarea" + state; 61824} 61825 61826/** 61827 * Populates selectors that target all text inputs. You can pass optional states to append to the selectors. 61828 * @example 61829 * // Styles as object usage 61830 * const styles = { 61831 * [textInputs('active')]: { 61832 * 'border': 'none' 61833 * } 61834 * } 61835 * 61836 * // styled-components usage 61837 * const div = styled.div` 61838 * > ${textInputs('active')} { 61839 * border: none; 61840 * } 61841 * ` 61842 * 61843 * // CSS in JS Output 61844 * 61845 * 'input[type="color"]:active, 61846 * input[type="date"]:active, 61847 * input[type="datetime"]:active, 61848 * input[type="datetime-local"]:active, 61849 * input[type="email"]:active, 61850 * input[type="month"]:active, 61851 * input[type="number"]:active, 61852 * input[type="password"]:active, 61853 * input[type="search"]:active, 61854 * input[type="tel"]:active, 61855 * input[type="text"]:active, 61856 * input[type="time"]:active, 61857 * input[type="url"]:active, 61858 * input[type="week"]:active, 61859 * input:not([type]):active, 61860 * textarea:active': { 61861 * 'border': 'none' 61862 * } 61863 */ 61864function textInputs() { 61865 for (var _len = arguments.length, states = new Array(_len), _key = 0; _key < _len; _key++) { 61866 states[_key] = arguments[_key]; 61867 } 61868 return statefulSelectors(states, template, stateMap); 61869} 61870 61871/** 61872 * Accepts any number of transition values as parameters for creating a single transition statement. You may also pass an array of properties as the first parameter that you would like to apply the same transition values to (second parameter). 61873 * @example 61874 * // Styles as object usage 61875 * const styles = { 61876 * ...transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s'), 61877 * ...transitions(['color', 'background-color'], '2.0s ease-in 2s') 61878 * } 61879 * 61880 * // styled-components usage 61881 * const div = styled.div` 61882 * ${transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s')}; 61883 * ${transitions(['color', 'background-color'], '2.0s ease-in 2s'),}; 61884 * ` 61885 * 61886 * // CSS as JS Output 61887 * 61888 * div { 61889 * 'transition': 'opacity 1.0s ease-in 0s, width 2.0s ease-in 2s' 61890 * 'transition': 'color 2.0s ease-in 2s, background-color 2.0s ease-in 2s', 61891 * } 61892 */ 61893function transitions() { 61894 for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) { 61895 properties[_key] = arguments[_key]; 61896 } 61897 if (Array.isArray(properties[0]) && properties.length === 2) { 61898 var value = properties[1]; 61899 if (typeof value !== 'string') { 61900 throw new PolishedError(61); 61901 } 61902 var transitionsString = properties[0].map(function (property) { 61903 return property + " " + value; 61904 }).join(', '); 61905 return { 61906 transition: transitionsString 61907 }; 61908 } else { 61909 return { 61910 transition: properties.join(', ') 61911 }; 61912 } 61913} 61914 61915 61916 61917 61918/***/ }, 61919 61920/***/ 76578 61921(module) { 61922 61923"use strict"; 61924 61925 61926/** @type {import('.')} */ 61927module.exports = [ 61928 'Float32Array', 61929 'Float64Array', 61930 'Int8Array', 61931 'Int16Array', 61932 'Int32Array', 61933 'Uint8Array', 61934 'Uint8ClampedArray', 61935 'Uint16Array', 61936 'Uint32Array', 61937 'BigInt64Array', 61938 'BigUint64Array' 61939]; 61940 61941 61942/***/ }, 61943 61944/***/ 2694 61945(module, __unused_webpack_exports, __webpack_require__) { 61946 61947"use strict"; 61948/** 61949 * Copyright (c) 2013-present, Facebook, Inc. 61950 * 61951 * This source code is licensed under the MIT license found in the 61952 * LICENSE file in the root directory of this source tree. 61953 */ 61954 61955 61956 61957var ReactPropTypesSecret = __webpack_require__(6925); 61958 61959function emptyFunction() {} 61960function emptyFunctionWithReset() {} 61961emptyFunctionWithReset.resetWarningCache = emptyFunction; 61962 61963module.exports = function() { 61964 function shim(props, propName, componentName, location, propFullName, secret) { 61965 if (secret === ReactPropTypesSecret) { 61966 // It is still safe when called from React. 61967 return; 61968 } 61969 var err = new Error( 61970 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 61971 'Use PropTypes.checkPropTypes() to call them. ' + 61972 'Read more at http://fb.me/use-check-prop-types' 61973 ); 61974 err.name = 'Invariant Violation'; 61975 throw err; 61976 }; 61977 shim.isRequired = shim; 61978 function getShim() { 61979 return shim; 61980 }; 61981 // Important! 61982 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. 61983 var ReactPropTypes = { 61984 array: shim, 61985 bigint: shim, 61986 bool: shim, 61987 func: shim, 61988 number: shim, 61989 object: shim, 61990 string: shim, 61991 symbol: shim, 61992 61993 any: shim, 61994 arrayOf: getShim, 61995 element: shim, 61996 elementType: shim, 61997 instanceOf: getShim, 61998 node: shim, 61999 objectOf: getShim, 62000 oneOf: getShim, 62001 oneOfType: getShim, 62002 shape: getShim, 62003 exact: getShim, 62004 62005 checkPropTypes: emptyFunctionWithReset, 62006 resetWarningCache: emptyFunction 62007 }; 62008 62009 ReactPropTypes.PropTypes = ReactPropTypes; 62010 62011 return ReactPropTypes; 62012}; 62013 62014 62015/***/ }, 62016 62017/***/ 5556 62018(module, __unused_webpack_exports, __webpack_require__) { 62019 62020/** 62021 * Copyright (c) 2013-present, Facebook, Inc. 62022 * 62023 * This source code is licensed under the MIT license found in the 62024 * LICENSE file in the root directory of this source tree. 62025 */ 62026 62027if (false) // removed by dead control flow 62028{ var throwOnDirectAccess, ReactIs; } else { 62029 // By explicitly using `prop-types` you are opting into new production behavior. 62030 // http://fb.me/prop-types-in-prod 62031 module.exports = __webpack_require__(2694)(); 62032} 62033 62034 62035/***/ }, 62036 62037/***/ 6925 62038(module) { 62039 62040"use strict"; 62041/** 62042 * Copyright (c) 2013-present, Facebook, Inc. 62043 * 62044 * This source code is licensed under the MIT license found in the 62045 * LICENSE file in the root directory of this source tree. 62046 */ 62047 62048 62049 62050var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; 62051 62052module.exports = ReactPropTypesSecret; 62053 62054 62055/***/ }, 62056 62057/***/ 94836 62058(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 62059 62060"use strict"; 62061 62062// EXPORTS 62063__webpack_require__.d(__webpack_exports__, { 62064 vD: () => (/* binding */ CookiesProvider), 62065 lT: () => (/* binding */ useCookies) 62066}); 62067 62068// UNUSED EXPORTS: Cookies, withCookies 62069 62070;// ./node_modules/universal-cookie/esm/index.mjs 62071var dist = {}; 62072 62073var hasRequiredDist; 62074 62075function requireDist () { 62076 if (hasRequiredDist) return dist; 62077 hasRequiredDist = 1; 62078 Object.defineProperty(dist, "__esModule", { value: true }); 62079 dist.parseCookie = parseCookie; 62080 dist.parse = parseCookie; 62081 dist.stringifyCookie = stringifyCookie; 62082 dist.stringifySetCookie = stringifySetCookie; 62083 dist.serialize = stringifySetCookie; 62084 dist.parseSetCookie = parseSetCookie; 62085 dist.stringifySetCookie = stringifySetCookie; 62086 dist.serialize = stringifySetCookie; 62087 /** 62088 * RegExp to match cookie-name in RFC 6265 sec 4.1.1 62089 * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2 62090 * which has been replaced by the token definition in RFC 7230 appendix B. 62091 * 62092 * cookie-name = token 62093 * token = 1*tchar 62094 * tchar = "!" / "#" / "$" / "%" / "&" / "'" / 62095 * "*" / "+" / "-" / "." / "^" / "_" / 62096 * "`" / "|" / "~" / DIGIT / ALPHA 62097 * 62098 * Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191 62099 * Allow same range as cookie value, except `=`, which delimits end of name. 62100 */ 62101 const cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/; 62102 /** 62103 * RegExp to match cookie-value in RFC 6265 sec 4.1.1 62104 * 62105 * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) 62106 * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E 62107 * ; US-ASCII characters excluding CTLs, 62108 * ; whitespace DQUOTE, comma, semicolon, 62109 * ; and backslash 62110 * 62111 * Allowing more characters: https://github.com/jshttp/cookie/issues/191 62112 * Comma, backslash, and DQUOTE are not part of the parsing algorithm. 62113 */ 62114 const cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/; 62115 /** 62116 * RegExp to match domain-value in RFC 6265 sec 4.1.1 62117 * 62118 * domain-value = <subdomain> 62119 * ; defined in [RFC1034], Section 3.5, as 62120 * ; enhanced by [RFC1123], Section 2.1 62121 * <subdomain> = <label> | <subdomain> "." <label> 62122 * <label> = <let-dig> [ [ <ldh-str>
62122 ] <let-dig> ] 62123 * Labels must be 63 characters or less. 62124 * 'let-dig' not 'letter' in the first char, per RFC1123 62125 * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str> 62126 * <let-dig-hyp> = <let-dig> | "-" 62127 * <let-dig> = <letter> | <digit> 62128 * <letter> = any one of the 52 alphabetic characters A through Z in 62129 * upper case and a through z in lower case 62130 * <digit> = any one of the ten digits 0 through 9 62131 * 62132 * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173 62133 * 62134 * > (Note that a leading %x2E ("."), if present, is ignored even though that 62135 * character is not permitted, but a trailing %x2E ("."), if present, will 62136 * cause the user agent to ignore the attribute.) 62137 */ 62138 const domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i; 62139 /** 62140 * RegExp to match path-value in RFC 6265 sec 4.1.1 62141 * 62142 * path-value = <any CHAR except CTLs or ";"> 62143 * CHAR = %x01-7F 62144 * ; defined in RFC 5234 appendix B.1 62145 */ 62146 const pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/; 62147 /** 62148 * RegExp to match max-age-value in RFC 6265 sec 5.6.2 62149 */ 62150 const maxAgeRegExp = /^-?\d+$/; 62151 const __toString = Object.prototype.toString; 62152 const NullObject = /* @__PURE__ */ (() => { 62153 const C = function () { }; 62154 C.prototype = Object.create(null); 62155 return C; 62156 })(); 62157 /** 62158 * Parse a `Cookie` header. 62159 * 62160 * Parse the given cookie header string into an object 62161 * The object has the various cookies as keys(names) => values 62162 */ 62163 function parseCookie(str, options) { 62164 const obj = new NullObject(); 62165 const len = str.length; 62166 // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='. 62167 if (len < 2) 62168 return obj; 62169 const dec = options?.decode || decode; 62170 let index = 0; 62171 do { 62172 const eqIdx = eqIndex(str, index, len); 62173 if (eqIdx === -1) 62174 break; // No more cookie pairs. 62175 const endIdx = endIndex(str, index, len); 62176 if (eqIdx > endIdx) { 62177 // backtrack on prior semicolon 62178 index = str.lastIndexOf(";", eqIdx - 1) + 1; 62179 continue; 62180 } 62181 const key = valueSlice(str, index, eqIdx); 62182 // only assign once 62183 if (obj[key] === undefined) { 62184 obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx)); 62185 } 62186 index = endIdx + 1; 62187 } while (index < len); 62188 return obj; 62189 } 62190 /** 62191 * Stringifies an object into an HTTP `Cookie` header. 62192 */ 62193 function stringifyCookie(cookie, options) { 62194 const enc = options?.encode || encodeURIComponent; 62195 const cookieStrings = []; 62196 for (const name of Object.keys(cookie)) { 62197 const val = cookie[name]; 62198 if (val === undefined) 62199 continue; 62200 if (!cookieNameRegExp.test(name)) { 62201 throw new TypeError(`cookie name is invalid: ${name}`); 62202 } 62203 const value = enc(val); 62204 if (!cookieValueRegExp.test(value)) { 62205 throw new TypeError(`cookie val is invalid: ${val}`); 62206 } 62207 cookieStrings.push(`${name}=${value}`); 62208 } 62209 return cookieStrings.join("; "); 62210 } 62211 function stringifySetCookie(_name, _val, _opts) { 62212 const cookie = typeof _name === "object" 62213 ? _name 62214 : { ..._opts, name: _name, value: String(_val) }; 62215 const options = typeof _val === "object" ? _val : _opts; 62216 const enc = options?.encode || encodeURIComponent; 62217 if (!cookieNameRegExp.test(cookie.name)) { 62218 throw new TypeError(`argument name is invalid: ${cookie.name}`); 62219 } 62220 const value = cookie.value ? enc(cookie.value) : ""; 62221 if (!cookieValueRegExp.test(value)) { 62222 throw new TypeError(`argument val is invalid: ${cookie.value}`); 62223 } 62224 let str = cookie.name + "=" + value; 62225 if (cookie.maxAge !== undefined) { 62226 if (!Number.isInteger(cookie.maxAge)) { 62227 throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`); 62228 } 62229 str += "; Max-Age=" + cookie.maxAge; 62230 } 62231 if (cookie.domain) { 62232 if (!domainValueRegExp.test(cookie.domain)) {
vendor: 7,364 bytes, lines 62233-62475
62233 throw new TypeError(`option domain is invalid: ${cookie.domain}`); 62234 } 62235 str += "; Domain=" + cookie.domain; 62236 } 62237 if (cookie.path) { 62238 if (!pathValueRegExp.test(cookie.path)) { 62239 throw new TypeError(`option path is invalid: ${cookie.path}`); 62240 } 62241 str += "; Path=" + cookie.path; 62242 } 62243 if (cookie.expires) { 62244 if (!isDate(cookie.expires) || !Number.isFinite(cookie.expires.valueOf())) { 62245 throw new TypeError(`option expires is invalid: ${cookie.expires}`); 62246 } 62247 str += "; Expires=" + cookie.expires.toUTCString(); 62248 } 62249 if (cookie.httpOnly) { 62250 str += "; HttpOnly"; 62251 } 62252 if (cookie.secure) { 62253 str += "; Secure"; 62254 } 62255 if (cookie.partitioned) { 62256 str += "; Partitioned"; 62257 } 62258 if (cookie.priority) { 62259 const priority = typeof cookie.priority === "string" 62260 ? cookie.priority.toLowerCase() 62261 : undefined; 62262 switch (priority) { 62263 case "low": 62264 str += "; Priority=Low"; 62265 break; 62266 case "medium": 62267 str += "; Priority=Medium"; 62268 break; 62269 case "high": 62270 str += "; Priority=High"; 62271 break; 62272 default: 62273 throw new TypeError(`option priority is invalid: ${cookie.priority}`); 62274 } 62275 } 62276 if (cookie.sameSite) { 62277 const sameSite = typeof cookie.sameSite === "string" 62278 ? cookie.sameSite.toLowerCase() 62279 : cookie.sameSite; 62280 switch (sameSite) { 62281 case true: 62282 case "strict": 62283 str += "; SameSite=Strict"; 62284 break; 62285 case "lax": 62286 str += "; SameSite=Lax"; 62287 break; 62288 case "none": 62289 str += "; SameSite=None"; 62290 break; 62291 default: 62292 throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`); 62293 } 62294 } 62295 return str; 62296 } 62297 /** 62298 * Deserialize a `Set-Cookie` header into an object. 62299 * 62300 * deserialize('foo=bar; httpOnly') 62301 * => { name: 'foo', value: 'bar', httpOnly: true } 62302 */ 62303 function parseSetCookie(str, options) { 62304 const dec = options?.decode || decode; 62305 const len = str.length; 62306 const endIdx = endIndex(str, 0, len); 62307 const eqIdx = eqIndex(str, 0, endIdx); 62308 const setCookie = eqIdx === -1 62309 ? { name: "", value: dec(valueSlice(str, 0, endIdx)) } 62310 : { 62311 name: valueSlice(str, 0, eqIdx), 62312 value: dec(valueSlice(str, eqIdx + 1, endIdx)), 62313 }; 62314 let index = endIdx + 1; 62315 while (index < len) { 62316 const endIdx = endIndex(str, index, len); 62317 const eqIdx = eqIndex(str, index, endIdx); 62318 const attr = eqIdx === -1 62319 ? valueSlice(str, index, endIdx) 62320 : valueSlice(str, index, eqIdx); 62321 const val = eqIdx === -1 ? undefined : valueSlice(str, eqIdx + 1, endIdx); 62322 switch (attr.toLowerCase()) { 62323 case "httponly": 62324 setCookie.httpOnly = true; 62325 break; 62326 case "secure": 62327 setCookie.secure = true; 62328 break; 62329 case "partitioned": 62330 setCookie.partitioned = true; 62331 break; 62332 case "domain": 62333 setCookie.domain = val; 62334 break; 62335 case "path": 62336 setCookie.path = val; 62337 break; 62338 case "max-age": 62339 if (val && maxAgeRegExp.test(val)) 62340 setCookie.maxAge = Number(val); 62341 break; 62342 case "expires": 62343 if (!val) 62344 break; 62345 const date = new Date(val); 62346 if (Number.isFinite(date.valueOf())) 62347 setCookie.expires = date; 62348 break; 62349 case "priority": 62350 if (!val) 62351 break; 62352 const priority = val.toLowerCase(); 62353 if (priority === "low" || 62354 priority === "medium" || 62355 priority === "high") { 62356 setCookie.priority = priority; 62357 } 62358 break; 62359 case "samesite": 62360 if (!val) 62361 break; 62362 const sameSite = val.toLowerCase(); 62363 if (sameSite === "lax" || 62364 sameSite === "strict" || 62365 sameSite === "none") { 62366 setCookie.sameSite = sameSite; 62367 } 62368 break; 62369 } 62370 index = endIdx + 1; 62371 } 62372 return setCookie; 62373 } 62374 /** 62375 * Find the `;` character between `min` and `len` in str. 62376 */ 62377 function endIndex(str, min, len) { 62378 const index = str.indexOf(";", min); 62379 return index === -1 ? len : index; 62380 } 62381 /** 62382 * Find the `=` character between `min` and `max` in str. 62383 */ 62384 function eqIndex(str, min, max) { 62385 const index = str.indexOf("=", min); 62386 return index < max ? index : -1; 62387 } 62388 /** 62389 * Slice out a value between startPod to max. 62390 */ 62391 function valueSlice(str, min, max) { 62392 let start = min; 62393 let end = max; 62394 do { 62395 const code = str.charCodeAt(start); 62396 if (code !== 0x20 /* */ && code !== 0x09 /* \t */) 62397 break; 62398 } while (++start < end); 62399 while (end > start) { 62400 const code = str.charCodeAt(end - 1); 62401 if (code !== 0x20 /* */ && code !== 0x09 /* \t */) 62402 break; 62403 end--; 62404 } 62405 return str.slice(start, end); 62406 } 62407 /** 62408 * URL-decode string value. Optimized to skip native call when no %. 62409 */ 62410 function decode(str) { 62411 if (str.indexOf("%") === -1) 62412 return str; 62413 try { 62414 return decodeURIComponent(str); 62415 } 62416 catch (e) { 62417 return str; 62418 } 62419 } 62420 /** 62421 * Determine if value is a Date. 62422 */ 62423 function isDate(val) { 62424 return __toString.call(val) === "[object Date]"; 62425 } 62426 62427 return dist; 62428} 62429 62430var distExports = /*@__PURE__*/ requireDist(); 62431 62432function hasDocumentCookie() { 62433 const testingValue = typeof globalThis === 'undefined' 62434 ? undefined 62435 : globalThis.TEST_HAS_DOCUMENT_COOKIE; 62436 if (typeof testingValue === 'boolean') { 62437 return testingValue; 62438 } 62439 // Can we get/set cookies on document.cookie? 62440 return typeof document === 'object' && typeof document.cookie === 'string'; 62441} 62442function parseCookies(cookies) { 62443 if (typeof cookies === 'string') { 62444 return distExports.parse(cookies); 62445 } 62446 else if (typeof cookies === 'object' && cookies !== null) { 62447 return cookies; 62448 } 62449 else { 62450 return {}; 62451 } 62452} 62453function readCookie(value, options = {}) { 62454 const cleanValue = cleanupCookieValue(value); 62455 if (!options.doNotParse) { 62456 try { 62457 return JSON.parse(cleanValue); 62458 } 62459 catch (e) { 62460 // At least we tried 62461 } 62462 } 62463 // Ignore clean value if we failed the deserialization 62464 // It is not relevant anymore to trim those values 62465 return value; 62466} 62467function cleanupCookieValue(value) { 62468 // express prepend j: before serializing a cookie 62469 if (value && value[0] === 'j' && value[1] === ':') { 62470 return value.substr(2); 62471 } 62472 return value; 62473} 62474 62475class Cookies {
62476 constructor(cookies, defaultSetOptions = {}) { 62477 this.changeListeners = []; 62478 this.HAS_DOCUMENT_COOKIE = false; 62479 this.update = () => { 62480 if (!this.HAS_DOCUMENT_COOKIE) { 62481 return; 62482 } 62483 const previousCookies = this.cookies; 62484 this.cookies = distExports.parse(document.cookie); 62485 this._checkChanges(previousCookies); 62486 }; 62487 const domCookies = typeof document === 'undefined' ? '' : document.cookie; 62488 this.cookies = parseCookies(cookies || domCookies); 62489 this.defaultSetOptions = defaultSetOptions; 62490 this.HAS_DOCUMENT_COOKIE = hasDocumentCookie(); 62491 } 62492 _emitChange(params) { 62493 for (let i = 0; i < this.changeListeners.length; ++i) { 62494 this.changeListeners[i](params); 62495 } 62496 } 62497 _checkChanges(previousCookies) { 62498 const names = new Set(Object.keys(previousCookies).concat(Object.keys(this.cookies))); 62499 names.forEach((name) => { 62500 if (previousCookies[name] !== this.cookies[name]) { 62501 this._emitChange({ 62502 name, 62503 value: readCookie(this.cookies[name]), 62504 }); 62505 } 62506 }); 62507 } 62508 _startPolling() { 62509 this.pollingInterval = setInterval(this.update, 300); 62510 } 62511 _stopPolling() { 62512 if (this.pollingInterval) { 62513 clearInterval(this.pollingInterval); 62514 } 62515 } 62516 get(name, options = {}) { 62517 if (!options.doNotUpdate) { 62518 this.update(); 62519 } 62520 return readCookie(this.cookies[name], options); 62521 } 62522 getAll(options = {}) { 62523 if (!options.doNotUpdate) { 62524 this.update(); 62525 } 62526 const result = {}; 62527 for (let name in this.cookies) { 62528 result[name] = readCookie(this.cookies[name], options); 62529 } 62530 return result; 62531 } 62532 set(name, value, options) { 62533 if (options) { 62534 options = Object.assign(Object.assign({}, this.defaultSetOptions), options); 62535 } 62536 else { 62537 options = this.defaultSetOptions; 62538 } 62539 const stringValue = typeof value === 'string' ? value : JSON.stringify(value); 62540 this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: stringValue }); 62541 if (this.HAS_DOCUMENT_COOKIE) { 62542 document.cookie = distExports.serialize(name, stringValue, options); 62543 } 62544 this._emitChange({ name, value, options }); 62545 } 62546 remove(name, options) { 62547 const finalOptions = (options = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 })); 62548 this.cookies = Object.assign({}, this.cookies); 62549 delete this.cookies[name]; 62550 if (this.HAS_DOCUMENT_COOKIE) { 62551 document.cookie = distExports.serialize(name, '', finalOptions); 62552 } 62553 this._emitChange({ name, value: undefined, options }); 62554 } 62555 addChangeListener(callback) { 62556 this.changeListeners.push(callback); 62557 if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1) { 62558 if (typeof window === 'object' && 'cookieStore' in window) { 62559 window.cookieStore.addEventListener('change', this.update); 62560 } 62561 else { 62562 this._startPolling(); 62563 } 62564 } 62565 } 62566 removeChangeListener(callback) { 62567 const idx = this.changeListeners.indexOf(callback); 62568 if (idx >= 0) { 62569 this.changeListeners.splice(idx, 1); 62570 } 62571 if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0) { 62572 if (typeof window === 'object' && 'cookieStore' in window) { 62573 window.cookieStore.removeEventListener('change', this.update); 62574 } 62575 else { 62576 this._stopPolling(); 62577 } 62578 } 62579 } 62580 removeAllChangeListeners() { 62581 while (this.changeListeners.length > 0) { 62582 this.removeChangeListener(this.changeListeners[0]); 62583 } 62584 } 62585} 62586 62587 62588 62589// EXTERNAL MODULE: ./node_modules/react/index.js 62590var react = __webpack_require__(96540); 62591;// ./node_modules/react-cookie/esm/index.mjs 62592/* unused harmony import specifier */ var React; 62593 62594 62595 62596 62597 62598const CookiesContext = react.createContext(null); 62599const { Provider, Consumer } = CookiesContext; 62600 62601const CookiesProvider = (props) => { 62602 const cookies = react.useMemo(() => { 62603 if (props.cookies) { 62604 return props.cookies; 62605 } 62606 else { 62607 return new Cookies(undefined, props.defaultSetOptions); 62608 } 62609 }, [props.cookies, props.defaultSetOptions]); 62610 return react.createElement(Provider, { value: cookies }, props.children); 62611}; 62612 62613/****************************************************************************** 62614Copyright (c) Microsoft Corporation. 62615 62616Permission to use, copy, modify, and/or distribute this software for any 62617purpose with or without fee is hereby granted. 62618 62619THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 62620REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 62621AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 62622INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 62623LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 62624OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 62625PERFORMANCE OF THIS SOFTWARE. 62626***************************************************************************** */ 62627/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 62628 62629 62630function __rest(s, e) { 62631 var t = {}; 62632 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 62633 t[p] = s[p]; 62634 if (s != null && typeof Object.getOwnPropertySymbols === "function") 62635 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 62636 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 62637 t[p[i]] = s[p[i]]; 62638 } 62639 return t; 62640} 62641 62642typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 62643 var e = new Error(message); 62644 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 62645}; 62646 62647function getDefaultExportFromCjs (x) { 62648 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; 62649} 62650 62651var reactIs = {exports: {}}; 62652 62653var reactIs_production_min = {}; 62654 62655/** @license React v16.13.1 62656 * react-is.production.min.js 62657 * 62658 * Copyright (c) Facebook, Inc. and its affiliates. 62659 * 62660 * This source code is licensed under the MIT license found in the 62661 * LICENSE file in the root directory of this source tree. 62662 */ 62663 62664var hasRequiredReactIs_production_min; 62665 62666function requireReactIs_production_min () { 62667 if (hasRequiredReactIs_production_min) return reactIs_production_min; 62668 hasRequiredReactIs_production_min = 1; 62669var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? 62670 Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; 62671 function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d; 62672 reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t}; 62673 reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p}; 62674 reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z; 62675 return reactIs_production_min; 62676} 62677 62678var reactIs_development = {}; 62679 62680/** @license React v16.13.1 62681 * react-is.development.js 62682 * 62683 * Copyright (c) Facebook, Inc. and its affiliates. 62684 * 62685 * This source code is licensed under the MIT license found in the 62686 * LICENSE file in the root directory of this source tree. 62687 */ 62688 62689var hasRequiredReactIs_development; 62690 62691function requireReactIs_development () { 62692 if (hasRequiredReactIs_development) return reactIs_development; 62693 hasRequiredReactIs_development = 1; 62694 62695 62696 62697 if (false) // removed by dead control flow 62698{} 62699 return reactIs_development; 62700} 62701 62702var hasRequiredReactIs; 62703 62704function requireReactIs () { 62705 if (hasRequiredReactIs) return reactIs.exports; 62706 hasRequiredReactIs = 1; 62707 62708 if (true) { 62709 reactIs.exports = requireReactIs_production_min(); 62710 } else // removed by dead control flow 62711{} 62712 return reactIs.exports; 62713} 62714 62715var hoistNonReactStatics_cjs; 62716var hasRequiredHoistNonReactStatics_cjs; 62717 62718function requireHoistNonReactStatics_cjs () { 62719 if (hasRequiredHoistNonReactStatics_cjs) return hoistNonReactStatics_cjs; 62720 hasRequiredHoistNonReactStatics_cjs = 1; 62721 62722 var reactIs = requireReactIs(); 62723 62724 /** 62725 * Copyright 2015, Yahoo! Inc. 62726 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. 62727 */ 62728 var REACT_STATICS = { 62729 childContextTypes: true, 62730 contextType: true, 62731 contextTypes: true, 62732 defaultProps: true, 62733 displayName: true, 62734 getDefaultProps: true, 62735 getDerivedStateFromError: true, 62736 getDerivedStateFromProps: true, 62737 mixins: true, 62738 propTypes: true, 62739 type: true 62740 }; 62741 var KNOWN_STATICS = { 62742 name: true, 62743 length: true, 62744 prototype: true, 62745 caller: true, 62746 callee: true, 62747 arguments: true, 62748 arity: true 62749 }; 62750 var FORWARD_REF_STATICS = { 62751 '$$typeof': true, 62752 render: true, 62753 defaultProps: true, 62754 displayName: true, 62755 propTypes: true 62756 }; 62757 var MEMO_STATICS = { 62758 '$$typeof': true, 62759 compare: true, 62760 defaultProps: true, 62761 displayName: true, 62762 propTypes: true, 62763 type: true 62764 }; 62765 var TYPE_STATICS = {}; 62766 TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; 62767 TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; 62768 62769 function getStatics(component) { 62770 // React v16.11 and below 62771 if (reactIs.isMemo(component)) { 62772 return MEMO_STATICS; 62773 } // React v16.12 and above 62774 62775 62776 return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; 62777 } 62778 62779 var defineProperty = Object.defineProperty; 62780 var getOwnPropertyNames = Object.getOwnPropertyNames; 62781 var getOwnPropertySymbols = Object.getOwnPropertySymbols; 62782 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 62783 var getPrototypeOf = Object.getPrototypeOf; 62784 var objectPrototype = Object.prototype; 62785 function hoistNonReactStatics(targetComponent, sourceComponent, blackl
62785ist) { 62786 if (typeof sourceComponent !== 'string') { 62787 // don't hoist over string (html) components 62788 if (objectPrototype) { 62789 var inheritedComponent = getPrototypeOf(sourceComponent); 62790 62791 if (inheritedComponent && inheritedComponent !== objectPrototype) { 62792 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); 62793 } 62794 } 62795 62796 var keys = getOwnPropertyNames(sourceComponent); 62797 62798 if (getOwnPropertySymbols) { 62799 keys = keys.concat(getOwnPropertySymbols(sourceComponent)); 62800 } 62801 62802 var targetStatics = getStatics(targetComponent); 62803 var sourceStatics = getStatics(sourceComponent); 62804 62805 for (var i = 0; i < keys.length; ++i) { 62806 var key = keys[i]; 62807 62808 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { 62809 var descriptor = getOwnPropertyDescriptor(sourceComponent, key); 62810 62811 try { 62812 // Avoid failures from read-only properties 62813 defineProperty(targetComponent, key, descriptor); 62814 } catch (e) {} 62815 } 62816 } 62817 } 62818 62819 return targetComponent; 62820 } 62821 62822 hoistNonReactStatics_cjs = hoistNonReactStatics; 62823 return hoistNonReactStatics_cjs; 62824} 62825 62826var hoistNonReactStatics_cjsExports = requireHoistNonReactStatics_cjs(); 62827var hoistStatics = /*@__PURE__*/(/* unused pure expression or super */ null && (getDefaultExportFromCjs(hoistNonReactStatics_cjsExports))); 62828 62829function withCookies(WrappedComponent) { 62830 // @ts-ignore 62831 const name = WrappedComponent.displayName || WrappedComponent.name; 62832 class CookieWrapper extends React.Component { 62833 constructor() { 62834 super(...arguments); 62835 this.onChange = () => { 62836 // Make sure to update children with new values 62837 this.forceUpdate(); 62838 }; 62839 } 62840 listen() { 62841 this.props.cookies.addChangeListener(this.onChange); 62842 } 62843 unlisten(cookies) { 62844 (cookies || this.props.cookies).removeChangeListener(this.onChange); 62845 } 62846 componentDidMount() { 62847 this.listen(); 62848 } 62849 componentDidUpdate(prevProps) { 62850 if (prevProps.cookies !== this.props.cookies) { 62851 this.unlisten(prevProps.cookies); 62852 this.listen(); 62853 } 62854 } 62855 componentWillUnmount() { 62856 this.unlisten(); 62857 } 62858 render() { 62859 const _a = this.props, { forwardedRef, cookies } = _a, restProps = __rest(_a, ["forwardedRef", "cookies"]); 62860 const allCookies = cookies.getAll({ doNotUpdate: true }); 62861 return (React.createElement(WrappedComponent, Object.assign({}, restProps, { ref: forwardedRef, cookies: cookies, allCookies: allCookies }))); 62862 } 62863 } 62864 CookieWrapper.displayName = `withCookies(${name})`; 62865 CookieWrapper.WrappedComponent = WrappedComponent; 62866 const ForwardedComponent = React.forwardRef((props, ref) => { 62867 return (React.createElement(Consumer, null, (cookies) => (React.createElement(CookieWrapper, Object.assign({ cookies: cookies }, props, { forwardedRef: ref }))))); 62868 }); 62869 ForwardedComponent.displayName = CookieWrapper.displayName; 62870 ForwardedComponent.WrappedComponent = CookieWrapper.WrappedComponent; 62871 return hoistStatics(ForwardedComponent, WrappedComponent); 62872} 62873 62874function isInBrowser() { 62875 return (typeof window !== 'undefined' && 62876 typeof window.document !== 'undefined' && 62877 typeof window.document.createElement !== 'undefined'); 62878} 62879const useIsomorphicLayoutEffect = isInBrowser() 62880 ? react.useLayoutEffect 62881 : react.useEffect; 62882 62883function useCookies(dependencies, options) { 62884 const cookies = (0,react.useContext)(CookiesContext); 62885 if (!cookies) { 62886 throw new Error('Missing <CookiesProvider>'); 62887 } 62888 const defaultOptions = { doNotUpdate: true }; 62889 const getOptions = Object.assign(Object.assign({}, defaultOptions), options); 62890 const [allCookies, setCookies] = (0,react.useState)(() => cookies.getAll(getOptions)); 62891 useIsomorphicLayoutEffect(() => { 62892 function onChange() { 62893 if (!cookies) { 62894 throw new Error('Missing <CookiesProvider>'); 62895 } 62896 const newCookies = cookies.getAll(getOptions); 62897 if (shouldUpdate(dependencies || null, newCookies, allCookies)) {
62898 setCookies(newCookies); 62899 } 62900 } 62901 cookies.addChangeListener(onChange); 62902 return () => { 62903 cookies.removeChangeListener(onChange); 62904 }; 62905 }, [cookies, allCookies]); 62906 const setCookie = (0,react.useMemo)(() => cookies.set.bind(cookies), [cookies]); 62907 const removeCookie = (0,react.useMemo)(() => cookies.remove.bind(cookies), [cookies]); 62908 const updateCookies = (0,react.useMemo)(() => cookies.update.bind(cookies), [cookies]); 62909 return [allCookies, setCookie, removeCookie, updateCookies]; 62910} 62911function shouldUpdate(dependencies, newCookies, oldCookies) { 62912 if (!dependencies) { 62913 return true; 62914 } 62915 for (let dependency of dependencies) { 62916 if (newCookies[dependency] !== oldCookies[dependency]) { 62917 return true; 62918 } 62919 } 62920 return false; 62921} 62922 62923 62924 62925 62926/***/ }, 62927 62928/***/ 22551 62929(__unused_webpack_module, exports, __webpack_require__) { 62930 62931"use strict"; 62932/** 62933 * @license React 62934 * react-dom.production.min.js 62935 * 62936 * Copyright (c) Facebook, Inc. and its affiliates. 62937 * 62938 * This source code is licensed under the MIT license found in the 62939 * LICENSE file in the root directory of this source tree. 62940 */ 62941/* 62942 Modernizr 3.0.0pre (Custom Build) | MIT 62943*/ 62944var aa=__webpack_require__(96540),ca=__webpack_require__(69982);function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var da=new Set,ea={};function fa(a,b){ha(a,b);ha(a+"Capture",b)} 62945function ha(a,b){ea[a]=b;for(a=0;a<b.length;a++)da.add(b[a])} 62946var ia=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la= 62947{},ma={};function oa(a){if(ja.call(ma,a))return!0;if(ja.call(la,a))return!1;if(ka.test(a))return ma[a]=!0;la[a]=!0;return!1}function pa(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} 62948function qa(a,b,c,d){if(null===b||"undefined"===typeof b||pa(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={}; 62949"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)}); 62950["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)}); 62951["checked","multiple","muted","selected"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});
vendor: 22,186 bytes, lines 62951-63006
62951["rowSpan","start"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()} 62952"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(ra, 62953sa);z[b]=new v(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)}); 62954z.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)}); 62955function ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2<b.length)||"o"!==b[0]&&"O"!==b[0]||"n"!==b[1]&&"N"!==b[1])qa(b,c,e,d)&&(c=null),d||null===e?oa(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c)))} 62956var ua=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va=Symbol.for("react.element"),wa=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),Ba=Symbol.for("react.provider"),Ca=Symbol.for("react.context"),Da=Symbol.for("react.forward_ref"),Ea=Symbol.for("react.suspense"),Fa=Symbol.for("react.suspense_list"),Ga=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode"); 62957var Ia=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Ja=Symbol.iterator;function Ka(a){if(null===a||"object"!==typeof a)return null;a=Ja&&a[Ja]||a["@@iterator"];return"function"===typeof a?a:null}var A=Object.assign,La;function Ma(a){if(void 0===La)try{throw Error();}catch(c){var b=c.stack.trim().match(/\n( *(at )?)/);La=b&&b[1]||""}return"\n"+La+a}var Na=!1; 62958function Oa(a,b){if(!a||Na)return"";Na=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error();},Object.defineProperty(b.prototype,"props",{set:function(){throw Error();}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(b,[])}catch(l){var d=l}Reflect.construct(a,[],b)}else{try{b.call()}catch(l){d=l}a.call(b.prototype)}else{try{throw Error();}catch(l){d=l}a()}}catch(l){if(l&&d&&"string"===typeof l.stack){for(var e=l.stack.split("\n"), 62959f=d.stack.split("\n"),g=e.length-1,h=f.length-1;1<=g&&0<=h&&e[g]!==f[h];)h--;for(;1<=g&&0<=h;g--,h--)if(e[g]!==f[h]){if(1!==g||1!==h){do if(g--,h--,0>h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?Ma(a):""} 62960function Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return""}} 62961function Qa(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||"Context")+".Consumer";case Ba:return(a._context.displayName||"Context")+".Provider";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName|| 62962b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||"Memo";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null} 62963function Ra(a){var b=a.type;switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(b);case 8:return b===za?"StrictMode":"Mode";case 22:return"Offscreen"; 62964case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Sa(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}} 62965function Ta(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)} 62966function Ua(a){var b=Ta(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker= 62967null;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Ta(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}} 62968function Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,"checked",b,!1)} 62969function bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?cb(a,b.type,c):b.hasOwnProperty("defaultValue")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)} 62970function db(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)} 62971function cb(a,b,c){if("number"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}var eb=Array.isArray; 62972function fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=""+Sa(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}} 62973function gb(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(p(91));return A({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function hb(a,b){var c=b.value;if(null==c){c=b.children;b=b.defaultValue;if(null!=c){if(null!=b)throw Error(p(92));if(eb(c)){if(1<c.length)throw Error(p(93));c=c[0]}b=c}null==b&&(b="");c=b}a._wrapperState={initialValue:Sa(c)}} 62974function ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&""!==b&&null!==b&&(a.value=b)}function kb(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}} 62975function lb(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?kb(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} 62976var mb,nb=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if("http://www.w3.org/2000/svg"!==a.namespaceURI||"innerHTML"in a)a.innerHTML=b;else{mb=mb||document.createElement("div");mb.innerHTML="<svg>"+b.valueOf().toString()+"</svg>";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}); 62977function ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b} 62978var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0, 62979zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(""+b).trim():b+"px"} 62980function sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=rb(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}); 62981function ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if("object"!==typeof b.dangerouslySetInnerHTML||!("__html"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(p(62));}} 62982function vb(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null; 62983function Bb(a){if(a=Cb(a)){if("function"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a<b.length;a++)Bb(b[a])}}function Gb(a,b){return a(b)}function Hb(){}var Ib=!1;function Jb(a,b,c){if(Ib)return a(b,c);Ib=!0;try{return Gb(a,b,c)}finally{if(Ib=!1,null!==zb||null!==Ab)Hb(),Fb()}} 62984function Kb(a,b){var c=a.stateNode;if(null===c)return null;var d=Db(c);if(null===d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&"function"!== 62985typeof c)throw Error(p(231,b,typeof c));return c}var Lb=!1;if(ia)try{var Mb={};Object.defineProperty(Mb,"passive",{get:function(){Lb=!0}});window.addEventListener("test",Mb,Mb);window.removeEventListener("test",Mb,Mb)}catch(a){Lb=!1}function Nb(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(m){this.onError(m)}}var Ob=!1,Pb=null,Qb=!1,Rb=null,Sb={onError:function(a){Ob=!0;Pb=a}};function Tb(a,b,c,d,e,f,g,h,k){Ob=!1;Pb=null;Nb.apply(Sb,arguments)} 62986function Ub(a,b,c,d,e,f,g,h,k){Tb.apply(this,arguments);if(Ob){if(Ob){var l=Pb;Ob=!1;Pb=null}else throw Error(p(198));Qb||(Qb=!0,Rb=l)}}function Vb(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.flags&4098)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function Wb(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function Xb(a){if(Vb(a)!==a)throw Error(p(188));} 62987function Yb(a){var b=a.alternate;if(!b){b=Vb(a);if(null===b)throw Error(p(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return Xb(e),a;if(f===d)return Xb(e),b;f=f.sibling}throw Error(p(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h=== 62988c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(p(189));}}if(c.alternate!==d)throw Error(p(190));}if(3!==c.tag)throw Error(p(188));return c.stateNode.current===c?a:b}function Zb(a){a=Yb(a);return null!==a?$b(a):null}function $b(a){if(5===a.tag||6===a.tag)return a;for(a=a.child;null!==a;){var b=$b(a);if(null!==b)return b;a=a.sibling}return null} 62989var ac=ca.unstable_scheduleCallback,bc=ca.unstable_cancelCallback,cc=ca.unstable_shouldYield,dc=ca.unstable_requestPaint,B=ca.unstable_now,ec=ca.unstable_getCurrentPriorityLevel,fc=ca.unstable_ImmediatePriority,gc=ca.unstable_UserBlockingPriority,hc=ca.unstable_NormalPriority,ic=ca.unstable_LowPriority,jc=ca.unstable_IdlePriority,kc=null,lc=null;function mc(a){if(lc&&"function"===typeof lc.onCommitFiberRoot)try{lc.onCommitFiberRoot(kc,a,void 0,128===(a.current.flags&128))}catch(b){}} 62990var oc=Math.clz32?Math.clz32:nc,pc=Math.log,qc=Math.LN2;function nc(a){a>>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304; 62991function tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824; 62992default:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0<b;)c=31-oc(b),e=1<<c,d|=a[c],b&=~e;return d} 62993function vc(a,b){switch(a){case 1:case 2:case 4:return b+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return b+5E3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}} 62994function wc(a,b){for(var c=a.suspendedLanes,d=a.pingedLanes,e=a.expirationTimes,f=a.pendingLanes;0<f;){var g=31-oc(f),h=1<<g,k=e[g];if(-1===k){if(0===(h&c)||0!==(h&d))e[g]=vc(h,b)}else k<=b&&(a.expiredLanes|=h);f&=~h}}function xc(a){a=a.pendingLanes&-1073741825;return 0!==a?a:a&1073741824?1073741824:0}function yc(){var a=rc;rc<<=1;0===(rc&4194240)&&(rc=64);return a}function zc(a){for(var b=[],c=0;31>c;c++)b.push(a);return b} 62995function Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0<c;){var e=31-oc(c),f=1<<e;b[e]=0;d[e]=-1;a[e]=-1;c&=~f}} 62996function Cc(a,b){var c=a.entangledLanes|=b;for(a=a.entanglements;c;){var d=31-oc(c),e=1<<d;e&b|a[d]&b&&(a[d]|=b);c&=~e}}var C=0;function Dc(a){a&=-a;return 1<a?4<a?0!==(a&268435455)?16:536870912:4:1}var Ec,Fc,Gc,Hc,Ic,Jc=!1,Kc=[],Lc=null,Mc=null,Nc=null,Oc=new Map,Pc=new Map,Qc=[],Rc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); 62997function Sc(a,b){switch(a){case "focusin":case "focusout":Lc=null;break;case "dragenter":case "dragleave":Mc=null;break;case "mouseover":case "mouseout":Nc=null;break;case "pointerover":case "pointerout":Oc.delete(b.pointerId);break;case "gotpointercapture":case "lostpointercapture":Pc.delete(b.pointerId)}} 62998function Tc(a,b,c,d,e,f){if(null===a||a.nativeEvent!==f)return a={blockedOn:b,domEventName:c,eventSystemFlags:d,nativeEvent:f,targetContainers:[e]},null!==b&&(b=Cb(b),null!==b&&Fc(b)),a;a.eventSystemFlags|=d;b=a.targetContainers;null!==e&&-1===b.indexOf(e)&&b.push(e);return a} 62999function Uc(a,b,c,d,e){switch(b){case "focusin":return Lc=Tc(Lc,a,b,c,d,e),!0;case "dragenter":return Mc=Tc(Mc,a,b,c,d,e),!0;case "mouseover":return Nc=Tc(Nc,a,b,c,d,e),!0;case "pointerover":var f=e.pointerId;Oc.set(f,Tc(Oc.get(f)||null,a,b,c,d,e));return!0;case "gotpointercapture":return f=e.pointerId,Pc.set(f,Tc(Pc.get(f)||null,a,b,c,d,e)),!0}return!1} 63000function Vc(a){var b=Wc(a.target);if(null!==b){var c=Vb(b);if(null!==c)if(b=c.tag,13===b){if(b=Wb(c),null!==b){a.blockedOn=b;Ic(a.priority,function(){Gc(c)});return}}else if(3===b&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null} 63001function Xc(a){if(null!==a.blockedOn)return!1;for(var b=a.targetContainers;0<b.length;){var c=Yc(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null===c){c=a.nativeEvent;var d=new c.constructor(c.type,c);wb=d;c.target.dispatchEvent(d);wb=null}else return b=Cb(c),null!==b&&Fc(b),a.blockedOn=c,!1;b.shift()}return!0}function Zc(a,b,c){Xc(a)&&c.delete(b)}function $c(){Jc=!1;null!==Lc&&Xc(Lc)&&(Lc=null);null!==Mc&&Xc(Mc)&&(Mc=null);null!==Nc&&Xc(Nc)&&(Nc=null);Oc.forEach(Zc);Pc.forEach(Zc)} 63002function ad(a,b){a.blockedOn===b&&(a.blockedOn=null,Jc||(Jc=!0,ca.unstable_scheduleCallback(ca.unstable_NormalPriority,$c)))} 63003function bd(a){function b(b){return ad(b,a)}if(0<Kc.length){ad(Kc[0],a);for(var c=1;c<Kc.length;c++){var d=Kc[c];d.blockedOn===a&&(d.blockedOn=null)}}null!==Lc&&ad(Lc,a);null!==Mc&&ad(Mc,a);null!==Nc&&ad(Nc,a);Oc.forEach(b);Pc.forEach(b);for(c=0;c<Qc.length;c++)d=Qc[c],d.blockedOn===a&&(d.blockedOn=null);for(;0<Qc.length&&(c=Qc[0],null===c.blockedOn);)Vc(c),null===c.blockedOn&&Qc.shift()}var cd=ua.ReactCurrentBatchConfig,dd=!0; 63004function ed(a,b,c,d){var e=C,f=cd.transition;cd.transition=null;try{C=1,fd(a,b,c,d)}finally{C=e,cd.transition=f}}function gd(a,b,c,d){var e=C,f=cd.transition;cd.transition=null;try{C=4,fd(a,b,c,d)}finally{C=e,cd.transition=f}} 63005function fd(a,b,c,d){if(dd){var e=Yc(a,b,c,d);if(null===e)hd(a,b,d,id,c),Sc(a,d);else if(Uc(e,a,b,c,d))d.stopPropagation();else if(Sc(a,d),b&4&&-1<Rc.indexOf(a)){for(;null!==e;){var f=Cb(e);null!==f&&Ec(f);f=Yc(a,b,c,d);null===f&&hd(a,b,d,id,c);if(f===e)break;e=f}null!==e&&d.stopPropagation()}else hd(a,b,d,null,c)}}var id=null; 63006function Yc(a,b,c,d){id=null;a=xb(d);a=Wc(a);if(null!==a)if(b=Vb(a),null===b)a=null;else if(c=b.tag,13===c){a=Wb(b);if(null!==a)return a;a=null}else if(3===c){if(b.stateNode.current.memoizedState.isDehydrated)return 3===b.tag?b.stateNode.containerInfo:null;a=null}else b!==a&&(a=null);id=a;return null}
63007function jd(a){switch(a){case "cancel":case "click":case "close":case "contextmenu":case "copy":case "cut":case "auxclick":case "dblclick":case "dragend":case "dragstart":case "drop":case "focusin":case "focusout":case "input":case "invalid":case "keydown":case "keypress":case "keyup":case "mousedown":case "mouseup":case "paste":case "pause":case "play":case "pointercancel":case "pointerdown":case "pointerup":case "ratechange":case "reset":case "resize":case "seeked":case "submit":case "touchcancel":case "touchend":case "touchstart":case "volumechange":case "change":case "selectionchange":case "textInput":case "compositionstart":case "compositionend":case "compositionupdate":case "beforeblur":case "afterblur":case "beforeinput":case "blur":case "fullscreenchange":case "focus":case "hashchange":case "popstate":case "select":case "selectstart":return 1;case "drag":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "mousemove":case "mouseout":case "mouseover":case "pointermove":case "pointerout":case "pointerover":case "scroll":case "toggle":case "touchmove":case "wheel":case "mouseenter":case "mouseleave":case "pointerenter":case "pointerleave":return 4; 63008case "message":switch(ec()){case fc:return 1;case gc:return 4;case hc:case ic:return 16;case jc:return 536870912;default:return 16}default:return 16}}var kd=null,ld=null,md=null;
vendor: 4,326 bytes, lines 63008-63018
63008function nd(){if(md)return md;var a,b=ld,c=b.length,d,e="value"in kd?kd.value:kd.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return md=e.slice(a,1<d?1-d:void 0)} 63009function od(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function pd(){return!0}function qd(){return!1} 63010function rd(a){function b(b,d,e,f,g){this._reactName=b;this._targetInst=e;this.type=d;this.nativeEvent=f;this.target=g;this.currentTarget=null;for(var c in a)a.hasOwnProperty(c)&&(b=a[c],this[c]=b?b(f):f[c]);this.isDefaultPrevented=(null!=f.defaultPrevented?f.defaultPrevented:!1===f.returnValue)?pd:qd;this.isPropagationStopped=qd;return this}A(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&& 63011(a.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd});return b} 63012var sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=A({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=A({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if("movementX"in 63013a)return a.movementX;a!==yd&&(yd&&"mousemove"===a.type?(wd=a.screenX-yd.screenX,xd=a.screenY-yd.screenY):xd=wd=0,yd=a);return wd},movementY:function(a){return"movementY"in a?a.movementY:xd}}),Bd=rd(Ad),Cd=A({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=A({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=A({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=A({},sd,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=A({},sd,{data:0}),Ld=rd(Kd),Md={Esc:"Escape", 63014Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7", 63015119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pd(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Od[a])?!!b[a]:!1}function zd(){return Pd} 63016var Qd=A({},ud,{key:function(a){if(a.key){var b=Md[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=od(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?Nd[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(a){return"keypress"===a.type?od(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"=== 63017a.type?od(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),Rd=rd(Qd),Sd=A({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=A({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=A({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=A({},Ad,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0}, 63018deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae=ia&&"CompositionEvent"in window,be=null;ia&&"documentMode"in document&&(be=document.documentMode);var ce=ia&&"TextEvent"in window&&!be,de=ia&&(!ae||be&&8<be&&11>
63018=be),ee=String.fromCharCode(32),fe=!1; 63019function ge(a,b){switch(a){case "keyup":return-1!==$d.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "focusout":return!0;default:return!1}}function he(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case "compositionend":return he(b);case "keypress":if(32!==b.which)return null;fe=!0;return ee;case "textInput":return a=b.data,a===ee&&fe?null:a;default:return null}} 63020function ke(a,b){if(ie)return"compositionend"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case "compositionend":return de&&"ko"!==b.locale?null:b.data;default:return null}} 63021var le={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!le[a.type]:"textarea"===b?!0:!1}function ne(a,b,c,d){Eb(d);b=oe(b,"onChange");0<b.length&&(c=new td("onChange","change",null,c,d),a.push({event:c,listeners:b}))}var pe=null,qe=null;function re(a){se(a,0)}function te(a){var b=ue(a);if(Wa(b))return a} 63022function ve(a,b){if("change"===a)return b}var we=!1;if(ia){var xe;if(ia){var ye="oninput"in document;if(!ye){var ze=document.createElement("div");ze.setAttribute("oninput","return;");ye="function"===typeof ze.oninput}xe=ye}else xe=!1;we=xe&&(!document.documentMode||9<document.documentMode)}function Ae(){pe&&(pe.detachEvent("onpropertychange",Be),qe=pe=null)}function Be(a){if("value"===a.propertyName&&te(qe)){var b=[];ne(b,qe,a,xb(a));Jb(re,b)}} 63023function Ce(a,b,c){"focusin"===a?(Ae(),pe=b,qe=c,pe.attachEvent("onpropertychange",Be)):"focusout"===a&&Ae()}function De(a){if("selectionchange"===a||"keyup"===a||"keydown"===a)return te(qe)}function Ee(a,b){if("click"===a)return te(b)}function Fe(a,b){if("input"===a||"change"===a)return te(b)}function Ge(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var He="function"===typeof Object.is?Object.is:Ge; 63024function Ie(a,b){if(He(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var e=c[d];if(!ja.call(b,e)||!He(a[e],b[e]))return!1}return!0}function Je(a){for(;a&&a.firstChild;)a=a.firstChild;return a} 63025function Ke(a,b){var c=Je(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1} 63026function Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)} 63027function Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c, 63028d);
vendor: 90,805 bytes, lines 63028-63239
63028e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c<b.length;c++)a=b[c],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}} 63029var Pe=ia&&"documentMode"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1; 63030function Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,"selectionStart"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,"onSelect"),0<d.length&&(b=new td("onSelect","select",null,b,c),a.push({event:b,listeners:d}),b.target=Qe)))} 63031function Ve(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var We={animationend:Ve("Animation","AnimationEnd"),animationiteration:Ve("Animation","AnimationIteration"),animationstart:Ve("Animation","AnimationStart"),transitionend:Ve("Transition","TransitionEnd")},Xe={},Ye={}; 63032ia&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete We.animationend.animation,delete We.animationiteration.animation,delete We.animationstart.animation),"TransitionEvent"in window||delete We.transitionend.transition);function Ze(a){if(Xe[a])return Xe[a];if(!We[a])return a;var b=We[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Ye)return Xe[a]=b[c];return a}var $e=Ze("animationend"),af=Ze("animationiteration"),bf=Ze("animationstart"),cf=Ze("transitionend"),df=new Map,ef="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); 63033function ff(a,b){df.set(a,b);fa(b,[a])}for(var gf=0;gf<ef.length;gf++){var hf=ef[gf],jf=hf.toLowerCase(),kf=hf[0].toUpperCase()+hf.slice(1);ff(jf,"on"+kf)}ff($e,"onAnimationEnd");ff(af,"onAnimationIteration");ff(bf,"onAnimationStart");ff("dblclick","onDoubleClick");ff("focusin","onFocus");ff("focusout","onBlur");ff(cf,"onTransitionEnd");ha("onMouseEnter",["mouseout","mouseover"]);ha("onMouseLeave",["mouseout","mouseover"]);ha("onPointerEnter",["pointerout","pointerover"]); 63034ha("onPointerLeave",["pointerout","pointerover"]);fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")); 63035fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mf=new Set("cancel close invalid load scroll toggle".split(" ").concat(lf)); 63036function nf(a,b,c){var d=a.type||"unknown-event";a.currentTarget=c;Ub(d,b,void 0,a);a.currentTarget=null} 63037function se(a,b){b=0!==(b&4);for(var c=0;c<a.length;c++){var d=a[c],e=d.event;d=d.listeners;a:{var f=void 0;if(b)for(var g=d.length-1;0<=g;g--){var h=d[g],k=h.instance,l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;nf(e,h,l);f=k}else for(g=0;g<d.length;g++){h=d[g];k=h.instance;l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;nf(e,h,l);f=k}}}if(Qb)throw a=Rb,Qb=!1,Rb=null,a;} 63038function D(a,b){var c=b[of];void 0===c&&(c=b[of]=new Set);var d=a+"__bubble";c.has(d)||(pf(b,a,2,!1),c.add(d))}function qf(a,b,c){var d=0;b&&(d|=4);pf(c,a,d,b)}var rf="_reactListening"+Math.random().toString(36).slice(2);function sf(a){if(!a[rf]){a[rf]=!0;da.forEach(function(b){"selectionchange"!==b&&(mf.has(b)||qf(b,!1,a),qf(b,!0,a))});var b=9===a.nodeType?a:a.ownerDocument;null===b||b[rf]||(b[rf]=!0,qf("selectionchange",!1,b))}} 63039function pf(a,b,c,d){switch(jd(b)){case 1:var e=ed;break;case 4:e=gd;break;default:e=fd}c=e.bind(null,b,c,a);e=void 0;!Lb||"touchstart"!==b&&"touchmove"!==b&&"wheel"!==b||(e=!0);d?void 0!==e?a.addEventListener(b,c,{capture:!0,passive:e}):a.addEventListener(b,c,!0):void 0!==e?a.addEventListener(b,c,{passive:e}):a.addEventListener(b,c,!1)} 63040function hd(a,b,c,d,e){var f=d;if(0===(b&1)&&0===(b&2)&&null!==d)a:for(;;){if(null===d)return;var g=d.tag;if(3===g||4===g){var h=d.stateNode.containerInfo;if(h===e||8===h.nodeType&&h.parentNode===e)break;if(4===g)for(g=d.return;null!==g;){var k=g.tag;if(3===k||4===k)if(k=g.stateNode.containerInfo,k===e||8===k.nodeType&&k.parentNode===e)return;g=g.return}for(;null!==h;){g=Wc(h);if(null===g)return;k=g.tag;if(5===k||6===k){d=f=g;continue a}h=h.parentNode}}d=d.return}Jb(function(){var d=f,e=xb(c),g=[]; 63041a:{var h=df.get(a);if(void 0!==h){var k=td,n=a;switch(a){case "keypress":if(0===od(c))break a;case "keydown":case "keyup":k=Rd;break;case "focusin":n="focus";k=Fd;break;case "focusout":n="blur";k=Fd;break;case "beforeblur":case "afterblur":k=Fd;break;case "click":if(2===c.button)break a;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":k=Bd;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":k= 63042Dd;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":k=Vd;break;case $e:case af:case bf:k=Hd;break;case cf:k=Xd;break;case "scroll":k=vd;break;case "wheel":k=Zd;break;case "copy":case "cut":case "paste":k=Jd;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":k=Td}var t=0!==(b&4),J=!t&&"scroll"===a,x=t?null!==h?h+"Capture":null:h;t=[];for(var w=d,u;null!== 63043w;){u=w;var F=u.stateNode;5===u.tag&&null!==F&&(u=F,null!==x&&(F=Kb(w,x),null!=F&&t.push(tf(w,F,u))));if(J)break;w=w.return}0<t.length&&(h=new k(h,n,null,c,e),g.push({event:h,listeners:t}))}}if(0===(b&7)){a:{h="mouseover"===a||"pointerover"===a;k="mouseout"===a||"pointerout"===a;if(h&&c!==wb&&(n=c.relatedTarget||c.fromElement)&&(Wc(n)||n[uf]))break a;if(k||h){h=e.window===e?e:(h=e.ownerDocument)?h.defaultView||h.parentWindow:window;if(k){if(n=c.relatedTarget||c.toElement,k=d,n=n?Wc(n):null,null!== 63044n&&(J=Vb(n),n!==J||5!==n.tag&&6!==n.tag))n=null}else k=null,n=d;if(k!==n){t=Bd;F="onMouseLeave";x="onMouseEnter";w="mouse";if("pointerout"===a||"pointerover"===a)t=Td,F="onPointerLeave",x="onPointerEnter",w="pointer";J=null==k?h:ue(k);u=null==n?h:ue(n);h=new t(F,w+"leave",k,c,e);h.target=J;h.relatedTarget=u;F=null;Wc(e)===d&&(t=new t(x,w+"enter",n,c,e),t.target=u,t.relatedTarget=J,F=t);J=F;if(k&&n)b:{t=k;x=n;w=0;for(u=t;u;u=vf(u))w++;u=0;for(F=x;F;F=vf(F))u++;for(;0<w-u;)t=vf(t),w--;for(;0<u-w;)x= 63045vf(x),u--;for(;w--;){if(t===x||null!==x&&t===x.alternate)break b;t=vf(t);x=vf(x)}t=null}else t=null;null!==k&&wf(g,h,k,t,!1);null!==n&&null!==J&&wf(g,J,n,t,!0)}}}a:{h=d?ue(d):window;k=h.nodeName&&h.nodeName.toLowerCase();if("select"===k||"input"===k&&"file"===h.type)var na=ve;else if(me(h))if(we)na=Fe;else{na=De;var xa=Ce}else(k=h.nodeName)&&"input"===k.toLowerCase()&&("checkbox"===h.type||"radio"===h.type)&&(na=Ee);if(na&&(na=na(a,d))){ne(g,na,c,e);break a}xa&&xa(a,h,d);"focusout"===a&&(xa=h._wrapperState)&& 63046xa.controlled&&"number"===h.type&&cb(h,"number",h.value)}xa=d?ue(d):window;switch(a){case "focusin":if(me(xa)||"true"===xa.contentEditable)Qe=xa,Re=d,Se=null;break;case "focusout":Se=Re=Qe=null;break;case "mousedown":Te=!0;break;case "contextmenu":case "mouseup":case "dragend":Te=!1;Ue(g,c,e);break;case "selectionchange":if(Pe)break;case "keydown":case "keyup":Ue(g,c,e)}var $a;if(ae)b:{switch(a){case "compositionstart":var ba="onCompositionStart";break b;case "compositionend":ba="onCompositionEnd"; 63047break b;case "compositionupdate":ba="onCompositionUpdate";break b}ba=void 0}else ie?ge(a,c)&&(ba="onCompositionEnd"):"keydown"===a&&229===c.keyCode&&(ba="onCompositionStart");ba&&(de&&"ko"!==c.locale&&(ie||"onCompositionStart"!==ba?"onCompositionEnd"===ba&&ie&&($a=nd()):(kd=e,ld="value"in kd?kd.value:kd.textContent,ie=!0)),xa=oe(d,ba),0<xa.length&&(ba=new Ld(ba,a,null,c,e),g.push({event:ba,listeners:xa}),$a?ba.data=$a:($a=he(c),null!==$a&&(ba.data=$a))));if($a=ce?je(a,c):ke(a,c))d=oe(d,"onBeforeInput"), 630480<d.length&&(e=new Ld("onBeforeInput","beforeinput",null,c,e),g.push({event:e,listeners:d}),e.data=$a)}se(g,b)})}function tf(a,b,c){return{instance:a,listener:b,currentTarget:c}}function oe(a,b){for(var c=b+"Capture",d=[];null!==a;){var e=a,f=e.stateNode;5===e.tag&&null!==f&&(e=f,f=Kb(a,c),null!=f&&d.unshift(tf(a,f,e)),f=Kb(a,b),null!=f&&d.push(tf(a,f,e)));a=a.return}return d}function vf(a){if(null===a)return null;do a=a.return;while(a&&5!==a.tag);return a?a:null} 63049function wf(a,b,c,d,e){for(var f=b._reactName,g=[];null!==c&&c!==d;){var h=c,k=h.alternate,l=h.stateNode;if(null!==k&&k===d)break;5===h.tag&&null!==l&&(h=l,e?(k=Kb(c,f),null!=k&&g.unshift(tf(c,k,h))):e||(k=Kb(c,f),null!=k&&g.push(tf(c,k,h))));c=c.return}0!==g.length&&a.push({event:b,listeners:g})}var xf=/\r\n?/g,yf=/\u0000|\uFFFD/g;function zf(a){return("string"===typeof a?a:""+a).replace(xf,"\n").replace(yf,"")}function Af(a,b,c){b=zf(b);if(zf(a)!==b&&c)throw Error(p(425));}function Bf(){} 63050var Cf=null,Df=null;function Ef(a,b){return"textarea"===a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html} 63051var Ff="function"===typeof setTimeout?setTimeout:void 0,Gf="function"===typeof clearTimeout?clearTimeout:void 0,Hf="function"===typeof Promise?Promise:void 0,Jf="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof Hf?function(a){return Hf.resolve(null).then(a).catch(If)}:Ff;function If(a){setTimeout(function(){throw a;})} 63052function Kf(a,b){var c=b,d=0;do{var e=c.nextSibling;a.removeChild(c);if(e&&8===e.nodeType)if(c=e.data,"/$"===c){if(0===d){a.removeChild(e);bd(b);return}d--}else"$"!==c&&"$?"!==c&&"$!"!==c||d++;c=e}while(c);bd(b)}function Lf(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break;if(8===b){b=a.data;if("$"===b||"$!"===b||"$?"===b)break;if("/$"===b)return null}}return a} 63053function Mf(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if("$"===c||"$!"===c||"$?"===c){if(0===b)return a;b--}else"/$"===c&&b++}a=a.previousSibling}return null}var Nf=Math.random().toString(36).slice(2),Of="__reactFiber$"+Nf,Pf="__reactProps$"+Nf,uf="__reactContainer$"+Nf,of="__reactEvents$"+Nf,Qf="__reactListeners$"+Nf,Rf="__reactHandles$"+Nf; 63054function Wc(a){var b=a[Of];if(b)return b;for(var c=a.parentNode;c;){if(b=c[uf]||c[Of]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=Mf(a);null!==a;){if(c=a[Of])return c;a=Mf(a)}return b}a=c;c=a.parentNode}return null}function Cb(a){a=a[Of]||a[uf];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function ue(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(p(33));}function Db(a){return a[Pf]||null}var Sf=[],Tf=-1;function Uf(a){return{current:a}} 63055function E(a){0>Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e} 63056function Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||"Unknown",e));return A({},c,d)} 63057function cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)} 63058function jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a<c.length;a++){var d=c[a];do d=d(!0);while(null!==d)}eg=null;fg=!1}catch(e){throw null!==eg&&(eg=eg.slice(a+1)),ac(fc,jg),e;}finally{C=b,gg=!1}}return null}var kg=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(a,b){kg[lg++]=ng;kg[lg++]=mg;mg=a;ng=b} 63059function ug(a,b,c){og[pg++]=rg;og[pg++]=sg;og[pg++]=qg;qg=a;var d=rg;a=sg;var e=32-oc(d)-1;d&=~(1<<e);c+=1;var f=32-oc(b)+e;if(30<f){var g=e-e%5;f=(d&(1<<g)-1).toString(32);d>>=g;e-=g;rg=1<<32-oc(b)+e|c<<e|d;sg=f+a}else rg=1<<f|c<<e|d,sg=a}function vg(a){null!==a.return&&(tg(a,1),ug(a,1,0))}function wg(a){for(;a===mg;)mg=kg[--lg],kg[lg]=null,ng=kg[--lg],kg[lg]=null;for(;a===qg;)qg=og[--pg],og[pg]=null,sg=og[--pg],og[pg]=null,rg=og[--pg],og[pg]=null}var xg=null,yg=null,I=!1,zg=null; 63060function Ag(a,b){var c=Bg(5,null,null,0);c.elementType="DELETED";c.stateNode=b;c.return=a;b=a.deletions;null===b?(a.deletions=[c],a.flags|=16):b.push(c)} 63061function Cg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,xg=a,yg=Lf(b.firstChild),!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,xg=a,yg=null,!0):!1;case 13:return b=8!==b.nodeType?null:b,null!==b?(c=null!==qg?{id:rg,overflow:sg}:null,a.memoizedState={dehydrated:b,treeContext:c,retryLane:1073741824},c=Bg(18,null,null,0),c.stateNode=b,c.return=a,a.child=c,xg=a,yg= 63062null,!0):!1;default:return!1}}function Dg(a){return 0!==(a.mode&1)&&0===(a.flags&128)}function Eg(a){if(I){var b=yg;if(b){var c=b;if(!Cg(a,b)){if(Dg(a))throw Error(p(418));b=Lf(c.nextSibling);var d=xg;b&&Cg(a,b)?Ag(d,c):(a.flags=a.flags&-4097|2,I=!1,xg=a)}}else{if(Dg(a))throw Error(p(418));a.flags=a.flags&-4097|2;I=!1;xg=a}}}function Fg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;xg=a} 63063function Gg(a){if(a!==xg)return!1;if(!I)return Fg(a),I=!0,!1;var b;(b=3!==a.tag)&&!(b=5!==a.tag)&&(b=a.type,b="head"!==b&&"body"!==b&&!Ef(a.type,a.memoizedProps));if(b&&(b=yg)){if(Dg(a))throw Hg(),Error(p(418));for(;b;)Ag(a,b),b=Lf(b.nextSibling)}Fg(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(p(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if("/$"===c){if(0===b){yg=Lf(a.nextSibling);break a}b--}else"$"!==c&&"$!"!==c&&"$?"!==c||b++}a=a.nextSibling}yg= 63064null}}else yg=xg?Lf(a.stateNode.nextSibling):null;return!0}function Hg(){for(var a=yg;a;)a=Lf(a.nextSibling)}function Ig(){yg=xg=null;I=!1}function Jg(a){null===zg?zg=[a]:zg.push(a)}var Kg=ua.ReactCurrentBatchConfig; 63065function Lg(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!==c.tag)throw Error(p(309));var d=c.stateNode}if(!d)throw Error(p(147,a));var e=d,f=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===f)return b.ref;b=function(a){var b=e.refs;null===a?delete b[f]:b[f]=a};b._stringRef=f;return b}if("string"!==typeof a)throw Error(p(284));if(!c._owner)throw Error(p(290,a));}return a} 63066function Mg(a,b){a=Object.prototype.toString.call(b);throw Error(p(31,"[object Object]"===a?"object with keys {"+Object.keys(b).join(", ")+"}":a));}function Ng(a){var b=a._init;return b(a._payload)} 63067function Og(a){function b(b,c){if(a){var d=b.deletions;null===d?(b.deletions=[c],b.flags|=16):d.push(c)}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b){a=Pg(a,b);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return b.flags|=1048576,c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.flags|=2,c):d;b.flags|=2;return c}function g(b){a&& 63068null===b.alternate&&(b.flags|=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=Qg(c,a.mode,d),b.return=a,b;b=e(b,c);b.return=a;return b}function k(a,b,c,d){var f=c.type;if(f===ya)return m(a,b,c.props.children,d,c.key);if(null!==b&&(b.elementType===f||"object"===typeof f&&null!==f&&f.$$typeof===Ha&&Ng(f)===b.type))return d=e(b,c.props),d.ref=Lg(a,b,c),d.return=a,d;d=Rg(c.type,c.key,c.props,null,a.mode,d);d.ref=Lg(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag|| 63069b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return b=Sg(c,a.mode,d),b.return=a,b;b=e(b,c.children||[]);b.return=a;return b}function m(a,b,c,d,f){if(null===b||7!==b.tag)return b=Tg(c,a.mode,d,f),b.return=a,b;b=e(b,c);b.return=a;return b}function q(a,b,c){if("string"===typeof b&&""!==b||"number"===typeof b)return b=Qg(""+b,a.mode,c),b.return=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case va:return c=Rg(b.type,b.key,b.props,null,a.mode,c), 63070c.ref=Lg(a,null,b),c.return=a,c;case wa:return b=Sg(b,a.mode,c),b.return=a,b;case Ha:var d=b._init;return q(a,d(b._payload),c)}if(eb(b)||Ka(b))return b=Tg(b,a.mode,c,null),b.return=a,b;Mg(a,b)}return null}function r(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c&&""!==c||"number"===typeof c)return null!==e?null:h(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case va:return c.key===e?k(a,b,c,d):null;case wa:return c.key===e?l(a,b,c,d):null;case Ha:return e=c._init,r(a, 63071b,e(c._payload),d)}if(eb(c)||Ka(c))return null!==e?null:m(a,b,c,d,null);Mg(a,c)}return null}function y(a,b,c,d,e){if("string"===typeof d&&""!==d||"number"===typeof d)return a=a.get(c)||null,h(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case va:return a=a.get(null===d.key?c:d.key)||null,k(b,a,d,e);case wa:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e);case Ha:var f=d._init;return y(a,b,c,f(d._payload),e)}if(eb(d)||Ka(d))return a=a.get(c)||null,m(b,a,d,e,null);Mg(b,d)}return null} 63072function n(e,g,h,k){for(var l=null,m=null,u=g,w=g=0,x=null;null!==u&&w<h.length;w++){u.index>w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;w<h.length;w++)u=q(e,h[w],k),null!==u&&(g=f(u,g,w),null===m?l=u:m.sibling=u,m=u);I&&tg(e,w);return l}for(u=d(e,u);w<h.length;w++)x=y(u,e,w,h[w],k),null!==x&&(a&&null!==x.alternate&&u.delete(null=== 63073x.key?w:x.key),g=f(x,g,w),null===m?l=x:m.sibling=x,m=x);a&&u.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function t(e,g,h,k){var l=Ka(h);if("function"!==typeof l)throw Error(p(150));h=l.call(h);if(null==h)throw Error(p(151));for(var u=l=null,m=g,w=g=0,x=null,n=h.next();null!==m&&!n.done;w++,n=h.next()){m.index>w?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e, 63074m),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){"object"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k= 63075f.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ha&&Ng(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=Lg(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Tg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Rg(f.type,f.key,f.props,null,a.mode,h),h.ref=Lg(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!== 63076d;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Sg(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);Mg(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d): 63077(c(a,d),d=Qg(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(a){var b=Wg.current;E(Wg);a._currentValue=b}function bh(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}} 63078function ch(a,b){Xg=a;Zg=Yg=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(dh=!0),a.firstContext=null)}function eh(a){var b=a._currentValue;if(Zg!==a)if(a={context:a,memoizedValue:b,next:null},null===Yg){if(null===Xg)throw Error(p(308));Yg=a;Xg.dependencies={lanes:0,firstContext:a}}else Yg=Yg.next=a;return b}var fh=null;function gh(a){null===fh?fh=[a]:fh.push(a)} 63079function hh(a,b,c,d){var e=b.interleaved;null===e?(c.next=c,gh(b)):(c.next=e.next,e.next=c);b.interleaved=c;return ih(a,d)}function ih(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}var jh=!1;function kh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}} 63080function lh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function mh(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}} 63081function nh(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(K&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return ih(a,c)}e=d.interleaved;null===e?(b.next=b,gh(d)):(b.next=e.next,e.next=b);d.interleaved=b;return ih(a,c)}function oh(a,b,c){b=b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}} 63082function ph(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next= 63083b;c.lastBaseUpdate=b} 63084function qh(a,b,c,d){var e=a.updateQueue;jh=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var m=a.alternate;null!==m&&(m=m.updateQueue,h=m.lastBaseUpdate,h!==g&&(null===h?m.firstBaseUpdate=l:h.next=l,m.lastBaseUpdate=k))}if(null!==f){var q=e.baseState;g=0;m=l=k=null;h=f;do{var r=h.lane,y=h.eventTime;if((d&r)===r){null!==m&&(m=m.next={eventTime:y,lane:0,tag:h.tag,payload:h.payload,callback:h.callback, 63085next:null});a:{var n=a,t=h;r=b;y=c;switch(t.tag){case 1:n=t.payload;if("function"===typeof n){q=n.call(y,q,r);break a}q=n;break a;case 3:n.flags=n.flags&-65537|128;case 0:n=t.payload;r="function"===typeof n?n.call(y,q,r):n;if(null===r||void 0===r)break a;q=A({},q,r);break a;case 2:jh=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,r=e.effects,null===r?e.effects=[h]:r.push(h))}else y={eventTime:y,lane:r,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===m?(l=m=y,k=q):m=m.next=y,g|=r; 63086h=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else r=h,h=r.next,r.next=null,e.lastBaseUpdate=r,e.shared.pending=null}while(1);null===m&&(k=q);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=m;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);rh|=g;a.lanes=g;a.memoizedState=q}} 63087function sh(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;b<a.length;b++){var d=a[b],e=d.callback;if(null!==e){d.callback=null;d=c;if("function"!==typeof e)throw Error(p(191,e));e.call(d)}}}var th={},uh=Uf(th),vh=Uf(th),wh=Uf(th);function xh(a){if(a===th)throw Error(p(174));return a} 63088function yh(a,b){G(wh,b);G(vh,a);G(uh,th);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(uh);G(uh,b)}function zh(){E(uh);E(vh);E(wh)}function Ah(a){xh(wh.current);var b=xh(uh.current);var c=lb(b,a.type);b!==c&&(G(vh,a),G(uh,c))}function Bh(a){vh.current===a&&(E(uh),E(vh))}var L=Uf(0); 63089function Ch(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Dh=[]; 63090function Eh(){for(var a=0;a<Dh.length;a++)Dh[a]._workInProgressVersionPrimary=null;Dh.length=0}var Fh=ua.ReactCurrentDispatcher,Gh=ua.ReactCurrentBatchConfig,Hh=0,M=null,N=null,O=null,Ih=!1,Jh=!1,Kh=0,Lh=0;function P(){throw Error(p(321));}function Mh(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!He(a[c],b[c]))return!1;return!0} 63091function Nh(a,b,c,d,e,f){Hh=f;M=b;b.memoizedState=null;b.updateQueue=null;b.lanes=0;Fh.current=null===a||null===a.memoizedState?Oh:Ph;a=c(d,e);if(Jh){f=0;do{Jh=!1;Kh=0;if(25<=f)throw Error(p(301));f+=1;O=N=null;b.updateQueue=null;Fh.current=Qh;a=c(d,e)}while(Jh)}Fh.current=Rh;b=null!==N&&null!==N.next;Hh=0;O=N=M=null;Ih=!1;if(b)throw Error(p(300));return a}function Sh(){var a=0!==Kh;Kh=0;return a} 63092function Th(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===O?M.memoizedState=O=a:O=O.next=a;return O}function Uh(){if(null===N){var a=M.alternate;a=null!==a?a.memoizedState:null}else a=N.next;var b=null===O?M.memoizedState:O.next;if(null!==b)O=b,N=a;else{if(null===a)throw Error(p(310));N=a;a={memoizedState:N.memoizedState,baseState:N.baseState,baseQueue:N.baseQueue,queue:N.queue,next:null};null===O?M.memoizedState=O=a:O=O.next=a}return O} 63093function Vh(a,b){return"function"===typeof b?b(a):b} 63094function Wh(a){var b=Uh(),c=b.queue;if(null===c)throw Error(p(311));c.lastRenderedReducer=a;var d=N,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){f=e.next;d=d.baseState;var h=g=null,k=null,l=f;do{var m=l.lane;if((Hh&m)===m)null!==k&&(k=k.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),d=l.hasEagerState?l.eagerState:a(d,l.action);else{var q={lane:m,action:l.action,hasEagerState:l.hasEagerState, 63095eagerState:l.eagerState,next:null};null===k?(h=k=q,g=d):k=k.next=q;M.lanes|=m;rh|=m}l=l.next}while(null!==l&&l!==f);null===k?g=d:k.next=h;He(d,b.memoizedState)||(dh=!0);b.memoizedState=d;b.baseState=g;b.baseQueue=k;c.lastRenderedState=d}a=c.interleaved;if(null!==a){e=a;do f=e.lane,M.lanes|=f,rh|=f,e=e.next;while(e!==a)}else null===e&&(c.lanes=0);return[b.memoizedState,c.dispatch]} 63096function Xh(a){var b=Uh(),c=b.queue;if(null===c)throw Error(p(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(dh=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}function Yh(){} 63097function Zh(a,b){var c=M,d=Uh(),e=b(),f=!He(d.memoizedState,e);f&&(d.memoizedState=e,dh=!0);d=d.queue;$h(ai.bind(null,c,d,a),[a]);if(d.getSnapshot!==b||f||null!==O&&O.memoizedState.tag&1){c.flags|=2048;bi(9,ci.bind(null,c,d,e,b),void 0,null);if(null===Q)throw Error(p(349));0!==(Hh&30)||di(c,b,e)}return e}function di(a,b,c){a.flags|=16384;a={getSnapshot:b,value:c};b=M.updateQueue;null===b?(b={lastEffect:null,stores:null},M.updateQueue=b,b.stores=[a]):(c=b.stores,null===c?b.stores=[a]:c.push(a))} 63098function ci(a,b,c,d){b.value=c;b.getSnapshot=d;ei(b)&&fi(a)}function ai(a,b,c){return c(function(){ei(b)&&fi(a)})}function ei(a){var b=a.getSnapshot;a=a.value;try{var c=b();return!He(a,c)}catch(d){return!0}}function fi(a){var b=ih(a,1);null!==b&&gi(b,a,1,-1)} 63099function hi(a){var b=Th();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vh,lastRenderedState:a};b.queue=a;a=a.dispatch=ii.bind(null,M,a);return[b.memoizedState,a]} 63100function bi(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=M.updateQueue;null===b?(b={lastEffect:null,stores:null},M.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}function ji(){return Uh().memoizedState}function ki(a,b,c,d){var e=Th();M.flags|=a;e.memoizedState=bi(1|b,c,void 0,void 0===d?null:d)} 63101function li(a,b,c,d){var e=Uh();d=void 0===d?null:d;var f=void 0;if(null!==N){var g=N.memoizedState;f=g.destroy;if(null!==d&&Mh(d,g.deps)){e.memoizedState=bi(b,c,f,d);return}}M.flags|=a;e.memoizedState=bi(1|b,c,f,d)}function mi(a,b){return ki(8390656,8,a,b)}function $h(a,b){return li(2048,8,a,b)}function ni(a,b){return li(4,2,a,b)}function oi(a,b){return li(4,4,a,b)} 63102function pi(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function qi(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return li(4,4,pi.bind(null,b,a),c)}function ri(){}function si(a,b){var c=Uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Mh(b,d[1]))return d[0];c.memoizedState=[a,b];return a} 63103function ti(a,b){var c=Uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Mh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}function ui(a,b,c){if(0===(Hh&21))return a.baseState&&(a.baseState=!1,dh=!0),a.memoizedState=c;He(c,b)||(c=yc(),M.lanes|=c,rh|=c,a.baseState=!0);return b}function vi(a,b){var c=C;C=0!==c&&4>c?c:4;a(!0);var d=Gh.transition;Gh.transition={};try{a(!1),b()}finally{C=c,Gh.transition=d}}function wi(){return Uh().memoizedState} 63104function xi(a,b,c){var d=yi(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,c);else if(c=hh(a,b,c,d),null!==c){var e=R();gi(c,a,d,e);Bi(c,b,d)}} 63105function ii(a,b,c){var d=yi(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,gh(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=hh(a,b,e,d);null!==c&&(e=R(),gi(c,a,d,e),Bi(c,b,d))}} 63106function zi(a){var b=a.alternate;return a===M||null!==b&&b===M}function Ai(a,b){Jh=Ih=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Bi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}} 63107var Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(a,b){Th().memoizedState=[a,void 0===b?null:b];return a},useContext:eh,useEffect:mi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ki(4194308, 631084,pi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ki(4194308,4,a,b)},useInsertionEffect:function(a,b){return ki(4,2,a,b)},useMemo:function(a,b){var c=Th();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Th();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=xi.bind(null,M,a);return[d.memoizedState,a]},useRef:function(a){var b= 63109Th();a={current:a};return b.memoizedState=a},useState:hi,useDebugValue:ri,useDeferredValue:function(a){return Th().memoizedState=a},useTransition:function(){var a=hi(!1),b=a[0];a=vi.bind(null,a[1]);Th().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=M,e=Th();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===Q)throw Error(p(349));0!==(Hh&30)||di(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;mi(ai.bind(null,d, 63110f,a),[a]);d.flags|=2048;bi(9,ci.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Th(),b=Q.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=":"+b+"R"+c;c=Kh++;0<c&&(b+="H"+c.toString(32));b+=":"}else c=Lh++,b=":"+b+"r"+c.toString(32)+":";return a.memoizedState=b},unstable_isNewReconciler:!1},Ph={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Wh,useRef:ji,useState:function(){return Wh(Vh)}, 63111useDebugValue:ri,useDeferredValue:function(a){var b=Uh();return ui(b,N.memoizedState,a)},useTransition:function(){var a=Wh(Vh)[0],b=Uh().memoizedState;return[a,b]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1},Qh={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Xh,useRef:ji,useState:function(){return Xh(Vh)},useDebugValue:ri,useDeferredValue:function(a){var b=Uh();return null=== 63112N?b.memoizedState=a:ui(b,N.memoizedState,a)},useTransition:function(){var a=Xh(Vh)[0],b=Uh().memoizedState;return[a,b]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1};function Ci(a,b){if(a&&a.defaultProps){b=A({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}function Di(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:A({},b,c);a.memoizedState=c;0===a.lanes&&(a.updateQueue.baseState=c)} 63113var Ei={isMounted:function(a){return(a=a._reactInternals)?Vb(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternals;var d=R(),e=yi(a),f=mh(d,e);f.payload=b;void 0!==c&&null!==c&&(f.callback=c);b=nh(a,f,e);null!==b&&(gi(b,a,e,d),oh(b,a,e))},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=R(),e=yi(a),f=mh(d,e);f.tag=1;f.payload=b;void 0!==c&&null!==c&&(f.callback=c);b=nh(a,f,e);null!==b&&(gi(b,a,e,d),oh(b,a,e))},enqueueForceUpdate:function(a,b){a=a._reactInternals;var c=R(),d= 63114yi(a),e=mh(c,d);e.tag=2;void 0!==b&&null!==b&&(e.callback=b);b=nh(a,e,d);null!==b&&(gi(b,a,d,c),oh(b,a,d))}};function Fi(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!Ie(c,d)||!Ie(e,f):!0} 63115function Gi(a,b,c){var d=!1,e=Vf;var f=b.contextType;"object"===typeof f&&null!==f?f=eh(f):(e=Zf(b)?Xf:H.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Yf(a,e):Vf);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Ei;a.stateNode=b;b._reactInternals=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b} 63116function Hi(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Ei.enqueueReplaceState(b,b.state,null)} 63117function Ii(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs={};kh(a);var f=b.contextType;"object"===typeof f&&null!==f?e.context=eh(f):(f=Zf(b)?Xf:H.current,e.context=Yf(a,f));e.state=a.memoizedState;f=b.getDerivedStateFromProps;"function"===typeof f&&(Di(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&"function"!==typeof e.componentWillMount||(b=e.state, 63118"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Ei.enqueueReplaceState(e,e.state,null),qh(a,c,e,d),e.state=a.memoizedState);"function"===typeof e.componentDidMount&&(a.flags|=4194308)}function Ji(a,b){try{var c="",d=b;do c+=Pa(d),d=d.return;while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+"\n"+f.stack}return{value:a,source:b,stack:e,digest:null}} 63119function Ki(a,b,c){return{value:a,source:null,stack:null!=c?c:null,digest:null!=b?b:null}}function Li(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}var Mi="function"===typeof WeakMap?WeakMap:Map;function Ni(a,b,c){c=mh(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Oi||(Oi=!0,Pi=d);Li(a,b)};return c} 63120function Qi(a,b,c){c=mh(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)};c.callback=function(){Li(a,b)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){Li(a,b);"function"!==typeof d&&(null===Ri?Ri=new Set([this]):Ri.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c} 63121function Si(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new Mi;var e=new Set;d.set(b,e)}else e=d.get(b),void 0===e&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=Ti.bind(null,a,b,c),b.then(a,a))}function Ui(a){do{var b;if(b=13===a.tag)b=a.memoizedState,b=null!==b?null!==b.dehydrated?!0:!1:!0;if(b)return a;a=a.return}while(null!==a);return null} 63122function Vi(a,b,c,d,e){if(0===(a.mode&1))return a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:(b=mh(-1,1),b.tag=2,nh(c,b,1))),c.lanes|=1),a;a.flags|=65536;a.lanes=e;return a}var Wi=ua.ReactCurrentOwner,dh=!1;function Xi(a,b,c,d){b.child=null===a?Vg(b,null,c,d):Ug(b,a.child,c,d)} 63123function Yi(a,b,c,d,e){c=c.render;var f=b.ref;ch(b,e);d=Nh(a,b,c,d,f,e);c=Sh();if(null!==a&&!dh)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Zi(a,b,e);I&&c&&vg(b);b.flags|=1;Xi(a,b,d,e);return b.child} 63124function $i(a,b,c,d,e){if(null===a){var f=c.type;if("function"===typeof f&&!aj(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,bj(a,b,f,d,e);a=Rg(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:Ie;if(c(g,d)&&a.ref===b.ref)return Zi(a,b,e)}b.flags|=1;a=Pg(f,d);a.ref=b.ref;a.return=b;return b.child=a} 63125function bj(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(Ie(f,d)&&a.ref===b.ref)if(dh=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(dh=!0);else return b.lanes=a.lanes,Zi(a,b,e)}return cj(a,b,c,d,e)} 63126function dj(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(ej,fj),fj|=c;else{if(0===(c&1073741824))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,G(ej,fj),fj|=a,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null};d=null!==f?f.baseLanes:c;G(ej,fj);fj|=d}else null!== 63127f?(d=f.baseLanes|c,b.memoizedState=null):d=c,G(ej,fj),fj|=d;Xi(a,b,e,c);return b.child}function gj(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function cj(a,b,c,d,e){var f=Zf(c)?Xf:H.current;f=Yf(b,f);ch(b,e);c=Nh(a,b,c,d,f,e);d=Sh();if(null!==a&&!dh)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Zi(a,b,e);I&&d&&vg(b);b.flags|=1;Xi(a,b,c,e);return b.child} 63128function hj(a,b,c,d,e){if(Zf(c)){var f=!0;cg(b)}else f=!1;ch(b,e);if(null===b.stateNode)ij(a,b),Gi(b,c,d),Ii(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"===typeof l&&null!==l?l=eh(l):(l=Zf(c)?Xf:H.current,l=Yf(b,l));var m=c.getDerivedStateFromProps,q="function"===typeof m||"function"===typeof g.getSnapshotBeforeUpdate;q||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps|| 63129(h!==d||k!==l)&&Hi(b,g,d,l);jh=!1;var r=b.memoizedState;g.state=r;qh(b,d,g,e);k=b.memoizedState;h!==d||r!==k||Wf.current||jh?("function"===typeof m&&(Di(b,c,m,d),k=b.memoizedState),(h=jh||Fi(b,c,h,d,r,k,l))?(q||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount||("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4194308)): 63130("function"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;lh(a,b);h=b.memoizedProps;l=b.type===b.elementType?h:Ci(b.type,h);g.props=l;q=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=eh(k):(k=Zf(c)?Xf:H.current,k=Yf(b,k));var y=c.getDerivedStateFromProps;(m="function"===typeof y||"function"===typeof g.getSnapshotBeforeUpdate)|| 63131"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==q||r!==k)&&Hi(b,g,d,k);jh=!1;r=b.memoizedState;g.state=r;qh(b,d,g,e);var n=b.memoizedState;h!==q||r!==n||Wf.current||jh?("function"===typeof y&&(Di(b,c,y,d),n=b.memoizedState),(l=jh||Fi(b,c,l,d,r,n,k)||!1)?(m||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,n,k),"function"===typeof g.UNSAFE_componentWillUpdate&& 63132g.UNSAFE_componentWillUpdate(d,n,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=n),g.props=d,g.state=n,g.context=k,d=l):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r=== 63133a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return jj(a,b,c,d,f,e)} 63134function jj(a,b,c,d,e,f){gj(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&dg(b,c,!1),Zi(a,b,f);d=b.stateNode;Wi.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Ug(b,a.child,null,f),b.child=Ug(b,null,h,f)):Xi(a,b,h,f);b.memoizedState=d.state;e&&dg(b,c,!0);return b.child}function kj(a){var b=a.stateNode;b.pendingContext?ag(a,b.pendingContext,b.pendingContext!==b.context):b.context&&ag(a,b.context,!1);yh(a,b.containerInfo)} 63135function lj(a,b,c,d,e){Ig();Jg(e);b.flags|=256;Xi(a,b,c,d);return b.child}var mj={dehydrated:null,treeContext:null,retryLane:0};function nj(a){return{baseLanes:a,cachePool:null,transitions:null}} 63136function oj(a,b,c){var d=b.pendingProps,e=L.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;G(L,e&1);if(null===a){Eg(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:"$!"===a.data?b.lanes=8:b.lanes=1073741824,null;g=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,g={mode:"hidden",children:g},0===(d&1)&&null!==f?(f.childLanes=0,f.pendingProps= 63137g):f=pj(g,d,0,null),a=Tg(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=nj(c),b.memoizedState=mj,a):qj(b,g)}e=a.memoizedState;if(null!==e&&(h=e.dehydrated,null!==h))return rj(a,b,g,d,h,e,c);if(f){f=d.fallback;g=b.mode;e=a.child;h=e.sibling;var k={mode:"hidden",children:d.children};0===(g&1)&&b.child!==e?(d=b.child,d.childLanes=0,d.pendingProps=k,b.deletions=null):(d=Pg(e,k),d.subtreeFlags=e.subtreeFlags&14680064);null!==h?f=Pg(h,f):(f=Tg(f,g,c,null),f.flags|=2);f.return= 63138b;d.return=b;d.sibling=f;b.child=d;d=f;f=b.child;g=a.child.memoizedState;g=null===g?nj(c):{baseLanes:g.baseLanes|c,cachePool:null,transitions:g.transitions};f.memoizedState=g;f.childLanes=a.childLanes&~c;b.memoizedState=mj;return d}f=a.child;a=f.sibling;d=Pg(f,{mode:"visible",children:d.children});0===(b.mode&1)&&(d.lanes=c);d.return=b;d.sibling=null;null!==a&&(c=b.deletions,null===c?(b.deletions=[a],b.flags|=16):c.push(a));b.child=d;b.memoizedState=null;return d} 63139function qj(a,b){b=pj({mode:"visible",children:b},a.mode,0,null);b.return=a;return a.child=b}function sj(a,b,c,d){null!==d&&Jg(d);Ug(b,a.child,null,c);a=qj(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a} 63140function rj(a,b,c,d,e,f,g){if(c){if(b.flags&256)return b.flags&=-257,d=Ki(Error(p(422))),sj(a,b,g,d);if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=pj({mode:"visible",children:d.children},e,0,null);f=Tg(f,e,g,null);f.flags|=2;d.return=b;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&Ug(b,a.child,null,g);b.child.memoizedState=nj(g);b.memoizedState=mj;return f}if(0===(b.mode&1))return sj(a,b,g,null);if("$!"===e.data){d=e.nextSibling&&e.nextSibling.dataset; 63141if(d)var h=d.dgst;d=h;f=Error(p(419));d=Ki(f,d,void 0);return sj(a,b,g,d)}h=0!==(g&a.childLanes);if(dh||h){d=Q;if(null!==d){switch(g&-g){case 4:e=2;break;case 16:e=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:e=32;break;case 536870912:e=268435456;break;default:e=0}e=0!==(e&(d.suspendedLanes|g))?0:e; 631420!==e&&e!==f.retryLane&&(f.retryLane=e,ih(a,e),gi(d,a,e,-1))}tj();d=Ki(Error(p(421)));return sj(a,b,g,d)}if("$?"===e.data)return b.flags|=128,b.child=a.child,b=uj.bind(null,a),e._reactRetry=b,null;a=f.treeContext;yg=Lf(e.nextSibling);xg=b;I=!0;zg=null;null!==a&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=a.id,sg=a.overflow,qg=b);b=qj(b,d.children);b.flags|=4096;return b}function vj(a,b,c){a.lanes|=b;var d=a.alternate;null!==d&&(d.lanes|=b);bh(a.return,b,c)} 63143function wj(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)} 63144function xj(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;Xi(a,b,d.children,c);d=L.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&vj(a,c,b);else if(19===a.tag)vj(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}G(L,d);if(0===(b.mode&1))b.memoizedState= 63145null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===Ch(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);wj(b,!1,e,c,f);break;case "backwards":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===Ch(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}wj(b,!0,c,null,f);break;case "together":wj(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child} 63146function ij(a,b){0===(b.mode&1)&&null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2)}function Zi(a,b,c){null!==a&&(b.dependencies=a.dependencies);rh|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(p(153));if(null!==b.child){a=b.child;c=Pg(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=Pg(a,a.pendingProps),c.return=b;c.sibling=null}return b.child} 63147function yj(a,b,c){switch(b.tag){case 3:kj(b);Ig();break;case 5:Ah(b);break;case 1:Zf(b.type)&&cg(b);break;case 4:yh(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;G(Wg,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return G(L,L.current&1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return oj(a,b,c);G(L,L.current&1);a=Zi(a,b,c);return null!==a?a.sibling:null}G(L,L.current&1);break;case 19:d=0!==(c& 63148b.childLanes);if(0!==(a.flags&128)){if(d)return xj(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);G(L,L.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,dj(a,b,c)}return Zi(a,b,c)}var zj,Aj,Bj,Cj; 63149zj=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};Aj=function(){}; 63150Bj=function(a,b,c,d){var e=a.memoizedProps;if(e!==d){a=b.stateNode;xh(uh.current);var f=null;switch(c){case "input":e=Ya(a,e);d=Ya(a,d);f=[];break;case "select":e=A({},e,{value:void 0});d=A({},d,{value:void 0});f=[];break;case "textarea":e=gb(a,e);d=gb(a,d);f=[];break;default:"function"!==typeof e.onClick&&"function"===typeof d.onClick&&(a.onclick=Bf)}ub(c,d);var g;c=null;for(l in e)if(!d.hasOwnProperty(l)&&e.hasOwnProperty(l)&&null!=e[l])if("style"===l){var h=e[l];for(g in h)h.hasOwnProperty(g)&& 63151(c||(c={}),c[g]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(ea.hasOwnProperty(l)?f||(f=[]):(f=f||[]).push(l,null));for(l in d){var k=d[l];h=null!=e?e[l]:void 0;if(d.hasOwnProperty(l)&&k!==h&&(null!=k||null!=h))if("style"===l)if(h){for(g in h)!h.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(c||(c={}),c[g]="");for(g in k)k.hasOwnProperty(g)&&h[g]!==k[g]&&(c||(c={}),c[g]=k[g])}else c||(f||(f=[]),f.push(l, 63152c)),c=k;else"dangerouslySetInnerHTML"===l?(k=k?k.__html:void 0,h=h?h.__html:void 0,null!=k&&h!==k&&(f=f||[]).push(l,k)):"children"===l?"string"!==typeof k&&"number"!==typeof k||(f=f||[]).push(l,""+k):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(ea.hasOwnProperty(l)?(null!=k&&"onScroll"===l&&D("scroll",a),f||h===k||(f=[])):(f=f||[]).push(l,k))}c&&(f=f||[]).push("style",c);var l=f;if(b.updateQueue=l)b.flags|=4}};Cj=function(a,b,c,d){c!==d&&(b.flags|=4)}; 63153function Dj(a,b){if(!I)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}} 63154function S(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags&14680064,d|=e.flags&14680064,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;a.subtreeFlags|=d;a.childLanes=c;return b} 63155function Ej(a,b,c){var d=b.pendingProps;wg(b);switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S(b),null;case 1:return Zf(b.type)&&$f(),S(b),null;case 3:d=b.stateNode;zh();E(Wf);E(H);Eh();d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)Gg(b)?b.flags|=4:null===a||a.memoizedState.isDehydrated&&0===(b.flags&256)||(b.flags|=1024,null!==zg&&(Fj(zg),zg=null));Aj(a,b);S(b);return null;case 5:Bh(b);var e=xh(wh.current); 63156c=b.type;if(null!==a&&null!=b.stateNode)Bj(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(p(166));S(b);return null}a=xh(uh.current);if(Gg(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Of]=b;d[Pf]=f;a=0!==(b.mode&1);switch(c){case "dialog":D("cancel",d);D("close",d);break;case "iframe":case "object":case "embed":D("load",d);break;case "video":case "audio":for(e=0;e<lf.length;e++)D(lf[e],d);break;case "source":D("error",d);break;case "img":case "image":case "link":D("error", 63157d);D("load",d);break;case "details":D("toggle",d);break;case "input":Za(d,f);D("invalid",d);break;case "select":d._wrapperState={wasMultiple:!!f.multiple};D("invalid",d);break;case "textarea":hb(d,f),D("invalid",d)}ub(c,f);e=null;for(var g in f)if(f.hasOwnProperty(g)){var h=f[g];"children"===g?"string"===typeof h?d.textContent!==h&&(!0!==f.suppressHydrationWarning&&Af(d.textContent,h,a),e=["children",h]):"number"===typeof h&&d.textContent!==""+h&&(!0!==f.suppressHydrationWarning&&Af(d.textContent, 63158h,a),e=["children",""+h]):ea.hasOwnProperty(g)&&null!=h&&"onScroll"===g&&D("scroll",d)}switch(c){case "input":Va(d);db(d,f,!0);break;case "textarea":Va(d);jb(d);break;case "select":case "option":break;default:"function"===typeof f.onClick&&(d.onclick=Bf)}d=e;b.updateQueue=d;null!==d&&(b.flags|=4)}else{g=9===e.nodeType?e:e.ownerDocument;"http://www.w3.org/1999/xhtml"===a&&(a=kb(c));"http://www.w3.org/1999/xhtml"===a?"script"===c?(a=g.createElement("div"),a.innerHTML="<script>\x3c/script>",a=a.removeChild(a.firstChild)): 63159"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;zj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case "dialog":D("cancel",a);D("close",a);e=d;break;case "iframe":case "object":case "embed":D("load",a);e=d;break;case "video":case "audio":for(e=0;e<lf.length;e++)D(lf[e],a);e=d;break;case "source":D("error",a);e=d;break;case "img":case "image":case "link":D("error", 63160a);D("load",a);e=d;break;case "details":D("toggle",a);e=d;break;case "input":Za(a,d);e=Ya(a,d);D("invalid",a);break;case "option":e=d;break;case "select":a._wrapperState={wasMultiple:!!d.multiple};e=A({},d,{value:void 0});D("invalid",a);break;case "textarea":hb(a,d);e=gb(a,d);D("invalid",a);break;default:e=d}ub(c,e);h=e;for(f in h)if(h.hasOwnProperty(f)){var k=h[f];"style"===f?sb(a,k):"dangerouslySetInnerHTML"===f?(k=k?k.__html:void 0,null!=k&&nb(a,k)):"children"===f?"string"===typeof k?("textarea"!== 63161c||""!==k)&&ob(a,k):"number"===typeof k&&ob(a,""+k):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(ea.hasOwnProperty(f)?null!=k&&"onScroll"===f&&D("scroll",a):null!=k&&ta(a,f,k,g))}switch(c){case "input":Va(a);db(a,d,!1);break;case "textarea":Va(a);jb(a);break;case "option":null!=d.value&&a.setAttribute("value",""+Sa(d.value));break;case "select":a.multiple=!!d.multiple;f=d.value;null!=f?fb(a,!!d.multiple,f,!1):null!=d.defaultValue&&fb(a,!!d.multiple,d.defaultValue, 63162!0);break;default:"function"===typeof e.onClick&&(a.onclick=Bf)}switch(c){case "button":case "input":case "select":case "textarea":d=!!d.autoFocus;break a;case "img":d=!0;break a;default:d=!1}}d&&(b.flags|=4)}null!==b.ref&&(b.flags|=512,b.flags|=2097152)}S(b);return null;case 6:if(a&&null!=b.stateNode)Cj(a,b,a.memoizedProps,d);else{if("string"!==typeof d&&null===b.stateNode)throw Error(p(166));c=xh(wh.current);xh(uh.current);if(Gg(b)){d=b.stateNode;c=b.memoizedProps;d[Of]=b;if(f=d.nodeValue!==c)if(a= 63163xg,null!==a)switch(a.tag){case 3:Af(d.nodeValue,c,0!==(a.mode&1));break;case 5:!0!==a.memoizedProps.suppressHydrationWarning&&Af(d.nodeValue,c,0!==(a.mode&1))}f&&(b.flags|=4)}else d=(9===c.nodeType?c:c.ownerDocument).createTextNode(d),d[Of]=b,b.stateNode=d}S(b);return null;case 13:E(L);d=b.memoizedState;if(null===a||null!==a.memoizedState&&null!==a.memoizedState.dehydrated){if(I&&null!==yg&&0!==(b.mode&1)&&0===(b.flags&128))Hg(),Ig(),b.flags|=98560,f=!1;else if(f=Gg(b),null!==d&&null!==d.dehydrated){if(null=== 63164a){if(!f)throw Error(p(318));f=b.memoizedState;f=null!==f?f.dehydrated:null;if(!f)throw Error(p(317));f[Of]=b}else Ig(),0===(b.flags&128)&&(b.memoizedState=null),b.flags|=4;S(b);f=!1}else null!==zg&&(Fj(zg),zg=null),f=!0;if(!f)return b.flags&65536?b:null}if(0!==(b.flags&128))return b.lanes=c,b;d=null!==d;d!==(null!==a&&null!==a.memoizedState)&&d&&(b.child.flags|=8192,0!==(b.mode&1)&&(null===a||0!==(L.current&1)?0===T&&(T=3):tj()));null!==b.updateQueue&&(b.flags|=4);S(b);return null;case 4:return zh(), 63165Aj(a,b),null===a&&sf(b.stateNode.containerInfo),S(b),null;case 10:return ah(b.type._context),S(b),null;case 17:return Zf(b.type)&&$f(),S(b),null;case 19:E(L);f=b.memoizedState;if(null===f)return S(b),null;d=0!==(b.flags&128);g=f.rendering;if(null===g)if(d)Dj(f,!1);else{if(0!==T||null!==a&&0!==(a.flags&128))for(a=b.child;null!==a;){g=Ch(a);if(null!==g){b.flags|=128;Dj(f,!1);d=g.updateQueue;null!==d&&(b.updateQueue=d,b.flags|=4);b.subtreeFlags=0;d=c;for(c=b.child;null!==c;)f=c,a=d,f.flags&=14680066, 63166g=f.alternate,null===g?(f.childLanes=0,f.lanes=a,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=g.childLanes,f.lanes=g.lanes,f.child=g.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=g.memoizedProps,f.memoizedState=g.memoizedState,f.updateQueue=g.updateQueue,f.type=g.type,a=g.dependencies,f.dependencies=null===a?null:{lanes:a.lanes,firstContext:a.firstContext}),c=c.sibling;G(L,L.current&1|2);return b.child}a= 63167a.sibling}null!==f.tail&&B()>Gj&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304)}else{if(!d)if(a=Ch(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dj(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Gj&&1073741824!==c&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering= 63168b,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=L.current,G(L,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Hj(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(fj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));} 63169function Ij(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return zh(),E(Wf),E(H),Eh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Bh(b),null;case 13:E(L);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(b.type._context),null;case 22:case 23:return Hj(), 63170null;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj="function"===typeof WeakSet?WeakSet:Set,V=null;function Lj(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Mj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Nj=!1; 63171function Oj(a,b){Cf=dd;a=Me();if(Ne(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+= 63172q.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break; 63173case 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Ci(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent="":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Nj;Nj=!1;return n} 63174function Pj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Mj(b,c,f)}e=e.next}while(e!==d)}}function Qj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Rj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}} 63175function Sj(a){var b=a.alternate;null!==b&&(a.alternate=null,Sj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Tj(a){return 5===a.tag||3===a.tag||4===a.tag} 63176function Uj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Tj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}} 63177function Vj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Vj(a,b,c),a=a.sibling;null!==a;)Vj(a,b,c),a=a.sibling} 63178function Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}var X=null,Xj=!1;function Yj(a,b,c){for(c=c.child;null!==c;)Zj(a,b,c),c=c.sibling} 63179function Zj(a,b,c){if(lc&&"function"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Lj(c,b);case 6:var d=X,e=Xj;X=null;Yj(a,b,c);X=d;Xj=e;null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Xj;X=c.stateNode.containerInfo;Xj=!0; 63180Yj(a,b,c);X=d;Xj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Mj(c,b,g):0!==(f&4)&&Mj(c,b,g));e=e.next}while(e!==d)}Yj(a,b,c);break;case 1:if(!U&&(Lj(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Yj(a,b,c);break;case 21:Yj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!== 63181c.memoizedState,Yj(a,b,c),U=d):Yj(a,b,c);break;default:Yj(a,b,c)}}function ak(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Kj);b.forEach(function(b){var d=bk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}} 63182function ck(a,b){var c=b.deletions;if(null!==c)for(var d=0;d<c.length;d++){var e=c[d];try{var f=a,g=b,h=g;a:for(;null!==h;){switch(h.tag){case 5:X=h.stateNode;Xj=!1;break a;case 3:X=h.stateNode.containerInfo;Xj=!0;break a;case 4:X=h.stateNode.containerInfo;Xj=!0;break a}h=h.return}if(null===X)throw Error(p(160));Zj(f,g,e);X=null;Xj=!1;var k=e.alternate;null!==k&&(k.return=null);e.return=null}catch(l){W(e,b,l)}}if(b.subtreeFlags&12854)for(b=b.child;null!==b;)dk(b,a),b=b.sibling} 63183function dk(a,b){var c=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:ck(b,a);ek(a);if(d&4){try{Pj(3,a,a.return),Qj(3,a)}catch(t){W(a,a.return,t)}try{Pj(5,a,a.return)}catch(t){W(a,a.return,t)}}break;case 1:ck(b,a);ek(a);d&512&&null!==c&&Lj(c,c.return);break;case 5:ck(b,a);ek(a);d&512&&null!==c&&Lj(c,c.return);if(a.flags&32){var e=a.stateNode;try{ob(e,"")}catch(t){W(a,a.return,t)}}if(d&4&&(e=a.stateNode,null!=e)){var f=a.memoizedProps,g=null!==c?c.memoizedProps:f,h=a.type,k=a.updateQueue; 63184a.updateQueue=null;if(null!==k)try{"input"===h&&"radio"===f.type&&null!=f.name&&ab(e,f);vb(h,g);var l=vb(h,f);for(g=0;g<k.length;g+=2){var m=k[g],q=k[g+1];"style"===m?sb(e,q):"dangerouslySetInnerHTML"===m?nb(e,q):"children"===m?ob(e,q):ta(e,m,q,l)}switch(h){case "input":bb(e,f);break;case "textarea":ib(e,f);break;case "select":var r=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=!!f.multiple;var y=f.value;null!=y?fb(e,!!f.multiple,y,!1):r!==!!f.multiple&&(null!=f.defaultValue?fb(e,!!f.multiple, 63185f.defaultValue,!0):fb(e,!!f.multiple,f.multiple?[]:"",!1))}e[Pf]=f}catch(t){W(a,a.return,t)}}break;case 6:ck(b,a);ek(a);if(d&4){if(null===a.stateNode)throw Error(p(162));e=a.stateNode;f=a.memoizedProps;try{e.nodeValue=f}catch(t){W(a,a.return,t)}}break;case 3:ck(b,a);ek(a);if(d&4&&null!==c&&c.memoizedState.isDehydrated)try{bd(b.containerInfo)}catch(t){W(a,a.return,t)}break;case 4:ck(b,a);ek(a);break;case 13:ck(b,a);ek(a);e=a.child;e.flags&8192&&(f=null!==e.memoizedState,e.stateNode.isHidden=f,!f|| 63186null!==e.alternate&&null!==e.alternate.memoizedState||(fk=B()));d&4&&ak(a);break;case 22:m=null!==c&&null!==c.memoizedState;a.mode&1?(U=(l=U)||m,ck(b,a),U=l):ck(b,a);ek(a);if(d&8192){l=null!==a.memoizedState;if((a.stateNode.isHidden=l)&&!m&&0!==(a.mode&1))for(V=a,m=a.child;null!==m;){for(q=V=m;null!==V;){r=V;y=r.child;switch(r.tag){case 0:case 11:case 14:case 15:Pj(4,r,r.return);break;case 1:Lj(r,r.return);var n=r.stateNode;if("function"===typeof n.componentWillUnmount){d=r;c=r.return;try{b=d,n.props= 63187b.memoizedProps,n.state=b.memoizedState,n.componentWillUnmount()}catch(t){W(d,c,t)}}break;case 5:Lj(r,r.return);break;case 22:if(null!==r.memoizedState){gk(q);continue}}null!==y?(y.return=r,V=y):gk(q)}m=m.sibling}a:for(m=null,q=a;;){if(5===q.tag){if(null===m){m=q;try{e=q.stateNode,l?(f=e.style,"function"===typeof f.setProperty?f.setProperty("display","none","important"):f.display="none"):(h=q.stateNode,k=q.memoizedProps.style,g=void 0!==k&&null!==k&&k.hasOwnProperty("display")?k.display:null,h.style.display= 63188rb("display",g))}catch(t){W(a,a.return,t)}}}else if(6===q.tag){if(null===m)try{q.stateNode.nodeValue=l?"":q.memoizedProps}catch(t){W(a,a.return,t)}}else if((22!==q.tag&&23!==q.tag||null===q.memoizedState||q===a)&&null!==q.child){q.child.return=q;q=q.child;continue}if(q===a)break a;for(;null===q.sibling;){if(null===q.return||q.return===a)break a;m===q&&(m=null);q=q.return}m===q&&(m=null);q.sibling.return=q.return;q=q.sibling}}break;case 19:ck(b,a);ek(a);d&4&&ak(a);break;case 21:break;default:ck(b, 63189a),ek(a)}}function ek(a){var b=a.flags;if(b&2){try{a:{for(var c=a.return;null!==c;){if(Tj(c)){var d=c;break a}c=c.return}throw Error(p(160));}switch(d.tag){case 5:var e=d.stateNode;d.flags&32&&(ob(e,""),d.flags&=-33);var f=Uj(a);Wj(a,f,e);break;case 3:case 4:var g=d.stateNode.containerInfo,h=Uj(a);Vj(a,h,g);break;default:throw Error(p(161));}}catch(k){W(a,a.return,k)}a.flags&=-3}b&4096&&(a.flags&=-4097)}function hk(a,b,c){V=a;ik(a,b,c)} 63190function ik(a,b,c){for(var d=0!==(a.mode&1);null!==V;){var e=V,f=e.child;if(22===e.tag&&d){var g=null!==e.memoizedState||Jj;if(!g){var h=e.alternate,k=null!==h&&null!==h.memoizedState||U;h=Jj;var l=U;Jj=g;if((U=k)&&!l)for(V=e;null!==V;)g=V,k=g.child,22===g.tag&&null!==g.memoizedState?jk(e):null!==k?(k.return=g,V=k):jk(e);for(;null!==f;)V=f,ik(f,b,c),f=f.sibling;V=e;Jj=h;U=l}kk(a,b,c)}else 0!==(e.subtreeFlags&8772)&&null!==f?(f.return=e,V=f):kk(a,b,c)}} 63191function kk(a){for(;null!==V;){var b=V;if(0!==(b.flags&8772)){var c=b.alternate;try{if(0!==(b.flags&8772))switch(b.tag){case 0:case 11:case 15:U||Qj(5,b);break;case 1:var d=b.stateNode;if(b.flags&4&&!U)if(null===c)d.componentDidMount();else{var e=b.elementType===b.type?c.memoizedProps:Ci(b.type,c.memoizedProps);d.componentDidUpdate(e,c.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var f=b.updateQueue;null!==f&&sh(b,f,d);break;case 3:var g=b.updateQueue;if(null!==g){c=null;if(null!==b.child)switch(b.child.tag){case 5:c= 63192b.child.stateNode;break;case 1:c=b.child.stateNode}sh(b,g,c)}break;case 5:var h=b.stateNode;if(null===c&&b.flags&4){c=h;var k=b.memoizedProps;switch(b.type){case "button":case "input":case "select":case "textarea":k.autoFocus&&c.focus();break;case "img":k.src&&(c.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(null===b.memoizedState){var l=b.alternate;if(null!==l){var m=l.memoizedState;if(null!==m){var q=m.dehydrated;null!==q&&bd(q)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break; 63193default:throw Error(p(163));}U||b.flags&512&&Rj(b)}catch(r){W(b,b.return,r)}}if(b===a){V=null;break}c=b.sibling;if(null!==c){c.return=b.return;V=c;break}V=b.return}}function gk(a){for(;null!==V;){var b=V;if(b===a){V=null;break}var c=b.sibling;if(null!==c){c.return=b.return;V=c;break}V=b.return}} 63194function jk(a){for(;null!==V;){var b=V;try{switch(b.tag){case 0:case 11:case 15:var c=b.return;try{Qj(4,b)}catch(k){W(b,c,k)}break;case 1:var d=b.stateNode;if("function"===typeof d.componentDidMount){var e=b.return;try{d.componentDidMount()}catch(k){W(b,e,k)}}var f=b.return;try{Rj(b)}catch(k){W(b,f,k)}break;case 5:var g=b.return;try{Rj(b)}catch(k){W(b,g,k)}}}catch(k){W(b,b.return,k)}if(b===a){V=null;break}var h=b.sibling;if(null!==h){h.return=b.return;V=h;break}V=b.return}} 63195var lk=Math.ceil,mk=ua.ReactCurrentDispatcher,nk=ua.ReactCurrentOwner,ok=ua.ReactCurrentBatchConfig,K=0,Q=null,Y=null,Z=0,fj=0,ej=Uf(0),T=0,pk=null,rh=0,qk=0,rk=0,sk=null,tk=null,fk=0,Gj=Infinity,uk=null,Oi=!1,Pi=null,Ri=null,vk=!1,wk=null,xk=0,yk=0,zk=null,Ak=-1,Bk=0;function R(){return 0!==(K&6)?B():-1!==Ak?Ak:Ak=B()} 63196function yi(a){if(0===(a.mode&1))return 1;if(0!==(K&2)&&0!==Z)return Z&-Z;if(null!==Kg.transition)return 0===Bk&&(Bk=yc()),Bk;a=C;if(0!==a)return a;a=window.event;a=void 0===a?16:jd(a.type);return a}function gi(a,b,c,d){if(50<yk)throw yk=0,zk=null,Error(p(185));Ac(a,c,d);if(0===(K&2)||a!==Q)a===Q&&(0===(K&2)&&(qk|=c),4===T&&Ck(a,Z)),Dk(a,d),1===c&&0===K&&0===(b.mode&1)&&(Gj=B()+500,fg&&jg())} 63197function Dk(a,b){var c=a.callbackNode;wc(a,b);var d=uc(a,a===Q?Z:0);if(0===d)null!==c&&bc(c),a.callbackNode=null,a.callbackPriority=0;else if(b=d&-d,a.callbackPriority!==b){null!=c&&bc(c);if(1===b)0===a.tag?ig(Ek.bind(null,a)):hg(Ek.bind(null,a)),Jf(function(){0===(K&6)&&jg()}),c=null;else{switch(Dc(d)){case 1:c=fc;break;case 4:c=gc;break;case 16:c=hc;break;case 536870912:c=jc;break;default:c=hc}c=Fk(c,Gk.bind(null,a))}a.callbackPriority=b;a.callbackNode=c}} 63198function Gk(a,b){Ak=-1;Bk=0;if(0!==(K&6))throw Error(p(327));var c=a.callbackNode;if(Hk()&&a.callbackNode!==c)return null;var d=uc(a,a===Q?Z:0);if(0===d)return null;if(0!==(d&30)||0!==(d&a.expiredLanes)||b)b=Ik(a,d);else{b=d;var e=K;K|=2;var f=Jk();if(Q!==a||Z!==b)uk=null,Gj=B()+500,Kk(a,b);do try{Lk();break}catch(h){Mk(a,h)}while(1);$g();mk.current=f;K=e;null!==Y?b=0:(Q=null,Z=0,b=T)}if(0!==b){2===b&&(e=xc(a),0!==e&&(d=e,b=Nk(a,e)));if(1===b)throw c=pk,Kk(a,0),Ck(a,d),Dk(a,B()),c;if(6===b)Ck(a,d); 63199else{e=a.current.alternate;if(0===(d&30)&&!Ok(e)&&(b=Ik(a,d),2===b&&(f=xc(a),0!==f&&(d=f,b=Nk(a,f))),1===b))throw c=pk,Kk(a,0),Ck(a,d),Dk(a,B()),c;a.finishedWork=e;a.finishedLanes=d;switch(b){case 0:case 1:throw Error(p(345));case 2:Pk(a,tk,uk);break;case 3:Ck(a,d);if((d&130023424)===d&&(b=fk+500-B(),10<b)){if(0!==uc(a,0))break;e=a.suspendedLanes;if((e&d)!==d){R();a.pingedLanes|=a.suspendedLanes&e;break}a.timeoutHandle=Ff(Pk.bind(null,a,tk,uk),b);break}Pk(a,tk,uk);break;case 4:Ck(a,d);if((d&4194240)=== 63200d)break;b=a.eventTimes;for(e=-1;0<d;){var g=31-oc(d);f=1<<g;g=b[g];g>e&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*lk(d/1960))-d;if(10<d){a.timeoutHandle=Ff(Pk.bind(null,a,tk,uk),d);break}Pk(a,tk,uk);break;case 5:Pk(a,tk,uk);break;default:throw Error(p(329));}}}Dk(a,B());return a.callbackNode===c?Gk.bind(null,a):null} 63201function Nk(a,b){var c=sk;a.current.memoizedState.isDehydrated&&(Kk(a,b).flags|=256);a=Ik(a,b);2!==a&&(b=tk,tk=c,null!==b&&Fj(b));return a}function Fj(a){null===tk?tk=a:tk.push.apply(tk,a)} 63202function Ok(a){for(var b=a;;){if(b.flags&16384){var c=b.updateQueue;if(null!==c&&(c=c.stores,null!==c))for(var d=0;d<c.length;d++){var e=c[d],f=e.getSnapshot;e=e.value;try{if(!He(f(),e))return!1}catch(g){return!1}}}c=b.child;if(b.subtreeFlags&16384&&null!==c)c.return=b,b=c;else{if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return!0;b=b.return}b.sibling.return=b.return;b=b.sibling}}return!0} 63203function Ck(a,b){b&=~rk;b&=~qk;a.suspendedLanes|=b;a.pingedLanes&=~b;for(a=a.expirationTimes;0<b;){var c=31-oc(b),d=1<<c;a[c]=-1;b&=~d}}function Ek(a){if(0!==(K&6))throw Error(p(327));Hk();var b=uc(a,0);if(0===(b&1))return Dk(a,B()),null;var c=Ik(a,b);if(0!==a.tag&&2===c){var d=xc(a);0!==d&&(b=d,c=Nk(a,d))}if(1===c)throw c=pk,Kk(a,0),Ck(a,b),Dk(a,B()),c;if(6===c)throw Error(p(345));a.finishedWork=a.current.alternate;a.finishedLanes=b;Pk(a,tk,uk);Dk(a,B());return null} 63204function Qk(a,b){var c=K;K|=1;try{return a(b)}finally{K=c,0===K&&(Gj=B()+500,fg&&jg())}}function Rk(a){null!==wk&&0===wk.tag&&0===(K&6)&&Hk();var b=K;K|=1;var c=ok.transition,d=C;try{if(ok.transition=null,C=1,a)return a()}finally{C=d,ok.transition=c,K=b,0===(K&6)&&jg()}}function Hj(){fj=ej.current;E(ej)} 63205function Kk(a,b){a.finishedWork=null;a.finishedLanes=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,Gf(c));if(null!==Y)for(c=Y.return;null!==c;){var d=c;wg(d);switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&$f();break;case 3:zh();E(Wf);E(H);Eh();break;case 5:Bh(d);break;case 4:zh();break;case 13:E(L);break;case 19:E(L);break;case 10:ah(d.type._context);break;case 22:case 23:Hj()}c=c.return}Q=a;Y=a=Pg(a.current,null);Z=fj=b;T=0;pk=null;rk=qk=rh=0;tk=sk=null;if(null!==fh){for(b= 632060;b<fh.length;b++)if(c=fh[b],d=c.interleaved,null!==d){c.interleaved=null;var e=d.next,f=c.pending;if(null!==f){var g=f.next;f.next=e;d.next=g}c.pending=d}fh=null}return a} 63207function Mk(a,b){do{var c=Y;try{$g();Fh.current=Rh;if(Ih){for(var d=M.memoizedState;null!==d;){var e=d.queue;null!==e&&(e.pending=null);d=d.next}Ih=!1}Hh=0;O=N=M=null;Jh=!1;Kh=0;nk.current=null;if(null===c||null===c.return){T=1;pk=b;Y=null;break}a:{var f=a,g=c.return,h=c,k=b;b=Z;h.flags|=32768;if(null!==k&&"object"===typeof k&&"function"===typeof k.then){var l=k,m=h,q=m.tag;if(0===(m.mode&1)&&(0===q||11===q||15===q)){var r=m.alternate;r?(m.updateQueue=r.updateQueue,m.memoizedState=r.memoizedState, 63208m.lanes=r.lanes):(m.updateQueue=null,m.memoizedState=null)}var y=Ui(g);if(null!==y){y.flags&=-257;Vi(y,g,h,f,b);y.mode&1&&Si(f,l,b);b=y;k=l;var n=b.updateQueue;if(null===n){var t=new Set;t.add(k);b.updateQueue=t}else n.add(k);break a}else{if(0===(b&1)){Si(f,l,b);tj();break a}k=Error(p(426))}}else if(I&&h.mode&1){var J=Ui(g);if(null!==J){0===(J.flags&65536)&&(J.flags|=256);Vi(J,g,h,f,b);Jg(Ji(k,h));break a}}f=k=Ji(k,h);4!==T&&(T=2);null===sk?sk=[f]:sk.push(f);f=g;do{switch(f.tag){case 3:f.flags|=65536; 63209b&=-b;f.lanes|=b;var x=Ni(f,k,b);ph(f,x);break a;case 1:h=k;var w=f.type,u=f.stateNode;if(0===(f.flags&128)&&("function"===typeof w.getDerivedStateFromError||null!==u&&"function"===typeof u.componentDidCatch&&(null===Ri||!Ri.has(u)))){f.flags|=65536;b&=-b;f.lanes|=b;var F=Qi(f,h,b);ph(f,F);break a}}f=f.return}while(null!==f)}Sk(c)}catch(na){b=na;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)}function Jk(){var a=mk.current;mk.current=Rh;return null===a?Rh:a} 63210function tj(){if(0===T||3===T||2===T)T=4;null===Q||0===(rh&268435455)&&0===(qk&268435455)||Ck(Q,Z)}function Ik(a,b){var c=K;K|=2;var d=Jk();if(Q!==a||Z!==b)uk=null,Kk(a,b);do try{Tk();break}catch(e){Mk(a,e)}while(1);$g();K=c;mk.current=d;if(null!==Y)throw Error(p(261));Q=null;Z=0;return T}function Tk(){for(;null!==Y;)Uk(Y)}function Lk(){for(;null!==Y&&!cc();)Uk(Y)}function Uk(a){var b=Vk(a.alternate,a,fj);a.memoizedProps=a.pendingProps;null===b?Sk(a):Y=b;nk.current=null} 63211function Sk(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&32768)){if(c=Ej(c,b,fj),null!==c){Y=c;return}}else{c=Ij(c,b);if(null!==c){c.flags&=32767;Y=c;return}if(null!==a)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{T=6;Y=null;return}}b=b.sibling;if(null!==b){Y=b;return}Y=b=a}while(null!==b);0===T&&(T=5)}function Pk(a,b,c){var d=C,e=ok.transition;try{ok.transition=null,C=1,Wk(a,b,c,d)}finally{ok.transition=e,C=d}return null} 63212function Wk(a,b,c,d){do Hk();while(null!==wk);if(0!==(K&6))throw Error(p(327));c=a.finishedWork;var e=a.finishedLanes;if(null===c)return null;a.finishedWork=null;a.finishedLanes=0;if(c===a.current)throw Error(p(177));a.callbackNode=null;a.callbackPriority=0;var f=c.lanes|c.childLanes;Bc(a,f);a===Q&&(Y=Q=null,Z=0);0===(c.subtreeFlags&2064)&&0===(c.flags&2064)||vk||(vk=!0,Fk(hc,function(){Hk();return null}));f=0!==(c.flags&15990);if(0!==(c.subtreeFlags&15990)||f){f=ok.transition;ok.transition=null; 63213var g=C;C=1;var h=K;K|=4;nk.current=null;Oj(a,c);dk(c,a);Oe(Df);dd=!!Cf;Df=Cf=null;a.current=c;hk(c,a,e);dc();K=h;C=g;ok.transition=f}else a.current=c;vk&&(vk=!1,wk=a,xk=e);f=a.pendingLanes;0===f&&(Ri=null);mc(c.stateNode,d);Dk(a,B());if(null!==b)for(d=a.onRecoverableError,c=0;c<b.length;c++)e=b[c],d(e.value,{componentStack:e.stack,digest:e.digest});if(Oi)throw Oi=!1,a=Pi,Pi=null,a;0!==(xk&1)&&0!==a.tag&&Hk();f=a.pendingLanes;0!==(f&1)?a===zk?yk++:(yk=0,zk=a):yk=0;jg();return null} 63214function Hk(){if(null!==wk){var a=Dc(xk),b=ok.transition,c=C;try{ok.transition=null;C=16>a?16:a;if(null===wk)var d=!1;else{a=wk;wk=null;xk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;k<h.length;k++){var l=h[k];for(V=l;null!==V;){var m=V;switch(m.tag){case 0:case 11:case 15:Pj(8,m,f)}var q=m.child;if(null!==q)q.return=m,V=q;else for(;null!==V;){m=V;var r=m.sibling,y=m.return;Sj(m);if(m=== 63215l){V=null;break}if(null!==r){r.return=y;V=r;break}V=y}}}var n=f.alternate;if(null!==n){var t=n.child;if(null!==t){n.child=null;do{var J=t.sibling;t.sibling=null;t=J}while(null!==t)}}V=f}}if(0!==(f.subtreeFlags&2064)&&null!==g)g.return=f,V=g;else b:for(;null!==V;){f=V;if(0!==(f.flags&2048))switch(f.tag){case 0:case 11:case 15:Pj(9,f,f.return)}var x=f.sibling;if(null!==x){x.return=f.return;V=x;break b}V=f.return}}var w=a.current;for(V=w;null!==V;){g=V;var u=g.child;if(0!==(g.subtreeFlags&2064)&&null!== 63216u)u.return=g,V=u;else b:for(g=w;null!==V;){h=V;if(0!==(h.flags&2048))try{switch(h.tag){case 0:case 11:case 15:Qj(9,h)}}catch(na){W(h,h.return,na)}if(h===g){V=null;break b}var F=h.sibling;if(null!==F){F.return=h.return;V=F;break b}V=h.return}}K=e;jg();if(lc&&"function"===typeof lc.onPostCommitFiberRoot)try{lc.onPostCommitFiberRoot(kc,a)}catch(na){}d=!0}return d}finally{C=c,ok.transition=b}}return!1}function Xk(a,b,c){b=Ji(c,b);b=Ni(a,b,1);a=nh(a,b,1);b=R();null!==a&&(Ac(a,1,b),Dk(a,b))} 63217function W(a,b,c){if(3===a.tag)Xk(a,a,c);else for(;null!==b;){if(3===b.tag){Xk(b,a,c);break}else if(1===b.tag){var d=b.stateNode;if("function"===typeof b.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Ri||!Ri.has(d))){a=Ji(c,a);a=Qi(b,a,1);b=nh(b,a,1);a=R();null!==b&&(Ac(b,1,a),Dk(b,a));break}}b=b.return}} 63218function Ti(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);b=R();a.pingedLanes|=a.suspendedLanes&c;Q===a&&(Z&c)===c&&(4===T||3===T&&(Z&130023424)===Z&&500>B()-fk?Kk(a,0):rk|=c);Dk(a,b)}function Yk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=R();a=ih(a,b);null!==a&&(Ac(a,b,c),Dk(a,c))}function uj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Yk(a,c)} 63219function bk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Yk(a,c)}var Vk; 63220Vk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)dh=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return dh=!1,yj(a,b,c);dh=0!==(a.flags&131072)?!0:!1}else dh=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;ij(a,b);a=b.pendingProps;var e=Yf(b,H.current);ch(b,c);e=Nh(null,b,d,a,e,c);var f=Sh();b.flags|=1;"object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue= 63221null,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,kh(b),e.updater=Ei,b.stateNode=e,e._reactInternals=b,Ii(b,d,a,c),b=jj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Xi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{ij(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=Zk(d);a=Ci(d,a);switch(e){case 0:b=cj(null,b,d,a,c);break a;case 1:b=hj(null,b,d,a,c);break a;case 11:b=Yi(null,b,d,a,c);break a;case 14:b=$i(null,b,d,Ci(d.type,a),c);break a}throw Error(p(306, 63222d,""));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),cj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),hj(a,b,d,e,c);case 3:a:{kj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;lh(a,b);qh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState= 63223f,b.memoizedState=f,b.flags&256){e=Ji(Error(p(423)),b);b=lj(a,b,d,c,e);break a}else if(d!==e){e=Ji(Error(p(424)),b);b=lj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Vg(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=Zi(a,b,c);break a}Xi(a,b,d,c)}b=b.child}return b;case 5:return Ah(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32), 63224gj(a,b),Xi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return oj(a,b,c);case 4:return yh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Ug(b,null,d,c):Xi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),Yi(a,b,d,e,c);case 7:return Xi(a,b,b.pendingProps,c),b.child;case 8:return Xi(a,b,b.pendingProps.children,c),b.child;case 12:return Xi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps; 63225g=e.value;G(Wg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=Zi(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=mh(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);bh(f.return, 63226c,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);bh(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Xi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,ch(b,c),e=eh(e),d=d(e),b.flags|=1,Xi(a,b,d,c), 63227b.child;case 14:return d=b.type,e=Ci(d,b.pendingProps),e=Ci(d.type,e),$i(a,b,d,e,c);case 15:return bj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),ij(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,ch(b,c),Gi(b,d,e),Ii(b,d,e,c),jj(null,b,d,!0,a,c);case 19:return xj(a,b,c);case 22:return dj(a,b,c)}throw Error(p(156,b.tag));};function Fk(a,b){return ac(a,b)} 63228function $k(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new $k(a,b,c,d)}function aj(a){a=a.prototype;return!(!a||!a.isReactComponent)} 63229function Zk(a){if("function"===typeof a)return aj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2} 63230function Pg(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext}; 63231c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c} 63232function Rg(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)aj(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ya:return Tg(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return pj(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11; 63233break a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,""));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Tg(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function pj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function Qg(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a} 63234function Sg(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b} 63235function al(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData= 63236null}function bl(a,b,c,d,e,f,g,h,k){a=new al(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};kh(f);return a}function cl(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:wa,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}} 63237function dl(a){if(!a)return Vf;a=a._reactInternals;a:{if(Vb(a)!==a||1!==a.tag)throw Error(p(170));var b=a;do{switch(b.tag){case 3:b=b.stateNode.context;break a;case 1:if(Zf(b.type)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break a}}b=b.return}while(null!==b);throw Error(p(171));}if(1===a.tag){var c=a.type;if(Zf(c))return bg(a,c,b)}return b} 63238function el(a,b,c,d,e,f,g,h,k){a=bl(c,d,!0,a,e,f,g,h,k);a.context=dl(null);c=a.current;d=R();e=yi(c);f=mh(d,e);f.callback=void 0!==b&&null!==b?b:null;nh(c,f,e);a.current.lanes=e;Ac(a,e,d);Dk(a,d);return a}function fl(a,b,c,d){var e=b.current,f=R(),g=yi(e);c=dl(c);null===b.context?b.context=c:b.pendingContext=c;b=mh(f,g);b.payload={element:a};d=void 0===d?null:d;null!==d&&(b.callback=d);a=nh(e,b,g);null!==a&&(gi(a,e,g,f),oh(a,e,g));return g} 63239function gl(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function hl(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;
63239a.retryLane=0!==c&&c<b?c:b}}function il(a,b){hl(a,b);(a=a.alternate)&&hl(a,b)}function jl(){return null}var kl="function"===typeof reportError?reportError:function(a){console.error(a)};function ll(a){this._internalRoot=a} 63240ml.prototype.render=ll.prototype.render=function(a){var b=this._internalRoot;if(null===b)throw Error(p(409));fl(a,b,null,null)};ml.prototype.unmount=ll.prototype.unmount=function(){var a=this._internalRoot;if(null!==a){this._internalRoot=null;var b=a.containerInfo;Rk(function(){fl(null,a,null,null)});b[uf]=null}};function ml(a){this._internalRoot=a} 63241ml.prototype.unstable_scheduleHydration=function(a){if(a){var b=Hc();a={blockedOn:null,target:a,priority:b};for(var c=0;c<Qc.length&&0!==b&&b<Qc[c].priority;c++);Qc.splice(c,0,a);0===c&&Vc(a)}};function nl(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType)}function ol(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function pl(){} 63242function ql(a,b,c,d,e){if(e){if("function"===typeof d){var f=d;d=function(){var a=gl(g);f.call(a)}}var g=el(b,d,a,0,null,!1,!1,"",pl);a._reactRootContainer=g;a[uf]=g.current;sf(8===a.nodeType?a.parentNode:a);Rk();return g}for(;e=a.lastChild;)a.removeChild(e);if("function"===typeof d){var h=d;d=function(){var a=gl(k);h.call(a)}}var k=bl(a,0,!1,null,null,!1,!1,"",pl);a._reactRootContainer=k;a[uf]=k.current;sf(8===a.nodeType?a.parentNode:a);Rk(function(){fl(b,k,c,d)});return k} 63243function rl(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f;if("function"===typeof e){var h=e;e=function(){var a=gl(g);h.call(a)}}fl(b,g,a,e)}else g=ql(c,b,a,e,d);return gl(g)}Ec=function(a){switch(a.tag){case 3:var b=a.stateNode;if(b.current.memoizedState.isDehydrated){var c=tc(b.pendingLanes);0!==c&&(Cc(b,c|1),Dk(b,B()),0===(K&6)&&(Gj=B()+500,jg()))}break;case 13:Rk(function(){var b=ih(a,1);if(null!==b){var c=R();gi(b,a,1,c)}}),il(a,1)}}; 63244Fc=function(a){if(13===a.tag){var b=ih(a,134217728);if(null!==b){var c=R();gi(b,a,134217728,c)}il(a,134217728)}};Gc=function(a){if(13===a.tag){var b=yi(a),c=ih(a,b);if(null!==c){var d=R();gi(c,a,b,d)}il(a,b)}};Hc=function(){return C};Ic=function(a,b){var c=C;try{return C=a,b()}finally{C=c}}; 63245yb=function(a,b,c){switch(b){case "input":bb(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Db(d);if(!e)throw Error(p(90));Wa(d);bb(d,e)}}}break;case "textarea":ib(a,c);break;case "select":b=c.value,null!=b&&fb(a,!!c.multiple,b,!1)}};Gb=Qk;Hb=Rk; 63246var sl={usingClientEntryPoint:!1,Events:[Cb,ue,Db,Eb,Fb,Qk]},tl={findFiberByHostInstance:Wc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"}; 63247var ul={bundleType:tl.bundleType,version:tl.version,rendererPackageName:tl.rendererPackageName,rendererConfig:tl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=Zb(a);return null===a?null:a.stateNode},findFiberByHostInstance:tl.findFiberByHostInstance|| 63248jl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl.isDisabled&&vl.supportsFiber)try{kc=vl.inject(ul),lc=vl}catch(a){}}exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sl; 63249exports.createPortal=function(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nl(b))throw Error(p(200));return cl(a,b,null,c)};exports.createRoot=function(a,b){if(!nl(a))throw Error(p(299));var c=!1,d="",e=kl;null!==b&&void 0!==b&&(!0===b.unstable_strictMode&&(c=!0),void 0!==b.identifierPrefix&&(d=b.identifierPrefix),void 0!==b.onRecoverableError&&(e=b.onRecoverableError));b=bl(a,1,!1,null,null,c,!1,d,e);a[uf]=b.current;sf(8===a.nodeType?a.parentNode:a);return new ll(b)};
63250exports.findDOMNode=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternals;if(void 0===b){if("function"===typeof a.render)throw Error(p(188));a=Object.keys(a).join(",");throw Error(p(268,a));}a=Zb(b);a=null===a?null:a.stateNode;return a};exports.flushSync=function(a){return Rk(a)};exports.hydrate=function(a,b,c){if(!ol(b))throw Error(p(200));return rl(null,a,b,!0,c)}; 63251exports.hydrateRoot=function(a,b,c){if(!nl(a))throw Error(p(405));var d=null!=c&&c.hydratedSources||null,e=!1,f="",g=kl;null!==c&&void 0!==c&&(!0===c.unstable_strictMode&&(e=!0),void 0!==c.identifierPrefix&&(f=c.identifierPrefix),void 0!==c.onRecoverableError&&(g=c.onRecoverableError));b=el(b,null,a,1,null!=c?c:null,e,!1,f,g);a[uf]=b.current;sf(a);if(d)for(a=0;a<d.length;a++)c=d[a],e=c._getVersion,e=e(c._source),null==b.mutableSourceEagerHydrationData?b.mutableSourceEagerHydrationData=[c,e]:b.mutableSourceEagerHydrationData.push(c, 63252e);return new ml(b)};exports.render=function(a,b,c){if(!ol(b))throw Error(p(200));return rl(null,a,b,!1,c)};exports.unmountComponentAtNode=function(a){if(!ol(a))throw Error(p(40));return a._reactRootContainer?(Rk(function(){rl(null,null,a,!1,function(){a._reactRootContainer=null;a[uf]=null})}),!0):!1};exports.unstable_batchedUpdates=Qk; 63253exports.unstable_renderSubtreeIntoContainer=function(a,b,c,d){if(!ol(c))throw Error(p(200));if(null==a||void 0===a._reactInternals)throw Error(p(38));return rl(a,b,c,!1,d)};exports.version="18.3.1-next-f1338f8080-20240426"; 63254 63255 63256/***/ }, 63257 63258/***/ 5338 63259(__unused_webpack_module, exports, __webpack_require__) { 63260 63261"use strict"; 63262 63263 63264var m = __webpack_require__(40961); 63265if (true) { 63266 exports.H = m.createRoot; 63267 exports.c = m.hydrateRoot; 63268} else // removed by dead control flow 63269{ var i; } 63270 63271 63272/***/ }, 63273 63274/***/ 40961 63275(module, __unused_webpack_exports, __webpack_require__) { 63276 63277"use strict"; 63278 63279 63280function checkDCE() { 63281 /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ 63282 if ( 63283 typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || 63284 typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function' 63285 ) { 63286 return; 63287 } 63288 if (false) // removed by dead control flow 63289{} 63290 try { 63291 // Verify that the code above has been dead code eliminated (DCE'd). 63292 __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); 63293 } catch (err) { 63294 // DevTools shouldn't crash React, no matter what. 63295 // We should still report in case we break this code. 63296 console.error(err); 63297 } 63298} 63299 63300if (true) { 63301 // DCE check should happen before ReactDOM bundle executes so that 63302 // DevTools can report bad minification during injection. 63303 checkDCE(); 63304 module.exports = __webpack_require__(22551); 63305} else // removed by dead control flow 63306{} 63307 63308 63309/***/ }, 63310 63311/***/ 30115 63312(module) { 63313 63314/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */ 63315 63316var hasElementType = typeof Element !== 'undefined'; 63317var hasMap = typeof Map === 'function'; 63318var hasSet = typeof Set === 'function'; 63319var hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView; 63320 63321// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js 63322 63323function equal(a, b) { 63324 // START: fast-deep-equal es6/index.js 3.1.3 63325 if (a === b) return true; 63326 63327 if (a && b && typeof a == 'object' && typeof b == 'object') { 63328 if (a.constructor !== b.constructor) return false; 63329 63330 var length, i, keys; 63331 if (Array.isArray(a)) { 63332 length = a.length; 63333 if (length != b.length) return false; 63334 for (i = length; i-- !== 0;) 63335 if (!equal(a[i], b[i])) return false; 63336 return true; 63337 } 63338 63339 // START: Modifications: 63340 // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code 63341 // to co-exist with es5. 63342 // 2. Replace `for of` with es5 compliant iteration using `for`. 63343 // Basically, take: 63344 // 63345 // ```js 63346 // for (i of a.entries()) 63347 // if (!b.has(i[0])) return false; 63348 // ``` 63349 // 63350 // ... and convert to: 63351 // 63352 // ```js 63353 // it = a.entries(); 63354 // while (!(i = it.next()).done) 63355 // if (!b.has(i.value[0])) return false; 63356 // ``` 63357 // 63358 // **Note**: `i` access switches to `i.value`. 63359 var it; 63360 if (hasMap && (a instanceof Map) && (b instanceof Map)) { 63361 if (a.size !== b.size) return false;
63362 it = a.entries(); 63363 while (!(i = it.next()).done) 63364 if (!b.has(i.value[0])) return false; 63365 it = a.entries(); 63366 while (!(i = it.next()).done) 63367 if (!equal(i.value[1], b.get(i.value[0]))) return false; 63368 return true; 63369 } 63370 63371 if (hasSet && (a instanceof Set) && (b instanceof Set)) { 63372 if (a.size !== b.size) return false; 63373 it = a.entries(); 63374 while (!(i = it.next()).done) 63375 if (!b.has(i.value[0])) return false; 63376 return true; 63377 } 63378 // END: Modifications 63379 63380 if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { 63381 length = a.length; 63382 if (length != b.length) return false; 63383 for (i = length; i-- !== 0;) 63384 if (a[i] !== b[i]) return false; 63385 return true; 63386 } 63387 63388 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 63389 // START: Modifications: 63390 // Apply guards for `Object.create(null)` handling. See: 63391 // - https://github.com/FormidableLabs/react-fast-compare/issues/64 63392 // - https://github.com/epoberezkin/fast-deep-equal/issues/49 63393 if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === 'function' && typeof b.valueOf === 'function') return a.valueOf() === b.valueOf(); 63394 if (a.toString !== Object.prototype.toString && typeof a.toString === 'function' && typeof b.toString === 'function') return a.toString() === b.toString(); 63395 // END: Modifications 63396 63397 keys = Object.keys(a); 63398 length = keys.length; 63399 if (length !== Object.keys(b).length) return false; 63400 63401 for (i = length; i-- !== 0;) 63402 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 63403 // END: fast-deep-equal 63404 63405 // START: react-fast-compare 63406 // custom handling for DOM elements 63407 if (hasElementType && a instanceof Element) return false; 63408 63409 // custom handling for React/Preact 63410 for (i = length; i-- !== 0;) { 63411 if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) { 63412 // React-specific: avoid traversing React elements' _owner 63413 // Preact-specific: avoid traversing Preact elements' __v and __o 63414 // __v = $_original / $_vnode 63415 // __o = $_owner 63416 // These properties contain circular references and are not needed when 63417 // comparing the actual elements (and not their owners) 63418 // .$$typeof and ._store on just reasonable markers of elements 63419 63420 continue; 63421 } 63422 63423 // all other properties should be traversed as usual 63424 if (!equal(a[keys[i]], b[keys[i]])) return false; 63425 } 63426 // END: react-fast-compare 63427 63428 // START: fast-deep-equal 63429 return true; 63430 } 63431 63432 return a !== a && b !== b; 63433} 63434// end fast-deep-equal 63435 63436module.exports = function isEqual(a, b) { 63437 try { 63438 return equal(a, b); 63439 } catch (error) { 63440 if (((error.message || '').match(/stack|recursion/i))) { 63441 // warn on circular references, don't crash 63442 // browsers give this different errors name and messages: 63443 // chrome/safari: "RangeError", "Maximum call stack size exceeded" 63444 // firefox: "InternalError", too much recursion" 63445 // edge: "Error", "Out of stack space" 63446 console.warn('react-fast-compare cannot handle circular refs'); 63447 return false; 63448 } 63449 // some other error. we should definitely know about these 63450 throw error; 63451 } 63452}; 63453 63454 63455/***/ }, 63456 63457/***/ 85902 63458(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 63459 63460"use strict"; 63461/* harmony export */ __webpack_require__.d(__webpack_exports__, { 63462/* harmony export */ mg: () => (/* binding */ Helmet), 63463/* harmony export */ vd: () => (/* binding */ HelmetProvider) 63464/* harmony export */ }); 63465/* unused harmony export HelmetData */ 63466/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 63467/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30115); 63468/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_1__); 63469/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20311); 63470/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_2__); 63471/* harmony import */ var shallowequal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2833); 63472/* harmony import */ var shallowequal__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(shallowequal__WEBPACK_IMPORTED_MODULE_3__);
63473// src/index.tsx 63474 63475 63476 63477
63478// src/Provider.tsx 63479 63480
63481// src/server.ts 63482 63483
63484// src/constants.ts 63485var TAG_NAMES = /* @__PURE__ */ ((TAG_NAMES2) => { 63486 TAG_NAMES2["BASE"] = "base"; 63487 TAG_NAMES2["BODY"] = "body"; 63488 TAG_NAMES2["HEAD"] = "head"; 63489 TAG_NAMES2["HTML"] = "html"; 63490 TAG_NAMES2["LINK"] = "link"; 63491 TAG_NAMES2["META"] = "meta"; 63492 TAG_NAMES2["NOSCRIPT"] = "noscript"; 63493 TAG_NAMES2["SCRIPT"] = "script"; 63494 TAG_NAMES2["STYLE"] = "style"; 63495 TAG_NAMES2["TITLE"] = "title"; 63496 TAG_NAMES2["FRAGMENT"] = "Symbol(react.fragment)"; 63497 return TAG_NAMES2; 63498})(TAG_NAMES || {}); 63499var SEO_PRIORITY_TAGS = { 63500 link: { rel: ["amphtml", "canonical", "alternate"] }, 63501 script: { type: ["application/ld+json"] }, 63502 meta: { 63503 charset: "", 63504 name: ["generator", "robots", "description"], 63505 property: [ 63506 "og:type", 63507 "og:title", 63508 "og:url", 63509 "og:image", 63510 "og:image:alt", 63511 "og:description", 63512 "twitter:url", 63513 "twitter:title", 63514 "twitter:description", 63515 "twitter:image", 63516 "twitter:image:alt", 63517 "twitter:card", 63518 "twitter:site" 63519 ] 63520 } 63521}; 63522var VALID_TAG_NAMES = Object.values(TAG_NAMES); 63523var REACT_TAG_MAP = { 63524 accesskey: "accessKey", 63525 charset: "charSet", 63526 class: "className", 63527 contenteditable: "contentEditable", 63528 contextmenu: "contextMenu", 63529 "http-equiv": "httpEquiv", 63530 itemprop: "itemProp", 63531 tabindex: "tabIndex" 63532}; 63533var HTML_TAG_MAP = Object.entries(REACT_TAG_MAP).reduce( 63534 (carry, [key, value]) => { 63535 carry[value] = key; 63536 return carry; 63537 }, 63538 {} 63539); 63540var HELMET_ATTRIBUTE = "data-rh"; 63541
63542// src/utils.ts 63543var HELMET_PROPS = { 63544 DEFAULT_TITLE: "defaultTitle", 63545 DEFER: "defer", 63546 ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters", 63547 ON_CHANGE_CLIENT_STATE: "onChangeClientState", 63548 TITLE_TEMPLATE: "titleTemplate", 63549 PRIORITIZE_SEO_TAGS: "prioritizeSeoTags" 63550}; 63551var getInnermostProperty = (propsList, property) => { 63552 for (let i = propsList.length - 1; i >= 0; i -= 1) { 63553 const props = propsList[i]; 63554 if (Object.prototype.hasOwnProperty.call(props, property)) { 63555 return props[property]; 63556 } 63557 } 63558 return null; 63559}; 63560var getTitleFromPropsList = (propsList) => { 63561 let innermostTitle = getInnermostProperty(propsList, "title" /* TITLE */); 63562 const innermostTemplate = getInnermostProperty(propsList, HELMET_PROPS.TITLE_TEMPLATE); 63563 if (Array.isArray(innermostTitle)) { 63564 innermostTitle = innermostTitle.join(""); 63565 } 63566 if (innermostTemplate && innermostTitle) { 63567 return innermostTemplate.replace(/%s/g, () => innermostTitle); 63568 } 63569 const innermostDefaultTitle = getInnermostProperty(propsList, HELMET_PROPS.DEFAULT_TITLE); 63570 return innermostTitle || innermostDefaultTitle || void 0; 63571}; 63572var getOnChangeClientState = (propsList) => getInnermostProperty(propsList, HELMET_PROPS.ON_CHANGE_CLIENT_STATE) || (() => { 63573}); 63574var getAttributesFromPropsList = (tagType, propsList) => propsList.filter((props) => typeof props[tagType] !== "undefined").map((props) => props[tagType]).reduce((tagAttrs, current) => ({ ...tagAttrs, ...current }), {}); 63575var getBaseTagFromPropsList = (primaryAttributes, propsList) => propsList.filter((props) => typeof props["base" /* BASE */] !== "undefined").map((props) => props["base" /* BASE */]).reverse().reduce((innermostBaseTag, tag) => { 63576 if (!innermostBaseTag.length) { 63577 const keys = Object.keys(tag); 63578 for (let i = 0; i < keys.length; i += 1) { 63579 const attributeKey = keys[i]; 63580 const lowerCaseAttributeKey = attributeKey.toLowerCase(); 63581 if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && tag[lowerCaseAttributeKey]) { 63582 return innermostBaseTag.concat(tag); 63583 } 63584 } 63585 } 63586 return innermostBaseTag; 63587}, []); 63588var warn = (msg) => console && typeof console.warn === "function" && console.warn(msg); 63589var getTagsFromPropsList = (tagName, primaryAttributes, propsList) => { 63590 const approvedSeenTags = {}; 63591 return propsList.filter((props) => { 63592 if (Array.isArray(props[tagName])) { 63593 return true; 63594 } 63595 if (typeof props[tagName] !== "undefined") { 63596 warn( 63597 `Helmet: ${tagName} should be of type "Array". Instead found type "${typeof props[tagName]}"` 63598 ); 63599 } 63600 return false; 63601 }).map((props) => props[tagName]).reverse().reduce((approvedTags, instanceTags) => { 63602 const instanceSeenTags = {}; 63603 instanceTags.filter((tag) => { 63604 let primaryAttributeKey; 63605 const keys2 = Object.keys(tag); 63606 for (let i = 0; i < keys2.length; i += 1) { 63607 const attributeKey = keys2[i]; 63608 const lowerCaseAttributeKey = attributeKey.toLowerCase(); 63609 if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && !(primaryAttributeKey === "rel" /* REL */ && tag[primaryAttributeKey].toLowerCase() === "canonical") && !(lowerCaseAttributeKey === "rel" /* REL */ && tag[lowerCaseAttributeKey].toLowerCase() === "stylesheet")) { 63610 primaryAttributeKey = lowerCaseAttributeKey; 63611 } 63612 if (primaryAttributes.indexOf(attributeKey) !== -1 && (attributeKey === "innerHTML" /* INNER_HTML */ || attributeKey === "cssText" /* CSS_TEXT */ || attributeKey === "itemprop" /* ITEM_PROP */)) { 63613 primaryAttributeKey = attributeKey; 63614 } 63615 } 63616 if (!primaryAttributeKey || !tag[primaryAttributeKey]) { 63617 return false; 63618 } 63619 const value = tag[primaryAttributeKey].toLowerCase(); 63620 if (!approvedSeenTags[primaryAttributeKey]) { 63621 approvedSeenTags[primaryAttributeKey] = {}; 63622 } 63623 if (!instanceSeenTags[primaryAttributeKey]) { 63624 instanceSeenTags[primaryAttributeKey] = {}; 63625 } 63626 if (!approvedSeenTags[primaryAttributeKey][value]) { 63627 instanceSeenTags[primaryAttributeKey][value] = true; 63628 return true; 63629 } 63630 return false;
63631 }).reverse().forEach((tag) => approvedTags.push(tag)); 63632 const keys = Object.keys(instanceSeenTags); 63633 for (let i = 0; i < keys.length; i += 1) { 63634 const attributeKey = keys[i]; 63635 const tagUnion = { 63636 ...approvedSeenTags[attributeKey], 63637 ...instanceSeenTags[attributeKey] 63638 }; 63639 approvedSeenTags[attributeKey] = tagUnion; 63640 } 63641 return approvedTags; 63642 }, []).reverse(); 63643}; 63644var getAnyTrueFromPropsList = (propsList, checkedTag) => { 63645 if (Array.isArray(propsList) && propsList.length) { 63646 for (let index = 0; index < propsList.length; index += 1) { 63647 const prop = propsList[index]; 63648 if (prop[checkedTag]) { 63649 return true; 63650 } 63651 } 63652 } 63653 return false; 63654}; 63655var reducePropsToState = (propsList) => ({ 63656 baseTag: getBaseTagFromPropsList(["href" /* HREF */], propsList), 63657 bodyAttributes: getAttributesFromPropsList("bodyAttributes" /* BODY */, propsList), 63658 defer: getInnermostProperty(propsList, HELMET_PROPS.DEFER), 63659 encode: getInnermostProperty(propsList, HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS), 63660 htmlAttributes: getAttributesFromPropsList("htmlAttributes" /* HTML */, propsList), 63661 linkTags: getTagsFromPropsList( 63662 "link" /* LINK */, 63663 ["rel" /* REL */, "href" /* HREF */], 63664 propsList 63665 ), 63666 metaTags: getTagsFromPropsList( 63667 "meta" /* META */, 63668 [ 63669 "name" /* NAME */, 63670 "charset" /* CHARSET */, 63671 "http-equiv" /* HTTPEQUIV */, 63672 "property" /* PROPERTY */, 63673 "itemprop" /* ITEM_PROP */ 63674 ], 63675 propsList 63676 ), 63677 noscriptTags: getTagsFromPropsList("noscript" /* NOSCRIPT */, ["innerHTML" /* INNER_HTML */], propsList), 63678 onChangeClientState: getOnChangeClientState(propsList), 63679 scriptTags: getTagsFromPropsList( 63680 "script" /* SCRIPT */, 63681 ["src" /* SRC */, "innerHTML" /* INNER_HTML */], 63682 propsList 63683 ), 63684 styleTags: getTagsFromPropsList("style" /* STYLE */, ["cssText" /* CSS_TEXT */], propsList), 63685 title: getTitleFromPropsList(propsList), 63686 titleAttributes: getAttributesFromPropsList("titleAttributes" /* TITLE */, propsList), 63687 prioritizeSeoTags: getAnyTrueFromPropsList(propsList, HELMET_PROPS.PRIORITIZE_SEO_TAGS) 63688}); 63689var flattenArray = (possibleArray) => Array.isArray(possibleArray) ? possibleArray.join("") : possibleArray; 63690var checkIfPropsMatch = (props, toMatch) => { 63691 const keys = Object.keys(props); 63692 for (let i = 0; i < keys.length; i += 1) { 63693 if (toMatch[keys[i]] && toMatch[keys[i]].includes(props[keys[i]])) { 63694 return true; 63695 } 63696 } 63697 return false; 63698}; 63699var prioritizer = (elementsList, propsToMatch) => { 63700 if (Array.isArray(elementsList)) { 63701 return elementsList.reduce( 63702 (acc, elementAttrs) => { 63703 if (checkIfPropsMatch(elementAttrs, propsToMatch)) { 63704 acc.priority.push(elementAttrs); 63705 } else { 63706 acc.default.push(elementAttrs); 63707 } 63708 return acc; 63709 }, 63710 { priority: [], default: [] } 63711 ); 63712 } 63713 return { default: elementsList, priority: [] }; 63714}; 63715var without = (obj, key) => { 63716 return { 63717 ...obj, 63718 [key]: void 0 63719 }; 63720}; 63721
63722// src/server.ts 63723var SELF_CLOSING_TAGS = ["noscript" /* NOSCRIPT */, "script" /* SCRIPT */, "style" /* STYLE */]; 63724var encodeSpecialCharacters = (str, encode = true) => { 63725 if (encode === false) { 63726 return String(str); 63727 } 63728 return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); 63729}; 63730var generateElementAttributesAsString = (attributes) => Object.keys(attributes).reduce((str, key) => { 63731 const attr = typeof attributes[key] !== "undefined" ? `${key}="${attributes[key]}"` : `${key}`; 63732 return str ? `${str} ${attr}` : attr; 63733}, ""); 63734var generateTitleAsString = (type, title, attributes, encode) => { 63735 const attributeString = generateElementAttributesAsString(attributes); 63736 const flattenedTitle = flattenArray(title); 63737 return attributeString ? `<${type} ${HELMET_ATTRIBUTE}="true" ${attributeString}>${encodeSpecialCharacters( 63738 flattenedTitle, 63739 encode 63740 )}</${type}>` : `<${type} ${HELMET_ATTRIBUTE}="true">${encodeSpecialCharacters( 63741 flattenedTitle, 63742 encode 63743 )}</${type}>`; 63744}; 63745var generateTagsAsString = (type, tags, encode = true) => tags.reduce((str, t) => { 63746 const tag = t; 63747 const attributeHtml = Object.keys(tag).filter( 63748 (attribute) => !(attribute === "innerHTML" /* INNER_HTML */ || attribute === "cssText" /* CSS_TEXT */) 63749 ).reduce((string, attribute) => { 63750 const attr = typeof tag[attribute] === "undefined" ? attribute : `${attribute}="${encodeSpecialCharacters(tag[attribute], encode)}"`; 63751 return string ? `${string} ${attr}` : attr; 63752 }, ""); 63753 const tagContent = tag.innerHTML || tag.cssText || ""; 63754 const isSelfClosing = SELF_CLOSING_TAGS.indexOf(type) === -1; 63755 return `${str}<${type} ${HELMET_ATTRIBUTE}="true" ${attributeHtml}${isSelfClosing ? `/>` : `>${tagContent}</${type}>`}`; 63756}, ""); 63757var convertElementAttributesToReactProps = (attributes, initProps = {}) => Object.keys(attributes).reduce((obj, key) => { 63758 const mapped = REACT_TAG_MAP[key]; 63759 obj[mapped || key] = attributes[key]; 63760 return obj; 63761}, initProps); 63762var generateTitleAsReactComponent = (_type, title, attributes) => { 63763 const initProps = { 63764 key: title, 63765 [HELMET_ATTRIBUTE]: true 63766 }; 63767 const props = convertElementAttributesToReactProps(attributes, initProps); 63768 return [react__WEBPACK_IMPORTED_MODULE_0__.createElement("title" /* TITLE */, props, title)]; 63769}; 63770var generateTagsAsReactComponent = (type, tags) => tags.map((tag, i) => { 63771 const mappedTag = { 63772 key: i, 63773 [HELMET_ATTRIBUTE]: true 63774 }; 63775 Object.keys(tag).forEach((attribute) => { 63776 const mapped = REACT_TAG_MAP[attribute]; 63777 const mappedAttribute = mapped || attribute; 63778 if (mappedAttribute === "innerHTML" /* INNER_HTML */ || mappedAttribute === "cssText" /* CSS_TEXT */) { 63779 const content = tag.innerHTML || tag.cssText; 63780 mappedTag.dangerouslySetInnerHTML = { __html: content }; 63781 } else { 63782 mappedTag[mappedAttribute] = tag[attribute]; 63783 } 63784 }); 63785 return react__WEBPACK_IMPORTED_MODULE_0__.createElement(type, mappedTag); 63786}); 63787var getMethodsForTag = (type, tags, encode = true) => { 63788 switch (type) { 63789 case "title" /* TITLE */: 63790 return { 63791 toComponent: () => generateTitleAsReactComponent(type, tags.title, tags.titleAttributes), 63792 toString: () => generateTitleAsString(type, tags.title, tags.titleAttributes, encode) 63793 }; 63794 case "bodyAttributes" /* BODY */: 63795 case "htmlAttributes" /* HTML */: 63796 return { 63797 toComponent: () => convertElementAttributesToReactProps(tags), 63798 toString: () => generateElementAttributesAsString(tags) 63799 }; 63800 default: 63801 return { 63802 toComponent: () => generateTagsAsReactComponent(type, tags), 63803 toString: () => generateTagsAsString(type, tags, encode) 63804 }; 63805 } 63806}; 63807var getPriorityMethods = ({ metaTags, linkTags, scriptTags, encode }) => { 63808 const meta = prioritizer(metaTags, SEO_PRIORITY_TAGS.meta); 63809 const link = prioritizer(linkTags, SEO_PRIORITY_TAGS.link); 63810 const script = prioritizer(scriptTags, SEO_PRIORITY_TAGS.script); 63811 const priorityMethods = { 63812 toComponent: () => [ 63813 ...generateTagsAsReactComponent("meta" /* META */, meta.priority), 63814 ...generateTagsAsReactComponent("link" /* LINK */, link.priority), 63815 ...generateTagsAsReactComponent("script" /* SCRIPT */, script.priority) 63816 ], 63817 toString: () => ( 63818 // generate all the tags as strings and concatenate them 63819 `${getMethodsForTag("meta" /* META */, meta.priority, encode)} ${getMethodsForTag( 63820 "link" /* LINK */, 63821 link.priority, 63822 encode 63823 )} ${getMethodsForTag("script" /* SCRIPT */, script.priority, encode)}` 63824 ) 63825 }; 63826 return { 63827 priorityMethods, 63828 metaTags: meta.default, 63829 linkTags: link.default, 63830 scriptTags: script.default 63831 }; 63832}; 63833var mapStateOnServer = (props) => { 63834 const { 63835 baseTag, 63836 bodyAttributes, 63837 encode = true, 63838 htmlAttributes, 63839 noscriptTags, 63840 styleTags, 63841 title = "", 63842 titleAttributes, 63843 prioritizeSeoTags 63844 } = props; 63845 let { linkTags, metaTags, scriptTags } = props; 63846 let priorityMethods = { 63847 toComponent: () => { 63848 }, 63849 toString: () => "" 63850 }; 63851 if (prioritizeSeoTags) { 63852 ({ priorityMethods, linkTags, metaTags, scriptTags } = getPriorityMethods(props)); 63853 } 63854 return { 63855 priority: priorityMethods, 63856 base: getMethodsForTag("base" /* BASE */, baseTag, encode), 63857 bodyAttributes: getMethodsForTag("bodyAttributes" /* BODY */, bodyAttributes, encode), 63858 htmlAttributes: getMethodsForTag("htmlAttributes" /* HTML */, htmlAttributes, encode), 63859 link: getMethodsForTag("link" /* LINK */, linkTags, encode), 63860 meta: getMethodsForTag("meta" /* META */, metaTags, encode), 63861 noscript: getMethodsForTag("noscript" /* NOSCRIPT */, noscriptTags, encode), 63862 script: getMethodsForTag("script" /* SCRIPT */, scriptTags, encode), 63863 style: getMethodsForTag("style" /* STYLE */, styleTags, encode), 63864 title: getMethodsForTag("title" /* TITLE */, { title, titleAttributes }, encode) 63865 }; 63866}; 63867var server_default = mapStateOnServer; 63868
63869// src/HelmetData.ts 63870var instances = []; 63871var isDocument = !!(typeof window !== "undefined" && window.document && window.document.createElement); 63872var HelmetData = class { 63873 instances = []; 63874 canUseDOM = isDocument; 63875 context; 63876 value = { 63877 setHelmet: (serverState) => { 63878 this.context.helmet = serverState; 63879 }, 63880 helmetInstances: { 63881 get: () => this.canUseDOM ? instances : this.instances, 63882 add: (instance) => { 63883 (this.canUseDOM ? instances : this.instances).push(instance); 63884 }, 63885 remove: (instance) => { 63886 const index = (this.canUseDOM ? instances : this.instances).indexOf(instance); 63887 (this.canUseDOM ? instances : this.instances).splice(index, 1); 63888 } 63889 } 63890 }; 63891 constructor(context, canUseDOM) { 63892 this.context = context; 63893 this.canUseDOM = canUseDOM || false; 63894 if (!canUseDOM) { 63895 context.helmet = server_default({ 63896 baseTag: [], 63897 bodyAttributes: {}, 63898 encodeSpecialCharacters: true, 63899 htmlAttributes: {}, 63900 linkTags: [], 63901 metaTags: [], 63902 noscriptTags: [], 63903 scriptTags: [], 63904 styleTags: [], 63905 title: "", 63906 titleAttributes: {} 63907 }); 63908 } 63909 } 63910}; 63911
63912// src/Provider.tsx 63913var defaultValue = {}; 63914var Context = react__WEBPACK_IMPORTED_MODULE_0__.createContext(defaultValue); 63915var HelmetProvider = class _HelmetProvider extends react__WEBPACK_IMPORTED_MODULE_0__.Component { 63916 static canUseDOM = isDocument; 63917 helmetData; 63918 constructor(props) { 63919 super(props); 63920 this.helmetData = new HelmetData(this.props.context || {}, _HelmetProvider.canUseDOM); 63921 } 63922 render() { 63923 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Context.Provider, { value: this.helmetData.value }, this.props.children); 63924 } 63925}; 63926
63927// src/Dispatcher.tsx 63928 63929 63930
63931// src/client.ts 63932var updateTags = (type, tags) => { 63933 const headElement = document.head || document.querySelector("head" /* HEAD */); 63934 const tagNodes = headElement.querySelectorAll(`${type}[${HELMET_ATTRIBUTE}]`); 63935 const oldTags = [].slice.call(tagNodes); 63936 const newTags = []; 63937 let indexToDelete; 63938 if (tags && tags.length) { 63939 tags.forEach((tag) => { 63940 const newElement = document.createElement(type); 63941 for (const attribute in tag) { 63942 if (Object.prototype.hasOwnProperty.call(tag, attribute)) { 63943 if (attribute === "innerHTML" /* INNER_HTML */) { 63944 newElement.innerHTML = tag.innerHTML; 63945 } else if (attribute === "cssText" /* CSS_TEXT */) { 63946 if (newElement.styleSheet) { 63947 newElement.styleSheet.cssText = tag.cssText; 63948 } else { 63949 newElement.appendChild(document.createTextNode(tag.cssText)); 63950 } 63951 } else { 63952 const attr = attribute; 63953 const value = typeof tag[attr] === "undefined" ? "" : tag[attr]; 63954 newElement.setAttribute(attribute, value); 63955 } 63956 } 63957 } 63958 newElement.setAttribute(HELMET_ATTRIBUTE, "true"); 63959 if (oldTags.some((existingTag, index) => { 63960 indexToDelete = index; 63961 return newElement.isEqualNode(existingTag); 63962 })) { 63963 oldTags.splice(indexToDelete, 1); 63964 } else { 63965 newTags.push(newElement); 63966 } 63967 }); 63968 } 63969 oldTags.forEach((tag) => tag.parentNode?.removeChild(tag));
63970 newTags.forEach((tag) => headElement.appendChild(tag)); 63971 return { 63972 oldTags, 63973 newTags 63974 }; 63975}; 63976var updateAttributes = (tagName, attributes) => { 63977 const elementTag = document.getElementsByTagName(tagName)[0]; 63978 if (!elementTag) { 63979 return; 63980 } 63981 const helmetAttributeString = elementTag.getAttribute(HELMET_ATTRIBUTE); 63982 const helmetAttributes = helmetAttributeString ? helmetAttributeString.split(",") : []; 63983 const attributesToRemove = [...helmetAttributes]; 63984 const attributeKeys = Object.keys(attributes); 63985 for (const attribute of attributeKeys) { 63986 const value = attributes[attribute] || ""; 63987 if (elementTag.getAttribute(attribute) !== value) { 63988 elementTag.setAttribute(attribute, value); 63989 } 63990 if (helmetAttributes.indexOf(attribute) === -1) { 63991 helmetAttributes.push(attribute); 63992 } 63993 const indexToSave = attributesToRemove.indexOf(attribute); 63994 if (indexToSave !== -1) { 63995 attributesToRemove.splice(indexToSave, 1); 63996 } 63997 } 63998 for (let i = attributesToRemove.length - 1; i >= 0; i -= 1) { 63999 elementTag.removeAttribute(attributesToRemove[i]); 64000 } 64001 if (helmetAttributes.length === attributesToRemove.length) { 64002 elementTag.removeAttribute(HELMET_ATTRIBUTE); 64003 } else if (elementTag.getAttribute(HELMET_ATTRIBUTE) !== attributeKeys.join(",")) { 64004 elementTag.setAttribute(HELMET_ATTRIBUTE, attributeKeys.join(",")); 64005 } 64006}; 64007var updateTitle = (title, attributes) => { 64008 if (typeof title !== "undefined" && document.title !== title) { 64009 document.title = flattenArray(title); 64010 } 64011 updateAttributes("title" /* TITLE */, attributes); 64012}; 64013var commitTagChanges = (newState, cb) => { 64014 const { 64015 baseTag, 64016 bodyAttributes, 64017 htmlAttributes, 64018 linkTags, 64019 metaTags, 64020 noscriptTags, 64021 onChangeClientState, 64022 scriptTags, 64023 styleTags, 64024 title, 64025 titleAttributes 64026 } = newState; 64027 updateAttributes("body" /* BODY */, bodyAttributes); 64028 updateAttributes("html" /* HTML */, htmlAttributes); 64029 updateTitle(title, titleAttributes); 64030 const tagUpdates = { 64031 baseTag: updateTags("base" /* BASE */, baseTag), 64032 linkTags: updateTags("link" /* LINK */, linkTags), 64033 metaTags: updateTags("meta" /* META */, metaTags), 64034 noscriptTags: updateTags("noscript" /* NOSCRIPT */, noscriptTags), 64035 scriptTags: updateTags("script" /* SCRIPT */, scriptTags), 64036 styleTags: updateTags("style" /* STYLE */, styleTags) 64037 }; 64038 const addedTags = {}; 64039 const removedTags = {}; 64040 Object.keys(tagUpdates).forEach((tagType) => { 64041 const { newTags, oldTags } = tagUpdates[tagType]; 64042 if (newTags.length) { 64043 addedTags[tagType] = newTags; 64044 } 64045 if (oldTags.length) { 64046 removedTags[tagType] = tagUpdates[tagType].oldTags; 64047 } 64048 }); 64049 if (cb) { 64050 cb(); 64051 } 64052 onChangeClientState(newState, addedTags, removedTags); 64053}; 64054var _helmetCallback = null; 64055var handleStateChangeOnClient = (newState) => { 64056 if (_helmetCallback) { 64057 cancelAnimationFrame(_helmetCallback); 64058 } 64059 if (newState.defer) { 64060 _helmetCallback = requestAnimationFrame(() => { 64061 commitTagChanges(newState, () => { 64062 _helmetCallback = null; 64063 }); 64064 }); 64065 } else { 64066 commitTagChanges(newState); 64067 _helmetCallback = null; 64068 } 64069}; 64070var client_default = handleStateChangeOnClient; 64071
64072// src/Dispatcher.tsx 64073var HelmetDispatcher = class extends react__WEBPACK_IMPORTED_MODULE_0__.Component { 64074 rendered = false; 64075 shouldComponentUpdate(nextProps) { 64076 return !shallowequal__WEBPACK_IMPORTED_MODULE_3___default()(nextProps, this.props); 64077 } 64078 componentDidUpdate() { 64079 this.emitChange(); 64080 } 64081 componentWillUnmount() { 64082 const { helmetInstances } = this.props.context; 64083 helmetInstances.remove(this); 64084 this.emitChange(); 64085 } 64086 emitChange() { 64087 const { helmetInstances, setHelmet } = this.props.context; 64088 let serverState = null; 64089 const state = reducePropsToState( 64090 helmetInstances.get().map((instance) => { 64091 const props = { ...instance.props }; 64092 delete props.context; 64093 return props; 64094 }) 64095 ); 64096 if (HelmetProvider.canUseDOM) { 64097 client_default(state); 64098 } else if (server_default) { 64099 serverState = server_default(state); 64100 } 64101 setHelmet(serverState); 64102 } 64103 // componentWillMount will be deprecated 64104 // for SSR, initialize on first render 64105 // constructor is also unsafe in StrictMode 64106 init() { 64107 if (this.rendered) { 64108 return; 64109 } 64110 this.rendered = true; 64111 const { helmetInstances } = this.props.context; 64112 helmetInstances.add(this); 64113 this.emitChange(); 64114 } 64115 render() { 64116 this.init(); 64117 return null; 64118 } 64119}; 64120
64121// src/index.tsx 64122var Helmet = class extends react__WEBPACK_IMPORTED_MODULE_0__.Component { 64123 static defaultProps = { 64124 defer: true, 64125 encodeSpecialCharacters: true, 64126 prioritizeSeoTags: false 64127 }; 64128 shouldComponentUpdate(nextProps) { 64129 return !react_fast_compare__WEBPACK_IMPORTED_MODULE_1___default()(without(this.props, "helmetData"), without(nextProps, "helmetData")); 64130 } 64131 mapNestedChildrenToProps(child, nestedChildren) { 64132 if (!nestedChildren) { 64133 return null; 64134 } 64135 switch (child.type) { 64136 case "script" /* SCRIPT */: 64137 case "noscript" /* NOSCRIPT */: 64138 return { 64139 innerHTML: nestedChildren 64140 }; 64141 case "style" /* STYLE */: 64142 return { 64143 cssText: nestedChildren 64144 }; 64145 default: 64146 throw new Error( 64147 `<${child.type} /> elements are self-closing and can not contain children. Refer to our API for more information.` 64148 ); 64149 } 64150 } 64151 flattenArrayTypeChildren(child, arrayTypeChildren, newChildProps, nestedChildren) { 64152 return { 64153 ...arrayTypeChildren, 64154 [child.type]: [ 64155 ...arrayTypeChildren[child.type] || [], 64156 { 64157 ...newChildProps, 64158 ...this.mapNestedChildrenToProps(child, nestedChildren) 64159 } 64160 ] 64161 }; 64162 } 64163 mapObjectTypeChildren(child, newProps, newChildProps, nestedChildren) { 64164 switch (child.type) { 64165 case "title" /* TITLE */: 64166 return { 64167 ...newProps, 64168 [child.type]: nestedChildren, 64169 titleAttributes: { ...newChildProps } 64170 }; 64171 case "body" /* BODY */: 64172 return { 64173 ...newProps, 64174 bodyAttributes: { ...newChildProps } 64175 }; 64176 case "html" /* HTML */: 64177 return { 64178 ...newProps, 64179 htmlAttributes: { ...newChildProps } 64180 }; 64181 default: 64182 return { 64183 ...newProps, 64184 [child.type]: { ...newChildProps } 64185 }; 64186 } 64187 } 64188 mapArrayTypeChildrenToProps(arrayTypeChildren, newProps) { 64189 let newFlattenedProps = { ...newProps }; 64190 Object.keys(arrayTypeChildren).forEach((arrayChildName) => { 64191 newFlattenedProps = { 64192 ...newFlattenedProps, 64193 [arrayChildName]: arrayTypeChildren[arrayChildName] 64194 }; 64195 }); 64196 return newFlattenedProps; 64197 }
64198 warnOnInvalidChildren(child, nestedChildren) { 64199 invariant__WEBPACK_IMPORTED_MODULE_2___default()( 64200 VALID_TAG_NAMES.some((name) => child.type === name), 64201 typeof child.type === "function" ? `You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.` : `Only elements types ${VALID_TAG_NAMES.join( 64202 ", " 64203 )} are allowed. Helmet does not support rendering <${child.type}> elements. Refer to our API for more information.` 64204 ); 64205 invariant__WEBPACK_IMPORTED_MODULE_2___default()( 64206 !nestedChildren || typeof nestedChildren === "string" || Array.isArray(nestedChildren) && !nestedChildren.some((nestedChild) => typeof nestedChild !== "string"), 64207 `Helmet expects a string as a child of <${child.type}>. Did you forget to wrap your children in braces? ( <${child.type}>{\`\`}</${child.type}> ) Refer to our API for more information.` 64208 ); 64209 return true; 64210 } 64211 mapChildrenToProps(children, newProps) { 64212 let arrayTypeChildren = {}; 64213 react__WEBPACK_IMPORTED_MODULE_0__.Children.forEach(children, (child) => { 64214 if (!child || !child.props) { 64215 return; 64216 } 64217 const { children: nestedChildren, ...childProps } = child.props; 64218 const newChildProps = Object.keys(childProps).reduce((obj, key) => { 64219 obj[HTML_TAG_MAP[key] || key] = childProps[key]; 64220 return obj; 64221 }, {}); 64222 let { type } = child; 64223 if (typeof type === "symbol") { 64224 type = type.toString(); 64225 } else {
64226 this.warnOnInvalidChildren(child, nestedChildren); 64227 } 64228 switch (type) { 64229 case "Symbol(react.fragment)" /* FRAGMENT */: 64230 newProps = this.mapChildrenToProps(nestedChildren, newProps); 64231 break; 64232 case "link" /* LINK */: 64233 case "meta" /* META */: 64234 case "noscript" /* NOSCRIPT */: 64235 case "script" /* SCRIPT */: 64236 case "style" /* STYLE */: 64237 arrayTypeChildren = this.flattenArrayTypeChildren( 64238 child, 64239 arrayTypeChildren, 64240 newChildProps, 64241 nestedChildren 64242 ); 64243 break; 64244 default: 64245 newProps = this.mapObjectTypeChildren(child, newProps, newChildProps, nestedChildren); 64246 break; 64247 } 64248 }); 64249 return this.mapArrayTypeChildrenToProps(arrayTypeChildren, newProps); 64250 } 64251 render() { 64252 const { children, ...props } = this.props; 64253 let newProps = { ...props }; 64254 let { helmetData } = props; 64255 if (children) { 64256 newProps = this.mapChildrenToProps(children, newProps); 64257 } 64258 if (helmetData && !(helmetData instanceof HelmetData)) { 64259 const data = helmetData; 64260 helmetData = new HelmetData(data.context, true); 64261 delete newProps.helmetData; 64262 } 64263 return helmetData ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(HelmetDispatcher, { ...newProps, context: helmetData.value }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Context.Consumer, null, (context) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(HelmetDispatcher, { ...newProps, context })); 64264 } 64265}; 64266 64267 64268 64269/***/ }, 64270 64271/***/ 22799 64272(__unused_webpack_module, exports) { 64273 64274"use strict"; 64275/** @license React v16.13.1 64276 * react-is.production.min.js 64277 * 64278 * Copyright (c) Facebook, Inc. and its affiliates. 64279 * 64280 * This source code is licensed under the MIT license found in the 64281 * LICENSE file in the root directory of this source tree. 64282 */ 64283 64284var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? 64285Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; 64286function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d; 64287exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t}; 64288exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p}; 64289exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};
64289exports.typeOf=z; 64290 64291 64292/***/ }, 64293 64294/***/ 44363 64295(module, __unused_webpack_exports, __webpack_require__) { 64296 64297"use strict"; 64298 64299 64300if (true) { 64301 module.exports = __webpack_require__(22799); 64302} else // removed by dead control flow 64303{} 64304 64305 64306/***/ }, 64307 64308/***/ 67808 64309(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 64310 64311"use strict"; 64312 64313// EXPORTS 64314__webpack_require__.d(__webpack_exports__, { 64315 $: () => (/* binding */ ReactMarkdown) 64316}); 64317 64318// NAMESPACE OBJECT: ./node_modules/micromark/lib/constructs.js 64319var constructs_namespaceObject = {}; 64320__webpack_require__.r(constructs_namespaceObject); 64321__webpack_require__.d(constructs_namespaceObject, { 64322 attentionMarkers: () => (attentionMarkers), 64323 contentInitial: () => (contentInitial), 64324 disable: () => (disable), 64325 document: () => (constructs_document), 64326 flow: () => (constructs_flow), 64327 flowInitial: () => (flowInitial), 64328 insideSpan: () => (insideSpan), 64329 string: () => (constructs_string), 64330 text: () => (constructs_text) 64331}); 64332 64333// NAMESPACE OBJECT: ./node_modules/property-information/lib/util/types.js 64334var types_namespaceObject = {}; 64335__webpack_require__.r(types_namespaceObject); 64336__webpack_require__.d(types_namespaceObject, { 64337 boolean: () => (types_boolean), 64338 booleanish: () => (booleanish), 64339 commaOrSpaceSeparated: () => (commaOrSpaceSeparated), 64340 commaSeparated: () => (commaSeparated), 64341 number: () => (number), 64342 overloadedBoolean: () => (overloadedBoolean), 64343 spaceSeparated: () => (spaceSeparated) 64344}); 64345 64346// EXTERNAL MODULE: ./node_modules/react/index.js 64347var react = __webpack_require__(96540); 64348// EXTERNAL MODULE: ./node_modules/is-buffer/index.js 64349var is_buffer = __webpack_require__(87206); 64350var is_buffer_default = /*#__PURE__*/__webpack_require__.n(is_buffer); 64351;// ./node_modules/unist-util-stringify-position/lib/index.js 64352/** 64353 * @typedef {import('unist').Node} Node 64354 * @typedef {import('unist').Point} Point 64355 * @typedef {import('unist').Position} Position 64356 */ 64357 64358/** 64359 * @typedef NodeLike 64360 * @property {string} type 64361 * @property {PositionLike | null | undefined} [position] 64362 * 64363 * @typedef PositionLike 64364 * @property {PointLike | null | undefined} [start] 64365 * @property {PointLike | null | undefined} [end] 64366 * 64367 * @typedef PointLike 64368 * @property {number | null | undefined} [line] 64369 * @property {number | null | undefined} [column] 64370 * @property {number | null | undefined} [offset] 64371 */ 64372 64373/** 64374 * Serialize the positional info of a point, position (start and end points), 64375 * or node. 64376 * 64377 * @param {Node | NodeLike | Position | PositionLike | Point | PointLike | null | undefined} [value] 64378 * Node, position, or point. 64379 * @returns {string} 64380 * Pretty printed positional info of a node (`string`). 64381 * 64382 * In the format of a range `ls:cs-le:ce` (when given `node` or `position`) 64383 * or a point `l:c` (when given `point`), where `l` stands for line, `c` for 64384 * column, `s` for `start`, and `e` for end. 64385 * An empty string (`''`) is returned if the given value is neither `node`, 64386 * `position`, nor `point`. 64387 */ 64388function stringifyPosition(value) { 64389 // Nothing. 64390 if (!value || typeof value !== 'object') { 64391 return '' 64392 } 64393 64394 // Node. 64395 if ('position' in value || 'type' in value) { 64396 return position(value.position) 64397 } 64398 64399 // Position. 64400 if ('start' in value || 'end' in value) { 64401 return position(value) 64402 } 64403 64404 // Point. 64405 if ('line' in value || 'column' in value) { 64406 return point(value) 64407 } 64408 64409 // ? 64410 return '' 64411} 64412 64413/** 64414 * @param {Point | PointLike | null | undefined} point 64415 * @returns {string} 64416 */ 64417function point(point) { 64418 return index(point && point.line) + ':' + index(point && point.column) 64419} 64420 64421/** 64422 * @param {Position | PositionLike | null | undefined} pos 64423 * @returns {string} 64424 */ 64425function position(pos) { 64426 return point(pos && pos.start) + '-' + point(pos && pos.end) 64427} 64428 64429/** 64430 * @param {number | null | undefined} value 64431 * @returns {number} 64432 */ 64433function index(value) { 64434 return value && typeof value === 'number' ? value : 1 64435} 64436 64437;// ./node_modules/vfile-message/lib/index.js 64438/** 64439 * @typedef {import('unist').Node} Node 64440 * @typedef {import('unist').Position} Position 64441 * @typedef {import('unist').Point} Point 64442 * @typedef {object & {type: string, position?: Position | undefined}} NodeLike 64443 */ 64444 64445 64446 64447/** 64448 * Message. 64449 */
64450class VFileMessage extends Error { 64451 /** 64452 * Create a message for `reason` at `place` from `origin`. 64453 * 64454 * When an error is passed in as `reason`, the `stack` is copied. 64455 * 64456 * @param {string | Error | VFileMessage} reason 64457 * Reason for message, uses the stack and message of the error if given. 64458 * 64459 * > ð **Note**: you should use markdown. 64460 * @param {Node | NodeLike | Position | Point | null | undefined} [place] 64461 * Place in file where the message occurred. 64462 * @param {string | null | undefined} [origin] 64463 * Place in code where the message originates (example: 64464 * `'my-package:my-rule'` or `'my-rule'`). 64465 * @returns 64466 * Instance of `VFileMessage`. 64467 */ 64468 // To do: next major: expose `undefined` everywhere instead of `null`. 64469 constructor(reason, place, origin) { 64470 /** @type {[string | null, string | null]} */ 64471 const parts = [null, null] 64472 /** @type {Position} */ 64473 let position = { 64474 // @ts-expect-error: we always follows the structure of `position`. 64475 start: {line: null, column: null}, 64476 // @ts-expect-error: " 64477 end: {line: null, column: null} 64478 } 64479 64480 super() 64481 64482 if (typeof place === 'string') { 64483 origin = place 64484 place = undefined 64485 } 64486 64487 if (typeof origin === 'string') { 64488 const index = origin.indexOf(':') 64489 64490 if (index === -1) { 64491 parts[1] = origin 64492 } else { 64493 parts[0] = origin.slice(0, index) 64494 parts[1] = origin.slice(index + 1) 64495 } 64496 } 64497 64498 if (place) { 64499 // Node. 64500 if ('type' in place || 'position' in place) { 64501 if (place.position) { 64502 // To do: next major: deep clone. 64503 // @ts-expect-error: looks like a position. 64504 position = place.position 64505 } 64506 } 64507 // Position. 64508 else if ('start' in place || 'end' in place) { 64509 // @ts-expect-error: looks like a position. 64510 // To do: next major: deep clone. 64511 position = place 64512 } 64513 // Point. 64514 else if ('line' in place || 'column' in place) { 64515 // To do: next major: deep clone. 64516 position.start = place 64517 } 64518 } 64519 64520 // Fields from `Error`. 64521 /** 64522 * Serialized positional info of error. 64523 * 64524 * On normal errors, this would be something like `ParseError`, buit in 64525 * `VFile` messages we use this space to show where an error happened. 64526 */ 64527 this.name = stringifyPosition(place) || '1:1' 64528 64529 /** 64530 * Reason for message. 64531 * 64532 * @type {string} 64533 */ 64534 this.message = typeof reason === 'object' ? reason.message : reason 64535 64536 /** 64537 * Stack of message. 64538 * 64539 * This is used by normal errors to show where something happened in 64540 * programming code, irrelevant for `VFile` messages, 64541 * 64542 * @type {string} 64543 */ 64544 this.stack = '' 64545 64546 if (typeof reason === 'object' && reason.stack) { 64547 this.stack = reason.stack 64548 } 64549 64550 /** 64551 * Reason for message. 64552 * 64553 * > ð **Note**: you should use markdown. 64554 * 64555 * @type {string} 64556 */ 64557 this.reason = this.message 64558 64559 /* eslint-disable no-unused-expressions */ 64560 /** 64561 * State of problem. 64562 * 64563 * * `true` â marks associated file as no longer processable (error) 64564 * * `false` â necessitates a (potential) change (warning) 64565 * * `null | undefined` â for things that might not need changing (info) 64566 * 64567 * @type {boolean | null | undefined} 64568 */ 64569 this.fatal 64570 64571 /** 64572 * Starting line of error. 64573 * 64574 * @type {number | null} 64575 */ 64576 this.line = position.start.line 64577 64578 /** 64579 * Starting column of error. 64580 * 64581 * @type {number | null} 64582 */ 64583 this.column = position.start.column 64584 64585 /** 64586 * Full unist position. 64587 * 64588 * @type {Position | null} 64589 */ 64590 this.position = position 64591 64592 /** 64593 * Namespace of message (example: `'my-package'`). 64594 * 64595 * @type {string | null} 64596 */ 64597 this.source = parts[0] 64598 64599 /** 64600 * Category of message (example: `'my-rule'`). 64601 * 64602 * @type {string | null} 64603 */ 64604 this.ruleId = parts[1] 64605 64606 /** 64607 * Path of a file (used throughout the `VFile` ecosystem). 64608 * 64609 * @type {string | null} 64610 */ 64611 this.file
64612 64613 // The following fields are âwell knownâ. 64614 // Not standard. 64615 // Feel free to add other non-standard fields to your messages. 64616 64617 /** 64618 * Specify the source value thatâs being reported, which is deemed 64619 * incorrect. 64620 * 64621 * @type {string | null} 64622 */ 64623 this.actual 64624 64625 /** 64626 * Suggest acceptable values that can be used instead of `actual`. 64627 * 64628 * @type {Array<string> | null} 64629 */ 64630 this.expected 64631 64632 /** 64633 * Link to docs for the message. 64634 * 64635 * > ð **Note**: this must be an absolute URL that can be passed as `x` 64636 * > to `new URL(x)`. 64637 * 64638 * @type {string | null} 64639 */ 64640 this.url 64641 64642 /** 64643 * Long form description of the message (you should use markdown). 64644 * 64645 * @type {string | null} 64646 */ 64647 this.note 64648 /* eslint-enable no-unused-expressions */ 64649 } 64650} 64651 64652VFileMessage.prototype.file = '' 64653VFileMessage.prototype.name = '' 64654VFileMessage.prototype.reason = '' 64655VFileMessage.prototype.message = '' 64656VFileMessage.prototype.stack = '' 64657VFileMessage.prototype.fatal = null 64658VFileMessage.prototype.column = null 64659VFileMessage.prototype.line = null 64660VFileMessage.prototype.source = null 64661VFileMessage.prototype.ruleId = null 64662VFileMessage.prototype.position = null 64663 64664;// ./node_modules/vfile/lib/minpath.browser.js 64665// A derivative work based on: 64666// <https://github.com/browserify/path-browserify>. 64667// Which is licensed: 64668// 64669// MIT License 64670// 64671// Copyright (c) 2013 James Halliday 64672// 64673// Permission is hereby granted, free of charge, to any person obtaining a copy of 64674// this software and associated documentation files (the "Software"), to deal in 64675// the Software without restriction, including without limitation the rights to 64676// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 64677// the Software, and to permit persons to whom the Software is furnished to do so, 64678// subject to the following conditions: 64679// 64680// The above copyright notice and this permission notice shall be included in all 64681// copies or substantial portions of the Software. 64682// 64683// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 64684// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 64685// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 64686// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 64687// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 64688// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 64689// A derivative work based on: 64690// 64691// Parts of that are extracted from Nodeâs internal `path` module: 64692// <https://github.com/nodejs/node/blob/master/lib/path.js>. 64693// Which is licensed: 64694// 64695// Copyright Joyent, Inc. and other Node contributors. 64696// 64697// Permission is hereby granted, free of charge, to any person obtaining a 64698// copy of this software and associated documentation files (the 64699// "Software"), to deal in the Software without restriction, including 64700// without limitation the rights to use, copy, modify, merge, publish, 64701// distribute, sublicense, and/or sell copies of the Software, and to permit 64702// persons to whom the Software is furnished to do so, subject to the 64703// following conditions: 64704// 64705// The above copyright notice and this permission notice shall be included 64706// in all copies or substantial portions of the Software. 64707// 64708// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 64709// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 64710// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 64711// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 64712// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 64713// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 64714// USE OR OTHER DEALINGS IN THE SOFTWARE. 64715 64716const path = {basename, dirname, extname, join, sep: '/'} 64717 64718/* eslint-disable max-depth, complexity */ 64719 64720/**
64721 * Get the basename from a path. 64722 * 64723 * @param {string} path 64724 * File path. 64725 * @param {string | undefined} [ext] 64726 * Extension to strip. 64727 * @returns {string} 64728 * Stem or basename. 64729 */ 64730function basename(path, ext) { 64731 if (ext !== undefined && typeof ext !== 'string') { 64732 throw new TypeError('"ext" argument must be a string') 64733 } 64734 64735 assertPath(path) 64736 let start = 0 64737 let end = -1 64738 let index = path.length 64739 /** @type {boolean | undefined} */ 64740 let seenNonSlash 64741 64742 if (ext === undefined || ext.length === 0 || ext.length > path.length) { 64743 while (index--) { 64744 if (path.charCodeAt(index) === 47 /* `/` */) { 64745 // If we reached a path separator that was not part of a set of path 64746 // separators at the end of the string, stop now. 64747 if (seenNonSlash) { 64748 start = index + 1 64749 break 64750 } 64751 } else if (end < 0) { 64752 // We saw the first non-path separator, mark this as the end of our 64753 // path component. 64754 seenNonSlash = true 64755 end = index + 1 64756 } 64757 } 64758 64759 return end < 0 ? '' : path.slice(start, end) 64760 } 64761 64762 if (ext === path) { 64763 return '' 64764 } 64765 64766 let firstNonSlashEnd = -1 64767 let extIndex = ext.length - 1 64768 64769 while (index--) { 64770 if (path.charCodeAt(index) === 47 /* `/` */) { 64771 // If we reached a path separator that was not part of a set of path 64772 // separators at the end of the string, stop now. 64773 if (seenNonSlash) { 64774 start = index + 1 64775 break 64776 } 64777 } else { 64778 if (firstNonSlashEnd < 0) { 64779 // We saw the first non-path separator, remember this index in case 64780 // we need it if the extension ends up not matching. 64781 seenNonSlash = true 64782 firstNonSlashEnd = index + 1 64783 } 64784 64785 if (extIndex > -1) { 64786 // Try to match the explicit extension. 64787 if (path.charCodeAt(index) === ext.charCodeAt(extIndex--)) { 64788 if (extIndex < 0) { 64789 // We matched the extension, so mark this as the end of our path 64790 // component 64791 end = index 64792 } 64793 } else { 64794 // Extension does not match, so our result is the entire path 64795 // component 64796 extIndex = -1 64797 end = firstNonSlashEnd 64798 } 64799 } 64800 } 64801 } 64802 64803 if (start === end) { 64804 end = firstNonSlashEnd 64805 } else if (end < 0) { 64806 end = path.length 64807 } 64808 64809 return path.slice(start, end) 64810} 64811 64812/** 64813 * Get the dirname from a path. 64814 * 64815 * @param {string} path 64816 * File path. 64817 * @returns {string} 64818 * File path. 64819 */ 64820function dirname(path) { 64821 assertPath(path) 64822 64823 if (path.length === 0) { 64824 return '.' 64825 } 64826 64827 let end = -1 64828 let index = path.length 64829 /** @type {boolean | undefined} */ 64830 let unmatchedSlash 64831 64832 // Prefix `--` is important to not run on `0`. 64833 while (--index) { 64834 if (path.charCodeAt(index) === 47 /* `/` */) { 64835 if (unmatchedSlash) { 64836 end = index 64837 break 64838 } 64839 } else if (!unmatchedSlash) { 64840 // We saw the first non-path separator 64841 unmatchedSlash = true 64842 } 64843 } 64844 64845 return end < 0 64846 ? path.charCodeAt(0) === 47 /* `/` */ 64847 ? '/' 64848 : '.' 64849 : end === 1 && path.charCodeAt(0) === 47 /* `/` */ 64850 ? '//' 64851 : path.slice(0, end) 64852} 64853 64854/** 64855 * Get an extname from a path. 64856 * 64857 * @param {string} path 64858 * File path. 64859 * @returns {string} 64860 * Extname. 64861 */ 64862function extname(path) { 64863 assertPath(path) 64864 64865 let index = path.length 64866 64867 let end = -1 64868 let startPart = 0 64869 let startDot = -1 64870 // Track the state of characters (if any) we see before our first dot and 64871 // after any path separator we find. 64872 let preDotState = 0 64873 /** @type {boolean | undefined} */ 64874 let unmatchedSlash 64875 64876 while (index--) { 64877 const code = path.charCodeAt(index) 64878 64879 if (code === 47 /* `/` */) { 64880 // If we reached a path separator that was not part of a set of path 64881 // separators at the end of the string, stop now. 64882 if (unmatchedSlash) { 64883 startPart = index + 1 64884 break 64885 } 64886 64887 continue 64888 } 64889 64890 if (end < 0) { 64891 // We saw the first non-path separator, mark this as the end of our 64892 // extension. 64893 unmatchedSlash = true 64894 end = index + 1 64895 } 64896 64897 if (code === 46 /* `.` */) { 64898 // If this is our first dot, mark it as the start of our extension. 64899 if (startDot < 0) { 64900 startDot = index 64901 } else if (preDotState !== 1) { 64902 preDotState = 1 64903 } 64904 } else if (startDot > -1) { 64905 // We saw a non-dot and non-path separator before our dot, so we should 64906 // have a good chance at having a non-empty extension. 64907 preDotState = -1 64908 } 64909 } 64910 64911 if ( 64912 startDot < 0 || 64913 end < 0 || 64914 // We saw a non-dot character immediately before the dot. 64915 preDotState === 0 || 64916 // The (right-most) trimmed path component is exactly `..`. 64917 (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) 64918 ) { 64919 return '' 64920 } 64921 64922 return path.slice(startDot, end) 64923} 64924 64925/** 64926 * Join segments from a path. 64927 * 64928 * @param {Array<string>} segments 64929 * Path segments. 64930 * @returns {string} 64931 * File path. 64932 */ 64933function join(...segments) { 64934 let index = -1 64935 /** @type {string | undefined} */ 64936 let joined 64937 64938 while (++index < segments.length) { 64939 assertPath(segments[index]) 64940 64941 if (segments[index]) { 64942 joined = 64943 joined === undefined ? segments[index] : joined + '/' + segments[index] 64944 } 64945 } 64946 64947 return joined === undefined ? '.' : normalize(joined) 64948} 64949 64950/** 64951 * Normalize a basic file path. 64952 * 64953 * @param {string} path 64954 * File path. 64955 * @returns {string} 64956 * File path. 64957 */ 64958// Note: `normalize` is not exposed as `path.normalize`, so some code is 64959// manually removed from it. 64960function normalize(path) { 64961 assertPath(path) 64962 64963 const absolute = path.charCodeAt(0) === 47 /* `/` */ 64964 64965 // Normalize the path according to POSIX rules.
64966 let value = normalizeString(path, !absolute) 64967 64968 if (value.length === 0 && !absolute) { 64969 value = '.' 64970 } 64971 64972 if (value.length > 0 && path.charCodeAt(path.length - 1) === 47 /* / */) { 64973 value += '/' 64974 } 64975 64976 return absolute ? '/' + value : value 64977} 64978 64979/** 64980 * Resolve `.` and `..` elements in a path with directory names. 64981 * 64982 * @param {string} path 64983 * File path. 64984 * @param {boolean} allowAboveRoot 64985 * Whether `..` can move above root. 64986 * @returns {string} 64987 * File path. 64988 */ 64989function normalizeString(path, allowAboveRoot) { 64990 let result = '' 64991 let lastSegmentLength = 0 64992 let lastSlash = -1 64993 let dots = 0 64994 let index = -1 64995 /** @type {number | undefined} */ 64996 let code 64997 /** @type {number} */ 64998 let lastSlashIndex 64999 65000 while (++index <= path.length) { 65001 if (index < path.length) { 65002 code = path.charCodeAt(index) 65003 } else if (code === 47 /* `/` */) { 65004 break 65005 } else { 65006 code = 47 /* `/` */ 65007 } 65008 65009 if (code === 47 /* `/` */) { 65010 if (lastSlash === index - 1 || dots === 1) { 65011 // Empty. 65012 } else if (lastSlash !== index - 1 && dots === 2) { 65013 if ( 65014 result.length < 2 || 65015 lastSegmentLength !== 2 || 65016 result.charCodeAt(result.length - 1) !== 46 /* `.` */ || 65017 result.charCodeAt(result.length - 2) !== 46 /* `.` */ 65018 ) { 65019 if (result.length > 2) { 65020 lastSlashIndex = result.lastIndexOf('/') 65021 65022 if (lastSlashIndex !== result.length - 1) { 65023 if (lastSlashIndex < 0) { 65024 result = '' 65025 lastSegmentLength = 0 65026 } else { 65027 result = result.slice(0, lastSlashIndex) 65028 lastSegmentLength = result.length - 1 - result.lastIndexOf('/') 65029 } 65030 65031 lastSlash = index 65032 dots = 0 65033 continue 65034 } 65035 } else if (result.length > 0) { 65036 result = '' 65037 lastSegmentLength = 0 65038 lastSlash = index 65039 dots = 0 65040 continue 65041 } 65042 } 65043 65044 if (allowAboveRoot) { 65045 result = result.length > 0 ? result + '/..' : '..' 65046 lastSegmentLength = 2 65047 } 65048 } else { 65049 if (result.length > 0) { 65050 result += '/' + path.slice(lastSlash + 1, index) 65051 } else { 65052 result = path.slice(lastSlash + 1, index) 65053 } 65054 65055 lastSegmentLength = index - lastSlash - 1 65056 } 65057 65058 lastSlash = index 65059 dots = 0 65060 } else if (code === 46 /* `.` */ && dots > -1) { 65061 dots++ 65062 } else { 65063 dots = -1 65064 } 65065 } 65066 65067 return result 65068} 65069 65070/** 65071 * Make sure `path` is a string. 65072 * 65073 * @param {string} path 65074 * File path. 65075 * @returns {asserts path is string} 65076 * Nothing. 65077 */ 65078function assertPath(path) { 65079 if (typeof path !== 'string') { 65080 throw new TypeError( 65081 'Path must be a string. Received ' + JSON.stringify(path) 65082 ) 65083 } 65084} 65085 65086/* eslint-enable max-depth, complexity */ 65087 65088;// ./node_modules/vfile/lib/minproc.browser.js 65089// Somewhat based on: 65090// <https://github.com/defunctzombie/node-process/blob/master/browser.js>. 65091// But I donât think one tiny line of code can be copyrighted. ð 65092const proc = {cwd} 65093 65094function cwd() { 65095 return '/' 65096} 65097 65098;// ./node_modules/vfile/lib/minurl.shared.js 65099/** 65100 * @typedef URL 65101 * @property {string} hash 65102 * @property {string} host 65103 * @property {string} hostname 65104 * @property {string} href 65105 * @property {string} origin 65106 * @property {string} password 65107 * @property {string} pathname 65108 * @property {string} port 65109 * @property {string} protocol 65110 * @property {string} search 65111 * @property {any} searchParams 65112 * @property {string} username 65113 * @property {() => string} toString 65114 * @property {() => string} toJSON 65115 */ 65116 65117/** 65118 * Check if `fileUrlOrPath` looks like a URL. 65119 * 65120 * @param {unknown} fileUrlOrPath 65121 * File path or URL. 65122 * @returns {fileUrlOrPath is URL} 65123 * Whether itâs a URL. 65124 */ 65125// From: <https://github.com/nodejs/node/blob/fcf8ba4/lib/internal/url.js#L1501> 65126function isUrl(fileUrlOrPath) { 65127 return ( 65128 fileUrlOrPath !== null && 65129 typeof fileUrlOrPath === 'object' && 65130 // @ts-expect-error: indexable. 65131 fileUrlOrPath.href && 65132 // @ts-expect-error: indexable. 65133 fileUrlOrPath.origin 65134 ) 65135} 65136 65137;// ./node_modules/vfile/lib/minurl.browser.js 65138/// <reference lib="dom" /> 65139 65140 65141 65142// See: <https://github.com/nodejs/node/blob/fcf8ba4/lib/internal/url.js> 65143 65144/** 65145 * @param {string | URL} path 65146 * File URL. 65147 * @returns {string} 65148 * File URL. 65149 */ 65150function urlToPath(path) { 65151 if (typeof path === 'string') { 65152 path = new URL(path) 65153 } else if (!isUrl(path)) { 65154 /** @type {NodeJS.ErrnoException} */ 65155 const error = new TypeError( 65156 'The "path" argument must be of type string or an instance of URL. Received `' + 65157 path + 65158 '`' 65159 ) 65160 error.code = 'ERR_INVALID_ARG_TYPE' 65161 throw error 65162 } 65163 65164 if (path.protocol !== 'file:') { 65165 /** @type {NodeJS.ErrnoException} */ 65166 const error = new TypeError('The URL must be of scheme file') 65167 error.code = 'ERR_INVALID_URL_SCHEME' 65168 throw error 65169 } 65170 65171 return getPathFromURLPosix(path) 65172} 65173 65174/** 65175 * Get a path from a POSIX URL. 65176 * 65177 * @param {URL} url 65178 * URL. 65179 * @returns {string} 65180 * File path. 65181 */ 65182function getPathFromURLPosix(url) { 65183 if (url.hostname !== '') { 65184 /** @type {NodeJS.ErrnoException} */ 65185 const error = new TypeError( 65186 'File URL host must be "localhost" or empty on darwin' 65187 ) 65188 error.code = 'ERR_INVALID_FILE_URL_HOST' 65189 throw error 65190 } 65191 65192 const pathname = url.pathname 65193 let index = -1 65194 65195 while (++index < pathname.length) { 65196 if ( 65197 pathname.charCodeAt(index) === 37 /* `%` */ && 65198 pathname.charCodeAt(index + 1) === 50 /* `2` */ 65199 ) { 65200 const third = pathname.charCodeAt(index + 2) 65201 if (third === 70 /* `F` */ || third === 102 /* `f` */) { 65202 /** @type {NodeJS.ErrnoException} */ 65203 const error = new TypeError( 65204 'File URL path must not include encoded / characters' 65205 ) 65206 error.code = 'ERR_INVALID_FILE_URL_PATH' 65207 throw error 65208 } 65209 } 65210 } 65211 65212 return decodeURIComponent(pathname) 65213} 65214 65215 65216 65217;// ./node_modules/vfile/lib/index.js 65218/** 65219 * @typedef {import('unist').Node} Node 65220 * @typedef {import('unist').Position} Position 65221 * @typedef {import('unist').Point} Point 65222 * @typedef {import('./minurl.shared.js').URL} URL 65223 * @typedef {import('../index.js').Data} Data 65224 * @typedef {import('../index.js').Value} Value 65225 */ 65226 65227/** 65228 * @typedef {Record<string, unknown> & {type: string, position?: Position | undefined}} NodeLike 65229 * 65230 * @typedef {'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'} BufferEncoding 65231 * Encodings supported by the buffer class. 65232 * 65233 * This is a copy of the types from Node, copied to prevent Node globals from 65234 * being needed. 65235 * Copied from: <https://github.com/DefinitelyTyped/DefinitelyTyped/blob/90a4ec8/types/node/buffer.d.ts#L170> 65236 * 65237 * @typedef {Options | URL | Value | VFile} Compatible 65238 * Things that can be passed to the constructor. 65239 * 65240 * @typedef VFileCoreOptions 65241 * Set multiple values. 65242 * @property {Value | null | undefined} [value] 65243 * Set `value`. 65244 * @property {string | null | undefined} [cwd] 65245 * Set `cwd`. 65246 * @property {Array<string> | null | undefined} [history] 65247 * Set `history`. 65248 * @property {URL | string | null | undefined} [path] 65249 * Set `path`. 65250 * @property {string | null | undefined} [basename] 65251 * Set `basename`. 65252 * @property {string | null | undefined} [stem] 65253 * Set `stem`. 65254 * @property {string | null | undefined} [extname] 65255 * Set `extname`. 65256 * @property {string | null | undefined} [dirname] 65257 * Set `dirname`. 65258 * @property {Data | null | undefined} [data] 65259 * Set `data`. 65260 * 65261 * @typedef Map 65262 * Raw source map. 65263 * 65264 * See: 65265 * <https://github.com/mozilla/source-map/blob/58819f0/source-map.d.ts#L15-L23>. 65266 * @property {number} version 65267 * Which version of the source map spec this map is following. 65268 * @property {Array<string>} sources 65269 * An array of URLs to the original source files. 65270 * @property {Array<string>} names 65271 * An array of identifiers which can be referenced by individual mappings. 65272 * @property {string | undefined} [sourceRoot] 65273 * The URL root from which all sources are relative. 65274 * @property {Array<string> | undefined} [sourcesContent] 65275 * An array of contents of the original source files. 65276 * @property {string} mappings 65277 * A string of base64 VLQs which contain the actual mappings. 65278 * @property {string} file 65279 * The generated file this source map is associated with. 65280 * 65281 * @typedef {{[key: string]: unknown} & VFileCoreOptions} Options 65282 * Configuration. 65283 * 65284 * A bunch of keys that will be shallow copied over to the new file. 65285 * 65286 * @typedef {Record<string, unknown>} ReporterSettings 65287 * Configuration for reporters. 65288 */ 65289 65290/** 65291 * @template {ReporterSettings} Settings 65292 * Options type. 65293 * @callback Reporter 65294 * Type for a reporter. 65295 * @param {Array<VFile>} files 65296 * Files to report. 65297 * @param {Settings} options 65298 * Configuration. 65299 * @returns {string} 65300 * Report. 65301 */ 65302 65303 65304 65305 65306 65307 65308 65309/** 65310 * Order of setting (least specific to most), we need this because otherwise 65311 * `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a 65312 * stem can be set. 65313 * 65314 * @type {Array<'basename' | 'dirname' | 'extname' | 'history' | 'path' | 'stem'>} 65315 */ 65316const order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname'] 65317 65318class VFile { 65319 /** 65320 * Create a new virtual file. 65321 * 65322 * `options` is treated as: 65323 * 65324 * * `string` or `Buffer` â `{value: options}` 65325 * * `URL` â `{path: options}` 65326 * * `VFile` â shallow copies its data over to the new file 65327 * * `object` â all fields are shallow copied over to the new file 65328 * 65329 * Path related fields are set in the following order (least specific to 65330 * most specific): `history`, `path`, `basename`, `stem`, `extname`, 65331 * `dirname`. 65332 * 65333 * You cannot set `dirname` or `extname` without setting either `history`, 65334 * `path`, `basename`, or `stem` too. 65335 * 65336 * @param {Compatible | null | undefined} [value] 65337 * File value. 65338 * @returns 65339 * New instance. 65340 */ 65341 constructor(value) { 65342 /** @type {Options | VFile} */ 65343 let options 65344 65345 if (!value) { 65346 options = {} 65347 } else if (typeof value === 'string' || buffer(value)) { 65348 options = {value} 65349 } else if (isUrl(value)) { 65350 options = {path: value} 65351 } else { 65352 options = value 65353 } 65354 65355 /** 65356 * Place to store custom information (default: `{}`). 65357 * 65358 * Itâs OK to store custom data directly on the file but moving it to 65359 * `data` is recommended.
65360 * 65361 * @type {Data} 65362 */ 65363 this.data = {} 65364 65365 /** 65366 * List of messages associated with the file. 65367 * 65368 * @type {Array<VFileMessage>} 65369 */ 65370 this.messages = [] 65371 65372 /** 65373 * List of filepaths the file moved between. 65374 * 65375 * The first is the original path and the last is the current path. 65376 * 65377 * @type {Array<string>} 65378 */ 65379 this.history = [] 65380 65381 /** 65382 * Base of `path` (default: `process.cwd()` or `'/'` in browsers). 65383 * 65384 * @type {string} 65385 */ 65386 this.cwd = proc.cwd() 65387 65388 /* eslint-disable no-unused-expressions */ 65389 /** 65390 * Raw value. 65391 * 65392 * @type {Value} 65393 */ 65394 this.value 65395 65396 // The below are non-standard, they are âwell-knownâ. 65397 // As in, used in several tools. 65398 65399 /** 65400 * Whether a file was saved to disk. 65401 * 65402 * This is used by vfile reporters. 65403 * 65404 * @type {boolean} 65405 */ 65406 this.stored 65407 65408 /** 65409 * Custom, non-string, compiled, representation. 65410 * 65411 * This is used by unified to store non-string results. 65412 * One example is when turning markdown into React nodes. 65413 * 65414 * @type {unknown} 65415 */ 65416 this.result 65417 65418 /** 65419 * Source map. 65420 * 65421 * This type is equivalent to the `RawSourceMap` type from the `source-map` 65422 * module. 65423 * 65424 * @type {Map | null | undefined} 65425 */ 65426 this.map 65427 /* eslint-enable no-unused-expressions */ 65428 65429 // Set path related properties in the correct order. 65430 let index = -1 65431 65432 while (++index < order.length) { 65433 const prop = order[index] 65434 65435 // Note: we specifically use `in` instead of `hasOwnProperty` to accept 65436 // `vfile`s too. 65437 if ( 65438 prop in options && 65439 options[prop] !== undefined && 65440 options[prop] !== null 65441 ) { 65442 // @ts-expect-error: TS doesnât understand basic reality. 65443 this[prop] = prop === 'history' ? [...options[prop]] : options[prop] 65444 } 65445 } 65446 65447 /** @type {string} */ 65448 let prop 65449 65450 // Set non-path related properties. 65451 for (prop in options) { 65452 // @ts-expect-error: fine to set other things. 65453 if (!order.includes(prop)) { 65454 // @ts-expect-error: fine to set other things. 65455 this[prop] = options[prop] 65456 } 65457 } 65458 } 65459 65460 /** 65461 * Get the full path (example: `'~/index.min.js'`). 65462 * 65463 * @returns {string} 65464 */ 65465 get path() { 65466 return this.history[this.history.length - 1] 65467 } 65468 65469 /** 65470 * Set the full path (example: `'~/index.min.js'`). 65471 * 65472 * Cannot be nullified. 65473 * You can set a file URL (a `URL` object with a `file:` protocol) which will 65474 * be turned into a path with `url.fileURLToPath`. 65475 * 65476 * @param {string | URL} path 65477 */ 65478 set path(path) { 65479 if (isUrl(path)) { 65480 path = urlToPath(path) 65481 } 65482 65483 assertNonEmpty(path, 'path') 65484 65485 if (this.path !== path) { 65486 this.history.push(path) 65487 } 65488 } 65489 65490 /** 65491 * Get the parent path (example: `'~'`). 65492 */ 65493 get dirname() { 65494 return typeof this.path === 'string' ? path.dirname(this.path) : undefined 65495 } 65496 65497 /** 65498 * Set the parent path (example: `'~'`). 65499 * 65500 * Cannot be set if thereâs no `path` yet. 65501 */ 65502 set dirname(dirname) { 65503 lib_assertPath(this.basename, 'dirname') 65504 this.path = path.join(dirname || '', this.basename) 65505 } 65506 65507 /**
65508 * Get the basename (including extname) (example: `'index.min.js'`). 65509 */ 65510 get basename() { 65511 return typeof this.path === 'string' ? path.basename(this.path) : undefined 65512 } 65513 65514 /** 65515 * Set basename (including extname) (`'index.min.js'`). 65516 * 65517 * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` 65518 * on windows). 65519 * Cannot be nullified (use `file.path = file.dirname` instead). 65520 */ 65521 set basename(basename) { 65522 assertNonEmpty(basename, 'basename') 65523 assertPart(basename, 'basename') 65524 this.path = path.join(this.dirname || '', basename) 65525 } 65526 65527 /** 65528 * Get the extname (including dot) (example: `'.js'`). 65529 */ 65530 get extname() { 65531 return typeof this.path === 'string' ? path.extname(this.path) : undefined 65532 } 65533 65534 /** 65535 * Set the extname (including dot) (example: `'.js'`). 65536 * 65537 * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` 65538 * on windows). 65539 * Cannot be set if thereâs no `path` yet. 65540 */ 65541 set extname(extname) { 65542 assertPart(extname, 'extname') 65543 lib_assertPath(this.dirname, 'extname') 65544 65545 if (extname) { 65546 if (extname.charCodeAt(0) !== 46 /* `.` */) { 65547 throw new Error('`extname` must start with `.`') 65548 } 65549 65550 if (extname.includes('.', 1)) { 65551 throw new Error('`extname` cannot contain multiple dots') 65552 } 65553 } 65554 65555 this.path = path.join(this.dirname, this.stem + (extname || '')) 65556 } 65557 65558 /** 65559 * Get the stem (basename w/o extname) (example: `'index.min'`). 65560 */ 65561 get stem() { 65562 return typeof this.path === 'string' 65563 ? path.basename(this.path, this.extname) 65564 : undefined 65565 } 65566 65567 /** 65568 * Set the stem (basename w/o extname) (example: `'index.min'`). 65569 * 65570 * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` 65571 * on windows). 65572 * Cannot be nullified (use `file.path = file.dirname` instead). 65573 */ 65574 set stem(stem) { 65575 assertNonEmpty(stem, 'stem') 65576 assertPart(stem, 'stem') 65577 this.path = path.join(this.dirname || '', stem + (this.extname || '')) 65578 } 65579 65580 /** 65581 * Serialize the file. 65582 * 65583 * @param {BufferEncoding | null | undefined} [encoding='utf8'] 65584 * Character encoding to understand `value` as when itâs a `Buffer` 65585 * (default: `'utf8'`). 65586 * @returns {string} 65587 * Serialized file. 65588 */ 65589 toString(encoding) { 65590 return (this.value || '').toString(encoding || undefined) 65591 } 65592 65593 /** 65594 * Create a warning message associated with the file. 65595 * 65596 * Its `fatal` is set to `false` and `file` is set to the current file path. 65597 * Its added to `file.messages`. 65598 * 65599 * @param {string | Error | VFileMessage} reason 65600 * Reason for message, uses the stack and message of the error if given. 65601 * @param {Node | NodeLike | Position | Point | null | undefined} [place] 65602 * Place in file where the message occurred. 65603 * @param {string | null | undefined} [origin] 65604 * Place in code where the message originates (example: 65605 * `'my-package:my-rule'` or `'my-rule'`). 65606 * @returns {VFileMessage} 65607 * Message. 65608 */ 65609 message(reason, place, origin) { 65610 const message = new VFileMessage(reason, place, origin) 65611 65612 if (this.path) { 65613 message.name = this.path + ':' + message.name 65614 message.file = this.path 65615 } 65616 65617 message.fatal = false 65618 65619 this.messages.push(message) 65620 65621 return message 65622 } 65623 65624 /** 65625 * Create an info message associated with the file. 65626 * 65627 * Its `fatal` is set to `null` and `file` is set to the current file path. 65628 * Its added to `file.messages`. 65629 * 65630 * @param {string | Error | VFileMessage} reason 65631 * Reason for message, uses the stack and message of the error if given. 65632 * @param {Node | NodeLike | Position | Point | null | undefined} [place] 65633 * Place in file where the message occurred. 65634 * @param {string | null | undefined} [origin] 65635 * Place in code where the message originates (example: 65636 * `'my-package:my-rule'` or `'my-rule'`). 65637 * @returns {VFileMessage} 65638 * Message. 65639 */ 65640 info(reason, place, origin) { 65641 const message = this.message(reason, place, origin) 65642 65643 message.fatal = null 65644 65645 return message 65646 } 65647 65648 /** 65649 * Create a fatal error associated with the file. 65650 * 65651 * Its `fatal` is set to `true` and `file` is set to the current file path. 65652 * Its added to `file.messages`. 65653 * 65654 * > ð **Note**: a fatal error means that a file is no longer processable. 65655 * 65656 * @param {string | Error | VFileMessage} reason 65657 * Reason for message, uses the stack and message of the error if given. 65658 * @param {Node | NodeLike | Position | Point | null | undefined} [place] 65659 * Place in file where the message occurred. 65660 * @param {string | null | undefined} [origin] 65661 * Place in code where the message originates (example: 65662 * `'my-package:my-rule'` or `'my-rule'`). 65663 * @returns {never} 65664 * Message. 65665 * @throws {VFileMessage} 65666 * Message. 65667 */ 65668 fail(reason, place, origin) { 65669 const message = this.message(reason, place, origin) 65670 65671 message.fatal = true 65672 65673 throw message 65674 } 65675} 65676 65677/** 65678 * Assert that `part` is not a path (as in, does not contain `path.sep`). 65679 * 65680 * @param {string | null | undefined} part 65681 * File path part. 65682 * @param {string} name 65683 * Part name. 65684 * @returns {void} 65685 * Nothing. 65686 */ 65687function assertPart(part, name) { 65688 if (part && part.includes(path.sep)) { 65689 throw new Error( 65690 '`' + name + '` cannot be a path: did not expect `' + path.sep + '`' 65691 ) 65692 } 65693} 65694 65695/** 65696 * Assert that `part` is not empty. 65697 * 65698 * @param {string | undefined} part 65699 * Thing. 65700 * @param {string} name 65701 * Part name. 65702 * @returns {asserts part is string} 65703 * Nothing. 65704 */ 65705function assertNonEmpty(part, name) { 65706 if (!part) { 65707 throw new Error('`' + name + '` cannot be empty') 65708 } 65709} 65710 65711/** 65712 * Assert `path` exists. 65713 * 65714 * @param {string | undefined} path 65715 * Path. 65716 * @param {string} name 65717 * Dependency name. 65718 * @returns {asserts path is string} 65719 * Nothing. 65720 */ 65721function lib_assertPath(path, name) { 65722 if (!path) { 65723 throw new Error('Setting `' + name + '` requires `path` to be set too') 65724 } 65725} 65726 65727/** 65728 * Assert `value` is a buffer. 65729 * 65730 * @param {unknown} value 65731 * thing. 65732 * @returns {value is Buffer} 65733 * Whether `value` is a Node.js buffer. 65734 */ 65735function buffer(value) { 65736 return is_buffer_default()(value) 65737} 65738 65739;// ./node_modules/bail/index.js 65740/** 65741 * Throw a given error. 65742 * 65743 * @param {Error|null|undefined} [error] 65744 * Maybe error. 65745 * @returns {asserts error is null|undefined} 65746 */ 65747function bail(error) { 65748 if (error) { 65749 throw error 65750 } 65751} 65752 65753// EXTERNAL MODULE: ./node_modules/extend/index.js 65754var extend = __webpack_require__(92849); 65755var extend_default = /*#__PURE__*/__webpack_require__.n(extend); 65756;// ./node_modules/is-plain-obj/index.js 65757function isPlainObject(value) { 65758 if (typeof value !== 'object' || value === null) { 65759 return false;
65760 } 65761 65762 const prototype = Object.getPrototypeOf(value); 65763 return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); 65764} 65765 65766;// ./node_modules/trough/lib/index.js 65767// To do: remove `void`s 65768// To do: remove `null` from output of our APIs, allow it as user APIs. 65769 65770/** 65771 * @typedef {(error?: Error | null | undefined, ...output: Array<any>) => void} Callback 65772 * Callback. 65773 * 65774 * @typedef {(...input: Array<any>) => any} Middleware 65775 * Ware. 65776 * 65777 * @typedef Pipeline 65778 * Pipeline. 65779 * @property {Run} run 65780 * Run the pipeline. 65781 * @property {Use} use 65782 * Add middleware. 65783 * 65784 * @typedef {(...input: Array<any>) => void} Run 65785 * Call all middleware. 65786 * 65787 * Calls `done` on completion with either an error or the output of the 65788 * last middleware. 65789 * 65790 * > ð **Note**: as the length of input defines whether async functions get a 65791 * > `next` function, 65792 * > itâs recommended to keep `input` at one value normally. 65793 65794 * 65795 * @typedef {(fn: Middleware) => Pipeline} Use 65796 * Add middleware. 65797 */ 65798 65799/** 65800 * Create new middleware. 65801 * 65802 * @returns {Pipeline} 65803 * Pipeline. 65804 */ 65805function trough() { 65806 /** @type {Array<Middleware>} */ 65807 const fns = [] 65808 /** @type {Pipeline} */ 65809 const pipeline = {run, use} 65810 65811 return pipeline 65812 65813 /** @type {Run} */ 65814 function run(...values) { 65815 let middlewareIndex = -1 65816 /** @type {Callback} */ 65817 const callback = values.pop() 65818 65819 if (typeof callback !== 'function') { 65820 throw new TypeError('Expected function as last argument, not ' + callback) 65821 } 65822 65823 next(null, ...values) 65824 65825 /** 65826 * Run the next `fn`, or weâre done. 65827 * 65828 * @param {Error | null | undefined} error 65829 * @param {Array<any>} output 65830 */ 65831 function next(error, ...output) { 65832 const fn = fns[++middlewareIndex] 65833 let index = -1 65834 65835 if (error) { 65836 callback(error) 65837 return 65838 } 65839 65840 // Copy non-nullish input into values. 65841 while (++index < values.length) { 65842 if (output[index] === null || output[index] === undefined) { 65843 output[index] = values[index] 65844 } 65845 } 65846 65847 // Save the newly created `output` for the next call. 65848 values = output 65849 65850 // Next or done. 65851 if (fn) { 65852 wrap(fn, next)(...output) 65853 } else { 65854 callback(null, ...output) 65855 } 65856 } 65857 } 65858 65859 /** @type {Use} */ 65860 function use(middelware) { 65861 if (typeof middelware !== 'function') { 65862 throw new TypeError( 65863 'Expected `middelware` to be a function, not ' + middelware 65864 ) 65865 } 65866 65867 fns.push(middelware) 65868 return pipeline 65869 } 65870} 65871 65872/** 65873 * Wrap `middleware` into a uniform interface. 65874 * 65875 * You can pass all input to the resulting function. 65876 * `callback` is then called with the output of `middleware`. 65877 * 65878 * If `middleware` accepts more arguments than the later given in input, 65879 * an extra `done` function is passed to it after that input, 65880 * which must be called by `middleware`. 65881 * 65882 * The first value in `input` is the main input value. 65883 * All other input values are the rest input values. 65884 * The values given to `callback` are the input values, 65885 * merged with every non-nullish output value. 65886 * 65887 * * if `middleware` throws an error, 65888 * returns a promise that is rejected, 65889 * or calls the given `done` function with an error, 65890 * `callback` is called with that error 65891 * * if `middleware` returns a value or returns a promise that is resolved, 65892 * that value is the main output value 65893 * * if `middleware` calls `done`, 65894 * all non-nullish values except for the first one (the error) overwrite the 65895 * output values 65896 * 65897 * @param {Middleware} middleware 65898 * Function to wrap. 65899 * @param {Callback} callback 65900 * Callback called with the output of `middleware`. 65901 * @returns {Run} 65902 * Wrapped middleware. 65903 */ 65904function wrap(middleware, callback) { 65905 /** @type {boolean} */ 65906 let called 65907 65908 return wrapped 65909 65910 /** 65911 * Call `middleware`. 65912 * @this {any} 65913 * @param {Array<any>} parameters 65914 * @returns {void} 65915 */ 65916 function wrapped(...parameters) { 65917 const fnExpectsCallback = middleware.length > parameters.length 65918 /** @type {any} */ 65919 let result 65920 65921 if (fnExpectsCallback) { 65922 parameters.push(done) 65923 } 65924 65925 try { 65926 result = middleware.apply(this, parameters) 65927 } catch (error) { 65928 const exception = /** @type {Error} */ (error) 65929 65930 // Well, this is quite the pickle.
65931 // `middleware` received a callback and called it synchronously, but that 65932 // threw an error. 65933 // The only thing left to do is to throw the thing instead. 65934 if (fnExpectsCallback && called) { 65935 throw exception 65936 } 65937 65938 return done(exception) 65939 } 65940 65941 if (!fnExpectsCallback) { 65942 if (result && result.then && typeof result.then === 'function') { 65943 result.then(then, done) 65944 } else if (result instanceof Error) { 65945 done(result) 65946 } else { 65947 then(result) 65948 } 65949 } 65950 } 65951 65952 /** 65953 * Call `callback`, only once. 65954 * 65955 * @type {Callback} 65956 */ 65957 function done(error, ...output) { 65958 if (!called) { 65959 called = true 65960 callback(error, ...output) 65961 } 65962 } 65963 65964 /** 65965 * Call `done` with one value. 65966 * 65967 * @param {any} [value] 65968 */ 65969 function then(value) { 65970 done(null, value) 65971 } 65972} 65973 65974;// ./node_modules/unified/lib/index.js 65975/** 65976 * @typedef {import('unist').Node} Node 65977 * @typedef {import('vfile').VFileCompatible} VFileCompatible 65978 * @typedef {import('vfile').VFileValue} VFileValue 65979 * @typedef {import('..').Processor} Processor 65980 * @typedef {import('..').Plugin} Plugin 65981 * @typedef {import('..').Preset} Preset 65982 * @typedef {import('..').Pluggable} Pluggable 65983 * @typedef {import('..').PluggableList} PluggableList 65984 * @typedef {import('..').Transformer} Transformer 65985 * @typedef {import('..').Parser} Parser 65986 * @typedef {import('..').Compiler} Compiler 65987 * @typedef {import('..').RunCallback} RunCallback 65988 * @typedef {import('..').ProcessCallback} ProcessCallback 65989 * 65990 * @typedef Context 65991 * @property {Node} tree 65992 * @property {VFile} file 65993 */ 65994 65995 65996 65997 65998 65999 66000 66001 66002// Expose a frozen processor. 66003const unified = base().freeze() 66004 66005const own = {}.hasOwnProperty 66006 66007// Function to create the first processor. 66008/** 66009 * @returns {Processor} 66010 */ 66011function base() { 66012 const transformers = trough() 66013 /** @type {Processor['attachers']} */ 66014 const attachers = [] 66015 /** @type {Record<string, unknown>} */ 66016 let namespace = {} 66017 /** @type {boolean|undefined} */ 66018 let frozen 66019 let freezeIndex = -1 66020 66021 // Data management. 66022 // @ts-expect-error: overloads are handled. 66023 processor.data = data 66024 processor.Parser = undefined 66025 processor.Compiler = undefined 66026 66027 // Lock. 66028 processor.freeze = freeze 66029 66030 // Plugins. 66031 processor.attachers = attachers 66032 // @ts-expect-error: overloads are handled. 66033 processor.use = use 66034 66035 // API. 66036 processor.parse = parse 66037 processor.stringify = stringify 66038 // @ts-expect-error: overloads are handled. 66039 processor.run = run 66040 processor.runSync = runSync 66041 // @ts-expect-error: overloads are handled. 66042 processor.process = process 66043 processor.processSync = processSync 66044 66045 // Expose. 66046 return processor 66047 66048 // Create a new processor based on the processor in the current scope. 66049 /** @type {Processor} */ 66050 function processor() { 66051 const destination = base() 66052 let index = -1 66053 66054 while (++index < attachers.length) { 66055 destination.use(...attachers[index]) 66056 } 66057 66058 destination.data(extend_default()(true, {}, namespace)) 66059 66060 return destination 66061 } 66062 66063 /** 66064 * @param {string|Record<string, unknown>} [key] 66065 * @param {unknown} [value] 66066 * @returns {unknown} 66067 */ 66068 function data(key, value) { 66069 if (typeof key === 'string') { 66070 // Set `key`. 66071 if (arguments.length === 2) { 66072 assertUnfrozen('data', frozen) 66073 namespace[key] = value 66074 return processor 66075 } 66076 66077 // Get `key`. 66078 return (own.call(namespace, key) && namespace[key]) || null 66079 } 66080 66081 // Set space. 66082 if (key) { 66083 assertUnfrozen('data', frozen) 66084 namespace = key 66085 return processor 66086 } 66087 66088 // Get space. 66089 return namespace 66090 } 66091 66092 /** @type {Processor['freeze']} */ 66093 function freeze() { 66094 if (frozen) { 66095 return processor 66096 } 66097 66098 while (++freezeIndex < attachers.length) { 66099 const [attacher, ...options] = attachers[freezeIndex] 66100 66101 if (options[0] === false) { 66102 continue 66103 } 66104 66105 if (options[0] === true) { 66106 options[0] = undefined 66107 } 66108 66109 /** @type {Transformer|void} */ 66110 const transformer = attacher.call(processor, ...options) 66111 66112 if (typeof transformer === 'function') { 66113 transformers.use(transformer) 66114 } 66115 } 66116 66117 frozen = true 66118 freezeIndex = Number.POSITIVE_INFINITY 66119 66120 return processor 66121 } 66122 66123 /** 66124 * @param {Pluggable|null|undefined} [value] 66125 * @param {...unknown} options 66126 * @returns {Processor} 66127 */ 66128 function use(value, ...options) { 66129 /** @type {Record<string, unknown>|undefined} */ 66130 let settings 66131 66132 assertUnfrozen('use', frozen) 66133 66134 if (value === null || value === undefined) { 66135 // Empty. 66136 } else if (typeof value === 'function') { 66137 addPlugin(value, ...options) 66138 } else if (typeof value === 'object') { 66139 if (Array.isArray(value)) { 66140 addList(value) 66141 } else { 66142 addPreset(value) 66143 } 66144 } else { 66145 throw new TypeError('Expected usable value, not `' + value + '`') 66146 } 66147 66148 if (settings) { 66149 namespace.settings = Object.assign(namespace.settings || {}, settings) 66150 } 66151 66152 return processor 66153 66154 /** 66155 * @param {import('..').Pluggable<unknown[]>} value 66156 * @returns {void} 66157 */ 66158 function add(value) { 66159 if (typeof value === 'function') { 66160 addPlugin(value) 66161 } else if (typeof value === 'object') { 66162 if (Array.isArray(value)) { 66163 const [plugin, ...options] = value 66164 addPlugin(plugin, ...options) 66165 } else { 66166 addPreset(value) 66167 } 66168 } else { 66169 throw new TypeError('Expected usable value, not `' + value + '`') 66170 } 66171 } 66172 66173 /** 66174 * @param {Preset} result 66175 * @returns {void} 66176 */ 66177 function addPreset(result) { 66178 addList(result.plugins) 66179 66180 if (result.settings) { 66181 settings = Object.assign(settings || {}, result.settings) 66182 } 66183 } 66184 66185 /** 66186 * @param {PluggableList|null|undefined} [plugins] 66187 * @returns {void} 66188 */ 66189 function addList(plugins) { 66190 let index = -1 66191 66192 if (plugins === null || plugins === undefined) { 66193 // Empty. 66194 } else if (Array.isArray(plugins)) { 66195 while (++index < plugins.length) { 66196 const thing = plugins[index] 66197 add(thing) 66198 } 66199 } else { 66200 throw new TypeError('Expected a list of plugins, not `' + plugins + '`') 66201 } 66202 } 66203 66204 /** 66205 * @param {Plugin} plugin 66206 * @param {...unknown} [value] 66207 * @returns {void} 66208 */ 66209 function addPlugin(plugin, value) { 66210 let index = -1 66211 /** @type {Processor['attachers'][number]|undefined} */ 66212 let entry 66213 66214 while (++index < attachers.length) { 66215 if (attachers[index][0] === plugin) { 66216 entry = attachers[index] 66217 break 66218 } 66219 } 66220 66221 if (entry) { 66222 if (isPlainObject(entry[1]) && isPlainObject(value)) { 66223 value = extend_default()(true, entry[1], value) 66224 } 66225 66226 entry[1] = value 66227 } else { 66228 // @ts-expect-error: fine. 66229 attachers.push([...arguments]) 66230 } 66231 } 66232 } 66233 66234 /** @type {Processor['parse']} */ 66235 function parse(doc) { 66236 processor.freeze() 66237 const file = vfile(doc) 66238 const Parser = processor.Parser 66239 assertParser('parse', Parser) 66240 66241 if (newable(Parser, 'parse')) { 66242 // @ts-expect-error: `newable` checks this. 66243 return new Parser(String(file), file).parse() 66244 } 66245 66246 // @ts-expect-error: `newable` checks this. 66247 return Parser(String(file), file) // eslint-disable-line new-cap 66248 } 66249 66250 /** @type {Processor['stringify']} */ 66251 function stringify(node, doc) { 66252 processor.freeze() 66253 const file = vfile(doc) 66254 const Compiler = processor.Compiler 66255 assertCompiler('stringify', Compiler) 66256 assertNode(node) 66257 66258 if (newable(Compiler, 'compile')) { 66259 // @ts-expect-error: `newable` checks this. 66260 return new Compiler(node, file).compile() 66261 } 66262 66263 // @ts-expect-error: `newable` checks this. 66264 return Compiler(node, file) // eslint-disable-line new-cap 66265 } 66266 66267 /** 66268 * @param {Node} node 66269 * @param {VFileCompatible|RunCallback} [doc] 66270 * @param {RunCallback} [callback] 66271 * @returns {Promise<Node>|void} 66272 */ 66273 function run(node, doc, callback) { 66274 assertNode(node) 66275 processor.freeze() 66276 66277 if (!callback && typeof doc === 'function') { 66278 callback = doc 66279 doc = undefined 66280 } 66281 66282 if (!callback) { 66283 return new Promise(executor) 66284 } 66285 66286 executor(null, callback) 66287 66288 /** 66289 * @param {null|((node: Node) => void)} resolve 66290 * @param {(error: Error) => void} reject 66291 * @returns {void} 66292 */ 66293 function executor(resolve, reject) { 66294 // @ts-expect-error: `doc` canât be a callback anymore, we checked. 66295 transformers.run(node, vfile(doc), done) 66296 66297 /** 66298 * @param {Error|null} error 66299 * @param {Node} tree 66300 * @param {VFile} file 66301 * @returns {void} 66302 */ 66303 function done(error, tree, file) { 66304 tree = tree || node 66305 if (error) { 66306 reject(error) 66307 } else if (resolve) { 66308 resolve(tree) 66309 } else { 66310 // @ts-expect-error: `callback` is defined if `resolve` is not. 66311 callback(null, tree, file) 66312 } 66313 } 66314 } 66315 } 66316 66317 /** @type {Processor['runSync']} */ 66318 function runSync(node, file) { 66319 /** @type {Node|undefined} */ 66320 let result 66321 /** @type {boolean|undefined} */
66322 let complete 66323 66324 processor.run(node, file, done) 66325 66326 assertDone('runSync', 'run', complete) 66327 66328 // @ts-expect-error: we either bailed on an error or have a tree. 66329 return result 66330 66331 /** 66332 * @param {Error|null} [error] 66333 * @param {Node} [tree] 66334 * @returns {void} 66335 */ 66336 function done(error, tree) { 66337 bail(error) 66338 result = tree 66339 complete = true 66340 } 66341 } 66342 66343 /** 66344 * @param {VFileCompatible} doc 66345 * @param {ProcessCallback} [callback] 66346 * @returns {Promise<VFile>|undefined} 66347 */ 66348 function process(doc, callback) { 66349 processor.freeze() 66350 assertParser('process', processor.Parser) 66351 assertCompiler('process', processor.Compiler) 66352 66353 if (!callback) { 66354 return new Promise(executor) 66355 } 66356 66357 executor(null, callback) 66358 66359 /** 66360 * @param {null|((file: VFile) => void)} resolve 66361 * @param {(error?: Error|null|undefined) => void} reject 66362 * @returns {void} 66363 */ 66364 function executor(resolve, reject) { 66365 const file = vfile(doc) 66366 66367 processor.run(processor.parse(file), file, (error, tree, file) => { 66368 if (error || !tree || !file) { 66369 done(error) 66370 } else { 66371 /** @type {unknown} */ 66372 const result = processor.stringify(tree, file) 66373 66374 if (result === undefined || result === null) { 66375 // Empty. 66376 } else if (looksLikeAVFileValue(result)) { 66377 file.value = result 66378 } else { 66379 file.result = result 66380 } 66381 66382 done(error, file) 66383 } 66384 }) 66385 66386 /** 66387 * @param {Error|null|undefined} [error] 66388 * @param {VFile|undefined} [file] 66389 * @returns {void} 66390 */ 66391 function done(error, file) { 66392 if (error || !file) { 66393 reject(error) 66394 } else if (resolve) { 66395 resolve(file) 66396 } else { 66397 // @ts-expect-error: `callback` is defined if `resolve` is not. 66398 callback(null, file) 66399 } 66400 } 66401 } 66402 } 66403 66404 /** @type {Processor['processSync']} */ 66405 function processSync(doc) { 66406 /** @type {boolean|undefined} */ 66407 let complete 66408 66409 processor.freeze() 66410 assertParser('processSync', processor.Parser) 66411 assertCompiler('processSync', processor.Compiler) 66412 66413 const file = vfile(doc) 66414 66415 processor.process(file, done) 66416 66417 assertDone('processSync', 'process', complete) 66418 66419 return file 66420 66421 /** 66422 * @param {Error|null|undefined} [error] 66423 * @returns {void} 66424 */ 66425 function done(error) { 66426 complete = true 66427 bail(error) 66428 } 66429 } 66430} 66431 66432/** 66433 * Check if `value` is a constructor. 66434 * 66435 * @param {unknown} value 66436 * @param {string} name 66437 * @returns {boolean} 66438 */ 66439function newable(value, name) { 66440 return ( 66441 typeof value === 'function' && 66442 // Prototypes do exist. 66443 // type-coverage:ignore-next-line 66444 value.prototype && 66445 // A function with keys in its prototype is probably a constructor. 66446 // Classesâ prototype methods are not enumerable, so we check if some value 66447 // exists in the prototype. 66448 // type-coverage:ignore-next-line 66449 (keys(value.prototype) || name in value.prototype) 66450 ) 66451} 66452 66453/** 66454 * Check if `value` is an object with keys. 66455 * 66456 * @param {Record<string, unknown>} value 66457 * @returns {boolean} 66458 */ 66459function keys(value) { 66460 /** @type {string} */ 66461 let key 66462 66463 for (key in value) { 66464 if (own.call(value, key)) { 66465 return true 66466 } 66467 } 66468 66469 return false 66470} 66471 66472/** 66473 * Assert a parser is available. 66474 * 66475 * @param {string} name 66476 * @param {unknown} value 66477 * @returns {asserts value is Parser} 66478 */ 66479function assertParser(name, value) { 66480 if (typeof value !== 'function') { 66481 throw new TypeError('Cannot `' + name + '` without `Parser`') 66482 } 66483} 66484 66485/** 66486 * Assert a compiler is available. 66487 * 66488 * @param {string} name 66489 * @param {unknown} value 66490 * @returns {asserts value is Compiler} 66491 */ 66492function assertCompiler(name, value) { 66493 if (typeof value !== 'function') { 66494 throw new TypeError('Cannot `' + name + '` without `Compiler`') 66495 } 66496} 66497 66498/** 66499 * Assert the processor is not frozen. 66500 * 66501 * @param {string} name 66502 * @param {unknown} frozen 66503 * @returns {asserts frozen is false} 66504 */ 66505function assertUnfrozen(name, frozen) { 66506 if (frozen) { 66507 throw new Error( 66508 'Cannot call `' + 66509 name + 66510 '` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.' 66511 ) 66512 } 66513} 66514 66515/** 66516 * Assert `node` is a unist node. 66517 * 66518 * @param {unknown} node 66519 * @returns {asserts node is Node} 66520 */ 66521function assertNode(node) { 66522 // `isPlainObj` unfortunately uses `any` instead of `unknown`. 66523 // type-coverage:ignore-next-line 66524 if (!isPlainObject(node) || typeof node.type !== 'string') { 66525 throw new TypeError('Expected node, got `' + node + '`') 66526 // Fine. 66527 } 66528} 66529 66530/** 66531 * Assert that `complete` is `true`. 66532 * 66533 * @param {string} name 66534 * @param {string} asyncName 66535 * @param {unknown} complete 66536 * @returns {asserts complete is true} 66537 */ 66538function assertDone(name, asyncName, complete) { 66539 if (!complete) { 66540 throw new Error( 66541 '`' + name + '` finished async. Use `' + asyncName + '` instead' 66542 ) 66543 } 66544} 66545 66546/** 66547 * @param {VFileCompatible} [value] 66548 * @returns {VFile} 66549 */ 66550function vfile(value) { 66551 return looksLikeAVFile(value) ? value : new VFile(value) 66552} 66553 66554/** 66555 * @param {VFileCompatible} [value] 66556 * @returns {value is VFile} 66557 */ 66558function looksLikeAVFile(value) { 66559 return Boolean( 66560 value && 66561 typeof value === 'object' && 66562 'message' in value && 66563 'messages' in value 66564 ) 66565} 66566 66567/** 66568 * @param {unknown} [value] 66569 * @returns {value is VFileValue} 66570 */ 66571function looksLikeAVFileValue(value) { 66572 return typeof value === 'string' || is_buffer_default()(value) 66573} 66574 66575;// ./node_modules/mdast-util-to-string/lib/index.js 66576/** 66577 * @typedef {import('mdast').Root|import('mdast').Content} Node 66578 * 66579 * @typedef Options 66580 * Configuration (optional). 66581 * @property {boolean | null | undefined} [includeImageAlt=true] 66582 * Whether to use `alt` for `image`s. 66583 * @property {boolean | null | undefined} [includeHtml=true] 66584 * Whether to use `value` of HTML. 66585 */ 66586 66587/** @type {Options} */ 66588const emptyOptions = {} 66589 66590/** 66591 * Get the text content of a node or list of nodes. 66592 *
66593 * Prefers the nodeâs plain-text fields, otherwise serializes its children, 66594 * and if the given value is an array, serialize the nodes in it. 66595 * 66596 * @param {unknown} value 66597 * Thing to serialize, typically `Node`. 66598 * @param {Options | null | undefined} [options] 66599 * Configuration (optional). 66600 * @returns {string} 66601 * Serialized `value`. 66602 */ 66603function lib_toString(value, options) { 66604 const settings = options || emptyOptions 66605 const includeImageAlt = 66606 typeof settings.includeImageAlt === 'boolean' 66607 ? settings.includeImageAlt 66608 : true 66609 const includeHtml = 66610 typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true 66611 66612 return one(value, includeImageAlt, includeHtml) 66613} 66614 66615/** 66616 * One node or several nodes. 66617 * 66618 * @param {unknown} value 66619 * Thing to serialize. 66620 * @param {boolean} includeImageAlt 66621 * Include image `alt`s. 66622 * @param {boolean} includeHtml 66623 * Include HTML. 66624 * @returns {string} 66625 * Serialized node. 66626 */ 66627function one(value, includeImageAlt, includeHtml) { 66628 if (node(value)) { 66629 if ('value' in value) { 66630 return value.type === 'html' && !includeHtml ? '' : value.value 66631 } 66632 66633 if (includeImageAlt && 'alt' in value && value.alt) { 66634 return value.alt 66635 } 66636 66637 if ('children' in value) { 66638 return lib_all(value.children, includeImageAlt, includeHtml) 66639 } 66640 } 66641 66642 if (Array.isArray(value)) { 66643 return lib_all(value, includeImageAlt, includeHtml) 66644 } 66645 66646 return '' 66647} 66648 66649/** 66650 * Serialize a list of nodes. 66651 * 66652 * @param {Array<unknown>} values 66653 * Thing to serialize. 66654 * @param {boolean} includeImageAlt 66655 * Include image `alt`s. 66656 * @param {boolean} includeHtml 66657 * Include HTML. 66658 * @returns {string} 66659 * Serialized nodes. 66660 */ 66661function lib_all(values, includeImageAlt, includeHtml) { 66662 /** @type {Array<string>} */ 66663 const result = [] 66664 let index = -1 66665 66666 while (++index < values.length) { 66667 result[index] = one(values[index], includeImageAlt, includeHtml) 66668 } 66669 66670 return result.join('') 66671} 66672 66673/** 66674 * Check if `value` looks like a node. 66675 * 66676 * @param {unknown} value 66677 * Thing. 66678 * @returns {value is Node} 66679 * Whether `value` is a node. 66680 */ 66681function node(value) { 66682 return Boolean(value && typeof value === 'object') 66683} 66684 66685;// ./node_modules/micromark-util-chunked/index.js 66686/** 66687 * Like `Array#splice`, but smarter for giant arrays. 66688 * 66689 * `Array#splice` takes all items to be inserted as individual argument which 66690 * causes a stack overflow in V8 when trying to insert 100k items for instance. 66691 * 66692 * Otherwise, this does not return the removed items, and takes `items` as an 66693 * array instead of rest parameters. 66694 * 66695 * @template {unknown} T 66696 * Item type. 66697 * @param {Array<T>} list 66698 * List to operate on. 66699 * @param {number} start 66700 * Index to remove/insert at (can be negative). 66701 * @param {number} remove 66702 * Number of items to remove. 66703 * @param {Array<T>} items 66704 * Items to inject into `list`. 66705 * @returns {void} 66706 * Nothing. 66707 */ 66708function splice(list, start, remove, items) { 66709 const end = list.length 66710 let chunkStart = 0 66711 /** @type {Array<unknown>} */ 66712 let parameters 66713 66714 // Make start between zero and `end` (included). 66715 if (start < 0) { 66716 start = -start > end ? 0 : end + start 66717 } else { 66718 start = start > end ? end : start 66719 } 66720 remove = remove > 0 ? remove : 0 66721 66722 // No need to chunk the items if thereâs only a couple (10k) items. 66723 if (items.length < 10000) { 66724 parameters = Array.from(items) 66725 parameters.unshift(start, remove) 66726 // @ts-expect-error Hush, itâs fine. 66727 list.splice(...parameters) 66728 } else { 66729 // Delete `remove` items starting from `start` 66730 if (remove) list.splice(start, remove) 66731 66732 // Insert the items in chunks to not cause stack overflows. 66733 while (chunkStart < items.length) { 66734 parameters = items.slice(chunkStart, chunkStart + 10000) 66735 parameters.unshift(start, 0) 66736 // @ts-expect-error Hush, itâs fine. 66737 list.splice(...parameters) 66738 chunkStart += 10000 66739 start += 10000 66740 } 66741 } 66742} 66743 66744/** 66745 * Append `items` (an array) at the end of `list` (another array). 66746 * When `list` was empty, returns `items` instead. 66747 * 66748 * This prevents a potentially expensive operation when `list` is empty, 66749 * and adds items in batches to prevent V8 from hanging. 66750 * 66751 * @template {unknown} T 66752 * Item type. 66753 * @param {Array<T>} list 66754 * List to operate on. 66755 * @param {Array<T>} items 66756 * Items to add to `list`. 66757 * @returns {Array<T>} 66758 * Either `list` or `items`. 66759 */ 66760function push(list, items) { 66761 if (list.length > 0) { 66762 splice(list, list.length, 0, items) 66763 return list 66764 } 66765 return items 66766} 66767 66768;// ./node_modules/micromark-util-combine-extensions/index.js 66769/** 66770 * @typedef {import('micromark-util-types').Extension} Extension 66771 * @typedef {import('micromark-util-types').Handles} Handles 66772 * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension 66773 * @typedef {import('micromark-util-types').NormalizedExtension} NormalizedExtension 66774 */ 66775 66776 66777
66778const micromark_util_combine_extensions_hasOwnProperty = {}.hasOwnProperty 66779 66780/** 66781 * Combine multiple syntax extensions into one. 66782 * 66783 * @param {Array<Extension>} extensions 66784 * List of syntax extensions. 66785 * @returns {NormalizedExtension} 66786 * A single combined extension. 66787 */ 66788function combineExtensions(extensions) { 66789 /** @type {NormalizedExtension} */ 66790 const all = {} 66791 let index = -1 66792 66793 while (++index < extensions.length) { 66794 syntaxExtension(all, extensions[index]) 66795 } 66796 66797 return all 66798} 66799 66800/** 66801 * Merge `extension` into `all`. 66802 * 66803 * @param {NormalizedExtension} all 66804 * Extension to merge into. 66805 * @param {Extension} extension 66806 * Extension to merge. 66807 * @returns {void} 66808 */ 66809function syntaxExtension(all, extension) { 66810 /** @type {keyof Extension} */ 66811 let hook 66812 66813 for (hook in extension) { 66814 const maybe = micromark_util_combine_extensions_hasOwnProperty.call(all, hook) ? all[hook] : undefined 66815 /** @type {Record<string, unknown>} */ 66816 const left = maybe || (all[hook] = {}) 66817 /** @type {Record<string, unknown> | undefined} */ 66818 const right = extension[hook] 66819 /** @type {string} */ 66820 let code 66821 66822 if (right) { 66823 for (code in right) { 66824 if (!micromark_util_combine_extensions_hasOwnProperty.call(left, code)) left[code] = [] 66825 const value = right[code] 66826 constructs( 66827 // @ts-expect-error Looks like a list. 66828 left[code], 66829 Array.isArray(value) ? value : value ? [value] : [] 66830 ) 66831 } 66832 } 66833 } 66834} 66835 66836/** 66837 * Merge `list` into `existing` (both lists of constructs). 66838 * Mutates `existing`. 66839 * 66840 * @param {Array<unknown>} existing 66841 * @param {Array<unknown>} list 66842 * @returns {void} 66843 */ 66844function constructs(existing, list) { 66845 let index = -1 66846 /** @type {Array<unknown>} */ 66847 const before = [] 66848 66849 while (++index < list.length) { 66850 // @ts-expect-error Looks like an object. 66851 ;(list[index].add === 'after' ? existing : before).push(list[index]) 66852 } 66853 66854 splice(existing, 0, 0, before) 66855} 66856 66857/** 66858 * Combine multiple HTML extensions into one. 66859 * 66860 * @param {Array<HtmlExtension>} htmlExtensions 66861 * List of HTML extensions. 66862 * @returns {HtmlExtension} 66863 * A single combined HTML extension. 66864 */ 66865function combineHtmlExtensions(htmlExtensions) { 66866 /** @type {HtmlExtension} */ 66867 const handlers = {} 66868 let index = -1 66869 66870 while (++index < htmlExtensions.length) { 66871 htmlExtension(handlers, htmlExtensions[index]) 66872 } 66873 66874 return handlers 66875} 66876 66877/** 66878 * Merge `extension` into `all`. 66879 * 66880 * @param {HtmlExtension} all 66881 * Extension to merge into. 66882 * @param {HtmlExtension} extension 66883 * Extension to merge. 66884 * @returns {void} 66885 */ 66886function htmlExtension(all, extension) { 66887 /** @type {keyof HtmlExtension} */ 66888 let hook 66889 66890 for (hook in extension) { 66891 const maybe = micromark_util_combine_extensions_hasOwnProperty.call(all, hook) ? all[hook] : undefined 66892 const left = maybe || (all[hook] = {}) 66893 const right = extension[hook] 66894 /** @type {keyof Handles} */ 66895 let type 66896 66897 if (right) { 66898 for (type in right) { 66899 // @ts-expect-error assume document vs regular handler are managed correctly. 66900 left[type] = right[type] 66901 } 66902 } 66903 } 66904} 66905 66906;// ./node_modules/micromark-util-character/lib/unicode-punctuation-regex.js 66907// This module is generated by `script/`. 66908// 66909// CommonMark handles attention (emphasis, strong) markers based on what comes 66910// before or after them. 66911// One such difference is if those characters are Unicode punctuation. 66912// This script is generated from the Unicode data. 66913 66914/** 66915 * Regular expression that matches a unicode punctuation character. 66916 */ 66917const unicodePunctuationRegex = 66918 /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/ 66919 66920;// ./node_modules/micromark-util-character/index.js 66921/** 66922 * @typedef {import('micromark-util-types').Code} Code 66923 */ 66924 66925 66926 66927/** 66928 * Check whether the character code represents an ASCII alpha (`a` through `z`, 66929 * case insensitive). 66930 * 66931 * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha. 66932 * 66933 * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`) 66934 * to U+005A (`Z`). 66935 * 66936 * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`) 66937 * to U+007A (`z`). 66938 * 66939 * @param code
66940 * Code. 66941 * @returns 66942 * Whether it matches. 66943 */ 66944const asciiAlpha = regexCheck(/[A-Za-z]/) 66945 66946/** 66947 * Check whether the character code represents an ASCII alphanumeric (`a` 66948 * through `z`, case insensitive, or `0` through `9`). 66949 * 66950 * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha 66951 * (see `asciiAlpha`). 66952 * 66953 * @param code 66954 * Code. 66955 * @returns 66956 * Whether it matches. 66957 */ 66958const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/) 66959 66960/** 66961 * Check whether the character code represents an ASCII atext. 66962 * 66963 * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in 66964 * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`), 66965 * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F 66966 * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E 66967 * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE 66968 * (`{`) to U+007E TILDE (`~`). 66969 * 66970 * See: 66971 * **\[RFC5322]**: 66972 * [Internet Message Format](https://tools.ietf.org/html/rfc5322). 66973 * P. Resnick. 66974 * IETF. 66975 * 66976 * @param code 66977 * Code. 66978 * @returns 66979 * Whether it matches. 66980 */ 66981const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/) 66982 66983/** 66984 * Check whether a character code is an ASCII control character. 66985 * 66986 * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL) 66987 * to U+001F (US), or U+007F (DEL). 66988 * 66989 * @param {Code} code 66990 * Code. 66991 * @returns {boolean} 66992 * Whether it matches. 66993 */ 66994function asciiControl(code) { 66995 return ( 66996 // Special whitespace codes (which have negative values), C0 and Control 66997 // character DEL 66998 code !== null && (code < 32 || code === 127) 66999 ) 67000} 67001 67002/** 67003 * Check whether the character code represents an ASCII digit (`0` through `9`). 67004 * 67005 * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to 67006 * U+0039 (`9`). 67007 * 67008 * @param code 67009 * Code. 67010 * @returns 67011 * Whether it matches. 67012 */ 67013const asciiDigit = regexCheck(/\d/) 67014 67015/** 67016 * Check whether the character code represents an ASCII hex digit (`a` through 67017 * `f`, case insensitive, or `0` through `9`). 67018 * 67019 * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex 67020 * digit, or an ASCII lower hex digit. 67021 * 67022 * An **ASCII upper hex digit** is a character in the inclusive range U+0041 67023 * (`A`) to U+0046 (`F`). 67024 * 67025 * An **ASCII lower hex digit** is a character in the inclusive range U+0061 67026 * (`a`) to U+0066 (`f`). 67027 * 67028 * @param code 67029 * Code. 67030 * @returns 67031 * Whether it matches. 67032 */ 67033const asciiHexDigit = regexCheck(/[\dA-Fa-f]/) 67034 67035/** 67036 * Check whether the character code represents ASCII punctuation. 67037 * 67038 * An **ASCII punctuation** is a character in the inclusive ranges U+0021 67039 * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT 67040 * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT 67041 * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`). 67042 * 67043 * @param code 67044 * Code. 67045 * @returns 67046 * Whether it matches. 67047 */ 67048const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/) 67049 67050/** 67051 * Check whether a character code is a markdown line ending. 67052 * 67053 * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN 67054 * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR). 67055 * 67056 * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE 67057 * RETURN (CR) are replaced by these virtual characters depending on whether 67058 * they occurred together. 67059 * 67060 * @param {Code} code 67061 * Code. 67062 * @returns {boolean} 67063 * Whether it matches. 67064 */ 67065function markdownLineEnding(code) { 67066 return code !== null && code < -2 67067} 67068 67069/** 67070 * Check whether a character code is a markdown line ending (see 67071 * `markdownLineEnding`) or markdown space (see `markdownSpace`). 67072 * 67073 * @param {Code} code 67074 * Code. 67075 * @returns {boolean} 67076 * Whether it matches. 67077 */ 67078function markdownLineEndingOrSpace(code) { 67079 return code !== null && (code < 0 || code === 32) 67080} 67081 67082/** 67083 * Check whether a character code is a markdown space. 67084 * 67085 * A **markdown space** is the concrete character U+0020 SPACE (SP) and the 67086 * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT). 67087 * 67088 * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is 67089 * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL 67090 * SPACE (VS) characters, depending on the column at which the tab occurred. 67091 * 67092 * @param {Code} code
67093 * Code. 67094 * @returns {boolean} 67095 * Whether it matches. 67096 */ 67097function markdownSpace(code) { 67098 return code === -2 || code === -1 || code === 32 67099} 67100 67101// Size note: removing ASCII from the regex and using `asciiPunctuation` here 67102// In fact adds to the bundle size. 67103/** 67104 * Check whether the character code represents Unicode punctuation. 67105 * 67106 * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation, 67107 * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf` 67108 * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po` 67109 * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII 67110 * punctuation (see `asciiPunctuation`). 67111 * 67112 * See: 67113 * **\[UNICODE]**: 67114 * [The Unicode Standard](https://www.unicode.org/versions/). 67115 * Unicode Consortium. 67116 * 67117 * @param code 67118 * Code. 67119 * @returns 67120 * Whether it matches. 67121 */ 67122const unicodePunctuation = regexCheck(unicodePunctuationRegex) 67123 67124/** 67125 * Check whether the character code represents Unicode whitespace. 67126 * 67127 * Note that this does handle micromark specific markdown whitespace characters. 67128 * See `markdownLineEndingOrSpace` to check that. 67129 * 67130 * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator, 67131 * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF), 67132 * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**). 67133 * 67134 * See: 67135 * **\[UNICODE]**: 67136 * [The Unicode Standard](https://www.unicode.org/versions/). 67137 * Unicode Consortium. 67138 * 67139 * @param code 67140 * Code. 67141 * @returns 67142 * Whether it matches. 67143 */ 67144const unicodeWhitespace = regexCheck(/\s/) 67145 67146/** 67147 * Create a code check from a regex. 67148 * 67149 * @param {RegExp} regex 67150 * @returns {(code: Code) => boolean} 67151 */ 67152function regexCheck(regex) { 67153 return check 67154 67155 /** 67156 * Check whether a code matches the bound regex. 67157 * 67158 * @param {Code} code 67159 * Character code. 67160 * @returns {boolean} 67161 * Whether the character code matches the bound regex. 67162 */ 67163 function check(code) { 67164 return code !== null && regex.test(String.fromCharCode(code)) 67165 } 67166} 67167 67168;// ./node_modules/micromark-factory-space/index.js 67169/** 67170 * @typedef {import('micromark-util-types').Effects} Effects 67171 * @typedef {import('micromark-util-types').State} State 67172 * @typedef {import('micromark-util-types').TokenType} TokenType 67173 */ 67174 67175 67176 67177// To do: implement `spaceOrTab`, `spaceOrTabMinMax`, `spaceOrTabWithOptions`. 67178 67179/** 67180 * Parse spaces and tabs. 67181 * 67182 * There is no `nok` parameter: 67183 * 67184 * * spaces in markdown are often optional, in which case this factory can be 67185 * used and `ok` will be switched to whether spaces were found or not 67186 * * one line ending or space can be detected with `markdownSpace(code)` right 67187 * before using `factorySpace` 67188 * 67189 * ###### Examples 67190 * 67191 * Where `â` represents a tab (plus how much it expands) and `â ` represents a 67192 * single space. 67193 * 67194 * ```markdown 67195 * â 67196 * â â â â 67197 * ââ 67198 * ``` 67199 * 67200 * @param {Effects} effects 67201 * Context. 67202 * @param {State} ok 67203 * State switched to when successful. 67204 * @param {TokenType} type 67205 * Type (`' \t'`). 67206 * @param {number | undefined} [max=Infinity] 67207 * Max (exclusive). 67208 * @returns 67209 * Start state. 67210 */ 67211function factorySpace(effects, ok, type, max) { 67212 const limit = max ? max - 1 : Number.POSITIVE_INFINITY 67213 let size = 0 67214 return start 67215 67216 /** @type {State} */ 67217 function start(code) { 67218 if (markdownSpace(code)) { 67219 effects.enter(type) 67220 return prefix(code) 67221 } 67222 return ok(code) 67223 } 67224 67225 /** @type {State} */ 67226 function prefix(code) { 67227 if (markdownSpace(code) && size++ < limit) { 67228 effects.consume(code) 67229 return prefix 67230 } 67231 effects.exit(type) 67232 return ok(code) 67233 } 67234} 67235 67236;// ./node_modules/micromark/lib/initialize/content.js 67237/** 67238 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct 67239 * @typedef {import('micromark-util-types').Initializer} Initializer 67240 * @typedef {import('micromark-util-types').State} State 67241 * @typedef {import('micromark-util-types').Token} Token 67242 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 67243 */ 67244 67245 67246 67247/** @type {InitialConstruct} */ 67248const content = { 67249 tokenize: initializeContent 67250} 67251 67252/** 67253 * @this {TokenizeContext} 67254 * @type {Initializer} 67255 */ 67256function initializeContent(effects) { 67257 const contentStart = effects.attempt( 67258 this.parser.constructs.contentInitial, 67259 afterContentStartConstruct, 67260 paragraphInitial 67261 ) 67262 /** @type {Token} */ 67263 let previous 67264 return contentStart 67265 67266 /** @type {State} */ 67267 function afterContentStartConstruct(code) { 67268 if (code === null) {
67269 effects.consume(code) 67270 return 67271 } 67272 effects.enter('lineEnding') 67273 effects.consume(code) 67274 effects.exit('lineEnding') 67275 return factorySpace(effects, contentStart, 'linePrefix') 67276 } 67277 67278 /** @type {State} */ 67279 function paragraphInitial(code) { 67280 effects.enter('paragraph') 67281 return lineStart(code) 67282 } 67283 67284 /** @type {State} */ 67285 function lineStart(code) { 67286 const token = effects.enter('chunkText', { 67287 contentType: 'text', 67288 previous 67289 }) 67290 if (previous) { 67291 previous.next = token 67292 } 67293 previous = token 67294 return data(code) 67295 } 67296 67297 /** @type {State} */ 67298 function data(code) { 67299 if (code === null) { 67300 effects.exit('chunkText') 67301 effects.exit('paragraph') 67302 effects.consume(code) 67303 return 67304 } 67305 if (markdownLineEnding(code)) { 67306 effects.consume(code) 67307 effects.exit('chunkText') 67308 return lineStart 67309 } 67310 67311 // Data. 67312 effects.consume(code) 67313 return data 67314 } 67315} 67316 67317;// ./node_modules/micromark/lib/initialize/document.js 67318/** 67319 * @typedef {import('micromark-util-types').Construct} Construct 67320 * @typedef {import('micromark-util-types').ContainerState} ContainerState 67321 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct 67322 * @typedef {import('micromark-util-types').Initializer} Initializer 67323 * @typedef {import('micromark-util-types').Point} Point 67324 * @typedef {import('micromark-util-types').State} State 67325 * @typedef {import('micromark-util-types').Token} Token 67326 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 67327 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 67328 */ 67329 67330/** 67331 * @typedef {[Construct, ContainerState]} StackItem 67332 */ 67333 67334 67335 67336 67337/** @type {InitialConstruct} */ 67338const document_document = { 67339 tokenize: initializeDocument 67340} 67341 67342/** @type {Construct} */ 67343const containerConstruct = { 67344 tokenize: tokenizeContainer 67345} 67346 67347/** 67348 * @this {TokenizeContext} 67349 * @type {Initializer} 67350 */ 67351function initializeDocument(effects) { 67352 const self = this 67353 /** @type {Array<StackItem>} */ 67354 const stack = [] 67355 let continued = 0 67356 /** @type {TokenizeContext | undefined} */ 67357 let childFlow 67358 /** @type {Token | undefined} */ 67359 let childToken 67360 /** @type {number} */ 67361 let lineStartOffset 67362 return start 67363 67364 /** @type {State} */ 67365 function start(code) { 67366 // First we iterate through the open blocks, starting with the root 67367 // document, and descending through last children down to the last open 67368 // block. 67369 // Each block imposes a condition that the line must satisfy if the block is 67370 // to remain open. 67371 // For example, a block quote requires a `>` character. 67372 // A paragraph requires a non-blank line. 67373 // In this phase we may match all or just some of the open blocks. 67374 // But we cannot close unmatched blocks yet, because we may have a lazy 67375 // continuation line. 67376 if (continued < stack.length) { 67377 const item = stack[continued] 67378 self.containerState = item[1] 67379 return effects.attempt( 67380 item[0].continuation, 67381 documentContinue, 67382 checkNewContainers 67383 )(code) 67384 } 67385 67386 // Done. 67387 return checkNewContainers(code) 67388 } 67389 67390 /** @type {State} */ 67391 function documentContinue(code) { 67392 continued++ 67393 67394 // Note: this field is called `_closeFlow` but it also closes containers. 67395 // Perhaps a good idea to rename it but itâs already used in the wild by 67396 // extensions. 67397 if (self.containerState._closeFlow) { 67398 self.containerState._closeFlow = undefined 67399 if (childFlow) { 67400 closeFlow() 67401 } 67402 67403 // Note: this algorithm for moving events around is similar to the 67404 // algorithm when dealing with lazy lines in `writeToChild`. 67405 const indexBeforeExits = self.events.length 67406 let indexBeforeFlow = indexBeforeExits 67407 /** @type {Point | undefined} */ 67408 let point 67409 67410 // Find the flow chunk. 67411 while (indexBeforeFlow--) { 67412 if ( 67413 self.events[indexBeforeFlow][0] === 'exit' && 67414 self.events[indexBeforeFlow][1].type === 'chunkFlow' 67415 ) { 67416 point = self.events[indexBeforeFlow][1].end 67417 break 67418 } 67419 } 67420 exitContainers(continued) 67421 67422 // Fix positions. 67423 let index = indexBeforeExits 67424 while (index < self.events.length) { 67425 self.events[index][1].end = Object.assign({}, point) 67426 index++ 67427 } 67428 67429 // Inject the exits earlier (theyâre still also at the end). 67430 splice( 67431 self.events, 67432 indexBeforeFlow + 1, 67433 0, 67434 self.events.slice(indexBeforeExits) 67435 ) 67436 67437 // Discard the duplicate exits. 67438 self.events.length = index 67439 return checkNewContainers(code) 67440 } 67441 return start(code) 67442 } 67443 67444 /** @type {State} */ 67445 function checkNewContainers(code) { 67446 // Next, after consuming the continuation markers for existing blocks, we 67447 // look for new block starts (e.g. `>` for a block quote). 67448 // If we encounter a new block start, we close any blocks unmatched in 67449 // step 1 before creating the new block as a child of the last matched 67450 // block. 67451 if (continued === stack.length) { 67452 // No need to `check` whether thereâs a container, of `exitContainers` 67453 // would be moot. 67454 // We can instead immediately `attempt` to parse one. 67455 if (!childFlow) { 67456 return documentContinued(code) 67457 } 67458 67459 // If we have concrete content, such as block HTML or fenced code, 67460 // we canât have containers âpierceâ into them, so we can immediately 67461 // start. 67462 if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { 67463 return flowStart(code) 67464 } 67465 67466 // If we do have flow, it could still be a blank line, 67467 // but weâd be interrupting it w/ a new container if thereâs a current 67468 // construct. 67469 // To do: next major: remove `_gfmTableDynamicInterruptHack` (no longer 67470 // needed in [email protected]). 67471 self.interrupt = Boolean( 67472 childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack 67473 ) 67474 } 67475 67476 // Check if there is a new container. 67477 self.containerState = {} 67478 return effects.check( 67479 containerConstruct, 67480 thereIsANewContainer, 67481 thereIsNoNewContainer 67482 )(code) 67483 } 67484 67485 /** @type {State} */ 67486 function thereIsANewContainer(code) { 67487 if (childFlow) closeFlow() 67488 exitContainers(continued) 67489 return documentContinued(code) 67490 } 67491 67492 /** @type {State} */ 67493 function thereIsNoNewContainer(code) { 67494 self.parser.lazy[self.now().line] = continued !== stack.length 67495 lineStartOffset = self.now().offset 67496 return flowStart(code) 67497 } 67498 67499 /** @type {State} */ 67500 function documentContinued(code) { 67501 // Try new containers. 67502 self.containerState = {} 67503 return effects.attempt( 67504 containerConstruct, 67505 containerContinue, 67506 flowStart 67507 )(code) 67508 } 67509 67510 /** @type {State} */ 67511 function containerContinue(code) { 67512 continued++ 67513 stack.push([self.currentConstruct, self.containerState]) 67514 // Try another. 67515 return documentContinued(code) 67516 } 67517 67518 /** @type {State} */ 67519 function flowStart(code) { 67520 if (code === null) { 67521 if (childFlow) closeFlow() 67522 exitContainers(0)
67523 effects.consume(code) 67524 return 67525 } 67526 childFlow = childFlow || self.parser.flow(self.now()) 67527 effects.enter('chunkFlow', { 67528 contentType: 'flow', 67529 previous: childToken, 67530 _tokenizer: childFlow 67531 }) 67532 return flowContinue(code) 67533 } 67534 67535 /** @type {State} */ 67536 function flowContinue(code) { 67537 if (code === null) { 67538 writeToChild(effects.exit('chunkFlow'), true) 67539 exitContainers(0) 67540 effects.consume(code) 67541 return 67542 } 67543 if (markdownLineEnding(code)) { 67544 effects.consume(code) 67545 writeToChild(effects.exit('chunkFlow')) 67546 // Get ready for the next line. 67547 continued = 0 67548 self.interrupt = undefined 67549 return start 67550 } 67551 effects.consume(code) 67552 return flowContinue 67553 } 67554 67555 /** 67556 * @param {Token} token 67557 * @param {boolean | undefined} [eof] 67558 * @returns {void} 67559 */ 67560 function writeToChild(token, eof) { 67561 const stream = self.sliceStream(token) 67562 if (eof) stream.push(null) 67563 token.previous = childToken 67564 if (childToken) childToken.next = token 67565 childToken = token 67566 childFlow.defineSkip(token.start) 67567 childFlow.write(stream) 67568 67569 // Alright, so we just added a lazy line: 67570 // 67571 // ```markdown 67572 // > a 67573 // b. 67574 // 67575 // Or: 67576 // 67577 // > ~~~c 67578 // d 67579 // 67580 // Or: 67581 // 67582 // > | e | 67583 // f 67584 // ``` 67585 // 67586 // The construct in the second example (fenced code) does not accept lazy 67587 // lines, so it marked itself as done at the end of its first line, and 67588 // then the content construct parses `d`. 67589 // Most constructs in markdown match on the first line: if the first line 67590 // forms a construct, a non-lazy line canât âunmakeâ it. 67591 // 67592 // The construct in the third example is potentially a GFM table, and 67593 // those are *weird*. 67594 // It *could* be a table, from the first line, if the following line 67595 // matches a condition. 67596 // In this case, that second line is lazy, which âunmakesâ the first line 67597 // and turns the whole into one content block. 67598 // 67599 // Weâve now parsed the non-lazy and the lazy line, and can figure out 67600 // whether the lazy line started a new flow block. 67601 // If it did, we exit the current containers between the two flow blocks. 67602 if (self.parser.lazy[token.start.line]) { 67603 let index = childFlow.events.length 67604 while (index--) { 67605 if ( 67606 // The token starts before the line ending⦠67607 childFlow.events[index][1].start.offset < lineStartOffset && 67608 // â¦and either is not ended yet⦠67609 (!childFlow.events[index][1].end || 67610 // â¦or ends after it. 67611 childFlow.events[index][1].end.offset > lineStartOffset) 67612 ) { 67613 // Exit: thereâs still something open, which means itâs a lazy line 67614 // part of something. 67615 return 67616 } 67617 } 67618 67619 // Note: this algorithm for moving events around is similar to the 67620 // algorithm when closing flow in `documentContinue`. 67621 const indexBeforeExits = self.events.length 67622 let indexBeforeFlow = indexBeforeExits 67623 /** @type {boolean | undefined} */ 67624 let seen 67625 /** @type {Point | undefined} */ 67626 let point 67627 67628 // Find the previous chunk (the one before the lazy line). 67629 while (indexBeforeFlow--) { 67630 if ( 67631 self.events[indexBeforeFlow][0] === 'exit' && 67632 self.events[indexBeforeFlow][1].type === 'chunkFlow' 67633 ) { 67634 if (seen) { 67635 point = self.events[indexBeforeFlow][1].end 67636 break 67637 } 67638 seen = true 67639 } 67640 } 67641 exitContainers(continued) 67642 67643 // Fix positions. 67644 index = indexBeforeExits 67645 while (index < self.events.length) { 67646 self.events[index][1].end = Object.assign({}, point) 67647 index++ 67648 } 67649 67650 // Inject the exits earlier (theyâre still also at the end). 67651 splice( 67652 self.events, 67653 indexBeforeFlow + 1, 67654 0, 67655 self.events.slice(indexBeforeExits) 67656 ) 67657 67658 // Discard the duplicate exits. 67659 self.events.length = index 67660 } 67661 } 67662 67663 /** 67664 * @param {number} size 67665 * @returns {void} 67666 */ 67667 function exitContainers(size) { 67668 let index = stack.length 67669 67670 // Exit open containers. 67671 while (index-- > size) { 67672 const entry = stack[index] 67673 self.containerState = entry[1] 67674 entry[0].exit.call(self, effects) 67675 } 67676 stack.length = size 67677 } 67678 function closeFlow() { 67679 childFlow.write([null]) 67680 childToken = undefined 67681 childFlow = undefined 67682 self.containerState._closeFlow = undefined 67683 } 67684} 67685 67686/** 67687 * @this {TokenizeContext} 67688 * @type {Tokenizer} 67689 */ 67690function tokenizeContainer(effects, ok, nok) { 67691 // Always populated by defaults. 67692 67693 return factorySpace( 67694 effects, 67695 effects.attempt(this.parser.constructs.document, ok, nok), 67696 'linePrefix', 67697 this.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4 67698 ) 67699} 67700 67701;// ./node_modules/micromark-core-commonmark/lib/blank-line.js 67702/** 67703 * @typedef {import('micromark-util-types').Construct} Construct 67704 * @typedef {import('micromark-util-types').State} State 67705 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 67706 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 67707 */ 67708 67709 67710 67711/** @type {Construct} */ 67712const blankLine = { 67713 tokenize: tokenizeBlankLine, 67714 partial: true 67715} 67716
67717/** 67718 * @this {TokenizeContext} 67719 * @type {Tokenizer} 67720 */ 67721function tokenizeBlankLine(effects, ok, nok) { 67722 return start 67723 67724 /** 67725 * Start of blank line. 67726 * 67727 * > ð **Note**: `â ` represents a space character. 67728 * 67729 * ```markdown 67730 * > | â â â 67731 * ^ 67732 * > | â 67733 * ^ 67734 * ``` 67735 * 67736 * @type {State} 67737 */ 67738 function start(code) { 67739 return markdownSpace(code) 67740 ? factorySpace(effects, after, 'linePrefix')(code) 67741 : after(code) 67742 } 67743 67744 /** 67745 * At eof/eol, after optional whitespace. 67746 * 67747 * > ð **Note**: `â ` represents a space character. 67748 * 67749 * ```markdown 67750 * > | â â â 67751 * ^ 67752 * > | â 67753 * ^ 67754 * ``` 67755 * 67756 * @type {State} 67757 */ 67758 function after(code) { 67759 return code === null || markdownLineEnding(code) ? ok(code) : nok(code) 67760 } 67761} 67762 67763;// ./node_modules/micromark-util-subtokenize/index.js 67764/** 67765 * @typedef {import('micromark-util-types').Chunk} Chunk 67766 * @typedef {import('micromark-util-types').Event} Event 67767 * @typedef {import('micromark-util-types').Token} Token 67768 */ 67769 67770 67771/** 67772 * Tokenize subcontent. 67773 * 67774 * @param {Array<Event>} events 67775 * List of events. 67776 * @returns {boolean} 67777 * Whether subtokens were found. 67778 */ 67779function subtokenize(events) { 67780 /** @type {Record<string, number>} */ 67781 const jumps = {} 67782 let index = -1 67783 /** @type {Event} */ 67784 let event 67785 /** @type {number | undefined} */ 67786 let lineIndex 67787 /** @type {number} */ 67788 let otherIndex 67789 /** @type {Event} */ 67790 let otherEvent 67791 /** @type {Array<Event>} */ 67792 let parameters 67793 /** @type {Array<Event>} */ 67794 let subevents 67795 /** @type {boolean | undefined} */ 67796 let more 67797 while (++index < events.length) { 67798 while (index in jumps) { 67799 index = jumps[index] 67800 } 67801 event = events[index] 67802 67803 // Add a hook for the GFM tasklist extension, which needs to know if text 67804 // is in the first content of a list item. 67805 if ( 67806 index && 67807 event[1].type === 'chunkFlow' && 67808 events[index - 1][1].type === 'listItemPrefix' 67809 ) { 67810 subevents = event[1]._tokenizer.events 67811 otherIndex = 0 67812 if ( 67813 otherIndex < subevents.length && 67814 subevents[otherIndex][1].type === 'lineEndingBlank' 67815 ) { 67816 otherIndex += 2 67817 } 67818 if ( 67819 otherIndex < subevents.length && 67820 subevents[otherIndex][1].type === 'content' 67821 ) { 67822 while (++otherIndex < subevents.length) { 67823 if (subevents[otherIndex][1].type === 'content') { 67824 break 67825 } 67826 if (subevents[otherIndex][1].type === 'chunkText') { 67827 subevents[otherIndex][1]._isInFirstContentOfListItem = true 67828 otherIndex++ 67829 } 67830 } 67831 } 67832 } 67833 67834 // Enter. 67835 if (event[0] === 'enter') { 67836 if (event[1].contentType) { 67837 Object.assign(jumps, subcontent(events, index)) 67838 index = jumps[index] 67839 more = true 67840 } 67841 } 67842 // Exit. 67843 else if (event[1]._container) { 67844 otherIndex = index 67845 lineIndex = undefined 67846 while (otherIndex--) { 67847 otherEvent = events[otherIndex] 67848 if ( 67849 otherEvent[1].type === 'lineEnding' || 67850 otherEvent[1].type === 'lineEndingBlank' 67851 ) { 67852 if (otherEvent[0] === 'enter') { 67853 if (lineIndex) { 67854 events[lineIndex][1].type = 'lineEndingBlank' 67855 } 67856 otherEvent[1].type = 'lineEnding' 67857 lineIndex = otherIndex 67858 } 67859 } else { 67860 break 67861 } 67862 } 67863 if (lineIndex) { 67864 // Fix position. 67865 event[1].end = Object.assign({}, events[lineIndex][1].start) 67866 67867 // Switch container exit w/ line endings. 67868 parameters = events.slice(lineIndex, index) 67869 parameters.unshift(event) 67870 splice(events, lineIndex, index - lineIndex + 1, parameters) 67871 } 67872 } 67873 } 67874 return !more 67875} 67876 67877/** 67878 * Tokenize embedded tokens. 67879 * 67880 * @param {Array<Event>} events 67881 * @param {number} eventIndex 67882 * @returns {Record<string, number>} 67883 */ 67884function subcontent(events, eventIndex) { 67885 const token = events[eventIndex][1] 67886 const context = events[eventIndex][2] 67887 let startPosition = eventIndex - 1 67888 /** @type {Array<number>} */ 67889 const startPositions = [] 67890 const tokenizer = 67891 token._tokenizer || context.parser[token.contentType](token.start) 67892 const childEvents = tokenizer.events 67893 /** @type {Array<[number, number]>} */ 67894 const jumps = [] 67895 /** @type {Record<string, number>} */ 67896 const gaps = {} 67897 /** @type {Array<Chunk>} */ 67898 let stream 67899 /** @type {Token | undefined} */ 67900 let previous 67901 let index = -1 67902 /** @type {Token | undefined} */ 67903 let current = token 67904 let adjust = 0 67905 let start = 0 67906 const breaks = [start] 67907 67908 // Loop forward through the linked tokens to pass them in order to the 67909 // subtokenizer. 67910 while (current) { 67911 // Find the position of the event for this token. 67912 while (events[++startPosition][1] !== current) { 67913 // Empty. 67914 } 67915 startPositions.push(startPosition) 67916 if (!current._tokenizer) { 67917 stream = context.sliceStream(current) 67918 if (!current.next) { 67919 stream.push(null) 67920 } 67921 if (previous) {
67922 tokenizer.defineSkip(current.start) 67923 } 67924 if (current._isInFirstContentOfListItem) { 67925 tokenizer._gfmTasklistFirstContentOfListItem = true 67926 } 67927 tokenizer.write(stream) 67928 if (current._isInFirstContentOfListItem) { 67929 tokenizer._gfmTasklistFirstContentOfListItem = undefined 67930 } 67931 } 67932 67933 // Unravel the next token. 67934 previous = current 67935 current = current.next 67936 } 67937 67938 // Now, loop back through all events (and linked tokens), to figure out which 67939 // parts belong where. 67940 current = token 67941 while (++index < childEvents.length) { 67942 if ( 67943 // Find a void token that includes a break. 67944 childEvents[index][0] === 'exit' && 67945 childEvents[index - 1][0] === 'enter' && 67946 childEvents[index][1].type === childEvents[index - 1][1].type && 67947 childEvents[index][1].start.line !== childEvents[index][1].end.line 67948 ) { 67949 start = index + 1 67950 breaks.push(start) 67951 // Help GC. 67952 current._tokenizer = undefined 67953 current.previous = undefined 67954 current = current.next 67955 } 67956 } 67957 67958 // Help GC. 67959 tokenizer.events = [] 67960 67961 // If thereâs one more token (which is the cases for lines that end in an 67962 // EOF), thatâs perfect: the last point we found starts it. 67963 // If there isnât then make sure any remaining content is added to it. 67964 if (current) { 67965 // Help GC. 67966 current._tokenizer = undefined 67967 current.previous = undefined 67968 } else { 67969 breaks.pop() 67970 } 67971 67972 // Now splice the events from the subtokenizer into the current events, 67973 // moving back to front so that splice indices arenât affected. 67974 index = breaks.length 67975 while (index--) { 67976 const slice = childEvents.slice(breaks[index], breaks[index + 1]) 67977 const start = startPositions.pop() 67978 jumps.unshift([start, start + slice.length - 1]) 67979 splice(events, start, 2, slice) 67980 } 67981 index = -1 67982 while (++index < jumps.length) { 67983 gaps[adjust + jumps[index][0]] = adjust + jumps[index][1] 67984 adjust += jumps[index][1] - jumps[index][0] - 1 67985 } 67986 return gaps 67987} 67988 67989;// ./node_modules/micromark-core-commonmark/lib/content.js 67990/** 67991 * @typedef {import('micromark-util-types').Construct} Construct 67992 * @typedef {import('micromark-util-types').Resolver} Resolver 67993 * @typedef {import('micromark-util-types').State} State 67994 * @typedef {import('micromark-util-types').Token} Token 67995 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 67996 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 67997 */ 67998 67999 68000 68001 68002/** 68003 * No name because it must not be turned off. 68004 * @type {Construct} 68005 */ 68006const content_content = { 68007 tokenize: tokenizeContent, 68008 resolve: resolveContent 68009} 68010 68011/** @type {Construct} */ 68012const continuationConstruct = { 68013 tokenize: tokenizeContinuation, 68014 partial: true 68015} 68016 68017/** 68018 * Content is transparent: itâs parsed right now. That way, definitions are also 68019 * parsed right now: before text in paragraphs (specifically, media) are parsed. 68020 * 68021 * @type {Resolver} 68022 */ 68023function resolveContent(events) { 68024 subtokenize(events) 68025 return events 68026} 68027 68028/** 68029 * @this {TokenizeContext} 68030 * @type {Tokenizer} 68031 */ 68032function tokenizeContent(effects, ok) { 68033 /** @type {Token | undefined} */ 68034 let previous 68035 return chunkStart 68036 68037 /** 68038 * Before a content chunk. 68039 * 68040 * ```markdown 68041 * > | abc 68042 * ^ 68043 * ``` 68044 * 68045 * @type {State} 68046 */ 68047 function chunkStart(code) { 68048 effects.enter('content') 68049 previous = effects.enter('chunkContent', { 68050 contentType: 'content' 68051 }) 68052 return chunkInside(code) 68053 } 68054 68055 /** 68056 * In a content chunk. 68057 * 68058 * ```markdown 68059 * > | abc 68060 * ^^^ 68061 * ``` 68062 * 68063 * @type {State} 68064 */ 68065 function chunkInside(code) { 68066 if (code === null) { 68067 return contentEnd(code) 68068 } 68069 68070 // To do: in `markdown-rs`, each line is parsed on its own, and everything 68071 // is stitched together resolving. 68072 if (markdownLineEnding(code)) { 68073 return effects.check( 68074 continuationConstruct, 68075 contentContinue, 68076 contentEnd 68077 )(code) 68078 } 68079 68080 // Data. 68081 effects.consume(code) 68082 return chunkInside 68083 } 68084 68085 /** 68086 * 68087 * 68088 * @type {State} 68089 */ 68090 function contentEnd(code) { 68091 effects.exit('chunkContent') 68092 effects.exit('content') 68093 return ok(code) 68094 } 68095 68096 /** 68097 * 68098 * 68099 * @type {State} 68100 */ 68101 function contentContinue(code) {
68102 effects.consume(code) 68103 effects.exit('chunkContent') 68104 previous.next = effects.enter('chunkContent', { 68105 contentType: 'content', 68106 previous 68107 }) 68108 previous = previous.next 68109 return chunkInside 68110 } 68111} 68112 68113/** 68114 * @this {TokenizeContext} 68115 * @type {Tokenizer} 68116 */ 68117function tokenizeContinuation(effects, ok, nok) { 68118 const self = this 68119 return startLookahead 68120 68121 /** 68122 * 68123 * 68124 * @type {State} 68125 */ 68126 function startLookahead(code) { 68127 effects.exit('chunkContent') 68128 effects.enter('lineEnding') 68129 effects.consume(code) 68130 effects.exit('lineEnding') 68131 return factorySpace(effects, prefixed, 'linePrefix') 68132 } 68133 68134 /** 68135 * 68136 * 68137 * @type {State} 68138 */ 68139 function prefixed(code) { 68140 if (code === null || markdownLineEnding(code)) { 68141 return nok(code) 68142 } 68143 68144 // Always populated by defaults. 68145 68146 const tail = self.events[self.events.length - 1] 68147 if ( 68148 !self.parser.constructs.disable.null.includes('codeIndented') && 68149 tail && 68150 tail[1].type === 'linePrefix' && 68151 tail[2].sliceSerialize(tail[1], true).length >= 4 68152 ) { 68153 return ok(code) 68154 } 68155 return effects.interrupt(self.parser.constructs.flow, nok, ok)(code) 68156 } 68157} 68158 68159;// ./node_modules/micromark/lib/initialize/flow.js 68160/** 68161 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct 68162 * @typedef {import('micromark-util-types').Initializer} Initializer 68163 * @typedef {import('micromark-util-types').State} State 68164 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 68165 */ 68166 68167 68168 68169 68170/** @type {InitialConstruct} */ 68171const flow = { 68172 tokenize: initializeFlow 68173} 68174 68175/** 68176 * @this {TokenizeContext} 68177 * @type {Initializer} 68178 */ 68179function initializeFlow(effects) { 68180 const self = this 68181 const initial = effects.attempt( 68182 // Try to parse a blank line. 68183 blankLine, 68184 atBlankEnding, 68185 // Try to parse initial flow (essentially, only code). 68186 effects.attempt( 68187 this.parser.constructs.flowInitial, 68188 afterConstruct, 68189 factorySpace( 68190 effects, 68191 effects.attempt( 68192 this.parser.constructs.flow, 68193 afterConstruct, 68194 effects.attempt(content_content, afterConstruct) 68195 ), 68196 'linePrefix' 68197 ) 68198 ) 68199 ) 68200 return initial 68201 68202 /** @type {State} */ 68203 function atBlankEnding(code) { 68204 if (code === null) { 68205 effects.consume(code) 68206 return 68207 } 68208 effects.enter('lineEndingBlank') 68209 effects.consume(code) 68210 effects.exit('lineEndingBlank') 68211 self.currentConstruct = undefined 68212 return initial 68213 } 68214 68215 /** @type {State} */ 68216 function afterConstruct(code) { 68217 if (code === null) { 68218 effects.consume(code) 68219 return 68220 } 68221 effects.enter('lineEnding') 68222 effects.consume(code) 68223 effects.exit('lineEnding') 68224 self.currentConstruct = undefined 68225 return initial 68226 } 68227} 68228 68229;// ./node_modules/micromark/lib/initialize/text.js 68230/** 68231 * @typedef {import('micromark-util-types').Code} Code 68232 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct 68233 * @typedef {import('micromark-util-types').Initializer} Initializer 68234 * @typedef {import('micromark-util-types').Resolver} Resolver 68235 * @typedef {import('micromark-util-types').State} State 68236 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 68237 */ 68238 68239const resolver = { 68240 resolveAll: createResolver() 68241} 68242const string = initializeFactory('string') 68243const text_text = initializeFactory('text') 68244 68245/** 68246 * @param {'string' | 'text'} field 68247 * @returns {InitialConstruct} 68248 */ 68249function initializeFactory(field) { 68250 return { 68251 tokenize: initializeText, 68252 resolveAll: createResolver( 68253 field === 'text' ? resolveAllLineSuffixes : undefined 68254 ) 68255 } 68256 68257 /** 68258 * @this {TokenizeContext} 68259 * @type {Initializer} 68260 */ 68261 function initializeText(effects) { 68262 const self = this 68263 const constructs = this.parser.constructs[field] 68264 const text = effects.attempt(constructs, start, notText) 68265 return start 68266 68267 /** @type {State} */ 68268 function start(code) { 68269 return atBreak(code) ? text(code) : notText(code) 68270 } 68271 68272 /** @type {State} */ 68273 function notText(code) { 68274 if (code === null) {
68275 effects.consume(code) 68276 return 68277 } 68278 effects.enter('data') 68279 effects.consume(code) 68280 return data 68281 } 68282 68283 /** @type {State} */ 68284 function data(code) { 68285 if (atBreak(code)) { 68286 effects.exit('data') 68287 return text(code) 68288 } 68289 68290 // Data. 68291 effects.consume(code) 68292 return data 68293 } 68294 68295 /** 68296 * @param {Code} code 68297 * @returns {boolean} 68298 */ 68299 function atBreak(code) { 68300 if (code === null) { 68301 return true 68302 } 68303 const list = constructs[code] 68304 let index = -1 68305 if (list) { 68306 // Always populated by defaults. 68307 68308 while (++index < list.length) { 68309 const item = list[index] 68310 if (!item.previous || item.previous.call(self, self.previous)) { 68311 return true 68312 } 68313 } 68314 } 68315 return false 68316 } 68317 } 68318} 68319 68320/** 68321 * @param {Resolver | undefined} [extraResolver] 68322 * @returns {Resolver} 68323 */ 68324function createResolver(extraResolver) { 68325 return resolveAllText 68326 68327 /** @type {Resolver} */ 68328 function resolveAllText(events, context) { 68329 let index = -1 68330 /** @type {number | undefined} */ 68331 let enter 68332 68333 // A rather boring computation (to merge adjacent `data` events) which 68334 // improves mm performance by 29%. 68335 while (++index <= events.length) { 68336 if (enter === undefined) { 68337 if (events[index] && events[index][1].type === 'data') { 68338 enter = index 68339 index++ 68340 } 68341 } else if (!events[index] || events[index][1].type !== 'data') { 68342 // Donât do anything if there is one data token. 68343 if (index !== enter + 2) { 68344 events[enter][1].end = events[index - 1][1].end 68345 events.splice(enter + 2, index - enter - 2) 68346 index = enter + 2 68347 } 68348 enter = undefined 68349 } 68350 } 68351 return extraResolver ? extraResolver(events, context) : events 68352 } 68353} 68354 68355/** 68356 * A rather ugly set of instructions which again looks at chunks in the input 68357 * stream. 68358 * The reason to do this here is that it is *much* faster to parse in reverse. 68359 * And that we canât hook into `null` to split the line suffix before an EOF. 68360 * To do: figure out if we can make this into a clean utility, or even in core. 68361 * As it will be useful for GFMs literal autolink extension (and maybe even 68362 * tables?) 68363 * 68364 * @type {Resolver} 68365 */ 68366function resolveAllLineSuffixes(events, context) { 68367 let eventIndex = 0 // Skip first. 68368 68369 while (++eventIndex <= events.length) { 68370 if ( 68371 (eventIndex === events.length || 68372 events[eventIndex][1].type === 'lineEnding') && 68373 events[eventIndex - 1][1].type === 'data' 68374 ) { 68375 const data = events[eventIndex - 1][1] 68376 const chunks = context.sliceStream(data) 68377 let index = chunks.length 68378 let bufferIndex = -1 68379 let size = 0 68380 /** @type {boolean | undefined} */ 68381 let tabs 68382 while (index--) { 68383 const chunk = chunks[index] 68384 if (typeof chunk === 'string') { 68385 bufferIndex = chunk.length 68386 while (chunk.charCodeAt(bufferIndex - 1) === 32) { 68387 size++ 68388 bufferIndex-- 68389 } 68390 if (bufferIndex) break 68391 bufferIndex = -1 68392 } 68393 // Number 68394 else if (chunk === -2) { 68395 tabs = true 68396 size++ 68397 } else if (chunk === -1) { 68398 // Empty 68399 } else { 68400 // Replacement character, exit. 68401 index++ 68402 break 68403 } 68404 } 68405 if (size) { 68406 const token = { 68407 type: 68408 eventIndex === events.length || tabs || size < 2 68409 ? 'lineSuffix' 68410 : 'hardBreakTrailing', 68411 start: { 68412 line: data.end.line, 68413 column: data.end.column - size, 68414 offset: data.end.offset - size, 68415 _index: data.start._index + index, 68416 _bufferIndex: index 68417 ? bufferIndex 68418 : data.start._bufferIndex + bufferIndex 68419 }, 68420 end: Object.assign({}, data.end) 68421 } 68422 data.end = Object.assign({}, token.start) 68423 if (data.start.offset === data.end.offset) { 68424 Object.assign(data, token) 68425 } else { 68426 events.splice( 68427 eventIndex, 68428 0, 68429 ['enter', token, context], 68430 ['exit', token, context] 68431 ) 68432 eventIndex += 2 68433 } 68434 } 68435 eventIndex++ 68436 } 68437 } 68438 return events 68439} 68440 68441;// ./node_modules/micromark-util-resolve-all/index.js 68442/** 68443 * @typedef {import('micromark-util-types').Event} Event 68444 * @typedef {import('micromark-util-types').Resolver} Resolver 68445 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 68446 */ 68447 68448/** 68449 * Call all `resolveAll`s. 68450 * 68451 * @param {Array<{resolveAll?: Resolver | undefined}>} constructs 68452 * List of constructs, optionally with `resolveAll`s. 68453 * @param {Array<Event>} events 68454 * List of events. 68455 * @param {TokenizeContext} context 68456 * Context used by `tokenize`. 68457 * @returns {Array<Event>} 68458 * Changed events. 68459 */ 68460function resolveAll(constructs, events, context) { 68461 /** @type {Array<Resolver>} */ 68462 const called = [] 68463 let index = -1 68464 68465 while (++index < constructs.length) { 68466 const resolve = constructs[index].resolveAll 68467 68468 if (resolve && !called.includes(resolve)) { 68469 events = resolve(events, context) 68470 called.push(resolve) 68471 } 68472 } 68473 68474 return events 68475} 68476 68477;// ./node_modules/micromark/lib/create-tokenizer.js 68478/** 68479 * @typedef {import('micromark-util-types').Chunk} Chunk 68480 * @typedef {import('micromark-util-types').Code} Code 68481 * @typedef {import('micromark-util-types').Construct} Construct 68482 * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord 68483 * @typedef {import('micromark-util-types').Effects} Effects 68484 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct 68485 * @typedef {import('micromark-util-types').ParseContext} ParseContext 68486 * @typedef {import('micromark-util-types').Point} Point 68487 * @typedef {import('micromark-util-types').State} State 68488 * @typedef {import('micromark-util-types').Token} Token 68489 * @typedef {import('micromark-util-types').TokenType} TokenType 68490 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 68491 */ 68492 68493/** 68494 * @callback Restore 68495 * @returns {void} 68496 * 68497 * @typedef Info 68498 * @property {Restore} restore 68499 * @property {number} from 68500 * 68501 * @callback ReturnHandle 68502 * Handle a successful run. 68503 * @param {Construct} construct 68504 * @param {Info} info 68505 * @returns {void} 68506 */ 68507 68508 68509 68510 68511/** 68512 * Create a tokenizer. 68513 * Tokenizers deal with one type of data (e.g., containers, flow, text). 68514 * The parser is the object dealing with it all. 68515 * `initialize` works like other constructs, except that only its `tokenize` 68516 * function is used, in which case it doesnât receive an `ok` or `nok`. 68517 * `from` can be given to set the point before the first character, although 68518 * when further lines are indented, they must be set with `defineSki
68518p`. 68519 * 68520 * @param {ParseContext} parser 68521 * @param {InitialConstruct} initialize 68522 * @param {Omit<Point, '_bufferIndex' | '_index'> | undefined} [from] 68523 * @returns {TokenizeContext} 68524 */ 68525function createTokenizer(parser, initialize, from) { 68526 /** @type {Point} */ 68527 let point = Object.assign( 68528 from 68529 ? Object.assign({}, from) 68530 : { 68531 line: 1, 68532 column: 1, 68533 offset: 0 68534 }, 68535 { 68536 _index: 0, 68537 _bufferIndex: -1 68538 } 68539 ) 68540 /** @type {Record<string, number>} */ 68541 const columnStart = {} 68542 /** @type {Array<Construct>} */ 68543 const resolveAllConstructs = [] 68544 /** @type {Array<Chunk>} */ 68545 let chunks = [] 68546 /** @type {Array<Token>} */ 68547 let stack = [] 68548 /** @type {boolean | undefined} */ 68549 let consumed = true 68550 68551 /** 68552 * Tools used for tokenizing. 68553 * 68554 * @type {Effects} 68555 */ 68556 const effects = { 68557 consume, 68558 enter, 68559 exit, 68560 attempt: constructFactory(onsuccessfulconstruct), 68561 check: constructFactory(onsuccessfulcheck), 68562 interrupt: constructFactory(onsuccessfulcheck, { 68563 interrupt: true 68564 }) 68565 } 68566 68567 /** 68568 * State and tools for resolving and serializing. 68569 * 68570 * @type {TokenizeContext} 68571 */ 68572 const context = { 68573 previous: null, 68574 code: null, 68575 containerState: {}, 68576 events: [], 68577 parser, 68578 sliceStream, 68579 sliceSerialize, 68580 now, 68581 defineSkip, 68582 write 68583 } 68584 68585 /** 68586 * The state function. 68587 * 68588 * @type {State | void} 68589 */ 68590 let state = initialize.tokenize.call(context, effects) 68591 68592 /** 68593 * Track which character we expect to be consumed, to catch bugs. 68594 * 68595 * @type {Code} 68596 */ 68597 let expectedCode 68598 if (initialize.resolveAll) { 68599 resolveAllConstructs.push(initialize) 68600 } 68601 return context 68602 68603 /** @type {TokenizeContext['write']} */ 68604 function write(slice) { 68605 chunks = push(chunks, slice) 68606 main() 68607 68608 // Exit if weâre not done, resolve might change stuff. 68609 if (chunks[chunks.length - 1] !== null) { 68610 return [] 68611 } 68612 addResult(initialize, 0) 68613 68614 // Otherwise, resolve, and exit. 68615 context.events = resolveAll(resolveAllConstructs, context.events, context) 68616 return context.events 68617 } 68618 68619 // 68620 // Tools. 68621 // 68622 68623 /** @type {TokenizeContext['sliceSerialize']} */ 68624 function sliceSerialize(token, expandTabs) { 68625 return serializeChunks(sliceStream(token), expandTabs) 68626 } 68627 68628 /** @type {TokenizeContext['sliceStream']} */ 68629 function sliceStream(token) { 68630 return sliceChunks(chunks, token) 68631 } 68632 68633 /** @type {TokenizeContext['now']} */ 68634 function now() { 68635 // This is a hot path, so we clone manually instead of `Object.assign({}, point)` 68636 const {line, column, offset, _index, _bufferIndex} = point 68637 return { 68638 line, 68639 column, 68640 offset, 68641 _index, 68642 _bufferIndex 68643 } 68644 } 68645 68646 /** @type {TokenizeContext['defineSkip']} */ 68647 function defineSkip(value) { 68648 columnStart[value.line] = value.column 68649 accountForPotentialSkip() 68650 } 68651 68652 // 68653 // State management. 68654 // 68655 68656 /** 68657 * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by 68658 * `consume`). 68659 * Here is where we walk through the chunks, which either include strings of 68660 * several characters, or numerical character codes. 68661 * The reason to do this in a loop instead of a call is so the stack can 68662 * drain. 68663 * 68664 * @returns {void} 68665 */ 68666 function main() { 68667 /** @type {number} */ 68668 let chunkIndex 68669 while (point._index < chunks.length) { 68670 const chunk = chunks[point._index] 68671 68672 // If weâre in a buffer chunk, loop through it. 68673 if (typeof chunk === 'string') { 68674 chunkIndex = point._index 68675 if (point._bufferIndex < 0) { 68676 point._bufferIndex = 0 68677 } 68678 while ( 68679 point._index === chunkIndex && 68680 point._bufferIndex < chunk.length 68681 ) { 68682 go(chunk.charCodeAt(point._bufferIndex)) 68683 } 68684 } else { 68685 go(chunk) 68686 } 68687 } 68688 } 68689 68690 /** 68691 * Deal with one code. 68692 * 68693 * @param {Code} code 68694 * @returns {void} 68695 */ 68696 function go(code) { 68697 consumed = undefined 68698 expectedCode = code 68699 state = state(code) 68700 } 68701 68702 /** @type {Effects['consume']} */ 68703 function consume(code) { 68704 if (markdownLineEnding(code)) { 68705 point.line++ 68706 point.column = 1 68707 point.offset += code === -3 ? 2 : 1 68708 accountForPotentialSkip() 68709 } else if (code !== -1) { 68710 point.column++ 68711 point.offset++ 68712 } 68713 68714 // Not in a string chunk. 68715 if (point._bufferIndex < 0) { 68716 point._index++ 68717 } else { 68718 point._bufferIndex++ 68719 68720 // At end of string chunk. 68721 // @ts-expect-error Points w/ non-negative `_bufferIndex` reference 68722 // strings. 68723 if (point._bufferIndex === chunks[point._index].length) { 68724 point._bufferIndex = -1 68725 point._index++ 68726 } 68727 } 68728 68729 // Expose the previous character. 68730 context.previous = code 68731 68732 // Mark as consumed. 68733 consumed = true 68734 } 68735 68736 /** @type {Effects['enter']} */ 68737 function enter(type, fields) { 68738 /** @type {Token} */ 68739 // @ts-expect-error Patch instead of assign required fields to help GC. 68740 const token = fields || {} 68741 token.type = type 68742 token.start = now() 68743 context.events.push(['enter', token, context]) 68744 stack.push(token) 68745 return token 68746 } 68747 68748 /** @type {Effects['exit']} */ 68749 function exit(type) { 68750 const token = stack.pop() 68751 token.end = now() 68752 context.events.push(['exit', token, context]) 68753 return token 68754 } 68755 68756 /** 68757 * Use results. 68758 * 68759 * @type {ReturnHandle} 68760 */ 68761 function onsuccessfulconstruct(construct, info) { 68762 addResult(construct, info.from) 68763 } 68764 68765 /** 68766 * Discard results. 68767 * 68768 * @type {ReturnHandle} 68769 */ 68770 function onsuccessfulcheck(_, info) {
68771 info.restore() 68772 } 68773 68774 /** 68775 * Factory to attempt/check/interrupt. 68776 * 68777 * @param {ReturnHandle} onreturn 68778 * @param {{interrupt?: boolean | undefined} | undefined} [fields] 68779 */ 68780 function constructFactory(onreturn, fields) { 68781 return hook 68782 68783 /** 68784 * Handle either an object mapping codes to constructs, a list of 68785 * constructs, or a single construct. 68786 * 68787 * @param {Array<Construct> | Construct | ConstructRecord} constructs 68788 * @param {State} returnState 68789 * @param {State | undefined} [bogusState] 68790 * @returns {State} 68791 */ 68792 function hook(constructs, returnState, bogusState) { 68793 /** @type {Array<Construct>} */ 68794 let listOfConstructs 68795 /** @type {number} */ 68796 let constructIndex 68797 /** @type {Construct} */ 68798 let currentConstruct 68799 /** @type {Info} */ 68800 let info 68801 return Array.isArray(constructs) /* c8 ignore next 1 */ 68802 ? handleListOfConstructs(constructs) 68803 : 'tokenize' in constructs 68804 ? // @ts-expect-error Looks like a construct. 68805 handleListOfConstructs([constructs]) 68806 : handleMapOfConstructs(constructs) 68807 68808 /** 68809 * Handle a list of construct. 68810 * 68811 * @param {ConstructRecord} map 68812 * @returns {State} 68813 */ 68814 function handleMapOfConstructs(map) { 68815 return start 68816 68817 /** @type {State} */ 68818 function start(code) { 68819 const def = code !== null && map[code] 68820 const all = code !== null && map.null 68821 const list = [ 68822 // To do: add more extension tests. 68823 /* c8 ignore next 2 */ 68824 ...(Array.isArray(def) ? def : def ? [def] : []), 68825 ...(Array.isArray(all) ? all : all ? [all] : []) 68826 ] 68827 return handleListOfConstructs(list)(code) 68828 } 68829 } 68830 68831 /** 68832 * Handle a list of construct. 68833 * 68834 * @param {Array<Construct>} list 68835 * @returns {State} 68836 */ 68837 function handleListOfConstructs(list) { 68838 listOfConstructs = list 68839 constructIndex = 0 68840 if (list.length === 0) { 68841 return bogusState 68842 } 68843 return handleConstruct(list[constructIndex]) 68844 } 68845 68846 /** 68847 * Handle a single construct. 68848 * 68849 * @param {Construct} construct 68850 * @returns {State} 68851 */ 68852 function handleConstruct(construct) { 68853 return start 68854 68855 /** @type {State} */ 68856 function start(code) { 68857 // To do: not needed to store if there is no bogus state, probably? 68858 // Currently doesnât work because `inspect` in document does a check 68859 // w/o a bogus, which doesnât make sense. But it does seem to help perf 68860 // by not storing. 68861 info = store() 68862 currentConstruct = construct 68863 if (!construct.partial) { 68864 context.currentConstruct = construct 68865 } 68866 68867 // Always populated by defaults. 68868 68869 if ( 68870 construct.name && 68871 context.parser.constructs.disable.null.includes(construct.name) 68872 ) { 68873 return nok(code) 68874 } 68875 return construct.tokenize.call( 68876 // If we do have fields, create an object w/ `context` as its 68877 // prototype. 68878 // This allows a âlive bindingâ, which is needed for `interrupt`. 68879 fields ? Object.assign(Object.create(context), fields) : context, 68880 effects, 68881 ok, 68882 nok 68883 )(code) 68884 } 68885 } 68886 68887 /** @type {State} */ 68888 function ok(code) { 68889 consumed = true 68890 onreturn(currentConstruct, info) 68891 return returnState 68892 } 68893 68894 /** @type {State} */ 68895 function nok(code) { 68896 consumed = true 68897 info.restore() 68898 if (++constructIndex < listOfConstructs.length) { 68899 return handleConstruct(listOfConstructs[constructIndex]) 68900 } 68901 return bogusState 68902 } 68903 } 68904 } 68905 68906 /** 68907 * @param {Construct} construct 68908 * @param {number} from 68909 * @returns {void} 68910 */ 68911 function addResult(construct, from) { 68912 if (construct.resolveAll && !resolveAllConstructs.includes(construct)) { 68913 resolveAllConstructs.push(construct) 68914 } 68915 if (construct.resolve) { 68916 splice( 68917 context.events, 68918 from, 68919 context.events.length - from, 68920 construct.resolve(context.events.slice(from), context) 68921 ) 68922 } 68923 if (construct.resolveTo) { 68924 context.events = construct.resolveTo(context.events, context) 68925 } 68926 } 68927 68928 /** 68929 * Store state. 68930 * 68931 * @returns {Info} 68932 */ 68933 function store() { 68934 const startPoint = now() 68935 const startPrevious = context.previous 68936 const startCurrentConstruct = context.currentConstruct 68937 const startEventsIndex = context.events.length 68938 const startStack = Array.from(stack) 68939 return { 68940 restore, 68941 from: startEventsIndex 68942 } 68943 68944 /** 68945 * Restore state. 68946 * 68947 * @returns {void} 68948 */
68949 function restore() { 68950 point = startPoint 68951 context.previous = startPrevious 68952 context.currentConstruct = startCurrentConstruct 68953 context.events.length = startEventsIndex 68954 stack = startStack 68955 accountForPotentialSkip() 68956 } 68957 } 68958 68959 /** 68960 * Move the current point a bit forward in the line when itâs on a column 68961 * skip. 68962 * 68963 * @returns {void} 68964 */ 68965 function accountForPotentialSkip() { 68966 if (point.line in columnStart && point.column < 2) { 68967 point.column = columnStart[point.line] 68968 point.offset += columnStart[point.line] - 1 68969 } 68970 } 68971} 68972 68973/** 68974 * Get the chunks from a slice of chunks in the range of a token. 68975 * 68976 * @param {Array<Chunk>} chunks 68977 * @param {Pick<Token, 'end' | 'start'>} token 68978 * @returns {Array<Chunk>} 68979 */ 68980function sliceChunks(chunks, token) { 68981 const startIndex = token.start._index 68982 const startBufferIndex = token.start._bufferIndex 68983 const endIndex = token.end._index 68984 const endBufferIndex = token.end._bufferIndex 68985 /** @type {Array<Chunk>} */ 68986 let view 68987 if (startIndex === endIndex) { 68988 // @ts-expect-error `_bufferIndex` is used on string chunks. 68989 view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)] 68990 } else { 68991 view = chunks.slice(startIndex, endIndex) 68992 if (startBufferIndex > -1) { 68993 const head = view[0] 68994 if (typeof head === 'string') { 68995 view[0] = head.slice(startBufferIndex) 68996 } else { 68997 view.shift() 68998 } 68999 } 69000 if (endBufferIndex > 0) { 69001 // @ts-expect-error `_bufferIndex` is used on string chunks. 69002 view.push(chunks[endIndex].slice(0, endBufferIndex)) 69003 } 69004 } 69005 return view 69006} 69007 69008/** 69009 * Get the string value of a slice of chunks. 69010 * 69011 * @param {Array<Chunk>} chunks 69012 * @param {boolean | undefined} [expandTabs=false] 69013 * @returns {string} 69014 */ 69015function serializeChunks(chunks, expandTabs) { 69016 let index = -1 69017 /** @type {Array<string>} */ 69018 const result = [] 69019 /** @type {boolean | undefined} */ 69020 let atTab 69021 while (++index < chunks.length) { 69022 const chunk = chunks[index] 69023 /** @type {string} */ 69024 let value 69025 if (typeof chunk === 'string') { 69026 value = chunk 69027 } else 69028 switch (chunk) { 69029 case -5: { 69030 value = '\r' 69031 break 69032 } 69033 case -4: { 69034 value = '\n' 69035 break 69036 } 69037 case -3: { 69038 value = '\r' + '\n' 69039 break 69040 } 69041 case -2: { 69042 value = expandTabs ? ' ' : '\t' 69043 break 69044 } 69045 case -1: { 69046 if (!expandTabs && atTab) continue 69047 value = ' ' 69048 break 69049 } 69050 default: { 69051 // Currently only replacement character. 69052 value = String.fromCharCode(chunk) 69053 } 69054 } 69055 atTab = chunk === -2 69056 result.push(value) 69057 } 69058 return result.join('') 69059} 69060 69061;// ./node_modules/micromark-core-commonmark/lib/thematic-break.js 69062/** 69063 * @typedef {import('micromark-util-types').Code} Code 69064 * @typedef {import('micromark-util-types').Construct} Construct 69065 * @typedef {import('micromark-util-types').State} State 69066 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 69067 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 69068 */ 69069 69070 69071 69072/** @type {Construct} */ 69073const thematicBreak = { 69074 name: 'thematicBreak', 69075 tokenize: tokenizeThematicBreak 69076} 69077 69078/** 69079 * @this {TokenizeContext} 69080 * @type {Tokenizer} 69081 */ 69082function tokenizeThematicBreak(effects, ok, nok) { 69083 let size = 0 69084 /** @type {NonNullable<Code>} */ 69085 let marker 69086 return start 69087 69088 /** 69089 * Start of thematic break. 69090 * 69091 * ```markdown 69092 * > | *** 69093 * ^ 69094 * ``` 69095 * 69096 * @type {State} 69097 */ 69098 function start(code) { 69099 effects.enter('thematicBreak') 69100 // To do: parse indent like `markdown-rs`. 69101 return before(code) 69102 } 69103 69104 /** 69105 * After optional whitespace, at marker. 69106 * 69107 * ```markdown 69108 * > | *** 69109 * ^ 69110 * ``` 69111 * 69112 * @type {State} 69113 */ 69114 function before(code) { 69115 marker = code 69116 return atBreak(code) 69117 } 69118 69119 /** 69120 * After something, before something else. 69121 * 69122 * ```markdown 69123 * > | *** 69124 * ^ 69125 * ``` 69126 * 69127 * @type {State} 69128 */ 69129 function atBreak(code) { 69130 if (code === marker) { 69131 effects.enter('thematicBreakSequence') 69132 return sequence(code) 69133 } 69134 if (size >= 3 && (code === null || markdownLineEnding(code))) { 69135 effects.exit('thematicBreak') 69136 return ok(code) 69137 } 69138 return nok(code) 69139 } 69140 69141 /** 69142 * In sequence. 69143 * 69144 * ```markdown 69145 * > | *** 69146 * ^ 69147 * ``` 69148 * 69149 * @type {State} 69150 */ 69151 function sequence(code) { 69152 if (code === marker) {
69153 effects.consume(code) 69154 size++ 69155 return sequence 69156 } 69157 effects.exit('thematicBreakSequence') 69158 return markdownSpace(code) 69159 ? factorySpace(effects, atBreak, 'whitespace')(code) 69160 : atBreak(code) 69161 } 69162} 69163 69164;// ./node_modules/micromark-core-commonmark/lib/list.js 69165/** 69166 * @typedef {import('micromark-util-types').Code} Code 69167 * @typedef {import('micromark-util-types').Construct} Construct 69168 * @typedef {import('micromark-util-types').ContainerState} ContainerState 69169 * @typedef {import('micromark-util-types').Exiter} Exiter 69170 * @typedef {import('micromark-util-types').State} State 69171 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 69172 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 69173 */ 69174 69175 69176 69177 69178 69179 69180/** @type {Construct} */ 69181const list = { 69182 name: 'list', 69183 tokenize: tokenizeListStart, 69184 continuation: { 69185 tokenize: tokenizeListContinuation 69186 }, 69187 exit: tokenizeListEnd 69188} 69189 69190/** @type {Construct} */ 69191const listItemPrefixWhitespaceConstruct = { 69192 tokenize: tokenizeListItemPrefixWhitespace, 69193 partial: true 69194} 69195 69196/** @type {Construct} */ 69197const indentConstruct = { 69198 tokenize: tokenizeIndent, 69199 partial: true 69200} 69201 69202// To do: `markdown-rs` parses list items on their own and later stitches them 69203// together. 69204 69205/** 69206 * @type {Tokenizer} 69207 * @this {TokenizeContext} 69208 */ 69209function tokenizeListStart(effects, ok, nok) { 69210 const self = this 69211 const tail = self.events[self.events.length - 1] 69212 let initialSize = 69213 tail && tail[1].type === 'linePrefix' 69214 ? tail[2].sliceSerialize(tail[1], true).length 69215 : 0 69216 let size = 0 69217 return start 69218 69219 /** @type {State} */ 69220 function start(code) { 69221 const kind = 69222 self.containerState.type || 69223 (code === 42 || code === 43 || code === 45 69224 ? 'listUnordered' 69225 : 'listOrdered') 69226 if ( 69227 kind === 'listUnordered' 69228 ? !self.containerState.marker || code === self.containerState.marker 69229 : asciiDigit(code) 69230 ) { 69231 if (!self.containerState.type) { 69232 self.containerState.type = kind 69233 effects.enter(kind, { 69234 _container: true 69235 }) 69236 } 69237 if (kind === 'listUnordered') { 69238 effects.enter('listItemPrefix') 69239 return code === 42 || code === 45 69240 ? effects.check(thematicBreak, nok, atMarker)(code) 69241 : atMarker(code) 69242 } 69243 if (!self.interrupt || code === 49) { 69244 effects.enter('listItemPrefix') 69245 effects.enter('listItemValue') 69246 return inside(code) 69247 } 69248 } 69249 return nok(code) 69250 } 69251 69252 /** @type {State} */ 69253 function inside(code) { 69254 if (asciiDigit(code) && ++size < 10) { 69255 effects.consume(code) 69256 return inside 69257 } 69258 if ( 69259 (!self.interrupt || size < 2) && 69260 (self.containerState.marker 69261 ? code === self.containerState.marker 69262 : code === 41 || code === 46) 69263 ) { 69264 effects.exit('listItemValue') 69265 return atMarker(code) 69266 } 69267 return nok(code) 69268 } 69269 69270 /** 69271 * @type {State} 69272 **/ 69273 function atMarker(code) { 69274 effects.enter('listItemMarker') 69275 effects.consume(code) 69276 effects.exit('listItemMarker') 69277 self.containerState.marker = self.containerState.marker || code 69278 return effects.check( 69279 blankLine, 69280 // Canât be empty when interrupting. 69281 self.interrupt ? nok : onBlank, 69282 effects.attempt( 69283 listItemPrefixWhitespaceConstruct, 69284 endOfPrefix, 69285 otherPrefix 69286 ) 69287 ) 69288 } 69289 69290 /** @type {State} */ 69291 function onBlank(code) { 69292 self.containerState.initialBlankLine = true 69293 initialSize++ 69294 return endOfPrefix(code) 69295 } 69296 69297 /** @type {State} */ 69298 function otherPrefix(code) { 69299 if (markdownSpace(code)) { 69300 effects.enter('listItemPrefixWhitespace') 69301 effects.consume(code) 69302 effects.exit('listItemPrefixWhitespace') 69303 return endOfPrefix 69304 } 69305 return nok(code) 69306 } 69307 69308 /** @type {State} */ 69309 function endOfPrefix(code) { 69310 self.containerState.size = 69311 initialSize + 69312 self.sliceSerialize(effects.exit('listItemPrefix'), true).length 69313 return ok(code) 69314 } 69315} 69316 69317/** 69318 * @type {Tokenizer} 69319 * @this {TokenizeContext} 69320 */ 69321function tokenizeListContinuation(effects, ok, nok) { 69322 const self = this 69323 self.containerState._closeFlow = undefined 69324 return effects.check(blankLine, onBlank, notBlank) 69325 69326 /** @type {State} */ 69327 function onBlank(code) { 69328 self.containerState.furtherBlankLines = 69329 self.containerState.furtherBlankLines || 69330 self.containerState.initialBlankLine 69331 69332 // We have a blank line. 69333 // Still, try to consume at most the items size. 69334 return factorySpace( 69335 effects, 69336 ok, 69337 'listItemIndent', 69338 self.containerState.size + 1 69339 )(code) 69340 } 69341 69342 /** @type {State} */ 69343 function notBlank(code) { 69344 if (self.containerState.furtherBlankLines || !markdownSpace(code)) { 69345 self.containerState.furtherBlankLines = undefined 69346 self.containerState.initialBlankLine = undefined 69347 return notInCurrentItem(code) 69348 } 69349 self.containerState.furtherBlankLines = undefined 69350 self.containerState.initialBlankLine = undefined 69351 return effects.attempt(indentConstruct, ok, notInCurrentItem)(code) 69352 } 69353 69354 /** @type {State} */ 69355 function notInCurrentItem(code) { 69356 // While we do continue, we signal that the flow should be closed. 69357 self.containerState._closeFlow = true 69358 // As weâre closing flow, weâre no longer interrupting. 69359 self.interrupt = undefined 69360 // Always populated by defaults. 69361 69362 return factorySpace( 69363 effects, 69364 effects.attempt(list, ok, nok), 69365 'linePrefix', 69366 self.parser.constructs.disable.null.includes('codeIndented') 69367 ? undefined 69368 : 4 69369 )(code) 69370 } 69371} 69372 69373/** 69374 * @type {Tokenizer} 69375 * @this {TokenizeContext} 69376 */ 69377function tokenizeIndent(effects, ok, nok) { 69378 const self = this 69379 return factorySpace( 69380 effects, 69381 afterPrefix, 69382 'listItemIndent', 69383 self.containerState.size + 1 69384 ) 69385 69386 /** @type {State} */ 69387 function afterPrefix(code) { 69388 const tail = self.events[self.events.length - 1] 69389 return tail && 69390 tail[1].type === 'listItemIndent' && 69391 tail[2].sliceSerialize(tail[1], true).length === self.containerState.size 69392 ? ok(code) 69393 : nok(code) 69394 } 69395} 69396 69397/** 69398 * @type {Exiter} 69399 * @this {TokenizeContext} 69400 */ 69401function tokenizeListEnd(effects) { 69402 effects.exit(this.containerState.type) 69403} 69404 69405/** 69406 * @type {Tokenizer} 69407 * @this {TokenizeContext} 69408 */ 69409function tokenizeListItemPrefixWhitespace(effects, ok, nok) { 69410 const self = this 69411 69412 // Always populated by defaults. 69413 69414 return factorySpace( 69415 effects, 69416 afterPrefix, 69417 'listItemPrefixWhitespace', 69418 self.parser.constructs.disable.null.includes('codeIndented') 69419 ? undefined 69420 : 4 + 1 69421 ) 69422 69423 /** @type {State} */ 69424 function afterPrefix(code) { 69425 const tail = self.events[self.events.length - 1] 69426 return !markdownSpace(code) && 69427 tail && 69428 tail[1].type === 'listItemPrefixWhitespace' 69429 ? ok(code) 69430 : nok(code) 69431 } 69432} 69433 69434;// ./node_modules/micromark-core-commonmark/lib/block-quote.js 69435/** 69436 * @typedef {import('micromark-util-types').Construct} Construct 69437 * @typedef {import('micromark-util-types').Exiter} Exiter 69438 * @typedef {import('micromark-util-types').State} State 69439 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 69440 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 69441 */ 69442 69443 69444 69445/** @type {Construct} */ 69446const blockQuote = { 69447 name: 'blockQuote', 69448 tokenize: tokenizeBlockQuoteStart, 69449 continuation: { 69450 tokenize: tokenizeBlockQuoteContinuation 69451 }, 69452 exit 69453} 69454
69455/** 69456 * @this {TokenizeContext} 69457 * @type {Tokenizer} 69458 */ 69459function tokenizeBlockQuoteStart(effects, ok, nok) { 69460 const self = this 69461 return start 69462 69463 /** 69464 * Start of block quote. 69465 * 69466 * ```markdown 69467 * > | > a 69468 * ^ 69469 * ``` 69470 * 69471 * @type {State} 69472 */ 69473 function start(code) { 69474 if (code === 62) { 69475 const state = self.containerState 69476 if (!state.open) { 69477 effects.enter('blockQuote', { 69478 _container: true 69479 }) 69480 state.open = true 69481 } 69482 effects.enter('blockQuotePrefix') 69483 effects.enter('blockQuoteMarker') 69484 effects.consume(code) 69485 effects.exit('blockQuoteMarker') 69486 return after 69487 } 69488 return nok(code) 69489 } 69490 69491 /** 69492 * After `>`, before optional whitespace. 69493 * 69494 * ```markdown 69495 * > | > a 69496 * ^ 69497 * ``` 69498 * 69499 * @type {State} 69500 */ 69501 function after(code) { 69502 if (markdownSpace(code)) { 69503 effects.enter('blockQuotePrefixWhitespace') 69504 effects.consume(code) 69505 effects.exit('blockQuotePrefixWhitespace') 69506 effects.exit('blockQuotePrefix') 69507 return ok 69508 } 69509 effects.exit('blockQuotePrefix') 69510 return ok(code) 69511 } 69512} 69513 69514/** 69515 * Start of block quote continuation. 69516 * 69517 * ```markdown 69518 * | > a 69519 * > | > b 69520 * ^ 69521 * ``` 69522 * 69523 * @this {TokenizeContext} 69524 * @type {Tokenizer} 69525 */ 69526function tokenizeBlockQuoteContinuation(effects, ok, nok) { 69527 const self = this 69528 return contStart 69529 69530 /** 69531 * Start of block quote continuation. 69532 * 69533 * Also used to parse the first block quote opening. 69534 * 69535 * ```markdown 69536 * | > a 69537 * > | > b 69538 * ^ 69539 * ``` 69540 * 69541 * @type {State} 69542 */ 69543 function contStart(code) { 69544 if (markdownSpace(code)) { 69545 // Always populated by defaults. 69546 69547 return factorySpace( 69548 effects, 69549 contBefore, 69550 'linePrefix', 69551 self.parser.constructs.disable.null.includes('codeIndented') 69552 ? undefined 69553 : 4 69554 )(code) 69555 } 69556 return contBefore(code) 69557 } 69558 69559 /** 69560 * At `>`, after optional whitespace. 69561 * 69562 * Also used to parse the first block quote opening. 69563 * 69564 * ```markdown 69565 * | > a 69566 * > | > b 69567 * ^ 69568 * ``` 69569 * 69570 * @type {State} 69571 */ 69572 function contBefore(code) { 69573 return effects.attempt(blockQuote, ok, nok)(code) 69574 } 69575} 69576 69577/** @type {Exiter} */ 69578function exit(effects) { 69579 effects.exit('blockQuote') 69580} 69581 69582;// ./node_modules/micromark-factory-destination/index.js 69583/** 69584 * @typedef {import('micromark-util-types').Effects} Effects 69585 * @typedef {import('micromark-util-types').State} State 69586 * @typedef {import('micromark-util-types').TokenType} TokenType 69587 */ 69588 69589 69590/** 69591 * Parse destinations. 69592 * 69593 * ###### Examples 69594 * 69595 * ```markdown 69596 * <a> 69597 * <a\>b> 69598 * <a b> 69599 * <a)> 69600 * a 69601 * a\)b 69602 * a(b)c 69603 * a(b) 69604 * ``` 69605 * 69606 * @param {Effects} effects 69607 * Context. 69608 * @param {State} ok 69609 * State switched to when successful. 69610 * @param {State} nok 69611 * State switched to when unsuccessful. 69612 * @param {TokenType} type 69613 * Type for whole (`<a>` or `b`). 69614 * @param {TokenType} literalType 69615 * Type when enclosed (`<a>`). 69616 * @param {TokenType} literalMarkerType 69617 * Type for enclosing (`<` and `>`). 69618 * @param {TokenType} rawType 69619 * Type when not enclosed (`b`). 69620 * @param {TokenType} stringType 69621 * Type for the value (`a` or `b`). 69622 * @param {number | undefined} [max=Infinity] 69623 * Depth of nested parens (inclusive). 69624 * @returns {State} 69625 * Start state. 69626 */ // eslint-disable-next-line max-params 69627function factoryDestination( 69628 effects, 69629 ok, 69630 nok, 69631 type, 69632 literalType, 69633 literalMarkerType, 69634 rawType, 69635 stringType, 69636 max 69637) { 69638 const limit = max || Number.POSITIVE_INFINITY 69639 let balance = 0 69640 return start 69641 69642 /** 69643 * Start of destination. 69644 * 69645 * ```markdown 69646 * > | <aa> 69647 * ^ 69648 * > | aa 69649 * ^ 69650 * ``` 69651 * 69652 * @type {State} 69653 */ 69654 function start(code) { 69655 if (code === 60) { 69656 effects.enter(type) 69657 effects.enter(literalType) 69658 effects.enter(literalMarkerType) 69659 effects.consume(code) 69660 effects.exit(literalMarkerType) 69661 return enclosedBefore 69662 } 69663 69664 // ASCII control, space, closing paren. 69665 if (code === null || code === 32 || code === 41 || asciiControl(code)) { 69666 return nok(code) 69667 } 69668 effects.enter(type) 69669 effects.enter(rawType) 69670 effects.enter(stringType) 69671 effects.enter('chunkString', { 69672 contentType: 'string' 69673 }) 69674 return raw(code) 69675 } 69676 69677 /** 69678 * After `<`, at an enclosed destination. 69679 * 69680 * ```markdown 69681 * > | <aa> 69682 * ^ 69683 * ``` 69684 * 69685 * @type {State} 69686 */ 69687 function enclosedBefore(code) { 69688 if (code === 62) { 69689 effects.enter(literalMarkerType)
69690 effects.consume(code) 69691 effects.exit(literalMarkerType) 69692 effects.exit(literalType) 69693 effects.exit(type) 69694 return ok 69695 } 69696 effects.enter(stringType) 69697 effects.enter('chunkString', { 69698 contentType: 'string' 69699 }) 69700 return enclosed(code) 69701 } 69702 69703 /** 69704 * In enclosed destination. 69705 * 69706 * ```markdown 69707 * > | <aa> 69708 * ^ 69709 * ``` 69710 * 69711 * @type {State} 69712 */ 69713 function enclosed(code) { 69714 if (code === 62) { 69715 effects.exit('chunkString') 69716 effects.exit(stringType) 69717 return enclosedBefore(code) 69718 } 69719 if (code === null || code === 60 || markdownLineEnding(code)) { 69720 return nok(code) 69721 } 69722 effects.consume(code) 69723 return code === 92 ? enclosedEscape : enclosed 69724 } 69725 69726 /** 69727 * After `\`, at a special character. 69728 * 69729 * ```markdown 69730 * > | <a\*a> 69731 * ^ 69732 * ``` 69733 * 69734 * @type {State} 69735 */ 69736 function enclosedEscape(code) { 69737 if (code === 60 || code === 62 || code === 92) { 69738 effects.consume(code) 69739 return enclosed 69740 } 69741 return enclosed(code) 69742 } 69743 69744 /** 69745 * In raw destination. 69746 * 69747 * ```markdown 69748 * > | aa 69749 * ^ 69750 * ``` 69751 * 69752 * @type {State} 69753 */ 69754 function raw(code) { 69755 if ( 69756 !balance && 69757 (code === null || code === 41 || markdownLineEndingOrSpace(code)) 69758 ) { 69759 effects.exit('chunkString') 69760 effects.exit(stringType) 69761 effects.exit(rawType) 69762 effects.exit(type) 69763 return ok(code) 69764 } 69765 if (balance < limit && code === 40) { 69766 effects.consume(code) 69767 balance++ 69768 return raw 69769 } 69770 if (code === 41) { 69771 effects.consume(code) 69772 balance-- 69773 return raw 69774 } 69775 69776 // ASCII control (but *not* `\0`) and space and `(`. 69777 // Note: in `markdown-rs`, `\0` exists in codes, in `micromark-js` it 69778 // doesnât. 69779 if (code === null || code === 32 || code === 40 || asciiControl(code)) { 69780 return nok(code) 69781 } 69782 effects.consume(code) 69783 return code === 92 ? rawEscape : raw 69784 } 69785 69786 /** 69787 * After `\`, at special character. 69788 * 69789 * ```markdown 69790 * > | a\*a 69791 * ^ 69792 * ``` 69793 * 69794 * @type {State} 69795 */ 69796 function rawEscape(code) { 69797 if (code === 40 || code === 41 || code === 92) { 69798 effects.consume(code) 69799 return raw 69800 } 69801 return raw(code) 69802 } 69803} 69804 69805;// ./node_modules/micromark-factory-label/index.js 69806/** 69807 * @typedef {import('micromark-util-types').Effects} Effects 69808 * @typedef {import('micromark-util-types').State} State 69809 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 69810 * @typedef {import('micromark-util-types').TokenType} TokenType 69811 */ 69812 69813 69814/** 69815 * Parse labels. 69816 * 69817 * > ð **Note**: labels in markdown are capped at 999 characters in the string. 69818 * 69819 * ###### Examples 69820 * 69821 * ```markdown 69822 * [a] 69823 * [a 69824 * b] 69825 * [a\]b] 69826 * ``` 69827 * 69828 * @this {TokenizeContext} 69829 * Tokenize context. 69830 * @param {Effects} effects 69831 * Context. 69832 * @param {State} ok 69833 * State switched to when successful. 69834 * @param {State} nok 69835 * State switched to when unsuccessful. 69836 * @param {TokenType} type 69837 * Type of the whole label (`[a]`). 69838 * @param {TokenType} markerType 69839 * Type for the markers (`[` and `]`). 69840 * @param {TokenType} stringType 69841 * Type for the identifier (`a`). 69842 * @returns {State} 69843 * Start state. 69844 */ // eslint-disable-next-line max-params 69845function factoryLabel(effects, ok, nok, type, markerType, stringType) { 69846 const self = this 69847 let size = 0 69848 /** @type {boolean} */ 69849 let seen 69850 return start 69851 69852 /** 69853 * Start of label. 69854 * 69855 * ```markdown 69856 * > | [a] 69857 * ^ 69858 * ``` 69859 * 69860 * @type {State} 69861 */ 69862 function start(code) { 69863 effects.enter(type) 69864 effects.enter(markerType) 69865 effects.consume(code) 69866 effects.exit(markerType) 69867 effects.enter(stringType) 69868 return atBreak 69869 } 69870 69871 /** 69872 * In label, at something, before something else. 69873 * 69874 * ```markdown 69875 * > | [a] 69876 * ^ 69877 * ``` 69878 * 69879 * @type {State} 69880 */ 69881 function atBreak(code) { 69882 if ( 69883 size > 999 || 69884 code === null || 69885 code === 91 || 69886 (code === 93 && !seen) || 69887 // To do: remove in the future once weâve switched from 69888 // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`, 69889 // which doesnât need this. 69890 // Hidden footnotes hook. 69891 /* c8 ignore next 3 */ 69892 (code === 94 && 69893 !size && 69894 '_hiddenFootnoteSupport' in self.parser.constructs) 69895 ) { 69896 return nok(code) 69897 } 69898 if (code === 93) { 69899 effects.exit(stringType) 69900 effects.enter(markerType)
69901 effects.consume(code) 69902 effects.exit(markerType) 69903 effects.exit(type) 69904 return ok 69905 } 69906 69907 // To do: indent? Link chunks and EOLs together? 69908 if (markdownLineEnding(code)) { 69909 effects.enter('lineEnding') 69910 effects.consume(code) 69911 effects.exit('lineEnding') 69912 return atBreak 69913 } 69914 effects.enter('chunkString', { 69915 contentType: 'string' 69916 }) 69917 return labelInside(code) 69918 } 69919 69920 /** 69921 * In label, in text. 69922 * 69923 * ```markdown 69924 * > | [a] 69925 * ^ 69926 * ``` 69927 * 69928 * @type {State} 69929 */ 69930 function labelInside(code) { 69931 if ( 69932 code === null || 69933 code === 91 || 69934 code === 93 || 69935 markdownLineEnding(code) || 69936 size++ > 999 69937 ) { 69938 effects.exit('chunkString') 69939 return atBreak(code) 69940 } 69941 effects.consume(code) 69942 if (!seen) seen = !markdownSpace(code) 69943 return code === 92 ? labelEscape : labelInside 69944 } 69945 69946 /** 69947 * After `\`, at a special character. 69948 * 69949 * ```markdown 69950 * > | [a\*a] 69951 * ^ 69952 * ``` 69953 * 69954 * @type {State} 69955 */ 69956 function labelEscape(code) { 69957 if (code === 91 || code === 92 || code === 93) { 69958 effects.consume(code) 69959 size++ 69960 return labelInside 69961 } 69962 return labelInside(code) 69963 } 69964} 69965 69966;// ./node_modules/micromark-factory-title/index.js 69967/** 69968 * @typedef {import('micromark-util-types').Code} Code 69969 * @typedef {import('micromark-util-types').Effects} Effects 69970 * @typedef {import('micromark-util-types').State} State 69971 * @typedef {import('micromark-util-types').TokenType} TokenType 69972 */ 69973 69974 69975 69976/** 69977 * Parse titles. 69978 * 69979 * ###### Examples 69980 * 69981 * ```markdown 69982 * "a" 69983 * 'b' 69984 * (c) 69985 * "a 69986 * b" 69987 * 'a 69988 * b' 69989 * (a\)b) 69990 * ``` 69991 * 69992 * @param {Effects} effects 69993 * Context. 69994 * @param {State} ok 69995 * State switched to when successful. 69996 * @param {State} nok 69997 * State switched to when unsuccessful. 69998 * @param {TokenType} type 69999 * Type of the whole title (`"a"`, `'b'`, `(c)`). 70000 * @param {TokenType} markerType 70001 * Type for the markers (`"`, `'`, `(`, and `)`). 70002 * @param {TokenType} stringType 70003 * Type for the value (`a`). 70004 * @returns {State} 70005 * Start state. 70006 */ // eslint-disable-next-line max-params 70007function factoryTitle(effects, ok, nok, type, markerType, stringType) { 70008 /** @type {NonNullable<Code>} */ 70009 let marker 70010 return start 70011 70012 /** 70013 * Start of title. 70014 * 70015 * ```markdown 70016 * > | "a" 70017 * ^ 70018 * ``` 70019 * 70020 * @type {State} 70021 */ 70022 function start(code) { 70023 if (code === 34 || code === 39 || code === 40) { 70024 effects.enter(type) 70025 effects.enter(markerType) 70026 effects.consume(code) 70027 effects.exit(markerType) 70028 marker = code === 40 ? 41 : code 70029 return begin 70030 } 70031 return nok(code) 70032 } 70033 70034 /** 70035 * After opening marker. 70036 * 70037 * This is also used at the closing marker. 70038 * 70039 * ```markdown 70040 * > | "a" 70041 * ^ 70042 * ``` 70043 * 70044 * @type {State} 70045 */ 70046 function begin(code) { 70047 if (code === marker) { 70048 effects.enter(markerType) 70049 effects.consume(code) 70050 effects.exit(markerType) 70051 effects.exit(type) 70052 return ok 70053 } 70054 effects.enter(stringType) 70055 return atBreak(code) 70056 } 70057 70058 /** 70059 * At something, before something else. 70060 * 70061 * ```markdown 70062 * > | "a" 70063 * ^ 70064 * ``` 70065 * 70066 * @type {State} 70067 */ 70068 function atBreak(code) { 70069 if (code === marker) { 70070 effects.exit(stringType) 70071 return begin(marker) 70072 } 70073 if (code === null) { 70074 return nok(code) 70075 } 70076 70077 // Note: blank lines canât exist in content. 70078 if (markdownLineEnding(code)) { 70079 // To do: use `space_or_tab_eol_with_options`, connect. 70080 effects.enter('lineEnding') 70081 effects.consume(code) 70082 effects.exit('lineEnding') 70083 return factorySpace(effects, atBreak, 'linePrefix') 70084 } 70085 effects.enter('chunkString', { 70086 contentType: 'string' 70087 }) 70088 return inside(code) 70089 } 70090 70091 /** 70092 * 70093 * 70094 * @type {State} 70095 */ 70096 function inside(code) { 70097 if (code === marker || code === null || markdownLineEnding(code)) { 70098 effects.exit('chunkString') 70099 return atBreak(code) 70100 } 70101 effects.consume(code) 70102 return code === 92 ? escape : inside 70103 } 70104 70105 /** 70106 * After `\`, at a special character. 70107 * 70108 * ```markdown 70109 * > | "a\*b" 70110 * ^ 70111 * ``` 70112 * 70113 * @type {State} 70114 */ 70115 function escape(code) { 70116 if (code === marker || code === 92) {
70117 effects.consume(code) 70118 return inside 70119 } 70120 return inside(code) 70121 } 70122} 70123 70124;// ./node_modules/micromark-factory-whitespace/index.js 70125/** 70126 * @typedef {import('micromark-util-types').Effects} Effects 70127 * @typedef {import('micromark-util-types').State} State 70128 */ 70129 70130 70131 70132/** 70133 * Parse spaces and tabs. 70134 * 70135 * There is no `nok` parameter: 70136 * 70137 * * line endings or spaces in markdown are often optional, in which case this 70138 * factory can be used and `ok` will be switched to whether spaces were found 70139 * or not 70140 * * one line ending or space can be detected with 70141 * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace` 70142 * 70143 * @param {Effects} effects 70144 * Context. 70145 * @param {State} ok 70146 * State switched to when successful. 70147 * @returns 70148 * Start state. 70149 */ 70150function factoryWhitespace(effects, ok) { 70151 /** @type {boolean} */ 70152 let seen 70153 return start 70154 70155 /** @type {State} */ 70156 function start(code) { 70157 if (markdownLineEnding(code)) { 70158 effects.enter('lineEnding') 70159 effects.consume(code) 70160 effects.exit('lineEnding') 70161 seen = true 70162 return start 70163 } 70164 if (markdownSpace(code)) { 70165 return factorySpace( 70166 effects, 70167 start, 70168 seen ? 'linePrefix' : 'lineSuffix' 70169 )(code) 70170 } 70171 return ok(code) 70172 } 70173} 70174 70175;// ./node_modules/micromark-util-normalize-identifier/index.js 70176/** 70177 * Normalize an identifier (as found in references, definitions). 70178 * 70179 * Collapses markdown whitespace, trim, and then lower- and uppercase. 70180 * 70181 * Some characters are considered âuppercaseâ, such as U+03F4 (`Ï´`), but if their 70182 * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different 70183 * uppercase character (U+0398 (`Î`)). 70184 * So, to get a canonical form, we perform both lower- and uppercase. 70185 * 70186 * Using uppercase last makes sure keys will never interact with default 70187 * prototypal values (such as `constructor`): nothing in the prototype of 70188 * `Object` is uppercase. 70189 * 70190 * @param {string} value 70191 * Identifier to normalize. 70192 * @returns {string} 70193 * Normalized identifier. 70194 */ 70195function normalizeIdentifier(value) { 70196 return ( 70197 value 70198 // Collapse markdown whitespace. 70199 .replace(/[\t\n\r ]+/g, ' ') 70200 // Trim. 70201 .replace(/^ | $/g, '') 70202 // Some characters are considered âuppercaseâ, but if their lowercase 70203 // counterpart is uppercased will result in a different uppercase 70204 // character. 70205 // Hence, to get that form, we perform both lower- and uppercase. 70206 // Upper case makes sure keys will not interact with default prototypal 70207 // methods: no method is uppercase. 70208 .toLowerCase() 70209 .toUpperCase() 70210 ) 70211} 70212 70213;// ./node_modules/micromark-core-commonmark/lib/definition.js 70214/** 70215 * @typedef {import('micromark-util-types').Construct} Construct 70216 * @typedef {import('micromark-util-types').State} State 70217 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 70218 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 70219 */ 70220 70221 70222 70223 70224 70225 70226 70227 70228/** @type {Construct} */ 70229const definition = { 70230 name: 'definition', 70231 tokenize: tokenizeDefinition 70232} 70233 70234/** @type {Construct} */ 70235const titleBefore = { 70236 tokenize: tokenizeTitleBefore, 70237 partial: true 70238} 70239 70240/** 70241 * @this {TokenizeContext} 70242 * @type {Tokenizer} 70243 */ 70244function tokenizeDefinition(effects, ok, nok) { 70245 const self = this 70246 /** @type {string} */ 70247 let identifier 70248 return start 70249 70250 /** 70251 * At start of a definition. 70252 * 70253 * ```markdown 70254 * > | [a]: b "c" 70255 * ^ 70256 * ``` 70257 * 70258 * @type {State} 70259 */ 70260 function start(code) { 70261 // Do not interrupt paragraphs (but do follow definitions). 70262 // To do: do `interrupt` the way `markdown-rs` does. 70263 // To do: parse whitespace the way `markdown-rs` does. 70264 effects.enter('definition') 70265 return before(code) 70266 } 70267 70268 /** 70269 * After optional whitespace, at `[`. 70270 * 70271 * ```markdown 70272 * > | [a]: b "c" 70273 * ^ 70274 * ``` 70275 * 70276 * @type {State} 70277 */ 70278 function before(code) { 70279 // To do: parse whitespace the way `markdown-rs` does. 70280 70281 return factoryLabel.call( 70282 self, 70283 effects, 70284 labelAfter, 70285 // Note: we donât need to reset the way `markdown-rs` does. 70286 nok, 70287 'definitionLabel', 70288 'definitionLabelMarker', 70289 'definitionLabelString' 70290 )(code) 70291 } 70292 70293 /** 70294 * After label. 70295 * 70296 * ```markdown 70297 * > | [a]: b "c" 70298 * ^ 70299 * ``` 70300 * 70301 * @type {State} 70302 */ 70303 function labelAfter(code) { 70304 identifier = normalizeIdentifier( 70305 self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) 70306 ) 70307 if (code === 58) { 70308 effects.enter('definitionMarker')
70309 effects.consume(code) 70310 effects.exit('definitionMarker') 70311 return markerAfter 70312 } 70313 return nok(code) 70314 } 70315 70316 /** 70317 * After marker. 70318 * 70319 * ```markdown 70320 * > | [a]: b "c" 70321 * ^ 70322 * ``` 70323 * 70324 * @type {State} 70325 */ 70326 function markerAfter(code) { 70327 // Note: whitespace is optional. 70328 return markdownLineEndingOrSpace(code) 70329 ? factoryWhitespace(effects, destinationBefore)(code) 70330 : destinationBefore(code) 70331 } 70332 70333 /** 70334 * Before destination. 70335 * 70336 * ```markdown 70337 * > | [a]: b "c" 70338 * ^ 70339 * ``` 70340 * 70341 * @type {State} 70342 */ 70343 function destinationBefore(code) { 70344 return factoryDestination( 70345 effects, 70346 destinationAfter, 70347 // Note: we donât need to reset the way `markdown-rs` does. 70348 nok, 70349 'definitionDestination', 70350 'definitionDestinationLiteral', 70351 'definitionDestinationLiteralMarker', 70352 'definitionDestinationRaw', 70353 'definitionDestinationString' 70354 )(code) 70355 } 70356 70357 /** 70358 * After destination. 70359 * 70360 * ```markdown 70361 * > | [a]: b "c" 70362 * ^ 70363 * ``` 70364 * 70365 * @type {State} 70366 */ 70367 function destinationAfter(code) { 70368 return effects.attempt(titleBefore, after, after)(code) 70369 } 70370 70371 /** 70372 * After definition. 70373 * 70374 * ```markdown 70375 * > | [a]: b 70376 * ^ 70377 * > | [a]: b "c" 70378 * ^ 70379 * ``` 70380 * 70381 * @type {State} 70382 */ 70383 function after(code) { 70384 return markdownSpace(code) 70385 ? factorySpace(effects, afterWhitespace, 'whitespace')(code) 70386 : afterWhitespace(code) 70387 } 70388 70389 /** 70390 * After definition, after optional whitespace. 70391 * 70392 * ```markdown 70393 * > | [a]: b 70394 * ^ 70395 * > | [a]: b "c" 70396 * ^ 70397 * ``` 70398 * 70399 * @type {State} 70400 */ 70401 function afterWhitespace(code) { 70402 if (code === null || markdownLineEnding(code)) { 70403 effects.exit('definition') 70404 70405 // Note: we donât care about uniqueness. 70406 // Itâs likely that that doesnât happen very frequently. 70407 // It is more likely that it wastes precious time. 70408 self.parser.defined.push(identifier) 70409 70410 // To do: `markdown-rs` interrupt. 70411 // // Youâd be interrupting. 70412 // tokenizer.interrupt = true 70413 return ok(code) 70414 } 70415 return nok(code) 70416 } 70417} 70418 70419/** 70420 * @this {TokenizeContext} 70421 * @type {Tokenizer} 70422 */ 70423function tokenizeTitleBefore(effects, ok, nok) { 70424 return titleBefore 70425 70426 /** 70427 * After destination, at whitespace. 70428 * 70429 * ```markdown 70430 * > | [a]: b 70431 * ^ 70432 * > | [a]: b "c" 70433 * ^ 70434 * ``` 70435 * 70436 * @type {State} 70437 */ 70438 function titleBefore(code) { 70439 return markdownLineEndingOrSpace(code) 70440 ? factoryWhitespace(effects, beforeMarker)(code) 70441 : nok(code) 70442 } 70443 70444 /** 70445 * At title. 70446 * 70447 * ```markdown 70448 * | [a]: b 70449 * > | "c" 70450 * ^ 70451 * ``` 70452 * 70453 * @type {State} 70454 */ 70455 function beforeMarker(code) { 70456 return factoryTitle( 70457 effects, 70458 titleAfter, 70459 nok, 70460 'definitionTitle', 70461 'definitionTitleMarker', 70462 'definitionTitleString' 70463 )(code) 70464 } 70465 70466 /** 70467 * After title. 70468 * 70469 * ```markdown 70470 * > | [a]: b "c" 70471 * ^ 70472 * ``` 70473 * 70474 * @type {State} 70475 */ 70476 function titleAfter(code) { 70477 return markdownSpace(code) 70478 ? factorySpace(effects, titleAfterOptionalWhitespace, 'whitespace')(code) 70479 : titleAfterOptionalWhitespace(code) 70480 } 70481 70482 /** 70483 * After title, after optional whitespace. 70484 * 70485 * ```markdown 70486 * > | [a]: b "c" 70487 * ^ 70488 * ``` 70489 * 70490 * @type {State} 70491 */ 70492 function titleAfterOptionalWhitespace(code) { 70493 return code === null || markdownLineEnding(code) ? ok(code) : nok(code) 70494 } 70495} 70496 70497;// ./node_modules/micromark-core-commonmark/lib/code-indented.js 70498/** 70499 * @typedef {import('micromark-util-types').Construct} Construct 70500 * @typedef {import('micromark-util-types').State} State 70501 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 70502 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 70503 */ 70504 70505 70506 70507/** @type {Construct} */ 70508const codeIndented = { 70509 name: 'codeIndented', 70510 tokenize: tokenizeCodeIndented 70511} 70512 70513/** @type {Construct} */ 70514const furtherStart = { 70515 tokenize: tokenizeFurtherStart, 70516 partial: true 70517} 70518
70519/** 70520 * @this {TokenizeContext} 70521 * @type {Tokenizer} 70522 */ 70523function tokenizeCodeIndented(effects, ok, nok) { 70524 const self = this 70525 return start 70526 70527 /** 70528 * Start of code (indented). 70529 * 70530 * > **Parsing note**: it is not needed to check if this first line is a 70531 * > filled line (that it has a non-whitespace character), because blank lines 70532 * > are parsed already, so we never run into that. 70533 * 70534 * ```markdown 70535 * > | aaa 70536 * ^ 70537 * ``` 70538 * 70539 * @type {State} 70540 */ 70541 function start(code) { 70542 // To do: manually check if interrupting like `markdown-rs`. 70543 70544 effects.enter('codeIndented') 70545 // To do: use an improved `space_or_tab` function like `markdown-rs`, 70546 // so that we can drop the next state. 70547 return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1)(code) 70548 } 70549 70550 /** 70551 * At start, after 1 or 4 spaces. 70552 * 70553 * ```markdown 70554 * > | aaa 70555 * ^ 70556 * ``` 70557 * 70558 * @type {State} 70559 */ 70560 function afterPrefix(code) { 70561 const tail = self.events[self.events.length - 1] 70562 return tail && 70563 tail[1].type === 'linePrefix' && 70564 tail[2].sliceSerialize(tail[1], true).length >= 4 70565 ? atBreak(code) 70566 : nok(code) 70567 } 70568 70569 /** 70570 * At a break. 70571 * 70572 * ```markdown 70573 * > | aaa 70574 * ^ ^ 70575 * ``` 70576 * 70577 * @type {State} 70578 */ 70579 function atBreak(code) { 70580 if (code === null) { 70581 return after(code) 70582 } 70583 if (markdownLineEnding(code)) { 70584 return effects.attempt(furtherStart, atBreak, after)(code) 70585 } 70586 effects.enter('codeFlowValue') 70587 return inside(code) 70588 } 70589 70590 /** 70591 * In code content. 70592 * 70593 * ```markdown 70594 * > | aaa 70595 * ^^^^ 70596 * ``` 70597 * 70598 * @type {State} 70599 */ 70600 function inside(code) { 70601 if (code === null || markdownLineEnding(code)) { 70602 effects.exit('codeFlowValue') 70603 return atBreak(code) 70604 } 70605 effects.consume(code) 70606 return inside 70607 } 70608 70609 /** @type {State} */ 70610 function after(code) { 70611 effects.exit('codeIndented') 70612 // To do: allow interrupting like `markdown-rs`. 70613 // Feel free to interrupt. 70614 // tokenizer.interrupt = false 70615 return ok(code) 70616 } 70617} 70618 70619/** 70620 * @this {TokenizeContext} 70621 * @type {Tokenizer} 70622 */ 70623function tokenizeFurtherStart(effects, ok, nok) { 70624 const self = this 70625 return furtherStart 70626 70627 /** 70628 * At eol, trying to parse another indent. 70629 * 70630 * ```markdown 70631 * > | aaa 70632 * ^ 70633 * | bbb 70634 * ``` 70635 * 70636 * @type {State} 70637 */ 70638 function furtherStart(code) { 70639 // To do: improve `lazy` / `pierce` handling. 70640 // If this is a lazy line, it canât be code. 70641 if (self.parser.lazy[self.now().line]) { 70642 return nok(code) 70643 } 70644 if (markdownLineEnding(code)) { 70645 effects.enter('lineEnding') 70646 effects.consume(code) 70647 effects.exit('lineEnding') 70648 return furtherStart 70649 } 70650 70651 // To do: the code here in `micromark-js` is a bit different from 70652 // `markdown-rs` because there it can attempt spaces. 70653 // We canât yet. 70654 // 70655 // To do: use an improved `space_or_tab` function like `markdown-rs`, 70656 // so that we can drop the next state. 70657 return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1)(code) 70658 } 70659 70660 /** 70661 * At start, after 1 or 4 spaces. 70662 * 70663 * ```markdown 70664 * > | aaa 70665 * ^ 70666 * ``` 70667 * 70668 * @type {State} 70669 */ 70670 function afterPrefix(code) { 70671 const tail = self.events[self.events.length - 1] 70672 return tail && 70673 tail[1].type === 'linePrefix' && 70674 tail[2].sliceSerialize(tail[1], true).length >= 4 70675 ? ok(code) 70676 : markdownLineEnding(code) 70677 ? furtherStart(code) 70678 : nok(code) 70679 } 70680} 70681 70682;// ./node_modules/micromark-core-commonmark/lib/heading-atx.js 70683/** 70684 * @typedef {import('micromark-util-types').Construct} Construct 70685 * @typedef {import('micromark-util-types').Resolver} Resolver 70686 * @typedef {import('micromark-util-types').State} State 70687 * @typedef {import('micromark-util-types').Token} Token 70688 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 70689 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 70690 */ 70691 70692 70693 70694 70695/** @type {Construct} */ 70696const headingAtx = { 70697 name: 'headingAtx', 70698 tokenize: tokenizeHeadingAtx, 70699 resolve: resolveHeadingAtx 70700} 70701 70702/** @type {Resolver} */ 70703function resolveHeadingAtx(events, context) { 70704 let contentEnd = events.length - 2 70705 let contentStart = 3 70706 /** @type {Token} */ 70707 let content 70708 /** @type {Token} */ 70709 let text 70710 70711 // Prefix whitespace, part of the opening. 70712 if (events[contentStart][1].type === 'whitespace') { 70713 contentStart += 2 70714 } 70715 70716 // Suffix whitespace, part of the closing. 70717 if ( 70718 contentEnd - 2 > contentStart && 70719 events[contentEnd][1].type === 'whitespace' 70720 ) { 70721 contentEnd -= 2 70722 } 70723 if ( 70724 events[contentEnd][1].type === 'atxHeadingSequence' && 70725 (contentStart === contentEnd - 1 || 70726 (contentEnd - 4 > contentStart && 70727 events[contentEnd - 2][1].type === 'whitespace')) 70728 ) { 70729 contentEnd -= contentStart + 1 === contentEnd ? 2 : 4 70730 } 70731 if (contentEnd > contentStart) { 70732 content = { 70733 type: 'atxHeadingText', 70734 start: events[contentStart][1].start, 70735 end: events[contentEnd][1].end 70736 } 70737 text = { 70738 type: 'chunkText', 70739 start: events[contentStart][1].start, 70740 end: events[contentEnd][1].end, 70741 contentType: 'text' 70742 } 70743 splice(events, contentStart, contentEnd - contentStart + 1, [ 70744 ['enter', content, context], 70745 ['enter', text, context], 70746 ['exit', text, context], 70747 ['exit', content, context] 70748 ]) 70749 } 70750 return events 70751} 70752 70753/** 70754 * @this {TokenizeContext} 70755 * @type {Tokenizer} 70756 */ 70757function tokenizeHeadingAtx(effects, ok, nok) { 70758 let size = 0 70759 return start 70760 70761 /** 70762 * Start of a heading (atx). 70763 * 70764 * ```markdown 70765 * > | ## aa 70766 * ^ 70767 * ``` 70768 * 70769 * @type {State} 70770 */ 70771 function start(code) { 70772 // To do: parse indent like `markdown-rs`. 70773 effects.enter('atxHeading') 70774 return before(code) 70775 } 70776 70777 /** 70778 * After optional whitespace, at `#`. 70779 * 70780 * ```markdown 70781 * > | ## aa 70782 * ^ 70783 * ``` 70784 * 70785 * @type {State} 70786 */ 70787 function before(code) { 70788 effects.enter('atxHeadingSequence') 70789 return sequenceOpen(code) 70790 } 70791 70792 /** 70793 * In opening sequence. 70794 * 70795 * ```markdown 70796 * > | ## aa 70797 * ^ 70798 * ``` 70799 * 70800 * @type {State} 70801 */ 70802 function sequenceOpen(code) { 70803 if (code === 35 && size++ < 6) {
70804 effects.consume(code) 70805 return sequenceOpen 70806 } 70807 70808 // Always at least one `#`. 70809 if (code === null || markdownLineEndingOrSpace(code)) { 70810 effects.exit('atxHeadingSequence') 70811 return atBreak(code) 70812 } 70813 return nok(code) 70814 } 70815 70816 /** 70817 * After something, before something else. 70818 * 70819 * ```markdown 70820 * > | ## aa 70821 * ^ 70822 * ``` 70823 * 70824 * @type {State} 70825 */ 70826 function atBreak(code) { 70827 if (code === 35) { 70828 effects.enter('atxHeadingSequence') 70829 return sequenceFurther(code) 70830 } 70831 if (code === null || markdownLineEnding(code)) { 70832 effects.exit('atxHeading') 70833 // To do: interrupt like `markdown-rs`. 70834 // // Feel free to interrupt. 70835 // tokenizer.interrupt = false 70836 return ok(code) 70837 } 70838 if (markdownSpace(code)) { 70839 return factorySpace(effects, atBreak, 'whitespace')(code) 70840 } 70841 70842 // To do: generate `data` tokens, add the `text` token later. 70843 // Needs edit map, see: `markdown.rs`. 70844 effects.enter('atxHeadingText') 70845 return data(code) 70846 } 70847 70848 /** 70849 * In further sequence (after whitespace). 70850 * 70851 * Could be normal âvisibleâ hashes in the heading or a final sequence. 70852 * 70853 * ```markdown 70854 * > | ## aa ## 70855 * ^ 70856 * ``` 70857 * 70858 * @type {State} 70859 */ 70860 function sequenceFurther(code) { 70861 if (code === 35) { 70862 effects.consume(code) 70863 return sequenceFurther 70864 } 70865 effects.exit('atxHeadingSequence') 70866 return atBreak(code) 70867 } 70868 70869 /** 70870 * In text. 70871 * 70872 * ```markdown 70873 * > | ## aa 70874 * ^ 70875 * ``` 70876 * 70877 * @type {State} 70878 */ 70879 function data(code) { 70880 if (code === null || code === 35 || markdownLineEndingOrSpace(code)) { 70881 effects.exit('atxHeadingText') 70882 return atBreak(code) 70883 } 70884 effects.consume(code) 70885 return data 70886 } 70887} 70888 70889;// ./node_modules/micromark-core-commonmark/lib/setext-underline.js 70890/** 70891 * @typedef {import('micromark-util-types').Code} Code 70892 * @typedef {import('micromark-util-types').Construct} Construct 70893 * @typedef {import('micromark-util-types').Resolver} Resolver 70894 * @typedef {import('micromark-util-types').State} State 70895 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 70896 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 70897 */ 70898 70899 70900 70901/** @type {Construct} */ 70902const setextUnderline = { 70903 name: 'setextUnderline', 70904 tokenize: tokenizeSetextUnderline, 70905 resolveTo: resolveToSetextUnderline 70906} 70907 70908/** @type {Resolver} */ 70909function resolveToSetextUnderline(events, context) { 70910 // To do: resolve like `markdown-rs`. 70911 let index = events.length 70912 /** @type {number | undefined} */ 70913 let content 70914 /** @type {number | undefined} */ 70915 let text 70916 /** @type {number | undefined} */ 70917 let definition 70918 70919 // Find the opening of the content. 70920 // Itâll always exist: we donât tokenize if it isnât there. 70921 while (index--) { 70922 if (events[index][0] === 'enter') { 70923 if (events[index][1].type === 'content') { 70924 content = index 70925 break 70926 } 70927 if (events[index][1].type === 'paragraph') { 70928 text = index 70929 } 70930 } 70931 // Exit 70932 else { 70933 if (events[index][1].type === 'content') { 70934 // Remove the content end (if needed weâll add it later) 70935 events.splice(index, 1) 70936 } 70937 if (!definition && events[index][1].type === 'definition') { 70938 definition = index 70939 } 70940 } 70941 } 70942 const heading = { 70943 type: 'setextHeading', 70944 start: Object.assign({}, events[text][1].start), 70945 end: Object.assign({}, events[events.length - 1][1].end) 70946 } 70947 70948 // Change the paragraph to setext heading text. 70949 events[text][1].type = 'setextHeadingText' 70950 70951 // If we have definitions in the content, weâll keep on having content, 70952 // but we need move it. 70953 if (definition) { 70954 events.splice(text, 0, ['enter', heading, context]) 70955 events.splice(definition + 1, 0, ['exit', events[content][1], context]) 70956 events[content][1].end = Object.assign({}, events[definition][1].end) 70957 } else { 70958 events[content][1] = heading 70959 } 70960 70961 // Add the heading exit at the end. 70962 events.push(['exit', heading, context]) 70963 return events 70964} 70965 70966/** 70967 * @this {TokenizeContext} 70968 * @type {Tokenizer} 70969 */ 70970function tokenizeSetextUnderline(effects, ok, nok) { 70971 const self = this 70972 /** @type {NonNullable<Code>} */ 70973 let marker 70974 return start 70975 70976 /** 70977 * At start of heading (setext) underline. 70978 * 70979 * ```markdown 70980 * | aa 70981 * > | == 70982 * ^ 70983 * ``` 70984 * 70985 * @type {State} 70986 */ 70987 function start(code) { 70988 let index = self.events.length 70989 /** @type {boolean | undefined} */ 70990 let paragraph 70991 // Find an opening. 70992 while (index--) { 70993 // Skip enter/exit of line ending, line prefix, and content. 70994 // We can now either have a definition or a paragraph. 70995 if ( 70996 self.events[index][1].type !== 'lineEnding' && 70997 self.events[index][1].type !== 'linePrefix' && 70998 self.events[index][1].type !== 'content' 70999 ) { 71000 paragraph = self.events[index][1].type === 'paragraph' 71001 break 71002 } 71003 } 71004 71005 // To do: handle lazy/pierce like `markdown-rs`. 71006 // To do: parse indent like `markdown-rs`. 71007 if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) { 71008 effects.enter('setextHeadingLine') 71009 marker = code 71010 return before(code) 71011 } 71012 return nok(code) 71013 } 71014 71015 /** 71016 * After optional whitespace, at `-` or `=`. 71017 * 71018 * ```markdown 71019 * | aa 71020 * > | == 71021 * ^ 71022 * ``` 71023 * 71024 * @type {State} 71025 */ 71026 function before(code) { 71027 effects.enter('setextHeadingLineSequence') 71028 return inside(code) 71029 } 71030 71031 /** 71032 * In sequence. 71033 * 71034 * ```markdown 71035 * | aa 71036 * > | == 71037 * ^ 71038 * ``` 71039 * 71040 * @type {State} 71041 */ 71042 function inside(code) { 71043 if (code === marker) {
71044 effects.consume(code) 71045 return inside 71046 } 71047 effects.exit('setextHeadingLineSequence') 71048 return markdownSpace(code) 71049 ? factorySpace(effects, after, 'lineSuffix')(code) 71050 : after(code) 71051 } 71052 71053 /** 71054 * After sequence, after optional whitespace. 71055 * 71056 * ```markdown 71057 * | aa 71058 * > | == 71059 * ^ 71060 * ``` 71061 * 71062 * @type {State} 71063 */ 71064 function after(code) { 71065 if (code === null || markdownLineEnding(code)) { 71066 effects.exit('setextHeadingLine') 71067 return ok(code) 71068 } 71069 return nok(code) 71070 } 71071} 71072 71073;// ./node_modules/micromark-util-html-tag-name/index.js 71074/** 71075 * List of lowercase HTML âblockâ tag names. 71076 * 71077 * The list, when parsing HTML (flow), results in more relaxed rules (condition 71078 * 6). 71079 * Because they are known blocks, the HTML-like syntax doesnât have to be 71080 * strictly parsed. 71081 * For tag names not in this list, a more strict algorithm (condition 7) is used 71082 * to detect whether the HTML-like syntax is seen as HTML (flow) or not. 71083 * 71084 * This is copied from: 71085 * <https://spec.commonmark.org/0.30/#html-blocks>. 71086 * 71087 * > ð **Note**: `search` was added in `[email protected]`. 71088 */ 71089const htmlBlockNames = [ 71090 'address', 71091 'article', 71092 'aside', 71093 'base', 71094 'basefont', 71095 'blockquote', 71096 'body', 71097 'caption', 71098 'center', 71099 'col', 71100 'colgroup', 71101 'dd', 71102 'details', 71103 'dialog', 71104 'dir', 71105 'div', 71106 'dl', 71107 'dt', 71108 'fieldset', 71109 'figcaption', 71110 'figure', 71111 'footer', 71112 'form', 71113 'frame', 71114 'frameset', 71115 'h1', 71116 'h2', 71117 'h3', 71118 'h4', 71119 'h5', 71120 'h6', 71121 'head', 71122 'header', 71123 'hr', 71124 'html', 71125 'iframe', 71126 'legend', 71127 'li', 71128 'link', 71129 'main', 71130 'menu', 71131 'menuitem', 71132 'nav', 71133 'noframes', 71134 'ol', 71135 'optgroup', 71136 'option', 71137 'p', 71138 'param', 71139 'search', 71140 'section', 71141 'summary', 71142 'table', 71143 'tbody', 71144 'td', 71145 'tfoot', 71146 'th', 71147 'thead', 71148 'title', 71149 'tr', 71150 'track', 71151 'ul' 71152] 71153 71154/** 71155 * List of lowercase HTML ârawâ tag names. 71156 * 71157 * The list, when parsing HTML (flow), results in HTML that can include lines 71158 * without exiting, until a closing tag also in this list is found (condition 71159 * 1). 71160 * 71161 * This module is copied from: 71162 * <https://spec.commonmark.org/0.30/#html-blocks>. 71163 * 71164 * > ð **Note**: `textarea` was added in `[email protected]`. 71165 */ 71166const htmlRawNames = ['pre', 'script', 'style', 'textarea'] 71167 71168;// ./node_modules/micromark-core-commonmark/lib/html-flow.js 71169/** 71170 * @typedef {import('micromark-util-types').Code} Code 71171 * @typedef {import('micromark-util-types').Construct} Construct 71172 * @typedef {import('micromark-util-types').Resolver} Resolver 71173 * @typedef {import('micromark-util-types').State} State 71174 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 71175 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 71176 */ 71177 71178 71179 71180 71181 71182/** @type {Construct} */ 71183const htmlFlow = { 71184 name: 'htmlFlow', 71185 tokenize: tokenizeHtmlFlow, 71186 resolveTo: resolveToHtmlFlow, 71187 concrete: true 71188} 71189 71190/** @type {Construct} */ 71191const blankLineBefore = { 71192 tokenize: tokenizeBlankLineBefore, 71193 partial: true 71194} 71195const nonLazyContinuationStart = { 71196 tokenize: tokenizeNonLazyContinuationStart, 71197 partial: true 71198} 71199 71200/** @type {Resolver} */ 71201function resolveToHtmlFlow(events) { 71202 let index = events.length 71203 while (index--) { 71204 if (events[index][0] === 'enter' && events[index][1].type === 'htmlFlow') { 71205 break 71206 } 71207 } 71208 if (index > 1 && events[index - 2][1].type === 'linePrefix') { 71209 // Add the prefix start to the HTML token. 71210 events[index][1].start = events[index - 2][1].start 71211 // Add the prefix start to the HTML line token. 71212 events[index + 1][1].start = events[index - 2][1].start 71213 // Remove the line prefix. 71214 events.splice(index - 2, 2) 71215 } 71216 return events 71217} 71218 71219/** 71220 * @this {TokenizeContext} 71221 * @type {Tokenizer} 71222 */ 71223function tokenizeHtmlFlow(effects, ok, nok) { 71224 const self = this 71225 /** @type {number} */ 71226 let marker 71227 /** @type {boolean} */ 71228 let closingTag 71229 /** @type {string} */ 71230 let buffer 71231 /** @type {number} */ 71232 let index 71233 /** @type {Code} */ 71234 let markerB 71235 return start 71236 71237 /** 71238 * Start of HTML (flow). 71239 * 71240 * ```markdown 71241 * > | <x /> 71242 * ^ 71243 * ``` 71244 * 71245 * @type {State} 71246 */ 71247 function start(code) { 71248 // To do: parse indent like `markdown-rs`. 71249 return before(code) 71250 } 71251 71252 /** 71253 * At `<`, after optional whitespace. 71254 * 71255 * ```markdown 71256 * > | <x /> 71257 * ^ 71258 * ``` 71259 * 71260 * @type {State} 71261 */ 71262 function before(code) { 71263 effects.enter('htmlFlow') 71264 effects.enter('htmlFlowData')
71265 effects.consume(code) 71266 return open 71267 } 71268 71269 /** 71270 * After `<`, at tag name or other stuff. 71271 * 71272 * ```markdown 71273 * > | <x /> 71274 * ^ 71275 * > | <!doctype> 71276 * ^ 71277 * > | <!--xxx--> 71278 * ^ 71279 * ``` 71280 * 71281 * @type {State} 71282 */ 71283 function open(code) { 71284 if (code === 33) { 71285 effects.consume(code) 71286 return declarationOpen 71287 } 71288 if (code === 47) { 71289 effects.consume(code) 71290 closingTag = true 71291 return tagCloseStart 71292 } 71293 if (code === 63) { 71294 effects.consume(code) 71295 marker = 3 71296 // To do: 71297 // tokenizer.concrete = true 71298 // To do: use `markdown-rs` style interrupt. 71299 // While weâre in an instruction instead of a declaration, weâre on a `?` 71300 // right now, so we do need to search for `>`, similar to declarations. 71301 return self.interrupt ? ok : continuationDeclarationInside 71302 } 71303 71304 // ASCII alphabetical. 71305 if (asciiAlpha(code)) { 71306 effects.consume(code) 71307 // @ts-expect-error: not null. 71308 buffer = String.fromCharCode(code) 71309 return tagName 71310 } 71311 return nok(code) 71312 } 71313 71314 /** 71315 * After `<!`, at declaration, comment, or CDATA. 71316 * 71317 * ```markdown 71318 * > | <!doctype> 71319 * ^ 71320 * > | <!--xxx--> 71321 * ^ 71322 * > | <![CDATA[>&<]]> 71323 * ^ 71324 * ``` 71325 * 71326 * @type {State} 71327 */ 71328 function declarationOpen(code) { 71329 if (code === 45) { 71330 effects.consume(code) 71331 marker = 2 71332 return commentOpenInside 71333 } 71334 if (code === 91) { 71335 effects.consume(code) 71336 marker = 5 71337 index = 0 71338 return cdataOpenInside 71339 } 71340 71341 // ASCII alphabetical. 71342 if (asciiAlpha(code)) { 71343 effects.consume(code) 71344 marker = 4 71345 // // Do not form containers. 71346 // tokenizer.concrete = true 71347 return self.interrupt ? ok : continuationDeclarationInside 71348 } 71349 return nok(code) 71350 } 71351 71352 /** 71353 * After `<!-`, inside a comment, at another `-`. 71354 * 71355 * ```markdown 71356 * > | <!--xxx--> 71357 * ^ 71358 * ``` 71359 * 71360 * @type {State} 71361 */ 71362 function commentOpenInside(code) { 71363 if (code === 45) { 71364 effects.consume(code) 71365 // // Do not form containers. 71366 // tokenizer.concrete = true 71367 return self.interrupt ? ok : continuationDeclarationInside 71368 } 71369 return nok(code) 71370 } 71371 71372 /** 71373 * After `<![`, inside CDATA, expecting `CDATA[`. 71374 * 71375 * ```markdown 71376 * > | <![CDATA[>&<]]> 71377 * ^^^^^^ 71378 * ``` 71379 * 71380 * @type {State} 71381 */ 71382 function cdataOpenInside(code) { 71383 const value = 'CDATA[' 71384 if (code === value.charCodeAt(index++)) { 71385 effects.consume(code) 71386 if (index === value.length) { 71387 // // Do not form containers. 71388 // tokenizer.concrete = true 71389 return self.interrupt ? ok : continuation 71390 } 71391 return cdataOpenInside 71392 } 71393 return nok(code) 71394 } 71395 71396 /** 71397 * After `</`, in closing tag, at tag name. 71398 * 71399 * ```markdown 71400 * > | </x> 71401 * ^ 71402 * ``` 71403 * 71404 * @type {State} 71405 */ 71406 function tagCloseStart(code) { 71407 if (asciiAlpha(code)) { 71408 effects.consume(code) 71409 // @ts-expect-error: not null. 71410 buffer = String.fromCharCode(code) 71411 return tagName 71412 } 71413 return nok(code) 71414 } 71415 71416 /** 71417 * In tag name. 71418 * 71419 * ```markdown 71420 * > | <ab> 71421 * ^^ 71422 * > | </ab> 71423 * ^^ 71424 * ``` 71425 * 71426 * @type {State} 71427 */ 71428 function tagName(code) { 71429 if ( 71430 code === null || 71431 code === 47 || 71432 code === 62 || 71433 markdownLineEndingOrSpace(code) 71434 ) { 71435 const slash = code === 47 71436 const name = buffer.toLowerCase() 71437 if (!slash && !closingTag && htmlRawNames.includes(name)) { 71438 marker = 1 71439 // // Do not form containers. 71440 // tokenizer.concrete = true 71441 return self.interrupt ? ok(code) : continuation(code) 71442 } 71443 if (htmlBlockNames.includes(buffer.toLowerCase())) { 71444 marker = 6 71445 if (slash) { 71446 effects.consume(code) 71447 return basicSelfClosing 71448 } 71449 71450 // // Do not form containers. 71451 // tokenizer.concrete = true 71452 return self.interrupt ? ok(code) : continuation(code) 71453 } 71454 marker = 7 71455 // Do not support complete HTML when interrupting. 71456 return self.interrupt && !self.parser.lazy[self.now().line] 71457 ? nok(code) 71458 : closingTag 71459 ? completeClosingTagAfter(code) 71460 : completeAttributeNameBefore(code) 71461 } 71462 71463 // ASCII alphanumerical and `-`. 71464 if (code === 45 || asciiAlphanumeric(code)) {
71465 effects.consume(code) 71466 buffer += String.fromCharCode(code) 71467 return tagName 71468 } 71469 return nok(code) 71470 } 71471 71472 /** 71473 * After closing slash of a basic tag name. 71474 * 71475 * ```markdown 71476 * > | <div/> 71477 * ^ 71478 * ``` 71479 * 71480 * @type {State} 71481 */ 71482 function basicSelfClosing(code) { 71483 if (code === 62) { 71484 effects.consume(code) 71485 // // Do not form containers. 71486 // tokenizer.concrete = true 71487 return self.interrupt ? ok : continuation 71488 } 71489 return nok(code) 71490 } 71491 71492 /** 71493 * After closing slash of a complete tag name. 71494 * 71495 * ```markdown 71496 * > | <x/> 71497 * ^ 71498 * ``` 71499 * 71500 * @type {State} 71501 */ 71502 function completeClosingTagAfter(code) { 71503 if (markdownSpace(code)) { 71504 effects.consume(code) 71505 return completeClosingTagAfter 71506 } 71507 return completeEnd(code) 71508 } 71509 71510 /** 71511 * At an attribute name. 71512 * 71513 * At first, this state is used after a complete tag name, after whitespace, 71514 * where it expects optional attributes or the end of the tag. 71515 * It is also reused after attributes, when expecting more optional 71516 * attributes. 71517 * 71518 * ```markdown 71519 * > | <a /> 71520 * ^ 71521 * > | <a :b> 71522 * ^ 71523 * > | <a _b> 71524 * ^ 71525 * > | <a b> 71526 * ^ 71527 * > | <a > 71528 * ^ 71529 * ``` 71530 * 71531 * @type {State} 71532 */ 71533 function completeAttributeNameBefore(code) { 71534 if (code === 47) { 71535 effects.consume(code) 71536 return completeEnd 71537 } 71538 71539 // ASCII alphanumerical and `:` and `_`. 71540 if (code === 58 || code === 95 || asciiAlpha(code)) { 71541 effects.consume(code) 71542 return completeAttributeName 71543 } 71544 if (markdownSpace(code)) { 71545 effects.consume(code) 71546 return completeAttributeNameBefore 71547 } 71548 return completeEnd(code) 71549 } 71550 71551 /** 71552 * In attribute name. 71553 * 71554 * ```markdown 71555 * > | <a :b> 71556 * ^ 71557 * > | <a _b> 71558 * ^ 71559 * > | <a b> 71560 * ^ 71561 * ``` 71562 * 71563 * @type {State} 71564 */ 71565 function completeAttributeName(code) { 71566 // ASCII alphanumerical and `-`, `.`, `:`, and `_`. 71567 if ( 71568 code === 45 || 71569 code === 46 || 71570 code === 58 || 71571 code === 95 || 71572 asciiAlphanumeric(code) 71573 ) { 71574 effects.consume(code) 71575 return completeAttributeName 71576 } 71577 return completeAttributeNameAfter(code) 71578 } 71579 71580 /** 71581 * After attribute name, at an optional initializer, the end of the tag, or 71582 * whitespace. 71583 * 71584 * ```markdown 71585 * > | <a b> 71586 * ^ 71587 * > | <a b=c> 71588 * ^ 71589 * ``` 71590 * 71591 * @type {State} 71592 */ 71593 function completeAttributeNameAfter(code) { 71594 if (code === 61) { 71595 effects.consume(code) 71596 return completeAttributeValueBefore 71597 } 71598 if (markdownSpace(code)) { 71599 effects.consume(code) 71600 return completeAttributeNameAfter 71601 } 71602 return completeAttributeNameBefore(code) 71603 } 71604 71605 /** 71606 * Before unquoted, double quoted, or single quoted attribute value, allowing 71607 * whitespace. 71608 * 71609 * ```markdown 71610 * > | <a b=c> 71611 * ^ 71612 * > | <a b="c"> 71613 * ^ 71614 * ``` 71615 * 71616 * @type {State} 71617 */ 71618 function completeAttributeValueBefore(code) { 71619 if ( 71620 code === null || 71621 code === 60 || 71622 code === 61 || 71623 code === 62 || 71624 code === 96 71625 ) { 71626 return nok(code) 71627 } 71628 if (code === 34 || code === 39) { 71629 effects.consume(code) 71630 markerB = code 71631 return completeAttributeValueQuoted 71632 } 71633 if (markdownSpace(code)) { 71634 effects.consume(code) 71635 return completeAttributeValueBefore 71636 } 71637 return completeAttributeValueUnquoted(code) 71638 } 71639 71640 /** 71641 * In double or single quoted attribute value. 71642 * 71643 * ```markdown 71644 * > | <a b="c"> 71645 * ^ 71646 * > | <a b='c'> 71647 * ^ 71648 * ``` 71649 * 71650 * @type {State} 71651 */ 71652 function completeAttributeValueQuoted(code) { 71653 if (code === markerB) { 71654 effects.consume(code) 71655 markerB = null 71656 return completeAttributeValueQuotedAfter 71657 } 71658 if (code === null || markdownLineEnding(code)) { 71659 return nok(code) 71660 } 71661 effects.consume(code) 71662 return completeAttributeValueQuoted 71663 } 71664 71665 /** 71666 * In unquoted attribute value. 71667 * 71668 * ```markdown 71669 * > | <a b=c> 71670 * ^ 71671 * ``` 71672 * 71673 * @type {State} 71674 */ 71675 function completeAttributeValueUnquoted(code) { 71676 if ( 71677 code === null || 71678 code === 34 || 71679 code === 39 || 71680 code === 47 || 71681 code === 60 || 71682 code === 61 || 71683 code === 62 || 71684 code === 96 || 71685 markdownLineEndingOrSpace(code) 71686 ) { 71687 return completeAttributeNameAfter(code) 71688 }
71689 effects.consume(code) 71690 return completeAttributeValueUnquoted 71691 } 71692 71693 /** 71694 * After double or single quoted attribute value, before whitespace or the 71695 * end of the tag. 71696 * 71697 * ```markdown 71698 * > | <a b="c"> 71699 * ^ 71700 * ``` 71701 * 71702 * @type {State} 71703 */ 71704 function completeAttributeValueQuotedAfter(code) { 71705 if (code === 47 || code === 62 || markdownSpace(code)) { 71706 return completeAttributeNameBefore(code) 71707 } 71708 return nok(code) 71709 } 71710 71711 /** 71712 * In certain circumstances of a complete tag where only an `>` is allowed. 71713 * 71714 * ```markdown 71715 * > | <a b="c"> 71716 * ^ 71717 * ``` 71718 * 71719 * @type {State} 71720 */ 71721 function completeEnd(code) { 71722 if (code === 62) { 71723 effects.consume(code) 71724 return completeAfter 71725 } 71726 return nok(code) 71727 } 71728 71729 /** 71730 * After `>` in a complete tag. 71731 * 71732 * ```markdown 71733 * > | <x> 71734 * ^ 71735 * ``` 71736 * 71737 * @type {State} 71738 */ 71739 function completeAfter(code) { 71740 if (code === null || markdownLineEnding(code)) { 71741 // // Do not form containers. 71742 // tokenizer.concrete = true 71743 return continuation(code) 71744 } 71745 if (markdownSpace(code)) { 71746 effects.consume(code) 71747 return completeAfter 71748 } 71749 return nok(code) 71750 } 71751 71752 /** 71753 * In continuation of any HTML kind. 71754 * 71755 * ```markdown 71756 * > | <!--xxx--> 71757 * ^ 71758 * ``` 71759 * 71760 * @type {State} 71761 */ 71762 function continuation(code) { 71763 if (code === 45 && marker === 2) { 71764 effects.consume(code) 71765 return continuationCommentInside 71766 } 71767 if (code === 60 && marker === 1) { 71768 effects.consume(code) 71769 return continuationRawTagOpen 71770 } 71771 if (code === 62 && marker === 4) { 71772 effects.consume(code) 71773 return continuationClose 71774 } 71775 if (code === 63 && marker === 3) { 71776 effects.consume(code) 71777 return continuationDeclarationInside 71778 } 71779 if (code === 93 && marker === 5) { 71780 effects.consume(code) 71781 return continuationCdataInside 71782 } 71783 if (markdownLineEnding(code) && (marker === 6 || marker === 7)) { 71784 effects.exit('htmlFlowData') 71785 return effects.check( 71786 blankLineBefore, 71787 continuationAfter, 71788 continuationStart 71789 )(code) 71790 } 71791 if (code === null || markdownLineEnding(code)) { 71792 effects.exit('htmlFlowData') 71793 return continuationStart(code) 71794 } 71795 effects.consume(code) 71796 return continuation 71797 } 71798 71799 /** 71800 * In continuation, at eol. 71801 * 71802 * ```markdown 71803 * > | <x> 71804 * ^ 71805 * | asd 71806 * ``` 71807 * 71808 * @type {State} 71809 */ 71810 function continuationStart(code) { 71811 return effects.check( 71812 nonLazyContinuationStart, 71813 continuationStartNonLazy, 71814 continuationAfter 71815 )(code) 71816 } 71817 71818 /** 71819 * In continuation, at eol, before non-lazy content. 71820 * 71821 * ```markdown 71822 * > | <x> 71823 * ^ 71824 * | asd 71825 * ``` 71826 * 71827 * @type {State} 71828 */ 71829 function continuationStartNonLazy(code) { 71830 effects.enter('lineEnding') 71831 effects.consume(code) 71832 effects.exit('lineEnding') 71833 return continuationBefore 71834 } 71835 71836 /** 71837 * In continuation, before non-lazy content. 71838 * 71839 * ```markdown 71840 * | <x> 71841 * > | asd 71842 * ^ 71843 * ``` 71844 * 71845 * @type {State} 71846 */ 71847 function continuationBefore(code) { 71848 if (code === null || markdownLineEnding(code)) { 71849 return continuationStart(code) 71850 } 71851 effects.enter('htmlFlowData') 71852 return continuation(code) 71853 } 71854 71855 /** 71856 * In comment continuation, after one `-`, expecting another. 71857 * 71858 * ```markdown 71859 * > | <!--xxx--> 71860 * ^ 71861 * ``` 71862 * 71863 * @type {State} 71864 */ 71865 function continuationCommentInside(code) { 71866 if (code === 45) { 71867 effects.consume(code) 71868 return continuationDeclarationInside 71869 } 71870 return continuation(code) 71871 } 71872 71873 /** 71874 * In raw continuation, after `<`, at `/`. 71875 * 71876 * ```markdown 71877 * > | <script>console.log(1)</script> 71878 * ^ 71879 * ``` 71880 * 71881 * @type {State} 71882 */ 71883 function continuationRawTagOpen(code) { 71884 if (code === 47) { 71885 effects.consume(code) 71886 buffer = '' 71887 return continuationRawEndTag 71888 } 71889 return continuation(code) 71890 } 71891 71892 /** 71893 * In raw continuation, after `</`, in a raw tag name. 71894 * 71895 * ```markdown 71896 * > | <script>console.log(1)</script> 71897 * ^^^^^^ 71898 * ``` 71899 * 71900 * @type {State} 71901 */ 71902 function continuationRawEndTag(code) { 71903 if (code === 62) { 71904 const name = buffer.toLowerCase() 71905 if (htmlRawNames.includes(name)) {
71906 effects.consume(code) 71907 return continuationClose 71908 } 71909 return continuation(code) 71910 } 71911 if (asciiAlpha(code) && buffer.length < 8) { 71912 effects.consume(code) 71913 // @ts-expect-error: not null. 71914 buffer += String.fromCharCode(code) 71915 return continuationRawEndTag 71916 } 71917 return continuation(code) 71918 } 71919 71920 /** 71921 * In cdata continuation, after `]`, expecting `]>`. 71922 * 71923 * ```markdown 71924 * > | <![CDATA[>&<]]> 71925 * ^ 71926 * ``` 71927 * 71928 * @type {State} 71929 */ 71930 function continuationCdataInside(code) { 71931 if (code === 93) { 71932 effects.consume(code) 71933 return continuationDeclarationInside 71934 } 71935 return continuation(code) 71936 } 71937 71938 /** 71939 * In declaration or instruction continuation, at `>`. 71940 * 71941 * ```markdown 71942 * > | <!--> 71943 * ^ 71944 * > | <?> 71945 * ^ 71946 * > | <!q> 71947 * ^ 71948 * > | <!--ab--> 71949 * ^ 71950 * > | <![CDATA[>&<]]> 71951 * ^ 71952 * ``` 71953 * 71954 * @type {State} 71955 */ 71956 function continuationDeclarationInside(code) { 71957 if (code === 62) { 71958 effects.consume(code) 71959 return continuationClose 71960 } 71961 71962 // More dashes. 71963 if (code === 45 && marker === 2) { 71964 effects.consume(code) 71965 return continuationDeclarationInside 71966 } 71967 return continuation(code) 71968 } 71969 71970 /** 71971 * In closed continuation: everything we get until the eol/eof is part of it. 71972 * 71973 * ```markdown 71974 * > | <!doctype> 71975 * ^ 71976 * ``` 71977 * 71978 * @type {State} 71979 */ 71980 function continuationClose(code) { 71981 if (code === null || markdownLineEnding(code)) { 71982 effects.exit('htmlFlowData') 71983 return continuationAfter(code) 71984 } 71985 effects.consume(code) 71986 return continuationClose 71987 } 71988 71989 /** 71990 * Done. 71991 * 71992 * ```markdown 71993 * > | <!doctype> 71994 * ^ 71995 * ``` 71996 * 71997 * @type {State} 71998 */ 71999 function continuationAfter(code) { 72000 effects.exit('htmlFlow') 72001 // // Feel free to interrupt. 72002 // tokenizer.interrupt = false 72003 // // No longer concrete. 72004 // tokenizer.concrete = false 72005 return ok(code) 72006 } 72007} 72008 72009/** 72010 * @this {TokenizeContext} 72011 * @type {Tokenizer} 72012 */ 72013function tokenizeNonLazyContinuationStart(effects, ok, nok) { 72014 const self = this 72015 return start 72016 72017 /** 72018 * At eol, before continuation. 72019 * 72020 * ```markdown 72021 * > | * ```js 72022 * ^ 72023 * | b 72024 * ``` 72025 * 72026 * @type {State} 72027 */ 72028 function start(code) { 72029 if (markdownLineEnding(code)) { 72030 effects.enter('lineEnding') 72031 effects.consume(code) 72032 effects.exit('lineEnding') 72033 return after 72034 } 72035 return nok(code) 72036 } 72037 72038 /** 72039 * A continuation. 72040 * 72041 * ```markdown 72042 * | * ```js 72043 * > | b 72044 * ^ 72045 * ``` 72046 * 72047 * @type {State} 72048 */ 72049 function after(code) { 72050 return self.parser.lazy[self.now().line] ? nok(code) : ok(code) 72051 } 72052} 72053 72054/** 72055 * @this {TokenizeContext} 72056 * @type {Tokenizer} 72057 */ 72058function tokenizeBlankLineBefore(effects, ok, nok) { 72059 return start 72060 72061 /** 72062 * Before eol, expecting blank line. 72063 * 72064 * ```markdown 72065 * > | <div> 72066 * ^ 72067 * | 72068 * ``` 72069 * 72070 * @type {State} 72071 */ 72072 function start(code) { 72073 effects.enter('lineEnding') 72074 effects.consume(code) 72075 effects.exit('lineEnding') 72076 return effects.attempt(blankLine, ok, nok) 72077 } 72078} 72079 72080;// ./node_modules/micromark-core-commonmark/lib/code-fenced.js 72081/** 72082 * @typedef {import('micromark-util-types').Code} Code 72083 * @typedef {import('micromark-util-types').Construct} Construct 72084 * @typedef {import('micromark-util-types').State} State 72085 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 72086 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 72087 */ 72088 72089 72090 72091/** @type {Construct} */ 72092const nonLazyContinuation = { 72093 tokenize: tokenizeNonLazyContinuation, 72094 partial: true 72095} 72096 72097/** @type {Construct} */ 72098const codeFenced = { 72099 name: 'codeFenced', 72100 tokenize: tokenizeCodeFenced, 72101 concrete: true 72102} 72103 72104/** 72105 * @this {TokenizeContext} 72106 * @type {Tokenizer} 72107 */ 72108function tokenizeCodeFenced(effects, ok, nok) { 72109 const self = this 72110 /** @type {Construct} */ 72111 const closeStart = { 72112 tokenize: tokenizeCloseStart, 72113 partial: true 72114 } 72115 let initialPrefix = 0 72116 let sizeOpen = 0 72117 /** @type {NonNullable<Code>} */ 72118 let marker 72119 return start 72120 72121 /** 72122 * Start of code. 72123 * 72124 * ```markdown 72125 * > | ~~~js 72126 * ^ 72127 * | alert(1) 72128 * | ~~~ 72129 * ``` 72130 * 72131 * @type {State} 72132 */ 72133 function start(code) { 72134 // To do: parse whitespace like `markdown-rs`. 72135 return beforeSequenceOpen(code) 72136 } 72137 72138 /** 72139 * In opening fence, after prefix, at sequence. 72140 * 72141 * ```markdown 72142 * > | ~~~js 72143 * ^ 72144 * | alert(1) 72145 * | ~~~ 72146 * ``` 72147 * 72148 * @type {State} 72149 */ 72150 function beforeSequenceOpen(code) { 72151 const tail = self.events[self.events.length - 1] 72152 initialPrefix = 72153 tail && tail[1].type === 'linePrefix' 72154 ? tail[2].sliceSerialize(tail[1], true).length 72155 : 0 72156 marker = code 72157 effects.enter('codeFenced') 72158 effects.enter('codeFencedFence') 72159 effects.enter('codeFencedFenceSequence') 72160 return sequenceOpen(code) 72161 } 72162 72163 /** 72164 * In opening fence sequence. 72165 * 72166 * ```markdown 72167 * > | ~~~js 72168 * ^ 72169 * | alert(1) 72170 * | ~~~ 72171 * ``` 72172 * 72173 * @type {State} 72174 */ 72175 function sequenceOpen(code) { 72176 if (code === marker) { 72177 sizeOpen++
72178 effects.consume(code) 72179 return sequenceOpen 72180 } 72181 if (sizeOpen < 3) { 72182 return nok(code) 72183 } 72184 effects.exit('codeFencedFenceSequence') 72185 return markdownSpace(code) 72186 ? factorySpace(effects, infoBefore, 'whitespace')(code) 72187 : infoBefore(code) 72188 } 72189 72190 /** 72191 * In opening fence, after the sequence (and optional whitespace), before info. 72192 * 72193 * ```markdown 72194 * > | ~~~js 72195 * ^ 72196 * | alert(1) 72197 * | ~~~ 72198 * ``` 72199 * 72200 * @type {State} 72201 */ 72202 function infoBefore(code) { 72203 if (code === null || markdownLineEnding(code)) { 72204 effects.exit('codeFencedFence') 72205 return self.interrupt 72206 ? ok(code) 72207 : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code) 72208 } 72209 effects.enter('codeFencedFenceInfo') 72210 effects.enter('chunkString', { 72211 contentType: 'string' 72212 }) 72213 return info(code) 72214 } 72215 72216 /** 72217 * In info. 72218 * 72219 * ```markdown 72220 * > | ~~~js 72221 * ^ 72222 * | alert(1) 72223 * | ~~~ 72224 * ``` 72225 * 72226 * @type {State} 72227 */ 72228 function info(code) { 72229 if (code === null || markdownLineEnding(code)) { 72230 effects.exit('chunkString') 72231 effects.exit('codeFencedFenceInfo') 72232 return infoBefore(code) 72233 } 72234 if (markdownSpace(code)) { 72235 effects.exit('chunkString') 72236 effects.exit('codeFencedFenceInfo') 72237 return factorySpace(effects, metaBefore, 'whitespace')(code) 72238 } 72239 if (code === 96 && code === marker) { 72240 return nok(code) 72241 } 72242 effects.consume(code) 72243 return info 72244 } 72245 72246 /** 72247 * In opening fence, after info and whitespace, before meta. 72248 * 72249 * ```markdown 72250 * > | ~~~js eval 72251 * ^ 72252 * | alert(1) 72253 * | ~~~ 72254 * ``` 72255 * 72256 * @type {State} 72257 */ 72258 function metaBefore(code) { 72259 if (code === null || markdownLineEnding(code)) { 72260 return infoBefore(code) 72261 } 72262 effects.enter('codeFencedFenceMeta') 72263 effects.enter('chunkString', { 72264 contentType: 'string' 72265 }) 72266 return meta(code) 72267 } 72268 72269 /** 72270 * In meta. 72271 * 72272 * ```markdown 72273 * > | ~~~js eval 72274 * ^ 72275 * | alert(1) 72276 * | ~~~ 72277 * ``` 72278 * 72279 * @type {State} 72280 */ 72281 function meta(code) { 72282 if (code === null || markdownLineEnding(code)) { 72283 effects.exit('chunkString') 72284 effects.exit('codeFencedFenceMeta') 72285 return infoBefore(code) 72286 } 72287 if (code === 96 && code === marker) { 72288 return nok(code) 72289 } 72290 effects.consume(code) 72291 return meta 72292 } 72293 72294 /** 72295 * At eol/eof in code, before a non-lazy closing fence or content. 72296 * 72297 * ```markdown 72298 * > | ~~~js 72299 * ^ 72300 * > | alert(1) 72301 * ^ 72302 * | ~~~ 72303 * ``` 72304 * 72305 * @type {State} 72306 */ 72307 function atNonLazyBreak(code) { 72308 return effects.attempt(closeStart, after, contentBefore)(code) 72309 } 72310 72311 /** 72312 * Before code content, not a closing fence, at eol. 72313 * 72314 * ```markdown 72315 * | ~~~js 72316 * > | alert(1) 72317 * ^ 72318 * | ~~~ 72319 * ``` 72320 * 72321 * @type {State} 72322 */ 72323 function contentBefore(code) { 72324 effects.enter('lineEnding') 72325 effects.consume(code) 72326 effects.exit('lineEnding') 72327 return contentStart 72328 } 72329 72330 /** 72331 * Before code content, not a closing fence. 72332 * 72333 * ```markdown 72334 * | ~~~js 72335 * > | alert(1) 72336 * ^ 72337 * | ~~~ 72338 * ``` 72339 * 72340 * @type {State} 72341 */ 72342 function contentStart(code) { 72343 return initialPrefix > 0 && markdownSpace(code) 72344 ? factorySpace( 72345 effects, 72346 beforeContentChunk, 72347 'linePrefix', 72348 initialPrefix + 1 72349 )(code) 72350 : beforeContentChunk(code) 72351 } 72352 72353 /** 72354 * Before code content, after optional prefix. 72355 * 72356 * ```markdown 72357 * | ~~~js 72358 * > | alert(1) 72359 * ^ 72360 * | ~~~ 72361 * ``` 72362 * 72363 * @type {State} 72364 */ 72365 function beforeContentChunk(code) { 72366 if (code === null || markdownLineEnding(code)) { 72367 return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code) 72368 } 72369 effects.enter('codeFlowValue') 72370 return contentChunk(code) 72371 } 72372 72373 /** 72374 * In code content. 72375 * 72376 * ```markdown 72377 * | ~~~js 72378 * > | alert(1) 72379 * ^^^^^^^^ 72380 * | ~~~ 72381 * ``` 72382 * 72383 * @type {State} 72384 */ 72385 function contentChunk(code) { 72386 if (code === null || markdownLineEnding(code)) { 72387 effects.exit('codeFlowValue') 72388 return beforeContentChunk(code) 72389 }
72390 effects.consume(code) 72391 return contentChunk 72392 } 72393 72394 /** 72395 * After code. 72396 * 72397 * ```markdown 72398 * | ~~~js 72399 * | alert(1) 72400 * > | ~~~ 72401 * ^ 72402 * ``` 72403 * 72404 * @type {State} 72405 */ 72406 function after(code) { 72407 effects.exit('codeFenced') 72408 return ok(code) 72409 } 72410 72411 /** 72412 * @this {TokenizeContext} 72413 * @type {Tokenizer} 72414 */ 72415 function tokenizeCloseStart(effects, ok, nok) { 72416 let size = 0 72417 return startBefore 72418 72419 /** 72420 * 72421 * 72422 * @type {State} 72423 */ 72424 function startBefore(code) { 72425 effects.enter('lineEnding') 72426 effects.consume(code) 72427 effects.exit('lineEnding') 72428 return start 72429 } 72430 72431 /** 72432 * Before closing fence, at optional whitespace. 72433 * 72434 * ```markdown 72435 * | ~~~js 72436 * | alert(1) 72437 * > | ~~~ 72438 * ^ 72439 * ``` 72440 * 72441 * @type {State} 72442 */ 72443 function start(code) { 72444 // Always populated by defaults. 72445 72446 // To do: `enter` here or in next state? 72447 effects.enter('codeFencedFence') 72448 return markdownSpace(code) 72449 ? factorySpace( 72450 effects, 72451 beforeSequenceClose, 72452 'linePrefix', 72453 self.parser.constructs.disable.null.includes('codeIndented') 72454 ? undefined 72455 : 4 72456 )(code) 72457 : beforeSequenceClose(code) 72458 } 72459 72460 /** 72461 * In closing fence, after optional whitespace, at sequence. 72462 * 72463 * ```markdown 72464 * | ~~~js 72465 * | alert(1) 72466 * > | ~~~ 72467 * ^ 72468 * ``` 72469 * 72470 * @type {State} 72471 */ 72472 function beforeSequenceClose(code) { 72473 if (code === marker) { 72474 effects.enter('codeFencedFenceSequence') 72475 return sequenceClose(code) 72476 } 72477 return nok(code) 72478 } 72479 72480 /** 72481 * In closing fence sequence. 72482 * 72483 * ```markdown 72484 * | ~~~js 72485 * | alert(1) 72486 * > | ~~~ 72487 * ^ 72488 * ``` 72489 * 72490 * @type {State} 72491 */ 72492 function sequenceClose(code) { 72493 if (code === marker) { 72494 size++ 72495 effects.consume(code) 72496 return sequenceClose 72497 } 72498 if (size >= sizeOpen) { 72499 effects.exit('codeFencedFenceSequence') 72500 return markdownSpace(code) 72501 ? factorySpace(effects, sequenceCloseAfter, 'whitespace')(code) 72502 : sequenceCloseAfter(code) 72503 } 72504 return nok(code) 72505 } 72506 72507 /** 72508 * After closing fence sequence, after optional whitespace. 72509 * 72510 * ```markdown 72511 * | ~~~js 72512 * | alert(1) 72513 * > | ~~~ 72514 * ^ 72515 * ``` 72516 * 72517 * @type {State} 72518 */ 72519 function sequenceCloseAfter(code) { 72520 if (code === null || markdownLineEnding(code)) { 72521 effects.exit('codeFencedFence') 72522 return ok(code) 72523 } 72524 return nok(code) 72525 } 72526 } 72527} 72528 72529/** 72530 * @this {TokenizeContext} 72531 * @type {Tokenizer} 72532 */ 72533function tokenizeNonLazyContinuation(effects, ok, nok) { 72534 const self = this 72535 return start 72536 72537 /** 72538 * 72539 * 72540 * @type {State} 72541 */ 72542 function start(code) { 72543 if (code === null) { 72544 return nok(code) 72545 } 72546 effects.enter('lineEnding') 72547 effects.consume(code) 72548 effects.exit('lineEnding') 72549 return lineStart 72550 } 72551 72552 /** 72553 * 72554 * 72555 * @type {State} 72556 */ 72557 function lineStart(code) { 72558 return self.parser.lazy[self.now().line] ? nok(code) : ok(code) 72559 } 72560} 72561 72562;// ./node_modules/decode-named-character-reference/index.dom.js 72563/// <reference lib="dom" /> 72564 72565/* global document */ 72566 72567const index_dom_element = document.createElement('i') 72568 72569/** 72570 * @param {string} value 72571 * @returns {string | false} 72572 */ 72573function decodeNamedCharacterReference(value) { 72574 const characterReference = '&' + value + ';' 72575 index_dom_element.innerHTML = characterReference 72576 const character = index_dom_element.textContent 72577 72578 // Some named character references do not require the closing semicolon 72579 // (`¬`, for instance), which leads to situations where parsing the assumed 72580 // named reference of `¬it;` will result in the string `¬it;`. 72581 // When we encounter a trailing semicolon after parsing, and the character 72582 // reference to decode was not a semicolon (`;`), we can assume that the 72583 // matching was not complete. 72584 if ( 72585 character.charCodeAt(character.length - 1) === 59 /* `;` */ && 72586 value !== 'semi' 72587 ) { 72588 return false 72589 } 72590 72591 // If the decoded string is equal to the input, the character reference was
72592 // not valid. 72593 return character === characterReference ? false : character 72594} 72595 72596;// ./node_modules/micromark-core-commonmark/lib/character-reference.js 72597/** 72598 * @typedef {import('micromark-util-types').Code} Code 72599 * @typedef {import('micromark-util-types').Construct} Construct 72600 * @typedef {import('micromark-util-types').State} State 72601 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 72602 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 72603 */ 72604 72605 72606 72607/** @type {Construct} */ 72608const characterReference = { 72609 name: 'characterReference', 72610 tokenize: tokenizeCharacterReference 72611} 72612 72613/** 72614 * @this {TokenizeContext} 72615 * @type {Tokenizer} 72616 */ 72617function tokenizeCharacterReference(effects, ok, nok) { 72618 const self = this 72619 let size = 0 72620 /** @type {number} */ 72621 let max 72622 /** @type {(code: Code) => boolean} */ 72623 let test 72624 return start 72625 72626 /** 72627 * Start of character reference. 72628 * 72629 * ```markdown 72630 * > | a&b 72631 * ^ 72632 * > | a{b 72633 * ^ 72634 * > | a	b 72635 * ^ 72636 * ``` 72637 * 72638 * @type {State} 72639 */ 72640 function start(code) { 72641 effects.enter('characterReference') 72642 effects.enter('characterReferenceMarker') 72643 effects.consume(code) 72644 effects.exit('characterReferenceMarker') 72645 return open 72646 } 72647 72648 /** 72649 * After `&`, at `#` for numeric references or alphanumeric for named 72650 * references. 72651 * 72652 * ```markdown 72653 * > | a&b 72654 * ^ 72655 * > | a{b 72656 * ^ 72657 * > | a	b 72658 * ^ 72659 * ``` 72660 * 72661 * @type {State} 72662 */ 72663 function open(code) { 72664 if (code === 35) { 72665 effects.enter('characterReferenceMarkerNumeric') 72666 effects.consume(code) 72667 effects.exit('characterReferenceMarkerNumeric') 72668 return numeric 72669 } 72670 effects.enter('characterReferenceValue') 72671 max = 31 72672 test = asciiAlphanumeric 72673 return value(code) 72674 } 72675 72676 /** 72677 * After `#`, at `x` for hexadecimals or digit for decimals. 72678 * 72679 * ```markdown 72680 * > | a{b 72681 * ^ 72682 * > | a	b 72683 * ^ 72684 * ``` 72685 * 72686 * @type {State} 72687 */ 72688 function numeric(code) { 72689 if (code === 88 || code === 120) { 72690 effects.enter('characterReferenceMarkerHexadecimal') 72691 effects.consume(code) 72692 effects.exit('characterReferenceMarkerHexadecimal') 72693 effects.enter('characterReferenceValue') 72694 max = 6 72695 test = asciiHexDigit 72696 return value 72697 } 72698 effects.enter('characterReferenceValue') 72699 max = 7 72700 test = asciiDigit 72701 return value(code) 72702 } 72703 72704 /** 72705 * After markers (`&#x`, `&#`, or `&`), in value, before `;`. 72706 * 72707 * The character reference kind defines what and how many characters are 72708 * allowed. 72709 * 72710 * ```markdown 72711 * > | a&b 72712 * ^^^ 72713 * > | a{b 72714 * ^^^ 72715 * > | a	b 72716 * ^ 72717 * ``` 72718 * 72719 * @type {State} 72720 */ 72721 function value(code) { 72722 if (code === 59 && size) { 72723 const token = effects.exit('characterReferenceValue') 72724 if ( 72725 test === asciiAlphanumeric && 72726 !decodeNamedCharacterReference(self.sliceSerialize(token)) 72727 ) { 72728 return nok(code) 72729 } 72730 72731 // To do: `markdown-rs` uses a different name: 72732 // `CharacterReferenceMarkerSemi`. 72733 effects.enter('characterReferenceMarker') 72734 effects.consume(code) 72735 effects.exit('characterReferenceMarker') 72736 effects.exit('characterReference') 72737 return ok 72738 } 72739 if (test(code) && size++ < max) { 72740 effects.consume(code) 72741 return value 72742 } 72743 return nok(code) 72744 } 72745} 72746 72747;// ./node_modules/micromark-core-commonmark/lib/character-escape.js 72748/** 72749 * @typedef {import('micromark-util-types').Construct} Construct 72750 * @typedef {import('micromark-util-types').State} State 72751 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 72752 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 72753 */ 72754 72755 72756/** @type {Construct} */ 72757const characterEscape = { 72758 name: 'characterEscape', 72759 tokenize: tokenizeCharacterEscape 72760} 72761 72762/** 72763 * @this {TokenizeContext} 72764 * @type {Tokenizer} 72765 */ 72766function tokenizeCharacterEscape(effects, ok, nok) { 72767 return start 72768 72769 /** 72770 * Start of character escape. 72771 * 72772 * ```markdown 72773 * > | a\*b 72774 * ^ 72775 * ``` 72776 * 72777 * @type {State} 72778 */ 72779 function start(code) { 72780 effects.enter('characterEscape') 72781 effects.enter('escapeMarker')
72782 effects.consume(code) 72783 effects.exit('escapeMarker') 72784 return inside 72785 } 72786 72787 /** 72788 * After `\`, at punctuation. 72789 * 72790 * ```markdown 72791 * > | a\*b 72792 * ^ 72793 * ``` 72794 * 72795 * @type {State} 72796 */ 72797 function inside(code) { 72798 // ASCII punctuation. 72799 if (asciiPunctuation(code)) { 72800 effects.enter('characterEscapeValue') 72801 effects.consume(code) 72802 effects.exit('characterEscapeValue') 72803 effects.exit('characterEscape') 72804 return ok 72805 } 72806 return nok(code) 72807 } 72808} 72809 72810;// ./node_modules/micromark-core-commonmark/lib/line-ending.js 72811/** 72812 * @typedef {import('micromark-util-types').Construct} Construct 72813 * @typedef {import('micromark-util-types').State} State 72814 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 72815 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 72816 */ 72817 72818 72819 72820/** @type {Construct} */ 72821const lineEnding = { 72822 name: 'lineEnding', 72823 tokenize: tokenizeLineEnding 72824} 72825 72826/** 72827 * @this {TokenizeContext} 72828 * @type {Tokenizer} 72829 */ 72830function tokenizeLineEnding(effects, ok) { 72831 return start 72832 72833 /** @type {State} */ 72834 function start(code) { 72835 effects.enter('lineEnding') 72836 effects.consume(code) 72837 effects.exit('lineEnding') 72838 return factorySpace(effects, ok, 'linePrefix') 72839 } 72840} 72841 72842;// ./node_modules/micromark-core-commonmark/lib/label-end.js 72843/** 72844 * @typedef {import('micromark-util-types').Construct} Construct 72845 * @typedef {import('micromark-util-types').Event} Event 72846 * @typedef {import('micromark-util-types').Resolver} Resolver 72847 * @typedef {import('micromark-util-types').State} State 72848 * @typedef {import('micromark-util-types').Token} Token 72849 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 72850 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 72851 */ 72852 72853 72854 72855 72856 72857 72858 72859 72860 72861/** @type {Construct} */ 72862const labelEnd = { 72863 name: 'labelEnd', 72864 tokenize: tokenizeLabelEnd, 72865 resolveTo: resolveToLabelEnd, 72866 resolveAll: resolveAllLabelEnd 72867} 72868 72869/** @type {Construct} */ 72870const resourceConstruct = { 72871 tokenize: tokenizeResource 72872} 72873/** @type {Construct} */ 72874const referenceFullConstruct = { 72875 tokenize: tokenizeReferenceFull 72876} 72877/** @type {Construct} */ 72878const referenceCollapsedConstruct = { 72879 tokenize: tokenizeReferenceCollapsed 72880} 72881 72882/** @type {Resolver} */ 72883function resolveAllLabelEnd(events) { 72884 let index = -1 72885 while (++index < events.length) { 72886 const token = events[index][1] 72887 if ( 72888 token.type === 'labelImage' || 72889 token.type === 'labelLink' || 72890 token.type === 'labelEnd' 72891 ) { 72892 // Remove the marker. 72893 events.splice(index + 1, token.type === 'labelImage' ? 4 : 2) 72894 token.type = 'data' 72895 index++ 72896 } 72897 } 72898 return events 72899} 72900 72901/** @type {Resolver} */ 72902function resolveToLabelEnd(events, context) { 72903 let index = events.length 72904 let offset = 0 72905 /** @type {Token} */ 72906 let token 72907 /** @type {number | undefined} */ 72908 let open 72909 /** @type {number | undefined} */ 72910 let close 72911 /** @type {Array<Event>} */ 72912 let media 72913 72914 // Find an opening. 72915 while (index--) { 72916 token = events[index][1] 72917 if (open) { 72918 // If we see another link, or inactive link label, weâve been here before. 72919 if ( 72920 token.type === 'link' || 72921 (token.type === 'labelLink' && token._inactive) 72922 ) { 72923 break 72924 } 72925 72926 // Mark other link openings as inactive, as we canât have links in 72927 // links. 72928 if (events[index][0] === 'enter' && token.type === 'labelLink') { 72929 token._inactive = true 72930 } 72931 } else if (close) { 72932 if ( 72933 events[index][0] === 'enter' && 72934 (token.type === 'labelImage' || token.type === 'labelLink') && 72935 !token._balanced 72936 ) { 72937 open = index 72938 if (token.type !== 'labelLink') { 72939 offset = 2 72940 break 72941 } 72942 } 72943 } else if (token.type === 'labelEnd') { 72944 close = index 72945 } 72946 } 72947 const group = { 72948 type: events[open][1].type === 'labelLink' ? 'link' : 'image', 72949 start: Object.assign({}, events[open][1].start), 72950 end: Object.assign({}, events[events.length - 1][1].end) 72951 } 72952 const label = { 72953 type: 'label', 72954 start: Object.assign({}, events[open][1].start), 72955 end: Object.assign({}, events[close][1].end) 72956 } 72957 const text = { 72958 type: 'labelText', 72959 start: Object.assign({}, events[open + offset + 2][1].end), 72960 end: Object.assign({}, events[close - 2][1].start) 72961 } 72962 media = [ 72963 ['enter', group, context], 72964 ['enter', label, context] 72965 ] 72966 72967 // Opening marker. 72968 media = push(media, events.slice(open + 1, open + offset + 3)) 72969 72970 // Text open. 72971 media = push(media, [['enter', text, context]]) 72972 72973 // Always populated by defaults. 72974 72975 // Between. 72976 media = push( 72977 media, 72978 resolveAll( 72979 context.parser.constructs.insideSpan.null, 72980 events.slice(open + offset + 4, close - 3), 72981 context 72982 ) 72983 ) 72984 72985 // Text close, marker close, label close. 72986 media = push(media, [ 72987 ['exit', text, context], 72988 events[close - 2], 72989 events[close - 1], 72990 ['exit', label, context] 72991 ]) 72992 72993 // Reference, resource, or so. 72994 media = push(media, events.slice(close + 1)) 72995 72996 // Media close. 72997 media = push(media, [['exit', group, context]]) 72998 splice(events, open, events.length, media) 72999 return events 73000} 73001 73002/** 73003 * @this {TokenizeContext} 73004 * @type {Tokenizer} 73005 */ 73006function tokenizeLabelEnd(effects, ok, nok) { 73007 const self = this 73008 let index = self.events.length 73009 /** @type {Token} */ 73010 let labelStart 73011 /** @type {boolean} */ 73012 let defined 73013 73014 // Find an opening. 73015 while (index--) { 73016 if ( 73017 (self.events[index][1].type === 'labelImage' || 73018 self.events[index][1].type === 'labelLink') && 73019 !self.events[index][1]._balanced 73020 ) { 73021 labelStart = self.events[index][1] 73022 break 73023 } 73024 } 73025 return start 73026 73027 /** 73028 * Start of label end. 73029 * 73030 * ```markdown 73031 * > | [a](b) c 73032 * ^ 73033 * > | [a][b] c 73034 * ^ 73035 * > | [a][] b 73036 * ^ 73037 * > | [a] b 73038 * ``` 73039 * 73040 * @type {State} 73041 */ 73042 function start(code) { 73043 // If there is not an okay opening. 73044 if (!labelStart) { 73045 return nok(code) 73046 } 73047 73048 // If the corresponding label (link) start is marked as inactive, 73049 // it means weâd be wrapping a link, like this: 73050 // 73051 // ```markdown 73052 // > | a [b [c](d) e](f) g. 73053 // ^ 73054 // ``` 73055 // 73056 // We canât have that, so itâs just balanced brackets. 73057 if (labelStart._inactive) { 73058 return labelEndNok(code) 73059 } 73060 defined = self.parser.defined.includes( 73061 normalizeIdentifier( 73062 self.sliceSerialize({ 73063 start: labelStart.end, 73064 end: self.now() 73065 }) 73066 ) 73067 ) 73068 effects.enter('labelEnd') 73069 effects.enter('labelMarker')
73070 effects.consume(code) 73071 effects.exit('labelMarker') 73072 effects.exit('labelEnd') 73073 return after 73074 } 73075 73076 /** 73077 * After `]`. 73078 * 73079 * ```markdown 73080 * > | [a](b) c 73081 * ^ 73082 * > | [a][b] c 73083 * ^ 73084 * > | [a][] b 73085 * ^ 73086 * > | [a] b 73087 * ^ 73088 * ``` 73089 * 73090 * @type {State} 73091 */ 73092 function after(code) { 73093 // Note: `markdown-rs` also parses GFM footnotes here, which for us is in 73094 // an extension. 73095 73096 // Resource (`[asd](fgh)`)? 73097 if (code === 40) { 73098 return effects.attempt( 73099 resourceConstruct, 73100 labelEndOk, 73101 defined ? labelEndOk : labelEndNok 73102 )(code) 73103 } 73104 73105 // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference? 73106 if (code === 91) { 73107 return effects.attempt( 73108 referenceFullConstruct, 73109 labelEndOk, 73110 defined ? referenceNotFull : labelEndNok 73111 )(code) 73112 } 73113 73114 // Shortcut (`[asd]`) reference? 73115 return defined ? labelEndOk(code) : labelEndNok(code) 73116 } 73117 73118 /** 73119 * After `]`, at `[`, but not at a full reference. 73120 * 73121 * > ð **Note**: we only get here if the label is defined. 73122 * 73123 * ```markdown 73124 * > | [a][] b 73125 * ^ 73126 * > | [a] b 73127 * ^ 73128 * ``` 73129 * 73130 * @type {State} 73131 */ 73132 function referenceNotFull(code) { 73133 return effects.attempt( 73134 referenceCollapsedConstruct, 73135 labelEndOk, 73136 labelEndNok 73137 )(code) 73138 } 73139 73140 /** 73141 * Done, we found something. 73142 * 73143 * ```markdown 73144 * > | [a](b) c 73145 * ^ 73146 * > | [a][b] c 73147 * ^ 73148 * > | [a][] b 73149 * ^ 73150 * > | [a] b 73151 * ^ 73152 * ``` 73153 * 73154 * @type {State} 73155 */ 73156 function labelEndOk(code) { 73157 // Note: `markdown-rs` does a bunch of stuff here. 73158 return ok(code) 73159 } 73160 73161 /** 73162 * Done, itâs nothing. 73163 * 73164 * There was an okay opening, but we didnât match anything. 73165 * 73166 * ```markdown 73167 * > | [a](b c 73168 * ^ 73169 * > | [a][b c 73170 * ^ 73171 * > | [a] b 73172 * ^ 73173 * ``` 73174 * 73175 * @type {State} 73176 */ 73177 function labelEndNok(code) { 73178 labelStart._balanced = true 73179 return nok(code) 73180 } 73181} 73182 73183/** 73184 * @this {TokenizeContext} 73185 * @type {Tokenizer} 73186 */ 73187function tokenizeResource(effects, ok, nok) { 73188 return resourceStart 73189 73190 /** 73191 * At a resource. 73192 * 73193 * ```markdown 73194 * > | [a](b) c 73195 * ^ 73196 * ``` 73197 * 73198 * @type {State} 73199 */ 73200 function resourceStart(code) { 73201 effects.enter('resource') 73202 effects.enter('resourceMarker') 73203 effects.consume(code) 73204 effects.exit('resourceMarker') 73205 return resourceBefore 73206 } 73207 73208 /** 73209 * In resource, after `(`, at optional whitespace. 73210 * 73211 * ```markdown 73212 * > | [a](b) c 73213 * ^ 73214 * ``` 73215 * 73216 * @type {State} 73217 */ 73218 function resourceBefore(code) { 73219 return markdownLineEndingOrSpace(code) 73220 ? factoryWhitespace(effects, resourceOpen)(code) 73221 : resourceOpen(code) 73222 } 73223 73224 /** 73225 * In resource, after optional whitespace, at `)` or a destination. 73226 * 73227 * ```markdown 73228 * > | [a](b) c 73229 * ^ 73230 * ``` 73231 * 73232 * @type {State} 73233 */ 73234 function resourceOpen(code) { 73235 if (code === 41) { 73236 return resourceEnd(code) 73237 } 73238 return factoryDestination( 73239 effects, 73240 resourceDestinationAfter, 73241 resourceDestinationMissing, 73242 'resourceDestination', 73243 'resourceDestinationLiteral', 73244 'resourceDestinationLiteralMarker', 73245 'resourceDestinationRaw', 73246 'resourceDestinationString', 73247 32 73248 )(code) 73249 } 73250 73251 /** 73252 * In resource, after destination, at optional whitespace. 73253 * 73254 * ```markdown 73255 * > | [a](b) c 73256 * ^ 73257 * ``` 73258 * 73259 * @type {State} 73260 */ 73261 function resourceDestinationAfter(code) { 73262 return markdownLineEndingOrSpace(code) 73263 ? factoryWhitespace(effects, resourceBetween)(code) 73264 : resourceEnd(code) 73265 } 73266 73267 /** 73268 * At invalid destination. 73269 * 73270 * ```markdown 73271 * > | [a](<<) b 73272 * ^ 73273 * ``` 73274 * 73275 * @type {State} 73276 */ 73277 function resourceDestinationMissing(code) { 73278 return nok(code) 73279 } 73280 73281 /** 73282 * In resource, after destination and whitespace, at `(` or title. 73283 * 73284 * ```markdown 73285 * > | [a](b ) c 73286 * ^ 73287 * ``` 73288 * 73289 * @type {State} 73290 */ 73291 function resourceBetween(code) { 73292 if (code === 34 || code === 39 || code === 40) { 73293 return factoryTitle( 73294 effects, 73295 resourceTitleAfter, 73296 nok, 73297 'resourceTitle', 73298 'resourceTitleMarker', 73299 'resourceTitleString' 73300 )(code) 73301 } 73302 return resourceEnd(code) 73303 } 73304 73305 /** 73306 * In resource, after title, at optional whitespace. 73307 * 73308 * ```markdown 73309 * > | [a](b "c") d 73310 * ^ 73311 * ``` 73312 * 73313 * @type {State} 73314 */ 73315 function resourceTitleAfter(code) { 73316 return markdownLineEndingOrSpace(code) 73317 ? factoryWhitespace(effects, resourceEnd)(code) 73318 : resourceEnd(code) 73319 } 73320 73321 /** 73322 * In resource, at `)`. 73323 * 73324 * ```markdown 73325 * > | [a](b) d 73326 * ^ 73327 * ``` 73328 * 73329 * @type {State} 73330 */ 73331 function resourceEnd(code) { 73332 if (code === 41) { 73333 effects.enter('resourceMarker')
73334 effects.consume(code) 73335 effects.exit('resourceMarker') 73336 effects.exit('resource') 73337 return ok 73338 } 73339 return nok(code) 73340 } 73341} 73342 73343/** 73344 * @this {TokenizeContext} 73345 * @type {Tokenizer} 73346 */ 73347function tokenizeReferenceFull(effects, ok, nok) { 73348 const self = this 73349 return referenceFull 73350 73351 /** 73352 * In a reference (full), at the `[`. 73353 * 73354 * ```markdown 73355 * > | [a][b] d 73356 * ^ 73357 * ``` 73358 * 73359 * @type {State} 73360 */ 73361 function referenceFull(code) { 73362 return factoryLabel.call( 73363 self, 73364 effects, 73365 referenceFullAfter, 73366 referenceFullMissing, 73367 'reference', 73368 'referenceMarker', 73369 'referenceString' 73370 )(code) 73371 } 73372 73373 /** 73374 * In a reference (full), after `]`. 73375 * 73376 * ```markdown 73377 * > | [a][b] d 73378 * ^ 73379 * ``` 73380 * 73381 * @type {State} 73382 */ 73383 function referenceFullAfter(code) { 73384 return self.parser.defined.includes( 73385 normalizeIdentifier( 73386 self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) 73387 ) 73388 ) 73389 ? ok(code) 73390 : nok(code) 73391 } 73392 73393 /** 73394 * In reference (full) that was missing. 73395 * 73396 * ```markdown 73397 * > | [a][b d 73398 * ^ 73399 * ``` 73400 * 73401 * @type {State} 73402 */ 73403 function referenceFullMissing(code) { 73404 return nok(code) 73405 } 73406} 73407 73408/** 73409 * @this {TokenizeContext} 73410 * @type {Tokenizer} 73411 */ 73412function tokenizeReferenceCollapsed(effects, ok, nok) { 73413 return referenceCollapsedStart 73414 73415 /** 73416 * In reference (collapsed), at `[`. 73417 * 73418 * > ð **Note**: we only get here if the label is defined. 73419 * 73420 * ```markdown 73421 * > | [a][] d 73422 * ^ 73423 * ``` 73424 * 73425 * @type {State} 73426 */ 73427 function referenceCollapsedStart(code) { 73428 // We only attempt a collapsed label if thereâs a `[`. 73429 73430 effects.enter('reference') 73431 effects.enter('referenceMarker') 73432 effects.consume(code) 73433 effects.exit('referenceMarker') 73434 return referenceCollapsedOpen 73435 } 73436 73437 /** 73438 * In reference (collapsed), at `]`. 73439 * 73440 * > ð **Note**: we only get here if the label is defined. 73441 * 73442 * ```markdown 73443 * > | [a][] d 73444 * ^ 73445 * ``` 73446 * 73447 * @type {State} 73448 */ 73449 function referenceCollapsedOpen(code) { 73450 if (code === 93) { 73451 effects.enter('referenceMarker') 73452 effects.consume(code) 73453 effects.exit('referenceMarker') 73454 effects.exit('reference') 73455 return ok 73456 } 73457 return nok(code) 73458 } 73459} 73460 73461;// ./node_modules/micromark-core-commonmark/lib/label-start-image.js 73462/** 73463 * @typedef {import('micromark-util-types').Construct} Construct 73464 * @typedef {import('micromark-util-types').State} State 73465 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 73466 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 73467 */ 73468 73469 73470 73471/** @type {Construct} */ 73472const labelStartImage = { 73473 name: 'labelStartImage', 73474 tokenize: tokenizeLabelStartImage, 73475 resolveAll: labelEnd.resolveAll 73476} 73477 73478/** 73479 * @this {TokenizeContext} 73480 * @type {Tokenizer} 73481 */ 73482function tokenizeLabelStartImage(effects, ok, nok) { 73483 const self = this 73484 return start 73485 73486 /** 73487 * Start of label (image) start. 73488 * 73489 * ```markdown 73490 * > | a ![b] c 73491 * ^ 73492 * ``` 73493 * 73494 * @type {State} 73495 */ 73496 function start(code) { 73497 effects.enter('labelImage') 73498 effects.enter('labelImageMarker') 73499 effects.consume(code) 73500 effects.exit('labelImageMarker') 73501 return open 73502 } 73503 73504 /** 73505 * After `!`, at `[`. 73506 * 73507 * ```markdown 73508 * > | a ![b] c 73509 * ^ 73510 * ``` 73511 * 73512 * @type {State} 73513 */ 73514 function open(code) { 73515 if (code === 91) { 73516 effects.enter('labelMarker') 73517 effects.consume(code) 73518 effects.exit('labelMarker') 73519 effects.exit('labelImage') 73520 return after 73521 } 73522 return nok(code) 73523 } 73524 73525 /** 73526 * After `![`. 73527 * 73528 * ```markdown 73529 * > | a ![b] c 73530 * ^ 73531 * ``` 73532 * 73533 * This is needed in because, when GFM footnotes are enabled, images never 73534 * form when started with a `^`. 73535 * Instead, links form: 73536 * 73537 * ```markdown 73538 *  73539 * 73540 * ![^a][b] 73541 * 73542 * [b]: c 73543 * ``` 73544 * 73545 * ```html 73546 * <p>!<a href=\"b\">^a</a></p> 73547 * <p>!<a href=\"c\">^a</a></p> 73548 * ``` 73549 * 73550 * @type {State} 73551 */ 73552 function after(code) { 73553 // To do: use a new field to do this, this is still needed for 73554 // `micromark-extension-gfm-footnote`, but the `label-start-link` 73555 // behavior isnât. 73556 // Hidden footnotes hook. 73557 /* c8 ignore next 3 */ 73558 return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs 73559 ? nok(code) 73560 : ok(code) 73561 } 73562} 73563 73564;// ./node_modules/micromark-util-classify-character/index.js 73565/** 73566 * @typedef {import('micromark-util-types').Code} Code 73567 */ 73568 73569 73570/** 73571 * Classify whether a code represents whitespace, punctuation, or something 73572 * else. 73573 * 73574 * Used for attention (emphasis, strong), whose sequences can open or close 73575 * based on the class of surrounding characters. 73576 * 73577 * > ð **Note**: eof (`null`) is seen as whitespace. 73578 * 73579 * @param {Code} code
73580 * Code. 73581 * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined} 73582 * Group. 73583 */ 73584function classifyCharacter(code) { 73585 if ( 73586 code === null || 73587 markdownLineEndingOrSpace(code) || 73588 unicodeWhitespace(code) 73589 ) { 73590 return 1 73591 } 73592 if (unicodePunctuation(code)) { 73593 return 2 73594 } 73595} 73596 73597;// ./node_modules/micromark-core-commonmark/lib/attention.js 73598/** 73599 * @typedef {import('micromark-util-types').Code} Code 73600 * @typedef {import('micromark-util-types').Construct} Construct 73601 * @typedef {import('micromark-util-types').Event} Event 73602 * @typedef {import('micromark-util-types').Point} Point 73603 * @typedef {import('micromark-util-types').Resolver} Resolver 73604 * @typedef {import('micromark-util-types').State} State 73605 * @typedef {import('micromark-util-types').Token} Token 73606 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 73607 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 73608 */ 73609 73610 73611 73612 73613/** @type {Construct} */ 73614const attention = { 73615 name: 'attention', 73616 tokenize: tokenizeAttention, 73617 resolveAll: resolveAllAttention 73618} 73619 73620/** 73621 * Take all events and resolve attention to emphasis or strong. 73622 * 73623 * @type {Resolver} 73624 */ 73625function resolveAllAttention(events, context) { 73626 let index = -1 73627 /** @type {number} */ 73628 let open 73629 /** @type {Token} */ 73630 let group 73631 /** @type {Token} */ 73632 let text 73633 /** @type {Token} */ 73634 let openingSequence 73635 /** @type {Token} */ 73636 let closingSequence 73637 /** @type {number} */ 73638 let use 73639 /** @type {Array<Event>} */ 73640 let nextEvents 73641 /** @type {number} */ 73642 let offset 73643 73644 // Walk through all events. 73645 // 73646 // Note: performance of this is fine on an mb of normal markdown, but itâs 73647 // a bottleneck for malicious stuff. 73648 while (++index < events.length) { 73649 // Find a token that can close. 73650 if ( 73651 events[index][0] === 'enter' && 73652 events[index][1].type === 'attentionSequence' && 73653 events[index][1]._close 73654 ) { 73655 open = index 73656 73657 // Now walk back to find an opener. 73658 while (open--) { 73659 // Find a token that can open the closer. 73660 if ( 73661 events[open][0] === 'exit' && 73662 events[open][1].type === 'attentionSequence' && 73663 events[open][1]._open && 73664 // If the markers are the same: 73665 context.sliceSerialize(events[open][1]).charCodeAt(0) === 73666 context.sliceSerialize(events[index][1]).charCodeAt(0) 73667 ) { 73668 // If the opening can close or the closing can open, 73669 // and the close size *is not* a multiple of three, 73670 // but the sum of the opening and closing size *is* multiple of three, 73671 // then donât match. 73672 if ( 73673 (events[open][1]._close || events[index][1]._open) && 73674 (events[index][1].end.offset - events[index][1].start.offset) % 3 && 73675 !( 73676 (events[open][1].end.offset - 73677 events[open][1].start.offset + 73678 events[index][1].end.offset - 73679 events[index][1].start.offset) % 73680 3 73681 ) 73682 ) { 73683 continue 73684 } 73685 73686 // Number of markers to use from the sequence. 73687 use = 73688 events[open][1].end.offset - events[open][1].start.offset > 1 && 73689 events[index][1].end.offset - events[index][1].start.offset > 1 73690 ? 2 73691 : 1 73692 const start = Object.assign({}, events[open][1].end) 73693 const end = Object.assign({}, events[index][1].start) 73694 movePoint(start, -use) 73695 movePoint(end, use) 73696 openingSequence = { 73697 type: use > 1 ? 'strongSequence' : 'emphasisSequence', 73698 start, 73699 end: Object.assign({}, events[open][1].end) 73700 } 73701 closingSequence = { 73702 type: use > 1 ? 'strongSequence' : 'emphasisSequence', 73703 start: Object.assign({}, events[index][1].start), 73704 end 73705 } 73706 text = { 73707 type: use > 1 ? 'strongText' : 'emphasisText', 73708 start: Object.assign({}, events[open][1].end), 73709 end: Object.assign({}, events[index][1].start) 73710 } 73711 group = { 73712 type: use > 1 ? 'strong' : 'emphasis', 73713 start: Object.assign({}, openingSequence.start), 73714 end: Object.assign({}, closingSequence.end) 73715 } 73716 events[open][1].end = Object.assign({}, openingSequence.start) 73717 events[index][1].start = Object.assign({}, closingSequence.end) 73718 nextEvents = [] 73719 73720 // If there are more markers in the opening, add them before. 73721 if (events[open][1].end.offset - events[open][1].start.offset) { 73722 nextEvents = push(nextEvents, [ 73723 ['enter', events[open][1], context], 73724 ['exit', events[open][1], context] 73725 ]) 73726 } 73727 73728 // Opening. 73729 nextEvents = push(nextEvents, [ 73730 ['enter', group, context], 73731 ['enter', openingSequence, context], 73732 ['exit', openingSequence, context], 73733 ['enter', text, context] 73734 ]) 73735 73736 // Always populated by defaults. 73737 73738 // Between. 73739 nextEvents = push( 73740 nextEvents, 73741 resolveAll( 73742 context.parser.constructs.insideSpan.null, 73743 events.slice(open + 1, index), 73744 context 73745 ) 73746 ) 73747 73748 // Closing. 73749 nextEvents = push(nextEvents, [ 73750 ['exit', text, context], 73751 ['enter', closingSequence, context], 73752 ['exit', closingSequence, context], 73753 ['exit', group, context] 73754 ]) 73755 73756 // If there are more markers in the closing, add them after. 73757 if (events[index][1].end.offset - events[index][1].start.offset) { 73758 offset = 2 73759 nextEvents = push(nextEvents, [ 73760 ['enter', events[index][1], context], 73761 ['exit', events[index][1], context] 73762 ]) 73763 } else { 73764 offset = 0 73765 } 73766 splice(events, open - 1, index - open + 3, nextEvents) 73767 index = open + nextEvents.length - offset - 2 73768 break 73769 } 73770 } 73771 } 73772 } 73773 73774 // Remove remaining sequences. 73775 index = -1 73776 while (++index < events.length) { 73777 if (events[index][1].type === 'attentionSequence') { 73778 events[index][1].type = 'data' 73779 } 73780 } 73781 return events 73782} 73783 73784/** 73785 * @this {TokenizeContext} 73786 * @type {Tokenizer} 73787 */ 73788function tokenizeAttention(effects, ok) { 73789 const attentionMarkers = this.parser.constructs.attentionMarkers.null 73790 const previous = this.previous
73791 const before = classifyCharacter(previous) 73792 73793 /** @type {NonNullable<Code>} */ 73794 let marker 73795 return start 73796 73797 /** 73798 * Before a sequence. 73799 * 73800 * ```markdown 73801 * > | ** 73802 * ^ 73803 * ``` 73804 * 73805 * @type {State} 73806 */ 73807 function start(code) { 73808 marker = code 73809 effects.enter('attentionSequence') 73810 return inside(code) 73811 } 73812 73813 /** 73814 * In a sequence. 73815 * 73816 * ```markdown 73817 * > | ** 73818 * ^^ 73819 * ``` 73820 * 73821 * @type {State} 73822 */ 73823 function inside(code) { 73824 if (code === marker) { 73825 effects.consume(code) 73826 return inside 73827 } 73828 const token = effects.exit('attentionSequence') 73829 73830 // To do: next major: move this to resolver, just like `markdown-rs`. 73831 const after = classifyCharacter(code) 73832 73833 // Always populated by defaults. 73834 73835 const open = 73836 !after || (after === 2 && before) || attentionMarkers.includes(code) 73837 const close = 73838 !before || (before === 2 && after) || attentionMarkers.includes(previous) 73839 token._open = Boolean(marker === 42 ? open : open && (before || !close)) 73840 token._close = Boolean(marker === 42 ? close : close && (after || !open)) 73841 return ok(code) 73842 } 73843} 73844 73845/** 73846 * Move a point a bit. 73847 * 73848 * Note: `move` only works inside lines! Itâs not possible to move past other 73849 * chunks (replacement characters, tabs, or line endings). 73850 * 73851 * @param {Point} point 73852 * @param {number} offset 73853 * @returns {void} 73854 */ 73855function movePoint(point, offset) { 73856 point.column += offset 73857 point.offset += offset 73858 point._bufferIndex += offset 73859} 73860 73861;// ./node_modules/micromark-core-commonmark/lib/autolink.js 73862/** 73863 * @typedef {import('micromark-util-types').Construct} Construct 73864 * @typedef {import('micromark-util-types').State} State 73865 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 73866 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 73867 */ 73868 73869 73870/** @type {Construct} */ 73871const autolink = { 73872 name: 'autolink', 73873 tokenize: tokenizeAutolink 73874} 73875 73876/** 73877 * @this {TokenizeContext} 73878 * @type {Tokenizer} 73879 */ 73880function tokenizeAutolink(effects, ok, nok) { 73881 let size = 0 73882 return start 73883 73884 /** 73885 * Start of an autolink. 73886 * 73887 * ```markdown 73888 * > | a<https://example.com>b 73889 * ^ 73890 * > | a<[email protected]>b 73891 * ^ 73892 * ``` 73893 * 73894 * @type {State} 73895 */ 73896 function start(code) { 73897 effects.enter('autolink') 73898 effects.enter('autolinkMarker') 73899 effects.consume(code) 73900 effects.exit('autolinkMarker') 73901 effects.enter('autolinkProtocol') 73902 return open 73903 } 73904 73905 /** 73906 * After `<`, at protocol or atext. 73907 * 73908 * ```markdown 73909 * > | a<https://example.com>b 73910 * ^ 73911 * > | a<[email protected]>b 73912 * ^ 73913 * ``` 73914 * 73915 * @type {State} 73916 */ 73917 function open(code) { 73918 if (asciiAlpha(code)) { 73919 effects.consume(code) 73920 return schemeOrEmailAtext 73921 } 73922 return emailAtext(code) 73923 } 73924 73925 /** 73926 * At second byte of protocol or atext. 73927 * 73928 * ```markdown 73929 * > | a<https://example.com>b 73930 * ^ 73931 * > | a<[email protected]>b 73932 * ^ 73933 * ``` 73934 * 73935 * @type {State} 73936 */ 73937 function schemeOrEmailAtext(code) { 73938 // ASCII alphanumeric and `+`, `-`, and `.`. 73939 if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) { 73940 // Count the previous alphabetical from `open` too. 73941 size = 1 73942 return schemeInsideOrEmailAtext(code) 73943 } 73944 return emailAtext(code) 73945 } 73946 73947 /** 73948 * In ambiguous protocol or atext. 73949 * 73950 * ```markdown 73951 * > | a<https://example.com>b 73952 * ^ 73953 * > | a<[email protected]>b 73954 * ^ 73955 * ``` 73956 * 73957 * @type {State} 73958 */ 73959 function schemeInsideOrEmailAtext(code) { 73960 if (code === 58) { 73961 effects.consume(code) 73962 size = 0 73963 return urlInside 73964 } 73965 73966 // ASCII alphanumeric and `+`, `-`, and `.`. 73967 if ( 73968 (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && 73969 size++ < 32 73970 ) { 73971 effects.consume(code) 73972 return schemeInsideOrEmailAtext 73973 } 73974 size = 0 73975 return emailAtext(code) 73976 } 73977 73978 /** 73979 * After protocol, in URL. 73980 * 73981 * ```markdown 73982 * > | a<https://example.com>b 73983 * ^ 73984 * ``` 73985 * 73986 * @type {State} 73987 */ 73988 function urlInside(code) { 73989 if (code === 62) { 73990 effects.exit('autolinkProtocol') 73991 effects.enter('autolinkMarker')
73992 effects.consume(code) 73993 effects.exit('autolinkMarker') 73994 effects.exit('autolink') 73995 return ok 73996 } 73997 73998 // ASCII control, space, or `<`. 73999 if (code === null || code === 32 || code === 60 || asciiControl(code)) { 74000 return nok(code) 74001 } 74002 effects.consume(code) 74003 return urlInside 74004 } 74005 74006 /** 74007 * In email atext. 74008 * 74009 * ```markdown 74010 * > | a<[email protected]>b 74011 * ^ 74012 * ``` 74013 * 74014 * @type {State} 74015 */ 74016 function emailAtext(code) { 74017 if (code === 64) { 74018 effects.consume(code) 74019 return emailAtSignOrDot 74020 } 74021 if (asciiAtext(code)) { 74022 effects.consume(code) 74023 return emailAtext 74024 } 74025 return nok(code) 74026 } 74027 74028 /** 74029 * In label, after at-sign or dot. 74030 * 74031 * ```markdown 74032 * > | a<[email protected]>b 74033 * ^ ^ 74034 * ``` 74035 * 74036 * @type {State} 74037 */ 74038 function emailAtSignOrDot(code) { 74039 return asciiAlphanumeric(code) ? emailLabel(code) : nok(code) 74040 } 74041 74042 /** 74043 * In label, where `.` and `>` are allowed. 74044 * 74045 * ```markdown 74046 * > | a<[email protected]>b 74047 * ^ 74048 * ``` 74049 * 74050 * @type {State} 74051 */ 74052 function emailLabel(code) { 74053 if (code === 46) { 74054 effects.consume(code) 74055 size = 0 74056 return emailAtSignOrDot 74057 } 74058 if (code === 62) { 74059 // Exit, then change the token type. 74060 effects.exit('autolinkProtocol').type = 'autolinkEmail' 74061 effects.enter('autolinkMarker') 74062 effects.consume(code) 74063 effects.exit('autolinkMarker') 74064 effects.exit('autolink') 74065 return ok 74066 } 74067 return emailValue(code) 74068 } 74069 74070 /** 74071 * In label, where `.` and `>` are *not* allowed. 74072 * 74073 * Though, this is also used in `emailLabel` to parse other values. 74074 * 74075 * ```markdown 74076 * > | a<[email protected]>b 74077 * ^ 74078 * ``` 74079 * 74080 * @type {State} 74081 */ 74082 function emailValue(code) { 74083 // ASCII alphanumeric or `-`. 74084 if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) { 74085 const next = code === 45 ? emailValue : emailLabel 74086 effects.consume(code) 74087 return next 74088 } 74089 return nok(code) 74090 } 74091} 74092 74093;// ./node_modules/micromark-core-commonmark/lib/html-text.js 74094/** 74095 * @typedef {import('micromark-util-types').Code} Code 74096 * @typedef {import('micromark-util-types').Construct} Construct 74097 * @typedef {import('micromark-util-types').State} State 74098 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 74099 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 74100 */ 74101 74102 74103 74104/** @type {Construct} */ 74105const htmlText = { 74106 name: 'htmlText', 74107 tokenize: tokenizeHtmlText 74108} 74109 74110/** 74111 * @this {TokenizeContext} 74112 * @type {Tokenizer} 74113 */ 74114function tokenizeHtmlText(effects, ok, nok) { 74115 const self = this 74116 /** @type {NonNullable<Code> | undefined} */ 74117 let marker 74118 /** @type {number} */ 74119 let index 74120 /** @type {State} */ 74121 let returnState 74122 return start 74123 74124 /** 74125 * Start of HTML (text). 74126 * 74127 * ```markdown 74128 * > | a <b> c 74129 * ^ 74130 * ``` 74131 * 74132 * @type {State} 74133 */ 74134 function start(code) { 74135 effects.enter('htmlText') 74136 effects.enter('htmlTextData') 74137 effects.consume(code) 74138 return open 74139 } 74140 74141 /** 74142 * After `<`, at tag name or other stuff. 74143 * 74144 * ```markdown 74145 * > | a <b> c 74146 * ^ 74147 * > | a <!doctype> c 74148 * ^ 74149 * > | a <!--b--> c 74150 * ^ 74151 * ``` 74152 * 74153 * @type {State} 74154 */ 74155 function open(code) { 74156 if (code === 33) { 74157 effects.consume(code) 74158 return declarationOpen 74159 } 74160 if (code === 47) { 74161 effects.consume(code) 74162 return tagCloseStart 74163 } 74164 if (code === 63) { 74165 effects.consume(code) 74166 return instruction 74167 } 74168 74169 // ASCII alphabetical. 74170 if (asciiAlpha(code)) { 74171 effects.consume(code) 74172 return tagOpen 74173 } 74174 return nok(code) 74175 } 74176 74177 /** 74178 * After `<!`, at declaration, comment, or CDATA. 74179 * 74180 * ```markdown 74181 * > | a <!doctype> c 74182 * ^ 74183 * > | a <!--b--> c 74184 * ^ 74185 * > | a <![CDATA[>&<]]> c 74186 * ^ 74187 * ``` 74188 * 74189 * @type {State} 74190 */ 74191 function declarationOpen(code) { 74192 if (code === 45) { 74193 effects.consume(code) 74194 return commentOpenInside 74195 } 74196 if (code === 91) {
74197 effects.consume(code) 74198 index = 0 74199 return cdataOpenInside 74200 } 74201 if (asciiAlpha(code)) { 74202 effects.consume(code) 74203 return declaration 74204 } 74205 return nok(code) 74206 } 74207 74208 /** 74209 * In a comment, after `<!-`, at another `-`. 74210 * 74211 * ```markdown 74212 * > | a <!--b--> c 74213 * ^ 74214 * ``` 74215 * 74216 * @type {State} 74217 */ 74218 function commentOpenInside(code) { 74219 if (code === 45) { 74220 effects.consume(code) 74221 return commentEnd 74222 } 74223 return nok(code) 74224 } 74225 74226 /** 74227 * In comment. 74228 * 74229 * ```markdown 74230 * > | a <!--b--> c 74231 * ^ 74232 * ``` 74233 * 74234 * @type {State} 74235 */ 74236 function comment(code) { 74237 if (code === null) { 74238 return nok(code) 74239 } 74240 if (code === 45) { 74241 effects.consume(code) 74242 return commentClose 74243 } 74244 if (markdownLineEnding(code)) { 74245 returnState = comment 74246 return lineEndingBefore(code) 74247 } 74248 effects.consume(code) 74249 return comment 74250 } 74251 74252 /** 74253 * In comment, after `-`. 74254 * 74255 * ```markdown 74256 * > | a <!--b--> c 74257 * ^ 74258 * ``` 74259 * 74260 * @type {State} 74261 */ 74262 function commentClose(code) { 74263 if (code === 45) { 74264 effects.consume(code) 74265 return commentEnd 74266 } 74267 return comment(code) 74268 } 74269 74270 /** 74271 * In comment, after `--`. 74272 * 74273 * ```markdown 74274 * > | a <!--b--> c 74275 * ^ 74276 * ``` 74277 * 74278 * @type {State} 74279 */ 74280 function commentEnd(code) { 74281 return code === 62 74282 ? end(code) 74283 : code === 45 74284 ? commentClose(code) 74285 : comment(code) 74286 } 74287 74288 /** 74289 * After `<![`, in CDATA, expecting `CDATA[`. 74290 * 74291 * ```markdown 74292 * > | a <![CDATA[>&<]]> b 74293 * ^^^^^^ 74294 * ``` 74295 * 74296 * @type {State} 74297 */ 74298 function cdataOpenInside(code) { 74299 const value = 'CDATA[' 74300 if (code === value.charCodeAt(index++)) { 74301 effects.consume(code) 74302 return index === value.length ? cdata : cdataOpenInside 74303 } 74304 return nok(code) 74305 } 74306 74307 /** 74308 * In CDATA. 74309 * 74310 * ```markdown 74311 * > | a <![CDATA[>&<]]> b 74312 * ^^^ 74313 * ``` 74314 * 74315 * @type {State} 74316 */ 74317 function cdata(code) { 74318 if (code === null) { 74319 return nok(code) 74320 } 74321 if (code === 93) { 74322 effects.consume(code) 74323 return cdataClose 74324 } 74325 if (markdownLineEnding(code)) { 74326 returnState = cdata 74327 return lineEndingBefore(code) 74328 } 74329 effects.consume(code) 74330 return cdata 74331 } 74332 74333 /** 74334 * In CDATA, after `]`, at another `]`. 74335 * 74336 * ```markdown 74337 * > | a <![CDATA[>&<]]> b 74338 * ^ 74339 * ``` 74340 * 74341 * @type {State} 74342 */ 74343 function cdataClose(code) { 74344 if (code === 93) { 74345 effects.consume(code) 74346 return cdataEnd 74347 } 74348 return cdata(code) 74349 } 74350 74351 /** 74352 * In CDATA, after `]]`, at `>`. 74353 * 74354 * ```markdown 74355 * > | a <![CDATA[>&<]]> b 74356 * ^ 74357 * ``` 74358 * 74359 * @type {State} 74360 */ 74361 function cdataEnd(code) { 74362 if (code === 62) { 74363 return end(code) 74364 } 74365 if (code === 93) { 74366 effects.consume(code) 74367 return cdataEnd 74368 } 74369 return cdata(code) 74370 } 74371 74372 /** 74373 * In declaration. 74374 * 74375 * ```markdown 74376 * > | a <!b> c 74377 * ^ 74378 * ``` 74379 * 74380 * @type {State} 74381 */ 74382 function declaration(code) { 74383 if (code === null || code === 62) { 74384 return end(code) 74385 } 74386 if (markdownLineEnding(code)) { 74387 returnState = declaration 74388 return lineEndingBefore(code) 74389 } 74390 effects.consume(code) 74391 return declaration 74392 } 74393 74394 /** 74395 * In instruction. 74396 * 74397 * ```markdown 74398 * > | a <?b?> c 74399 * ^ 74400 * ``` 74401 * 74402 * @type {State} 74403 */ 74404 function instruction(code) { 74405 if (code === null) { 74406 return nok(code) 74407 } 74408 if (code === 63) { 74409 effects.consume(code) 74410 return instructionClose 74411 } 74412 if (markdownLineEnding(code)) { 74413 returnState = instruction 74414 return lineEndingBefore(code) 74415 } 74416 effects.consume(code) 74417 return instruction 74418 } 74419 74420 /** 74421 * In instruction, after `?`, at `>`. 74422 * 74423 * ```markdown 74424 * > | a <?b?> c 74425 * ^ 74426 * ``` 74427 * 74428 * @type {State} 74429 */ 74430 function instructionClose(code) { 74431 return code === 62 ? end(code) : instruction(code) 74432 } 74433 74434 /** 74435 * After `</`, in closing tag, at tag name. 74436 * 74437 * ```markdown 74438 * > | a </b> c 74439 * ^ 74440 * ``` 74441 * 74442 * @type {State} 74443 */ 74444 function tagCloseStart(code) { 74445 // ASCII alphabetical. 74446 if (asciiAlpha(code)) {
74447 effects.consume(code) 74448 return tagClose 74449 } 74450 return nok(code) 74451 } 74452 74453 /** 74454 * After `</x`, in a tag name. 74455 * 74456 * ```markdown 74457 * > | a </b> c 74458 * ^ 74459 * ``` 74460 * 74461 * @type {State} 74462 */ 74463 function tagClose(code) { 74464 // ASCII alphanumerical and `-`. 74465 if (code === 45 || asciiAlphanumeric(code)) { 74466 effects.consume(code) 74467 return tagClose 74468 } 74469 return tagCloseBetween(code) 74470 } 74471 74472 /** 74473 * In closing tag, after tag name. 74474 * 74475 * ```markdown 74476 * > | a </b> c 74477 * ^ 74478 * ``` 74479 * 74480 * @type {State} 74481 */ 74482 function tagCloseBetween(code) { 74483 if (markdownLineEnding(code)) { 74484 returnState = tagCloseBetween 74485 return lineEndingBefore(code) 74486 } 74487 if (markdownSpace(code)) { 74488 effects.consume(code) 74489 return tagCloseBetween 74490 } 74491 return end(code) 74492 } 74493 74494 /** 74495 * After `<x`, in opening tag name. 74496 * 74497 * ```markdown 74498 * > | a <b> c 74499 * ^ 74500 * ``` 74501 * 74502 * @type {State} 74503 */ 74504 function tagOpen(code) { 74505 // ASCII alphanumerical and `-`. 74506 if (code === 45 || asciiAlphanumeric(code)) { 74507 effects.consume(code) 74508 return tagOpen 74509 } 74510 if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { 74511 return tagOpenBetween(code) 74512 } 74513 return nok(code) 74514 } 74515 74516 /** 74517 * In opening tag, after tag name. 74518 * 74519 * ```markdown 74520 * > | a <b> c 74521 * ^ 74522 * ``` 74523 * 74524 * @type {State} 74525 */ 74526 function tagOpenBetween(code) { 74527 if (code === 47) { 74528 effects.consume(code) 74529 return end 74530 } 74531 74532 // ASCII alphabetical and `:` and `_`. 74533 if (code === 58 || code === 95 || asciiAlpha(code)) { 74534 effects.consume(code) 74535 return tagOpenAttributeName 74536 } 74537 if (markdownLineEnding(code)) { 74538 returnState = tagOpenBetween 74539 return lineEndingBefore(code) 74540 } 74541 if (markdownSpace(code)) { 74542 effects.consume(code) 74543 return tagOpenBetween 74544 } 74545 return end(code) 74546 } 74547 74548 /** 74549 * In attribute name. 74550 * 74551 * ```markdown 74552 * > | a <b c> d 74553 * ^ 74554 * ``` 74555 * 74556 * @type {State} 74557 */ 74558 function tagOpenAttributeName(code) { 74559 // ASCII alphabetical and `-`, `.`, `:`, and `_`. 74560 if ( 74561 code === 45 || 74562 code === 46 || 74563 code === 58 || 74564 code === 95 || 74565 asciiAlphanumeric(code) 74566 ) { 74567 effects.consume(code) 74568 return tagOpenAttributeName 74569 } 74570 return tagOpenAttributeNameAfter(code) 74571 } 74572 74573 /** 74574 * After attribute name, before initializer, the end of the tag, or 74575 * whitespace. 74576 * 74577 * ```markdown 74578 * > | a <b c> d 74579 * ^ 74580 * ``` 74581 * 74582 * @type {State} 74583 */ 74584 function tagOpenAttributeNameAfter(code) { 74585 if (code === 61) { 74586 effects.consume(code) 74587 return tagOpenAttributeValueBefore 74588 } 74589 if (markdownLineEnding(code)) { 74590 returnState = tagOpenAttributeNameAfter 74591 return lineEndingBefore(code) 74592 } 74593 if (markdownSpace(code)) { 74594 effects.consume(code) 74595 return tagOpenAttributeNameAfter 74596 } 74597 return tagOpenBetween(code) 74598 } 74599 74600 /** 74601 * Before unquoted, double quoted, or single quoted attribute value, allowing 74602 * whitespace. 74603 * 74604 * ```markdown 74605 * > | a <b c=d> e 74606 * ^ 74607 * ``` 74608 * 74609 * @type {State} 74610 */ 74611 function tagOpenAttributeValueBefore(code) { 74612 if ( 74613 code === null || 74614 code === 60 || 74615 code === 61 || 74616 code === 62 || 74617 code === 96 74618 ) { 74619 return nok(code) 74620 } 74621 if (code === 34 || code === 39) { 74622 effects.consume(code) 74623 marker = code 74624 return tagOpenAttributeValueQuoted 74625 } 74626 if (markdownLineEnding(code)) { 74627 returnState = tagOpenAttributeValueBefore 74628 return lineEndingBefore(code) 74629 } 74630 if (markdownSpace(code)) { 74631 effects.consume(code) 74632 return tagOpenAttributeValueBefore 74633 } 74634 effects.consume(code) 74635 return tagOpenAttributeValueUnquoted 74636 } 74637 74638 /** 74639 * In double or single quoted attribute value. 74640 * 74641 * ```markdown 74642 * > | a <b c="d"> e 74643 * ^ 74644 * ``` 74645 * 74646 * @type {State} 74647 */ 74648 function tagOpenAttributeValueQuoted(code) { 74649 if (code === marker) { 74650 effects.consume(code) 74651 marker = undefined 74652 return tagOpenAttributeValueQuotedAfter 74653 } 74654 if (code === null) { 74655 return nok(code) 74656 } 74657 if (markdownLineEnding(code)) { 74658 returnState = tagOpenAttributeValueQuoted 74659 return lineEndingBefore(code) 74660 }
74661 effects.consume(code) 74662 return tagOpenAttributeValueQuoted 74663 } 74664 74665 /** 74666 * In unquoted attribute value. 74667 * 74668 * ```markdown 74669 * > | a <b c=d> e 74670 * ^ 74671 * ``` 74672 * 74673 * @type {State} 74674 */ 74675 function tagOpenAttributeValueUnquoted(code) { 74676 if ( 74677 code === null || 74678 code === 34 || 74679 code === 39 || 74680 code === 60 || 74681 code === 61 || 74682 code === 96 74683 ) { 74684 return nok(code) 74685 } 74686 if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { 74687 return tagOpenBetween(code) 74688 } 74689 effects.consume(code) 74690 return tagOpenAttributeValueUnquoted 74691 } 74692 74693 /** 74694 * After double or single quoted attribute value, before whitespace or the end 74695 * of the tag. 74696 * 74697 * ```markdown 74698 * > | a <b c="d"> e 74699 * ^ 74700 * ``` 74701 * 74702 * @type {State} 74703 */ 74704 function tagOpenAttributeValueQuotedAfter(code) { 74705 if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) { 74706 return tagOpenBetween(code) 74707 } 74708 return nok(code) 74709 } 74710 74711 /** 74712 * In certain circumstances of a tag where only an `>` is allowed. 74713 * 74714 * ```markdown 74715 * > | a <b c="d"> e 74716 * ^ 74717 * ``` 74718 * 74719 * @type {State} 74720 */ 74721 function end(code) { 74722 if (code === 62) { 74723 effects.consume(code) 74724 effects.exit('htmlTextData') 74725 effects.exit('htmlText') 74726 return ok 74727 } 74728 return nok(code) 74729 } 74730 74731 /** 74732 * At eol. 74733 * 74734 * > ð **Note**: we canât have blank lines in text, so no need to worry about 74735 * > empty tokens. 74736 * 74737 * ```markdown 74738 * > | a <!--a 74739 * ^ 74740 * | b--> 74741 * ``` 74742 * 74743 * @type {State} 74744 */ 74745 function lineEndingBefore(code) { 74746 effects.exit('htmlTextData') 74747 effects.enter('lineEnding') 74748 effects.consume(code) 74749 effects.exit('lineEnding') 74750 return lineEndingAfter 74751 } 74752 74753 /** 74754 * After eol, at optional whitespace. 74755 * 74756 * > ð **Note**: we canât have blank lines in text, so no need to worry about 74757 * > empty tokens. 74758 * 74759 * ```markdown 74760 * | a <!--a 74761 * > | b--> 74762 * ^ 74763 * ``` 74764 * 74765 * @type {State} 74766 */ 74767 function lineEndingAfter(code) { 74768 // Always populated by defaults. 74769 74770 return markdownSpace(code) 74771 ? factorySpace( 74772 effects, 74773 lineEndingAfterPrefix, 74774 'linePrefix', 74775 self.parser.constructs.disable.null.includes('codeIndented') 74776 ? undefined 74777 : 4 74778 )(code) 74779 : lineEndingAfterPrefix(code) 74780 } 74781 74782 /** 74783 * After eol, after optional whitespace. 74784 * 74785 * > ð **Note**: we canât have blank lines in text, so no need to worry about 74786 * > empty tokens. 74787 * 74788 * ```markdown 74789 * | a <!--a 74790 * > | b--> 74791 * ^ 74792 * ``` 74793 * 74794 * @type {State} 74795 */ 74796 function lineEndingAfterPrefix(code) { 74797 effects.enter('htmlTextData') 74798 return returnState(code) 74799 } 74800} 74801 74802;// ./node_modules/micromark-core-commonmark/lib/label-start-link.js 74803/** 74804 * @typedef {import('micromark-util-types').Construct} Construct 74805 * @typedef {import('micromark-util-types').State} State 74806 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 74807 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 74808 */ 74809 74810 74811 74812/** @type {Construct} */ 74813const labelStartLink = { 74814 name: 'labelStartLink', 74815 tokenize: tokenizeLabelStartLink, 74816 resolveAll: labelEnd.resolveAll 74817} 74818 74819/** 74820 * @this {TokenizeContext} 74821 * @type {Tokenizer} 74822 */ 74823function tokenizeLabelStartLink(effects, ok, nok) { 74824 const self = this 74825 return start 74826 74827 /** 74828 * Start of label (link) start. 74829 * 74830 * ```markdown 74831 * > | a [b] c 74832 * ^ 74833 * ``` 74834 * 74835 * @type {State} 74836 */ 74837 function start(code) { 74838 effects.enter('labelLink') 74839 effects.enter('labelMarker') 74840 effects.consume(code) 74841 effects.exit('labelMarker') 74842 effects.exit('labelLink') 74843 return after 74844 } 74845 74846 /** @type {State} */ 74847 function after(code) { 74848 // To do: this isnât needed in `micromark-extension-gfm-footnote`, 74849 // remove. 74850 // Hidden footnotes hook. 74851 /* c8 ignore next 3 */ 74852 return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs 74853 ? nok(code) 74854 : ok(code) 74855 } 74856} 74857 74858;// ./node_modules/micromark-core-commonmark/lib/hard-break-escape.js 74859/** 74860 * @typedef {import('micromark-util-types').Construct} Construct 74861 * @typedef {import('micromark-util-types').State} State 74862 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 74863 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 74864 */ 74865 74866 74867/** @type {Construct} */ 74868const hardBreakEscape = { 74869 name: 'hardBreakEscape', 74870 tokenize: tokenizeHardBreakEscape 74871} 74872 74873/** 74874 * @this {TokenizeContext} 74875 * @type {Tokenizer} 74876 */ 74877function tokenizeHardBreakEscape(effects, ok, nok) { 74878 return start 74879 74880 /** 74881 * Start of a hard break (escape). 74882 * 74883 * ```markdown 74884 * > | a\ 74885 * ^ 74886 * | b 74887 * ``` 74888 * 74889 * @type {State} 74890 */ 74891 function start(code) { 74892 effects.enter('hardBreakEscape')
74893 effects.consume(code) 74894 return after 74895 } 74896 74897 /** 74898 * After `\`, at eol. 74899 * 74900 * ```markdown 74901 * > | a\ 74902 * ^ 74903 * | b 74904 * ``` 74905 * 74906 * @type {State} 74907 */ 74908 function after(code) { 74909 if (markdownLineEnding(code)) { 74910 effects.exit('hardBreakEscape') 74911 return ok(code) 74912 } 74913 return nok(code) 74914 } 74915} 74916 74917;// ./node_modules/micromark-core-commonmark/lib/code-text.js 74918/** 74919 * @typedef {import('micromark-util-types').Construct} Construct 74920 * @typedef {import('micromark-util-types').Previous} Previous 74921 * @typedef {import('micromark-util-types').Resolver} Resolver 74922 * @typedef {import('micromark-util-types').State} State 74923 * @typedef {import('micromark-util-types').Token} Token 74924 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 74925 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer 74926 */ 74927 74928 74929/** @type {Construct} */ 74930const codeText = { 74931 name: 'codeText', 74932 tokenize: tokenizeCodeText, 74933 resolve: resolveCodeText, 74934 previous 74935} 74936 74937// To do: next major: donât resolve, like `markdown-rs`. 74938/** @type {Resolver} */ 74939function resolveCodeText(events) { 74940 let tailExitIndex = events.length - 4 74941 let headEnterIndex = 3 74942 /** @type {number} */ 74943 let index 74944 /** @type {number | undefined} */ 74945 let enter 74946 74947 // If we start and end with an EOL or a space. 74948 if ( 74949 (events[headEnterIndex][1].type === 'lineEnding' || 74950 events[headEnterIndex][1].type === 'space') && 74951 (events[tailExitIndex][1].type === 'lineEnding' || 74952 events[tailExitIndex][1].type === 'space') 74953 ) { 74954 index = headEnterIndex 74955 74956 // And we have data. 74957 while (++index < tailExitIndex) { 74958 if (events[index][1].type === 'codeTextData') { 74959 // Then we have padding. 74960 events[headEnterIndex][1].type = 'codeTextPadding' 74961 events[tailExitIndex][1].type = 'codeTextPadding' 74962 headEnterIndex += 2 74963 tailExitIndex -= 2 74964 break 74965 } 74966 } 74967 } 74968 74969 // Merge adjacent spaces and data. 74970 index = headEnterIndex - 1 74971 tailExitIndex++ 74972 while (++index <= tailExitIndex) { 74973 if (enter === undefined) { 74974 if (index !== tailExitIndex && events[index][1].type !== 'lineEnding') { 74975 enter = index 74976 } 74977 } else if ( 74978 index === tailExitIndex || 74979 events[index][1].type === 'lineEnding' 74980 ) { 74981 events[enter][1].type = 'codeTextData' 74982 if (index !== enter + 2) { 74983 events[enter][1].end = events[index - 1][1].end 74984 events.splice(enter + 2, index - enter - 2) 74985 tailExitIndex -= index - enter - 2 74986 index = enter + 2 74987 } 74988 enter = undefined 74989 } 74990 } 74991 return events 74992} 74993 74994/** 74995 * @this {TokenizeContext} 74996 * @type {Previous} 74997 */ 74998function previous(code) { 74999 // If there is a previous code, there will always be a tail. 75000 return ( 75001 code !== 96 || 75002 this.events[this.events.length - 1][1].type === 'characterEscape' 75003 ) 75004} 75005 75006/** 75007 * @this {TokenizeContext} 75008 * @type {Tokenizer} 75009 */ 75010function tokenizeCodeText(effects, ok, nok) { 75011 const self = this 75012 let sizeOpen = 0 75013 /** @type {number} */ 75014 let size 75015 /** @type {Token} */ 75016 let token 75017 return start 75018 75019 /** 75020 * Start of code (text). 75021 * 75022 * ```markdown 75023 * > | `a` 75024 * ^ 75025 * > | \`a` 75026 * ^ 75027 * ``` 75028 * 75029 * @type {State} 75030 */ 75031 function start(code) { 75032 effects.enter('codeText') 75033 effects.enter('codeTextSequence') 75034 return sequenceOpen(code) 75035 } 75036 75037 /** 75038 * In opening sequence. 75039 * 75040 * ```markdown 75041 * > | `a` 75042 * ^ 75043 * ``` 75044 * 75045 * @type {State} 75046 */ 75047 function sequenceOpen(code) { 75048 if (code === 96) { 75049 effects.consume(code) 75050 sizeOpen++ 75051 return sequenceOpen 75052 } 75053 effects.exit('codeTextSequence') 75054 return between(code) 75055 } 75056 75057 /** 75058 * Between something and something else. 75059 * 75060 * ```markdown 75061 * > | `a` 75062 * ^^ 75063 * ``` 75064 * 75065 * @type {State} 75066 */ 75067 function between(code) { 75068 // EOF. 75069 if (code === null) { 75070 return nok(code) 75071 } 75072 75073 // To do: next major: donât do spaces in resolve, but when compiling, 75074 // like `markdown-rs`. 75075 // Tabs donât work, and virtual spaces donât make sense. 75076 if (code === 32) { 75077 effects.enter('space')
75078 effects.consume(code) 75079 effects.exit('space') 75080 return between 75081 } 75082 75083 // Closing fence? Could also be data. 75084 if (code === 96) { 75085 token = effects.enter('codeTextSequence') 75086 size = 0 75087 return sequenceClose(code) 75088 } 75089 if (markdownLineEnding(code)) { 75090 effects.enter('lineEnding') 75091 effects.consume(code) 75092 effects.exit('lineEnding') 75093 return between 75094 } 75095 75096 // Data. 75097 effects.enter('codeTextData') 75098 return data(code) 75099 } 75100 75101 /** 75102 * In data. 75103 * 75104 * ```markdown 75105 * > | `a` 75106 * ^ 75107 * ``` 75108 * 75109 * @type {State} 75110 */ 75111 function data(code) { 75112 if ( 75113 code === null || 75114 code === 32 || 75115 code === 96 || 75116 markdownLineEnding(code) 75117 ) { 75118 effects.exit('codeTextData') 75119 return between(code) 75120 } 75121 effects.consume(code) 75122 return data 75123 } 75124 75125 /** 75126 * In closing sequence. 75127 * 75128 * ```markdown 75129 * > | `a` 75130 * ^ 75131 * ``` 75132 * 75133 * @type {State} 75134 */ 75135 function sequenceClose(code) { 75136 // More. 75137 if (code === 96) { 75138 effects.consume(code) 75139 size++ 75140 return sequenceClose 75141 } 75142 75143 // Done! 75144 if (size === sizeOpen) { 75145 effects.exit('codeTextSequence') 75146 effects.exit('codeText') 75147 return ok(code) 75148 } 75149 75150 // More or less accents: mark as data. 75151 token.type = 'codeTextData' 75152 return data(code) 75153 } 75154} 75155 75156;// ./node_modules/micromark/lib/constructs.js 75157/** 75158 * @typedef {import('micromark-util-types').Extension} Extension 75159 */ 75160 75161 75162 75163 75164/** @satisfies {Extension['document']} */ 75165const constructs_document = { 75166 [42]: list, 75167 [43]: list, 75168 [45]: list, 75169 [48]: list, 75170 [49]: list, 75171 [50]: list, 75172 [51]: list, 75173 [52]: list, 75174 [53]: list, 75175 [54]: list, 75176 [55]: list, 75177 [56]: list, 75178 [57]: list, 75179 [62]: blockQuote 75180} 75181 75182/** @satisfies {Extension['contentInitial']} */ 75183const contentInitial = { 75184 [91]: definition 75185} 75186 75187/** @satisfies {Extension['flowInitial']} */ 75188const flowInitial = { 75189 [-2]: codeIndented, 75190 [-1]: codeIndented, 75191 [32]: codeIndented 75192} 75193 75194/** @satisfies {Extension['flow']} */ 75195const constructs_flow = { 75196 [35]: headingAtx, 75197 [42]: thematicBreak, 75198 [45]: [setextUnderline, thematicBreak], 75199 [60]: htmlFlow, 75200 [61]: setextUnderline, 75201 [95]: thematicBreak, 75202 [96]: codeFenced, 75203 [126]: codeFenced 75204} 75205 75206/** @satisfies {Extension['string']} */ 75207const constructs_string = { 75208 [38]: characterReference, 75209 [92]: characterEscape 75210} 75211 75212/** @satisfies {Extension['text']} */ 75213const constructs_text = { 75214 [-5]: lineEnding, 75215 [-4]: lineEnding, 75216 [-3]: lineEnding, 75217 [33]: labelStartImage, 75218 [38]: characterReference, 75219 [42]: attention, 75220 [60]: [autolink, htmlText], 75221 [91]: labelStartLink, 75222 [92]: [hardBreakEscape, characterEscape], 75223 [93]: labelEnd, 75224 [95]: attention, 75225 [96]: codeText 75226} 75227 75228/** @satisfies {Extension['insideSpan']} */ 75229const insideSpan = { 75230 null: [attention, resolver] 75231} 75232 75233/** @satisfies {Extension['attentionMarkers']} */ 75234const attentionMarkers = { 75235 null: [42, 95] 75236} 75237 75238/** @satisfies {Extension['disable']} */ 75239const disable = { 75240 null: [] 75241} 75242 75243;// ./node_modules/micromark/lib/parse.js 75244/** 75245 * @typedef {import('micromark-util-types').Create} Create 75246 * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension 75247 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct 75248 * @typedef {import('micromark-util-types').ParseContext} ParseContext 75249 * @typedef {import('micromark-util-types').ParseOptions} ParseOptions 75250 */ 75251 75252 75253 75254 75255 75256 75257 75258 75259 75260/** 75261 * @param {ParseOptions | null | undefined} [options] 75262 * @returns {ParseContext} 75263 */ 75264function parse(options) { 75265 const settings = options || {} 75266 const constructs = 75267 /** @type {FullNormalizedExtension} */ 75268 combineExtensions([constructs_namespaceObject, ...(settings.extensions || [])]) 75269 75270 /** @type {ParseContext} */ 75271 const parser = { 75272 defined: [], 75273 lazy: {}, 75274 constructs, 75275 content: create(content), 75276 document: create(document_document), 75277 flow: create(flow), 75278 string: create(string), 75279 text: create(text_text) 75280 } 75281 return parser 75282 75283 /** 75284 * @param {InitialConstruct} initial 75285 */ 75286 function create(initial) { 75287 return creator 75288 /** @type {Create} */ 75289 function creator(from) { 75290 return createTokenizer(parser, initial, from) 75291 } 75292 } 75293} 75294 75295;// ./node_modules/micromark/lib/preprocess.js 75296/** 75297 * @typedef {import('micromark-util-types').Chunk} Chunk 75298 * @typedef {import('micromark-util-types').Code} Code 75299 * @typedef {import('micromark-util-types').Encoding} Encoding 75300 * @typedef {import('micromark-util-types').Value} Value 75301 */ 75302 75303/** 75304 * @callback Preprocessor 75305 * @param {Value} value 75306 * @param {Encoding | null | undefined} [encoding] 75307 * @param {boolean | null | undefined} [end=false] 75308 * @returns {Array<Chunk>} 75309 */ 75310 75311const search = /[\0\t\n\r]/g 75312 75313/** 75314 * @returns {Preprocessor} 75315 */ 75316function preprocess() { 75317 let column = 1 75318 let buffer = '' 75319 /** @type {boolean | undefined} */ 75320 let start = true 75321 /** @type {boolean | undefined} */ 75322 let atCarriageReturn 75323 return preprocessor 75324 75325 /** @type {Preprocessor} */ 75326 function preprocessor(value, encoding, end) { 75327 /** @type {Array<Chunk>} */ 75328 const chunks = [] 75329 /** @type {RegExpMatchArray | null} */ 75330 let match 75331 /** @type {number} */ 75332 let next 75333 /** @type {number} */ 75334 let startPosition 75335 /** @type {number} */ 75336 let endPosition 75337 /** @type {Code} */
75338 let code 75339 75340 // @ts-expect-error `Buffer` does allow an encoding. 75341 value = buffer + value.toString(encoding) 75342 startPosition = 0 75343 buffer = '' 75344 if (start) { 75345 // To do: `markdown-rs` actually parses BOMs (byte order mark). 75346 if (value.charCodeAt(0) === 65279) { 75347 startPosition++ 75348 } 75349 start = undefined 75350 } 75351 while (startPosition < value.length) { 75352 search.lastIndex = startPosition 75353 match = search.exec(value) 75354 endPosition = 75355 match && match.index !== undefined ? match.index : value.length 75356 code = value.charCodeAt(endPosition) 75357 if (!match) { 75358 buffer = value.slice(startPosition) 75359 break 75360 } 75361 if (code === 10 && startPosition === endPosition && atCarriageReturn) { 75362 chunks.push(-3) 75363 atCarriageReturn = undefined 75364 } else { 75365 if (atCarriageReturn) { 75366 chunks.push(-5) 75367 atCarriageReturn = undefined 75368 } 75369 if (startPosition < endPosition) { 75370 chunks.push(value.slice(startPosition, endPosition)) 75371 column += endPosition - startPosition 75372 } 75373 switch (code) { 75374 case 0: { 75375 chunks.push(65533) 75376 column++ 75377 break 75378 } 75379 case 9: { 75380 next = Math.ceil(column / 4) * 4 75381 chunks.push(-2) 75382 while (column++ < next) chunks.push(-1) 75383 break 75384 } 75385 case 10: { 75386 chunks.push(-4) 75387 column = 1 75388 break 75389 } 75390 default: { 75391 atCarriageReturn = true 75392 column = 1 75393 } 75394 } 75395 } 75396 startPosition = endPosition + 1 75397 } 75398 if (end) { 75399 if (atCarriageReturn) chunks.push(-5) 75400 if (buffer) chunks.push(buffer) 75401 chunks.push(null) 75402 } 75403 return chunks 75404 } 75405} 75406 75407;// ./node_modules/micromark/lib/postprocess.js 75408/** 75409 * @typedef {import('micromark-util-types').Event} Event 75410 */ 75411 75412 75413 75414/** 75415 * @param {Array<Event>} events 75416 * @returns {Array<Event>} 75417 */ 75418function postprocess(events) { 75419 while (!subtokenize(events)) { 75420 // Empty 75421 } 75422 return events 75423} 75424 75425;// ./node_modules/micromark-util-decode-numeric-character-reference/index.js 75426/** 75427 * Turn the number (in string form as either hexa- or plain decimal) coming from 75428 * a numeric character reference into a character. 75429 * 75430 * Sort of like `String.fromCharCode(Number.parseInt(value, base))`, but makes 75431 * non-characters and control characters safe. 75432 * 75433 * @param {string} value 75434 * Value to decode. 75435 * @param {number} base 75436 * Numeric base. 75437 * @returns {string} 75438 * Character. 75439 */ 75440function decodeNumericCharacterReference(value, base) { 75441 const code = Number.parseInt(value, base) 75442 if ( 75443 // C0 except for HT, LF, FF, CR, space. 75444 code < 9 || 75445 code === 11 || 75446 (code > 13 && code < 32) || 75447 // Control character (DEL) of C0, and C1 controls. 75448 (code > 126 && code < 160) || 75449 // Lone high surrogates and low surrogates. 75450 (code > 55295 && code < 57344) || 75451 // Noncharacters. 75452 (code > 64975 && code < 65008) /* eslint-disable no-bitwise */ || 75453 (code & 65535) === 65535 || 75454 (code & 65535) === 65534 /* eslint-enable no-bitwise */ || 75455 // Out of range 75456 code > 1114111 75457 ) { 75458 return '\uFFFD' 75459 } 75460 return String.fromCharCode(code) 75461} 75462 75463;// ./node_modules/micromark-util-decode-string/index.js 75464 75465 75466const characterEscapeOrReference = 75467 /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi 75468 75469/** 75470 * Decode markdown strings (which occur in places such as fenced code info 75471 * strings, destinations, labels, and titles). 75472 * 75473 * The âstringâ content type allows character escapes and -references. 75474 * This decodes those. 75475 * 75476 * @param {string} value 75477 * Value to decode. 75478 * @returns {string} 75479 * Decoded value. 75480 */ 75481function decodeString(value) { 75482 return value.replace(characterEscapeOrReference, decode) 75483} 75484 75485/** 75486 * @param {string} $0 75487 * @param {string} $1 75488 * @param {string} $2 75489 * @returns {string} 75490 */ 75491function decode($0, $1, $2) { 75492 if ($1) { 75493 // Escape. 75494 return $1 75495 } 75496 75497 // Reference. 75498 const head = $2.charCodeAt(0) 75499 if (head === 35) { 75500 const head = $2.charCodeAt(1) 75501 const hex = head === 120 || head === 88 75502 return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16
75502: 10) 75503 } 75504 return decodeNamedCharacterReference($2) || $0 75505} 75506 75507;// ./node_modules/mdast-util-from-markdown/lib/index.js 75508/** 75509 * @typedef {import('micromark-util-types').Encoding} Encoding 75510 * @typedef {import('micromark-util-types').Event} Event 75511 * @typedef {import('micromark-util-types').ParseOptions} ParseOptions 75512 * @typedef {import('micromark-util-types').Token} Token 75513 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext 75514 * @typedef {import('micromark-util-types').Value} Value 75515 * 75516 * @typedef {import('unist').Parent} UnistParent 75517 * @typedef {import('unist').Point} Point 75518 * 75519 * @typedef {import('mdast').PhrasingContent} PhrasingContent 75520 * @typedef {import('mdast').StaticPhrasingContent} StaticPhrasingContent 75521 * @typedef {import('mdast').Content} Content 75522 * @typedef {import('mdast').Break} Break 75523 * @typedef {import('mdast').Blockquote} Blockquote 75524 * @typedef {import('mdast').Code} Code 75525 * @typedef {import('mdast').Definition} Definition 75526 * @typedef {import('mdast').Emphasis} Emphasis 75527 * @typedef {import('mdast').Heading} Heading 75528 * @typedef {import('mdast').HTML} HTML 75529 * @typedef {import('mdast').Image} Image 75530 * @typedef {import('mdast').ImageReference} ImageReference 75531 * @typedef {import('mdast').InlineCode} InlineCode 75532 * @typedef {import('mdast').Link} Link 75533 * @typedef {import('mdast').LinkReference} LinkReference 75534 * @typedef {import('mdast').List} List 75535 * @typedef {import('mdast').ListItem} ListItem 75536 * @typedef {import('mdast').Paragraph} Paragraph 75537 * @typedef {import('mdast').Root} Root 75538 * @typedef {import('mdast').Strong} Strong 75539 * @typedef {import('mdast').Text} Text 75540 * @typedef {import('mdast').ThematicBreak} ThematicBreak 75541 * @typedef {import('mdast').ReferenceType} ReferenceType 75542 * @typedef {import('../index.js').CompileData} CompileData 75543 */ 75544 75545/** 75546 * @typedef {Root | Content} Node 75547 * @typedef {Extract<Node, UnistParent>} Parent 75548 * 75549 * @typedef {Omit<UnistParent, 'type' | 'children'> & {type: 'fragment', children: Array<PhrasingContent>}} Fragment 75550 */ 75551 75552/** 75553 * @callback Transform 75554 * Extra transform, to change the AST afterwards. 75555 * @param {Root} tree 75556 * Tree to transform. 75557 * @returns {Root | undefined | null | void} 75558 * New tree or nothing (in which case the current tree is used). 75559 * 75560 * @callback Handle 75561 * Handle a token. 75562 * @param {CompileContext} this 75563 * Context. 75564 * @param {Token} token 75565 * Current token. 75566 * @returns {void} 75567 * Nothing. 75568 * 75569 * @typedef {Record<string, Handle>} Handles 75570 * Token types mapping to handles 75571 * 75572 * @callback OnEnterError 75573 * Handle the case where the `right` token is open, but it is closed (by the 75574 * `left` token) or because we reached the end of the document. 75575 * @param {Omit<CompileContext, 'sliceSerialize'>} this 75576 * Context. 75577 * @param {Token | undefined} left 75578 * Left token. 75579 * @param {Token} right 75580 * Right token. 75581 * @returns {void} 75582 * Nothing. 75583 * 75584 * @callback OnExitError 75585 * Handle the case where the `right` token is open but it is closed by 75586 * exiting the `left` token. 75587 * @param {Omit<CompileContext, 'sliceSerialize'>} this 75588 * Context. 75589 * @param {Token} left 75590 * Left token. 75591 * @param {Token} right 75592 * Right token. 75593 * @returns {void} 75594 * Nothing. 75595 * 75596 * @typedef {[Token, OnEnterError | undefined]} TokenTuple 75597 * Open token on the stack, with an optional error handler for when 75598 * that token isnât closed properly. 75599 */ 75600 75601/** 75602 * @typedef Config 75603 * Configuration. 75604 * 75605 * We have our defaults, but extensions will add more. 75606 * @property {Array<string>} canContainEols 75607 * Token types where line endings are used. 75608 * @property {Handles} enter 75609 * Opening handles. 75610 * @property {Handles} exit 75611 * Closing handles. 75612 * @property {Array<Transform>} transforms 75613 * Tree transforms. 75614 * 75615 * @typedef {Partial<Config>} Extension 75616 * Change how markdown tokens from micromark are turned into mdast. 75617 * 75618 * @typedef CompileContext 75619 * mdast compiler context. 75620 * @property {Array<Node | Fragment>} stack 75621 * Stack of nodes. 75622 * @property {Array<TokenTuple>} tokenStack 75623 * Stack of tokens. 75624 * @property {<Key extends keyof CompileData>(key: Key) => CompileData[Key]} getData 75625 * Get data from the key/value store. 75626 * @property {<Key extends keyof CompileData>(key: Key, value?: CompileData[Key]) => void} setData 75627 * Set data into the key/value store. 75628 * @property {(this: CompileContext) => void} buffer 75629 * Capture some of the output data. 75630 * @property {(this: CompileContext) => string} resume 75631 * Stop capturing and access the output data. 75632 * @property {<Kind extends Node>(this: CompileContext, node: Kind, token: Token, onError?: OnEnterError) => Kind} enter 75633 * Enter a token. 75634 * @property {(this: CompileContext, token: Token, onError?: OnExitError) => Node} exit 75635 * Exit a token. 75636 * @property {TokenizeContext['sliceSerialize']} sliceSerialize 75637 * Get the string value of a token. 75638 * @property {Config} config 75639 * Configuration. 75640 * 75641 * @typedef FromMarkdownOptions 75642 * Configuration for how to build mdast. 75643 * @property {Array<Extension | Array<Extension>> | null | undefined} [mdastExtensions] 75644 * Extensions for this utility to change how tokens are turned into a tree. 75645 * 75646 * @typedef {ParseOptions & FromMarkdownOptions} Options 75647 * Configuration. 75648 */ 75649 75650// To do: micromark: create a registry of tokens? 75651// To do: next major: donât return given `Node` from `enter`. 75652// To do: next major: remove setter/getter. 75653 75654 75655 75656 75657 75658 75659 75660 75661 75662 75663const lib_own = {}.hasOwnProperty 75664 75665/** 75666 * @param value 75667 * Markdown to parse. 75668 * @param encoding 75669 * Character encoding for when `value` is `Buffer`. 75670 * @param options 75671 * Configuration. 75672 * @returns 75673 * mdast tree. 75674 */ 75675const fromMarkdown = 75676 /** 75677 * @type {( 75678 * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) & 75679 * ((value: Value, options?: Options | null | undefined) => Root) 75680 * )} 75681 */ 75682 75683 /** 75684 * @param {Value} value 75685 * @param {Encoding | Options | null | undefined} [encoding] 75686 * @param {Options | null | undefined} [options] 75687 * @returns {Root} 75688 */ 75689 function (value, encoding, options) { 75690 if (typeof encoding !== 'string') { 75691 options = encoding 75692 encoding = undefined 75693 } 75694 return compiler(options)( 75695 postprocess( 75696 parse(options).document().write(preprocess()(value, encoding, true)) 75697 ) 75698 ) 75699 } 75700 75701/** 75702 * Note this compiler only understand complete buffering, not streaming. 75703 * 75704 * @param {Options | null | undefined} [options] 75705 */ 75706function compiler(options) { 75707 /** @type {Config} */ 75708 const config = { 75709 transforms: [], 75710 canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'], 75711 enter: { 75712 autolink: opener(link), 75713 autolinkProtocol: onenterdata, 75714 autolinkEmail: onenterdata, 75715 atxHeading: opener(heading), 75716 blockQuote: opener(blockQuote), 75717 characterEscape: onenterdata, 75718 characterReference: onenterdata, 75719 codeFenced: opener(codeFlow), 75720 codeFencedFenceInfo: buffer, 75721 codeFencedFenceMeta: buffer, 75722 codeIndented: opener(codeFlow, buffer), 75723 codeText: opener(codeText, buffer), 75724 codeTextData: onenterdata, 75725 data: onenterdata, 75726 codeFlowValue: onenterdata, 75727 definition: opener(definition), 75728 definitionDestinationString: buffer, 75729 definitionLabelString: buffer, 75730 definitionTitleString: buffer, 75731 emphasis: opener(emphasis), 75732 hardBreakEscape: opener(hardBreak), 75733 hardBreakTrailing: opener(hardBreak), 75734 htmlFlow: opener(html, buffer), 75735 htmlFlowData: onenterdata, 75736 htmlText: opener(html, buffer), 75737 htmlTextData: onenterdata, 75738 image: opener(image), 75739 label: buffer, 75740 link: opener(link), 75741 listItem: opener(listItem),
75742 listItemValue: onenterlistitemvalue, 75743 listOrdered: opener(list, onenterlistordered), 75744 listUnordered: opener(list), 75745 paragraph: opener(paragraph), 75746 reference: onenterreference, 75747 referenceString: buffer, 75748 resourceDestinationString: buffer, 75749 resourceTitleString: buffer, 75750 setextHeading: opener(heading), 75751 strong: opener(strong), 75752 thematicBreak: opener(thematicBreak) 75753 }, 75754 exit: { 75755 atxHeading: closer(), 75756 atxHeadingSequence: onexitatxheadingsequence, 75757 autolink: closer(), 75758 autolinkEmail: onexitautolinkemail, 75759 autolinkProtocol: onexitautolinkprotocol, 75760 blockQuote: closer(), 75761 characterEscapeValue: onexitdata, 75762 characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, 75763 characterReferenceMarkerNumeric: onexitcharacterreferencemarker, 75764 characterReferenceValue: onexitcharacterreferencevalue, 75765 codeFenced: closer(onexitcodefenced), 75766 codeFencedFence: onexitcodefencedfence, 75767 codeFencedFenceInfo: onexitcodefencedfenceinfo, 75768 codeFencedFenceMeta: onexitcodefencedfencemeta, 75769 codeFlowValue: onexitdata, 75770 codeIndented: closer(onexitcodeindented), 75771 codeText: closer(onexitcodetext), 75772 codeTextData: onexitdata, 75773 data: onexitdata, 75774 definition: closer(), 75775 definitionDestinationString: onexitdefinitiondestinationstring,
75776 definitionLabelString: onexitdefinitionlabelstring, 75777 definitionTitleString: onexitdefinitiontitlestring, 75778 emphasis: closer(), 75779 hardBreakEscape: closer(onexithardbreak), 75780 hardBreakTrailing: closer(onexithardbreak), 75781 htmlFlow: closer(onexithtmlflow), 75782 htmlFlowData: onexitdata, 75783 htmlText: closer(onexithtmltext), 75784 htmlTextData: onexitdata, 75785 image: closer(onexitimage), 75786 label: onexitlabel, 75787 labelText: onexitlabeltext, 75788 lineEnding: onexitlineending, 75789 link: closer(onexitlink), 75790 listItem: closer(), 75791 listOrdered: closer(), 75792 listUnordered: closer(), 75793 paragraph: closer(), 75794 referenceString: onexitreferencestring, 75795 resourceDestinationString: onexitresourcedestinationstring, 75796 resourceTitleString: onexitresourcetitlestring, 75797 resource: onexitresource, 75798 setextHeading: closer(onexitsetextheading), 75799 setextHeadingLineSequence: onexitsetextheadinglinesequence, 75800 setextHeadingText: onexitsetextheadingtext, 75801 strong: closer(), 75802 thematicBreak: closer() 75803 } 75804 } 75805 configure(config, (options || {}).mdastExtensions || []) 75806 75807 /** @type {CompileData} */ 75808 const data = {} 75809 return compile 75810 75811 /** 75812 * Turn micromark events into an mdast tree. 75813 * 75814 * @param {Array<Event>} events 75815 * Events. 75816 * @returns {Root} 75817 * mdast tree. 75818 */ 75819 function compile(events) { 75820 /** @type {Root} */ 75821 let tree = { 75822 type: 'root', 75823 children: [] 75824 } 75825 /** @type {Omit<CompileContext, 'sliceSerialize'>} */ 75826 const context = { 75827 stack: [tree], 75828 tokenStack: [], 75829 config, 75830 enter, 75831 exit, 75832 buffer, 75833 resume, 75834 setData, 75835 getData 75836 } 75837 /** @type {Array<number>} */ 75838 const listStack = [] 75839 let index = -1 75840 while (++index < events.length) { 75841 // We preprocess lists to add `listItem` tokens, and to infer whether 75842 // items the list itself are spread out. 75843 if ( 75844 events[index][1].type === 'listOrdered' || 75845 events[index][1].type === 'listUnordered' 75846 ) { 75847 if (events[index][0] === 'enter') { 75848 listStack.push(index) 75849 } else { 75850 const tail = listStack.pop() 75851 index = prepareList(events, tail, index) 75852 } 75853 } 75854 } 75855 index = -1 75856 while (++index < events.length) { 75857 const handler = config[events[index][0]] 75858 if (lib_own.call(handler, events[index][1].type)) { 75859 handler[events[index][1].type].call( 75860 Object.assign( 75861 { 75862 sliceSerialize: events[index][2].sliceSerialize 75863 }, 75864 context 75865 ), 75866 events[index][1] 75867 ) 75868 } 75869 } 75870 75871 // Handle tokens still being open. 75872 if (context.tokenStack.length > 0) { 75873 const tail = context.tokenStack[context.tokenStack.length - 1] 75874 const handler = tail[1] || defaultOnError 75875 handler.call(context, undefined, tail[0]) 75876 } 75877 75878 // Figure out `root` position. 75879 tree.position = { 75880 start: lib_point( 75881 events.length > 0 75882 ? events[0][1].start 75883 : { 75884 line: 1, 75885 column: 1, 75886 offset: 0 75887 } 75888 ), 75889 end: lib_point( 75890 events.length > 0 75891 ? events[events.length - 2][1].end 75892 : { 75893 line: 1, 75894 column: 1, 75895 offset: 0 75896 } 75897 ) 75898 } 75899 75900 // Call transforms. 75901 index = -1 75902 while (++index < config.transforms.length) { 75903 tree = config.transforms[index](tree) || tree 75904 } 75905 return tree 75906 } 75907 75908 /** 75909 * @param {Array<Event>} events 75910 * @param {number} start 75911 * @param {number} length 75912 * @returns {number} 75913 */ 75914 function prepareList(events, start, length) { 75915 let index = start - 1 75916 let containerBalance = -1 75917 let listSpread = false 75918 /** @type {Token | undefined} */ 75919 let listItem 75920 /** @type {number | undefined} */ 75921 let lineIndex 75922 /** @type {number | undefined} */ 75923 let firstBlankLineIndex 75924 /** @type {boolean | undefined} */ 75925 let atMarker 75926 while (++index <= length) { 75927 const event = events[index] 75928 if ( 75929 event[1].type === 'listUnordered' || 75930 event[1].type === 'listOrdered' || 75931 event[1].type === 'blockQuote' 75932 ) { 75933 if (event[0] === 'enter') { 75934 containerBalance++ 75935 } else { 75936 containerBalance-- 75937 } 75938 atMarker = undefined 75939 } else if (event[1].type === 'lineEndingBlank') { 75940 if (event[0] === 'enter') { 75941 if ( 75942 listItem && 75943 !atMarker && 75944 !containerBalance && 75945 !firstBlankLineIndex 75946 ) { 75947 firstBlankLineIndex = index 75948 } 75949 atMarker = undefined 75950 } 75951 } else if ( 75952 event[1].type === 'linePrefix' || 75953 event[1].type === 'listItemValue' || 75954 event[1].type === 'listItemMarker' || 75955 event[1].type === 'listItemPrefix' || 75956 event[1].type === 'listItemPrefixWhitespace' 75957 ) { 75958 // Empty. 75959 } else { 75960 atMarker = undefined 75961 } 75962 if ( 75963 (!containerBalance && 75964 event[0] === 'enter' && 75965 event[1].type === 'listItemPrefix') || 75966 (containerBalance === -1 && 75967 event[0] === 'exit' && 75968 (event[1].type === 'listUnordered' || 75969 event[1].type === 'listOrdered')) 75970 ) { 75971 if (listItem) { 75972 let tailIndex = index 75973 lineIndex = undefined 75974 while (tailIndex--) { 75975 const tailEvent = events[tailIndex] 75976 if ( 75977 tailEvent[1].type === 'lineEnding' || 75978 tailEvent[1].type === 'lineEndingBlank' 75979 ) { 75980 if (tailEvent[0] === 'exit') continue 75981 if (lineIndex) { 75982 events[lineIndex][1].type = 'lineEndingBlank' 75983 listSpread = true 75984 } 75985 tailEvent[1].type = 'lineEnding' 75986 lineIndex = tailIndex 75987 } else if ( 75988 tailEvent[1].type === 'linePrefix' || 75989 tailEvent[1].type === 'blockQuotePrefix' || 75990 tailEvent[1].type === 'blockQuotePrefixWhitespace' || 75991 tailEvent[1].type === 'blockQuoteMarker' || 75992 tailEvent[1].type === 'listItemIndent' 75993 ) { 75994 // Empty 75995 } else { 75996 break 75997 } 75998 } 75999 if ( 76000 firstBlankLineIndex && 76001 (!lineIndex || firstBlankLineIndex < lineIndex) 76002 ) { 76003 listItem._spread = true 76004 } 76005 76006 // Fix position. 76007 listItem.end = Object.assign( 76008 {}, 76009 lineIndex ? events[lineIndex][1].start : event[1].end 76010 ) 76011 events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]) 76012 index++ 76013 length++ 76014 } 76015 76016 // Create a new list item. 76017 if (event[1].type === 'listItemPrefix') { 76018 listItem = { 76019 type: 'listItem', 76020 _spread: false, 76021 start: Object.assign({}, event[1].start), 76022 // @ts-expect-error: weâll add `end` in a second. 76023 end: undefined 76024 } 76025 // @ts-expect-error: `listItem` is most definitely defined, TS... 76026 events.splice(index, 0, ['enter', listItem, event[2]]) 76027 index++ 76028 length++ 76029 firstBlankLineIndex = undefined 76030 atMarker = true 76031 } 76032 } 76033 } 76034 events[start][1]._spread = listSpread 76035 return length 76036 } 76037 76038 /** 76039 * Set data. 76040 * 76041 * @template {keyof CompileData} Key 76042 * Field type. 76043 * @param {Key}
76043 key 76044 * Key of field. 76045 * @param {CompileData[Key]} [value] 76046 * New value. 76047 * @returns {void} 76048 * Nothing. 76049 */ 76050 function setData(key, value) { 76051 data[key] = value 76052 } 76053 76054 /** 76055 * Get data. 76056 * 76057 * @template {keyof CompileData} Key 76058 * Field type. 76059 * @param {Key} key 76060 * Key of field. 76061 * @returns {CompileData[Key]} 76062 * Value. 76063 */ 76064 function getData(key) { 76065 return data[key] 76066 } 76067 76068 /** 76069 * Create an opener handle. 76070 * 76071 * @param {(token: Token) => Node} create 76072 * Create a node. 76073 * @param {Handle} [and] 76074 * Optional function to also run. 76075 * @returns {Handle} 76076 * Handle. 76077 */ 76078 function opener(create, and) { 76079 return open 76080 76081 /** 76082 * @this {CompileContext} 76083 * @param {Token} token 76084 * @returns {void} 76085 */ 76086 function open(token) { 76087 enter.call(this, create(token), token) 76088 if (and) and.call(this, token) 76089 } 76090 } 76091 76092 /** 76093 * @this {CompileContext} 76094 * @returns {void} 76095 */ 76096 function buffer() { 76097 this.stack.push({ 76098 type: 'fragment', 76099 children: [] 76100 }) 76101 } 76102 76103 /** 76104 * @template {Node} Kind 76105 * Node type. 76106 * @this {CompileContext} 76107 * Context. 76108 * @param {Kind} node 76109 * Node to enter. 76110 * @param {Token} token 76111 * Corresponding token. 76112 * @param {OnEnterError | undefined} [errorHandler] 76113 * Handle the case where this token is open, but it is closed by something else. 76114 * @returns {Kind} 76115 * The given node. 76116 */ 76117 function enter(node, token, errorHandler) { 76118 const parent = this.stack[this.stack.length - 1] 76119 // @ts-expect-error: Assume `Node` can exist as a child of `parent`. 76120 parent.children.push(node) 76121 this.stack.push(node) 76122 this.tokenStack.push([token, errorHandler]) 76123 // @ts-expect-error: `end` will be patched later. 76124 node.position = { 76125 start: lib_point(token.start) 76126 } 76127 return node 76128 } 76129 76130 /** 76131 * Create a closer handle. 76132 * 76133 * @param {Handle} [and] 76134 * Optional function to also run. 76135 * @returns {Handle} 76136 * Handle. 76137 */ 76138 function closer(and) { 76139 return close 76140 76141 /** 76142 * @this {CompileContext} 76143 * @param {Token} token 76144 * @returns {void} 76145 */ 76146 function close(token) { 76147 if (and) and.call(this, token) 76148 exit.call(this, token) 76149 } 76150 } 76151 76152 /** 76153 * @this {CompileContext} 76154 * Context. 76155 * @param {Token} token 76156 * Corresponding token. 76157 * @param {OnExitError | undefined} [onExitError] 76158 * Handle the case where another token is open. 76159 * @returns {Node} 76160 * The closed node. 76161 */ 76162 function exit(token, onExitError) { 76163 const node = this.stack.pop() 76164 const open = this.tokenStack.pop() 76165 if (!open) { 76166 throw new Error( 76167 'Cannot close `' + 76168 token.type + 76169 '` (' + 76170 stringifyPosition({ 76171 start: token.start, 76172 end: token.end 76173 }) + 76174 '): itâs not open' 76175 ) 76176 } else if (open[0].type !== token.type) { 76177 if (onExitError) { 76178 onExitError.call(this, token, open[0]) 76179 } else { 76180 const handler = open[1] || defaultOnError 76181 handler.call(this, token, open[0]) 76182 } 76183 } 76184 node.position.end = lib_point(token.end) 76185 return node 76186 } 76187 76188 /** 76189 * @this {CompileContext} 76190 * @returns {string} 76191 */ 76192 function resume() { 76193 return lib_toString(this.stack.pop()) 76194 } 76195 76196 // 76197 // Handlers. 76198 // 76199 76200 /** 76201 * @this {CompileContext} 76202 * @type {Handle} 76203 */ 76204 function onenterlistordered() { 76205 setData('expectingFirstListItemValue', true) 76206 } 76207 76208 /** 76209 * @this {CompileContext} 76210 * @type {Handle} 76211 */ 76212 function onenterlistitemvalue(token) { 76213 if (getData('expectingFirstListItemValue')) { 76214 const ancestor = this.stack[this.stack.length - 2] 76215 ancestor.start = Number.parseInt(this.sliceSerialize(token), 10) 76216 setData('expectingFirstListItemValue') 76217 } 76218 } 76219 76220 /** 76221 * @this {CompileContext} 76222 * @type {Handle} 76223 */ 76224 function onexitcodefencedfenceinfo() { 76225 const data = this.resume() 76226 const node = this.stack[this.stack.length - 1] 76227 node.lang = data 76228 } 76229 76230 /** 76231 * @this {CompileContext} 76232 * @type {Handle} 76233 */
76234 function onexitcodefencedfencemeta() { 76235 const data = this.resume() 76236 const node = this.stack[this.stack.length - 1] 76237 node.meta = data 76238 } 76239 76240 /** 76241 * @this {CompileContext} 76242 * @type {Handle} 76243 */ 76244 function onexitcodefencedfence() { 76245 // Exit if this is the closing fence. 76246 if (getData('flowCodeInside')) return 76247 this.buffer() 76248 setData('flowCodeInside', true) 76249 } 76250 76251 /** 76252 * @this {CompileContext} 76253 * @type {Handle} 76254 */ 76255 function onexitcodefenced() { 76256 const data = this.resume() 76257 const node = this.stack[this.stack.length - 1] 76258 node.value = data.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '') 76259 setData('flowCodeInside') 76260 } 76261 76262 /** 76263 * @this {CompileContext} 76264 * @type {Handle} 76265 */ 76266 function onexitcodeindented() { 76267 const data = this.resume() 76268 const node = this.stack[this.stack.length - 1] 76269 node.value = data.replace(/(\r?\n|\r)$/g, '') 76270 } 76271 76272 /** 76273 * @this {CompileContext} 76274 * @type {Handle} 76275 */ 76276 function onexitdefinitionlabelstring(token) { 76277 const label = this.resume() 76278 const node = this.stack[this.stack.length - 1] 76279 node.label = label 76280 node.identifier = normalizeIdentifier( 76281 this.sliceSerialize(token) 76282 ).toLowerCase() 76283 } 76284 76285 /** 76286 * @this {CompileContext} 76287 * @type {Handle} 76288 */ 76289 function onexitdefinitiontitlestring() { 76290 const data = this.resume() 76291 const node = this.stack[this.stack.length - 1] 76292 node.title = data 76293 } 76294 76295 /** 76296 * @this {CompileContext} 76297 * @type {Handle} 76298 */ 76299 function onexitdefinitiondestinationstring() { 76300 const data = this.resume() 76301 const node = this.stack[this.stack.length - 1] 76302 node.url = data 76303 } 76304 76305 /** 76306 * @this {CompileContext} 76307 * @type {Handle} 76308 */ 76309 function onexitatxheadingsequence(token) { 76310 const node = this.stack[this.stack.length - 1] 76311 if (!node.depth) { 76312 const depth = this.sliceSerialize(token).length 76313 node.depth = depth 76314 } 76315 } 76316 76317 /** 76318 * @this {CompileContext} 76319 * @type {Handle} 76320 */ 76321 function onexitsetextheadingtext() { 76322 setData('setextHeadingSlurpLineEnding', true) 76323 } 76324 76325 /** 76326 * @this {CompileContext} 76327 * @type {Handle} 76328 */ 76329 function onexitsetextheadinglinesequence(token) { 76330 const node = this.stack[this.stack.length - 1]
76331 node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2 76332 } 76333 76334 /** 76335 * @this {CompileContext} 76336 * @type {Handle} 76337 */ 76338 function onexitsetextheading() { 76339 setData('setextHeadingSlurpLineEnding') 76340 } 76341 76342 /** 76343 * @this {CompileContext} 76344 * @type {Handle} 76345 */ 76346 76347 function onenterdata(token) { 76348 const node = this.stack[this.stack.length - 1] 76349 let tail = node.children[node.children.length - 1] 76350 if (!tail || tail.type !== 'text') { 76351 // Add a new text node. 76352 tail = text() 76353 // @ts-expect-error: weâll add `end` later. 76354 tail.position = { 76355 start: lib_point(token.start) 76356 } 76357 // @ts-expect-error: Assume `parent` accepts `text`. 76358 node.children.push(tail) 76359 } 76360 this.stack.push(tail) 76361 } 76362 76363 /** 76364 * @this {CompileContext} 76365 * @type {Handle} 76366 */ 76367 76368 function onexitdata(token) { 76369 const tail = this.stack.pop() 76370 tail.value += this.sliceSerialize(token) 76371 tail.position.end = lib_point(token.end) 76372 } 76373 76374 /** 76375 * @this {CompileContext} 76376 * @type {Handle} 76377 */ 76378 76379 function onexitlineending(token) { 76380 const context = this.stack[this.stack.length - 1] 76381 // If weâre at a hard break, include the line ending in there. 76382 if (getData('atHardBreak')) { 76383 const tail = context.children[context.children.length - 1] 76384 tail.position.end = lib_point(token.end) 76385 setData('atHardBreak') 76386 return 76387 } 76388 if ( 76389 !getData('setextHeadingSlurpLineEnding') && 76390 config.canContainEols.includes(context.type) 76391 ) { 76392 onenterdata.call(this, token) 76393 onexitdata.call(this, token) 76394 } 76395 } 76396 76397 /** 76398 * @this {CompileContext} 76399 * @type {Handle} 76400 */ 76401 76402 function onexithardbreak() { 76403 setData('atHardBreak', true) 76404 } 76405 76406 /** 76407 * @this {CompileContext} 76408 * @type {Handle} 76409 */ 76410 76411 function onexithtmlflow() { 76412 const data = this.resume() 76413 const node = this.stack[this.stack.length - 1] 76414 node.value = data 76415 } 76416 76417 /** 76418 * @this {CompileContext} 76419 * @type {Handle} 76420 */ 76421 76422 function onexithtmltext() { 76423 const data = this.resume() 76424 const node = this.stack[this.stack.length - 1] 76425 node.value = data 76426 } 76427 76428 /** 76429 * @this {CompileContext} 76430 * @type {Handle} 76431 */ 76432 76433 function onexitcodetext() { 76434 const data = this.resume() 76435 const node = this.stack[this.stack.length - 1] 76436 node.value = data 76437 } 76438 76439 /** 76440 * @this {CompileContext} 76441 * @type {Handle} 76442 */ 76443 76444 function onexitlink() { 76445 const node = this.stack[this.stack.length - 1] 76446 // Note: there are also `identifier` and `label` fields on this link node! 76447 // These are used / cleaned here. 76448 // To do: clean. 76449 if (getData('inReference')) { 76450 /** @type {ReferenceType} */ 76451 const referenceType = getData('referenceType') || 'shortcut' 76452 node.type += 'Reference' 76453 // @ts-expect-error: mutate. 76454 node.referenceType = referenceType 76455 // @ts-expect-error: mutate. 76456 delete node.url 76457 delete node.title 76458 } else { 76459 // @ts-expect-error: mutate. 76460 delete node.identifier 76461 // @ts-expect-error: mutate. 76462 delete node.label 76463 } 76464 setData('referenceType') 76465 } 76466 76467 /** 76468 * @this {CompileContext} 76469 * @type {Handle} 76470 */ 76471 76472 function onexitimage() { 76473 const node = this.stack[this.stack.length - 1] 76474 // Note: there are also `identifier` and `label` fields on this link node! 76475 // These are used / cleaned here. 76476 // To do: clean. 76477 if (getData('inReference')) { 76478 /** @type {ReferenceType} */ 76479 const referenceType = getData('referenceType') || 'shortcut' 76480 node.type += 'Reference' 76481 // @ts-expect-error: mutate. 76482 node.referenceType = referenceType 76483 // @ts-expect-error: mutate. 76484 delete node.url 76485 delete node.title 76486 } else { 76487 // @ts-expect-error: mutate. 76488 delete node.identifier 76489 // @ts-expect-error: mutate. 76490 delete node.label 76491 } 76492 setData('referenceType') 76493 } 76494 76495 /** 76496 * @this {CompileContext} 76497 * @type {Handle} 76498 */ 76499 76500 function onexitlabeltext(token) { 76501 const string = this.sliceSerialize(token) 76502 const ancestor = this.stack[this.stack.length - 2] 76503 // @ts-expect-error: stash this on the node, as it might become a reference 76504 // later. 76505 ancestor.label = decodeString(string) 76506 // @ts-expect-error: same as above. 76507 ancestor.identifier = normalizeIdentifier(string).toLowerCase() 76508 } 76509 76510 /** 76511 * @this {CompileContext} 76512 * @type {Handle} 76513 */ 76514 76515 function onexitlabel() { 76516 const fragment = this.stack[this.stack.length - 1] 76517 const value = this.resume() 76518 const node = this.stack[this.stack.length - 1] 76519 // Assume a reference. 76520 setData('inReference', true) 76521 if (node.type === 'link') { 76522 /** @type {Array<StaticPhrasingContent>} */ 76523 // @ts-expect-error: Assume static phrasing content. 76524 const children = fragment.children 76525 node.children = children 76526 } else { 76527 node.alt = value 76528 } 76529 } 76530 76531 /** 76532 * @this {CompileContext} 76533 * @type {Handle} 76534 */ 76535 76536 function onexitresourcedestinationstring() { 76537 const data = this.resume() 76538 const node = this.stack[this.stack.length - 1] 76539 node.url = data 76540 } 76541 76542 /** 76543 * @this {CompileContext} 76544 * @type {Handle} 76545 */ 76546 76547 function onexitresourcetitlestring() { 76548 const data = this.resume() 76549 const node = this.stack[this.stack.length - 1] 76550 node.title = data 76551 } 76552 76553 /** 76554 * @this {CompileContext} 76555 * @type {Handle} 76556 */ 76557 76558 function onexitresource() { 76559 setData('inReference') 76560 } 76561 76562 /** 76563 * @this {CompileContext} 76564 * @type {Handle} 76565 */ 76566 76567 function onenterreference() { 76568 setData('referenceType', 'collapsed') 76569 } 76570 76571 /** 76572 * @this {CompileContext} 76573 * @type {Handle} 76574 */ 76575 76576 function onexitreferencestring(token) { 76577 const label = this.resume() 76578 const node = this.stack[this.stack.length - 1] 76579 // @ts-expect-error: stash this on the node, as it might become a reference 76580 // later. 76581 node.label = label 76582 // @ts-expect-error: same as above. 76583 node.identifier = normalizeIdentifier( 76584 this.sliceSerialize(token) 76585 ).toLowerCase() 76586 setData('referenceType', 'full') 76587 } 76588 76589 /** 76590 * @this {CompileContext} 76591 * @type {Handle} 76592 */ 76593 76594 function onexitcharacterreferencemarker(token) { 76595 setData('characterReferenceType', token.type) 76596 } 76597 76598 /** 76599 * @this {CompileContext} 76600 * @type {Handle} 76601 */ 76602 function onexitcharacterreferencevalue(token) { 76603 const data = this.sliceSerialize(token) 76604 const type = getData('characterReferenceType') 76605 /** @type {string} */ 76606 let value 76607 if (type) { 76608 value = decodeNumericCharacterReference( 76609 data, 76610 type === 'characterReferenceMarkerNumeric' ? 10 : 16 76611 ) 76612 setData('characterReferenceType') 76613 } else { 76614 const result = decodeNamedCharacterReference(data) 76615 value = result 76616 } 76617 const tail = this.stack.pop() 76618 tail.value += value 76619 tail.position.end = lib_point(token.end) 76620 } 76621 76622 /** 76623 * @this {CompileContext} 76624 * @type {Handle} 76625 */ 76626 function onexitautolinkprotocol(token) { 76627 onexitdata.call(this, token) 76628 const node = this.stack[this.stack.length - 1] 76629 node.url = this.sliceSerialize(token) 76630 } 76631 76632 /** 76633 * @this {CompileContext} 76634 * @type {Handle} 76635 */ 76636 function onexitautolinkemail(token) { 76637 onexitdata.call(this, token) 76638 const node = this.stack[this.stack.length - 1] 76639 node.url = 'mailto:' + this.sliceSerialize(token) 76640 } 76641 76642 // 76643 // Creaters. 76644 // 76645 76646 /** @returns {Blockquote} */ 76647 function blockQuote() { 76648 return { 76649 type: 'blockquote', 76650 children: [] 76651 } 76652 } 76653 76654 /** @returns {Code} */ 76655 function codeFlow() { 76656 return { 76657 type: 'code', 76658 lang: null, 76659 meta: null, 76660 value: '' 76661 } 76662 } 76663 76664 /** @returns {InlineCode} */ 76665 function codeText() { 76666 return { 76667 type: 'inlineCode', 76668 value: '' 76669 } 76670 } 76671 76672 /** @returns {Definition} */ 76673 function definition() { 76674 return { 76675 type: 'definition', 76676 identifier: '', 76677 label: null, 76678 title: null, 76679 url: '' 76680 } 76681 } 76682 76683 /** @returns {Emphasis} */ 76684 function emphasis() { 76685 return { 76686 type: 'emphasis', 76687 children: [] 76688 } 76689 } 76690 76691 /** @returns {Heading} */ 76692 function heading() { 76693 // @ts-expect-error `depth` will be set later. 76694 return { 76695 type: 'heading', 76696 depth: undefined, 76697 children: [] 76698 } 76699 } 76700 76701 /** @returns {Break} */ 76702 function hardBreak() { 76703 return { 76704 type: 'break' 76705 } 76706 } 76707 76708 /** @returns {HTML} */ 76709 function html() { 76710 return { 76711 type: 'html', 76712 value: '' 76713 } 76714 } 76715 76716 /** @returns {Image} */ 76717 function image() { 76718 return { 76719 type: 'image', 76720 title: null, 76721 url: '', 76722 alt: null 76723 } 76724 } 76725 76726 /** @returns {Link} */ 76727 function link() { 76728 return { 76729 type: 'link', 76730 title: null, 76731 url: '', 76732 children: [] 76733 } 76734 } 76735 76736 /** 76737 * @param {Token} token 76738 * @returns {List} 76739 */ 76740 function list(token) { 76741 return { 76742 type: 'list', 76743 ordered: token.type === 'listOrdered', 76744 start: null, 76745 spread: token._spread, 76746 children: [] 76747 } 76748 } 76749 76750 /** 76751 * @param {Token} token 76752 * @returns {ListItem} 76753 */ 76754 function listItem(token) { 76755 return { 76756 type: 'listItem', 76757 spread: token._spread, 76758 checked: null, 76759 children: [] 76760 } 76761 } 76762 76763 /** @returns {Paragraph} */ 76764 function paragraph() { 76765 return { 76766 type: 'paragraph', 76767 children: [] 76768 } 76769 } 76770 76771 /** @returns {Strong} */ 76772 function strong() { 76773 return { 76774 type: 'strong', 76775 children: [] 76776 } 76777 } 76778 76779 /** @returns {Text} */ 76780 function text() { 76781 return { 76782 type: 'text', 76783 value: '' 76784 } 76785 } 76786 76787 /** @returns {ThematicBreak} */ 76788 function thematicBreak() { 76789 return { 76790 type: 'thematicBreak' 76791 } 76792 } 76793} 76794 76795/** 76796 * Copy a point-like value. 76797 * 76798 * @param {Point} d 76799 * Point-like value. 76800 * @returns {Point} 76801 * unist point. 76802 */ 76803function lib_point(d) { 76804 return { 76805 line: d.line, 76806 column: d.column, 76807 offset: d.offset 76808 } 76809} 76810 76811/** 76812 * @param {Config} combined 76813 * @param {Array<Extension | Array<Extension>>} extensions 76814 * @returns {void} 76815 */ 76816function configure(combined, extensions) { 76817 let index = -1 76818 while (++index < extensions.length) { 76819 const value = extensions[index] 76820 if (Array.isArray(value)) { 76821 configure(combined, value) 76822 } else { 76823 extension(combined, value) 76824 } 76825 } 76826} 76827 76828/** 76829 * @param {Config} combined 76830 * @param {Extension} extension 76831 * @returns {void} 76832 */ 76833function extension(combined, extension) { 76834 /** @type {keyof Extension} */ 76835 let key 76836 for (key in extension) { 76837 if (lib_own.call(extension, key)) { 76838 if (key === 'canContainEols') { 76839 const right = extension[key] 76840 if (right) { 76841 combined[key].push(...right) 76842 } 76843 } else if (key === 'transforms') { 76844 const right = extension[key] 76845 if (right) { 76846 combined[key].push(...right) 76847 } 76848 } else if (key === 'enter' || key === 'exit') { 76849 const right = extension[key] 76850 if (right) { 76851 Object.assign(combined[key], right) 76852 } 76853 } 76854 } 76855 } 76856} 76857 76858/** @type {OnEnterError} */ 76859function defaultOnError(left, right) { 76860 if (left) { 76861 throw new Error( 76862 'Cannot close `' + 76863 left.type + 76864 '` (' +
76865 stringifyPosition({ 76866 start: left.start, 76867 end: left.end 76868 }) + 76869 '): a different token (`' + 76870 right.type + 76871 '`, ' + 76872 stringifyPosition({ 76873 start: right.start, 76874 end: right.end 76875 }) + 76876 ') is open' 76877 ) 76878 } else { 76879 throw new Error( 76880 'Cannot close document, a token (`' + 76881 right.type + 76882 '`, ' + 76883 stringifyPosition({ 76884 start: right.start, 76885 end: right.end 76886 }) + 76887 ') is still open' 76888 ) 76889 } 76890} 76891 76892;// ./node_modules/remark-parse/lib/index.js 76893/** 76894 * @typedef {import('mdast').Root} Root 76895 * @typedef {import('mdast-util-from-markdown').Options} Options 76896 */ 76897 76898 76899 76900/** 76901 * @this {import('unified').Processor} 76902 * @type {import('unified').Plugin<[Options?] | void[], string, Root>} 76903 */ 76904function remarkParse(options) { 76905 /** @type {import('unified').ParserFunction<Root>} */ 76906 const parser = (doc) => { 76907 // Assume options. 76908 const settings = /** @type {Options} */ (this.data('settings')) 76909 76910 return fromMarkdown( 76911 doc, 76912 Object.assign({}, settings, options, { 76913 // Note: these options are not in the readme. 76914 // The goal is for them to be set by plugins on `data` instead of being 76915 // passed by users. 76916 extensions: this.data('micromarkExtensions') || [], 76917 mdastExtensions: this.data('fromMarkdownExtensions') || [] 76918 }) 76919 ) 76920 } 76921 76922 Object.assign(this, {Parser: parser}) 76923} 76924 76925;// ./node_modules/micromark-util-sanitize-uri/index.js 76926/* unused harmony import specifier */ var encode; 76927 76928 76929/** 76930 * Make a value safe for injection as a URL. 76931 * 76932 * This encodes unsafe characters with percent-encoding and skips already 76933 * encoded sequences (see `normalizeUri`). 76934 * Further unsafe characters are encoded as character references (see 76935 * `micromark-util-encode`). 76936 * 76937 * A regex of allowed protocols can be given, in which case the URL is 76938 * sanitized. 76939 * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or 76940 * `/^https?$/i` for `img[src]` (this is what `github.com` allows). 76941 * If the URL includes an unknown protocol (one not matched by `protocol`, such 76942 * as a dangerous example, `javascript:`), the value is ignored. 76943 * 76944 * @param {string | undefined} url 76945 * URI to sanitize. 76946 * @param {RegExp | null | undefined} [protocol] 76947 * Allowed protocols. 76948 * @returns {string} 76949 * Sanitized URI. 76950 */ 76951function sanitizeUri(url, protocol) { 76952 const value = encode(normalizeUri(url || '')) 76953 if (!protocol) { 76954 return value 76955 } 76956 const colon = value.indexOf(':') 76957 const questionMark = value.indexOf('?') 76958 const numberSign = value.indexOf('#') 76959 const slash = value.indexOf('/') 76960 if ( 76961 // If there is no protocol, itâs relative. 76962 colon < 0 || 76963 // If the first colon is after a `?`, `#`, or `/`, itâs not a protocol. 76964 (slash > -1 && colon > slash) || 76965 (questionMark > -1 && colon > questionMark) || 76966 (numberSign > -1 && colon > numberSign) || 76967 // It is a protocol, it should be allowed. 76968 protocol.test(value.slice(0, colon)) 76969 ) { 76970 return value 76971 } 76972 return '' 76973} 76974 76975/** 76976 * Normalize a URL. 76977 * 76978 * Encode unsafe characters with percent-encoding, skipping already encoded 76979 * sequences. 76980 * 76981 * @param {string} value 76982 * URI to normalize. 76983 * @returns {string} 76984 * Normalized URI. 76985 */ 76986function normalizeUri(value) { 76987 /** @type {Array<string>} */ 76988 const result = [] 76989 let index = -1 76990 let start = 0 76991 let skip = 0 76992 while (++index < value.length) { 76993 const code = value.charCodeAt(index) 76994 /** @type {string} */ 76995 let replace = '' 76996 76997 // A correct percent encoded value. 76998 if ( 76999 code === 37 && 77000 asciiAlphanumeric(value.charCodeAt(index + 1)) && 77001 asciiAlphanumeric(value.charCodeAt(index + 2)) 77002 ) { 77003 skip = 2 77004 } 77005 // ASCII. 77006 else if (code < 128) { 77007 if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) { 77008 replace = String.fromCharCode(code) 77009 } 77010 } 77011 // Astral. 77012 else if (code > 55295 && code < 57344) { 77013 const next = value.charCodeAt(index + 1) 77014 77015 // A correct surrogate pair. 77016 if (code < 56320 && next > 56319 && next < 57344) { 77017 replace = String.fromCharCode(code, next) 77018 skip = 1 77019 } 77020 // Lone surrogate. 77021 else { 77022 replace = '\uFFFD' 77023 } 77024 } 77025 // Unicode. 77026 else { 77027 replace = String.fromCharCode(code) 77028 } 77029 if (replace) { 77030 result.push(value.slice(start, index), encodeURIComponent(replace))
77031 start = index + skip + 1 77032 replace = '' 77033 } 77034 if (skip) { 77035 index += skip 77036 skip = 0 77037 } 77038 } 77039 return result.join('') + value.slice(start) 77040} 77041 77042;// ./node_modules/mdast-util-to-hast/lib/footer.js 77043/** 77044 * @typedef {import('hast').Element} Element 77045 * @typedef {import('hast').ElementContent} ElementContent 77046 * 77047 * @typedef {import('./state.js').State} State 77048 */ 77049 77050 77051 77052/** 77053 * Generate a hast footer for called footnote definitions. 77054 * 77055 * @param {State} state 77056 * Info passed around. 77057 * @returns {Element | undefined} 77058 * `section` element or `undefined`. 77059 */ 77060function footer(state) { 77061 /** @type {Array<ElementContent>} */ 77062 const listItems = [] 77063 let index = -1 77064 77065 while (++index < state.footnoteOrder.length) { 77066 const def = state.footnoteById[state.footnoteOrder[index]] 77067 77068 if (!def) { 77069 continue 77070 } 77071 77072 const content = state.all(def) 77073 const id = String(def.identifier).toUpperCase() 77074 const safeId = normalizeUri(id.toLowerCase()) 77075 let referenceIndex = 0 77076 /** @type {Array<ElementContent>} */ 77077 const backReferences = [] 77078 77079 while (++referenceIndex <= state.footnoteCounts[id]) { 77080 /** @type {Element} */ 77081 const backReference = { 77082 type: 'element', 77083 tagName: 'a', 77084 properties: { 77085 href: 77086 '#' + 77087 state.clobberPrefix + 77088 'fnref-' + 77089 safeId + 77090 (referenceIndex > 1 ? '-' + referenceIndex : ''), 77091 dataFootnoteBackref: true, 77092 className: ['data-footnote-backref'], 77093 ariaLabel: state.footnoteBackLabel 77094 }, 77095 children: [{type: 'text', value: 'â©'}] 77096 } 77097 77098 if (referenceIndex > 1) { 77099 backReference.children.push({ 77100 type: 'element', 77101 tagName: 'sup', 77102 children: [{type: 'text', value: String(referenceIndex)}] 77103 }) 77104 } 77105 77106 if (backReferences.length > 0) { 77107 backReferences.push({type: 'text', value: ' '}) 77108 } 77109 77110 backReferences.push(backReference) 77111 } 77112 77113 const tail = content[content.length - 1] 77114 77115 if (tail && tail.type === 'element' && tail.tagName === 'p') { 77116 const tailTail = tail.children[tail.children.length - 1] 77117 if (tailTail && tailTail.type === 'text') { 77118 tailTail.value += ' ' 77119 } else { 77120 tail.children.push({type: 'text', value: ' '}) 77121 } 77122 77123 tail.children.push(...backReferences) 77124 } else { 77125 content.push(...backReferences) 77126 } 77127 77128 /** @type {Element} */ 77129 const listItem = { 77130 type: 'element', 77131 tagName: 'li', 77132 properties: {id: state.clobberPrefix + 'fn-' + safeId}, 77133 children: state.wrap(content, true) 77134 } 77135 77136 state.patch(def, listItem) 77137 77138 listItems.push(listItem) 77139 } 77140 77141 if (listItems.length === 0) { 77142 return 77143 } 77144 77145 return { 77146 type: 'element', 77147 tagName: 'section', 77148 properties: {dataFootnotes: true, className: ['footnotes']}, 77149 children: [ 77150 { 77151 type: 'element', 77152 tagName: state.footnoteLabelTagName, 77153 properties: { 77154 // To do: use structured clone. 77155 ...JSON.parse(JSON.stringify(state.footnoteLabelProperties)), 77156 id: 'footnote-label' 77157 }, 77158 children: [{type: 'text', value: state.footnoteLabel}] 77159 }, 77160 {type: 'text', value: '\n'}, 77161 { 77162 type: 'element', 77163 tagName: 'ol', 77164 properties: {}, 77165 children: state.wrap(listItems, true) 77166 }, 77167 {type: 'text', value: '\n'} 77168 ] 77169 } 77170} 77171 77172;// ./node_modules/unist-util-is/lib/index.js 77173/** 77174 * @typedef {import('unist').Node} Node 77175 * @typedef {import('unist').Parent} Parent 77176 */ 77177 77178/** 77179 * @typedef {Record<string, unknown>} Props 77180 * @typedef {null | undefined | string | Props | TestFunctionAnything | Array<string | Props | TestFunctionAnything>} Test 77181 * Check for an arbitrary node, unaware of TypeScript inferral. 77182 * 77183 * @callback TestFunctionAnything 77184 * Check if a node passes a test, unaware of TypeScript inferral. 77185 * @param {unknown} this 77186 * The given context. 77187 * @param {Node} node 77188 * A node. 77189 * @param {number | null | undefined} [index] 77190 * The nodeâs position in its parent. 77191 * @param {Parent | null | undefined} [parent] 77192 * The nodeâs parent. 77193 * @returns {boolean | void} 77194 * Whether this node passes the test. 77195 */ 77196 77197/** 77198 * @template {Node} Kind 77199 * Node type. 77200 * @typedef {Kind['type'] | Partial<Kind> | TestFunctionPredicate<Kind> | Array<Kind['type'] | Partial<Kind> | TestFunctionPredicate<Kind>>} PredicateTest 77201 * Check for a node that can be inferred by TypeScript. 77202 */ 77203 77204/** 77205 * Check if a node passes a certain test. 77206 * 77207 * @template {Node} Kind 77208 * Node type. 77209 * @callback TestFunctionPredicate 77210 * Complex test function for a node that can be inferred by TypeScript. 77211 * @param {Node} node 77212 * A node. 77213 * @param {number | null | undefined} [index] 77214 * The nodeâs position in its parent. 77215 * @param {Parent | null | undefined} [parent] 77216 * The nodeâs parent. 77217 * @returns {node is Kind} 77218 * Whether this node passes the test. 77219 */ 77220 77221/** 77222 * @callback AssertAnything 77223 * Check that an arbitrary value is a node, unaware of TypeScript inferral. 77224 * @param {unknown} [node] 77225 * Anything (typically a node). 77226 * @param {number | null | undefined} [index] 77227 * The nodeâs position in its parent. 77228 * @param {Parent | null | undefined} [parent] 77229 * The nodeâs parent. 77230 * @returns {boolean} 77231 * Whether this is a node and passes a test. 77232 */ 77233 77234/**
77235 * Check if a node is a node and passes a certain node test. 77236 * 77237 * @template {Node} Kind 77238 * Node type. 77239 * @callback AssertPredicate 77240 * Check that an arbitrary value is a specific node, aware of TypeScript. 77241 * @param {unknown} [node] 77242 * Anything (typically a node). 77243 * @param {number | null | undefined} [index] 77244 * The nodeâs position in its parent. 77245 * @param {Parent | null | undefined} [parent] 77246 * The nodeâs parent. 77247 * @returns {node is Kind} 77248 * Whether this is a node and passes a test. 77249 */ 77250 77251/** 77252 * Check if `node` is a `Node` and whether it passes the given test. 77253 * 77254 * @param node 77255 * Thing to check, typically `Node`. 77256 * @param test 77257 * A check for a specific node. 77258 * @param index 77259 * The nodeâs position in its parent. 77260 * @param parent 77261 * The nodeâs parent. 77262 * @returns 77263 * Whether `node` is a node and passes a test. 77264 */ 77265const is = 77266 /** 77267 * @type {( 77268 * (() => false) & 77269 * (<Kind extends Node = Node>(node: unknown, test: PredicateTest<Kind>, index: number, parent: Parent, context?: unknown) => node is Kind) & 77270 * (<Kind extends Node = Node>(node: unknown, test: PredicateTest<Kind>, index?: null | undefined, parent?: null | undefined, context?: unknown) => node is Kind) & 77271 * ((node: unknown, test: Test, index: number, parent: Parent, context?: unknown) => boolean) & 77272 * ((node: unknown, test?: Test, index?: null | undefined, parent?: null | undefined, context?: unknown) => boolean) 77273 * )} 77274 */ 77275 ( 77276 /** 77277 * @param {unknown} [node] 77278 * @param {Test} [test] 77279 * @param {number | null | undefined} [index] 77280 * @param {Parent | null | undefined} [parent] 77281 * @param {unknown} [context] 77282 * @returns {boolean} 77283 */ 77284 // eslint-disable-next-line max-params 77285 function is(node, test, index, parent, context) { 77286 const check = convert(test) 77287 77288 if ( 77289 index !== undefined && 77290 index !== null && 77291 (typeof index !== 'number' || 77292 index < 0 || 77293 index === Number.POSITIVE_INFINITY) 77294 ) { 77295 throw new Error('Expected positive finite index') 77296 } 77297 77298 if ( 77299 parent !== undefined && 77300 parent !== null && 77301 (!is(parent) || !parent.children) 77302 ) { 77303 throw new Error('Expected parent node') 77304 } 77305 77306 if ( 77307 (parent === undefined || parent === null) !== 77308 (index === undefined || index === null) 77309 ) { 77310 throw new Error('Expected both parent and index') 77311 } 77312 77313 // @ts-expect-error Looks like a node. 77314 return node && node.type && typeof node.type === 'string' 77315 ? Boolean(check.call(context, node, index, parent)) 77316 : false 77317 } 77318 ) 77319 77320/** 77321 * Generate an assertion from a test. 77322 * 77323 * Useful if youâre going to test many nodes, for example when creating a 77324 * utility where something else passes a compatible test. 77325 * 77326 * The created function is a bit faster because it expects valid input only: 77327 * a `node`, `index`, and `parent`. 77328 * 77329 * @param test 77330 * * when nullish, checks if `node` is a `Node`. 77331 * * when `string`, works like passing `(node) => node.type === test`. 77332 * * when `function` checks if function passed the node is true. 77333 * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values. 77334 * * when `array`, checks if any one of the subtests pass. 77335 * @returns 77336 * An assertion. 77337 */ 77338const convert = 77339 /** 77340 * @type {( 77341 * (<Kind extends Node>(test: PredicateTest<Kind>) => AssertPredicate<Kind>) & 77342 * ((test?: Test) => AssertAnything) 77343 * )} 77344 */ 77345 ( 77346 /** 77347 * @param {Test} [test] 77348 * @returns {AssertAnything} 77349 */ 77350 function (test) { 77351 if (test === undefined || test === null) { 77352 return ok 77353 } 77354 77355 if (typeof test === 'string') { 77356 return typeFactory(test) 77357 } 77358 77359 if (typeof test === 'object') { 77360 return Array.isArray(test) ? anyFactory(test) : propsFactory(test) 77361 } 77362 77363 if (typeof test === 'function') { 77364 return castFactory(test) 77365 } 77366 77367 throw new Error('Expected function, string, or object as test') 77368 } 77369 ) 77370 77371/** 77372 * @param {Array<string | Props | TestFunctionAnything>} tests 77373 * @returns {AssertAnything} 77374 */ 77375function anyFactory(tests) { 77376 /** @type {Array<AssertAnything>} */ 77377 const checks = [] 77378 let index = -1 77379 77380 while (++index < tests.length) { 77381 checks[index] = convert(tests[index]) 77382 } 77383 77384 return castFactory(any) 77385 77386 /** 77387 * @this {unknown} 77388 * @param {Array<unknown>} parameters 77389 * @returns {boolean} 77390 */ 77391 function any(...parameters) { 77392 let index = -1 77393 77394 while (++index < checks.length) { 77395 if (checks[index].call(this, ...parameters)) return true 77396 } 77397 77398 return false 77399 } 77400} 77401 77402/** 77403 * Turn an object into a test for a node with a certain fields. 77404 * 77405 * @param {Props}
77405 check 77406 * @returns {AssertAnything} 77407 */ 77408function propsFactory(check) { 77409 return castFactory(all) 77410 77411 /** 77412 * @param {Node} node 77413 * @returns {boolean} 77414 */ 77415 function all(node) { 77416 /** @type {string} */ 77417 let key 77418 77419 for (key in check) { 77420 // @ts-expect-error: hush, it sure works as an index. 77421 if (node[key] !== check[key]) return false 77422 } 77423 77424 return true 77425 } 77426} 77427 77428/** 77429 * Turn a string into a test for a node with a certain type. 77430 * 77431 * @param {string} check 77432 * @returns {AssertAnything} 77433 */ 77434function typeFactory(check) { 77435 return castFactory(type) 77436 77437 /** 77438 * @param {Node} node 77439 */ 77440 function type(node) { 77441 return node && node.type === check 77442 } 77443} 77444 77445/** 77446 * Turn a custom test into a test for a node that passes that test. 77447 * 77448 * @param {TestFunctionAnything} check 77449 * @returns {AssertAnything} 77450 */ 77451function castFactory(check) { 77452 return assertion 77453 77454 /** 77455 * @this {unknown} 77456 * @param {unknown} node 77457 * @param {Array<unknown>} parameters 77458 * @returns {boolean} 77459 */ 77460 function assertion(node, ...parameters) { 77461 return Boolean( 77462 node && 77463 typeof node === 'object' && 77464 'type' in node && 77465 // @ts-expect-error: fine. 77466 Boolean(check.call(this, node, ...parameters)) 77467 ) 77468 } 77469} 77470 77471function ok() { 77472 return true 77473} 77474 77475;// ./node_modules/unist-util-visit-parents/lib/color.browser.js 77476/** 77477 * @param {string} d 77478 * @returns {string} 77479 */ 77480function color(d) { 77481 return d 77482} 77483 77484;// ./node_modules/unist-util-visit-parents/lib/index.js 77485/** 77486 * @typedef {import('unist').Node} Node 77487 * @typedef {import('unist').Parent} Parent 77488 * @typedef {import('unist-util-is').Test} Test 77489 */ 77490 77491/** 77492 * @typedef {boolean | 'skip'} Action 77493 * Union of the action types. 77494 * 77495 * @typedef {number} Index 77496 * Move to the sibling at `index` next (after node itself is completely 77497 * traversed). 77498 * 77499 * Useful if mutating the tree, such as removing the node the visitor is 77500 * currently on, or any of its previous siblings. 77501 * Results less than 0 or greater than or equal to `children.length` stop 77502 * traversing the parent. 77503 * 77504 * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple 77505 * List with one or two values, the first an action, the second an index. 77506 * 77507 * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult 77508 * Any value that can be returned from a visitor. 77509 */ 77510 77511/** 77512 * @template {Node} [Visited=Node] 77513 * Visited node type. 77514 * @template {Parent} [Ancestor=Parent] 77515 * Ancestor type. 77516 * @callback Visitor 77517 * Handle a node (matching `test`, if given). 77518 * 77519 * Visitors are free to transform `node`. 77520 * They can also transform the parent of node (the last of `ancestors`). 77521 * 77522 * Replacing `node` itself, if `SKIP` is not returned, still causes its 77523 * descendants to be walked (which is a bug). 77524 * 77525 * When adding or removing previous siblings of `node` (or next siblings, in 77526 * case of reverse), the `Visitor` should return a new `Index` to specify the 77527 * sibling to traverse after `node` is traversed. 77528 * Adding or removing next siblings of `node` (or previous siblings, in case 77529 * of reverse) is handled as expected without needing to return a new `Index`. 77530 * 77531 * Removing the children property of an ancestor still results in them being 77532 * traversed. 77533 * @param {Visited} node 77534 * Found node. 77535 * @param {Array<Ancestor>} ancestors 77536 * Ancestors of `node`. 77537 * @returns {VisitorResult} 77538 * What to do next. 77539 * 77540 * An `Index` is treated as a tuple of `[CONTINUE, Index]`. 77541 * An `Action` is treated as a tuple of `[Action]`. 77542 * 77543 * Passing a tuple back only makes sense if the `Action` is `SKIP`. 77544 * When the `Action` is `EXIT`, that action can be returned. 77545 * When the `Action` is `CONTINUE`, `Index` can be returned. 77546 */ 77547 77548/** 77549 * @template {Node} [Tree=Node] 77550 * Tree type. 77551 * @template {Test} [Check=string] 77552 * Test type. 77553 * @typedef {Visitor<import('./complex-types.js').Matches<import('./complex-types.js').InclusiveDescendant<Tree>, Check>, Extract<import('./complex-types.js').InclusiveDescendant<Tree>, Parent>>} BuildVisitor 77554 * Build a typed `Visitor` function from a tree and a test. 77555 * 77556 * It will infer which values are passed as `node` and which as `parents`. 77557 */ 77558 77559 77560 77561 77562/** 77563 * Continue traversing as normal. 77564 */ 77565const CONTINUE = true 77566 77567/** 77568 * Stop traversing immediately. 77569 */ 77570const EXIT = false 77571 77572/** 77573 * Do not traverse this nodeâs children. 77574 */ 77575const SKIP = 'skip' 77576 77577/** 77578 * Visit nodes, with ancestral information. 77579 * 77580 * This algorithm performs *depth-first* *tree traversal* in *preorder* 77581 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). 77582 * 77583 * You can choose for which nodes `visitor` is called by passing a `test`. 77584 * For complex tests, you should test yourself in `visitor`, as it will be 77585 * faster and will have improved type information. 77586 * 77587 * Walking the tree is an intensive task. 77588 * Make use of the return values of the visitor when possible. 77589 * Instead of walking a tree multiple times, walk it once, use `unist-util-is` 77590 * to check if a node matches, and then perform different operations. 77591 * 77592 * You can change the tree. 77593 * See `Visitor` for more info. 77594 * 77595 * @param tree 77596 * Tree to traverse. 77597 * @param test 77598 * `unist-util-is`-compatible test 77599 * @param visitor 77600 * Handle each node. 77601 * @param reverse 77602 * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). 77603 * @returns 77604 * Nothing. 77605 */ 77606const visitParents = 77607 /** 77608 * @type {( 77609 * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: BuildVisitor<Tree, Check>, reverse?: boolean | null | undefined) => void) & 77610 * (<Tree extends Node>(tree: Tree, visitor: BuildVisitor<Tree>, reverse?: boolean | null | undefined) => void) 77611 * )} 77612 */ 77613 ( 77614 /** 77615 * @param {Node} tree 77616 * @param {Test} test 77617 * @param {Visitor<Node>} visitor
77618 * @param {boolean | null | undefined} [reverse] 77619 * @returns {void} 77620 */ 77621 function (tree, test, visitor, reverse) { 77622 if (typeof test === 'function' && typeof visitor !== 'function') { 77623 reverse = visitor 77624 // @ts-expect-error no visitor given, so `visitor` is test. 77625 visitor = test 77626 test = null 77627 } 77628 77629 const is = convert(test) 77630 const step = reverse ? -1 : 1 77631 77632 factory(tree, undefined, [])() 77633 77634 /** 77635 * @param {Node} node 77636 * @param {number | undefined} index 77637 * @param {Array<Parent>} parents 77638 */ 77639 function factory(node, index, parents) { 77640 /** @type {Record<string, unknown>} */ 77641 // @ts-expect-error: hush 77642 const value = node && typeof node === 'object' ? node : {} 77643 77644 if (typeof value.type === 'string') { 77645 const name = 77646 // `hast` 77647 typeof value.tagName === 'string' 77648 ? value.tagName 77649 : // `xast` 77650 typeof value.name === 'string' 77651 ? value.name 77652 : undefined 77653 77654 Object.defineProperty(visit, 'name', { 77655 value: 77656 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')' 77657 }) 77658 } 77659 77660 return visit 77661 77662 function visit() { 77663 /** @type {ActionTuple} */ 77664 let result = [] 77665 /** @type {ActionTuple} */ 77666 let subresult 77667 /** @type {number} */ 77668 let offset 77669 /** @type {Array<Parent>} */ 77670 let grandparents 77671 77672 if (!test || is(node, index, parents[parents.length - 1] || null)) { 77673 result = toResult(visitor(node, parents)) 77674 77675 if (result[0] === EXIT) { 77676 return result 77677 } 77678 } 77679 77680 // @ts-expect-error looks like a parent. 77681 if (node.children && result[0] !== SKIP) { 77682 // @ts-expect-error looks like a parent. 77683 offset = (reverse ? node.children.length : -1) + step 77684 // @ts-expect-error looks like a parent. 77685 grandparents = parents.concat(node) 77686 77687 // @ts-expect-error looks like a parent. 77688 while (offset > -1 && offset < node.children.length) { 77689 // @ts-expect-error looks like a parent. 77690 subresult = factory(node.children[offset], offset, grandparents)() 77691 77692 if (subresult[0] === EXIT) { 77693 return subresult 77694 } 77695 77696 offset = 77697 typeof subresult[1] === 'number' ? subresult[1] : offset + step 77698 } 77699 } 77700 77701 return result 77702 } 77703 } 77704 } 77705 ) 77706 77707/** 77708 * Turn a return value into a clean result. 77709 * 77710 * @param {VisitorResult} value 77711 * Valid return values from visitors. 77712 * @returns {ActionTuple} 77713 * Clean result. 77714 */ 77715function toResult(value) { 77716 if (Array.isArray(value)) { 77717 return value 77718 } 77719 77720 if (typeof value === 'number') { 77721 return [CONTINUE, value] 77722 } 77723 77724 return [value] 77725} 77726 77727;// ./node_modules/unist-util-visit/lib/index.js 77728/** 77729 * @typedef {import('unist').Node} Node 77730 * @typedef {import('unist').Parent} Parent 77731 * @typedef {import('unist-util-is').Test} Test 77732 * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult 77733 */ 77734 77735/** 77736 * Check if `Child` can be a child of `Ancestor`. 77737 * 77738 * Returns the ancestor when `Child` can be a child of `Ancestor`, or returns 77739 * `never`. 77740 * 77741 * @template {Node} Ancestor 77742 * Node type. 77743 * @template {Node} Child 77744 * Node type. 77745 * @typedef {( 77746 * Ancestor extends Parent 77747 * ? Child extends Ancestor['children'][number] 77748 * ? Ancestor 77749 * : never 77750 * : never 77751 * )} ParentsOf 77752 */ 77753 77754/** 77755 * @template {Node} [Visited=Node] 77756 * Visited node type. 77757 * @template {Parent} [Ancestor=Parent] 77758 * Ancestor type. 77759 * @callback Visitor 77760 * Handle a node (matching `test`, if given). 77761 * 77762 * Visitors are free to transform `node`. 77763 * They can also transform `parent`. 77764 * 77765 * Replacing `node` itself, if `SKIP` is not returned, still causes its 77766 * descendants to be walked (which is a bug). 77767 * 77768 * When adding or removing previous siblings of `node` (or next siblings, in 77769 * case of reverse), the `Visitor` should return a new `Index` to specify the 77770 * sibling to traverse after `node` is traversed. 77771 * Adding or removing next siblings of `node` (or previous siblings, in case 77772 * of reverse) is handled as expected without needing to return a new `Index`. 77773 * 77774 * Removing the children property of `parent` still results in them being 77775 * traversed. 77776 * @param {Visited} node 77777 * Found node. 77778 * @param {Visited extends Node ? number | null : never} index 77779 * Index of `node` in `parent`. 77780 * @param {Ancestor extends Node ? Ancestor | null : never} parent 77781 * Parent of `node`. 77782 * @returns {VisitorResult} 77783 * What to do next. 77784 * 77785 * An `Index` is treated as a tuple of `[CONTINUE, Index]`. 77786 * An `Action` is treated as a tuple of `[Action]`. 77787 * 77788 * Passing a tuple back only makes sense if the `Action` is `SKIP`. 77789 * When the `Action` is `EXIT`, that action can be returned. 77790 * When the `Action` is `CONTINUE`, `Index` can be returned. 77791 */ 77792 77793/**
77794 * Build a typed `Visitor` function from a node and all possible parents. 77795 * 77796 * It will infer which values are passed as `node` and which as `parent`. 77797 * 77798 * @template {Node} Visited 77799 * Node type. 77800 * @template {Parent} Ancestor 77801 * Parent type. 77802 * @typedef {Visitor<Visited, ParentsOf<Ancestor, Visited>>} BuildVisitorFromMatch 77803 */ 77804 77805/** 77806 * Build a typed `Visitor` function from a list of descendants and a test. 77807 * 77808 * It will infer which values are passed as `node` and which as `parent`. 77809 * 77810 * @template {Node} Descendant 77811 * Node type. 77812 * @template {Test} Check 77813 * Test type. 77814 * @typedef {( 77815 * BuildVisitorFromMatch< 77816 * import('unist-util-visit-parents/complex-types.js').Matches<Descendant, Check>, 77817 * Extract<Descendant, Parent> 77818 * > 77819 * )} BuildVisitorFromDescendants 77820 */ 77821 77822/** 77823 * Build a typed `Visitor` function from a tree and a test. 77824 * 77825 * It will infer which values are passed as `node` and which as `parent`. 77826 * 77827 * @template {Node} [Tree=Node] 77828 * Node type. 77829 * @template {Test} [Check=string] 77830 * Test type. 77831 * @typedef {( 77832 * BuildVisitorFromDescendants< 77833 * import('unist-util-visit-parents/complex-types.js').InclusiveDescendant<Tree>, 77834 * Check 77835 * > 77836 * )} BuildVisitor 77837 */ 77838 77839 77840 77841/** 77842 * Visit nodes. 77843 * 77844 * This algorithm performs *depth-first* *tree traversal* in *preorder* 77845 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). 77846 * 77847 * You can choose for which nodes `visitor` is called by passing a `test`. 77848 * For complex tests, you should test yourself in `visitor`, as it will be 77849 * faster and will have improved type information. 77850 * 77851 * Walking the tree is an intensive task. 77852 * Make use of the return values of the visitor when possible. 77853 * Instead of walking a tree multiple times, walk it once, use `unist-util-is` 77854 * to check if a node matches, and then perform different operations. 77855 * 77856 * You can change the tree. 77857 * See `Visitor` for more info. 77858 * 77859 * @param tree 77860 * Tree to traverse. 77861 * @param test 77862 * `unist-util-is`-compatible test 77863 * @param visitor 77864 * Handle each node. 77865 * @param reverse 77866 * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). 77867 * @returns 77868 * Nothing. 77869 */ 77870const visit = 77871 /** 77872 * @type {( 77873 * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: BuildVisitor<Tree, Check>, reverse?: boolean | null | undefined) => void) & 77874 * (<Tree extends Node>(tree: Tree, visitor: BuildVisitor<Tree>, reverse?: boolean | null | undefined) => void) 77875 * )} 77876 */ 77877 ( 77878 /** 77879 * @param {Node} tree 77880 * @param {Test} test 77881 * @param {Visitor} visitor 77882 * @param {boolean | null | undefined} [reverse] 77883 * @returns {void} 77884 */ 77885 function (tree, test, visitor, reverse) { 77886 if (typeof test === 'function' && typeof visitor !== 'function') { 77887 reverse = visitor 77888 visitor = test 77889 test = null 77890 } 77891 77892 visitParents(tree, test, overload, reverse) 77893 77894 /** 77895 * @param {Node} node 77896 * @param {Array<Parent>} parents 77897 */ 77898 function overload(node, parents) { 77899 const parent = parents[parents.length - 1] 77900 return visitor( 77901 node, 77902 parent ? parent.children.indexOf(node) : null, 77903 parent 77904 ) 77905 } 77906 } 77907 ) 77908 77909 77910 77911;// ./node_modules/unist-util-position/lib/index.js 77912/** 77913 * @typedef {import('unist').Position} Position 77914 * @typedef {import('unist').Node} Node 77915 * @typedef {import('unist').Point} Point 77916 */ 77917 77918/** 77919 * @typedef NodeLike 77920 * @property {string} type 77921 * @property {PositionLike | null | undefined} [position] 77922 * 77923 * @typedef PositionLike 77924 * @property {PointLike | null | undefined} [start] 77925 * @property {PointLike | null | undefined} [end] 77926 * 77927 * @typedef PointLike 77928 * @property {number | null | undefined} [line] 77929 * @property {number | null | undefined} [column] 77930 * @property {number | null | undefined} [offset] 77931 */ 77932 77933/** 77934 * Get the starting point of `node`. 77935 * 77936 * @param node 77937 * Node. 77938 * @returns 77939 * Point. 77940 */ 77941const pointStart = unist_util_position_lib_point('start') 77942 77943/** 77944 * Get the ending point of `node`. 77945 * 77946 * @param node 77947 * Node. 77948 * @returns 77949 * Point. 77950 */ 77951const pointEnd = unist_util_position_lib_point('end') 77952 77953/** 77954 * Get the positional info of `node`. 77955 * 77956 * @param {NodeLike | Node | null | undefined} [node] 77957 * Node. 77958 * @returns {Position} 77959 * Position. 77960 */ 77961function lib_position(node) { 77962 return {start: pointStart(node), end: pointEnd(node)} 77963} 77964 77965/** 77966 * Get the positional info of `node`. 77967 * 77968 * @param {'start' | 'end'} type 77969 * Side. 77970 * @returns 77971 * Getter. 77972 */ 77973function unist_util_position_lib_point(type) { 77974 return point 77975 77976 /** 77977 * Get the point info of `node` at a bound side. 77978 * 77979 * @param {NodeLike | Node | null | undefined} [node] 77980 * @returns {Point} 77981 */ 77982 function point(node) { 77983 const point = (node && node.position && node.position[type]) || {} 77984 77985 // To do: next major: donât return points when invalid. 77986 return { 77987 // @ts-expect-error: in practice, null is allowed. 77988 line: point.line || null, 77989 // @ts-expect-error: in practice, null is allowed. 77990 column: point.column || null, 77991 // @ts-expect-error: in practice, null is allowed. 77992 offset: point.offset > -1 ? point.offset : null 77993 } 77994 } 77995} 77996 77997;// ./node_modules/unist-util-generated/lib/index.js 77998/** 77999 * @typedef PointLike 78000 * @property {number | null | undefined} [line] 78001 * @property {number | null | undefined} [column] 78002 * @property {number | null | undefined} [offset] 78003 * 78004 * @typedef PositionLike 78005 * @property {PointLike | null | undefined} [start] 78006 * @property {PointLike | null | undefined} [end] 78007 * 78008 * @typedef NodeLike 78009 * @property {PositionLike | null | undefined} [position] 78010 */ 78011
78012/** 78013 * Check if `node` is generated. 78014 * 78015 * @param {NodeLike | null | undefined} [node] 78016 * Node to check. 78017 * @returns {boolean} 78018 * Whether `node` is generated (does not have positional info). 78019 */ 78020function generated(node) { 78021 return ( 78022 !node || 78023 !node.position || 78024 !node.position.start || 78025 !node.position.start.line || 78026 !node.position.start.column || 78027 !node.position.end || 78028 !node.position.end.line || 78029 !node.position.end.column 78030 ) 78031} 78032 78033;// ./node_modules/mdast-util-definitions/lib/index.js 78034/** 78035 * @typedef {import('mdast').Root} Root 78036 * @typedef {import('mdast').Content} Content 78037 * @typedef {import('mdast').Definition} Definition 78038 */ 78039 78040/** 78041 * @typedef {Root | Content} Node 78042 * 78043 * @callback GetDefinition 78044 * Get a definition by identifier. 78045 * @param {string | null | undefined} [identifier] 78046 * Identifier of definition. 78047 * @returns {Definition | null} 78048 * Definition corresponding to `identifier` or `null`. 78049 */ 78050 78051 78052 78053const mdast_util_definitions_lib_own = {}.hasOwnProperty 78054 78055/** 78056 * Find definitions in `tree`. 78057 * 78058 * Uses CommonMark precedence, which means that earlier definitions are 78059 * preferred over duplicate later definitions. 78060 * 78061 * @param {Node} tree 78062 * Tree to check. 78063 * @returns {GetDefinition} 78064 * Getter. 78065 */ 78066function definitions(tree) { 78067 /** @type {Record<string, Definition>} */ 78068 const cache = Object.create(null) 78069 78070 if (!tree || !tree.type) { 78071 throw new Error('mdast-util-definitions expected node') 78072 } 78073 78074 visit(tree, 'definition', (definition) => { 78075 const id = clean(definition.identifier) 78076 if (id && !mdast_util_definitions_lib_own.call(cache, id)) { 78077 cache[id] = definition 78078 } 78079 }) 78080 78081 return definition 78082 78083 /** @type {GetDefinition} */ 78084 function definition(identifier) { 78085 const id = clean(identifier) 78086 // To do: next major: return `undefined` when not found. 78087 return id && mdast_util_definitions_lib_own.call(cache, id) ? cache[id] : null 78088 } 78089} 78090 78091/** 78092 * @param {string | null | undefined} [value] 78093 * @returns {string} 78094 */ 78095function clean(value) { 78096 return String(value || '').toUpperCase() 78097} 78098 78099;// ./node_modules/mdast-util-to-hast/lib/handlers/blockquote.js 78100/** 78101 * @typedef {import('hast').Element} Element 78102 * @typedef {import('mdast').Blockquote} Blockquote 78103 * @typedef {import('../state.js').State} State 78104 */ 78105 78106/** 78107 * Turn an mdast `blockquote` node into hast. 78108 * 78109 * @param {State} state 78110 * Info passed around. 78111 * @param {Blockquote} node 78112 * mdast node. 78113 * @returns {Element} 78114 * hast node. 78115 */ 78116function blockquote(state, node) { 78117 /** @type {Element} */ 78118 const result = { 78119 type: 'element', 78120 tagName: 'blockquote', 78121 properties: {}, 78122 children: state.wrap(state.all(node), true) 78123 } 78124 state.patch(node, result) 78125 return state.applyData(node, result) 78126} 78127 78128;// ./node_modules/mdast-util-to-hast/lib/handlers/break.js 78129/** 78130 * @typedef {import('hast').Element} Element 78131 * @typedef {import('hast').Text} Text 78132 * @typedef {import('mdast').Break} Break 78133 * @typedef {import('../state.js').State} State 78134 */ 78135 78136/** 78137 * Turn an mdast `break` node into hast. 78138 * 78139 * @param {State} state 78140 * Info passed around. 78141 * @param {Break} node 78142 * mdast node. 78143 * @returns {Array<Element | Text>} 78144 * hast element content. 78145 */ 78146function hardBreak(state, node) { 78147 /** @type {Element} */ 78148 const result = {type: 'element', tagName: 'br', properties: {}, children: []} 78149 state.patch(node, result) 78150 return [state.applyData(node, result), {type: 'text', value: '\n'}] 78151} 78152 78153;// ./node_modules/mdast-util-to-hast/lib/handlers/code.js 78154/** 78155 * @typedef {import('hast').Element} Element 78156 * @typedef {import('hast').Properties} Properties 78157 * @typedef {import('mdast').Code} Code 78158 * @typedef {import('../state.js').State} State 78159 78160 */ 78161 78162/** 78163 * Turn an mdast `code` node into hast. 78164 * 78165 * @param {State} state 78166 * Info passed around. 78167 * @param {Code} node 78168 * mdast node. 78169 * @returns {Element} 78170 * hast node. 78171 */ 78172function code(state, node) { 78173 const value = node.value ? node.value + '\n' : '' 78174 // To do: next major, use `node.lang` w/o regex, the splittingâs been going 78175 // on for years in remark now. 78176 const lang = node.lang ? node.lang.match(/^[^ \t]+(?=[ \t]|$)/) : null 78177 /** @type {Properties} */ 78178 const properties = {} 78179 78180 if (lang) { 78181 properties.className = ['language-' + lang] 78182 } 78183 78184 // Create `<code>`. 78185 /** @type {Element} */ 78186 let result = { 78187 type: 'element', 78188 tagName: 'code', 78189 properties, 78190 children: [{type: 'text', value}] 78191 } 78192 78193 if (node.meta) { 78194 result.data = {meta: node.meta} 78195 } 78196 78197 state.patch(node, result) 78198 result = state.applyData(node, result) 78199 78200 // Create `<pre>`. 78201 result = {type: 'element', tagName: 'pre', properties: {}, children: [result]} 78202 state.patch(node, result) 78203 return result 78204} 78205 78206;// ./node_modules/mdast-util-to-hast/lib/handlers/delete.js 78207/** 78208 * @typedef {import('hast').Element} Element 78209 * @typedef {import('mdast').Delete} Delete 78210 * @typedef {import('../state.js').State} State 78211 78212 */ 78213
78214/** 78215 * Turn an mdast `delete` node into hast. 78216 * 78217 * @param {State} state 78218 * Info passed around. 78219 * @param {Delete} node 78220 * mdast node. 78221 * @returns {Element} 78222 * hast node. 78223 */ 78224function strikethrough(state, node) { 78225 /** @type {Element} */ 78226 const result = { 78227 type: 'element', 78228 tagName: 'del', 78229 properties: {}, 78230 children: state.all(node) 78231 } 78232 state.patch(node, result) 78233 return state.applyData(node, result) 78234} 78235 78236;// ./node_modules/mdast-util-to-hast/lib/handlers/emphasis.js 78237/** 78238 * @typedef {import('hast').Element} Element 78239 * @typedef {import('mdast').Emphasis} Emphasis 78240 * @typedef {import('../state.js').State} State 78241 */ 78242 78243/** 78244 * Turn an mdast `emphasis` node into hast. 78245 * 78246 * @param {State} state 78247 * Info passed around. 78248 * @param {Emphasis} node 78249 * mdast node. 78250 * @returns {Element} 78251 * hast node. 78252 */ 78253function emphasis(state, node) { 78254 /** @type {Element} */ 78255 const result = { 78256 type: 'element', 78257 tagName: 'em', 78258 properties: {}, 78259 children: state.all(node) 78260 } 78261 state.patch(node, result) 78262 return state.applyData(node, result) 78263} 78264 78265;// ./node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js 78266/** 78267 * @typedef {import('mdast').FootnoteReference} FootnoteReference 78268 * @typedef {import('hast').Element} Element 78269 * @typedef {import('../state.js').State} State 78270 */ 78271 78272 78273 78274/** 78275 * Turn an mdast `footnoteReference` node into hast. 78276 * 78277 * @param {State} state 78278 * Info passed around. 78279 * @param {FootnoteReference} node 78280 * mdast node. 78281 * @returns {Element} 78282 * hast node. 78283 */ 78284function footnoteReference(state, node) { 78285 const id = String(node.identifier).toUpperCase() 78286 const safeId = normalizeUri(id.toLowerCase()) 78287 const index = state.footnoteOrder.indexOf(id) 78288 /** @type {number} */ 78289 let counter 78290 78291 if (index === -1) { 78292 state.footnoteOrder.push(id) 78293 state.footnoteCounts[id] = 1 78294 counter = state.footnoteOrder.length 78295 } else { 78296 state.footnoteCounts[id]++ 78297 counter = index + 1 78298 } 78299 78300 const reuseCounter = state.footnoteCounts[id] 78301 78302 /** @type {Element} */ 78303 const link = { 78304 type: 'element', 78305 tagName: 'a', 78306 properties: { 78307 href: '#' + state.clobberPrefix + 'fn-' + safeId, 78308 id: 78309 state.clobberPrefix + 78310 'fnref-' + 78311 safeId + 78312 (reuseCounter > 1 ? '-' + reuseCounter : ''), 78313 dataFootnoteRef: true, 78314 ariaDescribedBy: ['footnote-label'] 78315 }, 78316 children: [{type: 'text', value: String(counter)}] 78317 } 78318 state.patch(node, link) 78319 78320 /** @type {Element} */ 78321 const sup = { 78322 type: 'element', 78323 tagName: 'sup', 78324 properties: {}, 78325 children: [link] 78326 } 78327 state.patch(node, sup) 78328 return state.applyData(node, sup) 78329} 78330 78331;// ./node_modules/mdast-util-to-hast/lib/handlers/footnote.js 78332/** 78333 * @typedef {import('hast').Element} Element 78334 * @typedef {import('mdast').Footnote} Footnote 78335 * @typedef {import('../state.js').State} State 78336 */ 78337 78338 78339 78340// To do: when both: 78341// * <https://github.com/micromark/micromark-extension-footnote> 78342// * <https://github.com/syntax-tree/mdast-util-footnote> 78343// â¦are archived, remove this (also from mdast). 78344// These inline notes are not used in GFM. 78345 78346/** 78347 * Turn an mdast `footnote` node into hast. 78348 * 78349 * @param {State} state 78350 * Info passed around. 78351 * @param {Footnote} node 78352 * mdast node. 78353 * @returns {Element} 78354 * hast node. 78355 */ 78356function footnote(state, node) { 78357 const footnoteById = state.footnoteById 78358 let no = 1 78359 78360 while (no in footnoteById) no++ 78361 78362 const identifier = String(no) 78363 78364 footnoteById[identifier] = { 78365 type: 'footnoteDefinition', 78366 identifier, 78367 children: [{type: 'paragraph', children: node.children}], 78368 position: node.position 78369 } 78370 78371 return footnoteReference(state, { 78372 type: 'footnoteReference', 78373 identifier, 78374 position: node.position 78375 }) 78376} 78377 78378;// ./node_modules/mdast-util-to-hast/lib/handlers/heading.js 78379/** 78380 * @typedef {import('hast').Element} Element 78381 * @typedef {import('mdast').Heading} Heading 78382 * @typedef {import('../state.js').State} State 78383 */ 78384 78385/** 78386 * Turn an mdast `heading` node into hast. 78387 * 78388 * @param {State} state 78389 * Info passed around. 78390 * @param {Heading} node 78391 * mdast node. 78392 * @returns {Element} 78393 * hast node. 78394 */ 78395function heading(state, node) { 78396 /** @type {Element} */ 78397 const result = { 78398 type: 'element',
78399 tagName: 'h' + node.depth, 78400 properties: {}, 78401 children: state.all(node) 78402 } 78403 state.patch(node, result) 78404 return state.applyData(node, result) 78405} 78406 78407;// ./node_modules/mdast-util-to-hast/lib/handlers/html.js 78408/** 78409 * @typedef {import('hast').Element} Element 78410 * @typedef {import('mdast').HTML} Html 78411 * @typedef {import('../state.js').State} State 78412 * @typedef {import('../../index.js').Raw} Raw 78413 */ 78414 78415/** 78416 * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise 78417 * nothing). 78418 * 78419 * @param {State} state 78420 * Info passed around. 78421 * @param {Html} node 78422 * mdast node. 78423 * @returns {Raw | Element | null} 78424 * hast node. 78425 */ 78426function html(state, node) { 78427 if (state.dangerous) { 78428 /** @type {Raw} */ 78429 const result = {type: 'raw', value: node.value} 78430 state.patch(node, result) 78431 return state.applyData(node, result) 78432 } 78433 78434 // To do: next major: return `undefined`. 78435 return null 78436} 78437 78438;// ./node_modules/mdast-util-to-hast/lib/revert.js 78439/** 78440 * @typedef {import('hast').ElementContent} ElementContent 78441 * 78442 * @typedef {import('mdast').Content} Content 78443 * @typedef {import('mdast').Reference} Reference 78444 * @typedef {import('mdast').Root} Root 78445 * 78446 * @typedef {import('./state.js').State} State 78447 */ 78448 78449/** 78450 * @typedef {Root | Content} Nodes 78451 * @typedef {Extract<Nodes, Reference>} References 78452 */ 78453 78454// To do: next major: always return array. 78455 78456/** 78457 * Return the content of a reference without definition as plain text. 78458 * 78459 * @param {State} state 78460 * Info passed around. 78461 * @param {References} node 78462 * Reference node (image, link). 78463 * @returns {ElementContent | Array<ElementContent>} 78464 * hast content. 78465 */ 78466function revert(state, node) { 78467 const subtype = node.referenceType 78468 let suffix = ']' 78469 78470 if (subtype === 'collapsed') { 78471 suffix += '[]' 78472 } else if (subtype === 'full') { 78473 suffix += '[' + (node.label || node.identifier) + ']' 78474 } 78475 78476 if (node.type === 'imageReference') { 78477 return {type: 'text', value: '![' + node.alt + suffix} 78478 } 78479 78480 const contents = state.all(node) 78481 const head = contents[0] 78482 78483 if (head && head.type === 'text') { 78484 head.value = '[' + head.value 78485 } else { 78486 contents.unshift({type: 'text', value: '['}) 78487 } 78488 78489 const tail = contents[contents.length - 1] 78490 78491 if (tail && tail.type === 'text') { 78492 tail.value += suffix 78493 } else { 78494 contents.push({type: 'text', value: suffix}) 78495 } 78496 78497 return contents 78498} 78499 78500;// ./node_modules/mdast-util-to-hast/lib/handlers/image-reference.js 78501/** 78502 * @typedef {import('hast').ElementContent} ElementContent 78503 * @typedef {import('hast').Element} Element 78504 * @typedef {import('hast').Properties} Properties 78505 * @typedef {import('mdast').ImageReference} ImageReference 78506 * @typedef {import('../state.js').State} State 78507 */ 78508 78509 78510 78511 78512/** 78513 * Turn an mdast `imageReference` node into hast. 78514 * 78515 * @param {State} state 78516 * Info passed around. 78517 * @param {ImageReference} node 78518 * mdast node. 78519 * @returns {ElementContent | Array<ElementContent>} 78520 * hast node. 78521 */ 78522function imageReference(state, node) { 78523 const def = state.definition(node.identifier) 78524 78525 if (!def) { 78526 return revert(state, node) 78527 } 78528 78529 /** @type {Properties} */ 78530 const properties = {src: normalizeUri(def.url || ''), alt: node.alt} 78531 78532 if (def.title !== null && def.title !== undefined) { 78533 properties.title = def.title 78534 } 78535 78536 /** @type {Element} */ 78537 const result = {type: 'element', tagName: 'img', properties, children: []} 78538 state.patch(node, result) 78539 return state.applyData(node, result) 78540} 78541 78542;// ./node_modules/mdast-util-to-hast/lib/handlers/image.js 78543/** 78544 * @typedef {import('hast').Element} Element 78545 * @typedef {import('hast').Properties} Properties 78546 * @typedef {import('mdast').Image} Image 78547 * @typedef {import('../state.js').State} State 78548 */ 78549 78550 78551 78552/** 78553 * Turn an mdast `image` node into hast. 78554 * 78555 * @param {State} state 78556 * Info passed around. 78557 * @param {Image} node 78558 * mdast node. 78559 * @returns {Element} 78560 * hast node. 78561 */ 78562function image_image(state, node) { 78563 /** @type {Properties} */ 78564 const properties = {src: normalizeUri(node.url)} 78565 78566 if (node.alt !== null && node.alt !== undefined) { 78567 properties.alt = node.alt 78568 } 78569 78570 if (node.title !== null && node.title !== undefined) { 78571 properties.title = node.title 78572 } 78573 78574 /** @type {Element} */ 78575 const result = {type: 'element', tagName: 'img', properties, children: []} 78576 state.patch(node, result) 78577 return state.applyData(node, result) 78578} 78579 78580;// ./node_modules/mdast-util-to-hast/lib/handlers/inline-code.js 78581/** 78582 * @typedef {import('hast').Element} Element 78583 * @typedef {import('hast').Text} Text 78584 * @typedef {import('mdast').InlineCode} InlineCode 78585 * @typedef {import('../state.js').State} State 78586 */ 78587 78588/** 78589 * Turn an mdast `inlineCode` node into hast. 78590 * 78591 * @param {State} state 78592 * Info passed around. 78593 * @param {InlineCode} node 78594 * mdast node. 78595 * @returns {Element} 78596 * hast node. 78597 */ 78598function inlineCode(state, node) { 78599 /** @type {Text} */
78600 const text = {type: 'text', value: node.value.replace(/\r?\n|\r/g, ' ')} 78601 state.patch(node, text) 78602 78603 /** @type {Element} */ 78604 const result = { 78605 type: 'element', 78606 tagName: 'code', 78607 properties: {}, 78608 children: [text] 78609 } 78610 state.patch(node, result) 78611 return state.applyData(node, result) 78612} 78613 78614;// ./node_modules/mdast-util-to-hast/lib/handlers/link-reference.js 78615/** 78616 * @typedef {import('hast').Element} Element 78617 * @typedef {import('hast').ElementContent} ElementContent 78618 * @typedef {import('hast').Properties} Properties 78619 * @typedef {import('mdast').LinkReference} LinkReference 78620 * @typedef {import('../state.js').State} State 78621 */ 78622 78623 78624 78625 78626/** 78627 * Turn an mdast `linkReference` node into hast. 78628 * 78629 * @param {State} state 78630 * Info passed around. 78631 * @param {LinkReference} node 78632 * mdast node. 78633 * @returns {ElementContent | Array<ElementContent>} 78634 * hast node. 78635 */ 78636function linkReference(state, node) { 78637 const def = state.definition(node.identifier) 78638 78639 if (!def) { 78640 return revert(state, node) 78641 } 78642 78643 /** @type {Properties} */ 78644 const properties = {href: normalizeUri(def.url || '')} 78645 78646 if (def.title !== null && def.title !== undefined) { 78647 properties.title = def.title 78648 } 78649 78650 /** @type {Element} */ 78651 const result = { 78652 type: 'element', 78653 tagName: 'a', 78654 properties, 78655 children: state.all(node) 78656 } 78657 state.patch(node, result) 78658 return state.applyData(node, result) 78659} 78660 78661;// ./node_modules/mdast-util-to-hast/lib/handlers/link.js 78662/** 78663 * @typedef {import('hast').Element} Element 78664 * @typedef {import('hast').Properties} Properties 78665 * @typedef {import('mdast').Link} Link 78666 * @typedef {import('../state.js').State} State 78667 */ 78668 78669 78670 78671/** 78672 * Turn an mdast `link` node into hast. 78673 * 78674 * @param {State} state 78675 * Info passed around. 78676 * @param {Link} node 78677 * mdast node. 78678 * @returns {Element} 78679 * hast node. 78680 */ 78681function link_link(state, node) { 78682 /** @type {Properties} */ 78683 const properties = {href: normalizeUri(node.url)} 78684 78685 if (node.title !== null && node.title !== undefined) { 78686 properties.title = node.title 78687 } 78688 78689 /** @type {Element} */ 78690 const result = { 78691 type: 'element', 78692 tagName: 'a', 78693 properties, 78694 children: state.all(node) 78695 } 78696 state.patch(node, result) 78697 return state.applyData(node, result) 78698} 78699 78700;// ./node_modules/mdast-util-to-hast/lib/handlers/list-item.js 78701/** 78702 * @typedef {import('hast').Element} Element 78703 * @typedef {import('hast').ElementContent} ElementContent 78704 * @typedef {import('hast').Properties} Properties 78705 * @typedef {import('mdast').Content} Content 78706 * @typedef {import('mdast').ListItem} ListItem 78707 * @typedef {import('mdast').Parent} Parent 78708 * @typedef {import('mdast').Root} Root 78709 * @typedef {import('../state.js').State} State 78710 */ 78711 78712/** 78713 * @typedef {Root | Content} Nodes 78714 * @typedef {Extract<Nodes, Parent>} Parents 78715 */ 78716 78717/** 78718 * Turn an mdast `listItem` node into hast. 78719 * 78720 * @param {State} state 78721 * Info passed around. 78722 * @param {ListItem} node 78723 * mdast node. 78724 * @param {Parents | null | undefined} parent 78725 * Parent of `node`. 78726 * @returns {Element} 78727 * hast node. 78728 */ 78729function listItem(state, node, parent) { 78730 const results = state.all(node) 78731 const loose = parent ? listLoose(parent) : listItemLoose(node) 78732 /** @type {Properties} */ 78733 const properties = {} 78734 /** @type {Array<ElementContent>} */ 78735 const children = [] 78736 78737 if (typeof node.checked === 'boolean') { 78738 const head = results[0] 78739 /** @type {Element} */ 78740 let paragraph 78741 78742 if (head && head.type === 'element' && head.tagName === 'p') { 78743 paragraph = head 78744 } else { 78745 paragraph = {type: 'element', tagName: 'p', properties: {}, children: []} 78746 results.unshift(paragraph) 78747 } 78748 78749 if (paragraph.children.length > 0) { 78750 paragraph.children.unshift({type: 'text', value: ' '}) 78751 } 78752 78753 paragraph.children.unshift({ 78754 type: 'element', 78755 tagName: 'input', 78756 properties: {type: 'checkbox', checked: node.checked, disabled: true}, 78757 children: [] 78758 }) 78759 78760 // According to github-markdown-css, this class hides bullet. 78761 // See: <https://github.com/sindresorhus/github-markdown-css>. 78762 properties.className = ['task-list-item'] 78763 } 78764 78765 let index = -1 78766 78767 while (++index < results.length) { 78768 const child = results[index] 78769 78770 // Add eols before nodes, except if this is a loose, first paragraph. 78771 if ( 78772 loose || 78773 index !== 0 || 78774 child.type !== 'element' || 78775 child.tagName !== 'p' 78776 ) { 78777 children.push({type: 'text', value: '\n'}) 78778 } 78779 78780 if (child.type === 'element' && child.tagName === 'p' && !loose) { 78781 children.push(...child.children) 78782 } else { 78783 children.push(child) 78784 } 78785 } 78786 78787 const tail = results[results.length - 1] 78788 78789 // Add a final eol. 78790 if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) { 78791 children.push({type: 'text', value: '\n'}) 78792 } 78793 78794 /** @type {Element} */ 78795 const result = {type: 'element', tagName: 'li', properties, children} 78796 state.patch(node, result) 78797 return state.applyData(node, result) 78798} 78799 78800/** 78801 * @param {Parents} node 78802 * @return {Boolean} 78803 */ 78804function listLoose(node) { 78805 let loose = false 78806 if (node.type === 'list') { 78807 loose = node.spread || false 78808 const children = node.children 78809 let index = -1 78810 78811 while (!loose && ++index < children.length) { 78812 loose = listItemLoose(children[index]) 78813 } 78814 } 78815 78816 return loose 78817} 78818 78819/** 78820 * @param {ListItem} node 78821 * @return {Boolean} 78822 */ 78823function listItemLoose(node) { 78824 const spread = node.spread 78825 78826 return spread === undefined || spread === null 78827 ? node.children.length > 1 78828 : spread 78829} 78830 78831;// ./node_modules/mdast-util-to-hast/lib/handlers/list.js 78832/** 78833 * @typedef {import('hast').Element} Element 78834 * @typedef {import('hast').Properties} Properties 78835 * @typedef {import('mdast').List} List 78836 * @typedef {import('../state.js').State} State 78837 */ 78838 78839/** 78840 * Turn an mdast `list` node into hast. 78841 * 78842 * @param {State} state 78843 * Info passed around. 78844 * @param {List} node 78845 * mdast node. 78846 * @returns {Element} 78847 * hast node. 78848 */ 78849function list_list(state, node) { 78850 /** @type {Properties} */ 78851 const properties = {} 78852 const results = state.all(node) 78853 let index = -1 78854 78855 if (typeof node.start === 'number' && node.start !== 1) { 78856 properties.start = node.start 78857 } 78858 78859 // Like GitHub, add a class for custom styling. 78860 while (++index < results.length) { 78861 const child = results[index] 78862 78863 if ( 78864 child.type === 'element' && 78865 child.tagName === 'li' && 78866 child.properties && 78867 Array.isArray(child.properties.className) && 78868 child.properties.className.includes('task-list-item') 78869 ) { 78870 properties.className = ['contains-task-list'] 78871 break 78872 } 78873 } 78874 78875 /** @type {Element} */ 78876 const result = { 78877 type: 'element', 78878 tagName: node.ordered ? 'ol' : 'ul', 78879 properties, 78880 children: state.wrap(results, true) 78881 } 78882 state.patch(node, result) 78883 return state.applyData(node, result) 78884} 78885 78886;// ./node_modules/mdast-util-to-hast/lib/handlers/paragraph.js 78887/** 78888 * @typedef {import('hast').Element} Element 78889 * @typedef {import('mdast').Paragraph} Paragraph 78890 * @typedef {import('../state.js').State} State 78891 */ 78892 78893/** 78894 * Turn an mdast `paragraph` node into hast. 78895 * 78896 * @param {State} state 78897 * Info passed around. 78898 * @param {Paragraph} node 78899 * mdast node. 78900 * @returns {Element} 78901 * hast node. 78902 */ 78903function paragraph(state, node) { 78904 /** @type {Element} */ 78905 const result = { 78906 type: 'element', 78907 tagName: 'p', 78908 properties: {}, 78909 children: state.all(node) 78910 } 78911 state.patch(node, result) 78912 return state.applyData(node, result) 78913} 78914 78915;// ./node_modules/mdast-util-to-hast/lib/handlers/root.js 78916/** 78917 * @typedef {import('hast').Root} HastRoot 78918 * @typedef {import('hast').Element} HastElement 78919 * @typedef {import('mdast').Root} MdastRoot 78920 * @typedef {import('../state.js').State} State 78921 */ 78922 78923/** 78924 * Turn an mdast `root` node into hast. 78925 * 78926 * @param {State} state 78927 * Info passed around. 78928 * @param {MdastRoot} node 78929 * mdast node. 78930 * @returns {HastRoot | HastElement} 78931 * hast node. 78932 */ 78933function root(state, node) { 78934 /** @type {HastRoot} */ 78935 const result = {type: 'root', children: state.wrap(state.all(node))} 78936 state.patch(node, result) 78937 return state.applyData(node, result) 78938} 78939 78940;// ./node_modules/mdast-util-to-hast/lib/handlers/strong.js 78941/** 78942 * @typedef {import('hast').Element} Element 78943 * @typedef {import('mdast').Strong} Strong 78944 * @typedef {import('../state.js').State} State 78945 */ 78946 78947/** 78948 * Turn an mdast `strong` node into hast. 78949 * 78950 * @param {State} state 78951 * Info passed around. 78952 * @param {Strong} node 78953 * mdast node. 78954 * @returns {Element} 78955 * hast node. 78956 */ 78957function strong(state, node) { 78958 /** @type {Element} */ 78959 const result = { 78960 type: 'element', 78961 tagName: 'strong', 78962 properties: {}, 78963 children: state.all(node) 78964 } 78965 state.patch(node, result) 78966 return state.applyData(node, result) 78967} 78968 78969;// ./node_modules/mdast-util-to-hast/lib/handlers/table.js 78970/** 78971 * @typedef {import('hast').Element} Element 78972 * @typedef {import('mdast').Table} Table 78973 * @typedef {import('../state.js').State} State 78974 */ 78975 78976 78977 78978/** 78979 * Turn an mdast `table` node into hast. 78980 * 78981 * @param {State} state 78982 * Info passed around. 78983 * @param {Table} node 78984 * mdast node. 78985 * @returns {Element} 78986 * hast node. 78987 */ 78988function table(state, node) { 78989 const rows = state.all(node) 78990 const firstRow = rows.shift() 78991 /** @type {Array<Element>} */ 78992 const tableContent = [] 78993 78994 if (firstRow) { 78995 /** @type {Element} */ 78996 const head = { 78997 type: 'element', 78998 tagName: 'thead', 78999 properties: {}, 79000 children: state.wrap([firstRow], true) 79001 } 79002 state.patch(node.children[0], head) 79003 tableContent.push(head) 79004 } 79005 79006 if (rows.length > 0) { 79007 /** @type {Element} */ 79008 const body = { 79009 type: 'element', 79010 tagName: 'tbody', 79011 properties: {}, 79012 children: state.wrap(rows, true) 79013 } 79014 79015 const start = pointStart(node.children[1]) 79016 const end = pointEnd(node.children[node.children.length - 1]) 79017 if (start.line && end.line) body.position = {start, end} 79018 tableContent.push(body) 79019 } 79020 79021 /** @type {Element} */ 79022 const result = { 79023 type: 'element', 79024 tagName: 'table', 79025 properties: {}, 79026 children: state.wrap(tableContent, true) 79027 } 79028 state.patch(node, result) 79029 return state.applyData(node, result) 79030} 79031 79032;// ./node_modules/mdast-util-to-hast/lib/handlers/table-row.js 79033/** 79034 * @typedef {import('hast').Properties} Properties 79035 * @typedef {import('hast').Element} Element 79036 * @typedef {import('hast').ElementContent} ElementContent 79037 * @typedef {import('mdast').Content} Content 79038 * @typedef {import('mdast').Parent} Parent 79039 * @typedef {import('mdast').Root} Root 79040 * @typedef {import('mdast').TableRow} TableRow 79041 * @typedef {import('../state.js').State} State 79042 */ 79043 79044/** 79045 * @typedef {Root | Content} Nodes 79046 * @typedef {Extract<Nodes, Parent>} Parents 79047 */ 79048
79049/** 79050 * Turn an mdast `tableRow` node into hast. 79051 * 79052 * @param {State} state 79053 * Info passed around. 79054 * @param {TableRow} node 79055 * mdast node. 79056 * @param {Parents | null | undefined} parent 79057 * Parent of `node`. 79058 * @returns {Element} 79059 * hast node. 79060 */ 79061function tableRow(state, node, parent) { 79062 const siblings = parent ? parent.children : undefined 79063 // Generate a body row when without parent. 79064 const rowIndex = siblings ? siblings.indexOf(node) : 1 79065 const tagName = rowIndex === 0 ? 'th' : 'td' 79066 const align = parent && parent.type === 'table' ? parent.align : undefined 79067 const length = align ? align.length : node.children.length 79068 let cellIndex = -1 79069 /** @type {Array<ElementContent>} */ 79070 const cells = [] 79071 79072 while (++cellIndex < length) { 79073 // Note: can also be undefined. 79074 const cell = node.children[cellIndex] 79075 /** @type {Properties} */ 79076 const properties = {} 79077 const alignValue = align ? align[cellIndex] : undefined 79078 79079 if (alignValue) { 79080 properties.align = alignValue 79081 } 79082 79083 /** @type {Element} */ 79084 let result = {type: 'element', tagName, properties, children: []} 79085 79086 if (cell) { 79087 result.children = state.all(cell) 79088 state.patch(cell, result) 79089 result = state.applyData(node, result) 79090 } 79091 79092 cells.push(result) 79093 } 79094 79095 /** @type {Element} */ 79096 const result = { 79097 type: 'element', 79098 tagName: 'tr', 79099 properties: {}, 79100 children: state.wrap(cells, true) 79101 } 79102 state.patch(node, result) 79103 return state.applyData(node, result) 79104} 79105 79106;// ./node_modules/mdast-util-to-hast/lib/handlers/table-cell.js 79107/** 79108 * @typedef {import('hast').Element} Element 79109 * @typedef {import('mdast').TableCell} TableCell 79110 * @typedef {import('../state.js').State} State 79111 */ 79112 79113/** 79114 * Turn an mdast `tableCell` node into hast. 79115 * 79116 * @param {State} state 79117 * Info passed around. 79118 * @param {TableCell} node 79119 * mdast node. 79120 * @returns {Element} 79121 * hast node. 79122 */ 79123function tableCell(state, node) { 79124 // Note: this function is normally not called: see `table-row` for how rows 79125 // and their cells are compiled. 79126 /** @type {Element} */ 79127 const result = { 79128 type: 'element', 79129 tagName: 'td', // Assume body cell. 79130 properties: {}, 79131 children: state.all(node) 79132 } 79133 state.patch(node, result) 79134 return state.applyData(node, result) 79135} 79136 79137;// ./node_modules/trim-lines/index.js 79138const tab = 9 /* `\t` */ 79139const space = 32 /* ` ` */ 79140 79141/** 79142 * Remove initial and final spaces and tabs at the line breaks in `value`. 79143 * Does not trim initial and final spaces and tabs of the value itself. 79144 * 79145 * @param {string} value 79146 * Value to trim. 79147 * @returns {string} 79148 * Trimmed value. 79149 */ 79150function trimLines(value) { 79151 const source = String(value) 79152 const search = /\r?\n|\r/g 79153 let match = search.exec(source) 79154 let last = 0 79155 /** @type {Array<string>} */ 79156 const lines = [] 79157 79158 while (match) { 79159 lines.push( 79160 trimLine(source.slice(last, match.index), last > 0, true), 79161 match[0] 79162 ) 79163 79164 last = match.index + match[0].length 79165 match = search.exec(source) 79166 } 79167 79168 lines.push(trimLine(source.slice(last), last > 0, false)) 79169 79170 return lines.join('') 79171} 79172 79173/** 79174 * @param {string} value 79175 * Line to trim. 79176 * @param {boolean} start 79177 * Whether to trim the start of the line. 79178 * @param {boolean} end 79179 * Whether to trim the end of the line. 79180 * @returns {string} 79181 * Trimmed line. 79182 */ 79183function trimLine(value, start, end) { 79184 let startIndex = 0 79185 let endIndex = value.length 79186 79187 if (start) { 79188 let code = value.codePointAt(startIndex) 79189 79190 while (code === tab || code === space) { 79191 startIndex++ 79192 code = value.codePointAt(startIndex) 79193 } 79194 } 79195 79196 if (end) {
79197 let code = value.codePointAt(endIndex - 1) 79198 79199 while (code === tab || code === space) { 79200 endIndex-- 79201 code = value.codePointAt(endIndex - 1) 79202 } 79203 } 79204 79205 return endIndex > startIndex ? value.slice(startIndex, endIndex) : '' 79206} 79207 79208;// ./node_modules/mdast-util-to-hast/lib/handlers/text.js 79209/** 79210 * @typedef {import('hast').Element} HastElement 79211 * @typedef {import('hast').Text} HastText 79212 * @typedef {import('mdast').Text} MdastText 79213 * @typedef {import('../state.js').State} State 79214 */ 79215 79216 79217 79218/** 79219 * Turn an mdast `text` node into hast. 79220 * 79221 * @param {State} state 79222 * Info passed around. 79223 * @param {MdastText} node 79224 * mdast node. 79225 * @returns {HastText | HastElement} 79226 * hast node. 79227 */ 79228function handlers_text_text(state, node) { 79229 /** @type {HastText} */ 79230 const result = {type: 'text', value: trimLines(String(node.value))} 79231 state.patch(node, result) 79232 return state.applyData(node, result) 79233} 79234 79235;// ./node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js 79236/** 79237 * @typedef {import('hast').Element} Element 79238 * @typedef {import('mdast').ThematicBreak} ThematicBreak 79239 * @typedef {import('../state.js').State} State 79240 */ 79241 79242/** 79243 * Turn an mdast `thematicBreak` node into hast. 79244 * 79245 * @param {State} state 79246 * Info passed around. 79247 * @param {ThematicBreak} node 79248 * mdast node. 79249 * @returns {Element} 79250 * hast node. 79251 */ 79252function thematic_break_thematicBreak(state, node) { 79253 /** @type {Element} */ 79254 const result = { 79255 type: 'element', 79256 tagName: 'hr', 79257 properties: {}, 79258 children: [] 79259 } 79260 state.patch(node, result) 79261 return state.applyData(node, result) 79262} 79263 79264;// ./node_modules/mdast-util-to-hast/lib/handlers/index.js 79265 79266 79267 79268 79269 79270 79271 79272 79273 79274 79275 79276 79277 79278 79279 79280 79281 79282 79283 79284 79285 79286 79287 79288 79289 79290/** 79291 * Default handlers for nodes. 79292 */ 79293const handlers = { 79294 blockquote: blockquote, 79295 break: hardBreak, 79296 code: code, 79297 delete: strikethrough, 79298 emphasis: emphasis, 79299 footnoteReference: footnoteReference, 79300 footnote: footnote, 79301 heading: heading, 79302 html: html, 79303 imageReference: imageReference, 79304 image: image_image, 79305 inlineCode: inlineCode, 79306 linkReference: linkReference, 79307 link: link_link, 79308 listItem: listItem, 79309 list: list_list, 79310 paragraph: paragraph, 79311 root: root, 79312 strong: strong, 79313 table: table, 79314 tableCell: tableCell, 79315 tableRow: tableRow, 79316 text: handlers_text_text, 79317 thematicBreak: thematic_break_thematicBreak, 79318 toml: ignore, 79319 yaml: ignore, 79320 definition: ignore, 79321 footnoteDefinition: ignore 79322} 79323 79324// Return nothing for nodes that are ignored. 79325function ignore() { 79326 // To do: next major: return `undefined`. 79327 return null 79328} 79329 79330;// ./node_modules/mdast-util-to-hast/lib/state.js 79331/** 79332 * @typedef {import('hast').Content} HastContent 79333 * @typedef {import('hast').Element} HastElement 79334 * @typedef {import('hast').ElementContent} HastElementContent 79335 * @typedef {import('hast').Properties} HastProperties 79336 * @typedef {import('hast').Root} HastRoot 79337 * @typedef {import('hast').Text} HastText 79338 * 79339 * @typedef {import('mdast').Content} MdastContent 79340 * @typedef {import('mdast').Definition} MdastDefinition 79341 * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition 79342 * @typedef {import('mdast').Parent} MdastParent 79343 * @typedef {import('mdast').Root} MdastRoot 79344 */ 79345 79346/** 79347 * @typedef {HastRoot | HastContent} HastNodes 79348 * @typedef {MdastRoot | MdastContent} MdastNodes 79349 * @typedef {Extract<MdastNodes, MdastParent>} MdastParents 79350 * 79351 * @typedef EmbeddedHastFields 79352 * hast fields. 79353 * @property {string | null | undefined} [hName] 79354 * Generate a specific element with this tag name instead. 79355 * @property {HastProperties | null | undefined} [hProperties] 79356 * Generate an element with these properties instead. 79357 * @property {Array<HastElementContent> | null | undefined} [hChildren] 79358 * Generate an element with this content instead. 79359 * 79360 * @typedef {Record<string, unknown> & EmbeddedHastFields} MdastData 79361 * mdast data with embedded hast fields. 79362 * 79363 * @typedef {MdastNodes & {data?: MdastData | null | undefined}} MdastNodeWithData 79364 * mdast node with embedded hast data. 79365 * 79366 * @typedef PointLike 79367 * Point-like value. 79368 * @property {number | null | undefined} [line] 79369 * Line. 79370 * @property {number | null | undefined} [column] 79371 * Column. 79372 * @property {number | null | undefined} [offset] 79373 * Offset. 79374 * 79375 * @typedef PositionLike 79376 * Position-like value. 79377 * @property {PointLike | null | undefined} [start] 79378 * Point-like value. 79379 * @property {PointLike | null | undefined} [end] 79380 * Point-like value. 79381 * 79382 * @callback Handler 79383 * Handle a node. 79384 * @param {State} state 79385 * Info passed around. 79386 * @param {any} node 79387 * mdast node to handle. 79388 * @param {MdastParents | null | undefined} parent 79389 * Parent of `node`. 79390 * @returns {HastElementContent | Array<HastElementContent> | null | undefined} 79391 * hast node. 79392 * 79393 * @callback HFunctionProps 79394 * Signature of `state` for when props are passed. 79395 * @param {MdastNodes | PositionLike | null | undefined} node 79396 * mdast node or unist position. 79397 * @param {string} tagName 79398 * HTML tag name. 79399 * @param {HastProperties} props 79400 * Properties. 79401 * @param {Array<HastElementContent> | null | undefined} [children] 79402 * hast content. 79403 * @returns {HastElement} 79404 * Compiled element. 79405 * 79406 * @callback HFunctionNoProps 79407 * Signature of `state` for when no props are passed. 79408 * @param {MdastNodes | PositionLike | null | undefined} node 79409 * mdast node or unist position. 79410 * @param {string} tagName 79411 * HTML tag name. 79412 * @param {Array<HastElementContent> | null | undefined} [children] 79413 * hast content. 79414 * @returns {HastElement} 79415 * Compiled element. 79416 * 79417 * @typedef HFields 79418 * Info on `state`. 79419 * @property {boolean} dangerous 79420 * Whether HTML is allowed. 79421 * @property {string} clobberPrefix 79422 * Prefix to use to prevent DOM clobbering. 79423 * @property {string} footnoteLabel 79424 * Label to use to introduce the footnote section. 79425 * @property {string} footnoteLabelTagName 79426 * HTML used for the footnote label. 79427 * @property {HastProperties} footnoteLabelProperties 79428 * Properties on the HTML tag used for the footnote label. 79429 * @property {string} footnoteBackLabel 79430 * Label to use from backreferences back to their footnote call. 79431 * @property {(identifier: string) => MdastDefinition | null} definition 79432 * Definition cache. 79433 * @property {Record<string, MdastFootnoteDefinition>} footnoteById 79434 * Footnote definitions by their identifier. 79435 * @property {Array<string>} footnoteOrder 79436 * Identifiers of order when footnote calls first appear in tree order. 79437 * @property {Record<string, number>} footnoteCounts 79438 * Counts for how often the same footnote was called. 79439 * @property {Handlers} handlers 79440 * Applied handlers. 79441 * @property {Handler} unknownHandler 79442 * Handler for any none not in `passThrough` or otherwise handled. 79443 * @property {(from: MdastNodes, node: HastNodes) => void} patch 79444 * Copy a nodeâs positional info. 79445 * @property {<Type extends HastNodes>(from: MdastNodes, to: Type) => Type | HastElement} applyData 79446 * Honor the `data` of `from`, and generate an element instead of `node`. 79447 * @property {(node: MdastNodes, parent: MdastParents | null | undefined) => HastElementContent | Array<HastElementContent> | null | undefined} one 79448 * Transform an mdast node to hast. 79449 * @property {(node: MdastNodes) => Array<HastElementContent>} all 79450 * Transform the children of an mdast parent to hast. 79451 * @property {<Type extends HastContent>(nodes: Array<Type>, loose?: boolean | null | undefined) => Array<Type | HastText>} wrap 79452 * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`. 79453 * @property {(left: MdastNodeWithData | PositionLike | null | undefined, right: HastElementContent) => HastElementContent} augment 79454 * Like `state` but lower-level and usable on non-elements. 79455 * Deprecated: use `patch` and `applyData`. 79456 * @property {Array<string>} passThrough 79457 * List of node types to pass through untouched (except for their children). 79458 * 79459 * @typedef Options 79460 * Configuration (optional). 79461 * @property {boolean | null | undefined} [allowDangerousHtml=false] 79462 * Whether to persist raw HTML in markdown in the hast tree. 79463 * @property {string | null | undefined} [clobberPrefix='user-content-'] 79464 * Prefix to use before the `id` attribute on footnotes to prevent it from 79465 * *clobbering*. 79466 * @property {string | null | undefined} [footnoteBackLabel='Back to content'] 79467 * Label to use from backreferences back to their footnote call (affects 79468 * screen readers). 79469 * @property {string | null | undefined} [footnoteLabel='Footnotes'] 79470 * Label to use for the footnotes section (affects screen readers). 79471 * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}] 79472 * Properties to use on the footnote label (note that `id: 'footnote-label'` 79473 * is always added as footnote calls use it with `aria-describedby` to 79474 * provide an accessible label). 79475 * @property {string | null | undefined} [footnoteLabelTagName='h2'] 79476 * Tag name to use for the footnote label. 79477 * @property {Handlers | null | undefined} [handlers] 79478 * Extra handlers for nodes. 79479 * @property {Array<string> | null | undefined} [passThrough] 79480 * List of custom mdast node types to pass through (keep) in hast (note that 79481 * the node itself is passed, but eventual children are transformed). 79482 * @property {Handler | null | undefined} [unknownHandler] 79483 * Handler for all unknown nodes. 79484 * 79485 * @typedef {Record<string, Handler>} Handlers 79486 * Handle nodes. 79487 * 79488 * @typedef {HFunctionProps & HFunctionNoProps & HFields} State 79489 * Info passed around. 79490 */ 79491 79492 79493 79494 79495 79496 79497 79498const state_own = {}.hasOwnProperty 79499 79500/** 79501 * Create `state` from an mdast tree. 79502 * 79503 * @param {MdastNodes} tree 79504 * mdast node to transform. 79505 * @param {Options | null | undefined} [options] 79506 * Configuration. 79507 * @returns {State} 79508 * `state` function. 79509 */ 79510function createState(tree, options) { 79511 const settings = options || {} 79512 const dangerous = settings.allowDangerousHtml || false 79513 /** @type {Record<string, MdastFootnoteDefinition>} */ 79514 const footnoteById = {} 79515 79516 // To do: next major: add `options` to state, remove: 79517 // `dangerous`, `clobberPrefix`, `footnoteLabel`, `footnoteLabelTagName`, 79518 // `footnoteLabelProperties`, `footnoteBackLabel`, `passThrough`, 79519 // `unknownHandler`. 79520 79521 // To do: next major: move to `state.options.allowDangerousHtml`. 79522 state.dangerous = dangerous 79523 // To do: next major: move to `state.options`. 79524 state.clobberPrefix = 79525 settings.clobberPrefix === undefined || settings.clobberPrefix === null 79526 ? 'user-content-' 79527 : settings.clobberPrefix 79528 // To do: next major: move to `state.options`. 79529 state.footnoteLabel = settings.footnoteLabel || 'Footnotes' 79530 // To do: next major: move to `state.options`. 79531 state.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2' 79532 // To do: next major: move to `state.options`. 79533 state.footnoteLabelProperties = settings.footnoteLabelProperties || { 79534 className: ['sr-only'] 79535 } 79536 // To do: next major: move to `state.options`. 79537 state.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content' 79538 // To do: next major: move to `state.options`. 79539 state.unknownHandler = settings.unknownHandler 79540 // To do: next major: move to `state.options`. 79541 state.passThrough = settings.passThrough 79542 79543 state.handlers = {...handlers, ...settings.handlers} 79544 79545 // To do: next major: replace utility with `definitionById` object, so we 79546 // only walk once (as we need footnotes too). 79547 state.definition = definitions(tree) 79548 state.footnoteById = footnoteById 79549 /** @type {Array<string>} */ 79550 state.footnoteOrder = [] 79551 /** @type {Record<string, number>} */ 79552 state.footnoteCounts = {} 79553 79554 state.patch = patch 79555 state.applyData = applyData 79556 state.one = oneBound 79557 state.all = allBound 79558 state.wrap = state_wrap 79559 // To do: next major: remove `augment`. 79560 state.augment = augment 79561 79562 visit(tree, 'footnoteDefinition', (definition) => { 79563 const id = String(definition.identifier).toUpperCase() 79564
79565 // Mimick CM behavior of link definitions. 79566 // See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8290999/index.js#L26>. 79567 if (!state_own.call(footnoteById, id)) { 79568 footnoteById[id] = definition 79569 } 79570 }) 79571 79572 // @ts-expect-error Hush, itâs fine! 79573 return state 79574 79575 /** 79576 * Finalise the created `right`, a hast node, from `left`, an mdast node. 79577 * 79578 * @param {MdastNodeWithData | PositionLike | null | undefined} left 79579 * @param {HastElementContent} right 79580 * @returns {HastElementContent} 79581 */ 79582 /* c8 ignore start */ 79583 // To do: next major: remove. 79584 function augment(left, right) { 79585 // Handle `data.hName`, `data.hProperties, `data.hChildren`. 79586 if (left && 'data' in left && left.data) { 79587 /** @type {MdastData} */ 79588 const data = left.data 79589 79590 if (data.hName) { 79591 if (right.type !== 'element') { 79592 right = { 79593 type: 'element', 79594 tagName: '', 79595 properties: {}, 79596 children: [] 79597 } 79598 } 79599 79600 right.tagName = data.hName 79601 } 79602 79603 if (right.type === 'element' && data.hProperties) { 79604 right.properties = {...right.properties, ...data.hProperties} 79605 } 79606 79607 if ('children' in right && right.children && data.hChildren) { 79608 right.children = data.hChildren 79609 } 79610 } 79611 79612 if (left) { 79613 const ctx = 'type' in left ? left : {position: left} 79614 79615 if (!generated(ctx)) { 79616 // @ts-expect-error: fine. 79617 right.position = {start: pointStart(ctx), end: pointEnd(ctx)} 79618 } 79619 } 79620 79621 return right 79622 } 79623 /* c8 ignore stop */ 79624 79625 /** 79626 * Create an element for `node`. 79627 * 79628 * @type {HFunctionProps} 79629 */ 79630 /* c8 ignore start */ 79631 // To do: next major: remove. 79632 function state(node, tagName, props, children) { 79633 if (Array.isArray(props)) { 79634 children = props 79635 props = {} 79636 } 79637 79638 // @ts-expect-error augmenting an element yields an element. 79639 return augment(node, { 79640 type: 'element', 79641 tagName, 79642 properties: props || {}, 79643 children: children || [] 79644 }) 79645 } 79646 /* c8 ignore stop */ 79647 79648 /** 79649 * Transform an mdast node into a hast node. 79650 * 79651 * @param {MdastNodes} node 79652 * mdast node. 79653 * @param {MdastParents | null | undefined} [parent] 79654 * Parent of `node`. 79655 * @returns {HastElementContent | Array<HastElementContent> | null | undefined} 79656 * Resulting hast node. 79657 */ 79658 function oneBound(node, parent) { 79659 // @ts-expect-error: thatâs a state :) 79660 return state_one(state, node, parent) 79661 } 79662 79663 /** 79664 * Transform the children of an mdast node into hast nodes. 79665 * 79666 * @param {MdastNodes} parent 79667 * mdast node to compile 79668 * @returns {Array<HastElementContent>} 79669 * Resulting hast nodes. 79670 */ 79671 function allBound(parent) { 79672 // @ts-expect-error: thatâs a state :) 79673 return state_all(state, parent) 79674 } 79675} 79676 79677/** 79678 * Copy a nodeâs positional info. 79679 * 79680 * @param {MdastNodes} from 79681 * mdast node to copy from. 79682 * @param {HastNodes} to 79683 * hast node to copy into. 79684 * @returns {void} 79685 * Nothing. 79686 */ 79687function patch(from, to) { 79688 if (from.position) to.position = lib_position(from) 79689} 79690 79691/** 79692 * Honor the `data` of `from` and maybe generate an element instead of `to`. 79693 * 79694 * @template {HastNodes} Type 79695 * Node type. 79696 * @param {MdastNodes} from 79697 * mdast node to use data from. 79698 * @param {Type} to 79699 * hast node to change. 79700 * @returns {Type | HastElement} 79701 * Nothing. 79702 */ 79703function applyData(from, to) { 79704 /** @type {Type | HastElement} */ 79705 let result = to 79706 79707 // Handle `data.hName`, `data.hProperties, `data.hChildren`. 79708 if (from && from.data) { 79709 const hName = from.data.hName 79710 const hChildren = from.data.hChildren 79711 const hProperties = from.data.hProperties 79712 79713 if (typeof hName === 'string') { 79714 // Transforming the node resulted in an element with a different name 79715 // than wanted: 79716 if (result.type === 'element') { 79717 result.tagName = hName 79718 } 79719 // Transforming the node resulted in a non-element, which happens for 79720 // raw, text, and root nodes (unless custom handlers are passed). 79721 // The intent is likely to keep the content around (otherwise: pass 79722 // `hChildren`).
79723 else { 79724 result = { 79725 type: 'element', 79726 tagName: hName, 79727 properties: {}, 79728 children: [] 79729 } 79730 79731 // To do: next major: take the children from the `root`, or inject the 79732 // raw/text/comment or so into the element? 79733 // if ('children' in node) { 79734 // // @ts-expect-error: assume `children` are allowed in elements. 79735 // result.children = node.children 79736 // } else { 79737 // // @ts-expect-error: assume `node` is allowed in elements. 79738 // result.children.push(node) 79739 // } 79740 } 79741 } 79742 79743 if (result.type === 'element' && hProperties) { 79744 result.properties = {...result.properties, ...hProperties} 79745 } 79746 79747 if ( 79748 'children' in result && 79749 result.children && 79750 hChildren !== null && 79751 hChildren !== undefined 79752 ) { 79753 // @ts-expect-error: assume valid children are defined. 79754 result.children = hChildren 79755 } 79756 } 79757 79758 return result 79759} 79760 79761/** 79762 * Transform an mdast node into a hast node. 79763 * 79764 * @param {State} state 79765 * Info passed around. 79766 * @param {MdastNodes} node 79767 * mdast node. 79768 * @param {MdastParents | null | undefined} [parent] 79769 * Parent of `node`. 79770 * @returns {HastElementContent | Array<HastElementContent> | null | undefined} 79771 * Resulting hast node. 79772 */ 79773// To do: next major: do not expose, keep bound. 79774function state_one(state, node, parent) { 79775 const type = node && node.type 79776 79777 // Fail on non-nodes. 79778 if (!type) { 79779 throw new Error('Expected node, got `' + node + '`') 79780 } 79781 79782 if (state_own.call(state.handlers, type)) { 79783 return state.handlers[type](state, node, parent) 79784 } 79785 79786 if (state.passThrough && state.passThrough.includes(type)) { 79787 // To do: next major: deep clone. 79788 // @ts-expect-error: types of passed through nodes are expected to be added manually. 79789 return 'children' in node ? {...node, children: state_all(state, node)} : node 79790 } 79791 79792 if (state.unknownHandler) { 79793 return state.unknownHandler(state, node, parent) 79794 } 79795 79796 return defaultUnknownHandler(state, node) 79797} 79798 79799/** 79800 * Transform the children of an mdast node into hast nodes. 79801 * 79802 * @param {State} state 79803 * Info passed around. 79804 * @param {MdastNodes} parent 79805 * mdast node to compile 79806 * @returns {Array<HastElementContent>} 79807 * Resulting hast nodes. 79808 */ 79809// To do: next major: do not expose, keep bound. 79810function state_all(state, parent) { 79811 /** @type {Array<HastElementContent>} */ 79812 const values = [] 79813 79814 if ('children' in parent) { 79815 const nodes = parent.children 79816 let index = -1 79817 while (++index < nodes.length) { 79818 const result = state_one(state, nodes[index], parent) 79819 79820 // To do: see if we van clean this? Can we merge texts? 79821 if (result) { 79822 if (index && nodes[index - 1].type === 'break') { 79823 if (!Array.isArray(result) && result.type === 'text') { 79824 result.value = result.value.replace(/^\s+/, '') 79825 } 79826 79827 if (!Array.isArray(result) && result.type === 'element') { 79828 const head = result.children[0] 79829 79830 if (head && head.type === 'text') { 79831 head.value = head.value.replace(/^\s+/, '') 79832 } 79833 } 79834 } 79835 79836 if (Array.isArray(result)) { 79837 values.push(...result) 79838 } else { 79839 values.push(result) 79840 } 79841 } 79842 } 79843 } 79844 79845 return values 79846} 79847 79848/** 79849 * Transform an unknown node. 79850 * 79851 * @param {State} state 79852 * Info passed around. 79853 * @param {MdastNodes} node 79854 * Unknown mdast node. 79855 * @returns {HastText | HastElement} 79856 * Resulting hast node. 79857 */ 79858function defaultUnknownHandler(state, node) { 79859 const data = node.data || {} 79860 /** @type {HastText | HastElement} */ 79861 const result = 79862 'value' in node && 79863 !(state_own.call(data, 'hProperties') || state_own.call(data, 'hChildren')) 79864 ? {type: 'text', value: node.value} 79865 : { 79866 type: 'element', 79867 tagName: 'div', 79868 properties: {}, 79869 children: state_all(state, node) 79870 } 79871 79872 state.patch(node, result) 79873 return state.applyData(node, result) 79874} 79875 79876/** 79877 * Wrap `nodes` with line endings between each node. 79878 * 79879 * @template {HastContent} Type 79880 * Node type. 79881 * @param {Array<Type>} nodes 79882 * List of nodes to wrap. 79883 * @param {boolean | null | undefined} [loose=false] 79884 * Whether to add line endings at start and end. 79885 * @returns {Array<Type | HastText>} 79886 * Wrapped nodes. 79887 */ 79888function state_wrap(nodes, loose) { 79889 /** @type {Array<Type | HastText>} */ 79890 const result = [] 79891 let index = -1 79892 79893 if (loose) { 79894 result.push({type: 'text', value: '\n'}) 79895 } 79896
79897 while (++index < nodes.length) { 79898 if (index) result.push({type: 'text', value: '\n'}) 79899 result.push(nodes[index]) 79900 } 79901 79902 if (loose && nodes.length > 0) { 79903 result.push({type: 'text', value: '\n'}) 79904 } 79905 79906 return result 79907} 79908 79909;// ./node_modules/mdast-util-to-hast/lib/index.js 79910/** 79911 * @typedef {import('hast').Content} HastContent 79912 * @typedef {import('hast').Root} HastRoot 79913 * 79914 * @typedef {import('mdast').Content} MdastContent 79915 * @typedef {import('mdast').Root} MdastRoot 79916 * 79917 * @typedef {import('./state.js').Options} Options 79918 */ 79919 79920/** 79921 * @typedef {HastRoot | HastContent} HastNodes 79922 * @typedef {MdastRoot | MdastContent} MdastNodes 79923 */ 79924 79925 79926 79927 79928/** 79929 * Transform mdast to hast. 79930 * 79931 * ##### Notes 79932 * 79933 * ###### HTML 79934 * 79935 * Raw HTML is available in mdast as `html` nodes and can be embedded in hast 79936 * as semistandard `raw` nodes. 79937 * Most utilities ignore `raw` nodes but two notable ones donât: 79938 * 79939 * * `hast-util-to-html` also has an option `allowDangerousHtml` which will 79940 * output the raw HTML. 79941 * This is typically discouraged as noted by the option name but is useful 79942 * if you completely trust authors 79943 * * `hast-util-raw` can handle the raw embedded HTML strings by parsing them 79944 * into standard hast nodes (`element`, `text`, etc). 79945 * This is a heavy task as it needs a full HTML parser, but it is the only 79946 * way to support untrusted content 79947 * 79948 * ###### Footnotes 79949 * 79950 * Many options supported here relate to footnotes. 79951 * Footnotes are not specified by CommonMark, which we follow by default. 79952 * They are supported by GitHub, so footnotes can be enabled in markdown with 79953 * `mdast-util-gfm`. 79954 * 79955 * The options `footnoteBackLabel` and `footnoteLabel` define natural language 79956 * that explains footnotes, which is hidden for sighted users but shown to 79957 * assistive technology. 79958 * When your page is not in English, you must define translated values. 79959 * 79960 * Back references use ARIA attributes, but the section label itself uses a 79961 * heading that is hidden with an `sr-only` class. 79962 * To show it to sighted users, define different attributes in 79963 * `footnoteLabelProperties`. 79964 * 79965 * ###### Clobbering 79966 * 79967 * Footnotes introduces a problem, as it links footnote calls to footnote 79968 * definitions on the page through `id` attributes generated from user content, 79969 * which results in DOM clobbering. 79970 * 79971 * DOM clobbering is this: 79972 * 79973 * ```html 79974 * <p id=x></p> 79975 * <script>alert(x) // `x` now refers to the DOM `p#x` element</script> 79976 * ``` 79977 * 79978 * Elements by their ID are made available by browsers on the `window` object, 79979 * which is a security risk. 79980 * Using a prefix solves this problem. 79981 * 79982 * More information on how to handle clobbering and the prefix is explained in 79983 * Example: headings (DOM clobbering) in `rehype-sanitize`. 79984 * 79985 * ###### Unknown nodes 79986 * 79987 * Unknown nodes are nodes with a type that isnât in `handlers` or `passThrough`. 79988 * The default behavior for unknown nodes is: 79989 * 79990 * * when the node has a `value` (and doesnât have `data.hName`, 79991 * `data.hProperties`, or `data.hChildren`, see later), create a hast `text` 79992 * node 79993 * * otherwise, create a `<div>` element (which could be changed with 79994 * `data.hName`), with its children mapped from mdast to hast as well 79995 * 79996 * This behavior can be changed by passing an `unknownHandler`. 79997 * 79998 * @param {MdastNodes} tree 79999 * mdast tree. 80000 * @param {Options | null | undefined} [options] 80001 * Configuration. 80002 * @returns {HastNodes | null | undefined} 80003 * hast tree. 80004 */ 80005// To do: next major: always return a single `root`. 80006function toHast(tree, options) { 80007 const state = createState(tree, options) 80008 const node = state.one(tree, null) 80009 const foot = footer(state) 80010 80011 if (foot) { 80012 // @ts-expect-error If thereâs a footer, there were definitions, meaning block 80013 // content. 80014 // So assume `node` is a parent node. 80015 node.children.push({type: 'text', value: '\n'}, foot) 80016 } 80017 80018 // To do: next major: always return root? 80019 return Array.isArray(node) ? {type: 'root', children: node} : node 80020} 80021 80022;// ./node_modules/remark-rehype/lib/index.js 80023/** 80024 * @typedef {import('hast').Root} HastRoot 80025 * @typedef {import('mdast').Root} MdastRoot 80026 * @typedef {import('mdast-util-to-hast').Options} Options 80027 * @typedef {import('unified').Processor<any, any, any, any>} Processor 80028 * 80029 * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree 80030 */ 80031 80032 80033 80034// Note: the `<MdastRoot, HastRoot>` overload doesnât seem to work :'( 80035 80036/** 80037 * Plugin that turns markdown into HTML to support rehype. 80038 * 80039 * * If a destination processor is given, that processor runs with a new HTML 80040 * (hast) tree (bridge-mode). 80041 * As the given processor runs with a hast tree, and rehype plugins supp
80041ort 80042 * hast, that means rehype plugins can be used with the given processor. 80043 * The hast tree is discarded in the end. 80044 * Itâs highly unlikely that you want to do this. 80045 * * The common case is to not pass a destination processor, in which case the 80046 * current processor continues running with a new HTML (hast) tree 80047 * (mutate-mode). 80048 * As the current processor continues with a hast tree, and rehype plugins 80049 * support hast, that means rehype plugins can be used after 80050 * `remark-rehype`. 80051 * Itâs likely that this is what you want to do. 80052 * 80053 * @param destination 80054 * Optional unified processor. 80055 * @param options 80056 * Options passed to `mdast-util-to-hast`. 80057 */ 80058const remarkRehype = 80059 /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */ 80060 ( 80061 function (destination, options) { 80062 return destination && 'run' in destination 80063 ? bridge(destination, options) 80064 : mutate(destination || options) 80065 } 80066 ) 80067 80068/* harmony default export */ const lib = (remarkRehype); 80069 80070/** 80071 * Bridge-mode. 80072 * Runs the destination with the new hast tree. 80073 * 80074 * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>} 80075 */ 80076function bridge(destination, options) { 80077 return (node, file, next) => { 80078 destination.run(toHast(node, options), file, (error) => { 80079 next(error) 80080 }) 80081 } 80082} 80083 80084/** 80085 * Mutate-mode. 80086 * Further plugins run on the hast tree. 80087 * 80088 * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>} 80089 */ 80090function mutate(options) { 80091 // @ts-expect-error: assume a corresponding node is returned by `toHast`. 80092 return (node) => toHast(node, options) 80093} 80094 80095// EXTERNAL MODULE: ./node_modules/prop-types/index.js 80096var prop_types = __webpack_require__(5556); 80097var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types); 80098;// ./node_modules/property-information/lib/util/schema.js 80099/** 80100 * @typedef {import('./info.js').Info} Info 80101 * @typedef {Record<string, Info>} Properties 80102 * @typedef {Record<string, string>} Normal 80103 */ 80104 80105class Schema { 80106 /** 80107 * @constructor 80108 * @param {Properties} property 80109 * @param {Normal} normal 80110 * @param {string} [space] 80111 */ 80112 constructor(property, normal, space) { 80113 this.property = property 80114 this.normal = normal 80115 if (space) { 80116 this.space = space 80117 } 80118 } 80119} 80120 80121/** @type {Properties} */ 80122Schema.prototype.property = {} 80123/** @type {Normal} */ 80124Schema.prototype.normal = {} 80125/** @type {string|null} */ 80126Schema.prototype.space = null 80127 80128;// ./node_modules/property-information/lib/util/merge.js 80129/** 80130 * @typedef {import('./schema.js').Properties} Properties 80131 * @typedef {import('./schema.js').Normal} Normal 80132 */ 80133 80134 80135 80136/** 80137 * @param {Schema[]} definitions 80138 * @param {string} [space] 80139 * @returns {Schema} 80140 */ 80141function merge(definitions, space) { 80142 /** @type {Properties} */ 80143 const property = {} 80144 /** @type {Normal} */ 80145 const normal = {} 80146 let index = -1 80147 80148 while (++index < definitions.length) { 80149 Object.assign(property, definitions[index].property) 80150 Object.assign(normal, definitions[index].normal) 80151 } 80152 80153 return new Schema(property, normal, space) 80154} 80155 80156;// ./node_modules/property-information/lib/normalize.js 80157/** 80158 * @param {string} value 80159 * @returns {string} 80160 */ 80161function normalize_normalize(value) { 80162 return value.toLowerCase() 80163} 80164 80165;// ./node_modules/property-information/lib/util/info.js 80166class Info { 80167 /** 80168 * @constructor 80169 * @param {string} property 80170 * @param {string} attribute 80171 */ 80172 constructor(property, attribute) { 80173 /** @type {string} */ 80174 this.property = property 80175 /** @type {string} */ 80176 this.attribute = attribute 80177 } 80178} 80179 80180/** @type {string|null} */ 80181Info.prototype.space = null 80182Info.prototype.boolean = false 80183Info.prototype.booleanish = false 80184Info.prototype.overloadedBoolean = false 80185Info.prototype.number = false 80186Info.prototype.commaSeparated = false 80187Info.prototype.spaceSeparated = false 80188Info.prototype.commaOrSpaceSeparated = false 80189Info.prototype.mustUseProperty = false 80190Info.prototype.defined = false 80191 80192;// ./node_modules/property-information/lib/util/types.js 80193let powers = 0 80194 80195const types_boolean = increment() 80196const booleanish = increment() 80197const overloadedBoolean = increment() 80198const number = increment() 80199const spaceSeparated = increment() 80200const commaSeparated = increment() 80201const commaOrSpaceSeparated = increment() 80202 80203function increment() { 80204 return 2 ** ++powers 80205} 80206 80207;// ./node_modules/property-information/lib/util/defined-info.js 80208 80209 80210 80211/** @type {Array<keyof types>} */ 80212// @ts-expect-error: hush. 80213const checks = Object.keys(types_namespaceObject) 80214 80215class DefinedInfo extends Info { 80216 /** 80217 * @constructor 80218 * @param {string} property 80219 * @param {string} attribute 80220 * @param {number|null} [mask] 80221 * @param {string} [space] 80222 */ 80223 constructor(property, attribute, mask, space) { 80224 let index = -1 80225 80226 super(property, attribute) 80227 80228 mark(this, 'space', space) 80229 80230 if (typeof mask === 'number') { 80231 while (++index < checks.length) { 80232 const check = checks[index]
80233 mark(this, checks[index], (mask & types_namespaceObject[check]) === types_namespaceObject[check]) 80234 } 80235 } 80236 } 80237} 80238 80239DefinedInfo.prototype.defined = true 80240 80241/** 80242 * @param {DefinedInfo} values 80243 * @param {string} key 80244 * @param {unknown} value 80245 */ 80246function mark(values, key, value) { 80247 if (value) { 80248 // @ts-expect-error: assume `value` matches the expected value of `key`. 80249 values[key] = value 80250 } 80251} 80252 80253;// ./node_modules/property-information/lib/util/create.js 80254/** 80255 * @typedef {import('./schema.js').Properties} Properties 80256 * @typedef {import('./schema.js').Normal} Normal 80257 * 80258 * @typedef {Record<string, string>} Attributes 80259 * 80260 * @typedef {Object} Definition 80261 * @property {Record<string, number|null>} properties 80262 * @property {(attributes: Attributes, property: string) => string} transform 80263 * @property {string} [space] 80264 * @property {Attributes} [attributes] 80265 * @property {Array<string>} [mustUseProperty] 80266 */ 80267 80268 80269 80270 80271 80272const create_own = {}.hasOwnProperty 80273 80274/** 80275 * @param {Definition} definition 80276 * @returns {Schema} 80277 */ 80278function create(definition) { 80279 /** @type {Properties} */ 80280 const property = {} 80281 /** @type {Normal} */ 80282 const normal = {} 80283 /** @type {string} */ 80284 let prop 80285 80286 for (prop in definition.properties) { 80287 if (create_own.call(definition.properties, prop)) { 80288 const value = definition.properties[prop] 80289 const info = new DefinedInfo( 80290 prop, 80291 definition.transform(definition.attributes || {}, prop), 80292 value, 80293 definition.space 80294 ) 80295 80296 if ( 80297 definition.mustUseProperty && 80298 definition.mustUseProperty.includes(prop) 80299 ) { 80300 info.mustUseProperty = true 80301 } 80302 80303 property[prop] = info 80304 80305 normal[normalize_normalize(prop)] = prop 80306 normal[normalize_normalize(info.attribute)] = prop 80307 } 80308 } 80309 80310 return new Schema(property, normal, definition.space) 80311} 80312 80313;// ./node_modules/property-information/lib/xlink.js 80314 80315 80316const xlink = create({ 80317 space: 'xlink', 80318 transform(_, prop) { 80319 return 'xlink:' + prop.slice(5).toLowerCase() 80320 }, 80321 properties: { 80322 xLinkActuate: null, 80323 xLinkArcRole: null, 80324 xLinkHref: null, 80325 xLinkRole: null, 80326 xLinkShow: null, 80327 xLinkTitle: null, 80328 xLinkType: null 80329 } 80330}) 80331 80332;// ./node_modules/property-information/lib/xml.js 80333 80334 80335const xml = create({ 80336 space: 'xml', 80337 transform(_, prop) { 80338 return 'xml:' + prop.slice(3).toLowerCase() 80339 }, 80340 properties: {xmlLang: null, xmlBase: null, xmlSpace: null} 80341}) 80342 80343;// ./node_modules/property-information/lib/util/case-sensitive-transform.js 80344/** 80345 * @param {Record<string, string>} attributes 80346 * @param {string} attribute 80347 * @returns {string} 80348 */ 80349function caseSensitiveTransform(attributes, attribute) { 80350 return attribute in attributes ? attributes[attribute] : attribute 80351} 80352 80353;// ./node_modules/property-information/lib/util/case-insensitive-transform.js 80354 80355 80356/** 80357 * @param {Record<string, string>} attributes 80358 * @param {string} property 80359 * @returns {string} 80360 */ 80361function caseInsensitiveTransform(attributes, property) { 80362 return caseSensitiveTransform(attributes, property.toLowerCase()) 80363} 80364 80365;// ./node_modules/property-information/lib/xmlns.js 80366 80367 80368 80369const xmlns = create({ 80370 space: 'xmlns', 80371 attributes: {xmlnsxlink: 'xmlns:xlink'}, 80372 transform: caseInsensitiveTransform, 80373 properties: {xmlns: null, xmlnsXLink: null} 80374}) 80375 80376;// ./node_modules/property-information/lib/aria.js 80377 80378 80379 80380const aria = create({ 80381 transform(_, prop) { 80382 return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase() 80383 }, 80384 properties: { 80385 ariaActiveDescendant: null, 80386 ariaAtomic: booleanish, 80387 ariaAutoComplete: null, 80388 ariaBusy: booleanish, 80389 ariaChecked: booleanish, 80390 ariaColCount: number, 80391 ariaColIndex: number, 80392 ariaColSpan: number, 80393 ariaControls: spaceSeparated, 80394 ariaCurrent: null, 80395 ariaDescribedBy: spaceSeparated, 80396 ariaDetails: null, 80397 ariaDisabled: booleanish, 80398 ariaDropEffect: spaceSeparated, 80399 ariaErrorMessage: null, 80400 ariaExpanded: booleanish, 80401 ariaFlowTo: spaceSeparated, 80402 ariaGrabbed: booleanish, 80403 ariaHasPopup: null, 80404 ariaHidden: booleanish, 80405 ariaInvalid: null, 80406 ariaKeyShortcuts: null, 80407 ariaLabel: null, 80408 ariaLabelledBy: spaceSeparated,
vendor: 5,247 bytes, lines 80409-80636
80409 ariaLevel: number, 80410 ariaLive: null, 80411 ariaModal: booleanish, 80412 ariaMultiLine: booleanish, 80413 ariaMultiSelectable: booleanish, 80414 ariaOrientation: null, 80415 ariaOwns: spaceSeparated, 80416 ariaPlaceholder: null, 80417 ariaPosInSet: number, 80418 ariaPressed: booleanish, 80419 ariaReadOnly: booleanish, 80420 ariaRelevant: null, 80421 ariaRequired: booleanish, 80422 ariaRoleDescription: spaceSeparated, 80423 ariaRowCount: number, 80424 ariaRowIndex: number, 80425 ariaRowSpan: number, 80426 ariaSelected: booleanish, 80427 ariaSetSize: number, 80428 ariaSort: null, 80429 ariaValueMax: number, 80430 ariaValueMin: number, 80431 ariaValueNow: number, 80432 ariaValueText: null, 80433 role: null 80434 } 80435}) 80436 80437;// ./node_modules/property-information/lib/html.js 80438 80439 80440 80441 80442const html_html = create({ 80443 space: 'html', 80444 attributes: { 80445 acceptcharset: 'accept-charset', 80446 classname: 'class', 80447 htmlfor: 'for', 80448 httpequiv: 'http-equiv' 80449 }, 80450 transform: caseInsensitiveTransform, 80451 mustUseProperty: ['checked', 'multiple', 'muted', 'selected'], 80452 properties: { 80453 // Standard Properties. 80454 abbr: null, 80455 accept: commaSeparated, 80456 acceptCharset: spaceSeparated, 80457 accessKey: spaceSeparated, 80458 action: null, 80459 allow: null, 80460 allowFullScreen: types_boolean, 80461 allowPaymentRequest: types_boolean, 80462 allowUserMedia: types_boolean, 80463 alt: null, 80464 as: null, 80465 async: types_boolean, 80466 autoCapitalize: null, 80467 autoComplete: spaceSeparated, 80468 autoFocus: types_boolean, 80469 autoPlay: types_boolean, 80470 blocking: spaceSeparated, 80471 capture: null, 80472 charSet: null, 80473 checked: types_boolean, 80474 cite: null, 80475 className: spaceSeparated, 80476 cols: number, 80477 colSpan: null, 80478 content: null, 80479 contentEditable: booleanish, 80480 controls: types_boolean, 80481 controlsList: spaceSeparated, 80482 coords: number | commaSeparated, 80483 crossOrigin: null, 80484 data: null, 80485 dateTime: null, 80486 decoding: null, 80487 default: types_boolean, 80488 defer: types_boolean, 80489 dir: null, 80490 dirName: null, 80491 disabled: types_boolean, 80492 download: overloadedBoolean, 80493 draggable: booleanish, 80494 encType: null, 80495 enterKeyHint: null, 80496 fetchPriority: null, 80497 form: null, 80498 formAction: null, 80499 formEncType: null, 80500 formMethod: null, 80501 formNoValidate: types_boolean, 80502 formTarget: null, 80503 headers: spaceSeparated, 80504 height: number, 80505 hidden: types_boolean, 80506 high: number, 80507 href: null, 80508 hrefLang: null, 80509 htmlFor: spaceSeparated, 80510 httpEquiv: spaceSeparated, 80511 id: null, 80512 imageSizes: null, 80513 imageSrcSet: null, 80514 inert: types_boolean, 80515 inputMode: null, 80516 integrity: null, 80517 is: null, 80518 isMap: types_boolean, 80519 itemId: null, 80520 itemProp: spaceSeparated, 80521 itemRef: spaceSeparated, 80522 itemScope: types_boolean, 80523 itemType: spaceSeparated, 80524 kind: null, 80525 label: null, 80526 lang: null, 80527 language: null, 80528 list: null, 80529 loading: null, 80530 loop: types_boolean, 80531 low: number, 80532 manifest: null, 80533 max: null, 80534 maxLength: number, 80535 media: null, 80536 method: null, 80537 min: null, 80538 minLength: number, 80539 multiple: types_boolean, 80540 muted: types_boolean, 80541 name: null, 80542 nonce: null, 80543 noModule: types_boolean, 80544 noValidate: types_boolean, 80545 onAbort: null, 80546 onAfterPrint: null, 80547 onAuxClick: null, 80548 onBeforeMatch: null, 80549 onBeforePrint: null, 80550 onBeforeToggle: null, 80551 onBeforeUnload: null, 80552 onBlur: null, 80553 onCancel: null, 80554 onCanPlay: null, 80555 onCanPlayThrough: null, 80556 onChange: null, 80557 onClick: null, 80558 onClose: null, 80559 onContextLost: null, 80560 onContextMenu: null, 80561 onContextRestored: null, 80562 onCopy: null, 80563 onCueChange: null, 80564 onCut: null, 80565 onDblClick: null, 80566 onDrag: null, 80567 onDragEnd: null, 80568 onDragEnter: null, 80569 onDragExit: null, 80570 onDragLeave: null, 80571 onDragOver: null, 80572 onDragStart: null, 80573 onDrop: null, 80574 onDurationChange: null, 80575 onEmptied: null, 80576 onEnded: null, 80577 onError: null, 80578 onFocus: null, 80579 onFormData: null, 80580 onHashChange: null, 80581 onInput: null, 80582 onInvalid: null, 80583 onKeyDown: null, 80584 onKeyPress: null, 80585 onKeyUp: null, 80586 onLanguageChange: null, 80587 onLoad: null, 80588 onLoadedData: null, 80589 onLoadedMetadata: null, 80590 onLoadEnd: null, 80591 onLoadStart: null, 80592 onMessage: null, 80593 onMessageError: null, 80594 onMouseDown: null, 80595 onMouseEnter: null, 80596 onMouseLeave: null, 80597 onMouseMove: null, 80598 onMouseOut: null, 80599 onMouseOver: null, 80600 onMouseUp: null, 80601 onOffline: null, 80602 onOnline: null, 80603 onPageHide: null, 80604 onPageShow: null, 80605 onPaste: null, 80606 onPause: null, 80607 onPlay: null, 80608 onPlaying: null, 80609 onPopState: null, 80610 onProgress: null, 80611 onRateChange: null, 80612 onRejectionHandled: null, 80613 onReset: null, 80614 onResize: null, 80615 onScroll: null, 80616 onScrollEnd: null, 80617 onSecurityPolicyViolation: null, 80618 onSeeked: null, 80619 onSeeking: null, 80620 onSelect: null, 80621 onSlotChange: null, 80622 onStalled: null, 80623 onStorage: null, 80624 onSubmit: null, 80625 onSuspend: null, 80626 onTimeUpdate: null, 80627 onToggle: null, 80628 onUnhandledRejection: null, 80629 onUnload: null, 80630 onVolumeChange: null, 80631 onWaiting: null, 80632 onWheel: null, 80633 open: types_boolean, 80634 optimum: number, 80635 pattern: null, 80636 ping: spaceSeparated,
80637 placeholder: null, 80638 playsInline: types_boolean, 80639 popover: null, 80640 popoverTarget: null, 80641 popoverTargetAction: null, 80642 poster: null, 80643 preload: null, 80644 readOnly: types_boolean, 80645 referrerPolicy: null, 80646 rel: spaceSeparated, 80647 required: types_boolean, 80648 reversed: types_boolean, 80649 rows: number, 80650 rowSpan: number, 80651 sandbox: spaceSeparated, 80652 scope: null, 80653 scoped: types_boolean, 80654 seamless: types_boolean, 80655 selected: types_boolean, 80656 shadowRootClonable: types_boolean, 80657 shadowRootDelegatesFocus: types_boolean, 80658 shadowRootMode: null, 80659 shape: null, 80660 size: number, 80661 sizes: null, 80662 slot: null, 80663 span: number, 80664 spellCheck: booleanish, 80665 src: null, 80666 srcDoc: null, 80667 srcLang: null, 80668 srcSet: null, 80669 start: number, 80670 step: null, 80671 style: null, 80672 tabIndex: number, 80673 target: null, 80674 title: null, 80675 translate: null, 80676 type: null, 80677 typeMustMatch: types_boolean, 80678 useMap: null, 80679 value: booleanish, 80680 width: number, 80681 wrap: null, 80682 writingSuggestions: null, 80683 80684 // Legacy. 80685 // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis 80686 align: null, // Several. Use CSS `text-align` instead, 80687 aLink: null, // `<body>`. Use CSS `a:active {color}` instead 80688 archive: spaceSeparated, // `<object>`. List of URIs to archives 80689 axis: null, // `<td>` and `<th>`. Use `scope` on `<th>` 80690 background: null, // `<body>`. Use CSS `background-image` instead 80691 bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead 80692 border: number, // `<table>`. Use CSS `border-width` instead, 80693 borderColor: null, // `<table>`. Use CSS `border-color` instead, 80694 bottomMargin: number, // `<body>` 80695 cellPadding: null, // `<table>` 80696 cellSpacing: null, // `<table>` 80697 char: null, // Several table elements. When `align=char`, sets the character to align on 80698 charOff: null, // Several table elements. When `char`, offsets the alignment 80699 classId: null, // `<object>` 80700 clear: null, // `<br>`. Use CSS `clear` instead 80701 code: null, // `<object>` 80702 codeBase: null, // `<object>` 80703 codeType: null, // `<object>` 80704 color: null, // `<font>` and `<hr>`. Use CSS instead 80705 compact: types_boolean, // Lists. Use CSS to reduce space between items instead 80706 declare: types_boolean, // `<object>` 80707 event: null, // `<script>` 80708 face: null, // `<font>`. Use CSS instead 80709 frame: null, // `<table>` 80710 frameBorder: null, // `<iframe>`. Use CSS `border` instead 80711 hSpace: number, // `<img>` and `<object>` 80712 leftMargin: number, // `<body>` 80713 link: null, // `<body>`. Use CSS `a:link {color: *}` instead 80714 longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>` 80715 lowSrc: null, // `<img>`. Use a `<picture>` 80716 marginHeight: number, // `<body>` 80717 marginWidth: number, // `<body>` 80718 noResize: types_boolean, // `<frame>` 80719 noHref: types_boolean, // `<area>`. Use no href instead of an explicit `nohref` 80720 noShade: types_boolean, // `<hr>`. Use background-color and height instead of borders 80721 noWrap: types_boolean, // `<td>` and `<th>` 80722 object: null, // `<applet>` 80723 profile: null, // `<head>` 80724 prompt: null, // `<isindex>` 80725 rev: null, // `<link>` 80726 rightMargin: number, // `<body>` 80727 rules: null, // `<table>` 80728 scheme: null, // `<meta>` 80729 scrolling: booleanish, // `<frame>`. Use overflow in the child context 80730 standby: null, // `<object>` 80731 summary: null, // `<table>` 80732 text: null, // `<body>`. Use CSS `color` instead 80733 topMargin: number, // `<body>` 80734 valueType: null, // `<param>` 80735 version: null, // `<html>`. Use a doctype. 80736 vAlign: null, // Several. Use CSS `vertical-align` instead 80737 vLink: null, // `<body>`. Use CSS `a:visited {color}` instead 80738 vSpace: number, // `<img>` and `<object>` 80739 80740 // Non-standard Properties. 80741 allowTransparency: null, 80742 autoCorrect: null, 80743 autoSave: null, 80744 disablePictureInPicture: types_boolean, 80745 disableRemotePlayback: types_boolean, 80746 prefix: null, 80747 property: null, 80748 results: number, 80749 security: null, 80750 unselectable: null 80751 } 80752}) 80753 80754;// ./node_modules/property-information/lib/svg.js 80755 80756 80757 80758 80759const svg = create({ 80760 space: 'svg',
vendor: 5,584 bytes, lines 80760-80936
80760 80761 attributes: { 80762 accentHeight: 'accent-height', 80763 alignmentBaseline: 'alignment-baseline', 80764 arabicForm: 'arabic-form', 80765 baselineShift: 'baseline-shift', 80766 capHeight: 'cap-height', 80767 className: 'class', 80768 clipPath: 'clip-path', 80769 clipRule: 'clip-rule', 80770 colorInterpolation: 'color-interpolation', 80771 colorInterpolationFilters: 'color-interpolation-filters', 80772 colorProfile: 'color-profile', 80773 colorRendering: 'color-rendering', 80774 crossOrigin: 'crossorigin', 80775 dataType: 'datatype', 80776 dominantBaseline: 'dominant-baseline', 80777 enableBackground: 'enable-background', 80778 fillOpacity: 'fill-opacity', 80779 fillRule: 'fill-rule', 80780 floodColor: 'flood-color', 80781 floodOpacity: 'flood-opacity', 80782 fontFamily: 'font-family', 80783 fontSize: 'font-size', 80784 fontSizeAdjust: 'font-size-adjust', 80785 fontStretch: 'font-stretch', 80786 fontStyle: 'font-style', 80787 fontVariant: 'font-variant', 80788 fontWeight: 'font-weight', 80789 glyphName: 'glyph-name', 80790 glyphOrientationHorizontal: 'glyph-orientation-horizontal', 80791 glyphOrientationVertical: 'glyph-orientation-vertical', 80792 hrefLang: 'hreflang', 80793 horizAdvX: 'horiz-adv-x', 80794 horizOriginX: 'horiz-origin-x', 80795 horizOriginY: 'horiz-origin-y', 80796 imageRendering: 'image-rendering', 80797 letterSpacing: 'letter-spacing', 80798 lightingColor: 'lighting-color', 80799 markerEnd: 'marker-end', 80800 markerMid: 'marker-mid', 80801 markerStart: 'marker-start', 80802 navDown: 'nav-down', 80803 navDownLeft: 'nav-down-left', 80804 navDownRight: 'nav-down-right', 80805 navLeft: 'nav-left', 80806 navNext: 'nav-next', 80807 navPrev: 'nav-prev', 80808 navRight: 'nav-right', 80809 navUp: 'nav-up', 80810 navUpLeft: 'nav-up-left', 80811 navUpRight: 'nav-up-right', 80812 onAbort: 'onabort', 80813 onActivate: 'onactivate', 80814 onAfterPrint: 'onafterprint', 80815 onBeforePrint: 'onbeforeprint', 80816 onBegin: 'onbegin', 80817 onCancel: 'oncancel', 80818 onCanPlay: 'oncanplay', 80819 onCanPlayThrough: 'oncanplaythrough', 80820 onChange: 'onchange', 80821 onClick: 'onclick', 80822 onClose: 'onclose', 80823 onCopy: 'oncopy', 80824 onCueChange: 'oncuechange', 80825 onCut: 'oncut', 80826 onDblClick: 'ondblclick', 80827 onDrag: 'ondrag', 80828 onDragEnd: 'ondragend', 80829 onDragEnter: 'ondragenter', 80830 onDragExit: 'ondragexit', 80831 onDragLeave: 'ondragleave', 80832 onDragOver: 'ondragover', 80833 onDragStart: 'ondragstart', 80834 onDrop: 'ondrop', 80835 onDurationChange: 'ondurationchange', 80836 onEmptied: 'onemptied', 80837 onEnd: 'onend', 80838 onEnded: 'onended', 80839 onError: 'onerror', 80840 onFocus: 'onfocus', 80841 onFocusIn: 'onfocusin', 80842 onFocusOut: 'onfocusout', 80843 onHashChange: 'onhashchange', 80844 onInput: 'oninput', 80845 onInvalid: 'oninvalid', 80846 onKeyDown: 'onkeydown', 80847 onKeyPress: 'onkeypress', 80848 onKeyUp: 'onkeyup', 80849 onLoad: 'onload', 80850 onLoadedData: 'onloadeddata', 80851 onLoadedMetadata: 'onloadedmetadata', 80852 onLoadStart: 'onloadstart', 80853 onMessage: 'onmessage', 80854 onMouseDown: 'onmousedown', 80855 onMouseEnter: 'onmouseenter', 80856 onMouseLeave: 'onmouseleave', 80857 onMouseMove: 'onmousemove', 80858 onMouseOut: 'onmouseout', 80859 onMouseOver: 'onmouseover', 80860 onMouseUp: 'onmouseup', 80861 onMouseWheel: 'onmousewheel', 80862 onOffline: 'onoffline', 80863 onOnline: 'ononline', 80864 onPageHide: 'onpagehide', 80865 onPageShow: 'onpageshow', 80866 onPaste: 'onpaste', 80867 onPause: 'onpause', 80868 onPlay: 'onplay', 80869 onPlaying: 'onplaying', 80870 onPopState: 'onpopstate', 80871 onProgress: 'onprogress', 80872 onRateChange: 'onratechange', 80873 onRepeat: 'onrepeat', 80874 onReset: 'onreset', 80875 onResize: 'onresize', 80876 onScroll: 'onscroll', 80877 onSeeked: 'onseeked', 80878 onSeeking: 'onseeking', 80879 onSelect: 'onselect', 80880 onShow: 'onshow', 80881 onStalled: 'onstalled', 80882 onStorage: 'onstorage', 80883 onSubmit: 'onsubmit', 80884 onSuspend: 'onsuspend', 80885 onTimeUpdate: 'ontimeupdate', 80886 onToggle: 'ontoggle', 80887 onUnload: 'onunload', 80888 onVolumeChange: 'onvolumechange', 80889 onWaiting: 'onwaiting', 80890 onZoom: 'onzoom', 80891 overlinePosition: 'overline-position', 80892 overlineThickness: 'overline-thickness', 80893 paintOrder: 'paint-order', 80894 panose1: 'panose-1', 80895 pointerEvents: 'pointer-events', 80896 referrerPolicy: 'referrerpolicy', 80897 renderingIntent: 'rendering-intent', 80898 shapeRendering: 'shape-rendering', 80899 stopColor: 'stop-color', 80900 stopOpacity: 'stop-opacity', 80901 strikethroughPosition: 'strikethrough-position', 80902 strikethroughThickness: 'strikethrough-thickness', 80903 strokeDashArray: 'stroke-dasharray', 80904 strokeDashOffset: 'stroke-dashoffset', 80905 strokeLineCap: 'stroke-linecap', 80906 strokeLineJoin: 'stroke-linejoin', 80907 strokeMiterLimit: 'stroke-miterlimit', 80908 strokeOpacity: 'stroke-opacity', 80909 strokeWidth: 'stroke-width', 80910 tabIndex: 'tabindex', 80911 textAnchor: 'text-anchor', 80912 textDecoration: 'text-decoration', 80913 textRendering: 'text-rendering', 80914 transformOrigin: 'transform-origin', 80915 typeOf: 'typeof', 80916 underlinePosition: 'underline-position', 80917 underlineThickness: 'underline-thickness', 80918 unicodeBidi: 'unicode-bidi', 80919 unicodeRange: 'unicode-range', 80920 unitsPerEm: 'units-per-em', 80921 vAlphabetic: 'v-alphabetic', 80922 vHanging: 'v-hanging', 80923 vIdeographic: 'v-ideographic', 80924 vMathematical: 'v-mathematical', 80925 vectorEffect: 'vector-effect', 80926 vertAdvY: 'vert-adv-y', 80927 vertOriginX: 'vert-origin-x', 80928 vertOriginY: 'vert-origin-y', 80929 wordSpacing: 'word-spacing', 80930 writingMode: 'writing-mode', 80931 xHeight: 'x-height', 80932 // These were camelcased in Tiny. Now lowercased in SVG 2 80933 playbackOrder: 'playbackorder', 80934 timelineBegin: 'timelinebegin' 80935 }, 80936
80936transform: caseSensitiveTransform, 80937 properties: { 80938 about: commaOrSpaceSeparated, 80939 accentHeight: number, 80940 accumulate: null, 80941 additive: null, 80942 alignmentBaseline: null, 80943 alphabetic: number, 80944 amplitude: number, 80945 arabicForm: null, 80946 ascent: number, 80947 attributeName: null, 80948 attributeType: null, 80949 azimuth: number, 80950 bandwidth: null, 80951 baselineShift: null, 80952 baseFrequency: null, 80953 baseProfile: null, 80954 bbox: null, 80955 begin: null, 80956 bias: number, 80957 by: null, 80958 calcMode: null, 80959 capHeight: number, 80960 className: spaceSeparated, 80961 clip: null, 80962 clipPath: null, 80963 clipPathUnits: null, 80964 clipRule: null, 80965 color: null, 80966 colorInterpolation: null, 80967 colorInterpolationFilters: null, 80968 colorProfile: null, 80969 colorRendering: null, 80970 content: null, 80971 contentScriptType: null, 80972 contentStyleType: null, 80973 crossOrigin: null, 80974 cursor: null, 80975 cx: null, 80976 cy: null, 80977 d: null, 80978 dataType: null, 80979 defaultAction: null, 80980 descent: number, 80981 diffuseConstant: number, 80982 direction: null, 80983 display: null, 80984 dur: null, 80985 divisor: number, 80986 dominantBaseline: null, 80987 download: types_boolean, 80988 dx: null, 80989 dy: null, 80990 edgeMode: null, 80991 editable: null, 80992 elevation: number, 80993 enableBackground: null, 80994 end: null, 80995 event: null, 80996 exponent: number, 80997 externalResourcesRequired: null, 80998 fill: null, 80999 fillOpacity: number, 81000 fillRule: null, 81001 filter: null, 81002 filterRes: null, 81003 filterUnits: null, 81004 floodColor: null, 81005 floodOpacity: null, 81006 focusable: null, 81007 focusHighlight: null, 81008 fontFamily: null, 81009 fontSize: null, 81010 fontSizeAdjust: null, 81011 fontStretch: null, 81012 fontStyle: null, 81013 fontVariant: null, 81014 fontWeight: null, 81015 format: null, 81016 fr: null, 81017 from: null, 81018 fx: null, 81019 fy: null, 81020 g1: commaSeparated, 81021 g2: commaSeparated, 81022 glyphName: commaSeparated, 81023 glyphOrientationHorizontal: null, 81024 glyphOrientationVertical: null, 81025 glyphRef: null, 81026 gradientTransform: null, 81027 gradientUnits: null, 81028 handler: null, 81029 hanging: number, 81030 hatchContentUnits: null, 81031 hatchUnits: null, 81032 height: null, 81033 href: null, 81034 hrefLang: null, 81035 horizAdvX: number, 81036 horizOriginX: number, 81037 horizOriginY: number, 81038 id: null, 81039 ideographic: number, 81040 imageRendering: null, 81041 initialVisibility: null, 81042 in: null, 81043 in2: null, 81044 intercept: number, 81045 k: number, 81046 k1: number, 81047 k2: number, 81048 k3: number, 81049 k4: number, 81050 kernelMatrix: commaOrSpaceSeparated, 81051 kernelUnitLength: null, 81052 keyPoints: null, // SEMI_COLON_SEPARATED 81053 keySplines: null, // SEMI_COLON_SEPARATED 81054 keyTimes: null, // SEMI_COLON_SEPARATED 81055 kerning: null, 81056 lang: null, 81057 lengthAdjust: null, 81058 letterSpacing: null, 81059 lightingColor: null, 81060 limitingConeAngle: number, 81061 local: null, 81062 markerEnd: null, 81063 markerMid: null, 81064 markerStart: null, 81065 markerHeight: null, 81066 markerUnits: null, 81067 markerWidth: null, 81068 mask: null, 81069 maskContentUnits: null, 81070 maskUnits: null, 81071 mathematical: null, 81072 max: null, 81073 media: null, 81074 mediaCharacterEncoding: null, 81075 mediaContentEncodings: null, 81076 mediaSize: number, 81077 mediaTime: null, 81078 method: null, 81079 min: null, 81080 mode: null, 81081 name: null, 81082 navDown: null, 81083 navDownLeft: null, 81084 navDownRight: null, 81085 navLeft: null, 81086 navNext: null, 81087 navPrev: null, 81088 navRight: null, 81089 navUp: null, 81090 navUpLeft: null, 81091 navUpRight: null, 81092 numOctaves: null, 81093 observer: null, 81094 offset: null, 81095 onAbort: null, 81096 onActivate: null, 81097 onAfterPrint: null, 81098 onBeforePrint: null, 81099 onBegin: null, 81100 onCancel: null, 81101 onCanPlay: null, 81102 onCanPlayThrough: null, 81103 onChange: null, 81104 onClick: null, 81105 onClose: null, 81106 onCopy: null, 81107 onCueChange: null, 81108 onCut: null, 81109 onDblClick: null, 81110 onDrag: null, 81111 onDragEnd: null, 81112 onDragEnter: null, 81113 onDragExit: null, 81114 onDragLeave: null, 81115 onDragOver: null, 81116 onDragStart: null, 81117 onDrop: null, 81118 onDurationChange: null, 81119 onEmptied: null, 81120 onEnd: null, 81121 onEnded: null, 81122 onError: null, 81123 onFocus: null, 81124 onFocusIn: null, 81125 onFocusOut: null, 81126 onHashChange: null, 81127 onInput: null, 81128 onInvalid: null, 81129 onKeyDown: null, 81130 onKeyPress: null, 81131 onKeyUp: null, 81132 onLoad: null, 81133 onLoadedData: null, 81134 onLoadedMetadata: null, 81135 onLoadStart: null, 81136 onMessage: null, 81137 onMouseDown: null, 81138 onMouseEnter: null, 81139 onMouseLeave: null, 81140 onMouseMove: null, 81141 onMouseOut: null, 81142 onMouseOver: null, 81143 onMouseUp: null, 81144 onMouseWheel: null, 81145 onOffline: null, 81146 onOnline: null, 81147 onPageHide: null, 81148 onPageShow: null, 81149 onPaste: null, 81150 onPause: null, 81151 onPlay: null, 81152 onPlaying: null, 81153 onPopState: null, 81154 onProgress: null, 81155 onRateChange: null, 81156 onRepeat: null, 81157 onReset: null, 81158 onResize: null, 81159 onScroll: null, 81160 onSeeked: null, 81161 onSeeking: null, 81162 onSelect: null, 81163 onShow: null, 81164 onStalled: null, 81165 onStorage: null, 81166 onSubmit: null, 81167 onSuspend: null, 81168 onTimeUpdate: null, 81169 onToggle: null, 81170 onUnload: null, 81171 onVolumeChange: null, 81172 onWaiting: null, 81173 onZoom: null, 81174 opacity: null, 81175 operator: null, 81176 order: null, 81177 orient: null, 81178 orientation: null, 81179 origin: null, 81180 overflow: null, 81181 overlay: null, 81182 overlinePosition: number, 81183 overlineThickness: number, 81184 paintOrder: null, 81185 panose1: null, 81186 path: null, 81187 pathLength: number, 81188 patternContentUnits: null, 81189 patternTransform: null, 81190 patternUnits: null, 81191 phase: null, 81192 ping: spaceSeparated,
81193 pitch: null, 81194 playbackOrder: null, 81195 pointerEvents: null, 81196 points: null, 81197 pointsAtX: number, 81198 pointsAtY: number, 81199 pointsAtZ: number, 81200 preserveAlpha: null, 81201 preserveAspectRatio: null, 81202 primitiveUnits: null, 81203 propagate: null, 81204 property: commaOrSpaceSeparated, 81205 r: null, 81206 radius: null, 81207 referrerPolicy: null, 81208 refX: null, 81209 refY: null, 81210 rel: commaOrSpaceSeparated, 81211 rev: commaOrSpaceSeparated, 81212 renderingIntent: null, 81213 repeatCount: null, 81214 repeatDur: null, 81215 requiredExtensions: commaOrSpaceSeparated, 81216 requiredFeatures: commaOrSpaceSeparated, 81217 requiredFonts: commaOrSpaceSeparated, 81218 requiredFormats: commaOrSpaceSeparated, 81219 resource: null, 81220 restart: null, 81221 result: null, 81222 rotate: null, 81223 rx: null, 81224 ry: null, 81225 scale: null, 81226 seed: null, 81227 shapeRendering: null, 81228 side: null, 81229 slope: null, 81230 snapshotTime: null, 81231 specularConstant: number, 81232 specularExponent: number, 81233 spreadMethod: null, 81234 spacing: null, 81235 startOffset: null, 81236 stdDeviation: null, 81237 stemh: null, 81238 stemv: null, 81239 stitchTiles: null, 81240 stopColor: null, 81241 stopOpacity: null, 81242 strikethroughPosition: number, 81243 strikethroughThickness: number, 81244 string: null, 81245 stroke: null, 81246 strokeDashArray: commaOrSpaceSeparated, 81247 strokeDashOffset: null, 81248 strokeLineCap: null, 81249 strokeLineJoin: null, 81250 strokeMiterLimit: number, 81251 strokeOpacity: number, 81252 strokeWidth: null, 81253 style: null, 81254 surfaceScale: number, 81255 syncBehavior: null, 81256 syncBehaviorDefault: null, 81257 syncMaster: null, 81258 syncTolerance: null, 81259 syncToleranceDefault: null, 81260 systemLanguage: commaOrSpaceSeparated, 81261 tabIndex: number, 81262 tableValues: null, 81263 target: null, 81264 targetX: number, 81265 targetY: number, 81266 textAnchor: null, 81267 textDecoration: null, 81268 textRendering: null, 81269 textLength: null, 81270 timelineBegin: null, 81271 title: null, 81272 transformBehavior: null, 81273 type: null, 81274 typeOf: commaOrSpaceSeparated, 81275 to: null, 81276 transform: null, 81277 transformOrigin: null, 81278 u1: null, 81279 u2: null, 81280 underlinePosition: number, 81281 underlineThickness: number, 81282 unicode: null, 81283 unicodeBidi: null, 81284 unicodeRange: null, 81285 unitsPerEm: number, 81286 values: null, 81287 vAlphabetic: number, 81288 vMathematical: number, 81289 vectorEffect: null, 81290 vHanging: number, 81291 vIdeographic: number, 81292 version: null, 81293 vertAdvY: number, 81294 vertOriginX: number, 81295 vertOriginY: number, 81296 viewBox: null, 81297 viewTarget: null, 81298 visibility: null, 81299 width: null, 81300 widths: null, 81301 wordSpacing: null, 81302 writingMode: null, 81303 x: null, 81304 x1: null, 81305 x2: null, 81306 xChannelSelector: null, 81307 xHeight: number, 81308 y: null, 81309 y1: null, 81310 y2: null, 81311 yChannelSelector: null, 81312 z: null, 81313 zoomAndPan: null 81314 } 81315}) 81316 81317;// ./node_modules/property-information/index.js 81318/** 81319 * @typedef {import('./lib/util/info.js').Info} Info 81320 * @typedef {import('./lib/util/schema.js').Schema} Schema 81321 */ 81322 81323 81324 81325 81326 81327 81328 81329 81330 81331 81332 81333 81334const property_information_html = merge([xml, xlink, xmlns, aria, html_html], 'html') 81335const property_information_svg = merge([xml, xlink, xmlns, aria, svg], 'svg') 81336 81337;// ./node_modules/react-markdown/lib/rehype-filter.js 81338 81339 81340/** 81341 * @typedef {import('unist').Node} Node 81342 * @typedef {import('hast').Root} Root 81343 * @typedef {import('hast').Element} Element 81344 * 81345 * @callback AllowElement 81346 * @param {Element} element 81347 * @param {number} index 81348 * @param {Element|Root} parent 81349 * @returns {boolean|undefined} 81350 * 81351 * @typedef Options 81352 * @property {Array<string>} [allowedElements] 81353 * @property {Array<string>} [disallowedElements=[]] 81354 * @property {AllowElement} [allowElement] 81355 * @property {boolean} [unwrapDisallowed=false] 81356 */ 81357 81358/** 81359 * @type {import('unified').Plugin<[Options], Root>} 81360 */ 81361function rehypeFilter(options) { 81362 if (options.allowedElements && options.disallowedElements) { 81363 throw new TypeError( 81364 'Only one of `allowedElements` and `disallowedElements` should be defined' 81365 ) 81366 } 81367 81368 if ( 81369 options.allowedElements || 81370 options.disallowedElements || 81371 options.allowElement 81372 ) { 81373 return (tree) => { 81374 visit(tree, 'element', (node, index, parent_) => { 81375 const parent = /** @type {Element|Root} */ (parent_) 81376 /** @type {boolean|undefined} */ 81377 let remove 81378 81379 if (options.allowedElements) { 81380 remove = !options.allowedElements.includes(node.tagName) 81381 } else if (options.disallowedElements) { 81382 remove = options.disallowedElements.includes(node.tagName) 81383 } 81384 81385 if (!remove && options.allowElement && typeof index === 'number') { 81386 remove = !options.allowElement(node, index, parent) 81387 } 81388 81389 if (remove && typeof index === 'number') { 81390 if (options.unwrapDisallowed && node.children) { 81391 parent.children.splice(index, 1, ...node.children) 81392 } else { 81393 parent.children.splice(index, 1) 81394 } 81395 81396 return index 81397 } 81398 81399 return undefined 81400 }) 81401 } 81402 } 81403} 81404 81405// EXTERNAL MODULE: ./node_modules/react-markdown/node_modules/react-is/index.js 81406var react_is = __webpack_require__(88316); 81407;// ./node_modules/hast-util-whitespace/index.js 81408/** 81409 * Check if the given value is *inter-element whitespace*. 81410 * 81411 * @param {unknown} thing
81412 * Thing to check (typically `Node` or `string`). 81413 * @returns {boolean} 81414 * Whether the `value` is inter-element whitespace (`boolean`): consisting of 81415 * zero or more of space, tab (`\t`), line feed (`\n`), carriage return 81416 * (`\r`), or form feed (`\f`). 81417 * If a node is passed it must be a `Text` node, whose `value` field is 81418 * checked. 81419 */ 81420function whitespace(thing) { 81421 /** @type {string} */ 81422 const value = 81423 // @ts-expect-error looks like a node. 81424 thing && typeof thing === 'object' && thing.type === 'text' 81425 ? // @ts-expect-error looks like a text. 81426 thing.value || '' 81427 : thing 81428 81429 // HTML whitespace expression. 81430 // See <https://infra.spec.whatwg.org/#ascii-whitespace>. 81431 return typeof value === 'string' && value.replace(/[ \t\n\f\r]/g, '') === '' 81432} 81433 81434;// ./node_modules/property-information/lib/find.js 81435/** 81436 * @typedef {import('./util/schema.js').Schema} Schema 81437 */ 81438 81439 81440 81441 81442 81443const valid = /^data[-\w.:]+$/i 81444const dash = /-[a-z]/g 81445const cap = /[A-Z]/g 81446 81447/** 81448 * @param {Schema} schema 81449 * @param {string} value 81450 * @returns {Info} 81451 */ 81452function find(schema, value) { 81453 const normal = normalize_normalize(value) 81454 let prop = value 81455 let Type = Info 81456 81457 if (normal in schema.normal) { 81458 return schema.property[schema.normal[normal]] 81459 } 81460 81461 if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) { 81462 // Attribute or property. 81463 if (value.charAt(4) === '-') { 81464 // Turn it into a property. 81465 const rest = value.slice(5).replace(dash, camelcase) 81466 prop = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1) 81467 } else { 81468 // Turn it into an attribute. 81469 const rest = value.slice(4) 81470 81471 if (!dash.test(rest)) { 81472 let dashes = rest.replace(cap, kebab) 81473 81474 if (dashes.charAt(0) !== '-') { 81475 dashes = '-' + dashes 81476 } 81477 81478 value = 'data' + dashes 81479 } 81480 } 81481 81482 Type = DefinedInfo 81483 } 81484 81485 return new Type(prop, value) 81486} 81487 81488/** 81489 * @param {string} $0 81490 * @returns {string} 81491 */ 81492function kebab($0) { 81493 return '-' + $0.toLowerCase() 81494} 81495 81496/** 81497 * @param {string} $0 81498 * @returns {string} 81499 */ 81500function camelcase($0) { 81501 return $0.charAt(1).toUpperCase() 81502} 81503 81504;// ./node_modules/property-information/lib/hast-to-react.js 81505/** 81506 * `hast` is close to `React`, but differs in a couple of cases. 81507 * 81508 * To get a React property from a hast property, check if it is in 81509 * `hastToReact`, if it is, then use the corresponding value, 81510 * otherwise, use the hast property. 81511 * 81512 * @type {Record<string, string>} 81513 */ 81514const hastToReact = { 81515 classId: 'classID', 81516 dataType: 'datatype', 81517 itemId: 'itemID', 81518 strokeDashArray: 'strokeDasharray', 81519 strokeDashOffset: 'strokeDashoffset', 81520 strokeLineCap: 'strokeLinecap', 81521 strokeLineJoin: 'strokeLinejoin', 81522 strokeMiterLimit: 'strokeMiterlimit', 81523 typeOf: 'typeof', 81524 xLinkActuate: 'xlinkActuate', 81525 xLinkArcRole: 'xlinkArcrole', 81526 xLinkHref: 'xlinkHref', 81527 xLinkRole: 'xlinkRole', 81528 xLinkShow: 'xlinkShow', 81529 xLinkTitle: 'xlinkTitle', 81530 xLinkType: 'xlinkType', 81531 xmlnsXLink: 'xmlnsXlink' 81532} 81533 81534;// ./node_modules/space-separated-tokens/index.js 81535/** 81536 * Parse space-separated tokens to an array of strings. 81537 * 81538 * @param {string} value 81539 * Space-separated tokens. 81540 * @returns {Array<string>} 81541 * List of tokens. 81542 */ 81543function space_separated_tokens_parse(value) { 81544 const input = String(value || '').trim() 81545 return input ? input.split(/[ \t\n\r\f]+/g) : [] 81546} 81547 81548/** 81549 * Serialize an array of strings as space separated-tokens. 81550 * 81551 * @param {Array<string|number>} values 81552 * List of tokens. 81553 * @returns {string} 81554 * Space-separated tokens. 81555 */ 81556function stringify(values) { 81557 return values.join(' ').trim() 81558} 81559 81560;// ./node_modules/comma-separated-tokens/index.js 81561/** 81562 * @typedef Options 81563 * Configuration for `stringify`. 81564 * @property {boolean} [padLeft=true] 81565 * Whether to pad a space before a token. 81566 * @property {boolean} [padRight=false] 81567 * Whether to pad a space after a token. 81568 */ 81569 81570/** 81571 * @typedef {Options} StringifyOptions 81572 * Please use `StringifyOptions` instead. 81573 */ 81574 81575/** 81576 * Parse comma-separated tokens to an array. 81577 * 81578 * @param {string} value 81579 * Comma-separated tokens. 81580 * @returns {Array<string>} 81581 * List of tokens. 81582 */ 81583function comma_separated_tokens_parse(value) { 81584 /** @type {Array<string>} */ 81585 const tokens = [] 81586 const input = String(value || '') 81587 let index = input.indexOf(',') 81588 let start = 0 81589 /** @type {boolean} */ 81590 let end = false 81591
81592 while (!end) { 81593 if (index === -1) { 81594 index = input.length 81595 end = true 81596 } 81597 81598 const token = input.slice(start, index).trim() 81599 81600 if (token || !end) { 81601 tokens.push(token) 81602 } 81603 81604 start = index + 1 81605 index = input.indexOf(',', start) 81606 } 81607 81608 return tokens 81609} 81610 81611/** 81612 * Serialize an array of strings or numbers to comma-separated tokens. 81613 * 81614 * @param {Array<string|number>} values 81615 * List of tokens. 81616 * @param {Options} [options] 81617 * Configuration for `stringify` (optional). 81618 * @returns {string} 81619 * Comma-separated tokens. 81620 */ 81621function comma_separated_tokens_stringify(values, options) { 81622 const settings = options || {} 81623 81624 // Ensure the last empty entry is seen. 81625 const input = values[values.length - 1] === '' ? [...values, ''] : values 81626 81627 return input 81628 .join( 81629 (settings.padRight ? ' ' : '') + 81630 ',' + 81631 (settings.padLeft === false ? '' : ' ') 81632 ) 81633 .trim() 81634} 81635 81636// EXTERNAL MODULE: ./node_modules/style-to-object/index.js 81637var style_to_object = __webpack_require__(9108); 81638var style_to_object_default = /*#__PURE__*/__webpack_require__.n(style_to_object); 81639;// ./node_modules/style-to-object/index.mjs 81640 81641 81642/* harmony default export */ const node_modules_style_to_object = ((style_to_object_default())); 81643 81644;// ./node_modules/react-markdown/lib/uri-transformer.js 81645const protocols = ['http', 'https', 'mailto', 'tel'] 81646 81647/** 81648 * @param {string} uri 81649 * @returns {string} 81650 */ 81651function uriTransformer(uri) { 81652 const url = (uri || '').trim() 81653 const first = url.charAt(0) 81654 81655 if (first === '#' || first === '/') { 81656 return url 81657 } 81658 81659 const colon = url.indexOf(':') 81660 if (colon === -1) { 81661 return url 81662 } 81663 81664 let index = -1 81665 81666 while (++index < protocols.length) { 81667 const protocol = protocols[index] 81668 81669 if ( 81670 colon === protocol.length && 81671 url.slice(0, protocol.length).toLowerCase() === protocol 81672 ) { 81673 return url 81674 } 81675 } 81676 81677 index = url.indexOf('?') 81678 if (index !== -1 && colon > index) { 81679 return url 81680 } 81681 81682 index = url.indexOf('#') 81683 if (index !== -1 && colon > index) { 81684 return url 81685 } 81686 81687 // eslint-disable-next-line no-script-url 81688 return 'javascript:void(0)' 81689} 81690 81691;// ./node_modules/react-markdown/lib/ast-to-react.js 81692/** 81693 * @template T 81694 * @typedef {import('react').ComponentType<T>} ComponentType<T> 81695 */ 81696 81697/** 81698 * @template {import('react').ElementType} T 81699 * @typedef {import('react').ComponentPropsWithoutRef<T>} ComponentPropsWithoutRef<T> 81700 */ 81701 81702/** 81703 * @typedef {import('react').ReactNode} ReactNode 81704 * @typedef {import('unist').Position} Position 81705 * @typedef {import('hast').Element} Element 81706 * @typedef {import('hast').ElementContent} ElementContent 81707 * @typedef {import('hast').Root} Root 81708 * @typedef {import('hast').Text} Text 81709 * @typedef {import('hast').Comment} Comment 81710 * @typedef {import('hast').DocType} Doctype 81711 * @typedef {import('property-information').Info} Info 81712 * @typedef {import('property-information').Schema} Schema 81713 * @typedef {import('./complex-types.js').ReactMarkdownProps} ReactMarkdownProps 81714 * 81715 * @typedef Raw 81716 * @property {'raw'} type 81717 * @property {string} value 81718 * 81719 * @typedef Context 81720 * @property {Options} options 81721 * @property {Schema} schema 81722 * @property {number} listDepth 81723 * 81724 * @callback TransformLink 81725 * @param {string} href 81726 * @param {Array<ElementContent>} children 81727 * @param {string?} title 81728 * @returns {string} 81729 * 81730 * @callback TransformImage 81731 * @param {string} src 81732 * @param {string} alt 81733 * @param {string?} title 81734 * @returns {string} 81735 * 81736 * @typedef {import('react').HTMLAttributeAnchorTarget} TransformLinkTargetType 81737 * 81738 * @callback TransformLinkTarget 81739 * @param {string} href 81740 * @param {Array<ElementContent>} children 81741 * @param {string?} title 81742 * @returns {TransformLinkTargetType|undefined} 81743 * 81744 * @typedef {keyof JSX.IntrinsicElements} ReactMarkdownNames 81745 * 81746 * To do: is `data-sourcepos` typeable? 81747 * 81748 * @typedef {ComponentPropsWithoutRef<'code'> & ReactMarkdownProps & {inline?: boolean}} CodeProps 81749 * @typedef {ComponentPropsWithoutRef<'h1'> & ReactMarkdownProps & {level: number}} HeadingProps 81750 * @typedef {ComponentPropsWithoutRef<'li'> & ReactMarkdownProps & {checked: boolean|null, index: number, ordered: boolean}} LiProps 81751 * @typedef {ComponentPropsWithoutRef<'ol'> & ReactMarkdownProps & {depth: number, ordered: true}} OrderedListProps 81752 * @typedef {ComponentPropsWithoutRef<'td'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: false}} TableDataCellProps 81753 * @typedef {ComponentPropsWithoutRef<'th'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: true}} TableHeaderCellProps 81754 * @typedef {ComponentPropsWithoutRef<'tr'> & ReactMarkdownProps & {isHeader: boolean}} TableRowProps 81755 * @typedef {ComponentPropsWithoutRef<'ul'> & ReactMarkdownProps & {depth: number, ordered: false}} UnorderedListProps 81756 * 81757 * @typedef {ComponentType<CodeProps>} CodeComponent 81758 * @typedef {ComponentType<HeadingProps>} HeadingComponent 81759 * @typedef {ComponentType<LiProps>} LiComponent 81760 * @typedef {ComponentType<OrderedListProps>} OrderedListComponent 81761 * @typedef {ComponentType<TableDataCellProps>} TableDataCellComponent 81762 * @typedef {ComponentType<TableHeaderCellProps>} TableHeaderCellComponent 81763 * @typedef {ComponentType<TableRowProps>} TableRowComponent 81764 * @typedef {ComponentType<UnorderedListProps>} UnorderedListComponent 81765 * 81766 * @typedef SpecialComponents 81767 * @property {CodeComponent|ReactMarkdownNames} code 81768 * @property {HeadingComponent|ReactMarkdownNames} h1 81769 * @property {HeadingComponent|ReactMarkdownNames} h2 81770 * @property {HeadingComponent|ReactMarkdownNames} h3 81771 * @property {HeadingComponent|ReactMarkdownNames} h4 81772 * @property {HeadingComponent|ReactMarkdownNames} h5 81773 * @property {HeadingComponent|ReactMarkdownNames} h6 81774 * @property {LiComponent|ReactMarkdownNames} li 81775 * @property {OrderedListComponent|ReactMarkdownNames} ol 81776 * @property {TableDataCellComponent|ReactMarkdownNames} td 81777 * @property {TableHeaderCellComponent|ReactMarkdownNames} th 81778 * @property {TableRowComponent|ReactMarkdownNames} tr 81779 * @property {UnorderedListComponent|ReactMarkdownNames} ul 81780 * 81781 * @typedef {Partial<Omit<import('./complex-types.js').NormalComponents, keyof SpecialComponents> & SpecialComponents>} Components 81782 * 81783 * @typedef Options 81784 * @property {boolean} [sourcePos=false] 81785 * @property {boolean} [rawSourcePos=false] 81786 * @property {boolean} [skipHtml=false] 81787 * @property {boolean} [includeElementIndex=false] 81788 * @property {null|false|TransformLink} [transformLinkUri] 81789 * @property {TransformImage} [transformImageUri] 81790 * @property {TransformLinkTargetType|TransformLinkTarget} [linkTarget] 81791 * @property {Components} [components] 81792 */ 81793 81794 81795 81796 81797 81798 81799 81800 81801 81802 81803const ast_to_react_own = {}.hasOwnProperty 81804 81805// The table-related elements that must not contain whitespace text according 81806// to React. 81807const tableElements = new Set(['table', 'thead', 'tbody', 'tfoot', 'tr']) 81808 81809/** 81810 * @param {Context} context 81811 * @param {Element|Root} node 81812 */ 81813function childrenToReact(context, node) { 81814 /** @type {Array<ReactNode>} */ 81815 const children = [] 81816 let childIndex = -1 81817 /** @type {Comment|Doctype|Element|Raw|Text} */ 81818 let child 81819
81820 while (++childIndex < node.children.length) { 81821 child = node.children[childIndex] 81822 81823 if (child.type === 'element') { 81824 children.push(toReact(context, child, childIndex, node)) 81825 } else if (child.type === 'text') { 81826 // Currently, a warning is triggered by react for *any* white space in 81827 // tables. 81828 // So we drop it. 81829 // See: <https://github.com/facebook/react/pull/7081>. 81830 // See: <https://github.com/facebook/react/pull/7515>. 81831 // See: <https://github.com/remarkjs/remark-react/issues/64>. 81832 // See: <https://github.com/remarkjs/react-markdown/issues/576>. 81833 if ( 81834 node.type !== 'element' || 81835 !tableElements.has(node.tagName) || 81836 !whitespace(child) 81837 ) { 81838 children.push(child.value) 81839 } 81840 } else if (child.type === 'raw' && !context.options.skipHtml) { 81841 // Default behavior is to show (encoded) HTML. 81842 children.push(child.value) 81843 } 81844 } 81845 81846 return children 81847} 81848 81849/** 81850 * @param {Context} context 81851 * @param {Element} node 81852 * @param {number} index 81853 * @param {Element|Root} parent 81854 */ 81855function toReact(context, node, index, parent) { 81856 const options = context.options 81857 const transform = 81858 options.transformLinkUri === undefined 81859 ? uriTransformer 81860 : options.transformLinkUri 81861 const parentSchema = context.schema 81862 /** @type {ReactMarkdownNames} */ 81863 // @ts-expect-error assume a known HTML/SVG element. 81864 const name = node.tagName 81865 /** @type {Record<string, unknown>} */ 81866 const properties = {} 81867 let schema = parentSchema 81868 /** @type {string} */ 81869 let property 81870 81871 if (parentSchema.space === 'html' && name === 'svg') { 81872 schema = property_information_svg 81873 context.schema = schema 81874 } 81875 81876 if (node.properties) { 81877 for (property in node.properties) { 81878 if (ast_to_react_own.call(node.properties, property)) { 81879 addProperty(properties, property, node.properties[property], context) 81880 } 81881 } 81882 } 81883 81884 if (name === 'ol' || name === 'ul') { 81885 context.listDepth++ 81886 } 81887 81888 const children = childrenToReact(context, node) 81889 81890 if (name === 'ol' || name === 'ul') { 81891 context.listDepth-- 81892 } 81893 81894 // Restore parent schema. 81895 context.schema = parentSchema 81896 81897 // Nodes created by plugins do not have positional info, in which case we use 81898 // an object that matches the position interface. 81899 const position = node.position || { 81900 start: {line: null, column: null, offset: null}, 81901 end: {line: null, column: null, offset: null} 81902 } 81903 const component = 81904 options.components && ast_to_react_own.call(options.components, name) 81905 ? options.components[name] 81906 : name 81907 const basic = typeof component === 'string' || component === react.Fragment 81908 81909 if (!react_is.isValidElementType(component)) { 81910 throw new TypeError( 81911 `Component for name \`${name}\` not defined or is not renderable` 81912 ) 81913 } 81914 81915 properties.key = index 81916 81917 if (name === 'a' && options.linkTarget) { 81918 properties.target = 81919 typeof options.linkTarget === 'function' 81920 ? options.linkTarget( 81921 String(properties.href || ''), 81922 node.children, 81923 typeof properties.title === 'string' ? properties.title : null 81924 ) 81925 : options.linkTarget 81926 } 81927 81928 if (name === 'a' && transform) { 81929 properties.href = transform( 81930 String(properties.href || ''), 81931 node.children, 81932 typeof properties.title === 'string' ? properties.title : null 81933 ) 81934 } 81935 81936 if ( 81937 !basic && 81938 name === 'code' && 81939 parent.type === 'element' && 81940 parent.tagName !== 'pre' 81941 ) { 81942 properties.inline = true 81943 } 81944 81945 if ( 81946 !basic && 81947 (name === 'h1' || 81948 name === 'h2' || 81949 name === 'h3' || 81950 name === 'h4' || 81951 name === 'h5' || 81952 name === 'h6') 81953 ) { 81954 properties.level = Number.parseInt(name.charAt(1), 10) 81955 } 81956 81957 if (name === 'img' && options.transformImageUri) { 81958 properties.src = options.transformImageUri( 81959 String(properties.src || ''), 81960 String(properties.alt || ''), 81961 typeof properties.title === 'string' ? properties.title : null 81962 ) 81963 } 81964 81965 if (!basic && name === 'li' && parent.type === 'element') { 81966 const input = getInputElement(node) 81967 properties.checked = 81968 input && input.properties ? Boolean(input.properties.checked) : null 81969 properties.index = getElementsBeforeCount(parent, node) 81970 properties.ordered = parent.tagName === 'ol' 81971 } 81972 81973 if (!basic && (name === 'ol' || name === 'ul')) { 81974 properties.ordered = name === 'ol' 81975 properties.depth = context.listDepth 81976 } 81977 81978 if (name === 'td' || name === 'th') { 81979 if (properties.align) { 81980 if (!properties.style) properties.style = {} 81981 // @ts-expect-error assume `style` is an object 81982 properties.style.textAlign = properties.align 81983 delete properties.align 81984 } 81985 81986 if (!basic) { 81987 properties.isHeader = name === 'th' 81988 } 81989 } 81990 81991 if (!basic && name === 'tr' && parent.type === 'element') { 81992 properties.isHeader = Boolean(parent.tagName === 'thead') 81993 } 81994 81995 // If `sourcePos` is given, pass source information (line/column info from markdown source).
81996 if (options.sourcePos) { 81997 properties['data-sourcepos'] = flattenPosition(position) 81998 } 81999 82000 if (!basic && options.rawSourcePos) { 82001 properties.sourcePosition = node.position 82002 } 82003 82004 // If `includeElementIndex` is given, pass node index info to components. 82005 if (!basic && options.includeElementIndex) { 82006 properties.index = getElementsBeforeCount(parent, node) 82007 properties.siblingCount = getElementsBeforeCount(parent) 82008 } 82009 82010 if (!basic) { 82011 properties.node = node 82012 } 82013 82014 // Ensure no React warnings are emitted for void elements w/ children. 82015 return children.length > 0 82016 ? react.createElement(component, properties, children) 82017 : react.createElement(component, properties) 82018} 82019 82020/** 82021 * @param {Element|Root} node 82022 * @returns {Element?} 82023 */ 82024function getInputElement(node) { 82025 let index = -1 82026 82027 while (++index < node.children.length) { 82028 const child = node.children[index] 82029 82030 if (child.type === 'element' && child.tagName === 'input') { 82031 return child 82032 } 82033 } 82034 82035 return null 82036} 82037 82038/** 82039 * @param {Element|Root} parent 82040 * @param {Element} [node] 82041 * @returns {number} 82042 */ 82043function getElementsBeforeCount(parent, node) { 82044 let index = -1 82045 let count = 0 82046 82047 while (++index < parent.children.length) { 82048 if (parent.children[index] === node) break 82049 if (parent.children[index].type === 'element') count++ 82050 } 82051 82052 return count 82053} 82054 82055/** 82056 * @param {Record<string, unknown>} props 82057 * @param {string} prop 82058 * @param {unknown} value 82059 * @param {Context} ctx 82060 */ 82061function addProperty(props, prop, value, ctx) {
82062 const info = find(ctx.schema, prop) 82063 let result = value 82064 82065 // Ignore nullish and `NaN` values. 82066 // eslint-disable-next-line no-self-compare 82067 if (result === null || result === undefined || result !== result) { 82068 return 82069 } 82070 82071 // Accept `array`. 82072 // Most props are space-separated. 82073 if (Array.isArray(result)) { 82074 result = info.commaSeparated ? comma_separated_tokens_stringify(result) : stringify(result) 82075 } 82076 82077 if (info.property === 'style' && typeof result === 'string') { 82078 result = parseStyle(result) 82079 } 82080 82081 if (info.space && info.property) { 82082 props[ 82083 ast_to_react_own.call(hastToReact, info.property) 82084 ? hastToReact[info.property] 82085 : info.property 82086 ] = result 82087 } else if (info.attribute) { 82088 props[info.attribute] = result 82089 } 82090} 82091 82092/** 82093 * @param {string} value 82094 * @returns {Record<string, string>} 82095 */ 82096function parseStyle(value) { 82097 /** @type {Record<string, string>} */ 82098 const result = {} 82099 82100 try { 82101 node_modules_style_to_object(value, iterator) 82102 } catch { 82103 // Silent. 82104 } 82105 82106 return result 82107 82108 /** 82109 * @param {string} name 82110 * @param {string} v 82111 */ 82112 function iterator(name, v) { 82113 const k = name.slice(0, 4) === '-ms-' ? `ms-${name.slice(4)}` : name 82114 result[k.replace(/-([a-z])/g, styleReplacer)] = v 82115 } 82116} 82117 82118/** 82119 * @param {unknown} _ 82120 * @param {string} $1 82121 */ 82122function styleReplacer(_, $1) { 82123 return $1.toUpperCase() 82124} 82125 82126/** 82127 * @param {Position|{start: {line: null, column: null, offset: null}, end: {line: null, column: null, offset: null}}} pos 82128 * @returns {string} 82129 */ 82130function flattenPosition(pos) { 82131 return [ 82132 pos.start.line, 82133 ':', 82134 pos.start.column, 82135 '-', 82136 pos.end.line, 82137 ':', 82138 pos.end.column 82139 ] 82140 .map(String) 82141 .join('') 82142} 82143 82144;// ./node_modules/react-markdown/lib/react-markdown.js 82145/** 82146 * @typedef {import('react').ReactNode} ReactNode 82147 * @typedef {import('react').ReactElement<{}>} ReactElement 82148 * @typedef {import('unified').PluggableList} PluggableList 82149 * @typedef {import('hast').Root} Root 82150 * @typedef {import('./rehype-filter.js').Options} FilterOptions 82151 * @typedef {import('./ast-to-react.js').Options} TransformOptions 82152 * 82153 * @typedef CoreOptions 82154 * @property {string} children 82155 * 82156 * @typedef PluginOptions 82157 * @property {PluggableList} [remarkPlugins=[]] 82158 * @property {PluggableList} [rehypePlugins=[]] 82159 * @property {import('remark-rehype').Options | undefined} [remarkRehypeOptions={}] 82160 * 82161 * @typedef LayoutOptions 82162 * @property {string} [className] 82163 * 82164 * @typedef {CoreOptions & PluginOptions & LayoutOptions & FilterOptions & TransformOptions} ReactMarkdownOptions 82165 * 82166 * @typedef Deprecation 82167 * @property {string} id 82168 * @property {string} [to] 82169 */ 82170 82171 82172 82173 82174 82175 82176 82177 82178 82179 82180 82181const react_markdown_own = {}.hasOwnProperty 82182const changelog = 82183 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md' 82184 82185/** @type {Record<string, Deprecation>} */ 82186const deprecated = { 82187 plugins: {to: 'remarkPlugins', id: 'change-plugins-to-remarkplugins'}, 82188 renderers: {to: 'components', id: 'change-renderers-to-components'}, 82189 astPlugins: {id: 'remove-buggy-html-in-markdown-parser'}, 82190 allowDangerousHtml: {id: 'remove-buggy-html-in-markdown-parser'}, 82191 escapeHtml: {id: 'remove-buggy-html-in-markdown-parser'}, 82192 source: {to: 'children', id: 'change-source-to-children'}, 82193 allowNode: { 82194 to: 'allowElement', 82195 id: 'replace-allownode-allowedtypes-and-disallowedtypes' 82196 }, 82197 allowedTypes: { 82198 to: 'allowedElements', 82199 id: 'replace-allownode-allowedtypes-and-disallowedtypes' 82200 }, 82201 disallowedTypes: { 82202 to: 'disallowedElements', 82203 id: 'replace-allownode-allowedtypes-and-disallowedtypes' 82204 }, 82205 includeNodeIndex: { 82206 to: 'includeElementIndex', 82207 id: 'change-includenodeindex-to-includeelementindex' 82208 } 82209} 82210 82211/** 82212 * React component to render markdown. 82213 * 82214 * @param {ReactMarkdownOptions} options 82215 * @returns {ReactElement} 82216 */ 82217function ReactMarkdown(options) { 82218 for (const key in deprecated) { 82219 if (react_markdown_own.call(deprecated, key) && react_markdown_own.call(options, key)) { 82220 const deprecation = deprecated[key] 82221 console.warn( 82222 `[react-markdown] Warning: please ${ 82223 deprecation.to ? `use \`${deprecation.to}\` instead of` : 'remove' 82224 } \`${key}\` (see <${changelog}#${deprecation.id}> for more info)` 82225 )
82226 delete deprecated[key] 82227 } 82228 } 82229 82230 const processor = unified() 82231 .use(remarkParse) 82232 .use(options.remarkPlugins || []) 82233 .use(lib, { 82234 ...options.remarkRehypeOptions, 82235 allowDangerousHtml: true 82236 }) 82237 .use(options.rehypePlugins || []) 82238 .use(rehypeFilter, options) 82239 82240 const file = new VFile() 82241 82242 if (typeof options.children === 'string') { 82243 file.value = options.children 82244 } else if (options.children !== undefined && options.children !== null) { 82245 console.warn( 82246 `[react-markdown] Warning: please pass a string as \`children\` (not: \`${options.children}\`)` 82247 ) 82248 } 82249 82250 const hastNode = processor.runSync(processor.parse(file), file) 82251 82252 if (hastNode.type !== 'root') { 82253 throw new TypeError('Expected a `root` node') 82254 } 82255 82256 /** @type {ReactElement} */ 82257 let result = react.createElement( 82258 react.Fragment, 82259 {}, 82260 childrenToReact({options, schema: property_information_html, listDepth: 0}, hastNode) 82261 ) 82262 82263 if (options.className) { 82264 result = react.createElement('div', {className: options.className}, result) 82265 } 82266 82267 return result 82268} 82269 82270ReactMarkdown.propTypes = { 82271 // Core options: 82272 children: (prop_types_default()).string, 82273 // Layout options: 82274 className: (prop_types_default()).string, 82275 // Filter options: 82276 allowElement: (prop_types_default()).func, 82277 allowedElements: prop_types_default().arrayOf((prop_types_default()).string), 82278 disallowedElements: prop_types_default().arrayOf((prop_types_default()).string), 82279 unwrapDisallowed: (prop_types_default()).bool, 82280 // Plugin options: 82281 remarkPlugins: prop_types_default().arrayOf( 82282 prop_types_default().oneOfType([ 82283 (prop_types_default()).object, 82284 (prop_types_default()).func, 82285 prop_types_default().arrayOf( 82286 prop_types_default().oneOfType([ 82287 (prop_types_default()).bool, 82288 (prop_types_default()).string, 82289 (prop_types_default()).object, 82290 (prop_types_default()).func, 82291 prop_types_default().arrayOf( 82292 // prettier-ignore 82293 // type-coverage:ignore-next-line 82294 (prop_types_default()).any 82295 ) 82296 ]) 82297 ) 82298 ]) 82299 ), 82300 rehypePlugins: prop_types_default().arrayOf( 82301 prop_types_default().oneOfType([ 82302 (prop_types_default()).object, 82303 (prop_types_default()).func, 82304 prop_types_default().arrayOf( 82305 prop_types_default().oneOfType([ 82306 (prop_types_default()).bool, 82307 (prop_types_default()).string, 82308 (prop_types_default()).object, 82309 (prop_types_default()).func, 82310 prop_types_default().arrayOf( 82311 // prettier-ignore 82312 // type-coverage:ignore-next-line 82313 (prop_types_default()).any 82314 ) 82315 ]) 82316 ) 82317 ]) 82318 ), 82319 // Transform options: 82320 sourcePos: (prop_types_default()).bool, 82321 rawSourcePos: (prop_types_default()).bool, 82322 skipHtml: (prop_types_default()).bool, 82323 includeElementIndex: (prop_types_default()).bool, 82324 transformLinkUri: prop_types_default().oneOfType([(prop_types_default()).func, (prop_types_default()).bool]), 82325 linkTarget: prop_types_default().oneOfType([(prop_types_default()).func, (prop_types_default()).string]), 82326 transformImageUri: (prop_types_default()).func, 82327 components: (prop_types_default()).object 82328} 82329 82330 82331/***/ }, 82332 82333/***/ 10976 82334(__unused_webpack_module, exports) { 82335 82336"use strict"; 82337/** 82338 * @license React 82339 * react-is.production.min.js 82340 * 82341 * Copyright (c) Facebook, Inc. and its affiliates. 82342 * 82343 * This source code is licensed under the MIT license found in the 82344 * LICENSE file in the root directory of this source tree. 82345 */ 82346var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference"); 82347function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m; 82348exports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p}; 82349exports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n}; 82350exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v; 82351 82352 82353/***/ }, 82354 82355/***/ 88316 82356(module, __unused_webpack_exports, __webpack_require__) { 82357 82358"use strict"; 82359 82360 82361if (true) { 82362 module.exports = __webpack_require__(10976); 82363} else // removed by dead control flow 82364{} 82365 82366 82367/***/ }, 82368 82369/***/ 45135 82370(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 82371 82372"use strict"; 82373/* harmony export */ __webpack_require__.d(__webpack_exports__, { 82374/* harmony export */ Kq: () => (/* binding */ Provider_default), 82375/* harmony export */ Ng: () => (/* binding */ connect), 82376/* harmony export */ d4: () => (/* binding */ useSelector), 82377/* harmony export */ wA: () => (/* binding */ useDispatch) 82378/* harmony export */ }); 82379/* unused harmony exports ReactReduxContext, batch, createDispatchHook, createSelectorHook, createStoreHook, legacy_connect, shallowEqual, useStore */ 82380/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 82381/* harmony import */ var use_sync_external_store_with_selector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(78418);
82382// src/utils/react.ts 82383 82384
vendor: 3,136 bytes, lines 82385-82446
82385// src/utils/react-is.ts 82386var IS_REACT_19 = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.version.startsWith("19"); 82387var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for( 82388 IS_REACT_19 ? "react.transitional.element" : "react.element" 82389); 82390var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"); 82391var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"); 82392var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"); 82393var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"); 82394var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"); 82395var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"); 82396var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"); 82397var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"); 82398var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for( 82399 "react.suspense_list" 82400); 82401var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"); 82402var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); 82403var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ (/* unused pure expression or super */ null && (Symbol.for("react.offscreen"))); 82404var REACT_CLIENT_REFERENCE = /* @__PURE__ */ (/* unused pure expression or super */ null && (Symbol.for( 82405 "react.client.reference" 82406))); 82407var ForwardRef = REACT_FORWARD_REF_TYPE; 82408var Memo = REACT_MEMO_TYPE; 82409function isValidElementType(type) { 82410 return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_OFFSCREEN_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0) ? true : false; 82411} 82412function typeOf(object) { 82413 if (typeof object === "object" && object !== null) { 82414 const { $$typeof } = object; 82415 switch ($$typeof) { 82416 case REACT_ELEMENT_TYPE: 82417 switch (object = object.type, object) { 82418 case REACT_FRAGMENT_TYPE: 82419 case REACT_PROFILER_TYPE: 82420 case REACT_STRICT_MODE_TYPE: 82421 case REACT_SUSPENSE_TYPE: 82422 case REACT_SUSPENSE_LIST_TYPE: 82423 return object; 82424 default: 82425 switch (object = object && object.$$typeof, object) { 82426 case REACT_CONTEXT_TYPE: 82427 case REACT_FORWARD_REF_TYPE: 82428 case REACT_LAZY_TYPE: 82429 case REACT_MEMO_TYPE: 82430 return object; 82431 case REACT_CONSUMER_TYPE: 82432 return object; 82433 default: 82434 return $$typeof; 82435 } 82436 } 82437 case REACT_PORTAL_TYPE: 82438 return $$typeof; 82439 } 82440 } 82441} 82442function isContextConsumer(object) { 82443 return IS_REACT_19 ? typeOf(object) === REACT_CONSUMER_TYPE : typeOf(object) === REACT_CONTEXT_TYPE; 82444} 82445function isMemo(object) { 82446 return typeOf(object) === REACT_MEMO_TYPE
vendor: 229 bytes, lines 82446-82459
82446; 82447} 82448 82449// src/utils/warning.ts 82450function warning(message) { 82451 if (typeof console !== "undefined" && typeof console.error === "function") { 82452 console.error(message); 82453 } 82454 try { 82455 throw new Error(message); 82456 } catch (e) { 82457 } 82458} 82459
vendor: 3,320 bytes, lines 82460-82550
82460// src/connect/verifySubselectors.ts 82461function verify(selector, methodName) { 82462 if (!selector) { 82463 throw new Error(`Unexpected value for ${methodName} in connect.`); 82464 } else if (methodName === "mapStateToProps" || methodName === "mapDispatchToProps") { 82465 if (!Object.prototype.hasOwnProperty.call(selector, "dependsOnOwnProps")) { 82466 warning( 82467 `The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.` 82468 ); 82469 } 82470 } 82471} 82472function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) { 82473 verify(mapStateToProps, "mapStateToProps"); 82474 verify(mapDispatchToProps, "mapDispatchToProps"); 82475 verify(mergeProps, "mergeProps"); 82476} 82477 82478// src/connect/selectorFactory.ts 82479function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, { 82480 areStatesEqual, 82481 areOwnPropsEqual, 82482 areStatePropsEqual 82483}) { 82484 let hasRunAtLeastOnce = false; 82485 let state; 82486 let ownProps; 82487 let stateProps; 82488 let dispatchProps; 82489 let mergedProps; 82490 function handleFirstCall(firstState, firstOwnProps) { 82491 state = firstState; 82492 ownProps = firstOwnProps; 82493 stateProps = mapStateToProps(state, ownProps); 82494 dispatchProps = mapDispatchToProps(dispatch, ownProps); 82495 mergedProps = mergeProps(stateProps, dispatchProps, ownProps); 82496 hasRunAtLeastOnce = true; 82497 return mergedProps; 82498 } 82499 function handleNewPropsAndNewState() { 82500 stateProps = mapStateToProps(state, ownProps); 82501 if (mapDispatchToProps.dependsOnOwnProps) 82502 dispatchProps = mapDispatchToProps(dispatch, ownProps); 82503 mergedProps = mergeProps(stateProps, dispatchProps, ownProps); 82504 return mergedProps; 82505 } 82506 function handleNewProps() { 82507 if (mapStateToProps.dependsOnOwnProps) 82508 stateProps = mapStateToProps(state, ownProps); 82509 if (mapDispatchToProps.dependsOnOwnProps) 82510 dispatchProps = mapDispatchToProps(dispatch, ownProps); 82511 mergedProps = mergeProps(stateProps, dispatchProps, ownProps); 82512 return mergedProps; 82513 } 82514 function handleNewState() { 82515 const nextStateProps = mapStateToProps(state, ownProps); 82516 const statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); 82517 stateProps = nextStateProps; 82518 if (statePropsChanged) 82519 mergedProps = mergeProps(stateProps, dispatchProps, ownProps); 82520 return mergedProps; 82521 } 82522 function handleSubsequentCalls(nextState, nextOwnProps) { 82523 const propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); 82524 const stateChanged = !areStatesEqual( 82525 nextState, 82526 state, 82527 nextOwnProps, 82528 ownProps 82529 ); 82530 state = nextState; 82531 ownProps = nextOwnProps; 82532 if (propsChanged && stateChanged) return handleNewPropsAndNewState(); 82533 if (propsChanged) return handleNewProps(); 82534 if (stateChanged) return handleNewState(); 82535 return mergedProps; 82536 } 82537 return function pureFinalPropsSelector(nextState, nextOwnProps) { 82538 return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); 82539 }; 82540} 82541function finalPropsSelectorFactory(dispatch, { 82542 initMapStateToProps, 82543 initMapDispatchToProps, 82544 initMergeProps, 82545 ...options 82546}) { 82547 const mapStateToProps = initMapStateToProps(dispatch, options); 82548 const mapDispatchToProps = initMapDispatchToProps(dispatch, options); 82549 const mergeProps = initMergeProps(dispatch, options); 82550 if (
82550false) // removed by dead control flow 82551{
vendor: 2,389 bytes, lines 82551-82617
82551} 82552 return pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); 82553} 82554 82555// src/utils/bindActionCreators.ts 82556function bindActionCreators(actionCreators, dispatch) { 82557 const boundActionCreators = {}; 82558 for (const key in actionCreators) { 82559 const actionCreator = actionCreators[key]; 82560 if (typeof actionCreator === "function") { 82561 boundActionCreators[key] = (...args) => dispatch(actionCreator(...args)); 82562 } 82563 } 82564 return boundActionCreators; 82565} 82566 82567// src/utils/isPlainObject.ts 82568function isPlainObject(obj) { 82569 if (typeof obj !== "object" || obj === null) return false; 82570 const proto = Object.getPrototypeOf(obj); 82571 if (proto === null) return true; 82572 let baseProto = proto; 82573 while (Object.getPrototypeOf(baseProto) !== null) { 82574 baseProto = Object.getPrototypeOf(baseProto); 82575 } 82576 return proto === baseProto; 82577} 82578 82579// src/utils/verifyPlainObject.ts 82580function verifyPlainObject(value, displayName, methodName) { 82581 if (!isPlainObject(value)) { 82582 warning( 82583 `${methodName}() in ${displayName} must return a plain object. Instead received ${value}.` 82584 ); 82585 } 82586} 82587 82588// src/connect/wrapMapToProps.ts 82589function wrapMapToPropsConstant(getConstant) { 82590 return function initConstantSelector(dispatch) { 82591 const constant = getConstant(dispatch); 82592 function constantSelector() { 82593 return constant; 82594 } 82595 constantSelector.dependsOnOwnProps = false; 82596 return constantSelector; 82597 }; 82598} 82599function getDependsOnOwnProps(mapToProps) { 82600 return mapToProps.dependsOnOwnProps ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1; 82601} 82602function wrapMapToPropsFunc(mapToProps, methodName) { 82603 return function initProxySelector(dispatch, { displayName }) { 82604 const proxy = function mapToPropsProxy(stateOrDispatch, ownProps) { 82605 return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, void 0); 82606 }; 82607 proxy.dependsOnOwnProps = true; 82608 proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) { 82609 proxy.mapToProps = mapToProps; 82610 proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps); 82611 let props = proxy(stateOrDispatch, ownProps); 82612 if (typeof props === "function") { 82613 proxy.mapToProps = props; 82614 proxy.dependsOnOwnProps = getDependsOnOwnProps(props); 82615 props = proxy(stateOrDispatch, ownProps); 82616 } 82617 if (
82617false) 82618 // removed by dead control flow 82619{}
vendor: 1,964 bytes, lines 82619-82674
82619 82620 return props; 82621 }; 82622 return proxy; 82623 }; 82624} 82625 82626// src/connect/invalidArgFactory.ts 82627function createInvalidArgFactory(arg, name) { 82628 return (dispatch, options) => { 82629 throw new Error( 82630 `Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.` 82631 ); 82632 }; 82633} 82634 82635// src/connect/mapDispatchToProps.ts 82636function mapDispatchToPropsFactory(mapDispatchToProps) { 82637 return mapDispatchToProps && typeof mapDispatchToProps === "object" ? wrapMapToPropsConstant( 82638 (dispatch) => ( 82639 // @ts-ignore 82640 bindActionCreators(mapDispatchToProps, dispatch) 82641 ) 82642 ) : !mapDispatchToProps ? wrapMapToPropsConstant((dispatch) => ({ 82643 dispatch 82644 })) : typeof mapDispatchToProps === "function" ? ( 82645 // @ts-ignore 82646 wrapMapToPropsFunc(mapDispatchToProps, "mapDispatchToProps") 82647 ) : createInvalidArgFactory(mapDispatchToProps, "mapDispatchToProps"); 82648} 82649 82650// src/connect/mapStateToProps.ts 82651function mapStateToPropsFactory(mapStateToProps) { 82652 return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === "function" ? ( 82653 // @ts-ignore 82654 wrapMapToPropsFunc(mapStateToProps, "mapStateToProps") 82655 ) : createInvalidArgFactory(mapStateToProps, "mapStateToProps"); 82656} 82657 82658// src/connect/mergeProps.ts 82659function defaultMergeProps(stateProps, dispatchProps, ownProps) { 82660 return { ...ownProps, ...stateProps, ...dispatchProps }; 82661} 82662function wrapMergePropsFunc(mergeProps) { 82663 return function initMergePropsProxy(dispatch, { displayName, areMergedPropsEqual }) { 82664 let hasRunOnce = false; 82665 let mergedProps; 82666 return function mergePropsProxy(stateProps, dispatchProps, ownProps) { 82667 const nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps); 82668 if (hasRunOnce) { 82669 if (!areMergedPropsEqual(nextMergedProps, mergedProps)) 82670 mergedProps = nextMergedProps; 82671 } else { 82672 hasRunOnce = true; 82673 mergedProps = nextMergedProps; 82674 if (
82674false) 82675 // removed by dead control flow 82676{}
vendor: 3,773 bytes, lines 82676-82825
82676 82677 } 82678 return mergedProps; 82679 }; 82680 }; 82681} 82682function mergePropsFactory(mergeProps) { 82683 return !mergeProps ? () => defaultMergeProps : typeof mergeProps === "function" ? wrapMergePropsFunc(mergeProps) : createInvalidArgFactory(mergeProps, "mergeProps"); 82684} 82685 82686// src/utils/batch.ts 82687function defaultNoopBatch(callback) { 82688 callback(); 82689} 82690 82691// src/utils/Subscription.ts 82692function createListenerCollection() { 82693 let first = null; 82694 let last = null; 82695 return { 82696 clear() { 82697 first = null; 82698 last = null; 82699 }, 82700 notify() { 82701 defaultNoopBatch(() => { 82702 let listener = first; 82703 while (listener) { 82704 listener.callback(); 82705 listener = listener.next; 82706 } 82707 }); 82708 }, 82709 get() { 82710 const listeners = []; 82711 let listener = first; 82712 while (listener) { 82713 listeners.push(listener); 82714 listener = listener.next; 82715 } 82716 return listeners; 82717 }, 82718 subscribe(callback) { 82719 let isSubscribed = true; 82720 const listener = last = { 82721 callback, 82722 next: null, 82723 prev: last 82724 }; 82725 if (listener.prev) { 82726 listener.prev.next = listener; 82727 } else { 82728 first = listener; 82729 } 82730 return function unsubscribe() { 82731 if (!isSubscribed || first === null) return; 82732 isSubscribed = false; 82733 if (listener.next) { 82734 listener.next.prev = listener.prev; 82735 } else { 82736 last = listener.prev; 82737 } 82738 if (listener.prev) { 82739 listener.prev.next = listener.next; 82740 } else { 82741 first = listener.next; 82742 } 82743 }; 82744 } 82745 }; 82746} 82747var nullListeners = { 82748 notify() { 82749 }, 82750 get: () => [] 82751}; 82752function createSubscription(store, parentSub) { 82753 let unsubscribe; 82754 let listeners = nullListeners; 82755 let subscriptionsAmount = 0; 82756 let selfSubscribed = false; 82757 function addNestedSub(listener) { 82758 trySubscribe(); 82759 const cleanupListener = listeners.subscribe(listener); 82760 let removed = false; 82761 return () => { 82762 if (!removed) { 82763 removed = true; 82764 cleanupListener(); 82765 tryUnsubscribe(); 82766 } 82767 }; 82768 } 82769 function notifyNestedSubs() { 82770 listeners.notify(); 82771 } 82772 function handleChangeWrapper() { 82773 if (subscription.onStateChange) { 82774 subscription.onStateChange(); 82775 } 82776 } 82777 function isSubscribed() { 82778 return selfSubscribed; 82779 } 82780 function trySubscribe() { 82781 subscriptionsAmount++; 82782 if (!unsubscribe) { 82783 unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper); 82784 listeners = createListenerCollection(); 82785 } 82786 } 82787 function tryUnsubscribe() { 82788 subscriptionsAmount--; 82789 if (unsubscribe && subscriptionsAmount === 0) { 82790 unsubscribe(); 82791 unsubscribe = void 0; 82792 listeners.clear(); 82793 listeners = nullListeners; 82794 } 82795 } 82796 function trySubscribeSelf() { 82797 if (!selfSubscribed) { 82798 selfSubscribed = true; 82799 trySubscribe(); 82800 } 82801 } 82802 function tryUnsubscribeSelf() { 82803 if (selfSubscribed) { 82804 selfSubscribed = false; 82805 tryUnsubscribe(); 82806 } 82807 } 82808 const subscription = { 82809 addNestedSub, 82810 notifyNestedSubs, 82811 handleChangeWrapper, 82812 isSubscribed, 82813 trySubscribe: trySubscribeSelf, 82814 tryUnsubscribe: tryUnsubscribeSelf, 82815 getListeners: () => listeners 82816 }; 82817 return subscription; 82818} 82819 82820// src/utils/useIsomorphicLayoutEffect.ts 82821var canUseDOM = () => !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); 82822var isDOM = /* @__PURE__ */ canUseDOM(); 82823var isRunningInReactNative = () => typeof navigator !== "undefined" && navigator.product === "ReactNative"; 82824var isReactNative = /* @__PURE__ */ isRunningInReactNative(); 82825var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ?
82825react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect; 82826var useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect(); 82827
vendor: 669 bytes, lines 82828-82851
82828// src/utils/shallowEqual.ts 82829function is(x, y) { 82830 if (x === y) { 82831 return x !== 0 || y !== 0 || 1 / x === 1 / y; 82832 } else { 82833 return x !== x && y !== y; 82834 } 82835} 82836function shallowEqual(objA, objB) { 82837 if (is(objA, objB)) return true; 82838 if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { 82839 return false; 82840 } 82841 const keysA = Object.keys(objA); 82842 const keysB = Object.keys(objB); 82843 if (keysA.length !== keysB.length) return false; 82844 for (let i = 0; i < keysA.length; i++) { 82845 if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { 82846 return false; 82847 } 82848 } 82849 return true; 82850} 82851
vendor: 2,581 bytes, lines 82852-82941
82852// src/utils/hoistStatics.ts 82853var REACT_STATICS = { 82854 childContextTypes: true, 82855 contextType: true, 82856 contextTypes: true, 82857 defaultProps: true, 82858 displayName: true, 82859 getDefaultProps: true, 82860 getDerivedStateFromError: true, 82861 getDerivedStateFromProps: true, 82862 mixins: true, 82863 propTypes: true, 82864 type: true 82865}; 82866var KNOWN_STATICS = { 82867 name: true, 82868 length: true, 82869 prototype: true, 82870 caller: true, 82871 callee: true, 82872 arguments: true, 82873 arity: true 82874}; 82875var FORWARD_REF_STATICS = { 82876 $$typeof: true, 82877 render: true, 82878 defaultProps: true, 82879 displayName: true, 82880 propTypes: true 82881}; 82882var MEMO_STATICS = { 82883 $$typeof: true, 82884 compare: true, 82885 defaultProps: true, 82886 displayName: true, 82887 propTypes: true, 82888 type: true 82889}; 82890var TYPE_STATICS = { 82891 [ForwardRef]: FORWARD_REF_STATICS, 82892 [Memo]: MEMO_STATICS 82893}; 82894function getStatics(component) { 82895 if (isMemo(component)) { 82896 return MEMO_STATICS; 82897 } 82898 return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS; 82899} 82900var defineProperty = Object.defineProperty; 82901var getOwnPropertyNames = Object.getOwnPropertyNames; 82902var getOwnPropertySymbols = Object.getOwnPropertySymbols; 82903var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 82904var getPrototypeOf = Object.getPrototypeOf; 82905var objectPrototype = Object.prototype; 82906function hoistNonReactStatics(targetComponent, sourceComponent) { 82907 if (typeof sourceComponent !== "string") { 82908 if (objectPrototype) { 82909 const inheritedComponent = getPrototypeOf(sourceComponent); 82910 if (inheritedComponent && inheritedComponent !== objectPrototype) { 82911 hoistNonReactStatics(targetComponent, inheritedComponent); 82912 } 82913 } 82914 let keys = getOwnPropertyNames(sourceComponent); 82915 if (getOwnPropertySymbols) { 82916 keys = keys.concat(getOwnPropertySymbols(sourceComponent)); 82917 } 82918 const targetStatics = getStatics(targetComponent); 82919 const sourceStatics = getStatics(sourceComponent); 82920 for (let i = 0; i < keys.length; ++i) { 82921 const key = keys[i]; 82922 if (!KNOWN_STATICS[key] && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { 82923 const descriptor = getOwnPropertyDescriptor(sourceComponent, key); 82924 try { 82925 defineProperty(targetComponent, key, descriptor); 82926 } catch (e) { 82927 } 82928 } 82929 } 82930 } 82931 return targetComponent; 82932} 82933 82934// src/components/Context.ts 82935var ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`); 82936var gT = typeof globalThis !== "undefined" ? globalThis : ( 82937 /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */ 82938 {} 82939); 82940function getContext() { 82941 if (!
82941react__WEBPACK_IMPORTED_MODULE_0__.createContext) return {}; 82942 const contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map(); 82943 let realContext = contextMap.get(react__WEBPACK_IMPORTED_MODULE_0__.createContext); 82944 if (!realContext) { 82945 realContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext( 82946 null 82947 ); 82948 if (false) // removed by dead control flow 82949{} 82950 contextMap.set(react__WEBPACK_IMPORTED_MODULE_0__.createContext, realContext); 82951 } 82952 return realContext; 82953} 82954var ReactReduxContext = /* @__PURE__ */ getContext(); 82955
vendor: 12,074 bytes, lines 82956-83261
82956// src/components/connect.tsx 82957var NO_SUBSCRIPTION_ARRAY = [null, null]; 82958var stringifyComponent = (Comp) => { 82959 try { 82960 return JSON.stringify(Comp); 82961 } catch (err) { 82962 return String(Comp); 82963 } 82964}; 82965function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) { 82966 useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies); 82967} 82968function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs) { 82969 lastWrapperProps.current = wrapperProps; 82970 renderIsScheduled.current = false; 82971 if (childPropsFromStoreUpdate.current) { 82972 childPropsFromStoreUpdate.current = null; 82973 notifyNestedSubs(); 82974 } 82975} 82976function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, additionalSubscribeListener) { 82977 if (!shouldHandleStateChanges) return () => { 82978 }; 82979 let didUnsubscribe = false; 82980 let lastThrownError = null; 82981 const checkForUpdates = () => { 82982 if (didUnsubscribe || !isMounted.current) { 82983 return; 82984 } 82985 const latestStoreState = store.getState(); 82986 let newChildProps, error; 82987 try { 82988 newChildProps = childPropsSelector( 82989 latestStoreState, 82990 lastWrapperProps.current 82991 ); 82992 } catch (e) { 82993 error = e; 82994 lastThrownError = e; 82995 } 82996 if (!error) { 82997 lastThrownError = null; 82998 } 82999 if (newChildProps === lastChildProps.current) { 83000 if (!renderIsScheduled.current) { 83001 notifyNestedSubs(); 83002 } 83003 } else { 83004 lastChildProps.current = newChildProps; 83005 childPropsFromStoreUpdate.current = newChildProps; 83006 renderIsScheduled.current = true; 83007 additionalSubscribeListener(); 83008 } 83009 }; 83010 subscription.onStateChange = checkForUpdates; 83011 subscription.trySubscribe(); 83012 checkForUpdates(); 83013 const unsubscribeWrapper = () => { 83014 didUnsubscribe = true; 83015 subscription.tryUnsubscribe(); 83016 subscription.onStateChange = null; 83017 if (lastThrownError) { 83018 throw lastThrownError; 83019 } 83020 }; 83021 return unsubscribeWrapper; 83022} 83023function strictEqual(a, b) { 83024 return a === b; 83025} 83026var hasWarnedAboutDeprecatedPureOption = false; 83027function _connect(mapStateToProps, mapDispatchToProps, mergeProps, { 83028 // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence. 83029 // @ts-ignore 83030 pure, 83031 areStatesEqual = strictEqual, 83032 areOwnPropsEqual = shallowEqual, 83033 areStatePropsEqual = shallowEqual, 83034 areMergedPropsEqual = shallowEqual, 83035 // use React's forwardRef to expose a ref of the wrapped component 83036 forwardRef = false, 83037 // the context consumer to use 83038 context = ReactReduxContext 83039} = {}) { 83040 if (false) // removed by dead control flow 83041{} 83042 const Context = context; 83043 const initMapStateToProps = mapStateToPropsFactory(mapStateToProps); 83044 const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps); 83045 const initMergeProps = mergePropsFactory(mergeProps); 83046 const shouldHandleStateChanges = Boolean(mapStateToProps); 83047 const wrapWithConnect = (WrappedComponent) => { 83048 if (false) // removed by dead control flow 83049{} 83050 const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || "Component"; 83051 const displayName = `Connect(${wrappedComponentName})`; 83052 const selectorFactoryOptions = { 83053 shouldHandleStateChanges, 83054 displayName, 83055 wrappedComponentName, 83056 WrappedComponent, 83057 // @ts-ignore 83058 initMapStateToProps, 83059 initMapDispatchToProps, 83060 initMergeProps, 83061 areStatesEqual, 83062 areStatePropsEqual, 83063 areOwnPropsEqual, 83064 areMergedPropsEqual 83065 }; 83066 function ConnectFunction(props) { 83067 const [propsContext, reactReduxForwardedRef, wrapperProps] = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83068 const { reactReduxForwardedRef: reactReduxForwardedRef2, ...wrapperProps2 } = props; 83069 return [props.context, reactReduxForwardedRef2, wrapperProps2]; 83070 }, [props]); 83071 const ContextToUse = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83072 let ResultContext = Context; 83073 if (propsContext?.Consumer) { 83074 if (false) // removed by dead control flow 83075{} 83076 } 83077 return ResultContext; 83078 }, [propsContext, Context]); 83079 const contextValue = react__WEBPACK_IMPORTED_MODULE_0__.useContext(ContextToUse); 83080 const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch); 83081 const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store); 83082 if (false) // removed by dead control flow 83083{} 83084 const store = didStoreComeFromProps ? props.store : contextValue.store; 83085 const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState; 83086 const childPropsSelector = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83087 return finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions); 83088 }, [store]); 83089 const [subscription, notifyNestedSubs] = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83090 if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; 83091 const subscription2 = createSubscription( 83092 store, 83093 didStoreComeFromProps ? void 0 : contextValue.subscription 83094 ); 83095 const notifyNestedSubs2 = subscription2.notifyNestedSubs.bind(subscription2); 83096 return [subscription2, notifyNestedSubs2]; 83097 }, [store, didStoreComeFromProps, contextValue]); 83098 const overriddenContextValue = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83099 if (didStoreComeFromProps) { 83100 return contextValue; 83101 } 83102 return { 83103 ...contextValue, 83104 subscription 83105 }; 83106 }, [didStoreComeFromProps, contextValue, subscription]); 83107 const lastChildProps = react__WEBPACK_IMPORTED_MODULE_0__.useRef(void 0); 83108 const lastWrapperProps = react__WEBPACK_IMPORTED_MODULE_0__.useRef(wrapperProps); 83109 const childPropsFromStoreUpdate = react__WEBPACK_IMPORTED_MODULE_0__.useRef(void 0); 83110 const renderIsScheduled = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 83111 const isMounted = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 83112 const latestSubscriptionCallbackError = react__WEBPACK_IMPORTED_MODULE_0__.useRef( 83113 void 0 83114 ); 83115 useIsomorphicLayoutEffect(() => { 83116 isMounted.current = true; 83117 return () => { 83118 isMounted.current = false; 83119 }; 83120 }, []); 83121 const actualChildPropsSelector = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83122 const selector = () => { 83123 if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) { 83124 return childPropsFromStoreUpdate.current; 83125 } 83126 return childPropsSelector(store.getState(), wrapperProps); 83127 }; 83128 return selector; 83129 }, [store, wrapperProps]); 83130 const subscribeForReact = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83131 const subscribe = (reactListener) => { 83132 if (!subscription) { 83133 return () => { 83134 }; 83135 } 83136 return subscribeUpdates( 83137 shouldHandleStateChanges, 83138 store, 83139 subscription, 83140 // @ts-ignore 83141 childPropsSelector, 83142 lastWrapperProps, 83143 lastChildProps, 83144 renderIsScheduled, 83145 isMounted, 83146 childPropsFromStoreUpdate, 83147 notifyNestedSubs, 83148 reactListener 83149 ); 83150 }; 83151 return subscribe; 83152 }, [subscription]); 83153 useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [ 83154 lastWrapperProps, 83155 lastChildProps, 83156 renderIsScheduled, 83157 wrapperProps, 83158 childPropsFromStoreUpdate, 83159 notifyNestedSubs 83160 ]); 83161 let actualChildProps; 83162 try { 83163 actualChildProps = react__WEBPACK_IMPORTED_MODULE_0__.useSyncExternalStore( 83164 // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing 83165 subscribeForReact, 83166 // TODO This is incredibly hacky. We've already processed the store update and calculated new child props, 83167 // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`. 83168 actualChildPropsSelector, 83169 getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector 83170 ); 83171 } catch (err) { 83172 if (latestSubscriptionCallbackError.current) { 83173 ; 83174 err.message += ` 83175The error may be correlated with this previous error: 83176${latestSubscriptionCallbackError.current.stack} 83177 83178`; 83179 } 83180 throw err; 83181 } 83182 useIsomorphicLayoutEffect(() => { 83183 latestSubscriptionCallbackError.current = void 0; 83184 childPropsFromStoreUpdate.current = void 0; 83185 lastChildProps.current = actualChildProps; 83186 }); 83187 const renderedWrappedComponent = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83188 return ( 83189 // @ts-ignore 83190 /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( 83191 WrappedComponent, 83192 { 83193 ...actualChildProps, 83194 ref: reactReduxForwardedRef 83195 } 83196 ) 83197 ); 83198 }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); 83199 const renderedChild = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83200 if (shouldHandleStateChanges) { 83201 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent); 83202 } 83203 return renderedWrappedComponent; 83204 }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]); 83205 return renderedChild; 83206 } 83207 const _Connect = react__WEBPACK_IMPORTED_MODULE_0__.memo(ConnectFunction); 83208 const Connect = _Connect; 83209 Connect.WrappedComponent = WrappedComponent; 83210 Connect.displayName = ConnectFunction.displayName = displayName; 83211 if (forwardRef) { 83212 const _forwarded = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 83213 function forwardConnectRef(props, ref) { 83214 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Connect, { ...props, reactReduxForwardedRef: ref }); 83215 } 83216 ); 83217 const forwarded = _forwarded; 83218 forwarded.displayName = displayName; 83219 forwarded.WrappedComponent = WrappedComponent; 83220 return /* @__PURE__ */ hoistNonReactStatics(forwarded, WrappedComponent); 83221 } 83222 return /* @__PURE__ */ hoistNonReactStatics(Connect, WrappedComponent); 83223 }; 83224 return wrapWithConnect; 83225} 83226var connect = _connect; 83227var legacy_connect = (/* unused pure expression or super */ null && (_connect)); 83228 83229// src/components/Provider.tsx 83230function Provider(providerProps) { 83231 const { children, context, serverState, store } = providerProps; 83232 const contextValue = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 83233 const subscription = createSubscription(store); 83234 const baseContextValue = { 83235 store, 83236 subscription, 83237 getServerState: serverState ? () => serverState : void 0 83238 }; 83239 if (true) { 83240 return baseContextValue; 83241 } else // removed by dead control flow 83242{} 83243 }, [store, serverState]); 83244 const previousState = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => store.getState(), [store]); 83245 useIsomorphicLayoutEffect(() => { 83246 const { subscription } = contextValue; 83247 subscription.onStateChange = subscription.notifyNestedSubs; 83248 subscription.trySubscribe(); 83249 if (previousState !== store.getState()) { 83250 subscription.notifyNestedSubs(); 83251 } 83252 return () => { 83253 subscription.tryUnsubscribe(); 83254 subscription.onStateChange = void 0; 83255 }; 83256 }, [contextValue, previousState]); 83257 const Context = context || ReactReduxContext; 83258 return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Context.Provider, { value: contextValue }, children); 83259} 83260var Provider_default = Provider; 83261
83262// src/hooks/useReduxContext.ts 83263function createReduxContextHook(context = ReactReduxContext) { 83264 return function useReduxContext2() { 83265 const contextValue = react__WEBPACK_IMPORTED_MODULE_0__.useContext(context); 83266 if (false) // removed by dead control flow 83267{
vendor: 1,002 bytes, lines 83267-83304
83267} 83268 return contextValue; 83269 }; 83270} 83271var useReduxContext = /* @__PURE__ */ createReduxContextHook(); 83272 83273// src/hooks/useStore.ts 83274function createStoreHook(context = ReactReduxContext) { 83275 const useReduxContext2 = context === ReactReduxContext ? useReduxContext : ( 83276 // @ts-ignore 83277 createReduxContextHook(context) 83278 ); 83279 const useStore2 = () => { 83280 const { store } = useReduxContext2(); 83281 return store; 83282 }; 83283 Object.assign(useStore2, { 83284 withTypes: () => useStore2 83285 }); 83286 return useStore2; 83287} 83288var useStore = /* @__PURE__ */ createStoreHook(); 83289 83290// src/hooks/useDispatch.ts 83291function createDispatchHook(context = ReactReduxContext) { 83292 const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context); 83293 const useDispatch2 = () => { 83294 const store = useStore2(); 83295 return store.dispatch; 83296 }; 83297 Object.assign(useDispatch2, { 83298 withTypes: () => useDispatch2 83299 }); 83300 return useDispatch2; 83301} 83302var useDispatch = /* @__PURE__ */ createDispatchHook(); 83303 83304// src/hooks/useSelector.ts
vendor: 1,479 bytes, lines 83305-83343
83305 83306var refEquality = (a, b) => a === b; 83307function createSelectorHook(context = ReactReduxContext) { 83308 const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context); 83309 const useSelector2 = (selector, equalityFnOrOptions = {}) => { 83310 const { equalityFn = refEquality } = typeof equalityFnOrOptions === "function" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions; 83311 if (false) // removed by dead control flow 83312{} 83313 const reduxContext = useReduxContext2(); 83314 const { store, subscription, getServerState } = reduxContext; 83315 const firstRun = react__WEBPACK_IMPORTED_MODULE_0__.useRef(true); 83316 const wrappedSelector = react__WEBPACK_IMPORTED_MODULE_0__.useCallback( 83317 { 83318 [selector.name](state) { 83319 const selected = selector(state); 83320 if (false) // removed by dead control flow 83321{} 83322 return selected; 83323 } 83324 }[selector.name], 83325 [selector] 83326 ); 83327 const selectedState = (0,use_sync_external_store_with_selector_js__WEBPACK_IMPORTED_MODULE_1__.useSyncExternalStoreWithSelector)( 83328 subscription.addNestedSub, 83329 store.getState, 83330 getServerState || store.getState, 83331 wrappedSelector, 83332 equalityFn 83333 ); 83334 react__WEBPACK_IMPORTED_MODULE_0__.useDebugValue(selectedState); 83335 return selectedState; 83336 }; 83337 Object.assign(useSelector2, { 83338 withTypes: () => useSelector2 83339 }); 83340 return useSelector2; 83341} 83342var useSelector = /* @__PURE__ */ createSelectorHook(); 83343
83344// src/exports.ts 83345var batch = (/* unused pure expression or super */ null && (defaultNoopBatch)); 83346 83347//# sourceMappingURL=react-redux.mjs.map 83348 83349/***/ }, 83350 83351/***/ 84976 83352(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 83353 83354"use strict"; 83355var react__WEBPACK_IMPORTED_MODULE_0___namespace_cache; 83356var react_dom__WEBPACK_IMPORTED_MODULE_1___namespace_cache; 83357/* harmony export */ __webpack_require__.d(__webpack_exports__, { 83358/* harmony export */ N_: () => (/* binding */ Link), 83359/* harmony export */ k2: () => (/* binding */ NavLink), 83360/* harmony export */ rI: () => (/* binding */ HistoryRouter) 83361/* harmony export */ }); 83362/* unused harmony exports BrowserRouter, Form, HashRouter, RouterProvider, ScrollRestoration, UNSAFE_FetchersContext, UNSAFE_ViewTransitionContext, UNSAFE_useScrollRestoration, createBrowserRouter, createHashRouter, createSearchParams, unstable_usePrompt, useBeforeUnload, useFetcher, useFetchers, useFormAction, useLinkClickHandler, useSearchParams, useSubmit, useViewTransitionState */ 83363/* unused harmony import specifier */ var React; 83364/* unused harmony import specifier */ var UNSAFE_mapRouteProperties; 83365/* unused harmony import specifier */ var UNSAFE_logV6DeprecationWarnings; 83366/* unused harmony import specifier */ var UNSAFE_DataRouterContext; 83367/* unused harmony import specifier */ var UNSAFE_DataRouterStateContext; 83368/* unused harmony import specifier */ var Router; 83369/* unused harmony import specifier */ var UNSAFE_useRoutesImpl; 83370/* unused harmony import specifier */ var useLocation; 83371/* unused harmony import specifier */ var useNavigate; 83372/* unused harmony import specifier */ var UNSAFE_NavigationContext; 83373/* unused harmony import specifier */ var UNSAFE_useRouteId; 83374/* unused harmony import specifier */ var UNSAFE_RouteContext; 83375/* unused harmony import specifier */ var useResolvedPath; 83376/* unused harmony import specifier */ var useMatches; 83377/* unused harmony import specifier */ var useNavigation; 83378/* unused harmony import specifier */ var useBlocker; 83379/* unused harmony import specifier */ var createPath; 83380/* unused harmony import specifier */ var stripBasename; 83381/* unused harmony import specifier */ var createRouter; 83382/* unused harmony import specifier */ var createBrowserHistory; 83383/* unused harmony import specifier */ var createHashHistory; 83384/* unused harmony import specifier */ var UNSAFE_ErrorResponseImpl; 83385/* unused harmony import specifier */ var UNSAFE_invariant; 83386/* unused harmony import specifier */ var joinPaths; 83387/* unused harmony import specifier */ var IDLE_FETCHER; 83388/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 83389/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40961); 83390/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20913); 83391/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(45588); 83392/** 83393 * React Router DOM v6.30.4 83394 * 83395 * Copyright (c) Remix Software Inc. 83396 * 83397 * This source code is licensed under the MIT license found in the 83398 * LICENSE.md file in the root directory of this source tree. 83399 * 83400 * @license MIT 83401 */ 83402 83403 83404 83405 83406 83407 83408 83409function _extends() { 83410 return _extends = Object.assign ? Object.assign.bind() : function (n) { 83411 for (var e = 1; e < arguments.length; e++) { 83412 var t = arguments[e]; 83413 for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); 83414 } 83415 return n; 83416 }, _extends.apply(null, arguments); 83417} 83418function _objectWithoutPropertiesLoose(r, e) { 83419 if (null == r) return {}; 83420 var t = {}; 83421 for (var n in r) if ({}.hasOwnProperty.call(r, n)) { 83422 if (-1 !== e.indexOf(n)) continue; 83423 t[n] = r[n]; 83424 } 83425 return t; 83426} 83427 83428const defaultMethod = "get"; 83429const defaultEncType = "application/x-www-form-urlencoded"; 83430function isHtmlElement(object) { 83431 return object != null && typeof object.tagName === "string"; 83432} 83433function isButtonElement(object) { 83434 return isHtmlElement(object) && object.tagName.toLowerCase() === "button"; 83435} 83436function isFormElement(object) { 83437 return isHtmlElement(object) && object.tagName.toLowerCase() === "form"; 83438} 83439function isInputElement(object) { 83440 return isHtmlElement(object) && object.tagName.toLowerCase() === "input"; 83441} 83442function isModifiedEvent(event) { 83443 return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); 83444} 83445function shouldProcessLinkClick(event, target) { 83446 return event.button === 0 && ( 83447 // Ignore everything but left clicks 83448 !target || target === "_self") && 83449 // Let browser handle "target=_blank" etc. 83450 !isModifiedEvent(event) // Ignore clicks with modifier keys 83451; 83452} 83453/** 83454 * Creates a URLSearchParams object using the given initializer. 83455 * 83456 * This is identical to `new URLSearchParams(init)` except it also
83457 * supports arrays as values in the object form of the initializer 83458 * instead of just strings. This is convenient when you need multiple 83459 * values for a given key, but don't want to use an array initializer. 83460 * 83461 * For example, instead of: 83462 * 83463 * let searchParams = new URLSearchParams([ 83464 * ['sort', 'name'], 83465 * ['sort', 'price'] 83466 * ]); 83467 * 83468 * you can do: 83469 * 83470 * let searchParams = createSearchParams({ 83471 * sort: ['name', 'price'] 83472 * }); 83473 */ 83474function createSearchParams(init) { 83475 if (init === void 0) { 83476 init = ""; 83477 } 83478 return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => { 83479 let value = init[key]; 83480 return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]); 83481 }, [])); 83482} 83483function getSearchParamsForLocation(locationSearch, defaultSearchParams) { 83484 let searchParams = createSearchParams(locationSearch); 83485 if (defaultSearchParams) { 83486 // Use `defaultSearchParams.forEach(...)` here instead of iterating of 83487 // `defaultSearchParams.keys()` to work-around a bug in Firefox related to 83488 // web extensions. Relevant Bugzilla tickets: 83489 // https://bugzilla.mozilla.org/show_bug.cgi?id=1414602 83490 // https://bugzilla.mozilla.org/show_bug.cgi?id=1023984 83491 defaultSearchParams.forEach((_, key) => { 83492 if (!searchParams.has(key)) { 83493 defaultSearchParams.getAll(key).forEach(value => { 83494 searchParams.append(key, value); 83495 }); 83496 } 83497 }); 83498 } 83499 return searchParams; 83500} 83501// One-time check for submitter support 83502let _formDataSupportsSubmitter = null; 83503function isFormDataSubmitterSupported() { 83504 if (_formDataSupportsSubmitter === null) { 83505 try { 83506 new FormData(document.createElement("form"), 83507 // @ts-expect-error if FormData supports the submitter parameter, this will throw 83508 0); 83509 _formDataSupportsSubmitter = false; 83510 } catch (e) { 83511 _formDataSupportsSubmitter = true; 83512 } 83513 } 83514 return _formDataSupportsSubmitter; 83515} 83516const supportedFormEncTypes = new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]); 83517function getFormEncType(encType) { 83518 if (encType != null && !supportedFormEncTypes.has(encType)) { 83519 false ? 0 : void 0; 83520 return null; 83521 } 83522 return encType; 83523} 83524function getFormSubmissionInfo(target, basename) { 83525 let method; 83526 let action; 83527 let encType; 83528 let formData; 83529 let body; 83530 if (isFormElement(target)) { 83531 // When grabbing the action from the element, it will have had the basename 83532 // prefixed to ensure non-JS scenarios work, so strip it since we'll 83533 // re-prefix in the router 83534 let attr = target.getAttribute("action"); 83535 action = attr ? stripBasename(attr, basename) : null; 83536 method = target.getAttribute("method") || defaultMethod; 83537 encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType; 83538 formData = new FormData(target); 83539 } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) { 83540 let form = target.form; 83541 if (form == null) { 83542 throw new Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>"); 83543 } 83544 // <button>/<input type="submit"> may override attributes of <form> 83545 // When grabbing the action from the element, it will have had the basename 83546 // prefixed to ensure non-JS scenarios work, so strip it since we'll 83547 // re-prefix in the router 83548 let attr = target.getAttribute("formaction") || form.getAttribute("action"); 83549 action = attr ? stripBasename(attr, basename) : null; 83550 method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod; 83551 encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType; 83552 // Build a FormData object populated from a form and submitter 83553 formData = new FormData(form, target); 83554 // If this browser doesn't support the `FormData(el, submitter)` format, 83555 // then tack on the submitter value at the end. This is a lightweight 83556 // solution that is not 100% spec compliant. For complete support in older 83557 // browsers, consider using the `formdata-submitter-polyfill` package 83558 if (!isFormDataSubmitterSupported()) { 83559 let { 83560 name, 83561 type, 83562 value 83563 } = target; 83564 if (type === "image") {
83565 let prefix = name ? name + "." : ""; 83566 formData.append(prefix + "x", "0"); 83567 formData.append(prefix + "y", "0"); 83568 } else if (name) { 83569 formData.append(name, value); 83570 } 83571 } 83572 } else if (isHtmlElement(target)) { 83573 throw new Error("Cannot submit element that is not <form>, <button>, or " + "<input type=\"submit|image\">"); 83574 } else { 83575 method = defaultMethod; 83576 action = null; 83577 encType = defaultEncType; 83578 body = target; 83579 } 83580 // Send body for <Form encType="text/plain" so we encode it into text 83581 if (formData && encType === "text/plain") { 83582 body = formData; 83583 formData = undefined; 83584 } 83585 return { 83586 action, 83587 method: method.toLowerCase(), 83588 encType, 83589 formData, 83590 body 83591 }; 83592} 83593 83594const _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "viewTransition"], 83595 _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "viewTransition", "children"], 83596 _excluded3 = (/* unused pure expression or super */ null && (["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "viewTransition"])); 83597// HEY YOU! DON'T TOUCH THIS VARIABLE! 83598// 83599// It is replaced with the proper version at build time via a babel plugin in 83600// the rollup config. 83601// 83602// Export a global property onto the window for React Router detection by the 83603// Core Web Vitals Technology Report. This way they can configure the `wappalyzer` 83604// to detect and properly classify live websites as being built with React Router: 83605// https://github.com/HTTPArchive/wappalyzer/blob/main/src/technologies/r.json 83606const REACT_ROUTER_VERSION = "6"; 83607try { 83608 window.__reactRouterVersion = REACT_ROUTER_VERSION; 83609} catch (e) { 83610 // no-op 83611} 83612function createBrowserRouter(routes, opts) { 83613 return createRouter({ 83614 basename: opts == null ? void 0 : opts.basename, 83615 future: _extends({}, opts == null ? void 0 : opts.future, { 83616 v7_prependBasename: true 83617 }), 83618 history: createBrowserHistory({ 83619 window: opts == null ? void 0 : opts.window 83620 }), 83621 hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(), 83622 routes, 83623 mapRouteProperties: UNSAFE_mapRouteProperties, 83624 dataStrategy: opts == null ? void 0 : opts.dataStrategy, 83625 patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation, 83626 window: opts == null ? void 0 : opts.window 83627 }).initialize(); 83628} 83629function createHashRouter(routes, opts) { 83630 return createRouter({ 83631 basename: opts == null ? void 0 : opts.basename, 83632 future: _extends({}, opts == null ? void 0 : opts.future, { 83633 v7_prependBasename: true 83634 }), 83635 history: createHashHistory({ 83636 window: opts == null ? void 0 : opts.window 83637 }), 83638 hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(), 83639 routes, 83640 mapRouteProperties: UNSAFE_mapRouteProperties, 83641 dataStrategy: opts == null ? void 0 : opts.dataStrategy, 83642 patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation, 83643 window: opts == null ? void 0 : opts.window 83644 }).initialize(); 83645} 83646function parseHydrationData() { 83647 var _window; 83648 let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData; 83649 if (state && state.errors) { 83650 state = _extends({}, state, { 83651 errors: deserializeErrors(state.errors) 83652 }); 83653 } 83654 return state; 83655} 83656function deserializeErrors(errors) { 83657 if (!errors) return null; 83658 let entries = Object.entries(errors); 83659 let serialized = {}; 83660 for (let [key, val] of entries) { 83661 // Hey you! If you change this, please change the corresponding logic in 83662 // serializeErrors in react-router-dom/server.tsx :) 83663 if (val && val.__type === "RouteErrorResponse") { 83664 serialized[key] = new UNSAFE_ErrorResponseImpl(val.status, val.statusText, val.data, val.internal === true); 83665 } else if (val && val.__type === "Error") { 83666 // Attempt to reconstruct the right type of Error (i.e., ReferenceError) 83667 if (val.__subType) { 83668 let ErrorConstructor = window[val.__subType]; 83669 if (typeof ErrorConstructor === "function") { 83670 try { 83671 // @ts-expect-error 83672 let error = new ErrorConstructor(val.message);
83673 // Wipe away the client-side stack trace. Nothing to fill it in with 83674 // because we don't serialize SSR stack traces for security reasons 83675 error.stack = ""; 83676 serialized[key] = error; 83677 } catch (e) { 83678 // no-op - fall through and create a normal Error 83679 } 83680 } 83681 } 83682 if (serialized[key] == null) { 83683 let error = new Error(val.message); 83684 // Wipe away the client-side stack trace. Nothing to fill it in with 83685 // because we don't serialize SSR stack traces for security reasons 83686 error.stack = ""; 83687 serialized[key] = error; 83688 } 83689 } else { 83690 serialized[key] = val; 83691 } 83692 } 83693 return serialized; 83694} 83695const ViewTransitionContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext({ 83696 isTransitioning: false 83697}); 83698if (false) // removed by dead control flow 83699{} 83700const FetchersContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(new Map()); 83701if (false) // removed by dead control flow 83702{} 83703//#endregion 83704//////////////////////////////////////////////////////////////////////////////// 83705//#region Components 83706//////////////////////////////////////////////////////////////////////////////// 83707/** 83708 Webpack + React 17 fails to compile on any of the following because webpack 83709 complains that `startTransition` doesn't exist in `React`: 83710 * import { startTransition } from "react" 83711 * import * as React from from "react"; 83712 "startTransition" in React ? React.startTransition(() => setState()) : setState() 83713 * import * as React from from "react"; 83714 "startTransition" in React ? React["startTransition"](() => setState()) : setState() 83715 83716 Moving it to a constant such as the following solves the Webpack/React 17 issue: 83717 * import * as React from from "react"; 83718 const START_TRANSITION = "startTransition"; 83719 START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState() 83720 83721 However, that introduces webpack/terser minification issues in production builds 83722 in React 18 where minification/obfuscation ends up removing the call of 83723 React.startTransition entirely from the first half of the ternary. Grabbing 83724 this exported reference once up front resolves that issue. 83725 83726 See https://github.com/remix-run/react-router/issues/10579 83727*/ 83728const START_TRANSITION = "startTransition"; 83729const startTransitionImpl = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))[START_TRANSITION]; 83730const FLUSH_SYNC = "flushSync"; 83731const flushSyncImpl = /*#__PURE__*/ (react_dom__WEBPACK_IMPORTED_MODULE_1___namespace_cache || (react_dom__WEBPACK_IMPORTED_MODULE_1___namespace_cache = __webpack_require__.t(react_dom__WEBPACK_IMPORTED_MODULE_1__, 2)))[FLUSH_SYNC]; 83732const USE_ID = "useId"; 83733const useIdImpl = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))[USE_ID]; 83734function startTransitionSafe(cb) { 83735 if (startTransitionImpl) { 83736 startTransitionImpl(cb); 83737 } else { 83738 cb(); 83739 } 83740} 83741function flushSyncSafe(cb) { 83742 if (flushSyncImpl) { 83743 flushSyncImpl(cb); 83744 } else { 83745 cb(); 83746 } 83747} 83748class Deferred { 83749 constructor() { 83750 this.status = "pending"; 83751 this.promise = new Promise((resolve, reject) => { 83752 this.resolve = value => { 83753 if (this.status === "pending") { 83754 this.status = "resolved"; 83755 resolve(value); 83756 } 83757 }; 83758 this.reject = reason => { 83759 if (this.status === "pending") { 83760 this.status = "rejected"; 83761 reject(reason); 83762 } 83763 }; 83764 }); 83765 } 83766} 83767/** 83768 * Given a Remix Router instance, render the appropriate UI 83769 */ 83770function RouterProvider(_ref) { 83771 let { 83772 fallbackElement, 83773 router, 83774 future 83775 } = _ref; 83776 let [state, setStateImpl] = React.useState(router.state); 83777 let [pendingState, setPendingState] = React.useState(); 83778 let [vtContext, setVtContext] = React.useState({ 83779 isTransitioning: false 83780 }); 83781 let [renderDfd, setRenderDfd] = React.useState(); 83782 let [transition, setTransition] = React.useState(); 83783 let [interruption, setInterruption] = React.useState(); 83784 let fetcherData = React.useRef(new Map()); 83785 let { 83786 v7_startTransition 83787 } = future || {}; 83788 let optInStartTransition = React.useCallback(cb => { 83789 if (v7_startTransition) { 83790 startTransitionSafe(cb); 83791 } else { 83792 cb(); 83793 } 83794 }, [v7_startTransition]); 83795 let setState = React.useCallback((newState, _ref2) => { 83796 let { 83797 deletedFetchers, 83798 flushSync: flushSync, 83799 viewTransitionOpts: viewTransitionOpts 83800 } = _ref2;
83801 newState.fetchers.forEach((fetcher, key) => { 83802 if (fetcher.data !== undefined) { 83803 fetcherData.current.set(key, fetcher.data); 83804 } 83805 }); 83806 deletedFetchers.forEach(key => fetcherData.current.delete(key)); 83807 let isViewTransitionUnavailable = router.window == null || router.window.document == null || typeof router.window.document.startViewTransition !== "function"; 83808 // If this isn't a view transition or it's not available in this browser, 83809 // just update and be done with it 83810 if (!viewTransitionOpts || isViewTransitionUnavailable) { 83811 if (flushSync) { 83812 flushSyncSafe(() => setStateImpl(newState)); 83813 } else { 83814 optInStartTransition(() => setStateImpl(newState)); 83815 } 83816 return; 83817 } 83818 // flushSync + startViewTransition 83819 if (flushSync) { 83820 // Flush through the context to mark DOM elements as transition=ing 83821 flushSyncSafe(() => { 83822 // Cancel any pending transitions 83823 if (transition) { 83824 renderDfd && renderDfd.resolve(); 83825 transition.skipTransition(); 83826 } 83827 setVtContext({ 83828 isTransitioning: true, 83829 flushSync: true, 83830 currentLocation: viewTransitionOpts.currentLocation, 83831 nextLocation: viewTransitionOpts.nextLocation 83832 }); 83833 }); 83834 // Update the DOM 83835 let t = router.window.document.startViewTransition(() => { 83836 flushSyncSafe(() => setStateImpl(newState)); 83837 }); 83838 // Clean up after the animation completes 83839 t.finished.finally(() => { 83840 flushSyncSafe(() => { 83841 setRenderDfd(undefined); 83842 setTransition(undefined); 83843 setPendingState(undefined); 83844 setVtContext({ 83845 isTransitioning: false 83846 }); 83847 }); 83848 }); 83849 flushSyncSafe(() => setTransition(t)); 83850 return; 83851 } 83852 // startTransition + startViewTransition 83853 if (transition) { 83854 // Interrupting an in-progress transition, cancel and let everything flush 83855 // out, and then kick off a new transition from the interruption state 83856 renderDfd && renderDfd.resolve(); 83857 transition.skipTransition(); 83858 setInterruption({ 83859 state: newState, 83860 currentLocation: viewTransitionOpts.currentLocation, 83861 nextLocation: viewTransitionOpts.nextLocation 83862 }); 83863 } else { 83864 // Completed navigation update with opted-in view transitions, let 'er rip 83865 setPendingState(newState); 83866 setVtContext({ 83867 isTransitioning: true, 83868 flushSync: false, 83869 currentLocation: viewTransitionOpts.currentLocation, 83870 nextLocation: viewTransitionOpts.nextLocation 83871 }); 83872 } 83873 }, [router.window, transition, renderDfd, fetcherData, optInStartTransition]); 83874 // Need to use a layout effect here so we are subscribed early enough to 83875 // pick up on any render-driven redirects/navigations (useEffect/<Navigate>) 83876 React.useLayoutEffect(() => router.subscribe(setState), [router, setState]); 83877 // When we start a view transition, create a Deferred we can use for the 83878 // eventual "completed" render 83879 React.useEffect(() => { 83880 if (vtContext.isTransitioning && !vtContext.flushSync) { 83881 setRenderDfd(new Deferred()); 83882 } 83883 }, [vtContext]); 83884 // Once the deferred is created, kick off startViewTransition() to update the 83885 // DOM and then wait on the Deferred to resolve (indicating the DOM update has 83886 // happened) 83887 React.useEffect(() => { 83888 if (renderDfd && pendingState && router.window) { 83889 let newState = pendingState; 83890 let renderPromise = renderDfd.promise; 83891 let transition = router.window.document.startViewTransition(async () => { 83892 optInStartTransition(() => setStateImpl(newState)); 83893 await renderPromise; 83894 }); 83895 transition.finished.finally(() => { 83896 setRenderDfd(undefined); 83897 setTransition(undefined); 83898 setPendingState(undefined); 83899 setVtContext({ 83900 isTransitioning: false 83901 }); 83902 }); 83903 setTransition(transition); 83904 } 83905 }, [optInStartTransition, pendingState, renderDfd, router.window]); 83906 // When the new location finally renders and is committed to the DOM, this 83907 // effect will run to resolve the transition 83908 React.useEffect(() => { 83909 if (renderDfd && pendingState && state.location.key === pendingState.location.key) { 83910 renderDfd.resolve(); 83911 } 83912 }, [renderDfd, transition, state.location, pendingState]);
83913 // If we get interrupted with a new navigation during a transition, we skip 83914 // the active transition, let it cleanup, then kick it off again here 83915 React.useEffect(() => { 83916 if (!vtContext.isTransitioning && interruption) { 83917 setPendingState(interruption.state); 83918 setVtContext({ 83919 isTransitioning: true, 83920 flushSync: false, 83921 currentLocation: interruption.currentLocation, 83922 nextLocation: interruption.nextLocation 83923 }); 83924 setInterruption(undefined); 83925 } 83926 }, [vtContext.isTransitioning, interruption]); 83927 React.useEffect(() => { 83928 false ? 0 : void 0; 83929 // Only log this once on initial mount 83930 // eslint-disable-next-line react-hooks/exhaustive-deps 83931 }, []); 83932 let navigator = React.useMemo(() => { 83933 return { 83934 createHref: router.createHref, 83935 encodeLocation: router.encodeLocation, 83936 go: n => router.navigate(n), 83937 push: (to, state, opts) => router.navigate(to, { 83938 state, 83939 preventScrollReset: opts == null ? void 0 : opts.preventScrollReset 83940 }), 83941 replace: (to, state, opts) => router.navigate(to, { 83942 replace: true, 83943 state, 83944 preventScrollReset: opts == null ? void 0 : opts.preventScrollReset 83945 }) 83946 }; 83947 }, [router]); 83948 let basename = router.basename || "/"; 83949 let dataRouterContext = React.useMemo(() => ({ 83950 router, 83951 navigator, 83952 static: false, 83953 basename 83954 }), [router, navigator, basename]); 83955 let routerFuture = React.useMemo(() => ({ 83956 v7_relativeSplatPath: router.future.v7_relativeSplatPath 83957 }), [router.future.v7_relativeSplatPath]); 83958 React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future, router.future), [future, router.future]); 83959 // The fragment and {null} here are important! We need them to keep React 18's 83960 // useId happy when we are server-rendering since we may have a <script> here 83961 // containing the hydrated server-side staticContext (from StaticRouterProvider). 83962 // useId relies on the component tree structure to generate deterministic id's 83963 // so we need to ensure it remains the same on the client even though 83964 // we don't need the <script> tag 83965 return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(UNSAFE_DataRouterContext.Provider, { 83966 value: dataRouterContext 83967 }, /*#__PURE__*/React.createElement(UNSAFE_DataRouterStateContext.Provider, { 83968 value: state 83969 }, /*#__PURE__*/React.createElement(FetchersContext.Provider, { 83970 value: fetcherData.current 83971 }, /*#__PURE__*/React.createElement(ViewTransitionContext.Provider, { 83972 value: vtContext 83973 }, /*#__PURE__*/React.createElement(Router, { 83974 basename: basename, 83975 location: state.location, 83976 navigationType: state.historyAction, 83977 navigator: navigator, 83978 future: routerFuture 83979 }, state.initialized || router.future.v7_partialHydration ? (/*#__PURE__*/React.createElement(MemoizedDataRoutes, { 83980 routes: router.routes, 83981 future: router.future, 83982 state: state 83983 })) : fallbackElement))))), null); 83984} 83985// Memoize to avoid re-renders when updating `ViewTransitionContext` 83986const MemoizedDataRoutes = /*#__PURE__*/(/* unused pure expression or super */ null && (React.memo(DataRoutes))); 83987function DataRoutes(_ref3) { 83988 let { 83989 routes, 83990 future, 83991 state 83992 } = _ref3; 83993 return UNSAFE_useRoutesImpl(routes, undefined, state, future); 83994} 83995/** 83996 * A `<Router>` for use in web browsers. Provides the cleanest URLs. 83997 */ 83998function BrowserRouter(_ref4) { 83999 let { 84000 basename, 84001 children, 84002 future, 84003 window 84004 } = _ref4; 84005 let historyRef = React.useRef(); 84006 if (historyRef.current == null) { 84007 historyRef.current = createBrowserHistory({ 84008 window, 84009 v5Compat: true 84010 }); 84011 } 84012 let history = historyRef.current; 84013 let [state, setStateImpl] = React.useState({ 84014 action: history.action, 84015 location: history.location 84016 }); 84017 let { 84018 v7_startTransition 84019 } = future || {}; 84020 let setState = React.useCallback(newState => { 84021 v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); 84022 }, [setStateImpl, v7_startTransition]); 84023 React.useLayoutEffect(() => history.listen(setState), [history, setState]); 84024 React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]); 84025 return /*#__PURE__*/React.createElement(Router, { 84026 basename: basename, 84027 children: children, 84028 location: state.location, 84029 navigationType: state.action, 84030 navigator: history, 84031 future: future 84032 }); 84033} 84034/** 84035 * A `<Router>` for use in web browsers. Stores the location in the hash 84036 * portion of the URL so it is not sent to the server. 84037 */ 84038function HashRouter(_ref5) { 84039 let { 84040 basename, 84041 children, 84042 future, 84043 window 84044 } = _ref5; 84045 let historyRef = React.useRef(); 84046 if (historyRef.current == null) { 84047 historyRef.current = createHashHistory({ 84048 window, 84049 v5Compat: true 84050 }); 84051 } 84052 let history = historyRef.current; 84053 let [state, setStateImpl] = React.useState({ 84054 action: history.action, 84055 location: history.location 84056 }); 84057 let { 84058 v7_startTransition 84059 } = future || {}; 84060 let setState = React.useCallback(newState => { 84061 v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); 84062 }, [setStateImpl, v7_startTransition]); 84063 React.useLayoutEffect(() => history.listen(setState), [history, setState]); 84064 React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]); 84065 return /*#__PURE__*/React.createElement(Router, { 84066 basename: basename, 84067 children: children, 84068 location: state.location, 84069 navigationType: state.action, 84070 navigator: history, 84071 future: future 84072 }); 84073} 84074/** 84075 * A `<Router>` that accepts a pre-instantiated history object. It's important
84076 * to note that using your own history object is highly discouraged and may add 84077 * two versions of the history library to your bundles unless you use the same 84078 * version of the history library that React Router uses internally. 84079 */ 84080function HistoryRouter(_ref6) { 84081 let { 84082 basename, 84083 children, 84084 future, 84085 history 84086 } = _ref6; 84087 let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState({ 84088 action: history.action, 84089 location: history.location 84090 }); 84091 let { 84092 v7_startTransition 84093 } = future || {}; 84094 let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(newState => { 84095 v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); 84096 }, [setStateImpl, v7_startTransition]); 84097 react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => history.listen(setState), [history, setState]); 84098 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .UNSAFE_logV6DeprecationWarnings */ .V8)(future), [future]); 84099 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router__WEBPACK_IMPORTED_MODULE_2__/* .Router */ .Ix, { 84100 basename: basename, 84101 children: children, 84102 location: state.location, 84103 navigationType: state.action, 84104 navigator: history, 84105 future: future 84106 }); 84107} 84108if (false) // removed by dead control flow 84109{} 84110const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"; 84111const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i; 84112/** 84113 * The public API for rendering a history-aware `<a>`. 84114 */ 84115const Link = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function LinkWithRef(_ref7, ref) { 84116 let { 84117 onClick, 84118 relative, 84119 reloadDocument, 84120 replace, 84121 state, 84122 target, 84123 to, 84124 preventScrollReset, 84125 viewTransition 84126 } = _ref7, 84127 rest = _objectWithoutPropertiesLoose(_ref7, _excluded); 84128 let { 84129 basename 84130 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_2__/* .UNSAFE_NavigationContext */ .jb); 84131 // Rendered into <a href> for absolute URLs 84132 let absoluteHref; 84133 let isExternal = false; 84134 if (typeof to === "string" && ABSOLUTE_URL_REGEX.test(to)) { 84135 // Render the absolute href server- and client-side 84136 absoluteHref = to; 84137 // Only check for external origins client-side 84138 if (isBrowser) { 84139 try { 84140 let currentUrl = new URL(window.location.href); 84141 let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to); 84142 let path = (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .stripBasename */ .pb)(targetUrl.pathname, basename); 84143 if (targetUrl.origin === currentUrl.origin && path != null) { 84144 // Strip the protocol/origin/basename for same-origin absolute URLs 84145 to = path + targetUrl.search + targetUrl.hash; 84146 } else { 84147 isExternal = true; 84148 } 84149 } catch (e) { 84150 // We can't do external URL detection without a valid URL 84151 false ? 0 : void 0; 84152 } 84153 } 84154 } 84155 // Rendered into <a href> for relative URLs 84156 let href = (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .useHref */ .$P)(to, { 84157 relative 84158 }); 84159 let internalOnClick = useLinkClickHandler(to, { 84160 replace, 84161 state, 84162 target, 84163 preventScrollReset, 84164 relative, 84165 viewTransition 84166 }); 84167 function handleClick(event) { 84168 if (onClick) onClick(event); 84169 if (!event.defaultPrevented) { 84170 internalOnClick(event); 84171 } 84172 } 84173 return ( 84174 /*#__PURE__*/ 84175 // eslint-disable-next-line jsx-a11y/anchor-has-content 84176 react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", _extends({}, rest, { 84177 href: absoluteHref || href, 84178 onClick: isExternal || reloadDocument ? onClick : handleClick, 84179 ref: ref, 84180 target: target 84181 })) 84182 ); 84183}); 84184if (false) // removed by dead control flow 84185{} 84186/** 84187 * A `<Link>` wrapper that knows if it's "active" or not. 84188 */ 84189const NavLink = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function NavLinkWithRef(_ref8, ref) { 84190 let { 84191 "aria-current": ariaCurrentProp = "page", 84192 caseSensitive = false, 84193 className: classNameProp = "", 84194 end = false, 84195 style: styleProp, 84196 to, 84197 viewTransition, 84198 children 84199 } = _ref8, 84200 rest = _objectWithoutPropertiesLoose(_ref8, _excluded2); 84201 let path = (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .useResolvedPath */ .x$)(to, { 84202 relative: rest.relative 84203 }); 84204 let location = (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .zy)(); 84205 let routerState = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_2__/* .UNSAFE_DataRouterStateContext */ .Rq); 84206 let { 84207 navigator, 84208 basename 84209 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_2__/* .UNSAFE_NavigationContext */ .jb); 84210 let isTransitioning = routerState != null && 84211 // Conditional usage is OK here because the usage of a data router is static 84212 // eslint-disable-next-line react-hooks/rules-of-hooks 84213 useViewTransitionState(path) && viewTransition === true; 84214 let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname; 84215 let locationPathname = location.pathname; 84216 let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null; 84217 if (!caseSensitive) { 84218 locationPathname = locationPathname.toLowerCase(); 84219 nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null; 84220 toPathname = toPathname.toLowerCase(); 84221 } 84222 if (nextLocationPathname && basename) { 84223 nextLocationPathname = (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .stripBasename */ .pb)(nextLocationPathname, base
84223name) || nextLocationPathname; 84224 } 84225 // If the `to` has a trailing slash, look at that exact spot. Otherwise, 84226 // we're looking for a slash _after_ what's in `to`. For example: 84227 // 84228 // <NavLink to="/users"> and <NavLink to="/users/"> 84229 // both want to look for a / at index 6 to match URL `/users/matt` 84230 const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length; 84231 let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/"; 84232 let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/"); 84233 let renderProps = { 84234 isActive, 84235 isPending, 84236 isTransitioning 84237 }; 84238 let ariaCurrent = isActive ? ariaCurrentProp : undefined; 84239 let className; 84240 if (typeof classNameProp === "function") { 84241 className = classNameProp(renderProps); 84242 } else { 84243 // If the className prop is not a function, we use a default `active` 84244 // class for <NavLink />s that are active. In v5 `active` was the default 84245 // value for `activeClassName`, but we are removing that API and can still 84246 // use the old default behavior for a cleaner upgrade path and keep the 84247 // simple styling rules working as they currently do. 84248 className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null, isTransitioning ? "transitioning" : null].filter(Boolean).join(" "); 84249 } 84250 let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp; 84251 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Link, _extends({}, rest, { 84252 "aria-current": ariaCurrent, 84253 className: className, 84254 ref: ref, 84255 style: style, 84256 to: to, 84257 viewTransition: viewTransition 84258 }), typeof children === "function" ? children(renderProps) : children); 84259}); 84260if (false) // removed by dead control flow 84261{} 84262/** 84263 * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except 84264 * that the interaction with the server is with `fetch` instead of new document 84265 * requests, allowing components to add nicer UX to the page as the form is 84266 * submitted and returns with data. 84267 */ 84268const Form = /*#__PURE__*/(/* unused pure expression or super */ null && (React.forwardRef((_ref9, forwardedRef) => { 84269 let { 84270 fetcherKey, 84271 navigate, 84272 reloadDocument, 84273 replace, 84274 state, 84275 method = defaultMethod, 84276 action, 84277 onSubmit, 84278 relative, 84279 preventScrollReset, 84280 viewTransition 84281 } = _ref9, 84282 props = _objectWithoutPropertiesLoose(_ref9, _excluded3); 84283 let submit = useSubmit(); 84284 let formAction = useFormAction(action, { 84285 relative 84286 }); 84287 let formMethod = method.toLowerCase() === "get" ? "get" : "post"; 84288 let submitHandler = event => { 84289 onSubmit && onSubmit(event); 84290 if (event.defaultPrevented) return; 84291 event.preventDefault(); 84292 let submitter = event.nativeEvent.submitter; 84293 let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method; 84294 submit(submitter || event.currentTarget, { 84295 fetcherKey, 84296 method: submitMethod, 84297 navigate, 84298 replace, 84299 state, 84300 relative, 84301 preventScrollReset, 84302 viewTransition 84303 }); 84304 }; 84305 return /*#__PURE__*/React.createElement("form", _extends({ 84306 ref: forwardedRef, 84307 method: formMethod, 84308 action: formAction, 84309 onSubmit: reloadDocument ? onSubmit : submitHandler 84310 }, props)); 84311}))); 84312if (false) // removed by dead control flow 84313{} 84314/** 84315 * This component will emulate the browser's scroll restoration on location 84316 * changes. 84317 */ 84318function ScrollRestoration(_ref0) { 84319 let { 84320 getKey, 84321 storageKey 84322 } = _ref0; 84323 useScrollRestoration({ 84324 getKey, 84325 storageKey 84326 }); 84327 return null; 84328} 84329if (false) // removed by dead control flow 84330{} 84331//#endregion 84332//////////////////////////////////////////////////////////////////////////////// 84333//#region Hooks 84334//////////////////////////////////////////////////////////////////////////////// 84335var DataRouterHook; 84336(function (DataRouterHook) { 84337 DataRouterHook["UseScrollRestoration"] = "useScrollRestoration"; 84338 DataRouterHook["UseSubmit"] = "useSubmit"; 84339 DataRouterHook["UseSubmitFetcher"] = "useSubmitFetcher"; 84340 DataRouterHook["UseFetcher"] = "useFetcher"; 84341 DataRouterHook["useViewTransitionState"] = "useViewTransitionState"; 84342})(DataRouterHook || (DataRouterHook = {})); 84343var DataRouterStateHook; 84344(function (DataRouterStateHook) { 84345 DataRouterStateHook["UseFetcher"] = "useFetcher"; 84346 DataRouterStateHook["UseFetchers"] = "useFetchers"; 84347 DataRouterStateHook["UseScrollRestoration"] = "useScrollRestoration"; 84348})(DataRouterStateHook || (DataRouterStateHook = {})); 84349// Internal hooks 84350function getDataRouterConsoleError(hookName) { 84351 return hookName + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."; 84352} 84353function useDataRouterContext(hookName) { 84354 let ctx = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_2__/* .UNSAFE_DataRouterContext */ .sp); 84355 !ctx ? false ? 0 : (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .UNSAFE_invariant */ .Oi
84355)(false) : void 0; 84356 return ctx; 84357} 84358function useDataRouterState(hookName) { 84359 let state = React.useContext(UNSAFE_DataRouterStateContext); 84360 !state ? false ? 0 : UNSAFE_invariant(false) : void 0; 84361 return state; 84362} 84363// External hooks 84364/** 84365 * Handles the click behavior for router `<Link>` components. This is useful if 84366 * you need to create custom `<Link>` components with the same click behavior we 84367 * use in our exported `<Link>`. 84368 */ 84369function useLinkClickHandler(to, _temp) { 84370 let { 84371 target, 84372 replace: replaceProp, 84373 state, 84374 preventScrollReset, 84375 relative, 84376 viewTransition 84377 } = _temp === void 0 ? {} : _temp; 84378 let navigate = (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .useNavigate */ .Zp)(); 84379 let location = (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .zy)(); 84380 let path = (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .useResolvedPath */ .x$)(to, { 84381 relative 84382 }); 84383 return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(event => { 84384 if (shouldProcessLinkClick(event, target)) { 84385 event.preventDefault(); 84386 // If the URL hasn't changed, a regular <a> will do a replace instead of 84387 // a push, so do the same here unless the replace prop is explicitly set 84388 let replace = replaceProp !== undefined ? replaceProp : (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .createPath */ .AO)(location) === (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .createPath */ .AO)(path); 84389 navigate(to, { 84390 replace, 84391 state, 84392 preventScrollReset, 84393 relative, 84394 viewTransition 84395 }); 84396 } 84397 }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, viewTransition]); 84398} 84399/** 84400 * A convenient wrapper for reading and writing search parameters via the 84401 * URLSearchParams interface. 84402 */ 84403function useSearchParams(defaultInit) { 84404 false ? 0 : void 0; 84405 let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit)); 84406 let hasSetSearchParamsRef = React.useRef(false); 84407 let location = useLocation(); 84408 let searchParams = React.useMemo(() => 84409 // Only merge in the defaults if we haven't yet called setSearchParams. 84410 // Once we call that we want those to take precedence, otherwise you can't 84411 // remove a param with setSearchParams({}) if it has an initial value 84412 getSearchParamsForLocation(location.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current), [location.search]); 84413 let navigate = useNavigate(); 84414 let setSearchParams = React.useCallback((nextInit, navigateOptions) => { 84415 const newSearchParams = createSearchParams(typeof nextInit === "function" ? nextInit(searchParams) : nextInit); 84416 hasSetSearchParamsRef.current = true; 84417 navigate("?" + newSearchParams, navigateOptions); 84418 }, [navigate, searchParams]); 84419 return [searchParams, setSearchParams]; 84420} 84421function validateClientSideSubmission() { 84422 if (typeof document === "undefined") { 84423 throw new Error("You are calling submit during the server render. " + "Try calling submit within a `useEffect` or callback instead."); 84424 } 84425} 84426let fetcherId = 0; 84427let getUniqueFetcherId = () => "__" + String(++fetcherId) + "__"; 84428/** 84429 * Returns a function that may be used to programmatically submit a form (or 84430 * some arbitrary data) to the server. 84431 */ 84432function useSubmit() { 84433 let { 84434 router 84435 } = useDataRouterContext(DataRouterHook.UseSubmit); 84436 let { 84437 basename 84438 } = React.useContext(UNSAFE_NavigationContext); 84439 let currentRouteId = UNSAFE_useRouteId(); 84440 return React.useCallback(function (target, options) { 84441 if (options === void 0) { 84442 options = {}; 84443 } 84444 validateClientSideSubmission(); 84445 let { 84446 action, 84447 method, 84448 encType, 84449 formData, 84450 body 84451 } = getFormSubmissionInfo(target, basename); 84452 if (options.navigate === false) { 84453 let key = options.fetcherKey || getUniqueFetcherId(); 84454 router.fetch(key, currentRouteId, options.action || action, { 84455 preventScrollReset: options.preventScrollReset, 84456 formData, 84457 body, 84458 formMethod: options.method || method, 84459 formEncType: options.encType || encType, 84460 flushSync: options.flushSync 84461 }); 84462 } else { 84463 router.navigate(options.action || action, { 84464 preventScrollReset: options.preventScrollReset, 84465 formData, 84466 body, 84467 formMethod: options.method || method, 84468 formEncType: options.encType || encType, 84469 replace: options.replace, 84470 state: options.state, 84471 fromRouteId: currentRouteId, 84472 flushSync: options.flushSync, 84473 viewTransition: options.viewTransition 84474 }); 84475 } 84476 }, [router, basename, currentRouteId]); 84477} 84478// v7: Eventually we should deprecate this entirely in favor of using the 84479// router method directly? 84480function useFormAction(action, _temp2) { 84481 let { 84482 relative 84483 } = _temp2 === void 0 ? {}
84483 : _temp2; 84484 let { 84485 basename 84486 } = React.useContext(UNSAFE_NavigationContext); 84487 let routeContext = React.useContext(UNSAFE_RouteContext); 84488 !routeContext ? false ? 0 : UNSAFE_invariant(false) : void 0; 84489 let [match] = routeContext.matches.slice(-1); 84490 // Shallow clone path so we can modify it below, otherwise we modify the 84491 // object referenced by useMemo inside useResolvedPath 84492 let path = _extends({}, useResolvedPath(action ? action : ".", { 84493 relative 84494 })); 84495 // If no action was specified, browsers will persist current search params 84496 // when determining the path, so match that behavior 84497 // https://github.com/remix-run/remix/issues/927 84498 let location = useLocation(); 84499 if (action == null) { 84500 // Safe to write to this directly here since if action was undefined, we 84501 // would have called useResolvedPath(".") which will never include a search 84502 path.search = location.search; 84503 // When grabbing search params from the URL, remove any included ?index param 84504 // since it might not apply to our contextual route. We add it back based 84505 // on match.route.index below 84506 let params = new URLSearchParams(path.search); 84507 let indexValues = params.getAll("index"); 84508 let hasNakedIndexParam = indexValues.some(v => v === ""); 84509 if (hasNakedIndexParam) { 84510 params.delete("index"); 84511 indexValues.filter(v => v).forEach(v => params.append("index", v)); 84512 let qs = params.toString(); 84513 path.search = qs ? "?" + qs : ""; 84514 } 84515 } 84516 if ((!action || action === ".") && match.route.index) { 84517 path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index"; 84518 } 84519 // If we're operating within a basename, prepend it to the pathname prior 84520 // to creating the form action. If this is a root navigation, then just use 84521 // the raw basename which allows the basename to have full control over the 84522 // presence of a trailing slash on root actions 84523 if (basename !== "/") { 84524 path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]); 84525 } 84526 return createPath(path); 84527} 84528// TODO: (v7) Change the useFetcher generic default from `any` to `unknown` 84529/** 84530 * Interacts with route loaders and actions without causing a navigation. Great 84531 * for any interaction that stays on the same page. 84532 */ 84533function useFetcher(_temp3) { 84534 var _route$matches; 84535 let { 84536 key 84537 } = _temp3 === void 0 ? {} : _temp3; 84538 let { 84539 router 84540 } = useDataRouterContext(DataRouterHook.UseFetcher); 84541 let state = useDataRouterState(DataRouterStateHook.UseFetcher); 84542 let fetcherData = React.useContext(FetchersContext); 84543 let route = React.useContext(UNSAFE_RouteContext); 84544 let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id; 84545 !fetcherData ? false ? 0 : UNSAFE_invariant(false) : void 0; 84546 !route ? false ? 0 : UNSAFE_invariant(false) : void 0; 84547 !(routeId != null) ? false ? 0 : UNSAFE_invariant(false) : void 0; 84548 // Fetcher key handling 84549 // OK to call conditionally to feature detect `useId` 84550 // eslint-disable-next-line react-hooks/rules-of-hooks 84551 let defaultKey = useIdImpl ? useIdImpl() : ""; 84552 let [fetcherKey, setFetcherKey] = React.useState(key || defaultKey); 84553 if (key && key !== fetcherKey) { 84554 setFetcherKey(key); 84555 } else if (!fetcherKey) { 84556 // We will only fall through here when `useId` is not available 84557 setFetcherKey(getUniqueFetcherId()); 84558 } 84559 // Registration/cleanup 84560 React.useEffect(() => { 84561 router.getFetcher(fetcherKey); 84562 return () => { 84563 // Tell the router we've unmounted - if v7_fetcherPersist is enabled this 84564 // will not delete immediately but instead queue up a delete after the 84565 // fetcher returns to an `idle` state 84566 router.deleteFetcher(fetcherKey); 84567 }; 84568 }, [router, fetcherKey]); 84569 // Fetcher additions 84570 let load = React.useCallback((href, opts) => { 84571 !routeId ? false ? 0 : UNSAFE_invariant(false) : void 0; 84572 router.fetch(fetcherKey, routeId, href, opts); 84573 }, [fetcherKey, routeId, router]); 84574 let submitImpl = useSubmit(); 84575 let submit = React.useCallback((target, opts) => { 84576 submitImpl(target, _extends({}, opts, { 84577 navigate: false, 84578 fetcherKey 84579 })); 84580 }, [fetcherKey, submitImpl]); 84581 let FetcherForm = React.useMemo(() => { 84582 let FetcherForm = /*#__PURE__*/React.forwardRef((props, ref) => { 84583 return /*#__PURE__*/React.createElement(Form, _extends({}, props, { 84584 navigate: false, 84585 fetcherKey: fetcherKey, 84586 ref: ref 84587 })); 84588 }); 84589 if (false) // removed by dead control flow 84590{} 84591 return FetcherForm; 84592 }, [fetcherKey]); 84593 // Exposed FetcherWithComponents 84594 let fetcher = state.fetchers.get(fetcherKey) || IDLE_FETCHER; 84595 let data = fetcherData.get(fetcherKey); 84596 let fetcherWithComponents = React.useMemo(() => _extends({ 84597 Form: FetcherForm, 84598 submit, 84599 load 84600 }, fetcher, { 84601 data 84602 }), [FetcherForm, submit, load, fetcher, data]); 84603 return fetcherWithComponents; 84604} 84605/** 84606 * Provides all fetchers currently on the page. Useful for layouts and parent 84607 * routes that need to provide pending/optimistic UI regarding the fetch. 84608 */ 84609function useFetchers() { 84610 let state = useDataRouterState(DataRouterStateHook.UseFetchers); 84611 return Array.from(state.fetchers.entries()).map(_ref1 => { 84612 let [key, fetcher] = _ref1; 84613 return _extends({}, fetcher, { 84614 key 84615 }); 84616 }); 84617} 84618const SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions"; 84619let savedScrollPositions = {}; 84620/** 84621 * When rendered inside a RouterProvider, will restore scroll positions on
84621navigations 84622 */ 84623function useScrollRestoration(_temp4) { 84624 let { 84625 getKey, 84626 storageKey 84627 } = _temp4 === void 0 ? {} : _temp4; 84628 let { 84629 router 84630 } = useDataRouterContext(DataRouterHook.UseScrollRestoration); 84631 let { 84632 restoreScrollPosition, 84633 preventScrollReset 84634 } = useDataRouterState(DataRouterStateHook.UseScrollRestoration); 84635 let { 84636 basename 84637 } = React.useContext(UNSAFE_NavigationContext); 84638 let location = useLocation(); 84639 let matches = useMatches(); 84640 let navigation = useNavigation(); 84641 // Trigger manual scroll restoration while we're active 84642 React.useEffect(() => { 84643 window.history.scrollRestoration = "manual"; 84644 return () => { 84645 window.history.scrollRestoration = "auto"; 84646 }; 84647 }, []); 84648 // Save positions on pagehide 84649 usePageHide(React.useCallback(() => { 84650 if (navigation.state === "idle") { 84651 let key = (getKey ? getKey(location, matches) : null) || location.key; 84652 savedScrollPositions[key] = window.scrollY; 84653 } 84654 try { 84655 sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions)); 84656 } catch (error) { 84657 false ? 0 : void 0; 84658 } 84659 window.history.scrollRestoration = "auto"; 84660 }, [storageKey, getKey, navigation.state, location, matches])); 84661 // Read in any saved scroll locations 84662 if (typeof document !== "undefined") { 84663 // eslint-disable-next-line react-hooks/rules-of-hooks 84664 React.useLayoutEffect(() => { 84665 try { 84666 let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY); 84667 if (sessionPositions) { 84668 savedScrollPositions = JSON.parse(sessionPositions); 84669 } 84670 } catch (e) { 84671 // no-op, use default empty object 84672 } 84673 }, [storageKey]); 84674 // Enable scroll restoration in the router 84675 // eslint-disable-next-line react-hooks/rules-of-hooks 84676 React.useLayoutEffect(() => { 84677 let getKeyWithoutBasename = getKey && basename !== "/" ? (location, matches) => getKey(// Strip the basename to match useLocation() 84678 _extends({}, location, { 84679 pathname: stripBasename(location.pathname, basename) || location.pathname 84680 }), matches) : getKey; 84681 let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename); 84682 return () => disableScrollRestoration && disableScrollRestoration(); 84683 }, [router, basename, getKey]); 84684 // Restore scrolling when state.restoreScrollPosition changes 84685 // eslint-disable-next-line react-hooks/rules-of-hooks 84686 React.useLayoutEffect(() => { 84687 // Explicit false means don't do anything (used for submissions) 84688 if (restoreScrollPosition === false) { 84689 return; 84690 } 84691 // been here before, scroll to it 84692 if (typeof restoreScrollPosition === "number") { 84693 window.scrollTo(0, restoreScrollPosition); 84694 return; 84695 } 84696 // try to scroll to the hash 84697 if (location.hash) { 84698 let el = document.getElementById(decodeURIComponent(location.hash.slice(1))); 84699 if (el) { 84700 el.scrollIntoView(); 84701 return; 84702 } 84703 } 84704 // Don't reset if this navigation opted out 84705 if (preventScrollReset === true) { 84706 return; 84707 } 84708 // otherwise go to the top on new locations 84709 window.scrollTo(0, 0); 84710 }, [location, restoreScrollPosition, preventScrollReset]); 84711 } 84712} 84713/** 84714 * Setup a callback to be fired on the window's `beforeunload` event. This is 84715 * useful for saving some data to `window.localStorage` just before the page 84716 * refreshes. 84717 * 84718 * Note: The `callback` argument should be a function created with 84719 * `React.useCallback()`. 84720 */ 84721function useBeforeUnload(callback, options) { 84722 let { 84723 capture 84724 } = options || {}; 84725 React.useEffect(() => { 84726 let opts = capture != null ? { 84727 capture 84728 } : undefined; 84729 window.addEventListener("beforeunload", callback, opts); 84730 return () => { 84731 window.removeEventListener("beforeunload", callback, opts); 84732 }; 84733 }, [callback, capture]); 84734} 84735/** 84736 * Setup a callback to be fired on the window's `pagehide` event. This is 84737 * useful for saving some data to `window.localStorage` just before the page 84738 * refreshes. This event is better supported than beforeunload across browsers. 84739 *
84740 * Note: The `callback` argument should be a function created with 84741 * `React.useCallback()`. 84742 */ 84743function usePageHide(callback, options) { 84744 let { 84745 capture 84746 } = options || {}; 84747 React.useEffect(() => { 84748 let opts = capture != null ? { 84749 capture 84750 } : undefined; 84751 window.addEventListener("pagehide", callback, opts); 84752 return () => { 84753 window.removeEventListener("pagehide", callback, opts); 84754 }; 84755 }, [callback, capture]); 84756} 84757/** 84758 * Wrapper around useBlocker to show a window.confirm prompt to users instead 84759 * of building a custom UI with useBlocker. 84760 * 84761 * Warning: This has *a lot of rough edges* and behaves very differently (and 84762 * very incorrectly in some cases) across browsers if user click addition 84763 * back/forward navigations while the confirm is open. Use at your own risk. 84764 */ 84765function usePrompt(_ref10) { 84766 let { 84767 when, 84768 message 84769 } = _ref10; 84770 let blocker = useBlocker(when); 84771 React.useEffect(() => { 84772 if (blocker.state === "blocked") { 84773 let proceed = window.confirm(message); 84774 if (proceed) { 84775 // This timeout is needed to avoid a weird "race" on POP navigations 84776 // between the `window.history` revert navigation and the result of 84777 // `window.confirm` 84778 setTimeout(blocker.proceed, 0); 84779 } else { 84780 blocker.reset(); 84781 } 84782 } 84783 }, [blocker, message]); 84784 React.useEffect(() => { 84785 if (blocker.state === "blocked" && !when) { 84786 blocker.reset(); 84787 } 84788 }, [blocker, when]); 84789} 84790/** 84791 * Return a boolean indicating if there is an active view transition to the 84792 * given href. You can use this value to render CSS classes or viewTransitionName 84793 * styles onto your elements 84794 * 84795 * @param href The destination href 84796 * @param [opts.relative] Relative routing type ("route" | "path") 84797 */ 84798function useViewTransitionState(to, opts) { 84799 if (opts === void 0) { 84800 opts = {}; 84801 } 84802 let vtContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(ViewTransitionContext); 84803 !(vtContext != null) ? false ? 0 : (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 84804 let { 84805 basename 84806 } = useDataRouterContext(DataRouterHook.useViewTransitionState); 84807 let path = (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .useResolvedPath */ .x$)(to, { 84808 relative: opts.relative 84809 });
84810 if (!vtContext.isTransitioning) { 84811 return false; 84812 } 84813 let currentPath = (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .stripBasename */ .pb)(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname; 84814 let nextPath = (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .stripBasename */ .pb)(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname; 84815 // Transition is active if we're going to or coming from the indicated 84816 // destination. This ensures that other PUSH navigations that reverse 84817 // an indicated transition apply. I.e., on the list view you have: 84818 // 84819 // <NavLink to="/details/1" viewTransition> 84820 // 84821 // If you click the breadcrumb back to the list view: 84822 // 84823 // <NavLink to="/list" viewTransition> 84824 // 84825 // We should apply the transition because it's indicated as active going 84826 // from /list -> /details/1 and therefore should be active on the reverse 84827 // (even though this isn't strictly a POP reverse) 84828 return (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .matchPath */ .B6)(path.pathname, nextPath) != null || (0,react_router__WEBPACK_IMPORTED_MODULE_3__/* .matchPath */ .B6)(path.pathname, currentPath) != null; 84829} 84830//#endregion 84831 84832 84833//# sourceMappingURL=index.js.map 84834 84835 84836/***/ }, 84837 84838/***/ 20913 84839(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 84840 84841"use strict"; 84842var react__WEBPACK_IMPORTED_MODULE_0___namespace_cache; 84843/* harmony export */ __webpack_require__.d(__webpack_exports__, { 84844/* harmony export */ $P: () => (/* binding */ useHref), 84845/* harmony export */ C5: () => (/* binding */ Navigate), 84846/* harmony export */ Ix: () => (/* binding */ Router), 84847/* harmony export */ Rq: () => (/* binding */ DataRouterStateContext), 84848/* harmony export */ V8: () => (/* binding */ logV6DeprecationWarnings), 84849/* harmony export */ Ye: () => (/* binding */ useRoutes), 84850/* harmony export */ Zp: () => (/* binding */ useNavigate), 84851/* harmony export */ jb: () => (/* binding */ NavigationContext), 84852/* harmony export */ sp: () => (/* binding */ DataRouterContext), 84853/* harmony export */ x$: () => (/* binding */ useResolvedPath), 84854/* harmony export */ zy: () => (/* binding */ useLocation) 84855/* harmony export */ }); 84856/* unused harmony exports Await, MemoryRouter, Outlet, Route, RouterProvider, Routes, UNSAFE_LocationContext, UNSAFE_RouteContext, UNSAFE_mapRouteProperties, UNSAFE_useRouteId, UNSAFE_useRoutesImpl, createMemoryRouter, createRoutesFromChildren, createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useBlocker, useInRouterContext, useLoaderData, useMatch, useMatches, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useRevalidator, useRouteError, useRouteLoaderData */ 84857/* unused harmony import specifier */ var React; 84858/* unused harmony import specifier */ var UNSAFE_invariant; 84859/* unused harmony import specifier */ var matchPath; 84860/* unused harmony import specifier */ var UNSAFE_decodePath; 84861/* unused harmony import specifier */ var UNSAFE_convertRouteMatchToUiMatch; 84862/* unused harmony import specifier */ var stripBasename; 84863/* unused harmony import specifier */ var IDLE_BLOCKER; 84864/* unused harmony import specifier */ var createMemoryHistory; 84865/* unused harmony import specifier */ var createRouter; 84866/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 84867/* harmony import */ var _remix_run_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45588); 84868/** 84869 * React Router v6.30.4 84870 * 84871 * Copyright (c) Remix Software Inc. 84872 * 84873 * This source code is licensed under the MIT license found in the 84874 * LICENSE.md file in the root directory of this source tree. 84875 * 84876 * @license MIT 84877 */ 84878 84879 84880 84881 84882function _extends() { 84883 return _extends = Object.assign ? Object.assign.bind() : function (n) { 84884 for (var e = 1; e < arguments.length; e++) { 84885 var t = arguments[e]; 84886 for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); 84887 } 84888 return n; 84889 }, _extends.apply(null, arguments); 84890} 84891 84892// Create react-specific types from the agnostic types in @remix-run/router to 84893// export from react-router 84894 84895const DataRouterContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); 84896if (false) // removed by dead control flow 84897{} 84898const DataRouterStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); 84899if (false) // removed by dead control flow 84900{} 84901const AwaitContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); 84902if (false) // removed by dead control flow 84903{} 84904 84905/** 84906 * A Navigator is a "location changer";
84906 it's how you get to different locations. 84907 * 84908 * Every history instance conforms to the Navigator interface, but the 84909 * distinction is useful primarily when it comes to the low-level `<Router>` API 84910 * where both the location and a navigator must be provided separately in order 84911 * to avoid "tearing" that may occur in a suspense-enabled app if the action 84912 * and/or location were to be read directly from the history instance. 84913 */ 84914 84915const NavigationContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); 84916if (false) // removed by dead control flow 84917{} 84918const LocationContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); 84919if (false) // removed by dead control flow 84920{} 84921const RouteContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext({ 84922 outlet: null, 84923 matches: [], 84924 isDataRoute: false 84925}); 84926if (false) // removed by dead control flow 84927{} 84928const RouteErrorContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); 84929if (false) // removed by dead control flow 84930{} 84931 84932/** 84933 * Returns the full href for the given "to" value. This is useful for building 84934 * custom links that are also accessible and preserve right-click behavior. 84935 * 84936 * @see https://reactrouter.com/v6/hooks/use-href 84937 */ 84938function useHref(to, _temp) { 84939 let { 84940 relative 84941 } = _temp === void 0 ? {} : _temp; 84942 !useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 84943 let { 84944 basename, 84945 navigator 84946 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext); 84947 let { 84948 hash, 84949 pathname, 84950 search 84951 } = useResolvedPath(to, { 84952 relative 84953 }); 84954 let joinedPathname = pathname; 84955 84956 // If we're operating within a basename, prepend it to the pathname prior 84957 // to creating the href. If this is a root navigation, then just use the raw 84958 // basename which allows the basename to have full control over the presence 84959 // of a trailing slash on root links 84960 if (basename !== "/") { 84961 joinedPathname = pathname === "/" ? basename : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .joinPaths */ .HS)([basename, pathname]); 84962 } 84963 return navigator.createHref({ 84964 pathname: joinedPathname, 84965 search, 84966 hash 84967 }); 84968} 84969 84970/** 84971 * Returns true if this component is a descendant of a `<Router>`. 84972 * 84973 * @see https://reactrouter.com/v6/hooks/use-in-router-context 84974 */ 84975function useInRouterContext() { 84976 return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext) != null; 84977} 84978 84979/** 84980 * Returns the current location object, which represents the current URL in web 84981 * browsers. 84982 * 84983 * Note: If you're using this it may mean you're doing some of your own 84984 * "routing" in your app, and we'd like to know what your use case is. We may 84985 * be able to provide something higher-level to better suit your needs. 84986 * 84987 * @see https://reactrouter.com/v6/hooks/use-location 84988 */ 84989function useLocation() { 84990 !useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 84991 return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext).location; 84992} 84993 84994/** 84995 * Returns the current navigation action which describes how the router came to 84996 * the current location, either by a pop, push, or replace on the history stack. 84997 * 84998 * @see https://reactrouter.com/v6/hooks/use-navigation-type 84999 */ 85000function useNavigationType() { 85001 return React.useContext(LocationContext).navigationType; 85002} 85003 85004/** 85005 * Returns a PathMatch object if the given pattern matches the current URL. 85006 * This is useful for components that need to know "active" state, e.g. 85007 * `<NavLink>`. 85008 * 85009 * @see https://reactrouter.com/v6/hooks/use-match 85010 */ 85011function useMatch(pattern) { 85012 !useInRouterContext() ? false ? 0 : UNSAFE_invariant(false) : void 0; 85013 let { 85014 pathname 85015 } = useLocation(); 85016 return React.useMemo(() => matchPath(pattern, UNSAFE_decodePath(pathname)), [pathname, pattern]); 85017} 85018 85019/** 85020 * The interface for the navigate() function returned from useNavigate(). 85021 */ 85022 85023const navigateEffectWarning = (/* unused pure expression or super */ null && ("You should call navigate() in a React.useEffect(), not when " + "your component is first rendered.")); 85024 85025// Mute warnings for calls to useNavigate in SSR environments 85026function useIsomorphicLayoutEffect(cb) { 85027 let isStatic = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext).static; 85028 if (!isStatic) { 85029 // We should be able to get rid of this once react 18.3 is released 85030 // See: https://github.com/facebook/react/pull/26395 85031 // eslint-disable-next-line react-hooks/rules-of-hooks 85032 react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(cb); 85033 } 85034} 85035 85036/** 85037 * Returns an imperative method for changing the location. Used by `<Link>`s, but 85038 * may also be used by other elements to change the location. 85039 * 85040 * @see https://reactrouter.com/v6/hooks/use-navigate 85041 */ 85042function useNavigate() { 85043 let { 85044 isDataRoute 85045 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); 85046 // Conditional usage is OK here because the usage of a data router is static 85047 // eslint-disable-next-line react-hooks/rules-of-hooks 85048 return isDataRoute ? useNavigateStable() : useNavigateUnstable(); 85049} 85050function useNavigateUnstable() { 85051 !useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi
85051)(false) : void 0; 85052 let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext); 85053 let { 85054 basename, 85055 future, 85056 navigator 85057 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext); 85058 let { 85059 matches 85060 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); 85061 let { 85062 pathname: locationPathname 85063 } = useLocation(); 85064 let routePathnamesJson = JSON.stringify((0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_getResolveToMatches */ .yD)(matches, future.v7_relativeSplatPath)); 85065 let activeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 85066 useIsomorphicLayoutEffect(() => { 85067 activeRef.current = true; 85068 }); 85069 let navigate = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (to, options) { 85070 if (options === void 0) { 85071 options = {}; 85072 } 85073 false ? 0 : void 0; 85074 85075 // Short circuit here since if this happens on first render the navigate 85076 // is useless because we haven't wired up our history listener yet 85077 if (!activeRef.current) return; 85078 if (typeof to === "number") { 85079 navigator.go(to); 85080 return; 85081 } 85082 let path = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .resolveTo */ .Gh)(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path"); 85083 85084 // If we're operating within a basename, prepend it to the pathname prior 85085 // to handing off to history (but only if we're not in a data router, 85086 // otherwise it'll prepend the basename inside of the router). 85087 // If this is a root navigation, then we navigate to the raw basename 85088 // which allows the basename to have full control over the presence of a 85089 // trailing slash on root links 85090 if (dataRouterContext == null && basename !== "/") { 85091 path.pathname = path.pathname === "/" ? basename : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .joinPaths */ .HS)([basename, path.pathname]); 85092 } 85093 (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options); 85094 }, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]); 85095 return navigate; 85096} 85097const OutletContext = /*#__PURE__*/(/* unused pure expression or super */ null && (React.createContext(null))); 85098 85099/** 85100 * Returns the context (if provided) for the child route at this level of the route 85101 * hierarchy. 85102 * @see https://reactrouter.com/v6/hooks/use-outlet-context 85103 */ 85104function useOutletContext() { 85105 return React.useContext(OutletContext); 85106} 85107 85108/** 85109 * Returns the element for the child route at this level of the route 85110 * hierarchy. Used internally by `<Outlet>` to render child routes. 85111 * 85112 * @see https://reactrouter.com/v6/hooks/use-outlet 85113 */ 85114function useOutlet(context) { 85115 let outlet = React.useContext(RouteContext).outlet; 85116 if (outlet) { 85117 return /*#__PURE__*/React.createElement(OutletContext.Provider, { 85118 value: context 85119 }, outlet); 85120 } 85121 return outlet; 85122} 85123 85124/** 85125 * Returns an object of key/value pairs of the dynamic params from the current 85126 * URL that were matched by the route path. 85127 * 85128 * @see https://reactrouter.com/v6/hooks/use-params 85129 */ 85130function useParams() { 85131 let { 85132 matches 85133 } = React.useContext(RouteContext); 85134 let routeMatch = matches[matches.length - 1]; 85135 return routeMatch ? routeMatch.params : {}; 85136} 85137 85138/** 85139 * Resolves the pathname of the given `to` value against the current location. 85140 * 85141 * @see https://reactrouter.com/v6/hooks/use-resolved-path 85142 */ 85143function useResolvedPath(to, _temp2) { 85144 let { 85145 relative 85146 } = _temp2 === void 0 ? {} : _temp2; 85147 let { 85148 future 85149 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext); 85150 let { 85151 matches 85152 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); 85153 let { 85154 pathname: locationPathname 85155 } = useLocation(); 85156 let routePathnamesJson = JSON.stringify((0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_getResolveToMatches */ .yD)(matches, future.v7_relativeSplatPath)); 85157 return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .resolveTo */ .Gh)(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]); 85158} 85159 85160/** 85161 * Returns the element of the route that matched the current location, prepared 85162 * with the correct context to render the remainder of the route tree. Route 85163 * elements in the tree must render an `<Outlet>` to render their child route's 85164 * element. 85165 * 85166 * @see https://reactrouter.com/v6/hooks/use-routes 85167 */ 85168function useRoutes(routes, locationArg) { 85169 return useRoutesImpl(routes, locationArg); 85170} 85171 85172// Internal implementation with accept optional param for RouterProvider usage 85173function useRoutesImpl(routes, locationArg, dataRouterState, future) { 85174 !useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi
85174)(false) : void 0; 85175 let { 85176 navigator 85177 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext); 85178 let { 85179 matches: parentMatches 85180 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); 85181 let routeMatch = parentMatches[parentMatches.length - 1]; 85182 let parentParams = routeMatch ? routeMatch.params : {}; 85183 let parentPathname = routeMatch ? routeMatch.pathname : "/"; 85184 let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/"; 85185 let parentRoute = routeMatch && routeMatch.route; 85186 if (false) // removed by dead control flow 85187{} 85188 let locationFromContext = useLocation(); 85189 let location; 85190 if (locationArg) { 85191 var _parsedLocationArg$pa; 85192 let parsedLocationArg = typeof locationArg === "string" ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .parsePath */ .Rr)(locationArg) : locationArg; 85193 !(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 85194 location = parsedLocationArg; 85195 } else { 85196 location = locationFromContext; 85197 } 85198 let pathname = location.pathname || "/"; 85199 let remainingPathname = pathname; 85200 if (parentPathnameBase !== "/") { 85201 // Determine the remaining pathname by removing the # of URL segments the 85202 // parentPathnameBase has, instead of removing based on character count. 85203 // This is because we can't guarantee that incoming/outgoing encodings/ 85204 // decodings will match exactly. 85205 // We decode paths before matching on a per-segment basis with 85206 // decodeURIComponent(), but we re-encode pathnames via `new URL()` so they 85207 // match what `window.location.pathname` would reflect. Those don't 100% 85208 // align when it comes to encoded URI characters such as % and &. 85209 // 85210 // So we may end up with: 85211 // pathname: "/descendant/a%25b/match" 85212 // parentPathnameBase: "/descendant/a%b" 85213 // 85214 // And the direct substring removal approach won't work :/ 85215 let parentSegments = parentPathnameBase.replace(/^\//, "").split("/"); 85216 let segments = pathname.replace(/^\//, "").split("/"); 85217 remainingPathname = "/" + segments.slice(parentSegments.length).join("/"); 85218 } 85219 let matches = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .matchRoutes */ .ue)(routes, { 85220 pathname: remainingPathname 85221 }); 85222 if (false) // removed by dead control flow 85223{} 85224 let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, { 85225 params: Object.assign({}, parentParams, match.params), 85226 pathname: (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .joinPaths */ .HS)([parentPathnameBase, 85227 // Re-encode pathnames that were decoded inside matchRoutes 85228 navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname]), 85229 pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .joinPaths */ .HS)([parentPathnameBase, 85230 // Re-encode pathnames that were decoded inside matchRoutes 85231 navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase]) 85232 })), parentMatches, dataRouterState, future); 85233 85234 // When a user passes in a `locationArg`, the associated routes need to 85235 // be wrapped in a new `LocationContext.Provider` in order for `useLocation` 85236 // to use the scoped location instead of the global location. 85237 if (locationArg && renderedMatches) { 85238 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(LocationContext.Provider, { 85239 value: { 85240 location: _extends({ 85241 pathname: "/", 85242 search: "", 85243 hash: "", 85244 state: null, 85245 key: "default" 85246 }, location), 85247 navigationType: _remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .Action */ .rc.Pop 85248 } 85249 }, renderedMatches); 85250 } 85251 return renderedMatches; 85252} 85253function DefaultErrorComponent() { 85254 let error = useRouteError(); 85255 let message = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .isRouteErrorResponse */ .pX)(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error); 85256 let stack = error instanceof Error ? error.stack : null; 85257 let lightgrey = "rgba(200,200,200, 0.5)"; 85258 let preStyles = { 85259 padding: "0.5rem", 85260 backgroundColor: lightgrey 85261 }; 85262 let codeStyles = { 85263 padding: "2px 4px", 85264 backgroundColor: lightgrey 85265 }; 85266 let devInfo = null; 85267 if (false) // removed by dead control flow 85268{} 85269 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h2", null, "Unexpected Application
85269Error!"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h3", { 85270 style: { 85271 fontStyle: "italic" 85272 } 85273 }, message), stack ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("pre", { 85274 style: preStyles 85275 }, stack) : null, devInfo); 85276} 85277const defaultErrorElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(DefaultErrorComponent, null); 85278class RenderErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component { 85279 constructor(props) { 85280 super(props); 85281 this.state = { 85282 location: props.location, 85283 revalidation: props.revalidation, 85284 error: props.error 85285 }; 85286 } 85287 static getDerivedStateFromError(error) { 85288 return { 85289 error: error 85290 }; 85291 } 85292 static getDerivedStateFromProps(props, state) { 85293 // When we get into an error state, the user will likely click "back" to the 85294 // previous page that didn't have an error. Because this wraps the entire 85295 // application, that will have no effect--the error page continues to display. 85296 // This gives us a mechanism to recover from the error when the location changes. 85297 // 85298 // Whether we're in an error state or not, we update the location in state 85299 // so that when we are in an error state, it gets reset when a new location 85300 // comes in and the user recovers from the error. 85301 if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") { 85302 return { 85303 error: props.error, 85304 location: props.location, 85305 revalidation: props.revalidation 85306 }; 85307 } 85308 85309 // If we're not changing locations, preserve the location but still surface 85310 // any new errors that may come through. We retain the existing error, we do 85311 // this because the error provided from the app state may be cleared without 85312 // the location changing. 85313 return { 85314 error: props.error !== undefined ? props.error : state.error, 85315 location: state.location, 85316 revalidation: props.revalidation || state.revalidation 85317 }; 85318 } 85319 componentDidCatch(error, errorInfo) { 85320 console.error("React Router caught the following error during render", error, errorInfo); 85321 } 85322 render() { 85323 return this.state.error !== undefined ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteContext.Provider, { 85324 value: this.props.routeContext 85325 }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteErrorContext.Provider, { 85326 value: this.state.error, 85327 children: this.props.component 85328 })) : this.props.children; 85329 } 85330} 85331function RenderedRoute(_ref) { 85332 let { 85333 routeContext, 85334 match, 85335 children 85336 } = _ref; 85337 let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext); 85338 85339 // Track how deep we got in our render pass to emulate SSR componentDidCatch 85340 // in a DataStaticRouter 85341 if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) { 85342 dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id; 85343 } 85344 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteContext.Provider, { 85345 value: routeContext 85346 }, children); 85347} 85348function _renderMatches(matches, parentMatches, dataRouterState, future) { 85349 var _dataRouterState; 85350 if (parentMatches === void 0) { 85351 parentMatches = []; 85352 } 85353 if (dataRouterState === void 0) { 85354 dataRouterState = null; 85355 } 85356 if (future === void 0) { 85357 future = null; 85358 } 85359 if (matches == null) { 85360 var _future; 85361 if (!dataRouterState) { 85362 return null; 85363 } 85364 if (dataRouterState.errors) { 85365 // Don't bail if we have data router errors so we can render them in the 85366 // boundary. Use the pre-matched (or shimmed) matches 85367 matches = dataRouterState.matches; 85368 } else if ((_future = future) != null && _future.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) { 85369 // Don't bail if we're initializing with partial hydration and we have 85370 // router matches. That means we're actively running `patchRoutesOnNavigation` 85371 // so we should render down the partial matches to the appropriate 85372 // `HydrateFallback`. We only do this if `parentMatches` is empty so it 85373 // only impacts the root matches for `RouterProvider` and no descendant 85374 // `<Routes>` 85375 matches = dataRouterState.matches; 85376 } else { 85377 return null; 85378 } 85379 } 85380 let renderedMatches = matches; 85381 85382 // If we have data errors, trim matches to the highest error boundary 85383 let errors = (_dataRouterState = dataRouterState) == null ? void 0 : _dataRouterState.errors; 85384 if (errors != null) { 85385 let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]) !== undefined); 85386 !(errorIndex >= 0) ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi
vendor: 4,187 bytes, lines 85386-85480
85386)(false) : void 0; 85387 renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1)); 85388 } 85389 85390 // If we're in a partial hydration mode, detect if we need to render down to 85391 // a given HydrateFallback while we load the rest of the hydration data 85392 let renderFallback = false; 85393 let fallbackIndex = -1; 85394 if (dataRouterState && future && future.v7_partialHydration) { 85395 for (let i = 0; i < renderedMatches.length; i++) { 85396 let match = renderedMatches[i]; 85397 // Track the deepest fallback up until the first route without data 85398 if (match.route.HydrateFallback || match.route.hydrateFallbackElement) { 85399 fallbackIndex = i; 85400 } 85401 if (match.route.id) { 85402 let { 85403 loaderData, 85404 errors 85405 } = dataRouterState; 85406 let needsToRunLoader = match.route.loader && loaderData[match.route.id] === undefined && (!errors || errors[match.route.id] === undefined); 85407 if (match.route.lazy || needsToRunLoader) { 85408 // We found the first route that's not ready to render (waiting on 85409 // lazy, or has a loader that hasn't run yet). Flag that we need to 85410 // render a fallback and render up until the appropriate fallback 85411 renderFallback = true; 85412 if (fallbackIndex >= 0) { 85413 renderedMatches = renderedMatches.slice(0, fallbackIndex + 1); 85414 } else { 85415 renderedMatches = [renderedMatches[0]]; 85416 } 85417 break; 85418 } 85419 } 85420 } 85421 } 85422 return renderedMatches.reduceRight((outlet, match, index) => { 85423 // Only data routers handle errors/fallbacks 85424 let error; 85425 let shouldRenderHydrateFallback = false; 85426 let errorElement = null; 85427 let hydrateFallbackElement = null; 85428 if (dataRouterState) { 85429 error = errors && match.route.id ? errors[match.route.id] : undefined; 85430 errorElement = match.route.errorElement || defaultErrorElement; 85431 if (renderFallback) { 85432 if (fallbackIndex < 0 && index === 0) { 85433 warningOnce("route-fallback", false, "No `HydrateFallback` element provided to render during initial hydration"); 85434 shouldRenderHydrateFallback = true; 85435 hydrateFallbackElement = null; 85436 } else if (fallbackIndex === index) { 85437 shouldRenderHydrateFallback = true; 85438 hydrateFallbackElement = match.route.hydrateFallbackElement || null; 85439 } 85440 } 85441 } 85442 let matches = parentMatches.concat(renderedMatches.slice(0, index + 1)); 85443 let getChildren = () => { 85444 let children; 85445 if (error) { 85446 children = errorElement; 85447 } else if (shouldRenderHydrateFallback) { 85448 children = hydrateFallbackElement; 85449 } else if (match.route.Component) { 85450 // Note: This is a de-optimized path since React won't re-use the 85451 // ReactElement since it's identity changes with each new 85452 // React.createElement call. We keep this so folks can use 85453 // `<Route Component={...}>` in `<Routes>` but generally `Component` 85454 // usage is only advised in `RouterProvider` when we can convert it to 85455 // `element` ahead of time. 85456 children = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(match.route.Component, null); 85457 } else if (match.route.element) { 85458 children = match.route.element; 85459 } else { 85460 children = outlet; 85461 } 85462 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderedRoute, { 85463 match: match, 85464 routeContext: { 85465 outlet, 85466 matches, 85467 isDataRoute: dataRouterState != null 85468 }, 85469 children: children 85470 }); 85471 }; 85472 // Only wrap in an error boundary within data router usages when we have an 85473 // ErrorBoundary/errorElement on this route. Otherwise let it bubble up to 85474 // an ancestor ErrorBoundary/errorElement 85475 return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderErrorBoundary, { 85476 location: dataRouterState.location, 85477 revalidation: dataRouterState.revalidation, 85478 component: errorElement, 85479 error: error, 85480 children: getChildren(),
85481 routeContext: { 85482 outlet: null, 85483 matches, 85484 isDataRoute: true 85485 } 85486 }) : getChildren(); 85487 }, null); 85488} 85489var DataRouterHook = /*#__PURE__*/function (DataRouterHook) { 85490 DataRouterHook["UseBlocker"] = "useBlocker"; 85491 DataRouterHook["UseRevalidator"] = "useRevalidator"; 85492 DataRouterHook["UseNavigateStable"] = "useNavigate"; 85493 return DataRouterHook; 85494}(DataRouterHook || {}); 85495var DataRouterStateHook = /*#__PURE__*/function (DataRouterStateHook) { 85496 DataRouterStateHook["UseBlocker"] = "useBlocker"; 85497 DataRouterStateHook["UseLoaderData"] = "useLoaderData"; 85498 DataRouterStateHook["UseActionData"] = "useActionData"; 85499 DataRouterStateHook["UseRouteError"] = "useRouteError"; 85500 DataRouterStateHook["UseNavigation"] = "useNavigation"; 85501 DataRouterStateHook["UseRouteLoaderData"] = "useRouteLoaderData"; 85502 DataRouterStateHook["UseMatches"] = "useMatches"; 85503 DataRouterStateHook["UseRevalidator"] = "useRevalidator"; 85504 DataRouterStateHook["UseNavigateStable"] = "useNavigate"; 85505 DataRouterStateHook["UseRouteId"] = "useRouteId"; 85506 return DataRouterStateHook; 85507}(DataRouterStateHook || {}); 85508function getDataRouterConsoleError(hookName) { 85509 return hookName + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."; 85510} 85511function useDataRouterContext(hookName) { 85512 let ctx = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext); 85513 !ctx ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 85514 return ctx; 85515} 85516function useDataRouterState(hookName) { 85517 let state = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterStateContext); 85518 !state ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 85519 return state; 85520} 85521function useRouteContext(hookName) { 85522 let route = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); 85523 !route ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 85524 return route; 85525} 85526 85527// Internal version with hookName-aware debugging 85528function useCurrentRouteId(hookName) { 85529 let route = useRouteContext(hookName); 85530 let thisRoute = route.matches[route.matches.length - 1]; 85531 !thisRoute.route.id ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 85532 return thisRoute.route.id; 85533} 85534 85535/** 85536 * Returns the ID for the nearest contextual route 85537 */ 85538function useRouteId() { 85539 return useCurrentRouteId(DataRouterStateHook.UseRouteId); 85540} 85541 85542/** 85543 * Returns the current navigation, defaulting to an "idle" navigation when 85544 * no navigation is in progress 85545 */ 85546function useNavigation() { 85547 let state = useDataRouterState(DataRouterStateHook.UseNavigation); 85548 return state.navigation; 85549} 85550 85551/** 85552 * Returns a revalidate function for manually triggering revalidation, as well 85553 * as the current state of any manual revalidations 85554 */ 85555function useRevalidator() { 85556 let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator); 85557 let state = useDataRouterState(DataRouterStateHook.UseRevalidator); 85558 return React.useMemo(() => ({ 85559 revalidate: dataRouterContext.router.revalidate, 85560 state: state.revalidation 85561 }), [dataRouterContext.router.revalidate, state.revalidation]); 85562} 85563 85564/** 85565 * Returns the active route matches, useful for accessing loaderData for 85566 * parent/child routes or the route "handle" property 85567 */ 85568function useMatches() { 85569 let { 85570 matches, 85571 loaderData 85572 } = useDataRouterState(DataRouterStateHook.UseMatches); 85573 return React.useMemo(() => matches.map(m => UNSAFE_convertRouteMatchToUiMatch(m, loaderData)), [matches, loaderData]); 85574} 85575 85576/** 85577 * Returns the loader data for the nearest ancestor Route loader 85578 */ 85579function useLoaderData() { 85580 let state = useDataRouterState(DataRouterStateHook.UseLoaderData); 85581 let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData); 85582 if (state.errors && state.errors[routeId] != null) { 85583 console.error("You cannot `useLoaderData` in an errorElement (routeId: " + routeId + ")"); 85584 return undefined; 85585 } 85586 return state.loaderData[routeId]; 85587} 85588 85589/** 85590 * Returns the loaderData for the given routeId 85591 */ 85592function useRouteLoaderData(routeId) { 85593 let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData); 85594 return state.loaderData[routeId]; 85595} 85596 85597/** 85598 * Returns the action data for the nearest ancestor Route action 85599 */ 85600function useActionData() { 85601 let state = useDataRouterState(DataRouterStateHook.UseActionData); 85602 let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData); 85603 return state.actionData ? state.actionData[routeId] : undefined; 85604} 85605 85606/** 85607 * Returns the nearest ancestor Route error, which could be a loader/action 85608 * error or a render error. This is intended to be called from your 85609 * ErrorBoundary/errorElement to display a proper error message. 85610 */ 85611function useRouteError() { 85612 var _state$errors; 85613 let error = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteErrorContext); 85614 let state = useDataRouterState(DataRouterStateHook.UseRouteError); 85615 let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError); 85616 85617 // If this was a render error, we put it in a RouteError context inside 85618 // of RenderErrorBoundary 85619 if (error !== undefined) { 85620 return error; 85621 } 85622 85623 // Otherwise look for errors from our data router state 85624 return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId]; 85625} 85626 85627/** 85628 * Returns the happy-path data from the nearest ancestor `<Await />` value 85629 */ 85630function useAsyncValue() { 85631 let value = React.useContext(AwaitContext); 85632 return value == null ? void 0 : value._data; 85633} 85634 85635/** 85636 * Returns the error from the nearest ancestor `<Await />` value 85637 */ 85638function useAsyncError() { 85639 let value = React.useContext(AwaitContext); 85640 return value == null ? void 0 : value._error; 85641} 85642let blockerId = 0; 85643 85644/** 85645 * Allow the application to block navigations within the SPA and present the 85646 * user a confirmation dialog to confirm the navigation. Mostly used to avoid 85647 * using half-filled form data. This does not handle hard-reloads or 85648 * cross-origin navigations. 85649 */ 85650function useBlocker(shouldBlock) { 85651 let { 85652 router, 85653 basename 85654 } = useDataRouterContext(DataRouterHook.UseBlocker); 85655 let state = useDataRouterState(DataRouterStateHook.UseBlocker); 85656 let [blockerKey, setBlockerKey] = React.useState(""); 85657 let blockerFunction = React.useCallback(arg => { 85658 if (typeof shouldBlock !== "function") { 85659 return !!shouldBlock; 85660 } 85661 if (basename === "/") { 85662 return shouldBlock(arg); 85663 } 85664 85665 // If they provided us a function and we've got an active basename, strip 85666 // it from the locations we expose to the user to match the behavior of 85667 // useLocation 85668 let { 85669 currentLocation, 85670 nextLocation, 85671 historyAction 85672 } = arg; 85673 return shouldBlock({ 85674 currentLocation: _extends({}, currentLocation, {
85675 pathname: stripBasename(currentLocation.pathname, basename) || currentLocation.pathname 85676 }), 85677 nextLocation: _extends({}, nextLocation, { 85678 pathname: stripBasename(nextLocation.pathname, basename) || nextLocation.pathname 85679 }), 85680 historyAction 85681 }); 85682 }, [basename, shouldBlock]); 85683 85684 // This effect is in charge of blocker key assignment and deletion (which is 85685 // tightly coupled to the key) 85686 React.useEffect(() => { 85687 let key = String(++blockerId); 85688 setBlockerKey(key); 85689 return () => router.deleteBlocker(key); 85690 }, [router]); 85691 85692 // This effect handles assigning the blockerFunction. This is to handle 85693 // unstable blocker function identities, and happens only after the prior 85694 // effect so we don't get an orphaned blockerFunction in the router with a 85695 // key of "". Until then we just have the IDLE_BLOCKER. 85696 React.useEffect(() => { 85697 if (blockerKey !== "") { 85698 router.getBlocker(blockerKey, blockerFunction); 85699 } 85700 }, [router, blockerKey, blockerFunction]); 85701 85702 // Prefer the blocker from `state` not `router.state` since DataRouterContext 85703 // is memoized so this ensures we update on blocker state updates 85704 return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : IDLE_BLOCKER; 85705} 85706 85707/** 85708 * Stable version of useNavigate that is used when we are in the context of 85709 * a RouterProvider. 85710 */ 85711function useNavigateStable() { 85712 let { 85713 router 85714 } = useDataRouterContext(DataRouterHook.UseNavigateStable); 85715 let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable); 85716 let activeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 85717 useIsomorphicLayoutEffect(() => { 85718 activeRef.current = true; 85719 }); 85720 let navigate = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (to, options) { 85721 if (options === void 0) { 85722 options = {}; 85723 } 85724 false ? 0 : void 0; 85725 85726 // Short circuit here since if this happens on first render the navigate 85727 // is useless because we haven't wired up our router subscriber yet 85728 if (!activeRef.current) return; 85729 if (typeof to === "number") { 85730 router.navigate(to); 85731 } else { 85732 router.navigate(to, _extends({ 85733 fromRouteId: id 85734 }, options)); 85735 } 85736 }, [router, id]); 85737 return navigate; 85738} 85739const alreadyWarned$1 = {}; 85740function warningOnce(key, cond, message) { 85741 if (!cond && !alreadyWarned$1[key]) { 85742 alreadyWarned$1[key] = true; 85743 false ? 0 : void 0; 85744 } 85745} 85746 85747const alreadyWarned = {}; 85748function warnOnce(key, message) { 85749 if (false) // removed by dead control flow 85750{} 85751} 85752const logDeprecation = (flag, msg, link) => warnOnce(flag, "\u26A0\uFE0F React Router Future Flag Warning: " + msg + ". " + ("You can use the `" + flag + "` future flag to opt-in early. ") + ("For more information, see " + link + ".")); 85753function logV6DeprecationWarnings(renderFuture, routerFuture) { 85754 if ((renderFuture == null ? void 0 : renderFuture.v7_startTransition) === undefined) { 85755 logDeprecation("v7_startTransition", "React Router will begin wrapping state updates in `React.startTransition` in v7", "https://reactrouter.com/v6/upgrading/future#v7_starttransition"); 85756 } 85757 if ((renderFuture == null ? void 0 : renderFuture.v7_relativeSplatPath) === undefined && (!routerFuture || routerFuture.v7_relativeSplatPath === undefined)) { 85758 logDeprecation("v7_relativeSplatPath", "Relative route resolution within Splat routes is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"); 85759 } 85760 if (routerFuture) { 85761 if (routerFuture.v7_fetcherPersist === undefined) { 85762 logDeprecation("v7_fetcherPersist", "The persistence behavior of fetchers is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"); 85763 } 85764 if (routerFuture.v7_normalizeFormMethod === undefined) { 85765 logDeprecation("v7_normalizeFormMethod", "Casing of `formMethod` fields is being normalized to uppercase in v7", "https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"); 85766 } 85767 if (routerFuture.v7_partialHydration === undefined) { 85768 logDeprecation("v7_partialHydration", "`RouterProvider` hydration behavior is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_partialhydration"); 85769 } 85770 if (routerFuture.v7_skipActionErrorRevalidation === undefined) { 85771 logDeprecation("v7_skipActionErrorRevalidation", "The revalidation behavior after 4xx/5xx `action` responses is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"); 85772 } 85773 } 85774} 85775 85776/** 85777 Webpack + React 17 fails to compile on any of the following because webpack 85778 complains that `startTransition` doesn't exist in `React`: 85779 * import { startTransition } from "react" 85780 * import * as React from from "react"; 85781 "startTransition" in React ? React.startTransition(() => setState()) : setState() 85782 * import * as React from from "react"; 85783 "startTransition" in React ? React["startTransition"](() => setState()) : setState() 85784 85785 Moving it to a constant such as the following solves the Webpack/React 17 issue: 85786 * import * as React from from "react"; 85787 const START_TRANSITION = "startTransition"; 85788 START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState() 85789
85790 However, that introduces webpack/terser minification issues in production builds 85791 in React 18 where minification/obfuscation ends up removing the call of 85792 React.startTransition entirely from the first half of the ternary. Grabbing 85793 this exported reference once up front resolves that issue. 85794 85795 See https://github.com/remix-run/react-router/issues/10579 85796*/ 85797const START_TRANSITION = "startTransition"; 85798const startTransitionImpl = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))[START_TRANSITION]; 85799 85800/** 85801 * Given a Remix Router instance, render the appropriate UI 85802 */ 85803function RouterProvider(_ref) { 85804 let { 85805 fallbackElement, 85806 router, 85807 future 85808 } = _ref; 85809 let [state, setStateImpl] = React.useState(router.state); 85810 let { 85811 v7_startTransition 85812 } = future || {}; 85813 let setState = React.useCallback(newState => { 85814 if (v7_startTransition && startTransitionImpl) { 85815 startTransitionImpl(() => setStateImpl(newState)); 85816 } else { 85817 setStateImpl(newState); 85818 } 85819 }, [setStateImpl, v7_startTransition]); 85820 85821 // Need to use a layout effect here so we are subscribed early enough to 85822 // pick up on any render-driven redirects/navigations (useEffect/<Navigate>) 85823 React.useLayoutEffect(() => router.subscribe(setState), [router, setState]); 85824 React.useEffect(() => { 85825 false ? 0 : void 0; 85826 // Only log this once on initial mount 85827 // eslint-disable-next-line react-hooks/exhaustive-deps 85828 }, []); 85829 let navigator = React.useMemo(() => { 85830 return { 85831 createHref: router.createHref, 85832 encodeLocation: router.encodeLocation, 85833 go: n => router.navigate(n), 85834 push: (to, state, opts) => router.navigate(to, { 85835 state, 85836 preventScrollReset: opts == null ? void 0 : opts.preventScrollReset 85837 }), 85838 replace: (to, state, opts) => router.navigate(to, { 85839 replace: true, 85840 state, 85841 preventScrollReset: opts == null ? void 0 : opts.preventScrollReset 85842 }) 85843 }; 85844 }, [router]); 85845 let basename = router.basename || "/"; 85846 let dataRouterContext = React.useMemo(() => ({ 85847 router, 85848 navigator, 85849 static: false, 85850 basename 85851 }), [router, navigator, basename]); 85852 React.useEffect(() => logV6DeprecationWarnings(future, router.future), [router, future]); 85853 85854 // The fragment and {null} here are important! We need them to keep React 18's 85855 // useId happy when we are server-rendering since we may have a <script> here 85856 // containing the hydrated server-side staticContext (from StaticRouterProvider). 85857 // useId relies on the component tree structure to generate deterministic id's 85858 // so we need to ensure it remains the same on the client even though 85859 // we don't need the <script> tag 85860 return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DataRouterContext.Provider, { 85861 value: dataRouterContext 85862 }, /*#__PURE__*/React.createElement(DataRouterStateContext.Provider, { 85863 value: state 85864 }, /*#__PURE__*/React.createElement(Router, { 85865 basename: basename, 85866 location: state.location, 85867 navigationType: state.historyAction, 85868 navigator: navigator, 85869 future: { 85870 v7_relativeSplatPath: router.future.v7_relativeSplatPath 85871 } 85872 }, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/React.createElement(DataRoutes, { 85873 routes: router.routes, 85874 future: router.future, 85875 state: state 85876 }) : fallbackElement))), null); 85877} 85878function DataRoutes(_ref2) { 85879 let { 85880 routes, 85881 future, 85882 state 85883 } = _ref2; 85884 return useRoutesImpl(routes, undefined, state, future); 85885} 85886/** 85887 * A `<Router>` that stores all entries in memory. 85888 * 85889 * @see https://reactrouter.com/v6/router-components/memory-router 85890 */ 85891function MemoryRouter(_ref3) { 85892 let { 85893 basename, 85894 children, 85895 initialEntries, 85896 initialIndex, 85897 future 85898 } = _ref3; 85899 let historyRef = React.useRef(); 85900 if (historyRef.current == null) { 85901 historyRef.current = createMemoryHistory({ 85902 initialEntries, 85903 initialIndex, 85904 v5Compat: true 85905 }); 85906 } 85907 let history = historyRef.current; 85908 let [state, setStateImpl] = React.useState({ 85909 action: history.action, 85910 location: history.location 85911 }); 85912 let { 85913 v7_startTransition 85914 } = future || {}; 85915 let setState = React.useCallback(newState => { 85916 v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); 85917 }, [setStateImpl, v7_startTransition]); 85918 React.useLayoutEffect(() => history.listen(setState), [history, setState]); 85919 React.useEffect(() => logV6DeprecationWarnings(future), [future]); 85920 return /*#__PURE__*/React.createElement(Router, { 85921 basename: basename, 85922 children: children, 85923 location: state.location, 85924 navigationType: state.action, 85925 navigator: history, 85926 future: future 85927 }); 85928} 85929/** 85930 * Changes the current location. 85931 *
85932 * Note: This API is mostly useful in React.Component subclasses that are not 85933 * able to use hooks. In functional components, we recommend you use the 85934 * `useNavigate` hook instead. 85935 * 85936 * @see https://reactrouter.com/v6/components/navigate 85937 */ 85938function Navigate(_ref4) { 85939 let { 85940 to, 85941 replace, 85942 state, 85943 relative 85944 } = _ref4; 85945 !useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 85946 let { 85947 future, 85948 static: isStatic 85949 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext); 85950 false ? 0 : void 0; 85951 let { 85952 matches 85953 } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); 85954 let { 85955 pathname: locationPathname 85956 } = useLocation(); 85957 let navigate = useNavigate(); 85958 85959 // Resolve the path outside of the effect so that when effects run twice in 85960 // StrictMode they navigate to the same place 85961 let path = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .resolveTo */ .Gh)(to, (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_getResolveToMatches */ .yD)(matches, future.v7_relativeSplatPath), locationPathname, relative === "path"); 85962 let jsonPath = JSON.stringify(path); 85963 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => navigate(JSON.parse(jsonPath), { 85964 replace, 85965 state, 85966 relative 85967 }), [navigate, jsonPath, relative, replace, state]); 85968 return null; 85969} 85970/** 85971 * Renders the child route's element, if there is one. 85972 * 85973 * @see https://reactrouter.com/v6/components/outlet 85974 */ 85975function Outlet(props) { 85976 return useOutlet(props.context); 85977} 85978/** 85979 * Declares an element that should be rendered at a certain URL path. 85980 * 85981 * @see https://reactrouter.com/v6/components/route 85982 */ 85983function Route(_props) { 85984 false ? 0 : UNSAFE_invariant(false) ; 85985} 85986/** 85987 * Provides location context for the rest of the app. 85988 * 85989 * Note: You usually won't render a `<Router>` directly. Instead, you'll render a 85990 * router that is more specific to your environment such as a `<BrowserRouter>` 85991 * in web browsers or a `<StaticRouter>` for server rendering. 85992 * 85993 * @see https://reactrouter.com/v6/router-components/router 85994 */ 85995function Router(_ref5) { 85996 let { 85997 basename: basenameProp = "/", 85998 children = null, 85999 location: locationProp, 86000 navigationType = _remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .Action */ .rc.Pop, 86001 navigator, 86002 static: staticProp = false, 86003 future 86004 } = _ref5; 86005 !!useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_invariant */ .Oi)(false) : void 0; 86006 86007 // Preserve trailing slashes on basename, so we can let the user control 86008 // the enforcement of trailing slashes throughout the app 86009 let basename = basenameProp.replace(/^\/*/, "/"); 86010 let navigationContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({ 86011 basename, 86012 navigator, 86013 static: staticProp, 86014 future: _extends({ 86015 v7_relativeSplatPath: false 86016 }, future) 86017 }), [basename, future, navigator, staticProp]); 86018 if (typeof locationProp === "string") { 86019 locationProp = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .parsePath */ .Rr)(locationProp); 86020 } 86021 let { 86022 pathname = "/", 86023 search = "", 86024 hash = "", 86025 state = null, 86026 key = "default" 86027 } = locationProp; 86028 let locationContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 86029 let trailingPathname = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .stripBasename */ .pb)(pathname, basename); 86030 if (trailingPathname == null) { 86031 return null; 86032 } 86033 return { 86034 location: { 86035 pathname: trailingPathname, 86036 search, 86037 hash, 86038 state, 86039 key 86040 }, 86041 navigationType 86042 }; 86043 }, [basename, pathname, search, hash, state, key, navigationType]); 86044 false ? 0 : void 0; 86045 if (locationContext == null) { 86046 return null; 86047 } 86048 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(NavigationContext.Provider, { 86049 value: navigationContext 86050 }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(LocationContext.Provider, { 86051 children: children, 86052 value: locationContext 86053 })); 86054} 86055/** 86056 * A container for a nested tree of `<Route>` elements that renders the branch 86057 * that best matches the current location. 86058 * 86059 * @see https://reactrouter.com/v6/components/routes 86060 */ 86061function Routes(_ref6) { 86062 let { 86063 children, 86064 location 86065 } = _ref6; 86066 return useRoutes(createRoutesFromChildren(children), location); 86067} 86068/** 86069 * Component to use for rendering lazily loaded data from returning defer() 86070 * in a loader function 86071 */ 86072function Await(_ref7) { 86073 let { 86074 children, 86075 errorElement, 86076 resolve 86077 } = _ref7; 86078 return /*#__PURE__*/React.createElement(AwaitErrorBoundary, { 86079 resolve: resolve, 86080 errorElement: errorElement 86081 }, /*#__PURE__*/React.createElement(ResolveAwait, null, children)); 86082} 86083var AwaitRenderStatus = /*#__PURE__*/function (AwaitRenderStatus) { 86084 AwaitRenderStatus[AwaitRenderStatus["pending"] = 0] = "pending"; 86085 AwaitRenderStatus[AwaitRenderStatus["success"] = 1] = "success"; 86086 AwaitRenderStatus[AwaitRenderStatus["error"] = 2] = "error"; 86087 return AwaitRenderStatus; 86088}(AwaitRenderStatus || {}); 86089const neverSettledPromise = new Promise(() => {}); 86090class AwaitErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component { 86091 constructor(props) { 86092 super(props); 86093 this.state = { 86094 error: null 86095 }; 86096 } 86097 static getDerivedStateFromError(error) { 86098 return { 86099 error 86100 }; 86101 } 86102 componentDidCatch(error, errorInfo) { 86103 console.error("<Await> caught the following error during render", error, errorInfo); 86104 } 86105 render() { 86106 let { 86107 children, 86108 errorElement, 86109 resolve 86110 } = this.props; 86111 let promise = null; 86112 let status = AwaitRenderStatus.pending; 86113 if (!(resolve instanceof Promise)) { 86114 // Didn't get a promise - provide as a resolved promise 86115 status = AwaitRenderStatus.success; 86116 promise = Promise.resolve(); 86117 Object.defineProperty(promise, "_tracked", { 86118 get: () => true 86119 }); 86120 Object.defineProperty(promise, "_data", { 86121 get: () => resolve 86122 }); 86123 } else if (this.state.error) { 86124 // Caught a render error, provide it as a rejected promise 86125 status = AwaitRenderStatus.error; 86126 let renderError = this.state.error; 86127 promise = Promise.reject().catch(() => {}); // Avoid unhandled rejection warnings 86128 Object.defineProperty(promise, "_tracked", { 86129 get: () => true 86130 }); 86131 Object.defineProperty(promise, "_error", { 86132 get: () => renderError 86133 }); 86134 } else if (resolve._tracked) { 86135 // Already tracked promise - check contents 86136 promise = resolve; 86137 status = "_error" in promise ? AwaitRenderStatus.error : "_data" in promise ? AwaitRenderStatus.success : AwaitRenderStatus.pending; 86138 } else { 86139 // Raw (untracked) promise - track it 86140 status = AwaitRenderStatus.pending; 86141 Object.defineProperty(resolve, "_tracked", { 86142 get: () => true 86143 }); 86144 promise = resolve.then(data => Object.defineProperty(resolve, "_data", { 86145 get: () => data 86146 }), error => Object.defineProperty(resolve, "_error", { 86147 get: () => error 86148 })); 86149 } 86150 if (status === AwaitRenderStatus.error && promise._error instanceof _remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .AbortedDeferredError */ .tH) { 86151 // Freeze the UI by throwing a never resolved promise 86152 throw neverSettledPromise; 86153 } 86154 if (status === AwaitRenderStatus.error && !errorElement) { 86155 // No errorElement, throw to the nearest route-level error boundary 86156 throw promise._error; 86157 } 86158 if (status === AwaitRenderStatus.error) { 86159 // Render via our errorElement 86160 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(AwaitContext.Provider, { 86161 value: promise, 86162 children: errorElement 86163 }); 86164 } 86165 if (status === AwaitRenderStatus.success) { 86166 // Render children with resolved value 86167 return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(AwaitContext.Provider, { 86168 value: promise, 86169 children: children 86170 }); 86171 } 86172 86173 // Throw to the suspense boundary 86174 throw promise; 86175 } 86176} 86177 86178/** 86179 * @private 86180 * Indirection to leverage useAsyncValue for a render-prop API on `<Await>` 86181 */ 86182function ResolveAwait(_ref8) { 86183 let { 86184 children 86185 } = _ref8; 86186 let data = useAsyncValue(); 86187 let toRender = typeof children === "function" ? children(data) : children; 86188 return /*#__PURE__*/React.createElement(React.Fragment, null, toRender); 86189} 86190
86191/////////////////////////////////////////////////////////////////////////////// 86192// UTILS 86193/////////////////////////////////////////////////////////////////////////////// 86194 86195/** 86196 * Creates a route config from a React "children" object, which is usually 86197 * either a `<Route>` element or an array of them. Used internally by 86198 * `<Routes>` to create a route config from its children. 86199 * 86200 * @see https://reactrouter.com/v6/utils/create-routes-from-children 86201 */ 86202function createRoutesFromChildren(children, parentPath) { 86203 if (parentPath === void 0) { 86204 parentPath = []; 86205 } 86206 let routes = []; 86207 React.Children.forEach(children, (element, index) => { 86208 if (! /*#__PURE__*/React.isValidElement(element)) { 86209 // Ignore non-elements. This allows people to more easily inline 86210 // conditionals in their route config. 86211 return; 86212 } 86213 let treePath = [...parentPath, index]; 86214 if (element.type === React.Fragment) { 86215 // Transparently support React.Fragment and its children. 86216 routes.push.apply(routes, createRoutesFromChildren(element.props.children, treePath)); 86217 return; 86218 } 86219 !(element.type === Route) ? false ? 0 : UNSAFE_invariant(false) : void 0; 86220 !(!element.props.index || !element.props.children) ? false ? 0 : UNSAFE_invariant(false) : void 0; 86221 let route = { 86222 id: element.props.id || treePath.join("-"), 86223 caseSensitive: element.props.caseSensitive, 86224 element: element.props.element, 86225 Component: element.props.Component, 86226 index: element.props.index, 86227 path: element.props.path, 86228 loader: element.props.loader, 86229 action: element.props.action, 86230 errorElement: element.props.errorElement, 86231 ErrorBoundary: element.props.ErrorBoundary, 86232 hasErrorBoundary: element.props.ErrorBoundary != null || element.props.errorElement != null, 86233 shouldRevalidate: element.props.shouldRevalidate, 86234 handle: element.props.handle, 86235 lazy: element.props.lazy 86236 }; 86237 if (element.props.children) { 86238 route.children = createRoutesFromChildren(element.props.children, treePath); 86239 } 86240 routes.push(route); 86241 }); 86242 return routes; 86243} 86244 86245/** 86246 * Renders the result of `matchRoutes()` into a React element. 86247 */ 86248function renderMatches(matches) { 86249 return _renderMatches(matches); 86250} 86251 86252function mapRouteProperties(route) { 86253 let updates = { 86254 // Note: this check also occurs in createRoutesFromChildren so update 86255 // there if you change this -- please and thank you! 86256 hasErrorBoundary: route.ErrorBoundary != null || route.errorElement != null 86257 }; 86258 if (route.Component) { 86259 if (false) // removed by dead control flow 86260{} 86261 Object.assign(updates, { 86262 element: /*#__PURE__*/React.createElement(route.Component), 86263 Component: undefined 86264 }); 86265 } 86266 if (route.HydrateFallback) { 86267 if (false) // removed by dead control flow 86268{} 86269 Object.assign(updates, { 86270 hydrateFallbackElement: /*#__PURE__*/React.createElement(route.HydrateFallback), 86271 HydrateFallback: undefined 86272 }); 86273 } 86274 if (route.ErrorBoundary) { 86275 if (false) // removed by dead control flow 86276{} 86277 Object.assign(updates, { 86278 errorElement: /*#__PURE__*/React.createElement(route.ErrorBoundary), 86279 ErrorBoundary: undefined 86280 }); 86281 } 86282 return updates; 86283} 86284function createMemoryRouter(routes, opts) { 86285 return createRouter({ 86286 basename: opts == null ? void 0 : opts.basename, 86287 future: _extends({}, opts == null ? void 0 : opts.future, { 86288 v7_prependBasename: true 86289 }), 86290 history: createMemoryHistory({ 86291 initialEntries: opts == null ? void 0 : opts.initialEntries, 86292 initialIndex: opts == null ? void 0 : opts.initialIndex 86293 }), 86294 hydrationData: opts == null ? void 0 : opts.hydrationData, 86295 routes, 86296 mapRouteProperties, 86297 dataStrategy: opts == null ? void 0 : opts.dataStrategy, 86298 patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation 86299 }).initialize(); 86300} 86301 86302 86303//# sourceMappingURL=index.js.map 86304 86305 86306/***/ }, 86307 86308/***/ 44433 86309(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 86310 86311"use strict"; 86312/* harmony export */ __webpack_require__.d(__webpack_exports__, { 86313/* harmony export */ Vq: () => (/* binding */ HashLink) 86314/* harmony export */ }); 86315/* unused harmony exports NavHashLink, genericHashLink */ 86316/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96540); 86317/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84976); 86318 86319 86320 86321 86322/*! ***************************************************************************** 86323Copyright (c) Microsoft Corporation. 86324 86325Permission to use, copy, modify, and/or distribute this software for any 86326purpose with or without fee is hereby granted. 86327 86328THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 86329REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 86330AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 86331INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 86332LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 86333OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 86334PERFORMANCE OF THIS SOFTWARE. 86335***************************************************************************** */ 86336 86337var __assign = function() { 86338 __assign = Object.assign || function __assign(t) { 86339 for (var s, i = 1, n = arguments.length; i < n; i++) { 86340 s = arguments[i]; 86341 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 86342 } 86343 return t; 86344 }; 86345 return __assign.apply(this, arguments); 86346}; 86347 86348function __rest(s, e) { 86349 var t = {}; 86350 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 86351 t[p] = s[p]; 86352 if (s != null && typeof Object.getOwnPropertySymbols === "function") 86353 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 86354 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 86355 t[p[i]] = s[p[i]]; 86356 } 86357 return t; 86358} 86359 86360var hashFragment = ''; 86361var observer = null; 86362var asyncTimerId = null; 86363var scrollFunction = null; 86364function reset() { 86365 hashFragment = ''; 86366 if (observer !== null) 86367 observer.disconnect(); 86368 if (asyncTimerId !== null) { 86369 window.clearTimeout(asyncTimerId); 86370 asyncTimerId = null; 86371 } 86372} 86373function isInteractiveElement(element) { 86374 var formTags = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA']; 86375 var linkTags = ['A', 'AREA']; 86376 return ((formTags.includes(element.tagName) && !element.hasAttribute('disabled')) || 86377 (linkTags.includes(element.tagName) && element.hasAttribute('href'))); 86378} 86379function getElAndScroll() { 86380 var element = null; 86381 if (hashFragment === '#') { 86382 // use document.body instead of document.documentElement because of a bug in smoothscroll-polyfill in safari 86383 // see https://github.com/iamdustan/smoothscroll/issues/138 86384 // while smoothscroll-polyfill is not included, it is the recommended way to implement smoothscroll 86385 // in browsers that don't natively support el.scrollIntoView({ behavior: 'smooth' }) 86386 element = document.body; 86387 } 86388 else { 86389 // check for element with matching id before assume '#top' is the top of the document 86390 // see https://html.spec.whatwg.org/multipage/browsing-the-web.html#target-element 86391 var id = hashFragment.replace('#', ''); 86392 element = document.getElementById(id); 86393 if (element === null && hashFragment === '#top') { 86394 // see above comment for why document.body instead of document.documentElement 86395 element = document.body; 86396 } 86397 } 86398 if (element !== null) { 86399 scrollFunction(element); 86400 // update focus to where the page is scrolled to 86401 // unfortunately this doesn't work in safari (desktop and iOS) when blur() is called 86402 var originalTabIndex = element.getAttribute('tabindex'); 86403 if (originalTabIndex === null && !isInteractiveElement(element)) { 86404 element.setAttribute('tabindex', -1); 86405 } 86406 element.focus({ preventScroll: true });
86407 if (originalTabIndex === null && !isInteractiveElement(element)) { 86408 // for some reason calling blur() in safari resets the focus region to where it was previously, 86409 // if blur() is not called it works in safari, but then are stuck with default focus styles 86410 // on an element that otherwise might never had focus styles applied, so not an option 86411 element.blur(); 86412 element.removeAttribute('tabindex'); 86413 } 86414 reset(); 86415 return true; 86416 } 86417 return false; 86418} 86419function hashLinkScroll(timeout) { 86420 // Push onto callback queue so it runs after the DOM is updated 86421 window.setTimeout(function () { 86422 if (getElAndScroll() === false) { 86423 if (observer === null) { 86424 observer = new MutationObserver(getElAndScroll); 86425 } 86426 observer.observe(document, { 86427 attributes: true, 86428 childList: true, 86429 subtree: true, 86430 }); 86431 // if the element doesn't show up in specified timeout or 10 seconds, stop checking 86432 asyncTimerId = window.setTimeout(function () { 86433 reset(); 86434 }, timeout || 10000); 86435 } 86436 }, 0); 86437} 86438function genericHashLink(As) { 86439 return react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function (props, ref) { 86440 var linkHash = ''; 86441 if (typeof props.to === 'string' && props.to.includes('#')) { 86442 linkHash = "#" + props.to.split('#').slice(1).join('#'); 86443 } 86444 else if (typeof props.to === 'object' && 86445 typeof props.to.hash === 'string') { 86446 linkHash = props.to.hash; 86447 } 86448 var passDownProps = {}; 86449 if (As === react_router_dom__WEBPACK_IMPORTED_MODULE_1__/* .NavLink */ .k2) { 86450 passDownProps.isActive = function (match, location) { 86451 return match && match.isExact && location.hash === linkHash; 86452 }; 86453 } 86454 function handleClick(e) { 86455 reset(); 86456 hashFragment = props.elementId ? "#" + props.elementId : linkHash; 86457 if (props.onClick) 86458 props.onClick(e); 86459 if (hashFragment !== '' && 86460 // ignore non-vanilla click events, same as react-router 86461 // below logic adapted from react-router: https://github.com/ReactTraining/react-router/blob/fc91700e08df8147bd2bb1be19a299cbb14dbcaa/packages/react-router-dom/modules/Link.js#L43-L48 86462 !e.defaultPrevented && // onClick prevented default 86463 e.button === 0 && // ignore everything but left clicks 86464 (!props.target || props.target === '_self') && // let browser handle "target=_blank" etc 86465 !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) // ignore clicks with modifier keys 86466 ) { 86467 scrollFunction = 86468 props.scroll || 86469 (function (el) { 86470 return props.smooth 86471 ? el.scrollIntoView({ behavior: 'smooth' }) 86472 : el.scrollIntoView(); 86473 }); 86474 hashLinkScroll(props.timeout); 86475 } 86476 } 86477 var filteredProps = __rest(props, ["scroll", "smooth", "timeout", "elementId"]); 86478 return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(As, __assign({}, passDownProps, filteredProps, { onClick: handleClick, ref: ref }), props.children)); 86479 }); 86480} 86481var HashLink = genericHashLink(react_router_dom__WEBPACK_IMPORTED_MODULE_1__/* .Link */ .N_); 86482var NavHashLink = genericHashLink(react_router_dom__WEBPACK_IMPORTED_MODULE_1__/* .NavLink */ .k2); 86483if (false) // removed by dead control flow 86484{ var propTypes; } 86485 86486 86487//# sourceMappingURL=react-router-hash-link.esm.js.map 86488 86489 86490/***/ }, 86491 86492/***/ 15287 86493(__unused_webpack_module, exports) { 86494 86495"use strict"; 86496/** 86497 * @license React 86498 * react.production.min.js 86499 * 86500 * Copyright (c) Facebook, Inc. and its affiliates. 86501 * 86502 * This source code is licensed under the MIT license found in the 86503 * LICENSE file in the root directory of this source tree. 86504 */ 86505var l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){if(null===a||"object"!==typeof a)return null;a=z&&a[z]||a["@@iterator"];return"function"===typeof a?a:null} 86506var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={}; 86507E.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F; 86508H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0}; 86509function M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}} 86510function N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}
vendor: 9,400 bytes, lines 86510-86718
86510function O(a){return"object"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g;function Q(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)} 86511function R(a,b,e,d,c){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=""===d?"."+Q(h,0):d,I(c)?(e="",null!=a&&(e=a.replace(P,"$&/")+"/"),R(c,b,e,"",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;h=0;d=""===d?".":d+":";if(I(a))for(var g=0;g<a.length;g++){k= 86512a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if("object"===k)throw b=String(a),Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h} 86513function S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,"","",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;} 86514var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};function X(){throw Error("act(...) is not supported in production builds of React.");} 86515exports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};exports.Component=E;exports.Fragment=p;exports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w; 86516exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;exports.act=X; 86517exports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f); 86518for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}}; 86519exports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=X;exports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)}; 86520exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};exports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)}; 86521exports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};exports.useTransition=function(){return U.current.useTransition()};exports.version="18.3.1"; 86522 86523 86524/***/ }, 86525 86526/***/ 96540 86527(module, __unused_webpack_exports, __webpack_require__) { 86528 86529"use strict"; 86530 86531 86532if (true) { 86533 module.exports = __webpack_require__(15287); 86534} else // removed by dead control flow 86535{} 86536 86537 86538/***/ }, 86539 86540/***/ 27701 86541(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 86542 86543"use strict"; 86544 86545// EXPORTS 86546__webpack_require__.d(__webpack_exports__, { 86547 Kp: () => (/* reexport */ END), 86548 Ay: () => (/* binding */ redux_saga_core_npm_proxy_esm), 86549 Od: () => (/* reexport */ eventChannel) 86550}); 86551 86552// UNUSED EXPORTS: CANCEL, SAGA_LOCATION, buffers, channel, detach, isEnd, multicastChannel, runSaga, stdChannel 86553 86554// EXTERNAL MODULE: ./node_modules/@redux-saga/symbols/dist/redux-saga-symbols.esm.js 86555var redux_saga_symbols_esm = __webpack_require__(63821); 86556// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 86557var esm_extends = __webpack_require__(55285); 86558// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js 86559var objectWithoutPropertiesLoose = __webpack_require__(40644); 86560// EXTERNAL MODULE: ./node_modules/@redux-saga/is/dist/redux-saga-is.esm.js 86561var redux_saga_is_esm = __webpack_require__(21225); 86562// EXTERNAL MODULE: ./node_modules/@redux-saga/core/dist/io-22ea0cf9.js 86563var io_22ea0cf9 = __webpack_require__(28424); 86564;// ./node_modules/@redux-saga/deferred/dist/redux-saga-deferred.esm.js 86565function deferred() { 86566 var def = {}; 86567 def.promise = new Promise(function (resolve, reject) { 86568 def.resolve = resolve; 86569 def.reject = reject; 86570 }); 86571 return def; 86572} 86573function arrayOfDeferred(length) { 86574 var arr = []; 86575 86576 for (var i = 0; i < length; i++) { 86577 arr.push(deferred()); 86578 } 86579 86580 return arr; 86581} 86582 86583/* harmony default export */ const redux_saga_deferred_esm = (deferred); 86584 86585 86586;// ./node_modules/@redux-saga/core/dist/redux-saga-core.esm.js 86587 86588 86589 86590 86591 86592 86593 86594 86595 86596 86597var queue = []; 86598/** 86599 Variable to hold a counting semaphore 86600 - Incrementing adds a lock and puts the scheduler in a `suspended` state (if it's not 86601 already suspended) 86602 - Decrementing releases a lock. Zero locks puts the scheduler in a `released` state. This 86603 triggers flushing the queued tasks. 86604**/ 86605 86606var semaphore = 0; 86607/** 86608 Executes a task 'atomically'. Tasks scheduled during this execution will be queued 86609 and flushed after this task has finished (assuming the scheduler endup in a released 86610 state). 86611**/ 86612 86613function exec(task) { 86614 try { 86615 suspend(); 86616 task(); 86617 } finally { 86618 release(); 86619 } 86620} 86621/** 86622 Executes or queues a task depending on the state of the scheduler (`suspended` or `released`) 86623**/ 86624 86625 86626function asap(task) { 86627 queue.push(task); 86628 86629 if (!semaphore) { 86630 suspend(); 86631 flush(); 86632 } 86633} 86634/** 86635 * Puts the scheduler in a `suspended` state and executes a task immediately. 86636 */ 86637 86638function immediately(task) { 86639 try { 86640 suspend(); 86641 return task(); 86642 } finally { 86643 flush(); 86644 } 86645} 86646/** 86647 Puts the scheduler in a `suspended` state. Scheduled tasks will be queued until the 86648 scheduler is released. 86649**/ 86650 86651function suspend() { 86652 semaphore++; 86653} 86654/** 86655 Puts the scheduler in a `released` state. 86656**/ 86657 86658 86659function release() { 86660 semaphore--; 86661} 86662/** 86663 Releases the current lock. Executes all queued tasks if the scheduler is in the released state. 86664**/ 86665 86666 86667function flush() { 86668 release(); 86669 var task; 86670 86671 while (!semaphore && (task = queue.shift()) !== undefined) { 86672 exec(task); 86673 } 86674} 86675 86676var array = function array(patterns) { 86677 return function (input) { 86678 return patterns.some(function (p) { 86679 return matcher(p)(input); 86680 }); 86681 }; 86682}; 86683var predicate = function predicate(_predicate) { 86684 return function (input) { 86685 return _predicate(input); 86686 }; 86687}; 86688var string = function string(pattern) { 86689 return function (input) { 86690 return input.type === String(pattern); 86691 }; 86692}; 86693var symbol = function symbol(pattern) { 86694 return function (input) { 86695 return input.type === pattern; 86696 }; 86697}; 86698var wildcard = function wildcard() { 86699 return io_22ea0cf9.k; 86700}; 86701function matcher(pattern) { 86702 // prettier-ignore 86703 var matcherCreator = pattern === '*' ? wildcard : (0,redux_saga_is_esm/* string */.Yj)(pattern) ? string : (0,redux_saga_is_esm/* array */.YO)(pattern) ? array : (0,redux_saga_is_esm/* stringableFunc */.mr)(pattern) ? string : (0,redux_saga_is_esm/* func */.Pc)(pattern) ? predicate : (0,redux_saga_is_esm/* symbol */.HR)(pattern) ? symbol : null; 86704 86705 if (matcherCreator === null) { 86706 throw new Error("invalid pattern: " + pattern); 86707 } 86708 86709 return matcherCreator(pattern); 86710} 86711 86712var END = { 86713 type: redux_saga_symbols_esm/* CHANNEL_END_TYPE */.x7 86714}; 86715var isEnd = function isEnd(a) { 86716 return a && a.type === redux_saga_symbols_esm/* CHANNEL_END_TYPE */.x7; 86717}; 86718var CLOSED_CHANNEL_WITH_TAKERS = 'Cannot have a closed channel with pending takers';
86719var INVALID_BUFFER = 'invalid buffer passed to channel factory function'; 86720var UNDEFINED_INPUT_ERROR = "Saga or channel was provided with an undefined action\nHints:\n - check that your Action Creator returns a non-undefined value\n - if the Saga was started using runSaga, check that your subscribe source provides the action to its listeners"; 86721function channel(buffer$1) { 86722 if (buffer$1 === void 0) { 86723 buffer$1 = (0,io_22ea0cf9.e)(); 86724 } 86725 86726 var closed = false; 86727 var takers = []; 86728 86729 if (false) // removed by dead control flow 86730{} 86731 86732 function checkForbiddenStates() { 86733 if (closed && takers.length) { 86734 throw (0,io_22ea0cf9.i)(CLOSED_CHANNEL_WITH_TAKERS); 86735 } 86736 86737 if (takers.length && !buffer$1.isEmpty()) { 86738 throw (0,io_22ea0cf9.i)('Cannot have pending takers with non empty buffer'); 86739 } 86740 } 86741 86742 function put(input) { 86743 if (false) // removed by dead control flow 86744{} 86745 86746 if (closed) { 86747 return; 86748 } 86749 86750 if (takers.length === 0) { 86751 return buffer$1.put(input); 86752 } 86753 86754 var cb = takers.shift(); 86755 cb(input); 86756 } 86757 86758 function take(cb) { 86759 if (false) // removed by dead control flow 86760{} 86761 86762 if (closed && buffer$1.isEmpty()) { 86763 cb(END); 86764 } else if (!buffer$1.isEmpty()) { 86765 cb(buffer$1.take()); 86766 } else { 86767 takers.push(cb); 86768 86769 cb.cancel = function () { 86770 (0,io_22ea0cf9.r)(takers, cb); 86771 }; 86772 } 86773 } 86774 86775 function flush(cb) { 86776 if (false) // removed by dead control flow 86777{} 86778 86779 if (closed && buffer$1.isEmpty()) { 86780 cb(END); 86781 return; 86782 } 86783 86784 cb(buffer$1.flush()); 86785 } 86786 86787 function close() { 86788 if (false) // removed by dead control flow 86789{} 86790 86791 if (closed) { 86792 return; 86793 } 86794 86795 closed = true; 86796 var arr = takers; 86797 takers = []; 86798 86799 for (var i = 0, len = arr.length; i < len; i++) { 86800 var taker = arr[i]; 86801 taker(END); 86802 } 86803 } 86804 86805 return { 86806 take: take, 86807 put: put, 86808 flush: flush, 86809 close: close 86810 }; 86811} 86812function eventChannel(subscribe, buffer) { 86813 if (buffer === void 0) { 86814 buffer = (0,io_22ea0cf9.n)(); 86815 } 86816 86817 var closed = false; 86818 var unsubscribe; 86819 var chan = channel(buffer); 86820 86821 var close = function close() { 86822 if (closed) { 86823 return; 86824 } 86825 86826 closed = true; 86827 86828 if ((0,redux_saga_is_esm/* func */.Pc)(unsubscribe)) { 86829 unsubscribe(); 86830 } 86831 86832 chan.close(); 86833 }; 86834 86835 unsubscribe = subscribe(function (input) { 86836 if (isEnd(input)) { 86837 close(); 86838 return; 86839 } 86840 86841 chan.put(input); 86842 }); 86843 86844 if (false) // removed by dead control flow 86845{} 86846 86847 unsubscribe = (0,io_22ea0cf9.o)(unsubscribe); 86848 86849 if (closed) { 86850 unsubscribe(); 86851 } 86852 86853 return { 86854 take: chan.take, 86855 flush: chan.flush, 86856 close: close 86857 }; 86858} 86859function multicastChannel() { 86860 var _ref; 86861 86862 var closed = false; 86863 var currentTakers = []; 86864 var nextTakers = currentTakers; 86865 86866 function checkForbiddenStates() { 86867 if (closed && nextTakers.length) { 86868 throw (0,io_22ea0cf9.i)(CLOSED_CHANNEL_WITH_TAKERS); 86869 } 86870 } 86871 86872 var ensureCanMutateNextTakers = function ensureCanMutateNextTakers() { 86873 if (nextTakers !== currentTakers) { 86874 return; 86875 } 86876 86877 nextTakers = currentTakers.slice(); 86878 }; 86879 86880 var close = function close() { 86881 if (false) // removed by dead control flow 86882{} 86883 86884 closed = true; 86885 var takers = currentTakers = nextTakers; 86886 nextTakers = []; 86887 takers.forEach(function (taker) { 86888 taker(END); 86889 }); 86890 }; 86891 86892 return _ref = {}, _ref[redux_saga_symbols_esm/* MULTICAST */.Xl] = true, _ref.put = function put(input) { 86893 if (false) // removed by dead control flow 86894{} 86895 86896 if (closed) { 86897 return; 86898 } 86899 86900 if (isEnd(input)) { 86901 close(); 86902 return; 86903 } 86904 86905 var takers = currentTakers = nextTakers; 86906 86907 for (var i = 0, len = takers.length; i < len; i++) { 86908 var taker = takers[i]; 86909 86910 if (taker[redux_saga_symbols_esm/* MATCH */.E_](input)) { 86911 taker.cancel(); 86912 taker(input); 86913 } 86914 } 86915 }, _ref.take = function take(cb, matcher) { 86916 if (matcher === void 0) { 86917 matcher = wildcard; 86918 } 86919 86920 if (false) // removed by dead control flow 86921{} 86922 86923 if (closed) { 86924 cb(END); 86925 return; 86926 } 86927 86928 cb[redux_saga_symbols_esm/* MATCH */.E_] = matcher; 86929 ensureCanMutateNextTakers(); 86930 nextTakers.push(cb); 86931 cb.cancel = (0,io_22ea0cf9.o)(function () { 86932 ensureCanMutateNextTakers(); 86933 (0,io_22ea0cf9.r)(nextTakers, cb); 86934 }); 86935 }, _ref.close = close, _ref; 86936}
86937function stdChannel() { 86938 var chan = multicastChannel(); 86939 var put = chan.put; 86940 86941 chan.put = function (input) { 86942 if (input[redux_saga_symbols_esm/* SAGA_ACTION */.q8]) { 86943 put(input); 86944 return; 86945 } 86946 86947 asap(function () { 86948 put(input); 86949 }); 86950 }; 86951 86952 return chan; 86953} 86954 86955var RUNNING = 0; 86956var CANCELLED = 1; 86957var ABORTED = 2; 86958var DONE = 3; 86959 86960function resolvePromise(promise, cb) { 86961 var cancelPromise = promise[redux_saga_symbols_esm/* CANCEL */.bO]; 86962 86963 if ((0,redux_saga_is_esm/* func */.Pc)(cancelPromise)) { 86964 cb.cancel = cancelPromise; 86965 } 86966 86967 promise.then(cb, function (error) { 86968 cb(error, true); 86969 }); 86970} 86971 86972var current = 0; 86973var nextSagaId = (function () { 86974 return ++current; 86975}); 86976 86977var _effectRunnerMap; 86978 86979function getIteratorMetaInfo(iterator, fn) { 86980 if (iterator.isSagaIterator) { 86981 return { 86982 name: iterator.meta.name 86983 }; 86984 } 86985 86986 return (0,io_22ea0cf9.j)(fn); 86987} 86988 86989function createTaskIterator(_ref) { 86990 var context = _ref.context, 86991 fn = _ref.fn, 86992 args = _ref.args; 86993 86994 // catch synchronous failures; see #152 and #441 86995 try { 86996 var result = fn.apply(context, args); // i.e. a generator function returns an iterator 86997 86998 if ((0,redux_saga_is_esm/* iterator */.lJ)(result)) { 86999 return result; 87000 } 87001 87002 var resolved = false; 87003 87004 var next = function next(arg) { 87005 if (!resolved) { 87006 resolved = true; // Only promises returned from fork will be interpreted. See #1573 87007 87008 return { 87009 value: result, 87010 done: !(0,redux_saga_is_esm/* promise */.iv)(result) 87011 }; 87012 } else { 87013 return { 87014 value: arg, 87015 done: true 87016 }; 87017 } 87018 }; 87019 87020 return (0,io_22ea0cf9.q)(next); 87021 } catch (err) { 87022 // do not bubble up synchronous failures for detached forks 87023 // instead create a failed task. See #152 and #441 87024 return (0,io_22ea0cf9.q)(function () { 87025 throw err; 87026 }); 87027 } 87028} 87029 87030function runPutEffect(env, _ref2, cb) { 87031 var channel = _ref2.channel, 87032 action = _ref2.action, 87033 resolve = _ref2.resolve; 87034 87035 /** 87036 Schedule the put in case another saga is holding a lock. 87037 The put will be executed atomically. ie nested puts will execute after 87038 this put has terminated. 87039 **/ 87040 asap(function () { 87041 var result; 87042 87043 try { 87044 result = (channel ? channel.put : env.dispatch)(action); 87045 } catch (error) { 87046 cb(error, true); 87047 return; 87048 } 87049 87050 if (resolve && (0,redux_saga_is_esm/* promise */.iv)(result)) { 87051 resolvePromise(result, cb); 87052 } else { 87053 cb(result); 87054 } 87055 }); // Put effects are non cancellables 87056} 87057 87058function runTakeEffect(env, _ref3, cb) { 87059 var _ref3$channel = _ref3.channel, 87060 channel = _ref3$channel === void 0 ? env.channel : _ref3$channel, 87061 pattern = _ref3.pattern, 87062 maybe = _ref3.maybe; 87063 87064 var takeCb = function takeCb(input) { 87065 if (input instanceof Error) { 87066 cb(input, true); 87067 return; 87068 } 87069 87070 if (isEnd(input) && !maybe) { 87071 cb(redux_saga_symbols_esm/* TERMINATE */.a6); 87072 return; 87073 } 87074 87075 cb(input); 87076 }; 87077 87078 try { 87079 channel.take(takeCb, (0,redux_saga_is_esm/* notUndef */.uQ)(pattern) ? matcher(pattern) : null); 87080 } catch (err) { 87081 cb(err, true); 87082 return; 87083 } 87084 87085 cb.cancel = takeCb.cancel; 87086} 87087 87088function runCallEffect(env, _ref4, cb, _ref5) { 87089 var context = _ref4.context, 87090 fn = _ref4.fn, 87091 args = _ref4.args; 87092 var task = _ref5.task; 87093 87094 // catch synchronous failures; see #152 87095 try { 87096 var result = fn.apply(context, args); 87097 87098 if ((0,redux_saga_is_esm/* promise */.iv)(result)) { 87099 resolvePromise(result, cb); 87100 return; 87101 } 87102 87103 if ((0,redux_saga_is_esm/* iterator */.lJ)(result)) { 87104 // resolve iterator 87105 proc(env, result, task.context, current, (0,io_22ea0cf9.j)(fn), 87106 /* isRoot */ 87107 false, cb); 87108 return; 87109 } 87110 87111 cb(result); 87112 } catch (error) { 87113 cb(error, true); 87114 } 87115} 87116 87117function runCPSEffect(env, _ref6, cb) { 87118 var context = _ref6.context, 87119 fn = _ref6.fn, 87120 args = _ref6.args; 87121 87122 // CPS (ie node style functions) can define their own cancellation logic 87123 // by setting cancel field on the cb 87124 // catch synchronous failures; see #152 87125 try { 87126 var cpsCb = function cpsCb(err, res) { 87127 if ((0,redux_saga_is_esm/* undef */.vD)(err)) { 87128 cb(res); 87129 } else { 87130 cb(err, true); 87131 } 87132 }; 87133 87134 fn.apply(context, args.concat(cpsCb)); 87135 87136 if (cpsCb.cancel) { 87137 cb.cancel = cpsCb.cancel; 87138 } 87139 } catch (error) { 87140 cb(error, true); 87141 } 87142} 87143 87144function runForkEffect(env, _ref7, cb, _ref8) { 87145 var context = _ref7.context, 87146 fn = _ref7.fn, 87147 args = _ref7.args, 87148 detached = _ref7.detached; 87149 var parent = _ref8.task; 87150 var taskIterator = createTaskIterator({ 87151 context: context, 87152 fn: fn, 87153 args: args 87154 }); 87155 var meta = getIteratorMetaInfo(taskIterator, fn); 87156 immediately(function () { 87157 var child = proc(env, taskIterator, parent.context, current, meta, detached, undefined); 87158 87159 if (detached) { 87160 cb(child); 87161 } else { 87162 if (child.isRunning()) { 87163 parent.queue.addTask(child); 87164 cb(child); 87165 } else if (child.isAborted()) { 87166 parent.queue.abort(child.error()); 87167 } else { 87168 cb(child); 87169 } 87170 } 87171 }); // Fork effects are non cancellables 87172} 87173 87174function runJoinEffect(env, taskOrTasks, cb, _ref9) { 87175 var task = _ref9.task; 87176 87177 var joinSingleTask = function joinSingleTask(taskToJoin, cb) { 87178 if (taskToJoin.isRunning()) { 87179 var joiner = { 87180 task: task, 87181 cb: cb
87182 }; 87183 87184 cb.cancel = function () { 87185 if (taskToJoin.isRunning()) (0,io_22ea0cf9.r)(taskToJoin.joiners, joiner); 87186 }; 87187 87188 taskToJoin.joiners.push(joiner); 87189 } else { 87190 if (taskToJoin.isAborted()) { 87191 cb(taskToJoin.error(), true); 87192 } else { 87193 cb(taskToJoin.result()); 87194 } 87195 } 87196 }; 87197 87198 if ((0,redux_saga_is_esm/* array */.YO)(taskOrTasks)) { 87199 if (taskOrTasks.length === 0) { 87200 cb([]); 87201 return; 87202 } 87203 87204 var childCallbacks = (0,io_22ea0cf9.l)(taskOrTasks, cb); 87205 taskOrTasks.forEach(function (t, i) { 87206 joinSingleTask(t, childCallbacks[i]); 87207 }); 87208 } else { 87209 joinSingleTask(taskOrTasks, cb); 87210 } 87211} 87212 87213function cancelSingleTask(taskToCancel) { 87214 if (taskToCancel.isRunning()) { 87215 taskToCancel.cancel(); 87216 } 87217} 87218 87219function runCancelEffect(env, taskOrTasks, cb, _ref10) { 87220 var task = _ref10.task; 87221 87222 if (taskOrTasks === redux_saga_symbols_esm/* SELF_CANCELLATION */.Pe) { 87223 cancelSingleTask(task); 87224 } else if ((0,redux_saga_is_esm/* array */.YO)(taskOrTasks)) { 87225 taskOrTasks.forEach(cancelSingleTask); 87226 } else { 87227 cancelSingleTask(taskOrTasks); 87228 } 87229 87230 cb(); // cancel effects are non cancellables 87231} 87232 87233function runAllEffect(env, effects, cb, _ref11) { 87234 var digestEffect = _ref11.digestEffect; 87235 var effectId = current; 87236 var keys = Object.keys(effects); 87237 87238 if (keys.length === 0) { 87239 cb((0,redux_saga_is_esm/* array */.YO)(effects) ? [] : {}); 87240 return; 87241 } 87242 87243 var childCallbacks = (0,io_22ea0cf9.l)(effects, cb); 87244 keys.forEach(function (key) { 87245 digestEffect(effects[key], effectId, childCallbacks[key], key); 87246 }); 87247} 87248 87249function runRaceEffect(env, effects, cb, _ref12) { 87250 var digestEffect = _ref12.digestEffect; 87251 var effectId = current; 87252 var keys = Object.keys(effects); 87253 var response = (0,redux_saga_is_esm/* array */.YO)(effects) ? (0,io_22ea0cf9.m)(keys.length) : {}; 87254 var childCbs = {}; 87255 var completed = false; 87256 keys.forEach(function (key) { 87257 var chCbAtKey = function chCbAtKey(res, isErr) { 87258 if (completed) { 87259 return; 87260 } 87261 87262 if (isErr || (0,io_22ea0cf9.s)(res)) { 87263 // Race Auto cancellation 87264 cb.cancel(); 87265 cb(res, isErr); 87266 } else { 87267 cb.cancel(); 87268 completed = true; 87269 response[key] = res; 87270 cb(response); 87271 } 87272 }; 87273 87274 chCbAtKey.cancel = io_22ea0cf9.t; 87275 childCbs[key] = chCbAtKey; 87276 }); 87277 87278 cb.cancel = function () { 87279 // prevents unnecessary cancellation 87280 if (!completed) { 87281 completed = true; 87282 keys.forEach(function (key) { 87283 return childCbs[key].cancel(); 87284 }); 87285 } 87286 }; 87287 87288 keys.forEach(function (key) { 87289 if (completed) { 87290 return; 87291 } 87292 87293 digestEffect(effects[key], effectId, childCbs[key], key); 87294 }); 87295} 87296 87297function runSelectEffect(env, _ref13, cb) { 87298 var selector = _ref13.selector, 87299 args = _ref13.args; 87300 87301 try { 87302 var state = selector.apply(void 0, [env.getState()].concat(args)); 87303 cb(state); 87304 } catch (error) { 87305 cb(error, true); 87306 } 87307} 87308 87309function runChannelEffect(env, _ref14, cb) { 87310 var pattern = _ref14.pattern, 87311 buffer = _ref14.buffer; 87312 var chan = channel(buffer); 87313 var match = matcher(pattern); 87314 87315 var taker = function taker(action) { 87316 if (!isEnd(action)) { 87317 env.channel.take(taker, match); 87318 } 87319 87320 chan.put(action); 87321 }; 87322 87323 var close = chan.close; 87324 87325 chan.close = function () { 87326 taker.cancel(); 87327 close(); 87328 }; 87329 87330 env.channel.take(taker, match); 87331 cb(chan); 87332} 87333 87334function runCancelledEffect(env, data, cb, _ref15) { 87335 var task = _ref15.task; 87336 cb(task.isCancelled()); 87337} 87338 87339function runFlushEffect(env, channel, cb) { 87340 channel.flush(cb); 87341} 87342 87343function runGetContextEffect(env, prop, cb, _ref16) { 87344 var task = _ref16.task; 87345 cb(task.context[prop]); 87346} 87347 87348function runSetContextEffect(env, props, cb, _ref17) { 87349 var task = _ref17.task; 87350 (0,io_22ea0cf9.p)(task.context, props); 87351 cb(); 87352} 87353 87354var effectRunnerMap = (_effectRunnerMap = {}, _effectRunnerMap[io_22ea0cf9.T] = runTakeEffect, _effectRunnerMap[io_22ea0cf9.P] = runPutEffect, _effectRunnerMap[io_22ea0cf9.A] = runAllEffect, _effectRunnerMap[io_22ea0cf9.R] = runRaceEffect, _effectRunnerMap[io_22ea0cf9.C] = runCallEffect, _effectRunnerMap[io_22ea0cf9.a] = runCPSEffect, _effectRunnerMap[io_22ea0cf9.F] = runForkEffect, _effectRunnerMap[io_22ea0cf9.J] = runJoinEffect, _effectRunnerMap[io_22ea0cf9.b] = runCancelEffect, _effectRunnerMap[io_22ea0cf9.S] = runSelectEffect, _effectRunnerMap[io_22ea0cf9.d] = runChannelEffect, _effectRunnerMap[io_22ea0cf9.f] = runCancelledEffect, _effectRunnerMap[io_22ea0cf9.g] = runFlushEffect, _effectRunnerMap[io_22ea0cf9.G] = runGetContextEffect, _effectRunnerMap[io_22ea0cf9.h] = runSetContextEffect, _effectRunnerMap); 87355 87356/** 87357 Used to track a parent task and its forks 87358 In the fork model, forked tasks are attached by default to their parent 87359 We model this using the concept of Parent task && main Task 87360 main task is the main flow of the current Generator, the parent tasks is the 87361 aggregation of the main tasks + all its forked tasks. 87362 Thus the whole model represents an execution tree with multiple branches (vs the 87363 linear execution tree in sequential (non parallel) programming) 87364 87365 A parent tasks has the following semantics 87366 - It completes if all its forks either complete or all cancelled 87367 - If it's cancelled, all forks are cancelled as well 87368 - It aborts if any uncaught error bubbles up from forks 87369 - If it completes, the return value is the one returned by the main task 87370 **/ 87371 87372function forkQueue(mainTask, onAbort, cont) { 87373 var tasks = []; 87374 var result; 87375 var completed = false;
87376 addTask(mainTask); 87377 87378 var getTasks = function getTasks() { 87379 return tasks; 87380 }; 87381 87382 function abort(err) { 87383 onAbort(); 87384 cancelAll(); 87385 cont(err, true); 87386 } 87387 87388 function addTask(task) { 87389 tasks.push(task); 87390 87391 task.cont = function (res, isErr) { 87392 if (completed) { 87393 return; 87394 } 87395 87396 (0,io_22ea0cf9.r)(tasks, task); 87397 task.cont = io_22ea0cf9.t; 87398 87399 if (isErr) { 87400 abort(res); 87401 } else { 87402 if (task === mainTask) { 87403 result = res; 87404 } 87405 87406 if (!tasks.length) { 87407 completed = true; 87408 cont(result); 87409 } 87410 } 87411 }; 87412 } 87413 87414 function cancelAll() { 87415 if (completed) { 87416 return; 87417 } 87418 87419 completed = true; 87420 tasks.forEach(function (t) { 87421 t.cont = io_22ea0cf9.t; 87422 t.cancel(); 87423 }); 87424 tasks = []; 87425 } 87426 87427 return { 87428 addTask: addTask, 87429 cancelAll: cancelAll, 87430 abort: abort, 87431 getTasks: getTasks 87432 }; 87433} 87434 87435// there can be only a single saga error created at any given moment 87436 87437function formatLocation(fileName, lineNumber) { 87438 return fileName + "?" + lineNumber; 87439} 87440 87441function effectLocationAsString(effect) { 87442 var location = (0,io_22ea0cf9.v)(effect); 87443 87444 if (location) { 87445 var code = location.code, 87446 fileName = location.fileName, 87447 lineNumber = location.lineNumber; 87448 var source = code + " " + formatLocation(fileName, lineNumber); 87449 return source; 87450 } 87451 87452 return ''; 87453} 87454 87455function sagaLocationAsString(sagaMeta) { 87456 var name = sagaMeta.name, 87457 location = sagaMeta.location; 87458 87459 if (location) { 87460 return name + " " + formatLocation(location.fileName, location.lineNumber); 87461 } 87462 87463 return name; 87464} 87465 87466function cancelledTasksAsString(sagaStack) { 87467 var cancelledTasks = (0,io_22ea0cf9.u)(function (i) { 87468 return i.cancelledTasks; 87469 }, sagaStack); 87470 87471 if (!cancelledTasks.length) { 87472 return ''; 87473 } 87474 87475 return ['Tasks cancelled due to error:'].concat(cancelledTasks).join('\n'); 87476} 87477 87478var crashedEffect = null; 87479var sagaStack = []; 87480var addSagaFrame = function addSagaFrame(frame) { 87481 frame.crashedEffect = crashedEffect; 87482 sagaStack.push(frame); 87483}; 87484var clear = function clear() { 87485 crashedEffect = null; 87486 sagaStack.length = 0; 87487}; // this sets crashed effect for the soon-to-be-reported saga frame 87488// this slightly streatches the singleton nature of this module into wrong direction 87489// as it's even less obvious what's the data flow here, but it is what it is for now 87490 87491var setCrashedEffect = function setCrashedEffect(effect) { 87492 crashedEffect = effect; 87493}; 87494/** 87495 @returns {string} 87496 87497 @example 87498 The above error occurred in task errorInPutSaga {pathToFile} 87499 when executing effect put({type: 'REDUCER_ACTION_ERROR_IN_PUT'}) {pathToFile} 87500 created by fetchSaga {pathToFile} 87501 created by rootSaga {pathToFile} 87502*/ 87503 87504var redux_saga_core_esm_toString = function toString() { 87505 var firstSaga = sagaStack[0], 87506 otherSagas = sagaStack.slice(1); 87507 var crashedEffectLocation = firstSaga.crashedEffect ? effectLocationAsString(firstSaga.crashedEffect) : null; 87508 var errorMessage = "The above error occurred in task " + sagaLocationAsString(firstSaga.meta) + (crashedEffectLocation ? " \n when executing effect " + crashedEffectLocation : ''); 87509 return [errorMessage].concat(otherSagas.map(function (s) { 87510 return " created by " + sagaLocationAsString(s.meta); 87511 }), [cancelledTasksAsString(sagaStack)]).join('\n'); 87512}; 87513 87514function newTask(env, mainTask, parentContext, parentEffectId, meta, isRoot, cont) { 87515 var _task; 87516 87517 if (cont === void 0) { 87518 cont = io_22ea0cf9.t; 87519 } 87520 87521 var status = RUNNING; 87522 var taskResult; 87523 var taskError; 87524 var deferredEnd = null; 87525 var cancelledDueToErrorTasks = []; 87526 var context = Object.create(parentContext); 87527 var queue = forkQueue(mainTask, function onAbort() { 87528 cancelledDueToErrorTasks.push.apply(cancelledDueToErrorTasks, queue.getTasks().map(function (t) { 87529 return t.meta.name; 87530 })); 87531 }, end); 87532 /** 87533 This may be called by a parent generator to trigger/propagate cancellation 87534 cancel all pending tasks (including the main task), then end the current task. 87535 Cancellation propagates down to the whole execution tree held by this Parent task 87536 It's also propagated to all joiners of this task and their execution tree/joiners 87537 Cancellation is noop for terminated/Cancelled tasks tasks 87538 **/ 87539 87540 function cancel() { 87541 if (status === RUNNING) { 87542 // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped 87543 // effects in the iterator's finally block will still be executed 87544 status = CANCELLED; 87545 queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners 87546 87547 end(redux_saga_symbols_esm/* TASK_CANCEL */.nm, false); 87548 } 87549 } 87550 87551 function end(result, isErr) { 87552 if (!isErr) { 87553 // The status here may be RUNNING or CANCELLED 87554 // If the status is CANCELLED, then we do not need to change it here 87555 if (result === redux_saga_symbols_esm/* TASK_CANCEL */.nm) { 87556 status = CANCELLED; 87557 } else if (status !== CANCELLED) { 87558 status = DONE; 87559 } 87560 87561 taskResult = result; 87562 deferredEnd && deferredEnd.resolve(result); 87563 } else { 87564 status = ABORTED; 87565 addSagaFrame({ 87566 meta: meta, 87567 cancelledTasks: cancelledDueToErrorTasks 87568 }); 87569 87570 if (task.isRoot) { 87571 var sagaStack = redux_saga_core_esm_toString(); // we've dumped the saga stack to string and are passing it to user's code 87572 // we know that it won't be needed anymore and we need to clear it 87573 87574 clear(); 87575 env.onError(result, { 87576 sagaStack: sagaStack 87577 }); 87578 } 87579 87580 taskError = result; 87581 deferredEnd && deferredEnd.reject(result); 87582 } 87583 87584 task.cont(result, isErr);
87585 task.joiners.forEach(function (joiner) { 87586 joiner.cb(result, isErr); 87587 }); 87588 task.joiners = null; 87589 } 87590 87591 function setContext(props) { 87592 if (false) // removed by dead control flow 87593{} 87594 87595 (0,io_22ea0cf9.p)(context, props); 87596 } 87597 87598 function toPromise() { 87599 if (deferredEnd) { 87600 return deferredEnd.promise; 87601 } 87602 87603 deferredEnd = redux_saga_deferred_esm(); 87604 87605 if (status === ABORTED) { 87606 deferredEnd.reject(taskError); 87607 } else if (status !== RUNNING) { 87608 deferredEnd.resolve(taskResult); 87609 } 87610 87611 return deferredEnd.promise; 87612 } 87613 87614 var task = (_task = {}, _task[redux_saga_symbols_esm/* TASK */.wn] = true, _task.id = parentEffectId, _task.meta = meta, _task.isRoot = isRoot, _task.context = context, _task.joiners = [], _task.queue = queue, _task.cancel = cancel, _task.cont = cont, _task.end = end, _task.setContext = setContext, _task.toPromise = toPromise, _task.isRunning = function isRunning() { 87615 return status === RUNNING; 87616 }, _task.isCancelled = function isCancelled() { 87617 return status === CANCELLED || status === RUNNING && mainTask.status === CANCELLED; 87618 }, _task.isAborted = function isAborted() { 87619 return status === ABORTED; 87620 }, _task.result = function result() { 87621 return taskResult; 87622 }, _task.error = function error() { 87623 return taskError; 87624 }, _task); 87625 return task; 87626} 87627 87628function proc(env, iterator$1, parentContext, parentEffectId, meta, isRoot, cont) { 87629 if (false) // removed by dead control flow 87630{} 87631 87632 var finalRunEffect = env.finalizeRunEffect(runEffect); 87633 /** 87634 Tracks the current effect cancellation 87635 Each time the generator progresses. calling runEffect will set a new value 87636 on it. It allows propagating cancellation to child effects 87637 **/ 87638 87639 next.cancel = io_22ea0cf9.t; 87640 /** Creates a main task to track the main flow */ 87641 87642 var mainTask = { 87643 meta: meta, 87644 cancel: cancelMain, 87645 status: RUNNING 87646 }; 87647 /** 87648 Creates a new task descriptor for this generator. 87649 A task is the aggregation of it's mainTask and all it's forked tasks. 87650 **/ 87651 87652 var task = newTask(env, mainTask, parentContext, parentEffectId, meta, isRoot, cont); 87653 var executingContext = { 87654 task: task, 87655 digestEffect: digestEffect 87656 }; 87657 /** 87658 cancellation of the main task. We'll simply resume the Generator with a TASK_CANCEL 87659 **/ 87660 87661 function cancelMain() { 87662 if (mainTask.status === RUNNING) { 87663 mainTask.status = CANCELLED; 87664 next(redux_saga_symbols_esm/* TASK_CANCEL */.nm); 87665 } 87666 } 87667 /** 87668 attaches cancellation logic to this task's continuation 87669 this will permit cancellation to propagate down the call chain 87670 **/ 87671 87672 87673 if (cont) { 87674 cont.cancel = task.cancel; 87675 } // kicks up the generator 87676 87677 87678 next(); // then return the task descriptor to the caller 87679 87680 return task; 87681 /** 87682 * This is the generator driver 87683 * It's a recursive async/continuation function which calls itself 87684 * until the generator terminates or throws 87685 * @param {internal commands(TASK_CANCEL | TERMINATE) | any} arg - value, generator will be resumed with. 87686 * @param {boolean} isErr - the flag shows if effect finished with an error 87687 * 87688 * receives either (command | effect result, false) or (any thrown thing, true) 87689 */ 87690 87691 function next(arg, isErr) { 87692 try { 87693 var result; 87694 87695 if (isErr) { 87696 result = iterator$1.throw(arg); // user handled the error, we can clear bookkept values 87697 87698 clear(); 87699 } else if ((0,io_22ea0cf9.y)(arg)) { 87700 /** 87701 getting TASK_CANCEL automatically cancels the main task 87702 We can get this value here 87703 - By cancelling the parent task manually 87704 - By joining a Cancelled task 87705 **/ 87706 mainTask.status = CANCELLED; 87707 /** 87708 Cancels the current effect; this will propagate the cancellation down to any called tasks 87709 **/ 87710 87711 next.cancel(); 87712 /** 87713 If this Generator has a `return` method then invokes it 87714 This will jump to the finally block 87715 **/ 87716 87717 result = (0,redux_saga_is_esm/* func */.Pc)(iterator$1.return) ? iterator$1.return(redux_saga_symbols_esm/* TASK_CANCEL */.nm) : { 87718 done: true, 87719 value: redux_saga_symbols_esm/* TASK_CANCEL */.nm 87720 }; 87721 } else if ((0,io_22ea0cf9.z)(arg)) { 87722 // We get TERMINATE flag, i.e. by taking from a channel that ended using `take` (and not `takem` used to trap End of channels) 87723 result = (0,redux_saga_is_esm/* func */.Pc)(iterator$1.return) ? iterator$1.return() : { 87724 done: true 87725 }; 87726 } else { 87727 result = iterator$1.next(arg); 87728 } 87729 87730 if (!result.done) { 87731 digestEffect(result.value, parentEffectId, next); 87732 } else { 87733 /** 87734 This Generator has ended, terminate the main task and notify the fork queue 87735 **/ 87736 if (mainTask.status !== CANCELLED) { 87737 mainTask.status = DONE; 87738 } 87739 87740 mainTask.cont(result.value); 87741 } 87742 } catch (error) {
87743 if (mainTask.status === CANCELLED) { 87744 throw error; 87745 } 87746 87747 mainTask.status = ABORTED; 87748 mainTask.cont(error, true); 87749 } 87750 } 87751 87752 function runEffect(effect, effectId, currCb) { 87753 /** 87754 each effect runner must attach its own logic of cancellation to the provided callback 87755 it allows this generator to propagate cancellation downward. 87756 ATTENTION! effect runners must setup the cancel logic by setting cb.cancel = [cancelMethod] 87757 And the setup must occur before calling the callback 87758 This is a sort of inversion of control: called async functions are responsible 87759 of completing the flow by calling the provided continuation; while caller functions 87760 are responsible for aborting the current flow by calling the attached cancel function 87761 Library users can attach their own cancellation logic to promises by defining a 87762 promise[CANCEL] method in their returned promises 87763 ATTENTION! calling cancel must have no effect on an already completed or cancelled effect 87764 **/ 87765 if ((0,redux_saga_is_esm/* promise */.iv)(effect)) { 87766 resolvePromise(effect, currCb); 87767 } else if ((0,redux_saga_is_esm/* iterator */.lJ)(effect)) { 87768 // resolve iterator 87769 proc(env, effect, task.context, effectId, meta, 87770 /* isRoot */ 87771 false, currCb); 87772 } else if (effect && effect[redux_saga_symbols_esm.IO]) { 87773 var effectRunner = effectRunnerMap[effect.type]; 87774 effectRunner(env, effect.payload, currCb, executingContext); 87775 } else { 87776 // anything else returned as is 87777 currCb(effect); 87778 } 87779 } 87780 87781 function digestEffect(effect, parentEffectId, cb, label) { 87782 if (label === void 0) { 87783 label = ''; 87784 } 87785 87786 var effectId = nextSagaId(); 87787 env.sagaMonitor && env.sagaMonitor.effectTriggered({ 87788 effectId: effectId, 87789 parentEffectId: parentEffectId, 87790 label: label, 87791 effect: effect 87792 }); 87793 /** 87794 completion callback and cancel callback are mutually exclusive 87795 We can't cancel an already completed effect 87796 And We can't complete an already cancelled effectId 87797 **/ 87798 87799 var effectSettled; // Completion callback passed to the appropriate effect runner 87800 87801 function currCb(res, isErr) { 87802 if (effectSettled) { 87803 return; 87804 } 87805 87806 effectSettled = true; 87807 cb.cancel = io_22ea0cf9.t; // defensive measure 87808 87809 if (env.sagaMonitor) { 87810 if (isErr) { 87811 env.sagaMonitor.effectRejected(effectId, res); 87812 } else { 87813 env.sagaMonitor.effectResolved(effectId, res); 87814 } 87815 } 87816 87817 if (isErr) { 87818 setCrashedEffect(effect); 87819 } 87820 87821 cb(res, isErr); 87822 } // tracks down the current cancel 87823 87824 87825 currCb.cancel = io_22ea0cf9.t; // setup cancellation logic on the parent cb 87826 87827 cb.cancel = function () { 87828 // prevents cancelling an already completed effect 87829 if (effectSettled) { 87830 return; 87831 } 87832 87833 effectSettled = true; 87834 currCb.cancel(); // propagates cancel downward 87835 87836 currCb.cancel = io_22ea0cf9.t; // defensive measure 87837 87838 env.sagaMonitor && env.sagaMonitor.effectCancelled(effectId); 87839 }; 87840 87841 finalRunEffect(effect, effectId, currCb); 87842 } 87843} 87844 87845var RUN_SAGA_SIGNATURE = 'runSaga(options, saga, ...args)'; 87846var NON_GENERATOR_ERR = RUN_SAGA_SIGNATURE + ": saga argument must be a Generator function!"; 87847function runSaga(_ref, saga) { 87848 var _ref$channel = _ref.channel, 87849 channel = _ref$channel === void 0 ? stdChannel() : _ref$channel, 87850 dispatch = _ref.dispatch, 87851 getState = _ref.getState, 87852 _ref$context = _ref.context, 87853 context = _ref$context === void 0 ? {} : _ref$context, 87854 sagaMonitor = _ref.sagaMonitor, 87855 effectMiddlewares = _ref.effectMiddlewares, 87856 _ref$onError = _ref.onError, 87857 onError = _ref$onError === void 0 ? io_22ea0cf9.D : _ref$onError; 87858 87859 if (false) // removed by dead control flow 87860{} 87861 87862 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 87863 args[_key - 2] = arguments[_key]; 87864 } 87865 87866 var iterator$1 = saga.apply(void 0, args); 87867 87868 if (false) // removed by dead control flow 87869{} 87870 87871 var effectId = nextSagaId(); 87872 87873 if (sagaMonitor) { 87874 // monitors are expected to have a certain interface, let's fill-in any missing ones 87875 sagaMonitor.rootSagaStarted = sagaMonitor.rootSagaStarted || io_22ea0cf9.t; 87876 sagaMonitor.effectTriggered = sagaMonitor.effectTriggered || io_22ea0cf9.t; 87877 sagaMonitor.effectResolved = sagaMonitor.effectResolved || io_22ea0cf9.t; 87878 sagaMonitor.effectRejected = sagaMonitor.effectRejected || io_22ea0cf9.t;
87879 sagaMonitor.effectCancelled = sagaMonitor.effectCancelled || io_22ea0cf9.t; 87880 sagaMonitor.actionDispatched = sagaMonitor.actionDispatched || io_22ea0cf9.t; 87881 sagaMonitor.rootSagaStarted({ 87882 effectId: effectId, 87883 saga: saga, 87884 args: args 87885 }); 87886 } 87887 87888 if (false) // removed by dead control flow 87889{ var MIDDLEWARE_TYPE_ERROR; } 87890 87891 var finalizeRunEffect; 87892 87893 if (effectMiddlewares) { 87894 var middleware = io_22ea0cf9.B.apply(void 0, effectMiddlewares); 87895 87896 finalizeRunEffect = function finalizeRunEffect(runEffect) { 87897 return function (effect, effectId, currCb) { 87898 var plainRunEffect = function plainRunEffect(eff) { 87899 return runEffect(eff, effectId, currCb); 87900 }; 87901 87902 return middleware(plainRunEffect)(effect); 87903 }; 87904 }; 87905 } else { 87906 finalizeRunEffect = io_22ea0cf9.H; 87907 } 87908 87909 var env = { 87910 channel: channel, 87911 dispatch: (0,io_22ea0cf9.E)(dispatch), 87912 getState: getState, 87913 sagaMonitor: sagaMonitor, 87914 onError: onError, 87915 finalizeRunEffect: finalizeRunEffect 87916 }; 87917 return immediately(function () { 87918 var task = proc(env, iterator$1, context, effectId, (0,io_22ea0cf9.j)(saga), 87919 /* isRoot */ 87920 true, undefined); 87921 87922 if (sagaMonitor) { 87923 sagaMonitor.effectResolved(effectId, task); 87924 } 87925 87926 return task; 87927 }); 87928} 87929 87930function sagaMiddlewareFactory(_temp) { 87931 var _ref = _temp === void 0 ? {} : _temp, 87932 _ref$context = _ref.context, 87933 context = _ref$context === void 0 ? {} : _ref$context, 87934 _ref$channel = _ref.channel, 87935 channel = _ref$channel === void 0 ? stdChannel() : _ref$channel, 87936 sagaMonitor = _ref.sagaMonitor, 87937 options = (0,objectWithoutPropertiesLoose/* default */.A)(_ref, ["context", "channel", "sagaMonitor"]); 87938 87939 var boundRunSaga; 87940 87941 if (false) // removed by dead control flow 87942{} 87943 87944 function sagaMiddleware(_ref2) { 87945 var getState = _ref2.getState, 87946 dispatch = _ref2.dispatch; 87947 boundRunSaga = runSaga.bind(null, (0,esm_extends/* default */.A)({}, options, { 87948 context: context, 87949 channel: channel, 87950 dispatch: dispatch, 87951 getState: getState, 87952 sagaMonitor: sagaMonitor 87953 })); 87954 return function (next) { 87955 return function (action) { 87956 if (sagaMonitor && sagaMonitor.actionDispatched) { 87957 sagaMonitor.actionDispatched(action); 87958 } 87959 87960 var result = next(action); // hit reducers 87961 87962 channel.put(action); 87963 return result; 87964 }; 87965 }; 87966 } 87967 87968 sagaMiddleware.run = function () { 87969 if (false) // removed by dead control flow 87970{} 87971 87972 return boundRunSaga.apply(void 0, arguments); 87973 }; 87974 87975 sagaMiddleware.setContext = function (props) { 87976 if (false) // removed by dead control flow 87977{} 87978 87979 (0,io_22ea0cf9.p)(context, props); 87980 }; 87981 87982 return sagaMiddleware; 87983} 87984 87985/* harmony default export */ const redux_saga_core_esm = (sagaMiddlewareFactory); 87986 87987 87988;// ./node_modules/redux-saga/dist/redux-saga-core-npm-proxy.esm.js 87989 87990 87991 87992 87993 87994/* harmony default export */ const redux_saga_core_npm_proxy_esm = (redux_saga_core_esm); 87995 87996 87997/***/ }, 87998 87999/***/ 90167 88000(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 88001 88002"use strict"; 88003/* harmony export */ __webpack_require__.d(__webpack_exports__, { 88004/* harmony export */ Lt: () => (/* reexport safe */ _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_0__.Lt), 88005/* harmony export */ Q7: () => (/* reexport safe */ _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_0__.Q7), 88006/* harmony export */ T1: () => (/* reexport safe */ _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_0__.T1), 88007/* harmony export */ jP: () => (/* reexport safe */ _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_0__.jP), 88008/* harmony export */ yJ: () => (/* reexport safe */ _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_0__.yJ) 88009/* harmony export */ }); 88010/* harmony import */ var _redux_saga_core_effects__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85118); 88011 88012 88013 88014/***/ }, 88015 88016/***/ 93079 88017(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 88018 88019"use strict"; 88020/* harmony export */ __webpack_require__.d(__webpack_exports__, { 88021/* harmony export */ HY: () =>
88021 (/* binding */ combineReducers), 88022/* harmony export */ Tw: () => (/* binding */ applyMiddleware), 88023/* harmony export */ Zz: () => (/* binding */ compose), 88024/* harmony export */ ve: () => (/* binding */ isAction), 88025/* harmony export */ y$: () => (/* binding */ createStore) 88026/* harmony export */ }); 88027/* unused harmony exports __DO_NOT_USE__ActionTypes, bindActionCreators, isPlainObject, legacy_createStore */
vendor: 2,414 bytes, lines 88028-88104
88028// src/utils/formatProdErrorMessage.ts 88029function formatProdErrorMessage(code) { 88030 return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `; 88031} 88032 88033// src/utils/symbol-observable.ts 88034var $$observable = /* @__PURE__ */ (() => typeof Symbol === "function" && Symbol.observable || "@@observable")(); 88035var symbol_observable_default = $$observable; 88036 88037// src/utils/actionTypes.ts 88038var randomString = () => Math.random().toString(36).substring(7).split("").join("."); 88039var ActionTypes = { 88040 INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`, 88041 REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`, 88042 PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}` 88043}; 88044var actionTypes_default = ActionTypes; 88045 88046// src/utils/isPlainObject.ts 88047function isPlainObject(obj) { 88048 if (typeof obj !== "object" || obj === null) 88049 return false; 88050 let proto = obj; 88051 while (Object.getPrototypeOf(proto) !== null) { 88052 proto = Object.getPrototypeOf(proto); 88053 } 88054 return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null; 88055} 88056 88057// src/utils/kindOf.ts 88058function miniKindOf(val) { 88059 if (val === void 0) 88060 return "undefined"; 88061 if (val === null) 88062 return "null"; 88063 const type = typeof val; 88064 switch (type) { 88065 case "boolean": 88066 case "string": 88067 case "number": 88068 case "symbol": 88069 case "function": { 88070 return type; 88071 } 88072 } 88073 if (Array.isArray(val)) 88074 return "array"; 88075 if (isDate(val)) 88076 return "date"; 88077 if (isError(val)) 88078 return "error"; 88079 const constructorName = ctorName(val); 88080 switch (constructorName) { 88081 case "Symbol": 88082 case "Promise": 88083 case "WeakMap": 88084 case "WeakSet": 88085 case "Map": 88086 case "Set": 88087 return constructorName; 88088 } 88089 return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, ""); 88090} 88091function ctorName(val) { 88092 return typeof val.constructor === "function" ? val.constructor.name : null; 88093} 88094function isError(val) { 88095 return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number"; 88096} 88097function isDate(val) { 88098 if (val instanceof Date) 88099 return true; 88100 return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function"; 88101} 88102function kindOf(val) { 88103 let typeOfVal = typeof val; 88104 if (
88104false) // removed by dead control flow 88105{} 88106 return typeOfVal; 88107} 88108
vendor: 3,730 bytes, lines 88109-88218
88109// src/createStore.ts 88110function createStore(reducer, preloadedState, enhancer) { 88111 if (typeof reducer !== "function") { 88112 throw new Error( true ? formatProdErrorMessage(2) : 0); 88113 } 88114 if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") { 88115 throw new Error( true ? formatProdErrorMessage(0) : 0); 88116 } 88117 if (typeof preloadedState === "function" && typeof enhancer === "undefined") { 88118 enhancer = preloadedState; 88119 preloadedState = void 0; 88120 } 88121 if (typeof enhancer !== "undefined") { 88122 if (typeof enhancer !== "function") { 88123 throw new Error( true ? formatProdErrorMessage(1) : 0); 88124 } 88125 return enhancer(createStore)(reducer, preloadedState); 88126 } 88127 let currentReducer = reducer; 88128 let currentState = preloadedState; 88129 let currentListeners = /* @__PURE__ */ new Map(); 88130 let nextListeners = currentListeners; 88131 let listenerIdCounter = 0; 88132 let isDispatching = false; 88133 function ensureCanMutateNextListeners() { 88134 if (nextListeners === currentListeners) { 88135 nextListeners = /* @__PURE__ */ new Map(); 88136 currentListeners.forEach((listener, key) => { 88137 nextListeners.set(key, listener); 88138 }); 88139 } 88140 } 88141 function getState() { 88142 if (isDispatching) { 88143 throw new Error( true ? formatProdErrorMessage(3) : 0); 88144 } 88145 return currentState; 88146 } 88147 function subscribe(listener) { 88148 if (typeof listener !== "function") { 88149 throw new Error( true ? formatProdErrorMessage(4) : 0); 88150 } 88151 if (isDispatching) { 88152 throw new Error( true ? formatProdErrorMessage(5) : 0); 88153 } 88154 let isSubscribed = true; 88155 ensureCanMutateNextListeners(); 88156 const listenerId = listenerIdCounter++; 88157 nextListeners.set(listenerId, listener); 88158 return function unsubscribe() { 88159 if (!isSubscribed) { 88160 return; 88161 } 88162 if (isDispatching) { 88163 throw new Error( true ? formatProdErrorMessage(6) : 0); 88164 } 88165 isSubscribed = false; 88166 ensureCanMutateNextListeners(); 88167 nextListeners.delete(listenerId); 88168 currentListeners = null; 88169 }; 88170 } 88171 function dispatch(action) { 88172 if (!isPlainObject(action)) { 88173 throw new Error( true ? formatProdErrorMessage(7) : 0); 88174 } 88175 if (typeof action.type === "undefined") { 88176 throw new Error( true ? formatProdErrorMessage(8) : 0); 88177 } 88178 if (typeof action.type !== "string") { 88179 throw new Error( true ? formatProdErrorMessage(17) : 0); 88180 } 88181 if (isDispatching) { 88182 throw new Error( true ? formatProdErrorMessage(9) : 0); 88183 } 88184 try { 88185 isDispatching = true; 88186 currentState = currentReducer(currentState, action); 88187 } finally { 88188 isDispatching = false; 88189 } 88190 const listeners = currentListeners = nextListeners; 88191 listeners.forEach((listener) => { 88192 listener(); 88193 }); 88194 return action; 88195 } 88196 function replaceReducer(nextReducer) { 88197 if (typeof nextReducer !== "function") { 88198 throw new Error( true ? formatProdErrorMessage(10) : 0); 88199 } 88200 currentReducer = nextReducer; 88201 dispatch({ 88202 type: actionTypes_default.REPLACE 88203 }); 88204 } 88205 function observable() { 88206 const outerSubscribe = subscribe; 88207 return { 88208 /** 88209 * The minimal observable subscription method. 88210 * @param observer Any object that can be used as an observer. 88211 * The observer object should have a `next` method. 88212 * @returns An object with an `unsubscribe` method that can 88213 * be used to unsubscribe the observable from the store, and prevent further 88214 * emission of values from the observable. 88215 */ 88216 subscribe(observer) { 88217 if (typeof observer !== "object" || observer === null) { 88218 throw new Error( true ? formatProdErrorMessage(11) : 0
vendor: 2,545 bytes, lines 88218-88291
88218); 88219 } 88220 function observeState() { 88221 const observerAsObserver = observer; 88222 if (observerAsObserver.next) { 88223 observerAsObserver.next(getState()); 88224 } 88225 } 88226 observeState(); 88227 const unsubscribe = outerSubscribe(observeState); 88228 return { 88229 unsubscribe 88230 }; 88231 }, 88232 [symbol_observable_default]() { 88233 return this; 88234 } 88235 }; 88236 } 88237 dispatch({ 88238 type: actionTypes_default.INIT 88239 }); 88240 const store = { 88241 dispatch, 88242 subscribe, 88243 getState, 88244 replaceReducer, 88245 [symbol_observable_default]: observable 88246 }; 88247 return store; 88248} 88249function legacy_createStore(reducer, preloadedState, enhancer) { 88250 return createStore(reducer, preloadedState, enhancer); 88251} 88252 88253// src/utils/warning.ts 88254function warning(message) { 88255 if (typeof console !== "undefined" && typeof console.error === "function") { 88256 console.error(message); 88257 } 88258 try { 88259 throw new Error(message); 88260 } catch (e) { 88261 } 88262} 88263 88264// src/combineReducers.ts 88265function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { 88266 const reducerKeys = Object.keys(reducers); 88267 const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer"; 88268 if (reducerKeys.length === 0) { 88269 return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers."; 88270 } 88271 if (!isPlainObject(inputState)) { 88272 return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`; 88273 } 88274 const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]); 88275 unexpectedKeys.forEach((key) => { 88276 unexpectedKeyCache[key] = true; 88277 }); 88278 if (action && action.type === actionTypes_default.REPLACE) 88279 return; 88280 if (unexpectedKeys.length > 0) { 88281 return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`; 88282 } 88283} 88284function assertReducerShape(reducers) { 88285 Object.keys(reducers).forEach((key) => { 88286 const reducer = reducers[key]; 88287 const initialState = reducer(void 0, { 88288 type: actionTypes_default.INIT 88289 }); 88290 if (typeof initialState === "undefined") { 88291 throw new Error(
88291 true ? formatProdErrorMessage(12) : 0); 88292 } 88293 if (typeof reducer(void 0, { 88294 type: actionTypes_default.PROBE_UNKNOWN_ACTION() 88295 }) === "undefined") { 88296 throw new Error( true ? formatProdErrorMessage(13) : 0); 88297 } 88298 }); 88299} 88300function combineReducers(reducers) { 88301 const reducerKeys = Object.keys(reducers); 88302 const finalReducers = {}; 88303 for (let i = 0; i < reducerKeys.length; i++) { 88304 const key = reducerKeys[i]; 88305 if (false) // removed by dead control flow 88306{} 88307 if (typeof reducers[key] === "function") { 88308 finalReducers[key] = reducers[key]; 88309 } 88310 } 88311 const finalReducerKeys = Object.keys(finalReducers); 88312 let unexpectedKeyCache; 88313 if (false) // removed by dead control flow 88314{} 88315 let shapeAssertionError; 88316 try { 88317 assertReducerShape(finalReducers); 88318 } catch (e) { 88319 shapeAssertionError = e; 88320 } 88321 return function combination(state = {}, action) { 88322 if (shapeAssertionError) { 88323 throw shapeAssertionError; 88324 } 88325 if (false) // removed by dead control flow 88326{} 88327 let hasChanged = false; 88328 const nextState = {}; 88329 for (let i = 0; i < finalReducerKeys.length; i++) { 88330 const key = finalReducerKeys[i]; 88331 const reducer = finalReducers[key]; 88332 const previousStateForKey = state[key]; 88333 const nextStateForKey = reducer(previousStateForKey, action); 88334 if (typeof nextStateForKey === "undefined") { 88335 const actionType = action && action.type; 88336 throw new Error( true ? formatProdErrorMessage(14) : 0); 88337 } 88338 nextState[key] = nextStateForKey; 88339 hasChanged = hasChanged || nextStateForKey !== previousStateForKey; 88340 } 88341 hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; 88342 return hasChanged ? nextState : state; 88343 }; 88344} 88345
88346// src/bindActionCreators.ts 88347function bindActionCreator(actionCreator, dispatch) { 88348 return function(...args) { 88349 return dispatch(actionCreator.apply(this, args)); 88350 }; 88351} 88352function bindActionCreators(actionCreators, dispatch) { 88353 if (typeof actionCreators === "function") { 88354 return bindActionCreator(actionCreators, dispatch); 88355 } 88356 if (typeof actionCreators !== "object" || actionCreators === null) { 88357 throw new Error( true ? formatProdErrorMessage(16) : 0
vendor: 747 bytes, lines 88357-88385
88357); 88358 } 88359 const boundActionCreators = {}; 88360 for (const key in actionCreators) { 88361 const actionCreator = actionCreators[key]; 88362 if (typeof actionCreator === "function") { 88363 boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); 88364 } 88365 } 88366 return boundActionCreators; 88367} 88368 88369// src/compose.ts 88370function compose(...funcs) { 88371 if (funcs.length === 0) { 88372 return (arg) => arg; 88373 } 88374 if (funcs.length === 1) { 88375 return funcs[0]; 88376 } 88377 return funcs.reduce((a, b) => (...args) => a(b(...args))); 88378} 88379 88380// src/applyMiddleware.ts 88381function applyMiddleware(...middlewares) { 88382 return (createStore2) => (reducer, preloadedState) => { 88383 const store = createStore2(reducer, preloadedState); 88384 let dispatch = () => { 88385 throw new Error(
88385 true ? formatProdErrorMessage(15) : 0); 88386 }; 88387 const middlewareAPI = { 88388 getState: store.getState, 88389 dispatch: (action, ...args) => dispatch(action, ...args) 88390 }; 88391 const chain = middlewares.map((middleware) => middleware(middlewareAPI)); 88392 dispatch = compose(...chain)(store.dispatch); 88393 return { 88394 ...store, 88395 dispatch 88396 }; 88397 }; 88398} 88399
88400// src/utils/isAction.ts 88401function isAction(action) { 88402 return isPlainObject(action) && "type" in action && typeof action.type === "string"; 88403} 88404 88405//# sourceMappingURL=redux.mjs.map 88406 88407/***/ }, 88408 88409/***/ 77675 88410(module, __unused_webpack_exports, __webpack_require__) { 88411 88412"use strict"; 88413 88414 88415var setFunctionName = __webpack_require__(43206); 88416var $TypeError = __webpack_require__(69675); 88417 88418var $Object = Object; 88419 88420module.exports = setFunctionName(function flags() { 88421 if (this == null || this !== $Object(this)) { 88422 throw new $TypeError('RegExp.prototype.flags getter called on non-object'); 88423 } 88424 var result = ''; 88425 if (this.hasIndices) { 88426 result += 'd'; 88427 } 88428 if (this.global) { 88429 result += 'g'; 88430 } 88431 if (this.ignoreCase) { 88432 result += 'i'; 88433 } 88434 if (this.multiline) { 88435 result += 'm'; 88436 } 88437 if (this.dotAll) { 88438 result += 's'; 88439 } 88440 if (this.unicode) { 88441 result += 'u'; 88442 } 88443 if (this.unicodeSets) { 88444 result += 'v'; 88445 } 88446 if (this.sticky) { 88447 result += 'y'; 88448 } 88449 return result; 88450}, 'get flags', true); 88451 88452 88453 88454/***/ }, 88455 88456/***/ 71589 88457(module, __unused_webpack_exports, __webpack_require__) { 88458 88459"use strict"; 88460 88461 88462var define = __webpack_require__(38452); 88463var callBind = __webpack_require__(10487); 88464 88465var implementation = __webpack_require__(77675); 88466var getPolyfill = __webpack_require__(15330); 88467var shim = __webpack_require__(43984); 88468 88469var flagsBound = callBind(getPolyfill()); 88470 88471define(flagsBound, { 88472 getPolyfill: getPolyfill, 88473 implementation: implementation, 88474 shim: shim 88475}); 88476 88477module.exports = flagsBound; 88478 88479 88480/***/ }, 88481 88482/***/ 15330 88483(module, __unused_webpack_exports, __webpack_require__) { 88484 88485"use strict"; 88486 88487 88488var implementation = __webpack_require__(77675); 88489 88490var supportsDescriptors = (__webpack_require__(38452).supportsDescriptors); 88491var $gOPD = Object.getOwnPropertyDescriptor; 88492 88493module.exports = function getPolyfill() { 88494 if (supportsDescriptors && (/a/mig).flags === 'gim') { 88495 var descriptor = $gOPD(RegExp.prototype, 'flags'); 88496 if ( 88497 descriptor 88498 && typeof descriptor.get === 'function' 88499 && typeof RegExp.prototype.dotAll === 'boolean' 88500 && typeof RegExp.prototype.hasIndices === 'boolean' 88501 ) { 88502 /* eslint getter-return: 0 */ 88503 var calls = ''; 88504 var o = {}; 88505 Object.defineProperty(o, 'hasIndices', { 88506 get: function () { 88507 calls += 'd'; 88508 } 88509 }); 88510 Object.defineProperty(o, 'sticky', { 88511 get: function () { 88512 calls += 'y'; 88513 } 88514 }); 88515 if (calls === 'dy') { 88516 return descriptor.get; 88517 } 88518 } 88519 } 88520 return implementation; 88521}; 88522 88523 88524/***/ }, 88525 88526/***/ 43984 88527(module, __unused_webpack_exports, __webpack_require__) { 88528 88529"use strict"; 88530 88531 88532var supportsDescriptors = (__webpack_require__(38452).supportsDescriptors); 88533var getPolyfill = __webpack_require__(15330); 88534var gOPD = Object.getOwnPropertyDescriptor; 88535var defineProperty = Object.defineProperty; 88536var TypeErr = TypeError; 88537var getProto = Object.getPrototypeOf; 88538var regex = /a/; 88539 88540module.exports = function shimFlags() { 88541 if (!supportsDescriptors || !getProto) { 88542 throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); 88543 } 88544 var polyfill = getPolyfill(); 88545 var proto = getProto(regex); 88546 var descriptor = gOPD(proto, 'flags'); 88547 if (!descriptor || descriptor.get !== polyfill) { 88548 defineProperty(proto, 'flags', { 88549 configurable: true, 88550 enumerable: false, 88551 get: polyfill 88552 }); 88553 } 88554 return polyfill; 88555}; 88556 88557 88558/***/ }, 88559 88560/***/ 13527 88561(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 88562 88563"use strict"; 88564/* harmony export */ __webpack_require__.d(__webpack_exports__, { 88565/* harmony export */ Mz: () => (/* binding */ createSelector) 88566/* harmony export */ }); 88567/* unused harmony exports createSelectorCreator, createStructuredSelector, lruMemoize, referenceEqualityCheck, setGlobalDevModeChecks, unstable_autotrackMemoize, weakMapMemoize */
88568// src/devModeChecks/identityFunctionCheck.ts 88569var runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => { 88570 if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) { 88571 let isInputSameAsOutput = false; 88572 try { 88573 const emptyObject = {}; 88574 if (resultFunc(emptyObject) === emptyObject) isInputSameAsOutput = true; 88575 } catch { 88576 } 88577 if (isInputSameAsOutput) { 88578 let stack = void 0; 88579 try { 88580 throw new Error(); 88581 } catch (e) { 88582 ; 88583 ({ stack } = e); 88584 } 88585 console.warn( 88586 "The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.", 88587 { stack } 88588 ); 88589 } 88590 } 88591}; 88592
88593// src/devModeChecks/inputStabilityCheck.ts 88594var runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => { 88595 const { memoize, memoizeOptions } = options; 88596 const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject; 88597 const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions); 88598 const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy); 88599 if (!areInputSelectorResultsEqual) { 88600 let stack = void 0; 88601 try { 88602 throw new Error(); 88603 } catch (e) { 88604 ; 88605 ({ stack } = e); 88606 } 88607 console.warn( 88608 "An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`", 88609 { 88610 arguments: inputSelectorArgs, 88611 firstInputs: inputSelectorResults, 88612 secondInputs: inputSelectorResultsCopy, 88613 stack 88614 } 88615 ); 88616 } 88617}; 88618
88619// src/devModeChecks/setGlobalDevModeChecks.ts 88620var globalDevModeChecks = { 88621 inputStabilityCheck: "once", 88622 identityFunctionCheck: "once" 88623}; 88624var setGlobalDevModeChecks = (devModeChecks) => { 88625 Object.assign(globalDevModeChecks, devModeChecks); 88626}; 88627
88628// src/utils.ts 88629var NOT_FOUND = /* @__PURE__ */ (/* unused pure expression or super */ null && (Symbol("NOT_FOUND"))); 88630function assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) { 88631 if (typeof func !== "function") { 88632 throw new TypeError(errorMessage); 88633 } 88634} 88635function assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) { 88636 if (typeof object !== "object") { 88637 throw new TypeError(errorMessage); 88638 } 88639} 88640function assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) { 88641 if (!array.every((item) => typeof item === "function")) { 88642 const itemTypes = array.map( 88643 (item) => typeof item === "function" ? `function ${item.name || "unnamed"}()` : typeof item 88644 ).join(", "); 88645 throw new TypeError(`${errorMessage}[${itemTypes}]`); 88646 } 88647} 88648var ensureIsArray = (item) => { 88649 return Array.isArray(item) ? item : [item]; 88650}; 88651function getDependencies(createSelectorArgs) { 88652 const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs; 88653 assertIsArrayOfFunctions( 88654 dependencies, 88655 `createSelector expects all input-selectors to be functions, but received the following types: ` 88656 ); 88657 return dependencies; 88658} 88659function collectInputSelectorResults(dependencies, inputSelectorArgs) { 88660 const inputSelectorResults = []; 88661 const { length } = dependencies; 88662 for (let i = 0; i < length; i++) { 88663 inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs)); 88664 } 88665 return inputSelectorResults; 88666} 88667var getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => { 88668 const { identityFunctionCheck, inputStabilityCheck } = { 88669 ...globalDevModeChecks, 88670 ...devModeChecks 88671 }; 88672 return { 88673 identityFunctionCheck: { 88674 shouldRun: identityFunctionCheck === "always" || identityFunctionCheck === "once" && firstRun, 88675 run: runIdentityFunctionCheck 88676 }, 88677 inputStabilityCheck: { 88678 shouldRun: inputStabilityCheck === "always" || inputStabilityCheck === "once" && firstRun, 88679 run: runInputStabilityCheck 88680 } 88681 }; 88682}; 88683
88684// src/autotrackMemoize/autotracking.ts 88685var $REVISION = 0; 88686var CURRENT_TRACKER = null; 88687var Cell = class { 88688 revision = $REVISION; 88689 _value; 88690 _lastValue; 88691 _isEqual = tripleEq; 88692 constructor(initialValue, isEqual = tripleEq) { 88693 this._value = this._lastValue = initialValue; 88694 this._isEqual = isEqual; 88695 } 88696 // Whenever a storage value is read, it'll add itself to the current tracker if 88697 // one exists, entangling its state with that cache. 88698 get value() { 88699 CURRENT_TRACKER?.add(this); 88700 return this._value; 88701 } 88702 // Whenever a storage value is updated, we bump the global revision clock, 88703 // assign the revision for this storage to the new value, _and_ we schedule a 88704 // rerender. This is important, and it's what makes autotracking _pull_ 88705 // based. We don't actively tell the caches which depend on the storage that 88706 // anything has happened. Instead, we recompute the caches when needed. 88707 set value(newValue) { 88708 if (this.value === newValue) return; 88709 this._value = newValue; 88710 this.revision = ++$REVISION; 88711 } 88712}; 88713function tripleEq(a, b) { 88714 return a === b; 88715} 88716var TrackingCache = class { 88717 _cachedValue; 88718 _cachedRevision = -1; 88719 _deps = []; 88720 hits = 0; 88721 fn; 88722 constructor(fn) { 88723 this.fn = fn; 88724 } 88725 clear() { 88726 this._cachedValue = void 0; 88727 this._cachedRevision = -1; 88728 this._deps = []; 88729 this.hits = 0; 88730 } 88731 get value() { 88732 if (this.revision > this._cachedRevision) { 88733 const { fn } = this; 88734 const currentTracker = /* @__PURE__ */ new Set(); 88735 const prevTracker = CURRENT_TRACKER; 88736 CURRENT_TRACKER = currentTracker; 88737 this._cachedValue = fn(); 88738 CURRENT_TRACKER = prevTracker; 88739 this.hits++; 88740 this._deps = Array.from(currentTracker); 88741 this._cachedRevision = this.revision; 88742 } 88743 CURRENT_TRACKER?.add(this); 88744 return this._cachedValue; 88745 } 88746 get revision() { 88747 return Math.max(...this._deps.map((d) => d.revision), 0); 88748 } 88749}; 88750function getValue(cell) { 88751 if (!(cell instanceof Cell)) { 88752 console.warn("Not a valid cell! ", cell); 88753 } 88754 return cell.value; 88755} 88756function setValue(storage, value) { 88757 if (!(storage instanceof Cell)) { 88758 throw new TypeError( 88759 "setValue must be passed a tracked store created with `createStorage`." 88760 ); 88761 } 88762 storage.value = storage._lastValue = value; 88763} 88764function createCell(initialValue, isEqual = tripleEq) { 88765 return new Cell(initialValue, isEqual); 88766} 88767function createCache(fn) { 88768 assertIsFunction( 88769 fn, 88770 "the first parameter to `createCache` must be a function" 88771 ); 88772 return new TrackingCache(fn); 88773} 88774
88775// src/autotrackMemoize/tracking.ts 88776var neverEq = (a, b) => false; 88777function createTag() { 88778 return createCell(null, neverEq); 88779} 88780function dirtyTag(tag, value) { 88781 setValue(tag, value); 88782} 88783var consumeCollection = (node) => { 88784 let tag = node.collectionTag; 88785 if (tag === null) { 88786 tag = node.collectionTag = createTag(); 88787 } 88788 getValue(tag); 88789}; 88790var dirtyCollection = (node) => { 88791 const tag = node.collectionTag; 88792 if (tag !== null) { 88793 dirtyTag(tag, null); 88794 } 88795}; 88796
88797// src/autotrackMemoize/proxy.ts 88798var nextId = 0; 88799var proto = /* @__PURE__ */ Object.getPrototypeOf({}); 88800var ObjectTreeNode = class { 88801 constructor(value) { 88802 this.value = value; 88803 this.value = value; 88804 this.tag.value = value; 88805 } 88806 proxy = new Proxy(this, objectProxyHandler); 88807 tag = createTag(); 88808 tags = {}; 88809 children = {}; 88810 collectionTag = null; 88811 id = nextId++; 88812}; 88813var objectProxyHandler = { 88814 get(node, key) { 88815 function calculateResult() { 88816 const { value } = node; 88817 const childValue = Reflect.get(value, key); 88818 if (typeof key === "symbol") { 88819 return childValue; 88820 } 88821 if (key in proto) { 88822 return childValue; 88823 } 88824 if (typeof childValue === "object" && childValue !== null) { 88825 let childNode = node.children[key]; 88826 if (childNode === void 0) { 88827 childNode = node.children[key] = createNode(childValue); 88828 } 88829 if (childNode.tag) { 88830 getValue(childNode.tag); 88831 } 88832 return childNode.proxy; 88833 } else { 88834 let tag = node.tags[key]; 88835 if (tag === void 0) { 88836 tag = node.tags[key] = createTag(); 88837 tag.value = childValue; 88838 } 88839 getValue(tag); 88840 return childValue; 88841 } 88842 } 88843 const res = calculateResult(); 88844 return res; 88845 }, 88846 ownKeys(node) { 88847 consumeCollection(node); 88848 return Reflect.ownKeys(node.value); 88849 }, 88850 getOwnPropertyDescriptor(node, prop) { 88851 return Reflect.getOwnPropertyDescriptor(node.value, prop); 88852 }, 88853 has(node, prop) { 88854 return Reflect.has(node.value, prop); 88855 } 88856}; 88857var ArrayTreeNode = class { 88858 constructor(value) { 88859 this.value = value; 88860 this.value = value; 88861 this.tag.value = value; 88862 } 88863 proxy = new Proxy([this], arrayProxyHandler); 88864 tag = createTag(); 88865 tags = {}; 88866 children = {}; 88867 collectionTag = null; 88868 id = nextId++; 88869}; 88870var arrayProxyHandler = { 88871 get([node], key) { 88872 if (key === "length") { 88873 consumeCollection(node); 88874 } 88875 return objectProxyHandler.get(node, key); 88876 }, 88877 ownKeys([node]) { 88878 return objectProxyHandler.ownKeys(node); 88879 }, 88880 getOwnPropertyDescriptor([node], prop) { 88881 return objectProxyHandler.getOwnPropertyDescriptor(node, prop); 88882 }, 88883 has([node], prop) { 88884 return objectProxyHandler.has(node, prop); 88885 } 88886}; 88887function createNode(value) { 88888 if (Array.isArray(value)) { 88889 return new ArrayTreeNode(value); 88890 } 88891 return new ObjectTreeNode(value); 88892} 88893function updateNode(node, newValue) { 88894 const { value, tags, children } = node; 88895 node.value = newValue; 88896 if (Array.isArray(value) && Array.isArray(newValue) && value.length !== newValue.length) { 88897 dirtyCollection(node); 88898 } else { 88899 if (value !== newValue) { 88900 let oldKeysSize = 0; 88901 let newKeysSize = 0; 88902 let anyKeysAdded = false; 88903 for (const _key in value) { 88904 oldKeysSize++; 88905 } 88906 for (const key in newValue) { 88907 newKeysSize++; 88908 if (!(key in value)) { 88909 anyKeysAdded = true; 88910 break; 88911 } 88912 } 88913 const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize; 88914 if (isDifferent) { 88915 dirtyCollection(node); 88916 } 88917 } 88918 } 88919 for (const key in tags) { 88920 const childValue = value[key]; 88921 const newChildValue = newValue[key]; 88922 if (childValue !== newChildValue) { 88923 dirtyCollection(node); 88924 dirtyTag(tags[key], newChildValue); 88925 } 88926 if (typeof newChildValue === "object" && newChildValue !== null) { 88927 delete tags[key]; 88928 } 88929 } 88930 for (const key in children) { 88931 const childNode = children[key]; 88932 const newChildValue = newValue[key]; 88933 const childValue = childNode.value; 88934 if (childValue === newChildValue) { 88935 continue; 88936 } else if (typeof newChildValue === "object" && newChildValue !== null) { 88937 updateNode(childNode, newChildValue); 88938 } else { 88939 deleteNode(childNode); 88940 delete children[key]; 88941 } 88942 } 88943} 88944function deleteNode(node) { 88945 if (node.tag) { 88946 dirtyTag(node.tag, null); 88947 } 88948 dirtyCollection(node); 88949 for (const key in node.tags) { 88950 dirtyTag(node.tags[key], null); 88951 } 88952 for (const key in node.children) { 88953 deleteNode(node.children[key]); 88954 } 88955} 88956
88957// src/lruMemoize.ts 88958function createSingletonCache(equals) { 88959 let entry; 88960 return { 88961 get(key) { 88962 if (entry && equals(entry.key, key)) { 88963 return entry.value; 88964 } 88965 return NOT_FOUND; 88966 }, 88967 put(key, value) { 88968 entry = { key, value }; 88969 }, 88970 getEntries() { 88971 return entry ? [entry] : []; 88972 }, 88973 clear() { 88974 entry = void 0; 88975 } 88976 }; 88977} 88978function createLruCache(maxSize, equals) { 88979 let entries = []; 88980 function get(key) { 88981 const cacheIndex = entries.findIndex((entry) => equals(key, entry.key)); 88982 if (cacheIndex > -1) { 88983 const entry = entries[cacheIndex]; 88984 if (cacheIndex > 0) { 88985 entries.splice(cacheIndex, 1); 88986 entries.unshift(entry); 88987 } 88988 return entry.value; 88989 } 88990 return NOT_FOUND; 88991 } 88992 function put(key, value) { 88993 if (get(key) === NOT_FOUND) { 88994 entries.unshift({ key, value }); 88995 if (entries.length > maxSize) { 88996 entries.pop(); 88997 } 88998 } 88999 } 89000 function getEntries() { 89001 return entries; 89002 } 89003 function clear() { 89004 entries = []; 89005 } 89006 return { get, put, getEntries, clear }; 89007} 89008var referenceEqualityCheck = (a, b) => a === b; 89009function createCacheKeyComparator(equalityCheck) { 89010 return function areArgumentsShallowlyEqual(prev, next) { 89011 if (prev === null || next === null || prev.length !== next.length) { 89012 return false; 89013 } 89014 const { length } = prev; 89015 for (let i = 0; i < length; i++) { 89016 if (!equalityCheck(prev[i], next[i])) { 89017 return false; 89018 } 89019 } 89020 return true; 89021 }; 89022} 89023function lruMemoize(func, equalityCheckOrOptions) { 89024 const providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions }; 89025 const { 89026 equalityCheck = referenceEqualityCheck, 89027 maxSize = 1, 89028 resultEqualityCheck 89029 } = providedOptions; 89030 const comparator = createCacheKeyComparator(equalityCheck); 89031 let resultsCount = 0; 89032 const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); 89033 function memoized() { 89034 let value = cache.get(arguments); 89035 if (value === NOT_FOUND) { 89036 value = func.apply(null, arguments); 89037 resultsCount++; 89038 if (resultEqualityCheck) { 89039 const entries = cache.getEntries(); 89040 const matchingEntry = entries.find( 89041 (entry) => resultEqualityCheck(entry.value, value) 89042 ); 89043 if (matchingEntry) { 89044 value = matchingEntry.value; 89045 resultsCount !== 0 && resultsCount--; 89046 } 89047 } 89048 cache.put(arguments, value); 89049 } 89050 return value; 89051 } 89052 memoized.clearCache = () => { 89053 cache.clear(); 89054 memoized.resetResultsCount(); 89055 }; 89056 memoized.resultsCount = () => resultsCount; 89057 memoized.resetResultsCount = () => { 89058 resultsCount = 0; 89059 }; 89060 return memoized; 89061} 89062
89063// src/autotrackMemoize/autotrackMemoize.ts 89064function autotrackMemoize(func) { 89065 const node = createNode( 89066 [] 89067 ); 89068 let lastArgs = null; 89069 const shallowEqual = createCacheKeyComparator(referenceEqualityCheck); 89070 const cache = createCache(() => { 89071 const res = func.apply(null, node.proxy); 89072 return res; 89073 }); 89074 function memoized() { 89075 if (!shallowEqual(lastArgs, arguments)) { 89076 updateNode(node, arguments); 89077 lastArgs = arguments; 89078 } 89079 return cache.value; 89080 } 89081 memoized.clearCache = () => { 89082 return cache.clear(); 89083 }; 89084 return memoized; 89085} 89086
89087// src/weakMapMemoize.ts 89088var StrongRef = class { 89089 constructor(value) { 89090 this.value = value; 89091 } 89092 deref() { 89093 return this.value; 89094 } 89095}; 89096var getWeakRef = () => typeof WeakRef === "undefined" ? StrongRef : WeakRef; 89097var Ref = /* @__PURE__ */ getWeakRef(); 89098var UNTERMINATED = 0; 89099var TERMINATED = 1; 89100function createCacheNode() { 89101 return { 89102 s: UNTERMINATED, 89103 v: void 0, 89104 o: null, 89105 p: null 89106 }; 89107} 89108function maybeDeref(r) { 89109 if (r instanceof Ref) { 89110 return r.deref(); 89111 } 89112 return r; 89113} 89114function weakMapMemoize(func, options = {}) { 89115 let fnNode = createCacheNode(); 89116 const { resultEqualityCheck } = options; 89117 let lastResult; 89118 let resultsCount = 0; 89119 function memoized() { 89120 let cacheNode = fnNode; 89121 const { length } = arguments; 89122 for (let i = 0, l = length; i < l; i++) { 89123 const arg = arguments[i]; 89124 if (typeof arg === "function" || typeof arg === "object" && arg !== null) { 89125 let objectCache = cacheNode.o; 89126 if (objectCache === null) { 89127 cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap(); 89128 } 89129 const objectNode = objectCache.get(arg); 89130 if (objectNode === void 0) { 89131 cacheNode = createCacheNode(); 89132 objectCache.set(arg, cacheNode); 89133 } else { 89134 cacheNode = objectNode; 89135 } 89136 } else { 89137 let primitiveCache = cacheNode.p; 89138 if (primitiveCache === null) { 89139 cacheNode.p = primitiveCache = /* @__PURE__ */ new Map(); 89140 } 89141 const primitiveNode = primitiveCache.get(arg); 89142 if (primitiveNode === void 0) { 89143 cacheNode = createCacheNode(); 89144 primitiveCache.set(arg, cacheNode); 89145 } else { 89146 cacheNode = primitiveNode; 89147 } 89148 } 89149 } 89150 const terminatedNode = cacheNode; 89151 let result; 89152 if (cacheNode.s === TERMINATED) { 89153 result = cacheNode.v; 89154 } else { 89155 result = func.apply(null, arguments); 89156 resultsCount++; 89157 if (resultEqualityCheck) { 89158 const lastResultValue = maybeDeref(lastResult); 89159 if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) { 89160 result = lastResultValue; 89161 resultsCount !== 0 && resultsCount--; 89162 } 89163 const needsWeakRef = typeof result === "object" && result !== null || typeof result === "function"; 89164 lastResult = needsWeakRef ? /* @__PURE__ */ new Ref(result) : result; 89165 } 89166 } 89167 terminatedNode.s = TERMINATED; 89168 terminatedNode.v = result; 89169 return result; 89170 } 89171 memoized.clearCache = () => { 89172 fnNode = createCacheNode(); 89173 memoized.resetResultsCount(); 89174 }; 89175 memoized.resultsCount = () => resultsCount; 89176 memoized.resetResultsCount = () => { 89177 resultsCount = 0; 89178 }; 89179 return memoized; 89180} 89181
89182// src/createSelectorCreator.ts 89183function createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) { 89184 const createSelectorCreatorOptions = typeof memoizeOrOptions === "function" ? { 89185 memoize: memoizeOrOptions, 89186 memoizeOptions: memoizeOptionsFromArgs 89187 } : memoizeOrOptions; 89188 const createSelector2 = (...createSelectorArgs) => { 89189 let recomputations = 0; 89190 let dependencyRecomputations = 0; 89191 let lastResult; 89192 let directlyPassedOptions = {}; 89193 let resultFunc = createSelectorArgs.pop(); 89194 if (typeof resultFunc === "object") { 89195 directlyPassedOptions = resultFunc; 89196 resultFunc = createSelectorArgs.pop(); 89197 } 89198 assertIsFunction( 89199 resultFunc, 89200 `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]` 89201 ); 89202 const combinedOptions = { 89203 ...createSelectorCreatorOptions, 89204 ...directlyPassedOptions 89205 }; 89206 const { 89207 memoize, 89208 memoizeOptions = [], 89209 argsMemoize = weakMapMemoize, 89210 argsMemoizeOptions = [] 89211 } = combinedOptions; 89212 const finalMemoizeOptions = ensureIsArray(memoizeOptions); 89213 const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions); 89214 const dependencies = getDependencies(createSelectorArgs); 89215 const memoizedResultFunc = memoize(function recomputationWrapper() { 89216 recomputations++; 89217 return resultFunc.apply( 89218 null, 89219 arguments 89220 ); 89221 }, ...finalMemoizeOptions); 89222 let firstRun = true; 89223 const selector = argsMemoize(function dependenciesChecker() { 89224 dependencyRecomputations++; 89225 const inputSelectorResults = collectInputSelectorResults( 89226 dependencies, 89227 arguments 89228 ); 89229 lastResult = memoizedResultFunc.apply(null, inputSelectorResults); 89230 if (false) // removed by dead control flow 89231{} 89232 return lastResult; 89233 }, ...finalArgsMemoizeOptions); 89234 return Object.assign(selector, { 89235 resultFunc, 89236 memoizedResultFunc, 89237 dependencies, 89238 dependencyRecomputations: () => dependencyRecomputations, 89239 resetDependencyRecomputations: () => { 89240 dependencyRecomputations = 0; 89241 }, 89242 lastResult: () => lastResult, 89243 recomputations: () => recomputations, 89244 resetRecomputations: () => { 89245 recomputations = 0; 89246 }, 89247 memoize, 89248 argsMemoize 89249 }); 89250 }; 89251 Object.assign(createSelector2, { 89252 withTypes: () => createSelector2 89253 }); 89254 return createSelector2; 89255} 89256var createSelector = /* @__PURE__ */ createSelectorCreator(weakMapMemoize); 89257
vendor: 5,848 bytes, lines 89258-89342
89258// src/createStructuredSelector.ts 89259var createStructuredSelector = /* @__PURE__ */ Object.assign( 89260 (inputSelectorsObject, selectorCreator = createSelector) => { 89261 assertIsObject( 89262 inputSelectorsObject, 89263 `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}` 89264 ); 89265 const inputSelectorKeys = Object.keys(inputSelectorsObject); 89266 const dependencies = inputSelectorKeys.map( 89267 (key) => inputSelectorsObject[key] 89268 ); 89269 const structuredSelector = selectorCreator( 89270 dependencies, 89271 (...inputSelectorResults) => { 89272 return inputSelectorResults.reduce((composition, value, index) => { 89273 composition[inputSelectorKeys[index]] = value; 89274 return composition; 89275 }, {}); 89276 } 89277 ); 89278 return structuredSelector; 89279 }, 89280 { withTypes: () => createStructuredSelector } 89281); 89282 89283//# sourceMappingURL=reselect.mjs.map 89284 89285/***/ }, 89286 89287/***/ 7463 89288(__unused_webpack_module, exports) { 89289 89290"use strict"; 89291/** 89292 * @license React 89293 * scheduler.production.min.js 89294 * 89295 * Copyright (c) Facebook, Inc. and its affiliates. 89296 * 89297 * This source code is licensed under the MIT license found in the 89298 * LICENSE file in the root directory of this source tree. 89299 */ 89300function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,w=e>>>1;d<w;){var m=2*(d+1)-1,C=a[m],n=m+1,x=a[n];if(0>g(C,c))n<e&&0>g(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(n<e&&0>g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b} 89301function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null; 89302"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}} 89303function J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1; 89304function M(){return exports.unstable_now()-Q<P?!1:!0}function R(){if(null!==O){var a=exports.unstable_now();Q=a;var b=!0;try{b=O(!0,a)}finally{b?S():(N=!1,O=null)}}else N=!1}var S;if("function"===typeof F)S=function(){F(R)};else if("undefined"!==typeof MessageChannel){var T=new MessageChannel,U=T.port2;T.port1.onmessage=R;S=function(){U.postMessage(null)}}else S=function(){D(R,0)};function I(a){O=a;N||(N=!0,S())}function K(a,b){L=D(function(){a(exports.unstable_now())},b)} 89305exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){A||z||(A=!0,I(J))}; 89306exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<a?Math.floor(1E3/a):5};exports.unstable_getCurrentPriorityLevel=function(){return y};exports.unstable_getFirstCallbackNode=function(){return h(r)};exports.unstable_next=function(a){switch(y){case 1:case 2:case 3:var b=3;break;default:b=y}var c=y;y=b;try{return a()}finally{y=c}};exports.unstable_pauseExecution=function(){}; 89307exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=y;y=a;try{return b()}finally{y=c}}; 89308exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=c+e;a={id:u++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a}; 89309exports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}}; 89310 89311 89312/***/ }, 89313 89314/***/ 69982 89315(module, __unused_webpack_exports, __webpack_require__) { 89316 89317"use strict"; 89318 89319 89320if (true) { 89321 module.exports = __webpack_require__(7463); 89322} else // removed by dead control flow 89323{} 89324 89325 89326/***/ }, 89327 89328/***/ 96897 89329(module, __unused_webpack_exports, __webpack_require__) { 89330 89331"use strict"; 89332 89333 89334var GetIntrinsic = __webpack_require__(70453); 89335var define = __webpack_require__(30041); 89336var hasDescriptors = __webpack_require__(30592)(); 89337var gOPD = __webpack_require__(75795); 89338 89339var $TypeError = __webpack_require__(69675); 89340var $floor = GetIntrinsic('%Math.floor%'); 89341 89342/** @type {import('.')} */
89343module.exports = function setFunctionLength(fn, length) { 89344 if (typeof fn !== 'function') { 89345 throw new $TypeError('`fn` is not a function'); 89346 } 89347 if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) { 89348 throw new $TypeError('`length` must be a positive 32-bit integer'); 89349 } 89350 89351 var loose = arguments.length > 2 && !!arguments[2]; 89352 89353 var functionLengthIsConfigurable = true; 89354 var functionLengthIsWritable = true; 89355 if ('length' in fn && gOPD) { 89356 var desc = gOPD(fn, 'length'); 89357 if (desc && !desc.configurable) { 89358 functionLengthIsConfigurable = false; 89359 } 89360 if (desc && !desc.writable) { 89361 functionLengthIsWritable = false; 89362 } 89363 } 89364 89365 if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { 89366 if (hasDescriptors) { 89367 define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true); 89368 } else { 89369 define(/** @type {Parameters<define>[0]} */ (fn), 'length', length); 89370 } 89371 } 89372 return fn; 89373}; 89374 89375 89376/***/ }, 89377 89378/***/ 43206 89379(module, __unused_webpack_exports, __webpack_require__) { 89380 89381"use strict"; 89382 89383 89384var define = __webpack_require__(30041); 89385var hasDescriptors = __webpack_require__(30592)(); 89386var functionsHaveConfigurableNames = (__webpack_require__(74462).functionsHaveConfigurableNames)(); 89387 89388var $TypeError = __webpack_require__(69675); 89389 89390/** @type {import('.')} */ 89391module.exports = function setFunctionName(fn, name) { 89392 if (typeof fn !== 'function') { 89393 throw new $TypeError('`fn` is not a function'); 89394 } 89395 var loose = arguments.length > 2 && !!arguments[2]; 89396 if (!loose || functionsHaveConfigurableNames) { 89397 if (hasDescriptors) { 89398 define(/** @type {Parameters<define>[0]} */ (fn), 'name', name, true, true); 89399 } else { 89400 define(/** @type {Parameters<define>[0]} */ (fn), 'name', name); 89401 } 89402 } 89403 return fn; 89404}; 89405 89406 89407/***/ }, 89408 89409/***/ 2833 89410(module) { 89411 89412// 89413 89414module.exports = function shallowEqual(objA, objB, compare, compareContext) { 89415 var ret = compare ? compare.call(compareContext, objA, objB) : void 0; 89416 89417 if (ret !== void 0) { 89418 return !!ret; 89419 } 89420 89421 if (objA === objB) { 89422 return true; 89423 } 89424 89425 if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) { 89426 return false; 89427 } 89428 89429 var keysA = Object.keys(objA); 89430 var keysB = Object.keys(objB); 89431 89432 if (keysA.length !== keysB.length) { 89433 return false; 89434 } 89435 89436 var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB); 89437 89438 // Test for A's keys different from B. 89439 for (var idx = 0; idx < keysA.length; idx++) { 89440 var key = keysA[idx]; 89441 89442 if (!bHasOwnProperty(key)) { 89443 return false; 89444 } 89445 89446 var valueA = objA[key]; 89447 var valueB = objB[key]; 89448 89449 ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0; 89450 89451 if (ret === false || (ret === void 0 && valueA !== valueB)) { 89452 return false; 89453 } 89454 } 89455 89456 return true; 89457}; 89458 89459 89460/***/ }, 89461 89462/***/ 14803 89463(module, __unused_webpack_exports, __webpack_require__) { 89464 89465"use strict"; 89466 89467 89468var inspect = __webpack_require__(58859); 89469 89470var $TypeError = __webpack_require__(69675); 89471 89472/* 89473* This function traverses the list returning the node corresponding to the given key. 89474* 89475* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. 89476* By doing so, all the recently used nodes can be accessed relatively quickly. 89477*/ 89478/** @type {import('./list.d.ts').listGetNode} */ 89479// eslint-disable-next-line consistent-return 89480var listGetNode = function (list, key, isDelete) { 89481 /** @type {typeof list | NonNullable<(typeof list)['next']>} */ 89482 var prev = list; 89483 /** @type {(typeof list)['next']} */ 89484 var curr; 89485 // eslint-disable-next-line eqeqeq 89486 for (; (curr = prev.next) != null; prev = curr) { 89487 if (curr.key === key) { 89488 prev.next = curr.next; 89489 if (!isDelete) { 89490 // eslint-disable-next-line no-extra-parens 89491 curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next); 89492 list.next = curr; // eslint-disable-line no-param-reassign 89493 } 89494 return curr; 89495 } 89496 } 89497}; 89498 89499/** @type {import('./list.d.ts').listGet} */ 89500var listGet = function (objects, key) { 89501 if (!objects) { 89502 return void undefined; 89503 } 89504 var node = listGetNode(objects, key); 89505 return node && node.value; 89506}; 89507/** @type {import('./list.d.ts').listSet} */ 89508var listSet = function (objects, key, value) { 89509 var node = listGetNode(objects, key); 89510 if (node) { 89511 node.value = value; 89512 } else { 89513 // Prepend the new node to the beginning of the list 89514 objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens 89515 key: key, 89516 next: objects.next, 89517 value: value 89518 }); 89519 } 89520}; 89521/** @type {import('./list.d.ts').listHas} */ 89522var listHas = function (objects, key) { 89523 if (!objects) { 89524 return false;
vendor: 4,364 bytes, lines 89525-89677
89525 } 89526 return !!listGetNode(objects, key); 89527}; 89528/** @type {import('./list.d.ts').listDelete} */ 89529// eslint-disable-next-line consistent-return 89530var listDelete = function (objects, key) { 89531 if (objects) { 89532 return listGetNode(objects, key, true); 89533 } 89534}; 89535 89536/** @type {import('.')} */ 89537module.exports = function getSideChannelList() { 89538 /** @typedef {ReturnType<typeof getSideChannelList>} Channel */ 89539 /** @typedef {Parameters<Channel['get']>[0]} K */ 89540 /** @typedef {Parameters<Channel['set']>[1]} V */ 89541 89542 /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o; 89543 89544 /** @type {Channel} */ 89545 var channel = { 89546 assert: function (key) { 89547 if (!channel.has(key)) { 89548 throw new $TypeError('Side channel does not contain ' + inspect(key)); 89549 } 89550 }, 89551 'delete': function (key) { 89552 var root = $o && $o.next; 89553 var deletedNode = listDelete($o, key); 89554 if (deletedNode && root && root === deletedNode) { 89555 $o = void undefined; 89556 } 89557 return !!deletedNode; 89558 }, 89559 get: function (key) { 89560 return listGet($o, key); 89561 }, 89562 has: function (key) { 89563 return listHas($o, key); 89564 }, 89565 set: function (key, value) { 89566 if (!$o) { 89567 // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head 89568 $o = { 89569 next: void undefined 89570 }; 89571 } 89572 // eslint-disable-next-line no-extra-parens 89573 listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value); 89574 } 89575 }; 89576 // @ts-expect-error TODO: figure out why this is erroring 89577 return channel; 89578}; 89579 89580 89581/***/ }, 89582 89583/***/ 80507 89584(module, __unused_webpack_exports, __webpack_require__) { 89585 89586"use strict"; 89587 89588 89589var GetIntrinsic = __webpack_require__(70453); 89590var callBound = __webpack_require__(36556); 89591var inspect = __webpack_require__(58859); 89592 89593var $TypeError = __webpack_require__(69675); 89594var $Map = GetIntrinsic('%Map%', true); 89595 89596/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */ 89597var $mapGet = callBound('Map.prototype.get', true); 89598/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */ 89599var $mapSet = callBound('Map.prototype.set', true); 89600/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */ 89601var $mapHas = callBound('Map.prototype.has', true); 89602/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */ 89603var $mapDelete = callBound('Map.prototype.delete', true); 89604/** @type {<K, V>(thisArg: Map<K, V>) => number} */ 89605var $mapSize = callBound('Map.prototype.size', true); 89606 89607/** @type {import('.')} */ 89608module.exports = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() { 89609 /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */ 89610 /** @typedef {Parameters<Channel['get']>[0]} K */ 89611 /** @typedef {Parameters<Channel['set']>[1]} V */ 89612 89613 /** @type {Map<K, V> | undefined} */ var $m; 89614 89615 /** @type {Channel} */ 89616 var channel = { 89617 assert: function (key) { 89618 if (!channel.has(key)) { 89619 throw new $TypeError('Side channel does not contain ' + inspect(key)); 89620 } 89621 }, 89622 'delete': function (key) { 89623 if ($m) { 89624 var result = $mapDelete($m, key); 89625 if ($mapSize($m) === 0) { 89626 $m = void undefined; 89627 } 89628 return result; 89629 } 89630 return false; 89631 }, 89632 get: function (key) { // eslint-disable-line consistent-return 89633 if ($m) { 89634 return $mapGet($m, key); 89635 } 89636 }, 89637 has: function (key) { 89638 if ($m) { 89639 return $mapHas($m, key); 89640 } 89641 return false; 89642 }, 89643 set: function (key, value) { 89644 if (!$m) { 89645 // @ts-expect-error TS can't handle narrowing a variable inside a closure 89646 $m = new $Map(); 89647 } 89648 $mapSet($m, key, value); 89649 } 89650 }; 89651 89652 // @ts-expect-error TODO: figure out why TS is erroring here 89653 return channel; 89654}; 89655 89656 89657/***/ }, 89658 89659/***/ 72271 89660(module, __unused_webpack_exports, __webpack_require__) { 89661 89662"use strict"; 89663 89664 89665var GetIntrinsic = __webpack_require__(70453); 89666var callBound = __webpack_require__(36556); 89667var inspect = __webpack_require__(58859); 89668var getSideChannelMap = __webpack_require__(80507); 89669 89670var $TypeError = __webpack_require__(69675); 89671var $WeakMap = GetIntrinsic('%WeakMap%', true); 89672 89673/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */ 89674var $weakMapGet = callBound('WeakMap.prototype.get', true); 89675/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */ 89676var $weakMapSet = callBound('WeakMap.prototype.set', true); 89677/** @type {<K extends object, V>(thisArg: WeakMap<K, V>
89677, key: K) => boolean} */ 89678var $weakMapHas = callBound('WeakMap.prototype.has', true); 89679/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */ 89680var $weakMapDelete = callBound('WeakMap.prototype.delete', true); 89681 89682/** @type {import('.')} */ 89683module.exports = $WeakMap 89684 ? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() { 89685 /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */ 89686 /** @typedef {Parameters<Channel['get']>[0]} K */ 89687 /** @typedef {Parameters<Channel['set']>[1]} V */ 89688 89689 /** @type {WeakMap<K & object, V> | undefined} */ var $wm; 89690 /** @type {Channel | undefined} */ var $m; 89691 89692 /** @type {Channel} */ 89693 var channel = { 89694 assert: function (key) { 89695 if (!channel.has(key)) { 89696 throw new $TypeError('Side channel does not contain ' + inspect(key)); 89697 } 89698 }, 89699 'delete': function (key) { 89700 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 89701 if ($wm) { 89702 return $weakMapDelete($wm, key); 89703 } 89704 } else if (getSideChannelMap) { 89705 if ($m) { 89706 return $m['delete'](key); 89707 } 89708 } 89709 return false; 89710 }, 89711 get: function (key) { 89712 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 89713 if ($wm) { 89714 return $weakMapGet($wm, key); 89715 } 89716 } 89717 return $m && $m.get(key); 89718 }, 89719 has: function (key) { 89720 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 89721 if ($wm) { 89722 return $weakMapHas($wm, key); 89723 } 89724 } 89725 return !!$m && $m.has(key); 89726 }, 89727 set: function (key, value) { 89728 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 89729 if (!$wm) { 89730 $wm = new $WeakMap(); 89731 } 89732 $weakMapSet($wm, key, value); 89733 } else if (getSideChannelMap) { 89734 if (!$m) { 89735 $m = getSideChannelMap(); 89736 } 89737 // eslint-disable-next-line no-extra-parens 89738 /** @type {NonNullable<typeof $m>} */ ($m).set(key, value); 89739 } 89740 } 89741 }; 89742 89743 // @ts-expect-error TODO: figure out why this is erroring 89744 return channel; 89745 } 89746 : getSideChannelMap; 89747 89748 89749/***/ }, 89750 89751/***/ 920 89752(module, __unused_webpack_exports, __webpack_require__) { 89753 89754"use strict"; 89755 89756 89757var $TypeError = __webpack_require__(69675); 89758var inspect = __webpack_require__(58859); 89759var getSideChannelList = __webpack_require__(14803); 89760var getSideChannelMap = __webpack_require__(80507); 89761var getSideChannelWeakMap = __webpack_require__(72271); 89762 89763var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; 89764 89765/** @type {import('.')} */ 89766module.exports = function getSideChannel() { 89767 /** @typedef {ReturnType<typeof getSideChannel>} Channel */ 89768 89769 /** @type {Channel | undefined} */ var $channelData; 89770 89771 /** @type {Channel} */ 89772 var channel = { 89773 assert: function (key) { 89774 if (!channel.has(key)) { 89775 throw new $TypeError('Side channel does not contain ' + inspect(key)); 89776 } 89777 }, 89778 'delete': function (key) { 89779 return !!$channelData && $channelData['delete'](key); 89780 }, 89781 get: function (key) { 89782 return $channelData && $channelData.get(key); 89783 }, 89784 has: function (key) { 89785 return !!$channelData && $channelData.has(key); 89786 }, 89787 set: function (key, value) { 89788 if (!$channelData) { 89789 $channelData = makeChannel(); 89790 } 89791 89792 $channelData.set(key, value); 89793 } 89794 }; 89795 // @ts-expect-error TODO: figure out why this is erroring 89796 return channel; 89797}; 89798 89799 89800/***/ }, 89801 89802/***/ 528 89803(module) { 89804 89805"use strict"; 89806 89807 89808module.exports = (string, separator) => { 89809 if (!(typeof string === 'string' && typeof separator === 'string')) { 89810 throw new TypeError('Expected the arguments to be of type `string`'); 89811 } 89812 89813 if (separator === '') { 89814 return [string]; 89815 } 89816 89817 const separatorIndex = string.indexOf(separator); 89818 89819 if (separatorIndex === -1) { 89820 return [string]; 89821 } 89822 89823 return [ 89824 string.slice(0, separatorIndex), 89825 string.slice(separatorIndex + separator.length) 89826 ]; 89827}; 89828 89829 89830/***/ }, 89831 89832/***/ 81820 89833(module, __unused_webpack_exports, __webpack_require__) { 89834 89835"use strict"; 89836 89837 89838var SLOT = __webpack_require__(20063); 89839 89840var $SyntaxError = SyntaxError; 89841var $StopIteration = typeof StopIteration === 'object' ? StopIteration : null; 89842 89843module.exports = function getStopIterationIterator(origIterator) { 89844 if (!$StopIteration) { 89845 throw new $SyntaxError('this environment lacks StopIteration'); 89846 } 89847 89848 SLOT.set(origIterator, '[[Done]]', false); 89849 89850 var siIterator = { 89851 next: function next() { 89852 var iterator = SLOT.get(this, '[[Iterator]]'); 89853 var done = SLOT.get(iterator, '[[Done]]'); 89854 try { 89855 return { 89856 done: done, 89857 value: done ? void undefined : iterator.next() 89858 }; 89859 } catch (e) { 89860 SLOT.set(iterator, '[[Done]]', true); 89861 if (e !== $StopIteration) { 89862 throw e; 89863 } 89864 return { 89865 done: true, 89866 value: void undefined 89867 }; 89868 } 89869 } 89870 }; 89871 89872 SLOT.set(siIterator, '[[Iterator]]', origIterator); 89873 89874 return siIterator; 89875}; 89876 89877 89878/***/ }, 89879 89880/***/ 9108 89881(module, __unused_webpack_exports, __webpack_require__) { 89882 89883var parse = __webpack_require__(19788); 89884 89885/** 89886 * Parses inline style to object. 89887 * 89888 * @example 89889 * // returns { 'line-height': '42' } 89890 * StyleToObject('line-height: 42;'); 89891 * 89892 * @param {String} style - The inline style. 89893 * @param {Function} [iterator] - The iterator function. 89894 * @return {null|Object} 89895 */ 89896function StyleToObject(style, iterator) { 89897 var output = null; 89898 if (!style || typeof style !== 'string') { 89899 return output; 89900 } 89901 89902 var declaration; 89903 var declarations = parse(style); 89904 var hasIterator = typeof iterator === 'function'; 89905 var property; 89906 var value; 89907 89908 for (var i = 0, len = declarations.length; i < len; i++) { 89909 declaration = declarations[i]; 89910 property = declaration.property; 89911 value = declaration.value; 89912 89913 if (hasIterator) { 89914 iterator(property, value, declaration); 89915 } else if (value) { 89916 output || (output = {}); 89917 output[property] = value; 89918 } 89919 } 89920 89921 return output; 89922} 89923 89924module.exports = StyleToObject; 89925module.exports["default"] = StyleToObject; // ESM support 89926 89927 89928/***/ }, 89929 89930/***/ 27149 89931(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 89932 89933"use strict"; 89934 89935// EXPORTS 89936__webpack_require__.d(__webpack_exports__, { 89937 ID: () => (/* binding */ tt), 89938 NP: () => (/* binding */ rt), 89939 DU: () => (/* binding */ St), 89940 AH: () => (/* binding */ ft), 89941 Ay: () => (/* binding */ gt), 89942 I4: () => (/* binding */ gt), 89943 DP: () => (/* binding */ st) 89944}); 89945 89946// UNUSED EXPORTS: ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, ThemeConsumer, ThemeContext, __PRIVATE__, createTheme, isStyledComponent, keyframes, stylisPluginRSC, version, withTheme 89947 89948// EXTERNAL MODULE: ./node_modules/react/index.js 89949var react = __webpack_require__(96540); 89950;// ./node_modules/stylis/src/Enum.js
89951var MS = '-ms-' 89952var MOZ = '-moz-' 89953var WEBKIT = '-webkit-' 89954 89955var COMMENT = 'comm' 89956var RULESET = 'rule' 89957var DECLARATION = 'decl' 89958 89959var PAGE = '@page' 89960var MEDIA = '@media' 89961var IMPORT = '@import' 89962var CHARSET = '@charset' 89963var VIEWPORT = '@viewport' 89964var SUPPORTS = '@supports' 89965var DOCUMENT = '@document' 89966var NAMESPACE = '@namespace' 89967var KEYFRAMES = '@keyframes' 89968var FONT_FACE = '@font-face' 89969var COUNTER_STYLE = '@counter-style' 89970var FONT_FEATURE_VALUES = '@font-feature-values' 89971var LAYER = '@layer' 89972var SCOPE = '@scope' 89973 89974;// ./node_modules/stylis/src/Utility.js 89975/** 89976 * @param {number} 89977 * @return {number} 89978 */ 89979var abs = Math.abs 89980 89981/** 89982 * @param {number} 89983 * @return {string} 89984 */ 89985var from = String.fromCharCode 89986 89987/** 89988 * @param {object} 89989 * @return {object} 89990 */ 89991var Utility_assign = Object.assign 89992 89993/** 89994 * @param {string} value 89995 * @param {number} length 89996 * @return {number} 89997 */ 89998function hash (value, length) { 89999 return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0 90000} 90001 90002/** 90003 * @param {string} value 90004 * @return {string} 90005 */ 90006function trim (value) { 90007 return value.trim() 90008} 90009 90010/** 90011 * @param {string} value 90012 * @param {RegExp} pattern 90013 * @return {string?} 90014 */ 90015function match (value, pattern) { 90016 return (value = pattern.exec(value)) ? value[0] : value 90017} 90018 90019/** 90020 * @param {string} value 90021 * @param {(string|RegExp)} pattern 90022 * @param {string} replacement 90023 * @return {string} 90024 */ 90025function replace (value, pattern, replacement) { 90026 return value.replace(pattern, replacement) 90027} 90028 90029/** 90030 * @param {string} value 90031 * @param {string} search 90032 * @param {number} position 90033 * @return {number} 90034 */ 90035function indexof (value, search, position) { 90036 return value.indexOf(search, position) 90037} 90038 90039/** 90040 * @param {string} value 90041 * @param {number} index 90042 * @return {number} 90043 */ 90044function charat (value, index) { 90045 return value.charCodeAt(index) | 0 90046} 90047 90048/** 90049 * @param {string} value 90050 * @param {number} begin 90051 * @param {number} end 90052 * @return {string} 90053 */ 90054function substr (value, begin, end) { 90055 return value.slice(begin, end) 90056} 90057 90058/** 90059 * @param {string} value 90060 * @return {number} 90061 */ 90062function strlen (value) { 90063 return value.length 90064} 90065 90066/** 90067 * @param {any[]} value 90068 * @return {number} 90069 */ 90070function sizeof (value) { 90071 return value.length 90072} 90073 90074/** 90075 * @param {any} value 90076 * @param {any[]} array 90077 * @return {any} 90078 */ 90079function append (value, array) { 90080 return array.push(value), value 90081} 90082 90083/** 90084 * @param {string[]} array 90085 * @param {function} callback 90086 * @return {string} 90087 */ 90088function combine (array, callback) { 90089 return array.map(callback).join('') 90090} 90091 90092/** 90093 * @param {string[]} array 90094 * @param {RegExp} pattern 90095 * @return {string[]} 90096 */ 90097function filter (array, pattern) { 90098 return array.filter(function (value) { return !match(value, pattern) }) 90099} 90100 90101;// ./node_modules/stylis/src/Tokenizer.js 90102/* unused harmony import specifier */ var Tokenizer_append; 90103/* unused harmony import specifier */ var Tokenizer_from; 90104 90105 90106var line = 1 90107var column = 1 90108var Tokenizer_length = 0 90109var position = 0 90110var character = 0 90111var characters = '' 90112 90113/** 90114 * @param {string} value 90115 * @param {object | null} root 90116 * @param {object | null} parent 90117 * @param {string} type 90118 * @param {string[] | string} props 90119 * @param {object[] | string} children 90120 * @param {object[]} siblings 90121 * @param {number} length 90122 */ 90123function node (value, root, parent, type, props, children, length, siblings) { 90124 return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: '', siblings: siblings} 90125} 90126 90127/** 90128 * @param {object} root 90129 * @param {object} props 90130 * @return {object} 90131 */ 90132function copy (root, props) { 90133 return Utility_assign(node('', null, null, '', null, null, 0, root.siblings), root, {length: -root.length}, props) 90134} 90135 90136/** 90137 * @param {object} root 90138 */ 90139function lift (root) { 90140 while (root.root) 90141 root = copy(root.root, {children: [root]}) 90142 90143 append(root, root.siblings) 90144} 90145 90146/** 90147 * @return {number} 90148 */ 90149function Tokenizer_char () { 90150 return character 90151} 90152 90153/** 90154 * @return {number} 90155 */ 90156function prev () { 90157 character = position > 0 ? charat(characters, --position) : 0 90158 90159 if (column--, character === 10) 90160 column = 1, line-- 90161 90162 return character 90163} 90164 90165/** 90166 * @return {number} 90167 */ 90168function next () { 90169 character = position < Tokenizer_length ? charat(characters, position++) : 0 90170 90171 if (column++, character === 10) 90172 column = 1, line++ 90173 90174 return character 90175} 90176 90177/** 90178 * @return {number} 90179 */ 90180function peek () { 90181 return charat(characters, position) 90182} 90183 90184/** 90185 * @return {number} 90186 */ 90187function caret () { 90188 return position 90189} 90190 90191/** 90192 * @param {number} begin 90193 * @param {number} end 90194 * @return {string} 90195 */ 90196function slice (begin, end) { 90197 return substr(characters, begin, end) 90198} 90199 90200/** 90201 * @param {number} type 90202 * @return {number} 90203 */ 90204function token (type) { 90205 switch (type) { 90206 // \0 \t \n \r \s whitespace token 90207 case 0: case 9: case 10: case 13: case 32: 90208 return 5 90209 // ! + , / > @ ~ isolate token 90210 case 33: case 43: case 44: case 47: case 62: case 64: case 126: 90211 // ; { } breakpoint token 90212 case 59: case 123: case 125: 90213 return 4 90214 // : accompanied token 90215 case 58: 90216 return 3 90217 // " ' ( [ opening delimit token 90218 case 34: case 39: case 40: case 91: 90219 return 2 90220 // ) ] closing delimit token 90221 case 41: case 93: 90222 return 1 90223 } 90224 90225 return 0 90226} 90227 90228/** 90229 * @param {string} value 90230 * @return {any[]} 90231 */ 90232function alloc (value) { 90233 return line = column = 1, Tokenizer_length = strlen(characters = value), position = 0, [] 90234}
90234 90235 90236/** 90237 * @param {any} value 90238 * @return {any} 90239 */ 90240function dealloc (value) { 90241 return characters = '', value 90242} 90243 90244/** 90245 * @param {number} type 90246 * @return {string} 90247 */ 90248function delimit (type) { 90249 return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))) 90250} 90251 90252/** 90253 * @param {string} value 90254 * @return {string[]} 90255 */ 90256function tokenize (value) { 90257 return dealloc(tokenizer(alloc(value))) 90258} 90259 90260/** 90261 * @param {number} type 90262 * @return {string} 90263 */ 90264function whitespace (type) { 90265 while (character = peek()) 90266 if (character < 33) 90267 next() 90268 else 90269 break 90270 90271 return token(type) > 2 || token(character) > 3 ? '' : ' ' 90272} 90273 90274/** 90275 * @param {string[]} children 90276 * @return {string[]} 90277 */ 90278function tokenizer (children) { 90279 while (next()) 90280 switch (token(character)) { 90281 case 0: Tokenizer_append(identifier(position - 1), children) 90282 break 90283 case 2: Tokenizer_append(delimit(character), children) 90284 break 90285 default: Tokenizer_append(Tokenizer_from(character), children) 90286 } 90287 90288 return children 90289} 90290 90291/** 90292 * @param {number} index 90293 * @param {number} count 90294 * @return {string} 90295 */ 90296function escaping (index, count) { 90297 while (--count && next()) 90298 // not 0-9 A-F a-f 90299 if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97)) 90300 break 90301 90302 return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32)) 90303} 90304 90305/** 90306 * @param {number} type 90307 * @return {number} 90308 */ 90309function delimiter (type) { 90310 while (next()) 90311 switch (character) { 90312 // ] ) " ' 90313 case type: 90314 return position 90315 // " ' 90316 case 34: case 39: 90317 if (type !== 34 && type !== 39) 90318 delimiter(character) 90319 break 90320 // ( 90321 case 40: 90322 if (type === 41) 90323 delimiter(type) 90324 break 90325 // \ 90326 case 92: 90327 next() 90328 break 90329 } 90330 90331 return position 90332} 90333 90334/** 90335 * @param {number} type 90336 * @param {number} index 90337 * @return {number} 90338 */ 90339function commenter (type, index) { 90340 while (next()) 90341 // // 90342 if (type + character === 47 + 10) 90343 break 90344 // /* 90345 else if (type + character === 42 + 42 && peek() === 47) 90346 break 90347 90348 return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next()) 90349} 90350 90351/** 90352 * @param {number} index 90353 * @return {string} 90354 */ 90355function identifier (index) { 90356 while (!token(peek())) 90357 next() 90358 90359 return slice(index, position) 90360} 90361 90362;// ./node_modules/stylis/src/Serializer.js 90363 90364 90365 90366/** 90367 * @param {object[]} children 90368 * @param {function} callback 90369 * @return {string} 90370 */ 90371function serialize (children, callback) { 90372 var output = '' 90373 90374 for (var i = 0; i < children.length; i++) 90375 output += callback(children[i], i, children, callback) || '' 90376 90377 return output 90378} 90379 90380/** 90381 * @param {object} element 90382 * @param {number} index 90383 * @param {object[]} children 90384 * @param {function} callback 90385 * @return {string} 90386 */ 90387function stringify (element, index, children, callback) { 90388 switch (element.type) { 90389 case LAYER: if (element.children.length) break 90390 case IMPORT: case NAMESPACE: case DECLARATION: return element.return = element.return || element.value 90391 case COMMENT: return '' 90392 case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}' 90393 case RULESET: if (!strlen(element.value = element.props.join(','))) return '' 90394 } 90395 90396 return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : '' 90397} 90398 90399;// ./node_modules/stylis/src/Prefixer.js 90400 90401 90402 90403/** 90404 * @param {string} value 90405 * @param {number} length 90406 * @param {object[]} children 90407 * @return {string} 90408 */ 90409function prefix (value, length, children) { 90410 switch (hash(value, length)) { 90411 // color-adjust 90412 case 5103: 90413 return WEBKIT + 'print-' + value + value 90414 // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) 90415 case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: 90416 // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break 90417 case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: 90418 // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) 90419 case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: 90420 // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position 90421 case 6391: case 5879: case 5623: case 6135: case 4599: 90422 return WEBKIT + value + value 90423 // mask-composite 90424 case 4855: 90425 return WEBKIT + value.replace('add', 'source-over').replace('substract', 'source-out').replace('intersect', 'source-in').replace('exclude', 'xor') + value 90426 // tab-size 90427 case 4789: 90428 return MOZ + value + value 90429 // appearance, user-select, transform, hyphens, text-size-adjust
90430 case 5349: case 4246: case 4810: case 6968: case 2756: 90431 return WEBKIT + value + MOZ + value + MS + value + value 90432 // writing-mode 90433 case 5936: 90434 switch (charat(value, length + 11)) { 90435 // vertical-l(r) 90436 case 114: 90437 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value 90438 // vertical-r(l) 90439 case 108: 90440 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value 90441 // horizontal(-)tb 90442 case 45: 90443 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value 90444 // default: fallthrough to below 90445 } 90446 // flex, flex-direction, scroll-snap-type, writing-mode 90447 case 6828: case 4268: case 2903: 90448 return WEBKIT + value + MS + value + value 90449 // order 90450 case 6165: 90451 return WEBKIT + value + MS + 'flex-' + value + value 90452 // align-items 90453 case 5187: 90454 return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value 90455 // align-self 90456 case 5443: 90457 return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/g, '') + (!match(value, /flex-|baseline/) ? MS + 'grid-row-' + replace(value, /flex-|-self/g, '') : '') + value 90458 // align-content 90459 case 4675: 90460 return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/g, '') + value 90461 // flex-shrink 90462 case 5548: 90463 return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value 90464 // flex-basis 90465 case 5292: 90466 return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value 90467 // flex-grow 90468 case 6060: 90469 return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value 90470 // transition 90471 case 4554: 90472 return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value 90473 // cursor 90474 case 6187: 90475 return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value 90476 // background, background-image 90477 case 5495: case 3959: 90478 return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1') 90479 // justify-content 90480 case 4968: 90481 return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /space-between/, 'justify') + WEBKIT + value + value 90482 // justify-self 90483 case 4200: 90484 if (!match(value, /flex-|baseline/)) return MS + 'grid-column-align' + substr(value, length) + value 90485 break 90486 // grid-template-(columns|rows) 90487 case 2592: case 3360: 90488 return MS + replace(value, 'template-', '') + value 90489 // grid-(row|column)-start 90490 case 4384: case 3616: 90491 if (children && children.some(function (element, index) { return length = index, match(element.props, /grid-\w+-end/) })) { 90492 return ~indexof(value + (children = children[length].value), 'span', 0) ? value : (MS + replace(value, '-start', '') + value + MS + 'grid-row-span:' + (~indexof(children, 'span', 0) ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ';') 90493 } 90494 return MS + replace(value, '-start', '') + value 90495 // grid-(row|column)-end 90496 case 4896: case 4128: 90497 return (children && children.some(function (element) { return match(element.props, /grid-\w+-start/) })) ? value : MS + replace(replace(value, '-end', '-span'), 'span ', '') + value 90498 // (margin|padding)-inline-(start|end) 90499 case 4095: case 3583: case 4068: case 2532: 90500 return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value 90501 // (min|max)?(width|height|inline-size|block-size) 90502 case 8116: case 7059: case 5753: case 5535: 90503 case 5445: case 5701: case 4933: case 4677: 90504 case 5533: case 5789: case 5021: case 4765: 90505 // stretch, max-content, min-content, fill-available 90506 if (strlen(value) - 1 - length > 6) 90507 switch (charat(value, length + 1)) { 90508 // (m)ax-content, (m)in-content 90509 case 109: 90510 // - 90511 if (charat(value, length + 4) !== 45) 90512 break 90513 // (f)ill-available, (f)it-content 90514 case 102: 90515 return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value 90516 // (s)tretch 90517 case 115: 90518 return ~indexof(value, 'stretch', 0) ? prefix(replace(value, 'stretch', 'fill-available'), length, children) + value : value 90519 } 90520 break 90521 // grid-(column|row) 90522 case 5152: case 5920: 90523 return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function (_, a, b, c, d, e, f) { return (MS + a + ':' + b + f) + (c ? (MS + a + '-span:' + (d ? e : +e - +b)) + f : '') + value }) 90524 // position: sticky 90525 case 4949: 90526 // stick(y)? 90527 if (charat(value, length + 6) === 121) 90528 return replace(value, ':', ':' + WEBKIT) + value 90529 break 90530 // display: (flex|inline-flex|grid|inline-grid) 90531 case 6444: 90532 switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) { 90533 // (inline-)?fle(x) 90534 case 120: 90535 return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value 90536 // (inline-)?gri(d) 90537 case 100: 90538 return replace(value, ':', ':' + MS) + value 90539 } 90540 break 90541 // scroll-margin, scroll-margin-(top|right|bottom|left) 90542 case 5719: case 2647: case 2135: case 3927: case 2391: 90543 return replace(value, 'scroll-', 'scroll-snap-') + value 90544 } 90545 90546 return value 90547} 90548 90549;// ./node_modules/stylis/src/Middleware.js 90550/* unused harmony import specifier */ var Middleware_RULESET; 90551/* unused harmony import specifier */ var Middleware_combine; 90552/* unused harmony import specifier */ var Middleware_charat; 90553/* unused harmony import specifier */ var Middleware_substr; 90554/* unused harmony import specifier */ var Middleware_strlen; 90555/* unused harmony import specifier */ var Middleware_sizeof; 90556/* unused harmony import specifier */ var Middleware_tokenize; 90557 90558 90559 90560 90561 90562 90563/** 90564 * @param {function[]} collection 90565 * @return {function} 90566 */ 90567function middleware (collection) { 90568 var length = sizeof(collection) 90569
90570 return function (element, index, children, callback) { 90571 var output = '' 90572 90573 for (var i = 0; i < length; i++) 90574 output += collection[i](element, index, children, callback) || '' 90575 90576 return output 90577 } 90578} 90579 90580/** 90581 * @param {function} callback 90582 * @return {function} 90583 */ 90584function rulesheet (callback) { 90585 return function (element) { 90586 if (!element.root) 90587 if (element = element.return) 90588 callback(element) 90589 } 90590} 90591 90592/** 90593 * @param {object} element 90594 * @param {number} index 90595 * @param {object[]} children 90596 * @param {function} callback 90597 */ 90598function prefixer (element, index, children, callback) { 90599 if (element.length > -1) 90600 if (!element.return) 90601 switch (element.type) { 90602 case DECLARATION: element.return = prefix(element.value, element.length, children) 90603 return 90604 case KEYFRAMES: 90605 return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback) 90606 case RULESET: 90607 if (element.length) 90608 return combine(children = element.props, function (value) { 90609 switch (match(value, callback = /(::plac\w+|:read-\w+)/)) { 90610 // :read-(only|write) 90611 case ':read-only': case ':read-write': 90612 lift(copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})) 90613 lift(copy(element, {props: [value]})) 90614 Utility_assign(element, {props: filter(children, callback)}) 90615 break 90616 // :placeholder 90617 case '::placeholder': 90618 lift(copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]})) 90619 lift(copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]})) 90620 lift(copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]})) 90621 lift(copy(element, {props: [value]})) 90622 Utility_assign(element, {props: filter(children, callback)}) 90623 break 90624 } 90625 90626 return '' 90627 }) 90628 } 90629} 90630 90631/** 90632 * @param {object} element 90633 * @param {number} index 90634 * @param {object[]} children 90635 */ 90636function namespace (element) { 90637 switch (element.type) { 90638 case Middleware_RULESET: 90639 element.props = element.props.map(function (value) { 90640 return Middleware_combine(Middleware_tokenize(value), function (value, index, children) { 90641 switch (Middleware_charat(value, 0)) { 90642 // \f 90643 case 12: 90644 return Middleware_substr(value, 1, Middleware_strlen(value)) 90645 // \0 ( + > ~ 90646 case 0: case 40: case 43: case 62: case 126: 90647 return value 90648 // : 90649 case 58: 90650 if (children[++index] === 'global') 90651 children[index] = '', children[++index] = '\f' + Middleware_substr(children[index], index = 1, -1) 90652 // \s 90653 case 32: 90654 return index === 1 ? '' : value 90655 default: 90656 switch (index) { 90657 case 0: element = value 90658 return Middleware_sizeof(children) > 1 ? '' : value 90659 case index = Middleware_sizeof(children) - 1: case 2: 90660 return index === 2 ? value + element + element : value + element 90661 default: 90662 return value 90663 } 90664 } 90665 }) 90666 }) 90667 } 90668} 90669 90670;// ./node_modules/stylis/src/Parser.js 90671 90672 90673 90674 90675/** 90676 * @param {string} value 90677 * @return {object[]} 90678 */ 90679function compile (value) { 90680 return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value)) 90681} 90682 90683/** 90684 * @param {string} value 90685 * @param {object} root 90686 * @param {object?} parent 90687 * @param {string[]} rule 90688 * @param {string[]} rules 90689 * @param {string[]} rulesets 90690 * @param {number[]} pseudo 90691 * @param {number[]} points 90692 * @param {string[]} declarations 90693 * @return {object} 90694 */ 90695function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) { 90696 var index = 0 90697 var offset = 0 90698 var length = pseudo 90699 var atrule = 0 90700 var property = 0 90701 var previous = 0 90702 var variable = 1 90703 var scanning = 1 90704 var ampersand = 1 90705 var character = 0 90706 var type = '' 90707 var props = rules 90708 var children = rulesets 90709 var reference = rule 90710 var characters = type 90711 90712 while (scanning) 90713 switch (previous = character, character = next()) { 90714 // ( 90715 case 40: 90716 if (previous != 108 && charat(characters, length - 1) == 58) { 90717 if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f', abs(index ? points[index - 1] : 0)) != -1) 90718 ampersand = -1 90719 break 90720 } 90721 // " ' [ 90722 case 34: case 39: case 91: 90723 characters += delimit(character) 90724 break 90725 // \t \n \r \s 90726 case 9: case 10: case 13: case 32: 90727 characters += whitespace(previous) 90728 break 90729 // \ 90730 case 92: 90731 characters += escaping(caret() - 1, 7) 90732 continue 90733 // / 90734 case 47: 90735 switch (peek()) { 90736 case 42: case 47: 90737 append(comment(commenter(next(), caret()), root, parent, declarations), declarations) 90738 if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters) && substr(characters, -1, void 0) !== ' ') characters += ' ' 90739 break 90740 default: 90741 characters += '/' 90742 } 90743 break 90744 // { 90745 case 123 * variable: 90746 points[index++] = strlen(characters) * ampersand 90747 // } ; \0 90748 case 125 * variable: case 59: case 0: 90749 switch (character) { 90750 // \0 } 90751 case 0: case 125: scanning = 0 90752 // ; 90753 case 59 + offset: if (ampersand == -1) characters = replace(characters, /\f/g, '') 90754 if (property > 0 && (strlen(characters) - length || (variable === 0 && previous === 47))) 90755 append(property >
90755 32 ? declaration(characters + ';', rule, parent, length - 1, declarations) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2, declarations), declarations) 90756 break 90757 // @ ; 90758 case 59: characters += ';' 90759 // { rule/at-rule 90760 default: 90761 append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets) 90762 90763 if (character === 123) 90764 if (offset === 0) 90765 parse(characters, root, reference, reference, props, rulesets, length, points, children) 90766 else { 90767 switch (atrule) { 90768 // c(ontainer) 90769 case 99: 90770 if (charat(characters, 3) === 110) break 90771 // l(ayer) 90772 case 108: 90773 if (charat(characters, 2) === 97) break 90774 default: 90775 offset = 0 90776 // d(ocument) m(edia) s(upports) 90777 case 100: case 109: case 115: 90778 } 90779 if (offset) parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children) 90780 else parse(characters, reference, reference, reference, [''], children, 0, points, children) 90781 } 90782 } 90783 90784 index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo 90785 break 90786 // : 90787 case 58: 90788 length = 1 + strlen(characters), property = previous 90789 default: 90790 if (variable < 1) 90791 if (character == 123) 90792 --variable 90793 else if (character == 125 && variable++ == 0 && prev() == 125) 90794 continue 90795 90796 switch (characters += from(character), character * variable) { 90797 // & 90798 case 38: 90799 ampersand = offset > 0 ? 1 : (characters += '\f', -1) 90800 break 90801 // , 90802 case 44: 90803 points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1 90804 break 90805 // @ 90806 case 64: 90807 // - 90808 if (peek() === 45) 90809 characters += delimit(next()) 90810 90811 atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++ 90812 break 90813 // - 90814 case 45: 90815 if (previous === 45 && strlen(characters) == 2) 90816 variable = 0 90817 } 90818 } 90819 90820 return rulesets 90821} 90822 90823/** 90824 * @param {string} value 90825 * @param {object} root 90826 * @param {object?} parent 90827 * @param {number} index 90828 * @param {number} offset 90829 * @param {string[]} rules 90830 * @param {number[]} points 90831 * @param {string} type 90832 * @param {string[]} props 90833 * @param {string[]} children 90834 * @param {number} length 90835 * @param {object[]} siblings 90836 * @return {object} 90837 */ 90838function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length, siblings) { 90839 var post = offset - 1 90840 var rule = offset === 0 ? rules : [''] 90841 var size = sizeof(rule) 90842 90843 for (var i = 0, j = 0, k = 0; i < index; ++i) 90844 for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) 90845 if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x]))) 90846 props[k++] = z 90847 90848 return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings) 90849} 90850 90851/** 90852 * @param {number} value 90853 * @param {object} root 90854 * @param {object?} parent 90855 * @param {object[]} siblings 90856 * @return {object} 90857 */ 90858function comment (value, root, parent, siblings) { 90859 return node(value, root, parent, COMMENT, from(Tokenizer_char()), substr(value, 2, -2), 0, siblings) 90860} 90861 90862/** 90863 * @param {string} value 90864 * @param {object} root 90865 * @param {object?} parent 90866 * @param {number} length 90867 * @param {object[]} siblings 90868 * @return {object} 90869 */ 90870function declaration (value, root, parent, length, siblings) { 90871 return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings) 90872} 90873 90874;// ./node_modules/styled-components/dist/styled-components.browser.esm.js 90875/* unused harmony import specifier */ var t; 90876/* unused harmony import specifier */ var s; 90877var r,i;const c="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",a="active",l="data-styled-version",u="6.4.2",h="/*!sc*/\n",d="undefined"!=typeof window&&"undefined"!=typeof document;function p(e){if("undefined"!=typeof process&&void 0!==process.env){const t=process.env[e];if(void 0!==t&&""!==t)return"false"!==t}}const f=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:null!==(i=null!==(r=p("REACT_APP_SC_DISABLE_SPEEDY"))&&void 0!==r?r:p("SC_DISABLE_SPEEDY"))&&void 0!==i?i:"undefined"!=typeof process&&void 0!==process.env&&"production"!=="production"),m="sc-keyframes-",y={},g= false?0:{};function v(e,...t){return true?new Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${e} for more information.${t.length>0?` Args: ${t.join(", ")}`:""}`):0}const S=(/* unused pure expression or super */ null && (1<<30));let b=new Map,w=new Map,N=1;const C=e=>{if(b.has(e))return b.get(e);for(;w.has(N);)N++;const t=N++;if(false)// removed by dead control flow 90878{}return b.set(e,t),w.set(t,e),t},O=e=>w.get(e),E=(e,t)=>{N=t+1,b.set(e,t),w.set(t,e)},A=/invalid hook call/i,P=new Set,_=(e,n)=>{if(false)// removed by dead control flow 90879{}},I=Object.freeze([]),$=Object.freeze({});function R(e,t,n=$){return e.theme!==n.theme&&e.theme||t||n.theme}const j=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,x=/(^-|-$)/g;function T(e){return e.replace(j,"-").replace(x,"")}const k=/(a)(d)/gi,D=e=>String.fromCharCode(e+(e>25?39:97));function V(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=D(t%52)+n;return(D(t%52)+n).replace(k,"$1-$2")}const M=5381,G=(e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e},F=e=>G(M,e);function z(e){return V(F(e)>>>0)}function W(e){return false||e.displayName||e.name||"Component"}function L(e){return"string"==typeof e&&( true||0)}function B(e){return L(e)?`styled.${e}`:`Styled(${W(e)})`}const q=Symbol.for("react.memo"),H=Symbol.for("react.forward_ref"),Y={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0}
vendor: 9,215 bytes, lines 90879-90881
90879,U={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},J={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},X={[H]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[q]:J};function K(e){return("type"in(t=e)&&t.type.$$typeof)===q?J:"$$typeof"in e?X[e.$$typeof]:Y;// removed by dead control flow 90880 var t; }const Q=Object.defineProperty,Z=Object.getOwnPropertyNames,ee=Object.getOwnPropertySymbols,te=Object.getOwnPropertyDescriptor,ne=Object.getPrototypeOf,oe=Object.prototype;function se(e,t,n){if("string"!=typeof t){const o=ne(t);o&&o!==oe&&se(e,o,n);const s=Z(t).concat(ee(t)),r=K(e),i=K(t);for(let o=0;o<s.length;++o){const c=s[o];if(!(c in U||n&&n[c]||i&&c in i||r&&c in r)){const n=te(t,c);try{Q(e,c,n)}catch(e){}}}}return e}function re(e){return"function"==typeof e}const ie=Symbol.for("react.forward_ref");function ce(e){return null!=e&&("object"==typeof e||"function"==typeof e)&&e.$$typeof===ie&&"styledComponentId"in e}function ae(e,t){return e&&t?e+" "+t:e||t||""}function le(e,t){return e.join(t||"")}function ue(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function he(e,t,n=!1){if(!n&&!ue(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(let n=0;n<t.length;n++)e[n]=he(e[n],t[n]);else if(ue(t))for(const n in t)e[n]=he(e[n],t[n]);return e}function de(e,t){Object.defineProperty(e,"toString",{value:t})}const pe=class{constructor(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}indexOfGroup(e){if(e===this._cGroup)return this._cIndex;let t=this._cIndex;if(e>this._cGroup)for(let n=this._cGroup;n<e;n++)t+=this.groupSizes[n];else for(let n=this._cGroup-1;n>=e;n--)t-=this.groupSizes[n];return this._cGroup=e,this._cIndex=t,t}insertRules(e,t){if(e>=this.groupSizes.length){const t=this.groupSizes,n=t.length;let o=n;for(;e>=o;)if(o<<=1,o<0)throw v(16,`${e}`);this.groupSizes=new Uint32Array(o),this.groupSizes.set(t),this.length=o;for(let e=n;e<o;e++)this.groupSizes[e]=0}let n=this.indexOfGroup(e+1),o=0;for(let s=0,r=t.length;s<r;s++)this.tag.insertRule(n,t[s])&&(this.groupSizes[e]++,n++,o++);o>0&&this._cGroup>e&&(this._cIndex+=o)}clearGroup(e){if(e<this.length){const t=this.groupSizes[e],n=this.indexOfGroup(e),o=n+t;this.groupSizes[e]=0;for(let e=n;e<o;e++)this.tag.deleteRule(n);t>0&&this._cGroup>e&&(this._cIndex-=t)}}getGroup(e){let t="";if(e>=this.length||0===this.groupSizes[e])return t;const n=this.groupSizes[e],o=this.indexOfGroup(e),s=o+n;for(let e=o;e<s;e++)t+=this.tag.getRule(e)+h;return t}},fe=`style[${c}][${l}="${u}"]`,me=new RegExp(`^${c}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`),ye=e=>"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot||"host"in e&&11===e.nodeType,ge=e=>{if(!e)return document;if(ye(e))return e;if("getRootNode"in e){const t=e.getRootNode();if(ye(t))return t}return document},ve=(e,t,n)=>{const o=n.split(",");let s;for(let n=0,r=o.length;n<r;n++)(s=o[n])&&e.registerName(t,s)},Se=(e,t)=>{var n;const o=(null!==(n=t.textContent)&&void 0!==n?n:"").split(h),s=[];for(let t=0,n=o.length;t<n;t++){const n=o[t].trim();if(!n)continue;const r=n.match(me);if(r){const t=0|parseInt(r[1],10),n=r[2];0!==t&&(E(n,t),ve(e,n,r[3]),e.getTag().insertRules(t,s)),s.length=0}else s.push(n)}},be=e=>{const t=ge(e.options.target).querySelectorAll(fe);for(let n=0,o=t.length;n<o;n++){const o=t[n];o&&o.getAttribute(c)!==a&&(Se(e,o),o.parentNode&&o.parentNode.removeChild(o))}};let we=!1;function Ne(){if(!1!==we)return we;if("undefined"!=typeof document){const e=document.head.querySelector('meta[property="csp-nonce"]');if(e)return we=e.nonce||e.getAttribute("content")||void 0;const t=document.head.querySelector('meta[name="sc-nonce"]');if(t)return we=t.getAttribute("content")||void 0}return we= true?__webpack_require__.nc:0}const Ce=(e,t)=>{const n=document.head,o=e||n,s=document.createElement("style"),r=(e=>{const t=Array.from(e.querySelectorAll(`style[${c}]`));return t[t.length-1]})(o),i=void 0!==r?r.nextSibling:null;s.setAttribute(c,a),s.setAttribute(l,u);const h=t||Ne();return h&&s.setAttribute("nonce",h),o.insertBefore(s,i),s},Oe=class{constructor(e,t){this.element=Ce(e,t),this.element.appendChild(document.createTextNode("")),this.sheet=(e=>{var t;if(e.sheet)return e.sheet;const n=null!==(t=e.getRootNode().styleSheets)&&void 0!==t?t:document.styleSheets;for(let t=0,o=n.length;t<o;t++){const o=n[t];if(o.ownerNode===e)return o}throw v(17)})(this.element),this.length=0}insertRule(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}}deleteRule(e){this.sheet.deleteRule(e),this.length--}getRule(e){const t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""}},Ee=class{constructor(e,t){this.element=Ce(e,t),this.nodes=this.element.childNodes,this.length=0}insertRule(e,t){if(e<=this.length&&e>=0){const n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1}deleteRule(e){this.element.removeChild(this.nodes[e]),this.length--}getRule(e){return e<this.length?this.nodes[e].textContent:""}};let Ae=d;const Pe={isServer:!d,useCSSOMInjection:!f};class _e{static registerId(e){return C(e)}constructor(e=$,t={},n){this.options=Object.assign(Object.assign({},Pe),e),this.gs=t,this.keyframeIds=new Set,this.names=new Map(n),this.server=!!e.isServer,!this.server&&d&&Ae&&(Ae=!1,be(this)),de(this,()=>(e=>{const t=e.getTag(),{length:n}=t;let o="";for(let s=0;s<n;s++){const n=O(s);if(void 0===n)continue;const r=e.names.get(n);if(void 0===r||!r.size)continue;const i=t.getGroup(s);if(0===i.length)continue;const a=c+".g"+s+'[id="'+n+'"]';let l="";for(const e of r)e.length>0&&(l+=e+",");o+=i+a+'{content:"'+l+'"}'+h}return o})(this))}rehydrate(){!this.server&&d&&be(this)}reconstructWithOptions(e,t=!0){const n=new _e(Object.assign(Object.assign({},this.options),e),this.gs,t&&this.names||void 0);return n.keyframeIds=new Set(this.keyframeIds),!this.server&&d&&e.target!==this.options.target&&ge(this.options.target)!==ge(e.target)&&be(n),n}allocateGSInstance(e){return this.gs[e]=(this.gs[e]||0)+1}getTag(){return this.tag||(this.tag=(e=(({useCSSOMInjection:e,target:t,nonce:n})=>e?new Oe(t,n):new Ee(t,n))(this.options),new pe(e)));// removed by dead control flow 90881 var e; }hasNameForId(e,t){var n,o;return null!==(o=null===(n=this.names.get(e))||void 0===n?void 0:n.has(t))&&void 0!==o&&o}registerName(e,t){C(e),e.startsWith(m)&&this.keyframeIds.add(e);const n=this.names.get(e);n?n.add(t):this.names.set(e,new Set([t]))}insertRules(e,t,n){this.registerName(e,t),this.getTag().insertRules(C(e),n)}clearNames(e){this.names.has(e)&&this.names.get(e).clear()}clearRules(e){this.getTag().clearGroup(C(e)),this.clearNames(e)}clearTag(){this.tag=void 0}}const Ie=new WeakSet,$e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Re(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in $e||e.startsWith("--")?String(t).trim():t+"px"}const je=47;function xe(e){if(45===e.charCodeAt(0)&&45===e.charCodeAt(1))return e;let t="";for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t+=o>=65&&o<=90?"-"+String.fromCharCode(o+32):e[n]}return t.startsWith("ms-")?"-"+t:t}const Te=Symbol.for("sc-keyframes");function ke(e){return"object"==typeof e&&null!==e&&Te in e}function De(e){return re(e)&&!(e.prototype&&e.prototype.isReactComponent)}const Ve=e=>null==e||!1===e||""===e,Me=Symbol.for("react.client.reference");function Ge(e){return e.$$typeof===Me}function Fe(e){const t=e.$$id,n=(t&&t.includes("#")?t.split("#").pop():t)||e.name||"unknown";console.warn(`Interpolating a client component (${n}) as a selector is not supported in server components. The component selector pattern requires access to the component's internal class name, which is not available across the server/client boundary. Use a plain CSS class selector instead.`)}function ze(e,t){for(const n in e){const o=e[n];e.hasOwnProperty(n)&&!Ve(o)&&(Array.isArray(o)&&Ie.has(o)||re(o)?t.push(xe(n)+":",o,";"):ue(o)?(t.push(n+" {"),ze(o,t),t.push("}")):t.push(xe(n)+": "+Re(n,o)+";"))}}function We(e,t,n,o,s=[]){if(Ve(e))return s;const r=typeof e;if("string"===r)return s.push(e),s;if("function"===r){if(Ge(e))return false&&0,s;if(De(e)&&t){const r=e(t);return true||0,We(r,t,n,o,s)}return s.push(e),s}if(Array.isArray(e)){for(let r=0;r<e.length;r++)We(e[r],t,n,o,s);return s}return ce(e)?(s.push(`.${e.styledComponentId}`),s):ke(e)?(n?(e.inject(n,o),s.push(e.getName(o))):s.push(e),s):Ge(e)?( false&&0,s):ue(e)?e.toString!==Object.prototype.toString?(s.push(e.toString()),s):(ze(e,s),s):(s.push(e.toString()),s)}const Le=F(u);class Be{constructor(e,t,n){this.rules=e,this.componentId=t,this.baseHash=G(Le,t),this.baseStyle=n,_e.registerId(t)}
vendor: 15,569 bytes, lines 90881-90894
90881generateAndInjectStyles(e,t,n){let o=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";{let s="";for(let o=0;o<this.rules.length;o++){const r=this.rules[o];if("string"==typeof r)s+=r;else if(r)if(De(r)){const o=r(e);"string"==typeof o?s+=o:null!=o&&!1!==o&&( true||0,s+=le(We(o,e,t,n)))}else s+=le(We(r,e,t,n))}if(s){this.dynamicNameCache||(this.dynamicNameCache=new Map);const e=n.hash?n.hash+s:s;let r=this.dynamicNameCache.get(e);if(!r){if(r=V(G(G(this.baseHash,n.hash),s)>>>0),this.dynamicNameCache.size>=200){const e=this.dynamicNameCache.keys().next().value;void 0!==e&&this.dynamicNameCache.delete(e)}this.dynamicNameCache.set(e,r)}if(!t.hasNameForId(this.componentId,r)){const e=n(s,"."+r,void 0,this.componentId);t.insertRules(this.componentId,r,e)}o=ae(o,r)}}return o}}const qe=/&/g;function He(e,t){let n=0;for(;--t>=0&&92===e.charCodeAt(t);)n++;return!(1&~n)}function Ye(e){const t=e.length;let n="",o=0,s=0,r=0,i=!1,c=!1;for(let a=0;a<t;a++){const l=e.charCodeAt(a);if(0!==r||i||l!==je||42!==e.charCodeAt(a+1))if(i)42===l&&e.charCodeAt(a+1)===je&&(i=!1,a++);else if(34!==l&&39!==l||He(e,a)){if(0===r)if(123===l)s++;else if(125===l){if(s--,s<0){c=!0;let n=a+1;for(;n<t;){const t=e.charCodeAt(n);if(59===t||10===t)break;n++}n<t&&59===e.charCodeAt(n)&&n++,s=0,a=n-1,o=n;continue}0===s&&(n+=e.substring(o,a+1),o=a+1)}else 59===l&&0===s&&(n+=e.substring(o,a+1),o=a+1)}else 0===r?r=l:r===l&&(r=0);else i=!0,a++}return c||0!==s||0!==r?(o<t&&0===s&&0===r&&(n+=e.substring(o)),n):e}function Ue(e,t){const n=t+" ",o=","+n;for(let s=0;s<e.length;s++){const r=e[s];if("rule"===r.type){r.value=(n+r.value).replaceAll(",",o);const e=r.props,t=[];for(let o=0;o<e.length;o++)t[o]=n+e[o];r.props=t}Array.isArray(r.children)&&"@keyframes"!==r.type&&Ue(r.children,t)}return e}function Je({options:e=$,plugins:t=I}=$){let n,s,r;const i=(e,t,o)=>o.startsWith(s)&&o.endsWith(s)&&o.replaceAll(s,"").length>0?`.${n}`:e,c=t.slice();c.push(e=>{e.type===RULESET&&e.value.includes("&")&&(r||(r=new RegExp(`\\${s}\\b`,"g")),e.props[0]=e.props[0].replace(qe,s).replace(r,i))}),e.prefix&&c.push(prefixer),c.push(stringify);let a=[];const l=middleware(c.concat(rulesheet(e=>a.push(e)))),u=(t,i="",c="",u="&")=>{n=u,s=i,r=void 0;const h=function(e){const t=-1!==e.indexOf("//"),n=-1!==e.indexOf("}");if(!t&&!n)return e;if(!t)return Ye(e);const o=e.length;let s="",r=0,i=0,c=0,a=0,l=0,u=!1;for(;i<o;){const t=e.charCodeAt(i);if(34!==t&&39!==t||He(e,i))if(0===c)if(t===je&&i+1<o&&42===e.charCodeAt(i+1)){for(i+=2;i+1<o&&(42!==e.charCodeAt(i)||e.charCodeAt(i+1)!==je);)i++;i+=2}else if(40!==t)if(41!==t)if(a>0)i++;else if(42===t&&i+1<o&&e.charCodeAt(i+1)===je)s+=e.substring(r,i),i+=2,r=i,u=!0;else if(t===je&&i+1<o&&e.charCodeAt(i+1)===je){for(s+=e.substring(r,i);i<o&&10!==e.charCodeAt(i);)i++;r=i,u=!0}else 123===t?l++:125===t&&l--,i++;else a>0&&a--,i++;else a++,i++;else i++;else 0===c?c=t:c===t&&(c=0),i++}return u?(r<o&&(s+=e.substring(r)),0===l?s:Ye(s)):0===l?e:Ye(e)}(t);let d=compile(c||i?c+" "+i+" { "+h+" }":h);return e.namespace&&(d=Ue(d,e.namespace)),a=[],serialize(d,l),a},h=e;let d=M;for(let e=0;e<t.length;e++)t[e].name||v(15),d=G(d,t[e].name);return(null==h?void 0:h.namespace)&&(d=G(d,h.namespace)),(null==h?void 0:h.prefix)&&(d=G(d,"p")),u.hash=d!==M?d.toString():"",u}const Xe=new _e,Ke=Je(),Qe=react.createContext({shouldForwardProp:void 0,styleSheet:Xe,stylis:Ke,stylisPlugins:void 0}),Ze=Qe.Consumer;function et(){return react.useContext(Qe)}function tt(e){var n;const o=et(),{styleSheet:s}=o,r=react.useMemo(()=>{let t=s;return e.sheet?t=e.sheet:e.target?t=t.reconstructWithOptions(void 0!==e.nonce?{target:e.target,nonce:e.nonce}:{target:e.target},!1):void 0!==e.nonce&&(t=t.reconstructWithOptions({nonce:e.nonce})),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.nonce,e.sheet,e.target,s]),i=react.useMemo(()=>{var t;return void 0===e.stylisPlugins&&void 0===e.namespace&&void 0===e.enableVendorPrefixes?o.stylis:Je({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:null!==(t=e.stylisPlugins)&&void 0!==t?t:o.stylisPlugins})},[e.enableVendorPrefixes,e.namespace,e.stylisPlugins,o.stylis,o.stylisPlugins]),c="shouldForwardProp"in e?e.shouldForwardProp:o.shouldForwardProp,a=null!==(n=e.stylisPlugins)&&void 0!==n?n:o.stylisPlugins,l=react.useMemo(()=>({shouldForwardProp:c,styleSheet:r,stylis:i,stylisPlugins:a}),[c,r,i,a]);return react.createElement(Qe.Provider,{value:l},e.children)}const nt=react.createContext(void 0),ot=nt.Consumer;function st(){const e=react.useContext(nt);if(!e)throw v(18);return e}function rt(e){const n=react.useContext(nt),o=react.useMemo(()=>function(e,t){if(!e)throw v(14);if(re(e)){const n=e(t);if(false)// removed by dead control flow 90882{}return n}if(Array.isArray(e)||"object"!=typeof e)throw v(8);return t?Object.assign(Object.assign({},t),e):e}(e.theme,n),[e.theme,n]);return e.children?react.createElement(nt.Provider,{value:o},e.children):null}const it=Object.prototype.hasOwnProperty,ct={};function at(e,t){const n="string"!=typeof e?"sc":T(e);ct[n]=(ct[n]||0)+1;const o=n+"-"+z(u+n+ct[n]);return t?t+"-"+o:o}let lt;function ut(o,s,r){const i=ce(o),c=o,a=!L(o),{attrs:l=I,componentId:u=at(s.displayName,s.parentComponentId),displayName:h=B(o)}=s,d=s.displayName&&s.componentId?T(s.displayName)+"-"+s.componentId:s.componentId||u,p=i&&c.attrs?c.attrs.concat(l).filter(Boolean):l;let{shouldForwardProp:f}=s;if(i&&c.shouldForwardProp){const e=c.shouldForwardProp;if(s.shouldForwardProp){const t=s.shouldForwardProp;f=(n,o)=>e(n,o)&&t(n,o)}else f=e}const m=new Be(r,d,i?c.componentStyle:void 0);function y(o,s){return function(o,s,r){const{attrs:i,componentStyle:c,defaultProps:a,foldedComponentIds:l,styledComponentId:u,target:h}=o,d=react.useContext(nt),p=et(),f=o.shouldForwardProp||p.shouldForwardProp; false&&0;const m=R(s,d,a)||$;let y,g;{const e=react.useRef(null),n=e.current;if(null!==n&&n[1]===m&&n[2]===p.styleSheet&&n[3]===p.stylis&&n[7]===c&&function(e,t,n){const o=e,s=t;let r=0;for(const e in s)if(it.call(s,e)&&(r++,o[e]!==s[e]))return!1;return r===n}(n[0],s,n[4]))y=n[5],g=n[6];else{y=function(e,t,n){const o=Object.assign(Object.assign({},t),{className:void 0,theme:n}),s=e.length>1;for(let n=0;n<e.length;n++){const r=e[n],i=re(r)?r(s?Object.assign({},o):o):r;for(const e in i)"className"===e?o.className=ae(o.className,i[e]):"style"===e?o.style=Object.assign(Object.assign({},o.style),i[e]):e in t&&void 0===t[e]||(o[e]=i[e])}return"className"in t&&"string"==typeof t.className&&(o.className=ae(o.className,t.className)),o}(i,s,m),g=function(e,n,o,s){const r=e.generateAndInjectStyles(n,o,s);return false&&0,r}(c,y,p.styleSheet,p.stylis);let n=0;for(const e in s)it.call(s,e)&&n++;e.current=[s,m,p.styleSheet,p.stylis,n,y,g,c]}} false&&0;const v=y.as||h,S=function(t,n,o,s){const r={};for(const i in t)void 0===t[i]||"$"===i[0]||"as"===i||"theme"===i&&t.theme===o||("forwardedAs"===i?r.as=t.forwardedAs:s&&!s(i,n)||(r[i]=t[i],s||"development"!=="production"||0||0||0||0||(0)));return r}(y,v,m,f);let b=ae(l,u);return g&&(b+=" "+g),y.className&&(b+=" "+y.className),S[L(v)&&v.includes("-")?"class":"className"]=b,r&&(S.ref=r),(0,react.createElement)(v,S)}(g,o,s)}y.displayName=h;let g=react.forwardRef(y);return g.attrs=p,g.componentStyle=m,g.displayName=h,g.shouldForwardProp=f,g.foldedComponentIds=i?ae(c.foldedComponentIds,c.styledComponentId):"",g.styledComponentId=d,g.target=i?c.target:o,Object.defineProperty(g,"defaultProps",{get(){return this._foldedDefaultProps},set(e){this._foldedDefaultProps=i?function(e,...t){for(const n of t)he(e,n,!0);return e}({},c.defaultProps,e):e}}), false&&(0),de(g,()=>`.${g.styledComponentId}`),a&&se(g,o,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),g}var ht=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]);function dt(e,t){const n=[e[0]];for(let o=0,s=t.length;o<s;o+=1)n.push(t[o],e[o+1]);return n}const pt=e=>(Ie.add(e),e);function ft(e,...t){if(re(e)||ue(e))return pt(We(dt(I,[e,...t])));const n=e;return 0===t.length&&1===n.length&&"string"==typeof n[0]?We(n):pt(We(dt(n,t)))}function mt(e,t,n=$){if(!t)throw v(1,t);const o=(o,...s)=>e(t,n,ft(o,...s));return o.attrs=o=>mt(e,t,Object.assign(Object.assign({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)})),o.withConfig=o=>mt(e,t,Object.assign(Object.assign({},n),o)),o}const yt=e=>mt(ut,e),gt=yt;ht.forEach(e=>{gt[e]=yt(e)});class vt{constructor(e,t){this.instanceRules=new Map,this.rules=e,this.componentId=t,this.isStatic=function(e){for(let t=0;t<e.length;t+=1){const n=e[t];if(re(n)&&!ce(n))return!1}return!0}(e),_e.registerId(this.componentId)}removeStyles(e,t){this.instanceRules.delete(e),this.rebuildGroup(t)}renderStyles(e,t,n,o){const s=this.componentId;if(this.isStatic){if(n.hasNameForId(s,s+e))this.instanceRules.has(e)||this.computeRules(e,t,n,o);else{const r=this.computeRules(e,t,n,o);n.insertRules(s,r.name,r.rules)}return}const r=this.instanceRules.get(e);if(this.computeRules(e,t,n,o),!n.server&&r){const t=r.rules,n=this.instanceRules.get(e).rules;if(t.length===n.length){let e=!0;for(let o=0;o<t.length;o++)if(t[o]!==n[o]){e=!1;break}if(e)return}}this.rebuildGroup(n)}computeRules(e,t,n,o){const s=le(We(this.rules,t,n,o)),r={name:this.componentId+e,rules:o(s,"")};return this.instanceRules.set(e,r),r}rebuildGroup(e){const t=this.componentId;e.clearRules(t);for(const n of this.instanceRules.values())e.insertRules(t,n.name,n.rules)}}function St(e,...n){const o=ft(e,...n),s=`sc-global-${z(JSON.stringify(o))}`,r=new vt(o,s); false&&0;const i=e=>{const n=et(),i=react.useContext(nt);let a;{const e=react.useRef(null);null===e.current&&(e.current=n.styleSheet.allocateGSInstance(s)),a=e.current} false&&0, false&&0,n.styleSheet.server&&c(a,e,n.styleSheet,i,n.stylis);{const o=r.isStatic?[a,n.styleSheet,r]:[a,e,n.styleSheet,i,n.stylis,r],l=react.useRef(r);react.useLayoutEffect(()=>{n.styleSheet.server||(l.current!==r&&(n.styleSheet.clearRules(s),l.current=r),c(a,e,n.styleSheet,i,n.stylis))},o),react.useLayoutEffect(()=>()=>{n.styleSheet.server||r.removeStyles(a,n.styleSheet)},[a,n.styleSheet,r])}return n.styleSheet.server&&r.instanceRules.delete(a),null};function c(e,t,n,o,s){if(r.isStatic)r.renderStyles(e,y,n,s);else{const c=Object.assign(Object.assign({},t),{theme:R(t,o,i.defaultProps)});r.renderStyles(e,c,n,s)}}return react.memo(i)}function bt(e,t,n,o,s){for(const r in e){const i=e[r],c=s?s+"-"+r:r;if("object"==typeof i&&null!==i){const e={};bt(i,t,e,o,c),n[r]=e}else n[r]=o(c,i,r)}}function wt(e,t,n,o){let s="";for(const r in e){const i=e[r],c=t[r],a=o?o+"-"+r:r;"object"==typeof i&&null!==i?"object"==typeof c&&null!==c&&(s+=wt(i,c,n,a)):void 0!==c&&"function"!=typeof c&&(s+="--"+n+a+":"+c+";")}return s}function Nt(e,t){var n,o;const s=(null!==(n=null==t?void 0:t.prefix)&&void 0!==n?n:"sc")+"-",r=null!==(o=null==t?void 0:t.selector)&&void 0!==o?o:":root",i=function(e,t){const n={};return bt(e,t,n,e=>"--"+t+e),n}(e,s),c=function(e,t){const n={};return bt(e,t,n,(e,n)=>{if(false)// removed by dead control flow 90883{}return"var(--"+t+e+", "+n+")"}),n}(e,s),a=St` 90884 ${r} { 90885 ${t=>wt(e,t.theme,s)} 90886 } 90887 `;return Object.assign(c,{GlobalStyle:a,raw:e,vars:i,resolve(t){if(!d)throw new Error("createTheme.resolve() is client-only");const n=null!=t?t:document.documentElement;return function(e,t,n){const o={};return bt(e,t,o,(e,o)=>n.getPropertyValue("--"+t+e).trim()||o),o}(e,s,getComputedStyle(n))}})}var Ct;class Ot{constructor(e,t){this[Ct]=!0,this.inject=(e,t=Ke)=>{const n=this.getName(t);if(!e.hasNameForId(this.id,n)){const o=t(this.rules,n,"@keyframes");e.insertRules(this.id,n,o)}},this.name=e,this.id=m+e,this.rules=t,C(this.id),de(this,()=>{throw v(12,String(this.name))})}getName(e=Ke){return e.hash?this.name+V(+e.hash>>>0):this.name}}function Et(e,...t){ false&&0;const n=le(ft(e,...t)),o=z(n);return new Ot(o,n)}function At(e){const n=t.forwardRef((n,o)=>{const s=R(n,t.useContext(nt),e.defaultProps);return false&&0,t.createElement(e,Object.assign(Object.assign({},n),{theme:s,ref:o}))});return n.displayName=`WithTheme(${W(e)})`,se(n,e)}Ct=Te;class Pt{constructor({nonce:e}={}){this._emitSheetCSS=()=>{const e=this.instance.toString();if(!e)return"";const t=this.instance.options.nonce||Ne();return`<style ${le([t&&`nonce="${t}"`,`${c}="true"`,`${l}="${u}"`].filter(Boolean)," ")}>${e}</style>`},this.getStyleTags=()=>{if(this.sealed)throw v(2);return this._emitSheetCSS()},this.getStyleElement=()=>{if(this.sealed)throw v(2);const e=this.instance.toString();if(!e)return[];const n={[c]:"",[l]:u,dangerouslySetInnerHTML:{__html:e}},o=this.instance.options.nonce||Ne();return o&&(n.nonce=o),[t.createElement("style",Object.assign({},n,{key:"sc-0-0"}))]},this.seal=()=>{this.sealed=!0},this.instance=new _e({isServer:!0,nonce:e}),this.sealed=!1}collectStyles(e){if(this.sealed)throw v(2);return t.createElement(tt,{sheet:this.instance},e)}interleaveWithNodeStream(e){throw v(3)}}const _t={StyleSheet:_e,mainSheet:Xe}; false&&0;const It=(/* unused pure expression or super */ null && (`__sc-${c}__`)); false&&(0);const $t=/:(?:(first)-child|(last)-child|(only)-child|(nth-child)\(([^()]+)\)|(nth-last-child)\(([^()]+)\))/g,Rt=(/* unused pure expression or super */ null && (`:not(style[${c}])`)),jt=(/* unused pure expression or super */ null && (`style[${c}]`));function xt(e){return-1===e.indexOf("-child")?e:($t.lastIndex=0,e.replace($t,(e,t,n,o,s,r,i,c)=>t?`:nth-child(1 of ${Rt})`:n?`:nth-last-child(1 of ${Rt})`:o?`:nth-child(1 of ${Rt}):nth-last-child(1 of ${Rt})`:s?-1!==r.indexOf(" of ")?e:`:nth-child(${r} of ${Rt})`:-1!==c.indexOf(" of ")?e:`:nth-last-child(${c} of ${Rt})`))}function Tt(e,t){if(-1===e.indexOf("+"))return;let n=0,o=0;for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);if(40===r)n++;else if(41===r)n--;else if(91===r)o++;else if(93===r)o--;else if(43===r&&0===n&&0===o&&!He(e,s)){const n=e.substring(0,s),o=e.substring(s+1);t.push(n+"+"+jt+"+"+o),t.push(n+"+"+jt+"+"+jt+"+"+o)}}}function kt(e){if(e.type===s){const t=e.props,n=[];for(let e=0;e<t.length;e++){const o=xt(t[e]);n.push(o),Tt(o,n)}e.props=n}} 90888//# sourceMappingURL=styled-components.browser.esm.js.map 90889 90890 90891/***/ }, 90892 90893/***/ 8674 90894(__unused_webpack_module, __webpack_exports__, __webpack_require__)
vendor: 20,150 bytes, lines 90894-91336
90894 { 90895 90896"use strict"; 90897__webpack_require__.r(__webpack_exports__); 90898/* harmony export */ __webpack_require__.d(__webpack_exports__, { 90899/* harmony export */ __addDisposableResource: () => (/* binding */ __addDisposableResource), 90900/* harmony export */ __assign: () => (/* binding */ __assign), 90901/* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator), 90902/* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator), 90903/* harmony export */ __asyncValues: () => (/* binding */ __asyncValues), 90904/* harmony export */ __await: () => (/* binding */ __await), 90905/* harmony export */ __awaiter: () => (/* binding */ __awaiter), 90906/* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet), 90907/* harmony export */ __classPrivateFieldIn: () => (/* binding */ __classPrivateFieldIn), 90908/* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet), 90909/* harmony export */ __createBinding: () => (/* binding */ __createBinding), 90910/* harmony export */ __decorate: () => (/* binding */ __decorate), 90911/* harmony export */ __disposeResources: () => (/* binding */ __disposeResources), 90912/* harmony export */ __esDecorate: () => (/* binding */ __esDecorate), 90913/* harmony export */ __exportStar: () => (/* binding */ __exportStar), 90914/* harmony export */ __extends: () => (/* binding */ __extends), 90915/* harmony export */ __generator: () => (/* binding */ __generator), 90916/* harmony export */ __importDefault: () => (/* binding */ __importDefault), 90917/* harmony export */ __importStar: () => (/* binding */ __importStar), 90918/* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject), 90919/* harmony export */ __metadata: () => (/* binding */ __metadata), 90920/* harmony export */ __param: () => (/* binding */ __param), 90921/* harmony export */ __propKey: () => (/* binding */ __propKey), 90922/* harmony export */ __read: () => (/* binding */ __read), 90923/* harmony export */ __rest: () => (/* binding */ __rest), 90924/* harmony export */ __rewriteRelativeImportExtension: () => (/* binding */ __rewriteRelativeImportExtension), 90925/* harmony export */ __runInitializers: () => (/* binding */ __runInitializers), 90926/* harmony export */ __setFunctionName: () => (/* binding */ __setFunctionName), 90927/* harmony export */ __spread: () => (/* binding */ __spread), 90928/* harmony export */ __spreadArray: () => (/* binding */ __spreadArray), 90929/* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays), 90930/* harmony export */ __values: () => (/* binding */ __values), 90931/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 90932/* harmony export */ }); 90933/****************************************************************************** 90934Copyright (c) Microsoft Corporation. 90935 90936Permission to use, copy, modify, and/or distribute this software for any 90937purpose with or without fee is hereby granted. 90938 90939THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 90940REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 90941AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 90942INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 90943LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 90944OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 90945PERFORMANCE OF THIS SOFTWARE. 90946***************************************************************************** */ 90947/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 90948 90949var extendStatics = function(d, b) { 90950 extendStatics = Object.setPrototypeOf || 90951 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 90952 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 90953 return extendStatics(d, b); 90954}; 90955 90956function __extends(d, b) { 90957 if (typeof b !== "function" && b !== null) 90958 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 90959 extendStatics(d, b); 90960 function __() { this.constructor = d; } 90961 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 90962} 90963 90964var __assign = function() { 90965 __assign = Object.assign || function __assign(t) { 90966 for (var s, i = 1, n = arguments.length; i < n; i++) { 90967 s = arguments[i]; 90968 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 90969 } 90970 return t; 90971 } 90972 return __assign.apply(this, arguments); 90973} 90974 90975function __rest(s, e) { 90976 var t = {}; 90977 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 90978 t[p] = s[p]; 90979 if (s != null && typeof Object.getOwnPropertySymbols === "function") 90980 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 90981 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 90982 t[p[i]] = s[p[i]]; 90983 } 90984 return t; 90985} 90986 90987function __decorate(decorators, target, key, desc) { 90988 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 90989 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 90990 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 90991 return c > 3 && r && Object.defineProperty(target, key, r), r; 90992} 90993 90994function __param(paramIndex, decorator) { 90995 return function (target, key) { decorator(target, key, paramIndex); } 90996} 90997 90998function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { 90999 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } 91000 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; 91001 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; 91002 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); 91003 var _, done = false; 91004 for (var i = decorators.length - 1; i >= 0; i--) { 91005 var context = {}; 91006 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; 91007 for (var p in contextIn.access) context.access[p] = contextIn.access[p]; 91008 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; 91009 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); 91010 if (kind === "accessor") { 91011 if (result === void 0) continue; 91012 if (result === null || typeof result !== "object") throw new TypeError("Object expected"); 91013 if (_ = accept(result.get)) descriptor.get = _; 91014 if (_ = accept(result.set)) descriptor.set = _; 91015 if (_ = accept(result.init)) initializers.unshift(_); 91016 } 91017 else if (_ = accept(result)) { 91018 if (kind === "field") initializers.unshift(_); 91019 else descriptor[key] = _; 91020 } 91021 } 91022 if (target) Object.defineProperty(target, contextIn.name, descriptor); 91023 done = true; 91024}; 91025 91026function __runInitializers(thisArg, initializers, value) { 91027 var useValue = arguments.length > 2; 91028 for (var i = 0; i < initializers.length; i++) { 91029 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); 91030 } 91031 return useValue ? value : void 0; 91032}; 91033 91034function __propKey(x) { 91035 return typeof x === "symbol" ? x : "".concat(x); 91036}; 91037 91038function __setFunctionName(f, name, prefix) { 91039 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; 91040 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); 91041}; 91042 91043function __metadata(metadataKey, metadataValue) { 91044 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 91045} 91046 91047function __awaiter(thisArg, _arguments, P, generator) { 91048 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 91049 return new (P || (P = Promise))(function (resolve, reject) { 91050 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 91051 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 91052 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 91053 step((generator = generator.apply(thisArg, _arguments || [])).next()); 91054 }); 91055} 91056 91057function __generator(thisArg, body) { 91058 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); 91059 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 91060 function verb(n) { return function (v) { return step([n, v]); }; } 91061 function step(op) { 91062 if (f) throw new TypeError("Generator is already executing."); 91063 while (g && (g = 0, op[0] && (_ = 0)), _) try { 91064 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 91065 if (y = 0, t) op = [op[0] & 2, t.value]; 91066 switch (op[0]) { 91067 case 0: case 1: t = op; break; 91068 case 4: _.label++; return { value: op[1], done: false }; 91069 case 5: _.label++; y = op[1]; op = [0]; continue; 91070 case 7: op = _.ops.pop(); _.trys.pop(); continue; 91071 default: 91072 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 91073 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 91074 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 91075 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 91076 if (t[2]) _.ops.pop(); 91077 _.trys.pop(); continue; 91078 } 91079 op = body.call(thisArg, _); 91080 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 91081 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 91082 } 91083} 91084 91085var __createBinding = Object.create ? (function(o, m, k, k2) { 91086 if (k2 === undefined) k2 = k; 91087 var desc = Object.getOwnPropertyDescriptor(m, k); 91088 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 91089 desc = { enumerable: true, get: function() { return m[k]; } }; 91090 } 91091 Object.defineProperty(o, k2, desc); 91092}) : (function(o, m, k, k2) { 91093 if (k2 === undefined) k2 = k; 91094 o[k2] = m[k]; 91095}); 91096 91097function __exportStar(m, o) { 91098 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 91099} 91100 91101function __values(o) { 91102 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 91103 if (m) return m.call(o); 91104 if (o && typeof o.length === "number") return { 91105 next: function () { 91106 if (o && i >= o.length) o = void 0; 91107 return { value: o && o[i++], done: !o }; 91108 } 91109 }; 91110 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 91111} 91112 91113function __read(o, n) { 91114 var m = typeof Symbol === "function" && o[Symbol.iterator]; 91115 if (!m) return o; 91116 var i = m.call(o), r, ar = [], e; 91117 try { 91118 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 91119 } 91120 catch (error) { e = { error: error }; } 91121 finally { 91122 try { 91123 if (r && !r.done && (m = i["return"])) m.call(i); 91124 } 91125 finally { if (e) throw e.error; } 91126 } 91127 return ar; 91128} 91129 91130/** @deprecated */ 91131function __spread() { 91132 for (var ar = [], i = 0; i < arguments.length; i++) 91133 ar = ar.concat(__read(arguments[i])); 91134 return ar; 91135} 91136 91137/** @deprecated */ 91138function __spreadArrays() { 91139 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 91140 for (var r = Array(s), k = 0, i = 0; i < il; i++) 91141 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 91142 r[k] = a[j]; 91143 return r; 91144} 91145 91146function __spreadArray(to, from, pack) { 91147 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 91148 if (ar || !(i in from)) { 91149 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 91150 ar[i] = from[i]; 91151 } 91152 } 91153 return to.concat(ar || Array.prototype.slice.call(from)); 91154} 91155 91156function __await(v) { 91157 return this instanceof __await ? (this.v = v, this) : new __await(v); 91158} 91159 91160function __asyncGenerator(thisArg, _arguments, generator) { 91161 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 91162 var g = generator.apply(thisArg, _arguments || []), i, q = []; 91163 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; 91164 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } 91165 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } 91166 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 91167 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 91168 function fulfill(value) { resume("next", value); } 91169 function reject(value) { resume("throw", value); } 91170 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 91171} 91172 91173function __asyncDelegator(o) { 91174 var i, p; 91175 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 91176 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } 91177} 91178 91179function __asyncValues(o) { 91180 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 91181 var m = o[Symbol.asyncIterator], i; 91182 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 91183 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 91184 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 91185} 91186 91187function __makeTemplateObject(cooked, raw) { 91188 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 91189 return cooked; 91190}; 91191 91192var __setModuleDefault = Object.create ? (function(o, v) { 91193 Object.defineProperty(o, "default", { enumerable: true, value: v }); 91194}) : function(o, v) { 91195 o["default"] = v; 91196}; 91197 91198var ownKeys = function(o) { 91199 ownKeys = Object.getOwnPropertyNames || function (o) { 91200 var ar = []; 91201 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; 91202 return ar; 91203 }; 91204 return ownKeys(o); 91205}; 91206 91207function __importStar(mod) { 91208 if (mod && mod.__esModule) return mod; 91209 var result = {}; 91210 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); 91211 __setModuleDefault(result, mod); 91212 return result; 91213} 91214 91215function __importDefault(mod) { 91216 return (mod && mod.__esModule) ? mod : { default: mod }; 91217} 91218 91219function __classPrivateFieldGet(receiver, state, kind, f) { 91220 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 91221 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 91222 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 91223} 91224 91225function __classPrivateFieldSet(receiver, state, value, kind, f) { 91226 if (kind === "m") throw new TypeError("Private method is not writable"); 91227 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 91228 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 91229 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 91230} 91231 91232function __classPrivateFieldIn(state, receiver) { 91233 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); 91234 return typeof state === "function" ? receiver === state : state.has(receiver); 91235} 91236 91237function __addDisposableResource(env, value, async) { 91238 if (value !== null && value !== void 0) { 91239 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); 91240 var dispose, inner; 91241 if (async) { 91242 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); 91243 dispose = value[Symbol.asyncDispose]; 91244 } 91245 if (dispose === void 0) { 91246 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); 91247 dispose = value[Symbol.dispose]; 91248 if (async) inner = dispose; 91249 } 91250 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); 91251 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; 91252 env.stack.push({ value: value, dispose: dispose, async: async }); 91253 } 91254 else if (async) { 91255 env.stack.push({ async: true }); 91256 } 91257 return value; 91258} 91259 91260var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 91261 var e = new Error(message); 91262 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 91263}; 91264 91265function __disposeResources(env) { 91266 function fail(e) { 91267 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; 91268 env.hasError = true; 91269 } 91270 var r, s = 0; 91271 function next() { 91272 while (r = env.stack.pop()) { 91273 try { 91274 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); 91275 if (r.dispose) { 91276 var result = r.dispose.call(r.value); 91277 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); 91278 } 91279 else s |= 1; 91280 } 91281 catch (e) { 91282 fail(e); 91283 } 91284 } 91285 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); 91286 if (env.hasError) throw env.error; 91287 } 91288 return next(); 91289} 91290 91291function __rewriteRelativeImportExtension(path, preserveJsx) { 91292 if (typeof path === "string" && /^\.\.?\//.test(path)) { 91293 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { 91294 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); 91295 }); 91296 } 91297 return path; 91298} 91299 91300/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 91301 __extends, 91302 __assign, 91303 __rest, 91304 __decorate, 91305 __param, 91306 __esDecorate, 91307 __runInitializers, 91308 __propKey, 91309 __setFunctionName, 91310 __metadata, 91311 __awaiter, 91312 __generator, 91313 __createBinding, 91314 __exportStar, 91315 __values, 91316 __read, 91317 __spread, 91318 __spreadArrays, 91319 __spreadArray, 91320 __await, 91321 __asyncGenerator, 91322 __asyncDelegator, 91323 __asyncValues, 91324 __makeTemplateObject, 91325 __importStar, 91326 __importDefault, 91327 __classPrivateFieldGet, 91328 __classPrivateFieldSet, 91329 __classPrivateFieldIn, 91330 __addDisposableResource, 91331 __disposeResources, 91332 __rewriteRelativeImportExtension, 91333}); 91334 91335 91336/***/ }
91336, 91337 91338/***/ 85160 91339(__unused_webpack_module, exports, __webpack_require__) { 91340 91341"use strict"; 91342/** 91343 * @license React 91344 * use-sync-external-store-with-selector.production.js 91345 * 91346 * Copyright (c) Meta Platforms, Inc. and affiliates. 91347 * 91348 * This source code is licensed under the MIT license found in the 91349 * LICENSE file in the root directory of this source tree. 91350 */ 91351 91352 91353var React = __webpack_require__(96540); 91354function is(x, y) { 91355 return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); 91356} 91357var objectIs = "function" === typeof Object.is ? Object.is : is, 91358 useSyncExternalStore = React.useSyncExternalStore, 91359 useRef = React.useRef, 91360 useEffect = React.useEffect, 91361 useMemo = React.useMemo, 91362 useDebugValue = React.useDebugValue; 91363exports.useSyncExternalStoreWithSelector = function ( 91364 subscribe, 91365 getSnapshot, 91366 getServerSnapshot, 91367 selector, 91368 isEqual 91369) { 91370 var instRef = useRef(null); 91371 if (null === instRef.current) { 91372 var inst = { hasValue: !1, value: null }; 91373 instRef.current = inst; 91374 } else inst = instRef.current; 91375 instRef = useMemo( 91376 function () { 91377 function memoizedSelector(nextSnapshot) { 91378 if (!hasMemo) { 91379 hasMemo = !0; 91380 memoizedSnapshot = nextSnapshot; 91381 nextSnapshot = selector(nextSnapshot); 91382 if (void 0 !== isEqual && inst.hasValue) { 91383 var currentSelection = inst.value; 91384 if (isEqual(currentSelection, nextSnapshot)) 91385 return (memoizedSelection = currentSelection); 91386 } 91387 return (memoizedSelection = nextSnapshot); 91388 } 91389 currentSelection = memoizedSelection; 91390 if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; 91391 var nextSelection = selector(nextSnapshot); 91392 if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) 91393 return (memoizedSnapshot = nextSnapshot), currentSelection; 91394 memoizedSnapshot = nextSnapshot; 91395 return (memoizedSelection = nextSelection); 91396 } 91397 var hasMemo = !1, 91398 memoizedSnapshot, 91399 memoizedSelection, 91400 maybeGetServerSnapshot = 91401 void 0 === getServerSnapshot ? null : getServerSnapshot; 91402 return [ 91403 function () { 91404 return memoizedSelector(getSnapshot()); 91405 }, 91406 null === maybeGetServerSnapshot 91407 ? void 0 91408 : function () { 91409 return memoizedSelector(maybeGetServerSnapshot()); 91410 } 91411 ]; 91412 }, 91413 [getSnapshot, getServerSnapshot, selector, isEqual] 91414 ); 91415 var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]); 91416 useEffect( 91417 function () { 91418 inst.hasValue = !0; 91419 inst.value = value; 91420 }, 91421 [value] 91422 ); 91423 useDebugValue(value); 91424 return value; 91425}; 91426 91427 91428/***/ }, 91429 91430/***/ 78418 91431(module, __unused_webpack_exports, __webpack_require__) { 91432 91433"use strict"; 91434 91435 91436if (true) { 91437 module.exports = __webpack_require__(85160); 91438} else // removed by dead control flow 91439{} 91440 91441 91442/***/ }, 91443 91444/***/ 78624 91445(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 91446 91447"use strict"; 91448__webpack_require__.r(__webpack_exports__); 91449/* harmony export */ __webpack_require__.d(__webpack_exports__, { 91450/* harmony export */ DOMException: () => (/* binding */ DOMException), 91451/* harmony export */ Headers: () => (/* binding */ Headers), 91452/* harmony export */ Request: () => (/* binding */ Request), 91453/* harmony export */ Response: () => (/* binding */ Response), 91454/* harmony export */ fetch: () => (/* binding */ fetch) 91455/* harmony export */ }); 91456/* eslint-disable no-prototype-builtins */ 91457var g = 91458 (typeof globalThis !== 'undefined' && globalThis) || 91459 (typeof self !== 'undefined' && self) || 91460 // eslint-disable-next-line no-undef 91461 (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g) || 91462 {} 91463 91464var support = { 91465 searchParams: 'URLSearchParams' in g, 91466 iterable: 'Symbol' in g && 'iterator' in Symbol, 91467 blob: 91468 'FileReader' in g && 91469 'Blob' in g && 91470 (function() {
vendor: 18,961 bytes, lines 91471-92167
91471 try { 91472 new Blob() 91473 return true 91474 } catch (e) { 91475 return false 91476 } 91477 })(), 91478 formData: 'FormData' in g, 91479 arrayBuffer: 'ArrayBuffer' in g 91480} 91481 91482function isDataView(obj) { 91483 return obj && DataView.prototype.isPrototypeOf(obj) 91484} 91485 91486if (support.arrayBuffer) { 91487 var viewClasses = [ 91488 '[object Int8Array]', 91489 '[object Uint8Array]', 91490 '[object Uint8ClampedArray]', 91491 '[object Int16Array]', 91492 '[object Uint16Array]', 91493 '[object Int32Array]', 91494 '[object Uint32Array]', 91495 '[object Float32Array]', 91496 '[object Float64Array]' 91497 ] 91498 91499 var isArrayBufferView = 91500 ArrayBuffer.isView || 91501 function(obj) { 91502 return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 91503 } 91504} 91505 91506function normalizeName(name) { 91507 if (typeof name !== 'string') { 91508 name = String(name) 91509 } 91510 if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') { 91511 throw new TypeError('Invalid character in header field name: "' + name + '"') 91512 } 91513 return name.toLowerCase() 91514} 91515 91516function normalizeValue(value) { 91517 if (typeof value !== 'string') { 91518 value = String(value) 91519 } 91520 return value 91521} 91522 91523// Build a destructive iterator for the value list 91524function iteratorFor(items) { 91525 var iterator = { 91526 next: function() { 91527 var value = items.shift() 91528 return {done: value === undefined, value: value} 91529 } 91530 } 91531 91532 if (support.iterable) { 91533 iterator[Symbol.iterator] = function() { 91534 return iterator 91535 } 91536 } 91537 91538 return iterator 91539} 91540 91541function Headers(headers) { 91542 this.map = {} 91543 91544 if (headers instanceof Headers) { 91545 headers.forEach(function(value, name) { 91546 this.append(name, value) 91547 }, this) 91548 } else if (Array.isArray(headers)) { 91549 headers.forEach(function(header) { 91550 if (header.length != 2) { 91551 throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length) 91552 } 91553 this.append(header[0], header[1]) 91554 }, this) 91555 } else if (headers) { 91556 Object.getOwnPropertyNames(headers).forEach(function(name) { 91557 this.append(name, headers[name]) 91558 }, this) 91559 } 91560} 91561 91562Headers.prototype.append = function(name, value) { 91563 name = normalizeName(name) 91564 value = normalizeValue(value) 91565 var oldValue = this.map[name] 91566 this.map[name] = oldValue ? oldValue + ', ' + value : value 91567} 91568 91569Headers.prototype['delete'] = function(name) { 91570 delete this.map[normalizeName(name)] 91571} 91572 91573Headers.prototype.get = function(name) { 91574 name = normalizeName(name) 91575 return this.has(name) ? this.map[name] : null 91576} 91577 91578Headers.prototype.has = function(name) { 91579 return this.map.hasOwnProperty(normalizeName(name)) 91580} 91581 91582Headers.prototype.set = function(name, value) { 91583 this.map[normalizeName(name)] = normalizeValue(value) 91584} 91585 91586Headers.prototype.forEach = function(callback, thisArg) { 91587 for (var name in this.map) { 91588 if (this.map.hasOwnProperty(name)) { 91589 callback.call(thisArg, this.map[name], name, this) 91590 } 91591 } 91592} 91593 91594Headers.prototype.keys = function() { 91595 var items = [] 91596 this.forEach(function(value, name) { 91597 items.push(name) 91598 }) 91599 return iteratorFor(items) 91600} 91601 91602Headers.prototype.values = function() { 91603 var items = [] 91604 this.forEach(function(value) { 91605 items.push(value) 91606 }) 91607 return iteratorFor(items) 91608} 91609 91610Headers.prototype.entries = function() { 91611 var items = [] 91612 this.forEach(function(value, name) { 91613 items.push([name, value]) 91614 }) 91615 return iteratorFor(items) 91616} 91617 91618if (support.iterable) { 91619 Headers.prototype[Symbol.iterator] = Headers.prototype.entries 91620} 91621 91622function consumed(body) { 91623 if (body._noBody) return 91624 if (body.bodyUsed) { 91625 return Promise.reject(new TypeError('Already read')) 91626 } 91627 body.bodyUsed = true 91628} 91629 91630function fileReaderReady(reader) { 91631 return new Promise(function(resolve, reject) { 91632 reader.onload = function() { 91633 resolve(reader.result) 91634 } 91635 reader.onerror = function() { 91636 reject(reader.error) 91637 } 91638 }) 91639} 91640 91641function readBlobAsArrayBuffer(blob) { 91642 var reader = new FileReader() 91643 var promise = fileReaderReady(reader) 91644 reader.readAsArrayBuffer(blob) 91645 return promise 91646} 91647 91648function readBlobAsText(blob) { 91649 var reader = new FileReader() 91650 var promise = fileReaderReady(reader) 91651 var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type) 91652 var encoding = match ? match[1] : 'utf-8' 91653 reader.readAsText(blob, encoding) 91654 return promise 91655} 91656 91657function readArrayBufferAsText(buf) { 91658 var view = new Uint8Array(buf) 91659 var chars = new Array(view.length) 91660 91661 for (var i = 0; i < view.length; i++) { 91662 chars[i] = String.fromCharCode(view[i]) 91663 } 91664 return chars.join('') 91665} 91666 91667function bufferClone(buf) { 91668 if (buf.slice) { 91669 return buf.slice(0) 91670 } else { 91671 var view = new Uint8Array(buf.byteLength) 91672 view.set(new Uint8Array(buf)) 91673 return view.buffer 91674 } 91675} 91676 91677function Body() { 91678 this.bodyUsed = false 91679 91680 this._initBody = function(body) { 91681 /* 91682 fetch-mock wraps the Response object in an ES6 Proxy to 91683 provide useful test harness features such as flush. However, on 91684 ES5 browsers without fetch or Proxy support pollyfills must be used; 91685 the proxy-pollyfill is unable to proxy an attribute unless it exists 91686 on the object before the Proxy is created. This change ensures 91687 Response.bodyUsed exists on the instance, while maintaining the 91688 semantic of setting Request.bodyUsed in the constructor before 91689 _initBody is called. 91690 */ 91691 // eslint-disable-next-line no-self-assign 91692 this.bodyUsed = this.bodyUsed 91693 this._bodyInit = body 91694 if (!body) { 91695 this._noBody = true; 91696 this._bodyText = '' 91697 } else if (typeof body === 'string') { 91698 this._bodyText = body 91699 } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { 91700 this._bodyBlob = body 91701 } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { 91702 this._bodyFormData = body 91703 } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { 91704 this._bodyText = body.toString() 91705 } else if (support.arrayBuffer && support.blob && isDataView(body)) { 91706 this._bodyArrayBuffer = bufferClone(body.buffer) 91707 // IE 10-11 can't handle a DataView body. 91708 this._bodyInit = new Blob([this._bodyArrayBuffer]) 91709 } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { 91710 this._bodyArrayBuffer = bufferClone(body) 91711 } else { 91712 this._bodyText = body = Object.prototype.toString.call(body) 91713 } 91714 91715 if (!this.headers.get('content-type')) { 91716 if (typeof body === 'string') { 91717 this.headers.set('content-type', 'text/plain;charset=UTF-8') 91718 } else if (this._bodyBlob && this._bodyBlob.type) { 91719 this.headers.set('content-type', this._bodyBlob.type) 91720 } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { 91721 this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8') 91722 } 91723 } 91724 } 91725 91726 if (support.blob) { 91727 this.blob = function() { 91728 var rejected = consumed(this) 91729 if (rejected) { 91730 return rejected 91731 } 91732 91733 if (this._bodyBlob) { 91734 return Promise.resolve(this._bodyBlob) 91735 } else if (this._bodyArrayBuffer) { 91736 return Promise.resolve(new Blob([this._bodyArrayBuffer])) 91737 } else if (this._bodyFormData) { 91738 throw new Error('could not read FormData body as blob') 91739 } else { 91740 return Promise.resolve(new Blob([this._bodyText])) 91741 } 91742 } 91743 } 91744 91745 this.arrayBuffer = function() { 91746 if (this._bodyArrayBuffer) { 91747 var isConsumed = consumed(this) 91748 if (isConsumed) { 91749 return isConsumed 91750 } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) { 91751 return Promise.resolve( 91752 this._bodyArrayBuffer.buffer.slice( 91753 this._bodyArrayBuffer.byteOffset, 91754 this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength 91755 ) 91756 ) 91757 } else { 91758 return Promise.resolve(this._bodyArrayBuffer) 91759 } 91760 } else if (support.blob) { 91761 return this.blob().then(readBlobAsArrayBuffer) 91762 } else { 91763 throw new Error('could not read as ArrayBuffer') 91764 } 91765 } 91766 91767 this.text = function() { 91768 var rejected = consumed(this) 91769 if (rejected) { 91770 return rejected 91771 } 91772 91773 if (this._bodyBlob) { 91774 return readBlobAsText(this._bodyBlob) 91775 } else if (this._bodyArrayBuffer) { 91776 return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) 91777 } else if (this._bodyFormData) { 91778 throw new Error('could not read FormData body as text') 91779 } else { 91780 return Promise.resolve(this._bodyText) 91781 } 91782 } 91783 91784 if (support.formData) { 91785 this.formData = function() { 91786 return this.text().then(decode) 91787 } 91788 } 91789 91790 this.json = function() { 91791 return this.text().then(JSON.parse) 91792 } 91793 91794 return this 91795} 91796 91797// HTTP methods whose capitalization should be normalized 91798var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'] 91799 91800function normalizeMethod(method) { 91801 var upcased = method.toUpperCase() 91802 return methods.indexOf(upcased) > -1 ? upcased : method 91803} 91804 91805function Request(input, options) { 91806 if (!(this instanceof Request)) { 91807 throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') 91808 } 91809 91810 options = options || {} 91811 var body = options.body 91812 91813 if (input instanceof Request) { 91814 if (input.bodyUsed) { 91815 throw new TypeError('Already read') 91816 } 91817 this.url = input.url 91818 this.credentials = input.credentials 91819 if (!options.headers) { 91820 this.headers = new Headers(input.headers) 91821 } 91822 this.method = input.method 91823 this.mode = input.mode 91824 this.signal = input.signal 91825 if (!body && input._bodyInit != null) { 91826 body = input._bodyInit 91827 input.bodyUsed = true 91828 } 91829 } else { 91830 this.url = String(input) 91831 } 91832 91833 this.credentials = options.credentials || this.credentials || 'same-origin' 91834 if (options.headers || !this.headers) { 91835 this.headers = new Headers(options.headers) 91836 } 91837 this.method = normalizeMethod(options.method || this.method || 'GET') 91838 this.mode = options.mode || this.mode || null 91839 this.signal = options.signal || this.signal || (function () { 91840 if ('AbortController' in g) { 91841 var ctrl = new AbortController(); 91842 return ctrl.signal; 91843 } 91844 }()); 91845 this.referrer = null 91846 91847 if ((this.method === 'GET' || this.method === 'HEAD') && body) { 91848 throw new TypeError('Body not allowed for GET or HEAD requests') 91849 } 91850 this._initBody(body) 91851 91852 if (this.method === 'GET' || this.method === 'HEAD') { 91853 if (options.cache === 'no-store' || options.cache === 'no-cache') { 91854 // Search for a '_' parameter in the query string 91855 var reParamSearch = /([?&])_=[^&]*/ 91856 if (reParamSearch.test(this.url)) { 91857 // If it already exists then set the value with the current time 91858 this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime()) 91859 } else { 91860 // Otherwise add a new '_' parameter to the end with the current time 91861 var reQueryString = /\?/ 91862 this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime() 91863 } 91864 } 91865 } 91866} 91867 91868Request.prototype.clone = function() { 91869 return new Request(this, {body: this._bodyInit}) 91870} 91871 91872function decode(body) { 91873 var form = new FormData() 91874 body 91875 .trim() 91876 .split('&') 91877 .forEach(function(bytes) { 91878 if (bytes) { 91879 var split = bytes.split('=') 91880 var name = split.shift().replace(/\+/g, ' ') 91881 var value = split.join('=').replace(/\+/g, ' ') 91882 form.append(decodeURIComponent(name), decodeURIComponent(value)) 91883 } 91884 }) 91885 return form 91886} 91887 91888function parseHeaders(rawHeaders) { 91889 var headers = new Headers() 91890 // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space 91891 // https://tools.ietf.org/html/rfc7230#section-3.2 91892 var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ') 91893 // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill 91894 // https://github.com/github/fetch/issues/748 91895 // https://github.com/zloirock/core-js/issues/751 91896 preProcessedHeaders 91897 .split('\r') 91898 .map(function(header) { 91899 return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header 91900 }) 91901 .forEach(function(line) { 91902 var parts = line.split(':') 91903 var key = parts.shift().trim() 91904 if (key) { 91905 var value = parts.join(':').trim() 91906 try { 91907 headers.append(key, value) 91908 } catch (error) { 91909 console.warn('Response ' + error.message) 91910 } 91911 } 91912 }) 91913 return headers 91914} 91915 91916Body.call(Request.prototype) 91917 91918function Response(bodyInit, options) { 91919 if (!(this instanceof Response)) { 91920 throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') 91921 } 91922 if (!options) { 91923 options = {} 91924 } 91925 91926 this.type = 'default' 91927 this.status = options.status === undefined ? 200 : options.status 91928 if (this.status < 200 || this.status > 599) { 91929 throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].") 91930 } 91931 this.ok = this.status >= 200 && this.status < 300 91932 this.statusText = options.statusText === undefined ? '' : '' + options.statusText 91933 this.headers = new Headers(options.headers) 91934 this.url = options.url || '' 91935 this._initBody(bodyInit) 91936} 91937 91938Body.call(Response.prototype) 91939 91940Response.prototype.clone = function() { 91941 return new Response(this._bodyInit, { 91942 status: this.status, 91943 statusText: this.statusText, 91944 headers: new Headers(this.headers), 91945 url: this.url 91946 }) 91947} 91948 91949Response.error = function() { 91950 var response = new Response(null, {status: 200, statusText: ''}) 91951 response.ok = false 91952 response.status = 0 91953 response.type = 'error' 91954 return response 91955} 91956 91957var redirectStatuses = [301, 302, 303, 307, 308] 91958 91959Response.redirect = function(url, status) { 91960 if (redirectStatuses.indexOf(status) === -1) { 91961 throw new RangeError('Invalid status code') 91962 } 91963 91964 return new Response(null, {status: status, headers: {location: url}}) 91965} 91966 91967var DOMException = g.DOMException 91968try { 91969 new DOMException() 91970} catch (err) { 91971 DOMException = function(message, name) { 91972 this.message = message 91973 this.name = name 91974 var error = Error(message) 91975 this.stack = error.stack 91976 } 91977 DOMException.prototype = Object.create(Error.prototype) 91978 DOMException.prototype.constructor = DOMException 91979} 91980 91981function fetch(input, init) { 91982 return new Promise(function(resolve, reject) { 91983 var request = new Request(input, init) 91984 91985 if (request.signal && request.signal.aborted) { 91986 return reject(new DOMException('Aborted', 'AbortError')) 91987 } 91988 91989 var xhr = new XMLHttpRequest() 91990 91991 function abortXhr() { 91992 xhr.abort() 91993 } 91994 91995 xhr.onload = function() { 91996 var options = { 91997 statusText: xhr.statusText, 91998 headers: parseHeaders(xhr.getAllResponseHeaders() || '') 91999 } 92000 // This check if specifically for when a user fetches a file locally from the file system 92001 // Only if the status is out of a normal range 92002 if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) { 92003 options.status = 200; 92004 } else { 92005 options.status = xhr.status; 92006 } 92007 options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL') 92008 var body = 'response' in xhr ? xhr.response : xhr.responseText 92009 setTimeout(function() { 92010 resolve(new Response(body, options)) 92011 }, 0) 92012 } 92013 92014 xhr.onerror = function() { 92015 setTimeout(function() { 92016 reject(new TypeError('Network request failed')) 92017 }, 0) 92018 } 92019 92020 xhr.ontimeout = function() { 92021 setTimeout(function() { 92022 reject(new TypeError('Network request timed out')) 92023 }, 0) 92024 } 92025 92026 xhr.onabort = function() { 92027 setTimeout(function() { 92028 reject(new DOMException('Aborted', 'AbortError')) 92029 }, 0) 92030 } 92031 92032 function fixUrl(url) { 92033 try { 92034 return url === '' && g.location.href ? g.location.href : url 92035 } catch (e) { 92036 return url 92037 } 92038 } 92039 92040 xhr.open(request.method, fixUrl(request.url), true) 92041 92042 if (request.credentials === 'include') { 92043 xhr.withCredentials = true 92044 } else if (request.credentials === 'omit') { 92045 xhr.withCredentials = false 92046 } 92047 92048 if ('responseType' in xhr) { 92049 if (support.blob) { 92050 xhr.responseType = 'blob' 92051 } else if ( 92052 support.arrayBuffer 92053 ) { 92054 xhr.responseType = 'arraybuffer' 92055 } 92056 } 92057 92058 if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) { 92059 var names = []; 92060 Object.getOwnPropertyNames(init.headers).forEach(function(name) { 92061 names.push(normalizeName(name)) 92062 xhr.setRequestHeader(name, normalizeValue(init.headers[name])) 92063 }) 92064 request.headers.forEach(function(value, name) { 92065 if (names.indexOf(name) === -1) { 92066 xhr.setRequestHeader(name, value) 92067 } 92068 }) 92069 } else { 92070 request.headers.forEach(function(value, name) { 92071 xhr.setRequestHeader(name, value) 92072 }) 92073 } 92074 92075 if (request.signal) { 92076 request.signal.addEventListener('abort', abortXhr) 92077 92078 xhr.onreadystatechange = function() { 92079 // DONE (success or failure) 92080 if (xhr.readyState === 4) { 92081 request.signal.removeEventListener('abort', abortXhr) 92082 } 92083 } 92084 } 92085 92086 xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit) 92087 }) 92088} 92089 92090fetch.polyfill = true 92091 92092if (!g.fetch) { 92093 g.fetch = fetch 92094 g.Headers = Headers 92095 g.Request = Request 92096 g.Response = Response 92097} 92098 92099 92100/***/ }, 92101 92102/***/ 81539 92103(module, __unused_webpack_exports, __webpack_require__) { 92104 92105"use strict"; 92106 92107 92108var isString = __webpack_require__(4761); 92109var isNumber = __webpack_require__(21703); 92110var isBoolean = __webpack_require__(75128); 92111var isSymbol = __webpack_require__(93612); 92112var isBigInt = __webpack_require__(39803); 92113 92114// eslint-disable-next-line consistent-return 92115module.exports = function whichBoxedPrimitive(value) { 92116 // eslint-disable-next-line eqeqeq 92117 if (value == null || (typeof value !== 'object' && typeof value !== 'function')) { 92118 return null; 92119 } 92120 if (isString(value)) { 92121 return 'String'; 92122 } 92123 if (isNumber(value)) { 92124 return 'Number'; 92125 } 92126 if (isBoolean(value)) { 92127 return 'Boolean'; 92128 } 92129 if (isSymbol(value)) { 92130 return 'Symbol'; 92131 } 92132 if (isBigInt(value)) { 92133 return 'BigInt'; 92134 } 92135}; 92136 92137 92138/***/ }, 92139 92140/***/ 60593 92141(module, __unused_webpack_exports, __webpack_require__) { 92142 92143"use strict"; 92144 92145 92146var isMap = __webpack_require__(83802); 92147var isSet = __webpack_require__(90256); 92148var isWeakMap = __webpack_require__(87842); 92149var isWeakSet = __webpack_require__(12648); 92150 92151/** @type {import('.')} */ 92152module.exports = function whichCollection(/** @type {unknown} */ value) { 92153 if (value && typeof value === 'object') { 92154 if (isMap(value)) { 92155 return 'Map'; 92156 } 92157 if (isSet(value)) { 92158 return 'Set'; 92159 } 92160 if (isWeakMap(value)) { 92161 return 'WeakMap'; 92162 } 92163 if (isWeakSet(value)) { 92164 return 'WeakSet'; 92165 } 92166 } 92167 return false;
vendor: 3,859 bytes, lines 92168-92297
92168}; 92169 92170 92171/***/ }, 92172 92173/***/ 25767 92174(module, __unused_webpack_exports, __webpack_require__) { 92175 92176"use strict"; 92177 92178 92179var forEach = __webpack_require__(82682); 92180var availableTypedArrays = __webpack_require__(6554); 92181var callBind = __webpack_require__(10487); 92182var callBound = __webpack_require__(38075); 92183var gOPD = __webpack_require__(75795); 92184 92185/** @type {(O: object) => string} */ 92186var $toString = callBound('Object.prototype.toString'); 92187var hasToStringTag = __webpack_require__(49092)(); 92188 92189var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis; 92190var typedArrays = availableTypedArrays(); 92191 92192var $slice = callBound('String.prototype.slice'); 92193var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof'); 92194 92195/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */ 92196var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { 92197 for (var i = 0; i < array.length; i += 1) { 92198 if (array[i] === value) { 92199 return i; 92200 } 92201 } 92202 return -1; 92203}; 92204 92205/** @typedef {(receiver: import('.').TypedArray) => string | typeof Uint8Array.prototype.slice.call | typeof Uint8Array.prototype.set.call} Getter */ 92206/** @type {{ [k in `\$${import('.').TypedArrayName}`]?: Getter } & { __proto__: null }} */ 92207var cache = { __proto__: null }; 92208if (hasToStringTag && gOPD && getPrototypeOf) { 92209 forEach(typedArrays, function (typedArray) { 92210 var arr = new g[typedArray](); 92211 if (Symbol.toStringTag in arr) { 92212 var proto = getPrototypeOf(arr); 92213 // @ts-expect-error TS won't narrow inside a closure 92214 var descriptor = gOPD(proto, Symbol.toStringTag); 92215 if (!descriptor) { 92216 var superProto = getPrototypeOf(proto); 92217 // @ts-expect-error TS won't narrow inside a closure 92218 descriptor = gOPD(superProto, Symbol.toStringTag); 92219 } 92220 // @ts-expect-error TODO: fix 92221 cache['$' + typedArray] = callBind(descriptor.get); 92222 } 92223 }); 92224} else { 92225 forEach(typedArrays, function (typedArray) { 92226 var arr = new g[typedArray](); 92227 var fn = arr.slice || arr.set; 92228 if (fn) { 92229 // @ts-expect-error TODO: fix 92230 cache['$' + typedArray] = callBind(fn); 92231 } 92232 }); 92233} 92234 92235/** @type {(value: object) => false | import('.').TypedArrayName} */ 92236var tryTypedArrays = function tryAllTypedArrays(value) { 92237 /** @type {ReturnType<typeof tryAllTypedArrays>} */ var found = false; 92238 forEach( 92239 // eslint-disable-next-line no-extra-parens 92240 /** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ (cache), 92241 /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ 92242 function (getter, typedArray) { 92243 if (!found) { 92244 try { 92245 // @ts-expect-error TODO: fix 92246 if ('$' + getter(value) === typedArray) { 92247 found = $slice(typedArray, 1); 92248 } 92249 } catch (e) { /**/ } 92250 } 92251 } 92252 ); 92253 return found; 92254}; 92255 92256/** @type {(value: object) => false | import('.').TypedArrayName} */ 92257var trySlices = function tryAllSlices(value) { 92258 /** @type {ReturnType<typeof tryAllSlices>} */ var found = false; 92259 forEach( 92260 // eslint-disable-next-line no-extra-parens 92261 /** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ (cache), 92262 /** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) { 92263 if (!found) { 92264 try { 92265 // @ts-expect-error TODO: fix 92266 getter(value); 92267 found = $slice(name, 1); 92268 } catch (e) { /**/ } 92269 } 92270 } 92271 ); 92272 return found; 92273}; 92274 92275/** @type {import('.')} */ 92276module.exports = function whichTypedArray(value) { 92277 if (!value || typeof value !== 'object') { return false; } 92278 if (!hasToStringTag) { 92279 /** @type {string} */ 92280 var tag = $slice($toString(value), 8, -1); 92281 if ($indexOf(typedArrays, tag) > -1) { 92282 return tag; 92283 } 92284 if (tag !== 'Object') { 92285 return false; 92286 } 92287 // node < 0.6 hits here on real Typed Arrays 92288 return trySlices(value); 92289 } 92290 if (!gOPD) { return null; } // unknown engine 92291 return tryTypedArrays(value); 92292}; 92293 92294 92295/***/ } 92296 92297}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.