| 1 |
/******/ (() => { // webpackBootstrap |
| 2 |
/******/ var __webpack_modules__ = ({ |
| 3 |
|
| 4 |
/***/ 2599: |
| 5 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6 |
|
| 7 |
"use strict"; |
| 8 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 9 |
/* harmony export */ "RQ": () => (/* binding */ joinPaths), |
| 10 |
/* harmony export */ "WK": () => (/* binding */ isRouteErrorResponse), |
| 11 |
/* harmony export */ "Zn": () => (/* binding */ stripBasename), |
| 12 |
/* harmony export */ "Zq": () => (/* binding */ getPathContributingMatches), |
| 13 |
/* harmony export */ "aU": () => (/* binding */ Action), |
| 14 |
/* harmony export */ "cP": () => (/* binding */ parsePath), |
| 15 |
/* harmony export */ "fp": () => (/* binding */ matchRoutes), |
| 16 |
/* harmony export */ "kG": () => (/* binding */ invariant), |
| 17 |
/* harmony export */ "p7": () => (/* binding */ createRouter), |
| 18 |
/* harmony export */ "pC": () => (/* binding */ resolveTo), |
| 19 |
/* harmony export */ "q_": () => (/* binding */ createHashHistory) |
| 20 |
/* harmony export */ }); |
| 21 |
/* unused harmony exports AbortedDeferredError, ErrorResponse, IDLE_FETCHER, IDLE_NAVIGATION, UNSAFE_convertRoutesToDataRoutes, createBrowserHistory, createMemoryHistory, createPath, defer, generatePath, getStaticContextFromError, getToPathname, json, matchPath, normalizePathname, redirect, resolvePath, unstable_createStaticHandler, warning */ |
| 22 |
/** |
| 23 |
* @remix-run/router v1.0.3 |
| 24 |
* |
| 25 |
* Copyright (c) Remix Software Inc. |
| 26 |
* |
| 27 |
* This source code is licensed under the MIT license found in the |
| 28 |
* LICENSE.md file in the root directory of this source tree. |
| 29 |
* |
| 30 |
* @license MIT |
| 31 |
*/ |
| 32 |
function _extends() { |
| 33 |
_extends = Object.assign ? Object.assign.bind() : function (target) { |
| 34 |
for (var i = 1; i < arguments.length; i++) { |
| 35 |
var source = arguments[i]; |
| 36 |
|
| 37 |
for (var key in source) { |
| 38 |
if (Object.prototype.hasOwnProperty.call(source, key)) { |
| 39 |
target[key] = source[key]; |
| 40 |
} |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
return target; |
| 45 |
}; |
| 46 |
return _extends.apply(this, arguments); |
| 47 |
} |
| 48 |
|
| 49 |
//////////////////////////////////////////////////////////////////////////////// |
| 50 |
//#region Types and Constants |
| 51 |
//////////////////////////////////////////////////////////////////////////////// |
| 52 |
|
| 53 |
/** |
| 54 |
* Actions represent the type of change to a location value. |
| 55 |
*/ |
| 56 |
var Action; |
| 57 |
|
| 58 |
(function (Action) { |
| 59 |
/** |
| 60 |
* A POP indicates a change to an arbitrary index in the history stack, such |
| 61 |
* as a back or forward navigation. It does not describe the direction of the |
| 62 |
* navigation, only that the current index changed. |
| 63 |
* |
| 64 |
* Note: This is the default action for newly created history objects. |
| 65 |
*/ |
| 66 |
Action["Pop"] = "POP"; |
| 67 |
/** |
| 68 |
* A PUSH indicates a new entry being added to the history stack, such as when |
| 69 |
* a link is clicked and a new page loads. When this happens, all subsequent |
| 70 |
* entries in the stack are lost. |
| 71 |
*/ |
| 72 |
|
| 73 |
Action["Push"] = "PUSH"; |
| 74 |
/** |
| 75 |
* A REPLACE indicates the entry at the current index in the history stack |
| 76 |
* being replaced by a new one. |
| 77 |
*/ |
| 78 |
|
| 79 |
Action["Replace"] = "REPLACE"; |
| 80 |
})(Action || (Action = {})); |
| 81 |
|
| 82 |
const PopStateEventType = "popstate"; |
| 83 |
/** |
| 84 |
* Memory history stores the current location in memory. It is designed for use |
| 85 |
* in stateful non-browser environments like tests and React Native. |
| 86 |
*/ |
| 87 |
|
| 88 |
function createMemoryHistory(options) { |
| 89 |
if (options === void 0) { |
| 90 |
options = {}; |
| 91 |
} |
| 92 |
|
| 93 |
let { |
| 94 |
initialEntries = ["/"], |
| 95 |
initialIndex, |
| 96 |
v5Compat = false |
| 97 |
} = options; |
| 98 |
let entries; // Declare so we can access from createMemoryLocation |
| 99 |
|
| 100 |
entries = initialEntries.map((entry, index) => createMemoryLocation(entry, typeof entry === "string" ? null : entry.state, index === 0 ? "default" : undefined)); |
| 101 |
let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex); |
| 102 |
let action = Action.Pop; |
| 103 |
let listener = null; |
| 104 |
|
| 105 |
function clampIndex(n) { |
| 106 |
return Math.min(Math.max(n, 0), entries.length - 1); |
| 107 |
} |
| 108 |
|
| 109 |
function getCurrentLocation() { |
| 110 |
return entries[index]; |
| 111 |
} |
| 112 |
|
| 113 |
function createMemoryLocation(to, state, key) { |
| 114 |
if (state === void 0) { |
| 115 |
state = null; |
| 116 |
} |
| 117 |
|
| 118 |
let location = createLocation(entries ? getCurrentLocation().pathname : "/", to, state, key); |
| 119 |
warning$1(location.pathname.charAt(0) === "/", "relative pathnames are not supported in memory history: " + JSON.stringify(to)); |
| 120 |
return location; |
| 121 |
} |
| 122 |
|
| 123 |
let history = { |
| 124 |
get index() { |
| 125 |
return index; |
| 126 |
}, |
| 127 |
|
| 128 |
get action() { |
| 129 |
return action; |
| 130 |
}, |
| 131 |
|
| 132 |
get location() { |
| 133 |
return getCurrentLocation(); |
| 134 |
}, |
| 135 |
|
| 136 |
createHref(to) { |
| 137 |
return typeof to === "string" ? to : createPath(to); |
| 138 |
}, |
| 139 |
|
| 140 |
encodeLocation(location) { |
| 141 |
return location; |
| 142 |
}, |
| 143 |
|
| 144 |
push(to, state) { |
| 145 |
action = Action.Push; |
| 146 |
let nextLocation = createMemoryLocation(to, state); |
| 147 |
index += 1; |
| 148 |
entries.splice(index, entries.length, nextLocation); |
| 149 |
|
| 150 |
if (v5Compat && listener) { |
| 151 |
listener({ |
| 152 |
action, |
| 153 |
location: nextLocation |
| 154 |
}); |
| 155 |
} |
| 156 |
}, |
| 157 |
|
| 158 |
replace(to, state) { |
| 159 |
action = Action.Replace; |
| 160 |
let nextLocation = createMemoryLocation(to, state); |
| 161 |
entries[index] = nextLocation; |
| 162 |
|
| 163 |
if (v5Compat && listener) { |
| 164 |
listener({ |
| 165 |
action, |
| 166 |
location: nextLocation |
| 167 |
}); |
| 168 |
} |
| 169 |
}, |
| 170 |
|
| 171 |
go(delta) { |
| 172 |
action = Action.Pop; |
| 173 |
index = clampIndex(index + delta); |
| 174 |
|
| 175 |
if (listener) { |
| 176 |
listener({ |
| 177 |
action, |
| 178 |
location: getCurrentLocation() |
| 179 |
}); |
| 180 |
} |
| 181 |
}, |
| 182 |
|
| 183 |
listen(fn) { |
| 184 |
listener = fn; |
| 185 |
return () => { |
| 186 |
listener = null; |
| 187 |
}; |
| 188 |
} |
| 189 |
|
| 190 |
}; |
| 191 |
return history; |
| 192 |
} |
| 193 |
/** |
| 194 |
* Browser history stores the location in regular URLs. This is the standard for |
| 195 |
* most web apps, but it requires some configuration on the server to ensure you |
| 196 |
* serve the same app at multiple URLs. |
| 197 |
* |
| 198 |
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory |
| 199 |
*/ |
| 200 |
|
| 201 |
function createBrowserHistory(options) { |
| 202 |
if (options === void 0) { |
| 203 |
options = {}; |
| 204 |
} |
| 205 |
|
| 206 |
function createBrowserLocation(window, globalHistory) { |
| 207 |
let { |
| 208 |
pathname, |
| 209 |
search, |
| 210 |
hash |
| 211 |
} = window.location; |
| 212 |
return createLocation("", { |
| 213 |
pathname, |
| 214 |
search, |
| 215 |
hash |
| 216 |
}, // state defaults to `null` because `window.history.state` does |
| 217 |
globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); |
| 218 |
} |
| 219 |
|
| 220 |
function createBrowserHref(window, to) { |
| 221 |
return typeof to === "string" ? to : createPath(to); |
| 222 |
} |
| 223 |
|
| 224 |
return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options); |
| 225 |
} |
| 226 |
/** |
| 227 |
* Hash history stores the location in window.location.hash. This makes it ideal |
| 228 |
* for situations where you don't want to send the location to the server for |
| 229 |
* some reason, either because you do cannot configure it or the URL space is |
| 230 |
* reserved for something else. |
| 231 |
* |
| 232 |
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory |
| 233 |
*/ |
| 234 |
|
| 235 |
function createHashHistory(options) { |
| 236 |
if (options === void 0) { |
| 237 |
options = {}; |
| 238 |
} |
| 239 |
|
| 240 |
function createHashLocation(window, globalHistory) { |
| 241 |
let { |
| 242 |
pathname = "/", |
| 243 |
search = "", |
| 244 |
hash = "" |
| 245 |
} = parsePath(window.location.hash.substr(1)); |
| 246 |
return createLocation("", { |
| 247 |
pathname, |
| 248 |
search, |
| 249 |
hash |
| 250 |
}, // state defaults to `null` because `window.history.state` does |
| 251 |
globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); |
| 252 |
} |
| 253 |
|
| 254 |
function createHashHref(window, to) { |
| 255 |
let base = window.document.querySelector("base"); |
| 256 |
let href = ""; |
| 257 |
|
| 258 |
if (base && base.getAttribute("href")) { |
| 259 |
let url = window.location.href; |
| 260 |
let hashIndex = url.indexOf("#"); |
| 261 |
href = hashIndex === -1 ? url : url.slice(0, hashIndex); |
| 262 |
} |
| 263 |
|
| 264 |
return href + "#" + (typeof to === "string" ? to : createPath(to)); |
| 265 |
} |
| 266 |
|
| 267 |
function validateHashLocation(location, to) { |
| 268 |
warning$1(location.pathname.charAt(0) === "/", "relative pathnames are not supported in hash history.push(" + JSON.stringify(to) + ")"); |
| 269 |
} |
| 270 |
|
| 271 |
return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options); |
| 272 |
} //#endregion |
| 273 |
//////////////////////////////////////////////////////////////////////////////// |
| 274 |
//#region UTILS |
| 275 |
//////////////////////////////////////////////////////////////////////////////// |
| 276 |
|
| 277 |
function warning$1(cond, message) { |
| 278 |
if (!cond) { |
| 279 |
// eslint-disable-next-line no-console |
| 280 |
if (typeof console !== "undefined") console.warn(message); |
| 281 |
|
| 282 |
try { |
| 283 |
// Welcome to debugging history! |
| 284 |
// |
| 285 |
// This error is thrown as a convenience so you can more easily |
| 286 |
// find the source for a warning that appears in the console by |
| 287 |
// enabling "pause on exceptions" in your JavaScript debugger. |
| 288 |
throw new Error(message); // eslint-disable-next-line no-empty |
| 289 |
} catch (e) {} |
| 290 |
} |
| 291 |
} |
| 292 |
|
| 293 |
function createKey() { |
| 294 |
return Math.random().toString(36).substr(2, 8); |
| 295 |
} |
| 296 |
/** |
| 297 |
* For browser-based histories, we combine the state and key into an object |
| 298 |
*/ |
| 299 |
|
| 300 |
|
| 301 |
function getHistoryState(location) { |
| 302 |
return { |
| 303 |
usr: location.state, |
| 304 |
key: location.key |
| 305 |
}; |
| 306 |
} |
| 307 |
/** |
| 308 |
* Creates a Location object with a unique key from the given Path |
| 309 |
*/ |
| 310 |
|
| 311 |
|
| 312 |
function createLocation(current, to, state, key) { |
| 313 |
if (state === void 0) { |
| 314 |
state = null; |
| 315 |
} |
| 316 |
|
| 317 |
let location = _extends({ |
| 318 |
pathname: typeof current === "string" ? current : current.pathname, |
| 319 |
search: "", |
| 320 |
hash: "" |
| 321 |
}, typeof to === "string" ? parsePath(to) : to, { |
| 322 |
state, |
| 323 |
// TODO: This could be cleaned up. push/replace should probably just take |
| 324 |
// full Locations now and avoid the need to run through this flow at all |
| 325 |
// But that's a pretty big refactor to the current test suite so going to |
| 326 |
// keep as is for the time being and just let any incoming keys take precedence |
| 327 |
key: to && to.key || key || createKey() |
| 328 |
}); |
| 329 |
|
| 330 |
return location; |
| 331 |
} |
| 332 |
/** |
| 333 |
* Creates a string URL path from the given pathname, search, and hash components. |
| 334 |
*/ |
| 335 |
|
| 336 |
function createPath(_ref) { |
| 337 |
let { |
| 338 |
pathname = "/", |
| 339 |
search = "", |
| 340 |
hash = "" |
| 341 |
} = _ref; |
| 342 |
if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search; |
| 343 |
if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash; |
| 344 |
return pathname; |
| 345 |
} |
| 346 |
/** |
| 347 |
* Parses a string URL path into its separate pathname, search, and hash components. |
| 348 |
*/ |
| 349 |
|
| 350 |
function parsePath(path) { |
| 351 |
let parsedPath = {}; |
| 352 |
|
| 353 |
if (path) { |
| 354 |
let hashIndex = path.indexOf("#"); |
| 355 |
|
| 356 |
if (hashIndex >= 0) { |
| 357 |
parsedPath.hash = path.substr(hashIndex); |
| 358 |
path = path.substr(0, hashIndex); |
| 359 |
} |
| 360 |
|
| 361 |
let searchIndex = path.indexOf("?"); |
| 362 |
|
| 363 |
if (searchIndex >= 0) { |
| 364 |
parsedPath.search = path.substr(searchIndex); |
| 365 |
path = path.substr(0, searchIndex); |
| 366 |
} |
| 367 |
|
| 368 |
if (path) { |
| 369 |
parsedPath.pathname = path; |
| 370 |
} |
| 371 |
} |
| 372 |
|
| 373 |
return parsedPath; |
| 374 |
} |
| 375 |
function createURL(location) { |
| 376 |
// window.location.origin is "null" (the literal string value) in Firefox |
| 377 |
// under certain conditions, notably when serving from a local HTML file |
| 378 |
// See https://bugzilla.mozilla.org/show_bug.cgi?id=878297 |
| 379 |
let base = typeof window !== "undefined" && typeof window.location !== "undefined" && window.location.origin !== "null" ? window.location.origin : "unknown://unknown"; |
| 380 |
let href = typeof location === "string" ? location : createPath(location); |
| 381 |
return new URL(href, base); |
| 382 |
} |
| 383 |
|
| 384 |
function getUrlBasedHistory(getLocation, createHref, validateLocation, options) { |
| 385 |
if (options === void 0) { |
| 386 |
options = {}; |
| 387 |
} |
| 388 |
|
| 389 |
let { |
| 390 |
window = document.defaultView, |
| 391 |
v5Compat = false |
| 392 |
} = options; |
| 393 |
let globalHistory = window.history; |
| 394 |
let action = Action.Pop; |
| 395 |
let listener = null; |
| 396 |
|
| 397 |
function handlePop() { |
| 398 |
action = Action.Pop; |
| 399 |
|
| 400 |
if (listener) { |
| 401 |
listener({ |
| 402 |
action, |
| 403 |
location: history.location |
| 404 |
}); |
| 405 |
} |
| 406 |
} |
| 407 |
|
| 408 |
function push(to, state) { |
| 409 |
action = Action.Push; |
| 410 |
let location = createLocation(history.location, to, state); |
| 411 |
if (validateLocation) validateLocation(location, to); |
| 412 |
let historyState = getHistoryState(location); |
| 413 |
let url = history.createHref(location); // try...catch because iOS limits us to 100 pushState calls :/ |
| 414 |
|
| 415 |
try { |
| 416 |
globalHistory.pushState(historyState, "", url); |
| 417 |
} catch (error) { |
| 418 |
// They are going to lose state here, but there is no real |
| 419 |
// way to warn them about it since the page will refresh... |
| 420 |
window.location.assign(url); |
| 421 |
} |
| 422 |
|
| 423 |
if (v5Compat && listener) { |
| 424 |
listener({ |
| 425 |
action, |
| 426 |
location: history.location |
| 427 |
}); |
| 428 |
} |
| 429 |
} |
| 430 |
|
| 431 |
function replace(to, state) { |
| 432 |
action = Action.Replace; |
| 433 |
let location = createLocation(history.location, to, state); |
| 434 |
if (validateLocation) validateLocation(location, to); |
| 435 |
let historyState = getHistoryState(location); |
| 436 |
let url = history.createHref(location); |
| 437 |
globalHistory.replaceState(historyState, "", url); |
| 438 |
|
| 439 |
if (v5Compat && listener) { |
| 440 |
listener({ |
| 441 |
action, |
| 442 |
location: history.location |
| 443 |
}); |
| 444 |
} |
| 445 |
} |
| 446 |
|
| 447 |
let history = { |
| 448 |
get action() { |
| 449 |
return action; |
| 450 |
}, |
| 451 |
|
| 452 |
get location() { |
| 453 |
return getLocation(window, globalHistory); |
| 454 |
}, |
| 455 |
|
| 456 |
listen(fn) { |
| 457 |
if (listener) { |
| 458 |
throw new Error("A history only accepts one active listener"); |
| 459 |
} |
| 460 |
|
| 461 |
window.addEventListener(PopStateEventType, handlePop); |
| 462 |
listener = fn; |
| 463 |
return () => { |
| 464 |
window.removeEventListener(PopStateEventType, handlePop); |
| 465 |
listener = null; |
| 466 |
}; |
| 467 |
}, |
| 468 |
|
| 469 |
createHref(to) { |
| 470 |
return createHref(window, to); |
| 471 |
}, |
| 472 |
|
| 473 |
encodeLocation(location) { |
| 474 |
// Encode a Location the same way window.location would |
| 475 |
let url = createURL(createPath(location)); |
| 476 |
return _extends({}, location, { |
| 477 |
pathname: url.pathname, |
| 478 |
search: url.search, |
| 479 |
hash: url.hash |
| 480 |
}); |
| 481 |
}, |
| 482 |
|
| 483 |
push, |
| 484 |
replace, |
| 485 |
|
| 486 |
go(n) { |
| 487 |
return globalHistory.go(n); |
| 488 |
} |
| 489 |
|
| 490 |
}; |
| 491 |
return history; |
| 492 |
} //#endregion |
| 493 |
|
| 494 |
var ResultType; |
| 495 |
|
| 496 |
(function (ResultType) { |
| 497 |
ResultType["data"] = "data"; |
| 498 |
ResultType["deferred"] = "deferred"; |
| 499 |
ResultType["redirect"] = "redirect"; |
| 500 |
ResultType["error"] = "error"; |
| 501 |
})(ResultType || (ResultType = {})); |
| 502 |
|
| 503 |
function isIndexRoute(route) { |
| 504 |
return route.index === true; |
| 505 |
} // Walk the route tree generating unique IDs where necessary so we are working |
| 506 |
// solely with AgnosticDataRouteObject's within the Router |
| 507 |
|
| 508 |
|
| 509 |
function convertRoutesToDataRoutes(routes, parentPath, allIds) { |
| 510 |
if (parentPath === void 0) { |
| 511 |
parentPath = []; |
| 512 |
} |
| 513 |
|
| 514 |
if (allIds === void 0) { |
| 515 |
allIds = new Set(); |
| 516 |
} |
| 517 |
|
| 518 |
return routes.map((route, index) => { |
| 519 |
let treePath = [...parentPath, index]; |
| 520 |
let id = typeof route.id === "string" ? route.id : treePath.join("-"); |
| 521 |
invariant(route.index !== true || !route.children, "Cannot specify children on an index route"); |
| 522 |
invariant(!allIds.has(id), "Found a route id collision on id \"" + id + "\". Route " + "id's must be globally unique within Data Router usages"); |
| 523 |
allIds.add(id); |
| 524 |
|
| 525 |
if (isIndexRoute(route)) { |
| 526 |
let indexRoute = _extends({}, route, { |
| 527 |
id |
| 528 |
}); |
| 529 |
|
| 530 |
return indexRoute; |
| 531 |
} else { |
| 532 |
let pathOrLayoutRoute = _extends({}, route, { |
| 533 |
id, |
| 534 |
children: route.children ? convertRoutesToDataRoutes(route.children, treePath, allIds) : undefined |
| 535 |
}); |
| 536 |
|
| 537 |
return pathOrLayoutRoute; |
| 538 |
} |
| 539 |
}); |
| 540 |
} |
| 541 |
/** |
| 542 |
* Matches the given routes to a location and returns the match data. |
| 543 |
* |
| 544 |
* @see https://reactrouter.com/docs/en/v6/utils/match-routes |
| 545 |
*/ |
| 546 |
|
| 547 |
function matchRoutes(routes, locationArg, basename) { |
| 548 |
if (basename === void 0) { |
| 549 |
basename = "/"; |
| 550 |
} |
| 551 |
|
| 552 |
let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; |
| 553 |
let pathname = stripBasename(location.pathname || "/", basename); |
| 554 |
|
| 555 |
if (pathname == null) { |
| 556 |
return null; |
| 557 |
} |
| 558 |
|
| 559 |
let branches = flattenRoutes(routes); |
| 560 |
rankRouteBranches(branches); |
| 561 |
let matches = null; |
| 562 |
|
| 563 |
for (let i = 0; matches == null && i < branches.length; ++i) { |
| 564 |
matches = matchRouteBranch(branches[i], // Incoming pathnames are generally encoded from either window.location |
| 565 |
// or from router.navigate, but we want to match against the unencoded |
| 566 |
// paths in the route definitions. Memory router locations won't be |
| 567 |
// encoded here but there also shouldn't be anything to decode so this |
| 568 |
// should be a safe operation. This avoids needing matchRoutes to be |
| 569 |
// history-aware. |
| 570 |
safelyDecodeURI(pathname)); |
| 571 |
} |
| 572 |
|
| 573 |
return matches; |
| 574 |
} |
| 575 |
|
| 576 |
function flattenRoutes(routes, branches, parentsMeta, parentPath) { |
| 577 |
if (branches === void 0) { |
| 578 |
branches = []; |
| 579 |
} |
| 580 |
|
| 581 |
if (parentsMeta === void 0) { |
| 582 |
parentsMeta = []; |
| 583 |
} |
| 584 |
|
| 585 |
if (parentPath === void 0) { |
| 586 |
parentPath = ""; |
| 587 |
} |
| 588 |
|
| 589 |
routes.forEach((route, index) => { |
| 590 |
let meta = { |
| 591 |
relativePath: route.path || "", |
| 592 |
caseSensitive: route.caseSensitive === true, |
| 593 |
childrenIndex: index, |
| 594 |
route |
| 595 |
}; |
| 596 |
|
| 597 |
if (meta.relativePath.startsWith("/")) { |
| 598 |
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."); |
| 599 |
meta.relativePath = meta.relativePath.slice(parentPath.length); |
| 600 |
} |
| 601 |
|
| 602 |
let path = joinPaths([parentPath, meta.relativePath]); |
| 603 |
let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array so we traverse the |
| 604 |
// route tree depth-first and child routes appear before their parents in |
| 605 |
// the "flattened" version. |
| 606 |
|
| 607 |
if (route.children && route.children.length > 0) { |
| 608 |
invariant( // Our types know better, but runtime JS may not! |
| 609 |
// @ts-expect-error |
| 610 |
route.index !== true, "Index routes must not have child routes. Please remove " + ("all child routes from route path \"" + path + "\".")); |
| 611 |
flattenRoutes(route.children, branches, routesMeta, path); |
| 612 |
} // Routes without a path shouldn't ever match by themselves unless they are |
| 613 |
// index routes, so don't add them to the list of possible branches. |
| 614 |
|
| 615 |
|
| 616 |
if (route.path == null && !route.index) { |
| 617 |
return; |
| 618 |
} |
| 619 |
|
| 620 |
branches.push({ |
| 621 |
path, |
| 622 |
score: computeScore(path, route.index), |
| 623 |
routesMeta |
| 624 |
}); |
| 625 |
}); |
| 626 |
return branches; |
| 627 |
} |
| 628 |
|
| 629 |
function rankRouteBranches(branches) { |
| 630 |
branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first |
| 631 |
: compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex))); |
| 632 |
} |
| 633 |
|
| 634 |
const paramRe = /^:\w+$/; |
| 635 |
const dynamicSegmentValue = 3; |
| 636 |
const indexRouteValue = 2; |
| 637 |
const emptySegmentValue = 1; |
| 638 |
const staticSegmentValue = 10; |
| 639 |
const splatPenalty = -2; |
| 640 |
|
| 641 |
const isSplat = s => s === "*"; |
| 642 |
|
| 643 |
function computeScore(path, index) { |
| 644 |
let segments = path.split("/"); |
| 645 |
let initialScore = segments.length; |
| 646 |
|
| 647 |
if (segments.some(isSplat)) { |
| 648 |
initialScore += splatPenalty; |
| 649 |
} |
| 650 |
|
| 651 |
if (index) { |
| 652 |
initialScore += indexRouteValue; |
| 653 |
} |
| 654 |
|
| 655 |
return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore); |
| 656 |
} |
| 657 |
|
| 658 |
function compareIndexes(a, b) { |
| 659 |
let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]); |
| 660 |
return siblings ? // If two routes are siblings, we should try to match the earlier sibling |
| 661 |
// first. This allows people to have fine-grained control over the matching |
| 662 |
// behavior by simply putting routes with identical paths in the order they |
| 663 |
// want them tried. |
| 664 |
a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index, |
| 665 |
// so they sort equally. |
| 666 |
0; |
| 667 |
} |
| 668 |
|
| 669 |
function matchRouteBranch(branch, pathname) { |
| 670 |
let { |
| 671 |
routesMeta |
| 672 |
} = branch; |
| 673 |
let matchedParams = {}; |
| 674 |
let matchedPathname = "/"; |
| 675 |
let matches = []; |
| 676 |
|
| 677 |
for (let i = 0; i < routesMeta.length; ++i) { |
| 678 |
let meta = routesMeta[i]; |
| 679 |
let end = i === routesMeta.length - 1; |
| 680 |
let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/"; |
| 681 |
let match = matchPath({ |
| 682 |
path: meta.relativePath, |
| 683 |
caseSensitive: meta.caseSensitive, |
| 684 |
end |
| 685 |
}, remainingPathname); |
| 686 |
if (!match) return null; |
| 687 |
Object.assign(matchedParams, match.params); |
| 688 |
let route = meta.route; |
| 689 |
matches.push({ |
| 690 |
// TODO: Can this as be avoided? |
| 691 |
params: matchedParams, |
| 692 |
pathname: joinPaths([matchedPathname, match.pathname]), |
| 693 |
pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])), |
| 694 |
route |
| 695 |
}); |
| 696 |
|
| 697 |
if (match.pathnameBase !== "/") { |
| 698 |
matchedPathname = joinPaths([matchedPathname, match.pathnameBase]); |
| 699 |
} |
| 700 |
} |
| 701 |
|
| 702 |
return matches; |
| 703 |
} |
| 704 |
/** |
| 705 |
* Returns a path with params interpolated. |
| 706 |
* |
| 707 |
* @see https://reactrouter.com/docs/en/v6/utils/generate-path |
| 708 |
*/ |
| 709 |
|
| 710 |
|
| 711 |
function generatePath(path, params) { |
| 712 |
if (params === void 0) { |
| 713 |
params = {}; |
| 714 |
} |
| 715 |
|
| 716 |
return path.replace(/:(\w+)/g, (_, key) => { |
| 717 |
invariant(params[key] != null, "Missing \":" + key + "\" param"); |
| 718 |
return params[key]; |
| 719 |
}).replace(/(\/?)\*/, (_, prefix, __, str) => { |
| 720 |
const star = "*"; |
| 721 |
|
| 722 |
if (params[star] == null) { |
| 723 |
// If no splat was provided, trim the trailing slash _unless_ it's |
| 724 |
// the entire path |
| 725 |
return str === "/*" ? "/" : ""; |
| 726 |
} // Apply the splat |
| 727 |
|
| 728 |
|
| 729 |
return "" + prefix + params[star]; |
| 730 |
}); |
| 731 |
} |
| 732 |
/** |
| 733 |
* Performs pattern matching on a URL pathname and returns information about |
| 734 |
* the match. |
| 735 |
* |
| 736 |
* @see https://reactrouter.com/docs/en/v6/utils/match-path |
| 737 |
*/ |
| 738 |
|
| 739 |
function matchPath(pattern, pathname) { |
| 740 |
if (typeof pattern === "string") { |
| 741 |
pattern = { |
| 742 |
path: pattern, |
| 743 |
caseSensitive: false, |
| 744 |
end: true |
| 745 |
}; |
| 746 |
} |
| 747 |
|
| 748 |
let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end); |
| 749 |
let match = pathname.match(matcher); |
| 750 |
if (!match) return null; |
| 751 |
let matchedPathname = match[0]; |
| 752 |
let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1"); |
| 753 |
let captureGroups = match.slice(1); |
| 754 |
let params = paramNames.reduce((memo, paramName, index) => { |
| 755 |
// We need to compute the pathnameBase here using the raw splat value |
| 756 |
// instead of using params["*"] later because it will be decoded then |
| 757 |
if (paramName === "*") { |
| 758 |
let splatValue = captureGroups[index] || ""; |
| 759 |
pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1"); |
| 760 |
} |
| 761 |
|
| 762 |
memo[paramName] = safelyDecodeURIComponent(captureGroups[index] || "", paramName); |
| 763 |
return memo; |
| 764 |
}, {}); |
| 765 |
return { |
| 766 |
params, |
| 767 |
pathname: matchedPathname, |
| 768 |
pathnameBase, |
| 769 |
pattern |
| 770 |
}; |
| 771 |
} |
| 772 |
|
| 773 |
function compilePath(path, caseSensitive, end) { |
| 774 |
if (caseSensitive === void 0) { |
| 775 |
caseSensitive = false; |
| 776 |
} |
| 777 |
|
| 778 |
if (end === void 0) { |
| 779 |
end = true; |
| 780 |
} |
| 781 |
|
| 782 |
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(/\*$/, "/*") + "\".")); |
| 783 |
let paramNames = []; |
| 784 |
let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below |
| 785 |
.replace(/^\/*/, "/") // Make sure it has a leading / |
| 786 |
.replace(/[\\.*+^$?{}|()[\]]/g, "\\$&") // Escape special regex chars |
| 787 |
.replace(/:(\w+)/g, (_, paramName) => { |
| 788 |
paramNames.push(paramName); |
| 789 |
return "([^\\/]+)"; |
| 790 |
}); |
| 791 |
|
| 792 |
if (path.endsWith("*")) { |
| 793 |
paramNames.push("*"); |
| 794 |
regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest |
| 795 |
: "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"] |
| 796 |
} else if (end) { |
| 797 |
// When matching to the end, ignore trailing slashes |
| 798 |
regexpSource += "\\/*$"; |
| 799 |
} else if (path !== "" && path !== "/") { |
| 800 |
// If our path is non-empty and contains anything beyond an initial slash, |
| 801 |
// then we have _some_ form of path in our regex so we should expect to |
| 802 |
// match only if we find the end of this path segment. Look for an optional |
| 803 |
// non-captured trailing slash (to match a portion of the URL) or the end |
| 804 |
// of the path (if we've matched to the end). We used to do this with a |
| 805 |
// word boundary but that gives false positives on routes like |
| 806 |
// /user-preferences since `-` counts as a word boundary. |
| 807 |
regexpSource += "(?:(?=\\/|$))"; |
| 808 |
} else ; |
| 809 |
|
| 810 |
let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i"); |
| 811 |
return [matcher, paramNames]; |
| 812 |
} |
| 813 |
|
| 814 |
function safelyDecodeURI(value) { |
| 815 |
try { |
| 816 |
return decodeURI(value); |
| 817 |
} catch (error) { |
| 818 |
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 + ").")); |
| 819 |
return value; |
| 820 |
} |
| 821 |
} |
| 822 |
|
| 823 |
function safelyDecodeURIComponent(value, paramName) { |
| 824 |
try { |
| 825 |
return decodeURIComponent(value); |
| 826 |
} catch (error) { |
| 827 |
warning(false, "The value for the URL param \"" + paramName + "\" will not be decoded because" + (" the string \"" + value + "\" is a malformed URL segment. This is probably") + (" due to a bad percent encoding (" + error + ").")); |
| 828 |
return value; |
| 829 |
} |
| 830 |
} |
| 831 |
/** |
| 832 |
* @private |
| 833 |
*/ |
| 834 |
|
| 835 |
|
| 836 |
function stripBasename(pathname, basename) { |
| 837 |
if (basename === "/") return pathname; |
| 838 |
|
| 839 |
if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) { |
| 840 |
return null; |
| 841 |
} // We want to leave trailing slash behavior in the user's control, so if they |
| 842 |
// specify a basename with a trailing slash, we should support it |
| 843 |
|
| 844 |
|
| 845 |
let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length; |
| 846 |
let nextChar = pathname.charAt(startIndex); |
| 847 |
|
| 848 |
if (nextChar && nextChar !== "/") { |
| 849 |
// pathname does not start with basename/ |
| 850 |
return null; |
| 851 |
} |
| 852 |
|
| 853 |
return pathname.slice(startIndex) || "/"; |
| 854 |
} |
| 855 |
function invariant(value, message) { |
| 856 |
if (value === false || value === null || typeof value === "undefined") { |
| 857 |
throw new Error(message); |
| 858 |
} |
| 859 |
} |
| 860 |
/** |
| 861 |
* @private |
| 862 |
*/ |
| 863 |
|
| 864 |
function warning(cond, message) { |
| 865 |
if (!cond) { |
| 866 |
// eslint-disable-next-line no-console |
| 867 |
if (typeof console !== "undefined") console.warn(message); |
| 868 |
|
| 869 |
try { |
| 870 |
// Welcome to debugging React Router! |
| 871 |
// |
| 872 |
// This error is thrown as a convenience so you can more easily |
| 873 |
// find the source for a warning that appears in the console by |
| 874 |
// enabling "pause on exceptions" in your JavaScript debugger. |
| 875 |
throw new Error(message); // eslint-disable-next-line no-empty |
| 876 |
} catch (e) {} |
| 877 |
} |
| 878 |
} |
| 879 |
/** |
| 880 |
* Returns a resolved path object relative to the given pathname. |
| 881 |
* |
| 882 |
* @see https://reactrouter.com/docs/en/v6/utils/resolve-path |
| 883 |
*/ |
| 884 |
|
| 885 |
function resolvePath(to, fromPathname) { |
| 886 |
if (fromPathname === void 0) { |
| 887 |
fromPathname = "/"; |
| 888 |
} |
| 889 |
|
| 890 |
let { |
| 891 |
pathname: toPathname, |
| 892 |
search = "", |
| 893 |
hash = "" |
| 894 |
} = typeof to === "string" ? parsePath(to) : to; |
| 895 |
let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname; |
| 896 |
return { |
| 897 |
pathname, |
| 898 |
search: normalizeSearch(search), |
| 899 |
hash: normalizeHash(hash) |
| 900 |
}; |
| 901 |
} |
| 902 |
|
| 903 |
function resolvePathname(relativePath, fromPathname) { |
| 904 |
let segments = fromPathname.replace(/\/+$/, "").split("/"); |
| 905 |
let relativeSegments = relativePath.split("/"); |
| 906 |
relativeSegments.forEach(segment => { |
| 907 |
if (segment === "..") { |
| 908 |
// Keep the root "" segment so the pathname starts at / |
| 909 |
if (segments.length > 1) segments.pop(); |
| 910 |
} else if (segment !== ".") { |
| 911 |
segments.push(segment); |
| 912 |
} |
| 913 |
}); |
| 914 |
return segments.length > 1 ? segments.join("/") : "/"; |
| 915 |
} |
| 916 |
|
| 917 |
function getInvalidPathError(char, field, dest, path) { |
| 918 |
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."; |
| 919 |
} |
| 920 |
/** |
| 921 |
* @private |
| 922 |
* |
| 923 |
* When processing relative navigation we want to ignore ancestor routes that |
| 924 |
* do not contribute to the path, such that index/pathless layout routes don't |
| 925 |
* interfere. |
| 926 |
* |
| 927 |
* For example, when moving a route element into an index route and/or a |
| 928 |
* pathless layout route, relative link behavior contained within should stay |
| 929 |
* the same. Both of the following examples should link back to the root: |
| 930 |
* |
| 931 |
* <Route path="/"> |
| 932 |
* <Route path="accounts" element={<Link to=".."}> |
| 933 |
* </Route> |
| 934 |
* |
| 935 |
* <Route path="/"> |
| 936 |
* <Route path="accounts"> |
| 937 |
* <Route element={<AccountsLayout />}> // <-- Does not contribute |
| 938 |
* <Route index element={<Link to=".."} /> // <-- Does not contribute |
| 939 |
* </Route |
| 940 |
* </Route> |
| 941 |
* </Route> |
| 942 |
*/ |
| 943 |
|
| 944 |
|
| 945 |
function getPathContributingMatches(matches) { |
| 946 |
return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0); |
| 947 |
} |
| 948 |
/** |
| 949 |
* @private |
| 950 |
*/ |
| 951 |
|
| 952 |
function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) { |
| 953 |
if (isPathRelative === void 0) { |
| 954 |
isPathRelative = false; |
| 955 |
} |
| 956 |
|
| 957 |
let to; |
| 958 |
|
| 959 |
if (typeof toArg === "string") { |
| 960 |
to = parsePath(toArg); |
| 961 |
} else { |
| 962 |
to = _extends({}, toArg); |
| 963 |
invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to)); |
| 964 |
invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to)); |
| 965 |
invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to)); |
| 966 |
} |
| 967 |
|
| 968 |
let isEmptyPath = toArg === "" || to.pathname === ""; |
| 969 |
let toPathname = isEmptyPath ? "/" : to.pathname; |
| 970 |
let from; // Routing is relative to the current pathname if explicitly requested. |
| 971 |
// |
| 972 |
// If a pathname is explicitly provided in `to`, it should be relative to the |
| 973 |
// route context. This is explained in `Note on `<Link to>` values` in our |
| 974 |
// migration guide from v5 as a means of disambiguation between `to` values |
| 975 |
// that begin with `/` and those that do not. However, this is problematic for |
| 976 |
// `to` values that do not provide a pathname. `to` can simply be a search or |
| 977 |
// hash string, in which case we should assume that the navigation is relative |
| 978 |
// to the current location's pathname and *not* the route pathname. |
| 979 |
|
| 980 |
if (isPathRelative || toPathname == null) { |
| 981 |
from = locationPathname; |
| 982 |
} else { |
| 983 |
let routePathnameIndex = routePathnames.length - 1; |
| 984 |
|
| 985 |
if (toPathname.startsWith("..")) { |
| 986 |
let toSegments = toPathname.split("/"); // Each leading .. segment means "go up one route" instead of "go up one |
| 987 |
// URL segment". This is a key difference from how <a href> works and a |
| 988 |
// major reason we call this a "to" value instead of a "href". |
| 989 |
|
| 990 |
while (toSegments[0] === "..") { |
| 991 |
toSegments.shift(); |
| 992 |
routePathnameIndex -= 1; |
| 993 |
} |
| 994 |
|
| 995 |
to.pathname = toSegments.join("/"); |
| 996 |
} // If there are more ".." segments than parent routes, resolve relative to |
| 997 |
// the root / URL. |
| 998 |
|
| 999 |
|
| 1000 |
from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/"; |
| 1001 |
} |
| 1002 |
|
| 1003 |
let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original "to" had one |
| 1004 |
|
| 1005 |
let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"); // Or if this was a link to the current path which has a trailing slash |
| 1006 |
|
| 1007 |
let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/"); |
| 1008 |
|
| 1009 |
if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) { |
| 1010 |
path.pathname += "/"; |
| 1011 |
} |
| 1012 |
|
| 1013 |
return path; |
| 1014 |
} |
| 1015 |
/** |
| 1016 |
* @private |
| 1017 |
*/ |
| 1018 |
|
| 1019 |
function getToPathname(to) { |
| 1020 |
// Empty strings should be treated the same as / paths |
| 1021 |
return to === "" || to.pathname === "" ? "/" : typeof to === "string" ? parsePath(to).pathname : to.pathname; |
| 1022 |
} |
| 1023 |
/** |
| 1024 |
* @private |
| 1025 |
*/ |
| 1026 |
|
| 1027 |
const joinPaths = paths => paths.join("/").replace(/\/\/+/g, "/"); |
| 1028 |
/** |
| 1029 |
* @private |
| 1030 |
*/ |
| 1031 |
|
| 1032 |
const normalizePathname = pathname => pathname.replace(/\/+$/, "").replace(/^\/*/, "/"); |
| 1033 |
/** |
| 1034 |
* @private |
| 1035 |
*/ |
| 1036 |
|
| 1037 |
const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search; |
| 1038 |
/** |
| 1039 |
* @private |
| 1040 |
*/ |
| 1041 |
|
| 1042 |
const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash; |
| 1043 |
/** |
| 1044 |
* This is a shortcut for creating `application/json` responses. Converts `data` |
| 1045 |
* to JSON and sets the `Content-Type` header. |
| 1046 |
*/ |
| 1047 |
|
| 1048 |
const json = function json(data, init) { |
| 1049 |
if (init === void 0) { |
| 1050 |
init = {}; |
| 1051 |
} |
| 1052 |
|
| 1053 |
let responseInit = typeof init === "number" ? { |
| 1054 |
status: init |
| 1055 |
} : init; |
| 1056 |
let headers = new Headers(responseInit.headers); |
| 1057 |
|
| 1058 |
if (!headers.has("Content-Type")) { |
| 1059 |
headers.set("Content-Type", "application/json; charset=utf-8"); |
| 1060 |
} |
| 1061 |
|
| 1062 |
return new Response(JSON.stringify(data), _extends({}, responseInit, { |
| 1063 |
headers |
| 1064 |
})); |
| 1065 |
}; |
| 1066 |
class AbortedDeferredError extends Error {} |
| 1067 |
class DeferredData { |
| 1068 |
constructor(data) { |
| 1069 |
this.pendingKeys = new Set(); |
| 1070 |
this.subscriber = undefined; |
| 1071 |
invariant(data && typeof data === "object" && !Array.isArray(data), "defer() only accepts plain objects"); // Set up an AbortController + Promise we can race against to exit early |
| 1072 |
// cancellation |
| 1073 |
|
| 1074 |
let reject; |
| 1075 |
this.abortPromise = new Promise((_, r) => reject = r); |
| 1076 |
this.controller = new AbortController(); |
| 1077 |
|
| 1078 |
let onAbort = () => reject(new AbortedDeferredError("Deferred data aborted")); |
| 1079 |
|
| 1080 |
this.unlistenAbortSignal = () => this.controller.signal.removeEventListener("abort", onAbort); |
| 1081 |
|
| 1082 |
this.controller.signal.addEventListener("abort", onAbort); |
| 1083 |
this.data = Object.entries(data).reduce((acc, _ref) => { |
| 1084 |
let [key, value] = _ref; |
| 1085 |
return Object.assign(acc, { |
| 1086 |
[key]: this.trackPromise(key, value) |
| 1087 |
}); |
| 1088 |
}, {}); |
| 1089 |
} |
| 1090 |
|
| 1091 |
trackPromise(key, value) { |
| 1092 |
if (!(value instanceof Promise)) { |
| 1093 |
return value; |
| 1094 |
} |
| 1095 |
|
| 1096 |
this.pendingKeys.add(key); // We store a little wrapper promise that will be extended with |
| 1097 |
// _data/_error props upon resolve/reject |
| 1098 |
|
| 1099 |
let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, null, data), error => this.onSettle(promise, key, error)); // Register rejection listeners to avoid uncaught promise rejections on |
| 1100 |
// errors or aborted deferred values |
| 1101 |
|
| 1102 |
promise.catch(() => {}); |
| 1103 |
Object.defineProperty(promise, "_tracked", { |
| 1104 |
get: () => true |
| 1105 |
}); |
| 1106 |
return promise; |
| 1107 |
} |
| 1108 |
|
| 1109 |
onSettle(promise, key, error, data) { |
| 1110 |
if (this.controller.signal.aborted && error instanceof AbortedDeferredError) { |
| 1111 |
this.unlistenAbortSignal(); |
| 1112 |
Object.defineProperty(promise, "_error", { |
| 1113 |
get: () => error |
| 1114 |
}); |
| 1115 |
return Promise.reject(error); |
| 1116 |
} |
| 1117 |
|
| 1118 |
this.pendingKeys.delete(key); |
| 1119 |
|
| 1120 |
if (this.done) { |
| 1121 |
// Nothing left to abort! |
| 1122 |
this.unlistenAbortSignal(); |
| 1123 |
} |
| 1124 |
|
| 1125 |
const subscriber = this.subscriber; |
| 1126 |
|
| 1127 |
if (error) { |
| 1128 |
Object.defineProperty(promise, "_error", { |
| 1129 |
get: () => error |
| 1130 |
}); |
| 1131 |
subscriber && subscriber(false); |
| 1132 |
return Promise.reject(error); |
| 1133 |
} |
| 1134 |
|
| 1135 |
Object.defineProperty(promise, "_data", { |
| 1136 |
get: () => data |
| 1137 |
}); |
| 1138 |
subscriber && subscriber(false); |
| 1139 |
return data; |
| 1140 |
} |
| 1141 |
|
| 1142 |
subscribe(fn) { |
| 1143 |
this.subscriber = fn; |
| 1144 |
} |
| 1145 |
|
| 1146 |
cancel() { |
| 1147 |
this.controller.abort(); |
| 1148 |
this.pendingKeys.forEach((v, k) => this.pendingKeys.delete(k)); |
| 1149 |
let subscriber = this.subscriber; |
| 1150 |
subscriber && subscriber(true); |
| 1151 |
} |
| 1152 |
|
| 1153 |
async resolveData(signal) { |
| 1154 |
let aborted = false; |
| 1155 |
|
| 1156 |
if (!this.done) { |
| 1157 |
let onAbort = () => this.cancel(); |
| 1158 |
|
| 1159 |
signal.addEventListener("abort", onAbort); |
| 1160 |
aborted = await new Promise(resolve => { |
| 1161 |
this.subscribe(aborted => { |
| 1162 |
signal.removeEventListener("abort", onAbort); |
| 1163 |
|
| 1164 |
if (aborted || this.done) { |
| 1165 |
resolve(aborted); |
| 1166 |
} |
| 1167 |
}); |
| 1168 |
}); |
| 1169 |
} |
| 1170 |
|
| 1171 |
return aborted; |
| 1172 |
} |
| 1173 |
|
| 1174 |
get done() { |
| 1175 |
return this.pendingKeys.size === 0; |
| 1176 |
} |
| 1177 |
|
| 1178 |
get unwrappedData() { |
| 1179 |
invariant(this.data !== null && this.done, "Can only unwrap data on initialized and settled deferreds"); |
| 1180 |
return Object.entries(this.data).reduce((acc, _ref2) => { |
| 1181 |
let [key, value] = _ref2; |
| 1182 |
return Object.assign(acc, { |
| 1183 |
[key]: unwrapTrackedPromise(value) |
| 1184 |
}); |
| 1185 |
}, {}); |
| 1186 |
} |
| 1187 |
|
| 1188 |
} |
| 1189 |
|
| 1190 |
function isTrackedPromise(value) { |
| 1191 |
return value instanceof Promise && value._tracked === true; |
| 1192 |
} |
| 1193 |
|
| 1194 |
function unwrapTrackedPromise(value) { |
| 1195 |
if (!isTrackedPromise(value)) { |
| 1196 |
return value; |
| 1197 |
} |
| 1198 |
|
| 1199 |
if (value._error) { |
| 1200 |
throw value._error; |
| 1201 |
} |
| 1202 |
|
| 1203 |
return value._data; |
| 1204 |
} |
| 1205 |
|
| 1206 |
function defer(data) { |
| 1207 |
return new DeferredData(data); |
| 1208 |
} |
| 1209 |
/** |
| 1210 |
* A redirect response. Sets the status code and the `Location` header. |
| 1211 |
* Defaults to "302 Found". |
| 1212 |
*/ |
| 1213 |
|
| 1214 |
const redirect = function redirect(url, init) { |
| 1215 |
if (init === void 0) { |
| 1216 |
init = 302; |
| 1217 |
} |
| 1218 |
|
| 1219 |
let responseInit = init; |
| 1220 |
|
| 1221 |
if (typeof responseInit === "number") { |
| 1222 |
responseInit = { |
| 1223 |
status: responseInit |
| 1224 |
}; |
| 1225 |
} else if (typeof responseInit.status === "undefined") { |
| 1226 |
responseInit.status = 302; |
| 1227 |
} |
| 1228 |
|
| 1229 |
let headers = new Headers(responseInit.headers); |
| 1230 |
headers.set("Location", url); |
| 1231 |
return new Response(null, _extends({}, responseInit, { |
| 1232 |
headers |
| 1233 |
})); |
| 1234 |
}; |
| 1235 |
/** |
| 1236 |
* @private |
| 1237 |
* Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies |
| 1238 |
*/ |
| 1239 |
|
| 1240 |
class ErrorResponse { |
| 1241 |
constructor(status, statusText, data) { |
| 1242 |
this.status = status; |
| 1243 |
this.statusText = statusText || ""; |
| 1244 |
this.data = data; |
| 1245 |
} |
| 1246 |
|
| 1247 |
} |
| 1248 |
/** |
| 1249 |
* Check if the given error is an ErrorResponse generated from a 4xx/5xx |
| 1250 |
* Response throw from an action/loader |
| 1251 |
*/ |
| 1252 |
|
| 1253 |
function isRouteErrorResponse(e) { |
| 1254 |
return e instanceof ErrorResponse; |
| 1255 |
} |
| 1256 |
|
| 1257 |
const IDLE_NAVIGATION = { |
| 1258 |
state: "idle", |
| 1259 |
location: undefined, |
| 1260 |
formMethod: undefined, |
| 1261 |
formAction: undefined, |
| 1262 |
formEncType: undefined, |
| 1263 |
formData: undefined |
| 1264 |
}; |
| 1265 |
const IDLE_FETCHER = { |
| 1266 |
state: "idle", |
| 1267 |
data: undefined, |
| 1268 |
formMethod: undefined, |
| 1269 |
formAction: undefined, |
| 1270 |
formEncType: undefined, |
| 1271 |
formData: undefined |
| 1272 |
}; |
| 1273 |
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"; |
| 1274 |
const isServer = !isBrowser; //#endregion |
| 1275 |
//////////////////////////////////////////////////////////////////////////////// |
| 1276 |
//#region createRouter |
| 1277 |
//////////////////////////////////////////////////////////////////////////////// |
| 1278 |
|
| 1279 |
/** |
| 1280 |
* Create a router and listen to history POP navigations |
| 1281 |
*/ |
| 1282 |
|
| 1283 |
function createRouter(init) { |
| 1284 |
invariant(init.routes.length > 0, "You must provide a non-empty routes array to createRouter"); |
| 1285 |
let dataRoutes = convertRoutesToDataRoutes(init.routes); // Cleanup function for history |
| 1286 |
|
| 1287 |
let unlistenHistory = null; // Externally-provided functions to call on all state changes |
| 1288 |
|
| 1289 |
let subscribers = new Set(); // Externally-provided object to hold scroll restoration locations during routing |
| 1290 |
|
| 1291 |
let savedScrollPositions = null; // Externally-provided function to get scroll restoration keys |
| 1292 |
|
| 1293 |
let getScrollRestorationKey = null; // Externally-provided function to get current scroll position |
| 1294 |
|
| 1295 |
let getScrollPosition = null; // One-time flag to control the initial hydration scroll restoration. Because |
| 1296 |
// we don't get the saved positions from <ScrollRestoration /> until _after_ |
| 1297 |
// the initial render, we need to manually trigger a separate updateState to |
| 1298 |
// send along the restoreScrollPosition |
| 1299 |
|
| 1300 |
let initialScrollRestored = false; |
| 1301 |
let initialMatches = matchRoutes(dataRoutes, init.history.location, init.basename); |
| 1302 |
let initialErrors = null; |
| 1303 |
|
| 1304 |
if (initialMatches == null) { |
| 1305 |
// If we do not match a user-provided-route, fall back to the root |
| 1306 |
// to allow the error boundary to take over |
| 1307 |
let { |
| 1308 |
matches, |
| 1309 |
route, |
| 1310 |
error |
| 1311 |
} = getNotFoundMatches(dataRoutes); |
| 1312 |
initialMatches = matches; |
| 1313 |
initialErrors = { |
| 1314 |
[route.id]: error |
| 1315 |
}; |
| 1316 |
} |
| 1317 |
|
| 1318 |
let initialized = !initialMatches.some(m => m.route.loader) || init.hydrationData != null; |
| 1319 |
let router; |
| 1320 |
let state = { |
| 1321 |
historyAction: init.history.action, |
| 1322 |
location: init.history.location, |
| 1323 |
matches: initialMatches, |
| 1324 |
initialized, |
| 1325 |
navigation: IDLE_NAVIGATION, |
| 1326 |
restoreScrollPosition: null, |
| 1327 |
preventScrollReset: false, |
| 1328 |
revalidation: "idle", |
| 1329 |
loaderData: init.hydrationData && init.hydrationData.loaderData || {}, |
| 1330 |
actionData: init.hydrationData && init.hydrationData.actionData || null, |
| 1331 |
errors: init.hydrationData && init.hydrationData.errors || initialErrors, |
| 1332 |
fetchers: new Map() |
| 1333 |
}; // -- Stateful internal variables to manage navigations -- |
| 1334 |
// Current navigation in progress (to be committed in completeNavigation) |
| 1335 |
|
| 1336 |
let pendingAction = Action.Pop; // Should the current navigation prevent the scroll reset if scroll cannot |
| 1337 |
// be restored? |
| 1338 |
|
| 1339 |
let pendingPreventScrollReset = false; // AbortController for the active navigation |
| 1340 |
|
| 1341 |
let pendingNavigationController; // We use this to avoid touching history in completeNavigation if a |
| 1342 |
// revalidation is entirely uninterrupted |
| 1343 |
|
| 1344 |
let isUninterruptedRevalidation = false; // Use this internal flag to force revalidation of all loaders: |
| 1345 |
// - submissions (completed or interrupted) |
| 1346 |
// - useRevalidate() |
| 1347 |
// - X-Remix-Revalidate (from redirect) |
| 1348 |
|
| 1349 |
let isRevalidationRequired = false; // Use this internal array to capture routes that require revalidation due |
| 1350 |
// to a cancelled deferred on action submission |
| 1351 |
|
| 1352 |
let cancelledDeferredRoutes = []; // Use this internal array to capture fetcher loads that were cancelled by an |
| 1353 |
// action navigation and require revalidation |
| 1354 |
|
| 1355 |
let cancelledFetcherLoads = []; // AbortControllers for any in-flight fetchers |
| 1356 |
|
| 1357 |
let fetchControllers = new Map(); // Track loads based on the order in which they started |
| 1358 |
|
| 1359 |
let incrementingLoadId = 0; // Track the outstanding pending navigation data load to be compared against |
| 1360 |
// the globally incrementing load when a fetcher load lands after a completed |
| 1361 |
// navigation |
| 1362 |
|
| 1363 |
let pendingNavigationLoadId = -1; // Fetchers that triggered data reloads as a result of their actions |
| 1364 |
|
| 1365 |
let fetchReloadIds = new Map(); // Fetchers that triggered redirect navigations from their actions |
| 1366 |
|
| 1367 |
let fetchRedirectIds = new Set(); // Most recent href/match for fetcher.load calls for fetchers |
| 1368 |
|
| 1369 |
let fetchLoadMatches = new Map(); // Store DeferredData instances for active route matches. When a |
| 1370 |
// route loader returns defer() we stick one in here. Then, when a nested |
| 1371 |
// promise resolves we update loaderData. If a new navigation starts we |
| 1372 |
// cancel active deferreds for eliminated routes. |
| 1373 |
|
| 1374 |
let activeDeferreds = new Map(); // Initialize the router, all side effects should be kicked off from here. |
| 1375 |
// Implemented as a Fluent API for ease of: |
| 1376 |
// let router = createRouter(init).initialize(); |
| 1377 |
|
| 1378 |
function initialize() { |
| 1379 |
// If history informs us of a POP navigation, start the navigation but do not update |
| 1380 |
// state. We'll update our own state once the navigation completes |
| 1381 |
unlistenHistory = init.history.listen(_ref => { |
| 1382 |
let { |
| 1383 |
action: historyAction, |
| 1384 |
location |
| 1385 |
} = _ref; |
| 1386 |
return startNavigation(historyAction, location); |
| 1387 |
}); // Kick off initial data load if needed. Use Pop to avoid modifying history |
| 1388 |
|
| 1389 |
if (!state.initialized) { |
| 1390 |
startNavigation(Action.Pop, state.location); |
| 1391 |
} |
| 1392 |
|
| 1393 |
return router; |
| 1394 |
} // Clean up a router and it's side effects |
| 1395 |
|
| 1396 |
|
| 1397 |
function dispose() { |
| 1398 |
if (unlistenHistory) { |
| 1399 |
unlistenHistory(); |
| 1400 |
} |
| 1401 |
|
| 1402 |
subscribers.clear(); |
| 1403 |
pendingNavigationController && pendingNavigationController.abort(); |
| 1404 |
state.fetchers.forEach((_, key) => deleteFetcher(key)); |
| 1405 |
} // Subscribe to state updates for the router |
| 1406 |
|
| 1407 |
|
| 1408 |
function subscribe(fn) { |
| 1409 |
subscribers.add(fn); |
| 1410 |
return () => subscribers.delete(fn); |
| 1411 |
} // Update our state and notify the calling context of the change |
| 1412 |
|
| 1413 |
|
| 1414 |
function updateState(newState) { |
| 1415 |
state = _extends({}, state, newState); |
| 1416 |
subscribers.forEach(subscriber => subscriber(state)); |
| 1417 |
} // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION |
| 1418 |
// and setting state.[historyAction/location/matches] to the new route. |
| 1419 |
// - Location is a required param |
| 1420 |
// - Navigation will always be set to IDLE_NAVIGATION |
| 1421 |
// - Can pass any other state in newState |
| 1422 |
|
| 1423 |
|
| 1424 |
function completeNavigation(location, newState) { |
| 1425 |
var _state$navigation$for; |
| 1426 |
|
| 1427 |
// Deduce if we're in a loading/actionReload state: |
| 1428 |
// - We have committed actionData in the store |
| 1429 |
// - The current navigation was a submission |
| 1430 |
// - We're past the submitting state and into the loading state |
| 1431 |
// - The location we've finished loading is different from the submission |
| 1432 |
// location, indicating we redirected from the action (avoids false |
| 1433 |
// positives for loading/submissionRedirect when actionData returned |
| 1434 |
// on a prior submission) |
| 1435 |
let isActionReload = state.actionData != null && state.navigation.formMethod != null && state.navigation.state === "loading" && ((_state$navigation$for = state.navigation.formAction) == null ? void 0 : _state$navigation$for.split("?")[0]) === location.pathname; // Always preserve any existing loaderData from re-used routes |
| 1436 |
|
| 1437 |
let newLoaderData = newState.loaderData ? { |
| 1438 |
loaderData: mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || []) |
| 1439 |
} : {}; |
| 1440 |
updateState(_extends({}, isActionReload ? {} : { |
| 1441 |
actionData: null |
| 1442 |
}, newState, newLoaderData, { |
| 1443 |
historyAction: pendingAction, |
| 1444 |
location, |
| 1445 |
initialized: true, |
| 1446 |
navigation: IDLE_NAVIGATION, |
| 1447 |
revalidation: "idle", |
| 1448 |
// Don't restore on submission navigations |
| 1449 |
restoreScrollPosition: state.navigation.formData ? false : getSavedScrollPosition(location, newState.matches || state.matches), |
| 1450 |
preventScrollReset: pendingPreventScrollReset |
| 1451 |
})); |
| 1452 |
|
| 1453 |
if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) { |
| 1454 |
init.history.push(location, location.state); |
| 1455 |
} else if (pendingAction === Action.Replace) { |
| 1456 |
init.history.replace(location, location.state); |
| 1457 |
} // Reset stateful navigation vars |
| 1458 |
|
| 1459 |
|
| 1460 |
pendingAction = Action.Pop; |
| 1461 |
pendingPreventScrollReset = false; |
| 1462 |
isUninterruptedRevalidation = false; |
| 1463 |
isRevalidationRequired = false; |
| 1464 |
cancelledDeferredRoutes = []; |
| 1465 |
cancelledFetcherLoads = []; |
| 1466 |
} // Trigger a navigation event, which can either be a numerical POP or a PUSH |
| 1467 |
// replace with an optional submission |
| 1468 |
|
| 1469 |
|
| 1470 |
async function navigate(to, opts) { |
| 1471 |
if (typeof to === "number") { |
| 1472 |
init.history.go(to); |
| 1473 |
return; |
| 1474 |
} |
| 1475 |
|
| 1476 |
let { |
| 1477 |
path, |
| 1478 |
submission, |
| 1479 |
error |
| 1480 |
} = normalizeNavigateOptions(to, opts); |
| 1481 |
let location = createLocation(state.location, path, opts && opts.state); // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded |
| 1482 |
// URL from window.location, so we need to encode it here so the behavior |
| 1483 |
// remains the same as POP and non-data-router usages. new URL() does all |
| 1484 |
// the same encoding we'd get from a history.pushState/window.location read |
| 1485 |
// without having to touch history |
| 1486 |
|
| 1487 |
location = init.history.encodeLocation(location); |
| 1488 |
let historyAction = (opts && opts.replace) === true || submission != null ? Action.Replace : Action.Push; |
| 1489 |
let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : undefined; |
| 1490 |
return await startNavigation(historyAction, location, { |
| 1491 |
submission, |
| 1492 |
// Send through the formData serialization error if we have one so we can |
| 1493 |
// render at the right error boundary after we match routes |
| 1494 |
pendingError: error, |
| 1495 |
preventScrollReset, |
| 1496 |
replace: opts && opts.replace |
| 1497 |
}); |
| 1498 |
} // Revalidate all current loaders. If a navigation is in progress or if this |
| 1499 |
// is interrupted by a navigation, allow this to "succeed" by calling all |
| 1500 |
// loaders during the next loader round |
| 1501 |
|
| 1502 |
|
| 1503 |
function revalidate() { |
| 1504 |
interruptActiveLoads(); |
| 1505 |
updateState({ |
| 1506 |
revalidation: "loading" |
| 1507 |
}); // If we're currently submitting an action, we don't need to start a new |
| 1508 |
// navigation, we'll just let the follow up loader execution call all loaders |
| 1509 |
|
| 1510 |
if (state.navigation.state === "submitting") { |
| 1511 |
return; |
| 1512 |
} // If we're currently in an idle state, start a new navigation for the current |
| 1513 |
// action/location and mark it as uninterrupted, which will skip the history |
| 1514 |
// update in completeNavigation |
| 1515 |
|
| 1516 |
|
| 1517 |
if (state.navigation.state === "idle") { |
| 1518 |
startNavigation(state.historyAction, state.location, { |
| 1519 |
startUninterruptedRevalidation: true |
| 1520 |
}); |
| 1521 |
return; |
| 1522 |
} // Otherwise, if we're currently in a loading state, just start a new |
| 1523 |
// navigation to the navigation.location but do not trigger an uninterrupted |
| 1524 |
// revalidation so that history correctly updates once the navigation completes |
| 1525 |
|
| 1526 |
|
| 1527 |
startNavigation(pendingAction || state.historyAction, state.navigation.location, { |
| 1528 |
overrideNavigation: state.navigation |
| 1529 |
}); |
| 1530 |
} // Start a navigation to the given action/location. Can optionally provide a |
| 1531 |
// overrideNavigation which will override the normalLoad in the case of a redirect |
| 1532 |
// navigation |
| 1533 |
|
| 1534 |
|
| 1535 |
async function startNavigation(historyAction, location, opts) { |
| 1536 |
// Abort any in-progress navigations and start a new one. Unset any ongoing |
| 1537 |
// uninterrupted revalidations unless told otherwise, since we want this |
| 1538 |
// new navigation to update history normally |
| 1539 |
pendingNavigationController && pendingNavigationController.abort(); |
| 1540 |
pendingNavigationController = null; |
| 1541 |
pendingAction = historyAction; |
| 1542 |
isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; // Save the current scroll position every time we start a new navigation, |
| 1543 |
// and track whether we should reset scroll on completion |
| 1544 |
|
| 1545 |
saveScrollPosition(state.location, state.matches); |
| 1546 |
pendingPreventScrollReset = (opts && opts.preventScrollReset) === true; |
| 1547 |
let loadingNavigation = opts && opts.overrideNavigation; |
| 1548 |
let matches = matchRoutes(dataRoutes, location, init.basename); // Short circuit with a 404 on the root error boundary if we match nothing |
| 1549 |
|
| 1550 |
if (!matches) { |
| 1551 |
let { |
| 1552 |
matches: notFoundMatches, |
| 1553 |
route, |
| 1554 |
error |
| 1555 |
} = getNotFoundMatches(dataRoutes); // Cancel all pending deferred on 404s since we don't keep any routes |
| 1556 |
|
| 1557 |
cancelActiveDeferreds(); |
| 1558 |
completeNavigation(location, { |
| 1559 |
matches: notFoundMatches, |
| 1560 |
loaderData: {}, |
| 1561 |
errors: { |
| 1562 |
[route.id]: error |
| 1563 |
} |
| 1564 |
}); |
| 1565 |
return; |
| 1566 |
} // Short circuit if it's only a hash change |
| 1567 |
|
| 1568 |
|
| 1569 |
if (isHashChangeOnly(state.location, location)) { |
| 1570 |
completeNavigation(location, { |
| 1571 |
matches |
| 1572 |
}); |
| 1573 |
return; |
| 1574 |
} // Create a controller/Request for this navigation |
| 1575 |
|
| 1576 |
|
| 1577 |
pendingNavigationController = new AbortController(); |
| 1578 |
let request = createRequest(location, pendingNavigationController.signal, opts && opts.submission); |
| 1579 |
let pendingActionData; |
| 1580 |
let pendingError; |
| 1581 |
|
| 1582 |
if (opts && opts.pendingError) { |
| 1583 |
// If we have a pendingError, it means the user attempted a GET submission |
| 1584 |
// with binary FormData so assign here and skip to handleLoaders. That |
| 1585 |
// way we handle calling loaders above the boundary etc. It's not really |
| 1586 |
// different from an actionError in that sense. |
| 1587 |
pendingError = { |
| 1588 |
[findNearestBoundary(matches).route.id]: opts.pendingError |
| 1589 |
}; |
| 1590 |
} else if (opts && opts.submission) { |
| 1591 |
// Call action if we received an action submission |
| 1592 |
let actionOutput = await handleAction(request, location, opts.submission, matches, { |
| 1593 |
replace: opts.replace |
| 1594 |
}); |
| 1595 |
|
| 1596 |
if (actionOutput.shortCircuited) { |
| 1597 |
return; |
| 1598 |
} |
| 1599 |
|
| 1600 |
pendingActionData = actionOutput.pendingActionData; |
| 1601 |
pendingError = actionOutput.pendingActionError; |
| 1602 |
|
| 1603 |
let navigation = _extends({ |
| 1604 |
state: "loading", |
| 1605 |
location |
| 1606 |
}, opts.submission); |
| 1607 |
|
| 1608 |
loadingNavigation = navigation; |
| 1609 |
} // Call loaders |
| 1610 |
|
| 1611 |
|
| 1612 |
let { |
| 1613 |
shortCircuited, |
| 1614 |
loaderData, |
| 1615 |
errors |
| 1616 |
} = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.replace, pendingActionData, pendingError); |
| 1617 |
|
| 1618 |
if (shortCircuited) { |
| 1619 |
return; |
| 1620 |
} // Clean up now that the action/loaders have completed. Don't clean up if |
| 1621 |
// we short circuited because pendingNavigationController will have already |
| 1622 |
// been assigned to a new controller for the next navigation |
| 1623 |
|
| 1624 |
|
| 1625 |
pendingNavigationController = null; |
| 1626 |
completeNavigation(location, { |
| 1627 |
matches, |
| 1628 |
loaderData, |
| 1629 |
errors |
| 1630 |
}); |
| 1631 |
} // Call the action matched by the leaf route for this navigation and handle |
| 1632 |
// redirects/errors |
| 1633 |
|
| 1634 |
|
| 1635 |
async function handleAction(request, location, submission, matches, opts) { |
| 1636 |
interruptActiveLoads(); // Put us in a submitting state |
| 1637 |
|
| 1638 |
let navigation = _extends({ |
| 1639 |
state: "submitting", |
| 1640 |
location |
| 1641 |
}, submission); |
| 1642 |
|
| 1643 |
updateState({ |
| 1644 |
navigation |
| 1645 |
}); // Call our action and get the result |
| 1646 |
|
| 1647 |
let result; |
| 1648 |
let actionMatch = getTargetMatch(matches, location); |
| 1649 |
|
| 1650 |
if (!actionMatch.route.action) { |
| 1651 |
result = getMethodNotAllowedResult(location); |
| 1652 |
} else { |
| 1653 |
result = await callLoaderOrAction("action", request, actionMatch, matches, router.basename); |
| 1654 |
|
| 1655 |
if (request.signal.aborted) { |
| 1656 |
return { |
| 1657 |
shortCircuited: true |
| 1658 |
}; |
| 1659 |
} |
| 1660 |
} |
| 1661 |
|
| 1662 |
if (isRedirectResult(result)) { |
| 1663 |
let redirectNavigation = _extends({ |
| 1664 |
state: "loading", |
| 1665 |
location: createLocation(state.location, result.location) |
| 1666 |
}, submission); |
| 1667 |
|
| 1668 |
await startRedirectNavigation(result, redirectNavigation, opts && opts.replace); |
| 1669 |
return { |
| 1670 |
shortCircuited: true |
| 1671 |
}; |
| 1672 |
} |
| 1673 |
|
| 1674 |
if (isErrorResult(result)) { |
| 1675 |
// Store off the pending error - we use it to determine which loaders |
| 1676 |
// to call and will commit it when we complete the navigation |
| 1677 |
let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); // By default, all submissions are REPLACE navigations, but if the |
| 1678 |
// action threw an error that'll be rendered in an errorElement, we fall |
| 1679 |
// back to PUSH so that the user can use the back button to get back to |
| 1680 |
// the pre-submission form location to try again |
| 1681 |
|
| 1682 |
if ((opts && opts.replace) !== true) { |
| 1683 |
pendingAction = Action.Push; |
| 1684 |
} |
| 1685 |
|
| 1686 |
return { |
| 1687 |
pendingActionError: { |
| 1688 |
[boundaryMatch.route.id]: result.error |
| 1689 |
} |
| 1690 |
}; |
| 1691 |
} |
| 1692 |
|
| 1693 |
if (isDeferredResult(result)) { |
| 1694 |
throw new Error("defer() is not supported in actions"); |
| 1695 |
} |
| 1696 |
|
| 1697 |
return { |
| 1698 |
pendingActionData: { |
| 1699 |
[actionMatch.route.id]: result.data |
| 1700 |
} |
| 1701 |
}; |
| 1702 |
} // Call all applicable loaders for the given matches, handling redirects, |
| 1703 |
// errors, etc. |
| 1704 |
|
| 1705 |
|
| 1706 |
async function handleLoaders(request, location, matches, overrideNavigation, submission, replace, pendingActionData, pendingError) { |
| 1707 |
// Figure out the right navigation we want to use for data loading |
| 1708 |
let loadingNavigation = overrideNavigation; |
| 1709 |
|
| 1710 |
if (!loadingNavigation) { |
| 1711 |
let navigation = { |
| 1712 |
state: "loading", |
| 1713 |
location, |
| 1714 |
formMethod: undefined, |
| 1715 |
formAction: undefined, |
| 1716 |
formEncType: undefined, |
| 1717 |
formData: undefined |
| 1718 |
}; |
| 1719 |
loadingNavigation = navigation; |
| 1720 |
} |
| 1721 |
|
| 1722 |
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, pendingActionData, pendingError, fetchLoadMatches); // Cancel pending deferreds for no-longer-matched routes or routes we're |
| 1723 |
// about to reload. Note that if this is an action reload we would have |
| 1724 |
// already cancelled all pending deferreds so this would be a no-op |
| 1725 |
|
| 1726 |
cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId)); // Short circuit if we have no loaders to run |
| 1727 |
|
| 1728 |
if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) { |
| 1729 |
completeNavigation(location, { |
| 1730 |
matches, |
| 1731 |
loaderData: mergeLoaderData(state.loaderData, {}, matches), |
| 1732 |
// Commit pending error if we're short circuiting |
| 1733 |
errors: pendingError || null, |
| 1734 |
actionData: pendingActionData || null |
| 1735 |
}); |
| 1736 |
return { |
| 1737 |
shortCircuited: true |
| 1738 |
}; |
| 1739 |
} // If this is an uninterrupted revalidation, we remain in our current idle |
| 1740 |
// state. If not, we need to switch to our loading state and load data, |
| 1741 |
// preserving any new action data or existing action data (in the case of |
| 1742 |
// a revalidation interrupting an actionReload) |
| 1743 |
|
| 1744 |
|
| 1745 |
if (!isUninterruptedRevalidation) { |
| 1746 |
revalidatingFetchers.forEach(_ref2 => { |
| 1747 |
let [key] = _ref2; |
| 1748 |
let fetcher = state.fetchers.get(key); |
| 1749 |
let revalidatingFetcher = { |
| 1750 |
state: "loading", |
| 1751 |
data: fetcher && fetcher.data, |
| 1752 |
formMethod: undefined, |
| 1753 |
formAction: undefined, |
| 1754 |
formEncType: undefined, |
| 1755 |
formData: undefined |
| 1756 |
}; |
| 1757 |
state.fetchers.set(key, revalidatingFetcher); |
| 1758 |
}); |
| 1759 |
updateState(_extends({ |
| 1760 |
navigation: loadingNavigation, |
| 1761 |
actionData: pendingActionData || state.actionData || null |
| 1762 |
}, revalidatingFetchers.length > 0 ? { |
| 1763 |
fetchers: new Map(state.fetchers) |
| 1764 |
} : {})); |
| 1765 |
} |
| 1766 |
|
| 1767 |
pendingNavigationLoadId = ++incrementingLoadId; |
| 1768 |
revalidatingFetchers.forEach(_ref3 => { |
| 1769 |
let [key] = _ref3; |
| 1770 |
return fetchControllers.set(key, pendingNavigationController); |
| 1771 |
}); |
| 1772 |
let { |
| 1773 |
results, |
| 1774 |
loaderResults, |
| 1775 |
fetcherResults |
| 1776 |
} = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, request); |
| 1777 |
|
| 1778 |
if (request.signal.aborted) { |
| 1779 |
return { |
| 1780 |
shortCircuited: true |
| 1781 |
}; |
| 1782 |
} // Clean up _after_ loaders have completed. Don't clean up if we short |
| 1783 |
// circuited because fetchControllers would have been aborted and |
| 1784 |
// reassigned to new controllers for the next navigation |
| 1785 |
|
| 1786 |
|
| 1787 |
revalidatingFetchers.forEach(_ref4 => { |
| 1788 |
let [key] = _ref4; |
| 1789 |
return fetchControllers.delete(key); |
| 1790 |
}); // If any loaders returned a redirect Response, start a new REPLACE navigation |
| 1791 |
|
| 1792 |
let redirect = findRedirect(results); |
| 1793 |
|
| 1794 |
if (redirect) { |
| 1795 |
let redirectNavigation = getLoaderRedirect(state, redirect); |
| 1796 |
await startRedirectNavigation(redirect, redirectNavigation, replace); |
| 1797 |
return { |
| 1798 |
shortCircuited: true |
| 1799 |
}; |
| 1800 |
} // Process and commit output from loaders |
| 1801 |
|
| 1802 |
|
| 1803 |
let { |
| 1804 |
loaderData, |
| 1805 |
errors |
| 1806 |
} = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds); // Wire up subscribers to update loaderData as promises settle |
| 1807 |
|
| 1808 |
activeDeferreds.forEach((deferredData, routeId) => { |
| 1809 |
deferredData.subscribe(aborted => { |
| 1810 |
// Note: No need to updateState here since the TrackedPromise on |
| 1811 |
// loaderData is stable across resolve/reject |
| 1812 |
// Remove this instance if we were aborted or if promises have settled |
| 1813 |
if (aborted || deferredData.done) { |
| 1814 |
activeDeferreds.delete(routeId); |
| 1815 |
} |
| 1816 |
}); |
| 1817 |
}); |
| 1818 |
markFetchRedirectsDone(); |
| 1819 |
let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId); |
| 1820 |
return _extends({ |
| 1821 |
loaderData, |
| 1822 |
errors |
| 1823 |
}, didAbortFetchLoads || revalidatingFetchers.length > 0 ? { |
| 1824 |
fetchers: new Map(state.fetchers) |
| 1825 |
} : {}); |
| 1826 |
} |
| 1827 |
|
| 1828 |
function getFetcher(key) { |
| 1829 |
return state.fetchers.get(key) || IDLE_FETCHER; |
| 1830 |
} // Trigger a fetcher load/submit for the given fetcher key |
| 1831 |
|
| 1832 |
|
| 1833 |
function fetch(key, routeId, href, opts) { |
| 1834 |
if (isServer) { |
| 1835 |
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."); |
| 1836 |
} |
| 1837 |
|
| 1838 |
if (fetchControllers.has(key)) abortFetcher(key); |
| 1839 |
let matches = matchRoutes(dataRoutes, href, init.basename); |
| 1840 |
|
| 1841 |
if (!matches) { |
| 1842 |
setFetcherError(key, routeId, new ErrorResponse(404, "Not Found", null)); |
| 1843 |
return; |
| 1844 |
} |
| 1845 |
|
| 1846 |
let { |
| 1847 |
path, |
| 1848 |
submission |
| 1849 |
} = normalizeNavigateOptions(href, opts, true); |
| 1850 |
let match = getTargetMatch(matches, path); |
| 1851 |
|
| 1852 |
if (submission) { |
| 1853 |
handleFetcherAction(key, routeId, path, match, matches, submission); |
| 1854 |
return; |
| 1855 |
} // Store off the match so we can call it's shouldRevalidate on subsequent |
| 1856 |
// revalidations |
| 1857 |
|
| 1858 |
|
| 1859 |
fetchLoadMatches.set(key, [path, match, matches]); |
| 1860 |
handleFetcherLoader(key, routeId, path, match, matches); |
| 1861 |
} // Call the action for the matched fetcher.submit(), and then handle redirects, |
| 1862 |
// errors, and revalidation |
| 1863 |
|
| 1864 |
|
| 1865 |
async function handleFetcherAction(key, routeId, path, match, requestMatches, submission) { |
| 1866 |
interruptActiveLoads(); |
| 1867 |
fetchLoadMatches.delete(key); |
| 1868 |
|
| 1869 |
if (!match.route.action) { |
| 1870 |
let { |
| 1871 |
error |
| 1872 |
} = getMethodNotAllowedResult(path); |
| 1873 |
setFetcherError(key, routeId, error); |
| 1874 |
return; |
| 1875 |
} // Put this fetcher into it's submitting state |
| 1876 |
|
| 1877 |
|
| 1878 |
let existingFetcher = state.fetchers.get(key); |
| 1879 |
|
| 1880 |
let fetcher = _extends({ |
| 1881 |
state: "submitting" |
| 1882 |
}, submission, { |
| 1883 |
data: existingFetcher && existingFetcher.data |
| 1884 |
}); |
| 1885 |
|
| 1886 |
state.fetchers.set(key, fetcher); |
| 1887 |
updateState({ |
| 1888 |
fetchers: new Map(state.fetchers) |
| 1889 |
}); // Call the action for the fetcher |
| 1890 |
|
| 1891 |
let abortController = new AbortController(); |
| 1892 |
let fetchRequest = createRequest(path, abortController.signal, submission); |
| 1893 |
fetchControllers.set(key, abortController); |
| 1894 |
let actionResult = await callLoaderOrAction("action", fetchRequest, match, requestMatches, router.basename); |
| 1895 |
|
| 1896 |
if (fetchRequest.signal.aborted) { |
| 1897 |
// We can delete this so long as we weren't aborted by ou our own fetcher |
| 1898 |
// re-submit which would have put _new_ controller is in fetchControllers |
| 1899 |
if (fetchControllers.get(key) === abortController) { |
| 1900 |
fetchControllers.delete(key); |
| 1901 |
} |
| 1902 |
|
| 1903 |
return; |
| 1904 |
} |
| 1905 |
|
| 1906 |
if (isRedirectResult(actionResult)) { |
| 1907 |
fetchControllers.delete(key); |
| 1908 |
fetchRedirectIds.add(key); |
| 1909 |
|
| 1910 |
let loadingFetcher = _extends({ |
| 1911 |
state: "loading" |
| 1912 |
}, submission, { |
| 1913 |
data: undefined |
| 1914 |
}); |
| 1915 |
|
| 1916 |
state.fetchers.set(key, loadingFetcher); |
| 1917 |
updateState({ |
| 1918 |
fetchers: new Map(state.fetchers) |
| 1919 |
}); |
| 1920 |
|
| 1921 |
let redirectNavigation = _extends({ |
| 1922 |
state: "loading", |
| 1923 |
location: createLocation(state.location, actionResult.location) |
| 1924 |
}, submission); |
| 1925 |
|
| 1926 |
await startRedirectNavigation(actionResult, redirectNavigation); |
| 1927 |
return; |
| 1928 |
} // Process any non-redirect errors thrown |
| 1929 |
|
| 1930 |
|
| 1931 |
if (isErrorResult(actionResult)) { |
| 1932 |
setFetcherError(key, routeId, actionResult.error); |
| 1933 |
return; |
| 1934 |
} |
| 1935 |
|
| 1936 |
if (isDeferredResult(actionResult)) { |
| 1937 |
invariant(false, "defer() is not supported in actions"); |
| 1938 |
} // Start the data load for current matches, or the next location if we're |
| 1939 |
// in the middle of a navigation |
| 1940 |
|
| 1941 |
|
| 1942 |
let nextLocation = state.navigation.location || state.location; |
| 1943 |
let revalidationRequest = createRequest(nextLocation, abortController.signal); |
| 1944 |
let matches = state.navigation.state !== "idle" ? matchRoutes(dataRoutes, state.navigation.location, init.basename) : state.matches; |
| 1945 |
invariant(matches, "Didn't find any matches after fetcher action"); |
| 1946 |
let loadId = ++incrementingLoadId; |
| 1947 |
fetchReloadIds.set(key, loadId); |
| 1948 |
|
| 1949 |
let loadFetcher = _extends({ |
| 1950 |
state: "loading", |
| 1951 |
data: actionResult.data |
| 1952 |
}, submission); |
| 1953 |
|
| 1954 |
state.fetchers.set(key, loadFetcher); |
| 1955 |
let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(state, matches, submission, nextLocation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, { |
| 1956 |
[match.route.id]: actionResult.data |
| 1957 |
}, undefined, // No need to send through errors since we short circuit above |
| 1958 |
fetchLoadMatches); // Put all revalidating fetchers into the loading state, except for the |
| 1959 |
// current fetcher which we want to keep in it's current loading state which |
| 1960 |
// contains it's action submission info + action data |
| 1961 |
|
| 1962 |
revalidatingFetchers.filter(_ref5 => { |
| 1963 |
let [staleKey] = _ref5; |
| 1964 |
return staleKey !== key; |
| 1965 |
}).forEach(_ref6 => { |
| 1966 |
let [staleKey] = _ref6; |
| 1967 |
let existingFetcher = state.fetchers.get(staleKey); |
| 1968 |
let revalidatingFetcher = { |
| 1969 |
state: "loading", |
| 1970 |
data: existingFetcher && existingFetcher.data, |
| 1971 |
formMethod: undefined, |
| 1972 |
formAction: undefined, |
| 1973 |
formEncType: undefined, |
| 1974 |
formData: undefined |
| 1975 |
}; |
| 1976 |
state.fetchers.set(staleKey, revalidatingFetcher); |
| 1977 |
fetchControllers.set(staleKey, abortController); |
| 1978 |
}); |
| 1979 |
updateState({ |
| 1980 |
fetchers: new Map(state.fetchers) |
| 1981 |
}); |
| 1982 |
let { |
| 1983 |
results, |
| 1984 |
loaderResults, |
| 1985 |
fetcherResults |
| 1986 |
} = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, revalidationRequest); |
| 1987 |
|
| 1988 |
if (abortController.signal.aborted) { |
| 1989 |
return; |
| 1990 |
} |
| 1991 |
|
| 1992 |
fetchReloadIds.delete(key); |
| 1993 |
fetchControllers.delete(key); |
| 1994 |
revalidatingFetchers.forEach(_ref7 => { |
| 1995 |
let [staleKey] = _ref7; |
| 1996 |
return fetchControllers.delete(staleKey); |
| 1997 |
}); |
| 1998 |
let redirect = findRedirect(results); |
| 1999 |
|
| 2000 |
if (redirect) { |
| 2001 |
let redirectNavigation = getLoaderRedirect(state, redirect); |
| 2002 |
await startRedirectNavigation(redirect, redirectNavigation); |
| 2003 |
return; |
| 2004 |
} // Process and commit output from loaders |
| 2005 |
|
| 2006 |
|
| 2007 |
let { |
| 2008 |
loaderData, |
| 2009 |
errors |
| 2010 |
} = processLoaderData(state, state.matches, matchesToLoad, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds); |
| 2011 |
let doneFetcher = { |
| 2012 |
state: "idle", |
| 2013 |
data: actionResult.data, |
| 2014 |
formMethod: undefined, |
| 2015 |
formAction: undefined, |
| 2016 |
formEncType: undefined, |
| 2017 |
formData: undefined |
| 2018 |
}; |
| 2019 |
state.fetchers.set(key, doneFetcher); |
| 2020 |
let didAbortFetchLoads = abortStaleFetchLoads(loadId); // If we are currently in a navigation loading state and this fetcher is |
| 2021 |
// more recent than the navigation, we want the newer data so abort the |
| 2022 |
// navigation and complete it with the fetcher data |
| 2023 |
|
| 2024 |
if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) { |
| 2025 |
invariant(pendingAction, "Expected pending action"); |
| 2026 |
pendingNavigationController && pendingNavigationController.abort(); |
| 2027 |
completeNavigation(state.navigation.location, { |
| 2028 |
matches, |
| 2029 |
loaderData, |
| 2030 |
errors, |
| 2031 |
fetchers: new Map(state.fetchers) |
| 2032 |
}); |
| 2033 |
} else { |
| 2034 |
// otherwise just update with the fetcher data, preserving any existing |
| 2035 |
// loaderData for loaders that did not need to reload. We have to |
| 2036 |
// manually merge here since we aren't going through completeNavigation |
| 2037 |
updateState(_extends({ |
| 2038 |
errors, |
| 2039 |
loaderData: mergeLoaderData(state.loaderData, loaderData, matches) |
| 2040 |
}, didAbortFetchLoads ? { |
| 2041 |
fetchers: new Map(state.fetchers) |
| 2042 |
} : {})); |
| 2043 |
isRevalidationRequired = false; |
| 2044 |
} |
| 2045 |
} // Call the matched loader for fetcher.load(), handling redirects, errors, etc. |
| 2046 |
|
| 2047 |
|
| 2048 |
async function handleFetcherLoader(key, routeId, path, match, matches) { |
| 2049 |
let existingFetcher = state.fetchers.get(key); // Put this fetcher into it's loading state |
| 2050 |
|
| 2051 |
let loadingFetcher = { |
| 2052 |
state: "loading", |
| 2053 |
formMethod: undefined, |
| 2054 |
formAction: undefined, |
| 2055 |
formEncType: undefined, |
| 2056 |
formData: undefined, |
| 2057 |
data: existingFetcher && existingFetcher.data |
| 2058 |
}; |
| 2059 |
state.fetchers.set(key, loadingFetcher); |
| 2060 |
updateState({ |
| 2061 |
fetchers: new Map(state.fetchers) |
| 2062 |
}); // Call the loader for this fetcher route match |
| 2063 |
|
| 2064 |
let abortController = new AbortController(); |
| 2065 |
let fetchRequest = createRequest(path, abortController.signal); |
| 2066 |
fetchControllers.set(key, abortController); |
| 2067 |
let result = await callLoaderOrAction("loader", fetchRequest, match, matches, router.basename); // Deferred isn't supported or fetcher loads, await everything and treat it |
| 2068 |
// as a normal load. resolveDeferredData will return undefined if this |
| 2069 |
// fetcher gets aborted, so we just leave result untouched and short circuit |
| 2070 |
// below if that happens |
| 2071 |
|
| 2072 |
if (isDeferredResult(result)) { |
| 2073 |
result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result; |
| 2074 |
} // We can delete this so long as we weren't aborted by ou our own fetcher |
| 2075 |
// re-load which would have put _new_ controller is in fetchControllers |
| 2076 |
|
| 2077 |
|
| 2078 |
if (fetchControllers.get(key) === abortController) { |
| 2079 |
fetchControllers.delete(key); |
| 2080 |
} |
| 2081 |
|
| 2082 |
if (fetchRequest.signal.aborted) { |
| 2083 |
return; |
| 2084 |
} // If the loader threw a redirect Response, start a new REPLACE navigation |
| 2085 |
|
| 2086 |
|
| 2087 |
if (isRedirectResult(result)) { |
| 2088 |
let redirectNavigation = getLoaderRedirect(state, result); |
| 2089 |
await startRedirectNavigation(result, redirectNavigation); |
| 2090 |
return; |
| 2091 |
} // Process any non-redirect errors thrown |
| 2092 |
|
| 2093 |
|
| 2094 |
if (isErrorResult(result)) { |
| 2095 |
let boundaryMatch = findNearestBoundary(state.matches, routeId); |
| 2096 |
state.fetchers.delete(key); // TODO: In remix, this would reset to IDLE_NAVIGATION if it was a catch - |
| 2097 |
// do we need to behave any differently with our non-redirect errors? |
| 2098 |
// What if it was a non-redirect Response? |
| 2099 |
|
| 2100 |
updateState({ |
| 2101 |
fetchers: new Map(state.fetchers), |
| 2102 |
errors: { |
| 2103 |
[boundaryMatch.route.id]: result.error |
| 2104 |
} |
| 2105 |
}); |
| 2106 |
return; |
| 2107 |
} |
| 2108 |
|
| 2109 |
invariant(!isDeferredResult(result), "Unhandled fetcher deferred data"); // Put the fetcher back into an idle state |
| 2110 |
|
| 2111 |
let doneFetcher = { |
| 2112 |
state: "idle", |
| 2113 |
data: result.data, |
| 2114 |
formMethod: undefined, |
| 2115 |
formAction: undefined, |
| 2116 |
formEncType: undefined, |
| 2117 |
formData: undefined |
| 2118 |
}; |
| 2119 |
state.fetchers.set(key, doneFetcher); |
| 2120 |
updateState({ |
| 2121 |
fetchers: new Map(state.fetchers) |
| 2122 |
}); |
| 2123 |
} |
| 2124 |
/** |
| 2125 |
* Utility function to handle redirects returned from an action or loader. |
| 2126 |
* Normally, a redirect "replaces" the navigation that triggered it. So, for |
| 2127 |
* example: |
| 2128 |
* |
| 2129 |
* - user is on /a |
| 2130 |
* - user clicks a link to /b |
| 2131 |
* - loader for /b redirects to /c |
| 2132 |
* |
| 2133 |
* In a non-JS app the browser would track the in-flight navigation to /b and |
| 2134 |
* then replace it with /c when it encountered the redirect response. In |
| 2135 |
* the end it would only ever update the URL bar with /c. |
| 2136 |
* |
| 2137 |
* In client-side routing using pushState/replaceState, we aim to emulate |
| 2138 |
* this behavior and we also do not update history until the end of the |
| 2139 |
* navigation (including processed redirects). This means that we never |
| 2140 |
* actually touch history until we've processed redirects, so we just use |
| 2141 |
* the history action from the original navigation (PUSH or REPLACE). |
| 2142 |
*/ |
| 2143 |
|
| 2144 |
|
| 2145 |
async function startRedirectNavigation(redirect, navigation, replace) { |
| 2146 |
if (redirect.revalidate) { |
| 2147 |
isRevalidationRequired = true; |
| 2148 |
} |
| 2149 |
|
| 2150 |
invariant(navigation.location, "Expected a location on the redirect navigation"); // There's no need to abort on redirects, since we don't detect the |
| 2151 |
// redirect until the action/loaders have settled |
| 2152 |
|
| 2153 |
pendingNavigationController = null; |
| 2154 |
let redirectHistoryAction = replace === true ? Action.Replace : Action.Push; |
| 2155 |
await startNavigation(redirectHistoryAction, navigation.location, { |
| 2156 |
overrideNavigation: navigation |
| 2157 |
}); |
| 2158 |
} |
| 2159 |
|
| 2160 |
async function callLoadersAndMaybeResolveData(currentMatches, matches, matchesToLoad, fetchersToLoad, request) { |
| 2161 |
// Call all navigation loaders and revalidating fetcher loaders in parallel, |
| 2162 |
// then slice off the results into separate arrays so we can handle them |
| 2163 |
// accordingly |
| 2164 |
let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, router.basename)), ...fetchersToLoad.map(_ref8 => { |
| 2165 |
let [, href, match, fetchMatches] = _ref8; |
| 2166 |
return callLoaderOrAction("loader", createRequest(href, request.signal), match, fetchMatches, router.basename); |
| 2167 |
})]); |
| 2168 |
let loaderResults = results.slice(0, matchesToLoad.length); |
| 2169 |
let fetcherResults = results.slice(matchesToLoad.length); |
| 2170 |
await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, request.signal, false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map(_ref9 => { |
| 2171 |
let [,, match] = _ref9; |
| 2172 |
return match; |
| 2173 |
}), fetcherResults, request.signal, true)]); |
| 2174 |
return { |
| 2175 |
results, |
| 2176 |
loaderResults, |
| 2177 |
fetcherResults |
| 2178 |
}; |
| 2179 |
} |
| 2180 |
|
| 2181 |
function interruptActiveLoads() { |
| 2182 |
// Every interruption triggers a revalidation |
| 2183 |
isRevalidationRequired = true; // Cancel pending route-level deferreds and mark cancelled routes for |
| 2184 |
// revalidation |
| 2185 |
|
| 2186 |
cancelledDeferredRoutes.push(...cancelActiveDeferreds()); // Abort in-flight fetcher loads |
| 2187 |
|
| 2188 |
fetchLoadMatches.forEach((_, key) => { |
| 2189 |
if (fetchControllers.has(key)) { |
| 2190 |
cancelledFetcherLoads.push(key); |
| 2191 |
abortFetcher(key); |
| 2192 |
} |
| 2193 |
}); |
| 2194 |
} |
| 2195 |
|
| 2196 |
function setFetcherError(key, routeId, error) { |
| 2197 |
let boundaryMatch = findNearestBoundary(state.matches, routeId); |
| 2198 |
deleteFetcher(key); |
| 2199 |
updateState({ |
| 2200 |
errors: { |
| 2201 |
[boundaryMatch.route.id]: error |
| 2202 |
}, |
| 2203 |
fetchers: new Map(state.fetchers) |
| 2204 |
}); |
| 2205 |
} |
| 2206 |
|
| 2207 |
function deleteFetcher(key) { |
| 2208 |
if (fetchControllers.has(key)) abortFetcher(key); |
| 2209 |
fetchLoadMatches.delete(key); |
| 2210 |
fetchReloadIds.delete(key); |
| 2211 |
fetchRedirectIds.delete(key); |
| 2212 |
state.fetchers.delete(key); |
| 2213 |
} |
| 2214 |
|
| 2215 |
function abortFetcher(key) { |
| 2216 |
let controller = fetchControllers.get(key); |
| 2217 |
invariant(controller, "Expected fetch controller: " + key); |
| 2218 |
controller.abort(); |
| 2219 |
fetchControllers.delete(key); |
| 2220 |
} |
| 2221 |
|
| 2222 |
function markFetchersDone(keys) { |
| 2223 |
for (let key of keys) { |
| 2224 |
let fetcher = getFetcher(key); |
| 2225 |
let doneFetcher = { |
| 2226 |
state: "idle", |
| 2227 |
data: fetcher.data, |
| 2228 |
formMethod: undefined, |
| 2229 |
formAction: undefined, |
| 2230 |
formEncType: undefined, |
| 2231 |
formData: undefined |
| 2232 |
}; |
| 2233 |
state.fetchers.set(key, doneFetcher); |
| 2234 |
} |
| 2235 |
} |
| 2236 |
|
| 2237 |
function markFetchRedirectsDone() { |
| 2238 |
let doneKeys = []; |
| 2239 |
|
| 2240 |
for (let key of fetchRedirectIds) { |
| 2241 |
let fetcher = state.fetchers.get(key); |
| 2242 |
invariant(fetcher, "Expected fetcher: " + key); |
| 2243 |
|
| 2244 |
if (fetcher.state === "loading") { |
| 2245 |
fetchRedirectIds.delete(key); |
| 2246 |
doneKeys.push(key); |
| 2247 |
} |
| 2248 |
} |
| 2249 |
|
| 2250 |
markFetchersDone(doneKeys); |
| 2251 |
} |
| 2252 |
|
| 2253 |
function abortStaleFetchLoads(landedId) { |
| 2254 |
let yeetedKeys = []; |
| 2255 |
|
| 2256 |
for (let [key, id] of fetchReloadIds) { |
| 2257 |
if (id < landedId) { |
| 2258 |
let fetcher = state.fetchers.get(key); |
| 2259 |
invariant(fetcher, "Expected fetcher: " + key); |
| 2260 |
|
| 2261 |
if (fetcher.state === "loading") { |
| 2262 |
abortFetcher(key); |
| 2263 |
fetchReloadIds.delete(key); |
| 2264 |
yeetedKeys.push(key); |
| 2265 |
} |
| 2266 |
} |
| 2267 |
} |
| 2268 |
|
| 2269 |
markFetchersDone(yeetedKeys); |
| 2270 |
return yeetedKeys.length > 0; |
| 2271 |
} |
| 2272 |
|
| 2273 |
function cancelActiveDeferreds(predicate) { |
| 2274 |
let cancelledRouteIds = []; |
| 2275 |
activeDeferreds.forEach((dfd, routeId) => { |
| 2276 |
if (!predicate || predicate(routeId)) { |
| 2277 |
// Cancel the deferred - but do not remove from activeDeferreds here - |
| 2278 |
// we rely on the subscribers to do that so our tests can assert proper |
| 2279 |
// cleanup via _internalActiveDeferreds |
| 2280 |
dfd.cancel(); |
| 2281 |
cancelledRouteIds.push(routeId); |
| 2282 |
activeDeferreds.delete(routeId); |
| 2283 |
} |
| 2284 |
}); |
| 2285 |
return cancelledRouteIds; |
| 2286 |
} // Opt in to capturing and reporting scroll positions during navigations, |
| 2287 |
// used by the <ScrollRestoration> component |
| 2288 |
|
| 2289 |
|
| 2290 |
function enableScrollRestoration(positions, getPosition, getKey) { |
| 2291 |
savedScrollPositions = positions; |
| 2292 |
getScrollPosition = getPosition; |
| 2293 |
|
| 2294 |
getScrollRestorationKey = getKey || (location => location.key); // Perform initial hydration scroll restoration, since we miss the boat on |
| 2295 |
// the initial updateState() because we've not yet rendered <ScrollRestoration/> |
| 2296 |
// and therefore have no savedScrollPositions available |
| 2297 |
|
| 2298 |
|
| 2299 |
if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) { |
| 2300 |
initialScrollRestored = true; |
| 2301 |
let y = getSavedScrollPosition(state.location, state.matches); |
| 2302 |
|
| 2303 |
if (y != null) { |
| 2304 |
updateState({ |
| 2305 |
restoreScrollPosition: y |
| 2306 |
}); |
| 2307 |
} |
| 2308 |
} |
| 2309 |
|
| 2310 |
return () => { |
| 2311 |
savedScrollPositions = null; |
| 2312 |
getScrollPosition = null; |
| 2313 |
getScrollRestorationKey = null; |
| 2314 |
}; |
| 2315 |
} |
| 2316 |
|
| 2317 |
function saveScrollPosition(location, matches) { |
| 2318 |
if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) { |
| 2319 |
let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData)); |
| 2320 |
let key = getScrollRestorationKey(location, userMatches) || location.key; |
| 2321 |
savedScrollPositions[key] = getScrollPosition(); |
| 2322 |
} |
| 2323 |
} |
| 2324 |
|
| 2325 |
function getSavedScrollPosition(location, matches) { |
| 2326 |
if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) { |
| 2327 |
let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData)); |
| 2328 |
let key = getScrollRestorationKey(location, userMatches) || location.key; |
| 2329 |
let y = savedScrollPositions[key]; |
| 2330 |
|
| 2331 |
if (typeof y === "number") { |
| 2332 |
return y; |
| 2333 |
} |
| 2334 |
} |
| 2335 |
|
| 2336 |
return null; |
| 2337 |
} |
| 2338 |
|
| 2339 |
router = { |
| 2340 |
get basename() { |
| 2341 |
return init.basename; |
| 2342 |
}, |
| 2343 |
|
| 2344 |
get state() { |
| 2345 |
return state; |
| 2346 |
}, |
| 2347 |
|
| 2348 |
get routes() { |
| 2349 |
return dataRoutes; |
| 2350 |
}, |
| 2351 |
|
| 2352 |
initialize, |
| 2353 |
subscribe, |
| 2354 |
enableScrollRestoration, |
| 2355 |
navigate, |
| 2356 |
fetch, |
| 2357 |
revalidate, |
| 2358 |
// Passthrough to history-aware createHref used by useHref so we get proper |
| 2359 |
// hash-aware URLs in DOM paths |
| 2360 |
createHref: to => init.history.createHref(to), |
| 2361 |
getFetcher, |
| 2362 |
deleteFetcher, |
| 2363 |
dispose, |
| 2364 |
_internalFetchControllers: fetchControllers, |
| 2365 |
_internalActiveDeferreds: activeDeferreds |
| 2366 |
}; |
| 2367 |
return router; |
| 2368 |
} //#endregion |
| 2369 |
//////////////////////////////////////////////////////////////////////////////// |
| 2370 |
//#region createStaticHandler |
| 2371 |
//////////////////////////////////////////////////////////////////////////////// |
| 2372 |
|
| 2373 |
const validActionMethods = new Set(["POST", "PUT", "PATCH", "DELETE"]); |
| 2374 |
const validRequestMethods = new Set(["GET", "HEAD", ...validActionMethods]); |
| 2375 |
function unstable_createStaticHandler(routes) { |
| 2376 |
invariant(routes.length > 0, "You must provide a non-empty routes array to unstable_createStaticHandler"); |
| 2377 |
let dataRoutes = convertRoutesToDataRoutes(routes); |
| 2378 |
/** |
| 2379 |
* The query() method is intended for document requests, in which we want to |
| 2380 |
* call an optional action and potentially multiple loaders for all nested |
| 2381 |
* routes. It returns a StaticHandlerContext object, which is very similar |
| 2382 |
* to the router state (location, loaderData, actionData, errors, etc.) and |
| 2383 |
* also adds SSR-specific information such as the statusCode and headers |
| 2384 |
* from action/loaders Responses. |
| 2385 |
* |
| 2386 |
* It _should_ never throw and should report all errors through the |
| 2387 |
* returned context.errors object, properly associating errors to their error |
| 2388 |
* boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be |
| 2389 |
* used to emulate React error boundaries during SSr by performing a second |
| 2390 |
* pass only down to the boundaryId. |
| 2391 |
* |
| 2392 |
* The one exception where we do not return a StaticHandlerContext is when a |
| 2393 |
* redirect response is returned or thrown from any action/loader. We |
| 2394 |
* propagate that out and return the raw Response so the HTTP server can |
| 2395 |
* return it directly. |
| 2396 |
*/ |
| 2397 |
|
| 2398 |
async function query(request) { |
| 2399 |
let url = new URL(request.url); |
| 2400 |
let location = createLocation("", createPath(url), null, "default"); |
| 2401 |
let matches = matchRoutes(dataRoutes, location); |
| 2402 |
|
| 2403 |
if (!validRequestMethods.has(request.method)) { |
| 2404 |
let { |
| 2405 |
matches: methodNotAllowedMatches, |
| 2406 |
route, |
| 2407 |
error |
| 2408 |
} = getMethodNotAllowedMatches(dataRoutes); |
| 2409 |
return { |
| 2410 |
location, |
| 2411 |
matches: methodNotAllowedMatches, |
| 2412 |
loaderData: {}, |
| 2413 |
actionData: null, |
| 2414 |
errors: { |
| 2415 |
[route.id]: error |
| 2416 |
}, |
| 2417 |
statusCode: error.status, |
| 2418 |
loaderHeaders: {}, |
| 2419 |
actionHeaders: {} |
| 2420 |
}; |
| 2421 |
} else if (!matches) { |
| 2422 |
let { |
| 2423 |
matches: notFoundMatches, |
| 2424 |
route, |
| 2425 |
error |
| 2426 |
} = getNotFoundMatches(dataRoutes); |
| 2427 |
return { |
| 2428 |
location, |
| 2429 |
matches: notFoundMatches, |
| 2430 |
loaderData: {}, |
| 2431 |
actionData: null, |
| 2432 |
errors: { |
| 2433 |
[route.id]: error |
| 2434 |
}, |
| 2435 |
statusCode: error.status, |
| 2436 |
loaderHeaders: {}, |
| 2437 |
actionHeaders: {} |
| 2438 |
}; |
| 2439 |
} |
| 2440 |
|
| 2441 |
let result = await queryImpl(request, location, matches); |
| 2442 |
|
| 2443 |
if (result instanceof Response) { |
| 2444 |
return result; |
| 2445 |
} // When returning StaticHandlerContext, we patch back in the location here |
| 2446 |
// since we need it for React Context. But this helps keep our submit and |
| 2447 |
// loadRouteData operating on a Request instead of a Location |
| 2448 |
|
| 2449 |
|
| 2450 |
return _extends({ |
| 2451 |
location |
| 2452 |
}, result); |
| 2453 |
} |
| 2454 |
/** |
| 2455 |
* The queryRoute() method is intended for targeted route requests, either |
| 2456 |
* for fetch ?_data requests or resource route requests. In this case, we |
| 2457 |
* are only ever calling a single action or loader, and we are returning the |
| 2458 |
* returned value directly. In most cases, this will be a Response returned |
| 2459 |
* from the action/loader, but it may be a primitive or other value as well - |
| 2460 |
* and in such cases the calling context should handle that accordingly. |
| 2461 |
* |
| 2462 |
* We do respect the throw/return differentiation, so if an action/loader |
| 2463 |
* throws, then this method will throw the value. This is important so we |
| 2464 |
* can do proper boundary identification in Remix where a thrown Response |
| 2465 |
* must go to the Catch Boundary but a returned Response is happy-path. |
| 2466 |
* |
| 2467 |
* One thing to note is that any Router-initiated thrown Response (such as a |
| 2468 |
* 404 or 405) will have a custom X-Remix-Router-Error: "yes" header on it |
| 2469 |
* in order to differentiate from responses thrown from user actions/loaders. |
| 2470 |
*/ |
| 2471 |
|
| 2472 |
|
| 2473 |
async function queryRoute(request, routeId) { |
| 2474 |
let url = new URL(request.url); |
| 2475 |
let location = createLocation("", createPath(url), null, "default"); |
| 2476 |
let matches = matchRoutes(dataRoutes, location); |
| 2477 |
|
| 2478 |
if (!validRequestMethods.has(request.method)) { |
| 2479 |
throw createRouterErrorResponse(null, { |
| 2480 |
status: 405, |
| 2481 |
statusText: "Method Not Allowed" |
| 2482 |
}); |
| 2483 |
} else if (!matches) { |
| 2484 |
throw createRouterErrorResponse(null, { |
| 2485 |
status: 404, |
| 2486 |
statusText: "Not Found" |
| 2487 |
}); |
| 2488 |
} |
| 2489 |
|
| 2490 |
let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location); |
| 2491 |
|
| 2492 |
if (!match) { |
| 2493 |
throw createRouterErrorResponse(null, { |
| 2494 |
status: 404, |
| 2495 |
statusText: "Not Found" |
| 2496 |
}); |
| 2497 |
} |
| 2498 |
|
| 2499 |
let result = await queryImpl(request, location, matches, match); |
| 2500 |
|
| 2501 |
if (result instanceof Response) { |
| 2502 |
return result; |
| 2503 |
} |
| 2504 |
|
| 2505 |
let error = result.errors ? Object.values(result.errors)[0] : undefined; |
| 2506 |
|
| 2507 |
if (error !== undefined) { |
| 2508 |
// If we got back result.errors, that means the loader/action threw |
| 2509 |
// _something_ that wasn't a Response, but it's not guaranteed/required |
| 2510 |
// to be an `instanceof Error` either, so we have to use throw here to |
| 2511 |
// preserve the "error" state outside of queryImpl. |
| 2512 |
throw error; |
| 2513 |
} // Pick off the right state value to return |
| 2514 |
|
| 2515 |
|
| 2516 |
let routeData = [result.actionData, result.loaderData].find(v => v); |
| 2517 |
return Object.values(routeData || {})[0]; |
| 2518 |
} |
| 2519 |
|
| 2520 |
async function queryImpl(request, location, matches, routeMatch) { |
| 2521 |
invariant(request.signal, "query()/queryRoute() requests must contain an AbortController signal"); |
| 2522 |
|
| 2523 |
try { |
| 2524 |
if (validActionMethods.has(request.method)) { |
| 2525 |
let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), routeMatch != null); |
| 2526 |
return result; |
| 2527 |
} |
| 2528 |
|
| 2529 |
let result = await loadRouteData(request, matches, routeMatch); |
| 2530 |
return result instanceof Response ? result : _extends({}, result, { |
| 2531 |
actionData: null, |
| 2532 |
actionHeaders: {} |
| 2533 |
}); |
| 2534 |
} catch (e) { |
| 2535 |
// If the user threw/returned a Response in callLoaderOrAction, we throw |
| 2536 |
// it to bail out and then return or throw here based on whether the user |
| 2537 |
// returned or threw |
| 2538 |
if (isQueryRouteResponse(e)) { |
| 2539 |
if (e.type === ResultType.error && !isRedirectResponse(e.response)) { |
| 2540 |
throw e.response; |
| 2541 |
} |
| 2542 |
|
| 2543 |
return e.response; |
| 2544 |
} // Redirects are always returned since they don't propagate to catch |
| 2545 |
// boundaries |
| 2546 |
|
| 2547 |
|
| 2548 |
if (isRedirectResponse(e)) { |
| 2549 |
return e; |
| 2550 |
} |
| 2551 |
|
| 2552 |
throw e; |
| 2553 |
} |
| 2554 |
} |
| 2555 |
|
| 2556 |
async function submit(request, matches, actionMatch, isRouteRequest) { |
| 2557 |
let result; |
| 2558 |
|
| 2559 |
if (!actionMatch.route.action) { |
| 2560 |
if (isRouteRequest) { |
| 2561 |
throw createRouterErrorResponse(null, { |
| 2562 |
status: 405, |
| 2563 |
statusText: "Method Not Allowed" |
| 2564 |
}); |
| 2565 |
} |
| 2566 |
|
| 2567 |
result = getMethodNotAllowedResult(request.url); |
| 2568 |
} else { |
| 2569 |
result = await callLoaderOrAction("action", request, actionMatch, matches, undefined, // Basename not currently supported in static handlers |
| 2570 |
true, isRouteRequest); |
| 2571 |
|
| 2572 |
if (request.signal.aborted) { |
| 2573 |
let method = isRouteRequest ? "queryRoute" : "query"; |
| 2574 |
throw new Error(method + "() call aborted"); |
| 2575 |
} |
| 2576 |
} |
| 2577 |
|
| 2578 |
if (isRedirectResult(result)) { |
| 2579 |
// Uhhhh - this should never happen, we should always throw these from |
| 2580 |
// callLoaderOrAction, but the type narrowing here keeps TS happy and we |
| 2581 |
// can get back on the "throw all redirect responses" train here should |
| 2582 |
// this ever happen :/ |
| 2583 |
throw new Response(null, { |
| 2584 |
status: result.status, |
| 2585 |
headers: { |
| 2586 |
Location: result.location |
| 2587 |
} |
| 2588 |
}); |
| 2589 |
} |
| 2590 |
|
| 2591 |
if (isDeferredResult(result)) { |
| 2592 |
throw new Error("defer() is not supported in actions"); |
| 2593 |
} |
| 2594 |
|
| 2595 |
if (isRouteRequest) { |
| 2596 |
// Note: This should only be non-Response values if we get here, since |
| 2597 |
// isRouteRequest should throw any Response received in callLoaderOrAction |
| 2598 |
if (isErrorResult(result)) { |
| 2599 |
let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); |
| 2600 |
return { |
| 2601 |
matches: [actionMatch], |
| 2602 |
loaderData: {}, |
| 2603 |
actionData: null, |
| 2604 |
errors: { |
| 2605 |
[boundaryMatch.route.id]: result.error |
| 2606 |
}, |
| 2607 |
// Note: statusCode + headers are unused here since queryRoute will |
| 2608 |
// return the raw Response or value |
| 2609 |
statusCode: 500, |
| 2610 |
loaderHeaders: {}, |
| 2611 |
actionHeaders: {} |
| 2612 |
}; |
| 2613 |
} |
| 2614 |
|
| 2615 |
return { |
| 2616 |
matches: [actionMatch], |
| 2617 |
loaderData: {}, |
| 2618 |
actionData: { |
| 2619 |
[actionMatch.route.id]: result.data |
| 2620 |
}, |
| 2621 |
errors: null, |
| 2622 |
// Note: statusCode + headers are unused here since queryRoute will |
| 2623 |
// return the raw Response or value |
| 2624 |
statusCode: 200, |
| 2625 |
loaderHeaders: {}, |
| 2626 |
actionHeaders: {} |
| 2627 |
}; |
| 2628 |
} |
| 2629 |
|
| 2630 |
if (isErrorResult(result)) { |
| 2631 |
// Store off the pending error - we use it to determine which loaders |
| 2632 |
// to call and will commit it when we complete the navigation |
| 2633 |
let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); |
| 2634 |
let context = await loadRouteData(request, matches, undefined, { |
| 2635 |
[boundaryMatch.route.id]: result.error |
| 2636 |
}); // action status codes take precedence over loader status codes |
| 2637 |
|
| 2638 |
return _extends({}, context, { |
| 2639 |
statusCode: isRouteErrorResponse(result.error) ? result.error.status : 500, |
| 2640 |
actionData: null, |
| 2641 |
actionHeaders: _extends({}, result.headers ? { |
| 2642 |
[actionMatch.route.id]: result.headers |
| 2643 |
} : {}) |
| 2644 |
}); |
| 2645 |
} |
| 2646 |
|
| 2647 |
let context = await loadRouteData(request, matches); |
| 2648 |
return _extends({}, context, result.statusCode ? { |
| 2649 |
statusCode: result.statusCode |
| 2650 |
} : {}, { |
| 2651 |
actionData: { |
| 2652 |
[actionMatch.route.id]: result.data |
| 2653 |
}, |
| 2654 |
actionHeaders: _extends({}, result.headers ? { |
| 2655 |
[actionMatch.route.id]: result.headers |
| 2656 |
} : {}) |
| 2657 |
}); |
| 2658 |
} |
| 2659 |
|
| 2660 |
async function loadRouteData(request, matches, routeMatch, pendingActionError) { |
| 2661 |
let isRouteRequest = routeMatch != null; |
| 2662 |
let requestMatches = routeMatch ? [routeMatch] : getLoaderMatchesUntilBoundary(matches, Object.keys(pendingActionError || {})[0]); |
| 2663 |
let matchesToLoad = requestMatches.filter(m => m.route.loader); // Short circuit if we have no loaders to run |
| 2664 |
|
| 2665 |
if (matchesToLoad.length === 0) { |
| 2666 |
return { |
| 2667 |
matches, |
| 2668 |
loaderData: {}, |
| 2669 |
errors: pendingActionError || null, |
| 2670 |
statusCode: 200, |
| 2671 |
loaderHeaders: {} |
| 2672 |
}; |
| 2673 |
} |
| 2674 |
|
| 2675 |
let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, undefined, // Basename not currently supported in static handlers |
| 2676 |
true, isRouteRequest))]); |
| 2677 |
|
| 2678 |
if (request.signal.aborted) { |
| 2679 |
let method = isRouteRequest ? "queryRoute" : "query"; |
| 2680 |
throw new Error(method + "() call aborted"); |
| 2681 |
} // Can't do anything with these without the Remix side of things, so just |
| 2682 |
// cancel them for now |
| 2683 |
|
| 2684 |
|
| 2685 |
results.forEach(result => { |
| 2686 |
if (isDeferredResult(result)) { |
| 2687 |
result.deferredData.cancel(); |
| 2688 |
} |
| 2689 |
}); // Process and commit output from loaders |
| 2690 |
|
| 2691 |
let context = processRouteLoaderData(matches, matchesToLoad, results, pendingActionError); |
| 2692 |
return _extends({}, context, { |
| 2693 |
matches |
| 2694 |
}); |
| 2695 |
} |
| 2696 |
|
| 2697 |
function createRouterErrorResponse(body, init) { |
| 2698 |
return new Response(body, _extends({}, init, { |
| 2699 |
headers: _extends({}, init.headers, { |
| 2700 |
"X-Remix-Router-Error": "yes" |
| 2701 |
}) |
| 2702 |
})); |
| 2703 |
} |
| 2704 |
|
| 2705 |
return { |
| 2706 |
dataRoutes, |
| 2707 |
query, |
| 2708 |
queryRoute |
| 2709 |
}; |
| 2710 |
} //#endregion |
| 2711 |
//////////////////////////////////////////////////////////////////////////////// |
| 2712 |
//#region Helpers |
| 2713 |
//////////////////////////////////////////////////////////////////////////////// |
| 2714 |
|
| 2715 |
/** |
| 2716 |
* Given an existing StaticHandlerContext and an error thrown at render time, |
| 2717 |
* provide an updated StaticHandlerContext suitable for a second SSR render |
| 2718 |
*/ |
| 2719 |
|
| 2720 |
function getStaticContextFromError(routes, context, error) { |
| 2721 |
let newContext = _extends({}, context, { |
| 2722 |
statusCode: 500, |
| 2723 |
errors: { |
| 2724 |
[context._deepestRenderedBoundaryId || routes[0].id]: error |
| 2725 |
} |
| 2726 |
}); |
| 2727 |
|
| 2728 |
return newContext; |
| 2729 |
} // Normalize navigation options by converting formMethod=GET formData objects to |
| 2730 |
// URLSearchParams so they behave identically to links with query params |
| 2731 |
|
| 2732 |
function normalizeNavigateOptions(to, opts, isFetcher) { |
| 2733 |
if (isFetcher === void 0) { |
| 2734 |
isFetcher = false; |
| 2735 |
} |
| 2736 |
|
| 2737 |
let path = typeof to === "string" ? to : createPath(to); // Return location verbatim on non-submission navigations |
| 2738 |
|
| 2739 |
if (!opts || !("formMethod" in opts) && !("formData" in opts)) { |
| 2740 |
return { |
| 2741 |
path |
| 2742 |
}; |
| 2743 |
} // Create a Submission on non-GET navigations |
| 2744 |
|
| 2745 |
|
| 2746 |
if (opts.formMethod != null && opts.formMethod !== "get") { |
| 2747 |
return { |
| 2748 |
path, |
| 2749 |
submission: { |
| 2750 |
formMethod: opts.formMethod, |
| 2751 |
formAction: stripHashFromPath(path), |
| 2752 |
formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded", |
| 2753 |
formData: opts.formData |
| 2754 |
} |
| 2755 |
}; |
| 2756 |
} // No formData to flatten for GET submission |
| 2757 |
|
| 2758 |
|
| 2759 |
if (!opts.formData) { |
| 2760 |
return { |
| 2761 |
path |
| 2762 |
}; |
| 2763 |
} // Flatten submission onto URLSearchParams for GET submissions |
| 2764 |
|
| 2765 |
|
| 2766 |
let parsedPath = parsePath(path); |
| 2767 |
|
| 2768 |
try { |
| 2769 |
let searchParams = convertFormDataToSearchParams(opts.formData); // Since fetcher GET submissions only run a single loader (as opposed to |
| 2770 |
// navigation GET submissions which run all loaders), we need to preserve |
| 2771 |
// any incoming ?index params |
| 2772 |
|
| 2773 |
if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) { |
| 2774 |
searchParams.append("index", ""); |
| 2775 |
} |
| 2776 |
|
| 2777 |
parsedPath.search = "?" + searchParams; |
| 2778 |
} catch (e) { |
| 2779 |
return { |
| 2780 |
path, |
| 2781 |
error: new ErrorResponse(400, "Bad Request", "Cannot submit binary form data using GET") |
| 2782 |
}; |
| 2783 |
} |
| 2784 |
|
| 2785 |
return { |
| 2786 |
path: createPath(parsedPath) |
| 2787 |
}; |
| 2788 |
} |
| 2789 |
|
| 2790 |
function getLoaderRedirect(state, redirect) { |
| 2791 |
let { |
| 2792 |
formMethod, |
| 2793 |
formAction, |
| 2794 |
formEncType, |
| 2795 |
formData |
| 2796 |
} = state.navigation; |
| 2797 |
let navigation = { |
| 2798 |
state: "loading", |
| 2799 |
location: createLocation(state.location, redirect.location), |
| 2800 |
formMethod: formMethod || undefined, |
| 2801 |
formAction: formAction || undefined, |
| 2802 |
formEncType: formEncType || undefined, |
| 2803 |
formData: formData || undefined |
| 2804 |
}; |
| 2805 |
return navigation; |
| 2806 |
} // Filter out all routes below any caught error as they aren't going to |
| 2807 |
// render so we don't need to load them |
| 2808 |
|
| 2809 |
|
| 2810 |
function getLoaderMatchesUntilBoundary(matches, boundaryId) { |
| 2811 |
let boundaryMatches = matches; |
| 2812 |
|
| 2813 |
if (boundaryId) { |
| 2814 |
let index = matches.findIndex(m => m.route.id === boundaryId); |
| 2815 |
|
| 2816 |
if (index >= 0) { |
| 2817 |
boundaryMatches = matches.slice(0, index); |
| 2818 |
} |
| 2819 |
} |
| 2820 |
|
| 2821 |
return boundaryMatches; |
| 2822 |
} |
| 2823 |
|
| 2824 |
function getMatchesToLoad(state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, pendingActionData, pendingError, fetchLoadMatches) { |
| 2825 |
let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : null; // Pick navigation matches that are net-new or qualify for revalidation |
| 2826 |
|
| 2827 |
let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined; |
| 2828 |
let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId); |
| 2829 |
let navigationMatches = boundaryMatches.filter((match, index) => match.route.loader != null && (isNewLoader(state.loaderData, state.matches[index], match) || // If this route had a pending deferred cancelled it must be revalidated |
| 2830 |
cancelledDeferredRoutes.some(id => id === match.route.id) || shouldRevalidateLoader(state.location, state.matches[index], submission, location, match, isRevalidationRequired, actionResult))); // Pick fetcher.loads that need to be revalidated |
| 2831 |
|
| 2832 |
let revalidatingFetchers = []; |
| 2833 |
fetchLoadMatches && fetchLoadMatches.forEach((_ref10, key) => { |
| 2834 |
let [href, match, fetchMatches] = _ref10; |
| 2835 |
|
| 2836 |
// This fetcher was cancelled from a prior action submission - force reload |
| 2837 |
if (cancelledFetcherLoads.includes(key)) { |
| 2838 |
revalidatingFetchers.push([key, href, match, fetchMatches]); |
| 2839 |
} else if (isRevalidationRequired) { |
| 2840 |
let shouldRevalidate = shouldRevalidateLoader(href, match, submission, href, match, isRevalidationRequired, actionResult); |
| 2841 |
|
| 2842 |
if (shouldRevalidate) { |
| 2843 |
revalidatingFetchers.push([key, href, match, fetchMatches]); |
| 2844 |
} |
| 2845 |
} |
| 2846 |
}); |
| 2847 |
return [navigationMatches, revalidatingFetchers]; |
| 2848 |
} |
| 2849 |
|
| 2850 |
function isNewLoader(currentLoaderData, currentMatch, match) { |
| 2851 |
let isNew = // [a] -> [a, b] |
| 2852 |
!currentMatch || // [a, b] -> [a, c] |
| 2853 |
match.route.id !== currentMatch.route.id; // Handle the case that we don't have data for a re-used route, potentially |
| 2854 |
// from a prior error or from a cancelled pending deferred |
| 2855 |
|
| 2856 |
let isMissingData = currentLoaderData[match.route.id] === undefined; // Always load if this is a net-new route or we don't yet have data |
| 2857 |
|
| 2858 |
return isNew || isMissingData; |
| 2859 |
} |
| 2860 |
|
| 2861 |
function isNewRouteInstance(currentMatch, match) { |
| 2862 |
let currentPath = currentMatch.route.path; |
| 2863 |
return (// param change for this match, /users/123 -> /users/456 |
| 2864 |
currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path |
| 2865 |
// e.g. /files/images/avatar.jpg -> files/finances.xls |
| 2866 |
currentPath && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"] |
| 2867 |
); |
| 2868 |
} |
| 2869 |
|
| 2870 |
function shouldRevalidateLoader(currentLocation, currentMatch, submission, location, match, isRevalidationRequired, actionResult) { |
| 2871 |
let currentUrl = createURL(currentLocation); |
| 2872 |
let currentParams = currentMatch.params; |
| 2873 |
let nextUrl = createURL(location); |
| 2874 |
let nextParams = match.params; // This is the default implementation as to when we revalidate. If the route |
| 2875 |
// provides it's own implementation, then we give them full control but |
| 2876 |
// provide this value so they can leverage it if needed after they check |
| 2877 |
// their own specific use cases |
| 2878 |
// Note that fetchers always provide the same current/next locations so the |
| 2879 |
// URL-based checks here don't apply to fetcher shouldRevalidate calls |
| 2880 |
|
| 2881 |
let defaultShouldRevalidate = isNewRouteInstance(currentMatch, match) || // Clicked the same link, resubmitted a GET form |
| 2882 |
currentUrl.toString() === nextUrl.toString() || // Search params affect all loaders |
| 2883 |
currentUrl.search !== nextUrl.search || // Forced revalidation due to submission, useRevalidate, or X-Remix-Revalidate |
| 2884 |
isRevalidationRequired; |
| 2885 |
|
| 2886 |
if (match.route.shouldRevalidate) { |
| 2887 |
let routeChoice = match.route.shouldRevalidate(_extends({ |
| 2888 |
currentUrl, |
| 2889 |
currentParams, |
| 2890 |
nextUrl, |
| 2891 |
nextParams |
| 2892 |
}, submission, { |
| 2893 |
actionResult, |
| 2894 |
defaultShouldRevalidate |
| 2895 |
})); |
| 2896 |
|
| 2897 |
if (typeof routeChoice === "boolean") { |
| 2898 |
return routeChoice; |
| 2899 |
} |
| 2900 |
} |
| 2901 |
|
| 2902 |
return defaultShouldRevalidate; |
| 2903 |
} |
| 2904 |
|
| 2905 |
async function callLoaderOrAction(type, request, match, matches, basename, isStaticRequest, isRouteRequest) { |
| 2906 |
if (isStaticRequest === void 0) { |
| 2907 |
isStaticRequest = false; |
| 2908 |
} |
| 2909 |
|
| 2910 |
if (isRouteRequest === void 0) { |
| 2911 |
isRouteRequest = false; |
| 2912 |
} |
| 2913 |
|
| 2914 |
let resultType; |
| 2915 |
let result; // Setup a promise we can race against so that abort signals short circuit |
| 2916 |
|
| 2917 |
let reject; |
| 2918 |
let abortPromise = new Promise((_, r) => reject = r); |
| 2919 |
|
| 2920 |
let onReject = () => reject(); |
| 2921 |
|
| 2922 |
request.signal.addEventListener("abort", onReject); |
| 2923 |
|
| 2924 |
try { |
| 2925 |
let handler = match.route[type]; |
| 2926 |
invariant(handler, "Could not find the " + type + " to run on the \"" + match.route.id + "\" route"); |
| 2927 |
result = await Promise.race([handler({ |
| 2928 |
request, |
| 2929 |
params: match.params |
| 2930 |
}), abortPromise]); |
| 2931 |
} catch (e) { |
| 2932 |
resultType = ResultType.error; |
| 2933 |
result = e; |
| 2934 |
} finally { |
| 2935 |
request.signal.removeEventListener("abort", onReject); |
| 2936 |
} |
| 2937 |
|
| 2938 |
if (result instanceof Response) { |
| 2939 |
let status = result.status; // Process redirects |
| 2940 |
|
| 2941 |
if (status >= 300 && status <= 399) { |
| 2942 |
let location = result.headers.get("Location"); |
| 2943 |
invariant(location, "Redirects returned/thrown from loaders/actions must have a Location header"); // Support relative routing in redirects |
| 2944 |
|
| 2945 |
let activeMatches = matches.slice(0, matches.indexOf(match) + 1); |
| 2946 |
let routePathnames = getPathContributingMatches(activeMatches).map(match => match.pathnameBase); |
| 2947 |
let requestPath = createURL(request.url).pathname; |
| 2948 |
let resolvedLocation = resolveTo(location, routePathnames, requestPath); |
| 2949 |
invariant(createPath(resolvedLocation), "Unable to resolve redirect location: " + result.headers.get("Location")); // Prepend the basename to the redirect location if we have one |
| 2950 |
|
| 2951 |
if (basename) { |
| 2952 |
let path = resolvedLocation.pathname; |
| 2953 |
resolvedLocation.pathname = path === "/" ? basename : joinPaths([basename, path]); |
| 2954 |
} |
| 2955 |
|
| 2956 |
location = createPath(resolvedLocation); // Don't process redirects in the router during static requests requests. |
| 2957 |
// Instead, throw the Response and let the server handle it with an HTTP |
| 2958 |
// redirect. We also update the Location header in place in this flow so |
| 2959 |
// basename and relative routing is taken into account |
| 2960 |
|
| 2961 |
if (isStaticRequest) { |
| 2962 |
result.headers.set("Location", location); |
| 2963 |
throw result; |
| 2964 |
} |
| 2965 |
|
| 2966 |
return { |
| 2967 |
type: ResultType.redirect, |
| 2968 |
status, |
| 2969 |
location, |
| 2970 |
revalidate: result.headers.get("X-Remix-Revalidate") !== null |
| 2971 |
}; |
| 2972 |
} // For SSR single-route requests, we want to hand Responses back directly |
| 2973 |
// without unwrapping. We do this with the QueryRouteResponse wrapper |
| 2974 |
// interface so we can know whether it was returned or thrown |
| 2975 |
|
| 2976 |
|
| 2977 |
if (isRouteRequest) { |
| 2978 |
// eslint-disable-next-line no-throw-literal |
| 2979 |
throw { |
| 2980 |
type: resultType || ResultType.data, |
| 2981 |
response: result |
| 2982 |
}; |
| 2983 |
} |
| 2984 |
|
| 2985 |
let data; |
| 2986 |
let contentType = result.headers.get("Content-Type"); |
| 2987 |
|
| 2988 |
if (contentType && contentType.startsWith("application/json")) { |
| 2989 |
data = await result.json(); |
| 2990 |
} else { |
| 2991 |
data = await result.text(); |
| 2992 |
} |
| 2993 |
|
| 2994 |
if (resultType === ResultType.error) { |
| 2995 |
return { |
| 2996 |
type: resultType, |
| 2997 |
error: new ErrorResponse(status, result.statusText, data), |
| 2998 |
headers: result.headers |
| 2999 |
}; |
| 3000 |
} |
| 3001 |
|
| 3002 |
return { |
| 3003 |
type: ResultType.data, |
| 3004 |
data, |
| 3005 |
statusCode: result.status, |
| 3006 |
headers: result.headers |
| 3007 |
}; |
| 3008 |
} |
| 3009 |
|
| 3010 |
if (resultType === ResultType.error) { |
| 3011 |
return { |
| 3012 |
type: resultType, |
| 3013 |
error: result |
| 3014 |
}; |
| 3015 |
} |
| 3016 |
|
| 3017 |
if (result instanceof DeferredData) { |
| 3018 |
return { |
| 3019 |
type: ResultType.deferred, |
| 3020 |
deferredData: result |
| 3021 |
}; |
| 3022 |
} |
| 3023 |
|
| 3024 |
return { |
| 3025 |
type: ResultType.data, |
| 3026 |
data: result |
| 3027 |
}; |
| 3028 |
} |
| 3029 |
|
| 3030 |
function createRequest(location, signal, submission) { |
| 3031 |
let url = createURL(stripHashFromPath(location)).toString(); |
| 3032 |
let init = { |
| 3033 |
signal |
| 3034 |
}; |
| 3035 |
|
| 3036 |
if (submission) { |
| 3037 |
let { |
| 3038 |
formMethod, |
| 3039 |
formEncType, |
| 3040 |
formData |
| 3041 |
} = submission; |
| 3042 |
init.method = formMethod.toUpperCase(); |
| 3043 |
init.body = formEncType === "application/x-www-form-urlencoded" ? convertFormDataToSearchParams(formData) : formData; |
| 3044 |
} // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) |
| 3045 |
|
| 3046 |
|
| 3047 |
return new Request(url, init); |
| 3048 |
} |
| 3049 |
|
| 3050 |
function convertFormDataToSearchParams(formData) { |
| 3051 |
let searchParams = new URLSearchParams(); |
| 3052 |
|
| 3053 |
for (let [key, value] of formData.entries()) { |
| 3054 |
invariant(typeof value === "string", 'File inputs are not supported with encType "application/x-www-form-urlencoded", ' + 'please use "multipart/form-data" instead.'); |
| 3055 |
searchParams.append(key, value); |
| 3056 |
} |
| 3057 |
|
| 3058 |
return searchParams; |
| 3059 |
} |
| 3060 |
|
| 3061 |
function processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds) { |
| 3062 |
// Fill in loaderData/errors from our loaders |
| 3063 |
let loaderData = {}; |
| 3064 |
let errors = null; |
| 3065 |
let statusCode; |
| 3066 |
let foundError = false; |
| 3067 |
let loaderHeaders = {}; // Process loader results into state.loaderData/state.errors |
| 3068 |
|
| 3069 |
results.forEach((result, index) => { |
| 3070 |
let id = matchesToLoad[index].route.id; |
| 3071 |
invariant(!isRedirectResult(result), "Cannot handle redirect results in processLoaderData"); |
| 3072 |
|
| 3073 |
if (isErrorResult(result)) { |
| 3074 |
// Look upwards from the matched route for the closest ancestor |
| 3075 |
// error boundary, defaulting to the root match |
| 3076 |
let boundaryMatch = findNearestBoundary(matches, id); |
| 3077 |
let error = result.error; // If we have a pending action error, we report it at the highest-route |
| 3078 |
// that throws a loader error, and then clear it out to indicate that |
| 3079 |
// it was consumed |
| 3080 |
|
| 3081 |
if (pendingError) { |
| 3082 |
error = Object.values(pendingError)[0]; |
| 3083 |
pendingError = undefined; |
| 3084 |
} |
| 3085 |
|
| 3086 |
errors = Object.assign(errors || {}, { |
| 3087 |
[boundaryMatch.route.id]: error |
| 3088 |
}); // Once we find our first (highest) error, we set the status code and |
| 3089 |
// prevent deeper status codes from overriding |
| 3090 |
|
| 3091 |
if (!foundError) { |
| 3092 |
foundError = true; |
| 3093 |
statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500; |
| 3094 |
} |
| 3095 |
|
| 3096 |
if (result.headers) { |
| 3097 |
loaderHeaders[id] = result.headers; |
| 3098 |
} |
| 3099 |
} else if (isDeferredResult(result)) { |
| 3100 |
activeDeferreds && activeDeferreds.set(id, result.deferredData); |
| 3101 |
loaderData[id] = result.deferredData.data; // TODO: Add statusCode/headers once we wire up streaming in Remix |
| 3102 |
} else { |
| 3103 |
loaderData[id] = result.data; // Error status codes always override success status codes, but if all |
| 3104 |
// loaders are successful we take the deepest status code. |
| 3105 |
|
| 3106 |
if (result.statusCode != null && result.statusCode !== 200 && !foundError) { |
| 3107 |
statusCode = result.statusCode; |
| 3108 |
} |
| 3109 |
|
| 3110 |
if (result.headers) { |
| 3111 |
loaderHeaders[id] = result.headers; |
| 3112 |
} |
| 3113 |
} |
| 3114 |
}); // If we didn't consume the pending action error (i.e., all loaders |
| 3115 |
// resolved), then consume it here |
| 3116 |
|
| 3117 |
if (pendingError) { |
| 3118 |
errors = pendingError; |
| 3119 |
} |
| 3120 |
|
| 3121 |
return { |
| 3122 |
loaderData, |
| 3123 |
errors, |
| 3124 |
statusCode: statusCode || 200, |
| 3125 |
loaderHeaders |
| 3126 |
}; |
| 3127 |
} |
| 3128 |
|
| 3129 |
function processLoaderData(state, matches, matchesToLoad, results, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds) { |
| 3130 |
let { |
| 3131 |
loaderData, |
| 3132 |
errors |
| 3133 |
} = processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds); // Process results from our revalidating fetchers |
| 3134 |
|
| 3135 |
for (let index = 0; index < revalidatingFetchers.length; index++) { |
| 3136 |
let [key,, match] = revalidatingFetchers[index]; |
| 3137 |
invariant(fetcherResults !== undefined && fetcherResults[index] !== undefined, "Did not find corresponding fetcher result"); |
| 3138 |
let result = fetcherResults[index]; // Process fetcher non-redirect errors |
| 3139 |
|
| 3140 |
if (isErrorResult(result)) { |
| 3141 |
let boundaryMatch = findNearestBoundary(state.matches, match.route.id); |
| 3142 |
|
| 3143 |
if (!(errors && errors[boundaryMatch.route.id])) { |
| 3144 |
errors = _extends({}, errors, { |
| 3145 |
[boundaryMatch.route.id]: result.error |
| 3146 |
}); |
| 3147 |
} |
| 3148 |
|
| 3149 |
state.fetchers.delete(key); |
| 3150 |
} else if (isRedirectResult(result)) { |
| 3151 |
// Should never get here, redirects should get processed above, but we |
| 3152 |
// keep this to type narrow to a success result in the else |
| 3153 |
throw new Error("Unhandled fetcher revalidation redirect"); |
| 3154 |
} else if (isDeferredResult(result)) { |
| 3155 |
// Should never get here, deferred data should be awaited for fetchers |
| 3156 |
// in resolveDeferredResults |
| 3157 |
throw new Error("Unhandled fetcher deferred data"); |
| 3158 |
} else { |
| 3159 |
let doneFetcher = { |
| 3160 |
state: "idle", |
| 3161 |
data: result.data, |
| 3162 |
formMethod: undefined, |
| 3163 |
formAction: undefined, |
| 3164 |
formEncType: undefined, |
| 3165 |
formData: undefined |
| 3166 |
}; |
| 3167 |
state.fetchers.set(key, doneFetcher); |
| 3168 |
} |
| 3169 |
} |
| 3170 |
|
| 3171 |
return { |
| 3172 |
loaderData, |
| 3173 |
errors |
| 3174 |
}; |
| 3175 |
} |
| 3176 |
|
| 3177 |
function mergeLoaderData(loaderData, newLoaderData, matches) { |
| 3178 |
let mergedLoaderData = _extends({}, newLoaderData); |
| 3179 |
|
| 3180 |
matches.forEach(match => { |
| 3181 |
let id = match.route.id; |
| 3182 |
|
| 3183 |
if (newLoaderData[id] === undefined && loaderData[id] !== undefined) { |
| 3184 |
mergedLoaderData[id] = loaderData[id]; |
| 3185 |
} |
| 3186 |
}); |
| 3187 |
return mergedLoaderData; |
| 3188 |
} // Find the nearest error boundary, looking upwards from the leaf route (or the |
| 3189 |
// route specified by routeId) for the closest ancestor error boundary, |
| 3190 |
// defaulting to the root match |
| 3191 |
|
| 3192 |
|
| 3193 |
function findNearestBoundary(matches, routeId) { |
| 3194 |
let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches]; |
| 3195 |
return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0]; |
| 3196 |
} |
| 3197 |
|
| 3198 |
function getShortCircuitMatches(routes, status, statusText) { |
| 3199 |
// Prefer a root layout route if present, otherwise shim in a route object |
| 3200 |
let route = routes.find(r => r.index || !r.path || r.path === "/") || { |
| 3201 |
id: "__shim-" + status + "-route__" |
| 3202 |
}; |
| 3203 |
return { |
| 3204 |
matches: [{ |
| 3205 |
params: {}, |
| 3206 |
pathname: "", |
| 3207 |
pathnameBase: "", |
| 3208 |
route |
| 3209 |
}], |
| 3210 |
route, |
| 3211 |
error: new ErrorResponse(status, statusText, null) |
| 3212 |
}; |
| 3213 |
} |
| 3214 |
|
| 3215 |
function getNotFoundMatches(routes) { |
| 3216 |
return getShortCircuitMatches(routes, 404, "Not Found"); |
| 3217 |
} |
| 3218 |
|
| 3219 |
function getMethodNotAllowedMatches(routes) { |
| 3220 |
return getShortCircuitMatches(routes, 405, "Method Not Allowed"); |
| 3221 |
} |
| 3222 |
|
| 3223 |
function getMethodNotAllowedResult(path) { |
| 3224 |
let href = typeof path === "string" ? path : createPath(path); |
| 3225 |
console.warn("You're trying to submit to a route that does not have an action. To " + "fix this, please add an `action` function to the route for " + ("[" + href + "]")); |
| 3226 |
return { |
| 3227 |
type: ResultType.error, |
| 3228 |
error: new ErrorResponse(405, "Method Not Allowed", "") |
| 3229 |
}; |
| 3230 |
} // Find any returned redirect errors, starting from the lowest match |
| 3231 |
|
| 3232 |
|
| 3233 |
function findRedirect(results) { |
| 3234 |
for (let i = results.length - 1; i >= 0; i--) { |
| 3235 |
let result = results[i]; |
| 3236 |
|
| 3237 |
if (isRedirectResult(result)) { |
| 3238 |
return result; |
| 3239 |
} |
| 3240 |
} |
| 3241 |
} |
| 3242 |
|
| 3243 |
function stripHashFromPath(path) { |
| 3244 |
let parsedPath = typeof path === "string" ? parsePath(path) : path; |
| 3245 |
return createPath(_extends({}, parsedPath, { |
| 3246 |
hash: "" |
| 3247 |
})); |
| 3248 |
} |
| 3249 |
|
| 3250 |
function isHashChangeOnly(a, b) { |
| 3251 |
return a.pathname === b.pathname && a.search === b.search && a.hash !== b.hash; |
| 3252 |
} |
| 3253 |
|
| 3254 |
function isDeferredResult(result) { |
| 3255 |
return result.type === ResultType.deferred; |
| 3256 |
} |
| 3257 |
|
| 3258 |
function isErrorResult(result) { |
| 3259 |
return result.type === ResultType.error; |
| 3260 |
} |
| 3261 |
|
| 3262 |
function isRedirectResult(result) { |
| 3263 |
return (result && result.type) === ResultType.redirect; |
| 3264 |
} |
| 3265 |
|
| 3266 |
function isRedirectResponse(result) { |
| 3267 |
if (!(result instanceof Response)) { |
| 3268 |
return false; |
| 3269 |
} |
| 3270 |
|
| 3271 |
let status = result.status; |
| 3272 |
let location = result.headers.get("Location"); |
| 3273 |
return status >= 300 && status <= 399 && location != null; |
| 3274 |
} |
| 3275 |
|
| 3276 |
function isQueryRouteResponse(obj) { |
| 3277 |
return obj && obj.response instanceof Response && (obj.type === ResultType.data || ResultType.error); |
| 3278 |
} |
| 3279 |
|
| 3280 |
async function resolveDeferredResults(currentMatches, matchesToLoad, results, signal, isFetcher, currentLoaderData) { |
| 3281 |
for (let index = 0; index < results.length; index++) { |
| 3282 |
let result = results[index]; |
| 3283 |
let match = matchesToLoad[index]; |
| 3284 |
let currentMatch = currentMatches.find(m => m.route.id === match.route.id); |
| 3285 |
let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined; |
| 3286 |
|
| 3287 |
if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) { |
| 3288 |
// Note: we do not have to touch activeDeferreds here since we race them |
| 3289 |
// against the signal in resolveDeferredData and they'll get aborted |
| 3290 |
// there if needed |
| 3291 |
await resolveDeferredData(result, signal, isFetcher).then(result => { |
| 3292 |
if (result) { |
| 3293 |
results[index] = result || results[index]; |
| 3294 |
} |
| 3295 |
}); |
| 3296 |
} |
| 3297 |
} |
| 3298 |
} |
| 3299 |
|
| 3300 |
async function resolveDeferredData(result, signal, unwrap) { |
| 3301 |
if (unwrap === void 0) { |
| 3302 |
unwrap = false; |
| 3303 |
} |
| 3304 |
|
| 3305 |
let aborted = await result.deferredData.resolveData(signal); |
| 3306 |
|
| 3307 |
if (aborted) { |
| 3308 |
return; |
| 3309 |
} |
| 3310 |
|
| 3311 |
if (unwrap) { |
| 3312 |
try { |
| 3313 |
return { |
| 3314 |
type: ResultType.data, |
| 3315 |
data: result.deferredData.unwrappedData |
| 3316 |
}; |
| 3317 |
} catch (e) { |
| 3318 |
// Handle any TrackedPromise._error values encountered while unwrapping |
| 3319 |
return { |
| 3320 |
type: ResultType.error, |
| 3321 |
error: e |
| 3322 |
}; |
| 3323 |
} |
| 3324 |
} |
| 3325 |
|
| 3326 |
return { |
| 3327 |
type: ResultType.data, |
| 3328 |
data: result.deferredData.data |
| 3329 |
}; |
| 3330 |
} |
| 3331 |
|
| 3332 |
function hasNakedIndexQuery(search) { |
| 3333 |
return new URLSearchParams(search).getAll("index").some(v => v === ""); |
| 3334 |
} // Note: This should match the format exported by useMatches, so if you change |
| 3335 |
// this please also change that :) Eventually we'll DRY this up |
| 3336 |
|
| 3337 |
|
| 3338 |
function createUseMatchesMatch(match, loaderData) { |
| 3339 |
let { |
| 3340 |
route, |
| 3341 |
pathname, |
| 3342 |
params |
| 3343 |
} = match; |
| 3344 |
return { |
| 3345 |
id: route.id, |
| 3346 |
pathname, |
| 3347 |
params, |
| 3348 |
data: loaderData[route.id], |
| 3349 |
handle: route.handle |
| 3350 |
}; |
| 3351 |
} |
| 3352 |
|
| 3353 |
function getTargetMatch(matches, location) { |
| 3354 |
let search = typeof location === "string" ? parsePath(location).search : location.search; |
| 3355 |
|
| 3356 |
if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) { |
| 3357 |
// Return the leaf index route when index is present |
| 3358 |
return matches[matches.length - 1]; |
| 3359 |
} // Otherwise grab the deepest "path contributing" match (ignoring index and |
| 3360 |
// pathless layout routes) |
| 3361 |
|
| 3362 |
|
| 3363 |
let pathMatches = getPathContributingMatches(matches); |
| 3364 |
return pathMatches[pathMatches.length - 1]; |
| 3365 |
} //#endregion |
| 3366 |
|
| 3367 |
|
| 3368 |
//# sourceMappingURL=router.js.map |
| 3369 |
|
| 3370 |
|
| 3371 |
/***/ }), |
| 3372 |
|
| 3373 |
/***/ 3632: |
| 3374 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3375 |
|
| 3376 |
"use strict"; |
| 3377 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3378 |
/* harmony export */ "N": () => (/* binding */ actions) |
| 3379 |
/* harmony export */ }); |
| 3380 |
var actions = { |
| 3381 |
SET_LOADING: "SET_LOADING", |
| 3382 |
SET_STATE: "SET_STATE", |
| 3383 |
SET_MEETINGS: "SET_MEETINGS", |
| 3384 |
SET_MEETINGS_PAGINATION_DATA: "SET_MEETINGS_PAGINATION_DATA", |
| 3385 |
SET_MEETINGS_AFTER_DELETE: "SET_MEETINGS_AFTER_DELETE", |
| 3386 |
SET_MEETINGS_AFTER_DUPLICATE: "SET_MEETINGS_AFTER_DUPLICATE", |
| 3387 |
SET_STAFFS: "SET_STAFFS", |
| 3388 |
SET_STAFF: "SET_STAFF", |
| 3389 |
SET_PAGINGATE_DATA: "SET_PAGINGATE_DATA", |
| 3390 |
SET_BOOKINGS: "SETBOOKINGS", |
| 3391 |
SET_CUSTOMERS: "SET_CUSTOMERS", |
| 3392 |
SET_META_DATA_WITH_MEETING: "SET_META_DATA_WITH_MEETING", |
| 3393 |
SET_STAFF_SCHEDULE: "SET_STAFF_SCHEDULE", |
| 3394 |
CLEAR_MEETING_DATA_FOR_UPDATE: "CLEAR_MEETING_DATA_FOR_UPDATE", |
| 3395 |
SET_EMAIL_CUSTOMIZE_DATA: "SET_EMAIL_CUSTOMIZE_DATA", |
| 3396 |
SET_SETTINGS: "SET_SETTINGS", |
| 3397 |
SET_SETTINGS_LOADING: "SET_SETTINGS_LOADING", |
| 3398 |
SET_SETTINGS_SCHEDULE: "SET_SETTINGS_SCHEDULE", |
| 3399 |
SET_SELECTED_DATE: "SET_SELECTED_DATE", |
| 3400 |
SET_MEETING_TO_BOOK: "SET_MEETING_TO_BOOK", |
| 3401 |
SET_SELECTED_STAFF_ID_TO_BOOK: "SET_SELECTED_STAFF_ID_TO_BOOK", |
| 3402 |
SET_MEETING_SLOTS: "SET_MEETING_SLOTS", |
| 3403 |
SET_BOOKING_STATE: "SET_BOOKING_STATE", |
| 3404 |
SET_SETTINGS_CURRENCY: "SET_SETTINGS_CURRENCY", |
| 3405 |
CLEAR_BOOKING_RELATED_DATA: "CLEAR_BOOKING_RELATED_DATA", |
| 3406 |
SET_SETTINGS_COLOR: "SET_SETTINGS_COLOR", |
| 3407 |
SET_SEATS: "SET_SEATS", |
| 3408 |
SET_SEAT_REDUCER_STATE: "SET_SEAT_REDUCER_STATE" |
| 3409 |
}; |
| 3410 |
|
| 3411 |
/***/ }), |
| 3412 |
|
| 3413 |
/***/ 7157: |
| 3414 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3415 |
|
| 3416 |
"use strict"; |
| 3417 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3418 |
/* harmony export */ "I": () => (/* binding */ setState) |
| 3419 |
/* harmony export */ }); |
| 3420 |
/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3632); |
| 3421 |
|
| 3422 |
var setState = function setState(_ref) { |
| 3423 |
var dispatch = _ref.dispatch, |
| 3424 |
name = _ref.name, |
| 3425 |
value = _ref.value; |
| 3426 |
dispatch({ |
| 3427 |
type: _actions__WEBPACK_IMPORTED_MODULE_0__/* .actions.SET_STATE */ .N.SET_STATE, |
| 3428 |
field: name, |
| 3429 |
payload: value |
| 3430 |
}); |
| 3431 |
}; |
| 3432 |
|
| 3433 |
/***/ }), |
| 3434 |
|
| 3435 |
/***/ 629: |
| 3436 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3437 |
|
| 3438 |
"use strict"; |
| 3439 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3440 |
/* harmony export */ "I": () => (/* binding */ setMeetings) |
| 3441 |
/* harmony export */ }); |
| 3442 |
/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3632); |
| 3443 |
|
| 3444 |
var setMeetings = function setMeetings(_ref) { |
| 3445 |
var dispatch = _ref.dispatch, |
| 3446 |
value = _ref.value; |
| 3447 |
dispatch({ |
| 3448 |
type: _actions__WEBPACK_IMPORTED_MODULE_0__/* .actions.SET_MEETINGS */ .N.SET_MEETINGS, |
| 3449 |
payload: value |
| 3450 |
}); |
| 3451 |
}; |
| 3452 |
|
| 3453 |
/***/ }), |
| 3454 |
|
| 3455 |
/***/ 8494: |
| 3456 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3457 |
|
| 3458 |
"use strict"; |
| 3459 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3460 |
/* harmony export */ "Z": () => (/* binding */ MainPageHeader) |
| 3461 |
/* harmony export */ }); |
| 3462 |
/* harmony import */ var _common_icons_Icons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2751); |
| 3463 |
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); } |
| 3464 |
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } |
| 3465 |
var React = window.React; |
| 3466 |
var _window$antd = window.antd, |
| 3467 |
Button = _window$antd.Button, |
| 3468 |
PageHeader = _window$antd.PageHeader, |
| 3469 |
Dropdown = _window$antd.Dropdown; |
| 3470 |
|
| 3471 |
var __ = wp.i18n.__; |
| 3472 |
function MainPageHeader(_ref) { |
| 3473 |
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref)); |
| 3474 |
/** |
| 3475 |
* Main page header more info button items link |
| 3476 |
* */ |
| 3477 |
var infoMenuItems = [{ |
| 3478 |
key: "1", |
| 3479 |
label: /*#__PURE__*/React.createElement("a", { |
| 3480 |
target: "_blank", |
| 3481 |
rel: "noopener noreferrer", |
| 3482 |
href: "https://arraytics.com/support/" |
| 3483 |
}, /*#__PURE__*/React.createElement(_common_icons_Icons__WEBPACK_IMPORTED_MODULE_0__/* .HelpIcon */ .by, null), " ", __("Need Help?", "timetics")) |
| 3484 |
}, { |
| 3485 |
key: "2", |
| 3486 |
label: /*#__PURE__*/React.createElement("a", { |
| 3487 |
target: "_blank", |
| 3488 |
rel: "noopener noreferrer", |
| 3489 |
href: "https://docs.arraytics.com/docs/timetics/getting-started/" |
| 3490 |
}, /*#__PURE__*/React.createElement(_common_icons_Icons__WEBPACK_IMPORTED_MODULE_0__/* .DocumentIcon */ .$l, null), " ", __("Documentation", "timetics")) |
| 3491 |
}, { |
| 3492 |
key: "3", |
| 3493 |
label: /*#__PURE__*/React.createElement("a", { |
| 3494 |
target: "_blank", |
| 3495 |
rel: "noopener noreferrer", |
| 3496 |
href: "https://arraytics.com/timetics-roadmaps/" |
| 3497 |
}, /*#__PURE__*/React.createElement(_common_icons_Icons__WEBPACK_IMPORTED_MODULE_0__/* .FeatureIcon */ .ig, null), " ", __("Feature Request", "timetics")) |
| 3498 |
}]; |
| 3499 |
var DropdownMenu = function DropdownMenu() { |
| 3500 |
return ( |
| 3501 |
/*#__PURE__*/ |
| 3502 |
/** |
| 3503 |
* Main page dropdown button |
| 3504 |
*/ |
| 3505 |
React.createElement(Dropdown, { |
| 3506 |
key: "more-info", |
| 3507 |
overlayClassName: "tt-action-dropdown tt-action-area", |
| 3508 |
menu: { |
| 3509 |
items: infoMenuItems |
| 3510 |
}, |
| 3511 |
placement: "bottomRight" |
| 3512 |
}, /*#__PURE__*/React.createElement(Button, { |
| 3513 |
type: "text", |
| 3514 |
icon: /*#__PURE__*/React.createElement(_common_icons_Icons__WEBPACK_IMPORTED_MODULE_0__/* .DocIcon */ .V7, null) |
| 3515 |
})) |
| 3516 |
); |
| 3517 |
}; |
| 3518 |
return /*#__PURE__*/React.createElement("div", { |
| 3519 |
className: "tt-page-header-wrapper" |
| 3520 |
}, /*#__PURE__*/React.createElement(PageHeader, _extends({ |
| 3521 |
ghost: false |
| 3522 |
}, props, { |
| 3523 |
extra: [/*#__PURE__*/React.createElement(DropdownMenu, { |
| 3524 |
key: "more-info" |
| 3525 |
})] |
| 3526 |
}))); |
| 3527 |
} |
| 3528 |
|
| 3529 |
/***/ }), |
| 3530 |
|
| 3531 |
/***/ 2470: |
| 3532 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3533 |
|
| 3534 |
"use strict"; |
| 3535 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3536 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 3537 |
/* harmony export */ }); |
| 3538 |
/* harmony import */ var _common_icons_Icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2751); |
| 3539 |
/* harmony import */ var _actionCreators_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7157); |
| 3540 |
/* harmony import */ var _context_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7258); |
| 3541 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 3542 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 3543 |
function _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); } |
| 3544 |
function _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; } |
| 3545 |
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 3546 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 3547 |
|
| 3548 |
|
| 3549 |
|
| 3550 |
var _window$antd = window.antd, |
| 3551 |
Button = _window$antd.Button, |
| 3552 |
Space = _window$antd.Space; |
| 3553 |
var __ = wp.i18n.__; |
| 3554 |
function ScheduleMode() { |
| 3555 |
var _useStateValue = (0,_context_provider__WEBPACK_IMPORTED_MODULE_1__/* .useStateValue */ .K)(), |
| 3556 |
_useStateValue2 = _slicedToArray(_useStateValue, 2), |
| 3557 |
_useStateValue2$ = _useStateValue2[0], |
| 3558 |
meetingReducer = _useStateValue2$.meeting, |
| 3559 |
staff = _useStateValue2$.staff, |
| 3560 |
dispatch = _useStateValue2[1]; |
| 3561 |
var editAvailability = meetingReducer.editAvailability; |
| 3562 |
var editAvailabilityHandler = function editAvailabilityHandler(status) { |
| 3563 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_0__/* .setState */ .I)({ |
| 3564 |
dispatch: dispatch, |
| 3565 |
name: "editAvailability", |
| 3566 |
value: status |
| 3567 |
}); |
| 3568 |
}; |
| 3569 |
return /*#__PURE__*/React.createElement(Space, { |
| 3570 |
wrap: true, |
| 3571 |
className: "tt-availability-btn-area" |
| 3572 |
}, /*#__PURE__*/React.createElement(Button, { |
| 3573 |
type: !editAvailability ? "primary" : "default", |
| 3574 |
htmlType: "button", |
| 3575 |
onClick: function onClick(e) { |
| 3576 |
editAvailabilityHandler(false); |
| 3577 |
}, |
| 3578 |
icon: /*#__PURE__*/React.createElement(_common_icons_Icons__WEBPACK_IMPORTED_MODULE_2__/* .StarIcon */ .r7, { |
| 3579 |
width: "14", |
| 3580 |
height: "14", |
| 3581 |
color: "#1890ff" |
| 3582 |
}), |
| 3583 |
ghost: !editAvailability ? true : false |
| 3584 |
// TODO azad- please add an apporopriate icon in this button. check figma |
| 3585 |
}, __("Use Default Availability", "timetics")), /*#__PURE__*/React.createElement(Button, { |
| 3586 |
type: editAvailability ? "primary" : "default", |
| 3587 |
htmlType: "button", |
| 3588 |
onClick: function onClick(e) { |
| 3589 |
editAvailabilityHandler(true); |
| 3590 |
}, |
| 3591 |
icon: /*#__PURE__*/React.createElement(_common_icons_Icons__WEBPACK_IMPORTED_MODULE_2__/* .EditIcon */ .dY, { |
| 3592 |
width: "16", |
| 3593 |
height: "16", |
| 3594 |
color: "#1890ff" |
| 3595 |
}), |
| 3596 |
ghost: editAvailability ? true : false |
| 3597 |
}, __("Customize availability", "timetics"))); |
| 3598 |
} |
| 3599 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ScheduleMode); |
| 3600 |
|
| 3601 |
/***/ }), |
| 3602 |
|
| 3603 |
/***/ 8253: |
| 3604 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3605 |
|
| 3606 |
"use strict"; |
| 3607 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3608 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 3609 |
/* harmony export */ }); |
| 3610 |
/* harmony import */ var _common_SelectInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4378); |
| 3611 |
/* harmony import */ var _actionCreators_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7157); |
| 3612 |
/* harmony import */ var _context_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7258); |
| 3613 |
/* harmony import */ var _utils_dummyData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5177); |
| 3614 |
/* harmony import */ var _ScheduleMode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2470); |
| 3615 |
/* harmony import */ var _SingleDaySchedule__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3017); |
| 3616 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 3617 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 3618 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 3619 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } |
| 3620 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 3621 |
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } |
| 3622 |
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
| 3623 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 3624 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 3625 |
function _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); } |
| 3626 |
function _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; } |
| 3627 |
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 3628 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 3629 |
|
| 3630 |
|
| 3631 |
|
| 3632 |
|
| 3633 |
|
| 3634 |
|
| 3635 |
|
| 3636 |
var __ = wp.i18n.__; |
| 3637 |
var React = window.React; |
| 3638 |
var useState = React.useState, |
| 3639 |
useEffect = React.useEffect; |
| 3640 |
var _window$antd = window.antd, |
| 3641 |
Table = _window$antd.Table, |
| 3642 |
Checkbox = _window$antd.Checkbox, |
| 3643 |
Divider = _window$antd.Divider, |
| 3644 |
Select = _window$antd.Select, |
| 3645 |
Collapse = _window$antd.Collapse, |
| 3646 |
Form = _window$antd.Form, |
| 3647 |
Avatar = _window$antd.Avatar; |
| 3648 |
var Panel = Collapse.Panel; |
| 3649 |
function Schedules(_ref) { |
| 3650 |
var meetingType = _ref.meetingType, |
| 3651 |
schedules = _ref.schedules, |
| 3652 |
_ref$selectedStaffIds = _ref.selectedStaffIds, |
| 3653 |
selectedStaffIds = _ref$selectedStaffIds === void 0 ? [] : _ref$selectedStaffIds, |
| 3654 |
_ref$selectedStaff = _ref.selectedStaff, |
| 3655 |
selectedStaff = _ref$selectedStaff === void 0 ? [] : _ref$selectedStaff, |
| 3656 |
meetingDuration = _ref.meetingDuration; |
| 3657 |
var _useStateValue = (0,_context_provider__WEBPACK_IMPORTED_MODULE_2__/* .useStateValue */ .K)(), |
| 3658 |
_useStateValue2 = _slicedToArray(_useStateValue, 2), |
| 3659 |
_useStateValue2$ = _useStateValue2[0], |
| 3660 |
staffReducer = _useStateValue2$.staff, |
| 3661 |
meetingReducer = _useStateValue2$.meeting, |
| 3662 |
dispatch = _useStateValue2[1]; |
| 3663 |
|
| 3664 |
// const { |
| 3665 |
// meetingType, |
| 3666 |
// schedules, |
| 3667 |
// selectedStaffIds = [], |
| 3668 |
// selectedStaff = [], |
| 3669 |
// meetingDuration, |
| 3670 |
// } = meetingReducer; |
| 3671 |
var staffs = staffReducer.staffs; |
| 3672 |
var _useState = useState(0), |
| 3673 |
_useState2 = _slicedToArray(_useState, 2), |
| 3674 |
activeKey = _useState2[0], |
| 3675 |
setActiveKey = _useState2[1]; |
| 3676 |
// const [schedules, setSchedules] = useState( |
| 3677 |
// dummySchedules({ startTime, duration: 10 }) |
| 3678 |
// ); |
| 3679 |
|
| 3680 |
var removeStaff = function removeStaff(event, _staff) { |
| 3681 |
event.stopPropagation(); |
| 3682 |
var _staffs = _toConsumableArray(selectedStaff); |
| 3683 |
var _staffsIds = _toConsumableArray(selectedStaffIds); |
| 3684 |
_staffs = _staffs.filter(function (item) { |
| 3685 |
return item.id !== _staff.id; |
| 3686 |
}); |
| 3687 |
_staffsIds = _staffsIds.filter(function (item) { |
| 3688 |
return item !== (_staff === null || _staff === void 0 ? void 0 : _staff.id); |
| 3689 |
}); |
| 3690 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3691 |
dispatch: dispatch, |
| 3692 |
name: "selectedStaff", |
| 3693 |
value: _staffs |
| 3694 |
}); |
| 3695 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3696 |
dispatch: dispatch, |
| 3697 |
name: "selectedStaffIds", |
| 3698 |
value: _staffsIds |
| 3699 |
}); |
| 3700 |
var _schedules = _objectSpread({}, schedules); |
| 3701 |
delete _schedules[_staff.id]; |
| 3702 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3703 |
dispatch: dispatch, |
| 3704 |
name: "schedules", |
| 3705 |
value: _objectSpread({}, _schedules) |
| 3706 |
}); |
| 3707 |
}; |
| 3708 |
return /*#__PURE__*/React.createElement("div", { |
| 3709 |
className: "tt-container-wrapper tt-schedules-container" |
| 3710 |
}, selectedStaff !== null && selectedStaff !== void 0 && selectedStaff.length ? /*#__PURE__*/React.createElement("div", { |
| 3711 |
className: "tt-meeting-schedule" |
| 3712 |
}, /*#__PURE__*/React.createElement(_ScheduleMode__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, null), selectedStaff === null || selectedStaff === void 0 ? void 0 : selectedStaff.map(function (_staff, i) { |
| 3713 |
var _schedules$_staff$id; |
| 3714 |
return /*#__PURE__*/React.createElement("div", { |
| 3715 |
className: "tt-single-host-schedule", |
| 3716 |
key: "staff-".concat(i) |
| 3717 |
}, /*#__PURE__*/React.createElement("span", { |
| 3718 |
className: "tt-single-host-avatar" |
| 3719 |
}, /*#__PURE__*/React.createElement(Avatar, { |
| 3720 |
size: 30, |
| 3721 |
src: _staff === null || _staff === void 0 ? void 0 : _staff.image |
| 3722 |
})), /*#__PURE__*/React.createElement(Collapse, { |
| 3723 |
className: "tt-single-host-schedule-time", |
| 3724 |
accordion: true, |
| 3725 |
key: "".concat(i, "-selected-staff"), |
| 3726 |
activeKey: activeKey, |
| 3727 |
expandIconPosition: "end", |
| 3728 |
onChange: function onChange(e) { |
| 3729 |
setActiveKey(e); |
| 3730 |
} |
| 3731 |
}, /*#__PURE__*/React.createElement(Panel, { |
| 3732 |
header: _staff === null || _staff === void 0 ? void 0 : _staff.full_name, |
| 3733 |
key: i |
| 3734 |
}, (_schedules$_staff$id = schedules[_staff.id]) === null || _schedules$_staff$id === void 0 ? void 0 : _schedules$_staff$id.map(function (schedule, schduleIndex) { |
| 3735 |
return /*#__PURE__*/React.createElement(React.Fragment, { |
| 3736 |
key: "schedule-item-".concat(schduleIndex) |
| 3737 |
}, /*#__PURE__*/React.createElement(_SingleDaySchedule__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, { |
| 3738 |
schedule: _objectSpread({}, schedule) |
| 3739 |
// key={`schdule-item-${index}`} |
| 3740 |
, |
| 3741 |
scheduleIndex: schduleIndex, |
| 3742 |
schedules: schedules[_staff.id], |
| 3743 |
staffId: _staff.id |
| 3744 |
})); |
| 3745 |
})))); |
| 3746 |
})) : null); |
| 3747 |
} |
| 3748 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Schedules); |
| 3749 |
|
| 3750 |
/***/ }), |
| 3751 |
|
| 3752 |
/***/ 3017: |
| 3753 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3754 |
|
| 3755 |
"use strict"; |
| 3756 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3757 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 3758 |
/* harmony export */ }); |
| 3759 |
/* harmony import */ var _common_icons_Icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2751); |
| 3760 |
/* harmony import */ var _helper_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4903); |
| 3761 |
/* harmony import */ var _actionCreators_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7157); |
| 3762 |
/* harmony import */ var _context_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7258); |
| 3763 |
/* harmony import */ var _utils_dummyData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5177); |
| 3764 |
/* harmony import */ var _TooltipText__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8854); |
| 3765 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 3766 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 3767 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 3768 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } |
| 3769 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 3770 |
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } |
| 3771 |
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
| 3772 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 3773 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 3774 |
function _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); } |
| 3775 |
function _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; } |
| 3776 |
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 3777 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 3778 |
|
| 3779 |
|
| 3780 |
|
| 3781 |
|
| 3782 |
|
| 3783 |
|
| 3784 |
var __ = wp.i18n.__; |
| 3785 |
var _window$antd = window.antd, |
| 3786 |
Checkbox = _window$antd.Checkbox, |
| 3787 |
Row = _window$antd.Row, |
| 3788 |
Col = _window$antd.Col, |
| 3789 |
Table = _window$antd.Table, |
| 3790 |
Select = _window$antd.Select, |
| 3791 |
Space = _window$antd.Space, |
| 3792 |
Divider = _window$antd.Divider; |
| 3793 |
var React = window.React; |
| 3794 |
var useState = React.useState; |
| 3795 |
function SingleDaySchedule(_ref) { |
| 3796 |
var _schedule$schedules2; |
| 3797 |
var schedule = _ref.schedule, |
| 3798 |
schedules = _ref.schedules, |
| 3799 |
setSchedules = _ref.setSchedules, |
| 3800 |
scheduleIndex = _ref.scheduleIndex, |
| 3801 |
staffId = _ref.staffId; |
| 3802 |
var _useStateValue = (0,_context_provider__WEBPACK_IMPORTED_MODULE_2__/* .useStateValue */ .K)(), |
| 3803 |
_useStateValue2 = _slicedToArray(_useStateValue, 2), |
| 3804 |
meeting = _useStateValue2[0].meeting, |
| 3805 |
dispatch = _useStateValue2[1]; |
| 3806 |
var _useState = useState(null), |
| 3807 |
_useState2 = _slicedToArray(_useState, 2), |
| 3808 |
status = _useState2[0], |
| 3809 |
setStatus = _useState2[1]; |
| 3810 |
var _useState3 = useState("09:00 AM"), |
| 3811 |
_useState4 = _slicedToArray(_useState3, 2), |
| 3812 |
startTime = _useState4[0], |
| 3813 |
setStartTime = _useState4[1]; |
| 3814 |
var _useState5 = useState("24:00 PM"), |
| 3815 |
_useState6 = _slicedToArray(_useState5, 2), |
| 3816 |
endTime = _useState6[0], |
| 3817 |
setEndTime = _useState6[1]; |
| 3818 |
var timeCompareError = meeting.timeCompareError, |
| 3819 |
__schedules = meeting.schedules, |
| 3820 |
meetingDuration = meeting.meetingDuration, |
| 3821 |
meetingBufferTime = meeting.meetingBufferTime, |
| 3822 |
editAvailability = meeting.editAvailability; |
| 3823 |
var timeInterval = 10; |
| 3824 |
var timeFormat = "HH:mm"; //'h:mm A' |
| 3825 |
|
| 3826 |
/** |
| 3827 |
*Handler for click on schedule checkbox |
| 3828 |
* @param {Event} e Javascript Event object. |
| 3829 |
* @param {Object} param1 Object contains single schedule and it's index |
| 3830 |
*/ |
| 3831 |
var _onChange = function onChange(e, _ref2) { |
| 3832 |
var schedule = _ref2.schedule, |
| 3833 |
scheduleIndex = _ref2.scheduleIndex; |
| 3834 |
// console.log(`checked = ${e.target.checked}`); |
| 3835 |
if (e.target.checked == true) { |
| 3836 |
addScheduleDay({ |
| 3837 |
schedule: schedule, |
| 3838 |
scheduleIndex: scheduleIndex |
| 3839 |
}); |
| 3840 |
} else { |
| 3841 |
var _schedules = _toConsumableArray(schedules); |
| 3842 |
if (_schedules[scheduleIndex].key == schedule.key) { |
| 3843 |
_schedules[scheduleIndex].status = false; |
| 3844 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3845 |
dispatch: dispatch, |
| 3846 |
name: "schedules", |
| 3847 |
value: _objectSpread(_objectSpread({}, __schedules), {}, _defineProperty({}, staffId, _toConsumableArray(_schedules))) |
| 3848 |
}); |
| 3849 |
} |
| 3850 |
} |
| 3851 |
}; |
| 3852 |
|
| 3853 |
/** |
| 3854 |
*Handler for delete single time slot of a schedule |
| 3855 |
* @param {*} param0 Object contains single schedule, it's index, time slot and it's index. |
| 3856 |
* @returns |
| 3857 |
*/ |
| 3858 |
var deleteScheduleDay = function deleteScheduleDay(_ref3) { |
| 3859 |
var schedule = _ref3.schedule, |
| 3860 |
scheduleIndex = _ref3.scheduleIndex, |
| 3861 |
timeSlot = _ref3.timeSlot, |
| 3862 |
timeSlotIndex = _ref3.timeSlotIndex; |
| 3863 |
if (!schedule.status) return false; |
| 3864 |
var _schedules = _toConsumableArray(schedules); |
| 3865 |
// console.log("schedule.schedules: ", _schedules, timeSlotIndex); |
| 3866 |
|
| 3867 |
if (_schedules[scheduleIndex].key == schedule.key && schedule.schedules.length == 1) { |
| 3868 |
_schedules[scheduleIndex].schedules = [ |
| 3869 |
// { start: {label:"9:00", value: }, end: {label: "17:00", value: } }, |
| 3870 |
(0,_utils_dummyData__WEBPACK_IMPORTED_MODULE_3__/* .getSlotTime */ ._9)({ |
| 3871 |
startTime: startTime, |
| 3872 |
duration: meetingDuration |
| 3873 |
})]; |
| 3874 |
_schedules[scheduleIndex].status = false; |
| 3875 |
} |
| 3876 |
if (schedule.schedules.length > 1 && schedules[scheduleIndex].key == schedule.key) { |
| 3877 |
var _schedules$scheduleIn; |
| 3878 |
(_schedules$scheduleIn = _schedules[scheduleIndex]) === null || _schedules$scheduleIn === void 0 ? void 0 : _schedules$scheduleIn.schedules.splice(timeSlotIndex, 1); |
| 3879 |
} |
| 3880 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3881 |
dispatch: dispatch, |
| 3882 |
name: "schedules", |
| 3883 |
value: _objectSpread(_objectSpread({}, __schedules), {}, _defineProperty({}, staffId, _toConsumableArray(_schedules))) |
| 3884 |
}); |
| 3885 |
// console.log( |
| 3886 |
// "schedule?.schedules[timeSlotIndex - 1]", |
| 3887 |
// schedule?.schedules |
| 3888 |
// ); |
| 3889 |
var _timeSlotIndex = timeSlotIndex == 0 ? 0 : timeSlotIndex - 1; |
| 3890 |
var _status = (0,_helper_helpers__WEBPACK_IMPORTED_MODULE_0__/* .compareTime */ .Xi)({ |
| 3891 |
key: "", |
| 3892 |
value: schedule === null || schedule === void 0 ? void 0 : schedule.schedules[_timeSlotIndex], |
| 3893 |
timeSlotIndex: timeSlotIndex, |
| 3894 |
scheduleIndex: scheduleIndex, |
| 3895 |
schedule: schedule, |
| 3896 |
timeCompareError: timeCompareError |
| 3897 |
}); |
| 3898 |
// console.log("status: ", _status); |
| 3899 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3900 |
dispatch: dispatch, |
| 3901 |
name: "timeCompareError", |
| 3902 |
value: _status |
| 3903 |
}); |
| 3904 |
}; |
| 3905 |
|
| 3906 |
/** |
| 3907 |
* *Handler for add schedule time slot |
| 3908 |
* @param {*} param0 Object contains single schedule and it's index |
| 3909 |
* @returns |
| 3910 |
*/ |
| 3911 |
var addScheduleDay = function addScheduleDay(_ref4) { |
| 3912 |
var _schedules$scheduleIn2; |
| 3913 |
var schedule = _ref4.schedule, |
| 3914 |
scheduleIndex = _ref4.scheduleIndex; |
| 3915 |
var _schedules = _toConsumableArray(schedules); |
| 3916 |
var timeSlotIndex = ((_schedules$scheduleIn2 = _schedules[scheduleIndex].schedules) === null || _schedules$scheduleIn2 === void 0 ? void 0 : _schedules$scheduleIn2.length) - 1; |
| 3917 |
if (_schedules[scheduleIndex].key !== schedule.key) { |
| 3918 |
return false; |
| 3919 |
} |
| 3920 |
//TODO should be added a validation for maximum time slot per day base on day start and end time. |
| 3921 |
|
| 3922 |
if (schedule.status == false) { |
| 3923 |
_schedules[scheduleIndex].status = true; |
| 3924 |
_schedules[scheduleIndex].schedules = [ |
| 3925 |
// { start: {label:"9:00", value: }, end: {label: "17:00", value: } }, |
| 3926 |
(0,_utils_dummyData__WEBPACK_IMPORTED_MODULE_3__/* .getSlotTime */ ._9)({ |
| 3927 |
startTime: startTime, |
| 3928 |
duration: meetingDuration |
| 3929 |
})]; |
| 3930 |
} else { |
| 3931 |
var _schedules$scheduleIn3; |
| 3932 |
var timeSlot = (0,_helper_helpers__WEBPACK_IMPORTED_MODULE_0__/* ._getNextTimeSlot */ .Wf)({ |
| 3933 |
schedules: _schedules[scheduleIndex].schedules, |
| 3934 |
duration: timeInterval |
| 3935 |
// bufferTime: meetingBufferTime, |
| 3936 |
// dayEnd: endTime, |
| 3937 |
}); |
| 3938 |
// console.log("time slot: ", timeSlot); |
| 3939 |
//TODO need to check timeSlot is false or not |
| 3940 |
// if (!timeSlot) { |
| 3941 |
// return alert("day end"); |
| 3942 |
// } |
| 3943 |
(_schedules$scheduleIn3 = _schedules[scheduleIndex]) === null || _schedules$scheduleIn3 === void 0 ? void 0 : _schedules$scheduleIn3.schedules.push(timeSlot); |
| 3944 |
} |
| 3945 |
var _status = (0,_helper_helpers__WEBPACK_IMPORTED_MODULE_0__/* .compareTime */ .Xi)({ |
| 3946 |
key: "", |
| 3947 |
value: schedule === null || schedule === void 0 ? void 0 : schedule.schedules[timeSlotIndex], |
| 3948 |
timeSlotIndex: timeSlotIndex, |
| 3949 |
scheduleIndex: scheduleIndex, |
| 3950 |
schedule: schedule, |
| 3951 |
timeCompareError: timeCompareError |
| 3952 |
}); |
| 3953 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3954 |
dispatch: dispatch, |
| 3955 |
name: "timeCompareError", |
| 3956 |
value: _status |
| 3957 |
}); |
| 3958 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3959 |
dispatch: dispatch, |
| 3960 |
name: "schedules", |
| 3961 |
value: _objectSpread(_objectSpread({}, __schedules), {}, _defineProperty({}, staffId, _toConsumableArray(_schedules))) |
| 3962 |
}); |
| 3963 |
}; |
| 3964 |
|
| 3965 |
/** |
| 3966 |
* Handler to select time and compare(validity) |
| 3967 |
* @param {*} param0 Object contains key of the day, name of the day, schedule index, time slot index |
| 3968 |
*/ |
| 3969 |
var onSelectTime = function onSelectTime(_ref5) { |
| 3970 |
var key = _ref5.key, |
| 3971 |
value = _ref5.value, |
| 3972 |
scheduleIndex = _ref5.scheduleIndex, |
| 3973 |
timeSlotIndex = _ref5.timeSlotIndex; |
| 3974 |
var _schedules = _toConsumableArray(schedules); |
| 3975 |
_schedules[scheduleIndex].schedules[timeSlotIndex] = _objectSpread(_objectSpread({}, _schedules[scheduleIndex].schedules[timeSlotIndex]), {}, _defineProperty({}, key, value)); |
| 3976 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3977 |
dispatch: dispatch, |
| 3978 |
name: "schedules", |
| 3979 |
value: _objectSpread(_objectSpread({}, __schedules), {}, _defineProperty({}, staffId, _toConsumableArray(_schedules))) |
| 3980 |
}); |
| 3981 |
var _status = (0,_helper_helpers__WEBPACK_IMPORTED_MODULE_0__/* .compareTime */ .Xi)({ |
| 3982 |
key: key, |
| 3983 |
value: value, |
| 3984 |
timeSlotIndex: timeSlotIndex, |
| 3985 |
scheduleIndex: scheduleIndex, |
| 3986 |
schedule: schedule, |
| 3987 |
timeCompareError: timeCompareError |
| 3988 |
}); |
| 3989 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 3990 |
dispatch: dispatch, |
| 3991 |
name: "timeCompareError", |
| 3992 |
value: _status |
| 3993 |
}); |
| 3994 |
// if (_status.hasError) { |
| 3995 |
// alert(`time conflict.${_status.with.start}-${_status.with.end}`); |
| 3996 |
// } |
| 3997 |
}; |
| 3998 |
|
| 3999 |
var onSearchTime = function onSearchTime(value) { |
| 4000 |
// console.log("search time: ", value); |
| 4001 |
}; |
| 4002 |
if (!editAvailability) { |
| 4003 |
var _schedule$schedules; |
| 4004 |
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(Row, { |
| 4005 |
gutter: [16, 24] |
| 4006 |
}, /*#__PURE__*/React.createElement(Col, { |
| 4007 |
className: 'tt-availability-day', |
| 4008 |
span: 6 |
| 4009 |
}, schedule.key), /*#__PURE__*/React.createElement(Col, { |
| 4010 |
span: 14 |
| 4011 |
}, schedule.status == true ? schedule === null || schedule === void 0 ? void 0 : (_schedule$schedules = schedule.schedules) === null || _schedule$schedules === void 0 ? void 0 : _schedule$schedules.map(function (item, i) { |
| 4012 |
var _item$start, _item$end; |
| 4013 |
// console.log("item: ", item); |
| 4014 |
return /*#__PURE__*/React.createElement(React.Fragment, { |
| 4015 |
key: "".concat(i, "-single-schedule-time-slot") |
| 4016 |
}, /*#__PURE__*/React.createElement("div", { |
| 4017 |
key: "schedule-time-slot-".concat(i), |
| 4018 |
style: { |
| 4019 |
margin: "5px 0" |
| 4020 |
} |
| 4021 |
// size={[20]} |
| 4022 |
}, /*#__PURE__*/React.createElement("span", null, item === null || item === void 0 ? void 0 : (_item$start = item.start) === null || _item$start === void 0 ? void 0 : _item$start.label), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("span", null, item === null || item === void 0 ? void 0 : (_item$end = item.end) === null || _item$end === void 0 ? void 0 : _item$end.label))); |
| 4023 |
}) : /*#__PURE__*/React.createElement("span", { |
| 4024 |
style: { |
| 4025 |
color: "#aeb0b3" |
| 4026 |
} |
| 4027 |
}, __("Unavailable", "timetics"))), /*#__PURE__*/React.createElement(Col, { |
| 4028 |
span: 4, |
| 4029 |
align: "right" |
| 4030 |
}))); |
| 4031 |
} |
| 4032 |
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(Row, { |
| 4033 |
gutter: [16, 24] |
| 4034 |
}, /*#__PURE__*/React.createElement(Col, { |
| 4035 |
xs: { |
| 4036 |
span: 12, |
| 4037 |
order: 1 |
| 4038 |
}, |
| 4039 |
sm: 6 |
| 4040 |
}, /*#__PURE__*/React.createElement(Checkbox, { |
| 4041 |
onChange: function onChange(e) { |
| 4042 |
_onChange(e, { |
| 4043 |
schedule: schedule, |
| 4044 |
scheduleIndex: scheduleIndex |
| 4045 |
}); |
| 4046 |
}, |
| 4047 |
checked: schedule.status |
| 4048 |
}, schedule.key)), /*#__PURE__*/React.createElement(Col, { |
| 4049 |
xs: { |
| 4050 |
span: 20, |
| 4051 |
offset: 2, |
| 4052 |
order: 3 |
| 4053 |
}, |
| 4054 |
sm: { |
| 4055 |
span: 14, |
| 4056 |
offset: 0, |
| 4057 |
order: 2 |
| 4058 |
} |
| 4059 |
}, schedule.status == true ? schedule === null || schedule === void 0 ? void 0 : (_schedule$schedules2 = schedule.schedules) === null || _schedule$schedules2 === void 0 ? void 0 : _schedule$schedules2.map(function (item, i) { |
| 4060 |
var _timeCompareError$wit, _item$start2, _timeCompareError$wit2, _timeCompareError$wit3; |
| 4061 |
// console.log("item: ", item); |
| 4062 |
return /*#__PURE__*/React.createElement(React.Fragment, { |
| 4063 |
key: "".concat(i, "-single-schedule-time-slot") |
| 4064 |
}, /*#__PURE__*/React.createElement(Space, { |
| 4065 |
key: "schedule-time-slot-".concat(i), |
| 4066 |
style: { |
| 4067 |
margin: "5px 0" |
| 4068 |
}, |
| 4069 |
size: [20] |
| 4070 |
}, /*#__PURE__*/React.createElement(Select, { |
| 4071 |
showSearch: true, |
| 4072 |
placeholder: "Select a time", |
| 4073 |
optionFilterProp: "children", |
| 4074 |
onChange: function onChange(value) { |
| 4075 |
var _getTimeOptions; |
| 4076 |
onSelectTime({ |
| 4077 |
value: (_getTimeOptions = (0,_utils_dummyData__WEBPACK_IMPORTED_MODULE_3__/* .getTimeOptions */ .wU)({ |
| 4078 |
startTime: startTime, |
| 4079 |
endTime: endTime, |
| 4080 |
duration: timeInterval |
| 4081 |
})) === null || _getTimeOptions === void 0 ? void 0 : _getTimeOptions.find(function (el) { |
| 4082 |
return el.value == value; |
| 4083 |
}), |
| 4084 |
key: "start", |
| 4085 |
scheduleIndex: scheduleIndex, |
| 4086 |
timeSlotIndex: i |
| 4087 |
}); |
| 4088 |
}, |
| 4089 |
onSearch: function onSearch(value) { |
| 4090 |
onSearchTime(value); |
| 4091 |
}, |
| 4092 |
filterOption: function filterOption(input, option) { |
| 4093 |
var _option$label; |
| 4094 |
return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : "").toLowerCase().includes(input.toLowerCase()); |
| 4095 |
}, |
| 4096 |
options: function () { |
| 4097 |
var _schedule$schedules$e; |
| 4098 |
return (0,_utils_dummyData__WEBPACK_IMPORTED_MODULE_3__/* .getTimeOptions */ .wU)({ |
| 4099 |
startTime: i == 0 ? startTime : schedule === null || schedule === void 0 ? void 0 : (_schedule$schedules$e = schedule.schedules[i - 1].end) === null || _schedule$schedules$e === void 0 ? void 0 : _schedule$schedules$e.label, |
| 4100 |
endTime: endTime, |
| 4101 |
duration: timeInterval |
| 4102 |
}); |
| 4103 |
}(), |
| 4104 |
value: item === null || item === void 0 ? void 0 : item.start, |
| 4105 |
status: timeCompareError !== null && timeCompareError !== void 0 && timeCompareError.scheduleIndex.includes(scheduleIndex) && timeCompareError !== null && timeCompareError !== void 0 && (_timeCompareError$wit = timeCompareError["with"][scheduleIndex]) !== null && _timeCompareError$wit !== void 0 && _timeCompareError$wit.includes(i) ? "error" : "" |
| 4106 |
}), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement(Select, { |
| 4107 |
showSearch: true, |
| 4108 |
placeholder: "Select a time", |
| 4109 |
optionFilterProp: "children", |
| 4110 |
onChange: function onChange(value) { |
| 4111 |
var _getTimeOptions2; |
| 4112 |
onSelectTime({ |
| 4113 |
value: (_getTimeOptions2 = (0,_utils_dummyData__WEBPACK_IMPORTED_MODULE_3__/* .getTimeOptions */ .wU)({ |
| 4114 |
startTime: startTime, |
| 4115 |
endTime: endTime, |
| 4116 |
duration: timeInterval |
| 4117 |
})) === null || _getTimeOptions2 === void 0 ? void 0 : _getTimeOptions2.find(function (el) { |
| 4118 |
return el.value == value; |
| 4119 |
}), |
| 4120 |
key: "end", |
| 4121 |
scheduleIndex: scheduleIndex, |
| 4122 |
timeSlotIndex: i |
| 4123 |
}); |
| 4124 |
}, |
| 4125 |
onSearch: function onSearch(value) { |
| 4126 |
onSearchTime(value); |
| 4127 |
}, |
| 4128 |
filterOption: function filterOption(input, option) { |
| 4129 |
var _option$label2; |
| 4130 |
return ((_option$label2 = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label2 !== void 0 ? _option$label2 : "").toLowerCase().includes(input.toLowerCase()); |
| 4131 |
}, |
| 4132 |
options: (0,_utils_dummyData__WEBPACK_IMPORTED_MODULE_3__/* .getTimeOptions */ .wU)({ |
| 4133 |
startTime: item === null || item === void 0 ? void 0 : (_item$start2 = item.start) === null || _item$start2 === void 0 ? void 0 : _item$start2.label, |
| 4134 |
endTime: endTime, |
| 4135 |
duration: timeInterval |
| 4136 |
}), |
| 4137 |
value: item === null || item === void 0 ? void 0 : item.end, |
| 4138 |
status: timeCompareError !== null && timeCompareError !== void 0 && timeCompareError.scheduleIndex.includes(scheduleIndex) && timeCompareError !== null && timeCompareError !== void 0 && (_timeCompareError$wit2 = timeCompareError["with"][scheduleIndex]) !== null && _timeCompareError$wit2 !== void 0 && _timeCompareError$wit2.includes(i) ? "error" : "" |
| 4139 |
}), /*#__PURE__*/React.createElement(_TooltipText__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, { |
| 4140 |
text: "Remove time slot", |
| 4141 |
placement: "top" |
| 4142 |
}, /*#__PURE__*/React.createElement("span", { |
| 4143 |
style: { |
| 4144 |
cursor: "pointer" |
| 4145 |
}, |
| 4146 |
onClick: function onClick() { |
| 4147 |
deleteScheduleDay({ |
| 4148 |
schedule: schedule, |
| 4149 |
scheduleIndex: scheduleIndex, |
| 4150 |
timeSlot: item, |
| 4151 |
timeSlotIndex: i |
| 4152 |
}); |
| 4153 |
} |
| 4154 |
}, /*#__PURE__*/React.createElement(_common_icons_Icons__WEBPACK_IMPORTED_MODULE_5__/* .DeleteIcon */ .pJ, { |
| 4155 |
color: "#0A1018" |
| 4156 |
})))), (timeCompareError === null || timeCompareError === void 0 ? void 0 : timeCompareError.scheduleIndex.includes(scheduleIndex)) && (timeCompareError === null || timeCompareError === void 0 ? void 0 : (_timeCompareError$wit3 = timeCompareError["with"][scheduleIndex]) === null || _timeCompareError$wit3 === void 0 ? void 0 : _timeCompareError$wit3.includes(i)) && /*#__PURE__*/React.createElement("p", { |
| 4157 |
className: "tt-schedule-time-slot-error-msg", |
| 4158 |
key: "schedule-time-slot-error-msg-".concat(i), |
| 4159 |
style: { |
| 4160 |
margin: "0", |
| 4161 |
color: "red" |
| 4162 |
} |
| 4163 |
}, __("Time conflict.", "timetics"))); |
| 4164 |
}) : /*#__PURE__*/React.createElement("span", { |
| 4165 |
style: { |
| 4166 |
color: "#aeb0b3" |
| 4167 |
} |
| 4168 |
}, __("Unavailable", "timetics"))), /*#__PURE__*/React.createElement(Col, { |
| 4169 |
xs: { |
| 4170 |
span: 12, |
| 4171 |
order: 2 |
| 4172 |
}, |
| 4173 |
sm: { |
| 4174 |
span: 4, |
| 4175 |
order: 3 |
| 4176 |
}, |
| 4177 |
align: "right" |
| 4178 |
}, /*#__PURE__*/React.createElement(_TooltipText__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, { |
| 4179 |
text: "Add new time slot", |
| 4180 |
placement: "top" |
| 4181 |
}, /*#__PURE__*/React.createElement("span", { |
| 4182 |
style: { |
| 4183 |
cursor: "pointer" |
| 4184 |
}, |
| 4185 |
onClick: function onClick() { |
| 4186 |
addScheduleDay({ |
| 4187 |
schedule: schedule, |
| 4188 |
scheduleIndex: scheduleIndex |
| 4189 |
}); |
| 4190 |
} |
| 4191 |
}, /*#__PURE__*/React.createElement(_common_icons_Icons__WEBPACK_IMPORTED_MODULE_5__/* .AddIcon */ .dt, null)))))); |
| 4192 |
} |
| 4193 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SingleDaySchedule); |
| 4194 |
|
| 4195 |
/***/ }), |
| 4196 |
|
| 4197 |
/***/ 8854: |
| 4198 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4199 |
|
| 4200 |
"use strict"; |
| 4201 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 4202 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 4203 |
/* harmony export */ }); |
| 4204 |
var Tooltip = window.antd.Tooltip; |
| 4205 |
var __ = wp.i18n.__; |
| 4206 |
function TooltipText(_ref) { |
| 4207 |
var placement = _ref.placement, |
| 4208 |
text = _ref.text, |
| 4209 |
children = _ref.children; |
| 4210 |
return /*#__PURE__*/React.createElement(Tooltip, { |
| 4211 |
placement: placement, |
| 4212 |
title: text, |
| 4213 |
overlayClassName: "tt-tooltip-card" |
| 4214 |
}, children); |
| 4215 |
} |
| 4216 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TooltipText); |
| 4217 |
|
| 4218 |
/***/ }), |
| 4219 |
|
| 4220 |
/***/ 7258: |
| 4221 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4222 |
|
| 4223 |
"use strict"; |
| 4224 |
|
| 4225 |
// EXPORTS |
| 4226 |
__webpack_require__.d(__webpack_exports__, { |
| 4227 |
"Z": () => (/* binding */ provider), |
| 4228 |
"K": () => (/* binding */ useStateValue) |
| 4229 |
}); |
| 4230 |
|
| 4231 |
// EXTERNAL MODULE: ./assets/src/admin/actionCreators/actions.js |
| 4232 |
var actions = __webpack_require__(3632); |
| 4233 |
;// CONCATENATED MODULE: ./assets/src/admin/reducers/meetingReducer.js |
| 4234 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } |
| 4235 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 4236 |
function _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); } |
| 4237 |
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } |
| 4238 |
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
| 4239 |
function _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; } |
| 4240 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 4241 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 4242 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 4243 |
|
| 4244 |
var demo = "demo"; |
| 4245 |
var meetingReducer = function meetingReducer(state, action) { |
| 4246 |
switch (action.type) { |
| 4247 |
case actions/* actions.SET_LOADING */.N.SET_LOADING: |
| 4248 |
{ |
| 4249 |
var payload = action.payload; |
| 4250 |
return _objectSpread(_objectSpread({}, state), {}, { |
| 4251 |
loading: payload |
| 4252 |
}); |
| 4253 |
} |
| 4254 |
case actions/* actions.SET_STATE */.N.SET_STATE: |
| 4255 |
{ |
| 4256 |
var field = action.field, |
| 4257 |
_payload = action.payload; |
| 4258 |
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, field, _payload)); |
| 4259 |
} |
| 4260 |
case actions/* actions.SET_MEETINGS */.N.SET_MEETINGS: |
| 4261 |
{ |
| 4262 |
var _payload2 = action.payload; |
| 4263 |
return _objectSpread(_objectSpread({}, state), {}, { |
| 4264 |
meetings: _payload2, |
| 4265 |
loading: false |
| 4266 |
}); |
| 4267 |
} |
| 4268 |
case actions/* actions.SET_MEETINGS_PAGINATION_DATA */.N.SET_MEETINGS_PAGINATION_DATA: |
| 4269 |
{ |
| 4270 |
var _payload3 = action.payload; |
| 4271 |
return _objectSpread(_objectSpread({}, state), _payload3); |
| 4272 |
} |
| 4273 |
case actions/* actions.SET_MEETINGS_AFTER_DELETE */.N.SET_MEETINGS_AFTER_DELETE: |
| 4274 |
{ |
| 4275 |
var _payload4 = action.payload; |
| 4276 |
var _meetings = getFilterdMeetings(state.meetings, _payload4); |
| 4277 |
return _objectSpread(_objectSpread({}, state), {}, { |
| 4278 |
meetings: _meetings |
| 4279 |
}); |
| 4280 |
} |
| 4281 |
case actions/* actions.SET_MEETINGS_AFTER_DUPLICATE */.N.SET_MEETINGS_AFTER_DUPLICATE: |
| 4282 |
{ |
| 4283 |
var _payload5 = action.payload; |
| 4284 |
return _objectSpread(_objectSpread({}, state), {}, { |
| 4285 |
meetings: [_payload5].concat(_toConsumableArray(state.meetings)) |
| 4286 |
}); |
| 4287 |
} |
| 4288 |
case actions/* actions.SET_META_DATA_WITH_MEETING */.N.SET_META_DATA_WITH_MEETING: |
| 4289 |
{ |
| 4290 |
var _payload6 = action.payload; |
| 4291 |
return _objectSpread(_objectSpread({}, state), _payload6); |
| 4292 |
} |
| 4293 |
case actions/* actions.CLEAR_MEETING_DATA_FOR_UPDATE */.N.CLEAR_MEETING_DATA_FOR_UPDATE: |
| 4294 |
{ |
| 4295 |
var _payload7 = action.payload; |
| 4296 |
return _objectSpread(_objectSpread({}, state), {}, { |
| 4297 |
meeting: null, |
| 4298 |
meetingId: null, |
| 4299 |
schedules: null, |
| 4300 |
selectedStaff: null, |
| 4301 |
selectedStaffIds: null |
| 4302 |
}); |
| 4303 |
} |
| 4304 |
default: |
| 4305 |
return state; |
| 4306 |
} |
| 4307 |
}; |
| 4308 |
function getFilterdMeetings(meetings, payload) { |
| 4309 |
return _toConsumableArray(meetings).filter(function (item) { |
| 4310 |
return item.id !== payload; |
| 4311 |
}); |
| 4312 |
} |
| 4313 |
;// CONCATENATED MODULE: ./assets/src/admin/reducers/staffReducer.js |
| 4314 |
function staffReducer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 4315 |
function staffReducer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? staffReducer_ownKeys(Object(source), !0).forEach(function (key) { staffReducer_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : staffReducer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 4316 |
function staffReducer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 4317 |
|
| 4318 |
var staffReducer = function staffReducer(state, action) { |
| 4319 |
var field = action.field, |
| 4320 |
payload = action.payload; |
| 4321 |
switch (action.type) { |
| 4322 |
case actions/* actions.SET_STAFFS */.N.SET_STAFFS: |
| 4323 |
{ |
| 4324 |
return staffReducer_objectSpread(staffReducer_objectSpread({}, state), {}, { |
| 4325 |
staffs: payload |
| 4326 |
}); |
| 4327 |
} |
| 4328 |
case actions/* actions.SET_STAFF */.N.SET_STAFF: |
| 4329 |
{ |
| 4330 |
return staffReducer_objectSpread(staffReducer_objectSpread({}, state), {}, { |
| 4331 |
staff: payload |
| 4332 |
}); |
| 4333 |
} |
| 4334 |
case actions/* actions.SET_STAFF_SCHEDULE */.N.SET_STAFF_SCHEDULE: |
| 4335 |
{ |
| 4336 |
return staffReducer_objectSpread(staffReducer_objectSpread({}, state), {}, { |
| 4337 |
schedule: { |
| 4338 |
staff: payload |
| 4339 |
} |
| 4340 |
}); |
| 4341 |
} |
| 4342 |
default: |
| 4343 |
return state; |
| 4344 |
} |
| 4345 |
}; |
| 4346 |
;// CONCATENATED MODULE: ./assets/src/admin/reducers/bookingReducer.js |
| 4347 |
function bookingReducer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 4348 |
function bookingReducer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? bookingReducer_ownKeys(Object(source), !0).forEach(function (key) { bookingReducer_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : bookingReducer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 4349 |
function bookingReducer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 4350 |
|
| 4351 |
var bookingReducer = function bookingReducer(state, action) { |
| 4352 |
var field = action.field, |
| 4353 |
payload = action.payload; |
| 4354 |
switch (action.type) { |
| 4355 |
case actions/* actions.SET_BOOKINGS */.N.SET_BOOKINGS: |
| 4356 |
{ |
| 4357 |
return bookingReducer_objectSpread(bookingReducer_objectSpread({}, state), {}, { |
| 4358 |
bookings: payload |
| 4359 |
}); |
| 4360 |
} |
| 4361 |
case actions/* actions.SET_SELECTED_DATE */.N.SET_SELECTED_DATE: |
| 4362 |
{ |
| 4363 |
return bookingReducer_objectSpread(bookingReducer_objectSpread({}, state), payload); |
| 4364 |
} |
| 4365 |
case actions/* actions.SET_MEETING_TO_BOOK */.N.SET_MEETING_TO_BOOK: |
| 4366 |
{ |
| 4367 |
return bookingReducer_objectSpread(bookingReducer_objectSpread({}, state), payload); |
| 4368 |
} |
| 4369 |
case actions/* actions.SET_SELECTED_STAFF_ID_TO_BOOK */.N.SET_SELECTED_STAFF_ID_TO_BOOK: |
| 4370 |
{ |
| 4371 |
return bookingReducer_objectSpread(bookingReducer_objectSpread({}, state), payload); |
| 4372 |
} |
| 4373 |
case actions/* actions.SET_MEETING_SLOTS */.N.SET_MEETING_SLOTS: |
| 4374 |
{ |
| 4375 |
return bookingReducer_objectSpread(bookingReducer_objectSpread({}, state), payload); |
| 4376 |
} |
| 4377 |
case actions/* actions.SET_BOOKING_STATE */.N.SET_BOOKING_STATE: |
| 4378 |
{ |
| 4379 |
return bookingReducer_objectSpread(bookingReducer_objectSpread({}, state), payload); |
| 4380 |
} |
| 4381 |
case actions/* actions.CLEAR_BOOKING_RELATED_DATA */.N.CLEAR_BOOKING_RELATED_DATA: |
| 4382 |
{ |
| 4383 |
return bookingReducer_objectSpread(bookingReducer_objectSpread({}, state), {}, { |
| 4384 |
selectedDaysSlots: [], |
| 4385 |
slots: {}, |
| 4386 |
selectedMeetingId: null, |
| 4387 |
meetingToBook: null, |
| 4388 |
staffsOfMeetingToBook: [], |
| 4389 |
meetingStaffs: [], |
| 4390 |
selectedStaffIdToBook: null, |
| 4391 |
unavailableDayNumber: [], |
| 4392 |
selectedDay: null, |
| 4393 |
selectedDate: null |
| 4394 |
}, payload); |
| 4395 |
} |
| 4396 |
default: |
| 4397 |
return state; |
| 4398 |
} |
| 4399 |
}; |
| 4400 |
;// CONCATENATED MODULE: ./assets/src/admin/reducers/customerReducer.js |
| 4401 |
function customerReducer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 4402 |
function customerReducer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? customerReducer_ownKeys(Object(source), !0).forEach(function (key) { customerReducer_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : customerReducer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 4403 |
function customerReducer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 4404 |
|
| 4405 |
var customerReducer = function customerReducer(state, action) { |
| 4406 |
var field = action.field, |
| 4407 |
payload = action.payload; |
| 4408 |
switch (action.type) { |
| 4409 |
case actions/* actions.SET_CUSTOMERS */.N.SET_CUSTOMERS: |
| 4410 |
{ |
| 4411 |
return customerReducer_objectSpread(customerReducer_objectSpread({}, state), {}, { |
| 4412 |
customers: payload |
| 4413 |
}); |
| 4414 |
} |
| 4415 |
default: |
| 4416 |
return state; |
| 4417 |
} |
| 4418 |
}; |
| 4419 |
;// CONCATENATED MODULE: ./assets/src/admin/reducers/settingsReducer.js |
| 4420 |
function settingsReducer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 4421 |
function settingsReducer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? settingsReducer_ownKeys(Object(source), !0).forEach(function (key) { settingsReducer_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : settingsReducer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 4422 |
function settingsReducer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 4423 |
|
| 4424 |
var settingsReducer = function settingsReducer(state, action) { |
| 4425 |
var field = action.field, |
| 4426 |
payload = action.payload; |
| 4427 |
switch (action.type) { |
| 4428 |
case actions/* actions.SET_SETTINGS_LOADING */.N.SET_SETTINGS_LOADING: |
| 4429 |
{ |
| 4430 |
return settingsReducer_objectSpread(settingsReducer_objectSpread({}, state), {}, { |
| 4431 |
loading: payload |
| 4432 |
}); |
| 4433 |
} |
| 4434 |
case actions/* actions.SET_SETTINGS */.N.SET_SETTINGS: |
| 4435 |
{ |
| 4436 |
return settingsReducer_objectSpread(settingsReducer_objectSpread({}, state), {}, { |
| 4437 |
settings: settingsReducer_objectSpread(settingsReducer_objectSpread({}, state === null || state === void 0 ? void 0 : state.settings), payload) |
| 4438 |
}); |
| 4439 |
} |
| 4440 |
case actions/* actions.SET_EMAIL_CUSTOMIZE_DATA */.N.SET_EMAIL_CUSTOMIZE_DATA: |
| 4441 |
{ |
| 4442 |
var _payload = action.payload; |
| 4443 |
return settingsReducer_objectSpread(settingsReducer_objectSpread({}, state), _payload); |
| 4444 |
} |
| 4445 |
case actions/* actions.SET_SETTINGS_SCHEDULE */.N.SET_SETTINGS_SCHEDULE: |
| 4446 |
{ |
| 4447 |
return settingsReducer_objectSpread(settingsReducer_objectSpread({}, state), {}, { |
| 4448 |
settings: settingsReducer_objectSpread(settingsReducer_objectSpread({}, state.settings), {}, { |
| 4449 |
availability: payload |
| 4450 |
}) |
| 4451 |
}); |
| 4452 |
} |
| 4453 |
case actions/* actions.SET_SETTINGS_CURRENCY */.N.SET_SETTINGS_CURRENCY: |
| 4454 |
{ |
| 4455 |
return settingsReducer_objectSpread(settingsReducer_objectSpread({}, state), {}, { |
| 4456 |
settings: settingsReducer_objectSpread(settingsReducer_objectSpread({}, state.settings), payload) |
| 4457 |
}); |
| 4458 |
} |
| 4459 |
case actions/* actions.SET_SETTINGS_COLOR */.N.SET_SETTINGS_COLOR: |
| 4460 |
{ |
| 4461 |
return settingsReducer_objectSpread(settingsReducer_objectSpread({}, state), {}, { |
| 4462 |
settings: settingsReducer_objectSpread(settingsReducer_objectSpread({}, state.settings), payload) |
| 4463 |
}); |
| 4464 |
} |
| 4465 |
default: |
| 4466 |
return state; |
| 4467 |
} |
| 4468 |
}; |
| 4469 |
;// CONCATENATED MODULE: ./assets/src/admin/reducers/seatsReducer.js |
| 4470 |
function seatsReducer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 4471 |
function seatsReducer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? seatsReducer_ownKeys(Object(source), !0).forEach(function (key) { seatsReducer_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : seatsReducer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 4472 |
function seatsReducer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 4473 |
|
| 4474 |
var seatsReducer = function seatsReducer(state, action) { |
| 4475 |
var field = action.field, |
| 4476 |
payload = action.payload; |
| 4477 |
switch (action.type) { |
| 4478 |
case actions/* actions.SET_SEATS */.N.SET_SEATS: |
| 4479 |
{ |
| 4480 |
return seatsReducer_objectSpread(seatsReducer_objectSpread({}, state), payload); |
| 4481 |
} |
| 4482 |
case actions/* actions.SET_SEAT_REDUCER_STATE */.N.SET_SEAT_REDUCER_STATE: |
| 4483 |
{ |
| 4484 |
return seatsReducer_objectSpread(seatsReducer_objectSpread({}, state), payload); |
| 4485 |
} |
| 4486 |
default: |
| 4487 |
return state; |
| 4488 |
} |
| 4489 |
}; |
| 4490 |
;// CONCATENATED MODULE: ./assets/src/admin/reducers/index.js |
| 4491 |
|
| 4492 |
|
| 4493 |
|
| 4494 |
|
| 4495 |
|
| 4496 |
|
| 4497 |
var mainReducer = function mainReducer(_ref, action) { |
| 4498 |
var _wp, _wp$hooks; |
| 4499 |
var meeting = _ref.meeting, |
| 4500 |
staff = _ref.staff, |
| 4501 |
booking = _ref.booking, |
| 4502 |
customers = _ref.customers, |
| 4503 |
settings = _ref.settings, |
| 4504 |
seats = _ref.seats; |
| 4505 |
var _reducers = { |
| 4506 |
meeting: meetingReducer(meeting, action), |
| 4507 |
staff: staffReducer(staff, action), |
| 4508 |
booking: bookingReducer(booking, action), |
| 4509 |
customers: customerReducer(customers, action), |
| 4510 |
settings: settingsReducer(settings, action), |
| 4511 |
seats: seatsReducer(seats, action) |
| 4512 |
}; |
| 4513 |
var reducers = (_wp = wp) === null || _wp === void 0 ? void 0 : (_wp$hooks = _wp.hooks) === null || _wp$hooks === void 0 ? void 0 : _wp$hooks.applyFilters("timetics_reducer", _reducers, {}, action); |
| 4514 |
return reducers; |
| 4515 |
}; |
| 4516 |
/* harmony default export */ const reducers = (mainReducer); |
| 4517 |
;// CONCATENATED MODULE: ./assets/src/admin/context/createContext.js |
| 4518 |
var React = window.React; |
| 4519 |
var createContext = React.createContext; |
| 4520 |
var TimeTicsContext = createContext(); |
| 4521 |
;// CONCATENATED MODULE: ./assets/src/admin/context/state.js |
| 4522 |
var initialState = { |
| 4523 |
staff: { |
| 4524 |
staff: {} |
| 4525 |
}, |
| 4526 |
meeting: { |
| 4527 |
meetingType: "One-to-One", |
| 4528 |
meetingTitle: "Create One-on-One Meeting", |
| 4529 |
per_page: 9, |
| 4530 |
paged: 1, |
| 4531 |
totalItems: 0, |
| 4532 |
addressType: [], |
| 4533 |
meetingDuration: 60, |
| 4534 |
//meetingDuration should be in min |
| 4535 |
meetingBufferTime: 1, |
| 4536 |
//meetingDuration should be in min |
| 4537 |
loading: false, |
| 4538 |
booking_reminder_time_value: "1", |
| 4539 |
booking_reminder_time_key: "hour", |
| 4540 |
timeCompareError: { |
| 4541 |
hasError: false, |
| 4542 |
scheduleIndex: [], |
| 4543 |
"with": {} |
| 4544 |
} |
| 4545 |
}, |
| 4546 |
booking: {}, |
| 4547 |
customers: {}, |
| 4548 |
settings: {}, |
| 4549 |
seats: { |
| 4550 |
object_color: "" |
| 4551 |
} |
| 4552 |
}; |
| 4553 |
|
| 4554 |
;// CONCATENATED MODULE: ./assets/src/admin/context/provider.js |
| 4555 |
var _wp; |
| 4556 |
var provider_React = window.React; |
| 4557 |
var useContext = provider_React.useContext, |
| 4558 |
useReducer = provider_React.useReducer; |
| 4559 |
|
| 4560 |
|
| 4561 |
|
| 4562 |
var _wp$hooks = (_wp = wp) === null || _wp === void 0 ? void 0 : _wp.hooks, |
| 4563 |
applyFilters = _wp$hooks.applyFilters; |
| 4564 |
|
| 4565 |
var TimeTicsProvider = function TimeTicsProvider(_ref) { |
| 4566 |
var children = _ref.children; |
| 4567 |
return /*#__PURE__*/provider_React.createElement(TimeTicsContext.Provider, { |
| 4568 |
value: useReducer(reducers, initialState) |
| 4569 |
}, children); |
| 4570 |
}; |
| 4571 |
var useStateValue = function useStateValue() { |
| 4572 |
return useContext(TimeTicsContext); |
| 4573 |
}; |
| 4574 |
TimeTicsProvider = applyFilters("timetics_ctx", TimeTicsProvider, useStateValue, actions/* actions */.N); |
| 4575 |
/* harmony default export */ const provider = (TimeTicsProvider); |
| 4576 |
|
| 4577 |
/***/ }), |
| 4578 |
|
| 4579 |
/***/ 8188: |
| 4580 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4581 |
|
| 4582 |
"use strict"; |
| 4583 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 4584 |
/* harmony export */ "E": () => (/* binding */ createMeetingHandler), |
| 4585 |
/* harmony export */ "N": () => (/* binding */ updateMeetingHandler) |
| 4586 |
/* harmony export */ }); |
| 4587 |
/* harmony import */ var _services_meetings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3538); |
| 4588 |
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } |
| 4589 |
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
| 4590 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 4591 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 4592 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 4593 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
| 4594 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
| 4595 |
|
| 4596 |
var updateMeetingHandler = /*#__PURE__*/function () { |
| 4597 |
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) { |
| 4598 |
var id, values, res; |
| 4599 |
return _regeneratorRuntime().wrap(function _callee$(_context) { |
| 4600 |
while (1) { |
| 4601 |
switch (_context.prev = _context.next) { |
| 4602 |
case 0: |
| 4603 |
id = _ref.id, values = _ref.values; |
| 4604 |
_context.prev = 1; |
| 4605 |
_context.next = 4; |
| 4606 |
return (0,_services_meetings__WEBPACK_IMPORTED_MODULE_0__/* .updateMeeting */ .$Z)({ |
| 4607 |
method: "PUT", |
| 4608 |
data: _objectSpread({}, values) |
| 4609 |
}, id); |
| 4610 |
case 4: |
| 4611 |
res = _context.sent; |
| 4612 |
_context.next = 10; |
| 4613 |
break; |
| 4614 |
case 7: |
| 4615 |
_context.prev = 7; |
| 4616 |
_context.t0 = _context["catch"](1); |
| 4617 |
res = _context.t0; |
| 4618 |
case 10: |
| 4619 |
return _context.abrupt("return", res); |
| 4620 |
case 11: |
| 4621 |
case "end": |
| 4622 |
return _context.stop(); |
| 4623 |
} |
| 4624 |
} |
| 4625 |
}, _callee, null, [[1, 7]]); |
| 4626 |
})); |
| 4627 |
return function updateMeetingHandler(_x) { |
| 4628 |
return _ref2.apply(this, arguments); |
| 4629 |
}; |
| 4630 |
}(); |
| 4631 |
var createMeetingHandler = /*#__PURE__*/function () { |
| 4632 |
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3) { |
| 4633 |
var values, type, res; |
| 4634 |
return _regeneratorRuntime().wrap(function _callee2$(_context2) { |
| 4635 |
while (1) { |
| 4636 |
switch (_context2.prev = _context2.next) { |
| 4637 |
case 0: |
| 4638 |
values = _ref3.values, type = _ref3.type; |
| 4639 |
_context2.prev = 1; |
| 4640 |
_context2.next = 4; |
| 4641 |
return (0,_services_meetings__WEBPACK_IMPORTED_MODULE_0__/* .createMeeting */ .gJ)({ |
| 4642 |
method: "POST", |
| 4643 |
data: _objectSpread(_objectSpread({}, values), {}, { |
| 4644 |
type: type |
| 4645 |
}) |
| 4646 |
}); |
| 4647 |
case 4: |
| 4648 |
res = _context2.sent; |
| 4649 |
_context2.next = 10; |
| 4650 |
break; |
| 4651 |
case 7: |
| 4652 |
_context2.prev = 7; |
| 4653 |
_context2.t0 = _context2["catch"](1); |
| 4654 |
res = _context2.t0; |
| 4655 |
case 10: |
| 4656 |
return _context2.abrupt("return", res); |
| 4657 |
case 11: |
| 4658 |
case "end": |
| 4659 |
return _context2.stop(); |
| 4660 |
} |
| 4661 |
} |
| 4662 |
}, _callee2, null, [[1, 7]]); |
| 4663 |
})); |
| 4664 |
return function createMeetingHandler(_x2) { |
| 4665 |
return _ref4.apply(this, arguments); |
| 4666 |
}; |
| 4667 |
}(); |
| 4668 |
|
| 4669 |
/***/ }), |
| 4670 |
|
| 4671 |
/***/ 7026: |
| 4672 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4673 |
|
| 4674 |
"use strict"; |
| 4675 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 4676 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 4677 |
/* harmony export */ }); |
| 4678 |
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9250); |
| 4679 |
/* harmony import */ var _helper_availabilityModel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2758); |
| 4680 |
/* harmony import */ var _actionCreators_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7157); |
| 4681 |
/* harmony import */ var _actionCreators_meeting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(629); |
| 4682 |
/* harmony import */ var _context_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7258); |
| 4683 |
/* harmony import */ var _libs_meetingLib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8188); |
| 4684 |
/* harmony import */ var _services_meetings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3538); |
| 4685 |
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } |
| 4686 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } |
| 4687 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 4688 |
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } |
| 4689 |
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
| 4690 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 4691 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 4692 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 4693 |
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
| 4694 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
| 4695 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
| 4696 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 4697 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 4698 |
function _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); } |
| 4699 |
function _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; } |
| 4700 |
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 4701 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 4702 |
|
| 4703 |
|
| 4704 |
|
| 4705 |
|
| 4706 |
|
| 4707 |
|
| 4708 |
|
| 4709 |
function useMeetings() { |
| 4710 |
var _useStateValue = (0,_context_provider__WEBPACK_IMPORTED_MODULE_3__/* .useStateValue */ .K)(), |
| 4711 |
_useStateValue2 = _slicedToArray(_useStateValue, 2), |
| 4712 |
_useStateValue2$ = _useStateValue2[0], |
| 4713 |
meetingReducer = _useStateValue2$.meeting, |
| 4714 |
staffReducer = _useStateValue2$.staff, |
| 4715 |
settingsReducer = _useStateValue2$.settings, |
| 4716 |
dispatch = _useStateValue2[1]; |
| 4717 |
var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_6__/* .useNavigate */ .s0)(); |
| 4718 |
var per_page = meetingReducer.per_page, |
| 4719 |
paged = meetingReducer.paged, |
| 4720 |
timeCompareError = meetingReducer.timeCompareError, |
| 4721 |
_meetingReducer$meeti = meetingReducer.meetingCustom, |
| 4722 |
meetingCustom = _meetingReducer$meeti === void 0 ? false : _meetingReducer$meeti, |
| 4723 |
_meetingReducer$meeti2 = meetingReducer.meetingCustomValue, |
| 4724 |
meetingCustomValue = _meetingReducer$meeti2 === void 0 ? "" : _meetingReducer$meeti2, |
| 4725 |
meetingCustomTime = meetingReducer.meetingCustomTime, |
| 4726 |
_meetingReducer$selec = meetingReducer.selectedStaffIds, |
| 4727 |
selectedStaffIds = _meetingReducer$selec === void 0 ? [] : _meetingReducer$selec, |
| 4728 |
schedules = meetingReducer.schedules, |
| 4729 |
meetingType = meetingReducer.meetingType, |
| 4730 |
booking_reminder_time = meetingReducer.booking_reminder_time, |
| 4731 |
booking_reminder_time_key = meetingReducer.booking_reminder_time_key, |
| 4732 |
booking_reminder_time_value = meetingReducer.booking_reminder_time_value; |
| 4733 |
var staffs = staffReducer.staffs; |
| 4734 |
var _settingsReducer$sett = settingsReducer.settings, |
| 4735 |
settings = _settingsReducer$sett === void 0 ? {} : _settingsReducer$sett; |
| 4736 |
var availability = settings.availability; |
| 4737 |
var getMeetings = /*#__PURE__*/function () { |
| 4738 |
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) { |
| 4739 |
var _res$data, _res$data2, _res$data2$data; |
| 4740 |
var page, res, data, items; |
| 4741 |
return _regeneratorRuntime().wrap(function _callee$(_context) { |
| 4742 |
while (1) { |
| 4743 |
switch (_context.prev = _context.next) { |
| 4744 |
case 0: |
| 4745 |
page = _ref.page; |
| 4746 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 4747 |
dispatch: dispatch, |
| 4748 |
name: "loading", |
| 4749 |
value: true |
| 4750 |
}); |
| 4751 |
_context.next = 4; |
| 4752 |
return (0,_services_meetings__WEBPACK_IMPORTED_MODULE_5__/* .getAllMeetings */ .MY)({ |
| 4753 |
method: "GET", |
| 4754 |
params: { |
| 4755 |
per_page: per_page, |
| 4756 |
paged: page || paged |
| 4757 |
} |
| 4758 |
}); |
| 4759 |
case 4: |
| 4760 |
res = _context.sent; |
| 4761 |
data = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data; |
| 4762 |
items = res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$data = _res$data2.data) === null || _res$data2$data === void 0 ? void 0 : _res$data2$data.items; |
| 4763 |
(0,_actionCreators_meeting__WEBPACK_IMPORTED_MODULE_2__/* .setMeetings */ .I)({ |
| 4764 |
dispatch: dispatch, |
| 4765 |
value: items |
| 4766 |
}); |
| 4767 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 4768 |
dispatch: dispatch, |
| 4769 |
name: "totalItems", |
| 4770 |
value: data === null || data === void 0 ? void 0 : data.total |
| 4771 |
}); |
| 4772 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 4773 |
dispatch: dispatch, |
| 4774 |
name: "loading", |
| 4775 |
value: false |
| 4776 |
}); |
| 4777 |
case 10: |
| 4778 |
case "end": |
| 4779 |
return _context.stop(); |
| 4780 |
} |
| 4781 |
} |
| 4782 |
}, _callee); |
| 4783 |
})); |
| 4784 |
return function getMeetings(_x) { |
| 4785 |
return _ref2.apply(this, arguments); |
| 4786 |
}; |
| 4787 |
}(); |
| 4788 |
|
| 4789 |
/** |
| 4790 |
*Handler for delete meeting |
| 4791 |
* @param {Event} e js Event Object. |
| 4792 |
* @param {Object} meeting single meeting object. |
| 4793 |
*/ |
| 4794 |
var buldDeleteMeetingHandler = /*#__PURE__*/function () { |
| 4795 |
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, ids) { |
| 4796 |
var res; |
| 4797 |
return _regeneratorRuntime().wrap(function _callee2$(_context2) { |
| 4798 |
while (1) { |
| 4799 |
switch (_context2.prev = _context2.next) { |
| 4800 |
case 0: |
| 4801 |
_context2.next = 2; |
| 4802 |
return (0,_services_meetings__WEBPACK_IMPORTED_MODULE_5__/* .buldDeleteMeeting */ .kM)({ |
| 4803 |
method: "DELETE", |
| 4804 |
data: ids |
| 4805 |
}); |
| 4806 |
case 2: |
| 4807 |
res = _context2.sent; |
| 4808 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 4809 |
dispatch: dispatch, |
| 4810 |
name: "selectedMeetings", |
| 4811 |
value: [] |
| 4812 |
}); |
| 4813 |
getMeetings({ |
| 4814 |
page: paged |
| 4815 |
}); |
| 4816 |
case 5: |
| 4817 |
case "end": |
| 4818 |
return _context2.stop(); |
| 4819 |
} |
| 4820 |
} |
| 4821 |
}, _callee2); |
| 4822 |
})); |
| 4823 |
return function buldDeleteMeetingHandler(_x2, _x3) { |
| 4824 |
return _ref3.apply(this, arguments); |
| 4825 |
}; |
| 4826 |
}(); |
| 4827 |
/** |
| 4828 |
*Handler for clearing the array of ids of meeting in the context |
| 4829 |
* @param {Event} e js Event Object. |
| 4830 |
*/ |
| 4831 |
var clearSelectedMeetings = function clearSelectedMeetings(e) { |
| 4832 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 4833 |
dispatch: dispatch, |
| 4834 |
name: "selectedMeetings", |
| 4835 |
value: [] |
| 4836 |
}); |
| 4837 |
}; |
| 4838 |
/** |
| 4839 |
*Handler for selecting all meetings for delete |
| 4840 |
* @param {Event} e js Event Object. |
| 4841 |
* @param {Array} meetingIds array of ids for delete multiple meetings |
| 4842 |
*/ |
| 4843 |
var selectAllMeetings = function selectAllMeetings(e, ids) { |
| 4844 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 4845 |
dispatch: dispatch, |
| 4846 |
name: "selectedMeetings", |
| 4847 |
value: ids |
| 4848 |
}); |
| 4849 |
}; |
| 4850 |
|
| 4851 |
/** |
| 4852 |
* Handler for Form submit when it's success |
| 4853 |
* @param {Object} values ALl the values of Form |
| 4854 |
*/ |
| 4855 |
var onFinish = /*#__PURE__*/function () { |
| 4856 |
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref4) { |
| 4857 |
var values, id, _values, convertedSchedulesForApi, getSuccessData, res, _res, _res$data3, _res$data3$data, meetId; |
| 4858 |
return _regeneratorRuntime().wrap(function _callee3$(_context3) { |
| 4859 |
while (1) { |
| 4860 |
switch (_context3.prev = _context3.next) { |
| 4861 |
case 0: |
| 4862 |
values = _ref4.values, id = _ref4.id; |
| 4863 |
if (!(timeCompareError !== null && timeCompareError !== void 0 && timeCompareError.hasError || selectedStaffIds.length == 0)) { |
| 4864 |
_context3.next = 3; |
| 4865 |
break; |
| 4866 |
} |
| 4867 |
return _context3.abrupt("return", false); |
| 4868 |
case 3: |
| 4869 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 4870 |
dispatch: dispatch, |
| 4871 |
name: "loading", |
| 4872 |
value: true |
| 4873 |
}); |
| 4874 |
_values = _objectSpread(_objectSpread({}, values), {}, { |
| 4875 |
notifications: _objectSpread(_objectSpread({}, values.notifications), {}, { |
| 4876 |
booking_reminder_time: "".concat(booking_reminder_time_value, " ").concat(booking_reminder_time_key) |
| 4877 |
}) |
| 4878 |
}); |
| 4879 |
convertedSchedulesForApi = {}; |
| 4880 |
Object.keys(schedules).map(function (item) { |
| 4881 |
convertedSchedulesForApi[item] = (0,_helper_availabilityModel__WEBPACK_IMPORTED_MODULE_0__/* .convertSchedulesForApi */ .F6)(schedules[item]); |
| 4882 |
}); |
| 4883 |
getSuccessData = ""; |
| 4884 |
if (!id) { |
| 4885 |
_context3.next = 15; |
| 4886 |
break; |
| 4887 |
} |
| 4888 |
if (_values.duration == "custom") { |
| 4889 |
_values.duration = "".concat(meetingCustomValue, " ").concat(meetingCustomTime); |
| 4890 |
} |
| 4891 |
_context3.next = 12; |
| 4892 |
return (0,_libs_meetingLib__WEBPACK_IMPORTED_MODULE_4__/* .updateMeetingHandler */ .N)({ |
| 4893 |
id: id, |
| 4894 |
values: _objectSpread(_objectSpread({}, _values), {}, { |
| 4895 |
staff: selectedStaffIds, |
| 4896 |
schedule: convertedSchedulesForApi, |
| 4897 |
type: meetingType |
| 4898 |
}) |
| 4899 |
}); |
| 4900 |
case 12: |
| 4901 |
res = _context3.sent; |
| 4902 |
_context3.next = 20; |
| 4903 |
break; |
| 4904 |
case 15: |
| 4905 |
if (_values.duration == "custom") { |
| 4906 |
_values["duration"] = "".concat(meetingCustomValue, " ").concat(meetingCustomTime); |
| 4907 |
} |
| 4908 |
_context3.next = 18; |
| 4909 |
return (0,_libs_meetingLib__WEBPACK_IMPORTED_MODULE_4__/* .createMeetingHandler */ .E)({ |
| 4910 |
values: _objectSpread(_objectSpread({}, _values), {}, { |
| 4911 |
staff: selectedStaffIds, |
| 4912 |
schedule: convertedSchedulesForApi |
| 4913 |
}), |
| 4914 |
type: meetingReducer === null || meetingReducer === void 0 ? void 0 : meetingReducer.meetingType |
| 4915 |
}); |
| 4916 |
case 18: |
| 4917 |
_res = _context3.sent; |
| 4918 |
if (meetingType == "seat") { |
| 4919 |
meetId = _res === null || _res === void 0 ? void 0 : (_res$data3 = _res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$data = _res$data3.data) === null || _res$data3$data === void 0 ? void 0 : _res$data3$data.id; |
| 4920 |
if (meetId) { |
| 4921 |
navigate("/seats/".concat(meetId, "/create")); |
| 4922 |
} |
| 4923 |
} else { |
| 4924 |
navigate("/meetings"); |
| 4925 |
} |
| 4926 |
case 20: |
| 4927 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 4928 |
dispatch: dispatch, |
| 4929 |
name: "loading", |
| 4930 |
value: false |
| 4931 |
}); |
| 4932 |
case 21: |
| 4933 |
case "end": |
| 4934 |
return _context3.stop(); |
| 4935 |
} |
| 4936 |
} |
| 4937 |
}, _callee3); |
| 4938 |
})); |
| 4939 |
return function onFinish(_x4) { |
| 4940 |
return _ref5.apply(this, arguments); |
| 4941 |
}; |
| 4942 |
}(); |
| 4943 |
var getStaffsSchedule = function getStaffsSchedule(_ref6) { |
| 4944 |
var staffId = _ref6.staffId; |
| 4945 |
var _staffs = _toConsumableArray(staffs); |
| 4946 |
var staff = _staffs.find(function (item) { |
| 4947 |
return item.id == staffId; |
| 4948 |
}); |
| 4949 |
var schedule = staff.schedule; |
| 4950 |
if (Array.isArray(staff.schedule) && staff.schedule.length == 0) { |
| 4951 |
//TODO if schedule(availability) not available in settings then made it using dummySchedule helper function. |
| 4952 |
schedule = availability === null || availability === void 0 ? void 0 : availability.staff; |
| 4953 |
} |
| 4954 |
return schedule; |
| 4955 |
}; |
| 4956 |
return { |
| 4957 |
getMeetings: getMeetings, |
| 4958 |
buldDeleteMeetingHandler: buldDeleteMeetingHandler, |
| 4959 |
clearSelectedMeetings: clearSelectedMeetings, |
| 4960 |
selectAllMeetings: selectAllMeetings, |
| 4961 |
submitMeeting: onFinish, |
| 4962 |
getStaffsSchedule: getStaffsSchedule |
| 4963 |
}; |
| 4964 |
} |
| 4965 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useMeetings); |
| 4966 |
|
| 4967 |
/***/ }), |
| 4968 |
|
| 4969 |
/***/ 7004: |
| 4970 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4971 |
|
| 4972 |
"use strict"; |
| 4973 |
|
| 4974 |
// EXPORTS |
| 4975 |
__webpack_require__.d(__webpack_exports__, { |
| 4976 |
"Z": () => (/* binding */ steps_FirstStep) |
| 4977 |
}); |
| 4978 |
|
| 4979 |
;// CONCATENATED MODULE: ./assets/src/common/NumberInput.js |
| 4980 |
var _excluded = ["className", "name", "label", "required", "rules", "labelCol", "wrapperCol", "tooltip"]; |
| 4981 |
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } |
| 4982 |
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } |
| 4983 |
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } |
| 4984 |
var _window$antd = window.antd, |
| 4985 |
InputNumber = _window$antd.InputNumber, |
| 4986 |
Form = _window$antd.Form; |
| 4987 |
function NumberInput(_ref) { |
| 4988 |
var _ref$className = _ref.className, |
| 4989 |
className = _ref$className === void 0 ? "" : _ref$className, |
| 4990 |
name = _ref.name, |
| 4991 |
_ref$label = _ref.label, |
| 4992 |
label = _ref$label === void 0 ? "" : _ref$label, |
| 4993 |
_ref$required = _ref.required, |
| 4994 |
required = _ref$required === void 0 ? false : _ref$required, |
| 4995 |
_ref$rules = _ref.rules, |
| 4996 |
rules = _ref$rules === void 0 ? [] : _ref$rules, |
| 4997 |
_ref$labelCol = _ref.labelCol, |
| 4998 |
labelCol = _ref$labelCol === void 0 ? {} : _ref$labelCol, |
| 4999 |
_ref$wrapperCol = _ref.wrapperCol, |
| 5000 |
wrapperCol = _ref$wrapperCol === void 0 ? {} : _ref$wrapperCol, |
| 5001 |
_ref$tooltip = _ref.tooltip, |
| 5002 |
tooltip = _ref$tooltip === void 0 ? "" : _ref$tooltip, |
| 5003 |
props = _objectWithoutProperties(_ref, _excluded); |
| 5004 |
return /*#__PURE__*/React.createElement(Form.Item, { |
| 5005 |
className: "timetics-input tt-meeting-price-input ".concat(className), |
| 5006 |
label: label, |
| 5007 |
labelCol: labelCol, |
| 5008 |
wrapperCol: wrapperCol, |
| 5009 |
name: name, |
| 5010 |
tooltip: tooltip, |
| 5011 |
rules: rules |
| 5012 |
}, /*#__PURE__*/React.createElement(InputNumber, _extends({}, props, { |
| 5013 |
size: "large" |
| 5014 |
}))); |
| 5015 |
} |
| 5016 |
/* harmony default export */ const common_NumberInput = (NumberInput); |
| 5017 |
// EXTERNAL MODULE: ./assets/src/common/SelectInput.js |
| 5018 |
var SelectInput = __webpack_require__(4378); |
| 5019 |
;// CONCATENATED MODULE: ./assets/src/common/TextAreaInput.js |
| 5020 |
var TextAreaInput_excluded = ["className", "name", "label", "required", "rules", "labelCol", "wrapperCol"]; |
| 5021 |
function TextAreaInput_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = TextAreaInput_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } |
| 5022 |
function TextAreaInput_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } |
| 5023 |
var TextAreaInput_window$antd = window.antd, |
| 5024 |
Input = TextAreaInput_window$antd.Input, |
| 5025 |
TextAreaInput_Form = TextAreaInput_window$antd.Form; |
| 5026 |
var TextArea = Input.TextArea; |
| 5027 |
function TextAreaInput(_ref) { |
| 5028 |
var _ref$className = _ref.className, |
| 5029 |
className = _ref$className === void 0 ? "" : _ref$className, |
| 5030 |
name = _ref.name, |
| 5031 |
_ref$label = _ref.label, |
| 5032 |
label = _ref$label === void 0 ? "" : _ref$label, |
| 5033 |
_ref$required = _ref.required, |
| 5034 |
required = _ref$required === void 0 ? false : _ref$required, |
| 5035 |
_ref$rules = _ref.rules, |
| 5036 |
rules = _ref$rules === void 0 ? [] : _ref$rules, |
| 5037 |
_ref$labelCol = _ref.labelCol, |
| 5038 |
labelCol = _ref$labelCol === void 0 ? {} : _ref$labelCol, |
| 5039 |
_ref$wrapperCol = _ref.wrapperCol, |
| 5040 |
wrapperCol = _ref$wrapperCol === void 0 ? {} : _ref$wrapperCol, |
| 5041 |
props = TextAreaInput_objectWithoutProperties(_ref, TextAreaInput_excluded); |
| 5042 |
return /*#__PURE__*/React.createElement(TextAreaInput_Form.Item, { |
| 5043 |
className: "timetics-input ".concat(className), |
| 5044 |
label: label, |
| 5045 |
labelCol: labelCol, |
| 5046 |
wrapperCol: wrapperCol, |
| 5047 |
name: name, |
| 5048 |
rules: rules |
| 5049 |
}, /*#__PURE__*/React.createElement(TextArea, props)); |
| 5050 |
} |
| 5051 |
/* harmony default export */ const common_TextAreaInput = (TextAreaInput); |
| 5052 |
// EXTERNAL MODULE: ./assets/src/common/TextInput.js |
| 5053 |
var TextInput = __webpack_require__(6582); |
| 5054 |
// EXTERNAL MODULE: ./assets/src/admin/actionCreators/actions.js |
| 5055 |
var actions = __webpack_require__(3632); |
| 5056 |
// EXTERNAL MODULE: ./assets/src/admin/actionCreators/common.js |
| 5057 |
var common = __webpack_require__(7157); |
| 5058 |
// EXTERNAL MODULE: ./assets/src/admin/context/provider.js + 9 modules |
| 5059 |
var provider = __webpack_require__(7258); |
| 5060 |
;// CONCATENATED MODULE: ./assets/src/admin/utils/timezone.js |
| 5061 |
var aryIannaTimeZones = window.timetics.timezone; |
| 5062 |
// EXTERNAL MODULE: ./assets/src/common/icons/Icons.js |
| 5063 |
var Icons = __webpack_require__(2751); |
| 5064 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/meeting/LocationType.js |
| 5065 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } |
| 5066 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 5067 |
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } |
| 5068 |
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
| 5069 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 5070 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 5071 |
function _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); } |
| 5072 |
function _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; } |
| 5073 |
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 5074 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 5075 |
|
| 5076 |
|
| 5077 |
|
| 5078 |
|
| 5079 |
var LocationType_window$antd = window.antd, |
| 5080 |
LocationType_Form = LocationType_window$antd.Form, |
| 5081 |
Button = LocationType_window$antd.Button, |
| 5082 |
Select = LocationType_window$antd.Select, |
| 5083 |
Col = LocationType_window$antd.Col, |
| 5084 |
Row = LocationType_window$antd.Row, |
| 5085 |
Space = LocationType_window$antd.Space; |
| 5086 |
var __ = wp.i18n.__; |
| 5087 |
var LocationType_React = window.React; |
| 5088 |
var useState = LocationType_React.useState, |
| 5089 |
useEffect = LocationType_React.useEffect; |
| 5090 |
var MEETING_TYPE = { |
| 5091 |
oneToOne: "One-to-One", |
| 5092 |
oneToMany: "One-to-Many", |
| 5093 |
seat: "seat" |
| 5094 |
}; |
| 5095 |
var ADDRESS_TYPE = { |
| 5096 |
googleMeet: "google-meet", |
| 5097 |
inPerson: "in-person-meeting", |
| 5098 |
phoneCall: "phone-call" |
| 5099 |
}; |
| 5100 |
function LocationType(_ref) { |
| 5101 |
var form = _ref.form; |
| 5102 |
var _useStateValue = (0,provider/* useStateValue */.K)(), |
| 5103 |
_useStateValue2 = _slicedToArray(_useStateValue, 2), |
| 5104 |
meetingReducer = _useStateValue2[0].meeting, |
| 5105 |
dispatch = _useStateValue2[1]; |
| 5106 |
var addressType = meetingReducer.addressType, |
| 5107 |
meetingType = meetingReducer.meetingType; |
| 5108 |
var _useState = useState(locationOptions), |
| 5109 |
_useState2 = _slicedToArray(_useState, 2), |
| 5110 |
filterOption = _useState2[0], |
| 5111 |
setFilterOption = _useState2[1]; |
| 5112 |
|
| 5113 |
/** |
| 5114 |
* |
| 5115 |
* @param {String} value String value form onChange event of any field. |
| 5116 |
*/ |
| 5117 |
var setLocationType = function setLocationType(value, index) { |
| 5118 |
var _type = _toConsumableArray(addressType); |
| 5119 |
_type[index] = value; |
| 5120 |
(0,common/* setState */.I)({ |
| 5121 |
dispatch: dispatch, |
| 5122 |
name: "addressType", |
| 5123 |
value: _type |
| 5124 |
}); |
| 5125 |
}; |
| 5126 |
var filteredOptions = locationOptions.filter(function (option) { |
| 5127 |
return !_toConsumableArray(addressType).includes(option.value) && option.availability.includes(meetingType); |
| 5128 |
}); |
| 5129 |
useEffect(function () { |
| 5130 |
setFilterOption(filteredOptions); |
| 5131 |
return function () { |
| 5132 |
setFilterOption(null); |
| 5133 |
}; |
| 5134 |
}, [addressType]); |
| 5135 |
useEffect(function () { |
| 5136 |
/* making sure proper Location type is set for it's relevent location field on first render */ |
| 5137 |
if (meetingType === MEETING_TYPE.seat) (0,common/* setState */.I)({ |
| 5138 |
dispatch: dispatch, |
| 5139 |
name: "addressType", |
| 5140 |
value: addressType.length ? _toConsumableArray(addressType) : [ADDRESS_TYPE.inPerson] |
| 5141 |
}); |
| 5142 |
if (meetingType === MEETING_TYPE.oneToMany) (0,common/* setState */.I)({ |
| 5143 |
dispatch: dispatch, |
| 5144 |
name: "addressType", |
| 5145 |
value: addressType.length ? _toConsumableArray(addressType) : [ADDRESS_TYPE.googleMeet] |
| 5146 |
}); |
| 5147 |
if (meetingType === MEETING_TYPE.oneToOne) (0,common/* setState */.I)({ |
| 5148 |
dispatch: dispatch, |
| 5149 |
name: "addressType", |
| 5150 |
value: addressType.length ? _toConsumableArray(addressType) : [ADDRESS_TYPE.googleMeet] |
| 5151 |
}); |
| 5152 |
return function () { |
| 5153 |
(0,common/* setState */.I)({ |
| 5154 |
dispatch: dispatch, |
| 5155 |
name: "addressType", |
| 5156 |
value: [] |
| 5157 |
}); |
| 5158 |
}; |
| 5159 |
}, []); |
| 5160 |
return /*#__PURE__*/LocationType_React.createElement(LocationType_Form.List, { |
| 5161 |
name: "locations" |
| 5162 |
}, function (fields, _ref2) { |
| 5163 |
var add = _ref2.add, |
| 5164 |
remove = _ref2.remove; |
| 5165 |
return /*#__PURE__*/LocationType_React.createElement(Row, { |
| 5166 |
gutter: 16, |
| 5167 |
align: "middle" |
| 5168 |
}, fields.map(function (field, index) { |
| 5169 |
return /*#__PURE__*/LocationType_React.createElement(LocationType_React.Fragment, { |
| 5170 |
key: "location-type-".concat(index) |
| 5171 |
}, /*#__PURE__*/LocationType_React.createElement(Col, { |
| 5172 |
span: 11 |
| 5173 |
}, /*#__PURE__*/LocationType_React.createElement(LocationType_Form.Item, { |
| 5174 |
className: "timetics-input ", |
| 5175 |
label: __("Location type", "timetics"), |
| 5176 |
name: [index, "location_type"], |
| 5177 |
rules: [{ |
| 5178 |
required: true, |
| 5179 |
message: "Address is required" |
| 5180 |
}] |
| 5181 |
}, /*#__PURE__*/LocationType_React.createElement(Select |
| 5182 |
// defaultValue={locationOptions[0]} |
| 5183 |
, { |
| 5184 |
style: { |
| 5185 |
width: "100%" |
| 5186 |
}, |
| 5187 |
key: "meeting" |
| 5188 |
// options={locationOptions} |
| 5189 |
, |
| 5190 |
onChange: function onChange(value) { |
| 5191 |
setLocationType(value, index); |
| 5192 |
form.setFieldValue(["locations", index, "location"], value === ADDRESS_TYPE.googleMeet ? "Google Meet" : ""); |
| 5193 |
} |
| 5194 |
// value={selectedItems} |
| 5195 |
// name={"location_type"} |
| 5196 |
// fieldNames={{ |
| 5197 |
// label: "name", |
| 5198 |
// value: "value", |
| 5199 |
// }} |
| 5200 |
}, filterOption === null || filterOption === void 0 ? void 0 : filterOption.map(function (item, i) { |
| 5201 |
return /*#__PURE__*/LocationType_React.createElement(Select.Option, { |
| 5202 |
key: "".concat(i, "-meeting"), |
| 5203 |
value: item === null || item === void 0 ? void 0 : item.value |
| 5204 |
}, /*#__PURE__*/LocationType_React.createElement(Space, { |
| 5205 |
className: "tt-location-item" |
| 5206 |
}, item === null || item === void 0 ? void 0 : item.icon, item === null || item === void 0 ? void 0 : item.name)); |
| 5207 |
})))), /*#__PURE__*/LocationType_React.createElement(Col, { |
| 5208 |
span: fields.length > 1 ? 11 : 13 |
| 5209 |
}, /*#__PURE__*/LocationType_React.createElement(Location, { |
| 5210 |
nameIndex: index, |
| 5211 |
locationType: addressType[index] |
| 5212 |
})), fields.length > 1 ? /*#__PURE__*/LocationType_React.createElement(Col, { |
| 5213 |
span: 2 |
| 5214 |
}, /*#__PURE__*/LocationType_React.createElement(Button, { |
| 5215 |
className: "dynamic-delete-button", |
| 5216 |
type: "link", |
| 5217 |
onClick: function onClick() { |
| 5218 |
var _type = _toConsumableArray(addressType); |
| 5219 |
_type.splice(index, 1); |
| 5220 |
(0,common/* setState */.I)({ |
| 5221 |
dispatch: dispatch, |
| 5222 |
name: "addressType", |
| 5223 |
value: _type |
| 5224 |
}); |
| 5225 |
console.log("remove", field); |
| 5226 |
return remove(field.name); |
| 5227 |
}, |
| 5228 |
icon: /*#__PURE__*/LocationType_React.createElement(Icons/* CloseFillIcon */.Ys, { |
| 5229 |
width: "24", |
| 5230 |
height: "24" |
| 5231 |
}), |
| 5232 |
"aria-label": __("remove-location-type", "timetics") |
| 5233 |
})) : null); |
| 5234 |
}), fields.length < locationOptions.length && meetingType != MEETING_TYPE.seat && meetingType != MEETING_TYPE.oneToMany && /*#__PURE__*/LocationType_React.createElement(Button, { |
| 5235 |
type: "link", |
| 5236 |
className: "tt-add-location-btn", |
| 5237 |
onClick: function onClick() { |
| 5238 |
var _type = _toConsumableArray(addressType); |
| 5239 |
// _type.push("google-meet"); |
| 5240 |
(0,common/* setState */.I)({ |
| 5241 |
dispatch: dispatch, |
| 5242 |
name: "addressType", |
| 5243 |
value: _type |
| 5244 |
}); |
| 5245 |
add({ |
| 5246 |
location_type: "", |
| 5247 |
location: "" |
| 5248 |
}); |
| 5249 |
} |
| 5250 |
}, /*#__PURE__*/LocationType_React.createElement(Icons/* AddIcon */.dt, { |
| 5251 |
color: "#1890ff" |
| 5252 |
}), __("Add another location", "timetics"))); |
| 5253 |
}); |
| 5254 |
} |
| 5255 |
/* harmony default export */ const meeting_LocationType = (LocationType); |
| 5256 |
var locationOptions = [{ |
| 5257 |
id: 1, |
| 5258 |
name: "Google Meet", |
| 5259 |
value: "google-meet", |
| 5260 |
icon: /*#__PURE__*/LocationType_React.createElement(Icons/* GoogleMeet */.gB, null), |
| 5261 |
availability: [MEETING_TYPE.oneToMany, MEETING_TYPE.oneToOne] |
| 5262 |
}, |
| 5263 |
// { id: 2, name: "Zoom", value: "zoom", icon: <Zoom /> }, |
| 5264 |
{ |
| 5265 |
id: 2, |
| 5266 |
name: "Phone Call", |
| 5267 |
value: "phone-call", |
| 5268 |
icon: /*#__PURE__*/LocationType_React.createElement(Icons/* Phone */.LP, null), |
| 5269 |
availability: [MEETING_TYPE.oneToMany, MEETING_TYPE.oneToOne] |
| 5270 |
}, { |
| 5271 |
id: 3, |
| 5272 |
name: "In Person Meeting", |
| 5273 |
value: "in-person-meeting", |
| 5274 |
icon: /*#__PURE__*/LocationType_React.createElement(Icons/* Location */.Ye, null), |
| 5275 |
availability: [MEETING_TYPE.oneToMany, MEETING_TYPE.oneToOne, MEETING_TYPE.seat] |
| 5276 |
} |
| 5277 |
// { |
| 5278 |
// id: 5, |
| 5279 |
// name: "Custom Meeting", |
| 5280 |
// value: "custom-meeting", |
| 5281 |
// icon: <Calendar />, |
| 5282 |
// }, |
| 5283 |
]; |
| 5284 |
|
| 5285 |
var virtualOptions = [{ |
| 5286 |
id: 1, |
| 5287 |
name: "Zoom", |
| 5288 |
value: "zoom" |
| 5289 |
}, { |
| 5290 |
id: 2, |
| 5291 |
name: "Google Meet", |
| 5292 |
value: "google-meet" |
| 5293 |
}]; |
| 5294 |
function Location(_ref3) { |
| 5295 |
var nameIndex = _ref3.nameIndex, |
| 5296 |
locationType = _ref3.locationType; |
| 5297 |
if (locationType == ADDRESS_TYPE.googleMeet) { |
| 5298 |
return /*#__PURE__*/LocationType_React.createElement(TextInput/* default */.Z, { |
| 5299 |
style: { |
| 5300 |
display: "none" |
| 5301 |
}, |
| 5302 |
label: __("", "timetics"), |
| 5303 |
type: "text", |
| 5304 |
size: "small", |
| 5305 |
placeholder: __("", "timetics"), |
| 5306 |
name: [nameIndex, "location"], |
| 5307 |
defaultValue: "Google Meet" |
| 5308 |
}); |
| 5309 |
} |
| 5310 |
if (locationType == ADDRESS_TYPE.inPerson) { |
| 5311 |
return /*#__PURE__*/LocationType_React.createElement(TextInput/* default */.Z |
| 5312 |
// style={{ width: "50%" }} |
| 5313 |
, { |
| 5314 |
label: __("Address", "timetics"), |
| 5315 |
type: "text", |
| 5316 |
size: "small", |
| 5317 |
placeholder: __("Address", "timetics"), |
| 5318 |
name: [nameIndex, "location"], |
| 5319 |
rules: [{ |
| 5320 |
required: true, |
| 5321 |
message: "Address is required" |
| 5322 |
}] |
| 5323 |
}); |
| 5324 |
} |
| 5325 |
if (locationType == ADDRESS_TYPE.phoneCall) { |
| 5326 |
return /*#__PURE__*/LocationType_React.createElement(TextInput/* default */.Z |
| 5327 |
// style={{ width: "50%" }} |
| 5328 |
, { |
| 5329 |
label: __("Phone number", "timetics"), |
| 5330 |
type: "number", |
| 5331 |
size: "small", |
| 5332 |
placeholder: __("Phone number", "timetics"), |
| 5333 |
name: [nameIndex, "location"], |
| 5334 |
rules: [{ |
| 5335 |
required: true, |
| 5336 |
message: "Phone number is required" |
| 5337 |
}] |
| 5338 |
}); |
| 5339 |
} |
| 5340 |
// if (locationType == "custom-meeting") { |
| 5341 |
// return ( |
| 5342 |
// <TextInput |
| 5343 |
// // style={{ width: "50%" }} |
| 5344 |
// label={__("Custom", "timetics")} |
| 5345 |
// type={"text"} |
| 5346 |
// size="small" |
| 5347 |
// placeholder={__("Custom", "timetics")} |
| 5348 |
// name={[nameIndex, "location"]} |
| 5349 |
// rules={[ |
| 5350 |
// { |
| 5351 |
// required: true, |
| 5352 |
// message: "custom information is required", |
| 5353 |
// }, |
| 5354 |
// ]} |
| 5355 |
// /> |
| 5356 |
// ); |
| 5357 |
// } |
| 5358 |
return null; |
| 5359 |
} |
| 5360 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/meeting/TicketPrice.js |
| 5361 |
function TicketPrice_slicedToArray(arr, i) { return TicketPrice_arrayWithHoles(arr) || TicketPrice_iterableToArrayLimit(arr, i) || TicketPrice_unsupportedIterableToArray(arr, i) || TicketPrice_nonIterableRest(); } |
| 5362 |
function TicketPrice_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 5363 |
function TicketPrice_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return TicketPrice_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 TicketPrice_arrayLikeToArray(o, minLen); } |
| 5364 |
function TicketPrice_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; } |
| 5365 |
function TicketPrice_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 5366 |
function TicketPrice_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 5367 |
|
| 5368 |
|
| 5369 |
|
| 5370 |
|
| 5371 |
|
| 5372 |
var TicketPrice_window$antd = window.antd, |
| 5373 |
TicketPrice_Form = TicketPrice_window$antd.Form, |
| 5374 |
TicketPrice_Button = TicketPrice_window$antd.Button, |
| 5375 |
TicketPrice_Col = TicketPrice_window$antd.Col, |
| 5376 |
TicketPrice_Row = TicketPrice_window$antd.Row; |
| 5377 |
var TicketPrice_ = wp.i18n.__; |
| 5378 |
var TicketPrice_React = window.React; |
| 5379 |
function TicketPrice() { |
| 5380 |
var _useStateValue = (0,provider/* useStateValue */.K)(), |
| 5381 |
_useStateValue2 = TicketPrice_slicedToArray(_useStateValue, 2), |
| 5382 |
meetingReducer = _useStateValue2[0].meeting, |
| 5383 |
dispatch = _useStateValue2[1]; |
| 5384 |
var meeting = meetingReducer.meeting; |
| 5385 |
return /*#__PURE__*/TicketPrice_React.createElement(TicketPrice_Form.List, { |
| 5386 |
name: "price", |
| 5387 |
initialValue: [{ |
| 5388 |
ticket_name: TicketPrice_("default", "timetics"), |
| 5389 |
ticket_price: "", |
| 5390 |
ticket_quantity: "1" |
| 5391 |
}] |
| 5392 |
}, function (fields, _ref) { |
| 5393 |
var add = _ref.add, |
| 5394 |
remove = _ref.remove; |
| 5395 |
return /*#__PURE__*/TicketPrice_React.createElement(TicketPrice_Row, { |
| 5396 |
gutter: 16, |
| 5397 |
align: "middle" |
| 5398 |
}, fields.map(function (field, index) { |
| 5399 |
return /*#__PURE__*/TicketPrice_React.createElement(TicketPrice_React.Fragment, { |
| 5400 |
key: "ticket-type-".concat(index) |
| 5401 |
}, /*#__PURE__*/TicketPrice_React.createElement(TicketPrice_Col, { |
| 5402 |
span: 24 |
| 5403 |
}, /*#__PURE__*/TicketPrice_React.createElement(common_NumberInput, { |
| 5404 |
label: TicketPrice_("Price", "timetics"), |
| 5405 |
name: [index, "ticket_price"], |
| 5406 |
type: "number", |
| 5407 |
placeholder: TicketPrice_("Enter your meeting price", "timetics"), |
| 5408 |
min: 0 |
| 5409 |
}))); |
| 5410 |
})); |
| 5411 |
}); |
| 5412 |
} |
| 5413 |
/* harmony default export */ const meeting_TicketPrice = (TicketPrice); |
| 5414 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/meeting/steps/FirstStep.js |
| 5415 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 5416 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 5417 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 5418 |
function FirstStep_slicedToArray(arr, i) { return FirstStep_arrayWithHoles(arr) || FirstStep_iterableToArrayLimit(arr, i) || FirstStep_unsupportedIterableToArray(arr, i) || FirstStep_nonIterableRest(); } |
| 5419 |
function FirstStep_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 5420 |
function FirstStep_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return FirstStep_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 FirstStep_arrayLikeToArray(o, minLen); } |
| 5421 |
function FirstStep_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; } |
| 5422 |
function FirstStep_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 5423 |
function FirstStep_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 5424 |
|
| 5425 |
|
| 5426 |
|
| 5427 |
|
| 5428 |
|
| 5429 |
|
| 5430 |
|
| 5431 |
|
| 5432 |
|
| 5433 |
|
| 5434 |
var FirstStep_ = wp.i18n.__; |
| 5435 |
var FirstStep_React = window.React; |
| 5436 |
var FirstStep_useState = FirstStep_React.useState, |
| 5437 |
FirstStep_useEffect = FirstStep_React.useEffect; |
| 5438 |
var FirstStep_window$antd = window.antd, |
| 5439 |
FirstStep_Col = FirstStep_window$antd.Col, |
| 5440 |
FirstStep_Row = FirstStep_window$antd.Row, |
| 5441 |
FirstStep_Form = FirstStep_window$antd.Form, |
| 5442 |
FirstStep_Button = FirstStep_window$antd.Button, |
| 5443 |
FirstStep_Space = FirstStep_window$antd.Space; |
| 5444 |
var FirstStep_MEETING_TYPE = { |
| 5445 |
oneToOne: "One-to-One", |
| 5446 |
oneToMany: "One-to-Many", |
| 5447 |
seat: "seat" |
| 5448 |
}; |
| 5449 |
var FirstStep_ADDRESS_TYPE = { |
| 5450 |
googleMeet: "google-meet", |
| 5451 |
inPerson: "in-person-meeting", |
| 5452 |
phoneCall: "phone-call" |
| 5453 |
}; |
| 5454 |
function FirstStep(_ref) { |
| 5455 |
var _meeting$locations; |
| 5456 |
var onFinish = _ref.onFinish, |
| 5457 |
onFinishFailed = _ref.onFinishFailed, |
| 5458 |
current = _ref.current, |
| 5459 |
setCurrent = _ref.setCurrent, |
| 5460 |
form = _ref.form; |
| 5461 |
var _useStateValue = (0,provider/* useStateValue */.K)(), |
| 5462 |
_useStateValue2 = FirstStep_slicedToArray(_useStateValue, 2), |
| 5463 |
meetingReducer = _useStateValue2[0].meeting, |
| 5464 |
dispatch = _useStateValue2[1]; |
| 5465 |
var timeticsObj = window.timetics; |
| 5466 |
var _meetingReducer$meeti = meetingReducer.meeting, |
| 5467 |
meeting = _meetingReducer$meeti === void 0 ? null : _meetingReducer$meeti, |
| 5468 |
meetingId = meetingReducer.meetingId, |
| 5469 |
loading = meetingReducer.loading, |
| 5470 |
meetingType = meetingReducer.meetingType, |
| 5471 |
_meetingReducer$meeti2 = meetingReducer.meetingCustom, |
| 5472 |
meetingCustom = _meetingReducer$meeti2 === void 0 ? false : _meetingReducer$meeti2, |
| 5473 |
meetingCustomValue = meetingReducer.meetingCustomValue; |
| 5474 |
|
| 5475 |
/** |
| 5476 |
* |
| 5477 |
* @param {String} value meeting duration handler |
| 5478 |
*/ |
| 5479 |
var meetingDurationHandler = function meetingDurationHandler(value) { |
| 5480 |
var duration = value; |
| 5481 |
var durationInTime = value.split(" ")[0]; |
| 5482 |
var durationInUnit = value.split(" ")[1]; |
| 5483 |
if (duration == "custom") { |
| 5484 |
(0,common/* setState */.I)({ |
| 5485 |
dispatch: dispatch, |
| 5486 |
name: "meetingCustom", |
| 5487 |
value: true |
| 5488 |
}); |
| 5489 |
(0,common/* setState */.I)({ |
| 5490 |
dispatch: dispatch, |
| 5491 |
name: "meetingDuration", |
| 5492 |
value: 10 |
| 5493 |
}); |
| 5494 |
duration = meetingCustomValue; |
| 5495 |
} else { |
| 5496 |
(0,common/* setState */.I)({ |
| 5497 |
dispatch: dispatch, |
| 5498 |
name: "meetingDuration", |
| 5499 |
value: durationInUnit == "hr" ? durationInTime * 60 : durationInTime |
| 5500 |
}); |
| 5501 |
(0,common/* setState */.I)({ |
| 5502 |
dispatch: dispatch, |
| 5503 |
name: "meetingCustom", |
| 5504 |
value: false |
| 5505 |
}); |
| 5506 |
} |
| 5507 |
}; |
| 5508 |
var onFinishFirstStep = function onFinishFirstStep(values) { |
| 5509 |
if (meetingCustom) { |
| 5510 |
var _meetingDuration = 10; |
| 5511 |
if (values.custom_duration_time == "hr") { |
| 5512 |
_meetingDuration = (values === null || values === void 0 ? void 0 : values.custom_duration) * 60; |
| 5513 |
} else { |
| 5514 |
_meetingDuration = values === null || values === void 0 ? void 0 : values.custom_duration; |
| 5515 |
} |
| 5516 |
dispatch({ |
| 5517 |
type: actions/* actions.SET_META_DATA_WITH_MEETING */.N.SET_META_DATA_WITH_MEETING, |
| 5518 |
payload: { |
| 5519 |
meetingDuration: _meetingDuration |
| 5520 |
} |
| 5521 |
}); |
| 5522 |
} |
| 5523 |
(0,common/* setState */.I)({ |
| 5524 |
dispatch: dispatch, |
| 5525 |
name: "meeting", |
| 5526 |
value: _objectSpread(_objectSpread({}, meeting), values) |
| 5527 |
}); |
| 5528 |
//if onFinish is available as props |
| 5529 |
if (onFinish) { |
| 5530 |
onFinish(_objectSpread(_objectSpread({}, meeting), values)); |
| 5531 |
return; |
| 5532 |
} |
| 5533 |
setCurrent(current + 1); |
| 5534 |
}; |
| 5535 |
var onFinishFailedFirstStep = function onFinishFailedFirstStep(errorInfo) { |
| 5536 |
onFinishFailed(_objectSpread(_objectSpread({}, errorInfo), {}, { |
| 5537 |
values: _objectSpread({}, errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.values) |
| 5538 |
})); |
| 5539 |
}; |
| 5540 |
|
| 5541 |
/** |
| 5542 |
* Meeting duration custom class |
| 5543 |
*/ |
| 5544 |
var spanClass = meetingCustom == true ? "12" : "24"; |
| 5545 |
return /*#__PURE__*/FirstStep_React.createElement(FirstStep_Form, { |
| 5546 |
form: form, |
| 5547 |
name: "dynamic_form_complex", |
| 5548 |
layout: "vertical", |
| 5549 |
autoComplete: "on", |
| 5550 |
onFinish: onFinishFirstStep, |
| 5551 |
onFinishFailed: onFinishFailedFirstStep, |
| 5552 |
initialValues: _objectSpread(_objectSpread({}, meeting), {}, { |
| 5553 |
locations: meeting !== null && meeting !== void 0 && (_meeting$locations = meeting.locations) !== null && _meeting$locations !== void 0 && _meeting$locations.length ? meeting === null || meeting === void 0 ? void 0 : meeting.locations : [meetingType === FirstStep_MEETING_TYPE.seat ? { |
| 5554 |
location_type: FirstStep_ADDRESS_TYPE.inPerson, |
| 5555 |
location: "" |
| 5556 |
} : { |
| 5557 |
location_type: FirstStep_ADDRESS_TYPE.googleMeet, |
| 5558 |
location: "Google Meet" |
| 5559 |
}] |
| 5560 |
}) |
| 5561 |
}, /*#__PURE__*/FirstStep_React.createElement(TextInput/* default */.Z, { |
| 5562 |
label: FirstStep_("Title", "timetics"), |
| 5563 |
name: "name", |
| 5564 |
required: true, |
| 5565 |
rules: [{ |
| 5566 |
required: true, |
| 5567 |
message: FirstStep_("Please enter title!", "timetics") |
| 5568 |
}], |
| 5569 |
type: "text", |
| 5570 |
size: "small", |
| 5571 |
placeholder: FirstStep_("Title", "timetics") |
| 5572 |
}), /*#__PURE__*/FirstStep_React.createElement(common_TextAreaInput, { |
| 5573 |
label: FirstStep_("Description", "timetics"), |
| 5574 |
labelCol: 24, |
| 5575 |
wrapperCol: 24, |
| 5576 |
name: "description", |
| 5577 |
placeholder: FirstStep_("Enter description", "timetics"), |
| 5578 |
autoSize: { |
| 5579 |
minRows: 5, |
| 5580 |
maxRows: 5 |
| 5581 |
} |
| 5582 |
}), loading == false && /*#__PURE__*/FirstStep_React.createElement(meeting_LocationType, { |
| 5583 |
form: form |
| 5584 |
}), /*#__PURE__*/FirstStep_React.createElement(SelectInput/* default */.Z, { |
| 5585 |
initialValue: timeticsObj === null || timeticsObj === void 0 ? void 0 : timeticsObj.default_timezone, |
| 5586 |
style: { |
| 5587 |
width: "100%" |
| 5588 |
}, |
| 5589 |
key: "meeting-timezone", |
| 5590 |
data: aryIannaTimeZones, |
| 5591 |
label: FirstStep_("meeting Time zone", "timetics"), |
| 5592 |
labelCol: 24, |
| 5593 |
wrapperCol: 24, |
| 5594 |
name: "timezone" |
| 5595 |
}), /*#__PURE__*/FirstStep_React.createElement(FirstStep_Row, { |
| 5596 |
gutter: 16 |
| 5597 |
}, /*#__PURE__*/FirstStep_React.createElement(FirstStep_Col, { |
| 5598 |
span: spanClass |
| 5599 |
}, /*#__PURE__*/FirstStep_React.createElement(SelectInput/* default */.Z |
| 5600 |
// defaultValue={meetingOptions[0]} |
| 5601 |
, { |
| 5602 |
style: { |
| 5603 |
width: "100%" |
| 5604 |
}, |
| 5605 |
key: "duration", |
| 5606 |
data: meetingDuration, |
| 5607 |
label: FirstStep_("Duration", "timetics"), |
| 5608 |
labelCol: 24, |
| 5609 |
wrapperCol: 24, |
| 5610 |
name: "duration", |
| 5611 |
placeholder: FirstStep_("Enter your meeting duration", "timetics"), |
| 5612 |
onChange: meetingDurationHandler, |
| 5613 |
rules: [{ |
| 5614 |
required: true, |
| 5615 |
message: FirstStep_("Please select meeting duration!", "timetics") |
| 5616 |
}] |
| 5617 |
})), meetingCustom && /*#__PURE__*/FirstStep_React.createElement(FirstStep_React.Fragment, null, /*#__PURE__*/FirstStep_React.createElement(FirstStep_Col, { |
| 5618 |
span: 6 |
| 5619 |
}, /*#__PURE__*/FirstStep_React.createElement(TextInput/* default */.Z, { |
| 5620 |
name: "custom_duration", |
| 5621 |
key: "custom_duration", |
| 5622 |
type: "number", |
| 5623 |
min: 1, |
| 5624 |
label: FirstStep_("Set custom time", "timetics"), |
| 5625 |
onChange: function onChange(e) { |
| 5626 |
(0,common/* setState */.I)({ |
| 5627 |
dispatch: dispatch, |
| 5628 |
name: "meetingCustomValue", |
| 5629 |
value: e.target.value |
| 5630 |
}); |
| 5631 |
} |
| 5632 |
})), /*#__PURE__*/FirstStep_React.createElement(FirstStep_Col, { |
| 5633 |
span: 6 |
| 5634 |
}, /*#__PURE__*/FirstStep_React.createElement(SelectInput/* default */.Z, { |
| 5635 |
label: FirstStep_("hr's / min", "timetics"), |
| 5636 |
name: "custom_duration_time" |
| 5637 |
// key={"custom_duration_time"} |
| 5638 |
, |
| 5639 |
style: { |
| 5640 |
width: "100%" |
| 5641 |
}, |
| 5642 |
data: [{ |
| 5643 |
label: "Min", |
| 5644 |
value: "min" |
| 5645 |
}, { |
| 5646 |
label: "Hrs", |
| 5647 |
value: "hr" |
| 5648 |
}], |
| 5649 |
labelCol: 24, |
| 5650 |
wrapperCol: 24, |
| 5651 |
onChange: function onChange(value) { |
| 5652 |
(0,common/* setState */.I)({ |
| 5653 |
dispatch: dispatch, |
| 5654 |
name: "meetingCustomTime", |
| 5655 |
value: value |
| 5656 |
}); |
| 5657 |
} |
| 5658 |
})))), wp.hooks.applyFilters("ticket_price_repeater"), (meetingReducer === null || meetingReducer === void 0 ? void 0 : meetingReducer.meetingType) == "One-to-One" && /*#__PURE__*/FirstStep_React.createElement(meeting_TicketPrice, null), /*#__PURE__*/FirstStep_React.createElement(FirstStep_Row, { |
| 5659 |
justify: "end" |
| 5660 |
}, /*#__PURE__*/FirstStep_React.createElement(FirstStep_Col, null, onFinish ? /*#__PURE__*/FirstStep_React.createElement(FirstStep_Button, { |
| 5661 |
size: "large", |
| 5662 |
type: "primary", |
| 5663 |
htmlType: "submit" |
| 5664 |
}, FirstStep_("Save Updates", "timetics")) : /*#__PURE__*/FirstStep_React.createElement(FirstStep_Button, { |
| 5665 |
size: "large", |
| 5666 |
type: "primary", |
| 5667 |
htmlType: "submit" |
| 5668 |
}, FirstStep_("Next", "timetics"))))); |
| 5669 |
} |
| 5670 |
/* harmony default export */ const steps_FirstStep = (FirstStep); |
| 5671 |
var meetingDuration = [{ |
| 5672 |
id: 1, |
| 5673 |
name: "5 Min", |
| 5674 |
value: "5 min" |
| 5675 |
}, { |
| 5676 |
id: 2, |
| 5677 |
name: "10 Min", |
| 5678 |
value: "10 min" |
| 5679 |
}, { |
| 5680 |
id: 3, |
| 5681 |
name: "15 Min", |
| 5682 |
value: "15 min" |
| 5683 |
}, { |
| 5684 |
id: 4, |
| 5685 |
name: "20 Min", |
| 5686 |
value: "20 min" |
| 5687 |
}, { |
| 5688 |
id: 5, |
| 5689 |
name: "25 Min", |
| 5690 |
value: "25 min" |
| 5691 |
}, { |
| 5692 |
id: 6, |
| 5693 |
name: "30 Min", |
| 5694 |
value: "30 min" |
| 5695 |
}, { |
| 5696 |
id: 7, |
| 5697 |
name: "35 Min", |
| 5698 |
value: "35 min" |
| 5699 |
}, { |
| 5700 |
id: 8, |
| 5701 |
name: "40 Min", |
| 5702 |
value: "40 min" |
| 5703 |
}, { |
| 5704 |
id: 9, |
| 5705 |
name: "45 Min", |
| 5706 |
value: "45 min" |
| 5707 |
}, { |
| 5708 |
id: 10, |
| 5709 |
name: "50 Min", |
| 5710 |
value: "50 min" |
| 5711 |
}, { |
| 5712 |
id: 11, |
| 5713 |
name: "55 Min", |
| 5714 |
value: "55 min" |
| 5715 |
}, { |
| 5716 |
id: 12, |
| 5717 |
name: "1 hr", |
| 5718 |
value: "1 hr" |
| 5719 |
}, { |
| 5720 |
id: 13, |
| 5721 |
name: "Custom", |
| 5722 |
value: "custom" |
| 5723 |
}]; |
| 5724 |
var meetingOptions = [{ |
| 5725 |
id: 1, |
| 5726 |
name: "15 Min", |
| 5727 |
value: "15 min" |
| 5728 |
}, { |
| 5729 |
id: 2, |
| 5730 |
name: "30 Min", |
| 5731 |
value: "30 min" |
| 5732 |
}, { |
| 5733 |
id: 3, |
| 5734 |
name: "45 Min", |
| 5735 |
value: "45 min" |
| 5736 |
}, { |
| 5737 |
id: 4, |
| 5738 |
name: "1 hr", |
| 5739 |
value: "1 hr" |
| 5740 |
}, { |
| 5741 |
id: 5, |
| 5742 |
name: "2 hrs", |
| 5743 |
value: "2 hr" |
| 5744 |
}]; |
| 5745 |
|
| 5746 |
/***/ }), |
| 5747 |
|
| 5748 |
/***/ 9622: |
| 5749 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 5750 |
|
| 5751 |
"use strict"; |
| 5752 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 5753 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 5754 |
/* harmony export */ }); |
| 5755 |
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7484); |
| 5756 |
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_0__); |
| 5757 |
/* harmony import */ var _common_CreateOrUpdate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3181); |
| 5758 |
/* harmony import */ var _common_SelectInput__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4378); |
| 5759 |
/* harmony import */ var _helper_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4903); |
| 5760 |
/* harmony import */ var _actionCreators_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3632); |
| 5761 |
/* harmony import */ var _actionCreators_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7157); |
| 5762 |
/* harmony import */ var _components_Schedules__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8253); |
| 5763 |
/* harmony import */ var _context_provider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7258); |
| 5764 |
/* harmony import */ var _utils_dummyData__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(5177); |
| 5765 |
/* harmony import */ var _hook_useMeetings__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7026); |
| 5766 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 5767 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 5768 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 5769 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } |
| 5770 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 5771 |
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } |
| 5772 |
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
| 5773 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 5774 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 5775 |
function _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); } |
| 5776 |
function _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; } |
| 5777 |
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 5778 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 5779 |
|
| 5780 |
|
| 5781 |
|
| 5782 |
|
| 5783 |
|
| 5784 |
|
| 5785 |
|
| 5786 |
|
| 5787 |
|
| 5788 |
|
| 5789 |
var __ = wp.i18n.__; |
| 5790 |
var React = window.React; |
| 5791 |
var useState = React.useState, |
| 5792 |
useEffect = React.useEffect, |
| 5793 |
useRef = React.useRef; |
| 5794 |
var _window$antd = window.antd, |
| 5795 |
Col = _window$antd.Col, |
| 5796 |
Row = _window$antd.Row, |
| 5797 |
Form = _window$antd.Form, |
| 5798 |
Button = _window$antd.Button, |
| 5799 |
Space = _window$antd.Space, |
| 5800 |
Select = _window$antd.Select; |
| 5801 |
function SecondStep(_ref) { |
| 5802 |
var _meetingVisibility$; |
| 5803 |
var onFinish = _ref.onFinish, |
| 5804 |
_onFinishFailed = _ref.onFinishFailed, |
| 5805 |
current = _ref.current, |
| 5806 |
setCurrent = _ref.setCurrent, |
| 5807 |
saveUpdate = _ref.saveUpdate; |
| 5808 |
var _Form$useForm = Form.useForm(), |
| 5809 |
_Form$useForm2 = _slicedToArray(_Form$useForm, 1), |
| 5810 |
form = _Form$useForm2[0]; |
| 5811 |
var _useMeetings = (0,_hook_useMeetings__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z)(), |
| 5812 |
getStaffsSchedule = _useMeetings.getStaffsSchedule; |
| 5813 |
var _useStateValue = (0,_context_provider__WEBPACK_IMPORTED_MODULE_7__/* .useStateValue */ .K)(), |
| 5814 |
_useStateValue2 = _slicedToArray(_useStateValue, 2), |
| 5815 |
_useStateValue2$ = _useStateValue2[0], |
| 5816 |
meetingReducer = _useStateValue2$.meeting, |
| 5817 |
staffReducer = _useStateValue2$.staff, |
| 5818 |
dispatch = _useStateValue2[1]; |
| 5819 |
var staffs = staffReducer.staffs; |
| 5820 |
var _meetingReducer$meeti = meetingReducer.meeting, |
| 5821 |
meeting = _meetingReducer$meeti === void 0 ? null : _meetingReducer$meeti, |
| 5822 |
meetingId = meetingReducer.meetingId, |
| 5823 |
loading = meetingReducer.loading, |
| 5824 |
meetingType = meetingReducer.meetingType, |
| 5825 |
_meetingReducer$meeti2 = meetingReducer.meetingCustom, |
| 5826 |
meetingCustom = _meetingReducer$meeti2 === void 0 ? false : _meetingReducer$meeti2, |
| 5827 |
meetingCustomValue = meetingReducer.meetingCustomValue, |
| 5828 |
meetingStartDate = meetingReducer.meetingStartDate, |
| 5829 |
meetingEndDate = meetingReducer.meetingEndDate, |
| 5830 |
schedules = meetingReducer.schedules, |
| 5831 |
_meetingReducer$selec = meetingReducer.selectedStaffIds, |
| 5832 |
selectedStaffIds = _meetingReducer$selec === void 0 ? [] : _meetingReducer$selec, |
| 5833 |
_meetingReducer$selec2 = meetingReducer.selectedStaff, |
| 5834 |
selectedStaff = _meetingReducer$selec2 === void 0 ? [] : _meetingReducer$selec2, |
| 5835 |
meetingDuration = meetingReducer.meetingDuration; |
| 5836 |
var _useState = useState(["One-to-One", "One-to-Many", "seat"].includes(meetingType) ? "" : "multiple"), |
| 5837 |
_useState2 = _slicedToArray(_useState, 2), |
| 5838 |
staffSelectMode = _useState2[0], |
| 5839 |
setStaffSelectMode = _useState2[1]; |
| 5840 |
var _useState3 = useState("09:00 AM"), |
| 5841 |
_useState4 = _slicedToArray(_useState3, 2), |
| 5842 |
startTime = _useState4[0], |
| 5843 |
setStartTime = _useState4[1]; |
| 5844 |
var fp = useRef(null); |
| 5845 |
useEffect(function () { |
| 5846 |
form.setFieldsValue({ |
| 5847 |
staff: selectedStaffIds |
| 5848 |
}); |
| 5849 |
}, [selectedStaffIds]); |
| 5850 |
useEffect(function () { |
| 5851 |
if (typeof window !== "undefined" && window.flatpickr && fp.current) { |
| 5852 |
var _meeting$availability, _meeting$availability2, _meeting$availability3, _meeting$availability4, _window, _window$timetics; |
| 5853 |
var inputEl = fp.current; |
| 5854 |
var flatpickrInstance = window.flatpickr(inputEl, { |
| 5855 |
defaultDate: meeting !== null && meeting !== void 0 && (_meeting$availability = meeting.availability) !== null && _meeting$availability !== void 0 && _meeting$availability.start && meeting !== null && meeting !== void 0 && (_meeting$availability2 = meeting.availability) !== null && _meeting$availability2 !== void 0 && _meeting$availability2.end ? [meeting === null || meeting === void 0 ? void 0 : (_meeting$availability3 = meeting.availability) === null || _meeting$availability3 === void 0 ? void 0 : _meeting$availability3.start, meeting === null || meeting === void 0 ? void 0 : (_meeting$availability4 = meeting.availability) === null || _meeting$availability4 === void 0 ? void 0 : _meeting$availability4.end] : [], |
| 5856 |
// showMonths: 2, |
| 5857 |
locale: { |
| 5858 |
firstDayOfWeek: (0,_helper_helpers__WEBPACK_IMPORTED_MODULE_3__/* .convertWeekDayToNumber */ .wR)((_window = window) === null || _window === void 0 ? void 0 : (_window$timetics = _window.timetics) === null || _window$timetics === void 0 ? void 0 : _window$timetics.start_of_week) // start week on Monday |
| 5859 |
}, |
| 5860 |
|
| 5861 |
altFormat: "F j, Y", |
| 5862 |
dateFormat: "Y-m-d", |
| 5863 |
minDate: "today", |
| 5864 |
// monthSelectorType: "static", |
| 5865 |
mode: "range", |
| 5866 |
onChange: function onChange(selectedDates, dateStr, instance) { |
| 5867 |
// const day = getWeekDay(new Date(dateStr)); |
| 5868 |
|
| 5869 |
dispatch({ |
| 5870 |
type: _actionCreators_actions__WEBPACK_IMPORTED_MODULE_4__/* .actions.SET_META_DATA_WITH_MEETING */ .N.SET_META_DATA_WITH_MEETING, |
| 5871 |
payload: { |
| 5872 |
meetingStartDate: dayjs__WEBPACK_IMPORTED_MODULE_0___default()(selectedDates[0]).format("YYYY-MM-DD"), |
| 5873 |
meetingEndDate: dayjs__WEBPACK_IMPORTED_MODULE_0___default()(selectedDates[1]).format("YYYY-MM-DD") |
| 5874 |
} |
| 5875 |
}); |
| 5876 |
} |
| 5877 |
}); |
| 5878 |
return function () { |
| 5879 |
flatpickrInstance.destroy(); |
| 5880 |
}; |
| 5881 |
} |
| 5882 |
}, []); |
| 5883 |
var selectStaffHandler = function selectStaffHandler(_ref2) { |
| 5884 |
var values = _ref2.values, |
| 5885 |
option = _ref2.option; |
| 5886 |
var _staffs = []; |
| 5887 |
var _staffsIds = []; |
| 5888 |
var _schedules = {}; |
| 5889 |
if (Array.isArray(option)) { |
| 5890 |
var _id = values.filter(function (id) { |
| 5891 |
return !_toConsumableArray(selectedStaffIds).includes(id); |
| 5892 |
}); |
| 5893 |
if (_id.length > 0) { |
| 5894 |
_schedules[_id[0]] = getStaffsSchedule({ |
| 5895 |
staffId: _id[0] |
| 5896 |
}); //dummySchedules({startTime,duration: meetingDuration,}); |
| 5897 |
} |
| 5898 |
|
| 5899 |
_staffs = option; |
| 5900 |
_staffsIds = values; |
| 5901 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_5__/* .setState */ .I)({ |
| 5902 |
dispatch: dispatch, |
| 5903 |
name: "schedules", |
| 5904 |
value: _objectSpread(_objectSpread({}, schedules), _schedules) |
| 5905 |
}); |
| 5906 |
} else { |
| 5907 |
_staffs = [option]; |
| 5908 |
_staffsIds = [values]; |
| 5909 |
_schedules[values] = getStaffsSchedule({ |
| 5910 |
staffId: values |
| 5911 |
}); //dummySchedules({startTime,duration: meetingDuration,}); |
| 5912 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_5__/* .setState */ .I)({ |
| 5913 |
dispatch: dispatch, |
| 5914 |
name: "schedules", |
| 5915 |
value: _objectSpread({}, _schedules) |
| 5916 |
}); |
| 5917 |
} |
| 5918 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_5__/* .setState */ .I)({ |
| 5919 |
dispatch: dispatch, |
| 5920 |
name: "selectedStaff", |
| 5921 |
value: _staffs |
| 5922 |
}); |
| 5923 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_5__/* .setState */ .I)({ |
| 5924 |
dispatch: dispatch, |
| 5925 |
name: "selectedStaffIds", |
| 5926 |
value: _staffsIds |
| 5927 |
}); |
| 5928 |
}; |
| 5929 |
var deselectStaffHandler = function deselectStaffHandler(_ref3) { |
| 5930 |
var id = _ref3.id, |
| 5931 |
option = _ref3.option; |
| 5932 |
var _schedules = _objectSpread({}, schedules); |
| 5933 |
delete _schedules[id]; |
| 5934 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_5__/* .setState */ .I)({ |
| 5935 |
dispatch: dispatch, |
| 5936 |
name: "schedules", |
| 5937 |
value: _objectSpread({}, _schedules) |
| 5938 |
}); |
| 5939 |
var _staffs = _toConsumableArray(selectedStaff); |
| 5940 |
var _staffsIds = _toConsumableArray(selectedStaffIds); |
| 5941 |
_staffs = _staffs.filter(function (item) { |
| 5942 |
return item.id !== id; |
| 5943 |
}); |
| 5944 |
_staffsIds = _staffsIds.filter(function (item) { |
| 5945 |
return item !== id; |
| 5946 |
}); |
| 5947 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_5__/* .setState */ .I)({ |
| 5948 |
dispatch: dispatch, |
| 5949 |
name: "selectedStaff", |
| 5950 |
value: _staffs |
| 5951 |
}); |
| 5952 |
(0,_actionCreators_common__WEBPACK_IMPORTED_MODULE_5__/* .setState */ .I)({ |
| 5953 |
dispatch: dispatch, |
| 5954 |
name: "selectedStaffIds", |
| 5955 |
value: _staffsIds |
| 5956 |
}); |
| 5957 |
form.setFieldsValue({ |
| 5958 |
staff: _staffsIds |
| 5959 |
}); |
| 5960 |
}; |
| 5961 |
var onFinishSecondStep = function onFinishSecondStep(values) { |
| 5962 |
var _meetinBufferTime = 0; |
| 5963 |
if (values !== null && values !== void 0 && values.buffer_time) { |
| 5964 |
var _values$buffer_time; |
| 5965 |
if ((values === null || values === void 0 ? void 0 : (_values$buffer_time = values.buffer_time) === null || _values$buffer_time === void 0 ? void 0 : _values$buffer_time.split(" ")[1]) == "hr") { |
| 5966 |
_meetinBufferTime = +(values === null || values === void 0 ? void 0 : values.buffer_time.split(" ")[0]) * 60; |
| 5967 |
} else { |
| 5968 |
_meetinBufferTime = +(values === null || values === void 0 ? void 0 : values.buffer_time.split(" ")[0]); |
| 5969 |
} |
| 5970 |
} |
| 5971 |
dispatch({ |
| 5972 |
type: _actionCreators_actions__WEBPACK_IMPORTED_MODULE_4__/* .actions.SET_META_DATA_WITH_MEETING */ .N.SET_META_DATA_WITH_MEETING, |
| 5973 |
payload: { |
| 5974 |
meetingBufferTime: _meetinBufferTime |
| 5975 |
} |
| 5976 |
}); |
| 5977 |
if (saveUpdate) { |
| 5978 |
saveUpdate(_objectSpread(_objectSpread(_objectSpread({}, meeting), values), {}, { |
| 5979 |
availability: { |
| 5980 |
start: meetingStartDate, |
| 5981 |
end: meetingEndDate |
| 5982 |
} |
| 5983 |
})); |
| 5984 |
} else { |
| 5985 |
onFinish(_objectSpread(_objectSpread(_objectSpread({}, meeting), values), {}, { |
| 5986 |
availability: { |
| 5987 |
start: meetingStartDate, |
| 5988 |
end: meetingEndDate |
| 5989 |
} |
| 5990 |
})); |
| 5991 |
} |
| 5992 |
}; |
| 5993 |
return /*#__PURE__*/React.createElement(Form, { |
| 5994 |
name: "dynamic_form_complex", |
| 5995 |
layout: "vertical", |
| 5996 |
autoComplete: "on", |
| 5997 |
onFinish: onFinishSecondStep, |
| 5998 |
onFinishFailed: function onFinishFailed(errorInfo) { |
| 5999 |
_onFinishFailed(_objectSpread(_objectSpread({}, errorInfo), {}, { |
| 6000 |
values: _objectSpread(_objectSpread({}, errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.values), {}, { |
| 6001 |
meeting_start_date: meetingStartDate, |
| 6002 |
meeting_end_date: meetingEndDate |
| 6003 |
}) |
| 6004 |
})); |
| 6005 |
}, |
| 6006 |
initialValues: _objectSpread(_objectSpread({}, meeting), {}, { |
| 6007 |
staff: selectedStaffIds |
| 6008 |
}) |
| 6009 |
}, /*#__PURE__*/React.createElement(Form.Item, { |
| 6010 |
className: "timetics-input ", |
| 6011 |
wrapperCol: 24, |
| 6012 |
name: "staff", |
| 6013 |
label: __("select host", "timetics"), |
| 6014 |
rules: [{ |
| 6015 |
required: true, |
| 6016 |
message: __("Please select host", "timetics") |
| 6017 |
}] |
| 6018 |
}, /*#__PURE__*/React.createElement(Select, { |
| 6019 |
style: { |
| 6020 |
width: "100%" |
| 6021 |
}, |
| 6022 |
className: "tt-host-input timetics-input", |
| 6023 |
placeholder: __("Select host", "timetics"), |
| 6024 |
key: "staff", |
| 6025 |
options: staffs, |
| 6026 |
value: selectedStaffIds, |
| 6027 |
fieldNames: { |
| 6028 |
label: "full_name", |
| 6029 |
value: "id" |
| 6030 |
}, |
| 6031 |
mode: staffSelectMode, |
| 6032 |
onChange: function onChange(values, option) { |
| 6033 |
selectStaffHandler({ |
| 6034 |
values: values, |
| 6035 |
option: option |
| 6036 |
}); |
| 6037 |
}, |
| 6038 |
onDeselect: function onDeselect(id, option) { |
| 6039 |
deselectStaffHandler({ |
| 6040 |
id: id, |
| 6041 |
option: option |
| 6042 |
}); |
| 6043 |
} |
| 6044 |
})), /*#__PURE__*/React.createElement(_components_Schedules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, { |
| 6045 |
meetingType: meetingType, |
| 6046 |
schedules: schedules, |
| 6047 |
selectedStaffIds: selectedStaffIds, |
| 6048 |
selectedStaff: selectedStaff, |
| 6049 |
meetingDuration: meetingDuration |
| 6050 |
}), /*#__PURE__*/React.createElement(Form.Item, { |
| 6051 |
className: "timetics-input", |
| 6052 |
label: __("Meeting date range (meeting availibility)", "timetics"), |
| 6053 |
labelCol: 24, |
| 6054 |
wrapperCol: 24, |
| 6055 |
name: "meeting_date_range" |
| 6056 |
// rules={rules} |
| 6057 |
}, /*#__PURE__*/React.createElement("input", { |
| 6058 |
placeholder: "Select booking date", |
| 6059 |
ref: fp, |
| 6060 |
type: "text", |
| 6061 |
className: "tt-flat-picker-input ant-input ant-input-lg", |
| 6062 |
id: "booking-date", |
| 6063 |
name: "booking-date" |
| 6064 |
})), /*#__PURE__*/React.createElement(_common_SelectInput__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { |
| 6065 |
initialValue: (_meetingVisibility$ = meetingVisibility[0]) === null || _meetingVisibility$ === void 0 ? void 0 : _meetingVisibility$.value, |
| 6066 |
style: { |
| 6067 |
width: "100%" |
| 6068 |
}, |
| 6069 |
key: "meetingVisibility", |
| 6070 |
data: meetingVisibility, |
| 6071 |
label: __("Meeting visibility", "timetics"), |
| 6072 |
labelCol: 24, |
| 6073 |
wrapperCol: 24, |
| 6074 |
name: "visibility" |
| 6075 |
}), /*#__PURE__*/React.createElement(Row, { |
| 6076 |
justify: "end" |
| 6077 |
}, /*#__PURE__*/React.createElement(Space, null, saveUpdate ? /*#__PURE__*/React.createElement(Button, { |
| 6078 |
size: "large", |
| 6079 |
type: "primary", |
| 6080 |
htmlType: "submit" |
| 6081 |
}, __("Save Updates", "timetics")) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, { |
| 6082 |
size: "large", |
| 6083 |
onClick: function onClick() { |
| 6084 |
setCurrent(1); |
| 6085 |
} |
| 6086 |
}, __("Back", "timetics")), /*#__PURE__*/React.createElement(_common_CreateOrUpdate__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { |
| 6087 |
id: meetingId, |
| 6088 |
type: "primary", |
| 6089 |
htmlType: "submit", |
| 6090 |
size: "large", |
| 6091 |
buttonText: meetingId ? "Update Meeting" : "Create Meeting" |
| 6092 |
}))))); |
| 6093 |
} |
| 6094 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SecondStep); |
| 6095 |
var meetingVisibility = [{ |
| 6096 |
id: 1, |
| 6097 |
name: "Enabled", |
| 6098 |
value: "enabled" |
| 6099 |
}, { |
| 6100 |
id: 2, |
| 6101 |
name: "Disabled", |
| 6102 |
value: "disabled" |
| 6103 |
}]; |
| 6104 |
var meetingOptions = [{ |
| 6105 |
id: 1, |
| 6106 |
name: "15 Min", |
| 6107 |
value: "15 min" |
| 6108 |
}, { |
| 6109 |
id: 2, |
| 6110 |
name: "30 Min", |
| 6111 |
value: "30 min" |
| 6112 |
}, { |
| 6113 |
id: 3, |
| 6114 |
name: "45 Min", |
| 6115 |
value: "45 min" |
| 6116 |
}, { |
| 6117 |
id: 4, |
| 6118 |
name: "1 hr", |
| 6119 |
value: "1 hr" |
| 6120 |
}, { |
| 6121 |
id: 5, |
| 6122 |
name: "2 hrs", |
| 6123 |
value: "2 hr" |
| 6124 |
}]; |
| 6125 |
|
| 6126 |
/***/ }), |
| 6127 |
|
| 6128 |
/***/ 7213: |
| 6129 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6130 |
|
| 6131 |
"use strict"; |
| 6132 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 6133 |
/* harmony export */ "_": () => (/* binding */ apiEndpoint) |
| 6134 |
/* harmony export */ }); |
| 6135 |
var apiEndpoint = { |
| 6136 |
meetings: { |
| 6137 |
meetingsList: "/wp-json/timetics/v1/appointments", |
| 6138 |
meeting: "/wp-json/timetics/v1/appointments", |
| 6139 |
createMeeting: "/wp-json/timetics/v1/appointments", |
| 6140 |
deleteMeeting: "/wp-json/timetics/v1/appointments", |
| 6141 |
duplicateMeeting: "/wp-json/timetics/v1/appointments/:id/duplicate", |
| 6142 |
search: "wp-json/timetics/v1/appointments/search", |
| 6143 |
filterMeeting: "wp-json/timetics/v1/appointments/filter" |
| 6144 |
}, |
| 6145 |
staffs: { |
| 6146 |
staff: "/wp-json/timetics/v1/staffs", |
| 6147 |
search: "/wp-json/timetics/v1/staffs/search" |
| 6148 |
}, |
| 6149 |
bookings: { |
| 6150 |
booking: "/wp-json/timetics/v1/bookings", |
| 6151 |
search: "/wp-json/timetics/v1/bookings/search", |
| 6152 |
slots: "wp-json/timetics/v1/bookings/entries", |
| 6153 |
updatePaymentStatus: "/wp-json/timetics/v1/bookings/:bookingId/payment", |
| 6154 |
paymentOptions: "/wp-json/timetics/v1/bookings/payment_methods" |
| 6155 |
}, |
| 6156 |
customers: { |
| 6157 |
customers: "/wp-json/timetics/v1/customers", |
| 6158 |
search: "/wp-json/timetics/v1/customers/search" |
| 6159 |
}, |
| 6160 |
overview: { |
| 6161 |
overview: "/wp-json/timetics/v1/reports/overview" |
| 6162 |
}, |
| 6163 |
payment: { |
| 6164 |
stripe: "/wp-json/timetics/v1/stripe/payment" |
| 6165 |
}, |
| 6166 |
settings: { |
| 6167 |
settings: "/wp-json/timetics/v1/settings" |
| 6168 |
} |
| 6169 |
}; |
| 6170 |
|
| 6171 |
/***/ }), |
| 6172 |
|
| 6173 |
/***/ 3538: |
| 6174 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6175 |
|
| 6176 |
"use strict"; |
| 6177 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 6178 |
/* harmony export */ "$Z": () => (/* binding */ updateMeeting), |
| 6179 |
/* harmony export */ "Bi": () => (/* binding */ duplicateMeeting), |
| 6180 |
/* harmony export */ "FJ": () => (/* binding */ getSlots), |
| 6181 |
/* harmony export */ "IW": () => (/* binding */ filterMeeting), |
| 6182 |
/* harmony export */ "MY": () => (/* binding */ getAllMeetings), |
| 6183 |
/* harmony export */ "e5": () => (/* binding */ getSingleMeeting), |
| 6184 |
/* harmony export */ "gJ": () => (/* binding */ createMeeting), |
| 6185 |
/* harmony export */ "kM": () => (/* binding */ buldDeleteMeeting), |
| 6186 |
/* harmony export */ "wL": () => (/* binding */ searchMeeting), |
| 6187 |
/* harmony export */ "wY": () => (/* binding */ deleteMeeting) |
| 6188 |
/* harmony export */ }); |
| 6189 |
/* harmony import */ var _axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2593); |
| 6190 |
/* harmony import */ var _apiEndPoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7213); |
| 6191 |
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } |
| 6192 |
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
| 6193 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
| 6194 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
| 6195 |
|
| 6196 |
|
| 6197 |
var getAllMeetings = /*#__PURE__*/function () { |
| 6198 |
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config) { |
| 6199 |
return _regeneratorRuntime().wrap(function _callee$(_context) { |
| 6200 |
while (1) { |
| 6201 |
switch (_context.prev = _context.next) { |
| 6202 |
case 0: |
| 6203 |
return _context.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.meetings.meetingsList */ ._.meetings.meetingsList, config)); |
| 6204 |
case 1: |
| 6205 |
case "end": |
| 6206 |
return _context.stop(); |
| 6207 |
} |
| 6208 |
} |
| 6209 |
}, _callee); |
| 6210 |
})); |
| 6211 |
return function getAllMeetings(_x) { |
| 6212 |
return _ref.apply(this, arguments); |
| 6213 |
}; |
| 6214 |
}(); |
| 6215 |
var getSingleMeeting = /*#__PURE__*/function () { |
| 6216 |
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(config, id) { |
| 6217 |
return _regeneratorRuntime().wrap(function _callee2$(_context2) { |
| 6218 |
while (1) { |
| 6219 |
switch (_context2.prev = _context2.next) { |
| 6220 |
case 0: |
| 6221 |
return _context2.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)("".concat(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.meetings.meeting */ ._.meetings.meeting, "/").concat(id), config)); |
| 6222 |
case 1: |
| 6223 |
case "end": |
| 6224 |
return _context2.stop(); |
| 6225 |
} |
| 6226 |
} |
| 6227 |
}, _callee2); |
| 6228 |
})); |
| 6229 |
return function getSingleMeeting(_x2, _x3) { |
| 6230 |
return _ref2.apply(this, arguments); |
| 6231 |
}; |
| 6232 |
}(); |
| 6233 |
var createMeeting = /*#__PURE__*/function () { |
| 6234 |
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(config) { |
| 6235 |
return _regeneratorRuntime().wrap(function _callee3$(_context3) { |
| 6236 |
while (1) { |
| 6237 |
switch (_context3.prev = _context3.next) { |
| 6238 |
case 0: |
| 6239 |
return _context3.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.meetings.createMeeting */ ._.meetings.createMeeting, config)); |
| 6240 |
case 1: |
| 6241 |
case "end": |
| 6242 |
return _context3.stop(); |
| 6243 |
} |
| 6244 |
} |
| 6245 |
}, _callee3); |
| 6246 |
})); |
| 6247 |
return function createMeeting(_x4) { |
| 6248 |
return _ref3.apply(this, arguments); |
| 6249 |
}; |
| 6250 |
}(); |
| 6251 |
var updateMeeting = /*#__PURE__*/function () { |
| 6252 |
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(config, id) { |
| 6253 |
return _regeneratorRuntime().wrap(function _callee4$(_context4) { |
| 6254 |
while (1) { |
| 6255 |
switch (_context4.prev = _context4.next) { |
| 6256 |
case 0: |
| 6257 |
return _context4.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)("".concat(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.meetings.createMeeting */ ._.meetings.createMeeting, "/").concat(id), config)); |
| 6258 |
case 1: |
| 6259 |
case "end": |
| 6260 |
return _context4.stop(); |
| 6261 |
} |
| 6262 |
} |
| 6263 |
}, _callee4); |
| 6264 |
})); |
| 6265 |
return function updateMeeting(_x5, _x6) { |
| 6266 |
return _ref4.apply(this, arguments); |
| 6267 |
}; |
| 6268 |
}(); |
| 6269 |
var deleteMeeting = /*#__PURE__*/function () { |
| 6270 |
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(config, id) { |
| 6271 |
return _regeneratorRuntime().wrap(function _callee5$(_context5) { |
| 6272 |
while (1) { |
| 6273 |
switch (_context5.prev = _context5.next) { |
| 6274 |
case 0: |
| 6275 |
return _context5.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)("".concat(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.meetings.deleteMeeting */ ._.meetings.deleteMeeting, "/").concat(id), config)); |
| 6276 |
case 1: |
| 6277 |
case "end": |
| 6278 |
return _context5.stop(); |
| 6279 |
} |
| 6280 |
} |
| 6281 |
}, _callee5); |
| 6282 |
})); |
| 6283 |
return function deleteMeeting(_x7, _x8) { |
| 6284 |
return _ref5.apply(this, arguments); |
| 6285 |
}; |
| 6286 |
}(); |
| 6287 |
var buldDeleteMeeting = /*#__PURE__*/function () { |
| 6288 |
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(config) { |
| 6289 |
return _regeneratorRuntime().wrap(function _callee6$(_context6) { |
| 6290 |
while (1) { |
| 6291 |
switch (_context6.prev = _context6.next) { |
| 6292 |
case 0: |
| 6293 |
return _context6.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)("".concat(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.meetings.deleteMeeting */ ._.meetings.deleteMeeting), config)); |
| 6294 |
case 1: |
| 6295 |
case "end": |
| 6296 |
return _context6.stop(); |
| 6297 |
} |
| 6298 |
} |
| 6299 |
}, _callee6); |
| 6300 |
})); |
| 6301 |
return function buldDeleteMeeting(_x9) { |
| 6302 |
return _ref6.apply(this, arguments); |
| 6303 |
}; |
| 6304 |
}(); |
| 6305 |
var duplicateMeeting = /*#__PURE__*/function () { |
| 6306 |
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(config, id) { |
| 6307 |
return _regeneratorRuntime().wrap(function _callee7$(_context7) { |
| 6308 |
while (1) { |
| 6309 |
switch (_context7.prev = _context7.next) { |
| 6310 |
case 0: |
| 6311 |
return _context7.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)("".concat(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.meetings.duplicateMeeting.replace */ ._.meetings.duplicateMeeting.replace(":id", id)), config)); |
| 6312 |
case 1: |
| 6313 |
case "end": |
| 6314 |
return _context7.stop(); |
| 6315 |
} |
| 6316 |
} |
| 6317 |
}, _callee7); |
| 6318 |
})); |
| 6319 |
return function duplicateMeeting(_x10, _x11) { |
| 6320 |
return _ref7.apply(this, arguments); |
| 6321 |
}; |
| 6322 |
}(); |
| 6323 |
var searchMeeting = /*#__PURE__*/function () { |
| 6324 |
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(config) { |
| 6325 |
return _regeneratorRuntime().wrap(function _callee8$(_context8) { |
| 6326 |
while (1) { |
| 6327 |
switch (_context8.prev = _context8.next) { |
| 6328 |
case 0: |
| 6329 |
return _context8.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)("".concat(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.meetings.search */ ._.meetings.search), config)); |
| 6330 |
case 1: |
| 6331 |
case "end": |
| 6332 |
return _context8.stop(); |
| 6333 |
} |
| 6334 |
} |
| 6335 |
}, _callee8); |
| 6336 |
})); |
| 6337 |
return function searchMeeting(_x12) { |
| 6338 |
return _ref8.apply(this, arguments); |
| 6339 |
}; |
| 6340 |
}(); |
| 6341 |
var filterMeeting = /*#__PURE__*/function () { |
| 6342 |
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(config) { |
| 6343 |
return _regeneratorRuntime().wrap(function _callee9$(_context9) { |
| 6344 |
while (1) { |
| 6345 |
switch (_context9.prev = _context9.next) { |
| 6346 |
case 0: |
| 6347 |
return _context9.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)("".concat(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.meetings.filterMeeting */ ._.meetings.filterMeeting), config)); |
| 6348 |
case 1: |
| 6349 |
case "end": |
| 6350 |
return _context9.stop(); |
| 6351 |
} |
| 6352 |
} |
| 6353 |
}, _callee9); |
| 6354 |
})); |
| 6355 |
return function filterMeeting(_x13) { |
| 6356 |
return _ref9.apply(this, arguments); |
| 6357 |
}; |
| 6358 |
}(); |
| 6359 |
var getSlots = /*#__PURE__*/function () { |
| 6360 |
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(config, _ref10) { |
| 6361 |
var staffId, meetingId, startDate, endDate; |
| 6362 |
return _regeneratorRuntime().wrap(function _callee10$(_context10) { |
| 6363 |
while (1) { |
| 6364 |
switch (_context10.prev = _context10.next) { |
| 6365 |
case 0: |
| 6366 |
staffId = _ref10.staffId, meetingId = _ref10.meetingId, startDate = _ref10.startDate, endDate = _ref10.endDate; |
| 6367 |
return _context10.abrupt("return", (0,_axios_requestConfig__WEBPACK_IMPORTED_MODULE_0__/* .request */ .Q)("".concat(_apiEndPoints__WEBPACK_IMPORTED_MODULE_1__/* .apiEndpoint.bookings.slots */ ._.bookings.slots, "?staff_id=").concat(staffId, "&meeting_id=").concat(meetingId, "&start_date=").concat(startDate, "&end_date=").concat(endDate), config)); |
| 6368 |
case 2: |
| 6369 |
case "end": |
| 6370 |
return _context10.stop(); |
| 6371 |
} |
| 6372 |
} |
| 6373 |
}, _callee10); |
| 6374 |
})); |
| 6375 |
return function getSlots(_x14, _x15) { |
| 6376 |
return _ref11.apply(this, arguments); |
| 6377 |
}; |
| 6378 |
}(); |
| 6379 |
|
| 6380 |
|
| 6381 |
/***/ }), |
| 6382 |
|
| 6383 |
/***/ 5177: |
| 6384 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6385 |
|
| 6386 |
"use strict"; |
| 6387 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 6388 |
/* harmony export */ "SX": () => (/* binding */ createDateObject), |
| 6389 |
/* harmony export */ "_9": () => (/* binding */ getSlotTime), |
| 6390 |
/* harmony export */ "rQ": () => (/* binding */ _getOneScheduleObj), |
| 6391 |
/* harmony export */ "sR": () => (/* binding */ dummySchedules), |
| 6392 |
/* harmony export */ "wR": () => (/* binding */ getSlotStartAndEndTime), |
| 6393 |
/* harmony export */ "wU": () => (/* binding */ getTimeOptions), |
| 6394 |
/* harmony export */ "z9": () => (/* binding */ getTimeStringFromDateObject) |
| 6395 |
/* harmony export */ }); |
| 6396 |
/* unused harmony exports timeOptions, getOneScheduleObj */ |
| 6397 |
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7484); |
| 6398 |
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_0__); |
| 6399 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } |
| 6400 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 6401 |
function _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); } |
| 6402 |
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } |
| 6403 |
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
| 6404 |
function _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; } |
| 6405 |
|
| 6406 |
|
| 6407 |
/** |
| 6408 |
* |
| 6409 |
* @param {Object} param0 |
| 6410 |
* @returns time-options for availability of staff |
| 6411 |
*/ |
| 6412 |
var getTimeOptions = function getTimeOptions(_ref) { |
| 6413 |
var _ref$duration = _ref.duration, |
| 6414 |
duration = _ref$duration === void 0 ? 10 : _ref$duration, |
| 6415 |
startTime = _ref.startTime, |
| 6416 |
endTime = _ref.endTime; |
| 6417 |
var timeOptions = []; |
| 6418 |
var _startTime = new Date(createDateObject(startTime)).getTime(); |
| 6419 |
var _endTime = new Date(createDateObject(endTime)).getTime(); |
| 6420 |
var addMins = duration * 1000 * 60; |
| 6421 |
timeOptions.push({ |
| 6422 |
value: _startTime, |
| 6423 |
label: getTimeStringFromDateObject(new Date(_startTime).toString()) |
| 6424 |
}); |
| 6425 |
while (_startTime < _endTime) { |
| 6426 |
_startTime += addMins; |
| 6427 |
timeOptions.push({ |
| 6428 |
value: _startTime, |
| 6429 |
label: getTimeStringFromDateObject(new Date(_startTime).toString()) |
| 6430 |
}); |
| 6431 |
} |
| 6432 |
return timeOptions; |
| 6433 |
}; |
| 6434 |
var timeOptions = [{ |
| 6435 |
value: createDateObject("10:00 AM"), |
| 6436 |
label: "10:00 AM" |
| 6437 |
}, { |
| 6438 |
value: createDateObject("10:30 AM"), |
| 6439 |
label: "10:30 AM" |
| 6440 |
}, { |
| 6441 |
value: createDateObject("11:00 AM"), |
| 6442 |
label: "11:00 AM" |
| 6443 |
}, { |
| 6444 |
value: createDateObject("12:00 PM"), |
| 6445 |
label: "12:00 PM" |
| 6446 |
}, { |
| 6447 |
value: createDateObject("01:00 PM"), |
| 6448 |
label: "01:00 PM" |
| 6449 |
}, { |
| 6450 |
value: createDateObject("02:00 PM"), |
| 6451 |
label: "02:00 PM" |
| 6452 |
}, { |
| 6453 |
value: createDateObject("03:45 PM"), |
| 6454 |
label: "03:45 PM" |
| 6455 |
}, { |
| 6456 |
value: createDateObject("06:00 PM"), |
| 6457 |
label: "06:00 PM" |
| 6458 |
}]; |
| 6459 |
var getOneScheduleObj = function getOneScheduleObj(timeSloteIndex) { |
| 6460 |
var startTime = timeOptions[timeSloteIndex + 1]; |
| 6461 |
var endTime = timeOptions[timeSloteIndex + 2]; |
| 6462 |
return { |
| 6463 |
start: startTime, |
| 6464 |
end: endTime |
| 6465 |
}; |
| 6466 |
}; |
| 6467 |
var _getOneScheduleObj = function _getOneScheduleObj(_ref2) { |
| 6468 |
var _start, _end; |
| 6469 |
var schedules = _ref2.schedules, |
| 6470 |
duration = _ref2.duration, |
| 6471 |
bufferTime = _ref2.bufferTime, |
| 6472 |
dayEnd = _ref2.dayEnd; |
| 6473 |
var startTime = (_start = _toConsumableArray(schedules)[_toConsumableArray(schedules).length - 1].start) === null || _start === void 0 ? void 0 : _start.label; |
| 6474 |
var endTime = (_end = _toConsumableArray(schedules)[_toConsumableArray(schedules).length - 1].end) === null || _end === void 0 ? void 0 : _end.label; |
| 6475 |
//added buffer time here... endTime(09:40 ) + bufferTime(120) = new start time |
| 6476 |
if (bufferTime) { |
| 6477 |
var _startTime = new Date(createDateObject(endTime, 24)).getTime(); |
| 6478 |
var addMins = duration * 1000 * 60; //bufferTime * 1000 * 60; |
| 6479 |
endTime = getTimeStringFromDateObject(new Date(_startTime + addMins)); |
| 6480 |
} |
| 6481 |
return { |
| 6482 |
startTime: endTime, |
| 6483 |
duration: duration, |
| 6484 |
dayEnd: dayEnd |
| 6485 |
}; |
| 6486 |
}; |
| 6487 |
var getSlotTime = function getSlotTime(_ref3) { |
| 6488 |
var startTime = _ref3.startTime, |
| 6489 |
_ref3$duration = _ref3.duration, |
| 6490 |
duration = _ref3$duration === void 0 ? 10 : _ref3$duration, |
| 6491 |
_ref3$dayEnd = _ref3.dayEnd, |
| 6492 |
dayEnd = _ref3$dayEnd === void 0 ? "05:00 PM" : _ref3$dayEnd; |
| 6493 |
var _startTime = new Date(createDateObject(startTime, 24)).getTime(); |
| 6494 |
var _dayEndInMs = new Date(createDateObject(dayEnd)).getTime(); |
| 6495 |
var addMins = duration * 1000 * 60; |
| 6496 |
var _endTime = _startTime + addMins; |
| 6497 |
// if (_startTime >= _dayEndInMs || _endTime > _dayEndInMs) { |
| 6498 |
// return false; |
| 6499 |
// } |
| 6500 |
return { |
| 6501 |
start: { |
| 6502 |
value: _startTime, |
| 6503 |
label: getTimeStringFromDateObject(new Date(_startTime).toString()) |
| 6504 |
}, |
| 6505 |
end: { |
| 6506 |
value: _endTime, |
| 6507 |
label: getTimeStringFromDateObject(new Date(_endTime).toString()) |
| 6508 |
} |
| 6509 |
}; |
| 6510 |
}; |
| 6511 |
var getSlotStartAndEndTime = function getSlotStartAndEndTime(_ref4) { |
| 6512 |
var startTime = _ref4.startTime, |
| 6513 |
_ref4$duration = _ref4.duration, |
| 6514 |
duration = _ref4$duration === void 0 ? 10 : _ref4$duration, |
| 6515 |
_ref4$dayEnd = _ref4.dayEnd, |
| 6516 |
dayEnd = _ref4$dayEnd === void 0 ? "05:00 PM" : _ref4$dayEnd; |
| 6517 |
var _startTime = new Date(createDateObject(startTime, 24)).getTime(); |
| 6518 |
var _dayEndInMs = new Date(createDateObject(dayEnd)).getTime(); |
| 6519 |
var addMins = duration * 1000 * 60; |
| 6520 |
var _endTime = _startTime + addMins; |
| 6521 |
// if (_startTime >= _dayEndInMs || _endTime > _dayEndInMs) { |
| 6522 |
// return false; |
| 6523 |
// } |
| 6524 |
return { |
| 6525 |
start: _startTime, |
| 6526 |
end: _endTime |
| 6527 |
}; |
| 6528 |
}; |
| 6529 |
var dummySchedules = function dummySchedules(_ref5) { |
| 6530 |
var startTime = _ref5.startTime, |
| 6531 |
duration = _ref5.duration; |
| 6532 |
return [{ |
| 6533 |
key: "Fri", |
| 6534 |
name: "Friday", |
| 6535 |
status: false, |
| 6536 |
schedules: [getSlotTime({ |
| 6537 |
startTime: startTime, |
| 6538 |
duration: duration |
| 6539 |
})], |
| 6540 |
actions: ["AddIcon", "DeleteIcon"] |
| 6541 |
}, { |
| 6542 |
key: "Sat", |
| 6543 |
name: "Saturday", |
| 6544 |
status: false, |
| 6545 |
schedules: [getSlotTime({ |
| 6546 |
startTime: startTime, |
| 6547 |
duration: duration |
| 6548 |
})], |
| 6549 |
actions: ["AddIcon", "DeleteIcon"] |
| 6550 |
}, { |
| 6551 |
key: "Sun", |
| 6552 |
name: "Sunday", |
| 6553 |
status: true, |
| 6554 |
schedules: [getSlotTime({ |
| 6555 |
startTime: startTime, |
| 6556 |
duration: duration |
| 6557 |
})], |
| 6558 |
actions: ["AddIcon", "DeleteIcon"] |
| 6559 |
}, { |
| 6560 |
key: "Mon", |
| 6561 |
name: "Monday", |
| 6562 |
status: true, |
| 6563 |
schedules: [getSlotTime({ |
| 6564 |
startTime: startTime, |
| 6565 |
duration: duration |
| 6566 |
})], |
| 6567 |
actions: ["AddIcon", "DeleteIcon"] |
| 6568 |
}, { |
| 6569 |
key: "Tue", |
| 6570 |
name: "Tuesday", |
| 6571 |
status: true, |
| 6572 |
schedules: [getSlotTime({ |
| 6573 |
startTime: startTime, |
| 6574 |
duration: duration |
| 6575 |
})], |
| 6576 |
actions: ["AddIcon", "DeleteIcon"] |
| 6577 |
}, { |
| 6578 |
key: "Wed", |
| 6579 |
name: "Wednesday", |
| 6580 |
status: true, |
| 6581 |
schedules: [getSlotTime({ |
| 6582 |
startTime: startTime, |
| 6583 |
duration: duration |
| 6584 |
})], |
| 6585 |
actions: ["AddIcon", "DeleteIcon"] |
| 6586 |
}, { |
| 6587 |
key: "Thu", |
| 6588 |
name: "Thursday", |
| 6589 |
status: true, |
| 6590 |
schedules: [getSlotTime({ |
| 6591 |
startTime: startTime, |
| 6592 |
duration: duration |
| 6593 |
})], |
| 6594 |
actions: ["AddIcon", "DeleteIcon"] |
| 6595 |
}]; |
| 6596 |
}; |
| 6597 |
function createDateObject(time) { |
| 6598 |
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 12; |
| 6599 |
var startTime = new Date(); |
| 6600 |
var parts = time === null || time === void 0 ? void 0 : time.match(/(\d+):(\d+) (AM|PM)/); |
| 6601 |
if (parts) { |
| 6602 |
var hours = parseInt(parts[1]), |
| 6603 |
minutes = parseInt(parts[2]), |
| 6604 |
tt = parts[3]; |
| 6605 |
if (tt == "PM" && hours < 12) hours += 12; |
| 6606 |
startTime.setHours(hours, minutes, 0, 0); |
| 6607 |
} else { |
| 6608 |
var _parts = time === null || time === void 0 ? void 0 : time.split(":"); |
| 6609 |
var _hours = parseInt(_parts[0]), |
| 6610 |
_minutes = parseInt(_parts[1]); |
| 6611 |
startTime.setHours(_hours, _minutes, 0, 0); |
| 6612 |
} |
| 6613 |
return startTime.toString(); |
| 6614 |
} |
| 6615 |
|
| 6616 |
/** |
| 6617 |
* |
| 6618 |
* @param {*} dateObj new Date() object of javascript. |
| 6619 |
* @returns time in string format like: 09:20 |
| 6620 |
*/ |
| 6621 |
function getTimeStringFromDateObject(dateObj) { |
| 6622 |
//TODO should be added in the localStorage and get from there... |
| 6623 |
var timeFormat = 24; |
| 6624 |
var time = dayjs__WEBPACK_IMPORTED_MODULE_0___default()(dateObj).format(timeFormat == 24 ? "HH:mm" : "hh:mm A"); |
| 6625 |
return time; |
| 6626 |
} |
| 6627 |
|
| 6628 |
/***/ }), |
| 6629 |
|
| 6630 |
/***/ 2593: |
| 6631 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6632 |
|
| 6633 |
"use strict"; |
| 6634 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 6635 |
/* harmony export */ "Q": () => (/* binding */ request) |
| 6636 |
/* harmony export */ }); |
| 6637 |
/* unused harmony export finishPendingRequests */ |
| 6638 |
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1721); |
| 6639 |
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } |
| 6640 |
var _timetics, _timetics2; |
| 6641 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 6642 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 6643 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 6644 |
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
| 6645 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
| 6646 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
| 6647 |
|
| 6648 |
var notification = window.antd.notification; |
| 6649 |
axios__WEBPACK_IMPORTED_MODULE_0__/* ["default"].defaults.baseURL */ .ZP.defaults.baseURL = (_timetics = timetics) === null || _timetics === void 0 ? void 0 : _timetics.site_url; |
| 6650 |
axios__WEBPACK_IMPORTED_MODULE_0__/* ["default"].defaults.headers */ .ZP.defaults.headers = { |
| 6651 |
"X-WP-Nonce": (_timetics2 = timetics) === null || _timetics2 === void 0 ? void 0 : _timetics2.nonce |
| 6652 |
}; |
| 6653 |
var CANCEL_TOKEN_SOURCE = axios__WEBPACK_IMPORTED_MODULE_0__/* ["default"].CancelToken.source */ .ZP.CancelToken.source(); |
| 6654 |
function generateNewCancelTokenSource() { |
| 6655 |
CANCEL_TOKEN_SOURCE = axios.CancelToken.source(); |
| 6656 |
} |
| 6657 |
axios__WEBPACK_IMPORTED_MODULE_0__/* ["default"].interceptors.response.use */ .ZP.interceptors.response.use(function (res) { |
| 6658 |
var _res$config, _res$data; |
| 6659 |
if ((res === null || res === void 0 ? void 0 : (_res$config = res.config) === null || _res$config === void 0 ? void 0 : _res$config.method) !== "get" && res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.message) { |
| 6660 |
var _res$config2, _res$config2$params, _res$data2; |
| 6661 |
//To stop toast for any post or put request, add stopToast: true in params of request |
| 6662 |
if (res !== null && res !== void 0 && (_res$config2 = res.config) !== null && _res$config2 !== void 0 && (_res$config2$params = _res$config2.params) !== null && _res$config2$params !== void 0 && _res$config2$params.stopToast) return res; |
| 6663 |
notification.success({ |
| 6664 |
message: res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.message, |
| 6665 |
// description: "Something went wrong! please try again.", |
| 6666 |
placement: "topRight" |
| 6667 |
}); |
| 6668 |
} |
| 6669 |
return res; |
| 6670 |
}, /*#__PURE__*/function () { |
| 6671 |
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err) { |
| 6672 |
var _err$response, _err$response$data; |
| 6673 |
return _regeneratorRuntime().wrap(function _callee$(_context) { |
| 6674 |
while (1) { |
| 6675 |
switch (_context.prev = _context.next) { |
| 6676 |
case 0: |
| 6677 |
if (err.name && err.name == "AxiosError") { |
| 6678 |
//Error alet err?.response?.data?.message |
| 6679 |
notification.error({ |
| 6680 |
message: err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.message, |
| 6681 |
// description: "Something went wrong! please try again.", |
| 6682 |
placement: "topRight" |
| 6683 |
}); |
| 6684 |
} |
| 6685 |
return _context.abrupt("return", Promise.reject(err)); |
| 6686 |
case 2: |
| 6687 |
case "end": |
| 6688 |
return _context.stop(); |
| 6689 |
} |
| 6690 |
} |
| 6691 |
}, _callee); |
| 6692 |
})); |
| 6693 |
return function (_x) { |
| 6694 |
return _ref.apply(this, arguments); |
| 6695 |
}; |
| 6696 |
}()); |
| 6697 |
var request = function request(url, config) { |
| 6698 |
return axios__WEBPACK_IMPORTED_MODULE_0__/* ["default"].request */ .ZP.request(_objectSpread({ |
| 6699 |
url: url |
| 6700 |
}, config)); |
| 6701 |
}; |
| 6702 |
var finishPendingRequests = function finishPendingRequests(cancellationReason) { |
| 6703 |
CANCEL_TOKEN_SOURCE.cancel(cancellationReason); |
| 6704 |
generateNewCancelTokenSource(); |
| 6705 |
}; |
| 6706 |
|
| 6707 |
|
| 6708 |
/***/ }), |
| 6709 |
|
| 6710 |
/***/ 3181: |
| 6711 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6712 |
|
| 6713 |
"use strict"; |
| 6714 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 6715 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 6716 |
/* harmony export */ }); |
| 6717 |
var React = window.React; |
| 6718 |
var __ = wp.i18n.__; |
| 6719 |
var Button = window.antd.Button; |
| 6720 |
function CreateOrUpdate(_ref) { |
| 6721 |
var id = _ref.id, |
| 6722 |
loading = _ref.loading, |
| 6723 |
buttonText = _ref.buttonText; |
| 6724 |
var isUpdatting = id ? true : false; |
| 6725 |
return /*#__PURE__*/React.createElement(React.Fragment, null, isUpdatting ? /*#__PURE__*/React.createElement(Button, { |
| 6726 |
type: "primary", |
| 6727 |
block: true, |
| 6728 |
htmlType: "submit", |
| 6729 |
size: "large", |
| 6730 |
loading: loading |
| 6731 |
}, buttonText) : /*#__PURE__*/React.createElement(Button, { |
| 6732 |
type: "primary", |
| 6733 |
block: true, |
| 6734 |
htmlType: "submit", |
| 6735 |
size: "large", |
| 6736 |
loading: loading |
| 6737 |
}, buttonText)); |
| 6738 |
} |
| 6739 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CreateOrUpdate); |
| 6740 |
|
| 6741 |
/***/ }), |
| 6742 |
|
| 6743 |
/***/ 4378: |
| 6744 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6745 |
|
| 6746 |
"use strict"; |
| 6747 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 6748 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 6749 |
/* harmony export */ }); |
| 6750 |
var _excluded = ["className", "name", "label", "required", "rules", "labelCol", "wrapperCol", "labelAlign", "colon", "tooltip", "initialValue", "onChange"]; |
| 6751 |
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } |
| 6752 |
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } |
| 6753 |
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } |
| 6754 |
var _window$antd = window.antd, |
| 6755 |
Select = _window$antd.Select, |
| 6756 |
Form = _window$antd.Form; |
| 6757 |
function SelectInput(_ref) { |
| 6758 |
var _props$data; |
| 6759 |
var _ref$className = _ref.className, |
| 6760 |
className = _ref$className === void 0 ? "" : _ref$className, |
| 6761 |
name = _ref.name, |
| 6762 |
_ref$label = _ref.label, |
| 6763 |
label = _ref$label === void 0 ? "" : _ref$label, |
| 6764 |
_ref$required = _ref.required, |
| 6765 |
required = _ref$required === void 0 ? false : _ref$required, |
| 6766 |
_ref$rules = _ref.rules, |
| 6767 |
rules = _ref$rules === void 0 ? [] : _ref$rules, |
| 6768 |
_ref$labelCol = _ref.labelCol, |
| 6769 |
labelCol = _ref$labelCol === void 0 ? {} : _ref$labelCol, |
| 6770 |
_ref$wrapperCol = _ref.wrapperCol, |
| 6771 |
wrapperCol = _ref$wrapperCol === void 0 ? {} : _ref$wrapperCol, |
| 6772 |
_ref$labelAlign = _ref.labelAlign, |
| 6773 |
labelAlign = _ref$labelAlign === void 0 ? "" : _ref$labelAlign, |
| 6774 |
_ref$colon = _ref.colon, |
| 6775 |
colon = _ref$colon === void 0 ? "" : _ref$colon, |
| 6776 |
_ref$tooltip = _ref.tooltip, |
| 6777 |
tooltip = _ref$tooltip === void 0 ? "" : _ref$tooltip, |
| 6778 |
initialValue = _ref.initialValue, |
| 6779 |
onChange = _ref.onChange, |
| 6780 |
props = _objectWithoutProperties(_ref, _excluded); |
| 6781 |
return /*#__PURE__*/React.createElement(Form.Item, { |
| 6782 |
className: "timetics-input ".concat(className), |
| 6783 |
label: label, |
| 6784 |
labelCol: labelCol, |
| 6785 |
wrapperCol: wrapperCol, |
| 6786 |
name: name, |
| 6787 |
colon: colon, |
| 6788 |
labelAlign: labelAlign, |
| 6789 |
rules: rules, |
| 6790 |
tooltip: tooltip, |
| 6791 |
initialValue: initialValue |
| 6792 |
}, /*#__PURE__*/React.createElement(Select, _extends({}, props, { |
| 6793 |
size: "large", |
| 6794 |
onChange: onChange |
| 6795 |
}), props === null || props === void 0 ? void 0 : (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.map(function (option, i) { |
| 6796 |
return /*#__PURE__*/React.createElement(Option, { |
| 6797 |
key: "props.key-".concat(i), |
| 6798 |
value: option.value |
| 6799 |
}, option.name); |
| 6800 |
}))); |
| 6801 |
} |
| 6802 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SelectInput); |
| 6803 |
|
| 6804 |
/***/ }), |
| 6805 |
|
| 6806 |
/***/ 5729: |
| 6807 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6808 |
|
| 6809 |
"use strict"; |
| 6810 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 6811 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 6812 |
/* harmony export */ }); |
| 6813 |
var _antd = antd, |
| 6814 |
Alert = _antd.Alert, |
| 6815 |
Spin = _antd.Spin; |
| 6816 |
var React = window.React; |
| 6817 |
function Spinner(_ref) { |
| 6818 |
var tip = _ref.tip, |
| 6819 |
msg = _ref.msg, |
| 6820 |
desc = _ref.desc, |
| 6821 |
type = _ref.type, |
| 6822 |
wrapperClassName = _ref.wrapperClassName; |
| 6823 |
return /*#__PURE__*/React.createElement(Spin, { |
| 6824 |
tip: tip, |
| 6825 |
wrapperClassName: wrapperClassName |
| 6826 |
}, /*#__PURE__*/React.createElement(Alert, { |
| 6827 |
message: msg, |
| 6828 |
description: desc, |
| 6829 |
type: type |
| 6830 |
})); |
| 6831 |
} |
| 6832 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Spinner); |
| 6833 |
|
| 6834 |
/***/ }), |
| 6835 |
|
| 6836 |
/***/ 6582: |
| 6837 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6838 |
|
| 6839 |
"use strict"; |
| 6840 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 6841 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 6842 |
/* harmony export */ }); |
| 6843 |
var _excluded = ["className", "name", "label", "required", "rules", "labelCol", "wrapperCol", "tooltip"]; |
| 6844 |
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } |
| 6845 |
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } |
| 6846 |
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } |
| 6847 |
var _window$antd = window.antd, |
| 6848 |
Input = _window$antd.Input, |
| 6849 |
Form = _window$antd.Form; |
| 6850 |
function TextInput(_ref) { |
| 6851 |
var _ref$className = _ref.className, |
| 6852 |
className = _ref$className === void 0 ? "" : _ref$className, |
| 6853 |
name = _ref.name, |
| 6854 |
_ref$label = _ref.label, |
| 6855 |
label = _ref$label === void 0 ? "" : _ref$label, |
| 6856 |
_ref$required = _ref.required, |
| 6857 |
required = _ref$required === void 0 ? false : _ref$required, |
| 6858 |
_ref$rules = _ref.rules, |
| 6859 |
rules = _ref$rules === void 0 ? [] : _ref$rules, |
| 6860 |
_ref$labelCol = _ref.labelCol, |
| 6861 |
labelCol = _ref$labelCol === void 0 ? {} : _ref$labelCol, |
| 6862 |
_ref$wrapperCol = _ref.wrapperCol, |
| 6863 |
wrapperCol = _ref$wrapperCol === void 0 ? {} : _ref$wrapperCol, |
| 6864 |
_ref$tooltip = _ref.tooltip, |
| 6865 |
tooltip = _ref$tooltip === void 0 ? "" : _ref$tooltip, |
| 6866 |
props = _objectWithoutProperties(_ref, _excluded); |
| 6867 |
return /*#__PURE__*/React.createElement(Form.Item, { |
| 6868 |
className: "timetics-input ".concat(className), |
| 6869 |
label: label, |
| 6870 |
labelCol: labelCol, |
| 6871 |
wrapperCol: wrapperCol, |
| 6872 |
name: name, |
| 6873 |
tooltip: tooltip, |
| 6874 |
rules: rules |
| 6875 |
}, /*#__PURE__*/React.createElement(Input, _extends({}, props, { |
| 6876 |
size: "large" |
| 6877 |
}))); |
| 6878 |
} |
| 6879 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TextInput); |
| 6880 |
|
| 6881 |
/***/ }), |
| 6882 |
|
| 6883 |
/***/ 2751: |
| 6884 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 6885 |
|
| 6886 |
"use strict"; |
| 6887 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 6888 |
/* harmony export */ "$l": () => (/* binding */ DocumentIcon), |
| 6889 |
/* harmony export */ "A0": () => (/* binding */ GroupPeopleIcon), |
| 6890 |
/* harmony export */ "F_": () => (/* binding */ OverviewUserIcon), |
| 6891 |
/* harmony export */ "LP": () => (/* binding */ Phone), |
| 6892 |
/* harmony export */ "LZ": () => (/* binding */ ArrowRightIcon), |
| 6893 |
/* harmony export */ "Lx": () => (/* binding */ StripeIcon), |
| 6894 |
/* harmony export */ "MM": () => (/* binding */ OverviewPersonIcon), |
| 6895 |
/* harmony export */ "NL": () => (/* binding */ TwoPeopleIcon), |
| 6896 |
/* harmony export */ "Pl": () => (/* binding */ OverviewMoneyIcon), |
| 6897 |
/* harmony export */ "Qr": () => (/* binding */ CloneIcon), |
| 6898 |
/* harmony export */ "SM": () => (/* binding */ OverviewCalendarIcon), |
| 6899 |
/* harmony export */ "UC": () => (/* binding */ CardViewIcon), |
| 6900 |
/* harmony export */ "V7": () => (/* binding */ DocIcon), |
| 6901 |
/* harmony export */ "W1": () => (/* binding */ SearchIcon), |
| 6902 |
/* harmony export */ "Ye": () => (/* binding */ Location), |
| 6903 |
/* harmony export */ "Ys": () => (/* binding */ CloseFillIcon), |
| 6904 |
/* harmony export */ "ZN": () => (/* binding */ DotIcon), |
| 6905 |
/* harmony export */ "Ze": () => (/* binding */ EyeStrokeIcon), |
| 6906 |
/* harmony export */ "b0": () => (/* binding */ XIcon), |
| 6907 |
/* harmony export */ "by": () => (/* binding */ HelpIcon), |
| 6908 |
/* harmony export */ "dY": () => (/* binding */ EditIcon), |
| 6909 |
/* harmony export */ "dt": () => (/* binding */ AddIcon), |
| 6910 |
/* harmony export */ "eg": () => (/* binding */ GoogleCalendar), |
| 6911 |
/* harmony export */ "gB": () => (/* binding */ GoogleMeet), |
| 6912 |
/* harmony export */ "ig": () => (/* binding */ FeatureIcon), |
| 6913 |
/* harmony export */ "k1": () => (/* binding */ FilterIcon), |
| 6914 |
/* harmony export */ "pJ": () => (/* binding */ DeleteIcon), |
| 6915 |
/* harmony export */ "r7": () => (/* binding */ StarIcon), |
| 6916 |
/* harmony export */ "tB": () => (/* binding */ UserIcon) |
| 6917 |
/* harmony export */ }); |
| 6918 |
/* unused harmony exports Zoom, ArrowRightIcon2, ArrowLefttIcon, EyeFileIcon, calendarIcon, ClockIcon, CalendarIcon2, MoneyIcon, TicketIcon, ChairIcon, DollarIcon */ |
| 6919 |
// Optimized icon component |
| 6920 |
var EditIcon = function EditIcon(_ref) { |
| 6921 |
var _ref$color = _ref.color, |
| 6922 |
color = _ref$color === void 0 ? "#0A1018" : _ref$color, |
| 6923 |
_ref$width = _ref.width, |
| 6924 |
width = _ref$width === void 0 ? "18" : _ref$width, |
| 6925 |
_ref$height = _ref.height, |
| 6926 |
height = _ref$height === void 0 ? "18" : _ref$height; |
| 6927 |
return /*#__PURE__*/React.createElement("span", { |
| 6928 |
className: "anticon" |
| 6929 |
}, /*#__PURE__*/React.createElement("svg", { |
| 6930 |
width: width, |
| 6931 |
height: height, |
| 6932 |
viewBox: "0 0 18 18", |
| 6933 |
fill: color, |
| 6934 |
xmlns: "http://www.w3.org/2000/svg" |
| 6935 |
}, /*#__PURE__*/React.createElement("path", { |
| 6936 |
d: "M15.75 16.5H2.25C1.9425 16.5 1.6875 16.245 1.6875 15.9375C1.6875 15.63 1.9425 15.375 2.25 15.375H15.75C16.0575 15.375 16.3125 15.63 16.3125 15.9375C16.3125 16.245 16.0575 16.5 15.75 16.5Z" |
| 6937 |
}), /*#__PURE__*/React.createElement("path", { |
| 6938 |
d: "M14.2649 2.61C12.8099 1.155 11.3849 1.1175 9.89243 2.61L8.98493 3.5175C8.90993 3.5925 8.87993 3.7125 8.90993 3.8175C9.47993 5.805 11.0699 7.395 13.0574 7.965C13.0874 7.9725 13.1174 7.98 13.1474 7.98C13.2299 7.98 13.3049 7.95 13.3649 7.89L14.2649 6.9825C15.0074 6.2475 15.3674 5.535 15.3674 4.815C15.3749 4.0725 15.0149 3.3525 14.2649 2.61Z" |
| 6939 |
}), /*#__PURE__*/React.createElement("path", { |
| 6940 |
fillRule: "evenodd", |
| 6941 |
clipRule: "evenodd", |
| 6942 |
d: "M11.0775 8.31747C11.28 8.43748 11.49 8.54249 11.7075 8.64748C11.7367 8.66013 11.7655 8.67254 11.794 8.68469C12.0472 8.79272 12.1206 9.12682 11.926 9.32149L7.63497 13.6125C7.54497 13.71 7.35747 13.8 7.22248 13.8225L4.34251 14.2275C4.25251 14.2425 4.16247 14.25 4.07247 14.25C3.66749 14.25 3.29249 14.1075 3.0225 13.845C2.70746 13.5225 2.56501 13.0425 2.63999 12.5325L3.04497 9.65998C3.0675 9.53247 3.15749 9.34497 3.255 9.24749L7.55134 4.95113C7.74465 4.75781 8.07062 4.83089 8.18131 5.08088C8.19623 5.11457 8.21162 5.14844 8.2275 5.18248C8.33247 5.39248 8.43748 5.59497 8.5575 5.79749C8.65501 5.96249 8.75997 6.12749 8.84997 6.23998C8.95516 6.4013 9.07349 6.54288 9.14976 6.63421L9.165 6.65247C9.21751 6.71997 9.255 6.77248 9.27747 6.78749C9.52499 7.08749 9.80248 7.35747 10.05 7.56747C10.0827 7.6002 10.1132 7.62847 10.1366 7.64861C10.1561 7.66541 10.1707 7.67656 10.1775 7.67997C10.32 7.79997 10.47 7.91997 10.5975 8.00249C10.755 8.11498 10.9125 8.21997 11.0775 8.31747Z" |
| 6943 |
}))); |
| 6944 |
}; |
| 6945 |
var DeleteIcon = function DeleteIcon(_ref2) { |
| 6946 |
var _ref2$color = _ref2.color, |
| 6947 |
color = _ref2$color === void 0 ? "#FF3B30" : _ref2$color, |
| 6948 |
_ref2$width = _ref2.width, |
| 6949 |
width = _ref2$width === void 0 ? "18" : _ref2$width, |
| 6950 |
_ref2$height = _ref2.height, |
| 6951 |
height = _ref2$height === void 0 ? "18" : _ref2$height; |
| 6952 |
return /*#__PURE__*/React.createElement("span", { |
| 6953 |
className: "anticon" |
| 6954 |
}, /*#__PURE__*/React.createElement("svg", { |
| 6955 |
width: width, |
| 6956 |
height: height, |
| 6957 |
viewBox: "0 0 18 18", |
| 6958 |
xmlns: "http://www.w3.org/2000/svg", |
| 6959 |
fill: color |
| 6960 |
}, /*#__PURE__*/React.createElement("path", { |
| 6961 |
d: "M15.3031 4.46471C14.2251 4.35759 13.1472 4.27725 12.0626 4.21699V4.21029L11.9153 3.33991C11.8148 2.72395 11.6675 1.8 10.1009 1.8H8.3467C6.7867 1.8 6.6394 2.68377 6.53228 3.33321L6.39168 4.19021C5.76902 4.23038 5.14636 4.27055 4.5237 4.33081L3.15787 4.46471C2.87667 4.4915 2.67581 4.73922 2.70259 5.01373C2.72937 5.28823 2.9704 5.48909 3.2516 5.46231L4.61743 5.3284C8.12575 4.98025 11.6609 5.11416 15.2093 5.469C15.2294 5.469 15.2428 5.469 15.2629 5.469C15.5173 5.469 15.7383 5.27484 15.765 5.01373C15.7851 4.73922 15.5843 4.4915 15.3031 4.46471Z" |
| 6962 |
}), /*#__PURE__*/React.createElement("path", { |
| 6963 |
d: "M14.0712 6.41152C13.9105 6.24414 13.6896 6.15041 13.462 6.15041H4.99915C4.77151 6.15041 4.54387 6.24414 4.38988 6.41152C4.23589 6.5789 4.14885 6.80654 4.16224 7.04088L4.57734 13.9102C4.65099 14.9279 4.74473 16.2 7.08137 16.2H11.3797C13.7164 16.2 13.8101 14.9346 13.8838 13.9102L14.2989 7.04757C14.3123 6.80654 14.2252 6.5789 14.0712 6.41152ZM10.342 12.8457H8.11244C7.83794 12.8457 7.6103 12.618 7.6103 12.3435C7.6103 12.069 7.83794 11.8414 8.11244 11.8414H10.342C10.6165 11.8414 10.8441 12.069 10.8441 12.3435C10.8441 12.618 10.6165 12.8457 10.342 12.8457ZM10.9044 10.1676H7.55674C7.28223 10.1676 7.05459 9.93993 7.05459 9.66542C7.05459 9.39091 7.28223 9.16328 7.55674 9.16328H10.9044C11.1789 9.16328 11.4065 9.39091 11.4065 9.66542C11.4065 9.93993 11.1789 10.1676 10.9044 10.1676Z" |
| 6964 |
}))); |
| 6965 |
}; |
| 6966 |
var CloneIcon = function CloneIcon(_ref3) { |
| 6967 |
var _ref3$color = _ref3.color, |
| 6968 |
color = _ref3$color === void 0 ? "#0A1018" : _ref3$color, |
| 6969 |
_ref3$width = _ref3.width, |
| 6970 |
width = _ref3$width === void 0 ? "18" : _ref3$width, |
| 6971 |
_ref3$height = _ref3.height, |
| 6972 |
height = _ref3$height === void 0 ? "18" : _ref3$height; |
| 6973 |
return /*#__PURE__*/React.createElement("span", { |
| 6974 |
className: "anticon" |
| 6975 |
}, /*#__PURE__*/React.createElement("svg", { |
| 6976 |
width: width, |
| 6977 |
height: height, |
| 6978 |
viewBox: "0 0 18 18", |
| 6979 |
fill: color, |
| 6980 |
xmlns: "http://www.w3.org/2000/svg" |
| 6981 |
}, /*#__PURE__*/React.createElement("path", { |
| 6982 |
d: "M10.0297 4.2696V5.2344C8.14325 5.3856 7.07045 6.5952 7.07045 8.5896V11.88H4.26965C2.62085 11.88 1.80005 11.0592 1.80005 9.4104V4.2696C1.80005 2.6208 2.62085 1.8 4.26965 1.8H7.56005C9.20885 1.8 10.0297 2.6208 10.0297 4.2696Z" |
| 6983 |
}), /*#__PURE__*/React.createElement("path", { |
| 6984 |
d: "M13.7302 6.11999H10.4398C8.79102 6.11999 7.97021 6.94079 7.97021 8.5896V13.7304C7.97021 15.3792 8.79102 16.2 10.4398 16.2H13.7302C15.379 16.2 16.1998 15.3792 16.1998 13.7304V8.5896C16.1998 6.94079 15.379 6.11999 13.7302 6.11999ZM13.4134 11.7H12.7798V12.3336C12.7798 12.6288 12.535 12.8736 12.2398 12.8736C11.9446 12.8736 11.6998 12.6288 11.6998 12.3336V11.7H11.0662C10.771 11.7 10.5262 11.4552 10.5262 11.16C10.5262 10.8648 10.771 10.62 11.0662 10.62H11.6998V9.9864C11.6998 9.6912 11.9446 9.4464 12.2398 9.4464C12.535 9.4464 12.7798 9.6912 12.7798 9.9864V10.62H13.4134C13.7086 10.62 13.9534 10.8648 13.9534 11.16C13.9534 11.4552 13.7086 11.7 13.4134 11.7Z" |
| 6985 |
}))); |
| 6986 |
}; |
| 6987 |
var CardViewIcon = function CardViewIcon(_ref4) { |
| 6988 |
var _ref4$color = _ref4.color, |
| 6989 |
color = _ref4$color === void 0 ? "#0A1018" : _ref4$color, |
| 6990 |
_ref4$width = _ref4.width, |
| 6991 |
width = _ref4$width === void 0 ? "18" : _ref4$width, |
| 6992 |
_ref4$height = _ref4.height, |
| 6993 |
height = _ref4$height === void 0 ? "18" : _ref4$height; |
| 6994 |
return /*#__PURE__*/React.createElement("span", { |
| 6995 |
className: "anticon" |
| 6996 |
}, /*#__PURE__*/React.createElement("svg", { |
| 6997 |
width: width, |
| 6998 |
height: height, |
| 6999 |
viewBox: "0 0 18 18", |
| 7000 |
fill: color, |
| 7001 |
xmlns: "http://www.w3.org/2000/svg" |
| 7002 |
}, /*#__PURE__*/React.createElement("path", { |
| 7003 |
d: "M15.3001 6.8076V3.9474C15.3001 3.0591 14.8969 2.7 13.8952 2.7H11.35C10.3483 2.7 9.94507 3.0591 9.94507 3.9474V6.8013C9.94507 7.6959 10.3483 8.0487 11.35 8.0487H13.8952C14.8969 8.055 15.3001 7.6959 15.3001 6.8076Z" |
| 7004 |
}), /*#__PURE__*/React.createElement("path", { |
| 7005 |
d: "M15.3001 13.8951V11.3499C15.3001 10.3482 14.8969 9.945 13.8952 9.945H11.35C10.3483 9.945 9.94507 10.3482 9.94507 11.3499V13.8951C9.94507 14.8968 10.3483 15.3 11.35 15.3H13.8952C14.8969 15.3 15.3001 14.8968 15.3001 13.8951Z" |
| 7006 |
}), /*#__PURE__*/React.createElement("path", { |
| 7007 |
d: "M8.05495 6.8076V3.9474C8.05495 3.0591 7.65175 2.7 6.65005 2.7H4.10485C3.10315 2.7 2.69995 3.0591 2.69995 3.9474V6.8013C2.69995 7.6959 3.10315 8.0487 4.10485 8.0487H6.65005C7.65175 8.055 8.05495 7.6959 8.05495 6.8076Z" |
| 7008 |
}), /*#__PURE__*/React.createElement("path", { |
| 7009 |
d: "M8.05495 13.8951V11.3499C8.05495 10.3482 7.65175 9.945 6.65005 9.945H4.10485C3.10315 9.945 2.69995 10.3482 2.69995 11.3499V13.8951C2.69995 14.8968 3.10315 15.3 4.10485 15.3H6.65005C7.65175 15.3 8.05495 14.8968 8.05495 13.8951Z" |
| 7010 |
}))); |
| 7011 |
}; |
| 7012 |
var XIcon = function XIcon(_ref5) { |
| 7013 |
var _ref5$color = _ref5.color, |
| 7014 |
color = _ref5$color === void 0 ? "#0A1018" : _ref5$color, |
| 7015 |
_ref5$width = _ref5.width, |
| 7016 |
width = _ref5$width === void 0 ? "18" : _ref5$width, |
| 7017 |
_ref5$height = _ref5.height, |
| 7018 |
height = _ref5$height === void 0 ? "18" : _ref5$height; |
| 7019 |
return /*#__PURE__*/React.createElement("span", { |
| 7020 |
className: "anticon" |
| 7021 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7022 |
width: width, |
| 7023 |
height: height, |
| 7024 |
viewBox: "0 0 18 18", |
| 7025 |
fill: color, |
| 7026 |
xmlns: "http://www.w3.org/2000/svg" |
| 7027 |
}, /*#__PURE__*/React.createElement("path", { |
| 7028 |
d: "M14.1365 5.1364C14.488 4.78492 14.488 4.21508 14.1365 3.8636C13.785 3.51213 13.2152 3.51213 12.8637 3.8636L9.0001 7.72721L5.13649 3.8636C4.78502 3.51213 4.21517 3.51213 3.8637 3.8636C3.51223 4.21508 3.51223 4.78492 3.8637 5.1364L7.72731 9L3.8637 12.8636C3.51223 13.2151 3.51223 13.7849 3.8637 14.1364C4.21517 14.4879 4.78502 14.4879 5.13649 14.1364L9.0001 10.2728L12.8637 14.1364C13.2152 14.4879 13.785 14.4879 14.1365 14.1364C14.488 13.7849 14.488 13.2151 14.1365 12.8636L10.2729 9L14.1365 5.1364Z" |
| 7029 |
}))); |
| 7030 |
}; |
| 7031 |
var CloseFillIcon = function CloseFillIcon(_ref6) { |
| 7032 |
var _ref6$color = _ref6.color, |
| 7033 |
color = _ref6$color === void 0 ? "#0A1018" : _ref6$color, |
| 7034 |
_ref6$width = _ref6.width, |
| 7035 |
width = _ref6$width === void 0 ? "18" : _ref6$width, |
| 7036 |
_ref6$height = _ref6.height, |
| 7037 |
height = _ref6$height === void 0 ? "18" : _ref6$height; |
| 7038 |
return /*#__PURE__*/React.createElement("span", { |
| 7039 |
className: "anticon" |
| 7040 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7041 |
width: width, |
| 7042 |
height: height, |
| 7043 |
viewBox: "0 0 18 18", |
| 7044 |
fill: color, |
| 7045 |
xmlns: "http://www.w3.org/2000/svg" |
| 7046 |
}, /*#__PURE__*/React.createElement("path", { |
| 7047 |
d: "M8.9998 1.8C5.0326 1.8 1.7998 5.0328 1.7998 9C1.7998 12.9672 5.0326 16.2 8.9998 16.2C12.967 16.2 16.1998 12.9672 16.1998 9C16.1998 5.0328 12.967 1.8 8.9998 1.8ZM11.419 10.656C11.6278 10.8648 11.6278 11.2104 11.419 11.4192C11.311 11.5272 11.1742 11.5776 11.0374 11.5776C10.9006 11.5776 10.7638 11.5272 10.6558 11.4192L8.9998 9.7632L7.3438 11.4192C7.2358 11.5272 7.099 11.5776 6.9622 11.5776C6.8254 11.5776 6.6886 11.5272 6.5806 11.4192C6.3718 11.2104 6.3718 10.8648 6.5806 10.656L8.2366 9L6.5806 7.344C6.3718 7.1352 6.3718 6.7896 6.5806 6.5808C6.7894 6.372 7.135 6.372 7.3438 6.5808L8.9998 8.2368L10.6558 6.5808C10.8646 6.372 11.2102 6.372 11.419 6.5808C11.6278 6.7896 11.6278 7.1352 11.419 7.344L9.763 9L11.419 10.656Z" |
| 7048 |
}))); |
| 7049 |
}; |
| 7050 |
var DotIcon = function DotIcon(_ref7) { |
| 7051 |
var color = _ref7.color, |
| 7052 |
_ref7$width = _ref7.width, |
| 7053 |
width = _ref7$width === void 0 ? "18" : _ref7$width, |
| 7054 |
_ref7$height = _ref7.height, |
| 7055 |
height = _ref7$height === void 0 ? "18" : _ref7$height; |
| 7056 |
return /*#__PURE__*/React.createElement("span", { |
| 7057 |
className: "anticon" |
| 7058 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7059 |
width: width, |
| 7060 |
height: height, |
| 7061 |
viewBox: "0 0 20 20", |
| 7062 |
fill: color, |
| 7063 |
xmlns: "http://www.w3.org/2000/svg" |
| 7064 |
}, /*#__PURE__*/React.createElement("ellipse", { |
| 7065 |
cx: "16.5882", |
| 7066 |
cy: "10.4118", |
| 7067 |
rx: "1.41178", |
| 7068 |
ry: "1.41176", |
| 7069 |
transform: "rotate(90 16.5882 10.4118)" |
| 7070 |
}), /*#__PURE__*/React.createElement("ellipse", { |
| 7071 |
cx: "9.99986", |
| 7072 |
cy: "10.4118", |
| 7073 |
rx: "1.41178", |
| 7074 |
ry: "1.41176", |
| 7075 |
transform: "rotate(90 9.99986 10.4118)" |
| 7076 |
}), /*#__PURE__*/React.createElement("ellipse", { |
| 7077 |
cx: "3.41148", |
| 7078 |
cy: "10.4118", |
| 7079 |
rx: "1.41178", |
| 7080 |
ry: "1.41176", |
| 7081 |
transform: "rotate(90 3.41148 10.4118)" |
| 7082 |
}))); |
| 7083 |
}; |
| 7084 |
var AddIcon = function AddIcon(_ref8) { |
| 7085 |
var _ref8$color = _ref8.color, |
| 7086 |
color = _ref8$color === void 0 ? "#0A1018" : _ref8$color, |
| 7087 |
_ref8$width = _ref8.width, |
| 7088 |
width = _ref8$width === void 0 ? "18" : _ref8$width, |
| 7089 |
_ref8$height = _ref8.height, |
| 7090 |
height = _ref8$height === void 0 ? "18" : _ref8$height; |
| 7091 |
return /*#__PURE__*/React.createElement("span", { |
| 7092 |
className: "anticon" |
| 7093 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7094 |
width: width, |
| 7095 |
height: height, |
| 7096 |
viewBox: "0 0 18 18", |
| 7097 |
fill: color, |
| 7098 |
xmlns: "http://www.w3.org/2000/svg" |
| 7099 |
}, /*#__PURE__*/React.createElement("path", { |
| 7100 |
fillRule: "evenodd", |
| 7101 |
clipRule: "evenodd", |
| 7102 |
d: "M9.89995 3.6C9.89995 3.10294 9.49701 2.7 8.99995 2.7C8.50289 2.7 8.09995 3.10294 8.09995 3.6V8.1H3.59995C3.10289 8.1 2.69995 8.50294 2.69995 9C2.69995 9.49706 3.10289 9.9 3.59995 9.9H8.09995V14.4C8.09995 14.8971 8.50289 15.3 8.99995 15.3C9.49701 15.3 9.89995 14.8971 9.89995 14.4V9.9H14.4C14.897 9.9 15.3 9.49706 15.3 9C15.3 8.50294 14.897 8.1 14.4 8.1H9.89995V3.6Z" |
| 7103 |
}))); |
| 7104 |
}; |
| 7105 |
var SearchIcon = function SearchIcon(_ref9) { |
| 7106 |
var _ref9$color = _ref9.color, |
| 7107 |
color = _ref9$color === void 0 ? "#0A1018" : _ref9$color, |
| 7108 |
_ref9$width = _ref9.width, |
| 7109 |
width = _ref9$width === void 0 ? "18" : _ref9$width, |
| 7110 |
_ref9$height = _ref9.height, |
| 7111 |
height = _ref9$height === void 0 ? "18" : _ref9$height; |
| 7112 |
return /*#__PURE__*/React.createElement("span", { |
| 7113 |
className: "anticon" |
| 7114 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7115 |
width: width, |
| 7116 |
height: height, |
| 7117 |
viewBox: "0 0 20 20", |
| 7118 |
fill: color, |
| 7119 |
xmlns: "http://www.w3.org/2000/svg" |
| 7120 |
}, /*#__PURE__*/React.createElement("path", { |
| 7121 |
fillRule: "evenodd", |
| 7122 |
clipRule: "evenodd", |
| 7123 |
d: "M9.2 3.6C6.10721 3.6 3.6 6.10721 3.6 9.2C3.6 12.2928 6.10721 14.8 9.2 14.8C10.7086 14.8 12.0779 14.2035 13.0848 13.2334C13.1059 13.2059 13.1291 13.1795 13.1542 13.1543C13.1794 13.1291 13.2059 13.106 13.2333 13.0849C14.2034 12.0779 14.8 10.7086 14.8 9.2C14.8 6.10721 12.2928 3.6 9.2 3.6ZM14.8255 13.6942C15.8108 12.4624 16.4 10.9 16.4 9.2C16.4 5.22355 13.1765 2 9.2 2C5.22355 2 2 5.22355 2 9.2C2 13.1765 5.22355 16.4 9.2 16.4C10.9 16.4 12.4624 15.8108 13.6941 14.8256L16.6342 17.7657C16.9467 18.0781 17.4532 18.0781 17.7656 17.7657C18.078 17.4533 18.078 16.9467 17.7656 16.6343L14.8255 13.6942Z" |
| 7124 |
}))); |
| 7125 |
}; |
| 7126 |
var FilterIcon = function FilterIcon(_ref10) { |
| 7127 |
var _ref10$color = _ref10.color, |
| 7128 |
color = _ref10$color === void 0 ? "#0A1018" : _ref10$color, |
| 7129 |
_ref10$width = _ref10.width, |
| 7130 |
width = _ref10$width === void 0 ? "18" : _ref10$width, |
| 7131 |
_ref10$height = _ref10.height, |
| 7132 |
height = _ref10$height === void 0 ? "18" : _ref10$height; |
| 7133 |
return /*#__PURE__*/React.createElement("span", { |
| 7134 |
className: "anticon" |
| 7135 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7136 |
width: width, |
| 7137 |
height: height, |
| 7138 |
viewBox: "0 0 20 20", |
| 7139 |
fill: color, |
| 7140 |
xmlns: "http://www.w3.org/2000/svg" |
| 7141 |
}, /*#__PURE__*/React.createElement("path", { |
| 7142 |
d: "M11.6667 6.66667C11.6667 7.03486 11.9651 7.33333 12.3333 7.33333C12.7015 7.33333 13 7.03486 13 6.66667V5.33333H15.6667C16.0349 5.33333 16.3333 5.03486 16.3333 4.66667C16.3333 4.29848 16.0349 4 15.6667 4H13V2.66667C13 2.29848 12.7015 2 12.3333 2C11.9651 2 11.6667 2.29848 11.6667 2.66667V6.66667Z" |
| 7143 |
}), /*#__PURE__*/React.createElement("path", { |
| 7144 |
d: "M9.66667 9.33333C9.29848 9.33333 9 9.63181 9 10C9 10.3682 9.29848 10.6667 9.66667 10.6667H15.6667C16.0349 10.6667 16.3333 10.3682 16.3333 10C16.3333 9.63181 16.0349 9.33333 15.6667 9.33333H9.66667Z" |
| 7145 |
}), /*#__PURE__*/React.createElement("path", { |
| 7146 |
d: "M3 15.3333C3 14.9651 3.29848 14.6667 3.66667 14.6667H8.33333C8.70152 14.6667 9 14.9651 9 15.3333C9 15.7015 8.70152 16 8.33333 16H3.66667C3.29848 16 3 15.7015 3 15.3333Z" |
| 7147 |
}), /*#__PURE__*/React.createElement("path", { |
| 7148 |
d: "M11.6667 14.6667V13.3333C11.6667 12.9651 11.3682 12.6667 11 12.6667C10.6318 12.6667 10.3333 12.9651 10.3333 13.3333V17.3333C10.3333 17.7015 10.6318 18 11 18C11.3682 18 11.6667 17.7015 11.6667 17.3333V16H15.6667C16.0349 16 16.3333 15.7015 16.3333 15.3333C16.3333 14.9651 16.0349 14.6667 15.6667 14.6667H11.6667Z" |
| 7149 |
}), /*#__PURE__*/React.createElement("path", { |
| 7150 |
d: "M3 10C3 9.63181 3.29848 9.33333 3.66667 9.33333H6.33333V8C6.33333 7.63181 6.63181 7.33333 7 7.33333C7.36819 7.33333 7.66667 7.63181 7.66667 8V12C7.66667 12.3682 7.36819 12.6667 7 12.6667C6.63181 12.6667 6.33333 12.3682 6.33333 12V10.6667H3.66667C3.29848 10.6667 3 10.3682 3 10Z" |
| 7151 |
}), /*#__PURE__*/React.createElement("path", { |
| 7152 |
d: "M3 4.66667C3 4.29848 3.29848 4 3.66667 4H9.66667C10.0349 4 10.3333 4.29848 10.3333 4.66667C10.3333 5.03486 10.0349 5.33333 9.66667 5.33333H3.66667C3.29848 5.33333 3 5.03486 3 4.66667Z" |
| 7153 |
}))); |
| 7154 |
}; |
| 7155 |
var GroupPeopleIcon = function GroupPeopleIcon(_ref11) { |
| 7156 |
var _ref11$color = _ref11.color, |
| 7157 |
color = _ref11$color === void 0 ? "#0A1018" : _ref11$color, |
| 7158 |
_ref11$width = _ref11.width, |
| 7159 |
width = _ref11$width === void 0 ? "18" : _ref11$width, |
| 7160 |
_ref11$height = _ref11.height, |
| 7161 |
height = _ref11$height === void 0 ? "18" : _ref11$height; |
| 7162 |
return /*#__PURE__*/React.createElement("span", { |
| 7163 |
className: "anticon" |
| 7164 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7165 |
width: width, |
| 7166 |
height: height, |
| 7167 |
viewBox: "0 0 18 18", |
| 7168 |
fill: color, |
| 7169 |
xmlns: "http://www.w3.org/2000/svg" |
| 7170 |
}, /*#__PURE__*/React.createElement("path", { |
| 7171 |
fillRule: "evenodd", |
| 7172 |
clipRule: "evenodd", |
| 7173 |
d: "M8.90217 9.07826C7.38923 9.07826 6.16304 7.85207 6.16304 6.33913C6.16304 4.82619 7.38923 3.6 8.90217 3.6C8.93492 3.6 8.96753 3.60057 9 3.60171C9.03247 3.60057 9.06508 3.6 9.09783 3.6C10.6108 3.6 11.837 4.82619 11.837 6.33913C11.837 7.85207 10.6108 9.07826 9.09783 9.07826C9.06508 9.07826 9.03247 9.07769 9 9.07655C8.96753 9.07769 8.93492 9.07826 8.90217 9.07826ZM13.0601 14.5565H13.2557C13.6067 14.5565 13.8913 14.2719 13.8913 13.921C13.8913 11.8131 12.1836 10.1054 10.0758 10.1054H9.88013H8.11987H7.92422C5.81637 10.1054 4.1087 11.8131 4.1087 13.921C4.1087 14.2719 4.39331 14.5565 4.74426 14.5565H4.93991H13.0601ZM3.60795 14.5565H0.656965C0.295314 14.5565 0 14.2633 0 13.8996C0 11.9929 1.54504 10.4478 3.45173 10.4478H4.76566C4.81504 10.4478 4.86244 10.4498 4.91167 10.4519L4.91759 10.4521C4.00384 11.2353 3.42391 12.4016 3.42391 13.7005V13.8717C3.42391 14.1221 3.49239 14.3554 3.60795 14.5565ZM6.14806 8.37422C5.71365 8.80863 5.11447 9.07826 4.45109 9.07826C3.12646 9.07826 2.05435 8.00615 2.05435 6.68152C2.05435 5.3569 3.12646 4.28478 4.45109 4.28478C4.98179 4.28478 5.47184 4.45812 5.86987 4.74915C5.6195 5.22422 5.47826 5.76563 5.47826 6.33913C5.47826 7.10095 5.72649 7.80499 6.14806 8.37422ZM14.3921 14.5565H17.343C17.7047 14.5565 18 14.2633 18 13.8996C18 11.9929 16.455 10.4478 14.5483 10.4478H13.2343C13.185 10.4478 13.1376 10.4498 13.0883 10.4519L13.0824 10.4521C13.9962 11.2353 14.5761 12.4016 14.5761 13.7005V13.8717C14.5761 14.1221 14.5076 14.3554 14.3921 14.5565ZM11.8519 8.37422C12.2863 8.80863 12.8855 9.07826 13.5489 9.07826C14.8735 9.07826 15.9457 8.00615 15.9457 6.68152C15.9457 5.3569 14.8735 4.28478 13.5489 4.28478C13.0182 4.28478 12.5282 4.45812 12.1301 4.74915C12.3805 5.22422 12.5217 5.76563 12.5217 6.33913C12.5217 7.10095 12.2735 7.80499 11.8519 8.37422Z" |
| 7174 |
}))); |
| 7175 |
}; |
| 7176 |
var TwoPeopleIcon = function TwoPeopleIcon(_ref12) { |
| 7177 |
var _ref12$color = _ref12.color, |
| 7178 |
color = _ref12$color === void 0 ? "#0A1018" : _ref12$color, |
| 7179 |
_ref12$width = _ref12.width, |
| 7180 |
width = _ref12$width === void 0 ? "18" : _ref12$width, |
| 7181 |
_ref12$height = _ref12.height, |
| 7182 |
height = _ref12$height === void 0 ? "18" : _ref12$height; |
| 7183 |
return /*#__PURE__*/React.createElement("span", { |
| 7184 |
className: "anticon" |
| 7185 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7186 |
width: width, |
| 7187 |
height: height, |
| 7188 |
viewBox: "0 0 18 18", |
| 7189 |
fill: color, |
| 7190 |
xmlns: "http://www.w3.org/2000/svg" |
| 7191 |
}, /*#__PURE__*/React.createElement("path", { |
| 7192 |
d: "M9.9 5.4C9.9 7.38844 8.28844 9 6.3 9C4.31156 9 2.7 7.38844 2.7 5.4C2.7 3.41156 4.31156 1.8 6.3 1.8C8.28844 1.8 9.9 3.41156 9.9 5.4ZM0 15.3647C0 12.5944 2.24438 10.35 5.01469 10.35H7.58531C10.3556 10.35 12.6 12.5944 12.6 15.3647C12.6 15.8259 12.2259 16.2 11.7647 16.2H0.835313C0.374063 16.2 0 15.8259 0 15.3647ZM17.1366 16.2H13.2581C13.41 15.9356 13.5 15.6291 13.5 15.3V15.075C13.5 13.3678 12.7378 11.835 11.5369 10.8056C11.6044 10.8028 11.6691 10.8 11.7366 10.8H13.4634C15.9694 10.8 18 12.8306 18 15.3366C18 15.8147 17.6119 16.2 17.1366 16.2ZM12.15 9C11.2781 9 10.4906 8.64562 9.91969 8.07469C10.4738 7.32656 10.8 6.40125 10.8 5.4C10.8 4.64625 10.6144 3.93469 10.2853 3.31031C10.8084 2.92781 11.4525 2.7 12.15 2.7C13.8909 2.7 15.3 4.10906 15.3 5.85C15.3 7.59094 13.8909 9 12.15 9Z" |
| 7193 |
}))); |
| 7194 |
}; |
| 7195 |
var ClockIcon = function ClockIcon(_ref13) { |
| 7196 |
var _ref13$color = _ref13.color, |
| 7197 |
color = _ref13$color === void 0 ? "#0A1018" : _ref13$color, |
| 7198 |
_ref13$width = _ref13.width, |
| 7199 |
width = _ref13$width === void 0 ? "18" : _ref13$width, |
| 7200 |
_ref13$height = _ref13.height, |
| 7201 |
height = _ref13$height === void 0 ? "18" : _ref13$height; |
| 7202 |
return /*#__PURE__*/React.createElement("span", { |
| 7203 |
className: "anticon" |
| 7204 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7205 |
width: width, |
| 7206 |
height: height, |
| 7207 |
viewBox: "0 0 512 512", |
| 7208 |
fill: color, |
| 7209 |
xmlns: "http://www.w3.org/2000/svg" |
| 7210 |
}, /*#__PURE__*/React.createElement("path", { |
| 7211 |
d: "M256 512C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" |
| 7212 |
}))); |
| 7213 |
}; |
| 7214 |
var ArrowRightIcon = function ArrowRightIcon(_ref14) { |
| 7215 |
var _ref14$color = _ref14.color, |
| 7216 |
color = _ref14$color === void 0 ? "#0A1018" : _ref14$color, |
| 7217 |
_ref14$width = _ref14.width, |
| 7218 |
width = _ref14$width === void 0 ? "18" : _ref14$width, |
| 7219 |
_ref14$height = _ref14.height, |
| 7220 |
height = _ref14$height === void 0 ? "18" : _ref14$height; |
| 7221 |
return /*#__PURE__*/React.createElement("span", { |
| 7222 |
className: "anticon" |
| 7223 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7224 |
width: width, |
| 7225 |
height: height, |
| 7226 |
fill: color, |
| 7227 |
viewBox: "0 0 18 18", |
| 7228 |
xmlns: "http://www.w3.org/2000/svg" |
| 7229 |
}, /*#__PURE__*/React.createElement("path", { |
| 7230 |
fillRule: "evenodd", |
| 7231 |
clipRule: "evenodd", |
| 7232 |
d: "M5.39644 15.9806C5.00536 15.5907 5.00446 14.9575 5.39443 14.5664L10.8603 9.085L5.39443 3.60358C5.00446 3.2125 5.00536 2.57934 5.39644 2.18937C5.78751 1.7994 6.42068 1.80029 6.81065 2.19137L12.9806 8.3789C13.3698 8.76919 13.3698 9.40081 12.9806 9.79111L6.81065 15.9786C6.42068 16.3697 5.78751 16.3706 5.39644 15.9806Z" |
| 7233 |
}))); |
| 7234 |
}; |
| 7235 |
var ArrowRightIcon2 = function ArrowRightIcon2(_ref15) { |
| 7236 |
var _ref15$color = _ref15.color, |
| 7237 |
color = _ref15$color === void 0 ? "#0A1018" : _ref15$color, |
| 7238 |
_ref15$width = _ref15.width, |
| 7239 |
width = _ref15$width === void 0 ? "18" : _ref15$width, |
| 7240 |
_ref15$height = _ref15.height, |
| 7241 |
height = _ref15$height === void 0 ? "18" : _ref15$height; |
| 7242 |
return /*#__PURE__*/React.createElement("span", { |
| 7243 |
className: "anticon" |
| 7244 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7245 |
width: width, |
| 7246 |
height: height, |
| 7247 |
viewBox: "0 0 20 20", |
| 7248 |
fill: color, |
| 7249 |
xmlns: "http://www.w3.org/2000/svg" |
| 7250 |
}, /*#__PURE__*/React.createElement("path", { |
| 7251 |
d: "M2 9.85698H15.714M11.1428 16.714L17.9998 9.85698L11.1428 3", |
| 7252 |
stroke: "#0A1018", |
| 7253 |
"stroke-width": "2", |
| 7254 |
"stroke-linecap": "round", |
| 7255 |
"stroke-linejoin": "round" |
| 7256 |
}))); |
| 7257 |
}; |
| 7258 |
var ArrowLefttIcon = function ArrowLefttIcon(_ref16) { |
| 7259 |
var _ref16$color = _ref16.color, |
| 7260 |
color = _ref16$color === void 0 ? "#0A1018" : _ref16$color, |
| 7261 |
_ref16$width = _ref16.width, |
| 7262 |
width = _ref16$width === void 0 ? "18" : _ref16$width, |
| 7263 |
_ref16$height = _ref16.height, |
| 7264 |
height = _ref16$height === void 0 ? "18" : _ref16$height; |
| 7265 |
return /*#__PURE__*/React.createElement("span", { |
| 7266 |
className: "anticon" |
| 7267 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7268 |
width: width, |
| 7269 |
height: height, |
| 7270 |
viewBox: "0 0 20 20", |
| 7271 |
fill: color, |
| 7272 |
xmlns: "http://www.w3.org/2000/svg" |
| 7273 |
}, /*#__PURE__*/React.createElement("path", { |
| 7274 |
d: "M18 9.85698H4.28603M8.8572 16.714L2.00021 9.85698L8.8572 3", |
| 7275 |
stroke: "#0A1018", |
| 7276 |
"stroke-width": "2", |
| 7277 |
"stroke-linecap": "round", |
| 7278 |
"stroke-linejoin": "round" |
| 7279 |
}))); |
| 7280 |
}; |
| 7281 |
var HelpIcon = function HelpIcon(_ref17) { |
| 7282 |
var _ref17$color = _ref17.color, |
| 7283 |
color = _ref17$color === void 0 ? "#1890ff" : _ref17$color, |
| 7284 |
_ref17$width = _ref17.width, |
| 7285 |
width = _ref17$width === void 0 ? "20" : _ref17$width, |
| 7286 |
_ref17$height = _ref17.height, |
| 7287 |
height = _ref17$height === void 0 ? "20" : _ref17$height; |
| 7288 |
return /*#__PURE__*/React.createElement("span", { |
| 7289 |
className: "anticon" |
| 7290 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7291 |
width: width, |
| 7292 |
height: height, |
| 7293 |
fill: color, |
| 7294 |
viewBox: "0 0 20 20", |
| 7295 |
xmlns: "http://www.w3.org/2000/svg" |
| 7296 |
}, /*#__PURE__*/React.createElement("path", { |
| 7297 |
d: "M11.0482 4.59418H5.30125C5.06778 4.59418 4.84329 4.60316 4.62778 4.63012C2.21225 4.83678 1 6.26546 1 8.89818V12.4923C1 16.0865 2.43674 16.7963 5.30125 16.7963H5.66044C5.85799 16.7963 6.1184 16.9311 6.23513 17.0839L7.31269 18.5215C7.78861 19.1595 8.56086 19.1595 9.03678 18.5215L10.1143 17.0839C10.249 16.9042 10.4645 16.7963 10.689 16.7963H11.0482C13.6793 16.7963 15.107 15.5923 15.3136 13.1662C15.3405 12.9506 15.3495 12.726 15.3495 12.4923V8.89818C15.3495 6.03184 13.9127 4.59418 11.0482 4.59418ZM5.04084 11.7825C4.53798 11.7825 4.14288 11.3781 4.14288 10.884C4.14288 10.3898 4.54696 9.98541 5.04084 9.98541C5.53472 9.98541 5.9388 10.3898 5.9388 10.884C5.9388 11.3781 5.53472 11.7825 5.04084 11.7825ZM8.17474 11.7825C7.67188 11.7825 7.27677 11.3781 7.27677 10.884C7.27677 10.3898 7.68086 9.98541 8.17474 9.98541C8.66862 9.98541 9.0727 10.3898 9.0727 10.884C9.0727 11.3781 8.6776 11.7825 8.17474 11.7825ZM11.3176 11.7825C10.8148 11.7825 10.4196 11.3781 10.4196 10.884C10.4196 10.3898 10.8237 9.98541 11.3176 9.98541C11.8115 9.98541 12.2156 10.3898 12.2156 10.884C12.2156 11.3781 11.8115 11.7825 11.3176 11.7825Z", |
| 7298 |
fill: color |
| 7299 |
}), /*#__PURE__*/React.createElement("path", { |
| 7300 |
d: "M18.9422 5.304V8.89816C18.9422 10.6952 18.3855 11.9172 17.272 12.5912C17.0026 12.7529 16.6883 12.5372 16.6883 12.2227L16.6973 8.89816C16.6973 5.304 14.641 3.24635 11.0491 3.24635L5.58047 3.25533C5.26619 3.25533 5.05067 2.94084 5.21231 2.67128C5.88578 1.55709 7.10702 1 8.89398 1H14.641C17.5055 1 18.9422 2.43766 18.9422 5.304Z", |
| 7301 |
fill: color |
| 7302 |
}))); |
| 7303 |
}; |
| 7304 |
var DocumentIcon = function DocumentIcon(_ref18) { |
| 7305 |
var _ref18$color = _ref18.color, |
| 7306 |
color = _ref18$color === void 0 ? "#1890ff" : _ref18$color, |
| 7307 |
_ref18$width = _ref18.width, |
| 7308 |
width = _ref18$width === void 0 ? "18" : _ref18$width, |
| 7309 |
_ref18$height = _ref18.height, |
| 7310 |
height = _ref18$height === void 0 ? "18" : _ref18$height; |
| 7311 |
return /*#__PURE__*/React.createElement("span", { |
| 7312 |
className: "anticon" |
| 7313 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7314 |
width: width, |
| 7315 |
height: height, |
| 7316 |
fill: color, |
| 7317 |
viewBox: "0 0 18 18", |
| 7318 |
xmlns: "http://www.w3.org/2000/svg" |
| 7319 |
}, /*#__PURE__*/React.createElement("path", { |
| 7320 |
d: "M12.4115 0.188982C12.0428 -0.180018 11.4042 0.0719816 11.4042 0.584982V3.72598C11.4042 5.03998 12.5194 6.12898 13.8776 6.12898C14.732 6.13798 15.9192 6.13798 16.9356 6.13798C17.4482 6.13798 17.7181 5.53498 17.3583 5.17498C16.0631 3.86998 13.7427 1.52098 12.4115 0.188982Z", |
| 7321 |
fill: color |
| 7322 |
}), /*#__PURE__*/React.createElement("path", { |
| 7323 |
d: "M16.6398 7.371H14.0404C11.9088 7.371 10.1729 5.634 10.1729 3.501V0.9C10.1729 0.405 9.76819 0 9.27351 0H5.45997C2.68975 0 0.450195 1.8 0.450195 5.013V12.987C0.450195 16.2 2.68975 18 5.45997 18H12.5294C15.2996 18 17.5392 16.2 17.5392 12.987V8.271C17.5392 7.776 17.1344 7.371 16.6398 7.371ZM8.54498 14.175H4.9473C4.57854 14.175 4.27273 13.869 4.27273 13.5C4.27273 13.131 4.57854 12.825 4.9473 12.825H8.54498C8.91374 12.825 9.21955 13.131 9.21955 13.5C9.21955 13.869 8.91374 14.175 8.54498 14.175ZM10.3438 10.575H4.9473C4.57854 10.575 4.27273 10.269 4.27273 9.9C4.27273 9.531 4.57854 9.225 4.9473 9.225H10.3438C10.7126 9.225 11.0184 9.531 11.0184 9.9C11.0184 10.269 10.7126 10.575 10.3438 10.575Z", |
| 7324 |
fill: color |
| 7325 |
}))); |
| 7326 |
}; |
| 7327 |
var FeatureIcon = function FeatureIcon(_ref19) { |
| 7328 |
var _ref19$color = _ref19.color, |
| 7329 |
color = _ref19$color === void 0 ? "#1890ff" : _ref19$color, |
| 7330 |
_ref19$width = _ref19.width, |
| 7331 |
width = _ref19$width === void 0 ? "18" : _ref19$width, |
| 7332 |
_ref19$height = _ref19.height, |
| 7333 |
height = _ref19$height === void 0 ? "18" : _ref19$height; |
| 7334 |
return /*#__PURE__*/React.createElement("span", { |
| 7335 |
className: "anticon" |
| 7336 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7337 |
width: width, |
| 7338 |
height: height, |
| 7339 |
fill: color, |
| 7340 |
viewBox: "0 0 18 19", |
| 7341 |
xmlns: "http://www.w3.org/2000/svg" |
| 7342 |
}, /*#__PURE__*/React.createElement("path", { |
| 7343 |
fillRule: "evenodd", |
| 7344 |
clipRule: "evenodd", |
| 7345 |
d: "M13.5902 7.57803H16.1896C16.6843 7.57803 17.089 7.98303 17.089 8.47803V13.194C17.089 16.407 14.8494 18.207 12.0792 18.207H5.00977C2.23956 18.207 0 16.407 0 13.194V5.22003C0 2.00703 2.23956 0.207031 5.00977 0.207031H8.82332C9.318 0.207031 9.72274 0.612031 9.72274 1.10703V3.70803C9.72274 5.84103 11.4586 7.57803 13.5902 7.57803ZM11.9613 0.396012C11.5926 0.0270125 10.954 0.279013 10.954 0.792013V3.93301C10.954 5.24701 12.0693 6.33601 13.4274 6.33601C14.2818 6.34501 15.4689 6.34501 16.4852 6.34501H16.4854C16.998 6.34501 17.2679 5.74201 16.9081 5.38201C16.4894 4.96018 15.9637 4.42927 15.3988 3.85888L15.3932 3.85325L15.3913 3.85133L15.3905 3.8505L15.3902 3.85016C14.2096 2.65803 12.86 1.29526 11.9613 0.396012ZM3.0145 12.0732C3.0145 11.7456 3.28007 11.48 3.60768 11.48H5.32132V9.76639C5.32132 9.43879 5.58689 9.17321 5.9145 9.17321C6.2421 9.17321 6.50768 9.43879 6.50768 9.76639V11.48H8.22131C8.54892 11.48 8.8145 11.7456 8.8145 12.0732C8.8145 12.4008 8.54892 12.6664 8.22131 12.6664H6.50768V14.38C6.50768 14.7076 6.2421 14.9732 5.9145 14.9732C5.58689 14.9732 5.32132 14.7076 5.32132 14.38V12.6664H3.60768C3.28007 12.6664 3.0145 12.4008 3.0145 12.0732Z" |
| 7346 |
}))); |
| 7347 |
}; |
| 7348 |
var UserIcon = function UserIcon(_ref20) { |
| 7349 |
var _ref20$color = _ref20.color, |
| 7350 |
color = _ref20$color === void 0 ? "#0A1018" : _ref20$color, |
| 7351 |
_ref20$width = _ref20.width, |
| 7352 |
width = _ref20$width === void 0 ? "18" : _ref20$width, |
| 7353 |
_ref20$height = _ref20.height, |
| 7354 |
height = _ref20$height === void 0 ? "18" : _ref20$height; |
| 7355 |
return /*#__PURE__*/React.createElement("span", { |
| 7356 |
className: "anticon" |
| 7357 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7358 |
width: width, |
| 7359 |
height: height, |
| 7360 |
viewBox: "0 0 18 18", |
| 7361 |
fill: color, |
| 7362 |
xmlns: "http://www.w3.org/2000/svg" |
| 7363 |
}, /*#__PURE__*/React.createElement("path", { |
| 7364 |
d: "M12.6 5.4C12.6 7.38844 10.9884 9 8.99995 9C7.01151 9 5.39995 7.38844 5.39995 5.4C5.39995 3.41156 7.01151 1.8 8.99995 1.8C10.9884 1.8 12.6 3.41156 12.6 5.4ZM2.69995 15.3647C2.69995 12.5944 4.94433 10.35 7.71464 10.35H10.2853C13.0556 10.35 15.3 12.5944 15.3 15.3647C15.3 15.8259 14.9259 16.2 14.4646 16.2H3.53526C3.07401 16.2 2.69995 15.8259 2.69995 15.3647Z" |
| 7365 |
}))); |
| 7366 |
}; |
| 7367 |
var StarIcon = function StarIcon(_ref21) { |
| 7368 |
var _ref21$color = _ref21.color, |
| 7369 |
color = _ref21$color === void 0 ? "#0A1018" : _ref21$color, |
| 7370 |
_ref21$width = _ref21.width, |
| 7371 |
width = _ref21$width === void 0 ? "18" : _ref21$width, |
| 7372 |
_ref21$height = _ref21.height, |
| 7373 |
height = _ref21$height === void 0 ? "18" : _ref21$height; |
| 7374 |
return /*#__PURE__*/React.createElement("span", { |
| 7375 |
className: "anticon" |
| 7376 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7377 |
width: width, |
| 7378 |
height: height, |
| 7379 |
viewBox: "0 0 16 16", |
| 7380 |
fill: color, |
| 7381 |
xmlns: "http://www.w3.org/2000/svg" |
| 7382 |
}, /*#__PURE__*/React.createElement("path", { |
| 7383 |
fillRule: "evenodd", |
| 7384 |
clipRule: "evenodd", |
| 7385 |
d: "M7.31171 2.02343C7.31162 2.0236 7.31179 2.02326 7.31171 2.02343L6.02201 4.62263C5.87468 4.92425 5.63147 5.17748 5.3861 5.36081C5.13993 5.54473 4.83023 5.70415 4.50625 5.75958L4.50393 5.75998L2.16361 6.15179C2.1635 6.15181 2.16372 6.15177 2.16361 6.15179C1.53002 6.25828 1.36693 6.50183 1.33587 6.59987C1.30459 6.69855 1.29782 6.9928 1.75157 7.45002L3.57126 9.28367C3.82431 9.53866 3.99034 9.8757 4.08129 10.1958C4.17232 10.5163 4.20784 10.8891 4.13024 11.238L4.12926 11.2424L3.60828 13.5123C3.41655 14.3472 3.6249 14.5927 3.66782 14.6243C3.71125 14.6562 4.00801 14.7812 4.74106 14.3428L6.93988 13.0312C7.26577 12.8401 7.65149 12.7635 8.00114 12.7635C8.35019 12.7635 8.7366 12.8399 9.06146 13.0339L11.2546 14.3421C11.9945 14.7825 12.2905 14.6574 12.3319 14.6269C12.3723 14.5972 12.581 14.354 12.3884 13.5118L11.8665 11.238C11.7889 10.8891 11.8245 10.5163 11.9155 10.1958C12.0064 9.8757 12.1725 9.53866 12.4255 9.28367L14.2452 7.45002L14.2468 7.44842C14.7035 6.99134 14.695 6.69818 14.6641 6.60108C14.6326 6.50249 14.4678 6.25844 13.8335 6.15185C13.8334 6.15183 13.8336 6.15187 13.8335 6.15185L11.4929 5.75998C11.1659 5.70506 10.8538 5.54633 10.6055 5.36173C10.3584 5.17799 10.1149 4.92449 9.96747 4.62268L8.6765 2.02094C8.3757 1.41153 8.09125 1.33088 7.99747 1.33088C7.90253 1.33088 7.61609 1.41346 7.31171 2.02343ZM9.85875 1.42766C9.46248 0.625148 8.82618 0 7.99747 0C7.16976 0 6.53156 0.623978 6.13164 1.42576L4.83963 4.0296L4.83722 4.03449C4.80832 4.09396 4.72941 4.19465 4.59946 4.29174C4.47014 4.38837 4.35107 4.43598 4.28597 4.44735C4.28625 4.4473 4.28569 4.4474 4.28597 4.44735L1.94681 4.83897C1.08384 4.9839 0.325465 5.41322 0.0777134 6.19502C-0.169838 6.9762 0.200137 7.76883 0.817662 8.39109L2.63735 10.2247C2.69248 10.2803 2.76491 10.398 2.81154 10.5621C2.85778 10.7249 2.85924 10.8651 2.84182 10.9454L2.32152 13.2123C2.32153 13.2123 2.32152 13.2124 2.32152 13.2123C2.10238 14.1667 2.1655 15.1672 2.88932 15.6994C3.61265 16.2312 4.57794 15.9879 5.4151 15.4873L7.60408 14.1815C7.60462 14.1812 7.60516 14.1809 7.6057 14.1806C7.68372 14.1354 7.82555 14.0943 8.00114 14.0943C8.17856 14.0943 8.31677 14.1362 8.38814 14.1788L10.5823 15.4877C11.4199 15.9863 12.3865 16.2338 13.11 15.7023C13.8346 15.17 13.8937 14.1674 13.6754 13.2129L13.155 10.9453C13.1375 10.8651 13.139 10.7249 13.1852 10.5621C13.2319 10.398 13.3043 10.2803 13.3594 10.2247L15.1775 8.3927C15.1777 8.39248 15.1779 8.39227 15.1782 8.39206C15.7997 7.76975 16.171 6.9763 15.9214 6.19382C15.6722 5.41256 14.9126 4.98385 14.0503 4.83902L11.7096 4.44716C11.6403 4.43543 11.5191 4.38703 11.3897 4.29082C11.2597 4.19416 11.181 4.09375 11.1522 4.03449L9.85875 1.42766C9.85885 1.42786 9.85866 1.42746 9.85875 1.42766Z" |
| 7386 |
}))); |
| 7387 |
}; |
| 7388 |
var EyeFileIcon = function EyeFileIcon(_ref22) { |
| 7389 |
var _ref22$color = _ref22.color, |
| 7390 |
color = _ref22$color === void 0 ? "#0A1018" : _ref22$color, |
| 7391 |
_ref22$width = _ref22.width, |
| 7392 |
width = _ref22$width === void 0 ? "18" : _ref22$width, |
| 7393 |
_ref22$height = _ref22.height, |
| 7394 |
height = _ref22$height === void 0 ? "18" : _ref22$height; |
| 7395 |
return /*#__PURE__*/React.createElement("span", { |
| 7396 |
className: "anticon" |
| 7397 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7398 |
width: width, |
| 7399 |
height: height, |
| 7400 |
viewBox: "0 0 18 18", |
| 7401 |
fill: color, |
| 7402 |
xmlns: "http://www.w3.org/2000/svg" |
| 7403 |
}, /*#__PURE__*/React.createElement("path", { |
| 7404 |
d: "M16.4924 6.4332C14.6213 3.4929 11.8835 1.8 8.9999 1.8C7.5581 1.8 6.1568 2.2212 4.877 3.0069C3.5972 3.8007 2.447 4.959 1.5074 6.4332C0.697402 7.7049 0.697402 9.7704 1.5074 11.0421C3.3785 13.9905 6.1163 15.6753 8.9999 15.6753C10.4417 15.6753 11.843 15.2541 13.1228 14.4684C14.4026 13.6746 15.5528 12.5163 16.4924 11.0421C17.3024 9.7785 17.3024 7.7049 16.4924 6.4332ZM8.9999 12.0141C7.1855 12.0141 5.7275 10.548 5.7275 8.7417C5.7275 6.9354 7.1855 5.4693 8.9999 5.4693C10.8143 5.4693 12.2723 6.9354 12.2723 8.7417C12.2723 10.548 10.8143 12.0141 8.9999 12.0141Z" |
| 7405 |
}), /*#__PURE__*/React.createElement("path", { |
| 7406 |
d: "M9.00015 6.42507C7.72845 6.42507 6.69165 7.46186 6.69165 8.74167C6.69165 10.0134 7.72845 11.0502 9.00015 11.0502C10.2719 11.0502 11.3168 10.0134 11.3168 8.74167C11.3168 7.46996 10.2719 6.42507 9.00015 6.42507Z" |
| 7407 |
}))); |
| 7408 |
}; |
| 7409 |
var EyeStrokeIcon = function EyeStrokeIcon(_ref23) { |
| 7410 |
var _ref23$color = _ref23.color, |
| 7411 |
color = _ref23$color === void 0 ? "#0A1018" : _ref23$color, |
| 7412 |
_ref23$width = _ref23.width, |
| 7413 |
width = _ref23$width === void 0 ? "18" : _ref23$width, |
| 7414 |
_ref23$height = _ref23.height, |
| 7415 |
height = _ref23$height === void 0 ? "18" : _ref23$height; |
| 7416 |
return /*#__PURE__*/React.createElement("span", { |
| 7417 |
className: "anticon" |
| 7418 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7419 |
width: width, |
| 7420 |
height: height, |
| 7421 |
viewBox: "0 0 18 18", |
| 7422 |
fill: color, |
| 7423 |
xmlns: "http://www.w3.org/2000/svg" |
| 7424 |
}, /*#__PURE__*/React.createElement("path", { |
| 7425 |
fillRule: "evenodd", |
| 7426 |
clipRule: "evenodd", |
| 7427 |
d: "M8.99965 10.2677C9.8931 10.2677 10.6132 9.54762 10.6132 8.65417C10.6132 7.76071 9.8931 7.04065 8.99965 7.04065C8.10619 7.04065 7.38613 7.76071 7.38613 8.65417C7.38613 9.54762 8.10619 10.2677 8.99965 10.2677ZM8.99965 11.6177C10.6387 11.6177 11.9632 10.2932 11.9632 8.65417C11.9632 7.01513 10.6387 5.69065 8.99965 5.69065C7.36061 5.69065 6.03613 7.01513 6.03613 8.65417C6.03613 10.2932 7.36061 11.6177 8.99965 11.6177Z" |
| 7428 |
}), /*#__PURE__*/React.createElement("path", { |
| 7429 |
fillRule: "evenodd", |
| 7430 |
clipRule: "evenodd", |
| 7431 |
d: "M15.4021 10.0736L15.4032 10.0718C15.604 9.75728 15.7499 9.24465 15.7499 8.65002C15.7499 8.0554 15.604 7.54276 15.4032 7.22824L15.4021 7.22647C13.6881 4.53198 11.3494 3.15 8.9999 3.15C6.65044 3.15 4.31173 4.53198 2.59774 7.22647L2.59661 7.22824C2.39585 7.54276 2.2499 8.0554 2.2499 8.65002C2.2499 9.24465 2.39585 9.75728 2.59661 10.0718L2.59774 10.0736C4.31173 12.7681 6.65044 14.1501 8.9999 14.1501C11.3494 14.1501 13.6881 12.7681 15.4021 10.0736ZM1.45867 10.7982C0.713648 9.63097 0.713648 7.66908 1.45867 6.50189C3.35432 3.52182 6.07778 1.8 8.9999 1.8C11.922 1.8 14.6455 3.52182 16.5411 6.50189C17.2862 7.66908 17.2862 9.63097 16.5411 10.7982C14.6455 13.7782 11.922 15.5001 8.9999 15.5001C6.07778 15.5001 3.35432 13.7782 1.45867 10.7982Z" |
| 7432 |
}))); |
| 7433 |
}; |
| 7434 |
var GoogleMeet = function GoogleMeet() { |
| 7435 |
return /*#__PURE__*/React.createElement("svg", { |
| 7436 |
width: "20", |
| 7437 |
height: "20", |
| 7438 |
viewBox: "0 0 20 20", |
| 7439 |
fill: "none", |
| 7440 |
xmlns: "http://www.w3.org/2000/svg" |
| 7441 |
}, /*#__PURE__*/React.createElement("path", { |
| 7442 |
d: "M11.1816 10.4049L12.9362 12.4103L15.2955 13.9181L15.7068 10.4172L15.2955 6.99451L12.8909 8.31916L11.1816 10.4049Z", |
| 7443 |
fill: "#00832D" |
| 7444 |
}), /*#__PURE__*/React.createElement("path", { |
| 7445 |
d: "M1 13.5931V16.5756C1 17.2575 1.55228 17.8097 2.23414 17.8097H5.21666L5.83373 15.5554L5.21666 13.5931L3.17004 12.976L1 13.5931Z", |
| 7446 |
fill: "#0066DA" |
| 7447 |
}), /*#__PURE__*/React.createElement("path", { |
| 7448 |
d: "M5.21666 3L1 7.21666L3.17004 7.83373L5.21666 7.21666L5.82345 5.28111L5.21666 3Z", |
| 7449 |
fill: "#E94235" |
| 7450 |
}), /*#__PURE__*/React.createElement("path", { |
| 7451 |
d: "M5.21666 7.21666H1V13.5931H5.21666V7.21666Z", |
| 7452 |
fill: "#2684FC" |
| 7453 |
}), /*#__PURE__*/React.createElement("path", { |
| 7454 |
d: "M17.9902 4.78541L15.2956 6.99453V13.9181L18.0025 16.1375C18.4077 16.4542 19.0001 16.1652 19.0001 15.65V5.26261C19.0001 4.74118 18.3944 4.45527 17.9902 4.78541ZM11.1818 10.4049V13.5931H5.2168V17.8097H14.0615C14.7434 17.8097 15.2956 17.2575 15.2956 16.5756V13.9181L11.1818 10.4049Z", |
| 7455 |
fill: "#00AC47" |
| 7456 |
}), /*#__PURE__*/React.createElement("path", { |
| 7457 |
d: "M14.0615 3H5.2168V7.21666H11.1818V10.4049L15.2956 6.99657V4.23414C15.2956 3.55228 14.7434 3 14.0615 3Z", |
| 7458 |
fill: "#FFBA00" |
| 7459 |
})); |
| 7460 |
}; |
| 7461 |
var Location = function Location(_ref24) { |
| 7462 |
var _ref24$color = _ref24.color, |
| 7463 |
color = _ref24$color === void 0 ? "#0A1018" : _ref24$color, |
| 7464 |
_ref24$width = _ref24.width, |
| 7465 |
width = _ref24$width === void 0 ? "20" : _ref24$width, |
| 7466 |
_ref24$height = _ref24.height, |
| 7467 |
height = _ref24$height === void 0 ? "20" : _ref24$height; |
| 7468 |
return /*#__PURE__*/React.createElement("span", { |
| 7469 |
className: "anticon" |
| 7470 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7471 |
width: width, |
| 7472 |
height: height, |
| 7473 |
viewBox: "0 0 20 20", |
| 7474 |
fill: color, |
| 7475 |
xmlns: "http://www.w3.org/2000/svg" |
| 7476 |
}, /*#__PURE__*/React.createElement("path", { |
| 7477 |
d: "M9.98574 1C8.0012 1.00218 6.09855 1.79146 4.6952 3.19467C3.29184 4.59788 2.50238 6.50045 2.5 8.48499C2.5 10.4125 3.9925 13.429 6.93624 17.4505C7.28669 17.9306 7.74553 18.3211 8.27544 18.5904C8.80535 18.8597 9.39135 19 9.98574 19C10.5801 19 11.1661 18.8597 11.696 18.5904C12.2259 18.3211 12.6848 17.9306 13.0352 17.4505C15.979 13.429 17.4715 10.4125 17.4715 8.48499C17.4691 6.50045 16.6796 4.59788 15.2763 3.19467C13.8729 1.79146 11.9703 1.00218 9.98574 1ZM9.98574 11.4685C9.3924 11.4685 8.81238 11.2925 8.31903 10.9629C7.82568 10.6332 7.44117 10.1647 7.2141 9.61654C6.98704 9.06836 6.92763 8.46516 7.04339 7.88322C7.15914 7.30128 7.44486 6.76673 7.86442 6.34717C8.28398 5.92761 8.81853 5.64189 9.40047 5.52614C9.98241 5.41038 10.5856 5.46979 11.1338 5.69685C11.682 5.92392 12.1505 6.30843 12.4801 6.80178C12.8098 7.29513 12.9857 7.87515 12.9857 8.46849C12.9857 9.26414 12.6697 10.0272 12.1071 10.5898C11.5444 11.1524 10.7814 11.4685 9.98574 11.4685Z" |
| 7478 |
}))); |
| 7479 |
}; |
| 7480 |
var Phone = function Phone(_ref25) { |
| 7481 |
var _ref25$color = _ref25.color, |
| 7482 |
color = _ref25$color === void 0 ? "#0A1018" : _ref25$color, |
| 7483 |
_ref25$width = _ref25.width, |
| 7484 |
width = _ref25$width === void 0 ? "20" : _ref25$width, |
| 7485 |
_ref25$height = _ref25.height, |
| 7486 |
height = _ref25$height === void 0 ? "20" : _ref25$height; |
| 7487 |
return /*#__PURE__*/React.createElement("span", { |
| 7488 |
className: "anticon" |
| 7489 |
}, /*#__PURE__*/React.createElement("svg", { |
| 7490 |
width: width, |
| 7491 |
height: height, |
| 7492 |
viewBox: "0 0 20 20", |
| 7493 |
fill: color, |
| 7494 |
xmlns: "http://www.w3.org/2000/svg" |
| 7495 |
}, /*#__PURE__*/React.createElement("path", { |
| 7496 |
d: "M18.2201 9.24952C18.0212 9.24952 17.8305 9.17052 17.6899 9.0299C17.5493 8.88928 17.4703 8.69855 17.4703 8.49968C17.4687 6.90922 16.8362 5.38435 15.7115 4.25972C14.5869 3.13509 13.062 2.50258 11.4716 2.50099C11.2727 2.50099 11.082 2.42199 10.9414 2.28137C10.8007 2.14075 10.7217 1.95003 10.7217 1.75116C10.7217 1.55229 10.8007 1.36156 10.9414 1.22094C11.082 1.08032 11.2727 1.00132 11.4716 1.00132C13.4596 1.0035 15.3656 1.79421 16.7713 3.19995C18.177 4.60569 18.9678 6.51166 18.9699 8.49968C18.9699 8.69855 18.8909 8.88928 18.7503 9.0299C18.6097 9.17052 18.419 9.24952 18.2201 9.24952ZM15.9706 8.49968C15.9706 7.30647 15.4966 6.16213 14.6529 5.3184C13.8091 4.47467 12.6648 4.00067 11.4716 4.00067C11.2727 4.00067 11.082 4.07967 10.9414 4.22029C10.8007 4.36091 10.7217 4.55163 10.7217 4.7505C10.7217 4.94937 10.8007 5.14009 10.9414 5.28072C11.082 5.42134 11.2727 5.50034 11.4716 5.50034C12.267 5.50034 13.0299 5.81634 13.5924 6.37883C14.1549 6.94131 14.4709 7.70421 14.4709 8.49968C14.4709 8.69855 14.5499 8.88928 14.6905 9.0299C14.8312 9.17052 15.0219 9.24952 15.2208 9.24952C15.4196 9.24952 15.6103 9.17052 15.751 9.0299C15.8916 8.88928 15.9706 8.69855 15.9706 8.49968ZM17.6075 17.6207L18.2898 16.8341C18.7241 16.3984 18.968 15.8083 18.968 15.1931C18.968 14.5779 18.7241 13.9878 18.2898 13.5521C18.2666 13.5288 16.4625 12.1409 16.4625 12.1409C16.0295 11.7287 15.4544 11.4992 14.8566 11.5001C14.2588 11.5009 13.6843 11.732 13.2524 12.1454L11.8232 13.3496C10.6566 12.8668 9.59689 12.1583 8.70489 11.2647C7.81288 10.3712 7.10618 9.31021 6.62538 8.14276L7.82512 6.71807C8.23881 6.2863 8.4702 5.7117 8.47118 5.11373C8.47215 4.51575 8.24265 3.9404 7.83037 3.50727C7.83037 3.50727 6.44092 1.70542 6.41767 1.68217C5.98986 1.25158 5.4098 1.00658 4.80285 1.00013C4.19589 0.993677 3.61076 1.22628 3.17388 1.64768L2.31157 2.39752C-2.78282 8.30773 8.18729 19.1931 14.2925 18.9974C14.909 19.001 15.5199 18.881 16.0893 18.6445C16.6587 18.4081 17.1749 18.06 17.6075 17.6207Z" |
| 7497 |
}))); |
| 7498 |
}; |
| 7499 |
var GoogleCalendar = function GoogleCalendar() { |
| 7500 |
return /*#__PURE__*/React.createElement("svg", { |
| 7501 |
width: "20", |
| 7502 |
height: "20", |
| 7503 |
viewBox: "0 0 20 20", |
| 7504 |
fill: "none", |
| 7505 |
xmlns: "http://www.w3.org/2000/svg" |
| 7506 |
}, /*#__PURE__*/React.createElement("path", { |
| 7507 |
d: "M14.7388 5.26241L10.4758 4.78874L5.26526 5.26241L4.7915 9.99925L5.26517 14.7361L10.002 15.3282L14.7388 14.7361L15.2125 9.8809L14.7388 5.26241Z", |
| 7508 |
fill: "white" |
| 7509 |
}), /*#__PURE__*/React.createElement("path", { |
| 7510 |
d: "M7.21058 12.6124C6.85653 12.3732 6.61137 12.0239 6.47754 11.562L7.29941 11.2233C7.37402 11.5075 7.50425 11.7278 7.69019 11.8841C7.87496 12.0404 8.09995 12.1174 8.36284 12.1174C8.63167 12.1174 8.86261 12.0357 9.05557 11.8722C9.24852 11.7088 9.34572 11.5003 9.34572 11.2482C9.34572 10.99 9.24384 10.7792 9.04018 10.6158C8.83651 10.4525 8.58073 10.3707 8.27518 10.3707H7.80035V9.55717H8.22658C8.48947 9.55717 8.71096 9.48616 8.89096 9.34405C9.07096 9.20194 9.16096 9.00772 9.16096 8.76022C9.16096 8.54 9.08041 8.36468 8.9194 8.23328C8.75839 8.10188 8.55463 8.03555 8.30713 8.03555C8.06557 8.03555 7.8737 8.09954 7.73159 8.2286C7.58948 8.35766 7.48643 8.51633 7.42136 8.70344L6.60786 8.36477C6.71559 8.05922 6.91341 7.78922 7.20347 7.55595C7.49363 7.32267 7.86425 7.2054 8.31424 7.2054C8.64697 7.2054 8.94658 7.26939 9.21189 7.39845C9.47712 7.52751 9.68556 7.70633 9.83595 7.93367C9.98634 8.16218 10.0609 8.41805 10.0609 8.70218C10.0609 8.99233 9.99111 9.2374 9.85134 9.43873C9.71157 9.64006 9.53985 9.79396 9.33618 9.90177V9.95028C9.60501 10.0628 9.82407 10.2345 9.99696 10.4654C10.1687 10.6964 10.2551 10.9723 10.2551 11.2944C10.2551 11.6165 10.1734 11.9043 10.0099 12.1565C9.84648 12.4088 9.62031 12.6077 9.33375 12.7521C9.04603 12.8966 8.72275 12.97 8.36392 12.97C7.94831 12.9712 7.56464 12.8516 7.21058 12.6124Z", |
| 7511 |
fill: "#1A73E8" |
| 7512 |
}), /*#__PURE__*/React.createElement("path", { |
| 7513 |
d: "M12.2531 8.5348L11.3555 9.1873L10.9043 8.50285L12.5231 7.33521H13.1437V12.8429H12.2531V8.5348Z", |
| 7514 |
fill: "#1A73E8" |
| 7515 |
}), /*#__PURE__*/React.createElement("path", { |
| 7516 |
d: "M14.7388 18.9995L19.0019 14.7364L16.8704 13.7891L14.7388 14.7364L13.7915 16.8679L14.7388 18.9995Z", |
| 7517 |
fill: "#EA4335" |
| 7518 |
}), /*#__PURE__*/React.createElement("path", { |
| 7519 |
d: "M4.3125 16.8685L5.25983 19H14.7334V14.7369H5.25983L4.3125 16.8685Z", |
| 7520 |
fill: "#34A853" |
| 7521 |
}), /*#__PURE__*/React.createElement("path", { |
| 7522 |
d: "M2.421 1C1.63593 1 1 1.63593 1 2.421V14.7367L3.13154 15.684L5.26308 14.7367V5.26308H14.7367L15.684 3.13154L14.7368 1H2.421Z", |
| 7523 |
fill: "#4285F4" |
| 7524 |
}), /*#__PURE__*/React.createElement("path", { |
| 7525 |
d: "M1 14.7369V17.579C1 18.3641 1.63593 19 2.421 19H5.26308V14.7369H1Z", |
| 7526 |
fill: "#188038" |
| 7527 |
}), /*#__PURE__*/React.createElement("path", { |
| 7528 |
d: "M14.7393 5.26249V14.7361H19.0023V5.26249L16.8708 4.31516L14.7393 5.26249Z", |
| 7529 |
fill: "#FBBC04" |
| 7530 |
}), /*#__PURE__*/React.createElement("path", { |
| 7531 |
d: "M19.0023 5.26308V2.421C19.0023 1.63584 18.3664 1 17.5813 1H14.7393V5.26308H19.0023Z", |
| 7532 |
fill: "#1967D2" |
| 7533 |
})); |
| 7534 |
}; |
| 7535 |
var Zoom = function Zoom() { |
| 7536 |
return /*#__PURE__*/React.createElement("svg", { |
| 7537 |
width: "20", |
| 7538 |
height: "20", |
| 7539 |
viewBox: "0 0 20 20", |
| 7540 |
fill: "none", |
| 7541 |
xmlns: "http://www.w3.org/2000/svg" |
| 7542 |
}, /*#__PURE__*/React.createElement("path", { |
| 7543 |
d: "M17.2165 18H4.30818C3.45491 18 2.64541 17.5519 2.2516 16.7869C1.80309 15.9126 1.96718 14.8634 2.65635 14.1748L11.6375 5.20219H5.20519C3.43304 5.20219 2 3.7705 2 2H13.8909C14.7442 2 15.5537 2.44809 15.9475 3.21311C16.396 4.08743 16.2319 5.13661 15.5428 5.82514L6.56165 14.7978H14.0113C15.7834 14.7978 17.2165 16.2295 17.2165 18Z", |
| 7544 |
fill: "#0B5CFF" |
| 7545 |
})); |
| 7546 |
}; |
| 7547 |
var OverviewMoneyIcon = function OverviewMoneyIcon() { |
| 7548 |
return /*#__PURE__*/React.createElement("svg", { |
| 7549 |
width: "70", |
| 7550 |
height: "70", |
| 7551 |
viewBox: "0 0 70 70", |
| 7552 |
fill: "none", |
| 7553 |
xmlns: "http://www.w3.org/2000/svg" |
| 7554 |
}, /*#__PURE__*/React.createElement("circle", { |
| 7555 |
opacity: "0.15", |
| 7556 |
cx: "35", |
| 7557 |
cy: "35", |
| 7558 |
r: "35", |
| 7559 |
fill: "#F07B27" |
| 7560 |
}), /*#__PURE__*/React.createElement("path", { |
| 7561 |
d: "M33.9497 29.5122V33.5162L32.5357 33.0262C31.8217 32.7742 31.3877 32.5362 31.3877 31.3182C31.3877 30.3242 32.1297 29.5122 33.0397 29.5122H33.9497V29.5122Z", |
| 7562 |
fill: "#F07B27" |
| 7563 |
}), /*#__PURE__*/React.createElement("path", { |
| 7564 |
d: "M38.6118 38.6821C38.6118 39.6761 37.8698 40.4881 36.9598 40.4881H36.0498V36.4841L37.4638 36.9741C38.1778 37.2261 38.6118 37.4641 38.6118 38.6821Z", |
| 7565 |
fill: "#F07B27" |
| 7566 |
}), /*#__PURE__*/React.createElement("path", { |
| 7567 |
d: "M40.866 21H29.134C24.038 21 21 24.038 21 29.134V40.866C21 45.962 24.038 49 29.134 49H40.866C45.962 49 49 45.962 49 40.866V29.134C49 24.038 45.962 21 40.866 21ZM38.164 35C39.256 35.378 40.712 36.176 40.712 38.682C40.712 40.838 39.032 42.588 36.96 42.588H36.05V43.4C36.05 43.974 35.574 44.45 35 44.45C34.426 44.45 33.95 43.974 33.95 43.4V42.588H33.446C31.15 42.588 29.288 40.642 29.288 38.262C29.288 37.688 29.75 37.212 30.338 37.212C30.912 37.212 31.388 37.688 31.388 38.262C31.388 39.494 32.312 40.488 33.446 40.488H33.95V35.742L31.836 35C30.744 34.622 29.288 33.824 29.288 31.318C29.288 29.162 30.968 27.412 33.04 27.412H33.95V26.6C33.95 26.026 34.426 25.55 35 25.55C35.574 25.55 36.05 26.026 36.05 26.6V27.412H36.554C38.85 27.412 40.712 29.358 40.712 31.738C40.712 32.312 40.25 32.788 39.662 32.788C39.088 32.788 38.612 32.312 38.612 31.738C38.612 30.506 37.688 29.512 36.554 29.512H36.05V34.258L38.164 35Z", |
| 7568 |
fill: "#F07B27" |
| 7569 |
})); |
| 7570 |
}; |
| 7571 |
var OverviewPersonIcon = function OverviewPersonIcon() { |
| 7572 |
return /*#__PURE__*/React.createElement("svg", { |
| 7573 |
width: "70", |
| 7574 |
height: "70", |
| 7575 |
viewBox: "0 0 70 70", |
| 7576 |
fill: "none", |
| 7577 |
xmlns: "http://www.w3.org/2000/svg" |
| 7578 |
}, /*#__PURE__*/React.createElement("circle", { |
| 7579 |
opacity: "0.15", |
| 7580 |
cx: "35", |
| 7581 |
cy: "35", |
| 7582 |
r: "35", |
| 7583 |
fill: "#01AF28" |
| 7584 |
}), /*#__PURE__*/React.createElement("path", { |
| 7585 |
d: "M36.4 29.4C36.4 32.4931 33.8931 35 30.8 35C27.7069 35 25.2 32.4931 25.2 29.4C25.2 26.3069 27.7069 23.8 30.8 23.8C33.8931 23.8 36.4 26.3069 36.4 29.4ZM21 44.9006C21 40.5913 24.4913 37.1 28.8006 37.1H32.7994C37.1088 37.1 40.6 40.5913 40.6 44.9006C40.6 45.6181 40.0181 46.2 39.3006 46.2H22.2994C21.5819 46.2 21 45.6181 21 44.9006ZM47.6569 46.2H41.6238C41.86 45.7888 42 45.3119 42 44.8V44.45C42 41.7944 40.8144 39.41 38.9463 37.8088C39.0513 37.8044 39.1519 37.8 39.2569 37.8H41.9431C45.8413 37.8 49 40.9588 49 44.8569C49 45.6006 48.3962 46.2 47.6569 46.2ZM39.9 35C38.5437 35 37.3188 34.4488 36.4306 33.5606C37.2925 32.3969 37.8 30.9575 37.8 29.4C37.8 28.2275 37.5113 27.1206 36.9994 26.1494C37.8131 25.5544 38.815 25.2 39.9 25.2C42.6081 25.2 44.8 27.3919 44.8 30.1C44.8 32.8081 42.6081 35 39.9 35Z", |
| 7586 |
fill: "#01AF28" |
| 7587 |
})); |
| 7588 |
}; |
| 7589 |
var OverviewUserIcon = function OverviewUserIcon() { |
| 7590 |
return /*#__PURE__*/React.createElement("svg", { |
| 7591 |
width: "70", |
| 7592 |
height: "70", |
| 7593 |
viewBox: "0 0 70 70", |
| 7594 |
fill: "none", |
| 7595 |
xmlns: "http://www.w3.org/2000/svg" |
| 7596 |
}, /*#__PURE__*/React.createElement("circle", { |
| 7597 |
opacity: "0.17", |
| 7598 |
cx: "35", |
| 7599 |
cy: "35", |
| 7600 |
r: "35", |
| 7601 |
fill: "#AB2BE7" |
| 7602 |
}), /*#__PURE__*/React.createElement("path", { |
| 7603 |
d: "M40.0604 23.2728H29.3947C24.7619 23.2728 22 26.0346 22 30.6675V41.3332C22 44.9096 23.6419 47.366 26.531 48.2951C27.371 48.5879 28.3383 48.7279 29.3947 48.7279H40.0604C41.1168 48.7279 42.0841 48.5879 42.9241 48.2951C45.8133 47.366 47.4551 44.9096 47.4551 41.3332V30.6675C47.4551 26.0346 44.6932 23.2728 40.0604 23.2728ZM45.546 41.3332C45.546 44.0568 44.4769 45.7751 42.3259 46.4878C41.0913 44.0568 38.164 42.3259 34.7276 42.3259C31.2911 42.3259 28.3765 44.0441 27.1292 46.4878H27.1165C24.991 45.8005 23.9091 44.0696 23.9091 41.3459V30.6675C23.9091 27.0783 25.8055 25.1819 29.3947 25.1819H40.0604C43.6496 25.1819 45.546 27.0783 45.546 30.6675V41.3332Z", |
| 7604 |
fill: "#AB2BE7" |
| 7605 |
}), /*#__PURE__*/React.createElement("path", { |
| 7606 |
d: "M34.7298 30.9093C32.2097 30.9093 30.1733 32.9457 30.1733 35.4658C30.1733 37.9858 32.2097 40.0349 34.7298 40.0349C37.2499 40.0349 39.2863 37.9858 39.2863 35.4658C39.2863 32.9457 37.2499 30.9093 34.7298 30.9093Z", |
| 7607 |
fill: "#AB2BE7" |
| 7608 |
}), /*#__PURE__*/React.createElement("circle", { |
| 7609 |
cx: "44.9096", |
| 7610 |
cy: "27.091", |
| 7611 |
r: "3.81827", |
| 7612 |
fill: "white" |
| 7613 |
}), /*#__PURE__*/React.createElement("path", { |
| 7614 |
fillRule: "evenodd", |
| 7615 |
clipRule: "evenodd", |
| 7616 |
d: "M44.9089 32.182C47.7206 32.182 49.9999 29.9027 49.9999 27.091C49.9999 24.2793 47.7206 22 44.9089 22C42.0972 22 39.8179 24.2793 39.8179 27.091C39.8179 29.9027 42.0972 32.182 44.9089 32.182ZM43.9644 25.1923C43.9644 24.6651 44.3917 24.2377 44.9189 24.2377C45.4461 24.2377 45.8735 24.6651 45.8735 25.1923V26.1469H46.8281C47.3552 26.1469 47.7826 26.5742 47.7826 27.1014C47.7826 27.6286 47.3552 28.056 46.8281 28.056H45.8735V29.0106C45.8735 29.5378 45.4461 29.9651 44.9189 29.9651C44.3917 29.9651 43.9644 29.5378 43.9644 29.0106V28.056H43.0098C42.4826 28.056 42.0552 27.6286 42.0552 27.1014C42.0552 26.5742 42.4826 26.1469 43.0098 26.1469H43.9644V25.1923Z", |
| 7617 |
fill: "#AB2BE7" |
| 7618 |
})); |
| 7619 |
}; |
| 7620 |
var OverviewCalendarIcon = function OverviewCalendarIcon() { |
| 7621 |
return /*#__PURE__*/React.createElement("svg", { |
| 7622 |
width: "70", |
| 7623 |
height: "70", |
| 7624 |
viewBox: "0 0 70 70", |
| 7625 |
fill: "none", |
| 7626 |
xmlns: "http://www.w3.org/2000/svg" |
| 7627 |
}, /*#__PURE__*/React.createElement("circle", { |
| 7628 |
opacity: "0.15", |
| 7629 |
cx: "35", |
| 7630 |
cy: "35", |
| 7631 |
r: "35", |
| 7632 |
fill: "#24A4EC" |
| 7633 |
}), /*#__PURE__*/React.createElement("path", { |
| 7634 |
d: "M41.5614 24.1171V22.0121C41.5614 21.4588 41.1024 21 40.5489 21C39.9954 21 39.5365 21.4588 39.5365 22.0121V24.0362H30.7619V22.0121C30.7619 21.4588 30.3029 21 29.7495 21C29.196 21 28.737 21.4588 28.737 22.0121V24.1171C25.0922 24.4545 23.3238 26.627 23.0538 29.8521C23.0268 30.2435 23.3508 30.5673 23.7288 30.5673H46.5696C46.9611 30.5673 47.2851 30.23 47.2446 29.8521C46.9746 26.627 45.2062 24.4545 41.5614 24.1171Z", |
| 7635 |
fill: "#24A4EC" |
| 7636 |
}), /*#__PURE__*/React.createElement("path", { |
| 7637 |
d: "M45.9489 32.5911H24.3499C23.6075 32.5911 23 33.1984 23 33.9405V42.2529C23 46.3012 25.0249 49 29.7497 49H40.5491C45.2739 49 47.2988 46.3012 47.2988 42.2529V33.9405C47.2988 33.1984 46.6913 32.5911 45.9489 32.5911ZM31.3831 43.8857C31.2481 44.0072 31.0996 44.1016 30.9376 44.1691C30.7756 44.2366 30.6001 44.2771 30.4246 44.2771C30.2491 44.2771 30.0737 44.2366 29.9117 44.1691C29.7497 44.1016 29.6012 44.0072 29.4662 43.8857C29.2232 43.6293 29.0747 43.2785 29.0747 42.9276C29.0747 42.5768 29.2232 42.2259 29.4662 41.9696C29.6012 41.8481 29.7497 41.7536 29.9117 41.6862C30.2356 41.5512 30.6136 41.5512 30.9376 41.6862C31.0996 41.7536 31.2481 41.8481 31.3831 41.9696C31.6261 42.2259 31.7746 42.5768 31.7746 42.9276C31.7746 43.2785 31.6261 43.6293 31.3831 43.8857ZM31.6666 38.7175C31.5991 38.8794 31.5046 39.0278 31.3831 39.1628C31.2481 39.2842 31.0996 39.3787 30.9376 39.4461C30.7756 39.5136 30.6001 39.5541 30.4246 39.5541C30.2491 39.5541 30.0737 39.5136 29.9117 39.4461C29.7497 39.3787 29.6012 39.2842 29.4662 39.1628C29.3447 39.0278 29.2502 38.8794 29.1827 38.7175C29.1152 38.5555 29.0747 38.3801 29.0747 38.2047C29.0747 38.0293 29.1152 37.8538 29.1827 37.6919C29.2502 37.53 29.3447 37.3815 29.4662 37.2466C29.6012 37.1252 29.7497 37.0307 29.9117 36.9632C30.2356 36.8283 30.6136 36.8283 30.9376 36.9632C31.0996 37.0307 31.2481 37.1252 31.3831 37.2466C31.5046 37.3815 31.5991 37.53 31.6666 37.6919C31.7341 37.8538 31.7746 38.0293 31.7746 38.2047C31.7746 38.3801 31.7341 38.5555 31.6666 38.7175ZM36.1079 39.1628C35.9729 39.2842 35.8244 39.3787 35.6624 39.4461C35.5004 39.5136 35.3249 39.5541 35.1494 39.5541C34.9739 39.5541 34.7984 39.5136 34.6364 39.4461C34.4744 39.3787 34.326 39.2842 34.191 39.1628C33.948 38.9064 33.7995 38.5555 33.7995 38.2047C33.7995 37.8538 33.948 37.503 34.191 37.2466C34.326 37.1252 34.4744 37.0307 34.6364 36.9632C34.9604 36.8148 35.3384 36.8148 35.6624 36.9632C35.8244 37.0307 35.9729 37.1252 36.1079 37.2466C36.3509 37.503 36.4993 37.8538 36.4993 38.2047C36.4993 38.5555 36.3509 38.9064 36.1079 39.1628Z", |
| 7638 |
fill: "#24A4EC" |
| 7639 |
})); |
| 7640 |
}; |
| 7641 |
var DocIcon = function DocIcon(_ref26) { |
| 7642 |
var _ref26$color = _ref26.color, |
| 7643 |
color = _ref26$color === void 0 ? "#3161F1" : _ref26$color, |
| 7644 |
_ref26$width = _ref26.width, |
| 7645 |
width = _ref26$width === void 0 ? "25" : _ref26$width, |
| 7646 |
_ref26$height = _ref26.height, |
| 7647 |
height = _ref26$height === void 0 ? "25" : _ref26$height; |
| 7648 |
return /*#__PURE__*/React.createElement("svg", { |
| 7649 |
width: width, |
| 7650 |
height: height, |
| 7651 |
fill: color, |
| 7652 |
xmlns: "http://www.w3.org/2000/svg" |
| 7653 |
}, /*#__PURE__*/React.createElement("path", { |
| 7654 |
d: "M19.2106 0H6.57897C2.7895 0 0.263184 2.52632 0.263184 6.31579V13.8947C0.263184 17.6842 2.7895 20.2105 6.57897 20.2105V22.9011C6.57897 23.9116 7.70318 24.5179 8.53687 23.9495L14.1579 20.2105H19.2106C23 20.2105 25.5263 17.6842 25.5263 13.8947V6.31579C25.5263 2.52632 23 0 19.2106 0ZM12.8948 15.3726C12.3642 15.3726 11.9474 14.9432 11.9474 14.4253C11.9474 13.9074 12.3642 13.4779 12.8948 13.4779C13.4253 13.4779 13.8421 13.9074 13.8421 14.4253C13.8421 14.9432 13.4253 15.3726 12.8948 15.3726ZM14.4863 10.1305C13.9937 10.4589 13.8421 10.6737 13.8421 11.0274V11.2926C13.8421 11.8105 13.4127 12.24 12.8948 12.24C12.3769 12.24 11.9474 11.8105 11.9474 11.2926V11.0274C11.9474 9.5621 13.0211 8.8421 13.4253 8.56421C13.8927 8.24842 14.0442 8.03368 14.0442 7.70526C14.0442 7.07368 13.5263 6.55579 12.8948 6.55579C12.2632 6.55579 11.7453 7.07368 11.7453 7.70526C11.7453 8.22316 11.3158 8.65263 10.7979 8.65263C10.28 8.65263 9.85055 8.22316 9.85055 7.70526C9.85055 6.02526 11.2148 4.66105 12.8948 4.66105C14.5748 4.66105 15.939 6.02526 15.939 7.70526C15.939 9.14526 14.8779 9.86526 14.4863 10.1305Z" |
| 7655 |
})); |
| 7656 |
}; |
| 7657 |
var StripeIcon = function StripeIcon(_ref27) { |
| 7658 |
var _ref27$color = _ref27.color, |
| 7659 |
color = _ref27$color === void 0 ? "#3161F1" : _ref27$color, |
| 7660 |
_ref27$width = _ref27.width, |
| 7661 |
width = _ref27$width === void 0 ? "25" : _ref27$width, |
| 7662 |
_ref27$height = _ref27.height, |
| 7663 |
height = _ref27$height === void 0 ? "25" : _ref27$height; |
| 7664 |
return /*#__PURE__*/React.createElement("svg", { |
| 7665 |
width: width, |
| 7666 |
height: height, |
| 7667 |
fill: color, |
| 7668 |
viewBox: "0 0 14 20", |
| 7669 |
xmlns: "http://www.w3.org/2000/svg" |
| 7670 |
}, /*#__PURE__*/React.createElement("path", { |
| 7671 |
d: "M5.56044 5.95604C5.56044 5.0989 6.26374 4.76923 7.42857 4.76923C9.0989 4.76923 11.2088 5.27472 12.8791 6.17582V1.01099C11.0549 0.285714 9.25275 0 7.42857 0C2.96703 0 0 2.32967 0 6.21978C0 12.2857 8.35165 11.3187 8.35165 13.9341C8.35165 14.9451 7.47253 15.2747 6.24176 15.2747C4.41758 15.2747 2.08791 14.5275 0.241758 13.5165V18.7473C2.28571 19.6264 4.35165 20 6.24176 20C10.8132 20 13.956 17.7363 13.956 13.8022C13.9341 7.25275 5.56044 8.41758 5.56044 5.95604Z" |
| 7672 |
})); |
| 7673 |
}; |
| 7674 |
var calendarIcon = function calendarIcon() { |
| 7675 |
return /*#__PURE__*/React.createElement("svg", { |
| 7676 |
width: "18", |
| 7677 |
height: "18", |
| 7678 |
viewBox: "0 0 18 18", |
| 7679 |
fill: "#0A1018", |
| 7680 |
xmlns: "http://www.w3.org/2000/svg" |
| 7681 |
}, /*#__PURE__*/React.createElement("path", { |
| 7682 |
d: "M12.242 3.40308V2.32048C12.242 2.03595 12.0061 1.8 11.7215 1.8C11.437 1.8 11.2011 2.03595 11.2011 2.32048V3.36145H6.69022V2.32048C6.69022 2.03595 6.45427 1.8 6.16974 1.8C5.88521 1.8 5.64926 2.03595 5.64926 2.32048V3.40308C3.77552 3.57658 2.86641 4.69388 2.72762 6.35248C2.71374 6.55374 2.88029 6.72029 3.0746 6.72029H14.8167C15.0179 6.72029 15.1845 6.5468 15.1637 6.35248C15.0249 4.69388 14.1158 3.57658 12.242 3.40308Z" |
| 7683 |
}), /*#__PURE__*/React.createElement("path", { |
| 7684 |
d: "M14.4978 7.76126H3.39417C3.01248 7.76126 2.7002 8.07355 2.7002 8.45524V12.7301C2.7002 14.8121 3.74116 16.2 6.17008 16.2H11.7219C14.1508 16.2 15.1918 14.8121 15.1918 12.7301V8.45524C15.1918 8.07355 14.8795 7.76126 14.4978 7.76126ZM7.00979 13.5698C6.94039 13.6323 6.86405 13.6809 6.78077 13.7156C6.6975 13.7503 6.60728 13.7711 6.51706 13.7711C6.42685 13.7711 6.33663 13.7503 6.25335 13.7156C6.17008 13.6809 6.09374 13.6323 6.02434 13.5698C5.89942 13.438 5.82309 13.2575 5.82309 13.0771C5.82309 12.8967 5.89942 12.7162 6.02434 12.5844C6.09374 12.5219 6.17008 12.4734 6.25335 12.4387C6.41991 12.3693 6.61422 12.3693 6.78077 12.4387C6.86405 12.4734 6.94039 12.5219 7.00979 12.5844C7.1347 12.7162 7.21104 12.8967 7.21104 13.0771C7.21104 13.2575 7.1347 13.438 7.00979 13.5698ZM7.15552 10.9119C7.12082 10.9952 7.07224 11.0715 7.00979 11.1409C6.94039 11.2034 6.86405 11.252 6.78077 11.2867C6.6975 11.3214 6.60728 11.3422 6.51706 11.3422C6.42685 11.3422 6.33663 11.3214 6.25335 11.2867C6.17008 11.252 6.09374 11.2034 6.02434 11.1409C5.96188 11.0715 5.9133 10.9952 5.87861 10.9119C5.84391 10.8286 5.82309 10.7384 5.82309 10.6482C5.82309 10.558 5.84391 10.4678 5.87861 10.3845C5.9133 10.3012 5.96188 10.2249 6.02434 10.1555C6.09374 10.093 6.17008 10.0444 6.25335 10.0097C6.41991 9.94034 6.61422 9.94034 6.78077 10.0097C6.86405 10.0444 6.94039 10.093 7.00979 10.1555C7.07224 10.2249 7.12082 10.3012 7.15552 10.3845C7.19022 10.4678 7.21104 10.558 7.21104 10.6482C7.21104 10.7384 7.19022 10.8286 7.15552 10.9119ZM9.4387 11.1409C9.3693 11.2034 9.29297 11.252 9.20969 11.2867C9.12641 11.3214 9.0362 11.3422 8.94598 11.3422C8.85576 11.3422 8.76555 11.3214 8.68227 11.2867C8.59899 11.252 8.52265 11.2034 8.45326 11.1409C8.32834 11.0091 8.252 10.8286 8.252 10.6482C8.252 10.4678 8.32834 10.2873 8.45326 10.1555C8.52265 10.093 8.59899 10.0444 8.68227 10.0097C8.84882 9.9334 9.04314 9.9334 9.20969 10.0097C9.29297 10.0444 9.3693 10.093 9.4387 10.1555C9.56362 10.2873 9.63996 10.4678 9.63996 10.6482C9.63996 10.8286 9.56362 11.0091 9.4387 11.1409Z" |
| 7685 |
})); |
| 7686 |
}; |
| 7687 |
var CalendarIcon2 = function CalendarIcon2(_ref28) { |
| 7688 |
var _ref28$color = _ref28.color, |
| 7689 |
color = _ref28$color === void 0 ? "#3161F1" : _ref28$color, |
| 7690 |
_ref28$width = _ref28.width, |
| 7691 |
width = _ref28$width === void 0 ? "20" : _ref28$width, |
| 7692 |
_ref28$height = _ref28.height, |
| 7693 |
height = _ref28$height === void 0 ? "20" : _ref28$height; |
| 7694 |
return /*#__PURE__*/React.createElement("svg", { |
| 7695 |
width: width, |
| 7696 |
height: height, |
| 7697 |
fill: color, |
| 7698 |
viewBox: "0 0 20 20", |
| 7699 |
xmlns: "http://www.w3.org/2000/svg" |
| 7700 |
}, /*#__PURE__*/React.createElement("path", { |
| 7701 |
d: "M14.1279 3.00386V1.6506C14.1279 1.29494 13.833 1 13.4773 1C13.1216 1 12.8267 1.29494 12.8267 1.6506V2.95181H7.18815V1.6506C7.18815 1.29494 6.89321 1 6.53755 1C6.18189 1 5.88695 1.29494 5.88695 1.6506V3.00386C3.54478 3.22072 2.40839 4.61735 2.2349 6.6906C2.21755 6.94217 2.42574 7.15036 2.66863 7.15036H17.3462C17.5978 7.15036 17.806 6.93349 17.78 6.6906C17.6065 4.61735 16.4701 3.22072 14.1279 3.00386Z" |
| 7702 |
}), /*#__PURE__*/React.createElement("path", { |
| 7703 |
d: "M16.9472 8.45158H3.06767C2.59056 8.45158 2.2002 8.84194 2.2002 9.31905V14.6627C2.2002 17.2651 3.5014 19 6.53755 19H13.4773C16.5135 19 17.8147 17.2651 17.8147 14.6627V9.31905C17.8147 8.84194 17.4243 8.45158 16.9472 8.45158ZM7.58718 15.7123C7.50044 15.7904 7.40502 15.8511 7.30092 15.8945C7.19682 15.9378 7.08405 15.9639 6.97128 15.9639C6.85851 15.9639 6.74574 15.9378 6.64164 15.8945C6.53755 15.8511 6.44212 15.7904 6.35538 15.7123C6.19923 15.5475 6.10381 15.3219 6.10381 15.0964C6.10381 14.8709 6.19923 14.6453 6.35538 14.4805C6.44212 14.4024 6.53755 14.3417 6.64164 14.2983C6.84983 14.2116 7.09273 14.2116 7.30092 14.2983C7.40502 14.3417 7.50044 14.4024 7.58718 14.4805C7.74333 14.6453 7.83875 14.8709 7.83875 15.0964C7.83875 15.3219 7.74333 15.5475 7.58718 15.7123ZM7.76935 12.3899C7.72598 12.494 7.66526 12.5894 7.58718 12.6762C7.50044 12.7542 7.40502 12.815 7.30092 12.8583C7.19682 12.9017 7.08405 12.9277 6.97128 12.9277C6.85851 12.9277 6.74574 12.9017 6.64164 12.8583C6.53755 12.815 6.44212 12.7542 6.35538 12.6762C6.2773 12.5894 6.21658 12.494 6.17321 12.3899C6.12983 12.2858 6.10381 12.173 6.10381 12.0603C6.10381 11.9475 6.12983 11.8347 6.17321 11.7306C6.21658 11.6265 6.2773 11.5311 6.35538 11.4443C6.44212 11.3663 6.53755 11.3056 6.64164 11.2622C6.84983 11.1754 7.09273 11.1754 7.30092 11.2622C7.40502 11.3056 7.50044 11.3663 7.58718 11.4443C7.66526 11.5311 7.72598 11.6265 7.76935 11.7306C7.81273 11.8347 7.83875 11.9475 7.83875 12.0603C7.83875 12.173 7.81273 12.2858 7.76935 12.3899ZM10.6233 12.6762C10.5366 12.7542 10.4412 12.815 10.3371 12.8583C10.233 12.9017 10.1202 12.9277 10.0074 12.9277C9.89465 12.9277 9.78188 12.9017 9.67779 12.8583C9.57369 12.815 9.47827 12.7542 9.39152 12.6762C9.23538 12.5113 9.13996 12.2858 9.13996 12.0603C9.13996 11.8347 9.23538 11.6092 9.39152 11.4443C9.47827 11.3663 9.57369 11.3056 9.67779 11.2622C9.88598 11.1668 10.1289 11.1668 10.3371 11.2622C10.4412 11.3056 10.5366 11.3663 10.6233 11.4443C10.7795 11.6092 10.8749 11.8347 10.8749 12.0603C10.8749 12.2858 10.7795 12.5113 10.6233 12.6762Z" |
| 7704 |
})); |
| 7705 |
}; |
| 7706 |
var MoneyIcon = function MoneyIcon(_ref29) { |
| 7707 |
var _ref29$color = _ref29.color, |
| 7708 |
color = _ref29$color === void 0 ? "#3161F1" : _ref29$color, |
| 7709 |
_ref29$width = _ref29.width, |
| 7710 |
width = _ref29$width === void 0 ? "20" : _ref29$width, |
| 7711 |
_ref29$height = _ref29.height, |
| 7712 |
height = _ref29$height === void 0 ? "20" : _ref29$height; |
| 7713 |
return /*#__PURE__*/React.createElement("svg", { |
| 7714 |
width: width, |
| 7715 |
height: height, |
| 7716 |
fill: color, |
| 7717 |
viewBox: "0 0 24 24", |
| 7718 |
xmlns: "http://www.w3.org/2000/svg" |
| 7719 |
}, /*#__PURE__*/React.createElement("path", { |
| 7720 |
d: "M17 3.5H7C4 3.5 2 5 2 8.5V15.5C2 19 4 20.5 7 20.5H17C20 20.5 22 19 22 15.5V8.5C22 5 20 3.5 17 3.5ZM6.25 14.5C6.25 14.91 5.91 15.25 5.5 15.25C5.09 15.25 4.75 14.91 4.75 14.5V9.5C4.75 9.09 5.09 8.75 5.5 8.75C5.91 8.75 6.25 9.09 6.25 9.5V14.5ZM12 15C10.34 15 9 13.66 9 12C9 10.34 10.34 9 12 9C13.66 9 15 10.34 15 12C15 13.66 13.66 15 12 15ZM19.25 14.5C19.25 14.91 18.91 15.25 18.5 15.25C18.09 15.25 17.75 14.91 17.75 14.5V9.5C17.75 9.09 18.09 8.75 18.5 8.75C18.91 8.75 19.25 9.09 19.25 9.5V14.5Z" |
| 7721 |
})); |
| 7722 |
}; |
| 7723 |
var TicketIcon = function TicketIcon(_ref30) { |
| 7724 |
var _ref30$color = _ref30.color, |
| 7725 |
color = _ref30$color === void 0 ? "#3161F1" : _ref30$color, |
| 7726 |
_ref30$width = _ref30.width, |
| 7727 |
width = _ref30$width === void 0 ? "20" : _ref30$width, |
| 7728 |
_ref30$height = _ref30.height, |
| 7729 |
height = _ref30$height === void 0 ? "20" : _ref30$height; |
| 7730 |
return /*#__PURE__*/React.createElement("svg", { |
| 7731 |
width: width, |
| 7732 |
height: height, |
| 7733 |
viewBox: "0 0 18 18", |
| 7734 |
fill: color, |
| 7735 |
xmlns: "http://www.w3.org/2000/svg" |
| 7736 |
}, /*#__PURE__*/React.createElement("path", { |
| 7737 |
d: "M16.4961 8.06247C16.8036 8.06247 17.0586 7.80747 17.0586 7.49997V6.74997C17.0586 3.44247 16.0536 2.43747 12.7461 2.43747H8.05859V4.12497C8.05859 4.43247 7.80359 4.68747 7.49609 4.68747C7.18859 4.68747 6.93359 4.43247 6.93359 4.12497V2.43747H5.24609C1.93859 2.43747 0.933594 3.44247 0.933594 6.74997V7.12497C0.933594 7.43247 1.18859 7.68747 1.49609 7.68747C2.21609 7.68747 2.80859 8.27997 2.80859 8.99997C2.80859 9.71997 2.21609 10.3125 1.49609 10.3125C1.18859 10.3125 0.933594 10.5675 0.933594 10.875V11.25C0.933594 14.5575 1.93859 15.5625 5.24609 15.5625H6.93359V13.875C6.93359 13.5675 7.18859 13.3125 7.49609 13.3125C7.80359 13.3125 8.05859 13.5675 8.05859 13.875V15.5625H12.7461C16.0536 15.5625 17.0586 14.5575 17.0586 11.25C17.0586 10.9425 16.8036 10.6875 16.4961 10.6875C15.7761 10.6875 15.1836 10.095 15.1836 9.37497C15.1836 8.65497 15.7761 8.06247 16.4961 8.06247ZM8.05859 10.6275C8.05859 10.935 7.80359 11.19 7.49609 11.19C7.18859 11.19 6.93359 10.935 6.93359 10.6275V7.37247C6.93359 7.06497 7.18859 6.80997 7.49609 6.80997C7.80359 6.80997 8.05859 7.06497 8.05859 7.37247V10.6275Z" |
| 7738 |
})); |
| 7739 |
}; |
| 7740 |
var DollarIcon = function DollarIcon(_ref31) { |
| 7741 |
var _ref31$color = _ref31.color, |
| 7742 |
color = _ref31$color === void 0 ? "#3161F1" : _ref31$color, |
| 7743 |
_ref31$width = _ref31.width, |
| 7744 |
width = _ref31$width === void 0 ? "20" : _ref31$width, |
| 7745 |
_ref31$height = _ref31.height, |
| 7746 |
height = _ref31$height === void 0 ? "20" : _ref31$height; |
| 7747 |
return /*#__PURE__*/React.createElement("svg", { |
| 7748 |
width: width, |
| 7749 |
height: height, |
| 7750 |
viewBox: "0 0 18 18", |
| 7751 |
fill: color, |
| 7752 |
xmlns: "http://www.w3.org/2000/svg" |
| 7753 |
}, /*#__PURE__*/React.createElement("path", { |
| 7754 |
d: "M12.4891 0.666504H5.50573C2.4724 0.666504 0.664062 2.47484 0.664062 5.50817V12.4915C0.664062 15.5248 2.4724 17.3332 5.50573 17.3332H12.4891C15.5224 17.3332 17.3307 15.5248 17.3307 12.4915V5.50817C17.3307 2.47484 15.5224 0.666504 12.4891 0.666504ZM10.8807 8.99984C11.5307 9.22484 12.3974 9.69984 12.3974 11.1915C12.3974 12.4748 11.3974 13.5165 10.1641 13.5165H9.62239V13.9998C9.62239 14.3415 9.33906 14.6248 8.99739 14.6248C8.65573 14.6248 8.37239 14.3415 8.37239 13.9998V13.5165H8.07239C6.70573 13.5165 5.59739 12.3582 5.59739 10.9415C5.59739 10.5998 5.8724 10.3165 6.22239 10.3165C6.56406 10.3165 6.84739 10.5998 6.84739 10.9415C6.84739 11.6748 7.3974 12.2665 8.07239 12.2665H8.37239V9.4415L7.11406 8.99984C6.46406 8.77484 5.59739 8.29984 5.59739 6.80817C5.59739 5.52484 6.59739 4.48317 7.83073 4.48317H8.37239V3.99984C8.37239 3.65817 8.65573 3.37484 8.99739 3.37484C9.33906 3.37484 9.62239 3.65817 9.62239 3.99984V4.48317H9.92239C11.2891 4.48317 12.3974 5.6415 12.3974 7.05817C12.3974 7.39984 12.1224 7.68317 11.7724 7.68317C11.4307 7.68317 11.1474 7.39984 11.1474 7.05817C11.1474 6.32484 10.5974 5.73317 9.92239 5.73317H9.62239V8.55817L10.8807 8.99984Z" |
| 7755 |
})); |
| 7756 |
}; |
| 7757 |
var ChairIcon = function ChairIcon(_ref32) { |
| 7758 |
var _ref32$color = _ref32.color, |
| 7759 |
color = _ref32$color === void 0 ? "#3161F1" : _ref32$color, |
| 7760 |
_ref32$width = _ref32.width, |
| 7761 |
width = _ref32$width === void 0 ? "20" : _ref32$width, |
| 7762 |
_ref32$height = _ref32.height, |
| 7763 |
height = _ref32$height === void 0 ? "20" : _ref32$height; |
| 7764 |
return /*#__PURE__*/React.createElement("svg", { |
| 7765 |
width: width, |
| 7766 |
height: height, |
| 7767 |
viewBox: "0 0 17 18", |
| 7768 |
fill: color, |
| 7769 |
xmlns: "http://www.w3.org/2000/svg" |
| 7770 |
}, /*#__PURE__*/React.createElement("path", { |
| 7771 |
d: "M16.5 8.25C16.5 6.5955 15.1545 5.25 13.5 5.25V3.75C13.5 1.68225 11.8178 0 9.75 0L6.75 0C4.68225 0 3 1.68225 3 3.75V5.25C1.3455 5.25 0 6.5955 0 8.25L0 12C0 12.0127 3.50119e-08 12.0262 0.000750035 12.039C0.02175 13.2615 1.02225 14.25 2.25 14.25L7.5 14.25V16.5H4.5C4.086 16.5 3.75 16.8353 3.75 17.25C3.75 17.6647 4.086 18 4.5 18H12C12.414 18 12.75 17.6647 12.75 17.25C12.75 16.8353 12.414 16.5 12 16.5H9V14.25H14.25C15.4778 14.25 16.4783 13.2615 16.4993 12.039C16.4993 12.0262 16.5 12.0135 16.5 12V8.25ZM15 8.25V9.879C14.7653 9.79575 14.5133 9.75 14.25 9.75H13.5L13.5 6.75C14.3273 6.75 15 7.42275 15 8.25ZM4.5 3.75C4.5 2.5095 5.5095 1.5 6.75 1.5L9.75 1.5C10.9905 1.5 12 2.5095 12 3.75L12 9.75L4.5 9.75V3.75ZM3 6.75L3 9.75H2.25C1.98675 9.75 1.73475 9.79575 1.5 9.879V8.25C1.5 7.42275 2.17275 6.75 3 6.75ZM14.25 12.75L2.25 12.75C1.83675 12.75 1.5 12.414 1.5 12C1.5 11.586 1.83675 11.25 2.25 11.25L14.25 11.25C14.6633 11.25 15 11.586 15 12C15 12.414 14.6633 12.75 14.25 12.75Z" |
| 7772 |
})); |
| 7773 |
}; |
| 7774 |
|
| 7775 |
|
| 7776 |
/***/ }), |
| 7777 |
|
| 7778 |
/***/ 2758: |
| 7779 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 7780 |
|
| 7781 |
"use strict"; |
| 7782 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 7783 |
/* harmony export */ "F6": () => (/* binding */ convertSchedulesForApi), |
| 7784 |
/* harmony export */ "II": () => (/* binding */ convertSchedulesForUi) |
| 7785 |
/* harmony export */ }); |
| 7786 |
/* unused harmony exports convertScheduleForApi, convertScheduleForUi, getTimeStringFromTimeStringBasedOnFormat, getTimeStringFromMilliseconds, getMilliseconsFromTimeString, getDayFullname */ |
| 7787 |
/* harmony import */ var _admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5177); |
| 7788 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 7789 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 7790 |
function _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); } |
| 7791 |
function _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; } |
| 7792 |
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 7793 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 7794 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 7795 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 7796 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 7797 |
|
| 7798 |
|
| 7799 |
/** |
| 7800 |
* Handler for converting schedule object to api format |
| 7801 |
* @param {Object} schedule single schedule object of a day |
| 7802 |
* @returns schedule object with start and end time in milliseconds |
| 7803 |
*/ |
| 7804 |
var convertScheduleForApi = function convertScheduleForApi(schedule) { |
| 7805 |
var _schedule = _objectSpread({}, schedule); |
| 7806 |
if (_schedule.schedules) { |
| 7807 |
_schedule = _schedule.schedules.map(function (item) { |
| 7808 |
return { |
| 7809 |
start: getTimeStringFromMilliseconds(item.start.value), |
| 7810 |
end: getTimeStringFromMilliseconds(item.end.value) |
| 7811 |
}; |
| 7812 |
}); |
| 7813 |
} |
| 7814 |
return _schedule; |
| 7815 |
}; |
| 7816 |
/** |
| 7817 |
* Handler for converting schedules array to api format |
| 7818 |
* @param {Array} schedules Array of schedule objects |
| 7819 |
* @returns Converted schedules for api format |
| 7820 |
*/ |
| 7821 |
var convertSchedulesForApi = function convertSchedulesForApi(schedules) { |
| 7822 |
var _schedules = {}; |
| 7823 |
schedules.map(function (item) { |
| 7824 |
if (item.status === false) { |
| 7825 |
_schedules[item.key] = []; |
| 7826 |
} else { |
| 7827 |
_schedules[item.key] = convertScheduleForApi(item); |
| 7828 |
} |
| 7829 |
}); |
| 7830 |
return _schedules; |
| 7831 |
}; |
| 7832 |
|
| 7833 |
//currently not in use |
| 7834 |
/** |
| 7835 |
* |
| 7836 |
* @param {Objec} schedule single schedule object of a day |
| 7837 |
* @returns converted schedule object as per ui format |
| 7838 |
*/ |
| 7839 |
var convertScheduleForUi = function convertScheduleForUi(schedule) { |
| 7840 |
var _schedule = _objectSpread({}, schedule); |
| 7841 |
if (_schedule.schedules) { |
| 7842 |
_schedule = _schedule.schedules.map(function (item) { |
| 7843 |
return { |
| 7844 |
start: { |
| 7845 |
value: new Date(createDateObject(item.start, 24)).getTime(), |
| 7846 |
label: item.start |
| 7847 |
}, |
| 7848 |
end: { |
| 7849 |
value: new Date(createDateObject(item.end, 24)).getTime(), |
| 7850 |
label: item.end |
| 7851 |
} |
| 7852 |
}; |
| 7853 |
}); |
| 7854 |
} |
| 7855 |
return _schedule; |
| 7856 |
}; |
| 7857 |
|
| 7858 |
/** |
| 7859 |
* |
| 7860 |
* @param {Array} schedules Array of schedule objects |
| 7861 |
* @returns converted schedules as per ui format |
| 7862 |
*/ |
| 7863 |
var convertSchedulesForUi = function convertSchedulesForUi(schedules) { |
| 7864 |
var _schedules = []; |
| 7865 |
for (var _i = 0, _Object$entries = Object.entries(schedules); _i < _Object$entries.length; _i++) { |
| 7866 |
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), |
| 7867 |
key = _Object$entries$_i[0], |
| 7868 |
value = _Object$entries$_i[1]; |
| 7869 |
var _schedule = { |
| 7870 |
key: key, |
| 7871 |
name: getDayFullname(key), |
| 7872 |
status: value.length > 0 ? true : false, |
| 7873 |
schedules: value !== null && value !== void 0 && value.length ? value.map(function (item) { |
| 7874 |
return { |
| 7875 |
start: { |
| 7876 |
value: new Date((0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_0__/* .createDateObject */ .SX)(item.start, 24)).getTime(), |
| 7877 |
label: getTimeStringFromTimeStringBasedOnFormat(item.start) |
| 7878 |
}, |
| 7879 |
end: { |
| 7880 |
value: new Date((0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_0__/* .createDateObject */ .SX)(item.end, 24)).getTime(), |
| 7881 |
label: getTimeStringFromTimeStringBasedOnFormat(item.end) |
| 7882 |
} |
| 7883 |
}; |
| 7884 |
}) : [(0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_0__/* .getSlotTime */ ._9)({ |
| 7885 |
startTime: "09:00 AM", |
| 7886 |
duration: 10 |
| 7887 |
})] |
| 7888 |
}; |
| 7889 |
_schedules.push(_schedule); |
| 7890 |
} |
| 7891 |
return _schedules; |
| 7892 |
}; |
| 7893 |
var getTimeStringFromTimeStringBasedOnFormat = function getTimeStringFromTimeStringBasedOnFormat() { |
| 7894 |
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "5:00 PM"; |
| 7895 |
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 24; |
| 7896 |
//convert time string to 12 hour format or 24 hour format based on format |
| 7897 |
var _time$split = time.split(":"), |
| 7898 |
_time$split2 = _slicedToArray(_time$split, 2), |
| 7899 |
hours = _time$split2[0], |
| 7900 |
minutes = _time$split2[1]; |
| 7901 |
var _minutes$split = minutes.split(" "), |
| 7902 |
_minutes$split2 = _slicedToArray(_minutes$split, 2), |
| 7903 |
min = _minutes$split2[0], |
| 7904 |
ampm2 = _minutes$split2[1]; |
| 7905 |
var _hours = ampm2 === "pm" ? parseInt(hours) + 12 : hours; |
| 7906 |
var _minutes = min; |
| 7907 |
if (format === 24) { |
| 7908 |
return _hours + ":" + _minutes; |
| 7909 |
} else { |
| 7910 |
return _hours + ":" + _minutes + " " + ampm; |
| 7911 |
} |
| 7912 |
}; |
| 7913 |
var getTimeStringFromMilliseconds = function getTimeStringFromMilliseconds(time) { |
| 7914 |
var date = new Date(time); |
| 7915 |
var _time = (0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_0__/* .getTimeStringFromDateObject */ .z9)(date); |
| 7916 |
return _time; |
| 7917 |
}; |
| 7918 |
var getMilliseconsFromTimeString = function getMilliseconsFromTimeString() { |
| 7919 |
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "9:00 am"; |
| 7920 |
var _time$split3 = time.split(":"), |
| 7921 |
_time$split4 = _slicedToArray(_time$split3, 3), |
| 7922 |
hours = _time$split4[0], |
| 7923 |
minutes = _time$split4[1], |
| 7924 |
ampm = _time$split4[2]; |
| 7925 |
var _minutes$split3 = minutes.split(" "), |
| 7926 |
_minutes$split4 = _slicedToArray(_minutes$split3, 2), |
| 7927 |
min = _minutes$split4[0], |
| 7928 |
ampm2 = _minutes$split4[1]; |
| 7929 |
var _hours = ampm == "pm" ? parseInt(hours) + 12 : parseInt(hours); |
| 7930 |
var _minutes = parseInt(min); |
| 7931 |
var _time = new Date(); |
| 7932 |
_time.setHours(_hours); |
| 7933 |
_time.setMinutes(_minutes); |
| 7934 |
return _time.getTime(); |
| 7935 |
}; |
| 7936 |
var getDayFullname = function getDayFullname(day) { |
| 7937 |
var days = { |
| 7938 |
Mon: "Monday", |
| 7939 |
Tue: "Tuesday", |
| 7940 |
Wed: "Wednesday", |
| 7941 |
Thu: "Thursday", |
| 7942 |
Fri: "Friday", |
| 7943 |
Sat: "Saturday", |
| 7944 |
Sun: "Sunday" |
| 7945 |
}; |
| 7946 |
return days[day]; |
| 7947 |
}; |
| 7948 |
|
| 7949 |
/***/ }), |
| 7950 |
|
| 7951 |
/***/ 4903: |
| 7952 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 7953 |
|
| 7954 |
"use strict"; |
| 7955 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 7956 |
/* harmony export */ "Ne": () => (/* binding */ setScheduleDataToContex), |
| 7957 |
/* harmony export */ "Wf": () => (/* binding */ _getNextTimeSlot), |
| 7958 |
/* harmony export */ "Xi": () => (/* binding */ compareTime), |
| 7959 |
/* harmony export */ "ln": () => (/* binding */ convertWordpressDateFormatToDayjs), |
| 7960 |
/* harmony export */ "tU": () => (/* binding */ convertWordpressTimeFormatToDayjs), |
| 7961 |
/* harmony export */ "wR": () => (/* binding */ convertWeekDayToNumber), |
| 7962 |
/* harmony export */ "zR": () => (/* binding */ UploadImageFromMedia) |
| 7963 |
/* harmony export */ }); |
| 7964 |
/* unused harmony exports getNextTimeSlot, incrementTime, _compareTime, prepareTimeSlotConflict, convertMillisecondsToTodaysDateObject */ |
| 7965 |
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7484); |
| 7966 |
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_0__); |
| 7967 |
/* harmony import */ var _admin_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7157); |
| 7968 |
/* harmony import */ var _admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5177); |
| 7969 |
/* harmony import */ var _availabilityModel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2758); |
| 7970 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } |
| 7971 |
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 7972 |
function _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); } |
| 7973 |
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } |
| 7974 |
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
| 7975 |
function _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; } |
| 7976 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 7977 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 7978 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 7979 |
|
| 7980 |
|
| 7981 |
|
| 7982 |
|
| 7983 |
var ttFetch = function ttFetch(slug, callback, options) { |
| 7984 |
return fetch(slug, options).then(function (res) { |
| 7985 |
return res.json(); |
| 7986 |
}).then(function (data) { |
| 7987 |
if (callback) { |
| 7988 |
callback(data); |
| 7989 |
} |
| 7990 |
}); |
| 7991 |
}; |
| 7992 |
var getNextTimeSlot = function getNextTimeSlot(timeSlotes) { |
| 7993 |
var lastSlot = timeSlotes[timeSlotes.length - 1]; |
| 7994 |
var newSlot = { |
| 7995 |
start: incrementTime({ |
| 7996 |
prevTime: lastSlot.end, |
| 7997 |
add: 1, |
| 7998 |
spec: "hr" |
| 7999 |
}), |
| 8000 |
end: incrementTime({ |
| 8001 |
prevTime: lastSlot.end, |
| 8002 |
add: 2, |
| 8003 |
spec: "hr" |
| 8004 |
}) |
| 8005 |
}; |
| 8006 |
return newSlot; |
| 8007 |
}; |
| 8008 |
var _getNextTimeSlot = function _getNextTimeSlot(_ref) { |
| 8009 |
var schedules = _ref.schedules, |
| 8010 |
duration = _ref.duration, |
| 8011 |
bufferTime = _ref.bufferTime, |
| 8012 |
dayEnd = _ref.dayEnd; |
| 8013 |
var _getOneScheduleObj2 = (0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_2__/* ._getOneScheduleObj */ .rQ)({ |
| 8014 |
schedules: schedules, |
| 8015 |
duration: duration, |
| 8016 |
bufferTime: bufferTime, |
| 8017 |
dayEnd: dayEnd |
| 8018 |
}), |
| 8019 |
startTime = _getOneScheduleObj2.startTime, |
| 8020 |
_duration = _getOneScheduleObj2.duration, |
| 8021 |
_dayEnd = _getOneScheduleObj2.dayEnd; |
| 8022 |
var _getSlotStartAndEndTi = (0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_2__/* .getSlotStartAndEndTime */ .wR)({ |
| 8023 |
startTime: startTime, |
| 8024 |
duration: _duration, |
| 8025 |
dayEnd: _dayEnd |
| 8026 |
}), |
| 8027 |
start = _getSlotStartAndEndTi.start, |
| 8028 |
end = _getSlotStartAndEndTi.end; |
| 8029 |
var startLabel = (0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_2__/* .getTimeStringFromDateObject */ .z9)(new Date(start).toString()); |
| 8030 |
var endLabel = (0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_2__/* .getTimeStringFromDateObject */ .z9)(new Date(end).toString()); |
| 8031 |
return { |
| 8032 |
start: { |
| 8033 |
value: start, |
| 8034 |
label: (0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_2__/* .getTimeStringFromDateObject */ .z9)(new Date(start).toString()) |
| 8035 |
}, |
| 8036 |
end: { |
| 8037 |
value: end, |
| 8038 |
label: (0,_admin_utils_dummyData__WEBPACK_IMPORTED_MODULE_2__/* .getTimeStringFromDateObject */ .z9)(new Date(end).toString()) |
| 8039 |
} |
| 8040 |
}; |
| 8041 |
}; |
| 8042 |
var incrementTime = function incrementTime(_ref2) { |
| 8043 |
var prevTime = _ref2.prevTime, |
| 8044 |
_ref2$add = _ref2.add, |
| 8045 |
add = _ref2$add === void 0 ? 1 : _ref2$add, |
| 8046 |
_ref2$spec = _ref2.spec, |
| 8047 |
spec = _ref2$spec === void 0 ? "hr" : _ref2$spec; |
| 8048 |
var hour = prevTime.split(":")[0]; |
| 8049 |
var minutes = prevTime.split(":")[1]; |
| 8050 |
if (spec == "hr") { |
| 8051 |
if (hour == "00") { |
| 8052 |
hour = 1; |
| 8053 |
} else if (+hour + 1 > 23) { |
| 8054 |
hour = "00"; |
| 8055 |
} else { |
| 8056 |
hour = +hour + add; |
| 8057 |
} |
| 8058 |
// hour = +hour + 1 > 23 ? "00" : hour == "00" ? 1 : +hour + add; |
| 8059 |
} |
| 8060 |
|
| 8061 |
if (spec == "min") { |
| 8062 |
minutes = minutes >= 59 ? "00" : +minutes + add; |
| 8063 |
} |
| 8064 |
return "".concat(hour, ":").concat(minutes); |
| 8065 |
}; |
| 8066 |
var _compareTime = function _compareTime(_ref3) { |
| 8067 |
var _schedule$schedules; |
| 8068 |
var key = _ref3.key, |
| 8069 |
value = _ref3.value, |
| 8070 |
timeSlotIndex = _ref3.timeSlotIndex, |
| 8071 |
scheduleIndex = _ref3.scheduleIndex, |
| 8072 |
schedule = _ref3.schedule; |
| 8073 |
var status = { |
| 8074 |
hasError: false, |
| 8075 |
"with": [] |
| 8076 |
}; |
| 8077 |
var _value = value.value; |
| 8078 |
var timeInMs = new Date(_value).getTime(); |
| 8079 |
var startArr = []; |
| 8080 |
schedule === null || schedule === void 0 ? void 0 : (_schedule$schedules = schedule.schedules) === null || _schedule$schedules === void 0 ? void 0 : _schedule$schedules.map(function (item) { |
| 8081 |
startArr.push({ |
| 8082 |
start: new Date(item.start.value).getTime(), |
| 8083 |
end: new Date(item.end.value).getTime(), |
| 8084 |
time: timeInMs |
| 8085 |
}); |
| 8086 |
}); |
| 8087 |
for (var i = 0; i < startArr.length; i++) { |
| 8088 |
for (var j = 0; j < startArr.length; j++) { |
| 8089 |
if (startArr[j].start > startArr[i].start && startArr[j].end < startArr[i].end || startArr[j].end > startArr[i].start && startArr[j].end < startArr[i].end || startArr[j].start >= startArr[j].end) { |
| 8090 |
status.hasError = true; |
| 8091 |
status.scheduleIndex = scheduleIndex; |
| 8092 |
status["with"].push(i); |
| 8093 |
status["with"].push(j); |
| 8094 |
} |
| 8095 |
} |
| 8096 |
} |
| 8097 |
return status; |
| 8098 |
}; |
| 8099 |
var compareTime = function compareTime(_ref4) { |
| 8100 |
var _schedule$schedules2, _status$scheduleIndex; |
| 8101 |
var key = _ref4.key, |
| 8102 |
value = _ref4.value, |
| 8103 |
timeSlotIndex = _ref4.timeSlotIndex, |
| 8104 |
scheduleIndex = _ref4.scheduleIndex, |
| 8105 |
schedule = _ref4.schedule, |
| 8106 |
timeCompareError = _ref4.timeCompareError; |
| 8107 |
var status = _objectSpread({}, timeCompareError); |
| 8108 |
var _value = value.value; |
| 8109 |
var timeInMs = new Date(_value).getTime(); |
| 8110 |
var startArr = []; |
| 8111 |
schedule === null || schedule === void 0 ? void 0 : (_schedule$schedules2 = schedule.schedules) === null || _schedule$schedules2 === void 0 ? void 0 : _schedule$schedules2.map(function (item) { |
| 8112 |
startArr.push(convertMillisecondsToTodaysDateObject(item.start.value), convertMillisecondsToTodaysDateObject(item.end.value)); |
| 8113 |
}); |
| 8114 |
var _conflictWith = []; |
| 8115 |
var scIndexStatus = []; |
| 8116 |
|
| 8117 |
// check if any possible time conflicts and set error in timeCompareError |
| 8118 |
for (var i = 0; i < startArr.length; i++) { |
| 8119 |
var _checkIfHave = status["with"][scheduleIndex] ? status["with"][scheduleIndex] : []; |
| 8120 |
var conflict = Math.floor(i / 2); |
| 8121 |
var conflictWith = Math.floor(i / 2); |
| 8122 |
if (startArr[i] > startArr[i + 1]) { |
| 8123 |
scIndexStatus[i] = false; |
| 8124 |
status.hasError = true; |
| 8125 |
status.scheduleIndex = _toConsumableArray(new Set([].concat(_toConsumableArray(status.scheduleIndex), [scheduleIndex]))); |
| 8126 |
_conflictWith.push(conflict, conflictWith + 1); |
| 8127 |
status["with"][scheduleIndex] = _toConsumableArray(new Set([].concat(_toConsumableArray(_checkIfHave), _toConsumableArray(_conflictWith)))); |
| 8128 |
} |
| 8129 |
if (i % 2 == 0 && startArr[i] == startArr[i + 1]) { |
| 8130 |
_conflictWith = []; |
| 8131 |
scIndexStatus[i] = false; |
| 8132 |
status.hasError = true; |
| 8133 |
status.scheduleIndex = _toConsumableArray(new Set([].concat(_toConsumableArray(status.scheduleIndex), [scheduleIndex]))); |
| 8134 |
_conflictWith.push(conflict); |
| 8135 |
status["with"][scheduleIndex] = _toConsumableArray(new Set([].concat(_toConsumableArray(_checkIfHave), _toConsumableArray(_conflictWith)))); |
| 8136 |
} |
| 8137 |
_conflictWith = []; |
| 8138 |
if (startArr[i] <= startArr[i + 1]) { |
| 8139 |
scIndexStatus[i] = true; |
| 8140 |
} |
| 8141 |
} |
| 8142 |
|
| 8143 |
//clear error base on scheduleIndex |
| 8144 |
|
| 8145 |
if (scIndexStatus.every(function (item) { |
| 8146 |
return item == true; |
| 8147 |
})) { |
| 8148 |
status.scheduleIndex = _toConsumableArray(status.scheduleIndex).filter(function (item) { |
| 8149 |
return item != scheduleIndex; |
| 8150 |
}); |
| 8151 |
status["with"][scheduleIndex] = []; |
| 8152 |
} |
| 8153 |
|
| 8154 |
// No error if status object's scheduleIndex array length is 0 Or status object's with object property count is 0 |
| 8155 |
if (((_status$scheduleIndex = status.scheduleIndex) === null || _status$scheduleIndex === void 0 ? void 0 : _status$scheduleIndex.length) == 0 || Object.keys(status["with"]).length == 0) { |
| 8156 |
status.hasError = false; |
| 8157 |
} |
| 8158 |
return status; |
| 8159 |
}; |
| 8160 |
|
| 8161 |
/** |
| 8162 |
* |
| 8163 |
* @param {*} errorObj Error object returned from compareTime function. |
| 8164 |
* @returns structured error data |
| 8165 |
*/ |
| 8166 |
var prepareTimeSlotConflict = function prepareTimeSlotConflict(_ref5) { |
| 8167 |
var prevErrorObj = _ref5.prevErrorObj, |
| 8168 |
newError = _ref5.newError; |
| 8169 |
// const validTimeError = { |
| 8170 |
// ..._status, |
| 8171 |
// errros: { [_status.scheduleIndex]: [..._status.with] }, |
| 8172 |
// }; |
| 8173 |
|
| 8174 |
return ""; |
| 8175 |
}; |
| 8176 |
|
| 8177 |
/** |
| 8178 |
* Upload image form wordpress media |
| 8179 |
* @param {*} event |
| 8180 |
* @param {*} setImageUrl |
| 8181 |
* @returns media |
| 8182 |
*/ |
| 8183 |
|
| 8184 |
var UploadImageFromMedia = function UploadImageFromMedia(event, getImgURL, getImgID) { |
| 8185 |
event.preventDefault(); |
| 8186 |
var mediaUploader; |
| 8187 |
if (mediaUploader) { |
| 8188 |
mediaUploader.open(); |
| 8189 |
return; |
| 8190 |
} |
| 8191 |
mediaUploader = wp.media.frames.file_frame = wp.media({ |
| 8192 |
title: "Choose Image", |
| 8193 |
button: { |
| 8194 |
text: "Choose Image" |
| 8195 |
}, |
| 8196 |
multiple: false |
| 8197 |
}); |
| 8198 |
|
| 8199 |
// When a file is selected, grab the URL and set it as the text field's value |
| 8200 |
mediaUploader.on("select", function () { |
| 8201 |
var attachmentURL = mediaUploader.state().get("selection").first().toJSON(); |
| 8202 |
getImgURL(attachmentURL.url); |
| 8203 |
getImgID(attachmentURL.id); |
| 8204 |
}); |
| 8205 |
|
| 8206 |
// Open the uploader dialog |
| 8207 |
var media = mediaUploader.open(); |
| 8208 |
return media; |
| 8209 |
}; |
| 8210 |
var setScheduleDataToContex = function setScheduleDataToContex(_ref6) { |
| 8211 |
var dispatch = _ref6.dispatch, |
| 8212 |
meeting = _ref6.meeting, |
| 8213 |
staffs = _ref6.staffs; |
| 8214 |
var _staffs = staffs === null || staffs === void 0 ? void 0 : staffs.filter(function (staff) { |
| 8215 |
return _toConsumableArray(meeting === null || meeting === void 0 ? void 0 : meeting.staff).includes(staff.id); |
| 8216 |
}); |
| 8217 |
var _staffsIds = meeting.staff; |
| 8218 |
var _schedules = {}; |
| 8219 |
Object.keys(meeting === null || meeting === void 0 ? void 0 : meeting.schedule).map(function (item) { |
| 8220 |
_schedules[item] = (0,_availabilityModel__WEBPACK_IMPORTED_MODULE_3__/* .convertSchedulesForUi */ .II)(meeting === null || meeting === void 0 ? void 0 : meeting.schedule[item]); |
| 8221 |
}); |
| 8222 |
(0,_admin_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 8223 |
dispatch: dispatch, |
| 8224 |
name: "selectedStaff", |
| 8225 |
value: _staffs |
| 8226 |
}); |
| 8227 |
(0,_admin_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 8228 |
dispatch: dispatch, |
| 8229 |
name: "selectedStaffIds", |
| 8230 |
value: _staffsIds |
| 8231 |
}); |
| 8232 |
(0,_admin_actionCreators_common__WEBPACK_IMPORTED_MODULE_1__/* .setState */ .I)({ |
| 8233 |
dispatch: dispatch, |
| 8234 |
name: "schedules", |
| 8235 |
value: _objectSpread({}, _schedules) |
| 8236 |
}); |
| 8237 |
}; |
| 8238 |
var convertMillisecondsToTodaysDateObject = function convertMillisecondsToTodaysDateObject(milliseconds) { |
| 8239 |
var date = new Date(milliseconds); |
| 8240 |
var dateObject = { |
| 8241 |
day: date.getDate(), |
| 8242 |
month: date.getMonth() + 1, |
| 8243 |
year: date.getFullYear(), |
| 8244 |
hour: date.getHours(), |
| 8245 |
minute: date.getMinutes(), |
| 8246 |
second: date.getSeconds() |
| 8247 |
}; |
| 8248 |
|
| 8249 |
//convert dateObject to js date object |
| 8250 |
var dateObjectToMilliseconds = new Date(dateObject.year, dateObject.month - 1, dateObject.day, dateObject.hour, dateObject.minute, dateObject.second).getTime(); |
| 8251 |
return dateObjectToMilliseconds; |
| 8252 |
}; |
| 8253 |
|
| 8254 |
//convert wordpress date format to dayjs date format |
| 8255 |
var convertWordpressDateFormatToDayjs = function convertWordpressDateFormatToDayjs(_ref7) { |
| 8256 |
var _window, _window$timetics; |
| 8257 |
var _ref7$format = _ref7.format, |
| 8258 |
format = _ref7$format === void 0 ? (_window = window) === null || _window === void 0 ? void 0 : (_window$timetics = _window.timetics) === null || _window$timetics === void 0 ? void 0 : _window$timetics.date_format : _ref7$format, |
| 8259 |
date = _ref7.date; |
| 8260 |
if (!date) return; |
| 8261 |
var jsFormat = format.replace("d", "DD").replace("D", "D").replace("j", "D").replace("l", "DD").replace("m", "MM").replace("n", "M").replace("F", "MMMM").replace("Y", "YYYY"); |
| 8262 |
return dayjs__WEBPACK_IMPORTED_MODULE_0___default()(date).format(jsFormat); |
| 8263 |
}; |
| 8264 |
var convertWordpressTimeFormatToDayjs = function convertWordpressTimeFormatToDayjs(_ref8) { |
| 8265 |
var _window2, _window2$timetics; |
| 8266 |
var _ref8$format = _ref8.format, |
| 8267 |
format = _ref8$format === void 0 ? (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$timetics = _window2.timetics) === null || _window2$timetics === void 0 ? void 0 : _window2$timetics.time_format : _ref8$format, |
| 8268 |
time = _ref8.time; |
| 8269 |
if (!time) return; |
| 8270 |
var jsFormat = format.replace("g", "h").replace("G", "H").replace("h", "hh").replace("H", "HH").replace("i", "mm").replace("s", "ss").replace("a", "a").replace("A", "A"); |
| 8271 |
var hour = parseInt(time === null || time === void 0 ? void 0 : time.split(":")[0]); |
| 8272 |
var minute = parseInt(time.split(":")[1].slice(0, 2)); |
| 8273 |
// const ampm = minute.slice(1, 3); |
| 8274 |
|
| 8275 |
var date = dayjs__WEBPACK_IMPORTED_MODULE_0___default()(); |
| 8276 |
//add am or pm with dayjs |
| 8277 |
if (time.endsWith("pm")) { |
| 8278 |
// date = date.add(12, "hour"); |
| 8279 |
hour += 12; |
| 8280 |
} |
| 8281 |
return date.hour(hour).minute(minute).format(jsFormat); |
| 8282 |
}; |
| 8283 |
var convertWeekDayToNumber = function convertWeekDayToNumber(day) { |
| 8284 |
var weekDays = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; |
| 8285 |
return weekDays.indexOf(day.toLowerCase()); |
| 8286 |
}; |
| 8287 |
|
| 8288 |
/***/ }), |
| 8289 |
|
| 8290 |
/***/ 7006: |
| 8291 |
/***/ ((module, __webpack_exports__, __webpack_require__) => { |
| 8292 |
|
| 8293 |
"use strict"; |
| 8294 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 8295 |
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 8296 |
/* harmony export */ }); |
| 8297 |
/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3645); |
| 8298 |
/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__); |
| 8299 |
// Imports |
| 8300 |
|
| 8301 |
var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]}); |
| 8302 |
// Module |
| 8303 |
___CSS_LOADER_EXPORT___.push([module.id, "/*!\n * Quill Editor v1.3.7\n * https://quilljs.com/\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container {\n box-sizing: border-box;\n font-family: Helvetica, Arial, sans-serif;\n font-size: 13px;\n height: 100%;\n margin: 0px;\n position: relative;\n}\n.ql-container.ql-disabled .ql-tooltip {\n visibility: hidden;\n}\n.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before {\n pointer-events: none;\n}\n.ql-clipboard {\n left: -100000px;\n height: 1px;\n overflow-y: hidden;\n position: absolute;\n top: 50%;\n}\n.ql-clipboard p {\n margin: 0;\n padding: 0;\n}\n.ql-editor {\n box-sizing: border-box;\n line-height: 1.42;\n height: 100%;\n outline: none;\n overflow-y: auto;\n padding: 12px 15px;\n tab-size: 4;\n -moz-tab-size: 4;\n text-align: left;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n.ql-editor > * {\n cursor: text;\n}\n.ql-editor p,\n.ql-editor ol,\n.ql-editor ul,\n.ql-editor pre,\n.ql-editor blockquote,\n.ql-editor h1,\n.ql-editor h2,\n.ql-editor h3,\n.ql-editor h4,\n.ql-editor h5,\n.ql-editor h6 {\n margin: 0;\n padding: 0;\n counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol,\n.ql-editor ul {\n padding-left: 1.5em;\n}\n.ql-editor ol > li,\n.ql-editor ul > li {\n list-style-type: none;\n}\n.ql-editor ul > li::before {\n content: '\\2022';\n}\n.ql-editor ul[data-checked=true],\n.ql-editor ul[data-checked=false] {\n pointer-events: none;\n}\n.ql-editor ul[data-checked=true] > li *,\n.ql-editor ul[data-checked=false] > li * {\n pointer-events: all;\n}\n.ql-editor ul[data-checked=true] > li::before,\n.ql-editor ul[data-checked=false] > li::before {\n color: #777;\n cursor: pointer;\n pointer-events: all;\n}\n.ql-editor ul[data-checked=true] > li::before {\n content: '\\2611';\n}\n.ql-editor ul[data-checked=false] > li::before {\n content: '\\2610';\n}\n.ql-editor li::before {\n display: inline-block;\n white-space: nowrap;\n width: 1.2em;\n}\n.ql-editor li:not(.ql-direction-rtl)::before {\n margin-left: -1.5em;\n margin-right: 0.3em;\n text-align: right;\n}\n.ql-editor li.ql-direction-rtl::before {\n margin-left: 0.3em;\n margin-right: -1.5em;\n}\n.ql-editor ol li:not(.ql-direction-rtl),\n.ql-editor ul li:not(.ql-direction-rtl) {\n padding-left: 1.5em;\n}\n.ql-editor ol li.ql-direction-rtl,\n.ql-editor ul li.ql-direction-rtl {\n padding-right: 1.5em;\n}\n.ql-editor ol li {\n counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;\n counter-increment: list-0;\n}\n.ql-editor ol li:before {\n content: counter(list-0, decimal) '. ';\n}\n.ql-editor ol li.ql-indent-1 {\n counter-increment: list-1;\n}\n.ql-editor ol li.ql-indent-1:before {\n content: counter(list-1, lower-alpha) '. ';\n}\n.ql-editor ol li.ql-indent-1 {\n counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-2 {\n counter-increment: list-2;\n}\n.ql-editor ol li.ql-indent-2:before {\n content: counter(list-2, lower-roman) '. ';\n}\n.ql-editor ol li.ql-indent-2 {\n counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-3 {\n counter-increment: list-3;\n}\n.ql-editor ol li.ql-indent-3:before {\n content: counter(list-3, decimal) '. ';\n}\n.ql-editor ol li.ql-indent-3 {\n counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-4 {\n counter-increment: list-4;\n}\n.ql-editor ol li.ql-indent-4:before {\n content: counter(list-4, lower-alpha) '. ';\n}\n.ql-editor ol li.ql-indent-4 {\n counter-reset: list-5 list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-5 {\n counter-increment: list-5;\n}\n.ql-editor ol li.ql-indent-5:before {\n content: counter(list-5, lower-roman) '. ';\n}\n.ql-editor ol li.ql-indent-5 {\n counter-reset: list-6 list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-6 {\n counter-increment: list-6;\n}\n.ql-editor ol li.ql-indent-6:before {\n content: counter(list-6, decimal) '. ';\n}\n.ql-editor ol li.ql-indent-6 {\n counter-reset: list-7 list-8 list-9;\n}\n.ql-editor ol li.ql-indent-7 {\n counter-increment: list-7;\n}\n.ql-editor ol li.ql-indent-7:before {\n content: counter(list-7, lower-alpha) '. ';\n}\n.ql-editor ol li.ql-indent-7 {\n counter-reset: list-8 list-9;\n}\n.ql-editor ol li.ql-indent-8 {\n counter-increment: list-8;\n}\n.ql-editor ol li.ql-indent-8:before {\n content: counter(list-8, lower-roman) '. ';\n}\n.ql-editor ol li.ql-indent-8 {\n counter-reset: list-9;\n}\n.ql-editor ol li.ql-indent-9 {\n counter-increment: list-9;\n}\n.ql-editor ol li.ql-indent-9:before {\n content: counter(list-9, decimal) '. ';\n}\n.ql-editor .ql-indent-1:not(.ql-direction-rtl) {\n padding-left: 3em;\n}\n.ql-editor li.ql-indent-1:not(.ql-direction-rtl) {\n padding-left: 4.5em;\n}\n.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right {\n padding-right: 3em;\n}\n.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right {\n padding-right: 4.5em;\n}\n.ql-editor .ql-indent-2:not(.ql-direction-rtl) {\n padding-left: 6em;\n}\n.ql-editor li.ql-indent-2:not(.ql-direction-rtl) {\n padding-left: 7.5em;\n}\n.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right {\n padding-right: 6em;\n}\n.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right {\n padding-right: 7.5em;\n}\n.ql-editor .ql-indent-3:not(.ql-direction-rtl) {\n padding-left: 9em;\n}\n.ql-editor li.ql-indent-3:not(.ql-direction-rtl) {\n padding-left: 10.5em;\n}\n.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right {\n padding-right: 9em;\n}\n.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right {\n padding-right: 10.5em;\n}\n.ql-editor .ql-indent-4:not(.ql-direction-rtl) {\n padding-left: 12em;\n}\n.ql-editor li.ql-indent-4:not(.ql-direction-rtl) {\n padding-left: 13.5em;\n}\n.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right {\n padding-right: 12em;\n}\n.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right {\n padding-right: 13.5em;\n}\n.ql-editor .ql-indent-5:not(.ql-direction-rtl) {\n padding-left: 15em;\n}\n.ql-editor li.ql-indent-5:not(.ql-direction-rtl) {\n padding-left: 16.5em;\n}\n.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right {\n padding-right: 15em;\n}\n.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right {\n padding-right: 16.5em;\n}\n.ql-editor .ql-indent-6:not(.ql-direction-rtl) {\n padding-left: 18em;\n}\n.ql-editor li.ql-indent-6:not(.ql-direction-rtl) {\n padding-left: 19.5em;\n}\n.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right {\n padding-right: 18em;\n}\n.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right {\n padding-right: 19.5em;\n}\n.ql-editor .ql-indent-7:not(.ql-direction-rtl) {\n padding-left: 21em;\n}\n.ql-editor li.ql-indent-7:not(.ql-direction-rtl) {\n padding-left: 22.5em;\n}\n.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right {\n padding-right: 21em;\n}\n.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right {\n padding-right: 22.5em;\n}\n.ql-editor .ql-indent-8:not(.ql-direction-rtl) {\n padding-left: 24em;\n}\n.ql-editor li.ql-indent-8:not(.ql-direction-rtl) {\n padding-left: 25.5em;\n}\n.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right {\n padding-right: 24em;\n}\n.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right {\n padding-right: 25.5em;\n}\n.ql-editor .ql-indent-9:not(.ql-direction-rtl) {\n padding-left: 27em;\n}\n.ql-editor li.ql-indent-9:not(.ql-direction-rtl) {\n padding-left: 28.5em;\n}\n.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right {\n padding-right: 27em;\n}\n.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right {\n padding-right: 28.5em;\n}\n.ql-editor .ql-video {\n display: block;\n max-width: 100%;\n}\n.ql-editor .ql-video.ql-align-center {\n margin: 0 auto;\n}\n.ql-editor .ql-video.ql-align-right {\n margin: 0 0 0 auto;\n}\n.ql-editor .ql-bg-black {\n background-color: #000;\n}\n.ql-editor .ql-bg-red {\n background-color: #e60000;\n}\n.ql-editor .ql-bg-orange {\n background-color: #f90;\n}\n.ql-editor .ql-bg-yellow {\n background-color: #ff0;\n}\n.ql-editor .ql-bg-green {\n background-color: #008a00;\n}\n.ql-editor .ql-bg-blue {\n background-color: #06c;\n}\n.ql-editor .ql-bg-purple {\n background-color: #93f;\n}\n.ql-editor .ql-color-white {\n color: #fff;\n}\n.ql-editor .ql-color-red {\n color: #e60000;\n}\n.ql-editor .ql-color-orange {\n color: #f90;\n}\n.ql-editor .ql-color-yellow {\n color: #ff0;\n}\n.ql-editor .ql-color-green {\n color: #008a00;\n}\n.ql-editor .ql-color-blue {\n color: #06c;\n}\n.ql-editor .ql-color-purple {\n color: #93f;\n}\n.ql-editor .ql-font-serif {\n font-family: Georgia, Times New Roman, serif;\n}\n.ql-editor .ql-font-monospace {\n font-family: Monaco, Courier New, monospace;\n}\n.ql-editor .ql-size-small {\n font-size: 0.75em;\n}\n.ql-editor .ql-size-large {\n font-size: 1.5em;\n}\n.ql-editor .ql-size-huge {\n font-size: 2.5em;\n}\n.ql-editor .ql-direction-rtl {\n direction: rtl;\n text-align: inherit;\n}\n.ql-editor .ql-align-center {\n text-align: center;\n}\n.ql-editor .ql-align-justify {\n text-align: justify;\n}\n.ql-editor .ql-align-right {\n text-align: right;\n}\n.ql-editor.ql-blank::before {\n color: rgba(0,0,0,0.6);\n content: attr(data-placeholder);\n font-style: italic;\n left: 15px;\n pointer-events: none;\n position: absolute;\n right: 15px;\n}\n.ql-snow.ql-toolbar:after,\n.ql-snow .ql-toolbar:after {\n clear: both;\n content: '';\n display: table;\n}\n.ql-snow.ql-toolbar button,\n.ql-snow .ql-toolbar button {\n background: none;\n border: none;\n cursor: pointer;\n display: inline-block;\n float: left;\n height: 24px;\n padding: 3px 5px;\n width: 28px;\n}\n.ql-snow.ql-toolbar button svg,\n.ql-snow .ql-toolbar button svg {\n float: left;\n height: 100%;\n}\n.ql-snow.ql-toolbar button:active:hover,\n.ql-snow .ql-toolbar button:active:hover {\n outline: none;\n}\n.ql-snow.ql-toolbar input.ql-image[type=file],\n.ql-snow .ql-toolbar input.ql-image[type=file] {\n display: none;\n}\n.ql-snow.ql-toolbar button:hover,\n.ql-snow .ql-toolbar button:hover,\n.ql-snow.ql-toolbar button:focus,\n.ql-snow .ql-toolbar button:focus,\n.ql-snow.ql-toolbar button.ql-active,\n.ql-snow .ql-toolbar button.ql-active,\n.ql-snow.ql-toolbar .ql-picker-label:hover,\n.ql-snow .ql-toolbar .ql-picker-label:hover,\n.ql-snow.ql-toolbar .ql-picker-label.ql-active,\n.ql-snow .ql-toolbar .ql-picker-label.ql-active,\n.ql-snow.ql-toolbar .ql-picker-item:hover,\n.ql-snow .ql-toolbar .ql-picker-item:hover,\n.ql-snow.ql-toolbar .ql-picker-item.ql-selected,\n.ql-snow .ql-toolbar .ql-picker-item.ql-selected {\n color: #06c;\n}\n.ql-snow.ql-toolbar button:hover .ql-fill,\n.ql-snow .ql-toolbar button:hover .ql-fill,\n.ql-snow.ql-toolbar button:focus .ql-fill,\n.ql-snow .ql-toolbar button:focus .ql-fill,\n.ql-snow.ql-toolbar button.ql-active .ql-fill,\n.ql-snow .ql-toolbar button.ql-active .ql-fill,\n.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,\n.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,\n.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,\n.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,\n.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,\n.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,\n.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,\n.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,\n.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,\n.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,\n.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,\n.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,\n.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,\n.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,\n.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,\n.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,\n.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,\n.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,\n.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,\n.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,\n.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,\n.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill {\n fill: #06c;\n}\n.ql-snow.ql-toolbar button:hover .ql-stroke,\n.ql-snow .ql-toolbar button:hover .ql-stroke,\n.ql-snow.ql-toolbar button:focus .ql-stroke,\n.ql-snow .ql-toolbar button:focus .ql-stroke,\n.ql-snow.ql-toolbar button.ql-active .ql-stroke,\n.ql-snow .ql-toolbar button.ql-active .ql-stroke,\n.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,\n.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,\n.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,\n.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,\n.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,\n.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,\n.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,\n.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,\n.ql-snow.ql-toolbar button:hover .ql-stroke-miter,\n.ql-snow .ql-toolbar button:hover .ql-stroke-miter,\n.ql-snow.ql-toolbar button:focus .ql-stroke-miter,\n.ql-snow .ql-toolbar button:focus .ql-stroke-miter,\n.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,\n.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,\n.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,\n.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,\n.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,\n.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,\n.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,\n.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,\n.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,\n.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter {\n stroke: #06c;\n}\n@media (pointer: coarse) {\n .ql-snow.ql-toolbar button:hover:not(.ql-active),\n .ql-snow .ql-toolbar button:hover:not(.ql-active) {\n color: #444;\n }\n .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,\n .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,\n .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,\n .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill {\n fill: #444;\n }\n .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,\n .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,\n .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,\n .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter {\n stroke: #444;\n }\n}\n.ql-snow {\n box-sizing: border-box;\n}\n.ql-snow * {\n box-sizing: border-box;\n}\n.ql-snow .ql-hidden {\n display: none;\n}\n.ql-snow .ql-out-bottom,\n.ql-snow .ql-out-top {\n visibility: hidden;\n}\n.ql-snow .ql-tooltip {\n position: absolute;\n transform: translateY(10px);\n}\n.ql-snow .ql-tooltip a {\n cursor: pointer;\n text-decoration: none;\n}\n.ql-snow .ql-tooltip.ql-flip {\n transform: translateY(-10px);\n}\n.ql-snow .ql-formats {\n display: inline-block;\n vertical-align: middle;\n}\n.ql-snow .ql-formats:after {\n clear: both;\n content: '';\n display: table;\n}\n.ql-snow .ql-stroke {\n fill: none;\n stroke: #444;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 2;\n}\n.ql-snow .ql-stroke-miter {\n fill: none;\n stroke: #444;\n stroke-miterlimit: 10;\n stroke-width: 2;\n}\n.ql-snow .ql-fill,\n.ql-snow .ql-stroke.ql-fill {\n fill: #444;\n}\n.ql-snow .ql-empty {\n fill: none;\n}\n.ql-snow .ql-even {\n fill-rule: evenodd;\n}\n.ql-snow .ql-thin,\n.ql-snow .ql-stroke.ql-thin {\n stroke-width: 1;\n}\n.ql-snow .ql-transparent {\n opacity: 0.4;\n}\n.ql-snow .ql-direction svg:last-child {\n display: none;\n}\n.ql-snow .ql-direction.ql-active svg:last-child {\n display: inline;\n}\n.ql-snow .ql-direction.ql-active svg:first-child {\n display: none;\n}\n.ql-snow .ql-editor h1 {\n font-size: 2em;\n}\n.ql-snow .ql-editor h2 {\n font-size: 1.5em;\n}\n.ql-snow .ql-editor h3 {\n font-size: 1.17em;\n}\n.ql-snow .ql-editor h4 {\n font-size: 1em;\n}\n.ql-snow .ql-editor h5 {\n font-size: 0.83em;\n}\n.ql-snow .ql-editor h6 {\n font-size: 0.67em;\n}\n.ql-snow .ql-editor a {\n text-decoration: underline;\n}\n.ql-snow .ql-editor blockquote {\n border-left: 4px solid #ccc;\n margin-bottom: 5px;\n margin-top: 5px;\n padding-left: 16px;\n}\n.ql-snow .ql-editor code,\n.ql-snow .ql-editor pre {\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n.ql-snow .ql-editor pre {\n white-space: pre-wrap;\n margin-bottom: 5px;\n margin-top: 5px;\n padding: 5px 10px;\n}\n.ql-snow .ql-editor code {\n font-size: 85%;\n padding: 2px 4px;\n}\n.ql-snow .ql-editor pre.ql-syntax {\n background-color: #23241f;\n color: #f8f8f2;\n overflow: visible;\n}\n.ql-snow .ql-editor img {\n max-width: 100%;\n}\n.ql-snow .ql-picker {\n color: #444;\n display: inline-block;\n float: left;\n font-size: 14px;\n font-weight: 500;\n height: 24px;\n position: relative;\n vertical-align: middle;\n}\n.ql-snow .ql-picker-label {\n cursor: pointer;\n display: inline-block;\n height: 100%;\n padding-left: 8px;\n padding-right: 2px;\n position: relative;\n width: 100%;\n}\n.ql-snow .ql-picker-label::before {\n display: inline-block;\n line-height: 22px;\n}\n.ql-snow .ql-picker-options {\n background-color: #fff;\n display: none;\n min-width: 100%;\n padding: 4px 8px;\n position: absolute;\n white-space: nowrap;\n}\n.ql-snow .ql-picker-options .ql-picker-item {\n cursor: pointer;\n display: block;\n padding-bottom: 5px;\n padding-top: 5px;\n}\n.ql-snow .ql-picker.ql-expanded .ql-picker-label {\n color: #ccc;\n z-index: 2;\n}\n.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill {\n fill: #ccc;\n}\n.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke {\n stroke: #ccc;\n}\n.ql-snow .ql-picker.ql-expanded .ql-picker-options {\n display: block;\n margin-top: -1px;\n top: 100%;\n z-index: 1;\n}\n.ql-snow .ql-color-picker,\n.ql-snow .ql-icon-picker {\n width: 28px;\n}\n.ql-snow .ql-color-picker .ql-picker-label,\n.ql-snow .ql-icon-picker .ql-picker-label {\n padding: 2px 4px;\n}\n.ql-snow .ql-color-picker .ql-picker-label svg,\n.ql-snow .ql-icon-picker .ql-picker-label svg {\n right: 4px;\n}\n.ql-snow .ql-icon-picker .ql-picker-options {\n padding: 4px 0px;\n}\n.ql-snow .ql-icon-picker .ql-picker-item {\n height: 24px;\n width: 24px;\n padding: 2px 4px;\n}\n.ql-snow .ql-color-picker .ql-picker-options {\n padding: 3px 5px;\n width: 152px;\n}\n.ql-snow .ql-color-picker .ql-picker-item {\n border: 1px solid transparent;\n float: left;\n height: 16px;\n margin: 2px;\n padding: 0px;\n width: 16px;\n}\n.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg {\n position: absolute;\n margin-top: -9px;\n right: 0;\n top: 50%;\n width: 18px;\n}\n.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,\n.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,\n.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,\n.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,\n.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before {\n content: attr(data-label);\n}\n.ql-snow .ql-picker.ql-header {\n width: 98px;\n}\n.ql-snow .ql-picker.ql-header .ql-picker-label::before,\n.ql-snow .ql-picker.ql-header .ql-picker-item::before {\n content: 'Normal';\n}\n.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before {\n content: 'Heading 1';\n}\n.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before {\n content: 'Heading 2';\n}\n.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before {\n content: 'Heading 3';\n}\n.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before {\n content: 'Heading 4';\n}\n.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before {\n content: 'Heading 5';\n}\n.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before {\n content: 'Heading 6';\n}\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before {\n font-size: 2em;\n}\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before {\n font-size: 1.5em;\n}\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before {\n font-size: 1.17em;\n}\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before {\n font-size: 1em;\n}\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before {\n font-size: 0.83em;\n}\n.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before {\n font-size: 0.67em;\n}\n.ql-snow .ql-picker.ql-font {\n width: 108px;\n}\n.ql-snow .ql-picker.ql-font .ql-picker-label::before,\n.ql-snow .ql-picker.ql-font .ql-picker-item::before {\n content: 'Sans Serif';\n}\n.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,\n.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before {\n content: 'Serif';\n}\n.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,\n.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before {\n content: 'Monospace';\n}\n.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before {\n font-family: Georgia, Times New Roman, serif;\n}\n.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before {\n font-family: Monaco, Courier New, monospace;\n}\n.ql-snow .ql-picker.ql-size {\n width: 98px;\n}\n.ql-snow .ql-picker.ql-size .ql-picker-label::before,\n.ql-snow .ql-picker.ql-size .ql-picker-item::before {\n content: 'Normal';\n}\n.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,\n.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before {\n content: 'Small';\n}\n.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,\n.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before {\n content: 'Large';\n}\n.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,\n.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before {\n content: 'Huge';\n}\n.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before {\n font-size: 10px;\n}\n.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before {\n font-size: 18px;\n}\n.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before {\n font-size: 32px;\n}\n.ql-snow .ql-color-picker.ql-background .ql-picker-item {\n background-color: #fff;\n}\n.ql-snow .ql-color-picker.ql-color .ql-picker-item {\n background-color: #000;\n}\n.ql-toolbar.ql-snow {\n border: 1px solid #ccc;\n box-sizing: border-box;\n font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;\n padding: 8px;\n}\n.ql-toolbar.ql-snow .ql-formats {\n margin-right: 15px;\n}\n.ql-toolbar.ql-snow .ql-picker-label {\n border: 1px solid transparent;\n}\n.ql-toolbar.ql-snow .ql-picker-options {\n border: 1px solid transparent;\n box-shadow: rgba(0,0,0,0.2) 0 2px 8px;\n}\n.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {\n border-color: #ccc;\n}\n.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {\n border-color: #ccc;\n}\n.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,\n.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover {\n border-color: #000;\n}\n.ql-toolbar.ql-snow + .ql-container.ql-snow {\n border-top: 0px;\n}\n.ql-snow .ql-tooltip {\n background-color: #fff;\n border: 1px solid #ccc;\n box-shadow: 0px 0px 5px #ddd;\n color: #444;\n padding: 5px 12px;\n white-space: nowrap;\n}\n.ql-snow .ql-tooltip::before {\n content: \"Visit URL:\";\n line-height: 26px;\n margin-right: 8px;\n}\n.ql-snow .ql-tooltip input[type=text] {\n display: none;\n border: 1px solid #ccc;\n font-size: 13px;\n height: 26px;\n margin: 0px;\n padding: 3px 5px;\n width: 170px;\n}\n.ql-snow .ql-tooltip a.ql-preview {\n display: inline-block;\n max-width: 200px;\n overflow-x: hidden;\n text-overflow: ellipsis;\n vertical-align: top;\n}\n.ql-snow .ql-tooltip a.ql-action::after {\n border-right: 1px solid #ccc;\n content: 'Edit';\n margin-left: 16px;\n padding-right: 8px;\n}\n.ql-snow .ql-tooltip a.ql-remove::before {\n content: 'Remove';\n margin-left: 8px;\n}\n.ql-snow .ql-tooltip a {\n line-height: 26px;\n}\n.ql-snow .ql-tooltip.ql-editing a.ql-preview,\n.ql-snow .ql-tooltip.ql-editing a.ql-remove {\n display: none;\n}\n.ql-snow .ql-tooltip.ql-editing input[type=text] {\n display: inline-block;\n}\n.ql-snow .ql-tooltip.ql-editing a.ql-action::after {\n border-right: 0px;\n content: 'Save';\n padding-right: 0px;\n}\n.ql-snow .ql-tooltip[data-mode=link]::before {\n content: \"Enter link:\";\n}\n.ql-snow .ql-tooltip[data-mode=formula]::before {\n content: \"Enter formula:\";\n}\n.ql-snow .ql-tooltip[data-mode=video]::before {\n content: \"Enter video:\";\n}\n.ql-snow a {\n color: #06c;\n}\n.ql-container.ql-snow {\n border: 1px solid #ccc;\n}\n", ""]); |
| 8304 |
// Exports |
| 8305 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); |
| 8306 |
|
| 8307 |
|
| 8308 |
/***/ }), |
| 8309 |
|
| 8310 |
/***/ 3645: |
| 8311 |
/***/ ((module) => { |
| 8312 |
|
| 8313 |
"use strict"; |
| 8314 |
|
| 8315 |
|
| 8316 |
/* |
| 8317 |
MIT License http://www.opensource.org/licenses/mit-license.php |
| 8318 |
Author Tobias Koppers @sokra |
| 8319 |
*/ |
| 8320 |
// css base code, injected by the css-loader |
| 8321 |
// eslint-disable-next-line func-names |
| 8322 |
module.exports = function (cssWithMappingToString) { |
| 8323 |
var list = []; // return the list of modules as css string |
| 8324 |
|
| 8325 |
list.toString = function toString() { |
| 8326 |
return this.map(function (item) { |
| 8327 |
var content = cssWithMappingToString(item); |
| 8328 |
|
| 8329 |
if (item[2]) { |
| 8330 |
return "@media ".concat(item[2], " {").concat(content, "}"); |
| 8331 |
} |
| 8332 |
|
| 8333 |
return content; |
| 8334 |
}).join(""); |
| 8335 |
}; // import a list of modules into the list |
| 8336 |
// eslint-disable-next-line func-names |
| 8337 |
|
| 8338 |
|
| 8339 |
list.i = function (modules, mediaQuery, dedupe) { |
| 8340 |
if (typeof modules === "string") { |
| 8341 |
// eslint-disable-next-line no-param-reassign |
| 8342 |
modules = [[null, modules, ""]]; |
| 8343 |
} |
| 8344 |
|
| 8345 |
var alreadyImportedModules = {}; |
| 8346 |
|
| 8347 |
if (dedupe) { |
| 8348 |
for (var i = 0; i < this.length; i++) { |
| 8349 |
// eslint-disable-next-line prefer-destructuring |
| 8350 |
var id = this[i][0]; |
| 8351 |
|
| 8352 |
if (id != null) { |
| 8353 |
alreadyImportedModules[id] = true; |
| 8354 |
} |
| 8355 |
} |
| 8356 |
} |
| 8357 |
|
| 8358 |
for (var _i = 0; _i < modules.length; _i++) { |
| 8359 |
var item = [].concat(modules[_i]); |
| 8360 |
|
| 8361 |
if (dedupe && alreadyImportedModules[item[0]]) { |
| 8362 |
// eslint-disable-next-line no-continue |
| 8363 |
continue; |
| 8364 |
} |
| 8365 |
|
| 8366 |
if (mediaQuery) { |
| 8367 |
if (!item[2]) { |
| 8368 |
item[2] = mediaQuery; |
| 8369 |
} else { |
| 8370 |
item[2] = "".concat(mediaQuery, " and ").concat(item[2]); |
| 8371 |
} |
| 8372 |
} |
| 8373 |
|
| 8374 |
list.push(item); |
| 8375 |
} |
| 8376 |
}; |
| 8377 |
|
| 8378 |
return list; |
| 8379 |
}; |
| 8380 |
|
| 8381 |
/***/ }), |
| 8382 |
|
| 8383 |
/***/ 7484: |
| 8384 |
/***/ (function(module) { |
| 8385 |
|
| 8386 |
!function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),l=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case c:return r?l(1,0):l(31,11);case f:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),l=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,l=this;r=Number(r);var $=O.p(h),y=function(t){var e=w(l);return O.w(e.date(e.date()+Math.round(t*r)),l)};if($===f)return this.set(f,this.$M+r);if($===c)return this.set(c,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},$={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||$[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,v=this-M,g=O.m(this,M);return g=($={},$[c]=g/12,$[f]=g,$[h]=g/3,$[o]=(v-m)/6048e5,$[a]=(v-m)/864e5,$[u]=v/n,$[s]=v/e,$[i]=v/t,$)[y]||v,l?g:O.a(g)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[g],w.Ls=D,w.p={},w})); |
| 8387 |
|
| 8388 |
/***/ }), |
| 8389 |
|
| 8390 |
/***/ 6230: |
| 8391 |
/***/ ((module) => { |
| 8392 |
|
| 8393 |
/* eslint-env browser */ |
| 8394 |
module.exports = typeof self == 'object' ? self.FormData : window.FormData; |
| 8395 |
|
| 8396 |
|
| 8397 |
/***/ }), |
| 8398 |
|
| 8399 |
/***/ 8552: |
| 8400 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8401 |
|
| 8402 |
var getNative = __webpack_require__(852), |
| 8403 |
root = __webpack_require__(5639); |
| 8404 |
|
| 8405 |
/* Built-in method references that are verified to be native. */ |
| 8406 |
var DataView = getNative(root, 'DataView'); |
| 8407 |
|
| 8408 |
module.exports = DataView; |
| 8409 |
|
| 8410 |
|
| 8411 |
/***/ }), |
| 8412 |
|
| 8413 |
/***/ 1989: |
| 8414 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8415 |
|
| 8416 |
var hashClear = __webpack_require__(1789), |
| 8417 |
hashDelete = __webpack_require__(401), |
| 8418 |
hashGet = __webpack_require__(7667), |
| 8419 |
hashHas = __webpack_require__(1327), |
| 8420 |
hashSet = __webpack_require__(1866); |
| 8421 |
|
| 8422 |
/** |
| 8423 |
* Creates a hash object. |
| 8424 |
* |
| 8425 |
* @private |
| 8426 |
* @constructor |
| 8427 |
* @param {Array} [entries] The key-value pairs to cache. |
| 8428 |
*/ |
| 8429 |
function Hash(entries) { |
| 8430 |
var index = -1, |
| 8431 |
length = entries == null ? 0 : entries.length; |
| 8432 |
|
| 8433 |
this.clear(); |
| 8434 |
while (++index < length) { |
| 8435 |
var entry = entries[index]; |
| 8436 |
this.set(entry[0], entry[1]); |
| 8437 |
} |
| 8438 |
} |
| 8439 |
|
| 8440 |
// Add methods to `Hash`. |
| 8441 |
Hash.prototype.clear = hashClear; |
| 8442 |
Hash.prototype['delete'] = hashDelete; |
| 8443 |
Hash.prototype.get = hashGet; |
| 8444 |
Hash.prototype.has = hashHas; |
| 8445 |
Hash.prototype.set = hashSet; |
| 8446 |
|
| 8447 |
module.exports = Hash; |
| 8448 |
|
| 8449 |
|
| 8450 |
/***/ }), |
| 8451 |
|
| 8452 |
/***/ 8407: |
| 8453 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8454 |
|
| 8455 |
var listCacheClear = __webpack_require__(7040), |
| 8456 |
listCacheDelete = __webpack_require__(4125), |
| 8457 |
listCacheGet = __webpack_require__(2117), |
| 8458 |
listCacheHas = __webpack_require__(7518), |
| 8459 |
listCacheSet = __webpack_require__(4705); |
| 8460 |
|
| 8461 |
/** |
| 8462 |
* Creates an list cache object. |
| 8463 |
* |
| 8464 |
* @private |
| 8465 |
* @constructor |
| 8466 |
* @param {Array} [entries] The key-value pairs to cache. |
| 8467 |
*/ |
| 8468 |
function ListCache(entries) { |
| 8469 |
var index = -1, |
| 8470 |
length = entries == null ? 0 : entries.length; |
| 8471 |
|
| 8472 |
this.clear(); |
| 8473 |
while (++index < length) { |
| 8474 |
var entry = entries[index]; |
| 8475 |
this.set(entry[0], entry[1]); |
| 8476 |
} |
| 8477 |
} |
| 8478 |
|
| 8479 |
// Add methods to `ListCache`. |
| 8480 |
ListCache.prototype.clear = listCacheClear; |
| 8481 |
ListCache.prototype['delete'] = listCacheDelete; |
| 8482 |
ListCache.prototype.get = listCacheGet; |
| 8483 |
ListCache.prototype.has = listCacheHas; |
| 8484 |
ListCache.prototype.set = listCacheSet; |
| 8485 |
|
| 8486 |
module.exports = ListCache; |
| 8487 |
|
| 8488 |
|
| 8489 |
/***/ }), |
| 8490 |
|
| 8491 |
/***/ 7071: |
| 8492 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8493 |
|
| 8494 |
var getNative = __webpack_require__(852), |
| 8495 |
root = __webpack_require__(5639); |
| 8496 |
|
| 8497 |
/* Built-in method references that are verified to be native. */ |
| 8498 |
var Map = getNative(root, 'Map'); |
| 8499 |
|
| 8500 |
module.exports = Map; |
| 8501 |
|
| 8502 |
|
| 8503 |
/***/ }), |
| 8504 |
|
| 8505 |
/***/ 3369: |
| 8506 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8507 |
|
| 8508 |
var mapCacheClear = __webpack_require__(4785), |
| 8509 |
mapCacheDelete = __webpack_require__(1285), |
| 8510 |
mapCacheGet = __webpack_require__(6000), |
| 8511 |
mapCacheHas = __webpack_require__(9916), |
| 8512 |
mapCacheSet = __webpack_require__(5265); |
| 8513 |
|
| 8514 |
/** |
| 8515 |
* Creates a map cache object to store key-value pairs. |
| 8516 |
* |
| 8517 |
* @private |
| 8518 |
* @constructor |
| 8519 |
* @param {Array} [entries] The key-value pairs to cache. |
| 8520 |
*/ |
| 8521 |
function MapCache(entries) { |
| 8522 |
var index = -1, |
| 8523 |
length = entries == null ? 0 : entries.length; |
| 8524 |
|
| 8525 |
this.clear(); |
| 8526 |
while (++index < length) { |
| 8527 |
var entry = entries[index]; |
| 8528 |
this.set(entry[0], entry[1]); |
| 8529 |
} |
| 8530 |
} |
| 8531 |
|
| 8532 |
// Add methods to `MapCache`. |
| 8533 |
MapCache.prototype.clear = mapCacheClear; |
| 8534 |
MapCache.prototype['delete'] = mapCacheDelete; |
| 8535 |
MapCache.prototype.get = mapCacheGet; |
| 8536 |
MapCache.prototype.has = mapCacheHas; |
| 8537 |
MapCache.prototype.set = mapCacheSet; |
| 8538 |
|
| 8539 |
module.exports = MapCache; |
| 8540 |
|
| 8541 |
|
| 8542 |
/***/ }), |
| 8543 |
|
| 8544 |
/***/ 3818: |
| 8545 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8546 |
|
| 8547 |
var getNative = __webpack_require__(852), |
| 8548 |
root = __webpack_require__(5639); |
| 8549 |
|
| 8550 |
/* Built-in method references that are verified to be native. */ |
| 8551 |
var Promise = getNative(root, 'Promise'); |
| 8552 |
|
| 8553 |
module.exports = Promise; |
| 8554 |
|
| 8555 |
|
| 8556 |
/***/ }), |
| 8557 |
|
| 8558 |
/***/ 8525: |
| 8559 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8560 |
|
| 8561 |
var getNative = __webpack_require__(852), |
| 8562 |
root = __webpack_require__(5639); |
| 8563 |
|
| 8564 |
/* Built-in method references that are verified to be native. */ |
| 8565 |
var Set = getNative(root, 'Set'); |
| 8566 |
|
| 8567 |
module.exports = Set; |
| 8568 |
|
| 8569 |
|
| 8570 |
/***/ }), |
| 8571 |
|
| 8572 |
/***/ 8668: |
| 8573 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8574 |
|
| 8575 |
var MapCache = __webpack_require__(3369), |
| 8576 |
setCacheAdd = __webpack_require__(619), |
| 8577 |
setCacheHas = __webpack_require__(2385); |
| 8578 |
|
| 8579 |
/** |
| 8580 |
* |
| 8581 |
* Creates an array cache object to store unique values. |
| 8582 |
* |
| 8583 |
* @private |
| 8584 |
* @constructor |
| 8585 |
* @param {Array} [values] The values to cache. |
| 8586 |
*/ |
| 8587 |
function SetCache(values) { |
| 8588 |
var index = -1, |
| 8589 |
length = values == null ? 0 : values.length; |
| 8590 |
|
| 8591 |
this.__data__ = new MapCache; |
| 8592 |
while (++index < length) { |
| 8593 |
this.add(values[index]); |
| 8594 |
} |
| 8595 |
} |
| 8596 |
|
| 8597 |
// Add methods to `SetCache`. |
| 8598 |
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; |
| 8599 |
SetCache.prototype.has = setCacheHas; |
| 8600 |
|
| 8601 |
module.exports = SetCache; |
| 8602 |
|
| 8603 |
|
| 8604 |
/***/ }), |
| 8605 |
|
| 8606 |
/***/ 6384: |
| 8607 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8608 |
|
| 8609 |
var ListCache = __webpack_require__(8407), |
| 8610 |
stackClear = __webpack_require__(7465), |
| 8611 |
stackDelete = __webpack_require__(3779), |
| 8612 |
stackGet = __webpack_require__(7599), |
| 8613 |
stackHas = __webpack_require__(4758), |
| 8614 |
stackSet = __webpack_require__(4309); |
| 8615 |
|
| 8616 |
/** |
| 8617 |
* Creates a stack cache object to store key-value pairs. |
| 8618 |
* |
| 8619 |
* @private |
| 8620 |
* @constructor |
| 8621 |
* @param {Array} [entries] The key-value pairs to cache. |
| 8622 |
*/ |
| 8623 |
function Stack(entries) { |
| 8624 |
var data = this.__data__ = new ListCache(entries); |
| 8625 |
this.size = data.size; |
| 8626 |
} |
| 8627 |
|
| 8628 |
// Add methods to `Stack`. |
| 8629 |
Stack.prototype.clear = stackClear; |
| 8630 |
Stack.prototype['delete'] = stackDelete; |
| 8631 |
Stack.prototype.get = stackGet; |
| 8632 |
Stack.prototype.has = stackHas; |
| 8633 |
Stack.prototype.set = stackSet; |
| 8634 |
|
| 8635 |
module.exports = Stack; |
| 8636 |
|
| 8637 |
|
| 8638 |
/***/ }), |
| 8639 |
|
| 8640 |
/***/ 2705: |
| 8641 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8642 |
|
| 8643 |
var root = __webpack_require__(5639); |
| 8644 |
|
| 8645 |
/** Built-in value references. */ |
| 8646 |
var Symbol = root.Symbol; |
| 8647 |
|
| 8648 |
module.exports = Symbol; |
| 8649 |
|
| 8650 |
|
| 8651 |
/***/ }), |
| 8652 |
|
| 8653 |
/***/ 1149: |
| 8654 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8655 |
|
| 8656 |
var root = __webpack_require__(5639); |
| 8657 |
|
| 8658 |
/** Built-in value references. */ |
| 8659 |
var Uint8Array = root.Uint8Array; |
| 8660 |
|
| 8661 |
module.exports = Uint8Array; |
| 8662 |
|
| 8663 |
|
| 8664 |
/***/ }), |
| 8665 |
|
| 8666 |
/***/ 577: |
| 8667 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8668 |
|
| 8669 |
var getNative = __webpack_require__(852), |
| 8670 |
root = __webpack_require__(5639); |
| 8671 |
|
| 8672 |
/* Built-in method references that are verified to be native. */ |
| 8673 |
var WeakMap = getNative(root, 'WeakMap'); |
| 8674 |
|
| 8675 |
module.exports = WeakMap; |
| 8676 |
|
| 8677 |
|
| 8678 |
/***/ }), |
| 8679 |
|
| 8680 |
/***/ 4963: |
| 8681 |
/***/ ((module) => { |
| 8682 |
|
| 8683 |
/** |
| 8684 |
* A specialized version of `_.filter` for arrays without support for |
| 8685 |
* iteratee shorthands. |
| 8686 |
* |
| 8687 |
* @private |
| 8688 |
* @param {Array} [array] The array to iterate over. |
| 8689 |
* @param {Function} predicate The function invoked per iteration. |
| 8690 |
* @returns {Array} Returns the new filtered array. |
| 8691 |
*/ |
| 8692 |
function arrayFilter(array, predicate) { |
| 8693 |
var index = -1, |
| 8694 |
length = array == null ? 0 : array.length, |
| 8695 |
resIndex = 0, |
| 8696 |
result = []; |
| 8697 |
|
| 8698 |
while (++index < length) { |
| 8699 |
var value = array[index]; |
| 8700 |
if (predicate(value, index, array)) { |
| 8701 |
result[resIndex++] = value; |
| 8702 |
} |
| 8703 |
} |
| 8704 |
return result; |
| 8705 |
} |
| 8706 |
|
| 8707 |
module.exports = arrayFilter; |
| 8708 |
|
| 8709 |
|
| 8710 |
/***/ }), |
| 8711 |
|
| 8712 |
/***/ 4636: |
| 8713 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8714 |
|
| 8715 |
var baseTimes = __webpack_require__(2545), |
| 8716 |
isArguments = __webpack_require__(5694), |
| 8717 |
isArray = __webpack_require__(1469), |
| 8718 |
isBuffer = __webpack_require__(4144), |
| 8719 |
isIndex = __webpack_require__(5776), |
| 8720 |
isTypedArray = __webpack_require__(6719); |
| 8721 |
|
| 8722 |
/** Used for built-in method references. */ |
| 8723 |
var objectProto = Object.prototype; |
| 8724 |
|
| 8725 |
/** Used to check objects for own properties. */ |
| 8726 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 8727 |
|
| 8728 |
/** |
| 8729 |
* Creates an array of the enumerable property names of the array-like `value`. |
| 8730 |
* |
| 8731 |
* @private |
| 8732 |
* @param {*} value The value to query. |
| 8733 |
* @param {boolean} inherited Specify returning inherited property names. |
| 8734 |
* @returns {Array} Returns the array of property names. |
| 8735 |
*/ |
| 8736 |
function arrayLikeKeys(value, inherited) { |
| 8737 |
var isArr = isArray(value), |
| 8738 |
isArg = !isArr && isArguments(value), |
| 8739 |
isBuff = !isArr && !isArg && isBuffer(value), |
| 8740 |
isType = !isArr && !isArg && !isBuff && isTypedArray(value), |
| 8741 |
skipIndexes = isArr || isArg || isBuff || isType, |
| 8742 |
result = skipIndexes ? baseTimes(value.length, String) : [], |
| 8743 |
length = result.length; |
| 8744 |
|
| 8745 |
for (var key in value) { |
| 8746 |
if ((inherited || hasOwnProperty.call(value, key)) && |
| 8747 |
!(skipIndexes && ( |
| 8748 |
// Safari 9 has enumerable `arguments.length` in strict mode. |
| 8749 |
key == 'length' || |
| 8750 |
// Node.js 0.10 has enumerable non-index properties on buffers. |
| 8751 |
(isBuff && (key == 'offset' || key == 'parent')) || |
| 8752 |
// PhantomJS 2 has enumerable non-index properties on typed arrays. |
| 8753 |
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || |
| 8754 |
// Skip index properties. |
| 8755 |
isIndex(key, length) |
| 8756 |
))) { |
| 8757 |
result.push(key); |
| 8758 |
} |
| 8759 |
} |
| 8760 |
return result; |
| 8761 |
} |
| 8762 |
|
| 8763 |
module.exports = arrayLikeKeys; |
| 8764 |
|
| 8765 |
|
| 8766 |
/***/ }), |
| 8767 |
|
| 8768 |
/***/ 2488: |
| 8769 |
/***/ ((module) => { |
| 8770 |
|
| 8771 |
/** |
| 8772 |
* Appends the elements of `values` to `array`. |
| 8773 |
* |
| 8774 |
* @private |
| 8775 |
* @param {Array} array The array to modify. |
| 8776 |
* @param {Array} values The values to append. |
| 8777 |
* @returns {Array} Returns `array`. |
| 8778 |
*/ |
| 8779 |
function arrayPush(array, values) { |
| 8780 |
var index = -1, |
| 8781 |
length = values.length, |
| 8782 |
offset = array.length; |
| 8783 |
|
| 8784 |
while (++index < length) { |
| 8785 |
array[offset + index] = values[index]; |
| 8786 |
} |
| 8787 |
return array; |
| 8788 |
} |
| 8789 |
|
| 8790 |
module.exports = arrayPush; |
| 8791 |
|
| 8792 |
|
| 8793 |
/***/ }), |
| 8794 |
|
| 8795 |
/***/ 2908: |
| 8796 |
/***/ ((module) => { |
| 8797 |
|
| 8798 |
/** |
| 8799 |
* A specialized version of `_.some` for arrays without support for iteratee |
| 8800 |
* shorthands. |
| 8801 |
* |
| 8802 |
* @private |
| 8803 |
* @param {Array} [array] The array to iterate over. |
| 8804 |
* @param {Function} predicate The function invoked per iteration. |
| 8805 |
* @returns {boolean} Returns `true` if any element passes the predicate check, |
| 8806 |
* else `false`. |
| 8807 |
*/ |
| 8808 |
function arraySome(array, predicate) { |
| 8809 |
var index = -1, |
| 8810 |
length = array == null ? 0 : array.length; |
| 8811 |
|
| 8812 |
while (++index < length) { |
| 8813 |
if (predicate(array[index], index, array)) { |
| 8814 |
return true; |
| 8815 |
} |
| 8816 |
} |
| 8817 |
return false; |
| 8818 |
} |
| 8819 |
|
| 8820 |
module.exports = arraySome; |
| 8821 |
|
| 8822 |
|
| 8823 |
/***/ }), |
| 8824 |
|
| 8825 |
/***/ 8470: |
| 8826 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8827 |
|
| 8828 |
var eq = __webpack_require__(7813); |
| 8829 |
|
| 8830 |
/** |
| 8831 |
* Gets the index at which the `key` is found in `array` of key-value pairs. |
| 8832 |
* |
| 8833 |
* @private |
| 8834 |
* @param {Array} array The array to inspect. |
| 8835 |
* @param {*} key The key to search for. |
| 8836 |
* @returns {number} Returns the index of the matched value, else `-1`. |
| 8837 |
*/ |
| 8838 |
function assocIndexOf(array, key) { |
| 8839 |
var length = array.length; |
| 8840 |
while (length--) { |
| 8841 |
if (eq(array[length][0], key)) { |
| 8842 |
return length; |
| 8843 |
} |
| 8844 |
} |
| 8845 |
return -1; |
| 8846 |
} |
| 8847 |
|
| 8848 |
module.exports = assocIndexOf; |
| 8849 |
|
| 8850 |
|
| 8851 |
/***/ }), |
| 8852 |
|
| 8853 |
/***/ 8866: |
| 8854 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8855 |
|
| 8856 |
var arrayPush = __webpack_require__(2488), |
| 8857 |
isArray = __webpack_require__(1469); |
| 8858 |
|
| 8859 |
/** |
| 8860 |
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses |
| 8861 |
* `keysFunc` and `symbolsFunc` to get the enumerable property names and |
| 8862 |
* symbols of `object`. |
| 8863 |
* |
| 8864 |
* @private |
| 8865 |
* @param {Object} object The object to query. |
| 8866 |
* @param {Function} keysFunc The function to get the keys of `object`. |
| 8867 |
* @param {Function} symbolsFunc The function to get the symbols of `object`. |
| 8868 |
* @returns {Array} Returns the array of property names and symbols. |
| 8869 |
*/ |
| 8870 |
function baseGetAllKeys(object, keysFunc, symbolsFunc) { |
| 8871 |
var result = keysFunc(object); |
| 8872 |
return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); |
| 8873 |
} |
| 8874 |
|
| 8875 |
module.exports = baseGetAllKeys; |
| 8876 |
|
| 8877 |
|
| 8878 |
/***/ }), |
| 8879 |
|
| 8880 |
/***/ 4239: |
| 8881 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8882 |
|
| 8883 |
var Symbol = __webpack_require__(2705), |
| 8884 |
getRawTag = __webpack_require__(9607), |
| 8885 |
objectToString = __webpack_require__(2333); |
| 8886 |
|
| 8887 |
/** `Object#toString` result references. */ |
| 8888 |
var nullTag = '[object Null]', |
| 8889 |
undefinedTag = '[object Undefined]'; |
| 8890 |
|
| 8891 |
/** Built-in value references. */ |
| 8892 |
var symToStringTag = Symbol ? Symbol.toStringTag : undefined; |
| 8893 |
|
| 8894 |
/** |
| 8895 |
* The base implementation of `getTag` without fallbacks for buggy environments. |
| 8896 |
* |
| 8897 |
* @private |
| 8898 |
* @param {*} value The value to query. |
| 8899 |
* @returns {string} Returns the `toStringTag`. |
| 8900 |
*/ |
| 8901 |
function baseGetTag(value) { |
| 8902 |
if (value == null) { |
| 8903 |
return value === undefined ? undefinedTag : nullTag; |
| 8904 |
} |
| 8905 |
return (symToStringTag && symToStringTag in Object(value)) |
| 8906 |
? getRawTag(value) |
| 8907 |
: objectToString(value); |
| 8908 |
} |
| 8909 |
|
| 8910 |
module.exports = baseGetTag; |
| 8911 |
|
| 8912 |
|
| 8913 |
/***/ }), |
| 8914 |
|
| 8915 |
/***/ 9454: |
| 8916 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8917 |
|
| 8918 |
var baseGetTag = __webpack_require__(4239), |
| 8919 |
isObjectLike = __webpack_require__(7005); |
| 8920 |
|
| 8921 |
/** `Object#toString` result references. */ |
| 8922 |
var argsTag = '[object Arguments]'; |
| 8923 |
|
| 8924 |
/** |
| 8925 |
* The base implementation of `_.isArguments`. |
| 8926 |
* |
| 8927 |
* @private |
| 8928 |
* @param {*} value The value to check. |
| 8929 |
* @returns {boolean} Returns `true` if `value` is an `arguments` object, |
| 8930 |
*/ |
| 8931 |
function baseIsArguments(value) { |
| 8932 |
return isObjectLike(value) && baseGetTag(value) == argsTag; |
| 8933 |
} |
| 8934 |
|
| 8935 |
module.exports = baseIsArguments; |
| 8936 |
|
| 8937 |
|
| 8938 |
/***/ }), |
| 8939 |
|
| 8940 |
/***/ 939: |
| 8941 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8942 |
|
| 8943 |
var baseIsEqualDeep = __webpack_require__(2492), |
| 8944 |
isObjectLike = __webpack_require__(7005); |
| 8945 |
|
| 8946 |
/** |
| 8947 |
* The base implementation of `_.isEqual` which supports partial comparisons |
| 8948 |
* and tracks traversed objects. |
| 8949 |
* |
| 8950 |
* @private |
| 8951 |
* @param {*} value The value to compare. |
| 8952 |
* @param {*} other The other value to compare. |
| 8953 |
* @param {boolean} bitmask The bitmask flags. |
| 8954 |
* 1 - Unordered comparison |
| 8955 |
* 2 - Partial comparison |
| 8956 |
* @param {Function} [customizer] The function to customize comparisons. |
| 8957 |
* @param {Object} [stack] Tracks traversed `value` and `other` objects. |
| 8958 |
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. |
| 8959 |
*/ |
| 8960 |
function baseIsEqual(value, other, bitmask, customizer, stack) { |
| 8961 |
if (value === other) { |
| 8962 |
return true; |
| 8963 |
} |
| 8964 |
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { |
| 8965 |
return value !== value && other !== other; |
| 8966 |
} |
| 8967 |
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); |
| 8968 |
} |
| 8969 |
|
| 8970 |
module.exports = baseIsEqual; |
| 8971 |
|
| 8972 |
|
| 8973 |
/***/ }), |
| 8974 |
|
| 8975 |
/***/ 2492: |
| 8976 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8977 |
|
| 8978 |
var Stack = __webpack_require__(6384), |
| 8979 |
equalArrays = __webpack_require__(7114), |
| 8980 |
equalByTag = __webpack_require__(8351), |
| 8981 |
equalObjects = __webpack_require__(6096), |
| 8982 |
getTag = __webpack_require__(4160), |
| 8983 |
isArray = __webpack_require__(1469), |
| 8984 |
isBuffer = __webpack_require__(4144), |
| 8985 |
isTypedArray = __webpack_require__(6719); |
| 8986 |
|
| 8987 |
/** Used to compose bitmasks for value comparisons. */ |
| 8988 |
var COMPARE_PARTIAL_FLAG = 1; |
| 8989 |
|
| 8990 |
/** `Object#toString` result references. */ |
| 8991 |
var argsTag = '[object Arguments]', |
| 8992 |
arrayTag = '[object Array]', |
| 8993 |
objectTag = '[object Object]'; |
| 8994 |
|
| 8995 |
/** Used for built-in method references. */ |
| 8996 |
var objectProto = Object.prototype; |
| 8997 |
|
| 8998 |
/** Used to check objects for own properties. */ |
| 8999 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 9000 |
|
| 9001 |
/** |
| 9002 |
* A specialized version of `baseIsEqual` for arrays and objects which performs |
| 9003 |
* deep comparisons and tracks traversed objects enabling objects with circular |
| 9004 |
* references to be compared. |
| 9005 |
* |
| 9006 |
* @private |
| 9007 |
* @param {Object} object The object to compare. |
| 9008 |
* @param {Object} other The other object to compare. |
| 9009 |
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. |
| 9010 |
* @param {Function} customizer The function to customize comparisons. |
| 9011 |
* @param {Function} equalFunc The function to determine equivalents of values. |
| 9012 |
* @param {Object} [stack] Tracks traversed `object` and `other` objects. |
| 9013 |
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
| 9014 |
*/ |
| 9015 |
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { |
| 9016 |
var objIsArr = isArray(object), |
| 9017 |
othIsArr = isArray(other), |
| 9018 |
objTag = objIsArr ? arrayTag : getTag(object), |
| 9019 |
othTag = othIsArr ? arrayTag : getTag(other); |
| 9020 |
|
| 9021 |
objTag = objTag == argsTag ? objectTag : objTag; |
| 9022 |
othTag = othTag == argsTag ? objectTag : othTag; |
| 9023 |
|
| 9024 |
var objIsObj = objTag == objectTag, |
| 9025 |
othIsObj = othTag == objectTag, |
| 9026 |
isSameTag = objTag == othTag; |
| 9027 |
|
| 9028 |
if (isSameTag && isBuffer(object)) { |
| 9029 |
if (!isBuffer(other)) { |
| 9030 |
return false; |
| 9031 |
} |
| 9032 |
objIsArr = true; |
| 9033 |
objIsObj = false; |
| 9034 |
} |
| 9035 |
if (isSameTag && !objIsObj) { |
| 9036 |
stack || (stack = new Stack); |
| 9037 |
return (objIsArr || isTypedArray(object)) |
| 9038 |
? equalArrays(object, other, bitmask, customizer, equalFunc, stack) |
| 9039 |
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); |
| 9040 |
} |
| 9041 |
if (!(bitmask & COMPARE_PARTIAL_FLAG)) { |
| 9042 |
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), |
| 9043 |
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); |
| 9044 |
|
| 9045 |
if (objIsWrapped || othIsWrapped) { |
| 9046 |
var objUnwrapped = objIsWrapped ? object.value() : object, |
| 9047 |
othUnwrapped = othIsWrapped ? other.value() : other; |
| 9048 |
|
| 9049 |
stack || (stack = new Stack); |
| 9050 |
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); |
| 9051 |
} |
| 9052 |
} |
| 9053 |
if (!isSameTag) { |
| 9054 |
return false; |
| 9055 |
} |
| 9056 |
stack || (stack = new Stack); |
| 9057 |
return equalObjects(object, other, bitmask, customizer, equalFunc, stack); |
| 9058 |
} |
| 9059 |
|
| 9060 |
module.exports = baseIsEqualDeep; |
| 9061 |
|
| 9062 |
|
| 9063 |
/***/ }), |
| 9064 |
|
| 9065 |
/***/ 8458: |
| 9066 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9067 |
|
| 9068 |
var isFunction = __webpack_require__(3560), |
| 9069 |
isMasked = __webpack_require__(5346), |
| 9070 |
isObject = __webpack_require__(3218), |
| 9071 |
toSource = __webpack_require__(346); |
| 9072 |
|
| 9073 |
/** |
| 9074 |
* Used to match `RegExp` |
| 9075 |
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). |
| 9076 |
*/ |
| 9077 |
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; |
| 9078 |
|
| 9079 |
/** Used to detect host constructors (Safari). */ |
| 9080 |
var reIsHostCtor = /^\[object .+?Constructor\]$/; |
| 9081 |
|
| 9082 |
/** Used for built-in method references. */ |
| 9083 |
var funcProto = Function.prototype, |
| 9084 |
objectProto = Object.prototype; |
| 9085 |
|
| 9086 |
/** Used to resolve the decompiled source of functions. */ |
| 9087 |
var funcToString = funcProto.toString; |
| 9088 |
|
| 9089 |
/** Used to check objects for own properties. */ |
| 9090 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 9091 |
|
| 9092 |
/** Used to detect if a method is native. */ |
| 9093 |
var reIsNative = RegExp('^' + |
| 9094 |
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') |
| 9095 |
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' |
| 9096 |
); |
| 9097 |
|
| 9098 |
/** |
| 9099 |
* The base implementation of `_.isNative` without bad shim checks. |
| 9100 |
* |
| 9101 |
* @private |
| 9102 |
* @param {*} value The value to check. |
| 9103 |
* @returns {boolean} Returns `true` if `value` is a native function, |
| 9104 |
* else `false`. |
| 9105 |
*/ |
| 9106 |
function baseIsNative(value) { |
| 9107 |
if (!isObject(value) || isMasked(value)) { |
| 9108 |
return false; |
| 9109 |
} |
| 9110 |
var pattern = isFunction(value) ? reIsNative : reIsHostCtor; |
| 9111 |
return pattern.test(toSource(value)); |
| 9112 |
} |
| 9113 |
|
| 9114 |
module.exports = baseIsNative; |
| 9115 |
|
| 9116 |
|
| 9117 |
/***/ }), |
| 9118 |
|
| 9119 |
/***/ 8749: |
| 9120 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9121 |
|
| 9122 |
var baseGetTag = __webpack_require__(4239), |
| 9123 |
isLength = __webpack_require__(1780), |
| 9124 |
isObjectLike = __webpack_require__(7005); |
| 9125 |
|
| 9126 |
/** `Object#toString` result references. */ |
| 9127 |
var argsTag = '[object Arguments]', |
| 9128 |
arrayTag = '[object Array]', |
| 9129 |
boolTag = '[object Boolean]', |
| 9130 |
dateTag = '[object Date]', |
| 9131 |
errorTag = '[object Error]', |
| 9132 |
funcTag = '[object Function]', |
| 9133 |
mapTag = '[object Map]', |
| 9134 |
numberTag = '[object Number]', |
| 9135 |
objectTag = '[object Object]', |
| 9136 |
regexpTag = '[object RegExp]', |
| 9137 |
setTag = '[object Set]', |
| 9138 |
stringTag = '[object String]', |
| 9139 |
weakMapTag = '[object WeakMap]'; |
| 9140 |
|
| 9141 |
var arrayBufferTag = '[object ArrayBuffer]', |
| 9142 |
dataViewTag = '[object DataView]', |
| 9143 |
float32Tag = '[object Float32Array]', |
| 9144 |
float64Tag = '[object Float64Array]', |
| 9145 |
int8Tag = '[object Int8Array]', |
| 9146 |
int16Tag = '[object Int16Array]', |
| 9147 |
int32Tag = '[object Int32Array]', |
| 9148 |
uint8Tag = '[object Uint8Array]', |
| 9149 |
uint8ClampedTag = '[object Uint8ClampedArray]', |
| 9150 |
uint16Tag = '[object Uint16Array]', |
| 9151 |
uint32Tag = '[object Uint32Array]'; |
| 9152 |
|
| 9153 |
/** Used to identify `toStringTag` values of typed arrays. */ |
| 9154 |
var typedArrayTags = {}; |
| 9155 |
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = |
| 9156 |
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = |
| 9157 |
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = |
| 9158 |
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = |
| 9159 |
typedArrayTags[uint32Tag] = true; |
| 9160 |
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = |
| 9161 |
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = |
| 9162 |
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = |
| 9163 |
typedArrayTags[errorTag] = typedArrayTags[funcTag] = |
| 9164 |
typedArrayTags[mapTag] = typedArrayTags[numberTag] = |
| 9165 |
typedArrayTags[objectTag] = typedArrayTags[regexpTag] = |
| 9166 |
typedArrayTags[setTag] = typedArrayTags[stringTag] = |
| 9167 |
typedArrayTags[weakMapTag] = false; |
| 9168 |
|
| 9169 |
/** |
| 9170 |
* The base implementation of `_.isTypedArray` without Node.js optimizations. |
| 9171 |
* |
| 9172 |
* @private |
| 9173 |
* @param {*} value The value to check. |
| 9174 |
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`. |
| 9175 |
*/ |
| 9176 |
function baseIsTypedArray(value) { |
| 9177 |
return isObjectLike(value) && |
| 9178 |
isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; |
| 9179 |
} |
| 9180 |
|
| 9181 |
module.exports = baseIsTypedArray; |
| 9182 |
|
| 9183 |
|
| 9184 |
/***/ }), |
| 9185 |
|
| 9186 |
/***/ 280: |
| 9187 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9188 |
|
| 9189 |
var isPrototype = __webpack_require__(5726), |
| 9190 |
nativeKeys = __webpack_require__(6916); |
| 9191 |
|
| 9192 |
/** Used for built-in method references. */ |
| 9193 |
var objectProto = Object.prototype; |
| 9194 |
|
| 9195 |
/** Used to check objects for own properties. */ |
| 9196 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 9197 |
|
| 9198 |
/** |
| 9199 |
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense. |
| 9200 |
* |
| 9201 |
* @private |
| 9202 |
* @param {Object} object The object to query. |
| 9203 |
* @returns {Array} Returns the array of property names. |
| 9204 |
*/ |
| 9205 |
function baseKeys(object) { |
| 9206 |
if (!isPrototype(object)) { |
| 9207 |
return nativeKeys(object); |
| 9208 |
} |
| 9209 |
var result = []; |
| 9210 |
for (var key in Object(object)) { |
| 9211 |
if (hasOwnProperty.call(object, key) && key != 'constructor') { |
| 9212 |
result.push(key); |
| 9213 |
} |
| 9214 |
} |
| 9215 |
return result; |
| 9216 |
} |
| 9217 |
|
| 9218 |
module.exports = baseKeys; |
| 9219 |
|
| 9220 |
|
| 9221 |
/***/ }), |
| 9222 |
|
| 9223 |
/***/ 2545: |
| 9224 |
/***/ ((module) => { |
| 9225 |
|
| 9226 |
/** |
| 9227 |
* The base implementation of `_.times` without support for iteratee shorthands |
| 9228 |
* or max array length checks. |
| 9229 |
* |
| 9230 |
* @private |
| 9231 |
* @param {number} n The number of times to invoke `iteratee`. |
| 9232 |
* @param {Function} iteratee The function invoked per iteration. |
| 9233 |
* @returns {Array} Returns the array of results. |
| 9234 |
*/ |
| 9235 |
function baseTimes(n, iteratee) { |
| 9236 |
var index = -1, |
| 9237 |
result = Array(n); |
| 9238 |
|
| 9239 |
while (++index < n) { |
| 9240 |
result[index] = iteratee(index); |
| 9241 |
} |
| 9242 |
return result; |
| 9243 |
} |
| 9244 |
|
| 9245 |
module.exports = baseTimes; |
| 9246 |
|
| 9247 |
|
| 9248 |
/***/ }), |
| 9249 |
|
| 9250 |
/***/ 1717: |
| 9251 |
/***/ ((module) => { |
| 9252 |
|
| 9253 |
/** |
| 9254 |
* The base implementation of `_.unary` without support for storing metadata. |
| 9255 |
* |
| 9256 |
* @private |
| 9257 |
* @param {Function} func The function to cap arguments for. |
| 9258 |
* @returns {Function} Returns the new capped function. |
| 9259 |
*/ |
| 9260 |
function baseUnary(func) { |
| 9261 |
return function(value) { |
| 9262 |
return func(value); |
| 9263 |
}; |
| 9264 |
} |
| 9265 |
|
| 9266 |
module.exports = baseUnary; |
| 9267 |
|
| 9268 |
|
| 9269 |
/***/ }), |
| 9270 |
|
| 9271 |
/***/ 4757: |
| 9272 |
/***/ ((module) => { |
| 9273 |
|
| 9274 |
/** |
| 9275 |
* Checks if a `cache` value for `key` exists. |
| 9276 |
* |
| 9277 |
* @private |
| 9278 |
* @param {Object} cache The cache to query. |
| 9279 |
* @param {string} key The key of the entry to check. |
| 9280 |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
| 9281 |
*/ |
| 9282 |
function cacheHas(cache, key) { |
| 9283 |
return cache.has(key); |
| 9284 |
} |
| 9285 |
|
| 9286 |
module.exports = cacheHas; |
| 9287 |
|
| 9288 |
|
| 9289 |
/***/ }), |
| 9290 |
|
| 9291 |
/***/ 4429: |
| 9292 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9293 |
|
| 9294 |
var root = __webpack_require__(5639); |
| 9295 |
|
| 9296 |
/** Used to detect overreaching core-js shims. */ |
| 9297 |
var coreJsData = root['__core-js_shared__']; |
| 9298 |
|
| 9299 |
module.exports = coreJsData; |
| 9300 |
|
| 9301 |
|
| 9302 |
/***/ }), |
| 9303 |
|
| 9304 |
/***/ 7114: |
| 9305 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9306 |
|
| 9307 |
var SetCache = __webpack_require__(8668), |
| 9308 |
arraySome = __webpack_require__(2908), |
| 9309 |
cacheHas = __webpack_require__(4757); |
| 9310 |
|
| 9311 |
/** Used to compose bitmasks for value comparisons. */ |
| 9312 |
var COMPARE_PARTIAL_FLAG = 1, |
| 9313 |
COMPARE_UNORDERED_FLAG = 2; |
| 9314 |
|
| 9315 |
/** |
| 9316 |
* A specialized version of `baseIsEqualDeep` for arrays with support for |
| 9317 |
* partial deep comparisons. |
| 9318 |
* |
| 9319 |
* @private |
| 9320 |
* @param {Array} array The array to compare. |
| 9321 |
* @param {Array} other The other array to compare. |
| 9322 |
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. |
| 9323 |
* @param {Function} customizer The function to customize comparisons. |
| 9324 |
* @param {Function} equalFunc The function to determine equivalents of values. |
| 9325 |
* @param {Object} stack Tracks traversed `array` and `other` objects. |
| 9326 |
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. |
| 9327 |
*/ |
| 9328 |
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { |
| 9329 |
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, |
| 9330 |
arrLength = array.length, |
| 9331 |
othLength = other.length; |
| 9332 |
|
| 9333 |
if (arrLength != othLength && !(isPartial && othLength > arrLength)) { |
| 9334 |
return false; |
| 9335 |
} |
| 9336 |
// Check that cyclic values are equal. |
| 9337 |
var arrStacked = stack.get(array); |
| 9338 |
var othStacked = stack.get(other); |
| 9339 |
if (arrStacked && othStacked) { |
| 9340 |
return arrStacked == other && othStacked == array; |
| 9341 |
} |
| 9342 |
var index = -1, |
| 9343 |
result = true, |
| 9344 |
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; |
| 9345 |
|
| 9346 |
stack.set(array, other); |
| 9347 |
stack.set(other, array); |
| 9348 |
|
| 9349 |
// Ignore non-index properties. |
| 9350 |
while (++index < arrLength) { |
| 9351 |
var arrValue = array[index], |
| 9352 |
othValue = other[index]; |
| 9353 |
|
| 9354 |
if (customizer) { |
| 9355 |
var compared = isPartial |
| 9356 |
? customizer(othValue, arrValue, index, other, array, stack) |
| 9357 |
: customizer(arrValue, othValue, index, array, other, stack); |
| 9358 |
} |
| 9359 |
if (compared !== undefined) { |
| 9360 |
if (compared) { |
| 9361 |
continue; |
| 9362 |
} |
| 9363 |
result = false; |
| 9364 |
break; |
| 9365 |
} |
| 9366 |
// Recursively compare arrays (susceptible to call stack limits). |
| 9367 |
if (seen) { |
| 9368 |
if (!arraySome(other, function(othValue, othIndex) { |
| 9369 |
if (!cacheHas(seen, othIndex) && |
| 9370 |
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { |
| 9371 |
return seen.push(othIndex); |
| 9372 |
} |
| 9373 |
})) { |
| 9374 |
result = false; |
| 9375 |
break; |
| 9376 |
} |
| 9377 |
} else if (!( |
| 9378 |
arrValue === othValue || |
| 9379 |
equalFunc(arrValue, othValue, bitmask, customizer, stack) |
| 9380 |
)) { |
| 9381 |
result = false; |
| 9382 |
break; |
| 9383 |
} |
| 9384 |
} |
| 9385 |
stack['delete'](array); |
| 9386 |
stack['delete'](other); |
| 9387 |
return result; |
| 9388 |
} |
| 9389 |
|
| 9390 |
module.exports = equalArrays; |
| 9391 |
|
| 9392 |
|
| 9393 |
/***/ }), |
| 9394 |
|
| 9395 |
/***/ 8351: |
| 9396 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9397 |
|
| 9398 |
var Symbol = __webpack_require__(2705), |
| 9399 |
Uint8Array = __webpack_require__(1149), |
| 9400 |
eq = __webpack_require__(7813), |
| 9401 |
equalArrays = __webpack_require__(7114), |
| 9402 |
mapToArray = __webpack_require__(8776), |
| 9403 |
setToArray = __webpack_require__(1814); |
| 9404 |
|
| 9405 |
/** Used to compose bitmasks for value comparisons. */ |
| 9406 |
var COMPARE_PARTIAL_FLAG = 1, |
| 9407 |
COMPARE_UNORDERED_FLAG = 2; |
| 9408 |
|
| 9409 |
/** `Object#toString` result references. */ |
| 9410 |
var boolTag = '[object Boolean]', |
| 9411 |
dateTag = '[object Date]', |
| 9412 |
errorTag = '[object Error]', |
| 9413 |
mapTag = '[object Map]', |
| 9414 |
numberTag = '[object Number]', |
| 9415 |
regexpTag = '[object RegExp]', |
| 9416 |
setTag = '[object Set]', |
| 9417 |
stringTag = '[object String]', |
| 9418 |
symbolTag = '[object Symbol]'; |
| 9419 |
|
| 9420 |
var arrayBufferTag = '[object ArrayBuffer]', |
| 9421 |
dataViewTag = '[object DataView]'; |
| 9422 |
|
| 9423 |
/** Used to convert symbols to primitives and strings. */ |
| 9424 |
var symbolProto = Symbol ? Symbol.prototype : undefined, |
| 9425 |
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; |
| 9426 |
|
| 9427 |
/** |
| 9428 |
* A specialized version of `baseIsEqualDeep` for comparing objects of |
| 9429 |
* the same `toStringTag`. |
| 9430 |
* |
| 9431 |
* **Note:** This function only supports comparing values with tags of |
| 9432 |
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. |
| 9433 |
* |
| 9434 |
* @private |
| 9435 |
* @param {Object} object The object to compare. |
| 9436 |
* @param {Object} other The other object to compare. |
| 9437 |
* @param {string} tag The `toStringTag` of the objects to compare. |
| 9438 |
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. |
| 9439 |
* @param {Function} customizer The function to customize comparisons. |
| 9440 |
* @param {Function} equalFunc The function to determine equivalents of values. |
| 9441 |
* @param {Object} stack Tracks traversed `object` and `other` objects. |
| 9442 |
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
| 9443 |
*/ |
| 9444 |
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { |
| 9445 |
switch (tag) { |
| 9446 |
case dataViewTag: |
| 9447 |
if ((object.byteLength != other.byteLength) || |
| 9448 |
(object.byteOffset != other.byteOffset)) { |
| 9449 |
return false; |
| 9450 |
} |
| 9451 |
object = object.buffer; |
| 9452 |
other = other.buffer; |
| 9453 |
|
| 9454 |
case arrayBufferTag: |
| 9455 |
if ((object.byteLength != other.byteLength) || |
| 9456 |
!equalFunc(new Uint8Array(object), new Uint8Array(other))) { |
| 9457 |
return false; |
| 9458 |
} |
| 9459 |
return true; |
| 9460 |
|
| 9461 |
case boolTag: |
| 9462 |
case dateTag: |
| 9463 |
case numberTag: |
| 9464 |
// Coerce booleans to `1` or `0` and dates to milliseconds. |
| 9465 |
// Invalid dates are coerced to `NaN`. |
| 9466 |
return eq(+object, +other); |
| 9467 |
|
| 9468 |
case errorTag: |
| 9469 |
return object.name == other.name && object.message == other.message; |
| 9470 |
|
| 9471 |
case regexpTag: |
| 9472 |
case stringTag: |
| 9473 |
// Coerce regexes to strings and treat strings, primitives and objects, |
| 9474 |
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring |
| 9475 |
// for more details. |
| 9476 |
return object == (other + ''); |
| 9477 |
|
| 9478 |
case mapTag: |
| 9479 |
var convert = mapToArray; |
| 9480 |
|
| 9481 |
case setTag: |
| 9482 |
var isPartial = bitmask & COMPARE_PARTIAL_FLAG; |
| 9483 |
convert || (convert = setToArray); |
| 9484 |
|
| 9485 |
if (object.size != other.size && !isPartial) { |
| 9486 |
return false; |
| 9487 |
} |
| 9488 |
// Assume cyclic values are equal. |
| 9489 |
var stacked = stack.get(object); |
| 9490 |
if (stacked) { |
| 9491 |
return stacked == other; |
| 9492 |
} |
| 9493 |
bitmask |= COMPARE_UNORDERED_FLAG; |
| 9494 |
|
| 9495 |
// Recursively compare objects (susceptible to call stack limits). |
| 9496 |
stack.set(object, other); |
| 9497 |
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); |
| 9498 |
stack['delete'](object); |
| 9499 |
return result; |
| 9500 |
|
| 9501 |
case symbolTag: |
| 9502 |
if (symbolValueOf) { |
| 9503 |
return symbolValueOf.call(object) == symbolValueOf.call(other); |
| 9504 |
} |
| 9505 |
} |
| 9506 |
return false; |
| 9507 |
} |
| 9508 |
|
| 9509 |
module.exports = equalByTag; |
| 9510 |
|
| 9511 |
|
| 9512 |
/***/ }), |
| 9513 |
|
| 9514 |
/***/ 6096: |
| 9515 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9516 |
|
| 9517 |
var getAllKeys = __webpack_require__(8234); |
| 9518 |
|
| 9519 |
/** Used to compose bitmasks for value comparisons. */ |
| 9520 |
var COMPARE_PARTIAL_FLAG = 1; |
| 9521 |
|
| 9522 |
/** Used for built-in method references. */ |
| 9523 |
var objectProto = Object.prototype; |
| 9524 |
|
| 9525 |
/** Used to check objects for own properties. */ |
| 9526 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 9527 |
|
| 9528 |
/** |
| 9529 |
* A specialized version of `baseIsEqualDeep` for objects with support for |
| 9530 |
* partial deep comparisons. |
| 9531 |
* |
| 9532 |
* @private |
| 9533 |
* @param {Object} object The object to compare. |
| 9534 |
* @param {Object} other The other object to compare. |
| 9535 |
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. |
| 9536 |
* @param {Function} customizer The function to customize comparisons. |
| 9537 |
* @param {Function} equalFunc The function to determine equivalents of values. |
| 9538 |
* @param {Object} stack Tracks traversed `object` and `other` objects. |
| 9539 |
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
| 9540 |
*/ |
| 9541 |
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { |
| 9542 |
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, |
| 9543 |
objProps = getAllKeys(object), |
| 9544 |
objLength = objProps.length, |
| 9545 |
othProps = getAllKeys(other), |
| 9546 |
othLength = othProps.length; |
| 9547 |
|
| 9548 |
if (objLength != othLength && !isPartial) { |
| 9549 |
return false; |
| 9550 |
} |
| 9551 |
var index = objLength; |
| 9552 |
while (index--) { |
| 9553 |
var key = objProps[index]; |
| 9554 |
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { |
| 9555 |
return false; |
| 9556 |
} |
| 9557 |
} |
| 9558 |
// Check that cyclic values are equal. |
| 9559 |
var objStacked = stack.get(object); |
| 9560 |
var othStacked = stack.get(other); |
| 9561 |
if (objStacked && othStacked) { |
| 9562 |
return objStacked == other && othStacked == object; |
| 9563 |
} |
| 9564 |
var result = true; |
| 9565 |
stack.set(object, other); |
| 9566 |
stack.set(other, object); |
| 9567 |
|
| 9568 |
var skipCtor = isPartial; |
| 9569 |
while (++index < objLength) { |
| 9570 |
key = objProps[index]; |
| 9571 |
var objValue = object[key], |
| 9572 |
othValue = other[key]; |
| 9573 |
|
| 9574 |
if (customizer) { |
| 9575 |
var compared = isPartial |
| 9576 |
? customizer(othValue, objValue, key, other, object, stack) |
| 9577 |
: customizer(objValue, othValue, key, object, other, stack); |
| 9578 |
} |
| 9579 |
// Recursively compare objects (susceptible to call stack limits). |
| 9580 |
if (!(compared === undefined |
| 9581 |
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) |
| 9582 |
: compared |
| 9583 |
)) { |
| 9584 |
result = false; |
| 9585 |
break; |
| 9586 |
} |
| 9587 |
skipCtor || (skipCtor = key == 'constructor'); |
| 9588 |
} |
| 9589 |
if (result && !skipCtor) { |
| 9590 |
var objCtor = object.constructor, |
| 9591 |
othCtor = other.constructor; |
| 9592 |
|
| 9593 |
// Non `Object` object instances with different constructors are not equal. |
| 9594 |
if (objCtor != othCtor && |
| 9595 |
('constructor' in object && 'constructor' in other) && |
| 9596 |
!(typeof objCtor == 'function' && objCtor instanceof objCtor && |
| 9597 |
typeof othCtor == 'function' && othCtor instanceof othCtor)) { |
| 9598 |
result = false; |
| 9599 |
} |
| 9600 |
} |
| 9601 |
stack['delete'](object); |
| 9602 |
stack['delete'](other); |
| 9603 |
return result; |
| 9604 |
} |
| 9605 |
|
| 9606 |
module.exports = equalObjects; |
| 9607 |
|
| 9608 |
|
| 9609 |
/***/ }), |
| 9610 |
|
| 9611 |
/***/ 1957: |
| 9612 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9613 |
|
| 9614 |
/** Detect free variable `global` from Node.js. */ |
| 9615 |
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; |
| 9616 |
|
| 9617 |
module.exports = freeGlobal; |
| 9618 |
|
| 9619 |
|
| 9620 |
/***/ }), |
| 9621 |
|
| 9622 |
/***/ 8234: |
| 9623 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9624 |
|
| 9625 |
var baseGetAllKeys = __webpack_require__(8866), |
| 9626 |
getSymbols = __webpack_require__(9551), |
| 9627 |
keys = __webpack_require__(3674); |
| 9628 |
|
| 9629 |
/** |
| 9630 |
* Creates an array of own enumerable property names and symbols of `object`. |
| 9631 |
* |
| 9632 |
* @private |
| 9633 |
* @param {Object} object The object to query. |
| 9634 |
* @returns {Array} Returns the array of property names and symbols. |
| 9635 |
*/ |
| 9636 |
function getAllKeys(object) { |
| 9637 |
return baseGetAllKeys(object, keys, getSymbols); |
| 9638 |
} |
| 9639 |
|
| 9640 |
module.exports = getAllKeys; |
| 9641 |
|
| 9642 |
|
| 9643 |
/***/ }), |
| 9644 |
|
| 9645 |
/***/ 5050: |
| 9646 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9647 |
|
| 9648 |
var isKeyable = __webpack_require__(7019); |
| 9649 |
|
| 9650 |
/** |
| 9651 |
* Gets the data for `map`. |
| 9652 |
* |
| 9653 |
* @private |
| 9654 |
* @param {Object} map The map to query. |
| 9655 |
* @param {string} key The reference key. |
| 9656 |
* @returns {*} Returns the map data. |
| 9657 |
*/ |
| 9658 |
function getMapData(map, key) { |
| 9659 |
var data = map.__data__; |
| 9660 |
return isKeyable(key) |
| 9661 |
? data[typeof key == 'string' ? 'string' : 'hash'] |
| 9662 |
: data.map; |
| 9663 |
} |
| 9664 |
|
| 9665 |
module.exports = getMapData; |
| 9666 |
|
| 9667 |
|
| 9668 |
/***/ }), |
| 9669 |
|
| 9670 |
/***/ 852: |
| 9671 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9672 |
|
| 9673 |
var baseIsNative = __webpack_require__(8458), |
| 9674 |
getValue = __webpack_require__(7801); |
| 9675 |
|
| 9676 |
/** |
| 9677 |
* Gets the native function at `key` of `object`. |
| 9678 |
* |
| 9679 |
* @private |
| 9680 |
* @param {Object} object The object to query. |
| 9681 |
* @param {string} key The key of the method to get. |
| 9682 |
* @returns {*} Returns the function if it's native, else `undefined`. |
| 9683 |
*/ |
| 9684 |
function getNative(object, key) { |
| 9685 |
var value = getValue(object, key); |
| 9686 |
return baseIsNative(value) ? value : undefined; |
| 9687 |
} |
| 9688 |
|
| 9689 |
module.exports = getNative; |
| 9690 |
|
| 9691 |
|
| 9692 |
/***/ }), |
| 9693 |
|
| 9694 |
/***/ 9607: |
| 9695 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9696 |
|
| 9697 |
var Symbol = __webpack_require__(2705); |
| 9698 |
|
| 9699 |
/** Used for built-in method references. */ |
| 9700 |
var objectProto = Object.prototype; |
| 9701 |
|
| 9702 |
/** Used to check objects for own properties. */ |
| 9703 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 9704 |
|
| 9705 |
/** |
| 9706 |
* Used to resolve the |
| 9707 |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) |
| 9708 |
* of values. |
| 9709 |
*/ |
| 9710 |
var nativeObjectToString = objectProto.toString; |
| 9711 |
|
| 9712 |
/** Built-in value references. */ |
| 9713 |
var symToStringTag = Symbol ? Symbol.toStringTag : undefined; |
| 9714 |
|
| 9715 |
/** |
| 9716 |
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. |
| 9717 |
* |
| 9718 |
* @private |
| 9719 |
* @param {*} value The value to query. |
| 9720 |
* @returns {string} Returns the raw `toStringTag`. |
| 9721 |
*/ |
| 9722 |
function getRawTag(value) { |
| 9723 |
var isOwn = hasOwnProperty.call(value, symToStringTag), |
| 9724 |
tag = value[symToStringTag]; |
| 9725 |
|
| 9726 |
try { |
| 9727 |
value[symToStringTag] = undefined; |
| 9728 |
var unmasked = true; |
| 9729 |
} catch (e) {} |
| 9730 |
|
| 9731 |
var result = nativeObjectToString.call(value); |
| 9732 |
if (unmasked) { |
| 9733 |
if (isOwn) { |
| 9734 |
value[symToStringTag] = tag; |
| 9735 |
} else { |
| 9736 |
delete value[symToStringTag]; |
| 9737 |
} |
| 9738 |
} |
| 9739 |
return result; |
| 9740 |
} |
| 9741 |
|
| 9742 |
module.exports = getRawTag; |
| 9743 |
|
| 9744 |
|
| 9745 |
/***/ }), |
| 9746 |
|
| 9747 |
/***/ 9551: |
| 9748 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9749 |
|
| 9750 |
var arrayFilter = __webpack_require__(4963), |
| 9751 |
stubArray = __webpack_require__(479); |
| 9752 |
|
| 9753 |
/** Used for built-in method references. */ |
| 9754 |
var objectProto = Object.prototype; |
| 9755 |
|
| 9756 |
/** Built-in value references. */ |
| 9757 |
var propertyIsEnumerable = objectProto.propertyIsEnumerable; |
| 9758 |
|
| 9759 |
/* Built-in method references for those with the same name as other `lodash` methods. */ |
| 9760 |
var nativeGetSymbols = Object.getOwnPropertySymbols; |
| 9761 |
|
| 9762 |
/** |
| 9763 |
* Creates an array of the own enumerable symbols of `object`. |
| 9764 |
* |
| 9765 |
* @private |
| 9766 |
* @param {Object} object The object to query. |
| 9767 |
* @returns {Array} Returns the array of symbols. |
| 9768 |
*/ |
| 9769 |
var getSymbols = !nativeGetSymbols ? stubArray : function(object) { |
| 9770 |
if (object == null) { |
| 9771 |
return []; |
| 9772 |
} |
| 9773 |
object = Object(object); |
| 9774 |
return arrayFilter(nativeGetSymbols(object), function(symbol) { |
| 9775 |
return propertyIsEnumerable.call(object, symbol); |
| 9776 |
}); |
| 9777 |
}; |
| 9778 |
|
| 9779 |
module.exports = getSymbols; |
| 9780 |
|
| 9781 |
|
| 9782 |
/***/ }), |
| 9783 |
|
| 9784 |
/***/ 4160: |
| 9785 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9786 |
|
| 9787 |
var DataView = __webpack_require__(8552), |
| 9788 |
Map = __webpack_require__(7071), |
| 9789 |
Promise = __webpack_require__(3818), |
| 9790 |
Set = __webpack_require__(8525), |
| 9791 |
WeakMap = __webpack_require__(577), |
| 9792 |
baseGetTag = __webpack_require__(4239), |
| 9793 |
toSource = __webpack_require__(346); |
| 9794 |
|
| 9795 |
/** `Object#toString` result references. */ |
| 9796 |
var mapTag = '[object Map]', |
| 9797 |
objectTag = '[object Object]', |
| 9798 |
promiseTag = '[object Promise]', |
| 9799 |
setTag = '[object Set]', |
| 9800 |
weakMapTag = '[object WeakMap]'; |
| 9801 |
|
| 9802 |
var dataViewTag = '[object DataView]'; |
| 9803 |
|
| 9804 |
/** Used to detect maps, sets, and weakmaps. */ |
| 9805 |
var dataViewCtorString = toSource(DataView), |
| 9806 |
mapCtorString = toSource(Map), |
| 9807 |
promiseCtorString = toSource(Promise), |
| 9808 |
setCtorString = toSource(Set), |
| 9809 |
weakMapCtorString = toSource(WeakMap); |
| 9810 |
|
| 9811 |
/** |
| 9812 |
* Gets the `toStringTag` of `value`. |
| 9813 |
* |
| 9814 |
* @private |
| 9815 |
* @param {*} value The value to query. |
| 9816 |
* @returns {string} Returns the `toStringTag`. |
| 9817 |
*/ |
| 9818 |
var getTag = baseGetTag; |
| 9819 |
|
| 9820 |
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. |
| 9821 |
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || |
| 9822 |
(Map && getTag(new Map) != mapTag) || |
| 9823 |
(Promise && getTag(Promise.resolve()) != promiseTag) || |
| 9824 |
(Set && getTag(new Set) != setTag) || |
| 9825 |
(WeakMap && getTag(new WeakMap) != weakMapTag)) { |
| 9826 |
getTag = function(value) { |
| 9827 |
var result = baseGetTag(value), |
| 9828 |
Ctor = result == objectTag ? value.constructor : undefined, |
| 9829 |
ctorString = Ctor ? toSource(Ctor) : ''; |
| 9830 |
|
| 9831 |
if (ctorString) { |
| 9832 |
switch (ctorString) { |
| 9833 |
case dataViewCtorString: return dataViewTag; |
| 9834 |
case mapCtorString: return mapTag; |
| 9835 |
case promiseCtorString: return promiseTag; |
| 9836 |
case setCtorString: return setTag; |
| 9837 |
case weakMapCtorString: return weakMapTag; |
| 9838 |
} |
| 9839 |
} |
| 9840 |
return result; |
| 9841 |
}; |
| 9842 |
} |
| 9843 |
|
| 9844 |
module.exports = getTag; |
| 9845 |
|
| 9846 |
|
| 9847 |
/***/ }), |
| 9848 |
|
| 9849 |
/***/ 7801: |
| 9850 |
/***/ ((module) => { |
| 9851 |
|
| 9852 |
/** |
| 9853 |
* Gets the value at `key` of `object`. |
| 9854 |
* |
| 9855 |
* @private |
| 9856 |
* @param {Object} [object] The object to query. |
| 9857 |
* @param {string} key The key of the property to get. |
| 9858 |
* @returns {*} Returns the property value. |
| 9859 |
*/ |
| 9860 |
function getValue(object, key) { |
| 9861 |
return object == null ? undefined : object[key]; |
| 9862 |
} |
| 9863 |
|
| 9864 |
module.exports = getValue; |
| 9865 |
|
| 9866 |
|
| 9867 |
/***/ }), |
| 9868 |
|
| 9869 |
/***/ 1789: |
| 9870 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9871 |
|
| 9872 |
var nativeCreate = __webpack_require__(4536); |
| 9873 |
|
| 9874 |
/** |
| 9875 |
* Removes all key-value entries from the hash. |
| 9876 |
* |
| 9877 |
* @private |
| 9878 |
* @name clear |
| 9879 |
* @memberOf Hash |
| 9880 |
*/ |
| 9881 |
function hashClear() { |
| 9882 |
this.__data__ = nativeCreate ? nativeCreate(null) : {}; |
| 9883 |
this.size = 0; |
| 9884 |
} |
| 9885 |
|
| 9886 |
module.exports = hashClear; |
| 9887 |
|
| 9888 |
|
| 9889 |
/***/ }), |
| 9890 |
|
| 9891 |
/***/ 401: |
| 9892 |
/***/ ((module) => { |
| 9893 |
|
| 9894 |
/** |
| 9895 |
* Removes `key` and its value from the hash. |
| 9896 |
* |
| 9897 |
* @private |
| 9898 |
* @name delete |
| 9899 |
* @memberOf Hash |
| 9900 |
* @param {Object} hash The hash to modify. |
| 9901 |
* @param {string} key The key of the value to remove. |
| 9902 |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. |
| 9903 |
*/ |
| 9904 |
function hashDelete(key) { |
| 9905 |
var result = this.has(key) && delete this.__data__[key]; |
| 9906 |
this.size -= result ? 1 : 0; |
| 9907 |
return result; |
| 9908 |
} |
| 9909 |
|
| 9910 |
module.exports = hashDelete; |
| 9911 |
|
| 9912 |
|
| 9913 |
/***/ }), |
| 9914 |
|
| 9915 |
/***/ 7667: |
| 9916 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9917 |
|
| 9918 |
var nativeCreate = __webpack_require__(4536); |
| 9919 |
|
| 9920 |
/** Used to stand-in for `undefined` hash values. */ |
| 9921 |
var HASH_UNDEFINED = '__lodash_hash_undefined__'; |
| 9922 |
|
| 9923 |
/** Used for built-in method references. */ |
| 9924 |
var objectProto = Object.prototype; |
| 9925 |
|
| 9926 |
/** Used to check objects for own properties. */ |
| 9927 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 9928 |
|
| 9929 |
/** |
| 9930 |
* Gets the hash value for `key`. |
| 9931 |
* |
| 9932 |
* @private |
| 9933 |
* @name get |
| 9934 |
* @memberOf Hash |
| 9935 |
* @param {string} key The key of the value to get. |
| 9936 |
* @returns {*} Returns the entry value. |
| 9937 |
*/ |
| 9938 |
function hashGet(key) { |
| 9939 |
var data = this.__data__; |
| 9940 |
if (nativeCreate) { |
| 9941 |
var result = data[key]; |
| 9942 |
return result === HASH_UNDEFINED ? undefined : result; |
| 9943 |
} |
| 9944 |
return hasOwnProperty.call(data, key) ? data[key] : undefined; |
| 9945 |
} |
| 9946 |
|
| 9947 |
module.exports = hashGet; |
| 9948 |
|
| 9949 |
|
| 9950 |
/***/ }), |
| 9951 |
|
| 9952 |
/***/ 1327: |
| 9953 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9954 |
|
| 9955 |
var nativeCreate = __webpack_require__(4536); |
| 9956 |
|
| 9957 |
/** Used for built-in method references. */ |
| 9958 |
var objectProto = Object.prototype; |
| 9959 |
|
| 9960 |
/** Used to check objects for own properties. */ |
| 9961 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 9962 |
|
| 9963 |
/** |
| 9964 |
* Checks if a hash value for `key` exists. |
| 9965 |
* |
| 9966 |
* @private |
| 9967 |
* @name has |
| 9968 |
* @memberOf Hash |
| 9969 |
* @param {string} key The key of the entry to check. |
| 9970 |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
| 9971 |
*/ |
| 9972 |
function hashHas(key) { |
| 9973 |
var data = this.__data__; |
| 9974 |
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); |
| 9975 |
} |
| 9976 |
|
| 9977 |
module.exports = hashHas; |
| 9978 |
|
| 9979 |
|
| 9980 |
/***/ }), |
| 9981 |
|
| 9982 |
/***/ 1866: |
| 9983 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 9984 |
|
| 9985 |
var nativeCreate = __webpack_require__(4536); |
| 9986 |
|
| 9987 |
/** Used to stand-in for `undefined` hash values. */ |
| 9988 |
var HASH_UNDEFINED = '__lodash_hash_undefined__'; |
| 9989 |
|
| 9990 |
/** |
| 9991 |
* Sets the hash `key` to `value`. |
| 9992 |
* |
| 9993 |
* @private |
| 9994 |
* @name set |
| 9995 |
* @memberOf Hash |
| 9996 |
* @param {string} key The key of the value to set. |
| 9997 |
* @param {*} value The value to set. |
| 9998 |
* @returns {Object} Returns the hash instance. |
| 9999 |
*/ |
| 10000 |
function hashSet(key, value) { |
| 10001 |
var data = this.__data__; |
| 10002 |
this.size += this.has(key) ? 0 : 1; |
| 10003 |
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; |
| 10004 |
return this; |
| 10005 |
} |
| 10006 |
|
| 10007 |
module.exports = hashSet; |
| 10008 |
|
| 10009 |
|
| 10010 |
/***/ }), |
| 10011 |
|
| 10012 |
/***/ 5776: |
| 10013 |
/***/ ((module) => { |
| 10014 |
|
| 10015 |
/** Used as references for various `Number` constants. */ |
| 10016 |
var MAX_SAFE_INTEGER = 9007199254740991; |
| 10017 |
|
| 10018 |
/** Used to detect unsigned integer values. */ |
| 10019 |
var reIsUint = /^(?:0|[1-9]\d*)$/; |
| 10020 |
|
| 10021 |
/** |
| 10022 |
* Checks if `value` is a valid array-like index. |
| 10023 |
* |
| 10024 |
* @private |
| 10025 |
* @param {*} value The value to check. |
| 10026 |
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. |
| 10027 |
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`. |
| 10028 |
*/ |
| 10029 |
function isIndex(value, length) { |
| 10030 |
var type = typeof value; |
| 10031 |
length = length == null ? MAX_SAFE_INTEGER : length; |
| 10032 |
|
| 10033 |
return !!length && |
| 10034 |
(type == 'number' || |
| 10035 |
(type != 'symbol' && reIsUint.test(value))) && |
| 10036 |
(value > -1 && value % 1 == 0 && value < length); |
| 10037 |
} |
| 10038 |
|
| 10039 |
module.exports = isIndex; |
| 10040 |
|
| 10041 |
|
| 10042 |
/***/ }), |
| 10043 |
|
| 10044 |
/***/ 7019: |
| 10045 |
/***/ ((module) => { |
| 10046 |
|
| 10047 |
/** |
| 10048 |
* Checks if `value` is suitable for use as unique object key. |
| 10049 |
* |
| 10050 |
* @private |
| 10051 |
* @param {*} value The value to check. |
| 10052 |
* @returns {boolean} Returns `true` if `value` is suitable, else `false`. |
| 10053 |
*/ |
| 10054 |
function isKeyable(value) { |
| 10055 |
var type = typeof value; |
| 10056 |
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') |
| 10057 |
? (value !== '__proto__') |
| 10058 |
: (value === null); |
| 10059 |
} |
| 10060 |
|
| 10061 |
module.exports = isKeyable; |
| 10062 |
|
| 10063 |
|
| 10064 |
/***/ }), |
| 10065 |
|
| 10066 |
/***/ 5346: |
| 10067 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10068 |
|
| 10069 |
var coreJsData = __webpack_require__(4429); |
| 10070 |
|
| 10071 |
/** Used to detect methods masquerading as native. */ |
| 10072 |
var maskSrcKey = (function() { |
| 10073 |
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); |
| 10074 |
return uid ? ('Symbol(src)_1.' + uid) : ''; |
| 10075 |
}()); |
| 10076 |
|
| 10077 |
/** |
| 10078 |
* Checks if `func` has its source masked. |
| 10079 |
* |
| 10080 |
* @private |
| 10081 |
* @param {Function} func The function to check. |
| 10082 |
* @returns {boolean} Returns `true` if `func` is masked, else `false`. |
| 10083 |
*/ |
| 10084 |
function isMasked(func) { |
| 10085 |
return !!maskSrcKey && (maskSrcKey in func); |
| 10086 |
} |
| 10087 |
|
| 10088 |
module.exports = isMasked; |
| 10089 |
|
| 10090 |
|
| 10091 |
/***/ }), |
| 10092 |
|
| 10093 |
/***/ 5726: |
| 10094 |
/***/ ((module) => { |
| 10095 |
|
| 10096 |
/** Used for built-in method references. */ |
| 10097 |
var objectProto = Object.prototype; |
| 10098 |
|
| 10099 |
/** |
| 10100 |
* Checks if `value` is likely a prototype object. |
| 10101 |
* |
| 10102 |
* @private |
| 10103 |
* @param {*} value The value to check. |
| 10104 |
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`. |
| 10105 |
*/ |
| 10106 |
function isPrototype(value) { |
| 10107 |
var Ctor = value && value.constructor, |
| 10108 |
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; |
| 10109 |
|
| 10110 |
return value === proto; |
| 10111 |
} |
| 10112 |
|
| 10113 |
module.exports = isPrototype; |
| 10114 |
|
| 10115 |
|
| 10116 |
/***/ }), |
| 10117 |
|
| 10118 |
/***/ 7040: |
| 10119 |
/***/ ((module) => { |
| 10120 |
|
| 10121 |
/** |
| 10122 |
* Removes all key-value entries from the list cache. |
| 10123 |
* |
| 10124 |
* @private |
| 10125 |
* @name clear |
| 10126 |
* @memberOf ListCache |
| 10127 |
*/ |
| 10128 |
function listCacheClear() { |
| 10129 |
this.__data__ = []; |
| 10130 |
this.size = 0; |
| 10131 |
} |
| 10132 |
|
| 10133 |
module.exports = listCacheClear; |
| 10134 |
|
| 10135 |
|
| 10136 |
/***/ }), |
| 10137 |
|
| 10138 |
/***/ 4125: |
| 10139 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10140 |
|
| 10141 |
var assocIndexOf = __webpack_require__(8470); |
| 10142 |
|
| 10143 |
/** Used for built-in method references. */ |
| 10144 |
var arrayProto = Array.prototype; |
| 10145 |
|
| 10146 |
/** Built-in value references. */ |
| 10147 |
var splice = arrayProto.splice; |
| 10148 |
|
| 10149 |
/** |
| 10150 |
* Removes `key` and its value from the list cache. |
| 10151 |
* |
| 10152 |
* @private |
| 10153 |
* @name delete |
| 10154 |
* @memberOf ListCache |
| 10155 |
* @param {string} key The key of the value to remove. |
| 10156 |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. |
| 10157 |
*/ |
| 10158 |
function listCacheDelete(key) { |
| 10159 |
var data = this.__data__, |
| 10160 |
index = assocIndexOf(data, key); |
| 10161 |
|
| 10162 |
if (index < 0) { |
| 10163 |
return false; |
| 10164 |
} |
| 10165 |
var lastIndex = data.length - 1; |
| 10166 |
if (index == lastIndex) { |
| 10167 |
data.pop(); |
| 10168 |
} else { |
| 10169 |
splice.call(data, index, 1); |
| 10170 |
} |
| 10171 |
--this.size; |
| 10172 |
return true; |
| 10173 |
} |
| 10174 |
|
| 10175 |
module.exports = listCacheDelete; |
| 10176 |
|
| 10177 |
|
| 10178 |
/***/ }), |
| 10179 |
|
| 10180 |
/***/ 2117: |
| 10181 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10182 |
|
| 10183 |
var assocIndexOf = __webpack_require__(8470); |
| 10184 |
|
| 10185 |
/** |
| 10186 |
* Gets the list cache value for `key`. |
| 10187 |
* |
| 10188 |
* @private |
| 10189 |
* @name get |
| 10190 |
* @memberOf ListCache |
| 10191 |
* @param {string} key The key of the value to get. |
| 10192 |
* @returns {*} Returns the entry value. |
| 10193 |
*/ |
| 10194 |
function listCacheGet(key) { |
| 10195 |
var data = this.__data__, |
| 10196 |
index = assocIndexOf(data, key); |
| 10197 |
|
| 10198 |
return index < 0 ? undefined : data[index][1]; |
| 10199 |
} |
| 10200 |
|
| 10201 |
module.exports = listCacheGet; |
| 10202 |
|
| 10203 |
|
| 10204 |
/***/ }), |
| 10205 |
|
| 10206 |
/***/ 7518: |
| 10207 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10208 |
|
| 10209 |
var assocIndexOf = __webpack_require__(8470); |
| 10210 |
|
| 10211 |
/** |
| 10212 |
* Checks if a list cache value for `key` exists. |
| 10213 |
* |
| 10214 |
* @private |
| 10215 |
* @name has |
| 10216 |
* @memberOf ListCache |
| 10217 |
* @param {string} key The key of the entry to check. |
| 10218 |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
| 10219 |
*/ |
| 10220 |
function listCacheHas(key) { |
| 10221 |
return assocIndexOf(this.__data__, key) > -1; |
| 10222 |
} |
| 10223 |
|
| 10224 |
module.exports = listCacheHas; |
| 10225 |
|
| 10226 |
|
| 10227 |
/***/ }), |
| 10228 |
|
| 10229 |
/***/ 4705: |
| 10230 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10231 |
|
| 10232 |
var assocIndexOf = __webpack_require__(8470); |
| 10233 |
|
| 10234 |
/** |
| 10235 |
* Sets the list cache `key` to `value`. |
| 10236 |
* |
| 10237 |
* @private |
| 10238 |
* @name set |
| 10239 |
* @memberOf ListCache |
| 10240 |
* @param {string} key The key of the value to set. |
| 10241 |
* @param {*} value The value to set. |
| 10242 |
* @returns {Object} Returns the list cache instance. |
| 10243 |
*/ |
| 10244 |
function listCacheSet(key, value) { |
| 10245 |
var data = this.__data__, |
| 10246 |
index = assocIndexOf(data, key); |
| 10247 |
|
| 10248 |
if (index < 0) { |
| 10249 |
++this.size; |
| 10250 |
data.push([key, value]); |
| 10251 |
} else { |
| 10252 |
data[index][1] = value; |
| 10253 |
} |
| 10254 |
return this; |
| 10255 |
} |
| 10256 |
|
| 10257 |
module.exports = listCacheSet; |
| 10258 |
|
| 10259 |
|
| 10260 |
/***/ }), |
| 10261 |
|
| 10262 |
/***/ 4785: |
| 10263 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10264 |
|
| 10265 |
var Hash = __webpack_require__(1989), |
| 10266 |
ListCache = __webpack_require__(8407), |
| 10267 |
Map = __webpack_require__(7071); |
| 10268 |
|
| 10269 |
/** |
| 10270 |
* Removes all key-value entries from the map. |
| 10271 |
* |
| 10272 |
* @private |
| 10273 |
* @name clear |
| 10274 |
* @memberOf MapCache |
| 10275 |
*/ |
| 10276 |
function mapCacheClear() { |
| 10277 |
this.size = 0; |
| 10278 |
this.__data__ = { |
| 10279 |
'hash': new Hash, |
| 10280 |
'map': new (Map || ListCache), |
| 10281 |
'string': new Hash |
| 10282 |
}; |
| 10283 |
} |
| 10284 |
|
| 10285 |
module.exports = mapCacheClear; |
| 10286 |
|
| 10287 |
|
| 10288 |
/***/ }), |
| 10289 |
|
| 10290 |
/***/ 1285: |
| 10291 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10292 |
|
| 10293 |
var getMapData = __webpack_require__(5050); |
| 10294 |
|
| 10295 |
/** |
| 10296 |
* Removes `key` and its value from the map. |
| 10297 |
* |
| 10298 |
* @private |
| 10299 |
* @name delete |
| 10300 |
* @memberOf MapCache |
| 10301 |
* @param {string} key The key of the value to remove. |
| 10302 |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. |
| 10303 |
*/ |
| 10304 |
function mapCacheDelete(key) { |
| 10305 |
var result = getMapData(this, key)['delete'](key); |
| 10306 |
this.size -= result ? 1 : 0; |
| 10307 |
return result; |
| 10308 |
} |
| 10309 |
|
| 10310 |
module.exports = mapCacheDelete; |
| 10311 |
|
| 10312 |
|
| 10313 |
/***/ }), |
| 10314 |
|
| 10315 |
/***/ 6000: |
| 10316 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10317 |
|
| 10318 |
var getMapData = __webpack_require__(5050); |
| 10319 |
|
| 10320 |
/** |
| 10321 |
* Gets the map value for `key`. |
| 10322 |
* |
| 10323 |
* @private |
| 10324 |
* @name get |
| 10325 |
* @memberOf MapCache |
| 10326 |
* @param {string} key The key of the value to get. |
| 10327 |
* @returns {*} Returns the entry value. |
| 10328 |
*/ |
| 10329 |
function mapCacheGet(key) { |
| 10330 |
return getMapData(this, key).get(key); |
| 10331 |
} |
| 10332 |
|
| 10333 |
module.exports = mapCacheGet; |
| 10334 |
|
| 10335 |
|
| 10336 |
/***/ }), |
| 10337 |
|
| 10338 |
/***/ 9916: |
| 10339 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10340 |
|
| 10341 |
var getMapData = __webpack_require__(5050); |
| 10342 |
|
| 10343 |
/** |
| 10344 |
* Checks if a map value for `key` exists. |
| 10345 |
* |
| 10346 |
* @private |
| 10347 |
* @name has |
| 10348 |
* @memberOf MapCache |
| 10349 |
* @param {string} key The key of the entry to check. |
| 10350 |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
| 10351 |
*/ |
| 10352 |
function mapCacheHas(key) { |
| 10353 |
return getMapData(this, key).has(key); |
| 10354 |
} |
| 10355 |
|
| 10356 |
module.exports = mapCacheHas; |
| 10357 |
|
| 10358 |
|
| 10359 |
/***/ }), |
| 10360 |
|
| 10361 |
/***/ 5265: |
| 10362 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10363 |
|
| 10364 |
var getMapData = __webpack_require__(5050); |
| 10365 |
|
| 10366 |
/** |
| 10367 |
* Sets the map `key` to `value`. |
| 10368 |
* |
| 10369 |
* @private |
| 10370 |
* @name set |
| 10371 |
* @memberOf MapCache |
| 10372 |
* @param {string} key The key of the value to set. |
| 10373 |
* @param {*} value The value to set. |
| 10374 |
* @returns {Object} Returns the map cache instance. |
| 10375 |
*/ |
| 10376 |
function mapCacheSet(key, value) { |
| 10377 |
var data = getMapData(this, key), |
| 10378 |
size = data.size; |
| 10379 |
|
| 10380 |
data.set(key, value); |
| 10381 |
this.size += data.size == size ? 0 : 1; |
| 10382 |
return this; |
| 10383 |
} |
| 10384 |
|
| 10385 |
module.exports = mapCacheSet; |
| 10386 |
|
| 10387 |
|
| 10388 |
/***/ }), |
| 10389 |
|
| 10390 |
/***/ 8776: |
| 10391 |
/***/ ((module) => { |
| 10392 |
|
| 10393 |
/** |
| 10394 |
* Converts `map` to its key-value pairs. |
| 10395 |
* |
| 10396 |
* @private |
| 10397 |
* @param {Object} map The map to convert. |
| 10398 |
* @returns {Array} Returns the key-value pairs. |
| 10399 |
*/ |
| 10400 |
function mapToArray(map) { |
| 10401 |
var index = -1, |
| 10402 |
result = Array(map.size); |
| 10403 |
|
| 10404 |
map.forEach(function(value, key) { |
| 10405 |
result[++index] = [key, value]; |
| 10406 |
}); |
| 10407 |
return result; |
| 10408 |
} |
| 10409 |
|
| 10410 |
module.exports = mapToArray; |
| 10411 |
|
| 10412 |
|
| 10413 |
/***/ }), |
| 10414 |
|
| 10415 |
/***/ 4536: |
| 10416 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10417 |
|
| 10418 |
var getNative = __webpack_require__(852); |
| 10419 |
|
| 10420 |
/* Built-in method references that are verified to be native. */ |
| 10421 |
var nativeCreate = getNative(Object, 'create'); |
| 10422 |
|
| 10423 |
module.exports = nativeCreate; |
| 10424 |
|
| 10425 |
|
| 10426 |
/***/ }), |
| 10427 |
|
| 10428 |
/***/ 6916: |
| 10429 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10430 |
|
| 10431 |
var overArg = __webpack_require__(5569); |
| 10432 |
|
| 10433 |
/* Built-in method references for those with the same name as other `lodash` methods. */ |
| 10434 |
var nativeKeys = overArg(Object.keys, Object); |
| 10435 |
|
| 10436 |
module.exports = nativeKeys; |
| 10437 |
|
| 10438 |
|
| 10439 |
/***/ }), |
| 10440 |
|
| 10441 |
/***/ 4000: |
| 10442 |
/***/ ((module, exports, __webpack_require__) => { |
| 10443 |
|
| 10444 |
/* module decorator */ module = __webpack_require__.nmd(module); |
| 10445 |
var freeGlobal = __webpack_require__(1957); |
| 10446 |
|
| 10447 |
/** Detect free variable `exports`. */ |
| 10448 |
var freeExports = true && exports && !exports.nodeType && exports; |
| 10449 |
|
| 10450 |
/** Detect free variable `module`. */ |
| 10451 |
var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; |
| 10452 |
|
| 10453 |
/** Detect the popular CommonJS extension `module.exports`. */ |
| 10454 |
var moduleExports = freeModule && freeModule.exports === freeExports; |
| 10455 |
|
| 10456 |
/** Detect free variable `process` from Node.js. */ |
| 10457 |
var freeProcess = moduleExports && freeGlobal.process; |
| 10458 |
|
| 10459 |
/** Used to access faster Node.js helpers. */ |
| 10460 |
var nodeUtil = (function() { |
| 10461 |
try { |
| 10462 |
// Use `util.types` for Node.js 10+. |
| 10463 |
var types = freeModule && freeModule.require && freeModule.require('util').types; |
| 10464 |
|
| 10465 |
if (types) { |
| 10466 |
return types; |
| 10467 |
} |
| 10468 |
|
| 10469 |
// Legacy `process.binding('util')` for Node.js < 10. |
| 10470 |
return freeProcess && freeProcess.binding && freeProcess.binding('util'); |
| 10471 |
} catch (e) {} |
| 10472 |
}()); |
| 10473 |
|
| 10474 |
module.exports = nodeUtil; |
| 10475 |
|
| 10476 |
|
| 10477 |
/***/ }), |
| 10478 |
|
| 10479 |
/***/ 2333: |
| 10480 |
/***/ ((module) => { |
| 10481 |
|
| 10482 |
/** Used for built-in method references. */ |
| 10483 |
var objectProto = Object.prototype; |
| 10484 |
|
| 10485 |
/** |
| 10486 |
* Used to resolve the |
| 10487 |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) |
| 10488 |
* of values. |
| 10489 |
*/ |
| 10490 |
var nativeObjectToString = objectProto.toString; |
| 10491 |
|
| 10492 |
/** |
| 10493 |
* Converts `value` to a string using `Object.prototype.toString`. |
| 10494 |
* |
| 10495 |
* @private |
| 10496 |
* @param {*} value The value to convert. |
| 10497 |
* @returns {string} Returns the converted string. |
| 10498 |
*/ |
| 10499 |
function objectToString(value) { |
| 10500 |
return nativeObjectToString.call(value); |
| 10501 |
} |
| 10502 |
|
| 10503 |
module.exports = objectToString; |
| 10504 |
|
| 10505 |
|
| 10506 |
/***/ }), |
| 10507 |
|
| 10508 |
/***/ 5569: |
| 10509 |
/***/ ((module) => { |
| 10510 |
|
| 10511 |
/** |
| 10512 |
* Creates a unary function that invokes `func` with its argument transformed. |
| 10513 |
* |
| 10514 |
* @private |
| 10515 |
* @param {Function} func The function to wrap. |
| 10516 |
* @param {Function} transform The argument transform. |
| 10517 |
* @returns {Function} Returns the new function. |
| 10518 |
*/ |
| 10519 |
function overArg(func, transform) { |
| 10520 |
return function(arg) { |
| 10521 |
return func(transform(arg)); |
| 10522 |
}; |
| 10523 |
} |
| 10524 |
|
| 10525 |
module.exports = overArg; |
| 10526 |
|
| 10527 |
|
| 10528 |
/***/ }), |
| 10529 |
|
| 10530 |
/***/ 5639: |
| 10531 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10532 |
|
| 10533 |
var freeGlobal = __webpack_require__(1957); |
| 10534 |
|
| 10535 |
/** Detect free variable `self`. */ |
| 10536 |
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; |
| 10537 |
|
| 10538 |
/** Used as a reference to the global object. */ |
| 10539 |
var root = freeGlobal || freeSelf || Function('return this')(); |
| 10540 |
|
| 10541 |
module.exports = root; |
| 10542 |
|
| 10543 |
|
| 10544 |
/***/ }), |
| 10545 |
|
| 10546 |
/***/ 619: |
| 10547 |
/***/ ((module) => { |
| 10548 |
|
| 10549 |
/** Used to stand-in for `undefined` hash values. */ |
| 10550 |
var HASH_UNDEFINED = '__lodash_hash_undefined__'; |
| 10551 |
|
| 10552 |
/** |
| 10553 |
* Adds `value` to the array cache. |
| 10554 |
* |
| 10555 |
* @private |
| 10556 |
* @name add |
| 10557 |
* @memberOf SetCache |
| 10558 |
* @alias push |
| 10559 |
* @param {*} value The value to cache. |
| 10560 |
* @returns {Object} Returns the cache instance. |
| 10561 |
*/ |
| 10562 |
function setCacheAdd(value) { |
| 10563 |
this.__data__.set(value, HASH_UNDEFINED); |
| 10564 |
return this; |
| 10565 |
} |
| 10566 |
|
| 10567 |
module.exports = setCacheAdd; |
| 10568 |
|
| 10569 |
|
| 10570 |
/***/ }), |
| 10571 |
|
| 10572 |
/***/ 2385: |
| 10573 |
/***/ ((module) => { |
| 10574 |
|
| 10575 |
/** |
| 10576 |
* Checks if `value` is in the array cache. |
| 10577 |
* |
| 10578 |
* @private |
| 10579 |
* @name has |
| 10580 |
* @memberOf SetCache |
| 10581 |
* @param {*} value The value to search for. |
| 10582 |
* @returns {number} Returns `true` if `value` is found, else `false`. |
| 10583 |
*/ |
| 10584 |
function setCacheHas(value) { |
| 10585 |
return this.__data__.has(value); |
| 10586 |
} |
| 10587 |
|
| 10588 |
module.exports = setCacheHas; |
| 10589 |
|
| 10590 |
|
| 10591 |
/***/ }), |
| 10592 |
|
| 10593 |
/***/ 1814: |
| 10594 |
/***/ ((module) => { |
| 10595 |
|
| 10596 |
/** |
| 10597 |
* Converts `set` to an array of its values. |
| 10598 |
* |
| 10599 |
* @private |
| 10600 |
* @param {Object} set The set to convert. |
| 10601 |
* @returns {Array} Returns the values. |
| 10602 |
*/ |
| 10603 |
function setToArray(set) { |
| 10604 |
var index = -1, |
| 10605 |
result = Array(set.size); |
| 10606 |
|
| 10607 |
set.forEach(function(value) { |
| 10608 |
result[++index] = value; |
| 10609 |
}); |
| 10610 |
return result; |
| 10611 |
} |
| 10612 |
|
| 10613 |
module.exports = setToArray; |
| 10614 |
|
| 10615 |
|
| 10616 |
/***/ }), |
| 10617 |
|
| 10618 |
/***/ 7465: |
| 10619 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10620 |
|
| 10621 |
var ListCache = __webpack_require__(8407); |
| 10622 |
|
| 10623 |
/** |
| 10624 |
* Removes all key-value entries from the stack. |
| 10625 |
* |
| 10626 |
* @private |
| 10627 |
* @name clear |
| 10628 |
* @memberOf Stack |
| 10629 |
*/ |
| 10630 |
function stackClear() { |
| 10631 |
this.__data__ = new ListCache; |
| 10632 |
this.size = 0; |
| 10633 |
} |
| 10634 |
|
| 10635 |
module.exports = stackClear; |
| 10636 |
|
| 10637 |
|
| 10638 |
/***/ }), |
| 10639 |
|
| 10640 |
/***/ 3779: |
| 10641 |
/***/ ((module) => { |
| 10642 |
|
| 10643 |
/** |
| 10644 |
* Removes `key` and its value from the stack. |
| 10645 |
* |
| 10646 |
* @private |
| 10647 |
* @name delete |
| 10648 |
* @memberOf Stack |
| 10649 |
* @param {string} key The key of the value to remove. |
| 10650 |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. |
| 10651 |
*/ |
| 10652 |
function stackDelete(key) { |
| 10653 |
var data = this.__data__, |
| 10654 |
result = data['delete'](key); |
| 10655 |
|
| 10656 |
this.size = data.size; |
| 10657 |
return result; |
| 10658 |
} |
| 10659 |
|
| 10660 |
module.exports = stackDelete; |
| 10661 |
|
| 10662 |
|
| 10663 |
/***/ }), |
| 10664 |
|
| 10665 |
/***/ 7599: |
| 10666 |
/***/ ((module) => { |
| 10667 |
|
| 10668 |
/** |
| 10669 |
* Gets the stack value for `key`. |
| 10670 |
* |
| 10671 |
* @private |
| 10672 |
* @name get |
| 10673 |
* @memberOf Stack |
| 10674 |
* @param {string} key The key of the value to get. |
| 10675 |
* @returns {*} Returns the entry value. |
| 10676 |
*/ |
| 10677 |
function stackGet(key) { |
| 10678 |
return this.__data__.get(key); |
| 10679 |
} |
| 10680 |
|
| 10681 |
module.exports = stackGet; |
| 10682 |
|
| 10683 |
|
| 10684 |
/***/ }), |
| 10685 |
|
| 10686 |
/***/ 4758: |
| 10687 |
/***/ ((module) => { |
| 10688 |
|
| 10689 |
/** |
| 10690 |
* Checks if a stack value for `key` exists. |
| 10691 |
* |
| 10692 |
* @private |
| 10693 |
* @name has |
| 10694 |
* @memberOf Stack |
| 10695 |
* @param {string} key The key of the entry to check. |
| 10696 |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
| 10697 |
*/ |
| 10698 |
function stackHas(key) { |
| 10699 |
return this.__data__.has(key); |
| 10700 |
} |
| 10701 |
|
| 10702 |
module.exports = stackHas; |
| 10703 |
|
| 10704 |
|
| 10705 |
/***/ }), |
| 10706 |
|
| 10707 |
/***/ 4309: |
| 10708 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10709 |
|
| 10710 |
var ListCache = __webpack_require__(8407), |
| 10711 |
Map = __webpack_require__(7071), |
| 10712 |
MapCache = __webpack_require__(3369); |
| 10713 |
|
| 10714 |
/** Used as the size to enable large array optimizations. */ |
| 10715 |
var LARGE_ARRAY_SIZE = 200; |
| 10716 |
|
| 10717 |
/** |
| 10718 |
* Sets the stack `key` to `value`. |
| 10719 |
* |
| 10720 |
* @private |
| 10721 |
* @name set |
| 10722 |
* @memberOf Stack |
| 10723 |
* @param {string} key The key of the value to set. |
| 10724 |
* @param {*} value The value to set. |
| 10725 |
* @returns {Object} Returns the stack cache instance. |
| 10726 |
*/ |
| 10727 |
function stackSet(key, value) { |
| 10728 |
var data = this.__data__; |
| 10729 |
if (data instanceof ListCache) { |
| 10730 |
var pairs = data.__data__; |
| 10731 |
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { |
| 10732 |
pairs.push([key, value]); |
| 10733 |
this.size = ++data.size; |
| 10734 |
return this; |
| 10735 |
} |
| 10736 |
data = this.__data__ = new MapCache(pairs); |
| 10737 |
} |
| 10738 |
data.set(key, value); |
| 10739 |
this.size = data.size; |
| 10740 |
return this; |
| 10741 |
} |
| 10742 |
|
| 10743 |
module.exports = stackSet; |
| 10744 |
|
| 10745 |
|
| 10746 |
/***/ }), |
| 10747 |
|
| 10748 |
/***/ 346: |
| 10749 |
/***/ ((module) => { |
| 10750 |
|
| 10751 |
/** Used for built-in method references. */ |
| 10752 |
var funcProto = Function.prototype; |
| 10753 |
|
| 10754 |
/** Used to resolve the decompiled source of functions. */ |
| 10755 |
var funcToString = funcProto.toString; |
| 10756 |
|
| 10757 |
/** |
| 10758 |
* Converts `func` to its source code. |
| 10759 |
* |
| 10760 |
* @private |
| 10761 |
* @param {Function} func The function to convert. |
| 10762 |
* @returns {string} Returns the source code. |
| 10763 |
*/ |
| 10764 |
function toSource(func) { |
| 10765 |
if (func != null) { |
| 10766 |
try { |
| 10767 |
return funcToString.call(func); |
| 10768 |
} catch (e) {} |
| 10769 |
try { |
| 10770 |
return (func + ''); |
| 10771 |
} catch (e) {} |
| 10772 |
} |
| 10773 |
return ''; |
| 10774 |
} |
| 10775 |
|
| 10776 |
module.exports = toSource; |
| 10777 |
|
| 10778 |
|
| 10779 |
/***/ }), |
| 10780 |
|
| 10781 |
/***/ 7813: |
| 10782 |
/***/ ((module) => { |
| 10783 |
|
| 10784 |
/** |
| 10785 |
* Performs a |
| 10786 |
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
| 10787 |
* comparison between two values to determine if they are equivalent. |
| 10788 |
* |
| 10789 |
* @static |
| 10790 |
* @memberOf _ |
| 10791 |
* @since 4.0.0 |
| 10792 |
* @category Lang |
| 10793 |
* @param {*} value The value to compare. |
| 10794 |
* @param {*} other The other value to compare. |
| 10795 |
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. |
| 10796 |
* @example |
| 10797 |
* |
| 10798 |
* var object = { 'a': 1 }; |
| 10799 |
* var other = { 'a': 1 }; |
| 10800 |
* |
| 10801 |
* _.eq(object, object); |
| 10802 |
* // => true |
| 10803 |
* |
| 10804 |
* _.eq(object, other); |
| 10805 |
* // => false |
| 10806 |
* |
| 10807 |
* _.eq('a', 'a'); |
| 10808 |
* // => true |
| 10809 |
* |
| 10810 |
* _.eq('a', Object('a')); |
| 10811 |
* // => false |
| 10812 |
* |
| 10813 |
* _.eq(NaN, NaN); |
| 10814 |
* // => true |
| 10815 |
*/ |
| 10816 |
function eq(value, other) { |
| 10817 |
return value === other || (value !== value && other !== other); |
| 10818 |
} |
| 10819 |
|
| 10820 |
module.exports = eq; |
| 10821 |
|
| 10822 |
|
| 10823 |
/***/ }), |
| 10824 |
|
| 10825 |
/***/ 5694: |
| 10826 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10827 |
|
| 10828 |
var baseIsArguments = __webpack_require__(9454), |
| 10829 |
isObjectLike = __webpack_require__(7005); |
| 10830 |
|
| 10831 |
/** Used for built-in method references. */ |
| 10832 |
var objectProto = Object.prototype; |
| 10833 |
|
| 10834 |
/** Used to check objects for own properties. */ |
| 10835 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 10836 |
|
| 10837 |
/** Built-in value references. */ |
| 10838 |
var propertyIsEnumerable = objectProto.propertyIsEnumerable; |
| 10839 |
|
| 10840 |
/** |
| 10841 |
* Checks if `value` is likely an `arguments` object. |
| 10842 |
* |
| 10843 |
* @static |
| 10844 |
* @memberOf _ |
| 10845 |
* @since 0.1.0 |
| 10846 |
* @category Lang |
| 10847 |
* @param {*} value The value to check. |
| 10848 |
* @returns {boolean} Returns `true` if `value` is an `arguments` object, |
| 10849 |
* else `false`. |
| 10850 |
* @example |
| 10851 |
* |
| 10852 |
* _.isArguments(function() { return arguments; }()); |
| 10853 |
* // => true |
| 10854 |
* |
| 10855 |
* _.isArguments([1, 2, 3]); |
| 10856 |
* // => false |
| 10857 |
*/ |
| 10858 |
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { |
| 10859 |
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && |
| 10860 |
!propertyIsEnumerable.call(value, 'callee'); |
| 10861 |
}; |
| 10862 |
|
| 10863 |
module.exports = isArguments; |
| 10864 |
|
| 10865 |
|
| 10866 |
/***/ }), |
| 10867 |
|
| 10868 |
/***/ 1469: |
| 10869 |
/***/ ((module) => { |
| 10870 |
|
| 10871 |
/** |
| 10872 |
* Checks if `value` is classified as an `Array` object. |
| 10873 |
* |
| 10874 |
* @static |
| 10875 |
* @memberOf _ |
| 10876 |
* @since 0.1.0 |
| 10877 |
* @category Lang |
| 10878 |
* @param {*} value The value to check. |
| 10879 |
* @returns {boolean} Returns `true` if `value` is an array, else `false`. |
| 10880 |
* @example |
| 10881 |
* |
| 10882 |
* _.isArray([1, 2, 3]); |
| 10883 |
* // => true |
| 10884 |
* |
| 10885 |
* _.isArray(document.body.children); |
| 10886 |
* // => false |
| 10887 |
* |
| 10888 |
* _.isArray('abc'); |
| 10889 |
* // => false |
| 10890 |
* |
| 10891 |
* _.isArray(_.noop); |
| 10892 |
* // => false |
| 10893 |
*/ |
| 10894 |
var isArray = Array.isArray; |
| 10895 |
|
| 10896 |
module.exports = isArray; |
| 10897 |
|
| 10898 |
|
| 10899 |
/***/ }), |
| 10900 |
|
| 10901 |
/***/ 8612: |
| 10902 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10903 |
|
| 10904 |
var isFunction = __webpack_require__(3560), |
| 10905 |
isLength = __webpack_require__(1780); |
| 10906 |
|
| 10907 |
/** |
| 10908 |
* Checks if `value` is array-like. A value is considered array-like if it's |
| 10909 |
* not a function and has a `value.length` that's an integer greater than or |
| 10910 |
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. |
| 10911 |
* |
| 10912 |
* @static |
| 10913 |
* @memberOf _ |
| 10914 |
* @since 4.0.0 |
| 10915 |
* @category Lang |
| 10916 |
* @param {*} value The value to check. |
| 10917 |
* @returns {boolean} Returns `true` if `value` is array-like, else `false`. |
| 10918 |
* @example |
| 10919 |
* |
| 10920 |
* _.isArrayLike([1, 2, 3]); |
| 10921 |
* // => true |
| 10922 |
* |
| 10923 |
* _.isArrayLike(document.body.children); |
| 10924 |
* // => true |
| 10925 |
* |
| 10926 |
* _.isArrayLike('abc'); |
| 10927 |
* // => true |
| 10928 |
* |
| 10929 |
* _.isArrayLike(_.noop); |
| 10930 |
* // => false |
| 10931 |
*/ |
| 10932 |
function isArrayLike(value) { |
| 10933 |
return value != null && isLength(value.length) && !isFunction(value); |
| 10934 |
} |
| 10935 |
|
| 10936 |
module.exports = isArrayLike; |
| 10937 |
|
| 10938 |
|
| 10939 |
/***/ }), |
| 10940 |
|
| 10941 |
/***/ 4144: |
| 10942 |
/***/ ((module, exports, __webpack_require__) => { |
| 10943 |
|
| 10944 |
/* module decorator */ module = __webpack_require__.nmd(module); |
| 10945 |
var root = __webpack_require__(5639), |
| 10946 |
stubFalse = __webpack_require__(5062); |
| 10947 |
|
| 10948 |
/** Detect free variable `exports`. */ |
| 10949 |
var freeExports = true && exports && !exports.nodeType && exports; |
| 10950 |
|
| 10951 |
/** Detect free variable `module`. */ |
| 10952 |
var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; |
| 10953 |
|
| 10954 |
/** Detect the popular CommonJS extension `module.exports`. */ |
| 10955 |
var moduleExports = freeModule && freeModule.exports === freeExports; |
| 10956 |
|
| 10957 |
/** Built-in value references. */ |
| 10958 |
var Buffer = moduleExports ? root.Buffer : undefined; |
| 10959 |
|
| 10960 |
/* Built-in method references for those with the same name as other `lodash` methods. */ |
| 10961 |
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; |
| 10962 |
|
| 10963 |
/** |
| 10964 |
* Checks if `value` is a buffer. |
| 10965 |
* |
| 10966 |
* @static |
| 10967 |
* @memberOf _ |
| 10968 |
* @since 4.3.0 |
| 10969 |
* @category Lang |
| 10970 |
* @param {*} value The value to check. |
| 10971 |
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`. |
| 10972 |
* @example |
| 10973 |
* |
| 10974 |
* _.isBuffer(new Buffer(2)); |
| 10975 |
* // => true |
| 10976 |
* |
| 10977 |
* _.isBuffer(new Uint8Array(2)); |
| 10978 |
* // => false |
| 10979 |
*/ |
| 10980 |
var isBuffer = nativeIsBuffer || stubFalse; |
| 10981 |
|
| 10982 |
module.exports = isBuffer; |
| 10983 |
|
| 10984 |
|
| 10985 |
/***/ }), |
| 10986 |
|
| 10987 |
/***/ 8446: |
| 10988 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 10989 |
|
| 10990 |
var baseIsEqual = __webpack_require__(939); |
| 10991 |
|
| 10992 |
/** |
| 10993 |
* Performs a deep comparison between two values to determine if they are |
| 10994 |
* equivalent. |
| 10995 |
* |
| 10996 |
* **Note:** This method supports comparing arrays, array buffers, booleans, |
| 10997 |
* date objects, error objects, maps, numbers, `Object` objects, regexes, |
| 10998 |
* sets, strings, symbols, and typed arrays. `Object` objects are compared |
| 10999 |
* by their own, not inherited, enumerable properties. Functions and DOM |
| 11000 |
* nodes are compared by strict equality, i.e. `===`. |
| 11001 |
* |
| 11002 |
* @static |
| 11003 |
* @memberOf _ |
| 11004 |
* @since 0.1.0 |
| 11005 |
* @category Lang |
| 11006 |
* @param {*} value The value to compare. |
| 11007 |
* @param {*} other The other value to compare. |
| 11008 |
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. |
| 11009 |
* @example |
| 11010 |
* |
| 11011 |
* var object = { 'a': 1 }; |
| 11012 |
* var other = { 'a': 1 }; |
| 11013 |
* |
| 11014 |
* _.isEqual(object, other); |
| 11015 |
* // => true |
| 11016 |
* |
| 11017 |
* object === other; |
| 11018 |
* // => false |
| 11019 |
*/ |
| 11020 |
function isEqual(value, other) { |
| 11021 |
return baseIsEqual(value, other); |
| 11022 |
} |
| 11023 |
|
| 11024 |
module.exports = isEqual; |
| 11025 |
|
| 11026 |
|
| 11027 |
/***/ }), |
| 11028 |
|
| 11029 |
/***/ 3560: |
| 11030 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 11031 |
|
| 11032 |
var baseGetTag = __webpack_require__(4239), |
| 11033 |
isObject = __webpack_require__(3218); |
| 11034 |
|
| 11035 |
/** `Object#toString` result references. */ |
| 11036 |
var asyncTag = '[object AsyncFunction]', |
| 11037 |
funcTag = '[object Function]', |
| 11038 |
genTag = '[object GeneratorFunction]', |
| 11039 |
proxyTag = '[object Proxy]'; |
| 11040 |
|
| 11041 |
/** |
| 11042 |
* Checks if `value` is classified as a `Function` object. |
| 11043 |
* |
| 11044 |
* @static |
| 11045 |
* @memberOf _ |
| 11046 |
* @since 0.1.0 |
| 11047 |
* @category Lang |
| 11048 |
* @param {*} value The value to check. |
| 11049 |
* @returns {boolean} Returns `true` if `value` is a function, else `false`. |
| 11050 |
* @example |
| 11051 |
* |
| 11052 |
* _.isFunction(_); |
| 11053 |
* // => true |
| 11054 |
* |
| 11055 |
* _.isFunction(/abc/); |
| 11056 |
* // => false |
| 11057 |
*/ |
| 11058 |
function isFunction(value) { |
| 11059 |
if (!isObject(value)) { |
| 11060 |
return false; |
| 11061 |
} |
| 11062 |
// The use of `Object#toString` avoids issues with the `typeof` operator |
| 11063 |
// in Safari 9 which returns 'object' for typed arrays and other constructors. |
| 11064 |
var tag = baseGetTag(value); |
| 11065 |
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; |
| 11066 |
} |
| 11067 |
|
| 11068 |
module.exports = isFunction; |
| 11069 |
|
| 11070 |
|
| 11071 |
/***/ }), |
| 11072 |
|
| 11073 |
/***/ 1780: |
| 11074 |
/***/ ((module) => { |
| 11075 |
|
| 11076 |
/** Used as references for various `Number` constants. */ |
| 11077 |
var MAX_SAFE_INTEGER = 9007199254740991; |
| 11078 |
|
| 11079 |
/** |
| 11080 |
* Checks if `value` is a valid array-like length. |
| 11081 |
* |
| 11082 |
* **Note:** This method is loosely based on |
| 11083 |
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). |
| 11084 |
* |
| 11085 |
* @static |
| 11086 |
* @memberOf _ |
| 11087 |
* @since 4.0.0 |
| 11088 |
* @category Lang |
| 11089 |
* @param {*} value The value to check. |
| 11090 |
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`. |
| 11091 |
* @example |
| 11092 |
* |
| 11093 |
* _.isLength(3); |
| 11094 |
* // => true |
| 11095 |
* |
| 11096 |
* _.isLength(Number.MIN_VALUE); |
| 11097 |
* // => false |
| 11098 |
* |
| 11099 |
* _.isLength(Infinity); |
| 11100 |
* // => false |
| 11101 |
* |
| 11102 |
* _.isLength('3'); |
| 11103 |
* // => false |
| 11104 |
*/ |
| 11105 |
function isLength(value) { |
| 11106 |
return typeof value == 'number' && |
| 11107 |
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; |
| 11108 |
} |
| 11109 |
|
| 11110 |
module.exports = isLength; |
| 11111 |
|
| 11112 |
|
| 11113 |
/***/ }), |
| 11114 |
|
| 11115 |
/***/ 3218: |
| 11116 |
/***/ ((module) => { |
| 11117 |
|
| 11118 |
/** |
| 11119 |
* Checks if `value` is the |
| 11120 |
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) |
| 11121 |
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) |
| 11122 |
* |
| 11123 |
* @static |
| 11124 |
* @memberOf _ |
| 11125 |
* @since 0.1.0 |
| 11126 |
* @category Lang |
| 11127 |
* @param {*} value The value to check. |
| 11128 |
* @returns {boolean} Returns `true` if `value` is an object, else `false`. |
| 11129 |
* @example |
| 11130 |
* |
| 11131 |
* _.isObject({}); |
| 11132 |
* // => true |
| 11133 |
* |
| 11134 |
* _.isObject([1, 2, 3]); |
| 11135 |
* // => true |
| 11136 |
* |
| 11137 |
* _.isObject(_.noop); |
| 11138 |
* // => true |
| 11139 |
* |
| 11140 |
* _.isObject(null); |
| 11141 |
* // => false |
| 11142 |
*/ |
| 11143 |
function isObject(value) { |
| 11144 |
var type = typeof value; |
| 11145 |
return value != null && (type == 'object' || type == 'function'); |
| 11146 |
} |
| 11147 |
|
| 11148 |
module.exports = isObject; |
| 11149 |
|
| 11150 |
|
| 11151 |
/***/ }), |
| 11152 |
|
| 11153 |
/***/ 7005: |
| 11154 |
/***/ ((module) => { |
| 11155 |
|
| 11156 |
/** |
| 11157 |
* Checks if `value` is object-like. A value is object-like if it's not `null` |
| 11158 |
* and has a `typeof` result of "object". |
| 11159 |
* |
| 11160 |
* @static |
| 11161 |
* @memberOf _ |
| 11162 |
* @since 4.0.0 |
| 11163 |
* @category Lang |
| 11164 |
* @param {*} value The value to check. |
| 11165 |
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. |
| 11166 |
* @example |
| 11167 |
* |
| 11168 |
* _.isObjectLike({}); |
| 11169 |
* // => true |
| 11170 |
* |
| 11171 |
* _.isObjectLike([1, 2, 3]); |
| 11172 |
* // => true |
| 11173 |
* |
| 11174 |
* _.isObjectLike(_.noop); |
| 11175 |
* // => false |
| 11176 |
* |
| 11177 |
* _.isObjectLike(null); |
| 11178 |
* // => false |
| 11179 |
*/ |
| 11180 |
function isObjectLike(value) { |
| 11181 |
return value != null && typeof value == 'object'; |
| 11182 |
} |
| 11183 |
|
| 11184 |
module.exports = isObjectLike; |
| 11185 |
|
| 11186 |
|
| 11187 |
/***/ }), |
| 11188 |
|
| 11189 |
/***/ 6719: |
| 11190 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 11191 |
|
| 11192 |
var baseIsTypedArray = __webpack_require__(8749), |
| 11193 |
baseUnary = __webpack_require__(1717), |
| 11194 |
nodeUtil = __webpack_require__(4000); |
| 11195 |
|
| 11196 |
/* Node.js helper references. */ |
| 11197 |
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; |
| 11198 |
|
| 11199 |
/** |
| 11200 |
* Checks if `value` is classified as a typed array. |
| 11201 |
* |
| 11202 |
* @static |
| 11203 |
* @memberOf _ |
| 11204 |
* @since 3.0.0 |
| 11205 |
* @category Lang |
| 11206 |
* @param {*} value The value to check. |
| 11207 |
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`. |
| 11208 |
* @example |
| 11209 |
* |
| 11210 |
* _.isTypedArray(new Uint8Array); |
| 11211 |
* // => true |
| 11212 |
* |
| 11213 |
* _.isTypedArray([]); |
| 11214 |
* // => false |
| 11215 |
*/ |
| 11216 |
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; |
| 11217 |
|
| 11218 |
module.exports = isTypedArray; |
| 11219 |
|
| 11220 |
|
| 11221 |
/***/ }), |
| 11222 |
|
| 11223 |
/***/ 3674: |
| 11224 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 11225 |
|
| 11226 |
var arrayLikeKeys = __webpack_require__(4636), |
| 11227 |
baseKeys = __webpack_require__(280), |
| 11228 |
isArrayLike = __webpack_require__(8612); |
| 11229 |
|
| 11230 |
/** |
| 11231 |
* Creates an array of the own enumerable property names of `object`. |
| 11232 |
* |
| 11233 |
* **Note:** Non-object values are coerced to objects. See the |
| 11234 |
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) |
| 11235 |
* for more details. |
| 11236 |
* |
| 11237 |
* @static |
| 11238 |
* @since 0.1.0 |
| 11239 |
* @memberOf _ |
| 11240 |
* @category Object |
| 11241 |
* @param {Object} object The object to query. |
| 11242 |
* @returns {Array} Returns the array of property names. |
| 11243 |
* @example |
| 11244 |
* |
| 11245 |
* function Foo() { |
| 11246 |
* this.a = 1; |
| 11247 |
* this.b = 2; |
| 11248 |
* } |
| 11249 |
* |
| 11250 |
* Foo.prototype.c = 3; |
| 11251 |
* |
| 11252 |
* _.keys(new Foo); |
| 11253 |
* // => ['a', 'b'] (iteration order is not guaranteed) |
| 11254 |
* |
| 11255 |
* _.keys('hi'); |
| 11256 |
* // => ['0', '1'] |
| 11257 |
*/ |
| 11258 |
function keys(object) { |
| 11259 |
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); |
| 11260 |
} |
| 11261 |
|
| 11262 |
module.exports = keys; |
| 11263 |
|
| 11264 |
|
| 11265 |
/***/ }), |
| 11266 |
|
| 11267 |
/***/ 479: |
| 11268 |
/***/ ((module) => { |
| 11269 |
|
| 11270 |
/** |
| 11271 |
* This method returns a new empty array. |
| 11272 |
* |
| 11273 |
* @static |
| 11274 |
* @memberOf _ |
| 11275 |
* @since 4.13.0 |
| 11276 |
* @category Util |
| 11277 |
* @returns {Array} Returns the new empty array. |
| 11278 |
* @example |
| 11279 |
* |
| 11280 |
* var arrays = _.times(2, _.stubArray); |
| 11281 |
* |
| 11282 |
* console.log(arrays); |
| 11283 |
* // => [[], []] |
| 11284 |
* |
| 11285 |
* console.log(arrays[0] === arrays[1]); |
| 11286 |
* // => false |
| 11287 |
*/ |
| 11288 |
function stubArray() { |
| 11289 |
return []; |
| 11290 |
} |
| 11291 |
|
| 11292 |
module.exports = stubArray; |
| 11293 |
|
| 11294 |
|
| 11295 |
/***/ }), |
| 11296 |
|
| 11297 |
/***/ 5062: |
| 11298 |
/***/ ((module) => { |
| 11299 |
|
| 11300 |
/** |
| 11301 |
* This method returns `false`. |
| 11302 |
* |
| 11303 |
* @static |
| 11304 |
* @memberOf _ |
| 11305 |
* @since 4.13.0 |
| 11306 |
* @category Util |
| 11307 |
* @returns {boolean} Returns `false`. |
| 11308 |
* @example |
| 11309 |
* |
| 11310 |
* _.times(2, _.stubFalse); |
| 11311 |
* // => [false, false] |
| 11312 |
*/ |
| 11313 |
function stubFalse() { |
| 11314 |
return false; |
| 11315 |
} |
| 11316 |
|
| 11317 |
module.exports = stubFalse; |
| 11318 |
|
| 11319 |
|
| 11320 |
/***/ }), |
| 11321 |
|
| 11322 |
/***/ 6095: |
| 11323 |
/***/ (function(module) { |
| 11324 |
|
| 11325 |
/*! |
| 11326 |
* Quill Editor v1.3.7 |
| 11327 |
* https://quilljs.com/ |
| 11328 |
* Copyright (c) 2014, Jason Chen |
| 11329 |
* Copyright (c) 2013, salesforce.com |
| 11330 |
*/ |
| 11331 |
(function webpackUniversalModuleDefinition(root, factory) { |
| 11332 |
if(true) |
| 11333 |
module.exports = factory(); |
| 11334 |
else {} |
| 11335 |
})(typeof self !== 'undefined' ? self : this, function() { |
| 11336 |
return /******/ (function(modules) { // webpackBootstrap |
| 11337 |
/******/ // The module cache |
| 11338 |
/******/ var installedModules = {}; |
| 11339 |
/******/ |
| 11340 |
/******/ // The require function |
| 11341 |
/******/ function __nested_webpack_require_697__(moduleId) { |
| 11342 |
/******/ |
| 11343 |
/******/ // Check if module is in cache |
| 11344 |
/******/ if(installedModules[moduleId]) { |
| 11345 |
/******/ return installedModules[moduleId].exports; |
| 11346 |
/******/ } |
| 11347 |
/******/ // Create a new module (and put it into the cache) |
| 11348 |
/******/ var module = installedModules[moduleId] = { |
| 11349 |
/******/ i: moduleId, |
| 11350 |
/******/ l: false, |
| 11351 |
/******/ exports: {} |
| 11352 |
/******/ }; |
| 11353 |
/******/ |
| 11354 |
/******/ // Execute the module function |
| 11355 |
/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_697__); |
| 11356 |
/******/ |
| 11357 |
/******/ // Flag the module as loaded |
| 11358 |
/******/ module.l = true; |
| 11359 |
/******/ |
| 11360 |
/******/ // Return the exports of the module |
| 11361 |
/******/ return module.exports; |
| 11362 |
/******/ } |
| 11363 |
/******/ |
| 11364 |
/******/ |
| 11365 |
/******/ // expose the modules object (__webpack_modules__) |
| 11366 |
/******/ __nested_webpack_require_697__.m = modules; |
| 11367 |
/******/ |
| 11368 |
/******/ // expose the module cache |
| 11369 |
/******/ __nested_webpack_require_697__.c = installedModules; |
| 11370 |
/******/ |
| 11371 |
/******/ // define getter function for harmony exports |
| 11372 |
/******/ __nested_webpack_require_697__.d = function(exports, name, getter) { |
| 11373 |
/******/ if(!__nested_webpack_require_697__.o(exports, name)) { |
| 11374 |
/******/ Object.defineProperty(exports, name, { |
| 11375 |
/******/ configurable: false, |
| 11376 |
/******/ enumerable: true, |
| 11377 |
/******/ get: getter |
| 11378 |
/******/ }); |
| 11379 |
/******/ } |
| 11380 |
/******/ }; |
| 11381 |
/******/ |
| 11382 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
| 11383 |
/******/ __nested_webpack_require_697__.n = function(module) { |
| 11384 |
/******/ var getter = module && module.__esModule ? |
| 11385 |
/******/ function getDefault() { return module['default']; } : |
| 11386 |
/******/ function getModuleExports() { return module; }; |
| 11387 |
/******/ __nested_webpack_require_697__.d(getter, 'a', getter); |
| 11388 |
/******/ return getter; |
| 11389 |
/******/ }; |
| 11390 |
/******/ |
| 11391 |
/******/ // Object.prototype.hasOwnProperty.call |
| 11392 |
/******/ __nested_webpack_require_697__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
| 11393 |
/******/ |
| 11394 |
/******/ // __webpack_public_path__ |
| 11395 |
/******/ __nested_webpack_require_697__.p = ""; |
| 11396 |
/******/ |
| 11397 |
/******/ // Load entry module and return exports |
| 11398 |
/******/ return __nested_webpack_require_697__(__nested_webpack_require_697__.s = 109); |
| 11399 |
/******/ }) |
| 11400 |
/************************************************************************/ |
| 11401 |
/******/ ([ |
| 11402 |
/* 0 */ |
| 11403 |
/***/ (function(module, exports, __nested_webpack_require_2976__) { |
| 11404 |
|
| 11405 |
"use strict"; |
| 11406 |
|
| 11407 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 11408 |
var container_1 = __nested_webpack_require_2976__(17); |
| 11409 |
var format_1 = __nested_webpack_require_2976__(18); |
| 11410 |
var leaf_1 = __nested_webpack_require_2976__(19); |
| 11411 |
var scroll_1 = __nested_webpack_require_2976__(45); |
| 11412 |
var inline_1 = __nested_webpack_require_2976__(46); |
| 11413 |
var block_1 = __nested_webpack_require_2976__(47); |
| 11414 |
var embed_1 = __nested_webpack_require_2976__(48); |
| 11415 |
var text_1 = __nested_webpack_require_2976__(49); |
| 11416 |
var attributor_1 = __nested_webpack_require_2976__(12); |
| 11417 |
var class_1 = __nested_webpack_require_2976__(32); |
| 11418 |
var style_1 = __nested_webpack_require_2976__(33); |
| 11419 |
var store_1 = __nested_webpack_require_2976__(31); |
| 11420 |
var Registry = __nested_webpack_require_2976__(1); |
| 11421 |
var Parchment = { |
| 11422 |
Scope: Registry.Scope, |
| 11423 |
create: Registry.create, |
| 11424 |
find: Registry.find, |
| 11425 |
query: Registry.query, |
| 11426 |
register: Registry.register, |
| 11427 |
Container: container_1.default, |
| 11428 |
Format: format_1.default, |
| 11429 |
Leaf: leaf_1.default, |
| 11430 |
Embed: embed_1.default, |
| 11431 |
Scroll: scroll_1.default, |
| 11432 |
Block: block_1.default, |
| 11433 |
Inline: inline_1.default, |
| 11434 |
Text: text_1.default, |
| 11435 |
Attributor: { |
| 11436 |
Attribute: attributor_1.default, |
| 11437 |
Class: class_1.default, |
| 11438 |
Style: style_1.default, |
| 11439 |
Store: store_1.default, |
| 11440 |
}, |
| 11441 |
}; |
| 11442 |
exports.default = Parchment; |
| 11443 |
|
| 11444 |
|
| 11445 |
/***/ }), |
| 11446 |
/* 1 */ |
| 11447 |
/***/ (function(module, exports, __webpack_require__) { |
| 11448 |
|
| 11449 |
"use strict"; |
| 11450 |
|
| 11451 |
var __extends = (this && this.__extends) || (function () { |
| 11452 |
var extendStatics = Object.setPrototypeOf || |
| 11453 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 11454 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 11455 |
return function (d, b) { |
| 11456 |
extendStatics(d, b); |
| 11457 |
function __() { this.constructor = d; } |
| 11458 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 11459 |
}; |
| 11460 |
})(); |
| 11461 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 11462 |
var ParchmentError = /** @class */ (function (_super) { |
| 11463 |
__extends(ParchmentError, _super); |
| 11464 |
function ParchmentError(message) { |
| 11465 |
var _this = this; |
| 11466 |
message = '[Parchment] ' + message; |
| 11467 |
_this = _super.call(this, message) || this; |
| 11468 |
_this.message = message; |
| 11469 |
_this.name = _this.constructor.name; |
| 11470 |
return _this; |
| 11471 |
} |
| 11472 |
return ParchmentError; |
| 11473 |
}(Error)); |
| 11474 |
exports.ParchmentError = ParchmentError; |
| 11475 |
var attributes = {}; |
| 11476 |
var classes = {}; |
| 11477 |
var tags = {}; |
| 11478 |
var types = {}; |
| 11479 |
exports.DATA_KEY = '__blot'; |
| 11480 |
var Scope; |
| 11481 |
(function (Scope) { |
| 11482 |
Scope[Scope["TYPE"] = 3] = "TYPE"; |
| 11483 |
Scope[Scope["LEVEL"] = 12] = "LEVEL"; |
| 11484 |
Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; |
| 11485 |
Scope[Scope["BLOT"] = 14] = "BLOT"; |
| 11486 |
Scope[Scope["INLINE"] = 7] = "INLINE"; |
| 11487 |
Scope[Scope["BLOCK"] = 11] = "BLOCK"; |
| 11488 |
Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; |
| 11489 |
Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; |
| 11490 |
Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; |
| 11491 |
Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; |
| 11492 |
Scope[Scope["ANY"] = 15] = "ANY"; |
| 11493 |
})(Scope = exports.Scope || (exports.Scope = {})); |
| 11494 |
function create(input, value) { |
| 11495 |
var match = query(input); |
| 11496 |
if (match == null) { |
| 11497 |
throw new ParchmentError("Unable to create " + input + " blot"); |
| 11498 |
} |
| 11499 |
var BlotClass = match; |
| 11500 |
var node = |
| 11501 |
// @ts-ignore |
| 11502 |
input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); |
| 11503 |
return new BlotClass(node, value); |
| 11504 |
} |
| 11505 |
exports.create = create; |
| 11506 |
function find(node, bubble) { |
| 11507 |
if (bubble === void 0) { bubble = false; } |
| 11508 |
if (node == null) |
| 11509 |
return null; |
| 11510 |
// @ts-ignore |
| 11511 |
if (node[exports.DATA_KEY] != null) |
| 11512 |
return node[exports.DATA_KEY].blot; |
| 11513 |
if (bubble) |
| 11514 |
return find(node.parentNode, bubble); |
| 11515 |
return null; |
| 11516 |
} |
| 11517 |
exports.find = find; |
| 11518 |
function query(query, scope) { |
| 11519 |
if (scope === void 0) { scope = Scope.ANY; } |
| 11520 |
var match; |
| 11521 |
if (typeof query === 'string') { |
| 11522 |
match = types[query] || attributes[query]; |
| 11523 |
// @ts-ignore |
| 11524 |
} |
| 11525 |
else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { |
| 11526 |
match = types['text']; |
| 11527 |
} |
| 11528 |
else if (typeof query === 'number') { |
| 11529 |
if (query & Scope.LEVEL & Scope.BLOCK) { |
| 11530 |
match = types['block']; |
| 11531 |
} |
| 11532 |
else if (query & Scope.LEVEL & Scope.INLINE) { |
| 11533 |
match = types['inline']; |
| 11534 |
} |
| 11535 |
} |
| 11536 |
else if (query instanceof HTMLElement) { |
| 11537 |
var names = (query.getAttribute('class') || '').split(/\s+/); |
| 11538 |
for (var i in names) { |
| 11539 |
match = classes[names[i]]; |
| 11540 |
if (match) |
| 11541 |
break; |
| 11542 |
} |
| 11543 |
match = match || tags[query.tagName]; |
| 11544 |
} |
| 11545 |
if (match == null) |
| 11546 |
return null; |
| 11547 |
// @ts-ignore |
| 11548 |
if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) |
| 11549 |
return match; |
| 11550 |
return null; |
| 11551 |
} |
| 11552 |
exports.query = query; |
| 11553 |
function register() { |
| 11554 |
var Definitions = []; |
| 11555 |
for (var _i = 0; _i < arguments.length; _i++) { |
| 11556 |
Definitions[_i] = arguments[_i]; |
| 11557 |
} |
| 11558 |
if (Definitions.length > 1) { |
| 11559 |
return Definitions.map(function (d) { |
| 11560 |
return register(d); |
| 11561 |
}); |
| 11562 |
} |
| 11563 |
var Definition = Definitions[0]; |
| 11564 |
if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { |
| 11565 |
throw new ParchmentError('Invalid definition'); |
| 11566 |
} |
| 11567 |
else if (Definition.blotName === 'abstract') { |
| 11568 |
throw new ParchmentError('Cannot register abstract class'); |
| 11569 |
} |
| 11570 |
types[Definition.blotName || Definition.attrName] = Definition; |
| 11571 |
if (typeof Definition.keyName === 'string') { |
| 11572 |
attributes[Definition.keyName] = Definition; |
| 11573 |
} |
| 11574 |
else { |
| 11575 |
if (Definition.className != null) { |
| 11576 |
classes[Definition.className] = Definition; |
| 11577 |
} |
| 11578 |
if (Definition.tagName != null) { |
| 11579 |
if (Array.isArray(Definition.tagName)) { |
| 11580 |
Definition.tagName = Definition.tagName.map(function (tagName) { |
| 11581 |
return tagName.toUpperCase(); |
| 11582 |
}); |
| 11583 |
} |
| 11584 |
else { |
| 11585 |
Definition.tagName = Definition.tagName.toUpperCase(); |
| 11586 |
} |
| 11587 |
var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; |
| 11588 |
tagNames.forEach(function (tag) { |
| 11589 |
if (tags[tag] == null || Definition.className == null) { |
| 11590 |
tags[tag] = Definition; |
| 11591 |
} |
| 11592 |
}); |
| 11593 |
} |
| 11594 |
} |
| 11595 |
return Definition; |
| 11596 |
} |
| 11597 |
exports.register = register; |
| 11598 |
|
| 11599 |
|
| 11600 |
/***/ }), |
| 11601 |
/* 2 */ |
| 11602 |
/***/ (function(module, exports, __nested_webpack_require_9445__) { |
| 11603 |
|
| 11604 |
var diff = __nested_webpack_require_9445__(51); |
| 11605 |
var equal = __nested_webpack_require_9445__(11); |
| 11606 |
var extend = __nested_webpack_require_9445__(3); |
| 11607 |
var op = __nested_webpack_require_9445__(20); |
| 11608 |
|
| 11609 |
|
| 11610 |
var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() |
| 11611 |
|
| 11612 |
|
| 11613 |
var Delta = function (ops) { |
| 11614 |
// Assume we are given a well formed ops |
| 11615 |
if (Array.isArray(ops)) { |
| 11616 |
this.ops = ops; |
| 11617 |
} else if (ops != null && Array.isArray(ops.ops)) { |
| 11618 |
this.ops = ops.ops; |
| 11619 |
} else { |
| 11620 |
this.ops = []; |
| 11621 |
} |
| 11622 |
}; |
| 11623 |
|
| 11624 |
|
| 11625 |
Delta.prototype.insert = function (text, attributes) { |
| 11626 |
var newOp = {}; |
| 11627 |
if (text.length === 0) return this; |
| 11628 |
newOp.insert = text; |
| 11629 |
if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { |
| 11630 |
newOp.attributes = attributes; |
| 11631 |
} |
| 11632 |
return this.push(newOp); |
| 11633 |
}; |
| 11634 |
|
| 11635 |
Delta.prototype['delete'] = function (length) { |
| 11636 |
if (length <= 0) return this; |
| 11637 |
return this.push({ 'delete': length }); |
| 11638 |
}; |
| 11639 |
|
| 11640 |
Delta.prototype.retain = function (length, attributes) { |
| 11641 |
if (length <= 0) return this; |
| 11642 |
var newOp = { retain: length }; |
| 11643 |
if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { |
| 11644 |
newOp.attributes = attributes; |
| 11645 |
} |
| 11646 |
return this.push(newOp); |
| 11647 |
}; |
| 11648 |
|
| 11649 |
Delta.prototype.push = function (newOp) { |
| 11650 |
var index = this.ops.length; |
| 11651 |
var lastOp = this.ops[index - 1]; |
| 11652 |
newOp = extend(true, {}, newOp); |
| 11653 |
if (typeof lastOp === 'object') { |
| 11654 |
if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { |
| 11655 |
this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; |
| 11656 |
return this; |
| 11657 |
} |
| 11658 |
// Since it does not matter if we insert before or after deleting at the same index, |
| 11659 |
// always prefer to insert first |
| 11660 |
if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { |
| 11661 |
index -= 1; |
| 11662 |
lastOp = this.ops[index - 1]; |
| 11663 |
if (typeof lastOp !== 'object') { |
| 11664 |
this.ops.unshift(newOp); |
| 11665 |
return this; |
| 11666 |
} |
| 11667 |
} |
| 11668 |
if (equal(newOp.attributes, lastOp.attributes)) { |
| 11669 |
if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { |
| 11670 |
this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; |
| 11671 |
if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes |
| 11672 |
return this; |
| 11673 |
} else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { |
| 11674 |
this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; |
| 11675 |
if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes |
| 11676 |
return this; |
| 11677 |
} |
| 11678 |
} |
| 11679 |
} |
| 11680 |
if (index === this.ops.length) { |
| 11681 |
this.ops.push(newOp); |
| 11682 |
} else { |
| 11683 |
this.ops.splice(index, 0, newOp); |
| 11684 |
} |
| 11685 |
return this; |
| 11686 |
}; |
| 11687 |
|
| 11688 |
Delta.prototype.chop = function () { |
| 11689 |
var lastOp = this.ops[this.ops.length - 1]; |
| 11690 |
if (lastOp && lastOp.retain && !lastOp.attributes) { |
| 11691 |
this.ops.pop(); |
| 11692 |
} |
| 11693 |
return this; |
| 11694 |
}; |
| 11695 |
|
| 11696 |
Delta.prototype.filter = function (predicate) { |
| 11697 |
return this.ops.filter(predicate); |
| 11698 |
}; |
| 11699 |
|
| 11700 |
Delta.prototype.forEach = function (predicate) { |
| 11701 |
this.ops.forEach(predicate); |
| 11702 |
}; |
| 11703 |
|
| 11704 |
Delta.prototype.map = function (predicate) { |
| 11705 |
return this.ops.map(predicate); |
| 11706 |
}; |
| 11707 |
|
| 11708 |
Delta.prototype.partition = function (predicate) { |
| 11709 |
var passed = [], failed = []; |
| 11710 |
this.forEach(function(op) { |
| 11711 |
var target = predicate(op) ? passed : failed; |
| 11712 |
target.push(op); |
| 11713 |
}); |
| 11714 |
return [passed, failed]; |
| 11715 |
}; |
| 11716 |
|
| 11717 |
Delta.prototype.reduce = function (predicate, initial) { |
| 11718 |
return this.ops.reduce(predicate, initial); |
| 11719 |
}; |
| 11720 |
|
| 11721 |
Delta.prototype.changeLength = function () { |
| 11722 |
return this.reduce(function (length, elem) { |
| 11723 |
if (elem.insert) { |
| 11724 |
return length + op.length(elem); |
| 11725 |
} else if (elem.delete) { |
| 11726 |
return length - elem.delete; |
| 11727 |
} |
| 11728 |
return length; |
| 11729 |
}, 0); |
| 11730 |
}; |
| 11731 |
|
| 11732 |
Delta.prototype.length = function () { |
| 11733 |
return this.reduce(function (length, elem) { |
| 11734 |
return length + op.length(elem); |
| 11735 |
}, 0); |
| 11736 |
}; |
| 11737 |
|
| 11738 |
Delta.prototype.slice = function (start, end) { |
| 11739 |
start = start || 0; |
| 11740 |
if (typeof end !== 'number') end = Infinity; |
| 11741 |
var ops = []; |
| 11742 |
var iter = op.iterator(this.ops); |
| 11743 |
var index = 0; |
| 11744 |
while (index < end && iter.hasNext()) { |
| 11745 |
var nextOp; |
| 11746 |
if (index < start) { |
| 11747 |
nextOp = iter.next(start - index); |
| 11748 |
} else { |
| 11749 |
nextOp = iter.next(end - index); |
| 11750 |
ops.push(nextOp); |
| 11751 |
} |
| 11752 |
index += op.length(nextOp); |
| 11753 |
} |
| 11754 |
return new Delta(ops); |
| 11755 |
}; |
| 11756 |
|
| 11757 |
|
| 11758 |
Delta.prototype.compose = function (other) { |
| 11759 |
var thisIter = op.iterator(this.ops); |
| 11760 |
var otherIter = op.iterator(other.ops); |
| 11761 |
var ops = []; |
| 11762 |
var firstOther = otherIter.peek(); |
| 11763 |
if (firstOther != null && typeof firstOther.retain === 'number' && firstOther.attributes == null) { |
| 11764 |
var firstLeft = firstOther.retain; |
| 11765 |
while (thisIter.peekType() === 'insert' && thisIter.peekLength() <= firstLeft) { |
| 11766 |
firstLeft -= thisIter.peekLength(); |
| 11767 |
ops.push(thisIter.next()); |
| 11768 |
} |
| 11769 |
if (firstOther.retain - firstLeft > 0) { |
| 11770 |
otherIter.next(firstOther.retain - firstLeft); |
| 11771 |
} |
| 11772 |
} |
| 11773 |
var delta = new Delta(ops); |
| 11774 |
while (thisIter.hasNext() || otherIter.hasNext()) { |
| 11775 |
if (otherIter.peekType() === 'insert') { |
| 11776 |
delta.push(otherIter.next()); |
| 11777 |
} else if (thisIter.peekType() === 'delete') { |
| 11778 |
delta.push(thisIter.next()); |
| 11779 |
} else { |
| 11780 |
var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); |
| 11781 |
var thisOp = thisIter.next(length); |
| 11782 |
var otherOp = otherIter.next(length); |
| 11783 |
if (typeof otherOp.retain === 'number') { |
| 11784 |
var newOp = {}; |
| 11785 |
if (typeof thisOp.retain === 'number') { |
| 11786 |
newOp.retain = length; |
| 11787 |
} else { |
| 11788 |
newOp.insert = thisOp.insert; |
| 11789 |
} |
| 11790 |
// Preserve null when composing with a retain, otherwise remove it for inserts |
| 11791 |
var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); |
| 11792 |
if (attributes) newOp.attributes = attributes; |
| 11793 |
delta.push(newOp); |
| 11794 |
|
| 11795 |
// Optimization if rest of other is just retain |
| 11796 |
if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) { |
| 11797 |
var rest = new Delta(thisIter.rest()); |
| 11798 |
return delta.concat(rest).chop(); |
| 11799 |
} |
| 11800 |
|
| 11801 |
// Other op should be delete, we could be an insert or retain |
| 11802 |
// Insert + delete cancels out |
| 11803 |
} else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { |
| 11804 |
delta.push(otherOp); |
| 11805 |
} |
| 11806 |
} |
| 11807 |
} |
| 11808 |
return delta.chop(); |
| 11809 |
}; |
| 11810 |
|
| 11811 |
Delta.prototype.concat = function (other) { |
| 11812 |
var delta = new Delta(this.ops.slice()); |
| 11813 |
if (other.ops.length > 0) { |
| 11814 |
delta.push(other.ops[0]); |
| 11815 |
delta.ops = delta.ops.concat(other.ops.slice(1)); |
| 11816 |
} |
| 11817 |
return delta; |
| 11818 |
}; |
| 11819 |
|
| 11820 |
Delta.prototype.diff = function (other, index) { |
| 11821 |
if (this.ops === other.ops) { |
| 11822 |
return new Delta(); |
| 11823 |
} |
| 11824 |
var strings = [this, other].map(function (delta) { |
| 11825 |
return delta.map(function (op) { |
| 11826 |
if (op.insert != null) { |
| 11827 |
return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; |
| 11828 |
} |
| 11829 |
var prep = (delta === other) ? 'on' : 'with'; |
| 11830 |
throw new Error('diff() called ' + prep + ' non-document'); |
| 11831 |
}).join(''); |
| 11832 |
}); |
| 11833 |
var delta = new Delta(); |
| 11834 |
var diffResult = diff(strings[0], strings[1], index); |
| 11835 |
var thisIter = op.iterator(this.ops); |
| 11836 |
var otherIter = op.iterator(other.ops); |
| 11837 |
diffResult.forEach(function (component) { |
| 11838 |
var length = component[1].length; |
| 11839 |
while (length > 0) { |
| 11840 |
var opLength = 0; |
| 11841 |
switch (component[0]) { |
| 11842 |
case diff.INSERT: |
| 11843 |
opLength = Math.min(otherIter.peekLength(), length); |
| 11844 |
delta.push(otherIter.next(opLength)); |
| 11845 |
break; |
| 11846 |
case diff.DELETE: |
| 11847 |
opLength = Math.min(length, thisIter.peekLength()); |
| 11848 |
thisIter.next(opLength); |
| 11849 |
delta['delete'](opLength); |
| 11850 |
break; |
| 11851 |
case diff.EQUAL: |
| 11852 |
opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); |
| 11853 |
var thisOp = thisIter.next(opLength); |
| 11854 |
var otherOp = otherIter.next(opLength); |
| 11855 |
if (equal(thisOp.insert, otherOp.insert)) { |
| 11856 |
delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); |
| 11857 |
} else { |
| 11858 |
delta.push(otherOp)['delete'](opLength); |
| 11859 |
} |
| 11860 |
break; |
| 11861 |
} |
| 11862 |
length -= opLength; |
| 11863 |
} |
| 11864 |
}); |
| 11865 |
return delta.chop(); |
| 11866 |
}; |
| 11867 |
|
| 11868 |
Delta.prototype.eachLine = function (predicate, newline) { |
| 11869 |
newline = newline || '\n'; |
| 11870 |
var iter = op.iterator(this.ops); |
| 11871 |
var line = new Delta(); |
| 11872 |
var i = 0; |
| 11873 |
while (iter.hasNext()) { |
| 11874 |
if (iter.peekType() !== 'insert') return; |
| 11875 |
var thisOp = iter.peek(); |
| 11876 |
var start = op.length(thisOp) - iter.peekLength(); |
| 11877 |
var index = typeof thisOp.insert === 'string' ? |
| 11878 |
thisOp.insert.indexOf(newline, start) - start : -1; |
| 11879 |
if (index < 0) { |
| 11880 |
line.push(iter.next()); |
| 11881 |
} else if (index > 0) { |
| 11882 |
line.push(iter.next(index)); |
| 11883 |
} else { |
| 11884 |
if (predicate(line, iter.next(1).attributes || {}, i) === false) { |
| 11885 |
return; |
| 11886 |
} |
| 11887 |
i += 1; |
| 11888 |
line = new Delta(); |
| 11889 |
} |
| 11890 |
} |
| 11891 |
if (line.length() > 0) { |
| 11892 |
predicate(line, {}, i); |
| 11893 |
} |
| 11894 |
}; |
| 11895 |
|
| 11896 |
Delta.prototype.transform = function (other, priority) { |
| 11897 |
priority = !!priority; |
| 11898 |
if (typeof other === 'number') { |
| 11899 |
return this.transformPosition(other, priority); |
| 11900 |
} |
| 11901 |
var thisIter = op.iterator(this.ops); |
| 11902 |
var otherIter = op.iterator(other.ops); |
| 11903 |
var delta = new Delta(); |
| 11904 |
while (thisIter.hasNext() || otherIter.hasNext()) { |
| 11905 |
if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { |
| 11906 |
delta.retain(op.length(thisIter.next())); |
| 11907 |
} else if (otherIter.peekType() === 'insert') { |
| 11908 |
delta.push(otherIter.next()); |
| 11909 |
} else { |
| 11910 |
var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); |
| 11911 |
var thisOp = thisIter.next(length); |
| 11912 |
var otherOp = otherIter.next(length); |
| 11913 |
if (thisOp['delete']) { |
| 11914 |
// Our delete either makes their delete redundant or removes their retain |
| 11915 |
continue; |
| 11916 |
} else if (otherOp['delete']) { |
| 11917 |
delta.push(otherOp); |
| 11918 |
} else { |
| 11919 |
// We retain either their retain or insert |
| 11920 |
delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); |
| 11921 |
} |
| 11922 |
} |
| 11923 |
} |
| 11924 |
return delta.chop(); |
| 11925 |
}; |
| 11926 |
|
| 11927 |
Delta.prototype.transformPosition = function (index, priority) { |
| 11928 |
priority = !!priority; |
| 11929 |
var thisIter = op.iterator(this.ops); |
| 11930 |
var offset = 0; |
| 11931 |
while (thisIter.hasNext() && offset <= index) { |
| 11932 |
var length = thisIter.peekLength(); |
| 11933 |
var nextType = thisIter.peekType(); |
| 11934 |
thisIter.next(); |
| 11935 |
if (nextType === 'delete') { |
| 11936 |
index -= Math.min(length, index - offset); |
| 11937 |
continue; |
| 11938 |
} else if (nextType === 'insert' && (offset < index || !priority)) { |
| 11939 |
index += length; |
| 11940 |
} |
| 11941 |
offset += length; |
| 11942 |
} |
| 11943 |
return index; |
| 11944 |
}; |
| 11945 |
|
| 11946 |
|
| 11947 |
module.exports = Delta; |
| 11948 |
|
| 11949 |
|
| 11950 |
/***/ }), |
| 11951 |
/* 3 */ |
| 11952 |
/***/ (function(module, exports) { |
| 11953 |
|
| 11954 |
'use strict'; |
| 11955 |
|
| 11956 |
var hasOwn = Object.prototype.hasOwnProperty; |
| 11957 |
var toStr = Object.prototype.toString; |
| 11958 |
var defineProperty = Object.defineProperty; |
| 11959 |
var gOPD = Object.getOwnPropertyDescriptor; |
| 11960 |
|
| 11961 |
var isArray = function isArray(arr) { |
| 11962 |
if (typeof Array.isArray === 'function') { |
| 11963 |
return Array.isArray(arr); |
| 11964 |
} |
| 11965 |
|
| 11966 |
return toStr.call(arr) === '[object Array]'; |
| 11967 |
}; |
| 11968 |
|
| 11969 |
var isPlainObject = function isPlainObject(obj) { |
| 11970 |
if (!obj || toStr.call(obj) !== '[object Object]') { |
| 11971 |
return false; |
| 11972 |
} |
| 11973 |
|
| 11974 |
var hasOwnConstructor = hasOwn.call(obj, 'constructor'); |
| 11975 |
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); |
| 11976 |
// Not own constructor property must be Object |
| 11977 |
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { |
| 11978 |
return false; |
| 11979 |
} |
| 11980 |
|
| 11981 |
// Own properties are enumerated firstly, so to speed up, |
| 11982 |
// if last one is own, then all properties are own. |
| 11983 |
var key; |
| 11984 |
for (key in obj) { /**/ } |
| 11985 |
|
| 11986 |
return typeof key === 'undefined' || hasOwn.call(obj, key); |
| 11987 |
}; |
| 11988 |
|
| 11989 |
// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target |
| 11990 |
var setProperty = function setProperty(target, options) { |
| 11991 |
if (defineProperty && options.name === '__proto__') { |
| 11992 |
defineProperty(target, options.name, { |
| 11993 |
enumerable: true, |
| 11994 |
configurable: true, |
| 11995 |
value: options.newValue, |
| 11996 |
writable: true |
| 11997 |
}); |
| 11998 |
} else { |
| 11999 |
target[options.name] = options.newValue; |
| 12000 |
} |
| 12001 |
}; |
| 12002 |
|
| 12003 |
// Return undefined instead of __proto__ if '__proto__' is not an own property |
| 12004 |
var getProperty = function getProperty(obj, name) { |
| 12005 |
if (name === '__proto__') { |
| 12006 |
if (!hasOwn.call(obj, name)) { |
| 12007 |
return void 0; |
| 12008 |
} else if (gOPD) { |
| 12009 |
// In early versions of node, obj['__proto__'] is buggy when obj has |
| 12010 |
// __proto__ as an own property. Object.getOwnPropertyDescriptor() works. |
| 12011 |
return gOPD(obj, name).value; |
| 12012 |
} |
| 12013 |
} |
| 12014 |
|
| 12015 |
return obj[name]; |
| 12016 |
}; |
| 12017 |
|
| 12018 |
module.exports = function extend() { |
| 12019 |
var options, name, src, copy, copyIsArray, clone; |
| 12020 |
var target = arguments[0]; |
| 12021 |
var i = 1; |
| 12022 |
var length = arguments.length; |
| 12023 |
var deep = false; |
| 12024 |
|
| 12025 |
// Handle a deep copy situation |
| 12026 |
if (typeof target === 'boolean') { |
| 12027 |
deep = target; |
| 12028 |
target = arguments[1] || {}; |
| 12029 |
// skip the boolean and the target |
| 12030 |
i = 2; |
| 12031 |
} |
| 12032 |
if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { |
| 12033 |
target = {}; |
| 12034 |
} |
| 12035 |
|
| 12036 |
for (; i < length; ++i) { |
| 12037 |
options = arguments[i]; |
| 12038 |
// Only deal with non-null/undefined values |
| 12039 |
if (options != null) { |
| 12040 |
// Extend the base object |
| 12041 |
for (name in options) { |
| 12042 |
src = getProperty(target, name); |
| 12043 |
copy = getProperty(options, name); |
| 12044 |
|
| 12045 |
// Prevent never-ending loop |
| 12046 |
if (target !== copy) { |
| 12047 |
// Recurse if we're merging plain objects or arrays |
| 12048 |
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { |
| 12049 |
if (copyIsArray) { |
| 12050 |
copyIsArray = false; |
| 12051 |
clone = src && isArray(src) ? src : []; |
| 12052 |
} else { |
| 12053 |
clone = src && isPlainObject(src) ? src : {}; |
| 12054 |
} |
| 12055 |
|
| 12056 |
// Never move original objects, clone them |
| 12057 |
setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); |
| 12058 |
|
| 12059 |
// Don't bring in undefined values |
| 12060 |
} else if (typeof copy !== 'undefined') { |
| 12061 |
setProperty(target, { name: name, newValue: copy }); |
| 12062 |
} |
| 12063 |
} |
| 12064 |
} |
| 12065 |
} |
| 12066 |
} |
| 12067 |
|
| 12068 |
// Return the modified object |
| 12069 |
return target; |
| 12070 |
}; |
| 12071 |
|
| 12072 |
|
| 12073 |
/***/ }), |
| 12074 |
/* 4 */ |
| 12075 |
/***/ (function(module, exports, __nested_webpack_require_23616__) { |
| 12076 |
|
| 12077 |
"use strict"; |
| 12078 |
|
| 12079 |
|
| 12080 |
Object.defineProperty(exports, "__esModule", { |
| 12081 |
value: true |
| 12082 |
}); |
| 12083 |
exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; |
| 12084 |
|
| 12085 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 12086 |
|
| 12087 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 12088 |
|
| 12089 |
var _extend = __nested_webpack_require_23616__(3); |
| 12090 |
|
| 12091 |
var _extend2 = _interopRequireDefault(_extend); |
| 12092 |
|
| 12093 |
var _quillDelta = __nested_webpack_require_23616__(2); |
| 12094 |
|
| 12095 |
var _quillDelta2 = _interopRequireDefault(_quillDelta); |
| 12096 |
|
| 12097 |
var _parchment = __nested_webpack_require_23616__(0); |
| 12098 |
|
| 12099 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 12100 |
|
| 12101 |
var _break = __nested_webpack_require_23616__(16); |
| 12102 |
|
| 12103 |
var _break2 = _interopRequireDefault(_break); |
| 12104 |
|
| 12105 |
var _inline = __nested_webpack_require_23616__(6); |
| 12106 |
|
| 12107 |
var _inline2 = _interopRequireDefault(_inline); |
| 12108 |
|
| 12109 |
var _text = __nested_webpack_require_23616__(7); |
| 12110 |
|
| 12111 |
var _text2 = _interopRequireDefault(_text); |
| 12112 |
|
| 12113 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 12114 |
|
| 12115 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 12116 |
|
| 12117 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 12118 |
|
| 12119 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 12120 |
|
| 12121 |
var NEWLINE_LENGTH = 1; |
| 12122 |
|
| 12123 |
var BlockEmbed = function (_Parchment$Embed) { |
| 12124 |
_inherits(BlockEmbed, _Parchment$Embed); |
| 12125 |
|
| 12126 |
function BlockEmbed() { |
| 12127 |
_classCallCheck(this, BlockEmbed); |
| 12128 |
|
| 12129 |
return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); |
| 12130 |
} |
| 12131 |
|
| 12132 |
_createClass(BlockEmbed, [{ |
| 12133 |
key: 'attach', |
| 12134 |
value: function attach() { |
| 12135 |
_get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); |
| 12136 |
this.attributes = new _parchment2.default.Attributor.Store(this.domNode); |
| 12137 |
} |
| 12138 |
}, { |
| 12139 |
key: 'delta', |
| 12140 |
value: function delta() { |
| 12141 |
return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); |
| 12142 |
} |
| 12143 |
}, { |
| 12144 |
key: 'format', |
| 12145 |
value: function format(name, value) { |
| 12146 |
var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); |
| 12147 |
if (attribute != null) { |
| 12148 |
this.attributes.attribute(attribute, value); |
| 12149 |
} |
| 12150 |
} |
| 12151 |
}, { |
| 12152 |
key: 'formatAt', |
| 12153 |
value: function formatAt(index, length, name, value) { |
| 12154 |
this.format(name, value); |
| 12155 |
} |
| 12156 |
}, { |
| 12157 |
key: 'insertAt', |
| 12158 |
value: function insertAt(index, value, def) { |
| 12159 |
if (typeof value === 'string' && value.endsWith('\n')) { |
| 12160 |
var block = _parchment2.default.create(Block.blotName); |
| 12161 |
this.parent.insertBefore(block, index === 0 ? this : this.next); |
| 12162 |
block.insertAt(0, value.slice(0, -1)); |
| 12163 |
} else { |
| 12164 |
_get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); |
| 12165 |
} |
| 12166 |
} |
| 12167 |
}]); |
| 12168 |
|
| 12169 |
return BlockEmbed; |
| 12170 |
}(_parchment2.default.Embed); |
| 12171 |
|
| 12172 |
BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; |
| 12173 |
// It is important for cursor behavior BlockEmbeds use tags that are block level elements |
| 12174 |
|
| 12175 |
|
| 12176 |
var Block = function (_Parchment$Block) { |
| 12177 |
_inherits(Block, _Parchment$Block); |
| 12178 |
|
| 12179 |
function Block(domNode) { |
| 12180 |
_classCallCheck(this, Block); |
| 12181 |
|
| 12182 |
var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); |
| 12183 |
|
| 12184 |
_this2.cache = {}; |
| 12185 |
return _this2; |
| 12186 |
} |
| 12187 |
|
| 12188 |
_createClass(Block, [{ |
| 12189 |
key: 'delta', |
| 12190 |
value: function delta() { |
| 12191 |
if (this.cache.delta == null) { |
| 12192 |
this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { |
| 12193 |
if (leaf.length() === 0) { |
| 12194 |
return delta; |
| 12195 |
} else { |
| 12196 |
return delta.insert(leaf.value(), bubbleFormats(leaf)); |
| 12197 |
} |
| 12198 |
}, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); |
| 12199 |
} |
| 12200 |
return this.cache.delta; |
| 12201 |
} |
| 12202 |
}, { |
| 12203 |
key: 'deleteAt', |
| 12204 |
value: function deleteAt(index, length) { |
| 12205 |
_get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); |
| 12206 |
this.cache = {}; |
| 12207 |
} |
| 12208 |
}, { |
| 12209 |
key: 'formatAt', |
| 12210 |
value: function formatAt(index, length, name, value) { |
| 12211 |
if (length <= 0) return; |
| 12212 |
if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { |
| 12213 |
if (index + length === this.length()) { |
| 12214 |
this.format(name, value); |
| 12215 |
} |
| 12216 |
} else { |
| 12217 |
_get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); |
| 12218 |
} |
| 12219 |
this.cache = {}; |
| 12220 |
} |
| 12221 |
}, { |
| 12222 |
key: 'insertAt', |
| 12223 |
value: function insertAt(index, value, def) { |
| 12224 |
if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); |
| 12225 |
if (value.length === 0) return; |
| 12226 |
var lines = value.split('\n'); |
| 12227 |
var text = lines.shift(); |
| 12228 |
if (text.length > 0) { |
| 12229 |
if (index < this.length() - 1 || this.children.tail == null) { |
| 12230 |
_get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); |
| 12231 |
} else { |
| 12232 |
this.children.tail.insertAt(this.children.tail.length(), text); |
| 12233 |
} |
| 12234 |
this.cache = {}; |
| 12235 |
} |
| 12236 |
var block = this; |
| 12237 |
lines.reduce(function (index, line) { |
| 12238 |
block = block.split(index, true); |
| 12239 |
block.insertAt(0, line); |
| 12240 |
return line.length; |
| 12241 |
}, index + text.length); |
| 12242 |
} |
| 12243 |
}, { |
| 12244 |
key: 'insertBefore', |
| 12245 |
value: function insertBefore(blot, ref) { |
| 12246 |
var head = this.children.head; |
| 12247 |
_get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); |
| 12248 |
if (head instanceof _break2.default) { |
| 12249 |
head.remove(); |
| 12250 |
} |
| 12251 |
this.cache = {}; |
| 12252 |
} |
| 12253 |
}, { |
| 12254 |
key: 'length', |
| 12255 |
value: function length() { |
| 12256 |
if (this.cache.length == null) { |
| 12257 |
this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; |
| 12258 |
} |
| 12259 |
return this.cache.length; |
| 12260 |
} |
| 12261 |
}, { |
| 12262 |
key: 'moveChildren', |
| 12263 |
value: function moveChildren(target, ref) { |
| 12264 |
_get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); |
| 12265 |
this.cache = {}; |
| 12266 |
} |
| 12267 |
}, { |
| 12268 |
key: 'optimize', |
| 12269 |
value: function optimize(context) { |
| 12270 |
_get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); |
| 12271 |
this.cache = {}; |
| 12272 |
} |
| 12273 |
}, { |
| 12274 |
key: 'path', |
| 12275 |
value: function path(index) { |
| 12276 |
return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); |
| 12277 |
} |
| 12278 |
}, { |
| 12279 |
key: 'removeChild', |
| 12280 |
value: function removeChild(child) { |
| 12281 |
_get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); |
| 12282 |
this.cache = {}; |
| 12283 |
} |
| 12284 |
}, { |
| 12285 |
key: 'split', |
| 12286 |
value: function split(index) { |
| 12287 |
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; |
| 12288 |
|
| 12289 |
if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { |
| 12290 |
var clone = this.clone(); |
| 12291 |
if (index === 0) { |
| 12292 |
this.parent.insertBefore(clone, this); |
| 12293 |
return this; |
| 12294 |
} else { |
| 12295 |
this.parent.insertBefore(clone, this.next); |
| 12296 |
return clone; |
| 12297 |
} |
| 12298 |
} else { |
| 12299 |
var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); |
| 12300 |
this.cache = {}; |
| 12301 |
return next; |
| 12302 |
} |
| 12303 |
} |
| 12304 |
}]); |
| 12305 |
|
| 12306 |
return Block; |
| 12307 |
}(_parchment2.default.Block); |
| 12308 |
|
| 12309 |
Block.blotName = 'block'; |
| 12310 |
Block.tagName = 'P'; |
| 12311 |
Block.defaultChild = 'break'; |
| 12312 |
Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; |
| 12313 |
|
| 12314 |
function bubbleFormats(blot) { |
| 12315 |
var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 12316 |
|
| 12317 |
if (blot == null) return formats; |
| 12318 |
if (typeof blot.formats === 'function') { |
| 12319 |
formats = (0, _extend2.default)(formats, blot.formats()); |
| 12320 |
} |
| 12321 |
if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { |
| 12322 |
return formats; |
| 12323 |
} |
| 12324 |
return bubbleFormats(blot.parent, formats); |
| 12325 |
} |
| 12326 |
|
| 12327 |
exports.bubbleFormats = bubbleFormats; |
| 12328 |
exports.BlockEmbed = BlockEmbed; |
| 12329 |
exports.default = Block; |
| 12330 |
|
| 12331 |
/***/ }), |
| 12332 |
/* 5 */ |
| 12333 |
/***/ (function(module, exports, __nested_webpack_require_33760__) { |
| 12334 |
|
| 12335 |
"use strict"; |
| 12336 |
|
| 12337 |
|
| 12338 |
Object.defineProperty(exports, "__esModule", { |
| 12339 |
value: true |
| 12340 |
}); |
| 12341 |
exports.default = exports.overload = exports.expandConfig = undefined; |
| 12342 |
|
| 12343 |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
| 12344 |
|
| 12345 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 12346 |
|
| 12347 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 12348 |
|
| 12349 |
__nested_webpack_require_33760__(50); |
| 12350 |
|
| 12351 |
var _quillDelta = __nested_webpack_require_33760__(2); |
| 12352 |
|
| 12353 |
var _quillDelta2 = _interopRequireDefault(_quillDelta); |
| 12354 |
|
| 12355 |
var _editor = __nested_webpack_require_33760__(14); |
| 12356 |
|
| 12357 |
var _editor2 = _interopRequireDefault(_editor); |
| 12358 |
|
| 12359 |
var _emitter3 = __nested_webpack_require_33760__(8); |
| 12360 |
|
| 12361 |
var _emitter4 = _interopRequireDefault(_emitter3); |
| 12362 |
|
| 12363 |
var _module = __nested_webpack_require_33760__(9); |
| 12364 |
|
| 12365 |
var _module2 = _interopRequireDefault(_module); |
| 12366 |
|
| 12367 |
var _parchment = __nested_webpack_require_33760__(0); |
| 12368 |
|
| 12369 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 12370 |
|
| 12371 |
var _selection = __nested_webpack_require_33760__(15); |
| 12372 |
|
| 12373 |
var _selection2 = _interopRequireDefault(_selection); |
| 12374 |
|
| 12375 |
var _extend = __nested_webpack_require_33760__(3); |
| 12376 |
|
| 12377 |
var _extend2 = _interopRequireDefault(_extend); |
| 12378 |
|
| 12379 |
var _logger = __nested_webpack_require_33760__(10); |
| 12380 |
|
| 12381 |
var _logger2 = _interopRequireDefault(_logger); |
| 12382 |
|
| 12383 |
var _theme = __nested_webpack_require_33760__(34); |
| 12384 |
|
| 12385 |
var _theme2 = _interopRequireDefault(_theme); |
| 12386 |
|
| 12387 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 12388 |
|
| 12389 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 12390 |
|
| 12391 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 12392 |
|
| 12393 |
var debug = (0, _logger2.default)('quill'); |
| 12394 |
|
| 12395 |
var Quill = function () { |
| 12396 |
_createClass(Quill, null, [{ |
| 12397 |
key: 'debug', |
| 12398 |
value: function debug(limit) { |
| 12399 |
if (limit === true) { |
| 12400 |
limit = 'log'; |
| 12401 |
} |
| 12402 |
_logger2.default.level(limit); |
| 12403 |
} |
| 12404 |
}, { |
| 12405 |
key: 'find', |
| 12406 |
value: function find(node) { |
| 12407 |
return node.__quill || _parchment2.default.find(node); |
| 12408 |
} |
| 12409 |
}, { |
| 12410 |
key: 'import', |
| 12411 |
value: function _import(name) { |
| 12412 |
if (this.imports[name] == null) { |
| 12413 |
debug.error('Cannot import ' + name + '. Are you sure it was registered?'); |
| 12414 |
} |
| 12415 |
return this.imports[name]; |
| 12416 |
} |
| 12417 |
}, { |
| 12418 |
key: 'register', |
| 12419 |
value: function register(path, target) { |
| 12420 |
var _this = this; |
| 12421 |
|
| 12422 |
var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; |
| 12423 |
|
| 12424 |
if (typeof path !== 'string') { |
| 12425 |
var name = path.attrName || path.blotName; |
| 12426 |
if (typeof name === 'string') { |
| 12427 |
// register(Blot | Attributor, overwrite) |
| 12428 |
this.register('formats/' + name, path, target); |
| 12429 |
} else { |
| 12430 |
Object.keys(path).forEach(function (key) { |
| 12431 |
_this.register(key, path[key], target); |
| 12432 |
}); |
| 12433 |
} |
| 12434 |
} else { |
| 12435 |
if (this.imports[path] != null && !overwrite) { |
| 12436 |
debug.warn('Overwriting ' + path + ' with', target); |
| 12437 |
} |
| 12438 |
this.imports[path] = target; |
| 12439 |
if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { |
| 12440 |
_parchment2.default.register(target); |
| 12441 |
} else if (path.startsWith('modules') && typeof target.register === 'function') { |
| 12442 |
target.register(); |
| 12443 |
} |
| 12444 |
} |
| 12445 |
} |
| 12446 |
}]); |
| 12447 |
|
| 12448 |
function Quill(container) { |
| 12449 |
var _this2 = this; |
| 12450 |
|
| 12451 |
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 12452 |
|
| 12453 |
_classCallCheck(this, Quill); |
| 12454 |
|
| 12455 |
this.options = expandConfig(container, options); |
| 12456 |
this.container = this.options.container; |
| 12457 |
if (this.container == null) { |
| 12458 |
return debug.error('Invalid Quill container', container); |
| 12459 |
} |
| 12460 |
if (this.options.debug) { |
| 12461 |
Quill.debug(this.options.debug); |
| 12462 |
} |
| 12463 |
var html = this.container.innerHTML.trim(); |
| 12464 |
this.container.classList.add('ql-container'); |
| 12465 |
this.container.innerHTML = ''; |
| 12466 |
this.container.__quill = this; |
| 12467 |
this.root = this.addContainer('ql-editor'); |
| 12468 |
this.root.classList.add('ql-blank'); |
| 12469 |
this.root.setAttribute('data-gramm', false); |
| 12470 |
this.scrollingContainer = this.options.scrollingContainer || this.root; |
| 12471 |
this.emitter = new _emitter4.default(); |
| 12472 |
this.scroll = _parchment2.default.create(this.root, { |
| 12473 |
emitter: this.emitter, |
| 12474 |
whitelist: this.options.formats |
| 12475 |
}); |
| 12476 |
this.editor = new _editor2.default(this.scroll); |
| 12477 |
this.selection = new _selection2.default(this.scroll, this.emitter); |
| 12478 |
this.theme = new this.options.theme(this, this.options); |
| 12479 |
this.keyboard = this.theme.addModule('keyboard'); |
| 12480 |
this.clipboard = this.theme.addModule('clipboard'); |
| 12481 |
this.history = this.theme.addModule('history'); |
| 12482 |
this.theme.init(); |
| 12483 |
this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { |
| 12484 |
if (type === _emitter4.default.events.TEXT_CHANGE) { |
| 12485 |
_this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); |
| 12486 |
} |
| 12487 |
}); |
| 12488 |
this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { |
| 12489 |
var range = _this2.selection.lastRange; |
| 12490 |
var index = range && range.length === 0 ? range.index : undefined; |
| 12491 |
modify.call(_this2, function () { |
| 12492 |
return _this2.editor.update(null, mutations, index); |
| 12493 |
}, source); |
| 12494 |
}); |
| 12495 |
var contents = this.clipboard.convert('<div class=\'ql-editor\' style="white-space: normal;">' + html + '<p><br></p></div>'); |
| 12496 |
this.setContents(contents); |
| 12497 |
this.history.clear(); |
| 12498 |
if (this.options.placeholder) { |
| 12499 |
this.root.setAttribute('data-placeholder', this.options.placeholder); |
| 12500 |
} |
| 12501 |
if (this.options.readOnly) { |
| 12502 |
this.disable(); |
| 12503 |
} |
| 12504 |
} |
| 12505 |
|
| 12506 |
_createClass(Quill, [{ |
| 12507 |
key: 'addContainer', |
| 12508 |
value: function addContainer(container) { |
| 12509 |
var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; |
| 12510 |
|
| 12511 |
if (typeof container === 'string') { |
| 12512 |
var className = container; |
| 12513 |
container = document.createElement('div'); |
| 12514 |
container.classList.add(className); |
| 12515 |
} |
| 12516 |
this.container.insertBefore(container, refNode); |
| 12517 |
return container; |
| 12518 |
} |
| 12519 |
}, { |
| 12520 |
key: 'blur', |
| 12521 |
value: function blur() { |
| 12522 |
this.selection.setRange(null); |
| 12523 |
} |
| 12524 |
}, { |
| 12525 |
key: 'deleteText', |
| 12526 |
value: function deleteText(index, length, source) { |
| 12527 |
var _this3 = this; |
| 12528 |
|
| 12529 |
var _overload = overload(index, length, source); |
| 12530 |
|
| 12531 |
var _overload2 = _slicedToArray(_overload, 4); |
| 12532 |
|
| 12533 |
index = _overload2[0]; |
| 12534 |
length = _overload2[1]; |
| 12535 |
source = _overload2[3]; |
| 12536 |
|
| 12537 |
return modify.call(this, function () { |
| 12538 |
return _this3.editor.deleteText(index, length); |
| 12539 |
}, source, index, -1 * length); |
| 12540 |
} |
| 12541 |
}, { |
| 12542 |
key: 'disable', |
| 12543 |
value: function disable() { |
| 12544 |
this.enable(false); |
| 12545 |
} |
| 12546 |
}, { |
| 12547 |
key: 'enable', |
| 12548 |
value: function enable() { |
| 12549 |
var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; |
| 12550 |
|
| 12551 |
this.scroll.enable(enabled); |
| 12552 |
this.container.classList.toggle('ql-disabled', !enabled); |
| 12553 |
} |
| 12554 |
}, { |
| 12555 |
key: 'focus', |
| 12556 |
value: function focus() { |
| 12557 |
var scrollTop = this.scrollingContainer.scrollTop; |
| 12558 |
this.selection.focus(); |
| 12559 |
this.scrollingContainer.scrollTop = scrollTop; |
| 12560 |
this.scrollIntoView(); |
| 12561 |
} |
| 12562 |
}, { |
| 12563 |
key: 'format', |
| 12564 |
value: function format(name, value) { |
| 12565 |
var _this4 = this; |
| 12566 |
|
| 12567 |
var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; |
| 12568 |
|
| 12569 |
return modify.call(this, function () { |
| 12570 |
var range = _this4.getSelection(true); |
| 12571 |
var change = new _quillDelta2.default(); |
| 12572 |
if (range == null) { |
| 12573 |
return change; |
| 12574 |
} else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { |
| 12575 |
change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); |
| 12576 |
} else if (range.length === 0) { |
| 12577 |
_this4.selection.format(name, value); |
| 12578 |
return change; |
| 12579 |
} else { |
| 12580 |
change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); |
| 12581 |
} |
| 12582 |
_this4.setSelection(range, _emitter4.default.sources.SILENT); |
| 12583 |
return change; |
| 12584 |
}, source); |
| 12585 |
} |
| 12586 |
}, { |
| 12587 |
key: 'formatLine', |
| 12588 |
value: function formatLine(index, length, name, value, source) { |
| 12589 |
var _this5 = this; |
| 12590 |
|
| 12591 |
var formats = void 0; |
| 12592 |
|
| 12593 |
var _overload3 = overload(index, length, name, value, source); |
| 12594 |
|
| 12595 |
var _overload4 = _slicedToArray(_overload3, 4); |
| 12596 |
|
| 12597 |
index = _overload4[0]; |
| 12598 |
length = _overload4[1]; |
| 12599 |
formats = _overload4[2]; |
| 12600 |
source = _overload4[3]; |
| 12601 |
|
| 12602 |
return modify.call(this, function () { |
| 12603 |
return _this5.editor.formatLine(index, length, formats); |
| 12604 |
}, source, index, 0); |
| 12605 |
} |
| 12606 |
}, { |
| 12607 |
key: 'formatText', |
| 12608 |
value: function formatText(index, length, name, value, source) { |
| 12609 |
var _this6 = this; |
| 12610 |
|
| 12611 |
var formats = void 0; |
| 12612 |
|
| 12613 |
var _overload5 = overload(index, length, name, value, source); |
| 12614 |
|
| 12615 |
var _overload6 = _slicedToArray(_overload5, 4); |
| 12616 |
|
| 12617 |
index = _overload6[0]; |
| 12618 |
length = _overload6[1]; |
| 12619 |
formats = _overload6[2]; |
| 12620 |
source = _overload6[3]; |
| 12621 |
|
| 12622 |
return modify.call(this, function () { |
| 12623 |
return _this6.editor.formatText(index, length, formats); |
| 12624 |
}, source, index, 0); |
| 12625 |
} |
| 12626 |
}, { |
| 12627 |
key: 'getBounds', |
| 12628 |
value: function getBounds(index) { |
| 12629 |
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; |
| 12630 |
|
| 12631 |
var bounds = void 0; |
| 12632 |
if (typeof index === 'number') { |
| 12633 |
bounds = this.selection.getBounds(index, length); |
| 12634 |
} else { |
| 12635 |
bounds = this.selection.getBounds(index.index, index.length); |
| 12636 |
} |
| 12637 |
var containerBounds = this.container.getBoundingClientRect(); |
| 12638 |
return { |
| 12639 |
bottom: bounds.bottom - containerBounds.top, |
| 12640 |
height: bounds.height, |
| 12641 |
left: bounds.left - containerBounds.left, |
| 12642 |
right: bounds.right - containerBounds.left, |
| 12643 |
top: bounds.top - containerBounds.top, |
| 12644 |
width: bounds.width |
| 12645 |
}; |
| 12646 |
} |
| 12647 |
}, { |
| 12648 |
key: 'getContents', |
| 12649 |
value: function getContents() { |
| 12650 |
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; |
| 12651 |
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; |
| 12652 |
|
| 12653 |
var _overload7 = overload(index, length); |
| 12654 |
|
| 12655 |
var _overload8 = _slicedToArray(_overload7, 2); |
| 12656 |
|
| 12657 |
index = _overload8[0]; |
| 12658 |
length = _overload8[1]; |
| 12659 |
|
| 12660 |
return this.editor.getContents(index, length); |
| 12661 |
} |
| 12662 |
}, { |
| 12663 |
key: 'getFormat', |
| 12664 |
value: function getFormat() { |
| 12665 |
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); |
| 12666 |
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; |
| 12667 |
|
| 12668 |
if (typeof index === 'number') { |
| 12669 |
return this.editor.getFormat(index, length); |
| 12670 |
} else { |
| 12671 |
return this.editor.getFormat(index.index, index.length); |
| 12672 |
} |
| 12673 |
} |
| 12674 |
}, { |
| 12675 |
key: 'getIndex', |
| 12676 |
value: function getIndex(blot) { |
| 12677 |
return blot.offset(this.scroll); |
| 12678 |
} |
| 12679 |
}, { |
| 12680 |
key: 'getLength', |
| 12681 |
value: function getLength() { |
| 12682 |
return this.scroll.length(); |
| 12683 |
} |
| 12684 |
}, { |
| 12685 |
key: 'getLeaf', |
| 12686 |
value: function getLeaf(index) { |
| 12687 |
return this.scroll.leaf(index); |
| 12688 |
} |
| 12689 |
}, { |
| 12690 |
key: 'getLine', |
| 12691 |
value: function getLine(index) { |
| 12692 |
return this.scroll.line(index); |
| 12693 |
} |
| 12694 |
}, { |
| 12695 |
key: 'getLines', |
| 12696 |
value: function getLines() { |
| 12697 |
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; |
| 12698 |
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; |
| 12699 |
|
| 12700 |
if (typeof index !== 'number') { |
| 12701 |
return this.scroll.lines(index.index, index.length); |
| 12702 |
} else { |
| 12703 |
return this.scroll.lines(index, length); |
| 12704 |
} |
| 12705 |
} |
| 12706 |
}, { |
| 12707 |
key: 'getModule', |
| 12708 |
value: function getModule(name) { |
| 12709 |
return this.theme.modules[name]; |
| 12710 |
} |
| 12711 |
}, { |
| 12712 |
key: 'getSelection', |
| 12713 |
value: function getSelection() { |
| 12714 |
var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; |
| 12715 |
|
| 12716 |
if (focus) this.focus(); |
| 12717 |
this.update(); // Make sure we access getRange with editor in consistent state |
| 12718 |
return this.selection.getRange()[0]; |
| 12719 |
} |
| 12720 |
}, { |
| 12721 |
key: 'getText', |
| 12722 |
value: function getText() { |
| 12723 |
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; |
| 12724 |
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; |
| 12725 |
|
| 12726 |
var _overload9 = overload(index, length); |
| 12727 |
|
| 12728 |
var _overload10 = _slicedToArray(_overload9, 2); |
| 12729 |
|
| 12730 |
index = _overload10[0]; |
| 12731 |
length = _overload10[1]; |
| 12732 |
|
| 12733 |
return this.editor.getText(index, length); |
| 12734 |
} |
| 12735 |
}, { |
| 12736 |
key: 'hasFocus', |
| 12737 |
value: function hasFocus() { |
| 12738 |
return this.selection.hasFocus(); |
| 12739 |
} |
| 12740 |
}, { |
| 12741 |
key: 'insertEmbed', |
| 12742 |
value: function insertEmbed(index, embed, value) { |
| 12743 |
var _this7 = this; |
| 12744 |
|
| 12745 |
var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; |
| 12746 |
|
| 12747 |
return modify.call(this, function () { |
| 12748 |
return _this7.editor.insertEmbed(index, embed, value); |
| 12749 |
}, source, index); |
| 12750 |
} |
| 12751 |
}, { |
| 12752 |
key: 'insertText', |
| 12753 |
value: function insertText(index, text, name, value, source) { |
| 12754 |
var _this8 = this; |
| 12755 |
|
| 12756 |
var formats = void 0; |
| 12757 |
|
| 12758 |
var _overload11 = overload(index, 0, name, value, source); |
| 12759 |
|
| 12760 |
var _overload12 = _slicedToArray(_overload11, 4); |
| 12761 |
|
| 12762 |
index = _overload12[0]; |
| 12763 |
formats = _overload12[2]; |
| 12764 |
source = _overload12[3]; |
| 12765 |
|
| 12766 |
return modify.call(this, function () { |
| 12767 |
return _this8.editor.insertText(index, text, formats); |
| 12768 |
}, source, index, text.length); |
| 12769 |
} |
| 12770 |
}, { |
| 12771 |
key: 'isEnabled', |
| 12772 |
value: function isEnabled() { |
| 12773 |
return !this.container.classList.contains('ql-disabled'); |
| 12774 |
} |
| 12775 |
}, { |
| 12776 |
key: 'off', |
| 12777 |
value: function off() { |
| 12778 |
return this.emitter.off.apply(this.emitter, arguments); |
| 12779 |
} |
| 12780 |
}, { |
| 12781 |
key: 'on', |
| 12782 |
value: function on() { |
| 12783 |
return this.emitter.on.apply(this.emitter, arguments); |
| 12784 |
} |
| 12785 |
}, { |
| 12786 |
key: 'once', |
| 12787 |
value: function once() { |
| 12788 |
return this.emitter.once.apply(this.emitter, arguments); |
| 12789 |
} |
| 12790 |
}, { |
| 12791 |
key: 'pasteHTML', |
| 12792 |
value: function pasteHTML(index, html, source) { |
| 12793 |
this.clipboard.dangerouslyPasteHTML(index, html, source); |
| 12794 |
} |
| 12795 |
}, { |
| 12796 |
key: 'removeFormat', |
| 12797 |
value: function removeFormat(index, length, source) { |
| 12798 |
var _this9 = this; |
| 12799 |
|
| 12800 |
var _overload13 = overload(index, length, source); |
| 12801 |
|
| 12802 |
var _overload14 = _slicedToArray(_overload13, 4); |
| 12803 |
|
| 12804 |
index = _overload14[0]; |
| 12805 |
length = _overload14[1]; |
| 12806 |
source = _overload14[3]; |
| 12807 |
|
| 12808 |
return modify.call(this, function () { |
| 12809 |
return _this9.editor.removeFormat(index, length); |
| 12810 |
}, source, index); |
| 12811 |
} |
| 12812 |
}, { |
| 12813 |
key: 'scrollIntoView', |
| 12814 |
value: function scrollIntoView() { |
| 12815 |
this.selection.scrollIntoView(this.scrollingContainer); |
| 12816 |
} |
| 12817 |
}, { |
| 12818 |
key: 'setContents', |
| 12819 |
value: function setContents(delta) { |
| 12820 |
var _this10 = this; |
| 12821 |
|
| 12822 |
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; |
| 12823 |
|
| 12824 |
return modify.call(this, function () { |
| 12825 |
delta = new _quillDelta2.default(delta); |
| 12826 |
var length = _this10.getLength(); |
| 12827 |
var deleted = _this10.editor.deleteText(0, length); |
| 12828 |
var applied = _this10.editor.applyDelta(delta); |
| 12829 |
var lastOp = applied.ops[applied.ops.length - 1]; |
| 12830 |
if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { |
| 12831 |
_this10.editor.deleteText(_this10.getLength() - 1, 1); |
| 12832 |
applied.delete(1); |
| 12833 |
} |
| 12834 |
var ret = deleted.compose(applied); |
| 12835 |
return ret; |
| 12836 |
}, source); |
| 12837 |
} |
| 12838 |
}, { |
| 12839 |
key: 'setSelection', |
| 12840 |
value: function setSelection(index, length, source) { |
| 12841 |
if (index == null) { |
| 12842 |
this.selection.setRange(null, length || Quill.sources.API); |
| 12843 |
} else { |
| 12844 |
var _overload15 = overload(index, length, source); |
| 12845 |
|
| 12846 |
var _overload16 = _slicedToArray(_overload15, 4); |
| 12847 |
|
| 12848 |
index = _overload16[0]; |
| 12849 |
length = _overload16[1]; |
| 12850 |
source = _overload16[3]; |
| 12851 |
|
| 12852 |
this.selection.setRange(new _selection.Range(index, length), source); |
| 12853 |
if (source !== _emitter4.default.sources.SILENT) { |
| 12854 |
this.selection.scrollIntoView(this.scrollingContainer); |
| 12855 |
} |
| 12856 |
} |
| 12857 |
} |
| 12858 |
}, { |
| 12859 |
key: 'setText', |
| 12860 |
value: function setText(text) { |
| 12861 |
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; |
| 12862 |
|
| 12863 |
var delta = new _quillDelta2.default().insert(text); |
| 12864 |
return this.setContents(delta, source); |
| 12865 |
} |
| 12866 |
}, { |
| 12867 |
key: 'update', |
| 12868 |
value: function update() { |
| 12869 |
var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; |
| 12870 |
|
| 12871 |
var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes |
| 12872 |
this.selection.update(source); |
| 12873 |
return change; |
| 12874 |
} |
| 12875 |
}, { |
| 12876 |
key: 'updateContents', |
| 12877 |
value: function updateContents(delta) { |
| 12878 |
var _this11 = this; |
| 12879 |
|
| 12880 |
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; |
| 12881 |
|
| 12882 |
return modify.call(this, function () { |
| 12883 |
delta = new _quillDelta2.default(delta); |
| 12884 |
return _this11.editor.applyDelta(delta, source); |
| 12885 |
}, source, true); |
| 12886 |
} |
| 12887 |
}]); |
| 12888 |
|
| 12889 |
return Quill; |
| 12890 |
}(); |
| 12891 |
|
| 12892 |
Quill.DEFAULTS = { |
| 12893 |
bounds: null, |
| 12894 |
formats: null, |
| 12895 |
modules: {}, |
| 12896 |
placeholder: '', |
| 12897 |
readOnly: false, |
| 12898 |
scrollingContainer: null, |
| 12899 |
strict: true, |
| 12900 |
theme: 'default' |
| 12901 |
}; |
| 12902 |
Quill.events = _emitter4.default.events; |
| 12903 |
Quill.sources = _emitter4.default.sources; |
| 12904 |
// eslint-disable-next-line no-undef |
| 12905 |
Quill.version = false ? 0 : "1.3.7"; |
| 12906 |
|
| 12907 |
Quill.imports = { |
| 12908 |
'delta': _quillDelta2.default, |
| 12909 |
'parchment': _parchment2.default, |
| 12910 |
'core/module': _module2.default, |
| 12911 |
'core/theme': _theme2.default |
| 12912 |
}; |
| 12913 |
|
| 12914 |
function expandConfig(container, userConfig) { |
| 12915 |
userConfig = (0, _extend2.default)(true, { |
| 12916 |
container: container, |
| 12917 |
modules: { |
| 12918 |
clipboard: true, |
| 12919 |
keyboard: true, |
| 12920 |
history: true |
| 12921 |
} |
| 12922 |
}, userConfig); |
| 12923 |
if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { |
| 12924 |
userConfig.theme = _theme2.default; |
| 12925 |
} else { |
| 12926 |
userConfig.theme = Quill.import('themes/' + userConfig.theme); |
| 12927 |
if (userConfig.theme == null) { |
| 12928 |
throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); |
| 12929 |
} |
| 12930 |
} |
| 12931 |
var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); |
| 12932 |
[themeConfig, userConfig].forEach(function (config) { |
| 12933 |
config.modules = config.modules || {}; |
| 12934 |
Object.keys(config.modules).forEach(function (module) { |
| 12935 |
if (config.modules[module] === true) { |
| 12936 |
config.modules[module] = {}; |
| 12937 |
} |
| 12938 |
}); |
| 12939 |
}); |
| 12940 |
var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); |
| 12941 |
var moduleConfig = moduleNames.reduce(function (config, name) { |
| 12942 |
var moduleClass = Quill.import('modules/' + name); |
| 12943 |
if (moduleClass == null) { |
| 12944 |
debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); |
| 12945 |
} else { |
| 12946 |
config[name] = moduleClass.DEFAULTS || {}; |
| 12947 |
} |
| 12948 |
return config; |
| 12949 |
}, {}); |
| 12950 |
// Special case toolbar shorthand |
| 12951 |
if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { |
| 12952 |
userConfig.modules.toolbar = { |
| 12953 |
container: userConfig.modules.toolbar |
| 12954 |
}; |
| 12955 |
} |
| 12956 |
userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); |
| 12957 |
['bounds', 'container', 'scrollingContainer'].forEach(function (key) { |
| 12958 |
if (typeof userConfig[key] === 'string') { |
| 12959 |
userConfig[key] = document.querySelector(userConfig[key]); |
| 12960 |
} |
| 12961 |
}); |
| 12962 |
userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { |
| 12963 |
if (userConfig.modules[name]) { |
| 12964 |
config[name] = userConfig.modules[name]; |
| 12965 |
} |
| 12966 |
return config; |
| 12967 |
}, {}); |
| 12968 |
return userConfig; |
| 12969 |
} |
| 12970 |
|
| 12971 |
// Handle selection preservation and TEXT_CHANGE emission |
| 12972 |
// common to modification APIs |
| 12973 |
function modify(modifier, source, index, shift) { |
| 12974 |
if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { |
| 12975 |
return new _quillDelta2.default(); |
| 12976 |
} |
| 12977 |
var range = index == null ? null : this.getSelection(); |
| 12978 |
var oldDelta = this.editor.delta; |
| 12979 |
var change = modifier(); |
| 12980 |
if (range != null) { |
| 12981 |
if (index === true) index = range.index; |
| 12982 |
if (shift == null) { |
| 12983 |
range = shiftRange(range, change, source); |
| 12984 |
} else if (shift !== 0) { |
| 12985 |
range = shiftRange(range, index, shift, source); |
| 12986 |
} |
| 12987 |
this.setSelection(range, _emitter4.default.sources.SILENT); |
| 12988 |
} |
| 12989 |
if (change.length() > 0) { |
| 12990 |
var _emitter; |
| 12991 |
|
| 12992 |
var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; |
| 12993 |
(_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); |
| 12994 |
if (source !== _emitter4.default.sources.SILENT) { |
| 12995 |
var _emitter2; |
| 12996 |
|
| 12997 |
(_emitter2 = this.emitter).emit.apply(_emitter2, args); |
| 12998 |
} |
| 12999 |
} |
| 13000 |
return change; |
| 13001 |
} |
| 13002 |
|
| 13003 |
function overload(index, length, name, value, source) { |
| 13004 |
var formats = {}; |
| 13005 |
if (typeof index.index === 'number' && typeof index.length === 'number') { |
| 13006 |
// Allow for throwaway end (used by insertText/insertEmbed) |
| 13007 |
if (typeof length !== 'number') { |
| 13008 |
source = value, value = name, name = length, length = index.length, index = index.index; |
| 13009 |
} else { |
| 13010 |
length = index.length, index = index.index; |
| 13011 |
} |
| 13012 |
} else if (typeof length !== 'number') { |
| 13013 |
source = value, value = name, name = length, length = 0; |
| 13014 |
} |
| 13015 |
// Handle format being object, two format name/value strings or excluded |
| 13016 |
if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { |
| 13017 |
formats = name; |
| 13018 |
source = value; |
| 13019 |
} else if (typeof name === 'string') { |
| 13020 |
if (value != null) { |
| 13021 |
formats[name] = value; |
| 13022 |
} else { |
| 13023 |
source = name; |
| 13024 |
} |
| 13025 |
} |
| 13026 |
// Handle optional source |
| 13027 |
source = source || _emitter4.default.sources.API; |
| 13028 |
return [index, length, formats, source]; |
| 13029 |
} |
| 13030 |
|
| 13031 |
function shiftRange(range, index, length, source) { |
| 13032 |
if (range == null) return null; |
| 13033 |
var start = void 0, |
| 13034 |
end = void 0; |
| 13035 |
if (index instanceof _quillDelta2.default) { |
| 13036 |
var _map = [range.index, range.index + range.length].map(function (pos) { |
| 13037 |
return index.transformPosition(pos, source !== _emitter4.default.sources.USER); |
| 13038 |
}); |
| 13039 |
|
| 13040 |
var _map2 = _slicedToArray(_map, 2); |
| 13041 |
|
| 13042 |
start = _map2[0]; |
| 13043 |
end = _map2[1]; |
| 13044 |
} else { |
| 13045 |
var _map3 = [range.index, range.index + range.length].map(function (pos) { |
| 13046 |
if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; |
| 13047 |
if (length >= 0) { |
| 13048 |
return pos + length; |
| 13049 |
} else { |
| 13050 |
return Math.max(index, pos + length); |
| 13051 |
} |
| 13052 |
}); |
| 13053 |
|
| 13054 |
var _map4 = _slicedToArray(_map3, 2); |
| 13055 |
|
| 13056 |
start = _map4[0]; |
| 13057 |
end = _map4[1]; |
| 13058 |
} |
| 13059 |
return new _selection.Range(start, end - start); |
| 13060 |
} |
| 13061 |
|
| 13062 |
exports.expandConfig = expandConfig; |
| 13063 |
exports.overload = overload; |
| 13064 |
exports.default = Quill; |
| 13065 |
|
| 13066 |
/***/ }), |
| 13067 |
/* 6 */ |
| 13068 |
/***/ (function(module, exports, __nested_webpack_require_58401__) { |
| 13069 |
|
| 13070 |
"use strict"; |
| 13071 |
|
| 13072 |
|
| 13073 |
Object.defineProperty(exports, "__esModule", { |
| 13074 |
value: true |
| 13075 |
}); |
| 13076 |
|
| 13077 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 13078 |
|
| 13079 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 13080 |
|
| 13081 |
var _text = __nested_webpack_require_58401__(7); |
| 13082 |
|
| 13083 |
var _text2 = _interopRequireDefault(_text); |
| 13084 |
|
| 13085 |
var _parchment = __nested_webpack_require_58401__(0); |
| 13086 |
|
| 13087 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 13088 |
|
| 13089 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 13090 |
|
| 13091 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 13092 |
|
| 13093 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 13094 |
|
| 13095 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 13096 |
|
| 13097 |
var Inline = function (_Parchment$Inline) { |
| 13098 |
_inherits(Inline, _Parchment$Inline); |
| 13099 |
|
| 13100 |
function Inline() { |
| 13101 |
_classCallCheck(this, Inline); |
| 13102 |
|
| 13103 |
return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); |
| 13104 |
} |
| 13105 |
|
| 13106 |
_createClass(Inline, [{ |
| 13107 |
key: 'formatAt', |
| 13108 |
value: function formatAt(index, length, name, value) { |
| 13109 |
if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { |
| 13110 |
var blot = this.isolate(index, length); |
| 13111 |
if (value) { |
| 13112 |
blot.wrap(name, value); |
| 13113 |
} |
| 13114 |
} else { |
| 13115 |
_get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); |
| 13116 |
} |
| 13117 |
} |
| 13118 |
}, { |
| 13119 |
key: 'optimize', |
| 13120 |
value: function optimize(context) { |
| 13121 |
_get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); |
| 13122 |
if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { |
| 13123 |
var parent = this.parent.isolate(this.offset(), this.length()); |
| 13124 |
this.moveChildren(parent); |
| 13125 |
parent.wrap(this); |
| 13126 |
} |
| 13127 |
} |
| 13128 |
}], [{ |
| 13129 |
key: 'compare', |
| 13130 |
value: function compare(self, other) { |
| 13131 |
var selfIndex = Inline.order.indexOf(self); |
| 13132 |
var otherIndex = Inline.order.indexOf(other); |
| 13133 |
if (selfIndex >= 0 || otherIndex >= 0) { |
| 13134 |
return selfIndex - otherIndex; |
| 13135 |
} else if (self === other) { |
| 13136 |
return 0; |
| 13137 |
} else if (self < other) { |
| 13138 |
return -1; |
| 13139 |
} else { |
| 13140 |
return 1; |
| 13141 |
} |
| 13142 |
} |
| 13143 |
}]); |
| 13144 |
|
| 13145 |
return Inline; |
| 13146 |
}(_parchment2.default.Inline); |
| 13147 |
|
| 13148 |
Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; |
| 13149 |
// Lower index means deeper in the DOM tree, since not found (-1) is for embeds |
| 13150 |
Inline.order = ['cursor', 'inline', // Must be lower |
| 13151 |
'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher |
| 13152 |
]; |
| 13153 |
|
| 13154 |
exports.default = Inline; |
| 13155 |
|
| 13156 |
/***/ }), |
| 13157 |
/* 7 */ |
| 13158 |
/***/ (function(module, exports, __nested_webpack_require_62823__) { |
| 13159 |
|
| 13160 |
"use strict"; |
| 13161 |
|
| 13162 |
|
| 13163 |
Object.defineProperty(exports, "__esModule", { |
| 13164 |
value: true |
| 13165 |
}); |
| 13166 |
|
| 13167 |
var _parchment = __nested_webpack_require_62823__(0); |
| 13168 |
|
| 13169 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 13170 |
|
| 13171 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 13172 |
|
| 13173 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 13174 |
|
| 13175 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 13176 |
|
| 13177 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 13178 |
|
| 13179 |
var TextBlot = function (_Parchment$Text) { |
| 13180 |
_inherits(TextBlot, _Parchment$Text); |
| 13181 |
|
| 13182 |
function TextBlot() { |
| 13183 |
_classCallCheck(this, TextBlot); |
| 13184 |
|
| 13185 |
return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); |
| 13186 |
} |
| 13187 |
|
| 13188 |
return TextBlot; |
| 13189 |
}(_parchment2.default.Text); |
| 13190 |
|
| 13191 |
exports.default = TextBlot; |
| 13192 |
|
| 13193 |
/***/ }), |
| 13194 |
/* 8 */ |
| 13195 |
/***/ (function(module, exports, __nested_webpack_require_64422__) { |
| 13196 |
|
| 13197 |
"use strict"; |
| 13198 |
|
| 13199 |
|
| 13200 |
Object.defineProperty(exports, "__esModule", { |
| 13201 |
value: true |
| 13202 |
}); |
| 13203 |
|
| 13204 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 13205 |
|
| 13206 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 13207 |
|
| 13208 |
var _eventemitter = __nested_webpack_require_64422__(54); |
| 13209 |
|
| 13210 |
var _eventemitter2 = _interopRequireDefault(_eventemitter); |
| 13211 |
|
| 13212 |
var _logger = __nested_webpack_require_64422__(10); |
| 13213 |
|
| 13214 |
var _logger2 = _interopRequireDefault(_logger); |
| 13215 |
|
| 13216 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 13217 |
|
| 13218 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 13219 |
|
| 13220 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 13221 |
|
| 13222 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 13223 |
|
| 13224 |
var debug = (0, _logger2.default)('quill:events'); |
| 13225 |
|
| 13226 |
var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; |
| 13227 |
|
| 13228 |
EVENTS.forEach(function (eventName) { |
| 13229 |
document.addEventListener(eventName, function () { |
| 13230 |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { |
| 13231 |
args[_key] = arguments[_key]; |
| 13232 |
} |
| 13233 |
|
| 13234 |
[].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { |
| 13235 |
// TODO use WeakMap |
| 13236 |
if (node.__quill && node.__quill.emitter) { |
| 13237 |
var _node$__quill$emitter; |
| 13238 |
|
| 13239 |
(_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); |
| 13240 |
} |
| 13241 |
}); |
| 13242 |
}); |
| 13243 |
}); |
| 13244 |
|
| 13245 |
var Emitter = function (_EventEmitter) { |
| 13246 |
_inherits(Emitter, _EventEmitter); |
| 13247 |
|
| 13248 |
function Emitter() { |
| 13249 |
_classCallCheck(this, Emitter); |
| 13250 |
|
| 13251 |
var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); |
| 13252 |
|
| 13253 |
_this.listeners = {}; |
| 13254 |
_this.on('error', debug.error); |
| 13255 |
return _this; |
| 13256 |
} |
| 13257 |
|
| 13258 |
_createClass(Emitter, [{ |
| 13259 |
key: 'emit', |
| 13260 |
value: function emit() { |
| 13261 |
debug.log.apply(debug, arguments); |
| 13262 |
_get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); |
| 13263 |
} |
| 13264 |
}, { |
| 13265 |
key: 'handleDOM', |
| 13266 |
value: function handleDOM(event) { |
| 13267 |
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { |
| 13268 |
args[_key2 - 1] = arguments[_key2]; |
| 13269 |
} |
| 13270 |
|
| 13271 |
(this.listeners[event.type] || []).forEach(function (_ref) { |
| 13272 |
var node = _ref.node, |
| 13273 |
handler = _ref.handler; |
| 13274 |
|
| 13275 |
if (event.target === node || node.contains(event.target)) { |
| 13276 |
handler.apply(undefined, [event].concat(args)); |
| 13277 |
} |
| 13278 |
}); |
| 13279 |
} |
| 13280 |
}, { |
| 13281 |
key: 'listenDOM', |
| 13282 |
value: function listenDOM(eventName, node, handler) { |
| 13283 |
if (!this.listeners[eventName]) { |
| 13284 |
this.listeners[eventName] = []; |
| 13285 |
} |
| 13286 |
this.listeners[eventName].push({ node: node, handler: handler }); |
| 13287 |
} |
| 13288 |
}]); |
| 13289 |
|
| 13290 |
return Emitter; |
| 13291 |
}(_eventemitter2.default); |
| 13292 |
|
| 13293 |
Emitter.events = { |
| 13294 |
EDITOR_CHANGE: 'editor-change', |
| 13295 |
SCROLL_BEFORE_UPDATE: 'scroll-before-update', |
| 13296 |
SCROLL_OPTIMIZE: 'scroll-optimize', |
| 13297 |
SCROLL_UPDATE: 'scroll-update', |
| 13298 |
SELECTION_CHANGE: 'selection-change', |
| 13299 |
TEXT_CHANGE: 'text-change' |
| 13300 |
}; |
| 13301 |
Emitter.sources = { |
| 13302 |
API: 'api', |
| 13303 |
SILENT: 'silent', |
| 13304 |
USER: 'user' |
| 13305 |
}; |
| 13306 |
|
| 13307 |
exports.default = Emitter; |
| 13308 |
|
| 13309 |
/***/ }), |
| 13310 |
/* 9 */ |
| 13311 |
/***/ (function(module, exports, __webpack_require__) { |
| 13312 |
|
| 13313 |
"use strict"; |
| 13314 |
|
| 13315 |
|
| 13316 |
Object.defineProperty(exports, "__esModule", { |
| 13317 |
value: true |
| 13318 |
}); |
| 13319 |
|
| 13320 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 13321 |
|
| 13322 |
var Module = function Module(quill) { |
| 13323 |
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 13324 |
|
| 13325 |
_classCallCheck(this, Module); |
| 13326 |
|
| 13327 |
this.quill = quill; |
| 13328 |
this.options = options; |
| 13329 |
}; |
| 13330 |
|
| 13331 |
Module.DEFAULTS = {}; |
| 13332 |
|
| 13333 |
exports.default = Module; |
| 13334 |
|
| 13335 |
/***/ }), |
| 13336 |
/* 10 */ |
| 13337 |
/***/ (function(module, exports, __webpack_require__) { |
| 13338 |
|
| 13339 |
"use strict"; |
| 13340 |
|
| 13341 |
|
| 13342 |
Object.defineProperty(exports, "__esModule", { |
| 13343 |
value: true |
| 13344 |
}); |
| 13345 |
var levels = ['error', 'warn', 'log', 'info']; |
| 13346 |
var level = 'warn'; |
| 13347 |
|
| 13348 |
function debug(method) { |
| 13349 |
if (levels.indexOf(method) <= levels.indexOf(level)) { |
| 13350 |
var _console; |
| 13351 |
|
| 13352 |
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
| 13353 |
args[_key - 1] = arguments[_key]; |
| 13354 |
} |
| 13355 |
|
| 13356 |
(_console = console)[method].apply(_console, args); // eslint-disable-line no-console |
| 13357 |
} |
| 13358 |
} |
| 13359 |
|
| 13360 |
function namespace(ns) { |
| 13361 |
return levels.reduce(function (logger, method) { |
| 13362 |
logger[method] = debug.bind(console, method, ns); |
| 13363 |
return logger; |
| 13364 |
}, {}); |
| 13365 |
} |
| 13366 |
|
| 13367 |
debug.level = namespace.level = function (newLevel) { |
| 13368 |
level = newLevel; |
| 13369 |
}; |
| 13370 |
|
| 13371 |
exports.default = namespace; |
| 13372 |
|
| 13373 |
/***/ }), |
| 13374 |
/* 11 */ |
| 13375 |
/***/ (function(module, exports, __nested_webpack_require_70685__) { |
| 13376 |
|
| 13377 |
var pSlice = Array.prototype.slice; |
| 13378 |
var objectKeys = __nested_webpack_require_70685__(52); |
| 13379 |
var isArguments = __nested_webpack_require_70685__(53); |
| 13380 |
|
| 13381 |
var deepEqual = module.exports = function (actual, expected, opts) { |
| 13382 |
if (!opts) opts = {}; |
| 13383 |
// 7.1. All identical values are equivalent, as determined by ===. |
| 13384 |
if (actual === expected) { |
| 13385 |
return true; |
| 13386 |
|
| 13387 |
} else if (actual instanceof Date && expected instanceof Date) { |
| 13388 |
return actual.getTime() === expected.getTime(); |
| 13389 |
|
| 13390 |
// 7.3. Other pairs that do not both pass typeof value == 'object', |
| 13391 |
// equivalence is determined by ==. |
| 13392 |
} else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { |
| 13393 |
return opts.strict ? actual === expected : actual == expected; |
| 13394 |
|
| 13395 |
// 7.4. For all other Object pairs, including Array objects, equivalence is |
| 13396 |
// determined by having the same number of owned properties (as verified |
| 13397 |
// with Object.prototype.hasOwnProperty.call), the same set of keys |
| 13398 |
// (although not necessarily the same order), equivalent values for every |
| 13399 |
// corresponding key, and an identical 'prototype' property. Note: this |
| 13400 |
// accounts for both named and indexed properties on Arrays. |
| 13401 |
} else { |
| 13402 |
return objEquiv(actual, expected, opts); |
| 13403 |
} |
| 13404 |
} |
| 13405 |
|
| 13406 |
function isUndefinedOrNull(value) { |
| 13407 |
return value === null || value === undefined; |
| 13408 |
} |
| 13409 |
|
| 13410 |
function isBuffer (x) { |
| 13411 |
if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; |
| 13412 |
if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { |
| 13413 |
return false; |
| 13414 |
} |
| 13415 |
if (x.length > 0 && typeof x[0] !== 'number') return false; |
| 13416 |
return true; |
| 13417 |
} |
| 13418 |
|
| 13419 |
function objEquiv(a, b, opts) { |
| 13420 |
var i, key; |
| 13421 |
if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) |
| 13422 |
return false; |
| 13423 |
// an identical 'prototype' property. |
| 13424 |
if (a.prototype !== b.prototype) return false; |
| 13425 |
//~~~I've managed to break Object.keys through screwy arguments passing. |
| 13426 |
// Converting to array solves the problem. |
| 13427 |
if (isArguments(a)) { |
| 13428 |
if (!isArguments(b)) { |
| 13429 |
return false; |
| 13430 |
} |
| 13431 |
a = pSlice.call(a); |
| 13432 |
b = pSlice.call(b); |
| 13433 |
return deepEqual(a, b, opts); |
| 13434 |
} |
| 13435 |
if (isBuffer(a)) { |
| 13436 |
if (!isBuffer(b)) { |
| 13437 |
return false; |
| 13438 |
} |
| 13439 |
if (a.length !== b.length) return false; |
| 13440 |
for (i = 0; i < a.length; i++) { |
| 13441 |
if (a[i] !== b[i]) return false; |
| 13442 |
} |
| 13443 |
return true; |
| 13444 |
} |
| 13445 |
try { |
| 13446 |
var ka = objectKeys(a), |
| 13447 |
kb = objectKeys(b); |
| 13448 |
} catch (e) {//happens when one is a string literal and the other isn't |
| 13449 |
return false; |
| 13450 |
} |
| 13451 |
// having the same number of owned properties (keys incorporates |
| 13452 |
// hasOwnProperty) |
| 13453 |
if (ka.length != kb.length) |
| 13454 |
return false; |
| 13455 |
//the same set of keys (although not necessarily the same order), |
| 13456 |
ka.sort(); |
| 13457 |
kb.sort(); |
| 13458 |
//~~~cheap key test |
| 13459 |
for (i = ka.length - 1; i >= 0; i--) { |
| 13460 |
if (ka[i] != kb[i]) |
| 13461 |
return false; |
| 13462 |
} |
| 13463 |
//equivalent values for every corresponding key, and |
| 13464 |
//~~~possibly expensive deep test |
| 13465 |
for (i = ka.length - 1; i >= 0; i--) { |
| 13466 |
key = ka[i]; |
| 13467 |
if (!deepEqual(a[key], b[key], opts)) return false; |
| 13468 |
} |
| 13469 |
return typeof a === typeof b; |
| 13470 |
} |
| 13471 |
|
| 13472 |
|
| 13473 |
/***/ }), |
| 13474 |
/* 12 */ |
| 13475 |
/***/ (function(module, exports, __nested_webpack_require_73804__) { |
| 13476 |
|
| 13477 |
"use strict"; |
| 13478 |
|
| 13479 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 13480 |
var Registry = __nested_webpack_require_73804__(1); |
| 13481 |
var Attributor = /** @class */ (function () { |
| 13482 |
function Attributor(attrName, keyName, options) { |
| 13483 |
if (options === void 0) { options = {}; } |
| 13484 |
this.attrName = attrName; |
| 13485 |
this.keyName = keyName; |
| 13486 |
var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; |
| 13487 |
if (options.scope != null) { |
| 13488 |
// Ignore type bits, force attribute bit |
| 13489 |
this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; |
| 13490 |
} |
| 13491 |
else { |
| 13492 |
this.scope = Registry.Scope.ATTRIBUTE; |
| 13493 |
} |
| 13494 |
if (options.whitelist != null) |
| 13495 |
this.whitelist = options.whitelist; |
| 13496 |
} |
| 13497 |
Attributor.keys = function (node) { |
| 13498 |
return [].map.call(node.attributes, function (item) { |
| 13499 |
return item.name; |
| 13500 |
}); |
| 13501 |
}; |
| 13502 |
Attributor.prototype.add = function (node, value) { |
| 13503 |
if (!this.canAdd(node, value)) |
| 13504 |
return false; |
| 13505 |
node.setAttribute(this.keyName, value); |
| 13506 |
return true; |
| 13507 |
}; |
| 13508 |
Attributor.prototype.canAdd = function (node, value) { |
| 13509 |
var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); |
| 13510 |
if (match == null) |
| 13511 |
return false; |
| 13512 |
if (this.whitelist == null) |
| 13513 |
return true; |
| 13514 |
if (typeof value === 'string') { |
| 13515 |
return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; |
| 13516 |
} |
| 13517 |
else { |
| 13518 |
return this.whitelist.indexOf(value) > -1; |
| 13519 |
} |
| 13520 |
}; |
| 13521 |
Attributor.prototype.remove = function (node) { |
| 13522 |
node.removeAttribute(this.keyName); |
| 13523 |
}; |
| 13524 |
Attributor.prototype.value = function (node) { |
| 13525 |
var value = node.getAttribute(this.keyName); |
| 13526 |
if (this.canAdd(node, value) && value) { |
| 13527 |
return value; |
| 13528 |
} |
| 13529 |
return ''; |
| 13530 |
}; |
| 13531 |
return Attributor; |
| 13532 |
}()); |
| 13533 |
exports.default = Attributor; |
| 13534 |
|
| 13535 |
|
| 13536 |
/***/ }), |
| 13537 |
/* 13 */ |
| 13538 |
/***/ (function(module, exports, __nested_webpack_require_75851__) { |
| 13539 |
|
| 13540 |
"use strict"; |
| 13541 |
|
| 13542 |
|
| 13543 |
Object.defineProperty(exports, "__esModule", { |
| 13544 |
value: true |
| 13545 |
}); |
| 13546 |
exports.default = exports.Code = undefined; |
| 13547 |
|
| 13548 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 13549 |
|
| 13550 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 13551 |
|
| 13552 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 13553 |
|
| 13554 |
var _quillDelta = __nested_webpack_require_75851__(2); |
| 13555 |
|
| 13556 |
var _quillDelta2 = _interopRequireDefault(_quillDelta); |
| 13557 |
|
| 13558 |
var _parchment = __nested_webpack_require_75851__(0); |
| 13559 |
|
| 13560 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 13561 |
|
| 13562 |
var _block = __nested_webpack_require_75851__(4); |
| 13563 |
|
| 13564 |
var _block2 = _interopRequireDefault(_block); |
| 13565 |
|
| 13566 |
var _inline = __nested_webpack_require_75851__(6); |
| 13567 |
|
| 13568 |
var _inline2 = _interopRequireDefault(_inline); |
| 13569 |
|
| 13570 |
var _text = __nested_webpack_require_75851__(7); |
| 13571 |
|
| 13572 |
var _text2 = _interopRequireDefault(_text); |
| 13573 |
|
| 13574 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 13575 |
|
| 13576 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 13577 |
|
| 13578 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 13579 |
|
| 13580 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 13581 |
|
| 13582 |
var Code = function (_Inline) { |
| 13583 |
_inherits(Code, _Inline); |
| 13584 |
|
| 13585 |
function Code() { |
| 13586 |
_classCallCheck(this, Code); |
| 13587 |
|
| 13588 |
return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); |
| 13589 |
} |
| 13590 |
|
| 13591 |
return Code; |
| 13592 |
}(_inline2.default); |
| 13593 |
|
| 13594 |
Code.blotName = 'code'; |
| 13595 |
Code.tagName = 'CODE'; |
| 13596 |
|
| 13597 |
var CodeBlock = function (_Block) { |
| 13598 |
_inherits(CodeBlock, _Block); |
| 13599 |
|
| 13600 |
function CodeBlock() { |
| 13601 |
_classCallCheck(this, CodeBlock); |
| 13602 |
|
| 13603 |
return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); |
| 13604 |
} |
| 13605 |
|
| 13606 |
_createClass(CodeBlock, [{ |
| 13607 |
key: 'delta', |
| 13608 |
value: function delta() { |
| 13609 |
var _this3 = this; |
| 13610 |
|
| 13611 |
var text = this.domNode.textContent; |
| 13612 |
if (text.endsWith('\n')) { |
| 13613 |
// Should always be true |
| 13614 |
text = text.slice(0, -1); |
| 13615 |
} |
| 13616 |
return text.split('\n').reduce(function (delta, frag) { |
| 13617 |
return delta.insert(frag).insert('\n', _this3.formats()); |
| 13618 |
}, new _quillDelta2.default()); |
| 13619 |
} |
| 13620 |
}, { |
| 13621 |
key: 'format', |
| 13622 |
value: function format(name, value) { |
| 13623 |
if (name === this.statics.blotName && value) return; |
| 13624 |
|
| 13625 |
var _descendant = this.descendant(_text2.default, this.length() - 1), |
| 13626 |
_descendant2 = _slicedToArray(_descendant, 1), |
| 13627 |
text = _descendant2[0]; |
| 13628 |
|
| 13629 |
if (text != null) { |
| 13630 |
text.deleteAt(text.length() - 1, 1); |
| 13631 |
} |
| 13632 |
_get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); |
| 13633 |
} |
| 13634 |
}, { |
| 13635 |
key: 'formatAt', |
| 13636 |
value: function formatAt(index, length, name, value) { |
| 13637 |
if (length === 0) return; |
| 13638 |
if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { |
| 13639 |
return; |
| 13640 |
} |
| 13641 |
var nextNewline = this.newlineIndex(index); |
| 13642 |
if (nextNewline < 0 || nextNewline >= index + length) return; |
| 13643 |
var prevNewline = this.newlineIndex(index, true) + 1; |
| 13644 |
var isolateLength = nextNewline - prevNewline + 1; |
| 13645 |
var blot = this.isolate(prevNewline, isolateLength); |
| 13646 |
var next = blot.next; |
| 13647 |
blot.format(name, value); |
| 13648 |
if (next instanceof CodeBlock) { |
| 13649 |
next.formatAt(0, index - prevNewline + length - isolateLength, name, value); |
| 13650 |
} |
| 13651 |
} |
| 13652 |
}, { |
| 13653 |
key: 'insertAt', |
| 13654 |
value: function insertAt(index, value, def) { |
| 13655 |
if (def != null) return; |
| 13656 |
|
| 13657 |
var _descendant3 = this.descendant(_text2.default, index), |
| 13658 |
_descendant4 = _slicedToArray(_descendant3, 2), |
| 13659 |
text = _descendant4[0], |
| 13660 |
offset = _descendant4[1]; |
| 13661 |
|
| 13662 |
text.insertAt(offset, value); |
| 13663 |
} |
| 13664 |
}, { |
| 13665 |
key: 'length', |
| 13666 |
value: function length() { |
| 13667 |
var length = this.domNode.textContent.length; |
| 13668 |
if (!this.domNode.textContent.endsWith('\n')) { |
| 13669 |
return length + 1; |
| 13670 |
} |
| 13671 |
return length; |
| 13672 |
} |
| 13673 |
}, { |
| 13674 |
key: 'newlineIndex', |
| 13675 |
value: function newlineIndex(searchIndex) { |
| 13676 |
var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; |
| 13677 |
|
| 13678 |
if (!reverse) { |
| 13679 |
var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); |
| 13680 |
return offset > -1 ? searchIndex + offset : -1; |
| 13681 |
} else { |
| 13682 |
return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); |
| 13683 |
} |
| 13684 |
} |
| 13685 |
}, { |
| 13686 |
key: 'optimize', |
| 13687 |
value: function optimize(context) { |
| 13688 |
if (!this.domNode.textContent.endsWith('\n')) { |
| 13689 |
this.appendChild(_parchment2.default.create('text', '\n')); |
| 13690 |
} |
| 13691 |
_get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); |
| 13692 |
var next = this.next; |
| 13693 |
if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { |
| 13694 |
next.optimize(context); |
| 13695 |
next.moveChildren(this); |
| 13696 |
next.remove(); |
| 13697 |
} |
| 13698 |
} |
| 13699 |
}, { |
| 13700 |
key: 'replace', |
| 13701 |
value: function replace(target) { |
| 13702 |
_get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); |
| 13703 |
[].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { |
| 13704 |
var blot = _parchment2.default.find(node); |
| 13705 |
if (blot == null) { |
| 13706 |
node.parentNode.removeChild(node); |
| 13707 |
} else if (blot instanceof _parchment2.default.Embed) { |
| 13708 |
blot.remove(); |
| 13709 |
} else { |
| 13710 |
blot.unwrap(); |
| 13711 |
} |
| 13712 |
}); |
| 13713 |
} |
| 13714 |
}], [{ |
| 13715 |
key: 'create', |
| 13716 |
value: function create(value) { |
| 13717 |
var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); |
| 13718 |
domNode.setAttribute('spellcheck', false); |
| 13719 |
return domNode; |
| 13720 |
} |
| 13721 |
}, { |
| 13722 |
key: 'formats', |
| 13723 |
value: function formats() { |
| 13724 |
return true; |
| 13725 |
} |
| 13726 |
}]); |
| 13727 |
|
| 13728 |
return CodeBlock; |
| 13729 |
}(_block2.default); |
| 13730 |
|
| 13731 |
CodeBlock.blotName = 'code-block'; |
| 13732 |
CodeBlock.tagName = 'PRE'; |
| 13733 |
CodeBlock.TAB = ' '; |
| 13734 |
|
| 13735 |
exports.Code = Code; |
| 13736 |
exports.default = CodeBlock; |
| 13737 |
|
| 13738 |
/***/ }), |
| 13739 |
/* 14 */ |
| 13740 |
/***/ (function(module, exports, __nested_webpack_require_84272__) { |
| 13741 |
|
| 13742 |
"use strict"; |
| 13743 |
|
| 13744 |
|
| 13745 |
Object.defineProperty(exports, "__esModule", { |
| 13746 |
value: true |
| 13747 |
}); |
| 13748 |
|
| 13749 |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
| 13750 |
|
| 13751 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 13752 |
|
| 13753 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 13754 |
|
| 13755 |
var _quillDelta = __nested_webpack_require_84272__(2); |
| 13756 |
|
| 13757 |
var _quillDelta2 = _interopRequireDefault(_quillDelta); |
| 13758 |
|
| 13759 |
var _op = __nested_webpack_require_84272__(20); |
| 13760 |
|
| 13761 |
var _op2 = _interopRequireDefault(_op); |
| 13762 |
|
| 13763 |
var _parchment = __nested_webpack_require_84272__(0); |
| 13764 |
|
| 13765 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 13766 |
|
| 13767 |
var _code = __nested_webpack_require_84272__(13); |
| 13768 |
|
| 13769 |
var _code2 = _interopRequireDefault(_code); |
| 13770 |
|
| 13771 |
var _cursor = __nested_webpack_require_84272__(24); |
| 13772 |
|
| 13773 |
var _cursor2 = _interopRequireDefault(_cursor); |
| 13774 |
|
| 13775 |
var _block = __nested_webpack_require_84272__(4); |
| 13776 |
|
| 13777 |
var _block2 = _interopRequireDefault(_block); |
| 13778 |
|
| 13779 |
var _break = __nested_webpack_require_84272__(16); |
| 13780 |
|
| 13781 |
var _break2 = _interopRequireDefault(_break); |
| 13782 |
|
| 13783 |
var _clone = __nested_webpack_require_84272__(21); |
| 13784 |
|
| 13785 |
var _clone2 = _interopRequireDefault(_clone); |
| 13786 |
|
| 13787 |
var _deepEqual = __nested_webpack_require_84272__(11); |
| 13788 |
|
| 13789 |
var _deepEqual2 = _interopRequireDefault(_deepEqual); |
| 13790 |
|
| 13791 |
var _extend = __nested_webpack_require_84272__(3); |
| 13792 |
|
| 13793 |
var _extend2 = _interopRequireDefault(_extend); |
| 13794 |
|
| 13795 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 13796 |
|
| 13797 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 13798 |
|
| 13799 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 13800 |
|
| 13801 |
var ASCII = /^[ -~]*$/; |
| 13802 |
|
| 13803 |
var Editor = function () { |
| 13804 |
function Editor(scroll) { |
| 13805 |
_classCallCheck(this, Editor); |
| 13806 |
|
| 13807 |
this.scroll = scroll; |
| 13808 |
this.delta = this.getDelta(); |
| 13809 |
} |
| 13810 |
|
| 13811 |
_createClass(Editor, [{ |
| 13812 |
key: 'applyDelta', |
| 13813 |
value: function applyDelta(delta) { |
| 13814 |
var _this = this; |
| 13815 |
|
| 13816 |
var consumeNextNewline = false; |
| 13817 |
this.scroll.update(); |
| 13818 |
var scrollLength = this.scroll.length(); |
| 13819 |
this.scroll.batchStart(); |
| 13820 |
delta = normalizeDelta(delta); |
| 13821 |
delta.reduce(function (index, op) { |
| 13822 |
var length = op.retain || op.delete || op.insert.length || 1; |
| 13823 |
var attributes = op.attributes || {}; |
| 13824 |
if (op.insert != null) { |
| 13825 |
if (typeof op.insert === 'string') { |
| 13826 |
var text = op.insert; |
| 13827 |
if (text.endsWith('\n') && consumeNextNewline) { |
| 13828 |
consumeNextNewline = false; |
| 13829 |
text = text.slice(0, -1); |
| 13830 |
} |
| 13831 |
if (index >= scrollLength && !text.endsWith('\n')) { |
| 13832 |
consumeNextNewline = true; |
| 13833 |
} |
| 13834 |
_this.scroll.insertAt(index, text); |
| 13835 |
|
| 13836 |
var _scroll$line = _this.scroll.line(index), |
| 13837 |
_scroll$line2 = _slicedToArray(_scroll$line, 2), |
| 13838 |
line = _scroll$line2[0], |
| 13839 |
offset = _scroll$line2[1]; |
| 13840 |
|
| 13841 |
var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); |
| 13842 |
if (line instanceof _block2.default) { |
| 13843 |
var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), |
| 13844 |
_line$descendant2 = _slicedToArray(_line$descendant, 1), |
| 13845 |
leaf = _line$descendant2[0]; |
| 13846 |
|
| 13847 |
formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); |
| 13848 |
} |
| 13849 |
attributes = _op2.default.attributes.diff(formats, attributes) || {}; |
| 13850 |
} else if (_typeof(op.insert) === 'object') { |
| 13851 |
var key = Object.keys(op.insert)[0]; // There should only be one key |
| 13852 |
if (key == null) return index; |
| 13853 |
_this.scroll.insertAt(index, key, op.insert[key]); |
| 13854 |
} |
| 13855 |
scrollLength += length; |
| 13856 |
} |
| 13857 |
Object.keys(attributes).forEach(function (name) { |
| 13858 |
_this.scroll.formatAt(index, length, name, attributes[name]); |
| 13859 |
}); |
| 13860 |
return index + length; |
| 13861 |
}, 0); |
| 13862 |
delta.reduce(function (index, op) { |
| 13863 |
if (typeof op.delete === 'number') { |
| 13864 |
_this.scroll.deleteAt(index, op.delete); |
| 13865 |
return index; |
| 13866 |
} |
| 13867 |
return index + (op.retain || op.insert.length || 1); |
| 13868 |
}, 0); |
| 13869 |
this.scroll.batchEnd(); |
| 13870 |
return this.update(delta); |
| 13871 |
} |
| 13872 |
}, { |
| 13873 |
key: 'deleteText', |
| 13874 |
value: function deleteText(index, length) { |
| 13875 |
this.scroll.deleteAt(index, length); |
| 13876 |
return this.update(new _quillDelta2.default().retain(index).delete(length)); |
| 13877 |
} |
| 13878 |
}, { |
| 13879 |
key: 'formatLine', |
| 13880 |
value: function formatLine(index, length) { |
| 13881 |
var _this2 = this; |
| 13882 |
|
| 13883 |
var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
| 13884 |
|
| 13885 |
this.scroll.update(); |
| 13886 |
Object.keys(formats).forEach(function (format) { |
| 13887 |
if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; |
| 13888 |
var lines = _this2.scroll.lines(index, Math.max(length, 1)); |
| 13889 |
var lengthRemaining = length; |
| 13890 |
lines.forEach(function (line) { |
| 13891 |
var lineLength = line.length(); |
| 13892 |
if (!(line instanceof _code2.default)) { |
| 13893 |
line.format(format, formats[format]); |
| 13894 |
} else { |
| 13895 |
var codeIndex = index - line.offset(_this2.scroll); |
| 13896 |
var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; |
| 13897 |
line.formatAt(codeIndex, codeLength, format, formats[format]); |
| 13898 |
} |
| 13899 |
lengthRemaining -= lineLength; |
| 13900 |
}); |
| 13901 |
}); |
| 13902 |
this.scroll.optimize(); |
| 13903 |
return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); |
| 13904 |
} |
| 13905 |
}, { |
| 13906 |
key: 'formatText', |
| 13907 |
value: function formatText(index, length) { |
| 13908 |
var _this3 = this; |
| 13909 |
|
| 13910 |
var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
| 13911 |
|
| 13912 |
Object.keys(formats).forEach(function (format) { |
| 13913 |
_this3.scroll.formatAt(index, length, format, formats[format]); |
| 13914 |
}); |
| 13915 |
return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); |
| 13916 |
} |
| 13917 |
}, { |
| 13918 |
key: 'getContents', |
| 13919 |
value: function getContents(index, length) { |
| 13920 |
return this.delta.slice(index, index + length); |
| 13921 |
} |
| 13922 |
}, { |
| 13923 |
key: 'getDelta', |
| 13924 |
value: function getDelta() { |
| 13925 |
return this.scroll.lines().reduce(function (delta, line) { |
| 13926 |
return delta.concat(line.delta()); |
| 13927 |
}, new _quillDelta2.default()); |
| 13928 |
} |
| 13929 |
}, { |
| 13930 |
key: 'getFormat', |
| 13931 |
value: function getFormat(index) { |
| 13932 |
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; |
| 13933 |
|
| 13934 |
var lines = [], |
| 13935 |
leaves = []; |
| 13936 |
if (length === 0) { |
| 13937 |
this.scroll.path(index).forEach(function (path) { |
| 13938 |
var _path = _slicedToArray(path, 1), |
| 13939 |
blot = _path[0]; |
| 13940 |
|
| 13941 |
if (blot instanceof _block2.default) { |
| 13942 |
lines.push(blot); |
| 13943 |
} else if (blot instanceof _parchment2.default.Leaf) { |
| 13944 |
leaves.push(blot); |
| 13945 |
} |
| 13946 |
}); |
| 13947 |
} else { |
| 13948 |
lines = this.scroll.lines(index, length); |
| 13949 |
leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); |
| 13950 |
} |
| 13951 |
var formatsArr = [lines, leaves].map(function (blots) { |
| 13952 |
if (blots.length === 0) return {}; |
| 13953 |
var formats = (0, _block.bubbleFormats)(blots.shift()); |
| 13954 |
while (Object.keys(formats).length > 0) { |
| 13955 |
var blot = blots.shift(); |
| 13956 |
if (blot == null) return formats; |
| 13957 |
formats = combineFormats((0, _block.bubbleFormats)(blot), formats); |
| 13958 |
} |
| 13959 |
return formats; |
| 13960 |
}); |
| 13961 |
return _extend2.default.apply(_extend2.default, formatsArr); |
| 13962 |
} |
| 13963 |
}, { |
| 13964 |
key: 'getText', |
| 13965 |
value: function getText(index, length) { |
| 13966 |
return this.getContents(index, length).filter(function (op) { |
| 13967 |
return typeof op.insert === 'string'; |
| 13968 |
}).map(function (op) { |
| 13969 |
return op.insert; |
| 13970 |
}).join(''); |
| 13971 |
} |
| 13972 |
}, { |
| 13973 |
key: 'insertEmbed', |
| 13974 |
value: function insertEmbed(index, embed, value) { |
| 13975 |
this.scroll.insertAt(index, embed, value); |
| 13976 |
return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); |
| 13977 |
} |
| 13978 |
}, { |
| 13979 |
key: 'insertText', |
| 13980 |
value: function insertText(index, text) { |
| 13981 |
var _this4 = this; |
| 13982 |
|
| 13983 |
var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
| 13984 |
|
| 13985 |
text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); |
| 13986 |
this.scroll.insertAt(index, text); |
| 13987 |
Object.keys(formats).forEach(function (format) { |
| 13988 |
_this4.scroll.formatAt(index, text.length, format, formats[format]); |
| 13989 |
}); |
| 13990 |
return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); |
| 13991 |
} |
| 13992 |
}, { |
| 13993 |
key: 'isBlank', |
| 13994 |
value: function isBlank() { |
| 13995 |
if (this.scroll.children.length == 0) return true; |
| 13996 |
if (this.scroll.children.length > 1) return false; |
| 13997 |
var block = this.scroll.children.head; |
| 13998 |
if (block.statics.blotName !== _block2.default.blotName) return false; |
| 13999 |
if (block.children.length > 1) return false; |
| 14000 |
return block.children.head instanceof _break2.default; |
| 14001 |
} |
| 14002 |
}, { |
| 14003 |
key: 'removeFormat', |
| 14004 |
value: function removeFormat(index, length) { |
| 14005 |
var text = this.getText(index, length); |
| 14006 |
|
| 14007 |
var _scroll$line3 = this.scroll.line(index + length), |
| 14008 |
_scroll$line4 = _slicedToArray(_scroll$line3, 2), |
| 14009 |
line = _scroll$line4[0], |
| 14010 |
offset = _scroll$line4[1]; |
| 14011 |
|
| 14012 |
var suffixLength = 0, |
| 14013 |
suffix = new _quillDelta2.default(); |
| 14014 |
if (line != null) { |
| 14015 |
if (!(line instanceof _code2.default)) { |
| 14016 |
suffixLength = line.length() - offset; |
| 14017 |
} else { |
| 14018 |
suffixLength = line.newlineIndex(offset) - offset + 1; |
| 14019 |
} |
| 14020 |
suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); |
| 14021 |
} |
| 14022 |
var contents = this.getContents(index, length + suffixLength); |
| 14023 |
var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); |
| 14024 |
var delta = new _quillDelta2.default().retain(index).concat(diff); |
| 14025 |
return this.applyDelta(delta); |
| 14026 |
} |
| 14027 |
}, { |
| 14028 |
key: 'update', |
| 14029 |
value: function update(change) { |
| 14030 |
var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; |
| 14031 |
var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; |
| 14032 |
|
| 14033 |
var oldDelta = this.delta; |
| 14034 |
if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { |
| 14035 |
// Optimization for character changes |
| 14036 |
var textBlot = _parchment2.default.find(mutations[0].target); |
| 14037 |
var formats = (0, _block.bubbleFormats)(textBlot); |
| 14038 |
var index = textBlot.offset(this.scroll); |
| 14039 |
var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); |
| 14040 |
var oldText = new _quillDelta2.default().insert(oldValue); |
| 14041 |
var newText = new _quillDelta2.default().insert(textBlot.value()); |
| 14042 |
var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); |
| 14043 |
change = diffDelta.reduce(function (delta, op) { |
| 14044 |
if (op.insert) { |
| 14045 |
return delta.insert(op.insert, formats); |
| 14046 |
} else { |
| 14047 |
return delta.push(op); |
| 14048 |
} |
| 14049 |
}, new _quillDelta2.default()); |
| 14050 |
this.delta = oldDelta.compose(change); |
| 14051 |
} else { |
| 14052 |
this.delta = this.getDelta(); |
| 14053 |
if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { |
| 14054 |
change = oldDelta.diff(this.delta, cursorIndex); |
| 14055 |
} |
| 14056 |
} |
| 14057 |
return change; |
| 14058 |
} |
| 14059 |
}]); |
| 14060 |
|
| 14061 |
return Editor; |
| 14062 |
}(); |
| 14063 |
|
| 14064 |
function combineFormats(formats, combined) { |
| 14065 |
return Object.keys(combined).reduce(function (merged, name) { |
| 14066 |
if (formats[name] == null) return merged; |
| 14067 |
if (combined[name] === formats[name]) { |
| 14068 |
merged[name] = combined[name]; |
| 14069 |
} else if (Array.isArray(combined[name])) { |
| 14070 |
if (combined[name].indexOf(formats[name]) < 0) { |
| 14071 |
merged[name] = combined[name].concat([formats[name]]); |
| 14072 |
} |
| 14073 |
} else { |
| 14074 |
merged[name] = [combined[name], formats[name]]; |
| 14075 |
} |
| 14076 |
return merged; |
| 14077 |
}, {}); |
| 14078 |
} |
| 14079 |
|
| 14080 |
function normalizeDelta(delta) { |
| 14081 |
return delta.reduce(function (delta, op) { |
| 14082 |
if (op.insert === 1) { |
| 14083 |
var attributes = (0, _clone2.default)(op.attributes); |
| 14084 |
delete attributes['image']; |
| 14085 |
return delta.insert({ image: op.attributes.image }, attributes); |
| 14086 |
} |
| 14087 |
if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { |
| 14088 |
op = (0, _clone2.default)(op); |
| 14089 |
if (op.attributes.list) { |
| 14090 |
op.attributes.list = 'ordered'; |
| 14091 |
} else { |
| 14092 |
op.attributes.list = 'bullet'; |
| 14093 |
delete op.attributes.bullet; |
| 14094 |
} |
| 14095 |
} |
| 14096 |
if (typeof op.insert === 'string') { |
| 14097 |
var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); |
| 14098 |
return delta.insert(text, op.attributes); |
| 14099 |
} |
| 14100 |
return delta.push(op); |
| 14101 |
}, new _quillDelta2.default()); |
| 14102 |
} |
| 14103 |
|
| 14104 |
exports.default = Editor; |
| 14105 |
|
| 14106 |
/***/ }), |
| 14107 |
/* 15 */ |
| 14108 |
/***/ (function(module, exports, __nested_webpack_require_98688__) { |
| 14109 |
|
| 14110 |
"use strict"; |
| 14111 |
|
| 14112 |
|
| 14113 |
Object.defineProperty(exports, "__esModule", { |
| 14114 |
value: true |
| 14115 |
}); |
| 14116 |
exports.default = exports.Range = undefined; |
| 14117 |
|
| 14118 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 14119 |
|
| 14120 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 14121 |
|
| 14122 |
var _parchment = __nested_webpack_require_98688__(0); |
| 14123 |
|
| 14124 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 14125 |
|
| 14126 |
var _clone = __nested_webpack_require_98688__(21); |
| 14127 |
|
| 14128 |
var _clone2 = _interopRequireDefault(_clone); |
| 14129 |
|
| 14130 |
var _deepEqual = __nested_webpack_require_98688__(11); |
| 14131 |
|
| 14132 |
var _deepEqual2 = _interopRequireDefault(_deepEqual); |
| 14133 |
|
| 14134 |
var _emitter3 = __nested_webpack_require_98688__(8); |
| 14135 |
|
| 14136 |
var _emitter4 = _interopRequireDefault(_emitter3); |
| 14137 |
|
| 14138 |
var _logger = __nested_webpack_require_98688__(10); |
| 14139 |
|
| 14140 |
var _logger2 = _interopRequireDefault(_logger); |
| 14141 |
|
| 14142 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 14143 |
|
| 14144 |
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } |
| 14145 |
|
| 14146 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 14147 |
|
| 14148 |
var debug = (0, _logger2.default)('quill:selection'); |
| 14149 |
|
| 14150 |
var Range = function Range(index) { |
| 14151 |
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; |
| 14152 |
|
| 14153 |
_classCallCheck(this, Range); |
| 14154 |
|
| 14155 |
this.index = index; |
| 14156 |
this.length = length; |
| 14157 |
}; |
| 14158 |
|
| 14159 |
var Selection = function () { |
| 14160 |
function Selection(scroll, emitter) { |
| 14161 |
var _this = this; |
| 14162 |
|
| 14163 |
_classCallCheck(this, Selection); |
| 14164 |
|
| 14165 |
this.emitter = emitter; |
| 14166 |
this.scroll = scroll; |
| 14167 |
this.composing = false; |
| 14168 |
this.mouseDown = false; |
| 14169 |
this.root = this.scroll.domNode; |
| 14170 |
this.cursor = _parchment2.default.create('cursor', this); |
| 14171 |
// savedRange is last non-null range |
| 14172 |
this.lastRange = this.savedRange = new Range(0, 0); |
| 14173 |
this.handleComposition(); |
| 14174 |
this.handleDragging(); |
| 14175 |
this.emitter.listenDOM('selectionchange', document, function () { |
| 14176 |
if (!_this.mouseDown) { |
| 14177 |
setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); |
| 14178 |
} |
| 14179 |
}); |
| 14180 |
this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { |
| 14181 |
if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { |
| 14182 |
_this.update(_emitter4.default.sources.SILENT); |
| 14183 |
} |
| 14184 |
}); |
| 14185 |
this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { |
| 14186 |
if (!_this.hasFocus()) return; |
| 14187 |
var native = _this.getNativeRange(); |
| 14188 |
if (native == null) return; |
| 14189 |
if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle |
| 14190 |
// TODO unclear if this has negative side effects |
| 14191 |
_this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { |
| 14192 |
try { |
| 14193 |
_this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); |
| 14194 |
} catch (ignored) {} |
| 14195 |
}); |
| 14196 |
}); |
| 14197 |
this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { |
| 14198 |
if (context.range) { |
| 14199 |
var _context$range = context.range, |
| 14200 |
startNode = _context$range.startNode, |
| 14201 |
startOffset = _context$range.startOffset, |
| 14202 |
endNode = _context$range.endNode, |
| 14203 |
endOffset = _context$range.endOffset; |
| 14204 |
|
| 14205 |
_this.setNativeRange(startNode, startOffset, endNode, endOffset); |
| 14206 |
} |
| 14207 |
}); |
| 14208 |
this.update(_emitter4.default.sources.SILENT); |
| 14209 |
} |
| 14210 |
|
| 14211 |
_createClass(Selection, [{ |
| 14212 |
key: 'handleComposition', |
| 14213 |
value: function handleComposition() { |
| 14214 |
var _this2 = this; |
| 14215 |
|
| 14216 |
this.root.addEventListener('compositionstart', function () { |
| 14217 |
_this2.composing = true; |
| 14218 |
}); |
| 14219 |
this.root.addEventListener('compositionend', function () { |
| 14220 |
_this2.composing = false; |
| 14221 |
if (_this2.cursor.parent) { |
| 14222 |
var range = _this2.cursor.restore(); |
| 14223 |
if (!range) return; |
| 14224 |
setTimeout(function () { |
| 14225 |
_this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); |
| 14226 |
}, 1); |
| 14227 |
} |
| 14228 |
}); |
| 14229 |
} |
| 14230 |
}, { |
| 14231 |
key: 'handleDragging', |
| 14232 |
value: function handleDragging() { |
| 14233 |
var _this3 = this; |
| 14234 |
|
| 14235 |
this.emitter.listenDOM('mousedown', document.body, function () { |
| 14236 |
_this3.mouseDown = true; |
| 14237 |
}); |
| 14238 |
this.emitter.listenDOM('mouseup', document.body, function () { |
| 14239 |
_this3.mouseDown = false; |
| 14240 |
_this3.update(_emitter4.default.sources.USER); |
| 14241 |
}); |
| 14242 |
} |
| 14243 |
}, { |
| 14244 |
key: 'focus', |
| 14245 |
value: function focus() { |
| 14246 |
if (this.hasFocus()) return; |
| 14247 |
this.root.focus(); |
| 14248 |
this.setRange(this.savedRange); |
| 14249 |
} |
| 14250 |
}, { |
| 14251 |
key: 'format', |
| 14252 |
value: function format(_format, value) { |
| 14253 |
if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; |
| 14254 |
this.scroll.update(); |
| 14255 |
var nativeRange = this.getNativeRange(); |
| 14256 |
if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; |
| 14257 |
if (nativeRange.start.node !== this.cursor.textNode) { |
| 14258 |
var blot = _parchment2.default.find(nativeRange.start.node, false); |
| 14259 |
if (blot == null) return; |
| 14260 |
// TODO Give blot ability to not split |
| 14261 |
if (blot instanceof _parchment2.default.Leaf) { |
| 14262 |
var after = blot.split(nativeRange.start.offset); |
| 14263 |
blot.parent.insertBefore(this.cursor, after); |
| 14264 |
} else { |
| 14265 |
blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen |
| 14266 |
} |
| 14267 |
this.cursor.attach(); |
| 14268 |
} |
| 14269 |
this.cursor.format(_format, value); |
| 14270 |
this.scroll.optimize(); |
| 14271 |
this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); |
| 14272 |
this.update(); |
| 14273 |
} |
| 14274 |
}, { |
| 14275 |
key: 'getBounds', |
| 14276 |
value: function getBounds(index) { |
| 14277 |
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; |
| 14278 |
|
| 14279 |
var scrollLength = this.scroll.length(); |
| 14280 |
index = Math.min(index, scrollLength - 1); |
| 14281 |
length = Math.min(index + length, scrollLength - 1) - index; |
| 14282 |
var node = void 0, |
| 14283 |
_scroll$leaf = this.scroll.leaf(index), |
| 14284 |
_scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), |
| 14285 |
leaf = _scroll$leaf2[0], |
| 14286 |
offset = _scroll$leaf2[1]; |
| 14287 |
if (leaf == null) return null; |
| 14288 |
|
| 14289 |
var _leaf$position = leaf.position(offset, true); |
| 14290 |
|
| 14291 |
var _leaf$position2 = _slicedToArray(_leaf$position, 2); |
| 14292 |
|
| 14293 |
node = _leaf$position2[0]; |
| 14294 |
offset = _leaf$position2[1]; |
| 14295 |
|
| 14296 |
var range = document.createRange(); |
| 14297 |
if (length > 0) { |
| 14298 |
range.setStart(node, offset); |
| 14299 |
|
| 14300 |
var _scroll$leaf3 = this.scroll.leaf(index + length); |
| 14301 |
|
| 14302 |
var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); |
| 14303 |
|
| 14304 |
leaf = _scroll$leaf4[0]; |
| 14305 |
offset = _scroll$leaf4[1]; |
| 14306 |
|
| 14307 |
if (leaf == null) return null; |
| 14308 |
|
| 14309 |
var _leaf$position3 = leaf.position(offset, true); |
| 14310 |
|
| 14311 |
var _leaf$position4 = _slicedToArray(_leaf$position3, 2); |
| 14312 |
|
| 14313 |
node = _leaf$position4[0]; |
| 14314 |
offset = _leaf$position4[1]; |
| 14315 |
|
| 14316 |
range.setEnd(node, offset); |
| 14317 |
return range.getBoundingClientRect(); |
| 14318 |
} else { |
| 14319 |
var side = 'left'; |
| 14320 |
var rect = void 0; |
| 14321 |
if (node instanceof Text) { |
| 14322 |
if (offset < node.data.length) { |
| 14323 |
range.setStart(node, offset); |
| 14324 |
range.setEnd(node, offset + 1); |
| 14325 |
} else { |
| 14326 |
range.setStart(node, offset - 1); |
| 14327 |
range.setEnd(node, offset); |
| 14328 |
side = 'right'; |
| 14329 |
} |
| 14330 |
rect = range.getBoundingClientRect(); |
| 14331 |
} else { |
| 14332 |
rect = leaf.domNode.getBoundingClientRect(); |
| 14333 |
if (offset > 0) side = 'right'; |
| 14334 |
} |
| 14335 |
return { |
| 14336 |
bottom: rect.top + rect.height, |
| 14337 |
height: rect.height, |
| 14338 |
left: rect[side], |
| 14339 |
right: rect[side], |
| 14340 |
top: rect.top, |
| 14341 |
width: 0 |
| 14342 |
}; |
| 14343 |
} |
| 14344 |
} |
| 14345 |
}, { |
| 14346 |
key: 'getNativeRange', |
| 14347 |
value: function getNativeRange() { |
| 14348 |
var selection = document.getSelection(); |
| 14349 |
if (selection == null || selection.rangeCount <= 0) return null; |
| 14350 |
var nativeRange = selection.getRangeAt(0); |
| 14351 |
if (nativeRange == null) return null; |
| 14352 |
var range = this.normalizeNative(nativeRange); |
| 14353 |
debug.info('getNativeRange', range); |
| 14354 |
return range; |
| 14355 |
} |
| 14356 |
}, { |
| 14357 |
key: 'getRange', |
| 14358 |
value: function getRange() { |
| 14359 |
var normalized = this.getNativeRange(); |
| 14360 |
if (normalized == null) return [null, null]; |
| 14361 |
var range = this.normalizedToRange(normalized); |
| 14362 |
return [range, normalized]; |
| 14363 |
} |
| 14364 |
}, { |
| 14365 |
key: 'hasFocus', |
| 14366 |
value: function hasFocus() { |
| 14367 |
return document.activeElement === this.root; |
| 14368 |
} |
| 14369 |
}, { |
| 14370 |
key: 'normalizedToRange', |
| 14371 |
value: function normalizedToRange(range) { |
| 14372 |
var _this4 = this; |
| 14373 |
|
| 14374 |
var positions = [[range.start.node, range.start.offset]]; |
| 14375 |
if (!range.native.collapsed) { |
| 14376 |
positions.push([range.end.node, range.end.offset]); |
| 14377 |
} |
| 14378 |
var indexes = positions.map(function (position) { |
| 14379 |
var _position = _slicedToArray(position, 2), |
| 14380 |
node = _position[0], |
| 14381 |
offset = _position[1]; |
| 14382 |
|
| 14383 |
var blot = _parchment2.default.find(node, true); |
| 14384 |
var index = blot.offset(_this4.scroll); |
| 14385 |
if (offset === 0) { |
| 14386 |
return index; |
| 14387 |
} else if (blot instanceof _parchment2.default.Container) { |
| 14388 |
return index + blot.length(); |
| 14389 |
} else { |
| 14390 |
return index + blot.index(node, offset); |
| 14391 |
} |
| 14392 |
}); |
| 14393 |
var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); |
| 14394 |
var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); |
| 14395 |
return new Range(start, end - start); |
| 14396 |
} |
| 14397 |
}, { |
| 14398 |
key: 'normalizeNative', |
| 14399 |
value: function normalizeNative(nativeRange) { |
| 14400 |
if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { |
| 14401 |
return null; |
| 14402 |
} |
| 14403 |
var range = { |
| 14404 |
start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, |
| 14405 |
end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, |
| 14406 |
native: nativeRange |
| 14407 |
}; |
| 14408 |
[range.start, range.end].forEach(function (position) { |
| 14409 |
var node = position.node, |
| 14410 |
offset = position.offset; |
| 14411 |
while (!(node instanceof Text) && node.childNodes.length > 0) { |
| 14412 |
if (node.childNodes.length > offset) { |
| 14413 |
node = node.childNodes[offset]; |
| 14414 |
offset = 0; |
| 14415 |
} else if (node.childNodes.length === offset) { |
| 14416 |
node = node.lastChild; |
| 14417 |
offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; |
| 14418 |
} else { |
| 14419 |
break; |
| 14420 |
} |
| 14421 |
} |
| 14422 |
position.node = node, position.offset = offset; |
| 14423 |
}); |
| 14424 |
return range; |
| 14425 |
} |
| 14426 |
}, { |
| 14427 |
key: 'rangeToNative', |
| 14428 |
value: function rangeToNative(range) { |
| 14429 |
var _this5 = this; |
| 14430 |
|
| 14431 |
var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; |
| 14432 |
var args = []; |
| 14433 |
var scrollLength = this.scroll.length(); |
| 14434 |
indexes.forEach(function (index, i) { |
| 14435 |
index = Math.min(scrollLength - 1, index); |
| 14436 |
var node = void 0, |
| 14437 |
_scroll$leaf5 = _this5.scroll.leaf(index), |
| 14438 |
_scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), |
| 14439 |
leaf = _scroll$leaf6[0], |
| 14440 |
offset = _scroll$leaf6[1]; |
| 14441 |
var _leaf$position5 = leaf.position(offset, i !== 0); |
| 14442 |
|
| 14443 |
var _leaf$position6 = _slicedToArray(_leaf$position5, 2); |
| 14444 |
|
| 14445 |
node = _leaf$position6[0]; |
| 14446 |
offset = _leaf$position6[1]; |
| 14447 |
|
| 14448 |
args.push(node, offset); |
| 14449 |
}); |
| 14450 |
if (args.length < 2) { |
| 14451 |
args = args.concat(args); |
| 14452 |
} |
| 14453 |
return args; |
| 14454 |
} |
| 14455 |
}, { |
| 14456 |
key: 'scrollIntoView', |
| 14457 |
value: function scrollIntoView(scrollingContainer) { |
| 14458 |
var range = this.lastRange; |
| 14459 |
if (range == null) return; |
| 14460 |
var bounds = this.getBounds(range.index, range.length); |
| 14461 |
if (bounds == null) return; |
| 14462 |
var limit = this.scroll.length() - 1; |
| 14463 |
|
| 14464 |
var _scroll$line = this.scroll.line(Math.min(range.index, limit)), |
| 14465 |
_scroll$line2 = _slicedToArray(_scroll$line, 1), |
| 14466 |
first = _scroll$line2[0]; |
| 14467 |
|
| 14468 |
var last = first; |
| 14469 |
if (range.length > 0) { |
| 14470 |
var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); |
| 14471 |
|
| 14472 |
var _scroll$line4 = _slicedToArray(_scroll$line3, 1); |
| 14473 |
|
| 14474 |
last = _scroll$line4[0]; |
| 14475 |
} |
| 14476 |
if (first == null || last == null) return; |
| 14477 |
var scrollBounds = scrollingContainer.getBoundingClientRect(); |
| 14478 |
if (bounds.top < scrollBounds.top) { |
| 14479 |
scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; |
| 14480 |
} else if (bounds.bottom > scrollBounds.bottom) { |
| 14481 |
scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; |
| 14482 |
} |
| 14483 |
} |
| 14484 |
}, { |
| 14485 |
key: 'setNativeRange', |
| 14486 |
value: function setNativeRange(startNode, startOffset) { |
| 14487 |
var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; |
| 14488 |
var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; |
| 14489 |
var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; |
| 14490 |
|
| 14491 |
debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); |
| 14492 |
if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { |
| 14493 |
return; |
| 14494 |
} |
| 14495 |
var selection = document.getSelection(); |
| 14496 |
if (selection == null) return; |
| 14497 |
if (startNode != null) { |
| 14498 |
if (!this.hasFocus()) this.root.focus(); |
| 14499 |
var native = (this.getNativeRange() || {}).native; |
| 14500 |
if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { |
| 14501 |
|
| 14502 |
if (startNode.tagName == "BR") { |
| 14503 |
startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); |
| 14504 |
startNode = startNode.parentNode; |
| 14505 |
} |
| 14506 |
if (endNode.tagName == "BR") { |
| 14507 |
endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); |
| 14508 |
endNode = endNode.parentNode; |
| 14509 |
} |
| 14510 |
var range = document.createRange(); |
| 14511 |
range.setStart(startNode, startOffset); |
| 14512 |
range.setEnd(endNode, endOffset); |
| 14513 |
selection.removeAllRanges(); |
| 14514 |
selection.addRange(range); |
| 14515 |
} |
| 14516 |
} else { |
| 14517 |
selection.removeAllRanges(); |
| 14518 |
this.root.blur(); |
| 14519 |
document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) |
| 14520 |
} |
| 14521 |
} |
| 14522 |
}, { |
| 14523 |
key: 'setRange', |
| 14524 |
value: function setRange(range) { |
| 14525 |
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; |
| 14526 |
var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; |
| 14527 |
|
| 14528 |
if (typeof force === 'string') { |
| 14529 |
source = force; |
| 14530 |
force = false; |
| 14531 |
} |
| 14532 |
debug.info('setRange', range); |
| 14533 |
if (range != null) { |
| 14534 |
var args = this.rangeToNative(range); |
| 14535 |
this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); |
| 14536 |
} else { |
| 14537 |
this.setNativeRange(null); |
| 14538 |
} |
| 14539 |
this.update(source); |
| 14540 |
} |
| 14541 |
}, { |
| 14542 |
key: 'update', |
| 14543 |
value: function update() { |
| 14544 |
var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; |
| 14545 |
|
| 14546 |
var oldRange = this.lastRange; |
| 14547 |
|
| 14548 |
var _getRange = this.getRange(), |
| 14549 |
_getRange2 = _slicedToArray(_getRange, 2), |
| 14550 |
lastRange = _getRange2[0], |
| 14551 |
nativeRange = _getRange2[1]; |
| 14552 |
|
| 14553 |
this.lastRange = lastRange; |
| 14554 |
if (this.lastRange != null) { |
| 14555 |
this.savedRange = this.lastRange; |
| 14556 |
} |
| 14557 |
if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { |
| 14558 |
var _emitter; |
| 14559 |
|
| 14560 |
if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { |
| 14561 |
this.cursor.restore(); |
| 14562 |
} |
| 14563 |
var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; |
| 14564 |
(_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); |
| 14565 |
if (source !== _emitter4.default.sources.SILENT) { |
| 14566 |
var _emitter2; |
| 14567 |
|
| 14568 |
(_emitter2 = this.emitter).emit.apply(_emitter2, args); |
| 14569 |
} |
| 14570 |
} |
| 14571 |
} |
| 14572 |
}]); |
| 14573 |
|
| 14574 |
return Selection; |
| 14575 |
}(); |
| 14576 |
|
| 14577 |
function contains(parent, descendant) { |
| 14578 |
try { |
| 14579 |
// Firefox inserts inaccessible nodes around video elements |
| 14580 |
descendant.parentNode; |
| 14581 |
} catch (e) { |
| 14582 |
return false; |
| 14583 |
} |
| 14584 |
// IE11 has bug with Text nodes |
| 14585 |
// https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect |
| 14586 |
if (descendant instanceof Text) { |
| 14587 |
descendant = descendant.parentNode; |
| 14588 |
} |
| 14589 |
return parent.contains(descendant); |
| 14590 |
} |
| 14591 |
|
| 14592 |
exports.Range = Range; |
| 14593 |
exports.default = Selection; |
| 14594 |
|
| 14595 |
/***/ }), |
| 14596 |
/* 16 */ |
| 14597 |
/***/ (function(module, exports, __nested_webpack_require_116908__) { |
| 14598 |
|
| 14599 |
"use strict"; |
| 14600 |
|
| 14601 |
|
| 14602 |
Object.defineProperty(exports, "__esModule", { |
| 14603 |
value: true |
| 14604 |
}); |
| 14605 |
|
| 14606 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 14607 |
|
| 14608 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 14609 |
|
| 14610 |
var _parchment = __nested_webpack_require_116908__(0); |
| 14611 |
|
| 14612 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 14613 |
|
| 14614 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 14615 |
|
| 14616 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 14617 |
|
| 14618 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 14619 |
|
| 14620 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 14621 |
|
| 14622 |
var Break = function (_Parchment$Embed) { |
| 14623 |
_inherits(Break, _Parchment$Embed); |
| 14624 |
|
| 14625 |
function Break() { |
| 14626 |
_classCallCheck(this, Break); |
| 14627 |
|
| 14628 |
return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); |
| 14629 |
} |
| 14630 |
|
| 14631 |
_createClass(Break, [{ |
| 14632 |
key: 'insertInto', |
| 14633 |
value: function insertInto(parent, ref) { |
| 14634 |
if (parent.children.length === 0) { |
| 14635 |
_get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); |
| 14636 |
} else { |
| 14637 |
this.remove(); |
| 14638 |
} |
| 14639 |
} |
| 14640 |
}, { |
| 14641 |
key: 'length', |
| 14642 |
value: function length() { |
| 14643 |
return 0; |
| 14644 |
} |
| 14645 |
}, { |
| 14646 |
key: 'value', |
| 14647 |
value: function value() { |
| 14648 |
return ''; |
| 14649 |
} |
| 14650 |
}], [{ |
| 14651 |
key: 'value', |
| 14652 |
value: function value() { |
| 14653 |
return undefined; |
| 14654 |
} |
| 14655 |
}]); |
| 14656 |
|
| 14657 |
return Break; |
| 14658 |
}(_parchment2.default.Embed); |
| 14659 |
|
| 14660 |
Break.blotName = 'break'; |
| 14661 |
Break.tagName = 'BR'; |
| 14662 |
|
| 14663 |
exports.default = Break; |
| 14664 |
|
| 14665 |
/***/ }), |
| 14666 |
/* 17 */ |
| 14667 |
/***/ (function(module, exports, __nested_webpack_require_120162__) { |
| 14668 |
|
| 14669 |
"use strict"; |
| 14670 |
|
| 14671 |
var __extends = (this && this.__extends) || (function () { |
| 14672 |
var extendStatics = Object.setPrototypeOf || |
| 14673 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 14674 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 14675 |
return function (d, b) { |
| 14676 |
extendStatics(d, b); |
| 14677 |
function __() { this.constructor = d; } |
| 14678 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 14679 |
}; |
| 14680 |
})(); |
| 14681 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 14682 |
var linked_list_1 = __nested_webpack_require_120162__(44); |
| 14683 |
var shadow_1 = __nested_webpack_require_120162__(30); |
| 14684 |
var Registry = __nested_webpack_require_120162__(1); |
| 14685 |
var ContainerBlot = /** @class */ (function (_super) { |
| 14686 |
__extends(ContainerBlot, _super); |
| 14687 |
function ContainerBlot(domNode) { |
| 14688 |
var _this = _super.call(this, domNode) || this; |
| 14689 |
_this.build(); |
| 14690 |
return _this; |
| 14691 |
} |
| 14692 |
ContainerBlot.prototype.appendChild = function (other) { |
| 14693 |
this.insertBefore(other); |
| 14694 |
}; |
| 14695 |
ContainerBlot.prototype.attach = function () { |
| 14696 |
_super.prototype.attach.call(this); |
| 14697 |
this.children.forEach(function (child) { |
| 14698 |
child.attach(); |
| 14699 |
}); |
| 14700 |
}; |
| 14701 |
ContainerBlot.prototype.build = function () { |
| 14702 |
var _this = this; |
| 14703 |
this.children = new linked_list_1.default(); |
| 14704 |
// Need to be reversed for if DOM nodes already in order |
| 14705 |
[].slice |
| 14706 |
.call(this.domNode.childNodes) |
| 14707 |
.reverse() |
| 14708 |
.forEach(function (node) { |
| 14709 |
try { |
| 14710 |
var child = makeBlot(node); |
| 14711 |
_this.insertBefore(child, _this.children.head || undefined); |
| 14712 |
} |
| 14713 |
catch (err) { |
| 14714 |
if (err instanceof Registry.ParchmentError) |
| 14715 |
return; |
| 14716 |
else |
| 14717 |
throw err; |
| 14718 |
} |
| 14719 |
}); |
| 14720 |
}; |
| 14721 |
ContainerBlot.prototype.deleteAt = function (index, length) { |
| 14722 |
if (index === 0 && length === this.length()) { |
| 14723 |
return this.remove(); |
| 14724 |
} |
| 14725 |
this.children.forEachAt(index, length, function (child, offset, length) { |
| 14726 |
child.deleteAt(offset, length); |
| 14727 |
}); |
| 14728 |
}; |
| 14729 |
ContainerBlot.prototype.descendant = function (criteria, index) { |
| 14730 |
var _a = this.children.find(index), child = _a[0], offset = _a[1]; |
| 14731 |
if ((criteria.blotName == null && criteria(child)) || |
| 14732 |
(criteria.blotName != null && child instanceof criteria)) { |
| 14733 |
return [child, offset]; |
| 14734 |
} |
| 14735 |
else if (child instanceof ContainerBlot) { |
| 14736 |
return child.descendant(criteria, offset); |
| 14737 |
} |
| 14738 |
else { |
| 14739 |
return [null, -1]; |
| 14740 |
} |
| 14741 |
}; |
| 14742 |
ContainerBlot.prototype.descendants = function (criteria, index, length) { |
| 14743 |
if (index === void 0) { index = 0; } |
| 14744 |
if (length === void 0) { length = Number.MAX_VALUE; } |
| 14745 |
var descendants = []; |
| 14746 |
var lengthLeft = length; |
| 14747 |
this.children.forEachAt(index, length, function (child, index, length) { |
| 14748 |
if ((criteria.blotName == null && criteria(child)) || |
| 14749 |
(criteria.blotName != null && child instanceof criteria)) { |
| 14750 |
descendants.push(child); |
| 14751 |
} |
| 14752 |
if (child instanceof ContainerBlot) { |
| 14753 |
descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); |
| 14754 |
} |
| 14755 |
lengthLeft -= length; |
| 14756 |
}); |
| 14757 |
return descendants; |
| 14758 |
}; |
| 14759 |
ContainerBlot.prototype.detach = function () { |
| 14760 |
this.children.forEach(function (child) { |
| 14761 |
child.detach(); |
| 14762 |
}); |
| 14763 |
_super.prototype.detach.call(this); |
| 14764 |
}; |
| 14765 |
ContainerBlot.prototype.formatAt = function (index, length, name, value) { |
| 14766 |
this.children.forEachAt(index, length, function (child, offset, length) { |
| 14767 |
child.formatAt(offset, length, name, value); |
| 14768 |
}); |
| 14769 |
}; |
| 14770 |
ContainerBlot.prototype.insertAt = function (index, value, def) { |
| 14771 |
var _a = this.children.find(index), child = _a[0], offset = _a[1]; |
| 14772 |
if (child) { |
| 14773 |
child.insertAt(offset, value, def); |
| 14774 |
} |
| 14775 |
else { |
| 14776 |
var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); |
| 14777 |
this.appendChild(blot); |
| 14778 |
} |
| 14779 |
}; |
| 14780 |
ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { |
| 14781 |
if (this.statics.allowedChildren != null && |
| 14782 |
!this.statics.allowedChildren.some(function (child) { |
| 14783 |
return childBlot instanceof child; |
| 14784 |
})) { |
| 14785 |
throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); |
| 14786 |
} |
| 14787 |
childBlot.insertInto(this, refBlot); |
| 14788 |
}; |
| 14789 |
ContainerBlot.prototype.length = function () { |
| 14790 |
return this.children.reduce(function (memo, child) { |
| 14791 |
return memo + child.length(); |
| 14792 |
}, 0); |
| 14793 |
}; |
| 14794 |
ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { |
| 14795 |
this.children.forEach(function (child) { |
| 14796 |
targetParent.insertBefore(child, refNode); |
| 14797 |
}); |
| 14798 |
}; |
| 14799 |
ContainerBlot.prototype.optimize = function (context) { |
| 14800 |
_super.prototype.optimize.call(this, context); |
| 14801 |
if (this.children.length === 0) { |
| 14802 |
if (this.statics.defaultChild != null) { |
| 14803 |
var child = Registry.create(this.statics.defaultChild); |
| 14804 |
this.appendChild(child); |
| 14805 |
child.optimize(context); |
| 14806 |
} |
| 14807 |
else { |
| 14808 |
this.remove(); |
| 14809 |
} |
| 14810 |
} |
| 14811 |
}; |
| 14812 |
ContainerBlot.prototype.path = function (index, inclusive) { |
| 14813 |
if (inclusive === void 0) { inclusive = false; } |
| 14814 |
var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; |
| 14815 |
var position = [[this, index]]; |
| 14816 |
if (child instanceof ContainerBlot) { |
| 14817 |
return position.concat(child.path(offset, inclusive)); |
| 14818 |
} |
| 14819 |
else if (child != null) { |
| 14820 |
position.push([child, offset]); |
| 14821 |
} |
| 14822 |
return position; |
| 14823 |
}; |
| 14824 |
ContainerBlot.prototype.removeChild = function (child) { |
| 14825 |
this.children.remove(child); |
| 14826 |
}; |
| 14827 |
ContainerBlot.prototype.replace = function (target) { |
| 14828 |
if (target instanceof ContainerBlot) { |
| 14829 |
target.moveChildren(this); |
| 14830 |
} |
| 14831 |
_super.prototype.replace.call(this, target); |
| 14832 |
}; |
| 14833 |
ContainerBlot.prototype.split = function (index, force) { |
| 14834 |
if (force === void 0) { force = false; } |
| 14835 |
if (!force) { |
| 14836 |
if (index === 0) |
| 14837 |
return this; |
| 14838 |
if (index === this.length()) |
| 14839 |
return this.next; |
| 14840 |
} |
| 14841 |
var after = this.clone(); |
| 14842 |
this.parent.insertBefore(after, this.next); |
| 14843 |
this.children.forEachAt(index, this.length(), function (child, offset, length) { |
| 14844 |
child = child.split(offset, force); |
| 14845 |
after.appendChild(child); |
| 14846 |
}); |
| 14847 |
return after; |
| 14848 |
}; |
| 14849 |
ContainerBlot.prototype.unwrap = function () { |
| 14850 |
this.moveChildren(this.parent, this.next); |
| 14851 |
this.remove(); |
| 14852 |
}; |
| 14853 |
ContainerBlot.prototype.update = function (mutations, context) { |
| 14854 |
var _this = this; |
| 14855 |
var addedNodes = []; |
| 14856 |
var removedNodes = []; |
| 14857 |
mutations.forEach(function (mutation) { |
| 14858 |
if (mutation.target === _this.domNode && mutation.type === 'childList') { |
| 14859 |
addedNodes.push.apply(addedNodes, mutation.addedNodes); |
| 14860 |
removedNodes.push.apply(removedNodes, mutation.removedNodes); |
| 14861 |
} |
| 14862 |
}); |
| 14863 |
removedNodes.forEach(function (node) { |
| 14864 |
// Check node has actually been removed |
| 14865 |
// One exception is Chrome does not immediately remove IFRAMEs |
| 14866 |
// from DOM but MutationRecord is correct in its reported removal |
| 14867 |
if (node.parentNode != null && |
| 14868 |
// @ts-ignore |
| 14869 |
node.tagName !== 'IFRAME' && |
| 14870 |
document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { |
| 14871 |
return; |
| 14872 |
} |
| 14873 |
var blot = Registry.find(node); |
| 14874 |
if (blot == null) |
| 14875 |
return; |
| 14876 |
if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { |
| 14877 |
blot.detach(); |
| 14878 |
} |
| 14879 |
}); |
| 14880 |
addedNodes |
| 14881 |
.filter(function (node) { |
| 14882 |
return node.parentNode == _this.domNode; |
| 14883 |
}) |
| 14884 |
.sort(function (a, b) { |
| 14885 |
if (a === b) |
| 14886 |
return 0; |
| 14887 |
if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { |
| 14888 |
return 1; |
| 14889 |
} |
| 14890 |
return -1; |
| 14891 |
}) |
| 14892 |
.forEach(function (node) { |
| 14893 |
var refBlot = null; |
| 14894 |
if (node.nextSibling != null) { |
| 14895 |
refBlot = Registry.find(node.nextSibling); |
| 14896 |
} |
| 14897 |
var blot = makeBlot(node); |
| 14898 |
if (blot.next != refBlot || blot.next == null) { |
| 14899 |
if (blot.parent != null) { |
| 14900 |
blot.parent.removeChild(_this); |
| 14901 |
} |
| 14902 |
_this.insertBefore(blot, refBlot || undefined); |
| 14903 |
} |
| 14904 |
}); |
| 14905 |
}; |
| 14906 |
return ContainerBlot; |
| 14907 |
}(shadow_1.default)); |
| 14908 |
function makeBlot(node) { |
| 14909 |
var blot = Registry.find(node); |
| 14910 |
if (blot == null) { |
| 14911 |
try { |
| 14912 |
blot = Registry.create(node); |
| 14913 |
} |
| 14914 |
catch (e) { |
| 14915 |
blot = Registry.create(Registry.Scope.INLINE); |
| 14916 |
[].slice.call(node.childNodes).forEach(function (child) { |
| 14917 |
// @ts-ignore |
| 14918 |
blot.domNode.appendChild(child); |
| 14919 |
}); |
| 14920 |
if (node.parentNode) { |
| 14921 |
node.parentNode.replaceChild(blot.domNode, node); |
| 14922 |
} |
| 14923 |
blot.attach(); |
| 14924 |
} |
| 14925 |
} |
| 14926 |
return blot; |
| 14927 |
} |
| 14928 |
exports.default = ContainerBlot; |
| 14929 |
|
| 14930 |
|
| 14931 |
/***/ }), |
| 14932 |
/* 18 */ |
| 14933 |
/***/ (function(module, exports, __nested_webpack_require_130088__) { |
| 14934 |
|
| 14935 |
"use strict"; |
| 14936 |
|
| 14937 |
var __extends = (this && this.__extends) || (function () { |
| 14938 |
var extendStatics = Object.setPrototypeOf || |
| 14939 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 14940 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 14941 |
return function (d, b) { |
| 14942 |
extendStatics(d, b); |
| 14943 |
function __() { this.constructor = d; } |
| 14944 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 14945 |
}; |
| 14946 |
})(); |
| 14947 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 14948 |
var attributor_1 = __nested_webpack_require_130088__(12); |
| 14949 |
var store_1 = __nested_webpack_require_130088__(31); |
| 14950 |
var container_1 = __nested_webpack_require_130088__(17); |
| 14951 |
var Registry = __nested_webpack_require_130088__(1); |
| 14952 |
var FormatBlot = /** @class */ (function (_super) { |
| 14953 |
__extends(FormatBlot, _super); |
| 14954 |
function FormatBlot(domNode) { |
| 14955 |
var _this = _super.call(this, domNode) || this; |
| 14956 |
_this.attributes = new store_1.default(_this.domNode); |
| 14957 |
return _this; |
| 14958 |
} |
| 14959 |
FormatBlot.formats = function (domNode) { |
| 14960 |
if (typeof this.tagName === 'string') { |
| 14961 |
return true; |
| 14962 |
} |
| 14963 |
else if (Array.isArray(this.tagName)) { |
| 14964 |
return domNode.tagName.toLowerCase(); |
| 14965 |
} |
| 14966 |
return undefined; |
| 14967 |
}; |
| 14968 |
FormatBlot.prototype.format = function (name, value) { |
| 14969 |
var format = Registry.query(name); |
| 14970 |
if (format instanceof attributor_1.default) { |
| 14971 |
this.attributes.attribute(format, value); |
| 14972 |
} |
| 14973 |
else if (value) { |
| 14974 |
if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { |
| 14975 |
this.replaceWith(name, value); |
| 14976 |
} |
| 14977 |
} |
| 14978 |
}; |
| 14979 |
FormatBlot.prototype.formats = function () { |
| 14980 |
var formats = this.attributes.values(); |
| 14981 |
var format = this.statics.formats(this.domNode); |
| 14982 |
if (format != null) { |
| 14983 |
formats[this.statics.blotName] = format; |
| 14984 |
} |
| 14985 |
return formats; |
| 14986 |
}; |
| 14987 |
FormatBlot.prototype.replaceWith = function (name, value) { |
| 14988 |
var replacement = _super.prototype.replaceWith.call(this, name, value); |
| 14989 |
this.attributes.copy(replacement); |
| 14990 |
return replacement; |
| 14991 |
}; |
| 14992 |
FormatBlot.prototype.update = function (mutations, context) { |
| 14993 |
var _this = this; |
| 14994 |
_super.prototype.update.call(this, mutations, context); |
| 14995 |
if (mutations.some(function (mutation) { |
| 14996 |
return mutation.target === _this.domNode && mutation.type === 'attributes'; |
| 14997 |
})) { |
| 14998 |
this.attributes.build(); |
| 14999 |
} |
| 15000 |
}; |
| 15001 |
FormatBlot.prototype.wrap = function (name, value) { |
| 15002 |
var wrapper = _super.prototype.wrap.call(this, name, value); |
| 15003 |
if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { |
| 15004 |
this.attributes.move(wrapper); |
| 15005 |
} |
| 15006 |
return wrapper; |
| 15007 |
}; |
| 15008 |
return FormatBlot; |
| 15009 |
}(container_1.default)); |
| 15010 |
exports.default = FormatBlot; |
| 15011 |
|
| 15012 |
|
| 15013 |
/***/ }), |
| 15014 |
/* 19 */ |
| 15015 |
/***/ (function(module, exports, __nested_webpack_require_133111__) { |
| 15016 |
|
| 15017 |
"use strict"; |
| 15018 |
|
| 15019 |
var __extends = (this && this.__extends) || (function () { |
| 15020 |
var extendStatics = Object.setPrototypeOf || |
| 15021 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 15022 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 15023 |
return function (d, b) { |
| 15024 |
extendStatics(d, b); |
| 15025 |
function __() { this.constructor = d; } |
| 15026 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 15027 |
}; |
| 15028 |
})(); |
| 15029 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 15030 |
var shadow_1 = __nested_webpack_require_133111__(30); |
| 15031 |
var Registry = __nested_webpack_require_133111__(1); |
| 15032 |
var LeafBlot = /** @class */ (function (_super) { |
| 15033 |
__extends(LeafBlot, _super); |
| 15034 |
function LeafBlot() { |
| 15035 |
return _super !== null && _super.apply(this, arguments) || this; |
| 15036 |
} |
| 15037 |
LeafBlot.value = function (domNode) { |
| 15038 |
return true; |
| 15039 |
}; |
| 15040 |
LeafBlot.prototype.index = function (node, offset) { |
| 15041 |
if (this.domNode === node || |
| 15042 |
this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { |
| 15043 |
return Math.min(offset, 1); |
| 15044 |
} |
| 15045 |
return -1; |
| 15046 |
}; |
| 15047 |
LeafBlot.prototype.position = function (index, inclusive) { |
| 15048 |
var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); |
| 15049 |
if (index > 0) |
| 15050 |
offset += 1; |
| 15051 |
return [this.parent.domNode, offset]; |
| 15052 |
}; |
| 15053 |
LeafBlot.prototype.value = function () { |
| 15054 |
var _a; |
| 15055 |
return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; |
| 15056 |
}; |
| 15057 |
LeafBlot.scope = Registry.Scope.INLINE_BLOT; |
| 15058 |
return LeafBlot; |
| 15059 |
}(shadow_1.default)); |
| 15060 |
exports.default = LeafBlot; |
| 15061 |
|
| 15062 |
|
| 15063 |
/***/ }), |
| 15064 |
/* 20 */ |
| 15065 |
/***/ (function(module, exports, __nested_webpack_require_134898__) { |
| 15066 |
|
| 15067 |
var equal = __nested_webpack_require_134898__(11); |
| 15068 |
var extend = __nested_webpack_require_134898__(3); |
| 15069 |
|
| 15070 |
|
| 15071 |
var lib = { |
| 15072 |
attributes: { |
| 15073 |
compose: function (a, b, keepNull) { |
| 15074 |
if (typeof a !== 'object') a = {}; |
| 15075 |
if (typeof b !== 'object') b = {}; |
| 15076 |
var attributes = extend(true, {}, b); |
| 15077 |
if (!keepNull) { |
| 15078 |
attributes = Object.keys(attributes).reduce(function (copy, key) { |
| 15079 |
if (attributes[key] != null) { |
| 15080 |
copy[key] = attributes[key]; |
| 15081 |
} |
| 15082 |
return copy; |
| 15083 |
}, {}); |
| 15084 |
} |
| 15085 |
for (var key in a) { |
| 15086 |
if (a[key] !== undefined && b[key] === undefined) { |
| 15087 |
attributes[key] = a[key]; |
| 15088 |
} |
| 15089 |
} |
| 15090 |
return Object.keys(attributes).length > 0 ? attributes : undefined; |
| 15091 |
}, |
| 15092 |
|
| 15093 |
diff: function(a, b) { |
| 15094 |
if (typeof a !== 'object') a = {}; |
| 15095 |
if (typeof b !== 'object') b = {}; |
| 15096 |
var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { |
| 15097 |
if (!equal(a[key], b[key])) { |
| 15098 |
attributes[key] = b[key] === undefined ? null : b[key]; |
| 15099 |
} |
| 15100 |
return attributes; |
| 15101 |
}, {}); |
| 15102 |
return Object.keys(attributes).length > 0 ? attributes : undefined; |
| 15103 |
}, |
| 15104 |
|
| 15105 |
transform: function (a, b, priority) { |
| 15106 |
if (typeof a !== 'object') return b; |
| 15107 |
if (typeof b !== 'object') return undefined; |
| 15108 |
if (!priority) return b; // b simply overwrites us without priority |
| 15109 |
var attributes = Object.keys(b).reduce(function (attributes, key) { |
| 15110 |
if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value |
| 15111 |
return attributes; |
| 15112 |
}, {}); |
| 15113 |
return Object.keys(attributes).length > 0 ? attributes : undefined; |
| 15114 |
} |
| 15115 |
}, |
| 15116 |
|
| 15117 |
iterator: function (ops) { |
| 15118 |
return new Iterator(ops); |
| 15119 |
}, |
| 15120 |
|
| 15121 |
length: function (op) { |
| 15122 |
if (typeof op['delete'] === 'number') { |
| 15123 |
return op['delete']; |
| 15124 |
} else if (typeof op.retain === 'number') { |
| 15125 |
return op.retain; |
| 15126 |
} else { |
| 15127 |
return typeof op.insert === 'string' ? op.insert.length : 1; |
| 15128 |
} |
| 15129 |
} |
| 15130 |
}; |
| 15131 |
|
| 15132 |
|
| 15133 |
function Iterator(ops) { |
| 15134 |
this.ops = ops; |
| 15135 |
this.index = 0; |
| 15136 |
this.offset = 0; |
| 15137 |
}; |
| 15138 |
|
| 15139 |
Iterator.prototype.hasNext = function () { |
| 15140 |
return this.peekLength() < Infinity; |
| 15141 |
}; |
| 15142 |
|
| 15143 |
Iterator.prototype.next = function (length) { |
| 15144 |
if (!length) length = Infinity; |
| 15145 |
var nextOp = this.ops[this.index]; |
| 15146 |
if (nextOp) { |
| 15147 |
var offset = this.offset; |
| 15148 |
var opLength = lib.length(nextOp) |
| 15149 |
if (length >= opLength - offset) { |
| 15150 |
length = opLength - offset; |
| 15151 |
this.index += 1; |
| 15152 |
this.offset = 0; |
| 15153 |
} else { |
| 15154 |
this.offset += length; |
| 15155 |
} |
| 15156 |
if (typeof nextOp['delete'] === 'number') { |
| 15157 |
return { 'delete': length }; |
| 15158 |
} else { |
| 15159 |
var retOp = {}; |
| 15160 |
if (nextOp.attributes) { |
| 15161 |
retOp.attributes = nextOp.attributes; |
| 15162 |
} |
| 15163 |
if (typeof nextOp.retain === 'number') { |
| 15164 |
retOp.retain = length; |
| 15165 |
} else if (typeof nextOp.insert === 'string') { |
| 15166 |
retOp.insert = nextOp.insert.substr(offset, length); |
| 15167 |
} else { |
| 15168 |
// offset should === 0, length should === 1 |
| 15169 |
retOp.insert = nextOp.insert; |
| 15170 |
} |
| 15171 |
return retOp; |
| 15172 |
} |
| 15173 |
} else { |
| 15174 |
return { retain: Infinity }; |
| 15175 |
} |
| 15176 |
}; |
| 15177 |
|
| 15178 |
Iterator.prototype.peek = function () { |
| 15179 |
return this.ops[this.index]; |
| 15180 |
}; |
| 15181 |
|
| 15182 |
Iterator.prototype.peekLength = function () { |
| 15183 |
if (this.ops[this.index]) { |
| 15184 |
// Should never return 0 if our index is being managed correctly |
| 15185 |
return lib.length(this.ops[this.index]) - this.offset; |
| 15186 |
} else { |
| 15187 |
return Infinity; |
| 15188 |
} |
| 15189 |
}; |
| 15190 |
|
| 15191 |
Iterator.prototype.peekType = function () { |
| 15192 |
if (this.ops[this.index]) { |
| 15193 |
if (typeof this.ops[this.index]['delete'] === 'number') { |
| 15194 |
return 'delete'; |
| 15195 |
} else if (typeof this.ops[this.index].retain === 'number') { |
| 15196 |
return 'retain'; |
| 15197 |
} else { |
| 15198 |
return 'insert'; |
| 15199 |
} |
| 15200 |
} |
| 15201 |
return 'retain'; |
| 15202 |
}; |
| 15203 |
|
| 15204 |
Iterator.prototype.rest = function () { |
| 15205 |
if (!this.hasNext()) { |
| 15206 |
return []; |
| 15207 |
} else if (this.offset === 0) { |
| 15208 |
return this.ops.slice(this.index); |
| 15209 |
} else { |
| 15210 |
var offset = this.offset; |
| 15211 |
var index = this.index; |
| 15212 |
var next = this.next(); |
| 15213 |
var rest = this.ops.slice(this.index); |
| 15214 |
this.offset = offset; |
| 15215 |
this.index = index; |
| 15216 |
return [next].concat(rest); |
| 15217 |
} |
| 15218 |
}; |
| 15219 |
|
| 15220 |
|
| 15221 |
module.exports = lib; |
| 15222 |
|
| 15223 |
|
| 15224 |
/***/ }), |
| 15225 |
/* 21 */ |
| 15226 |
/***/ (function(module, exports) { |
| 15227 |
|
| 15228 |
var clone = (function() { |
| 15229 |
'use strict'; |
| 15230 |
|
| 15231 |
function _instanceof(obj, type) { |
| 15232 |
return type != null && obj instanceof type; |
| 15233 |
} |
| 15234 |
|
| 15235 |
var nativeMap; |
| 15236 |
try { |
| 15237 |
nativeMap = Map; |
| 15238 |
} catch(_) { |
| 15239 |
// maybe a reference error because no `Map`. Give it a dummy value that no |
| 15240 |
// value will ever be an instanceof. |
| 15241 |
nativeMap = function() {}; |
| 15242 |
} |
| 15243 |
|
| 15244 |
var nativeSet; |
| 15245 |
try { |
| 15246 |
nativeSet = Set; |
| 15247 |
} catch(_) { |
| 15248 |
nativeSet = function() {}; |
| 15249 |
} |
| 15250 |
|
| 15251 |
var nativePromise; |
| 15252 |
try { |
| 15253 |
nativePromise = Promise; |
| 15254 |
} catch(_) { |
| 15255 |
nativePromise = function() {}; |
| 15256 |
} |
| 15257 |
|
| 15258 |
/** |
| 15259 |
* Clones (copies) an Object using deep copying. |
| 15260 |
* |
| 15261 |
* This function supports circular references by default, but if you are certain |
| 15262 |
* there are no circular references in your object, you can save some CPU time |
| 15263 |
* by calling clone(obj, false). |
| 15264 |
* |
| 15265 |
* Caution: if `circular` is false and `parent` contains circular references, |
| 15266 |
* your program may enter an infinite loop and crash. |
| 15267 |
* |
| 15268 |
* @param `parent` - the object to be cloned |
| 15269 |
* @param `circular` - set to true if the object to be cloned may contain |
| 15270 |
* circular references. (optional - true by default) |
| 15271 |
* @param `depth` - set to a number if the object is only to be cloned to |
| 15272 |
* a particular depth. (optional - defaults to Infinity) |
| 15273 |
* @param `prototype` - sets the prototype to be used when cloning an object. |
| 15274 |
* (optional - defaults to parent prototype). |
| 15275 |
* @param `includeNonEnumerable` - set to true if the non-enumerable properties |
| 15276 |
* should be cloned as well. Non-enumerable properties on the prototype |
| 15277 |
* chain will be ignored. (optional - false by default) |
| 15278 |
*/ |
| 15279 |
function clone(parent, circular, depth, prototype, includeNonEnumerable) { |
| 15280 |
if (typeof circular === 'object') { |
| 15281 |
depth = circular.depth; |
| 15282 |
prototype = circular.prototype; |
| 15283 |
includeNonEnumerable = circular.includeNonEnumerable; |
| 15284 |
circular = circular.circular; |
| 15285 |
} |
| 15286 |
// maintain two arrays for circular references, where corresponding parents |
| 15287 |
// and children have the same index |
| 15288 |
var allParents = []; |
| 15289 |
var allChildren = []; |
| 15290 |
|
| 15291 |
var useBuffer = typeof Buffer != 'undefined'; |
| 15292 |
|
| 15293 |
if (typeof circular == 'undefined') |
| 15294 |
circular = true; |
| 15295 |
|
| 15296 |
if (typeof depth == 'undefined') |
| 15297 |
depth = Infinity; |
| 15298 |
|
| 15299 |
// recurse this function so we don't reset allParents and allChildren |
| 15300 |
function _clone(parent, depth) { |
| 15301 |
// cloning null always returns null |
| 15302 |
if (parent === null) |
| 15303 |
return null; |
| 15304 |
|
| 15305 |
if (depth === 0) |
| 15306 |
return parent; |
| 15307 |
|
| 15308 |
var child; |
| 15309 |
var proto; |
| 15310 |
if (typeof parent != 'object') { |
| 15311 |
return parent; |
| 15312 |
} |
| 15313 |
|
| 15314 |
if (_instanceof(parent, nativeMap)) { |
| 15315 |
child = new nativeMap(); |
| 15316 |
} else if (_instanceof(parent, nativeSet)) { |
| 15317 |
child = new nativeSet(); |
| 15318 |
} else if (_instanceof(parent, nativePromise)) { |
| 15319 |
child = new nativePromise(function (resolve, reject) { |
| 15320 |
parent.then(function(value) { |
| 15321 |
resolve(_clone(value, depth - 1)); |
| 15322 |
}, function(err) { |
| 15323 |
reject(_clone(err, depth - 1)); |
| 15324 |
}); |
| 15325 |
}); |
| 15326 |
} else if (clone.__isArray(parent)) { |
| 15327 |
child = []; |
| 15328 |
} else if (clone.__isRegExp(parent)) { |
| 15329 |
child = new RegExp(parent.source, __getRegExpFlags(parent)); |
| 15330 |
if (parent.lastIndex) child.lastIndex = parent.lastIndex; |
| 15331 |
} else if (clone.__isDate(parent)) { |
| 15332 |
child = new Date(parent.getTime()); |
| 15333 |
} else if (useBuffer && Buffer.isBuffer(parent)) { |
| 15334 |
if (Buffer.allocUnsafe) { |
| 15335 |
// Node.js >= 4.5.0 |
| 15336 |
child = Buffer.allocUnsafe(parent.length); |
| 15337 |
} else { |
| 15338 |
// Older Node.js versions |
| 15339 |
child = new Buffer(parent.length); |
| 15340 |
} |
| 15341 |
parent.copy(child); |
| 15342 |
return child; |
| 15343 |
} else if (_instanceof(parent, Error)) { |
| 15344 |
child = Object.create(parent); |
| 15345 |
} else { |
| 15346 |
if (typeof prototype == 'undefined') { |
| 15347 |
proto = Object.getPrototypeOf(parent); |
| 15348 |
child = Object.create(proto); |
| 15349 |
} |
| 15350 |
else { |
| 15351 |
child = Object.create(prototype); |
| 15352 |
proto = prototype; |
| 15353 |
} |
| 15354 |
} |
| 15355 |
|
| 15356 |
if (circular) { |
| 15357 |
var index = allParents.indexOf(parent); |
| 15358 |
|
| 15359 |
if (index != -1) { |
| 15360 |
return allChildren[index]; |
| 15361 |
} |
| 15362 |
allParents.push(parent); |
| 15363 |
allChildren.push(child); |
| 15364 |
} |
| 15365 |
|
| 15366 |
if (_instanceof(parent, nativeMap)) { |
| 15367 |
parent.forEach(function(value, key) { |
| 15368 |
var keyChild = _clone(key, depth - 1); |
| 15369 |
var valueChild = _clone(value, depth - 1); |
| 15370 |
child.set(keyChild, valueChild); |
| 15371 |
}); |
| 15372 |
} |
| 15373 |
if (_instanceof(parent, nativeSet)) { |
| 15374 |
parent.forEach(function(value) { |
| 15375 |
var entryChild = _clone(value, depth - 1); |
| 15376 |
child.add(entryChild); |
| 15377 |
}); |
| 15378 |
} |
| 15379 |
|
| 15380 |
for (var i in parent) { |
| 15381 |
var attrs; |
| 15382 |
if (proto) { |
| 15383 |
attrs = Object.getOwnPropertyDescriptor(proto, i); |
| 15384 |
} |
| 15385 |
|
| 15386 |
if (attrs && attrs.set == null) { |
| 15387 |
continue; |
| 15388 |
} |
| 15389 |
child[i] = _clone(parent[i], depth - 1); |
| 15390 |
} |
| 15391 |
|
| 15392 |
if (Object.getOwnPropertySymbols) { |
| 15393 |
var symbols = Object.getOwnPropertySymbols(parent); |
| 15394 |
for (var i = 0; i < symbols.length; i++) { |
| 15395 |
// Don't need to worry about cloning a symbol because it is a primitive, |
| 15396 |
// like a number or string. |
| 15397 |
var symbol = symbols[i]; |
| 15398 |
var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); |
| 15399 |
if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { |
| 15400 |
continue; |
| 15401 |
} |
| 15402 |
child[symbol] = _clone(parent[symbol], depth - 1); |
| 15403 |
if (!descriptor.enumerable) { |
| 15404 |
Object.defineProperty(child, symbol, { |
| 15405 |
enumerable: false |
| 15406 |
}); |
| 15407 |
} |
| 15408 |
} |
| 15409 |
} |
| 15410 |
|
| 15411 |
if (includeNonEnumerable) { |
| 15412 |
var allPropertyNames = Object.getOwnPropertyNames(parent); |
| 15413 |
for (var i = 0; i < allPropertyNames.length; i++) { |
| 15414 |
var propertyName = allPropertyNames[i]; |
| 15415 |
var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); |
| 15416 |
if (descriptor && descriptor.enumerable) { |
| 15417 |
continue; |
| 15418 |
} |
| 15419 |
child[propertyName] = _clone(parent[propertyName], depth - 1); |
| 15420 |
Object.defineProperty(child, propertyName, { |
| 15421 |
enumerable: false |
| 15422 |
}); |
| 15423 |
} |
| 15424 |
} |
| 15425 |
|
| 15426 |
return child; |
| 15427 |
} |
| 15428 |
|
| 15429 |
return _clone(parent, depth); |
| 15430 |
} |
| 15431 |
|
| 15432 |
/** |
| 15433 |
* Simple flat clone using prototype, accepts only objects, usefull for property |
| 15434 |
* override on FLAT configuration object (no nested props). |
| 15435 |
* |
| 15436 |
* USE WITH CAUTION! This may not behave as you wish if you do not know how this |
| 15437 |
* works. |
| 15438 |
*/ |
| 15439 |
clone.clonePrototype = function clonePrototype(parent) { |
| 15440 |
if (parent === null) |
| 15441 |
return null; |
| 15442 |
|
| 15443 |
var c = function () {}; |
| 15444 |
c.prototype = parent; |
| 15445 |
return new c(); |
| 15446 |
}; |
| 15447 |
|
| 15448 |
// private utility functions |
| 15449 |
|
| 15450 |
function __objToStr(o) { |
| 15451 |
return Object.prototype.toString.call(o); |
| 15452 |
} |
| 15453 |
clone.__objToStr = __objToStr; |
| 15454 |
|
| 15455 |
function __isDate(o) { |
| 15456 |
return typeof o === 'object' && __objToStr(o) === '[object Date]'; |
| 15457 |
} |
| 15458 |
clone.__isDate = __isDate; |
| 15459 |
|
| 15460 |
function __isArray(o) { |
| 15461 |
return typeof o === 'object' && __objToStr(o) === '[object Array]'; |
| 15462 |
} |
| 15463 |
clone.__isArray = __isArray; |
| 15464 |
|
| 15465 |
function __isRegExp(o) { |
| 15466 |
return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; |
| 15467 |
} |
| 15468 |
clone.__isRegExp = __isRegExp; |
| 15469 |
|
| 15470 |
function __getRegExpFlags(re) { |
| 15471 |
var flags = ''; |
| 15472 |
if (re.global) flags += 'g'; |
| 15473 |
if (re.ignoreCase) flags += 'i'; |
| 15474 |
if (re.multiline) flags += 'm'; |
| 15475 |
return flags; |
| 15476 |
} |
| 15477 |
clone.__getRegExpFlags = __getRegExpFlags; |
| 15478 |
|
| 15479 |
return clone; |
| 15480 |
})(); |
| 15481 |
|
| 15482 |
if (typeof module === 'object' && module.exports) { |
| 15483 |
module.exports = clone; |
| 15484 |
} |
| 15485 |
|
| 15486 |
|
| 15487 |
/***/ }), |
| 15488 |
/* 22 */ |
| 15489 |
/***/ (function(module, exports, __nested_webpack_require_146497__) { |
| 15490 |
|
| 15491 |
"use strict"; |
| 15492 |
|
| 15493 |
|
| 15494 |
Object.defineProperty(exports, "__esModule", { |
| 15495 |
value: true |
| 15496 |
}); |
| 15497 |
|
| 15498 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 15499 |
|
| 15500 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 15501 |
|
| 15502 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 15503 |
|
| 15504 |
var _parchment = __nested_webpack_require_146497__(0); |
| 15505 |
|
| 15506 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 15507 |
|
| 15508 |
var _emitter = __nested_webpack_require_146497__(8); |
| 15509 |
|
| 15510 |
var _emitter2 = _interopRequireDefault(_emitter); |
| 15511 |
|
| 15512 |
var _block = __nested_webpack_require_146497__(4); |
| 15513 |
|
| 15514 |
var _block2 = _interopRequireDefault(_block); |
| 15515 |
|
| 15516 |
var _break = __nested_webpack_require_146497__(16); |
| 15517 |
|
| 15518 |
var _break2 = _interopRequireDefault(_break); |
| 15519 |
|
| 15520 |
var _code = __nested_webpack_require_146497__(13); |
| 15521 |
|
| 15522 |
var _code2 = _interopRequireDefault(_code); |
| 15523 |
|
| 15524 |
var _container = __nested_webpack_require_146497__(25); |
| 15525 |
|
| 15526 |
var _container2 = _interopRequireDefault(_container); |
| 15527 |
|
| 15528 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 15529 |
|
| 15530 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 15531 |
|
| 15532 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 15533 |
|
| 15534 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 15535 |
|
| 15536 |
function isLine(blot) { |
| 15537 |
return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; |
| 15538 |
} |
| 15539 |
|
| 15540 |
var Scroll = function (_Parchment$Scroll) { |
| 15541 |
_inherits(Scroll, _Parchment$Scroll); |
| 15542 |
|
| 15543 |
function Scroll(domNode, config) { |
| 15544 |
_classCallCheck(this, Scroll); |
| 15545 |
|
| 15546 |
var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); |
| 15547 |
|
| 15548 |
_this.emitter = config.emitter; |
| 15549 |
if (Array.isArray(config.whitelist)) { |
| 15550 |
_this.whitelist = config.whitelist.reduce(function (whitelist, format) { |
| 15551 |
whitelist[format] = true; |
| 15552 |
return whitelist; |
| 15553 |
}, {}); |
| 15554 |
} |
| 15555 |
// Some reason fixes composition issues with character languages in Windows/Chrome, Safari |
| 15556 |
_this.domNode.addEventListener('DOMNodeInserted', function () {}); |
| 15557 |
_this.optimize(); |
| 15558 |
_this.enable(); |
| 15559 |
return _this; |
| 15560 |
} |
| 15561 |
|
| 15562 |
_createClass(Scroll, [{ |
| 15563 |
key: 'batchStart', |
| 15564 |
value: function batchStart() { |
| 15565 |
this.batch = true; |
| 15566 |
} |
| 15567 |
}, { |
| 15568 |
key: 'batchEnd', |
| 15569 |
value: function batchEnd() { |
| 15570 |
this.batch = false; |
| 15571 |
this.optimize(); |
| 15572 |
} |
| 15573 |
}, { |
| 15574 |
key: 'deleteAt', |
| 15575 |
value: function deleteAt(index, length) { |
| 15576 |
var _line = this.line(index), |
| 15577 |
_line2 = _slicedToArray(_line, 2), |
| 15578 |
first = _line2[0], |
| 15579 |
offset = _line2[1]; |
| 15580 |
|
| 15581 |
var _line3 = this.line(index + length), |
| 15582 |
_line4 = _slicedToArray(_line3, 1), |
| 15583 |
last = _line4[0]; |
| 15584 |
|
| 15585 |
_get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); |
| 15586 |
if (last != null && first !== last && offset > 0) { |
| 15587 |
if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { |
| 15588 |
this.optimize(); |
| 15589 |
return; |
| 15590 |
} |
| 15591 |
if (first instanceof _code2.default) { |
| 15592 |
var newlineIndex = first.newlineIndex(first.length(), true); |
| 15593 |
if (newlineIndex > -1) { |
| 15594 |
first = first.split(newlineIndex + 1); |
| 15595 |
if (first === last) { |
| 15596 |
this.optimize(); |
| 15597 |
return; |
| 15598 |
} |
| 15599 |
} |
| 15600 |
} else if (last instanceof _code2.default) { |
| 15601 |
var _newlineIndex = last.newlineIndex(0); |
| 15602 |
if (_newlineIndex > -1) { |
| 15603 |
last.split(_newlineIndex + 1); |
| 15604 |
} |
| 15605 |
} |
| 15606 |
var ref = last.children.head instanceof _break2.default ? null : last.children.head; |
| 15607 |
first.moveChildren(last, ref); |
| 15608 |
first.remove(); |
| 15609 |
} |
| 15610 |
this.optimize(); |
| 15611 |
} |
| 15612 |
}, { |
| 15613 |
key: 'enable', |
| 15614 |
value: function enable() { |
| 15615 |
var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; |
| 15616 |
|
| 15617 |
this.domNode.setAttribute('contenteditable', enabled); |
| 15618 |
} |
| 15619 |
}, { |
| 15620 |
key: 'formatAt', |
| 15621 |
value: function formatAt(index, length, format, value) { |
| 15622 |
if (this.whitelist != null && !this.whitelist[format]) return; |
| 15623 |
_get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); |
| 15624 |
this.optimize(); |
| 15625 |
} |
| 15626 |
}, { |
| 15627 |
key: 'insertAt', |
| 15628 |
value: function insertAt(index, value, def) { |
| 15629 |
if (def != null && this.whitelist != null && !this.whitelist[value]) return; |
| 15630 |
if (index >= this.length()) { |
| 15631 |
if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { |
| 15632 |
var blot = _parchment2.default.create(this.statics.defaultChild); |
| 15633 |
this.appendChild(blot); |
| 15634 |
if (def == null && value.endsWith('\n')) { |
| 15635 |
value = value.slice(0, -1); |
| 15636 |
} |
| 15637 |
blot.insertAt(0, value, def); |
| 15638 |
} else { |
| 15639 |
var embed = _parchment2.default.create(value, def); |
| 15640 |
this.appendChild(embed); |
| 15641 |
} |
| 15642 |
} else { |
| 15643 |
_get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); |
| 15644 |
} |
| 15645 |
this.optimize(); |
| 15646 |
} |
| 15647 |
}, { |
| 15648 |
key: 'insertBefore', |
| 15649 |
value: function insertBefore(blot, ref) { |
| 15650 |
if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { |
| 15651 |
var wrapper = _parchment2.default.create(this.statics.defaultChild); |
| 15652 |
wrapper.appendChild(blot); |
| 15653 |
blot = wrapper; |
| 15654 |
} |
| 15655 |
_get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); |
| 15656 |
} |
| 15657 |
}, { |
| 15658 |
key: 'leaf', |
| 15659 |
value: function leaf(index) { |
| 15660 |
return this.path(index).pop() || [null, -1]; |
| 15661 |
} |
| 15662 |
}, { |
| 15663 |
key: 'line', |
| 15664 |
value: function line(index) { |
| 15665 |
if (index === this.length()) { |
| 15666 |
return this.line(index - 1); |
| 15667 |
} |
| 15668 |
return this.descendant(isLine, index); |
| 15669 |
} |
| 15670 |
}, { |
| 15671 |
key: 'lines', |
| 15672 |
value: function lines() { |
| 15673 |
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; |
| 15674 |
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; |
| 15675 |
|
| 15676 |
var getLines = function getLines(blot, index, length) { |
| 15677 |
var lines = [], |
| 15678 |
lengthLeft = length; |
| 15679 |
blot.children.forEachAt(index, length, function (child, index, length) { |
| 15680 |
if (isLine(child)) { |
| 15681 |
lines.push(child); |
| 15682 |
} else if (child instanceof _parchment2.default.Container) { |
| 15683 |
lines = lines.concat(getLines(child, index, lengthLeft)); |
| 15684 |
} |
| 15685 |
lengthLeft -= length; |
| 15686 |
}); |
| 15687 |
return lines; |
| 15688 |
}; |
| 15689 |
return getLines(this, index, length); |
| 15690 |
} |
| 15691 |
}, { |
| 15692 |
key: 'optimize', |
| 15693 |
value: function optimize() { |
| 15694 |
var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; |
| 15695 |
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 15696 |
|
| 15697 |
if (this.batch === true) return; |
| 15698 |
_get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); |
| 15699 |
if (mutations.length > 0) { |
| 15700 |
this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); |
| 15701 |
} |
| 15702 |
} |
| 15703 |
}, { |
| 15704 |
key: 'path', |
| 15705 |
value: function path(index) { |
| 15706 |
return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self |
| 15707 |
} |
| 15708 |
}, { |
| 15709 |
key: 'update', |
| 15710 |
value: function update(mutations) { |
| 15711 |
if (this.batch === true) return; |
| 15712 |
var source = _emitter2.default.sources.USER; |
| 15713 |
if (typeof mutations === 'string') { |
| 15714 |
source = mutations; |
| 15715 |
} |
| 15716 |
if (!Array.isArray(mutations)) { |
| 15717 |
mutations = this.observer.takeRecords(); |
| 15718 |
} |
| 15719 |
if (mutations.length > 0) { |
| 15720 |
this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); |
| 15721 |
} |
| 15722 |
_get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy |
| 15723 |
if (mutations.length > 0) { |
| 15724 |
this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); |
| 15725 |
} |
| 15726 |
} |
| 15727 |
}]); |
| 15728 |
|
| 15729 |
return Scroll; |
| 15730 |
}(_parchment2.default.Scroll); |
| 15731 |
|
| 15732 |
Scroll.blotName = 'scroll'; |
| 15733 |
Scroll.className = 'ql-editor'; |
| 15734 |
Scroll.tagName = 'DIV'; |
| 15735 |
Scroll.defaultChild = 'block'; |
| 15736 |
Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; |
| 15737 |
|
| 15738 |
exports.default = Scroll; |
| 15739 |
|
| 15740 |
/***/ }), |
| 15741 |
/* 23 */ |
| 15742 |
/***/ (function(module, exports, __nested_webpack_require_157111__) { |
| 15743 |
|
| 15744 |
"use strict"; |
| 15745 |
|
| 15746 |
|
| 15747 |
Object.defineProperty(exports, "__esModule", { |
| 15748 |
value: true |
| 15749 |
}); |
| 15750 |
exports.SHORTKEY = exports.default = undefined; |
| 15751 |
|
| 15752 |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
| 15753 |
|
| 15754 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 15755 |
|
| 15756 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 15757 |
|
| 15758 |
var _clone = __nested_webpack_require_157111__(21); |
| 15759 |
|
| 15760 |
var _clone2 = _interopRequireDefault(_clone); |
| 15761 |
|
| 15762 |
var _deepEqual = __nested_webpack_require_157111__(11); |
| 15763 |
|
| 15764 |
var _deepEqual2 = _interopRequireDefault(_deepEqual); |
| 15765 |
|
| 15766 |
var _extend = __nested_webpack_require_157111__(3); |
| 15767 |
|
| 15768 |
var _extend2 = _interopRequireDefault(_extend); |
| 15769 |
|
| 15770 |
var _quillDelta = __nested_webpack_require_157111__(2); |
| 15771 |
|
| 15772 |
var _quillDelta2 = _interopRequireDefault(_quillDelta); |
| 15773 |
|
| 15774 |
var _op = __nested_webpack_require_157111__(20); |
| 15775 |
|
| 15776 |
var _op2 = _interopRequireDefault(_op); |
| 15777 |
|
| 15778 |
var _parchment = __nested_webpack_require_157111__(0); |
| 15779 |
|
| 15780 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 15781 |
|
| 15782 |
var _quill = __nested_webpack_require_157111__(5); |
| 15783 |
|
| 15784 |
var _quill2 = _interopRequireDefault(_quill); |
| 15785 |
|
| 15786 |
var _logger = __nested_webpack_require_157111__(10); |
| 15787 |
|
| 15788 |
var _logger2 = _interopRequireDefault(_logger); |
| 15789 |
|
| 15790 |
var _module = __nested_webpack_require_157111__(9); |
| 15791 |
|
| 15792 |
var _module2 = _interopRequireDefault(_module); |
| 15793 |
|
| 15794 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 15795 |
|
| 15796 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 15797 |
|
| 15798 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 15799 |
|
| 15800 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 15801 |
|
| 15802 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 15803 |
|
| 15804 |
var debug = (0, _logger2.default)('quill:keyboard'); |
| 15805 |
|
| 15806 |
var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; |
| 15807 |
|
| 15808 |
var Keyboard = function (_Module) { |
| 15809 |
_inherits(Keyboard, _Module); |
| 15810 |
|
| 15811 |
_createClass(Keyboard, null, [{ |
| 15812 |
key: 'match', |
| 15813 |
value: function match(evt, binding) { |
| 15814 |
binding = normalize(binding); |
| 15815 |
if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { |
| 15816 |
return !!binding[key] !== evt[key] && binding[key] !== null; |
| 15817 |
})) { |
| 15818 |
return false; |
| 15819 |
} |
| 15820 |
return binding.key === (evt.which || evt.keyCode); |
| 15821 |
} |
| 15822 |
}]); |
| 15823 |
|
| 15824 |
function Keyboard(quill, options) { |
| 15825 |
_classCallCheck(this, Keyboard); |
| 15826 |
|
| 15827 |
var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); |
| 15828 |
|
| 15829 |
_this.bindings = {}; |
| 15830 |
Object.keys(_this.options.bindings).forEach(function (name) { |
| 15831 |
if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { |
| 15832 |
return; |
| 15833 |
} |
| 15834 |
if (_this.options.bindings[name]) { |
| 15835 |
_this.addBinding(_this.options.bindings[name]); |
| 15836 |
} |
| 15837 |
}); |
| 15838 |
_this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); |
| 15839 |
_this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); |
| 15840 |
if (/Firefox/i.test(navigator.userAgent)) { |
| 15841 |
// Need to handle delete and backspace for Firefox in the general case #1171 |
| 15842 |
_this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); |
| 15843 |
_this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); |
| 15844 |
} else { |
| 15845 |
_this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); |
| 15846 |
_this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); |
| 15847 |
} |
| 15848 |
_this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); |
| 15849 |
_this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); |
| 15850 |
_this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); |
| 15851 |
_this.listen(); |
| 15852 |
return _this; |
| 15853 |
} |
| 15854 |
|
| 15855 |
_createClass(Keyboard, [{ |
| 15856 |
key: 'addBinding', |
| 15857 |
value: function addBinding(key) { |
| 15858 |
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 15859 |
var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
| 15860 |
|
| 15861 |
var binding = normalize(key); |
| 15862 |
if (binding == null || binding.key == null) { |
| 15863 |
return debug.warn('Attempted to add invalid keyboard binding', binding); |
| 15864 |
} |
| 15865 |
if (typeof context === 'function') { |
| 15866 |
context = { handler: context }; |
| 15867 |
} |
| 15868 |
if (typeof handler === 'function') { |
| 15869 |
handler = { handler: handler }; |
| 15870 |
} |
| 15871 |
binding = (0, _extend2.default)(binding, context, handler); |
| 15872 |
this.bindings[binding.key] = this.bindings[binding.key] || []; |
| 15873 |
this.bindings[binding.key].push(binding); |
| 15874 |
} |
| 15875 |
}, { |
| 15876 |
key: 'listen', |
| 15877 |
value: function listen() { |
| 15878 |
var _this2 = this; |
| 15879 |
|
| 15880 |
this.quill.root.addEventListener('keydown', function (evt) { |
| 15881 |
if (evt.defaultPrevented) return; |
| 15882 |
var which = evt.which || evt.keyCode; |
| 15883 |
var bindings = (_this2.bindings[which] || []).filter(function (binding) { |
| 15884 |
return Keyboard.match(evt, binding); |
| 15885 |
}); |
| 15886 |
if (bindings.length === 0) return; |
| 15887 |
var range = _this2.quill.getSelection(); |
| 15888 |
if (range == null || !_this2.quill.hasFocus()) return; |
| 15889 |
|
| 15890 |
var _quill$getLine = _this2.quill.getLine(range.index), |
| 15891 |
_quill$getLine2 = _slicedToArray(_quill$getLine, 2), |
| 15892 |
line = _quill$getLine2[0], |
| 15893 |
offset = _quill$getLine2[1]; |
| 15894 |
|
| 15895 |
var _quill$getLeaf = _this2.quill.getLeaf(range.index), |
| 15896 |
_quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), |
| 15897 |
leafStart = _quill$getLeaf2[0], |
| 15898 |
offsetStart = _quill$getLeaf2[1]; |
| 15899 |
|
| 15900 |
var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), |
| 15901 |
_ref2 = _slicedToArray(_ref, 2), |
| 15902 |
leafEnd = _ref2[0], |
| 15903 |
offsetEnd = _ref2[1]; |
| 15904 |
|
| 15905 |
var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; |
| 15906 |
var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; |
| 15907 |
var curContext = { |
| 15908 |
collapsed: range.length === 0, |
| 15909 |
empty: range.length === 0 && line.length() <= 1, |
| 15910 |
format: _this2.quill.getFormat(range), |
| 15911 |
offset: offset, |
| 15912 |
prefix: prefixText, |
| 15913 |
suffix: suffixText |
| 15914 |
}; |
| 15915 |
var prevented = bindings.some(function (binding) { |
| 15916 |
if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; |
| 15917 |
if (binding.empty != null && binding.empty !== curContext.empty) return false; |
| 15918 |
if (binding.offset != null && binding.offset !== curContext.offset) return false; |
| 15919 |
if (Array.isArray(binding.format)) { |
| 15920 |
// any format is present |
| 15921 |
if (binding.format.every(function (name) { |
| 15922 |
return curContext.format[name] == null; |
| 15923 |
})) { |
| 15924 |
return false; |
| 15925 |
} |
| 15926 |
} else if (_typeof(binding.format) === 'object') { |
| 15927 |
// all formats must match |
| 15928 |
if (!Object.keys(binding.format).every(function (name) { |
| 15929 |
if (binding.format[name] === true) return curContext.format[name] != null; |
| 15930 |
if (binding.format[name] === false) return curContext.format[name] == null; |
| 15931 |
return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); |
| 15932 |
})) { |
| 15933 |
return false; |
| 15934 |
} |
| 15935 |
} |
| 15936 |
if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; |
| 15937 |
if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; |
| 15938 |
return binding.handler.call(_this2, range, curContext) !== true; |
| 15939 |
}); |
| 15940 |
if (prevented) { |
| 15941 |
evt.preventDefault(); |
| 15942 |
} |
| 15943 |
}); |
| 15944 |
} |
| 15945 |
}]); |
| 15946 |
|
| 15947 |
return Keyboard; |
| 15948 |
}(_module2.default); |
| 15949 |
|
| 15950 |
Keyboard.keys = { |
| 15951 |
BACKSPACE: 8, |
| 15952 |
TAB: 9, |
| 15953 |
ENTER: 13, |
| 15954 |
ESCAPE: 27, |
| 15955 |
LEFT: 37, |
| 15956 |
UP: 38, |
| 15957 |
RIGHT: 39, |
| 15958 |
DOWN: 40, |
| 15959 |
DELETE: 46 |
| 15960 |
}; |
| 15961 |
|
| 15962 |
Keyboard.DEFAULTS = { |
| 15963 |
bindings: { |
| 15964 |
'bold': makeFormatHandler('bold'), |
| 15965 |
'italic': makeFormatHandler('italic'), |
| 15966 |
'underline': makeFormatHandler('underline'), |
| 15967 |
'indent': { |
| 15968 |
// highlight tab or tab at beginning of list, indent or blockquote |
| 15969 |
key: Keyboard.keys.TAB, |
| 15970 |
format: ['blockquote', 'indent', 'list'], |
| 15971 |
handler: function handler(range, context) { |
| 15972 |
if (context.collapsed && context.offset !== 0) return true; |
| 15973 |
this.quill.format('indent', '+1', _quill2.default.sources.USER); |
| 15974 |
} |
| 15975 |
}, |
| 15976 |
'outdent': { |
| 15977 |
key: Keyboard.keys.TAB, |
| 15978 |
shiftKey: true, |
| 15979 |
format: ['blockquote', 'indent', 'list'], |
| 15980 |
// highlight tab or tab at beginning of list, indent or blockquote |
| 15981 |
handler: function handler(range, context) { |
| 15982 |
if (context.collapsed && context.offset !== 0) return true; |
| 15983 |
this.quill.format('indent', '-1', _quill2.default.sources.USER); |
| 15984 |
} |
| 15985 |
}, |
| 15986 |
'outdent backspace': { |
| 15987 |
key: Keyboard.keys.BACKSPACE, |
| 15988 |
collapsed: true, |
| 15989 |
shiftKey: null, |
| 15990 |
metaKey: null, |
| 15991 |
ctrlKey: null, |
| 15992 |
altKey: null, |
| 15993 |
format: ['indent', 'list'], |
| 15994 |
offset: 0, |
| 15995 |
handler: function handler(range, context) { |
| 15996 |
if (context.format.indent != null) { |
| 15997 |
this.quill.format('indent', '-1', _quill2.default.sources.USER); |
| 15998 |
} else if (context.format.list != null) { |
| 15999 |
this.quill.format('list', false, _quill2.default.sources.USER); |
| 16000 |
} |
| 16001 |
} |
| 16002 |
}, |
| 16003 |
'indent code-block': makeCodeBlockHandler(true), |
| 16004 |
'outdent code-block': makeCodeBlockHandler(false), |
| 16005 |
'remove tab': { |
| 16006 |
key: Keyboard.keys.TAB, |
| 16007 |
shiftKey: true, |
| 16008 |
collapsed: true, |
| 16009 |
prefix: /\t$/, |
| 16010 |
handler: function handler(range) { |
| 16011 |
this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); |
| 16012 |
} |
| 16013 |
}, |
| 16014 |
'tab': { |
| 16015 |
key: Keyboard.keys.TAB, |
| 16016 |
handler: function handler(range) { |
| 16017 |
this.quill.history.cutoff(); |
| 16018 |
var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); |
| 16019 |
this.quill.updateContents(delta, _quill2.default.sources.USER); |
| 16020 |
this.quill.history.cutoff(); |
| 16021 |
this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); |
| 16022 |
} |
| 16023 |
}, |
| 16024 |
'list empty enter': { |
| 16025 |
key: Keyboard.keys.ENTER, |
| 16026 |
collapsed: true, |
| 16027 |
format: ['list'], |
| 16028 |
empty: true, |
| 16029 |
handler: function handler(range, context) { |
| 16030 |
this.quill.format('list', false, _quill2.default.sources.USER); |
| 16031 |
if (context.format.indent) { |
| 16032 |
this.quill.format('indent', false, _quill2.default.sources.USER); |
| 16033 |
} |
| 16034 |
} |
| 16035 |
}, |
| 16036 |
'checklist enter': { |
| 16037 |
key: Keyboard.keys.ENTER, |
| 16038 |
collapsed: true, |
| 16039 |
format: { list: 'checked' }, |
| 16040 |
handler: function handler(range) { |
| 16041 |
var _quill$getLine3 = this.quill.getLine(range.index), |
| 16042 |
_quill$getLine4 = _slicedToArray(_quill$getLine3, 2), |
| 16043 |
line = _quill$getLine4[0], |
| 16044 |
offset = _quill$getLine4[1]; |
| 16045 |
|
| 16046 |
var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); |
| 16047 |
var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); |
| 16048 |
this.quill.updateContents(delta, _quill2.default.sources.USER); |
| 16049 |
this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); |
| 16050 |
this.quill.scrollIntoView(); |
| 16051 |
} |
| 16052 |
}, |
| 16053 |
'header enter': { |
| 16054 |
key: Keyboard.keys.ENTER, |
| 16055 |
collapsed: true, |
| 16056 |
format: ['header'], |
| 16057 |
suffix: /^$/, |
| 16058 |
handler: function handler(range, context) { |
| 16059 |
var _quill$getLine5 = this.quill.getLine(range.index), |
| 16060 |
_quill$getLine6 = _slicedToArray(_quill$getLine5, 2), |
| 16061 |
line = _quill$getLine6[0], |
| 16062 |
offset = _quill$getLine6[1]; |
| 16063 |
|
| 16064 |
var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); |
| 16065 |
this.quill.updateContents(delta, _quill2.default.sources.USER); |
| 16066 |
this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); |
| 16067 |
this.quill.scrollIntoView(); |
| 16068 |
} |
| 16069 |
}, |
| 16070 |
'list autofill': { |
| 16071 |
key: ' ', |
| 16072 |
collapsed: true, |
| 16073 |
format: { list: false }, |
| 16074 |
prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, |
| 16075 |
handler: function handler(range, context) { |
| 16076 |
var length = context.prefix.length; |
| 16077 |
|
| 16078 |
var _quill$getLine7 = this.quill.getLine(range.index), |
| 16079 |
_quill$getLine8 = _slicedToArray(_quill$getLine7, 2), |
| 16080 |
line = _quill$getLine8[0], |
| 16081 |
offset = _quill$getLine8[1]; |
| 16082 |
|
| 16083 |
if (offset > length) return true; |
| 16084 |
var value = void 0; |
| 16085 |
switch (context.prefix.trim()) { |
| 16086 |
case '[]':case '[ ]': |
| 16087 |
value = 'unchecked'; |
| 16088 |
break; |
| 16089 |
case '[x]': |
| 16090 |
value = 'checked'; |
| 16091 |
break; |
| 16092 |
case '-':case '*': |
| 16093 |
value = 'bullet'; |
| 16094 |
break; |
| 16095 |
default: |
| 16096 |
value = 'ordered'; |
| 16097 |
} |
| 16098 |
this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); |
| 16099 |
this.quill.history.cutoff(); |
| 16100 |
var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); |
| 16101 |
this.quill.updateContents(delta, _quill2.default.sources.USER); |
| 16102 |
this.quill.history.cutoff(); |
| 16103 |
this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); |
| 16104 |
} |
| 16105 |
}, |
| 16106 |
'code exit': { |
| 16107 |
key: Keyboard.keys.ENTER, |
| 16108 |
collapsed: true, |
| 16109 |
format: ['code-block'], |
| 16110 |
prefix: /\n\n$/, |
| 16111 |
suffix: /^\s+$/, |
| 16112 |
handler: function handler(range) { |
| 16113 |
var _quill$getLine9 = this.quill.getLine(range.index), |
| 16114 |
_quill$getLine10 = _slicedToArray(_quill$getLine9, 2), |
| 16115 |
line = _quill$getLine10[0], |
| 16116 |
offset = _quill$getLine10[1]; |
| 16117 |
|
| 16118 |
var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); |
| 16119 |
this.quill.updateContents(delta, _quill2.default.sources.USER); |
| 16120 |
} |
| 16121 |
}, |
| 16122 |
'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), |
| 16123 |
'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), |
| 16124 |
'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), |
| 16125 |
'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) |
| 16126 |
} |
| 16127 |
}; |
| 16128 |
|
| 16129 |
function makeEmbedArrowHandler(key, shiftKey) { |
| 16130 |
var _ref3; |
| 16131 |
|
| 16132 |
var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; |
| 16133 |
return _ref3 = { |
| 16134 |
key: key, |
| 16135 |
shiftKey: shiftKey, |
| 16136 |
altKey: null |
| 16137 |
}, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { |
| 16138 |
var index = range.index; |
| 16139 |
if (key === Keyboard.keys.RIGHT) { |
| 16140 |
index += range.length + 1; |
| 16141 |
} |
| 16142 |
|
| 16143 |
var _quill$getLeaf3 = this.quill.getLeaf(index), |
| 16144 |
_quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), |
| 16145 |
leaf = _quill$getLeaf4[0]; |
| 16146 |
|
| 16147 |
if (!(leaf instanceof _parchment2.default.Embed)) return true; |
| 16148 |
if (key === Keyboard.keys.LEFT) { |
| 16149 |
if (shiftKey) { |
| 16150 |
this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); |
| 16151 |
} else { |
| 16152 |
this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); |
| 16153 |
} |
| 16154 |
} else { |
| 16155 |
if (shiftKey) { |
| 16156 |
this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); |
| 16157 |
} else { |
| 16158 |
this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); |
| 16159 |
} |
| 16160 |
} |
| 16161 |
return false; |
| 16162 |
}), _ref3; |
| 16163 |
} |
| 16164 |
|
| 16165 |
function handleBackspace(range, context) { |
| 16166 |
if (range.index === 0 || this.quill.getLength() <= 1) return; |
| 16167 |
|
| 16168 |
var _quill$getLine11 = this.quill.getLine(range.index), |
| 16169 |
_quill$getLine12 = _slicedToArray(_quill$getLine11, 1), |
| 16170 |
line = _quill$getLine12[0]; |
| 16171 |
|
| 16172 |
var formats = {}; |
| 16173 |
if (context.offset === 0) { |
| 16174 |
var _quill$getLine13 = this.quill.getLine(range.index - 1), |
| 16175 |
_quill$getLine14 = _slicedToArray(_quill$getLine13, 1), |
| 16176 |
prev = _quill$getLine14[0]; |
| 16177 |
|
| 16178 |
if (prev != null && prev.length() > 1) { |
| 16179 |
var curFormats = line.formats(); |
| 16180 |
var prevFormats = this.quill.getFormat(range.index - 1, 1); |
| 16181 |
formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; |
| 16182 |
} |
| 16183 |
} |
| 16184 |
// Check for astral symbols |
| 16185 |
var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; |
| 16186 |
this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); |
| 16187 |
if (Object.keys(formats).length > 0) { |
| 16188 |
this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); |
| 16189 |
} |
| 16190 |
this.quill.focus(); |
| 16191 |
} |
| 16192 |
|
| 16193 |
function handleDelete(range, context) { |
| 16194 |
// Check for astral symbols |
| 16195 |
var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; |
| 16196 |
if (range.index >= this.quill.getLength() - length) return; |
| 16197 |
var formats = {}, |
| 16198 |
nextLength = 0; |
| 16199 |
|
| 16200 |
var _quill$getLine15 = this.quill.getLine(range.index), |
| 16201 |
_quill$getLine16 = _slicedToArray(_quill$getLine15, 1), |
| 16202 |
line = _quill$getLine16[0]; |
| 16203 |
|
| 16204 |
if (context.offset >= line.length() - 1) { |
| 16205 |
var _quill$getLine17 = this.quill.getLine(range.index + 1), |
| 16206 |
_quill$getLine18 = _slicedToArray(_quill$getLine17, 1), |
| 16207 |
next = _quill$getLine18[0]; |
| 16208 |
|
| 16209 |
if (next) { |
| 16210 |
var curFormats = line.formats(); |
| 16211 |
var nextFormats = this.quill.getFormat(range.index, 1); |
| 16212 |
formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; |
| 16213 |
nextLength = next.length(); |
| 16214 |
} |
| 16215 |
} |
| 16216 |
this.quill.deleteText(range.index, length, _quill2.default.sources.USER); |
| 16217 |
if (Object.keys(formats).length > 0) { |
| 16218 |
this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); |
| 16219 |
} |
| 16220 |
} |
| 16221 |
|
| 16222 |
function handleDeleteRange(range) { |
| 16223 |
var lines = this.quill.getLines(range); |
| 16224 |
var formats = {}; |
| 16225 |
if (lines.length > 1) { |
| 16226 |
var firstFormats = lines[0].formats(); |
| 16227 |
var lastFormats = lines[lines.length - 1].formats(); |
| 16228 |
formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; |
| 16229 |
} |
| 16230 |
this.quill.deleteText(range, _quill2.default.sources.USER); |
| 16231 |
if (Object.keys(formats).length > 0) { |
| 16232 |
this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); |
| 16233 |
} |
| 16234 |
this.quill.setSelection(range.index, _quill2.default.sources.SILENT); |
| 16235 |
this.quill.focus(); |
| 16236 |
} |
| 16237 |
|
| 16238 |
function handleEnter(range, context) { |
| 16239 |
var _this3 = this; |
| 16240 |
|
| 16241 |
if (range.length > 0) { |
| 16242 |
this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change |
| 16243 |
} |
| 16244 |
var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { |
| 16245 |
if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { |
| 16246 |
lineFormats[format] = context.format[format]; |
| 16247 |
} |
| 16248 |
return lineFormats; |
| 16249 |
}, {}); |
| 16250 |
this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); |
| 16251 |
// Earlier scroll.deleteAt might have messed up our selection, |
| 16252 |
// so insertText's built in selection preservation is not reliable |
| 16253 |
this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); |
| 16254 |
this.quill.focus(); |
| 16255 |
Object.keys(context.format).forEach(function (name) { |
| 16256 |
if (lineFormats[name] != null) return; |
| 16257 |
if (Array.isArray(context.format[name])) return; |
| 16258 |
if (name === 'link') return; |
| 16259 |
_this3.quill.format(name, context.format[name], _quill2.default.sources.USER); |
| 16260 |
}); |
| 16261 |
} |
| 16262 |
|
| 16263 |
function makeCodeBlockHandler(indent) { |
| 16264 |
return { |
| 16265 |
key: Keyboard.keys.TAB, |
| 16266 |
shiftKey: !indent, |
| 16267 |
format: { 'code-block': true }, |
| 16268 |
handler: function handler(range) { |
| 16269 |
var CodeBlock = _parchment2.default.query('code-block'); |
| 16270 |
var index = range.index, |
| 16271 |
length = range.length; |
| 16272 |
|
| 16273 |
var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), |
| 16274 |
_quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), |
| 16275 |
block = _quill$scroll$descend2[0], |
| 16276 |
offset = _quill$scroll$descend2[1]; |
| 16277 |
|
| 16278 |
if (block == null) return; |
| 16279 |
var scrollIndex = this.quill.getIndex(block); |
| 16280 |
var start = block.newlineIndex(offset, true) + 1; |
| 16281 |
var end = block.newlineIndex(scrollIndex + offset + length); |
| 16282 |
var lines = block.domNode.textContent.slice(start, end).split('\n'); |
| 16283 |
offset = 0; |
| 16284 |
lines.forEach(function (line, i) { |
| 16285 |
if (indent) { |
| 16286 |
block.insertAt(start + offset, CodeBlock.TAB); |
| 16287 |
offset += CodeBlock.TAB.length; |
| 16288 |
if (i === 0) { |
| 16289 |
index += CodeBlock.TAB.length; |
| 16290 |
} else { |
| 16291 |
length += CodeBlock.TAB.length; |
| 16292 |
} |
| 16293 |
} else if (line.startsWith(CodeBlock.TAB)) { |
| 16294 |
block.deleteAt(start + offset, CodeBlock.TAB.length); |
| 16295 |
offset -= CodeBlock.TAB.length; |
| 16296 |
if (i === 0) { |
| 16297 |
index -= CodeBlock.TAB.length; |
| 16298 |
} else { |
| 16299 |
length -= CodeBlock.TAB.length; |
| 16300 |
} |
| 16301 |
} |
| 16302 |
offset += line.length + 1; |
| 16303 |
}); |
| 16304 |
this.quill.update(_quill2.default.sources.USER); |
| 16305 |
this.quill.setSelection(index, length, _quill2.default.sources.SILENT); |
| 16306 |
} |
| 16307 |
}; |
| 16308 |
} |
| 16309 |
|
| 16310 |
function makeFormatHandler(format) { |
| 16311 |
return { |
| 16312 |
key: format[0].toUpperCase(), |
| 16313 |
shortKey: true, |
| 16314 |
handler: function handler(range, context) { |
| 16315 |
this.quill.format(format, !context.format[format], _quill2.default.sources.USER); |
| 16316 |
} |
| 16317 |
}; |
| 16318 |
} |
| 16319 |
|
| 16320 |
function normalize(binding) { |
| 16321 |
if (typeof binding === 'string' || typeof binding === 'number') { |
| 16322 |
return normalize({ key: binding }); |
| 16323 |
} |
| 16324 |
if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { |
| 16325 |
binding = (0, _clone2.default)(binding, false); |
| 16326 |
} |
| 16327 |
if (typeof binding.key === 'string') { |
| 16328 |
if (Keyboard.keys[binding.key.toUpperCase()] != null) { |
| 16329 |
binding.key = Keyboard.keys[binding.key.toUpperCase()]; |
| 16330 |
} else if (binding.key.length === 1) { |
| 16331 |
binding.key = binding.key.toUpperCase().charCodeAt(0); |
| 16332 |
} else { |
| 16333 |
return null; |
| 16334 |
} |
| 16335 |
} |
| 16336 |
if (binding.shortKey) { |
| 16337 |
binding[SHORTKEY] = binding.shortKey; |
| 16338 |
delete binding.shortKey; |
| 16339 |
} |
| 16340 |
return binding; |
| 16341 |
} |
| 16342 |
|
| 16343 |
exports.default = Keyboard; |
| 16344 |
exports.SHORTKEY = SHORTKEY; |
| 16345 |
|
| 16346 |
/***/ }), |
| 16347 |
/* 24 */ |
| 16348 |
/***/ (function(module, exports, __nested_webpack_require_181454__) { |
| 16349 |
|
| 16350 |
"use strict"; |
| 16351 |
|
| 16352 |
|
| 16353 |
Object.defineProperty(exports, "__esModule", { |
| 16354 |
value: true |
| 16355 |
}); |
| 16356 |
|
| 16357 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 16358 |
|
| 16359 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 16360 |
|
| 16361 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 16362 |
|
| 16363 |
var _parchment = __nested_webpack_require_181454__(0); |
| 16364 |
|
| 16365 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 16366 |
|
| 16367 |
var _text = __nested_webpack_require_181454__(7); |
| 16368 |
|
| 16369 |
var _text2 = _interopRequireDefault(_text); |
| 16370 |
|
| 16371 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 16372 |
|
| 16373 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 16374 |
|
| 16375 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 16376 |
|
| 16377 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 16378 |
|
| 16379 |
var Cursor = function (_Parchment$Embed) { |
| 16380 |
_inherits(Cursor, _Parchment$Embed); |
| 16381 |
|
| 16382 |
_createClass(Cursor, null, [{ |
| 16383 |
key: 'value', |
| 16384 |
value: function value() { |
| 16385 |
return undefined; |
| 16386 |
} |
| 16387 |
}]); |
| 16388 |
|
| 16389 |
function Cursor(domNode, selection) { |
| 16390 |
_classCallCheck(this, Cursor); |
| 16391 |
|
| 16392 |
var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); |
| 16393 |
|
| 16394 |
_this.selection = selection; |
| 16395 |
_this.textNode = document.createTextNode(Cursor.CONTENTS); |
| 16396 |
_this.domNode.appendChild(_this.textNode); |
| 16397 |
_this._length = 0; |
| 16398 |
return _this; |
| 16399 |
} |
| 16400 |
|
| 16401 |
_createClass(Cursor, [{ |
| 16402 |
key: 'detach', |
| 16403 |
value: function detach() { |
| 16404 |
// super.detach() will also clear domNode.__blot |
| 16405 |
if (this.parent != null) this.parent.removeChild(this); |
| 16406 |
} |
| 16407 |
}, { |
| 16408 |
key: 'format', |
| 16409 |
value: function format(name, value) { |
| 16410 |
if (this._length !== 0) { |
| 16411 |
return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); |
| 16412 |
} |
| 16413 |
var target = this, |
| 16414 |
index = 0; |
| 16415 |
while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { |
| 16416 |
index += target.offset(target.parent); |
| 16417 |
target = target.parent; |
| 16418 |
} |
| 16419 |
if (target != null) { |
| 16420 |
this._length = Cursor.CONTENTS.length; |
| 16421 |
target.optimize(); |
| 16422 |
target.formatAt(index, Cursor.CONTENTS.length, name, value); |
| 16423 |
this._length = 0; |
| 16424 |
} |
| 16425 |
} |
| 16426 |
}, { |
| 16427 |
key: 'index', |
| 16428 |
value: function index(node, offset) { |
| 16429 |
if (node === this.textNode) return 0; |
| 16430 |
return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); |
| 16431 |
} |
| 16432 |
}, { |
| 16433 |
key: 'length', |
| 16434 |
value: function length() { |
| 16435 |
return this._length; |
| 16436 |
} |
| 16437 |
}, { |
| 16438 |
key: 'position', |
| 16439 |
value: function position() { |
| 16440 |
return [this.textNode, this.textNode.data.length]; |
| 16441 |
} |
| 16442 |
}, { |
| 16443 |
key: 'remove', |
| 16444 |
value: function remove() { |
| 16445 |
_get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); |
| 16446 |
this.parent = null; |
| 16447 |
} |
| 16448 |
}, { |
| 16449 |
key: 'restore', |
| 16450 |
value: function restore() { |
| 16451 |
if (this.selection.composing || this.parent == null) return; |
| 16452 |
var textNode = this.textNode; |
| 16453 |
var range = this.selection.getNativeRange(); |
| 16454 |
var restoreText = void 0, |
| 16455 |
start = void 0, |
| 16456 |
end = void 0; |
| 16457 |
if (range != null && range.start.node === textNode && range.end.node === textNode) { |
| 16458 |
var _ref = [textNode, range.start.offset, range.end.offset]; |
| 16459 |
restoreText = _ref[0]; |
| 16460 |
start = _ref[1]; |
| 16461 |
end = _ref[2]; |
| 16462 |
} |
| 16463 |
// Link format will insert text outside of anchor tag |
| 16464 |
while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { |
| 16465 |
this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); |
| 16466 |
} |
| 16467 |
if (this.textNode.data !== Cursor.CONTENTS) { |
| 16468 |
var text = this.textNode.data.split(Cursor.CONTENTS).join(''); |
| 16469 |
if (this.next instanceof _text2.default) { |
| 16470 |
restoreText = this.next.domNode; |
| 16471 |
this.next.insertAt(0, text); |
| 16472 |
this.textNode.data = Cursor.CONTENTS; |
| 16473 |
} else { |
| 16474 |
this.textNode.data = text; |
| 16475 |
this.parent.insertBefore(_parchment2.default.create(this.textNode), this); |
| 16476 |
this.textNode = document.createTextNode(Cursor.CONTENTS); |
| 16477 |
this.domNode.appendChild(this.textNode); |
| 16478 |
} |
| 16479 |
} |
| 16480 |
this.remove(); |
| 16481 |
if (start != null) { |
| 16482 |
var _map = [start, end].map(function (offset) { |
| 16483 |
return Math.max(0, Math.min(restoreText.data.length, offset - 1)); |
| 16484 |
}); |
| 16485 |
|
| 16486 |
var _map2 = _slicedToArray(_map, 2); |
| 16487 |
|
| 16488 |
start = _map2[0]; |
| 16489 |
end = _map2[1]; |
| 16490 |
|
| 16491 |
return { |
| 16492 |
startNode: restoreText, |
| 16493 |
startOffset: start, |
| 16494 |
endNode: restoreText, |
| 16495 |
endOffset: end |
| 16496 |
}; |
| 16497 |
} |
| 16498 |
} |
| 16499 |
}, { |
| 16500 |
key: 'update', |
| 16501 |
value: function update(mutations, context) { |
| 16502 |
var _this2 = this; |
| 16503 |
|
| 16504 |
if (mutations.some(function (mutation) { |
| 16505 |
return mutation.type === 'characterData' && mutation.target === _this2.textNode; |
| 16506 |
})) { |
| 16507 |
var range = this.restore(); |
| 16508 |
if (range) context.range = range; |
| 16509 |
} |
| 16510 |
} |
| 16511 |
}, { |
| 16512 |
key: 'value', |
| 16513 |
value: function value() { |
| 16514 |
return ''; |
| 16515 |
} |
| 16516 |
}]); |
| 16517 |
|
| 16518 |
return Cursor; |
| 16519 |
}(_parchment2.default.Embed); |
| 16520 |
|
| 16521 |
Cursor.blotName = 'cursor'; |
| 16522 |
Cursor.className = 'ql-cursor'; |
| 16523 |
Cursor.tagName = 'span'; |
| 16524 |
Cursor.CONTENTS = '\uFEFF'; // Zero width no break space |
| 16525 |
|
| 16526 |
|
| 16527 |
exports.default = Cursor; |
| 16528 |
|
| 16529 |
/***/ }), |
| 16530 |
/* 25 */ |
| 16531 |
/***/ (function(module, exports, __nested_webpack_require_189100__) { |
| 16532 |
|
| 16533 |
"use strict"; |
| 16534 |
|
| 16535 |
|
| 16536 |
Object.defineProperty(exports, "__esModule", { |
| 16537 |
value: true |
| 16538 |
}); |
| 16539 |
|
| 16540 |
var _parchment = __nested_webpack_require_189100__(0); |
| 16541 |
|
| 16542 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 16543 |
|
| 16544 |
var _block = __nested_webpack_require_189100__(4); |
| 16545 |
|
| 16546 |
var _block2 = _interopRequireDefault(_block); |
| 16547 |
|
| 16548 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 16549 |
|
| 16550 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 16551 |
|
| 16552 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 16553 |
|
| 16554 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 16555 |
|
| 16556 |
var Container = function (_Parchment$Container) { |
| 16557 |
_inherits(Container, _Parchment$Container); |
| 16558 |
|
| 16559 |
function Container() { |
| 16560 |
_classCallCheck(this, Container); |
| 16561 |
|
| 16562 |
return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); |
| 16563 |
} |
| 16564 |
|
| 16565 |
return Container; |
| 16566 |
}(_parchment2.default.Container); |
| 16567 |
|
| 16568 |
Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; |
| 16569 |
|
| 16570 |
exports.default = Container; |
| 16571 |
|
| 16572 |
/***/ }), |
| 16573 |
/* 26 */ |
| 16574 |
/***/ (function(module, exports, __nested_webpack_require_190886__) { |
| 16575 |
|
| 16576 |
"use strict"; |
| 16577 |
|
| 16578 |
|
| 16579 |
Object.defineProperty(exports, "__esModule", { |
| 16580 |
value: true |
| 16581 |
}); |
| 16582 |
exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; |
| 16583 |
|
| 16584 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 16585 |
|
| 16586 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 16587 |
|
| 16588 |
var _parchment = __nested_webpack_require_190886__(0); |
| 16589 |
|
| 16590 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 16591 |
|
| 16592 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 16593 |
|
| 16594 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 16595 |
|
| 16596 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 16597 |
|
| 16598 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 16599 |
|
| 16600 |
var ColorAttributor = function (_Parchment$Attributor) { |
| 16601 |
_inherits(ColorAttributor, _Parchment$Attributor); |
| 16602 |
|
| 16603 |
function ColorAttributor() { |
| 16604 |
_classCallCheck(this, ColorAttributor); |
| 16605 |
|
| 16606 |
return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); |
| 16607 |
} |
| 16608 |
|
| 16609 |
_createClass(ColorAttributor, [{ |
| 16610 |
key: 'value', |
| 16611 |
value: function value(domNode) { |
| 16612 |
var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); |
| 16613 |
if (!value.startsWith('rgb(')) return value; |
| 16614 |
value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); |
| 16615 |
return '#' + value.split(',').map(function (component) { |
| 16616 |
return ('00' + parseInt(component).toString(16)).slice(-2); |
| 16617 |
}).join(''); |
| 16618 |
} |
| 16619 |
}]); |
| 16620 |
|
| 16621 |
return ColorAttributor; |
| 16622 |
}(_parchment2.default.Attributor.Style); |
| 16623 |
|
| 16624 |
var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { |
| 16625 |
scope: _parchment2.default.Scope.INLINE |
| 16626 |
}); |
| 16627 |
var ColorStyle = new ColorAttributor('color', 'color', { |
| 16628 |
scope: _parchment2.default.Scope.INLINE |
| 16629 |
}); |
| 16630 |
|
| 16631 |
exports.ColorAttributor = ColorAttributor; |
| 16632 |
exports.ColorClass = ColorClass; |
| 16633 |
exports.ColorStyle = ColorStyle; |
| 16634 |
|
| 16635 |
/***/ }), |
| 16636 |
/* 27 */ |
| 16637 |
/***/ (function(module, exports, __nested_webpack_require_194529__) { |
| 16638 |
|
| 16639 |
"use strict"; |
| 16640 |
|
| 16641 |
|
| 16642 |
Object.defineProperty(exports, "__esModule", { |
| 16643 |
value: true |
| 16644 |
}); |
| 16645 |
exports.sanitize = exports.default = undefined; |
| 16646 |
|
| 16647 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 16648 |
|
| 16649 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 16650 |
|
| 16651 |
var _inline = __nested_webpack_require_194529__(6); |
| 16652 |
|
| 16653 |
var _inline2 = _interopRequireDefault(_inline); |
| 16654 |
|
| 16655 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 16656 |
|
| 16657 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 16658 |
|
| 16659 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 16660 |
|
| 16661 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 16662 |
|
| 16663 |
var Link = function (_Inline) { |
| 16664 |
_inherits(Link, _Inline); |
| 16665 |
|
| 16666 |
function Link() { |
| 16667 |
_classCallCheck(this, Link); |
| 16668 |
|
| 16669 |
return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments)); |
| 16670 |
} |
| 16671 |
|
| 16672 |
_createClass(Link, [{ |
| 16673 |
key: 'format', |
| 16674 |
value: function format(name, value) { |
| 16675 |
if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value); |
| 16676 |
value = this.constructor.sanitize(value); |
| 16677 |
this.domNode.setAttribute('href', value); |
| 16678 |
} |
| 16679 |
}], [{ |
| 16680 |
key: 'create', |
| 16681 |
value: function create(value) { |
| 16682 |
var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value); |
| 16683 |
value = this.sanitize(value); |
| 16684 |
node.setAttribute('href', value); |
| 16685 |
node.setAttribute('rel', 'noopener noreferrer'); |
| 16686 |
node.setAttribute('target', '_blank'); |
| 16687 |
return node; |
| 16688 |
} |
| 16689 |
}, { |
| 16690 |
key: 'formats', |
| 16691 |
value: function formats(domNode) { |
| 16692 |
return domNode.getAttribute('href'); |
| 16693 |
} |
| 16694 |
}, { |
| 16695 |
key: 'sanitize', |
| 16696 |
value: function sanitize(url) { |
| 16697 |
return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL; |
| 16698 |
} |
| 16699 |
}]); |
| 16700 |
|
| 16701 |
return Link; |
| 16702 |
}(_inline2.default); |
| 16703 |
|
| 16704 |
Link.blotName = 'link'; |
| 16705 |
Link.tagName = 'A'; |
| 16706 |
Link.SANITIZED_URL = 'about:blank'; |
| 16707 |
Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel']; |
| 16708 |
|
| 16709 |
function _sanitize(url, protocols) { |
| 16710 |
var anchor = document.createElement('a'); |
| 16711 |
anchor.href = url; |
| 16712 |
var protocol = anchor.href.slice(0, anchor.href.indexOf(':')); |
| 16713 |
return protocols.indexOf(protocol) > -1; |
| 16714 |
} |
| 16715 |
|
| 16716 |
exports.default = Link; |
| 16717 |
exports.sanitize = _sanitize; |
| 16718 |
|
| 16719 |
/***/ }), |
| 16720 |
/* 28 */ |
| 16721 |
/***/ (function(module, exports, __nested_webpack_require_198559__) { |
| 16722 |
|
| 16723 |
"use strict"; |
| 16724 |
|
| 16725 |
|
| 16726 |
Object.defineProperty(exports, "__esModule", { |
| 16727 |
value: true |
| 16728 |
}); |
| 16729 |
|
| 16730 |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
| 16731 |
|
| 16732 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 16733 |
|
| 16734 |
var _keyboard = __nested_webpack_require_198559__(23); |
| 16735 |
|
| 16736 |
var _keyboard2 = _interopRequireDefault(_keyboard); |
| 16737 |
|
| 16738 |
var _dropdown = __nested_webpack_require_198559__(107); |
| 16739 |
|
| 16740 |
var _dropdown2 = _interopRequireDefault(_dropdown); |
| 16741 |
|
| 16742 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 16743 |
|
| 16744 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 16745 |
|
| 16746 |
var optionsCounter = 0; |
| 16747 |
|
| 16748 |
function toggleAriaAttribute(element, attribute) { |
| 16749 |
element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true')); |
| 16750 |
} |
| 16751 |
|
| 16752 |
var Picker = function () { |
| 16753 |
function Picker(select) { |
| 16754 |
var _this = this; |
| 16755 |
|
| 16756 |
_classCallCheck(this, Picker); |
| 16757 |
|
| 16758 |
this.select = select; |
| 16759 |
this.container = document.createElement('span'); |
| 16760 |
this.buildPicker(); |
| 16761 |
this.select.style.display = 'none'; |
| 16762 |
this.select.parentNode.insertBefore(this.container, this.select); |
| 16763 |
|
| 16764 |
this.label.addEventListener('mousedown', function () { |
| 16765 |
_this.togglePicker(); |
| 16766 |
}); |
| 16767 |
this.label.addEventListener('keydown', function (event) { |
| 16768 |
switch (event.keyCode) { |
| 16769 |
// Allows the "Enter" key to open the picker |
| 16770 |
case _keyboard2.default.keys.ENTER: |
| 16771 |
_this.togglePicker(); |
| 16772 |
break; |
| 16773 |
|
| 16774 |
// Allows the "Escape" key to close the picker |
| 16775 |
case _keyboard2.default.keys.ESCAPE: |
| 16776 |
_this.escape(); |
| 16777 |
event.preventDefault(); |
| 16778 |
break; |
| 16779 |
default: |
| 16780 |
} |
| 16781 |
}); |
| 16782 |
this.select.addEventListener('change', this.update.bind(this)); |
| 16783 |
} |
| 16784 |
|
| 16785 |
_createClass(Picker, [{ |
| 16786 |
key: 'togglePicker', |
| 16787 |
value: function togglePicker() { |
| 16788 |
this.container.classList.toggle('ql-expanded'); |
| 16789 |
// Toggle aria-expanded and aria-hidden to make the picker accessible |
| 16790 |
toggleAriaAttribute(this.label, 'aria-expanded'); |
| 16791 |
toggleAriaAttribute(this.options, 'aria-hidden'); |
| 16792 |
} |
| 16793 |
}, { |
| 16794 |
key: 'buildItem', |
| 16795 |
value: function buildItem(option) { |
| 16796 |
var _this2 = this; |
| 16797 |
|
| 16798 |
var item = document.createElement('span'); |
| 16799 |
item.tabIndex = '0'; |
| 16800 |
item.setAttribute('role', 'button'); |
| 16801 |
|
| 16802 |
item.classList.add('ql-picker-item'); |
| 16803 |
if (option.hasAttribute('value')) { |
| 16804 |
item.setAttribute('data-value', option.getAttribute('value')); |
| 16805 |
} |
| 16806 |
if (option.textContent) { |
| 16807 |
item.setAttribute('data-label', option.textContent); |
| 16808 |
} |
| 16809 |
item.addEventListener('click', function () { |
| 16810 |
_this2.selectItem(item, true); |
| 16811 |
}); |
| 16812 |
item.addEventListener('keydown', function (event) { |
| 16813 |
switch (event.keyCode) { |
| 16814 |
// Allows the "Enter" key to select an item |
| 16815 |
case _keyboard2.default.keys.ENTER: |
| 16816 |
_this2.selectItem(item, true); |
| 16817 |
event.preventDefault(); |
| 16818 |
break; |
| 16819 |
|
| 16820 |
// Allows the "Escape" key to close the picker |
| 16821 |
case _keyboard2.default.keys.ESCAPE: |
| 16822 |
_this2.escape(); |
| 16823 |
event.preventDefault(); |
| 16824 |
break; |
| 16825 |
default: |
| 16826 |
} |
| 16827 |
}); |
| 16828 |
|
| 16829 |
return item; |
| 16830 |
} |
| 16831 |
}, { |
| 16832 |
key: 'buildLabel', |
| 16833 |
value: function buildLabel() { |
| 16834 |
var label = document.createElement('span'); |
| 16835 |
label.classList.add('ql-picker-label'); |
| 16836 |
label.innerHTML = _dropdown2.default; |
| 16837 |
label.tabIndex = '0'; |
| 16838 |
label.setAttribute('role', 'button'); |
| 16839 |
label.setAttribute('aria-expanded', 'false'); |
| 16840 |
this.container.appendChild(label); |
| 16841 |
return label; |
| 16842 |
} |
| 16843 |
}, { |
| 16844 |
key: 'buildOptions', |
| 16845 |
value: function buildOptions() { |
| 16846 |
var _this3 = this; |
| 16847 |
|
| 16848 |
var options = document.createElement('span'); |
| 16849 |
options.classList.add('ql-picker-options'); |
| 16850 |
|
| 16851 |
// Don't want screen readers to read this until options are visible |
| 16852 |
options.setAttribute('aria-hidden', 'true'); |
| 16853 |
options.tabIndex = '-1'; |
| 16854 |
|
| 16855 |
// Need a unique id for aria-controls |
| 16856 |
options.id = 'ql-picker-options-' + optionsCounter; |
| 16857 |
optionsCounter += 1; |
| 16858 |
this.label.setAttribute('aria-controls', options.id); |
| 16859 |
|
| 16860 |
this.options = options; |
| 16861 |
|
| 16862 |
[].slice.call(this.select.options).forEach(function (option) { |
| 16863 |
var item = _this3.buildItem(option); |
| 16864 |
options.appendChild(item); |
| 16865 |
if (option.selected === true) { |
| 16866 |
_this3.selectItem(item); |
| 16867 |
} |
| 16868 |
}); |
| 16869 |
this.container.appendChild(options); |
| 16870 |
} |
| 16871 |
}, { |
| 16872 |
key: 'buildPicker', |
| 16873 |
value: function buildPicker() { |
| 16874 |
var _this4 = this; |
| 16875 |
|
| 16876 |
[].slice.call(this.select.attributes).forEach(function (item) { |
| 16877 |
_this4.container.setAttribute(item.name, item.value); |
| 16878 |
}); |
| 16879 |
this.container.classList.add('ql-picker'); |
| 16880 |
this.label = this.buildLabel(); |
| 16881 |
this.buildOptions(); |
| 16882 |
} |
| 16883 |
}, { |
| 16884 |
key: 'escape', |
| 16885 |
value: function escape() { |
| 16886 |
var _this5 = this; |
| 16887 |
|
| 16888 |
// Close menu and return focus to trigger label |
| 16889 |
this.close(); |
| 16890 |
// Need setTimeout for accessibility to ensure that the browser executes |
| 16891 |
// focus on the next process thread and after any DOM content changes |
| 16892 |
setTimeout(function () { |
| 16893 |
return _this5.label.focus(); |
| 16894 |
}, 1); |
| 16895 |
} |
| 16896 |
}, { |
| 16897 |
key: 'close', |
| 16898 |
value: function close() { |
| 16899 |
this.container.classList.remove('ql-expanded'); |
| 16900 |
this.label.setAttribute('aria-expanded', 'false'); |
| 16901 |
this.options.setAttribute('aria-hidden', 'true'); |
| 16902 |
} |
| 16903 |
}, { |
| 16904 |
key: 'selectItem', |
| 16905 |
value: function selectItem(item) { |
| 16906 |
var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; |
| 16907 |
|
| 16908 |
var selected = this.container.querySelector('.ql-selected'); |
| 16909 |
if (item === selected) return; |
| 16910 |
if (selected != null) { |
| 16911 |
selected.classList.remove('ql-selected'); |
| 16912 |
} |
| 16913 |
if (item == null) return; |
| 16914 |
item.classList.add('ql-selected'); |
| 16915 |
this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); |
| 16916 |
if (item.hasAttribute('data-value')) { |
| 16917 |
this.label.setAttribute('data-value', item.getAttribute('data-value')); |
| 16918 |
} else { |
| 16919 |
this.label.removeAttribute('data-value'); |
| 16920 |
} |
| 16921 |
if (item.hasAttribute('data-label')) { |
| 16922 |
this.label.setAttribute('data-label', item.getAttribute('data-label')); |
| 16923 |
} else { |
| 16924 |
this.label.removeAttribute('data-label'); |
| 16925 |
} |
| 16926 |
if (trigger) { |
| 16927 |
if (typeof Event === 'function') { |
| 16928 |
this.select.dispatchEvent(new Event('change')); |
| 16929 |
} else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') { |
| 16930 |
// IE11 |
| 16931 |
var event = document.createEvent('Event'); |
| 16932 |
event.initEvent('change', true, true); |
| 16933 |
this.select.dispatchEvent(event); |
| 16934 |
} |
| 16935 |
this.close(); |
| 16936 |
} |
| 16937 |
} |
| 16938 |
}, { |
| 16939 |
key: 'update', |
| 16940 |
value: function update() { |
| 16941 |
var option = void 0; |
| 16942 |
if (this.select.selectedIndex > -1) { |
| 16943 |
var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex]; |
| 16944 |
option = this.select.options[this.select.selectedIndex]; |
| 16945 |
this.selectItem(item); |
| 16946 |
} else { |
| 16947 |
this.selectItem(null); |
| 16948 |
} |
| 16949 |
var isActive = option != null && option !== this.select.querySelector('option[selected]'); |
| 16950 |
this.label.classList.toggle('ql-active', isActive); |
| 16951 |
} |
| 16952 |
}]); |
| 16953 |
|
| 16954 |
return Picker; |
| 16955 |
}(); |
| 16956 |
|
| 16957 |
exports.default = Picker; |
| 16958 |
|
| 16959 |
/***/ }), |
| 16960 |
/* 29 */ |
| 16961 |
/***/ (function(module, exports, __nested_webpack_require_206753__) { |
| 16962 |
|
| 16963 |
"use strict"; |
| 16964 |
|
| 16965 |
|
| 16966 |
Object.defineProperty(exports, "__esModule", { |
| 16967 |
value: true |
| 16968 |
}); |
| 16969 |
|
| 16970 |
var _parchment = __nested_webpack_require_206753__(0); |
| 16971 |
|
| 16972 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 16973 |
|
| 16974 |
var _quill = __nested_webpack_require_206753__(5); |
| 16975 |
|
| 16976 |
var _quill2 = _interopRequireDefault(_quill); |
| 16977 |
|
| 16978 |
var _block = __nested_webpack_require_206753__(4); |
| 16979 |
|
| 16980 |
var _block2 = _interopRequireDefault(_block); |
| 16981 |
|
| 16982 |
var _break = __nested_webpack_require_206753__(16); |
| 16983 |
|
| 16984 |
var _break2 = _interopRequireDefault(_break); |
| 16985 |
|
| 16986 |
var _container = __nested_webpack_require_206753__(25); |
| 16987 |
|
| 16988 |
var _container2 = _interopRequireDefault(_container); |
| 16989 |
|
| 16990 |
var _cursor = __nested_webpack_require_206753__(24); |
| 16991 |
|
| 16992 |
var _cursor2 = _interopRequireDefault(_cursor); |
| 16993 |
|
| 16994 |
var _embed = __nested_webpack_require_206753__(35); |
| 16995 |
|
| 16996 |
var _embed2 = _interopRequireDefault(_embed); |
| 16997 |
|
| 16998 |
var _inline = __nested_webpack_require_206753__(6); |
| 16999 |
|
| 17000 |
var _inline2 = _interopRequireDefault(_inline); |
| 17001 |
|
| 17002 |
var _scroll = __nested_webpack_require_206753__(22); |
| 17003 |
|
| 17004 |
var _scroll2 = _interopRequireDefault(_scroll); |
| 17005 |
|
| 17006 |
var _text = __nested_webpack_require_206753__(7); |
| 17007 |
|
| 17008 |
var _text2 = _interopRequireDefault(_text); |
| 17009 |
|
| 17010 |
var _clipboard = __nested_webpack_require_206753__(55); |
| 17011 |
|
| 17012 |
var _clipboard2 = _interopRequireDefault(_clipboard); |
| 17013 |
|
| 17014 |
var _history = __nested_webpack_require_206753__(42); |
| 17015 |
|
| 17016 |
var _history2 = _interopRequireDefault(_history); |
| 17017 |
|
| 17018 |
var _keyboard = __nested_webpack_require_206753__(23); |
| 17019 |
|
| 17020 |
var _keyboard2 = _interopRequireDefault(_keyboard); |
| 17021 |
|
| 17022 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 17023 |
|
| 17024 |
_quill2.default.register({ |
| 17025 |
'blots/block': _block2.default, |
| 17026 |
'blots/block/embed': _block.BlockEmbed, |
| 17027 |
'blots/break': _break2.default, |
| 17028 |
'blots/container': _container2.default, |
| 17029 |
'blots/cursor': _cursor2.default, |
| 17030 |
'blots/embed': _embed2.default, |
| 17031 |
'blots/inline': _inline2.default, |
| 17032 |
'blots/scroll': _scroll2.default, |
| 17033 |
'blots/text': _text2.default, |
| 17034 |
|
| 17035 |
'modules/clipboard': _clipboard2.default, |
| 17036 |
'modules/history': _history2.default, |
| 17037 |
'modules/keyboard': _keyboard2.default |
| 17038 |
}); |
| 17039 |
|
| 17040 |
_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); |
| 17041 |
|
| 17042 |
exports.default = _quill2.default; |
| 17043 |
|
| 17044 |
/***/ }), |
| 17045 |
/* 30 */ |
| 17046 |
/***/ (function(module, exports, __nested_webpack_require_208833__) { |
| 17047 |
|
| 17048 |
"use strict"; |
| 17049 |
|
| 17050 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 17051 |
var Registry = __nested_webpack_require_208833__(1); |
| 17052 |
var ShadowBlot = /** @class */ (function () { |
| 17053 |
function ShadowBlot(domNode) { |
| 17054 |
this.domNode = domNode; |
| 17055 |
// @ts-ignore |
| 17056 |
this.domNode[Registry.DATA_KEY] = { blot: this }; |
| 17057 |
} |
| 17058 |
Object.defineProperty(ShadowBlot.prototype, "statics", { |
| 17059 |
// Hack for accessing inherited static methods |
| 17060 |
get: function () { |
| 17061 |
return this.constructor; |
| 17062 |
}, |
| 17063 |
enumerable: true, |
| 17064 |
configurable: true |
| 17065 |
}); |
| 17066 |
ShadowBlot.create = function (value) { |
| 17067 |
if (this.tagName == null) { |
| 17068 |
throw new Registry.ParchmentError('Blot definition missing tagName'); |
| 17069 |
} |
| 17070 |
var node; |
| 17071 |
if (Array.isArray(this.tagName)) { |
| 17072 |
if (typeof value === 'string') { |
| 17073 |
value = value.toUpperCase(); |
| 17074 |
if (parseInt(value).toString() === value) { |
| 17075 |
value = parseInt(value); |
| 17076 |
} |
| 17077 |
} |
| 17078 |
if (typeof value === 'number') { |
| 17079 |
node = document.createElement(this.tagName[value - 1]); |
| 17080 |
} |
| 17081 |
else if (this.tagName.indexOf(value) > -1) { |
| 17082 |
node = document.createElement(value); |
| 17083 |
} |
| 17084 |
else { |
| 17085 |
node = document.createElement(this.tagName[0]); |
| 17086 |
} |
| 17087 |
} |
| 17088 |
else { |
| 17089 |
node = document.createElement(this.tagName); |
| 17090 |
} |
| 17091 |
if (this.className) { |
| 17092 |
node.classList.add(this.className); |
| 17093 |
} |
| 17094 |
return node; |
| 17095 |
}; |
| 17096 |
ShadowBlot.prototype.attach = function () { |
| 17097 |
if (this.parent != null) { |
| 17098 |
this.scroll = this.parent.scroll; |
| 17099 |
} |
| 17100 |
}; |
| 17101 |
ShadowBlot.prototype.clone = function () { |
| 17102 |
var domNode = this.domNode.cloneNode(false); |
| 17103 |
return Registry.create(domNode); |
| 17104 |
}; |
| 17105 |
ShadowBlot.prototype.detach = function () { |
| 17106 |
if (this.parent != null) |
| 17107 |
this.parent.removeChild(this); |
| 17108 |
// @ts-ignore |
| 17109 |
delete this.domNode[Registry.DATA_KEY]; |
| 17110 |
}; |
| 17111 |
ShadowBlot.prototype.deleteAt = function (index, length) { |
| 17112 |
var blot = this.isolate(index, length); |
| 17113 |
blot.remove(); |
| 17114 |
}; |
| 17115 |
ShadowBlot.prototype.formatAt = function (index, length, name, value) { |
| 17116 |
var blot = this.isolate(index, length); |
| 17117 |
if (Registry.query(name, Registry.Scope.BLOT) != null && value) { |
| 17118 |
blot.wrap(name, value); |
| 17119 |
} |
| 17120 |
else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { |
| 17121 |
var parent = Registry.create(this.statics.scope); |
| 17122 |
blot.wrap(parent); |
| 17123 |
parent.format(name, value); |
| 17124 |
} |
| 17125 |
}; |
| 17126 |
ShadowBlot.prototype.insertAt = function (index, value, def) { |
| 17127 |
var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); |
| 17128 |
var ref = this.split(index); |
| 17129 |
this.parent.insertBefore(blot, ref); |
| 17130 |
}; |
| 17131 |
ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { |
| 17132 |
if (refBlot === void 0) { refBlot = null; } |
| 17133 |
if (this.parent != null) { |
| 17134 |
this.parent.children.remove(this); |
| 17135 |
} |
| 17136 |
var refDomNode = null; |
| 17137 |
parentBlot.children.insertBefore(this, refBlot); |
| 17138 |
if (refBlot != null) { |
| 17139 |
refDomNode = refBlot.domNode; |
| 17140 |
} |
| 17141 |
if (this.domNode.parentNode != parentBlot.domNode || |
| 17142 |
this.domNode.nextSibling != refDomNode) { |
| 17143 |
parentBlot.domNode.insertBefore(this.domNode, refDomNode); |
| 17144 |
} |
| 17145 |
this.parent = parentBlot; |
| 17146 |
this.attach(); |
| 17147 |
}; |
| 17148 |
ShadowBlot.prototype.isolate = function (index, length) { |
| 17149 |
var target = this.split(index); |
| 17150 |
target.split(length); |
| 17151 |
return target; |
| 17152 |
}; |
| 17153 |
ShadowBlot.prototype.length = function () { |
| 17154 |
return 1; |
| 17155 |
}; |
| 17156 |
ShadowBlot.prototype.offset = function (root) { |
| 17157 |
if (root === void 0) { root = this.parent; } |
| 17158 |
if (this.parent == null || this == root) |
| 17159 |
return 0; |
| 17160 |
return this.parent.children.offset(this) + this.parent.offset(root); |
| 17161 |
}; |
| 17162 |
ShadowBlot.prototype.optimize = function (context) { |
| 17163 |
// TODO clean up once we use WeakMap |
| 17164 |
// @ts-ignore |
| 17165 |
if (this.domNode[Registry.DATA_KEY] != null) { |
| 17166 |
// @ts-ignore |
| 17167 |
delete this.domNode[Registry.DATA_KEY].mutations; |
| 17168 |
} |
| 17169 |
}; |
| 17170 |
ShadowBlot.prototype.remove = function () { |
| 17171 |
if (this.domNode.parentNode != null) { |
| 17172 |
this.domNode.parentNode.removeChild(this.domNode); |
| 17173 |
} |
| 17174 |
this.detach(); |
| 17175 |
}; |
| 17176 |
ShadowBlot.prototype.replace = function (target) { |
| 17177 |
if (target.parent == null) |
| 17178 |
return; |
| 17179 |
target.parent.insertBefore(this, target.next); |
| 17180 |
target.remove(); |
| 17181 |
}; |
| 17182 |
ShadowBlot.prototype.replaceWith = function (name, value) { |
| 17183 |
var replacement = typeof name === 'string' ? Registry.create(name, value) : name; |
| 17184 |
replacement.replace(this); |
| 17185 |
return replacement; |
| 17186 |
}; |
| 17187 |
ShadowBlot.prototype.split = function (index, force) { |
| 17188 |
return index === 0 ? this : this.next; |
| 17189 |
}; |
| 17190 |
ShadowBlot.prototype.update = function (mutations, context) { |
| 17191 |
// Nothing to do by default |
| 17192 |
}; |
| 17193 |
ShadowBlot.prototype.wrap = function (name, value) { |
| 17194 |
var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; |
| 17195 |
if (this.parent != null) { |
| 17196 |
this.parent.insertBefore(wrapper, this.next); |
| 17197 |
} |
| 17198 |
wrapper.appendChild(this); |
| 17199 |
return wrapper; |
| 17200 |
}; |
| 17201 |
ShadowBlot.blotName = 'abstract'; |
| 17202 |
return ShadowBlot; |
| 17203 |
}()); |
| 17204 |
exports.default = ShadowBlot; |
| 17205 |
|
| 17206 |
|
| 17207 |
/***/ }), |
| 17208 |
/* 31 */ |
| 17209 |
/***/ (function(module, exports, __nested_webpack_require_214530__) { |
| 17210 |
|
| 17211 |
"use strict"; |
| 17212 |
|
| 17213 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 17214 |
var attributor_1 = __nested_webpack_require_214530__(12); |
| 17215 |
var class_1 = __nested_webpack_require_214530__(32); |
| 17216 |
var style_1 = __nested_webpack_require_214530__(33); |
| 17217 |
var Registry = __nested_webpack_require_214530__(1); |
| 17218 |
var AttributorStore = /** @class */ (function () { |
| 17219 |
function AttributorStore(domNode) { |
| 17220 |
this.attributes = {}; |
| 17221 |
this.domNode = domNode; |
| 17222 |
this.build(); |
| 17223 |
} |
| 17224 |
AttributorStore.prototype.attribute = function (attribute, value) { |
| 17225 |
// verb |
| 17226 |
if (value) { |
| 17227 |
if (attribute.add(this.domNode, value)) { |
| 17228 |
if (attribute.value(this.domNode) != null) { |
| 17229 |
this.attributes[attribute.attrName] = attribute; |
| 17230 |
} |
| 17231 |
else { |
| 17232 |
delete this.attributes[attribute.attrName]; |
| 17233 |
} |
| 17234 |
} |
| 17235 |
} |
| 17236 |
else { |
| 17237 |
attribute.remove(this.domNode); |
| 17238 |
delete this.attributes[attribute.attrName]; |
| 17239 |
} |
| 17240 |
}; |
| 17241 |
AttributorStore.prototype.build = function () { |
| 17242 |
var _this = this; |
| 17243 |
this.attributes = {}; |
| 17244 |
var attributes = attributor_1.default.keys(this.domNode); |
| 17245 |
var classes = class_1.default.keys(this.domNode); |
| 17246 |
var styles = style_1.default.keys(this.domNode); |
| 17247 |
attributes |
| 17248 |
.concat(classes) |
| 17249 |
.concat(styles) |
| 17250 |
.forEach(function (name) { |
| 17251 |
var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); |
| 17252 |
if (attr instanceof attributor_1.default) { |
| 17253 |
_this.attributes[attr.attrName] = attr; |
| 17254 |
} |
| 17255 |
}); |
| 17256 |
}; |
| 17257 |
AttributorStore.prototype.copy = function (target) { |
| 17258 |
var _this = this; |
| 17259 |
Object.keys(this.attributes).forEach(function (key) { |
| 17260 |
var value = _this.attributes[key].value(_this.domNode); |
| 17261 |
target.format(key, value); |
| 17262 |
}); |
| 17263 |
}; |
| 17264 |
AttributorStore.prototype.move = function (target) { |
| 17265 |
var _this = this; |
| 17266 |
this.copy(target); |
| 17267 |
Object.keys(this.attributes).forEach(function (key) { |
| 17268 |
_this.attributes[key].remove(_this.domNode); |
| 17269 |
}); |
| 17270 |
this.attributes = {}; |
| 17271 |
}; |
| 17272 |
AttributorStore.prototype.values = function () { |
| 17273 |
var _this = this; |
| 17274 |
return Object.keys(this.attributes).reduce(function (attributes, name) { |
| 17275 |
attributes[name] = _this.attributes[name].value(_this.domNode); |
| 17276 |
return attributes; |
| 17277 |
}, {}); |
| 17278 |
}; |
| 17279 |
return AttributorStore; |
| 17280 |
}()); |
| 17281 |
exports.default = AttributorStore; |
| 17282 |
|
| 17283 |
|
| 17284 |
/***/ }), |
| 17285 |
/* 32 */ |
| 17286 |
/***/ (function(module, exports, __nested_webpack_require_217128__) { |
| 17287 |
|
| 17288 |
"use strict"; |
| 17289 |
|
| 17290 |
var __extends = (this && this.__extends) || (function () { |
| 17291 |
var extendStatics = Object.setPrototypeOf || |
| 17292 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 17293 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 17294 |
return function (d, b) { |
| 17295 |
extendStatics(d, b); |
| 17296 |
function __() { this.constructor = d; } |
| 17297 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 17298 |
}; |
| 17299 |
})(); |
| 17300 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 17301 |
var attributor_1 = __nested_webpack_require_217128__(12); |
| 17302 |
function match(node, prefix) { |
| 17303 |
var className = node.getAttribute('class') || ''; |
| 17304 |
return className.split(/\s+/).filter(function (name) { |
| 17305 |
return name.indexOf(prefix + "-") === 0; |
| 17306 |
}); |
| 17307 |
} |
| 17308 |
var ClassAttributor = /** @class */ (function (_super) { |
| 17309 |
__extends(ClassAttributor, _super); |
| 17310 |
function ClassAttributor() { |
| 17311 |
return _super !== null && _super.apply(this, arguments) || this; |
| 17312 |
} |
| 17313 |
ClassAttributor.keys = function (node) { |
| 17314 |
return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { |
| 17315 |
return name |
| 17316 |
.split('-') |
| 17317 |
.slice(0, -1) |
| 17318 |
.join('-'); |
| 17319 |
}); |
| 17320 |
}; |
| 17321 |
ClassAttributor.prototype.add = function (node, value) { |
| 17322 |
if (!this.canAdd(node, value)) |
| 17323 |
return false; |
| 17324 |
this.remove(node); |
| 17325 |
node.classList.add(this.keyName + "-" + value); |
| 17326 |
return true; |
| 17327 |
}; |
| 17328 |
ClassAttributor.prototype.remove = function (node) { |
| 17329 |
var matches = match(node, this.keyName); |
| 17330 |
matches.forEach(function (name) { |
| 17331 |
node.classList.remove(name); |
| 17332 |
}); |
| 17333 |
if (node.classList.length === 0) { |
| 17334 |
node.removeAttribute('class'); |
| 17335 |
} |
| 17336 |
}; |
| 17337 |
ClassAttributor.prototype.value = function (node) { |
| 17338 |
var result = match(node, this.keyName)[0] || ''; |
| 17339 |
var value = result.slice(this.keyName.length + 1); // +1 for hyphen |
| 17340 |
return this.canAdd(node, value) ? value : ''; |
| 17341 |
}; |
| 17342 |
return ClassAttributor; |
| 17343 |
}(attributor_1.default)); |
| 17344 |
exports.default = ClassAttributor; |
| 17345 |
|
| 17346 |
|
| 17347 |
/***/ }), |
| 17348 |
/* 33 */ |
| 17349 |
/***/ (function(module, exports, __nested_webpack_require_219372__) { |
| 17350 |
|
| 17351 |
"use strict"; |
| 17352 |
|
| 17353 |
var __extends = (this && this.__extends) || (function () { |
| 17354 |
var extendStatics = Object.setPrototypeOf || |
| 17355 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 17356 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 17357 |
return function (d, b) { |
| 17358 |
extendStatics(d, b); |
| 17359 |
function __() { this.constructor = d; } |
| 17360 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 17361 |
}; |
| 17362 |
})(); |
| 17363 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 17364 |
var attributor_1 = __nested_webpack_require_219372__(12); |
| 17365 |
function camelize(name) { |
| 17366 |
var parts = name.split('-'); |
| 17367 |
var rest = parts |
| 17368 |
.slice(1) |
| 17369 |
.map(function (part) { |
| 17370 |
return part[0].toUpperCase() + part.slice(1); |
| 17371 |
}) |
| 17372 |
.join(''); |
| 17373 |
return parts[0] + rest; |
| 17374 |
} |
| 17375 |
var StyleAttributor = /** @class */ (function (_super) { |
| 17376 |
__extends(StyleAttributor, _super); |
| 17377 |
function StyleAttributor() { |
| 17378 |
return _super !== null && _super.apply(this, arguments) || this; |
| 17379 |
} |
| 17380 |
StyleAttributor.keys = function (node) { |
| 17381 |
return (node.getAttribute('style') || '').split(';').map(function (value) { |
| 17382 |
var arr = value.split(':'); |
| 17383 |
return arr[0].trim(); |
| 17384 |
}); |
| 17385 |
}; |
| 17386 |
StyleAttributor.prototype.add = function (node, value) { |
| 17387 |
if (!this.canAdd(node, value)) |
| 17388 |
return false; |
| 17389 |
// @ts-ignore |
| 17390 |
node.style[camelize(this.keyName)] = value; |
| 17391 |
return true; |
| 17392 |
}; |
| 17393 |
StyleAttributor.prototype.remove = function (node) { |
| 17394 |
// @ts-ignore |
| 17395 |
node.style[camelize(this.keyName)] = ''; |
| 17396 |
if (!node.getAttribute('style')) { |
| 17397 |
node.removeAttribute('style'); |
| 17398 |
} |
| 17399 |
}; |
| 17400 |
StyleAttributor.prototype.value = function (node) { |
| 17401 |
// @ts-ignore |
| 17402 |
var value = node.style[camelize(this.keyName)]; |
| 17403 |
return this.canAdd(node, value) ? value : ''; |
| 17404 |
}; |
| 17405 |
return StyleAttributor; |
| 17406 |
}(attributor_1.default)); |
| 17407 |
exports.default = StyleAttributor; |
| 17408 |
|
| 17409 |
|
| 17410 |
/***/ }), |
| 17411 |
/* 34 */ |
| 17412 |
/***/ (function(module, exports, __webpack_require__) { |
| 17413 |
|
| 17414 |
"use strict"; |
| 17415 |
|
| 17416 |
|
| 17417 |
Object.defineProperty(exports, "__esModule", { |
| 17418 |
value: true |
| 17419 |
}); |
| 17420 |
|
| 17421 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 17422 |
|
| 17423 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 17424 |
|
| 17425 |
var Theme = function () { |
| 17426 |
function Theme(quill, options) { |
| 17427 |
_classCallCheck(this, Theme); |
| 17428 |
|
| 17429 |
this.quill = quill; |
| 17430 |
this.options = options; |
| 17431 |
this.modules = {}; |
| 17432 |
} |
| 17433 |
|
| 17434 |
_createClass(Theme, [{ |
| 17435 |
key: 'init', |
| 17436 |
value: function init() { |
| 17437 |
var _this = this; |
| 17438 |
|
| 17439 |
Object.keys(this.options.modules).forEach(function (name) { |
| 17440 |
if (_this.modules[name] == null) { |
| 17441 |
_this.addModule(name); |
| 17442 |
} |
| 17443 |
}); |
| 17444 |
} |
| 17445 |
}, { |
| 17446 |
key: 'addModule', |
| 17447 |
value: function addModule(name) { |
| 17448 |
var moduleClass = this.quill.constructor.import('modules/' + name); |
| 17449 |
this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); |
| 17450 |
return this.modules[name]; |
| 17451 |
} |
| 17452 |
}]); |
| 17453 |
|
| 17454 |
return Theme; |
| 17455 |
}(); |
| 17456 |
|
| 17457 |
Theme.DEFAULTS = { |
| 17458 |
modules: {} |
| 17459 |
}; |
| 17460 |
Theme.themes = { |
| 17461 |
'default': Theme |
| 17462 |
}; |
| 17463 |
|
| 17464 |
exports.default = Theme; |
| 17465 |
|
| 17466 |
/***/ }), |
| 17467 |
/* 35 */ |
| 17468 |
/***/ (function(module, exports, __nested_webpack_require_223199__) { |
| 17469 |
|
| 17470 |
"use strict"; |
| 17471 |
|
| 17472 |
|
| 17473 |
Object.defineProperty(exports, "__esModule", { |
| 17474 |
value: true |
| 17475 |
}); |
| 17476 |
|
| 17477 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 17478 |
|
| 17479 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 17480 |
|
| 17481 |
var _parchment = __nested_webpack_require_223199__(0); |
| 17482 |
|
| 17483 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 17484 |
|
| 17485 |
var _text = __nested_webpack_require_223199__(7); |
| 17486 |
|
| 17487 |
var _text2 = _interopRequireDefault(_text); |
| 17488 |
|
| 17489 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 17490 |
|
| 17491 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 17492 |
|
| 17493 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 17494 |
|
| 17495 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 17496 |
|
| 17497 |
var GUARD_TEXT = '\uFEFF'; |
| 17498 |
|
| 17499 |
var Embed = function (_Parchment$Embed) { |
| 17500 |
_inherits(Embed, _Parchment$Embed); |
| 17501 |
|
| 17502 |
function Embed(node) { |
| 17503 |
_classCallCheck(this, Embed); |
| 17504 |
|
| 17505 |
var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); |
| 17506 |
|
| 17507 |
_this.contentNode = document.createElement('span'); |
| 17508 |
_this.contentNode.setAttribute('contenteditable', false); |
| 17509 |
[].slice.call(_this.domNode.childNodes).forEach(function (childNode) { |
| 17510 |
_this.contentNode.appendChild(childNode); |
| 17511 |
}); |
| 17512 |
_this.leftGuard = document.createTextNode(GUARD_TEXT); |
| 17513 |
_this.rightGuard = document.createTextNode(GUARD_TEXT); |
| 17514 |
_this.domNode.appendChild(_this.leftGuard); |
| 17515 |
_this.domNode.appendChild(_this.contentNode); |
| 17516 |
_this.domNode.appendChild(_this.rightGuard); |
| 17517 |
return _this; |
| 17518 |
} |
| 17519 |
|
| 17520 |
_createClass(Embed, [{ |
| 17521 |
key: 'index', |
| 17522 |
value: function index(node, offset) { |
| 17523 |
if (node === this.leftGuard) return 0; |
| 17524 |
if (node === this.rightGuard) return 1; |
| 17525 |
return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); |
| 17526 |
} |
| 17527 |
}, { |
| 17528 |
key: 'restore', |
| 17529 |
value: function restore(node) { |
| 17530 |
var range = void 0, |
| 17531 |
textNode = void 0; |
| 17532 |
var text = node.data.split(GUARD_TEXT).join(''); |
| 17533 |
if (node === this.leftGuard) { |
| 17534 |
if (this.prev instanceof _text2.default) { |
| 17535 |
var prevLength = this.prev.length(); |
| 17536 |
this.prev.insertAt(prevLength, text); |
| 17537 |
range = { |
| 17538 |
startNode: this.prev.domNode, |
| 17539 |
startOffset: prevLength + text.length |
| 17540 |
}; |
| 17541 |
} else { |
| 17542 |
textNode = document.createTextNode(text); |
| 17543 |
this.parent.insertBefore(_parchment2.default.create(textNode), this); |
| 17544 |
range = { |
| 17545 |
startNode: textNode, |
| 17546 |
startOffset: text.length |
| 17547 |
}; |
| 17548 |
} |
| 17549 |
} else if (node === this.rightGuard) { |
| 17550 |
if (this.next instanceof _text2.default) { |
| 17551 |
this.next.insertAt(0, text); |
| 17552 |
range = { |
| 17553 |
startNode: this.next.domNode, |
| 17554 |
startOffset: text.length |
| 17555 |
}; |
| 17556 |
} else { |
| 17557 |
textNode = document.createTextNode(text); |
| 17558 |
this.parent.insertBefore(_parchment2.default.create(textNode), this.next); |
| 17559 |
range = { |
| 17560 |
startNode: textNode, |
| 17561 |
startOffset: text.length |
| 17562 |
}; |
| 17563 |
} |
| 17564 |
} |
| 17565 |
node.data = GUARD_TEXT; |
| 17566 |
return range; |
| 17567 |
} |
| 17568 |
}, { |
| 17569 |
key: 'update', |
| 17570 |
value: function update(mutations, context) { |
| 17571 |
var _this2 = this; |
| 17572 |
|
| 17573 |
mutations.forEach(function (mutation) { |
| 17574 |
if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { |
| 17575 |
var range = _this2.restore(mutation.target); |
| 17576 |
if (range) context.range = range; |
| 17577 |
} |
| 17578 |
}); |
| 17579 |
} |
| 17580 |
}]); |
| 17581 |
|
| 17582 |
return Embed; |
| 17583 |
}(_parchment2.default.Embed); |
| 17584 |
|
| 17585 |
exports.default = Embed; |
| 17586 |
|
| 17587 |
/***/ }), |
| 17588 |
/* 36 */ |
| 17589 |
/***/ (function(module, exports, __nested_webpack_require_228527__) { |
| 17590 |
|
| 17591 |
"use strict"; |
| 17592 |
|
| 17593 |
|
| 17594 |
Object.defineProperty(exports, "__esModule", { |
| 17595 |
value: true |
| 17596 |
}); |
| 17597 |
exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; |
| 17598 |
|
| 17599 |
var _parchment = __nested_webpack_require_228527__(0); |
| 17600 |
|
| 17601 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 17602 |
|
| 17603 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 17604 |
|
| 17605 |
var config = { |
| 17606 |
scope: _parchment2.default.Scope.BLOCK, |
| 17607 |
whitelist: ['right', 'center', 'justify'] |
| 17608 |
}; |
| 17609 |
|
| 17610 |
var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); |
| 17611 |
var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); |
| 17612 |
var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); |
| 17613 |
|
| 17614 |
exports.AlignAttribute = AlignAttribute; |
| 17615 |
exports.AlignClass = AlignClass; |
| 17616 |
exports.AlignStyle = AlignStyle; |
| 17617 |
|
| 17618 |
/***/ }), |
| 17619 |
/* 37 */ |
| 17620 |
/***/ (function(module, exports, __nested_webpack_require_229442__) { |
| 17621 |
|
| 17622 |
"use strict"; |
| 17623 |
|
| 17624 |
|
| 17625 |
Object.defineProperty(exports, "__esModule", { |
| 17626 |
value: true |
| 17627 |
}); |
| 17628 |
exports.BackgroundStyle = exports.BackgroundClass = undefined; |
| 17629 |
|
| 17630 |
var _parchment = __nested_webpack_require_229442__(0); |
| 17631 |
|
| 17632 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 17633 |
|
| 17634 |
var _color = __nested_webpack_require_229442__(26); |
| 17635 |
|
| 17636 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 17637 |
|
| 17638 |
var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { |
| 17639 |
scope: _parchment2.default.Scope.INLINE |
| 17640 |
}); |
| 17641 |
var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { |
| 17642 |
scope: _parchment2.default.Scope.INLINE |
| 17643 |
}); |
| 17644 |
|
| 17645 |
exports.BackgroundClass = BackgroundClass; |
| 17646 |
exports.BackgroundStyle = BackgroundStyle; |
| 17647 |
|
| 17648 |
/***/ }), |
| 17649 |
/* 38 */ |
| 17650 |
/***/ (function(module, exports, __nested_webpack_require_230249__) { |
| 17651 |
|
| 17652 |
"use strict"; |
| 17653 |
|
| 17654 |
|
| 17655 |
Object.defineProperty(exports, "__esModule", { |
| 17656 |
value: true |
| 17657 |
}); |
| 17658 |
exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; |
| 17659 |
|
| 17660 |
var _parchment = __nested_webpack_require_230249__(0); |
| 17661 |
|
| 17662 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 17663 |
|
| 17664 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 17665 |
|
| 17666 |
var config = { |
| 17667 |
scope: _parchment2.default.Scope.BLOCK, |
| 17668 |
whitelist: ['rtl'] |
| 17669 |
}; |
| 17670 |
|
| 17671 |
var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); |
| 17672 |
var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); |
| 17673 |
var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); |
| 17674 |
|
| 17675 |
exports.DirectionAttribute = DirectionAttribute; |
| 17676 |
exports.DirectionClass = DirectionClass; |
| 17677 |
exports.DirectionStyle = DirectionStyle; |
| 17678 |
|
| 17679 |
/***/ }), |
| 17680 |
/* 39 */ |
| 17681 |
/***/ (function(module, exports, __nested_webpack_require_231202__) { |
| 17682 |
|
| 17683 |
"use strict"; |
| 17684 |
|
| 17685 |
|
| 17686 |
Object.defineProperty(exports, "__esModule", { |
| 17687 |
value: true |
| 17688 |
}); |
| 17689 |
exports.FontClass = exports.FontStyle = undefined; |
| 17690 |
|
| 17691 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 17692 |
|
| 17693 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 17694 |
|
| 17695 |
var _parchment = __nested_webpack_require_231202__(0); |
| 17696 |
|
| 17697 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 17698 |
|
| 17699 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 17700 |
|
| 17701 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 17702 |
|
| 17703 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 17704 |
|
| 17705 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 17706 |
|
| 17707 |
var config = { |
| 17708 |
scope: _parchment2.default.Scope.INLINE, |
| 17709 |
whitelist: ['serif', 'monospace'] |
| 17710 |
}; |
| 17711 |
|
| 17712 |
var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); |
| 17713 |
|
| 17714 |
var FontStyleAttributor = function (_Parchment$Attributor) { |
| 17715 |
_inherits(FontStyleAttributor, _Parchment$Attributor); |
| 17716 |
|
| 17717 |
function FontStyleAttributor() { |
| 17718 |
_classCallCheck(this, FontStyleAttributor); |
| 17719 |
|
| 17720 |
return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); |
| 17721 |
} |
| 17722 |
|
| 17723 |
_createClass(FontStyleAttributor, [{ |
| 17724 |
key: 'value', |
| 17725 |
value: function value(node) { |
| 17726 |
return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); |
| 17727 |
} |
| 17728 |
}]); |
| 17729 |
|
| 17730 |
return FontStyleAttributor; |
| 17731 |
}(_parchment2.default.Attributor.Style); |
| 17732 |
|
| 17733 |
var FontStyle = new FontStyleAttributor('font', 'font-family', config); |
| 17734 |
|
| 17735 |
exports.FontStyle = FontStyle; |
| 17736 |
exports.FontClass = FontClass; |
| 17737 |
|
| 17738 |
/***/ }), |
| 17739 |
/* 40 */ |
| 17740 |
/***/ (function(module, exports, __nested_webpack_require_234578__) { |
| 17741 |
|
| 17742 |
"use strict"; |
| 17743 |
|
| 17744 |
|
| 17745 |
Object.defineProperty(exports, "__esModule", { |
| 17746 |
value: true |
| 17747 |
}); |
| 17748 |
exports.SizeStyle = exports.SizeClass = undefined; |
| 17749 |
|
| 17750 |
var _parchment = __nested_webpack_require_234578__(0); |
| 17751 |
|
| 17752 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 17753 |
|
| 17754 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 17755 |
|
| 17756 |
var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { |
| 17757 |
scope: _parchment2.default.Scope.INLINE, |
| 17758 |
whitelist: ['small', 'large', 'huge'] |
| 17759 |
}); |
| 17760 |
var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { |
| 17761 |
scope: _parchment2.default.Scope.INLINE, |
| 17762 |
whitelist: ['10px', '18px', '32px'] |
| 17763 |
}); |
| 17764 |
|
| 17765 |
exports.SizeClass = SizeClass; |
| 17766 |
exports.SizeStyle = SizeStyle; |
| 17767 |
|
| 17768 |
/***/ }), |
| 17769 |
/* 41 */ |
| 17770 |
/***/ (function(module, exports, __nested_webpack_require_235375__) { |
| 17771 |
|
| 17772 |
"use strict"; |
| 17773 |
|
| 17774 |
|
| 17775 |
module.exports = { |
| 17776 |
'align': { |
| 17777 |
'': __nested_webpack_require_235375__(76), |
| 17778 |
'center': __nested_webpack_require_235375__(77), |
| 17779 |
'right': __nested_webpack_require_235375__(78), |
| 17780 |
'justify': __nested_webpack_require_235375__(79) |
| 17781 |
}, |
| 17782 |
'background': __nested_webpack_require_235375__(80), |
| 17783 |
'blockquote': __nested_webpack_require_235375__(81), |
| 17784 |
'bold': __nested_webpack_require_235375__(82), |
| 17785 |
'clean': __nested_webpack_require_235375__(83), |
| 17786 |
'code': __nested_webpack_require_235375__(58), |
| 17787 |
'code-block': __nested_webpack_require_235375__(58), |
| 17788 |
'color': __nested_webpack_require_235375__(84), |
| 17789 |
'direction': { |
| 17790 |
'': __nested_webpack_require_235375__(85), |
| 17791 |
'rtl': __nested_webpack_require_235375__(86) |
| 17792 |
}, |
| 17793 |
'float': { |
| 17794 |
'center': __nested_webpack_require_235375__(87), |
| 17795 |
'full': __nested_webpack_require_235375__(88), |
| 17796 |
'left': __nested_webpack_require_235375__(89), |
| 17797 |
'right': __nested_webpack_require_235375__(90) |
| 17798 |
}, |
| 17799 |
'formula': __nested_webpack_require_235375__(91), |
| 17800 |
'header': { |
| 17801 |
'1': __nested_webpack_require_235375__(92), |
| 17802 |
'2': __nested_webpack_require_235375__(93) |
| 17803 |
}, |
| 17804 |
'italic': __nested_webpack_require_235375__(94), |
| 17805 |
'image': __nested_webpack_require_235375__(95), |
| 17806 |
'indent': { |
| 17807 |
'+1': __nested_webpack_require_235375__(96), |
| 17808 |
'-1': __nested_webpack_require_235375__(97) |
| 17809 |
}, |
| 17810 |
'link': __nested_webpack_require_235375__(98), |
| 17811 |
'list': { |
| 17812 |
'ordered': __nested_webpack_require_235375__(99), |
| 17813 |
'bullet': __nested_webpack_require_235375__(100), |
| 17814 |
'check': __nested_webpack_require_235375__(101) |
| 17815 |
}, |
| 17816 |
'script': { |
| 17817 |
'sub': __nested_webpack_require_235375__(102), |
| 17818 |
'super': __nested_webpack_require_235375__(103) |
| 17819 |
}, |
| 17820 |
'strike': __nested_webpack_require_235375__(104), |
| 17821 |
'underline': __nested_webpack_require_235375__(105), |
| 17822 |
'video': __nested_webpack_require_235375__(106) |
| 17823 |
}; |
| 17824 |
|
| 17825 |
/***/ }), |
| 17826 |
/* 42 */ |
| 17827 |
/***/ (function(module, exports, __nested_webpack_require_236844__) { |
| 17828 |
|
| 17829 |
"use strict"; |
| 17830 |
|
| 17831 |
|
| 17832 |
Object.defineProperty(exports, "__esModule", { |
| 17833 |
value: true |
| 17834 |
}); |
| 17835 |
exports.getLastChangeIndex = exports.default = undefined; |
| 17836 |
|
| 17837 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 17838 |
|
| 17839 |
var _parchment = __nested_webpack_require_236844__(0); |
| 17840 |
|
| 17841 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 17842 |
|
| 17843 |
var _quill = __nested_webpack_require_236844__(5); |
| 17844 |
|
| 17845 |
var _quill2 = _interopRequireDefault(_quill); |
| 17846 |
|
| 17847 |
var _module = __nested_webpack_require_236844__(9); |
| 17848 |
|
| 17849 |
var _module2 = _interopRequireDefault(_module); |
| 17850 |
|
| 17851 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 17852 |
|
| 17853 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 17854 |
|
| 17855 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 17856 |
|
| 17857 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 17858 |
|
| 17859 |
var History = function (_Module) { |
| 17860 |
_inherits(History, _Module); |
| 17861 |
|
| 17862 |
function History(quill, options) { |
| 17863 |
_classCallCheck(this, History); |
| 17864 |
|
| 17865 |
var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); |
| 17866 |
|
| 17867 |
_this.lastRecorded = 0; |
| 17868 |
_this.ignoreChange = false; |
| 17869 |
_this.clear(); |
| 17870 |
_this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { |
| 17871 |
if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; |
| 17872 |
if (!_this.options.userOnly || source === _quill2.default.sources.USER) { |
| 17873 |
_this.record(delta, oldDelta); |
| 17874 |
} else { |
| 17875 |
_this.transform(delta); |
| 17876 |
} |
| 17877 |
}); |
| 17878 |
_this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); |
| 17879 |
_this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); |
| 17880 |
if (/Win/i.test(navigator.platform)) { |
| 17881 |
_this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); |
| 17882 |
} |
| 17883 |
return _this; |
| 17884 |
} |
| 17885 |
|
| 17886 |
_createClass(History, [{ |
| 17887 |
key: 'change', |
| 17888 |
value: function change(source, dest) { |
| 17889 |
if (this.stack[source].length === 0) return; |
| 17890 |
var delta = this.stack[source].pop(); |
| 17891 |
this.stack[dest].push(delta); |
| 17892 |
this.lastRecorded = 0; |
| 17893 |
this.ignoreChange = true; |
| 17894 |
this.quill.updateContents(delta[source], _quill2.default.sources.USER); |
| 17895 |
this.ignoreChange = false; |
| 17896 |
var index = getLastChangeIndex(delta[source]); |
| 17897 |
this.quill.setSelection(index); |
| 17898 |
} |
| 17899 |
}, { |
| 17900 |
key: 'clear', |
| 17901 |
value: function clear() { |
| 17902 |
this.stack = { undo: [], redo: [] }; |
| 17903 |
} |
| 17904 |
}, { |
| 17905 |
key: 'cutoff', |
| 17906 |
value: function cutoff() { |
| 17907 |
this.lastRecorded = 0; |
| 17908 |
} |
| 17909 |
}, { |
| 17910 |
key: 'record', |
| 17911 |
value: function record(changeDelta, oldDelta) { |
| 17912 |
if (changeDelta.ops.length === 0) return; |
| 17913 |
this.stack.redo = []; |
| 17914 |
var undoDelta = this.quill.getContents().diff(oldDelta); |
| 17915 |
var timestamp = Date.now(); |
| 17916 |
if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { |
| 17917 |
var delta = this.stack.undo.pop(); |
| 17918 |
undoDelta = undoDelta.compose(delta.undo); |
| 17919 |
changeDelta = delta.redo.compose(changeDelta); |
| 17920 |
} else { |
| 17921 |
this.lastRecorded = timestamp; |
| 17922 |
} |
| 17923 |
this.stack.undo.push({ |
| 17924 |
redo: changeDelta, |
| 17925 |
undo: undoDelta |
| 17926 |
}); |
| 17927 |
if (this.stack.undo.length > this.options.maxStack) { |
| 17928 |
this.stack.undo.shift(); |
| 17929 |
} |
| 17930 |
} |
| 17931 |
}, { |
| 17932 |
key: 'redo', |
| 17933 |
value: function redo() { |
| 17934 |
this.change('redo', 'undo'); |
| 17935 |
} |
| 17936 |
}, { |
| 17937 |
key: 'transform', |
| 17938 |
value: function transform(delta) { |
| 17939 |
this.stack.undo.forEach(function (change) { |
| 17940 |
change.undo = delta.transform(change.undo, true); |
| 17941 |
change.redo = delta.transform(change.redo, true); |
| 17942 |
}); |
| 17943 |
this.stack.redo.forEach(function (change) { |
| 17944 |
change.undo = delta.transform(change.undo, true); |
| 17945 |
change.redo = delta.transform(change.redo, true); |
| 17946 |
}); |
| 17947 |
} |
| 17948 |
}, { |
| 17949 |
key: 'undo', |
| 17950 |
value: function undo() { |
| 17951 |
this.change('undo', 'redo'); |
| 17952 |
} |
| 17953 |
}]); |
| 17954 |
|
| 17955 |
return History; |
| 17956 |
}(_module2.default); |
| 17957 |
|
| 17958 |
History.DEFAULTS = { |
| 17959 |
delay: 1000, |
| 17960 |
maxStack: 100, |
| 17961 |
userOnly: false |
| 17962 |
}; |
| 17963 |
|
| 17964 |
function endsWithNewlineChange(delta) { |
| 17965 |
var lastOp = delta.ops[delta.ops.length - 1]; |
| 17966 |
if (lastOp == null) return false; |
| 17967 |
if (lastOp.insert != null) { |
| 17968 |
return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); |
| 17969 |
} |
| 17970 |
if (lastOp.attributes != null) { |
| 17971 |
return Object.keys(lastOp.attributes).some(function (attr) { |
| 17972 |
return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; |
| 17973 |
}); |
| 17974 |
} |
| 17975 |
return false; |
| 17976 |
} |
| 17977 |
|
| 17978 |
function getLastChangeIndex(delta) { |
| 17979 |
var deleteLength = delta.reduce(function (length, op) { |
| 17980 |
length += op.delete || 0; |
| 17981 |
return length; |
| 17982 |
}, 0); |
| 17983 |
var changeIndex = delta.length() - deleteLength; |
| 17984 |
if (endsWithNewlineChange(delta)) { |
| 17985 |
changeIndex -= 1; |
| 17986 |
} |
| 17987 |
return changeIndex; |
| 17988 |
} |
| 17989 |
|
| 17990 |
exports.default = History; |
| 17991 |
exports.getLastChangeIndex = getLastChangeIndex; |
| 17992 |
|
| 17993 |
/***/ }), |
| 17994 |
/* 43 */ |
| 17995 |
/***/ (function(module, exports, __nested_webpack_require_242979__) { |
| 17996 |
|
| 17997 |
"use strict"; |
| 17998 |
|
| 17999 |
|
| 18000 |
Object.defineProperty(exports, "__esModule", { |
| 18001 |
value: true |
| 18002 |
}); |
| 18003 |
exports.default = exports.BaseTooltip = undefined; |
| 18004 |
|
| 18005 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 18006 |
|
| 18007 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 18008 |
|
| 18009 |
var _extend = __nested_webpack_require_242979__(3); |
| 18010 |
|
| 18011 |
var _extend2 = _interopRequireDefault(_extend); |
| 18012 |
|
| 18013 |
var _quillDelta = __nested_webpack_require_242979__(2); |
| 18014 |
|
| 18015 |
var _quillDelta2 = _interopRequireDefault(_quillDelta); |
| 18016 |
|
| 18017 |
var _emitter = __nested_webpack_require_242979__(8); |
| 18018 |
|
| 18019 |
var _emitter2 = _interopRequireDefault(_emitter); |
| 18020 |
|
| 18021 |
var _keyboard = __nested_webpack_require_242979__(23); |
| 18022 |
|
| 18023 |
var _keyboard2 = _interopRequireDefault(_keyboard); |
| 18024 |
|
| 18025 |
var _theme = __nested_webpack_require_242979__(34); |
| 18026 |
|
| 18027 |
var _theme2 = _interopRequireDefault(_theme); |
| 18028 |
|
| 18029 |
var _colorPicker = __nested_webpack_require_242979__(59); |
| 18030 |
|
| 18031 |
var _colorPicker2 = _interopRequireDefault(_colorPicker); |
| 18032 |
|
| 18033 |
var _iconPicker = __nested_webpack_require_242979__(60); |
| 18034 |
|
| 18035 |
var _iconPicker2 = _interopRequireDefault(_iconPicker); |
| 18036 |
|
| 18037 |
var _picker = __nested_webpack_require_242979__(28); |
| 18038 |
|
| 18039 |
var _picker2 = _interopRequireDefault(_picker); |
| 18040 |
|
| 18041 |
var _tooltip = __nested_webpack_require_242979__(61); |
| 18042 |
|
| 18043 |
var _tooltip2 = _interopRequireDefault(_tooltip); |
| 18044 |
|
| 18045 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 18046 |
|
| 18047 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 18048 |
|
| 18049 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 18050 |
|
| 18051 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 18052 |
|
| 18053 |
var ALIGNS = [false, 'center', 'right', 'justify']; |
| 18054 |
|
| 18055 |
var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"]; |
| 18056 |
|
| 18057 |
var FONTS = [false, 'serif', 'monospace']; |
| 18058 |
|
| 18059 |
var HEADERS = ['1', '2', '3', false]; |
| 18060 |
|
| 18061 |
var SIZES = ['small', false, 'large', 'huge']; |
| 18062 |
|
| 18063 |
var BaseTheme = function (_Theme) { |
| 18064 |
_inherits(BaseTheme, _Theme); |
| 18065 |
|
| 18066 |
function BaseTheme(quill, options) { |
| 18067 |
_classCallCheck(this, BaseTheme); |
| 18068 |
|
| 18069 |
var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options)); |
| 18070 |
|
| 18071 |
var listener = function listener(e) { |
| 18072 |
if (!document.body.contains(quill.root)) { |
| 18073 |
return document.body.removeEventListener('click', listener); |
| 18074 |
} |
| 18075 |
if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) { |
| 18076 |
_this.tooltip.hide(); |
| 18077 |
} |
| 18078 |
if (_this.pickers != null) { |
| 18079 |
_this.pickers.forEach(function (picker) { |
| 18080 |
if (!picker.container.contains(e.target)) { |
| 18081 |
picker.close(); |
| 18082 |
} |
| 18083 |
}); |
| 18084 |
} |
| 18085 |
}; |
| 18086 |
quill.emitter.listenDOM('click', document.body, listener); |
| 18087 |
return _this; |
| 18088 |
} |
| 18089 |
|
| 18090 |
_createClass(BaseTheme, [{ |
| 18091 |
key: 'addModule', |
| 18092 |
value: function addModule(name) { |
| 18093 |
var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name); |
| 18094 |
if (name === 'toolbar') { |
| 18095 |
this.extendToolbar(module); |
| 18096 |
} |
| 18097 |
return module; |
| 18098 |
} |
| 18099 |
}, { |
| 18100 |
key: 'buildButtons', |
| 18101 |
value: function buildButtons(buttons, icons) { |
| 18102 |
buttons.forEach(function (button) { |
| 18103 |
var className = button.getAttribute('class') || ''; |
| 18104 |
className.split(/\s+/).forEach(function (name) { |
| 18105 |
if (!name.startsWith('ql-')) return; |
| 18106 |
name = name.slice('ql-'.length); |
| 18107 |
if (icons[name] == null) return; |
| 18108 |
if (name === 'direction') { |
| 18109 |
button.innerHTML = icons[name][''] + icons[name]['rtl']; |
| 18110 |
} else if (typeof icons[name] === 'string') { |
| 18111 |
button.innerHTML = icons[name]; |
| 18112 |
} else { |
| 18113 |
var value = button.value || ''; |
| 18114 |
if (value != null && icons[name][value]) { |
| 18115 |
button.innerHTML = icons[name][value]; |
| 18116 |
} |
| 18117 |
} |
| 18118 |
}); |
| 18119 |
}); |
| 18120 |
} |
| 18121 |
}, { |
| 18122 |
key: 'buildPickers', |
| 18123 |
value: function buildPickers(selects, icons) { |
| 18124 |
var _this2 = this; |
| 18125 |
|
| 18126 |
this.pickers = selects.map(function (select) { |
| 18127 |
if (select.classList.contains('ql-align')) { |
| 18128 |
if (select.querySelector('option') == null) { |
| 18129 |
fillSelect(select, ALIGNS); |
| 18130 |
} |
| 18131 |
return new _iconPicker2.default(select, icons.align); |
| 18132 |
} else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) { |
| 18133 |
var format = select.classList.contains('ql-background') ? 'background' : 'color'; |
| 18134 |
if (select.querySelector('option') == null) { |
| 18135 |
fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); |
| 18136 |
} |
| 18137 |
return new _colorPicker2.default(select, icons[format]); |
| 18138 |
} else { |
| 18139 |
if (select.querySelector('option') == null) { |
| 18140 |
if (select.classList.contains('ql-font')) { |
| 18141 |
fillSelect(select, FONTS); |
| 18142 |
} else if (select.classList.contains('ql-header')) { |
| 18143 |
fillSelect(select, HEADERS); |
| 18144 |
} else if (select.classList.contains('ql-size')) { |
| 18145 |
fillSelect(select, SIZES); |
| 18146 |
} |
| 18147 |
} |
| 18148 |
return new _picker2.default(select); |
| 18149 |
} |
| 18150 |
}); |
| 18151 |
var update = function update() { |
| 18152 |
_this2.pickers.forEach(function (picker) { |
| 18153 |
picker.update(); |
| 18154 |
}); |
| 18155 |
}; |
| 18156 |
this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update); |
| 18157 |
} |
| 18158 |
}]); |
| 18159 |
|
| 18160 |
return BaseTheme; |
| 18161 |
}(_theme2.default); |
| 18162 |
|
| 18163 |
BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, { |
| 18164 |
modules: { |
| 18165 |
toolbar: { |
| 18166 |
handlers: { |
| 18167 |
formula: function formula() { |
| 18168 |
this.quill.theme.tooltip.edit('formula'); |
| 18169 |
}, |
| 18170 |
image: function image() { |
| 18171 |
var _this3 = this; |
| 18172 |
|
| 18173 |
var fileInput = this.container.querySelector('input.ql-image[type=file]'); |
| 18174 |
if (fileInput == null) { |
| 18175 |
fileInput = document.createElement('input'); |
| 18176 |
fileInput.setAttribute('type', 'file'); |
| 18177 |
fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'); |
| 18178 |
fileInput.classList.add('ql-image'); |
| 18179 |
fileInput.addEventListener('change', function () { |
| 18180 |
if (fileInput.files != null && fileInput.files[0] != null) { |
| 18181 |
var reader = new FileReader(); |
| 18182 |
reader.onload = function (e) { |
| 18183 |
var range = _this3.quill.getSelection(true); |
| 18184 |
_this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER); |
| 18185 |
_this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT); |
| 18186 |
fileInput.value = ""; |
| 18187 |
}; |
| 18188 |
reader.readAsDataURL(fileInput.files[0]); |
| 18189 |
} |
| 18190 |
}); |
| 18191 |
this.container.appendChild(fileInput); |
| 18192 |
} |
| 18193 |
fileInput.click(); |
| 18194 |
}, |
| 18195 |
video: function video() { |
| 18196 |
this.quill.theme.tooltip.edit('video'); |
| 18197 |
} |
| 18198 |
} |
| 18199 |
} |
| 18200 |
} |
| 18201 |
}); |
| 18202 |
|
| 18203 |
var BaseTooltip = function (_Tooltip) { |
| 18204 |
_inherits(BaseTooltip, _Tooltip); |
| 18205 |
|
| 18206 |
function BaseTooltip(quill, boundsContainer) { |
| 18207 |
_classCallCheck(this, BaseTooltip); |
| 18208 |
|
| 18209 |
var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer)); |
| 18210 |
|
| 18211 |
_this4.textbox = _this4.root.querySelector('input[type="text"]'); |
| 18212 |
_this4.listen(); |
| 18213 |
return _this4; |
| 18214 |
} |
| 18215 |
|
| 18216 |
_createClass(BaseTooltip, [{ |
| 18217 |
key: 'listen', |
| 18218 |
value: function listen() { |
| 18219 |
var _this5 = this; |
| 18220 |
|
| 18221 |
this.textbox.addEventListener('keydown', function (event) { |
| 18222 |
if (_keyboard2.default.match(event, 'enter')) { |
| 18223 |
_this5.save(); |
| 18224 |
event.preventDefault(); |
| 18225 |
} else if (_keyboard2.default.match(event, 'escape')) { |
| 18226 |
_this5.cancel(); |
| 18227 |
event.preventDefault(); |
| 18228 |
} |
| 18229 |
}); |
| 18230 |
} |
| 18231 |
}, { |
| 18232 |
key: 'cancel', |
| 18233 |
value: function cancel() { |
| 18234 |
this.hide(); |
| 18235 |
} |
| 18236 |
}, { |
| 18237 |
key: 'edit', |
| 18238 |
value: function edit() { |
| 18239 |
var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link'; |
| 18240 |
var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; |
| 18241 |
|
| 18242 |
this.root.classList.remove('ql-hidden'); |
| 18243 |
this.root.classList.add('ql-editing'); |
| 18244 |
if (preview != null) { |
| 18245 |
this.textbox.value = preview; |
| 18246 |
} else if (mode !== this.root.getAttribute('data-mode')) { |
| 18247 |
this.textbox.value = ''; |
| 18248 |
} |
| 18249 |
this.position(this.quill.getBounds(this.quill.selection.savedRange)); |
| 18250 |
this.textbox.select(); |
| 18251 |
this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || ''); |
| 18252 |
this.root.setAttribute('data-mode', mode); |
| 18253 |
} |
| 18254 |
}, { |
| 18255 |
key: 'restoreFocus', |
| 18256 |
value: function restoreFocus() { |
| 18257 |
var scrollTop = this.quill.scrollingContainer.scrollTop; |
| 18258 |
this.quill.focus(); |
| 18259 |
this.quill.scrollingContainer.scrollTop = scrollTop; |
| 18260 |
} |
| 18261 |
}, { |
| 18262 |
key: 'save', |
| 18263 |
value: function save() { |
| 18264 |
var value = this.textbox.value; |
| 18265 |
switch (this.root.getAttribute('data-mode')) { |
| 18266 |
case 'link': |
| 18267 |
{ |
| 18268 |
var scrollTop = this.quill.root.scrollTop; |
| 18269 |
if (this.linkRange) { |
| 18270 |
this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER); |
| 18271 |
delete this.linkRange; |
| 18272 |
} else { |
| 18273 |
this.restoreFocus(); |
| 18274 |
this.quill.format('link', value, _emitter2.default.sources.USER); |
| 18275 |
} |
| 18276 |
this.quill.root.scrollTop = scrollTop; |
| 18277 |
break; |
| 18278 |
} |
| 18279 |
case 'video': |
| 18280 |
{ |
| 18281 |
value = extractVideoUrl(value); |
| 18282 |
} // eslint-disable-next-line no-fallthrough |
| 18283 |
case 'formula': |
| 18284 |
{ |
| 18285 |
if (!value) break; |
| 18286 |
var range = this.quill.getSelection(true); |
| 18287 |
if (range != null) { |
| 18288 |
var index = range.index + range.length; |
| 18289 |
this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER); |
| 18290 |
if (this.root.getAttribute('data-mode') === 'formula') { |
| 18291 |
this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER); |
| 18292 |
} |
| 18293 |
this.quill.setSelection(index + 2, _emitter2.default.sources.USER); |
| 18294 |
} |
| 18295 |
break; |
| 18296 |
} |
| 18297 |
default: |
| 18298 |
} |
| 18299 |
this.textbox.value = ''; |
| 18300 |
this.hide(); |
| 18301 |
} |
| 18302 |
}]); |
| 18303 |
|
| 18304 |
return BaseTooltip; |
| 18305 |
}(_tooltip2.default); |
| 18306 |
|
| 18307 |
function extractVideoUrl(url) { |
| 18308 |
var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); |
| 18309 |
if (match) { |
| 18310 |
return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0'; |
| 18311 |
} |
| 18312 |
if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) { |
| 18313 |
// eslint-disable-line no-cond-assign |
| 18314 |
return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/'; |
| 18315 |
} |
| 18316 |
return url; |
| 18317 |
} |
| 18318 |
|
| 18319 |
function fillSelect(select, values) { |
| 18320 |
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; |
| 18321 |
|
| 18322 |
values.forEach(function (value) { |
| 18323 |
var option = document.createElement('option'); |
| 18324 |
if (value === defaultValue) { |
| 18325 |
option.setAttribute('selected', 'selected'); |
| 18326 |
} else { |
| 18327 |
option.setAttribute('value', value); |
| 18328 |
} |
| 18329 |
select.appendChild(option); |
| 18330 |
}); |
| 18331 |
} |
| 18332 |
|
| 18333 |
exports.BaseTooltip = BaseTooltip; |
| 18334 |
exports.default = BaseTheme; |
| 18335 |
|
| 18336 |
/***/ }), |
| 18337 |
/* 44 */ |
| 18338 |
/***/ (function(module, exports, __webpack_require__) { |
| 18339 |
|
| 18340 |
"use strict"; |
| 18341 |
|
| 18342 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 18343 |
var LinkedList = /** @class */ (function () { |
| 18344 |
function LinkedList() { |
| 18345 |
this.head = this.tail = null; |
| 18346 |
this.length = 0; |
| 18347 |
} |
| 18348 |
LinkedList.prototype.append = function () { |
| 18349 |
var nodes = []; |
| 18350 |
for (var _i = 0; _i < arguments.length; _i++) { |
| 18351 |
nodes[_i] = arguments[_i]; |
| 18352 |
} |
| 18353 |
this.insertBefore(nodes[0], null); |
| 18354 |
if (nodes.length > 1) { |
| 18355 |
this.append.apply(this, nodes.slice(1)); |
| 18356 |
} |
| 18357 |
}; |
| 18358 |
LinkedList.prototype.contains = function (node) { |
| 18359 |
var cur, next = this.iterator(); |
| 18360 |
while ((cur = next())) { |
| 18361 |
if (cur === node) |
| 18362 |
return true; |
| 18363 |
} |
| 18364 |
return false; |
| 18365 |
}; |
| 18366 |
LinkedList.prototype.insertBefore = function (node, refNode) { |
| 18367 |
if (!node) |
| 18368 |
return; |
| 18369 |
node.next = refNode; |
| 18370 |
if (refNode != null) { |
| 18371 |
node.prev = refNode.prev; |
| 18372 |
if (refNode.prev != null) { |
| 18373 |
refNode.prev.next = node; |
| 18374 |
} |
| 18375 |
refNode.prev = node; |
| 18376 |
if (refNode === this.head) { |
| 18377 |
this.head = node; |
| 18378 |
} |
| 18379 |
} |
| 18380 |
else if (this.tail != null) { |
| 18381 |
this.tail.next = node; |
| 18382 |
node.prev = this.tail; |
| 18383 |
this.tail = node; |
| 18384 |
} |
| 18385 |
else { |
| 18386 |
node.prev = null; |
| 18387 |
this.head = this.tail = node; |
| 18388 |
} |
| 18389 |
this.length += 1; |
| 18390 |
}; |
| 18391 |
LinkedList.prototype.offset = function (target) { |
| 18392 |
var index = 0, cur = this.head; |
| 18393 |
while (cur != null) { |
| 18394 |
if (cur === target) |
| 18395 |
return index; |
| 18396 |
index += cur.length(); |
| 18397 |
cur = cur.next; |
| 18398 |
} |
| 18399 |
return -1; |
| 18400 |
}; |
| 18401 |
LinkedList.prototype.remove = function (node) { |
| 18402 |
if (!this.contains(node)) |
| 18403 |
return; |
| 18404 |
if (node.prev != null) |
| 18405 |
node.prev.next = node.next; |
| 18406 |
if (node.next != null) |
| 18407 |
node.next.prev = node.prev; |
| 18408 |
if (node === this.head) |
| 18409 |
this.head = node.next; |
| 18410 |
if (node === this.tail) |
| 18411 |
this.tail = node.prev; |
| 18412 |
this.length -= 1; |
| 18413 |
}; |
| 18414 |
LinkedList.prototype.iterator = function (curNode) { |
| 18415 |
if (curNode === void 0) { curNode = this.head; } |
| 18416 |
// TODO use yield when we can |
| 18417 |
return function () { |
| 18418 |
var ret = curNode; |
| 18419 |
if (curNode != null) |
| 18420 |
curNode = curNode.next; |
| 18421 |
return ret; |
| 18422 |
}; |
| 18423 |
}; |
| 18424 |
LinkedList.prototype.find = function (index, inclusive) { |
| 18425 |
if (inclusive === void 0) { inclusive = false; } |
| 18426 |
var cur, next = this.iterator(); |
| 18427 |
while ((cur = next())) { |
| 18428 |
var length = cur.length(); |
| 18429 |
if (index < length || |
| 18430 |
(inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) { |
| 18431 |
return [cur, index]; |
| 18432 |
} |
| 18433 |
index -= length; |
| 18434 |
} |
| 18435 |
return [null, 0]; |
| 18436 |
}; |
| 18437 |
LinkedList.prototype.forEach = function (callback) { |
| 18438 |
var cur, next = this.iterator(); |
| 18439 |
while ((cur = next())) { |
| 18440 |
callback(cur); |
| 18441 |
} |
| 18442 |
}; |
| 18443 |
LinkedList.prototype.forEachAt = function (index, length, callback) { |
| 18444 |
if (length <= 0) |
| 18445 |
return; |
| 18446 |
var _a = this.find(index), startNode = _a[0], offset = _a[1]; |
| 18447 |
var cur, curIndex = index - offset, next = this.iterator(startNode); |
| 18448 |
while ((cur = next()) && curIndex < index + length) { |
| 18449 |
var curLength = cur.length(); |
| 18450 |
if (index > curIndex) { |
| 18451 |
callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); |
| 18452 |
} |
| 18453 |
else { |
| 18454 |
callback(cur, 0, Math.min(curLength, index + length - curIndex)); |
| 18455 |
} |
| 18456 |
curIndex += curLength; |
| 18457 |
} |
| 18458 |
}; |
| 18459 |
LinkedList.prototype.map = function (callback) { |
| 18460 |
return this.reduce(function (memo, cur) { |
| 18461 |
memo.push(callback(cur)); |
| 18462 |
return memo; |
| 18463 |
}, []); |
| 18464 |
}; |
| 18465 |
LinkedList.prototype.reduce = function (callback, memo) { |
| 18466 |
var cur, next = this.iterator(); |
| 18467 |
while ((cur = next())) { |
| 18468 |
memo = callback(memo, cur); |
| 18469 |
} |
| 18470 |
return memo; |
| 18471 |
}; |
| 18472 |
return LinkedList; |
| 18473 |
}()); |
| 18474 |
exports.default = LinkedList; |
| 18475 |
|
| 18476 |
|
| 18477 |
/***/ }), |
| 18478 |
/* 45 */ |
| 18479 |
/***/ (function(module, exports, __nested_webpack_require_260796__) { |
| 18480 |
|
| 18481 |
"use strict"; |
| 18482 |
|
| 18483 |
var __extends = (this && this.__extends) || (function () { |
| 18484 |
var extendStatics = Object.setPrototypeOf || |
| 18485 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 18486 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 18487 |
return function (d, b) { |
| 18488 |
extendStatics(d, b); |
| 18489 |
function __() { this.constructor = d; } |
| 18490 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 18491 |
}; |
| 18492 |
})(); |
| 18493 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 18494 |
var container_1 = __nested_webpack_require_260796__(17); |
| 18495 |
var Registry = __nested_webpack_require_260796__(1); |
| 18496 |
var OBSERVER_CONFIG = { |
| 18497 |
attributes: true, |
| 18498 |
characterData: true, |
| 18499 |
characterDataOldValue: true, |
| 18500 |
childList: true, |
| 18501 |
subtree: true, |
| 18502 |
}; |
| 18503 |
var MAX_OPTIMIZE_ITERATIONS = 100; |
| 18504 |
var ScrollBlot = /** @class */ (function (_super) { |
| 18505 |
__extends(ScrollBlot, _super); |
| 18506 |
function ScrollBlot(node) { |
| 18507 |
var _this = _super.call(this, node) || this; |
| 18508 |
_this.scroll = _this; |
| 18509 |
_this.observer = new MutationObserver(function (mutations) { |
| 18510 |
_this.update(mutations); |
| 18511 |
}); |
| 18512 |
_this.observer.observe(_this.domNode, OBSERVER_CONFIG); |
| 18513 |
_this.attach(); |
| 18514 |
return _this; |
| 18515 |
} |
| 18516 |
ScrollBlot.prototype.detach = function () { |
| 18517 |
_super.prototype.detach.call(this); |
| 18518 |
this.observer.disconnect(); |
| 18519 |
}; |
| 18520 |
ScrollBlot.prototype.deleteAt = function (index, length) { |
| 18521 |
this.update(); |
| 18522 |
if (index === 0 && length === this.length()) { |
| 18523 |
this.children.forEach(function (child) { |
| 18524 |
child.remove(); |
| 18525 |
}); |
| 18526 |
} |
| 18527 |
else { |
| 18528 |
_super.prototype.deleteAt.call(this, index, length); |
| 18529 |
} |
| 18530 |
}; |
| 18531 |
ScrollBlot.prototype.formatAt = function (index, length, name, value) { |
| 18532 |
this.update(); |
| 18533 |
_super.prototype.formatAt.call(this, index, length, name, value); |
| 18534 |
}; |
| 18535 |
ScrollBlot.prototype.insertAt = function (index, value, def) { |
| 18536 |
this.update(); |
| 18537 |
_super.prototype.insertAt.call(this, index, value, def); |
| 18538 |
}; |
| 18539 |
ScrollBlot.prototype.optimize = function (mutations, context) { |
| 18540 |
var _this = this; |
| 18541 |
if (mutations === void 0) { mutations = []; } |
| 18542 |
if (context === void 0) { context = {}; } |
| 18543 |
_super.prototype.optimize.call(this, context); |
| 18544 |
// We must modify mutations directly, cannot make copy and then modify |
| 18545 |
var records = [].slice.call(this.observer.takeRecords()); |
| 18546 |
// Array.push currently seems to be implemented by a non-tail recursive function |
| 18547 |
// so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); |
| 18548 |
while (records.length > 0) |
| 18549 |
mutations.push(records.pop()); |
| 18550 |
// TODO use WeakMap |
| 18551 |
var mark = function (blot, markParent) { |
| 18552 |
if (markParent === void 0) { markParent = true; } |
| 18553 |
if (blot == null || blot === _this) |
| 18554 |
return; |
| 18555 |
if (blot.domNode.parentNode == null) |
| 18556 |
return; |
| 18557 |
// @ts-ignore |
| 18558 |
if (blot.domNode[Registry.DATA_KEY].mutations == null) { |
| 18559 |
// @ts-ignore |
| 18560 |
blot.domNode[Registry.DATA_KEY].mutations = []; |
| 18561 |
} |
| 18562 |
if (markParent) |
| 18563 |
mark(blot.parent); |
| 18564 |
}; |
| 18565 |
var optimize = function (blot) { |
| 18566 |
// Post-order traversal |
| 18567 |
if ( |
| 18568 |
// @ts-ignore |
| 18569 |
blot.domNode[Registry.DATA_KEY] == null || |
| 18570 |
// @ts-ignore |
| 18571 |
blot.domNode[Registry.DATA_KEY].mutations == null) { |
| 18572 |
return; |
| 18573 |
} |
| 18574 |
if (blot instanceof container_1.default) { |
| 18575 |
blot.children.forEach(optimize); |
| 18576 |
} |
| 18577 |
blot.optimize(context); |
| 18578 |
}; |
| 18579 |
var remaining = mutations; |
| 18580 |
for (var i = 0; remaining.length > 0; i += 1) { |
| 18581 |
if (i >= MAX_OPTIMIZE_ITERATIONS) { |
| 18582 |
throw new Error('[Parchment] Maximum optimize iterations reached'); |
| 18583 |
} |
| 18584 |
remaining.forEach(function (mutation) { |
| 18585 |
var blot = Registry.find(mutation.target, true); |
| 18586 |
if (blot == null) |
| 18587 |
return; |
| 18588 |
if (blot.domNode === mutation.target) { |
| 18589 |
if (mutation.type === 'childList') { |
| 18590 |
mark(Registry.find(mutation.previousSibling, false)); |
| 18591 |
[].forEach.call(mutation.addedNodes, function (node) { |
| 18592 |
var child = Registry.find(node, false); |
| 18593 |
mark(child, false); |
| 18594 |
if (child instanceof container_1.default) { |
| 18595 |
child.children.forEach(function (grandChild) { |
| 18596 |
mark(grandChild, false); |
| 18597 |
}); |
| 18598 |
} |
| 18599 |
}); |
| 18600 |
} |
| 18601 |
else if (mutation.type === 'attributes') { |
| 18602 |
mark(blot.prev); |
| 18603 |
} |
| 18604 |
} |
| 18605 |
mark(blot); |
| 18606 |
}); |
| 18607 |
this.children.forEach(optimize); |
| 18608 |
remaining = [].slice.call(this.observer.takeRecords()); |
| 18609 |
records = remaining.slice(); |
| 18610 |
while (records.length > 0) |
| 18611 |
mutations.push(records.pop()); |
| 18612 |
} |
| 18613 |
}; |
| 18614 |
ScrollBlot.prototype.update = function (mutations, context) { |
| 18615 |
var _this = this; |
| 18616 |
if (context === void 0) { context = {}; } |
| 18617 |
mutations = mutations || this.observer.takeRecords(); |
| 18618 |
// TODO use WeakMap |
| 18619 |
mutations |
| 18620 |
.map(function (mutation) { |
| 18621 |
var blot = Registry.find(mutation.target, true); |
| 18622 |
if (blot == null) |
| 18623 |
return null; |
| 18624 |
// @ts-ignore |
| 18625 |
if (blot.domNode[Registry.DATA_KEY].mutations == null) { |
| 18626 |
// @ts-ignore |
| 18627 |
blot.domNode[Registry.DATA_KEY].mutations = [mutation]; |
| 18628 |
return blot; |
| 18629 |
} |
| 18630 |
else { |
| 18631 |
// @ts-ignore |
| 18632 |
blot.domNode[Registry.DATA_KEY].mutations.push(mutation); |
| 18633 |
return null; |
| 18634 |
} |
| 18635 |
}) |
| 18636 |
.forEach(function (blot) { |
| 18637 |
if (blot == null || |
| 18638 |
blot === _this || |
| 18639 |
//@ts-ignore |
| 18640 |
blot.domNode[Registry.DATA_KEY] == null) |
| 18641 |
return; |
| 18642 |
// @ts-ignore |
| 18643 |
blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); |
| 18644 |
}); |
| 18645 |
// @ts-ignore |
| 18646 |
if (this.domNode[Registry.DATA_KEY].mutations != null) { |
| 18647 |
// @ts-ignore |
| 18648 |
_super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); |
| 18649 |
} |
| 18650 |
this.optimize(mutations, context); |
| 18651 |
}; |
| 18652 |
ScrollBlot.blotName = 'scroll'; |
| 18653 |
ScrollBlot.defaultChild = 'block'; |
| 18654 |
ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; |
| 18655 |
ScrollBlot.tagName = 'DIV'; |
| 18656 |
return ScrollBlot; |
| 18657 |
}(container_1.default)); |
| 18658 |
exports.default = ScrollBlot; |
| 18659 |
|
| 18660 |
|
| 18661 |
/***/ }), |
| 18662 |
/* 46 */ |
| 18663 |
/***/ (function(module, exports, __nested_webpack_require_267910__) { |
| 18664 |
|
| 18665 |
"use strict"; |
| 18666 |
|
| 18667 |
var __extends = (this && this.__extends) || (function () { |
| 18668 |
var extendStatics = Object.setPrototypeOf || |
| 18669 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 18670 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 18671 |
return function (d, b) { |
| 18672 |
extendStatics(d, b); |
| 18673 |
function __() { this.constructor = d; } |
| 18674 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 18675 |
}; |
| 18676 |
})(); |
| 18677 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 18678 |
var format_1 = __nested_webpack_require_267910__(18); |
| 18679 |
var Registry = __nested_webpack_require_267910__(1); |
| 18680 |
// Shallow object comparison |
| 18681 |
function isEqual(obj1, obj2) { |
| 18682 |
if (Object.keys(obj1).length !== Object.keys(obj2).length) |
| 18683 |
return false; |
| 18684 |
// @ts-ignore |
| 18685 |
for (var prop in obj1) { |
| 18686 |
// @ts-ignore |
| 18687 |
if (obj1[prop] !== obj2[prop]) |
| 18688 |
return false; |
| 18689 |
} |
| 18690 |
return true; |
| 18691 |
} |
| 18692 |
var InlineBlot = /** @class */ (function (_super) { |
| 18693 |
__extends(InlineBlot, _super); |
| 18694 |
function InlineBlot() { |
| 18695 |
return _super !== null && _super.apply(this, arguments) || this; |
| 18696 |
} |
| 18697 |
InlineBlot.formats = function (domNode) { |
| 18698 |
if (domNode.tagName === InlineBlot.tagName) |
| 18699 |
return undefined; |
| 18700 |
return _super.formats.call(this, domNode); |
| 18701 |
}; |
| 18702 |
InlineBlot.prototype.format = function (name, value) { |
| 18703 |
var _this = this; |
| 18704 |
if (name === this.statics.blotName && !value) { |
| 18705 |
this.children.forEach(function (child) { |
| 18706 |
if (!(child instanceof format_1.default)) { |
| 18707 |
child = child.wrap(InlineBlot.blotName, true); |
| 18708 |
} |
| 18709 |
_this.attributes.copy(child); |
| 18710 |
}); |
| 18711 |
this.unwrap(); |
| 18712 |
} |
| 18713 |
else { |
| 18714 |
_super.prototype.format.call(this, name, value); |
| 18715 |
} |
| 18716 |
}; |
| 18717 |
InlineBlot.prototype.formatAt = function (index, length, name, value) { |
| 18718 |
if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { |
| 18719 |
var blot = this.isolate(index, length); |
| 18720 |
blot.format(name, value); |
| 18721 |
} |
| 18722 |
else { |
| 18723 |
_super.prototype.formatAt.call(this, index, length, name, value); |
| 18724 |
} |
| 18725 |
}; |
| 18726 |
InlineBlot.prototype.optimize = function (context) { |
| 18727 |
_super.prototype.optimize.call(this, context); |
| 18728 |
var formats = this.formats(); |
| 18729 |
if (Object.keys(formats).length === 0) { |
| 18730 |
return this.unwrap(); // unformatted span |
| 18731 |
} |
| 18732 |
var next = this.next; |
| 18733 |
if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { |
| 18734 |
next.moveChildren(this); |
| 18735 |
next.remove(); |
| 18736 |
} |
| 18737 |
}; |
| 18738 |
InlineBlot.blotName = 'inline'; |
| 18739 |
InlineBlot.scope = Registry.Scope.INLINE_BLOT; |
| 18740 |
InlineBlot.tagName = 'SPAN'; |
| 18741 |
return InlineBlot; |
| 18742 |
}(format_1.default)); |
| 18743 |
exports.default = InlineBlot; |
| 18744 |
|
| 18745 |
|
| 18746 |
/***/ }), |
| 18747 |
/* 47 */ |
| 18748 |
/***/ (function(module, exports, __nested_webpack_require_270902__) { |
| 18749 |
|
| 18750 |
"use strict"; |
| 18751 |
|
| 18752 |
var __extends = (this && this.__extends) || (function () { |
| 18753 |
var extendStatics = Object.setPrototypeOf || |
| 18754 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 18755 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 18756 |
return function (d, b) { |
| 18757 |
extendStatics(d, b); |
| 18758 |
function __() { this.constructor = d; } |
| 18759 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 18760 |
}; |
| 18761 |
})(); |
| 18762 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 18763 |
var format_1 = __nested_webpack_require_270902__(18); |
| 18764 |
var Registry = __nested_webpack_require_270902__(1); |
| 18765 |
var BlockBlot = /** @class */ (function (_super) { |
| 18766 |
__extends(BlockBlot, _super); |
| 18767 |
function BlockBlot() { |
| 18768 |
return _super !== null && _super.apply(this, arguments) || this; |
| 18769 |
} |
| 18770 |
BlockBlot.formats = function (domNode) { |
| 18771 |
var tagName = Registry.query(BlockBlot.blotName).tagName; |
| 18772 |
if (domNode.tagName === tagName) |
| 18773 |
return undefined; |
| 18774 |
return _super.formats.call(this, domNode); |
| 18775 |
}; |
| 18776 |
BlockBlot.prototype.format = function (name, value) { |
| 18777 |
if (Registry.query(name, Registry.Scope.BLOCK) == null) { |
| 18778 |
return; |
| 18779 |
} |
| 18780 |
else if (name === this.statics.blotName && !value) { |
| 18781 |
this.replaceWith(BlockBlot.blotName); |
| 18782 |
} |
| 18783 |
else { |
| 18784 |
_super.prototype.format.call(this, name, value); |
| 18785 |
} |
| 18786 |
}; |
| 18787 |
BlockBlot.prototype.formatAt = function (index, length, name, value) { |
| 18788 |
if (Registry.query(name, Registry.Scope.BLOCK) != null) { |
| 18789 |
this.format(name, value); |
| 18790 |
} |
| 18791 |
else { |
| 18792 |
_super.prototype.formatAt.call(this, index, length, name, value); |
| 18793 |
} |
| 18794 |
}; |
| 18795 |
BlockBlot.prototype.insertAt = function (index, value, def) { |
| 18796 |
if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { |
| 18797 |
// Insert text or inline |
| 18798 |
_super.prototype.insertAt.call(this, index, value, def); |
| 18799 |
} |
| 18800 |
else { |
| 18801 |
var after = this.split(index); |
| 18802 |
var blot = Registry.create(value, def); |
| 18803 |
after.parent.insertBefore(blot, after); |
| 18804 |
} |
| 18805 |
}; |
| 18806 |
BlockBlot.prototype.update = function (mutations, context) { |
| 18807 |
if (navigator.userAgent.match(/Trident/)) { |
| 18808 |
this.build(); |
| 18809 |
} |
| 18810 |
else { |
| 18811 |
_super.prototype.update.call(this, mutations, context); |
| 18812 |
} |
| 18813 |
}; |
| 18814 |
BlockBlot.blotName = 'block'; |
| 18815 |
BlockBlot.scope = Registry.Scope.BLOCK_BLOT; |
| 18816 |
BlockBlot.tagName = 'P'; |
| 18817 |
return BlockBlot; |
| 18818 |
}(format_1.default)); |
| 18819 |
exports.default = BlockBlot; |
| 18820 |
|
| 18821 |
|
| 18822 |
/***/ }), |
| 18823 |
/* 48 */ |
| 18824 |
/***/ (function(module, exports, __nested_webpack_require_273610__) { |
| 18825 |
|
| 18826 |
"use strict"; |
| 18827 |
|
| 18828 |
var __extends = (this && this.__extends) || (function () { |
| 18829 |
var extendStatics = Object.setPrototypeOf || |
| 18830 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 18831 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 18832 |
return function (d, b) { |
| 18833 |
extendStatics(d, b); |
| 18834 |
function __() { this.constructor = d; } |
| 18835 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 18836 |
}; |
| 18837 |
})(); |
| 18838 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 18839 |
var leaf_1 = __nested_webpack_require_273610__(19); |
| 18840 |
var EmbedBlot = /** @class */ (function (_super) { |
| 18841 |
__extends(EmbedBlot, _super); |
| 18842 |
function EmbedBlot() { |
| 18843 |
return _super !== null && _super.apply(this, arguments) || this; |
| 18844 |
} |
| 18845 |
EmbedBlot.formats = function (domNode) { |
| 18846 |
return undefined; |
| 18847 |
}; |
| 18848 |
EmbedBlot.prototype.format = function (name, value) { |
| 18849 |
// super.formatAt wraps, which is what we want in general, |
| 18850 |
// but this allows subclasses to overwrite for formats |
| 18851 |
// that just apply to particular embeds |
| 18852 |
_super.prototype.formatAt.call(this, 0, this.length(), name, value); |
| 18853 |
}; |
| 18854 |
EmbedBlot.prototype.formatAt = function (index, length, name, value) { |
| 18855 |
if (index === 0 && length === this.length()) { |
| 18856 |
this.format(name, value); |
| 18857 |
} |
| 18858 |
else { |
| 18859 |
_super.prototype.formatAt.call(this, index, length, name, value); |
| 18860 |
} |
| 18861 |
}; |
| 18862 |
EmbedBlot.prototype.formats = function () { |
| 18863 |
return this.statics.formats(this.domNode); |
| 18864 |
}; |
| 18865 |
return EmbedBlot; |
| 18866 |
}(leaf_1.default)); |
| 18867 |
exports.default = EmbedBlot; |
| 18868 |
|
| 18869 |
|
| 18870 |
/***/ }), |
| 18871 |
/* 49 */ |
| 18872 |
/***/ (function(module, exports, __nested_webpack_require_275351__) { |
| 18873 |
|
| 18874 |
"use strict"; |
| 18875 |
|
| 18876 |
var __extends = (this && this.__extends) || (function () { |
| 18877 |
var extendStatics = Object.setPrototypeOf || |
| 18878 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 18879 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 18880 |
return function (d, b) { |
| 18881 |
extendStatics(d, b); |
| 18882 |
function __() { this.constructor = d; } |
| 18883 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 18884 |
}; |
| 18885 |
})(); |
| 18886 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 18887 |
var leaf_1 = __nested_webpack_require_275351__(19); |
| 18888 |
var Registry = __nested_webpack_require_275351__(1); |
| 18889 |
var TextBlot = /** @class */ (function (_super) { |
| 18890 |
__extends(TextBlot, _super); |
| 18891 |
function TextBlot(node) { |
| 18892 |
var _this = _super.call(this, node) || this; |
| 18893 |
_this.text = _this.statics.value(_this.domNode); |
| 18894 |
return _this; |
| 18895 |
} |
| 18896 |
TextBlot.create = function (value) { |
| 18897 |
return document.createTextNode(value); |
| 18898 |
}; |
| 18899 |
TextBlot.value = function (domNode) { |
| 18900 |
var text = domNode.data; |
| 18901 |
// @ts-ignore |
| 18902 |
if (text['normalize']) |
| 18903 |
text = text['normalize'](); |
| 18904 |
return text; |
| 18905 |
}; |
| 18906 |
TextBlot.prototype.deleteAt = function (index, length) { |
| 18907 |
this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); |
| 18908 |
}; |
| 18909 |
TextBlot.prototype.index = function (node, offset) { |
| 18910 |
if (this.domNode === node) { |
| 18911 |
return offset; |
| 18912 |
} |
| 18913 |
return -1; |
| 18914 |
}; |
| 18915 |
TextBlot.prototype.insertAt = function (index, value, def) { |
| 18916 |
if (def == null) { |
| 18917 |
this.text = this.text.slice(0, index) + value + this.text.slice(index); |
| 18918 |
this.domNode.data = this.text; |
| 18919 |
} |
| 18920 |
else { |
| 18921 |
_super.prototype.insertAt.call(this, index, value, def); |
| 18922 |
} |
| 18923 |
}; |
| 18924 |
TextBlot.prototype.length = function () { |
| 18925 |
return this.text.length; |
| 18926 |
}; |
| 18927 |
TextBlot.prototype.optimize = function (context) { |
| 18928 |
_super.prototype.optimize.call(this, context); |
| 18929 |
this.text = this.statics.value(this.domNode); |
| 18930 |
if (this.text.length === 0) { |
| 18931 |
this.remove(); |
| 18932 |
} |
| 18933 |
else if (this.next instanceof TextBlot && this.next.prev === this) { |
| 18934 |
this.insertAt(this.length(), this.next.value()); |
| 18935 |
this.next.remove(); |
| 18936 |
} |
| 18937 |
}; |
| 18938 |
TextBlot.prototype.position = function (index, inclusive) { |
| 18939 |
if (inclusive === void 0) { inclusive = false; } |
| 18940 |
return [this.domNode, index]; |
| 18941 |
}; |
| 18942 |
TextBlot.prototype.split = function (index, force) { |
| 18943 |
if (force === void 0) { force = false; } |
| 18944 |
if (!force) { |
| 18945 |
if (index === 0) |
| 18946 |
return this; |
| 18947 |
if (index === this.length()) |
| 18948 |
return this.next; |
| 18949 |
} |
| 18950 |
var after = Registry.create(this.domNode.splitText(index)); |
| 18951 |
this.parent.insertBefore(after, this.next); |
| 18952 |
this.text = this.statics.value(this.domNode); |
| 18953 |
return after; |
| 18954 |
}; |
| 18955 |
TextBlot.prototype.update = function (mutations, context) { |
| 18956 |
var _this = this; |
| 18957 |
if (mutations.some(function (mutation) { |
| 18958 |
return mutation.type === 'characterData' && mutation.target === _this.domNode; |
| 18959 |
})) { |
| 18960 |
this.text = this.statics.value(this.domNode); |
| 18961 |
} |
| 18962 |
}; |
| 18963 |
TextBlot.prototype.value = function () { |
| 18964 |
return this.text; |
| 18965 |
}; |
| 18966 |
TextBlot.blotName = 'text'; |
| 18967 |
TextBlot.scope = Registry.Scope.INLINE_BLOT; |
| 18968 |
return TextBlot; |
| 18969 |
}(leaf_1.default)); |
| 18970 |
exports.default = TextBlot; |
| 18971 |
|
| 18972 |
|
| 18973 |
/***/ }), |
| 18974 |
/* 50 */ |
| 18975 |
/***/ (function(module, exports, __webpack_require__) { |
| 18976 |
|
| 18977 |
"use strict"; |
| 18978 |
|
| 18979 |
|
| 18980 |
var elem = document.createElement('div'); |
| 18981 |
elem.classList.toggle('test-class', false); |
| 18982 |
if (elem.classList.contains('test-class')) { |
| 18983 |
var _toggle = DOMTokenList.prototype.toggle; |
| 18984 |
DOMTokenList.prototype.toggle = function (token, force) { |
| 18985 |
if (arguments.length > 1 && !this.contains(token) === !force) { |
| 18986 |
return force; |
| 18987 |
} else { |
| 18988 |
return _toggle.call(this, token); |
| 18989 |
} |
| 18990 |
}; |
| 18991 |
} |
| 18992 |
|
| 18993 |
if (!String.prototype.startsWith) { |
| 18994 |
String.prototype.startsWith = function (searchString, position) { |
| 18995 |
position = position || 0; |
| 18996 |
return this.substr(position, searchString.length) === searchString; |
| 18997 |
}; |
| 18998 |
} |
| 18999 |
|
| 19000 |
if (!String.prototype.endsWith) { |
| 19001 |
String.prototype.endsWith = function (searchString, position) { |
| 19002 |
var subjectString = this.toString(); |
| 19003 |
if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { |
| 19004 |
position = subjectString.length; |
| 19005 |
} |
| 19006 |
position -= searchString.length; |
| 19007 |
var lastIndex = subjectString.indexOf(searchString, position); |
| 19008 |
return lastIndex !== -1 && lastIndex === position; |
| 19009 |
}; |
| 19010 |
} |
| 19011 |
|
| 19012 |
if (!Array.prototype.find) { |
| 19013 |
Object.defineProperty(Array.prototype, "find", { |
| 19014 |
value: function value(predicate) { |
| 19015 |
if (this === null) { |
| 19016 |
throw new TypeError('Array.prototype.find called on null or undefined'); |
| 19017 |
} |
| 19018 |
if (typeof predicate !== 'function') { |
| 19019 |
throw new TypeError('predicate must be a function'); |
| 19020 |
} |
| 19021 |
var list = Object(this); |
| 19022 |
var length = list.length >>> 0; |
| 19023 |
var thisArg = arguments[1]; |
| 19024 |
var value; |
| 19025 |
|
| 19026 |
for (var i = 0; i < length; i++) { |
| 19027 |
value = list[i]; |
| 19028 |
if (predicate.call(thisArg, value, i, list)) { |
| 19029 |
return value; |
| 19030 |
} |
| 19031 |
} |
| 19032 |
return undefined; |
| 19033 |
} |
| 19034 |
}); |
| 19035 |
} |
| 19036 |
|
| 19037 |
document.addEventListener("DOMContentLoaded", function () { |
| 19038 |
// Disable resizing in Firefox |
| 19039 |
document.execCommand("enableObjectResizing", false, false); |
| 19040 |
// Disable automatic linkifying in IE11 |
| 19041 |
document.execCommand("autoUrlDetect", false, false); |
| 19042 |
}); |
| 19043 |
|
| 19044 |
/***/ }), |
| 19045 |
/* 51 */ |
| 19046 |
/***/ (function(module, exports) { |
| 19047 |
|
| 19048 |
/** |
| 19049 |
* This library modifies the diff-patch-match library by Neil Fraser |
| 19050 |
* by removing the patch and match functionality and certain advanced |
| 19051 |
* options in the diff function. The original license is as follows: |
| 19052 |
* |
| 19053 |
* === |
| 19054 |
* |
| 19055 |
* Diff Match and Patch |
| 19056 |
* |
| 19057 |
* Copyright 2006 Google Inc. |
| 19058 |
* http://code.google.com/p/google-diff-match-patch/ |
| 19059 |
* |
| 19060 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 19061 |
* you may not use this file except in compliance with the License. |
| 19062 |
* You may obtain a copy of the License at |
| 19063 |
* |
| 19064 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 19065 |
* |
| 19066 |
* Unless required by applicable law or agreed to in writing, software |
| 19067 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 19068 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19069 |
* See the License for the specific language governing permissions and |
| 19070 |
* limitations under the License. |
| 19071 |
*/ |
| 19072 |
|
| 19073 |
|
| 19074 |
/** |
| 19075 |
* The data structure representing a diff is an array of tuples: |
| 19076 |
* [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] |
| 19077 |
* which means: delete 'Hello', add 'Goodbye' and keep ' world.' |
| 19078 |
*/ |
| 19079 |
var DIFF_DELETE = -1; |
| 19080 |
var DIFF_INSERT = 1; |
| 19081 |
var DIFF_EQUAL = 0; |
| 19082 |
|
| 19083 |
|
| 19084 |
/** |
| 19085 |
* Find the differences between two texts. Simplifies the problem by stripping |
| 19086 |
* any common prefix or suffix off the texts before diffing. |
| 19087 |
* @param {string} text1 Old string to be diffed. |
| 19088 |
* @param {string} text2 New string to be diffed. |
| 19089 |
* @param {Int} cursor_pos Expected edit position in text1 (optional) |
| 19090 |
* @return {Array} Array of diff tuples. |
| 19091 |
*/ |
| 19092 |
function diff_main(text1, text2, cursor_pos) { |
| 19093 |
// Check for equality (speedup). |
| 19094 |
if (text1 == text2) { |
| 19095 |
if (text1) { |
| 19096 |
return [[DIFF_EQUAL, text1]]; |
| 19097 |
} |
| 19098 |
return []; |
| 19099 |
} |
| 19100 |
|
| 19101 |
// Check cursor_pos within bounds |
| 19102 |
if (cursor_pos < 0 || text1.length < cursor_pos) { |
| 19103 |
cursor_pos = null; |
| 19104 |
} |
| 19105 |
|
| 19106 |
// Trim off common prefix (speedup). |
| 19107 |
var commonlength = diff_commonPrefix(text1, text2); |
| 19108 |
var commonprefix = text1.substring(0, commonlength); |
| 19109 |
text1 = text1.substring(commonlength); |
| 19110 |
text2 = text2.substring(commonlength); |
| 19111 |
|
| 19112 |
// Trim off common suffix (speedup). |
| 19113 |
commonlength = diff_commonSuffix(text1, text2); |
| 19114 |
var commonsuffix = text1.substring(text1.length - commonlength); |
| 19115 |
text1 = text1.substring(0, text1.length - commonlength); |
| 19116 |
text2 = text2.substring(0, text2.length - commonlength); |
| 19117 |
|
| 19118 |
// Compute the diff on the middle block. |
| 19119 |
var diffs = diff_compute_(text1, text2); |
| 19120 |
|
| 19121 |
// Restore the prefix and suffix. |
| 19122 |
if (commonprefix) { |
| 19123 |
diffs.unshift([DIFF_EQUAL, commonprefix]); |
| 19124 |
} |
| 19125 |
if (commonsuffix) { |
| 19126 |
diffs.push([DIFF_EQUAL, commonsuffix]); |
| 19127 |
} |
| 19128 |
diff_cleanupMerge(diffs); |
| 19129 |
if (cursor_pos != null) { |
| 19130 |
diffs = fix_cursor(diffs, cursor_pos); |
| 19131 |
} |
| 19132 |
diffs = fix_emoji(diffs); |
| 19133 |
return diffs; |
| 19134 |
}; |
| 19135 |
|
| 19136 |
|
| 19137 |
/** |
| 19138 |
* Find the differences between two texts. Assumes that the texts do not |
| 19139 |
* have any common prefix or suffix. |
| 19140 |
* @param {string} text1 Old string to be diffed. |
| 19141 |
* @param {string} text2 New string to be diffed. |
| 19142 |
* @return {Array} Array of diff tuples. |
| 19143 |
*/ |
| 19144 |
function diff_compute_(text1, text2) { |
| 19145 |
var diffs; |
| 19146 |
|
| 19147 |
if (!text1) { |
| 19148 |
// Just add some text (speedup). |
| 19149 |
return [[DIFF_INSERT, text2]]; |
| 19150 |
} |
| 19151 |
|
| 19152 |
if (!text2) { |
| 19153 |
// Just delete some text (speedup). |
| 19154 |
return [[DIFF_DELETE, text1]]; |
| 19155 |
} |
| 19156 |
|
| 19157 |
var longtext = text1.length > text2.length ? text1 : text2; |
| 19158 |
var shorttext = text1.length > text2.length ? text2 : text1; |
| 19159 |
var i = longtext.indexOf(shorttext); |
| 19160 |
if (i != -1) { |
| 19161 |
// Shorter text is inside the longer text (speedup). |
| 19162 |
diffs = [[DIFF_INSERT, longtext.substring(0, i)], |
| 19163 |
[DIFF_EQUAL, shorttext], |
| 19164 |
[DIFF_INSERT, longtext.substring(i + shorttext.length)]]; |
| 19165 |
// Swap insertions for deletions if diff is reversed. |
| 19166 |
if (text1.length > text2.length) { |
| 19167 |
diffs[0][0] = diffs[2][0] = DIFF_DELETE; |
| 19168 |
} |
| 19169 |
return diffs; |
| 19170 |
} |
| 19171 |
|
| 19172 |
if (shorttext.length == 1) { |
| 19173 |
// Single character string. |
| 19174 |
// After the previous speedup, the character can't be an equality. |
| 19175 |
return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; |
| 19176 |
} |
| 19177 |
|
| 19178 |
// Check to see if the problem can be split in two. |
| 19179 |
var hm = diff_halfMatch_(text1, text2); |
| 19180 |
if (hm) { |
| 19181 |
// A half-match was found, sort out the return data. |
| 19182 |
var text1_a = hm[0]; |
| 19183 |
var text1_b = hm[1]; |
| 19184 |
var text2_a = hm[2]; |
| 19185 |
var text2_b = hm[3]; |
| 19186 |
var mid_common = hm[4]; |
| 19187 |
// Send both pairs off for separate processing. |
| 19188 |
var diffs_a = diff_main(text1_a, text2_a); |
| 19189 |
var diffs_b = diff_main(text1_b, text2_b); |
| 19190 |
// Merge the results. |
| 19191 |
return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); |
| 19192 |
} |
| 19193 |
|
| 19194 |
return diff_bisect_(text1, text2); |
| 19195 |
}; |
| 19196 |
|
| 19197 |
|
| 19198 |
/** |
| 19199 |
* Find the 'middle snake' of a diff, split the problem in two |
| 19200 |
* and return the recursively constructed diff. |
| 19201 |
* See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. |
| 19202 |
* @param {string} text1 Old string to be diffed. |
| 19203 |
* @param {string} text2 New string to be diffed. |
| 19204 |
* @return {Array} Array of diff tuples. |
| 19205 |
* @private |
| 19206 |
*/ |
| 19207 |
function diff_bisect_(text1, text2) { |
| 19208 |
// Cache the text lengths to prevent multiple calls. |
| 19209 |
var text1_length = text1.length; |
| 19210 |
var text2_length = text2.length; |
| 19211 |
var max_d = Math.ceil((text1_length + text2_length) / 2); |
| 19212 |
var v_offset = max_d; |
| 19213 |
var v_length = 2 * max_d; |
| 19214 |
var v1 = new Array(v_length); |
| 19215 |
var v2 = new Array(v_length); |
| 19216 |
// Setting all elements to -1 is faster in Chrome & Firefox than mixing |
| 19217 |
// integers and undefined. |
| 19218 |
for (var x = 0; x < v_length; x++) { |
| 19219 |
v1[x] = -1; |
| 19220 |
v2[x] = -1; |
| 19221 |
} |
| 19222 |
v1[v_offset + 1] = 0; |
| 19223 |
v2[v_offset + 1] = 0; |
| 19224 |
var delta = text1_length - text2_length; |
| 19225 |
// If the total number of characters is odd, then the front path will collide |
| 19226 |
// with the reverse path. |
| 19227 |
var front = (delta % 2 != 0); |
| 19228 |
// Offsets for start and end of k loop. |
| 19229 |
// Prevents mapping of space beyond the grid. |
| 19230 |
var k1start = 0; |
| 19231 |
var k1end = 0; |
| 19232 |
var k2start = 0; |
| 19233 |
var k2end = 0; |
| 19234 |
for (var d = 0; d < max_d; d++) { |
| 19235 |
// Walk the front path one step. |
| 19236 |
for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { |
| 19237 |
var k1_offset = v_offset + k1; |
| 19238 |
var x1; |
| 19239 |
if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { |
| 19240 |
x1 = v1[k1_offset + 1]; |
| 19241 |
} else { |
| 19242 |
x1 = v1[k1_offset - 1] + 1; |
| 19243 |
} |
| 19244 |
var y1 = x1 - k1; |
| 19245 |
while (x1 < text1_length && y1 < text2_length && |
| 19246 |
text1.charAt(x1) == text2.charAt(y1)) { |
| 19247 |
x1++; |
| 19248 |
y1++; |
| 19249 |
} |
| 19250 |
v1[k1_offset] = x1; |
| 19251 |
if (x1 > text1_length) { |
| 19252 |
// Ran off the right of the graph. |
| 19253 |
k1end += 2; |
| 19254 |
} else if (y1 > text2_length) { |
| 19255 |
// Ran off the bottom of the graph. |
| 19256 |
k1start += 2; |
| 19257 |
} else if (front) { |
| 19258 |
var k2_offset = v_offset + delta - k1; |
| 19259 |
if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { |
| 19260 |
// Mirror x2 onto top-left coordinate system. |
| 19261 |
var x2 = text1_length - v2[k2_offset]; |
| 19262 |
if (x1 >= x2) { |
| 19263 |
// Overlap detected. |
| 19264 |
return diff_bisectSplit_(text1, text2, x1, y1); |
| 19265 |
} |
| 19266 |
} |
| 19267 |
} |
| 19268 |
} |
| 19269 |
|
| 19270 |
// Walk the reverse path one step. |
| 19271 |
for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { |
| 19272 |
var k2_offset = v_offset + k2; |
| 19273 |
var x2; |
| 19274 |
if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { |
| 19275 |
x2 = v2[k2_offset + 1]; |
| 19276 |
} else { |
| 19277 |
x2 = v2[k2_offset - 1] + 1; |
| 19278 |
} |
| 19279 |
var y2 = x2 - k2; |
| 19280 |
while (x2 < text1_length && y2 < text2_length && |
| 19281 |
text1.charAt(text1_length - x2 - 1) == |
| 19282 |
text2.charAt(text2_length - y2 - 1)) { |
| 19283 |
x2++; |
| 19284 |
y2++; |
| 19285 |
} |
| 19286 |
v2[k2_offset] = x2; |
| 19287 |
if (x2 > text1_length) { |
| 19288 |
// Ran off the left of the graph. |
| 19289 |
k2end += 2; |
| 19290 |
} else if (y2 > text2_length) { |
| 19291 |
// Ran off the top of the graph. |
| 19292 |
k2start += 2; |
| 19293 |
} else if (!front) { |
| 19294 |
var k1_offset = v_offset + delta - k2; |
| 19295 |
if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) { |
| 19296 |
var x1 = v1[k1_offset]; |
| 19297 |
var y1 = v_offset + x1 - k1_offset; |
| 19298 |
// Mirror x2 onto top-left coordinate system. |
| 19299 |
x2 = text1_length - x2; |
| 19300 |
if (x1 >= x2) { |
| 19301 |
// Overlap detected. |
| 19302 |
return diff_bisectSplit_(text1, text2, x1, y1); |
| 19303 |
} |
| 19304 |
} |
| 19305 |
} |
| 19306 |
} |
| 19307 |
} |
| 19308 |
// Diff took too long and hit the deadline or |
| 19309 |
// number of diffs equals number of characters, no commonality at all. |
| 19310 |
return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; |
| 19311 |
}; |
| 19312 |
|
| 19313 |
|
| 19314 |
/** |
| 19315 |
* Given the location of the 'middle snake', split the diff in two parts |
| 19316 |
* and recurse. |
| 19317 |
* @param {string} text1 Old string to be diffed. |
| 19318 |
* @param {string} text2 New string to be diffed. |
| 19319 |
* @param {number} x Index of split point in text1. |
| 19320 |
* @param {number} y Index of split point in text2. |
| 19321 |
* @return {Array} Array of diff tuples. |
| 19322 |
*/ |
| 19323 |
function diff_bisectSplit_(text1, text2, x, y) { |
| 19324 |
var text1a = text1.substring(0, x); |
| 19325 |
var text2a = text2.substring(0, y); |
| 19326 |
var text1b = text1.substring(x); |
| 19327 |
var text2b = text2.substring(y); |
| 19328 |
|
| 19329 |
// Compute both diffs serially. |
| 19330 |
var diffs = diff_main(text1a, text2a); |
| 19331 |
var diffsb = diff_main(text1b, text2b); |
| 19332 |
|
| 19333 |
return diffs.concat(diffsb); |
| 19334 |
}; |
| 19335 |
|
| 19336 |
|
| 19337 |
/** |
| 19338 |
* Determine the common prefix of two strings. |
| 19339 |
* @param {string} text1 First string. |
| 19340 |
* @param {string} text2 Second string. |
| 19341 |
* @return {number} The number of characters common to the start of each |
| 19342 |
* string. |
| 19343 |
*/ |
| 19344 |
function diff_commonPrefix(text1, text2) { |
| 19345 |
// Quick check for common null cases. |
| 19346 |
if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { |
| 19347 |
return 0; |
| 19348 |
} |
| 19349 |
// Binary search. |
| 19350 |
// Performance analysis: http://neil.fraser.name/news/2007/10/09/ |
| 19351 |
var pointermin = 0; |
| 19352 |
var pointermax = Math.min(text1.length, text2.length); |
| 19353 |
var pointermid = pointermax; |
| 19354 |
var pointerstart = 0; |
| 19355 |
while (pointermin < pointermid) { |
| 19356 |
if (text1.substring(pointerstart, pointermid) == |
| 19357 |
text2.substring(pointerstart, pointermid)) { |
| 19358 |
pointermin = pointermid; |
| 19359 |
pointerstart = pointermin; |
| 19360 |
} else { |
| 19361 |
pointermax = pointermid; |
| 19362 |
} |
| 19363 |
pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); |
| 19364 |
} |
| 19365 |
return pointermid; |
| 19366 |
}; |
| 19367 |
|
| 19368 |
|
| 19369 |
/** |
| 19370 |
* Determine the common suffix of two strings. |
| 19371 |
* @param {string} text1 First string. |
| 19372 |
* @param {string} text2 Second string. |
| 19373 |
* @return {number} The number of characters common to the end of each string. |
| 19374 |
*/ |
| 19375 |
function diff_commonSuffix(text1, text2) { |
| 19376 |
// Quick check for common null cases. |
| 19377 |
if (!text1 || !text2 || |
| 19378 |
text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { |
| 19379 |
return 0; |
| 19380 |
} |
| 19381 |
// Binary search. |
| 19382 |
// Performance analysis: http://neil.fraser.name/news/2007/10/09/ |
| 19383 |
var pointermin = 0; |
| 19384 |
var pointermax = Math.min(text1.length, text2.length); |
| 19385 |
var pointermid = pointermax; |
| 19386 |
var pointerend = 0; |
| 19387 |
while (pointermin < pointermid) { |
| 19388 |
if (text1.substring(text1.length - pointermid, text1.length - pointerend) == |
| 19389 |
text2.substring(text2.length - pointermid, text2.length - pointerend)) { |
| 19390 |
pointermin = pointermid; |
| 19391 |
pointerend = pointermin; |
| 19392 |
} else { |
| 19393 |
pointermax = pointermid; |
| 19394 |
} |
| 19395 |
pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); |
| 19396 |
} |
| 19397 |
return pointermid; |
| 19398 |
}; |
| 19399 |
|
| 19400 |
|
| 19401 |
/** |
| 19402 |
* Do the two texts share a substring which is at least half the length of the |
| 19403 |
* longer text? |
| 19404 |
* This speedup can produce non-minimal diffs. |
| 19405 |
* @param {string} text1 First string. |
| 19406 |
* @param {string} text2 Second string. |
| 19407 |
* @return {Array.<string>} Five element Array, containing the prefix of |
| 19408 |
* text1, the suffix of text1, the prefix of text2, the suffix of |
| 19409 |
* text2 and the common middle. Or null if there was no match. |
| 19410 |
*/ |
| 19411 |
function diff_halfMatch_(text1, text2) { |
| 19412 |
var longtext = text1.length > text2.length ? text1 : text2; |
| 19413 |
var shorttext = text1.length > text2.length ? text2 : text1; |
| 19414 |
if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { |
| 19415 |
return null; // Pointless. |
| 19416 |
} |
| 19417 |
|
| 19418 |
/** |
| 19419 |
* Does a substring of shorttext exist within longtext such that the substring |
| 19420 |
* is at least half the length of longtext? |
| 19421 |
* Closure, but does not reference any external variables. |
| 19422 |
* @param {string} longtext Longer string. |
| 19423 |
* @param {string} shorttext Shorter string. |
| 19424 |
* @param {number} i Start index of quarter length substring within longtext. |
| 19425 |
* @return {Array.<string>} Five element Array, containing the prefix of |
| 19426 |
* longtext, the suffix of longtext, the prefix of shorttext, the suffix |
| 19427 |
* of shorttext and the common middle. Or null if there was no match. |
| 19428 |
* @private |
| 19429 |
*/ |
| 19430 |
function diff_halfMatchI_(longtext, shorttext, i) { |
| 19431 |
// Start with a 1/4 length substring at position i as a seed. |
| 19432 |
var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); |
| 19433 |
var j = -1; |
| 19434 |
var best_common = ''; |
| 19435 |
var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; |
| 19436 |
while ((j = shorttext.indexOf(seed, j + 1)) != -1) { |
| 19437 |
var prefixLength = diff_commonPrefix(longtext.substring(i), |
| 19438 |
shorttext.substring(j)); |
| 19439 |
var suffixLength = diff_commonSuffix(longtext.substring(0, i), |
| 19440 |
shorttext.substring(0, j)); |
| 19441 |
if (best_common.length < suffixLength + prefixLength) { |
| 19442 |
best_common = shorttext.substring(j - suffixLength, j) + |
| 19443 |
shorttext.substring(j, j + prefixLength); |
| 19444 |
best_longtext_a = longtext.substring(0, i - suffixLength); |
| 19445 |
best_longtext_b = longtext.substring(i + prefixLength); |
| 19446 |
best_shorttext_a = shorttext.substring(0, j - suffixLength); |
| 19447 |
best_shorttext_b = shorttext.substring(j + prefixLength); |
| 19448 |
} |
| 19449 |
} |
| 19450 |
if (best_common.length * 2 >= longtext.length) { |
| 19451 |
return [best_longtext_a, best_longtext_b, |
| 19452 |
best_shorttext_a, best_shorttext_b, best_common]; |
| 19453 |
} else { |
| 19454 |
return null; |
| 19455 |
} |
| 19456 |
} |
| 19457 |
|
| 19458 |
// First check if the second quarter is the seed for a half-match. |
| 19459 |
var hm1 = diff_halfMatchI_(longtext, shorttext, |
| 19460 |
Math.ceil(longtext.length / 4)); |
| 19461 |
// Check again based on the third quarter. |
| 19462 |
var hm2 = diff_halfMatchI_(longtext, shorttext, |
| 19463 |
Math.ceil(longtext.length / 2)); |
| 19464 |
var hm; |
| 19465 |
if (!hm1 && !hm2) { |
| 19466 |
return null; |
| 19467 |
} else if (!hm2) { |
| 19468 |
hm = hm1; |
| 19469 |
} else if (!hm1) { |
| 19470 |
hm = hm2; |
| 19471 |
} else { |
| 19472 |
// Both matched. Select the longest. |
| 19473 |
hm = hm1[4].length > hm2[4].length ? hm1 : hm2; |
| 19474 |
} |
| 19475 |
|
| 19476 |
// A half-match was found, sort out the return data. |
| 19477 |
var text1_a, text1_b, text2_a, text2_b; |
| 19478 |
if (text1.length > text2.length) { |
| 19479 |
text1_a = hm[0]; |
| 19480 |
text1_b = hm[1]; |
| 19481 |
text2_a = hm[2]; |
| 19482 |
text2_b = hm[3]; |
| 19483 |
} else { |
| 19484 |
text2_a = hm[0]; |
| 19485 |
text2_b = hm[1]; |
| 19486 |
text1_a = hm[2]; |
| 19487 |
text1_b = hm[3]; |
| 19488 |
} |
| 19489 |
var mid_common = hm[4]; |
| 19490 |
return [text1_a, text1_b, text2_a, text2_b, mid_common]; |
| 19491 |
}; |
| 19492 |
|
| 19493 |
|
| 19494 |
/** |
| 19495 |
* Reorder and merge like edit sections. Merge equalities. |
| 19496 |
* Any edit section can move as long as it doesn't cross an equality. |
| 19497 |
* @param {Array} diffs Array of diff tuples. |
| 19498 |
*/ |
| 19499 |
function diff_cleanupMerge(diffs) { |
| 19500 |
diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. |
| 19501 |
var pointer = 0; |
| 19502 |
var count_delete = 0; |
| 19503 |
var count_insert = 0; |
| 19504 |
var text_delete = ''; |
| 19505 |
var text_insert = ''; |
| 19506 |
var commonlength; |
| 19507 |
while (pointer < diffs.length) { |
| 19508 |
switch (diffs[pointer][0]) { |
| 19509 |
case DIFF_INSERT: |
| 19510 |
count_insert++; |
| 19511 |
text_insert += diffs[pointer][1]; |
| 19512 |
pointer++; |
| 19513 |
break; |
| 19514 |
case DIFF_DELETE: |
| 19515 |
count_delete++; |
| 19516 |
text_delete += diffs[pointer][1]; |
| 19517 |
pointer++; |
| 19518 |
break; |
| 19519 |
case DIFF_EQUAL: |
| 19520 |
// Upon reaching an equality, check for prior redundancies. |
| 19521 |
if (count_delete + count_insert > 1) { |
| 19522 |
if (count_delete !== 0 && count_insert !== 0) { |
| 19523 |
// Factor out any common prefixies. |
| 19524 |
commonlength = diff_commonPrefix(text_insert, text_delete); |
| 19525 |
if (commonlength !== 0) { |
| 19526 |
if ((pointer - count_delete - count_insert) > 0 && |
| 19527 |
diffs[pointer - count_delete - count_insert - 1][0] == |
| 19528 |
DIFF_EQUAL) { |
| 19529 |
diffs[pointer - count_delete - count_insert - 1][1] += |
| 19530 |
text_insert.substring(0, commonlength); |
| 19531 |
} else { |
| 19532 |
diffs.splice(0, 0, [DIFF_EQUAL, |
| 19533 |
text_insert.substring(0, commonlength)]); |
| 19534 |
pointer++; |
| 19535 |
} |
| 19536 |
text_insert = text_insert.substring(commonlength); |
| 19537 |
text_delete = text_delete.substring(commonlength); |
| 19538 |
} |
| 19539 |
// Factor out any common suffixies. |
| 19540 |
commonlength = diff_commonSuffix(text_insert, text_delete); |
| 19541 |
if (commonlength !== 0) { |
| 19542 |
diffs[pointer][1] = text_insert.substring(text_insert.length - |
| 19543 |
commonlength) + diffs[pointer][1]; |
| 19544 |
text_insert = text_insert.substring(0, text_insert.length - |
| 19545 |
commonlength); |
| 19546 |
text_delete = text_delete.substring(0, text_delete.length - |
| 19547 |
commonlength); |
| 19548 |
} |
| 19549 |
} |
| 19550 |
// Delete the offending records and add the merged ones. |
| 19551 |
if (count_delete === 0) { |
| 19552 |
diffs.splice(pointer - count_insert, |
| 19553 |
count_delete + count_insert, [DIFF_INSERT, text_insert]); |
| 19554 |
} else if (count_insert === 0) { |
| 19555 |
diffs.splice(pointer - count_delete, |
| 19556 |
count_delete + count_insert, [DIFF_DELETE, text_delete]); |
| 19557 |
} else { |
| 19558 |
diffs.splice(pointer - count_delete - count_insert, |
| 19559 |
count_delete + count_insert, [DIFF_DELETE, text_delete], |
| 19560 |
[DIFF_INSERT, text_insert]); |
| 19561 |
} |
| 19562 |
pointer = pointer - count_delete - count_insert + |
| 19563 |
(count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; |
| 19564 |
} else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { |
| 19565 |
// Merge this equality with the previous one. |
| 19566 |
diffs[pointer - 1][1] += diffs[pointer][1]; |
| 19567 |
diffs.splice(pointer, 1); |
| 19568 |
} else { |
| 19569 |
pointer++; |
| 19570 |
} |
| 19571 |
count_insert = 0; |
| 19572 |
count_delete = 0; |
| 19573 |
text_delete = ''; |
| 19574 |
text_insert = ''; |
| 19575 |
break; |
| 19576 |
} |
| 19577 |
} |
| 19578 |
if (diffs[diffs.length - 1][1] === '') { |
| 19579 |
diffs.pop(); // Remove the dummy entry at the end. |
| 19580 |
} |
| 19581 |
|
| 19582 |
// Second pass: look for single edits surrounded on both sides by equalities |
| 19583 |
// which can be shifted sideways to eliminate an equality. |
| 19584 |
// e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC |
| 19585 |
var changes = false; |
| 19586 |
pointer = 1; |
| 19587 |
// Intentionally ignore the first and last element (don't need checking). |
| 19588 |
while (pointer < diffs.length - 1) { |
| 19589 |
if (diffs[pointer - 1][0] == DIFF_EQUAL && |
| 19590 |
diffs[pointer + 1][0] == DIFF_EQUAL) { |
| 19591 |
// This is a single edit surrounded by equalities. |
| 19592 |
if (diffs[pointer][1].substring(diffs[pointer][1].length - |
| 19593 |
diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { |
| 19594 |
// Shift the edit over the previous equality. |
| 19595 |
diffs[pointer][1] = diffs[pointer - 1][1] + |
| 19596 |
diffs[pointer][1].substring(0, diffs[pointer][1].length - |
| 19597 |
diffs[pointer - 1][1].length); |
| 19598 |
diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; |
| 19599 |
diffs.splice(pointer - 1, 1); |
| 19600 |
changes = true; |
| 19601 |
} else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == |
| 19602 |
diffs[pointer + 1][1]) { |
| 19603 |
// Shift the edit over the next equality. |
| 19604 |
diffs[pointer - 1][1] += diffs[pointer + 1][1]; |
| 19605 |
diffs[pointer][1] = |
| 19606 |
diffs[pointer][1].substring(diffs[pointer + 1][1].length) + |
| 19607 |
diffs[pointer + 1][1]; |
| 19608 |
diffs.splice(pointer + 1, 1); |
| 19609 |
changes = true; |
| 19610 |
} |
| 19611 |
} |
| 19612 |
pointer++; |
| 19613 |
} |
| 19614 |
// If shifts were made, the diff needs reordering and another shift sweep. |
| 19615 |
if (changes) { |
| 19616 |
diff_cleanupMerge(diffs); |
| 19617 |
} |
| 19618 |
}; |
| 19619 |
|
| 19620 |
|
| 19621 |
var diff = diff_main; |
| 19622 |
diff.INSERT = DIFF_INSERT; |
| 19623 |
diff.DELETE = DIFF_DELETE; |
| 19624 |
diff.EQUAL = DIFF_EQUAL; |
| 19625 |
|
| 19626 |
module.exports = diff; |
| 19627 |
|
| 19628 |
/* |
| 19629 |
* Modify a diff such that the cursor position points to the start of a change: |
| 19630 |
* E.g. |
| 19631 |
* cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) |
| 19632 |
* => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] |
| 19633 |
* cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) |
| 19634 |
* => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] |
| 19635 |
* |
| 19636 |
* @param {Array} diffs Array of diff tuples |
| 19637 |
* @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! |
| 19638 |
* @return {Array} A tuple [cursor location in the modified diff, modified diff] |
| 19639 |
*/ |
| 19640 |
function cursor_normalize_diff (diffs, cursor_pos) { |
| 19641 |
if (cursor_pos === 0) { |
| 19642 |
return [DIFF_EQUAL, diffs]; |
| 19643 |
} |
| 19644 |
for (var current_pos = 0, i = 0; i < diffs.length; i++) { |
| 19645 |
var d = diffs[i]; |
| 19646 |
if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { |
| 19647 |
var next_pos = current_pos + d[1].length; |
| 19648 |
if (cursor_pos === next_pos) { |
| 19649 |
return [i + 1, diffs]; |
| 19650 |
} else if (cursor_pos < next_pos) { |
| 19651 |
// copy to prevent side effects |
| 19652 |
diffs = diffs.slice(); |
| 19653 |
// split d into two diff changes |
| 19654 |
var split_pos = cursor_pos - current_pos; |
| 19655 |
var d_left = [d[0], d[1].slice(0, split_pos)]; |
| 19656 |
var d_right = [d[0], d[1].slice(split_pos)]; |
| 19657 |
diffs.splice(i, 1, d_left, d_right); |
| 19658 |
return [i + 1, diffs]; |
| 19659 |
} else { |
| 19660 |
current_pos = next_pos; |
| 19661 |
} |
| 19662 |
} |
| 19663 |
} |
| 19664 |
throw new Error('cursor_pos is out of bounds!') |
| 19665 |
} |
| 19666 |
|
| 19667 |
/* |
| 19668 |
* Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). |
| 19669 |
* |
| 19670 |
* Case 1) |
| 19671 |
* Check if a naive shift is possible: |
| 19672 |
* [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) |
| 19673 |
* [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result |
| 19674 |
* Case 2) |
| 19675 |
* Check if the following shifts are possible: |
| 19676 |
* [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] |
| 19677 |
* [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] |
| 19678 |
* ^ ^ |
| 19679 |
* d d_next |
| 19680 |
* |
| 19681 |
* @param {Array} diffs Array of diff tuples |
| 19682 |
* @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! |
| 19683 |
* @return {Array} Array of diff tuples |
| 19684 |
*/ |
| 19685 |
function fix_cursor (diffs, cursor_pos) { |
| 19686 |
var norm = cursor_normalize_diff(diffs, cursor_pos); |
| 19687 |
var ndiffs = norm[1]; |
| 19688 |
var cursor_pointer = norm[0]; |
| 19689 |
var d = ndiffs[cursor_pointer]; |
| 19690 |
var d_next = ndiffs[cursor_pointer + 1]; |
| 19691 |
|
| 19692 |
if (d == null) { |
| 19693 |
// Text was deleted from end of original string, |
| 19694 |
// cursor is now out of bounds in new string |
| 19695 |
return diffs; |
| 19696 |
} else if (d[0] !== DIFF_EQUAL) { |
| 19697 |
// A modification happened at the cursor location. |
| 19698 |
// This is the expected outcome, so we can return the original diff. |
| 19699 |
return diffs; |
| 19700 |
} else { |
| 19701 |
if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { |
| 19702 |
// Case 1) |
| 19703 |
// It is possible to perform a naive shift |
| 19704 |
ndiffs.splice(cursor_pointer, 2, d_next, d) |
| 19705 |
return merge_tuples(ndiffs, cursor_pointer, 2) |
| 19706 |
} else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { |
| 19707 |
// Case 2) |
| 19708 |
// d[1] is a prefix of d_next[1] |
| 19709 |
// We can assume that d_next[0] !== 0, since d[0] === 0 |
| 19710 |
// Shift edit locations.. |
| 19711 |
ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); |
| 19712 |
var suffix = d_next[1].slice(d[1].length); |
| 19713 |
if (suffix.length > 0) { |
| 19714 |
ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); |
| 19715 |
} |
| 19716 |
return merge_tuples(ndiffs, cursor_pointer, 3) |
| 19717 |
} else { |
| 19718 |
// Not possible to perform any modification |
| 19719 |
return diffs; |
| 19720 |
} |
| 19721 |
} |
| 19722 |
} |
| 19723 |
|
| 19724 |
/* |
| 19725 |
* Check diff did not split surrogate pairs. |
| 19726 |
* Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] |
| 19727 |
* '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' |
| 19728 |
* |
| 19729 |
* @param {Array} diffs Array of diff tuples |
| 19730 |
* @return {Array} Array of diff tuples |
| 19731 |
*/ |
| 19732 |
function fix_emoji (diffs) { |
| 19733 |
var compact = false; |
| 19734 |
var starts_with_pair_end = function(str) { |
| 19735 |
return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; |
| 19736 |
} |
| 19737 |
var ends_with_pair_start = function(str) { |
| 19738 |
return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF; |
| 19739 |
} |
| 19740 |
for (var i = 2; i < diffs.length; i += 1) { |
| 19741 |
if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) && |
| 19742 |
diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) && |
| 19743 |
diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { |
| 19744 |
compact = true; |
| 19745 |
|
| 19746 |
diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1]; |
| 19747 |
diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1]; |
| 19748 |
|
| 19749 |
diffs[i-2][1] = diffs[i-2][1].slice(0, -1); |
| 19750 |
} |
| 19751 |
} |
| 19752 |
if (!compact) { |
| 19753 |
return diffs; |
| 19754 |
} |
| 19755 |
var fixed_diffs = []; |
| 19756 |
for (var i = 0; i < diffs.length; i += 1) { |
| 19757 |
if (diffs[i][1].length > 0) { |
| 19758 |
fixed_diffs.push(diffs[i]); |
| 19759 |
} |
| 19760 |
} |
| 19761 |
return fixed_diffs; |
| 19762 |
} |
| 19763 |
|
| 19764 |
/* |
| 19765 |
* Try to merge tuples with their neigbors in a given range. |
| 19766 |
* E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] |
| 19767 |
* |
| 19768 |
* @param {Array} diffs Array of diff tuples. |
| 19769 |
* @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). |
| 19770 |
* @param {Int} length Number of consecutive elements to check. |
| 19771 |
* @return {Array} Array of merged diff tuples. |
| 19772 |
*/ |
| 19773 |
function merge_tuples (diffs, start, length) { |
| 19774 |
// Check from (start-1) to (start+length). |
| 19775 |
for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { |
| 19776 |
if (i + 1 < diffs.length) { |
| 19777 |
var left_d = diffs[i]; |
| 19778 |
var right_d = diffs[i+1]; |
| 19779 |
if (left_d[0] === right_d[1]) { |
| 19780 |
diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); |
| 19781 |
} |
| 19782 |
} |
| 19783 |
} |
| 19784 |
return diffs; |
| 19785 |
} |
| 19786 |
|
| 19787 |
|
| 19788 |
/***/ }), |
| 19789 |
/* 52 */ |
| 19790 |
/***/ (function(module, exports) { |
| 19791 |
|
| 19792 |
exports = module.exports = typeof Object.keys === 'function' |
| 19793 |
? Object.keys : shim; |
| 19794 |
|
| 19795 |
exports.shim = shim; |
| 19796 |
function shim (obj) { |
| 19797 |
var keys = []; |
| 19798 |
for (var key in obj) keys.push(key); |
| 19799 |
return keys; |
| 19800 |
} |
| 19801 |
|
| 19802 |
|
| 19803 |
/***/ }), |
| 19804 |
/* 53 */ |
| 19805 |
/***/ (function(module, exports) { |
| 19806 |
|
| 19807 |
var supportsArgumentsClass = (function(){ |
| 19808 |
return Object.prototype.toString.call(arguments) |
| 19809 |
})() == '[object Arguments]'; |
| 19810 |
|
| 19811 |
exports = module.exports = supportsArgumentsClass ? supported : unsupported; |
| 19812 |
|
| 19813 |
exports.supported = supported; |
| 19814 |
function supported(object) { |
| 19815 |
return Object.prototype.toString.call(object) == '[object Arguments]'; |
| 19816 |
}; |
| 19817 |
|
| 19818 |
exports.unsupported = unsupported; |
| 19819 |
function unsupported(object){ |
| 19820 |
return object && |
| 19821 |
typeof object == 'object' && |
| 19822 |
typeof object.length == 'number' && |
| 19823 |
Object.prototype.hasOwnProperty.call(object, 'callee') && |
| 19824 |
!Object.prototype.propertyIsEnumerable.call(object, 'callee') || |
| 19825 |
false; |
| 19826 |
}; |
| 19827 |
|
| 19828 |
|
| 19829 |
/***/ }), |
| 19830 |
/* 54 */ |
| 19831 |
/***/ (function(module, exports) { |
| 19832 |
|
| 19833 |
'use strict'; |
| 19834 |
|
| 19835 |
var has = Object.prototype.hasOwnProperty |
| 19836 |
, prefix = '~'; |
| 19837 |
|
| 19838 |
/** |
| 19839 |
* Constructor to create a storage for our `EE` objects. |
| 19840 |
* An `Events` instance is a plain object whose properties are event names. |
| 19841 |
* |
| 19842 |
* @constructor |
| 19843 |
* @api private |
| 19844 |
*/ |
| 19845 |
function Events() {} |
| 19846 |
|
| 19847 |
// |
| 19848 |
// We try to not inherit from `Object.prototype`. In some engines creating an |
| 19849 |
// instance in this way is faster than calling `Object.create(null)` directly. |
| 19850 |
// If `Object.create(null)` is not supported we prefix the event names with a |
| 19851 |
// character to make sure that the built-in object properties are not |
| 19852 |
// overridden or used as an attack vector. |
| 19853 |
// |
| 19854 |
if (Object.create) { |
| 19855 |
Events.prototype = Object.create(null); |
| 19856 |
|
| 19857 |
// |
| 19858 |
// This hack is needed because the `__proto__` property is still inherited in |
| 19859 |
// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. |
| 19860 |
// |
| 19861 |
if (!new Events().__proto__) prefix = false; |
| 19862 |
} |
| 19863 |
|
| 19864 |
/** |
| 19865 |
* Representation of a single event listener. |
| 19866 |
* |
| 19867 |
* @param {Function} fn The listener function. |
| 19868 |
* @param {Mixed} context The context to invoke the listener with. |
| 19869 |
* @param {Boolean} [once=false] Specify if the listener is a one-time listener. |
| 19870 |
* @constructor |
| 19871 |
* @api private |
| 19872 |
*/ |
| 19873 |
function EE(fn, context, once) { |
| 19874 |
this.fn = fn; |
| 19875 |
this.context = context; |
| 19876 |
this.once = once || false; |
| 19877 |
} |
| 19878 |
|
| 19879 |
/** |
| 19880 |
* Minimal `EventEmitter` interface that is molded against the Node.js |
| 19881 |
* `EventEmitter` interface. |
| 19882 |
* |
| 19883 |
* @constructor |
| 19884 |
* @api public |
| 19885 |
*/ |
| 19886 |
function EventEmitter() { |
| 19887 |
this._events = new Events(); |
| 19888 |
this._eventsCount = 0; |
| 19889 |
} |
| 19890 |
|
| 19891 |
/** |
| 19892 |
* Return an array listing the events for which the emitter has registered |
| 19893 |
* listeners. |
| 19894 |
* |
| 19895 |
* @returns {Array} |
| 19896 |
* @api public |
| 19897 |
*/ |
| 19898 |
EventEmitter.prototype.eventNames = function eventNames() { |
| 19899 |
var names = [] |
| 19900 |
, events |
| 19901 |
, name; |
| 19902 |
|
| 19903 |
if (this._eventsCount === 0) return names; |
| 19904 |
|
| 19905 |
for (name in (events = this._events)) { |
| 19906 |
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); |
| 19907 |
} |
| 19908 |
|
| 19909 |
if (Object.getOwnPropertySymbols) { |
| 19910 |
return names.concat(Object.getOwnPropertySymbols(events)); |
| 19911 |
} |
| 19912 |
|
| 19913 |
return names; |
| 19914 |
}; |
| 19915 |
|
| 19916 |
/** |
| 19917 |
* Return the listeners registered for a given event. |
| 19918 |
* |
| 19919 |
* @param {String|Symbol} event The event name. |
| 19920 |
* @param {Boolean} exists Only check if there are listeners. |
| 19921 |
* @returns {Array|Boolean} |
| 19922 |
* @api public |
| 19923 |
*/ |
| 19924 |
EventEmitter.prototype.listeners = function listeners(event, exists) { |
| 19925 |
var evt = prefix ? prefix + event : event |
| 19926 |
, available = this._events[evt]; |
| 19927 |
|
| 19928 |
if (exists) return !!available; |
| 19929 |
if (!available) return []; |
| 19930 |
if (available.fn) return [available.fn]; |
| 19931 |
|
| 19932 |
for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { |
| 19933 |
ee[i] = available[i].fn; |
| 19934 |
} |
| 19935 |
|
| 19936 |
return ee; |
| 19937 |
}; |
| 19938 |
|
| 19939 |
/** |
| 19940 |
* Calls each of the listeners registered for a given event. |
| 19941 |
* |
| 19942 |
* @param {String|Symbol} event The event name. |
| 19943 |
* @returns {Boolean} `true` if the event had listeners, else `false`. |
| 19944 |
* @api public |
| 19945 |
*/ |
| 19946 |
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { |
| 19947 |
var evt = prefix ? prefix + event : event; |
| 19948 |
|
| 19949 |
if (!this._events[evt]) return false; |
| 19950 |
|
| 19951 |
var listeners = this._events[evt] |
| 19952 |
, len = arguments.length |
| 19953 |
, args |
| 19954 |
, i; |
| 19955 |
|
| 19956 |
if (listeners.fn) { |
| 19957 |
if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); |
| 19958 |
|
| 19959 |
switch (len) { |
| 19960 |
case 1: return listeners.fn.call(listeners.context), true; |
| 19961 |
case 2: return listeners.fn.call(listeners.context, a1), true; |
| 19962 |
case 3: return listeners.fn.call(listeners.context, a1, a2), true; |
| 19963 |
case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; |
| 19964 |
case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; |
| 19965 |
case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; |
| 19966 |
} |
| 19967 |
|
| 19968 |
for (i = 1, args = new Array(len -1); i < len; i++) { |
| 19969 |
args[i - 1] = arguments[i]; |
| 19970 |
} |
| 19971 |
|
| 19972 |
listeners.fn.apply(listeners.context, args); |
| 19973 |
} else { |
| 19974 |
var length = listeners.length |
| 19975 |
, j; |
| 19976 |
|
| 19977 |
for (i = 0; i < length; i++) { |
| 19978 |
if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); |
| 19979 |
|
| 19980 |
switch (len) { |
| 19981 |
case 1: listeners[i].fn.call(listeners[i].context); break; |
| 19982 |
case 2: listeners[i].fn.call(listeners[i].context, a1); break; |
| 19983 |
case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; |
| 19984 |
case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; |
| 19985 |
default: |
| 19986 |
if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { |
| 19987 |
args[j - 1] = arguments[j]; |
| 19988 |
} |
| 19989 |
|
| 19990 |
listeners[i].fn.apply(listeners[i].context, args); |
| 19991 |
} |
| 19992 |
} |
| 19993 |
} |
| 19994 |
|
| 19995 |
return true; |
| 19996 |
}; |
| 19997 |
|
| 19998 |
/** |
| 19999 |
* Add a listener for a given event. |
| 20000 |
* |
| 20001 |
* @param {String|Symbol} event The event name. |
| 20002 |
* @param {Function} fn The listener function. |
| 20003 |
* @param {Mixed} [context=this] The context to invoke the listener with. |
| 20004 |
* @returns {EventEmitter} `this`. |
| 20005 |
* @api public |
| 20006 |
*/ |
| 20007 |
EventEmitter.prototype.on = function on(event, fn, context) { |
| 20008 |
var listener = new EE(fn, context || this) |
| 20009 |
, evt = prefix ? prefix + event : event; |
| 20010 |
|
| 20011 |
if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; |
| 20012 |
else if (!this._events[evt].fn) this._events[evt].push(listener); |
| 20013 |
else this._events[evt] = [this._events[evt], listener]; |
| 20014 |
|
| 20015 |
return this; |
| 20016 |
}; |
| 20017 |
|
| 20018 |
/** |
| 20019 |
* Add a one-time listener for a given event. |
| 20020 |
* |
| 20021 |
* @param {String|Symbol} event The event name. |
| 20022 |
* @param {Function} fn The listener function. |
| 20023 |
* @param {Mixed} [context=this] The context to invoke the listener with. |
| 20024 |
* @returns {EventEmitter} `this`. |
| 20025 |
* @api public |
| 20026 |
*/ |
| 20027 |
EventEmitter.prototype.once = function once(event, fn, context) { |
| 20028 |
var listener = new EE(fn, context || this, true) |
| 20029 |
, evt = prefix ? prefix + event : event; |
| 20030 |
|
| 20031 |
if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; |
| 20032 |
else if (!this._events[evt].fn) this._events[evt].push(listener); |
| 20033 |
else this._events[evt] = [this._events[evt], listener]; |
| 20034 |
|
| 20035 |
return this; |
| 20036 |
}; |
| 20037 |
|
| 20038 |
/** |
| 20039 |
* Remove the listeners of a given event. |
| 20040 |
* |
| 20041 |
* @param {String|Symbol} event The event name. |
| 20042 |
* @param {Function} fn Only remove the listeners that match this function. |
| 20043 |
* @param {Mixed} context Only remove the listeners that have this context. |
| 20044 |
* @param {Boolean} once Only remove one-time listeners. |
| 20045 |
* @returns {EventEmitter} `this`. |
| 20046 |
* @api public |
| 20047 |
*/ |
| 20048 |
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { |
| 20049 |
var evt = prefix ? prefix + event : event; |
| 20050 |
|
| 20051 |
if (!this._events[evt]) return this; |
| 20052 |
if (!fn) { |
| 20053 |
if (--this._eventsCount === 0) this._events = new Events(); |
| 20054 |
else delete this._events[evt]; |
| 20055 |
return this; |
| 20056 |
} |
| 20057 |
|
| 20058 |
var listeners = this._events[evt]; |
| 20059 |
|
| 20060 |
if (listeners.fn) { |
| 20061 |
if ( |
| 20062 |
listeners.fn === fn |
| 20063 |
&& (!once || listeners.once) |
| 20064 |
&& (!context || listeners.context === context) |
| 20065 |
) { |
| 20066 |
if (--this._eventsCount === 0) this._events = new Events(); |
| 20067 |
else delete this._events[evt]; |
| 20068 |
} |
| 20069 |
} else { |
| 20070 |
for (var i = 0, events = [], length = listeners.length; i < length; i++) { |
| 20071 |
if ( |
| 20072 |
listeners[i].fn !== fn |
| 20073 |
|| (once && !listeners[i].once) |
| 20074 |
|| (context && listeners[i].context !== context) |
| 20075 |
) { |
| 20076 |
events.push(listeners[i]); |
| 20077 |
} |
| 20078 |
} |
| 20079 |
|
| 20080 |
// |
| 20081 |
// Reset the array, or remove it completely if we have no more listeners. |
| 20082 |
// |
| 20083 |
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; |
| 20084 |
else if (--this._eventsCount === 0) this._events = new Events(); |
| 20085 |
else delete this._events[evt]; |
| 20086 |
} |
| 20087 |
|
| 20088 |
return this; |
| 20089 |
}; |
| 20090 |
|
| 20091 |
/** |
| 20092 |
* Remove all listeners, or those of the specified event. |
| 20093 |
* |
| 20094 |
* @param {String|Symbol} [event] The event name. |
| 20095 |
* @returns {EventEmitter} `this`. |
| 20096 |
* @api public |
| 20097 |
*/ |
| 20098 |
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { |
| 20099 |
var evt; |
| 20100 |
|
| 20101 |
if (event) { |
| 20102 |
evt = prefix ? prefix + event : event; |
| 20103 |
if (this._events[evt]) { |
| 20104 |
if (--this._eventsCount === 0) this._events = new Events(); |
| 20105 |
else delete this._events[evt]; |
| 20106 |
} |
| 20107 |
} else { |
| 20108 |
this._events = new Events(); |
| 20109 |
this._eventsCount = 0; |
| 20110 |
} |
| 20111 |
|
| 20112 |
return this; |
| 20113 |
}; |
| 20114 |
|
| 20115 |
// |
| 20116 |
// Alias methods names because people roll like that. |
| 20117 |
// |
| 20118 |
EventEmitter.prototype.off = EventEmitter.prototype.removeListener; |
| 20119 |
EventEmitter.prototype.addListener = EventEmitter.prototype.on; |
| 20120 |
|
| 20121 |
// |
| 20122 |
// This function doesn't apply anymore. |
| 20123 |
// |
| 20124 |
EventEmitter.prototype.setMaxListeners = function setMaxListeners() { |
| 20125 |
return this; |
| 20126 |
}; |
| 20127 |
|
| 20128 |
// |
| 20129 |
// Expose the prefix. |
| 20130 |
// |
| 20131 |
EventEmitter.prefixed = prefix; |
| 20132 |
|
| 20133 |
// |
| 20134 |
// Allow `EventEmitter` to be imported as module namespace. |
| 20135 |
// |
| 20136 |
EventEmitter.EventEmitter = EventEmitter; |
| 20137 |
|
| 20138 |
// |
| 20139 |
// Expose the module. |
| 20140 |
// |
| 20141 |
if ('undefined' !== typeof module) { |
| 20142 |
module.exports = EventEmitter; |
| 20143 |
} |
| 20144 |
|
| 20145 |
|
| 20146 |
/***/ }), |
| 20147 |
/* 55 */ |
| 20148 |
/***/ (function(module, exports, __nested_webpack_require_316416__) { |
| 20149 |
|
| 20150 |
"use strict"; |
| 20151 |
|
| 20152 |
|
| 20153 |
Object.defineProperty(exports, "__esModule", { |
| 20154 |
value: true |
| 20155 |
}); |
| 20156 |
exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; |
| 20157 |
|
| 20158 |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
| 20159 |
|
| 20160 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 20161 |
|
| 20162 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 20163 |
|
| 20164 |
var _extend2 = __nested_webpack_require_316416__(3); |
| 20165 |
|
| 20166 |
var _extend3 = _interopRequireDefault(_extend2); |
| 20167 |
|
| 20168 |
var _quillDelta = __nested_webpack_require_316416__(2); |
| 20169 |
|
| 20170 |
var _quillDelta2 = _interopRequireDefault(_quillDelta); |
| 20171 |
|
| 20172 |
var _parchment = __nested_webpack_require_316416__(0); |
| 20173 |
|
| 20174 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 20175 |
|
| 20176 |
var _quill = __nested_webpack_require_316416__(5); |
| 20177 |
|
| 20178 |
var _quill2 = _interopRequireDefault(_quill); |
| 20179 |
|
| 20180 |
var _logger = __nested_webpack_require_316416__(10); |
| 20181 |
|
| 20182 |
var _logger2 = _interopRequireDefault(_logger); |
| 20183 |
|
| 20184 |
var _module = __nested_webpack_require_316416__(9); |
| 20185 |
|
| 20186 |
var _module2 = _interopRequireDefault(_module); |
| 20187 |
|
| 20188 |
var _align = __nested_webpack_require_316416__(36); |
| 20189 |
|
| 20190 |
var _background = __nested_webpack_require_316416__(37); |
| 20191 |
|
| 20192 |
var _code = __nested_webpack_require_316416__(13); |
| 20193 |
|
| 20194 |
var _code2 = _interopRequireDefault(_code); |
| 20195 |
|
| 20196 |
var _color = __nested_webpack_require_316416__(26); |
| 20197 |
|
| 20198 |
var _direction = __nested_webpack_require_316416__(38); |
| 20199 |
|
| 20200 |
var _font = __nested_webpack_require_316416__(39); |
| 20201 |
|
| 20202 |
var _size = __nested_webpack_require_316416__(40); |
| 20203 |
|
| 20204 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 20205 |
|
| 20206 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 20207 |
|
| 20208 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 20209 |
|
| 20210 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 20211 |
|
| 20212 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 20213 |
|
| 20214 |
var debug = (0, _logger2.default)('quill:clipboard'); |
| 20215 |
|
| 20216 |
var DOM_KEY = '__ql-matcher'; |
| 20217 |
|
| 20218 |
var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; |
| 20219 |
|
| 20220 |
var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { |
| 20221 |
memo[attr.keyName] = attr; |
| 20222 |
return memo; |
| 20223 |
}, {}); |
| 20224 |
|
| 20225 |
var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { |
| 20226 |
memo[attr.keyName] = attr; |
| 20227 |
return memo; |
| 20228 |
}, {}); |
| 20229 |
|
| 20230 |
var Clipboard = function (_Module) { |
| 20231 |
_inherits(Clipboard, _Module); |
| 20232 |
|
| 20233 |
function Clipboard(quill, options) { |
| 20234 |
_classCallCheck(this, Clipboard); |
| 20235 |
|
| 20236 |
var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); |
| 20237 |
|
| 20238 |
_this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); |
| 20239 |
_this.container = _this.quill.addContainer('ql-clipboard'); |
| 20240 |
_this.container.setAttribute('contenteditable', true); |
| 20241 |
_this.container.setAttribute('tabindex', -1); |
| 20242 |
_this.matchers = []; |
| 20243 |
CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { |
| 20244 |
var _ref2 = _slicedToArray(_ref, 2), |
| 20245 |
selector = _ref2[0], |
| 20246 |
matcher = _ref2[1]; |
| 20247 |
|
| 20248 |
if (!options.matchVisual && matcher === matchSpacing) return; |
| 20249 |
_this.addMatcher(selector, matcher); |
| 20250 |
}); |
| 20251 |
return _this; |
| 20252 |
} |
| 20253 |
|
| 20254 |
_createClass(Clipboard, [{ |
| 20255 |
key: 'addMatcher', |
| 20256 |
value: function addMatcher(selector, matcher) { |
| 20257 |
this.matchers.push([selector, matcher]); |
| 20258 |
} |
| 20259 |
}, { |
| 20260 |
key: 'convert', |
| 20261 |
value: function convert(html) { |
| 20262 |
if (typeof html === 'string') { |
| 20263 |
this.container.innerHTML = html.replace(/\>\r?\n +\</g, '><'); // Remove spaces between tags |
| 20264 |
return this.convert(); |
| 20265 |
} |
| 20266 |
var formats = this.quill.getFormat(this.quill.selection.savedRange.index); |
| 20267 |
if (formats[_code2.default.blotName]) { |
| 20268 |
var text = this.container.innerText; |
| 20269 |
this.container.innerHTML = ''; |
| 20270 |
return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); |
| 20271 |
} |
| 20272 |
|
| 20273 |
var _prepareMatching = this.prepareMatching(), |
| 20274 |
_prepareMatching2 = _slicedToArray(_prepareMatching, 2), |
| 20275 |
elementMatchers = _prepareMatching2[0], |
| 20276 |
textMatchers = _prepareMatching2[1]; |
| 20277 |
|
| 20278 |
var delta = traverse(this.container, elementMatchers, textMatchers); |
| 20279 |
// Remove trailing newline |
| 20280 |
if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { |
| 20281 |
delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); |
| 20282 |
} |
| 20283 |
debug.log('convert', this.container.innerHTML, delta); |
| 20284 |
this.container.innerHTML = ''; |
| 20285 |
return delta; |
| 20286 |
} |
| 20287 |
}, { |
| 20288 |
key: 'dangerouslyPasteHTML', |
| 20289 |
value: function dangerouslyPasteHTML(index, html) { |
| 20290 |
var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; |
| 20291 |
|
| 20292 |
if (typeof index === 'string') { |
| 20293 |
this.quill.setContents(this.convert(index), html); |
| 20294 |
this.quill.setSelection(0, _quill2.default.sources.SILENT); |
| 20295 |
} else { |
| 20296 |
var paste = this.convert(html); |
| 20297 |
this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); |
| 20298 |
this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); |
| 20299 |
} |
| 20300 |
} |
| 20301 |
}, { |
| 20302 |
key: 'onPaste', |
| 20303 |
value: function onPaste(e) { |
| 20304 |
var _this2 = this; |
| 20305 |
|
| 20306 |
if (e.defaultPrevented || !this.quill.isEnabled()) return; |
| 20307 |
var range = this.quill.getSelection(); |
| 20308 |
var delta = new _quillDelta2.default().retain(range.index); |
| 20309 |
var scrollTop = this.quill.scrollingContainer.scrollTop; |
| 20310 |
this.container.focus(); |
| 20311 |
this.quill.selection.update(_quill2.default.sources.SILENT); |
| 20312 |
setTimeout(function () { |
| 20313 |
delta = delta.concat(_this2.convert()).delete(range.length); |
| 20314 |
_this2.quill.updateContents(delta, _quill2.default.sources.USER); |
| 20315 |
// range.length contributes to delta.length() |
| 20316 |
_this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); |
| 20317 |
_this2.quill.scrollingContainer.scrollTop = scrollTop; |
| 20318 |
_this2.quill.focus(); |
| 20319 |
}, 1); |
| 20320 |
} |
| 20321 |
}, { |
| 20322 |
key: 'prepareMatching', |
| 20323 |
value: function prepareMatching() { |
| 20324 |
var _this3 = this; |
| 20325 |
|
| 20326 |
var elementMatchers = [], |
| 20327 |
textMatchers = []; |
| 20328 |
this.matchers.forEach(function (pair) { |
| 20329 |
var _pair = _slicedToArray(pair, 2), |
| 20330 |
selector = _pair[0], |
| 20331 |
matcher = _pair[1]; |
| 20332 |
|
| 20333 |
switch (selector) { |
| 20334 |
case Node.TEXT_NODE: |
| 20335 |
textMatchers.push(matcher); |
| 20336 |
break; |
| 20337 |
case Node.ELEMENT_NODE: |
| 20338 |
elementMatchers.push(matcher); |
| 20339 |
break; |
| 20340 |
default: |
| 20341 |
[].forEach.call(_this3.container.querySelectorAll(selector), function (node) { |
| 20342 |
// TODO use weakmap |
| 20343 |
node[DOM_KEY] = node[DOM_KEY] || []; |
| 20344 |
node[DOM_KEY].push(matcher); |
| 20345 |
}); |
| 20346 |
break; |
| 20347 |
} |
| 20348 |
}); |
| 20349 |
return [elementMatchers, textMatchers]; |
| 20350 |
} |
| 20351 |
}]); |
| 20352 |
|
| 20353 |
return Clipboard; |
| 20354 |
}(_module2.default); |
| 20355 |
|
| 20356 |
Clipboard.DEFAULTS = { |
| 20357 |
matchers: [], |
| 20358 |
matchVisual: true |
| 20359 |
}; |
| 20360 |
|
| 20361 |
function applyFormat(delta, format, value) { |
| 20362 |
if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { |
| 20363 |
return Object.keys(format).reduce(function (delta, key) { |
| 20364 |
return applyFormat(delta, key, format[key]); |
| 20365 |
}, delta); |
| 20366 |
} else { |
| 20367 |
return delta.reduce(function (delta, op) { |
| 20368 |
if (op.attributes && op.attributes[format]) { |
| 20369 |
return delta.push(op); |
| 20370 |
} else { |
| 20371 |
return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); |
| 20372 |
} |
| 20373 |
}, new _quillDelta2.default()); |
| 20374 |
} |
| 20375 |
} |
| 20376 |
|
| 20377 |
function computeStyle(node) { |
| 20378 |
if (node.nodeType !== Node.ELEMENT_NODE) return {}; |
| 20379 |
var DOM_KEY = '__ql-computed-style'; |
| 20380 |
return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); |
| 20381 |
} |
| 20382 |
|
| 20383 |
function deltaEndsWith(delta, text) { |
| 20384 |
var endText = ""; |
| 20385 |
for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { |
| 20386 |
var op = delta.ops[i]; |
| 20387 |
if (typeof op.insert !== 'string') break; |
| 20388 |
endText = op.insert + endText; |
| 20389 |
} |
| 20390 |
return endText.slice(-1 * text.length) === text; |
| 20391 |
} |
| 20392 |
|
| 20393 |
function isLine(node) { |
| 20394 |
if (node.childNodes.length === 0) return false; // Exclude embed blocks |
| 20395 |
var style = computeStyle(node); |
| 20396 |
return ['block', 'list-item'].indexOf(style.display) > -1; |
| 20397 |
} |
| 20398 |
|
| 20399 |
function traverse(node, elementMatchers, textMatchers) { |
| 20400 |
// Post-order |
| 20401 |
if (node.nodeType === node.TEXT_NODE) { |
| 20402 |
return textMatchers.reduce(function (delta, matcher) { |
| 20403 |
return matcher(node, delta); |
| 20404 |
}, new _quillDelta2.default()); |
| 20405 |
} else if (node.nodeType === node.ELEMENT_NODE) { |
| 20406 |
return [].reduce.call(node.childNodes || [], function (delta, childNode) { |
| 20407 |
var childrenDelta = traverse(childNode, elementMatchers, textMatchers); |
| 20408 |
if (childNode.nodeType === node.ELEMENT_NODE) { |
| 20409 |
childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { |
| 20410 |
return matcher(childNode, childrenDelta); |
| 20411 |
}, childrenDelta); |
| 20412 |
childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { |
| 20413 |
return matcher(childNode, childrenDelta); |
| 20414 |
}, childrenDelta); |
| 20415 |
} |
| 20416 |
return delta.concat(childrenDelta); |
| 20417 |
}, new _quillDelta2.default()); |
| 20418 |
} else { |
| 20419 |
return new _quillDelta2.default(); |
| 20420 |
} |
| 20421 |
} |
| 20422 |
|
| 20423 |
function matchAlias(format, node, delta) { |
| 20424 |
return applyFormat(delta, format, true); |
| 20425 |
} |
| 20426 |
|
| 20427 |
function matchAttributor(node, delta) { |
| 20428 |
var attributes = _parchment2.default.Attributor.Attribute.keys(node); |
| 20429 |
var classes = _parchment2.default.Attributor.Class.keys(node); |
| 20430 |
var styles = _parchment2.default.Attributor.Style.keys(node); |
| 20431 |
var formats = {}; |
| 20432 |
attributes.concat(classes).concat(styles).forEach(function (name) { |
| 20433 |
var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); |
| 20434 |
if (attr != null) { |
| 20435 |
formats[attr.attrName] = attr.value(node); |
| 20436 |
if (formats[attr.attrName]) return; |
| 20437 |
} |
| 20438 |
attr = ATTRIBUTE_ATTRIBUTORS[name]; |
| 20439 |
if (attr != null && (attr.attrName === name || attr.keyName === name)) { |
| 20440 |
formats[attr.attrName] = attr.value(node) || undefined; |
| 20441 |
} |
| 20442 |
attr = STYLE_ATTRIBUTORS[name]; |
| 20443 |
if (attr != null && (attr.attrName === name || attr.keyName === name)) { |
| 20444 |
attr = STYLE_ATTRIBUTORS[name]; |
| 20445 |
formats[attr.attrName] = attr.value(node) || undefined; |
| 20446 |
} |
| 20447 |
}); |
| 20448 |
if (Object.keys(formats).length > 0) { |
| 20449 |
delta = applyFormat(delta, formats); |
| 20450 |
} |
| 20451 |
return delta; |
| 20452 |
} |
| 20453 |
|
| 20454 |
function matchBlot(node, delta) { |
| 20455 |
var match = _parchment2.default.query(node); |
| 20456 |
if (match == null) return delta; |
| 20457 |
if (match.prototype instanceof _parchment2.default.Embed) { |
| 20458 |
var embed = {}; |
| 20459 |
var value = match.value(node); |
| 20460 |
if (value != null) { |
| 20461 |
embed[match.blotName] = value; |
| 20462 |
delta = new _quillDelta2.default().insert(embed, match.formats(node)); |
| 20463 |
} |
| 20464 |
} else if (typeof match.formats === 'function') { |
| 20465 |
delta = applyFormat(delta, match.blotName, match.formats(node)); |
| 20466 |
} |
| 20467 |
return delta; |
| 20468 |
} |
| 20469 |
|
| 20470 |
function matchBreak(node, delta) { |
| 20471 |
if (!deltaEndsWith(delta, '\n')) { |
| 20472 |
delta.insert('\n'); |
| 20473 |
} |
| 20474 |
return delta; |
| 20475 |
} |
| 20476 |
|
| 20477 |
function matchIgnore() { |
| 20478 |
return new _quillDelta2.default(); |
| 20479 |
} |
| 20480 |
|
| 20481 |
function matchIndent(node, delta) { |
| 20482 |
var match = _parchment2.default.query(node); |
| 20483 |
if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { |
| 20484 |
return delta; |
| 20485 |
} |
| 20486 |
var indent = -1, |
| 20487 |
parent = node.parentNode; |
| 20488 |
while (!parent.classList.contains('ql-clipboard')) { |
| 20489 |
if ((_parchment2.default.query(parent) || {}).blotName === 'list') { |
| 20490 |
indent += 1; |
| 20491 |
} |
| 20492 |
parent = parent.parentNode; |
| 20493 |
} |
| 20494 |
if (indent <= 0) return delta; |
| 20495 |
return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); |
| 20496 |
} |
| 20497 |
|
| 20498 |
function matchNewline(node, delta) { |
| 20499 |
if (!deltaEndsWith(delta, '\n')) { |
| 20500 |
if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { |
| 20501 |
delta.insert('\n'); |
| 20502 |
} |
| 20503 |
} |
| 20504 |
return delta; |
| 20505 |
} |
| 20506 |
|
| 20507 |
function matchSpacing(node, delta) { |
| 20508 |
if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { |
| 20509 |
var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); |
| 20510 |
if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { |
| 20511 |
delta.insert('\n'); |
| 20512 |
} |
| 20513 |
} |
| 20514 |
return delta; |
| 20515 |
} |
| 20516 |
|
| 20517 |
function matchStyles(node, delta) { |
| 20518 |
var formats = {}; |
| 20519 |
var style = node.style || {}; |
| 20520 |
if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { |
| 20521 |
formats.italic = true; |
| 20522 |
} |
| 20523 |
if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { |
| 20524 |
formats.bold = true; |
| 20525 |
} |
| 20526 |
if (Object.keys(formats).length > 0) { |
| 20527 |
delta = applyFormat(delta, formats); |
| 20528 |
} |
| 20529 |
if (parseFloat(style.textIndent || 0) > 0) { |
| 20530 |
// Could be 0.5in |
| 20531 |
delta = new _quillDelta2.default().insert('\t').concat(delta); |
| 20532 |
} |
| 20533 |
return delta; |
| 20534 |
} |
| 20535 |
|
| 20536 |
function matchText(node, delta) { |
| 20537 |
var text = node.data; |
| 20538 |
// Word represents empty line with <o:p> </o:p> |
| 20539 |
if (node.parentNode.tagName === 'O:P') { |
| 20540 |
return delta.insert(text.trim()); |
| 20541 |
} |
| 20542 |
if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { |
| 20543 |
return delta; |
| 20544 |
} |
| 20545 |
if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { |
| 20546 |
// eslint-disable-next-line func-style |
| 20547 |
var replacer = function replacer(collapse, match) { |
| 20548 |
match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; |
| 20549 |
return match.length < 1 && collapse ? ' ' : match; |
| 20550 |
}; |
| 20551 |
text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); |
| 20552 |
text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace |
| 20553 |
if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { |
| 20554 |
text = text.replace(/^\s+/, replacer.bind(replacer, false)); |
| 20555 |
} |
| 20556 |
if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { |
| 20557 |
text = text.replace(/\s+$/, replacer.bind(replacer, false)); |
| 20558 |
} |
| 20559 |
} |
| 20560 |
return delta.insert(text); |
| 20561 |
} |
| 20562 |
|
| 20563 |
exports.default = Clipboard; |
| 20564 |
exports.matchAttributor = matchAttributor; |
| 20565 |
exports.matchBlot = matchBlot; |
| 20566 |
exports.matchNewline = matchNewline; |
| 20567 |
exports.matchSpacing = matchSpacing; |
| 20568 |
exports.matchText = matchText; |
| 20569 |
|
| 20570 |
/***/ }), |
| 20571 |
/* 56 */ |
| 20572 |
/***/ (function(module, exports, __nested_webpack_require_333274__) { |
| 20573 |
|
| 20574 |
"use strict"; |
| 20575 |
|
| 20576 |
|
| 20577 |
Object.defineProperty(exports, "__esModule", { |
| 20578 |
value: true |
| 20579 |
}); |
| 20580 |
|
| 20581 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 20582 |
|
| 20583 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 20584 |
|
| 20585 |
var _inline = __nested_webpack_require_333274__(6); |
| 20586 |
|
| 20587 |
var _inline2 = _interopRequireDefault(_inline); |
| 20588 |
|
| 20589 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 20590 |
|
| 20591 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 20592 |
|
| 20593 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 20594 |
|
| 20595 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 20596 |
|
| 20597 |
var Bold = function (_Inline) { |
| 20598 |
_inherits(Bold, _Inline); |
| 20599 |
|
| 20600 |
function Bold() { |
| 20601 |
_classCallCheck(this, Bold); |
| 20602 |
|
| 20603 |
return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments)); |
| 20604 |
} |
| 20605 |
|
| 20606 |
_createClass(Bold, [{ |
| 20607 |
key: 'optimize', |
| 20608 |
value: function optimize(context) { |
| 20609 |
_get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context); |
| 20610 |
if (this.domNode.tagName !== this.statics.tagName[0]) { |
| 20611 |
this.replaceWith(this.statics.blotName); |
| 20612 |
} |
| 20613 |
} |
| 20614 |
}], [{ |
| 20615 |
key: 'create', |
| 20616 |
value: function create() { |
| 20617 |
return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this); |
| 20618 |
} |
| 20619 |
}, { |
| 20620 |
key: 'formats', |
| 20621 |
value: function formats() { |
| 20622 |
return true; |
| 20623 |
} |
| 20624 |
}]); |
| 20625 |
|
| 20626 |
return Bold; |
| 20627 |
}(_inline2.default); |
| 20628 |
|
| 20629 |
Bold.blotName = 'bold'; |
| 20630 |
Bold.tagName = ['STRONG', 'B']; |
| 20631 |
|
| 20632 |
exports.default = Bold; |
| 20633 |
|
| 20634 |
/***/ }), |
| 20635 |
/* 57 */ |
| 20636 |
/***/ (function(module, exports, __nested_webpack_require_336502__) { |
| 20637 |
|
| 20638 |
"use strict"; |
| 20639 |
|
| 20640 |
|
| 20641 |
Object.defineProperty(exports, "__esModule", { |
| 20642 |
value: true |
| 20643 |
}); |
| 20644 |
exports.addControls = exports.default = undefined; |
| 20645 |
|
| 20646 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 20647 |
|
| 20648 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 20649 |
|
| 20650 |
var _quillDelta = __nested_webpack_require_336502__(2); |
| 20651 |
|
| 20652 |
var _quillDelta2 = _interopRequireDefault(_quillDelta); |
| 20653 |
|
| 20654 |
var _parchment = __nested_webpack_require_336502__(0); |
| 20655 |
|
| 20656 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 20657 |
|
| 20658 |
var _quill = __nested_webpack_require_336502__(5); |
| 20659 |
|
| 20660 |
var _quill2 = _interopRequireDefault(_quill); |
| 20661 |
|
| 20662 |
var _logger = __nested_webpack_require_336502__(10); |
| 20663 |
|
| 20664 |
var _logger2 = _interopRequireDefault(_logger); |
| 20665 |
|
| 20666 |
var _module = __nested_webpack_require_336502__(9); |
| 20667 |
|
| 20668 |
var _module2 = _interopRequireDefault(_module); |
| 20669 |
|
| 20670 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 20671 |
|
| 20672 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 20673 |
|
| 20674 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 20675 |
|
| 20676 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 20677 |
|
| 20678 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 20679 |
|
| 20680 |
var debug = (0, _logger2.default)('quill:toolbar'); |
| 20681 |
|
| 20682 |
var Toolbar = function (_Module) { |
| 20683 |
_inherits(Toolbar, _Module); |
| 20684 |
|
| 20685 |
function Toolbar(quill, options) { |
| 20686 |
_classCallCheck(this, Toolbar); |
| 20687 |
|
| 20688 |
var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options)); |
| 20689 |
|
| 20690 |
if (Array.isArray(_this.options.container)) { |
| 20691 |
var container = document.createElement('div'); |
| 20692 |
addControls(container, _this.options.container); |
| 20693 |
quill.container.parentNode.insertBefore(container, quill.container); |
| 20694 |
_this.container = container; |
| 20695 |
} else if (typeof _this.options.container === 'string') { |
| 20696 |
_this.container = document.querySelector(_this.options.container); |
| 20697 |
} else { |
| 20698 |
_this.container = _this.options.container; |
| 20699 |
} |
| 20700 |
if (!(_this.container instanceof HTMLElement)) { |
| 20701 |
var _ret; |
| 20702 |
|
| 20703 |
return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret); |
| 20704 |
} |
| 20705 |
_this.container.classList.add('ql-toolbar'); |
| 20706 |
_this.controls = []; |
| 20707 |
_this.handlers = {}; |
| 20708 |
Object.keys(_this.options.handlers).forEach(function (format) { |
| 20709 |
_this.addHandler(format, _this.options.handlers[format]); |
| 20710 |
}); |
| 20711 |
[].forEach.call(_this.container.querySelectorAll('button, select'), function (input) { |
| 20712 |
_this.attach(input); |
| 20713 |
}); |
| 20714 |
_this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) { |
| 20715 |
if (type === _quill2.default.events.SELECTION_CHANGE) { |
| 20716 |
_this.update(range); |
| 20717 |
} |
| 20718 |
}); |
| 20719 |
_this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { |
| 20720 |
var _this$quill$selection = _this.quill.selection.getRange(), |
| 20721 |
_this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), |
| 20722 |
range = _this$quill$selection2[0]; // quill.getSelection triggers update |
| 20723 |
|
| 20724 |
|
| 20725 |
_this.update(range); |
| 20726 |
}); |
| 20727 |
return _this; |
| 20728 |
} |
| 20729 |
|
| 20730 |
_createClass(Toolbar, [{ |
| 20731 |
key: 'addHandler', |
| 20732 |
value: function addHandler(format, handler) { |
| 20733 |
this.handlers[format] = handler; |
| 20734 |
} |
| 20735 |
}, { |
| 20736 |
key: 'attach', |
| 20737 |
value: function attach(input) { |
| 20738 |
var _this2 = this; |
| 20739 |
|
| 20740 |
var format = [].find.call(input.classList, function (className) { |
| 20741 |
return className.indexOf('ql-') === 0; |
| 20742 |
}); |
| 20743 |
if (!format) return; |
| 20744 |
format = format.slice('ql-'.length); |
| 20745 |
if (input.tagName === 'BUTTON') { |
| 20746 |
input.setAttribute('type', 'button'); |
| 20747 |
} |
| 20748 |
if (this.handlers[format] == null) { |
| 20749 |
if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { |
| 20750 |
debug.warn('ignoring attaching to disabled format', format, input); |
| 20751 |
return; |
| 20752 |
} |
| 20753 |
if (_parchment2.default.query(format) == null) { |
| 20754 |
debug.warn('ignoring attaching to nonexistent format', format, input); |
| 20755 |
return; |
| 20756 |
} |
| 20757 |
} |
| 20758 |
var eventName = input.tagName === 'SELECT' ? 'change' : 'click'; |
| 20759 |
input.addEventListener(eventName, function (e) { |
| 20760 |
var value = void 0; |
| 20761 |
if (input.tagName === 'SELECT') { |
| 20762 |
if (input.selectedIndex < 0) return; |
| 20763 |
var selected = input.options[input.selectedIndex]; |
| 20764 |
if (selected.hasAttribute('selected')) { |
| 20765 |
value = false; |
| 20766 |
} else { |
| 20767 |
value = selected.value || false; |
| 20768 |
} |
| 20769 |
} else { |
| 20770 |
if (input.classList.contains('ql-active')) { |
| 20771 |
value = false; |
| 20772 |
} else { |
| 20773 |
value = input.value || !input.hasAttribute('value'); |
| 20774 |
} |
| 20775 |
e.preventDefault(); |
| 20776 |
} |
| 20777 |
_this2.quill.focus(); |
| 20778 |
|
| 20779 |
var _quill$selection$getR = _this2.quill.selection.getRange(), |
| 20780 |
_quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), |
| 20781 |
range = _quill$selection$getR2[0]; |
| 20782 |
|
| 20783 |
if (_this2.handlers[format] != null) { |
| 20784 |
_this2.handlers[format].call(_this2, value); |
| 20785 |
} else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) { |
| 20786 |
value = prompt('Enter ' + format); |
| 20787 |
if (!value) return; |
| 20788 |
_this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER); |
| 20789 |
} else { |
| 20790 |
_this2.quill.format(format, value, _quill2.default.sources.USER); |
| 20791 |
} |
| 20792 |
_this2.update(range); |
| 20793 |
}); |
| 20794 |
// TODO use weakmap |
| 20795 |
this.controls.push([format, input]); |
| 20796 |
} |
| 20797 |
}, { |
| 20798 |
key: 'update', |
| 20799 |
value: function update(range) { |
| 20800 |
var formats = range == null ? {} : this.quill.getFormat(range); |
| 20801 |
this.controls.forEach(function (pair) { |
| 20802 |
var _pair = _slicedToArray(pair, 2), |
| 20803 |
format = _pair[0], |
| 20804 |
input = _pair[1]; |
| 20805 |
|
| 20806 |
if (input.tagName === 'SELECT') { |
| 20807 |
var option = void 0; |
| 20808 |
if (range == null) { |
| 20809 |
option = null; |
| 20810 |
} else if (formats[format] == null) { |
| 20811 |
option = input.querySelector('option[selected]'); |
| 20812 |
} else if (!Array.isArray(formats[format])) { |
| 20813 |
var value = formats[format]; |
| 20814 |
if (typeof value === 'string') { |
| 20815 |
value = value.replace(/\"/g, '\\"'); |
| 20816 |
} |
| 20817 |
option = input.querySelector('option[value="' + value + '"]'); |
| 20818 |
} |
| 20819 |
if (option == null) { |
| 20820 |
input.value = ''; // TODO make configurable? |
| 20821 |
input.selectedIndex = -1; |
| 20822 |
} else { |
| 20823 |
option.selected = true; |
| 20824 |
} |
| 20825 |
} else { |
| 20826 |
if (range == null) { |
| 20827 |
input.classList.remove('ql-active'); |
| 20828 |
} else if (input.hasAttribute('value')) { |
| 20829 |
// both being null should match (default values) |
| 20830 |
// '1' should match with 1 (headers) |
| 20831 |
var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value'); |
| 20832 |
input.classList.toggle('ql-active', isActive); |
| 20833 |
} else { |
| 20834 |
input.classList.toggle('ql-active', formats[format] != null); |
| 20835 |
} |
| 20836 |
} |
| 20837 |
}); |
| 20838 |
} |
| 20839 |
}]); |
| 20840 |
|
| 20841 |
return Toolbar; |
| 20842 |
}(_module2.default); |
| 20843 |
|
| 20844 |
Toolbar.DEFAULTS = {}; |
| 20845 |
|
| 20846 |
function addButton(container, format, value) { |
| 20847 |
var input = document.createElement('button'); |
| 20848 |
input.setAttribute('type', 'button'); |
| 20849 |
input.classList.add('ql-' + format); |
| 20850 |
if (value != null) { |
| 20851 |
input.value = value; |
| 20852 |
} |
| 20853 |
container.appendChild(input); |
| 20854 |
} |
| 20855 |
|
| 20856 |
function addControls(container, groups) { |
| 20857 |
if (!Array.isArray(groups[0])) { |
| 20858 |
groups = [groups]; |
| 20859 |
} |
| 20860 |
groups.forEach(function (controls) { |
| 20861 |
var group = document.createElement('span'); |
| 20862 |
group.classList.add('ql-formats'); |
| 20863 |
controls.forEach(function (control) { |
| 20864 |
if (typeof control === 'string') { |
| 20865 |
addButton(group, control); |
| 20866 |
} else { |
| 20867 |
var format = Object.keys(control)[0]; |
| 20868 |
var value = control[format]; |
| 20869 |
if (Array.isArray(value)) { |
| 20870 |
addSelect(group, format, value); |
| 20871 |
} else { |
| 20872 |
addButton(group, format, value); |
| 20873 |
} |
| 20874 |
} |
| 20875 |
}); |
| 20876 |
container.appendChild(group); |
| 20877 |
}); |
| 20878 |
} |
| 20879 |
|
| 20880 |
function addSelect(container, format, values) { |
| 20881 |
var input = document.createElement('select'); |
| 20882 |
input.classList.add('ql-' + format); |
| 20883 |
values.forEach(function (value) { |
| 20884 |
var option = document.createElement('option'); |
| 20885 |
if (value !== false) { |
| 20886 |
option.setAttribute('value', value); |
| 20887 |
} else { |
| 20888 |
option.setAttribute('selected', 'selected'); |
| 20889 |
} |
| 20890 |
input.appendChild(option); |
| 20891 |
}); |
| 20892 |
container.appendChild(input); |
| 20893 |
} |
| 20894 |
|
| 20895 |
Toolbar.DEFAULTS = { |
| 20896 |
container: null, |
| 20897 |
handlers: { |
| 20898 |
clean: function clean() { |
| 20899 |
var _this3 = this; |
| 20900 |
|
| 20901 |
var range = this.quill.getSelection(); |
| 20902 |
if (range == null) return; |
| 20903 |
if (range.length == 0) { |
| 20904 |
var formats = this.quill.getFormat(); |
| 20905 |
Object.keys(formats).forEach(function (name) { |
| 20906 |
// Clean functionality in existing apps only clean inline formats |
| 20907 |
if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) { |
| 20908 |
_this3.quill.format(name, false); |
| 20909 |
} |
| 20910 |
}); |
| 20911 |
} else { |
| 20912 |
this.quill.removeFormat(range, _quill2.default.sources.USER); |
| 20913 |
} |
| 20914 |
}, |
| 20915 |
direction: function direction(value) { |
| 20916 |
var align = this.quill.getFormat()['align']; |
| 20917 |
if (value === 'rtl' && align == null) { |
| 20918 |
this.quill.format('align', 'right', _quill2.default.sources.USER); |
| 20919 |
} else if (!value && align === 'right') { |
| 20920 |
this.quill.format('align', false, _quill2.default.sources.USER); |
| 20921 |
} |
| 20922 |
this.quill.format('direction', value, _quill2.default.sources.USER); |
| 20923 |
}, |
| 20924 |
indent: function indent(value) { |
| 20925 |
var range = this.quill.getSelection(); |
| 20926 |
var formats = this.quill.getFormat(range); |
| 20927 |
var indent = parseInt(formats.indent || 0); |
| 20928 |
if (value === '+1' || value === '-1') { |
| 20929 |
var modifier = value === '+1' ? 1 : -1; |
| 20930 |
if (formats.direction === 'rtl') modifier *= -1; |
| 20931 |
this.quill.format('indent', indent + modifier, _quill2.default.sources.USER); |
| 20932 |
} |
| 20933 |
}, |
| 20934 |
link: function link(value) { |
| 20935 |
if (value === true) { |
| 20936 |
value = prompt('Enter link URL:'); |
| 20937 |
} |
| 20938 |
this.quill.format('link', value, _quill2.default.sources.USER); |
| 20939 |
}, |
| 20940 |
list: function list(value) { |
| 20941 |
var range = this.quill.getSelection(); |
| 20942 |
var formats = this.quill.getFormat(range); |
| 20943 |
if (value === 'check') { |
| 20944 |
if (formats['list'] === 'checked' || formats['list'] === 'unchecked') { |
| 20945 |
this.quill.format('list', false, _quill2.default.sources.USER); |
| 20946 |
} else { |
| 20947 |
this.quill.format('list', 'unchecked', _quill2.default.sources.USER); |
| 20948 |
} |
| 20949 |
} else { |
| 20950 |
this.quill.format('list', value, _quill2.default.sources.USER); |
| 20951 |
} |
| 20952 |
} |
| 20953 |
} |
| 20954 |
}; |
| 20955 |
|
| 20956 |
exports.default = Toolbar; |
| 20957 |
exports.addControls = addControls; |
| 20958 |
|
| 20959 |
/***/ }), |
| 20960 |
/* 58 */ |
| 20961 |
/***/ (function(module, exports) { |
| 20962 |
|
| 20963 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <polyline class=\"ql-even ql-stroke\" points=\"5 7 3 9 5 11\"></polyline> <polyline class=\"ql-even ql-stroke\" points=\"13 7 15 9 13 11\"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>"; |
| 20964 |
|
| 20965 |
/***/ }), |
| 20966 |
/* 59 */ |
| 20967 |
/***/ (function(module, exports, __nested_webpack_require_349781__) { |
| 20968 |
|
| 20969 |
"use strict"; |
| 20970 |
|
| 20971 |
|
| 20972 |
Object.defineProperty(exports, "__esModule", { |
| 20973 |
value: true |
| 20974 |
}); |
| 20975 |
|
| 20976 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 20977 |
|
| 20978 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 20979 |
|
| 20980 |
var _picker = __nested_webpack_require_349781__(28); |
| 20981 |
|
| 20982 |
var _picker2 = _interopRequireDefault(_picker); |
| 20983 |
|
| 20984 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 20985 |
|
| 20986 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 20987 |
|
| 20988 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 20989 |
|
| 20990 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 20991 |
|
| 20992 |
var ColorPicker = function (_Picker) { |
| 20993 |
_inherits(ColorPicker, _Picker); |
| 20994 |
|
| 20995 |
function ColorPicker(select, label) { |
| 20996 |
_classCallCheck(this, ColorPicker); |
| 20997 |
|
| 20998 |
var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select)); |
| 20999 |
|
| 21000 |
_this.label.innerHTML = label; |
| 21001 |
_this.container.classList.add('ql-color-picker'); |
| 21002 |
[].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) { |
| 21003 |
item.classList.add('ql-primary'); |
| 21004 |
}); |
| 21005 |
return _this; |
| 21006 |
} |
| 21007 |
|
| 21008 |
_createClass(ColorPicker, [{ |
| 21009 |
key: 'buildItem', |
| 21010 |
value: function buildItem(option) { |
| 21011 |
var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option); |
| 21012 |
item.style.backgroundColor = option.getAttribute('value') || ''; |
| 21013 |
return item; |
| 21014 |
} |
| 21015 |
}, { |
| 21016 |
key: 'selectItem', |
| 21017 |
value: function selectItem(item, trigger) { |
| 21018 |
_get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger); |
| 21019 |
var colorLabel = this.label.querySelector('.ql-color-label'); |
| 21020 |
var value = item ? item.getAttribute('data-value') || '' : ''; |
| 21021 |
if (colorLabel) { |
| 21022 |
if (colorLabel.tagName === 'line') { |
| 21023 |
colorLabel.style.stroke = value; |
| 21024 |
} else { |
| 21025 |
colorLabel.style.fill = value; |
| 21026 |
} |
| 21027 |
} |
| 21028 |
} |
| 21029 |
}]); |
| 21030 |
|
| 21031 |
return ColorPicker; |
| 21032 |
}(_picker2.default); |
| 21033 |
|
| 21034 |
exports.default = ColorPicker; |
| 21035 |
|
| 21036 |
/***/ }), |
| 21037 |
/* 60 */ |
| 21038 |
/***/ (function(module, exports, __nested_webpack_require_353592__) { |
| 21039 |
|
| 21040 |
"use strict"; |
| 21041 |
|
| 21042 |
|
| 21043 |
Object.defineProperty(exports, "__esModule", { |
| 21044 |
value: true |
| 21045 |
}); |
| 21046 |
|
| 21047 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 21048 |
|
| 21049 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 21050 |
|
| 21051 |
var _picker = __nested_webpack_require_353592__(28); |
| 21052 |
|
| 21053 |
var _picker2 = _interopRequireDefault(_picker); |
| 21054 |
|
| 21055 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 21056 |
|
| 21057 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 21058 |
|
| 21059 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 21060 |
|
| 21061 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 21062 |
|
| 21063 |
var IconPicker = function (_Picker) { |
| 21064 |
_inherits(IconPicker, _Picker); |
| 21065 |
|
| 21066 |
function IconPicker(select, icons) { |
| 21067 |
_classCallCheck(this, IconPicker); |
| 21068 |
|
| 21069 |
var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select)); |
| 21070 |
|
| 21071 |
_this.container.classList.add('ql-icon-picker'); |
| 21072 |
[].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) { |
| 21073 |
item.innerHTML = icons[item.getAttribute('data-value') || '']; |
| 21074 |
}); |
| 21075 |
_this.defaultItem = _this.container.querySelector('.ql-selected'); |
| 21076 |
_this.selectItem(_this.defaultItem); |
| 21077 |
return _this; |
| 21078 |
} |
| 21079 |
|
| 21080 |
_createClass(IconPicker, [{ |
| 21081 |
key: 'selectItem', |
| 21082 |
value: function selectItem(item, trigger) { |
| 21083 |
_get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger); |
| 21084 |
item = item || this.defaultItem; |
| 21085 |
this.label.innerHTML = item.innerHTML; |
| 21086 |
} |
| 21087 |
}]); |
| 21088 |
|
| 21089 |
return IconPicker; |
| 21090 |
}(_picker2.default); |
| 21091 |
|
| 21092 |
exports.default = IconPicker; |
| 21093 |
|
| 21094 |
/***/ }), |
| 21095 |
/* 61 */ |
| 21096 |
/***/ (function(module, exports, __webpack_require__) { |
| 21097 |
|
| 21098 |
"use strict"; |
| 21099 |
|
| 21100 |
|
| 21101 |
Object.defineProperty(exports, "__esModule", { |
| 21102 |
value: true |
| 21103 |
}); |
| 21104 |
|
| 21105 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 21106 |
|
| 21107 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 21108 |
|
| 21109 |
var Tooltip = function () { |
| 21110 |
function Tooltip(quill, boundsContainer) { |
| 21111 |
var _this = this; |
| 21112 |
|
| 21113 |
_classCallCheck(this, Tooltip); |
| 21114 |
|
| 21115 |
this.quill = quill; |
| 21116 |
this.boundsContainer = boundsContainer || document.body; |
| 21117 |
this.root = quill.addContainer('ql-tooltip'); |
| 21118 |
this.root.innerHTML = this.constructor.TEMPLATE; |
| 21119 |
if (this.quill.root === this.quill.scrollingContainer) { |
| 21120 |
this.quill.root.addEventListener('scroll', function () { |
| 21121 |
_this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px'; |
| 21122 |
}); |
| 21123 |
} |
| 21124 |
this.hide(); |
| 21125 |
} |
| 21126 |
|
| 21127 |
_createClass(Tooltip, [{ |
| 21128 |
key: 'hide', |
| 21129 |
value: function hide() { |
| 21130 |
this.root.classList.add('ql-hidden'); |
| 21131 |
} |
| 21132 |
}, { |
| 21133 |
key: 'position', |
| 21134 |
value: function position(reference) { |
| 21135 |
var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; |
| 21136 |
// root.scrollTop should be 0 if scrollContainer !== root |
| 21137 |
var top = reference.bottom + this.quill.root.scrollTop; |
| 21138 |
this.root.style.left = left + 'px'; |
| 21139 |
this.root.style.top = top + 'px'; |
| 21140 |
this.root.classList.remove('ql-flip'); |
| 21141 |
var containerBounds = this.boundsContainer.getBoundingClientRect(); |
| 21142 |
var rootBounds = this.root.getBoundingClientRect(); |
| 21143 |
var shift = 0; |
| 21144 |
if (rootBounds.right > containerBounds.right) { |
| 21145 |
shift = containerBounds.right - rootBounds.right; |
| 21146 |
this.root.style.left = left + shift + 'px'; |
| 21147 |
} |
| 21148 |
if (rootBounds.left < containerBounds.left) { |
| 21149 |
shift = containerBounds.left - rootBounds.left; |
| 21150 |
this.root.style.left = left + shift + 'px'; |
| 21151 |
} |
| 21152 |
if (rootBounds.bottom > containerBounds.bottom) { |
| 21153 |
var height = rootBounds.bottom - rootBounds.top; |
| 21154 |
var verticalShift = reference.bottom - reference.top + height; |
| 21155 |
this.root.style.top = top - verticalShift + 'px'; |
| 21156 |
this.root.classList.add('ql-flip'); |
| 21157 |
} |
| 21158 |
return shift; |
| 21159 |
} |
| 21160 |
}, { |
| 21161 |
key: 'show', |
| 21162 |
value: function show() { |
| 21163 |
this.root.classList.remove('ql-editing'); |
| 21164 |
this.root.classList.remove('ql-hidden'); |
| 21165 |
} |
| 21166 |
}]); |
| 21167 |
|
| 21168 |
return Tooltip; |
| 21169 |
}(); |
| 21170 |
|
| 21171 |
exports.default = Tooltip; |
| 21172 |
|
| 21173 |
/***/ }), |
| 21174 |
/* 62 */ |
| 21175 |
/***/ (function(module, exports, __nested_webpack_require_359932__) { |
| 21176 |
|
| 21177 |
"use strict"; |
| 21178 |
|
| 21179 |
|
| 21180 |
Object.defineProperty(exports, "__esModule", { |
| 21181 |
value: true |
| 21182 |
}); |
| 21183 |
|
| 21184 |
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
| 21185 |
|
| 21186 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 21187 |
|
| 21188 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 21189 |
|
| 21190 |
var _extend = __nested_webpack_require_359932__(3); |
| 21191 |
|
| 21192 |
var _extend2 = _interopRequireDefault(_extend); |
| 21193 |
|
| 21194 |
var _emitter = __nested_webpack_require_359932__(8); |
| 21195 |
|
| 21196 |
var _emitter2 = _interopRequireDefault(_emitter); |
| 21197 |
|
| 21198 |
var _base = __nested_webpack_require_359932__(43); |
| 21199 |
|
| 21200 |
var _base2 = _interopRequireDefault(_base); |
| 21201 |
|
| 21202 |
var _link = __nested_webpack_require_359932__(27); |
| 21203 |
|
| 21204 |
var _link2 = _interopRequireDefault(_link); |
| 21205 |
|
| 21206 |
var _selection = __nested_webpack_require_359932__(15); |
| 21207 |
|
| 21208 |
var _icons = __nested_webpack_require_359932__(41); |
| 21209 |
|
| 21210 |
var _icons2 = _interopRequireDefault(_icons); |
| 21211 |
|
| 21212 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 21213 |
|
| 21214 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 21215 |
|
| 21216 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 21217 |
|
| 21218 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 21219 |
|
| 21220 |
var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']]; |
| 21221 |
|
| 21222 |
var SnowTheme = function (_BaseTheme) { |
| 21223 |
_inherits(SnowTheme, _BaseTheme); |
| 21224 |
|
| 21225 |
function SnowTheme(quill, options) { |
| 21226 |
_classCallCheck(this, SnowTheme); |
| 21227 |
|
| 21228 |
if (options.modules.toolbar != null && options.modules.toolbar.container == null) { |
| 21229 |
options.modules.toolbar.container = TOOLBAR_CONFIG; |
| 21230 |
} |
| 21231 |
|
| 21232 |
var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options)); |
| 21233 |
|
| 21234 |
_this.quill.container.classList.add('ql-snow'); |
| 21235 |
return _this; |
| 21236 |
} |
| 21237 |
|
| 21238 |
_createClass(SnowTheme, [{ |
| 21239 |
key: 'extendToolbar', |
| 21240 |
value: function extendToolbar(toolbar) { |
| 21241 |
toolbar.container.classList.add('ql-snow'); |
| 21242 |
this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); |
| 21243 |
this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); |
| 21244 |
this.tooltip = new SnowTooltip(this.quill, this.options.bounds); |
| 21245 |
if (toolbar.container.querySelector('.ql-link')) { |
| 21246 |
this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) { |
| 21247 |
toolbar.handlers['link'].call(toolbar, !context.format.link); |
| 21248 |
}); |
| 21249 |
} |
| 21250 |
} |
| 21251 |
}]); |
| 21252 |
|
| 21253 |
return SnowTheme; |
| 21254 |
}(_base2.default); |
| 21255 |
|
| 21256 |
SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { |
| 21257 |
modules: { |
| 21258 |
toolbar: { |
| 21259 |
handlers: { |
| 21260 |
link: function link(value) { |
| 21261 |
if (value) { |
| 21262 |
var range = this.quill.getSelection(); |
| 21263 |
if (range == null || range.length == 0) return; |
| 21264 |
var preview = this.quill.getText(range); |
| 21265 |
if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) { |
| 21266 |
preview = 'mailto:' + preview; |
| 21267 |
} |
| 21268 |
var tooltip = this.quill.theme.tooltip; |
| 21269 |
tooltip.edit('link', preview); |
| 21270 |
} else { |
| 21271 |
this.quill.format('link', false); |
| 21272 |
} |
| 21273 |
} |
| 21274 |
} |
| 21275 |
} |
| 21276 |
} |
| 21277 |
}); |
| 21278 |
|
| 21279 |
var SnowTooltip = function (_BaseTooltip) { |
| 21280 |
_inherits(SnowTooltip, _BaseTooltip); |
| 21281 |
|
| 21282 |
function SnowTooltip(quill, bounds) { |
| 21283 |
_classCallCheck(this, SnowTooltip); |
| 21284 |
|
| 21285 |
var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds)); |
| 21286 |
|
| 21287 |
_this2.preview = _this2.root.querySelector('a.ql-preview'); |
| 21288 |
return _this2; |
| 21289 |
} |
| 21290 |
|
| 21291 |
_createClass(SnowTooltip, [{ |
| 21292 |
key: 'listen', |
| 21293 |
value: function listen() { |
| 21294 |
var _this3 = this; |
| 21295 |
|
| 21296 |
_get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this); |
| 21297 |
this.root.querySelector('a.ql-action').addEventListener('click', function (event) { |
| 21298 |
if (_this3.root.classList.contains('ql-editing')) { |
| 21299 |
_this3.save(); |
| 21300 |
} else { |
| 21301 |
_this3.edit('link', _this3.preview.textContent); |
| 21302 |
} |
| 21303 |
event.preventDefault(); |
| 21304 |
}); |
| 21305 |
this.root.querySelector('a.ql-remove').addEventListener('click', function (event) { |
| 21306 |
if (_this3.linkRange != null) { |
| 21307 |
var range = _this3.linkRange; |
| 21308 |
_this3.restoreFocus(); |
| 21309 |
_this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER); |
| 21310 |
delete _this3.linkRange; |
| 21311 |
} |
| 21312 |
event.preventDefault(); |
| 21313 |
_this3.hide(); |
| 21314 |
}); |
| 21315 |
this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) { |
| 21316 |
if (range == null) return; |
| 21317 |
if (range.length === 0 && source === _emitter2.default.sources.USER) { |
| 21318 |
var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), |
| 21319 |
_quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), |
| 21320 |
link = _quill$scroll$descend2[0], |
| 21321 |
offset = _quill$scroll$descend2[1]; |
| 21322 |
|
| 21323 |
if (link != null) { |
| 21324 |
_this3.linkRange = new _selection.Range(range.index - offset, link.length()); |
| 21325 |
var preview = _link2.default.formats(link.domNode); |
| 21326 |
_this3.preview.textContent = preview; |
| 21327 |
_this3.preview.setAttribute('href', preview); |
| 21328 |
_this3.show(); |
| 21329 |
_this3.position(_this3.quill.getBounds(_this3.linkRange)); |
| 21330 |
return; |
| 21331 |
} |
| 21332 |
} else { |
| 21333 |
delete _this3.linkRange; |
| 21334 |
} |
| 21335 |
_this3.hide(); |
| 21336 |
}); |
| 21337 |
} |
| 21338 |
}, { |
| 21339 |
key: 'show', |
| 21340 |
value: function show() { |
| 21341 |
_get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this); |
| 21342 |
this.root.removeAttribute('data-mode'); |
| 21343 |
} |
| 21344 |
}]); |
| 21345 |
|
| 21346 |
return SnowTooltip; |
| 21347 |
}(_base.BaseTooltip); |
| 21348 |
|
| 21349 |
SnowTooltip.TEMPLATE = ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join(''); |
| 21350 |
|
| 21351 |
exports.default = SnowTheme; |
| 21352 |
|
| 21353 |
/***/ }), |
| 21354 |
/* 63 */ |
| 21355 |
/***/ (function(module, exports, __nested_webpack_require_368316__) { |
| 21356 |
|
| 21357 |
"use strict"; |
| 21358 |
|
| 21359 |
|
| 21360 |
Object.defineProperty(exports, "__esModule", { |
| 21361 |
value: true |
| 21362 |
}); |
| 21363 |
|
| 21364 |
var _core = __nested_webpack_require_368316__(29); |
| 21365 |
|
| 21366 |
var _core2 = _interopRequireDefault(_core); |
| 21367 |
|
| 21368 |
var _align = __nested_webpack_require_368316__(36); |
| 21369 |
|
| 21370 |
var _direction = __nested_webpack_require_368316__(38); |
| 21371 |
|
| 21372 |
var _indent = __nested_webpack_require_368316__(64); |
| 21373 |
|
| 21374 |
var _blockquote = __nested_webpack_require_368316__(65); |
| 21375 |
|
| 21376 |
var _blockquote2 = _interopRequireDefault(_blockquote); |
| 21377 |
|
| 21378 |
var _header = __nested_webpack_require_368316__(66); |
| 21379 |
|
| 21380 |
var _header2 = _interopRequireDefault(_header); |
| 21381 |
|
| 21382 |
var _list = __nested_webpack_require_368316__(67); |
| 21383 |
|
| 21384 |
var _list2 = _interopRequireDefault(_list); |
| 21385 |
|
| 21386 |
var _background = __nested_webpack_require_368316__(37); |
| 21387 |
|
| 21388 |
var _color = __nested_webpack_require_368316__(26); |
| 21389 |
|
| 21390 |
var _font = __nested_webpack_require_368316__(39); |
| 21391 |
|
| 21392 |
var _size = __nested_webpack_require_368316__(40); |
| 21393 |
|
| 21394 |
var _bold = __nested_webpack_require_368316__(56); |
| 21395 |
|
| 21396 |
var _bold2 = _interopRequireDefault(_bold); |
| 21397 |
|
| 21398 |
var _italic = __nested_webpack_require_368316__(68); |
| 21399 |
|
| 21400 |
var _italic2 = _interopRequireDefault(_italic); |
| 21401 |
|
| 21402 |
var _link = __nested_webpack_require_368316__(27); |
| 21403 |
|
| 21404 |
var _link2 = _interopRequireDefault(_link); |
| 21405 |
|
| 21406 |
var _script = __nested_webpack_require_368316__(69); |
| 21407 |
|
| 21408 |
var _script2 = _interopRequireDefault(_script); |
| 21409 |
|
| 21410 |
var _strike = __nested_webpack_require_368316__(70); |
| 21411 |
|
| 21412 |
var _strike2 = _interopRequireDefault(_strike); |
| 21413 |
|
| 21414 |
var _underline = __nested_webpack_require_368316__(71); |
| 21415 |
|
| 21416 |
var _underline2 = _interopRequireDefault(_underline); |
| 21417 |
|
| 21418 |
var _image = __nested_webpack_require_368316__(72); |
| 21419 |
|
| 21420 |
var _image2 = _interopRequireDefault(_image); |
| 21421 |
|
| 21422 |
var _video = __nested_webpack_require_368316__(73); |
| 21423 |
|
| 21424 |
var _video2 = _interopRequireDefault(_video); |
| 21425 |
|
| 21426 |
var _code = __nested_webpack_require_368316__(13); |
| 21427 |
|
| 21428 |
var _code2 = _interopRequireDefault(_code); |
| 21429 |
|
| 21430 |
var _formula = __nested_webpack_require_368316__(74); |
| 21431 |
|
| 21432 |
var _formula2 = _interopRequireDefault(_formula); |
| 21433 |
|
| 21434 |
var _syntax = __nested_webpack_require_368316__(75); |
| 21435 |
|
| 21436 |
var _syntax2 = _interopRequireDefault(_syntax); |
| 21437 |
|
| 21438 |
var _toolbar = __nested_webpack_require_368316__(57); |
| 21439 |
|
| 21440 |
var _toolbar2 = _interopRequireDefault(_toolbar); |
| 21441 |
|
| 21442 |
var _icons = __nested_webpack_require_368316__(41); |
| 21443 |
|
| 21444 |
var _icons2 = _interopRequireDefault(_icons); |
| 21445 |
|
| 21446 |
var _picker = __nested_webpack_require_368316__(28); |
| 21447 |
|
| 21448 |
var _picker2 = _interopRequireDefault(_picker); |
| 21449 |
|
| 21450 |
var _colorPicker = __nested_webpack_require_368316__(59); |
| 21451 |
|
| 21452 |
var _colorPicker2 = _interopRequireDefault(_colorPicker); |
| 21453 |
|
| 21454 |
var _iconPicker = __nested_webpack_require_368316__(60); |
| 21455 |
|
| 21456 |
var _iconPicker2 = _interopRequireDefault(_iconPicker); |
| 21457 |
|
| 21458 |
var _tooltip = __nested_webpack_require_368316__(61); |
| 21459 |
|
| 21460 |
var _tooltip2 = _interopRequireDefault(_tooltip); |
| 21461 |
|
| 21462 |
var _bubble = __nested_webpack_require_368316__(108); |
| 21463 |
|
| 21464 |
var _bubble2 = _interopRequireDefault(_bubble); |
| 21465 |
|
| 21466 |
var _snow = __nested_webpack_require_368316__(62); |
| 21467 |
|
| 21468 |
var _snow2 = _interopRequireDefault(_snow); |
| 21469 |
|
| 21470 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 21471 |
|
| 21472 |
_core2.default.register({ |
| 21473 |
'attributors/attribute/direction': _direction.DirectionAttribute, |
| 21474 |
|
| 21475 |
'attributors/class/align': _align.AlignClass, |
| 21476 |
'attributors/class/background': _background.BackgroundClass, |
| 21477 |
'attributors/class/color': _color.ColorClass, |
| 21478 |
'attributors/class/direction': _direction.DirectionClass, |
| 21479 |
'attributors/class/font': _font.FontClass, |
| 21480 |
'attributors/class/size': _size.SizeClass, |
| 21481 |
|
| 21482 |
'attributors/style/align': _align.AlignStyle, |
| 21483 |
'attributors/style/background': _background.BackgroundStyle, |
| 21484 |
'attributors/style/color': _color.ColorStyle, |
| 21485 |
'attributors/style/direction': _direction.DirectionStyle, |
| 21486 |
'attributors/style/font': _font.FontStyle, |
| 21487 |
'attributors/style/size': _size.SizeStyle |
| 21488 |
}, true); |
| 21489 |
|
| 21490 |
_core2.default.register({ |
| 21491 |
'formats/align': _align.AlignClass, |
| 21492 |
'formats/direction': _direction.DirectionClass, |
| 21493 |
'formats/indent': _indent.IndentClass, |
| 21494 |
|
| 21495 |
'formats/background': _background.BackgroundStyle, |
| 21496 |
'formats/color': _color.ColorStyle, |
| 21497 |
'formats/font': _font.FontClass, |
| 21498 |
'formats/size': _size.SizeClass, |
| 21499 |
|
| 21500 |
'formats/blockquote': _blockquote2.default, |
| 21501 |
'formats/code-block': _code2.default, |
| 21502 |
'formats/header': _header2.default, |
| 21503 |
'formats/list': _list2.default, |
| 21504 |
|
| 21505 |
'formats/bold': _bold2.default, |
| 21506 |
'formats/code': _code.Code, |
| 21507 |
'formats/italic': _italic2.default, |
| 21508 |
'formats/link': _link2.default, |
| 21509 |
'formats/script': _script2.default, |
| 21510 |
'formats/strike': _strike2.default, |
| 21511 |
'formats/underline': _underline2.default, |
| 21512 |
|
| 21513 |
'formats/image': _image2.default, |
| 21514 |
'formats/video': _video2.default, |
| 21515 |
|
| 21516 |
'formats/list/item': _list.ListItem, |
| 21517 |
|
| 21518 |
'modules/formula': _formula2.default, |
| 21519 |
'modules/syntax': _syntax2.default, |
| 21520 |
'modules/toolbar': _toolbar2.default, |
| 21521 |
|
| 21522 |
'themes/bubble': _bubble2.default, |
| 21523 |
'themes/snow': _snow2.default, |
| 21524 |
|
| 21525 |
'ui/icons': _icons2.default, |
| 21526 |
'ui/picker': _picker2.default, |
| 21527 |
'ui/icon-picker': _iconPicker2.default, |
| 21528 |
'ui/color-picker': _colorPicker2.default, |
| 21529 |
'ui/tooltip': _tooltip2.default |
| 21530 |
}, true); |
| 21531 |
|
| 21532 |
exports.default = _core2.default; |
| 21533 |
|
| 21534 |
/***/ }), |
| 21535 |
/* 64 */ |
| 21536 |
/***/ (function(module, exports, __nested_webpack_require_372903__) { |
| 21537 |
|
| 21538 |
"use strict"; |
| 21539 |
|
| 21540 |
|
| 21541 |
Object.defineProperty(exports, "__esModule", { |
| 21542 |
value: true |
| 21543 |
}); |
| 21544 |
exports.IndentClass = undefined; |
| 21545 |
|
| 21546 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 21547 |
|
| 21548 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 21549 |
|
| 21550 |
var _parchment = __nested_webpack_require_372903__(0); |
| 21551 |
|
| 21552 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 21553 |
|
| 21554 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 21555 |
|
| 21556 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 21557 |
|
| 21558 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 21559 |
|
| 21560 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 21561 |
|
| 21562 |
var IdentAttributor = function (_Parchment$Attributor) { |
| 21563 |
_inherits(IdentAttributor, _Parchment$Attributor); |
| 21564 |
|
| 21565 |
function IdentAttributor() { |
| 21566 |
_classCallCheck(this, IdentAttributor); |
| 21567 |
|
| 21568 |
return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments)); |
| 21569 |
} |
| 21570 |
|
| 21571 |
_createClass(IdentAttributor, [{ |
| 21572 |
key: 'add', |
| 21573 |
value: function add(node, value) { |
| 21574 |
if (value === '+1' || value === '-1') { |
| 21575 |
var indent = this.value(node) || 0; |
| 21576 |
value = value === '+1' ? indent + 1 : indent - 1; |
| 21577 |
} |
| 21578 |
if (value === 0) { |
| 21579 |
this.remove(node); |
| 21580 |
return true; |
| 21581 |
} else { |
| 21582 |
return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value); |
| 21583 |
} |
| 21584 |
} |
| 21585 |
}, { |
| 21586 |
key: 'canAdd', |
| 21587 |
value: function canAdd(node, value) { |
| 21588 |
return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value)); |
| 21589 |
} |
| 21590 |
}, { |
| 21591 |
key: 'value', |
| 21592 |
value: function value(node) { |
| 21593 |
return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN |
| 21594 |
} |
| 21595 |
}]); |
| 21596 |
|
| 21597 |
return IdentAttributor; |
| 21598 |
}(_parchment2.default.Attributor.Class); |
| 21599 |
|
| 21600 |
var IndentClass = new IdentAttributor('indent', 'ql-indent', { |
| 21601 |
scope: _parchment2.default.Scope.BLOCK, |
| 21602 |
whitelist: [1, 2, 3, 4, 5, 6, 7, 8] |
| 21603 |
}); |
| 21604 |
|
| 21605 |
exports.IndentClass = IndentClass; |
| 21606 |
|
| 21607 |
/***/ }), |
| 21608 |
/* 65 */ |
| 21609 |
/***/ (function(module, exports, __nested_webpack_require_376943__) { |
| 21610 |
|
| 21611 |
"use strict"; |
| 21612 |
|
| 21613 |
|
| 21614 |
Object.defineProperty(exports, "__esModule", { |
| 21615 |
value: true |
| 21616 |
}); |
| 21617 |
|
| 21618 |
var _block = __nested_webpack_require_376943__(4); |
| 21619 |
|
| 21620 |
var _block2 = _interopRequireDefault(_block); |
| 21621 |
|
| 21622 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 21623 |
|
| 21624 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 21625 |
|
| 21626 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 21627 |
|
| 21628 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 21629 |
|
| 21630 |
var Blockquote = function (_Block) { |
| 21631 |
_inherits(Blockquote, _Block); |
| 21632 |
|
| 21633 |
function Blockquote() { |
| 21634 |
_classCallCheck(this, Blockquote); |
| 21635 |
|
| 21636 |
return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments)); |
| 21637 |
} |
| 21638 |
|
| 21639 |
return Blockquote; |
| 21640 |
}(_block2.default); |
| 21641 |
|
| 21642 |
Blockquote.blotName = 'blockquote'; |
| 21643 |
Blockquote.tagName = 'blockquote'; |
| 21644 |
|
| 21645 |
exports.default = Blockquote; |
| 21646 |
|
| 21647 |
/***/ }), |
| 21648 |
/* 66 */ |
| 21649 |
/***/ (function(module, exports, __nested_webpack_require_378592__) { |
| 21650 |
|
| 21651 |
"use strict"; |
| 21652 |
|
| 21653 |
|
| 21654 |
Object.defineProperty(exports, "__esModule", { |
| 21655 |
value: true |
| 21656 |
}); |
| 21657 |
|
| 21658 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 21659 |
|
| 21660 |
var _block = __nested_webpack_require_378592__(4); |
| 21661 |
|
| 21662 |
var _block2 = _interopRequireDefault(_block); |
| 21663 |
|
| 21664 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 21665 |
|
| 21666 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 21667 |
|
| 21668 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 21669 |
|
| 21670 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 21671 |
|
| 21672 |
var Header = function (_Block) { |
| 21673 |
_inherits(Header, _Block); |
| 21674 |
|
| 21675 |
function Header() { |
| 21676 |
_classCallCheck(this, Header); |
| 21677 |
|
| 21678 |
return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); |
| 21679 |
} |
| 21680 |
|
| 21681 |
_createClass(Header, null, [{ |
| 21682 |
key: 'formats', |
| 21683 |
value: function formats(domNode) { |
| 21684 |
return this.tagName.indexOf(domNode.tagName) + 1; |
| 21685 |
} |
| 21686 |
}]); |
| 21687 |
|
| 21688 |
return Header; |
| 21689 |
}(_block2.default); |
| 21690 |
|
| 21691 |
Header.blotName = 'header'; |
| 21692 |
Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; |
| 21693 |
|
| 21694 |
exports.default = Header; |
| 21695 |
|
| 21696 |
/***/ }), |
| 21697 |
/* 67 */ |
| 21698 |
/***/ (function(module, exports, __nested_webpack_require_380948__) { |
| 21699 |
|
| 21700 |
"use strict"; |
| 21701 |
|
| 21702 |
|
| 21703 |
Object.defineProperty(exports, "__esModule", { |
| 21704 |
value: true |
| 21705 |
}); |
| 21706 |
exports.default = exports.ListItem = undefined; |
| 21707 |
|
| 21708 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 21709 |
|
| 21710 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 21711 |
|
| 21712 |
var _parchment = __nested_webpack_require_380948__(0); |
| 21713 |
|
| 21714 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 21715 |
|
| 21716 |
var _block = __nested_webpack_require_380948__(4); |
| 21717 |
|
| 21718 |
var _block2 = _interopRequireDefault(_block); |
| 21719 |
|
| 21720 |
var _container = __nested_webpack_require_380948__(25); |
| 21721 |
|
| 21722 |
var _container2 = _interopRequireDefault(_container); |
| 21723 |
|
| 21724 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 21725 |
|
| 21726 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 21727 |
|
| 21728 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 21729 |
|
| 21730 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 21731 |
|
| 21732 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 21733 |
|
| 21734 |
var ListItem = function (_Block) { |
| 21735 |
_inherits(ListItem, _Block); |
| 21736 |
|
| 21737 |
function ListItem() { |
| 21738 |
_classCallCheck(this, ListItem); |
| 21739 |
|
| 21740 |
return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); |
| 21741 |
} |
| 21742 |
|
| 21743 |
_createClass(ListItem, [{ |
| 21744 |
key: 'format', |
| 21745 |
value: function format(name, value) { |
| 21746 |
if (name === List.blotName && !value) { |
| 21747 |
this.replaceWith(_parchment2.default.create(this.statics.scope)); |
| 21748 |
} else { |
| 21749 |
_get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value); |
| 21750 |
} |
| 21751 |
} |
| 21752 |
}, { |
| 21753 |
key: 'remove', |
| 21754 |
value: function remove() { |
| 21755 |
if (this.prev == null && this.next == null) { |
| 21756 |
this.parent.remove(); |
| 21757 |
} else { |
| 21758 |
_get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this); |
| 21759 |
} |
| 21760 |
} |
| 21761 |
}, { |
| 21762 |
key: 'replaceWith', |
| 21763 |
value: function replaceWith(name, value) { |
| 21764 |
this.parent.isolate(this.offset(this.parent), this.length()); |
| 21765 |
if (name === this.parent.statics.blotName) { |
| 21766 |
this.parent.replaceWith(name, value); |
| 21767 |
return this; |
| 21768 |
} else { |
| 21769 |
this.parent.unwrap(); |
| 21770 |
return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value); |
| 21771 |
} |
| 21772 |
} |
| 21773 |
}], [{ |
| 21774 |
key: 'formats', |
| 21775 |
value: function formats(domNode) { |
| 21776 |
return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode); |
| 21777 |
} |
| 21778 |
}]); |
| 21779 |
|
| 21780 |
return ListItem; |
| 21781 |
}(_block2.default); |
| 21782 |
|
| 21783 |
ListItem.blotName = 'list-item'; |
| 21784 |
ListItem.tagName = 'LI'; |
| 21785 |
|
| 21786 |
var List = function (_Container) { |
| 21787 |
_inherits(List, _Container); |
| 21788 |
|
| 21789 |
_createClass(List, null, [{ |
| 21790 |
key: 'create', |
| 21791 |
value: function create(value) { |
| 21792 |
var tagName = value === 'ordered' ? 'OL' : 'UL'; |
| 21793 |
var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName); |
| 21794 |
if (value === 'checked' || value === 'unchecked') { |
| 21795 |
node.setAttribute('data-checked', value === 'checked'); |
| 21796 |
} |
| 21797 |
return node; |
| 21798 |
} |
| 21799 |
}, { |
| 21800 |
key: 'formats', |
| 21801 |
value: function formats(domNode) { |
| 21802 |
if (domNode.tagName === 'OL') return 'ordered'; |
| 21803 |
if (domNode.tagName === 'UL') { |
| 21804 |
if (domNode.hasAttribute('data-checked')) { |
| 21805 |
return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked'; |
| 21806 |
} else { |
| 21807 |
return 'bullet'; |
| 21808 |
} |
| 21809 |
} |
| 21810 |
return undefined; |
| 21811 |
} |
| 21812 |
}]); |
| 21813 |
|
| 21814 |
function List(domNode) { |
| 21815 |
_classCallCheck(this, List); |
| 21816 |
|
| 21817 |
var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode)); |
| 21818 |
|
| 21819 |
var listEventHandler = function listEventHandler(e) { |
| 21820 |
if (e.target.parentNode !== domNode) return; |
| 21821 |
var format = _this2.statics.formats(domNode); |
| 21822 |
var blot = _parchment2.default.find(e.target); |
| 21823 |
if (format === 'checked') { |
| 21824 |
blot.format('list', 'unchecked'); |
| 21825 |
} else if (format === 'unchecked') { |
| 21826 |
blot.format('list', 'checked'); |
| 21827 |
} |
| 21828 |
}; |
| 21829 |
|
| 21830 |
domNode.addEventListener('touchstart', listEventHandler); |
| 21831 |
domNode.addEventListener('mousedown', listEventHandler); |
| 21832 |
return _this2; |
| 21833 |
} |
| 21834 |
|
| 21835 |
_createClass(List, [{ |
| 21836 |
key: 'format', |
| 21837 |
value: function format(name, value) { |
| 21838 |
if (this.children.length > 0) { |
| 21839 |
this.children.tail.format(name, value); |
| 21840 |
} |
| 21841 |
} |
| 21842 |
}, { |
| 21843 |
key: 'formats', |
| 21844 |
value: function formats() { |
| 21845 |
// We don't inherit from FormatBlot |
| 21846 |
return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); |
| 21847 |
} |
| 21848 |
}, { |
| 21849 |
key: 'insertBefore', |
| 21850 |
value: function insertBefore(blot, ref) { |
| 21851 |
if (blot instanceof ListItem) { |
| 21852 |
_get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref); |
| 21853 |
} else { |
| 21854 |
var index = ref == null ? this.length() : ref.offset(this); |
| 21855 |
var after = this.split(index); |
| 21856 |
after.parent.insertBefore(blot, after); |
| 21857 |
} |
| 21858 |
} |
| 21859 |
}, { |
| 21860 |
key: 'optimize', |
| 21861 |
value: function optimize(context) { |
| 21862 |
_get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context); |
| 21863 |
var next = this.next; |
| 21864 |
if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) { |
| 21865 |
next.moveChildren(this); |
| 21866 |
next.remove(); |
| 21867 |
} |
| 21868 |
} |
| 21869 |
}, { |
| 21870 |
key: 'replace', |
| 21871 |
value: function replace(target) { |
| 21872 |
if (target.statics.blotName !== this.statics.blotName) { |
| 21873 |
var item = _parchment2.default.create(this.statics.defaultChild); |
| 21874 |
target.moveChildren(item); |
| 21875 |
this.appendChild(item); |
| 21876 |
} |
| 21877 |
_get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target); |
| 21878 |
} |
| 21879 |
}]); |
| 21880 |
|
| 21881 |
return List; |
| 21882 |
}(_container2.default); |
| 21883 |
|
| 21884 |
List.blotName = 'list'; |
| 21885 |
List.scope = _parchment2.default.Scope.BLOCK_BLOT; |
| 21886 |
List.tagName = ['OL', 'UL']; |
| 21887 |
List.defaultChild = 'list-item'; |
| 21888 |
List.allowedChildren = [ListItem]; |
| 21889 |
|
| 21890 |
exports.ListItem = ListItem; |
| 21891 |
exports.default = List; |
| 21892 |
|
| 21893 |
/***/ }), |
| 21894 |
/* 68 */ |
| 21895 |
/***/ (function(module, exports, __nested_webpack_require_389000__) { |
| 21896 |
|
| 21897 |
"use strict"; |
| 21898 |
|
| 21899 |
|
| 21900 |
Object.defineProperty(exports, "__esModule", { |
| 21901 |
value: true |
| 21902 |
}); |
| 21903 |
|
| 21904 |
var _bold = __nested_webpack_require_389000__(56); |
| 21905 |
|
| 21906 |
var _bold2 = _interopRequireDefault(_bold); |
| 21907 |
|
| 21908 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 21909 |
|
| 21910 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 21911 |
|
| 21912 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 21913 |
|
| 21914 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 21915 |
|
| 21916 |
var Italic = function (_Bold) { |
| 21917 |
_inherits(Italic, _Bold); |
| 21918 |
|
| 21919 |
function Italic() { |
| 21920 |
_classCallCheck(this, Italic); |
| 21921 |
|
| 21922 |
return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments)); |
| 21923 |
} |
| 21924 |
|
| 21925 |
return Italic; |
| 21926 |
}(_bold2.default); |
| 21927 |
|
| 21928 |
Italic.blotName = 'italic'; |
| 21929 |
Italic.tagName = ['EM', 'I']; |
| 21930 |
|
| 21931 |
exports.default = Italic; |
| 21932 |
|
| 21933 |
/***/ }), |
| 21934 |
/* 69 */ |
| 21935 |
/***/ (function(module, exports, __nested_webpack_require_390599__) { |
| 21936 |
|
| 21937 |
"use strict"; |
| 21938 |
|
| 21939 |
|
| 21940 |
Object.defineProperty(exports, "__esModule", { |
| 21941 |
value: true |
| 21942 |
}); |
| 21943 |
|
| 21944 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 21945 |
|
| 21946 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 21947 |
|
| 21948 |
var _inline = __nested_webpack_require_390599__(6); |
| 21949 |
|
| 21950 |
var _inline2 = _interopRequireDefault(_inline); |
| 21951 |
|
| 21952 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 21953 |
|
| 21954 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 21955 |
|
| 21956 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 21957 |
|
| 21958 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 21959 |
|
| 21960 |
var Script = function (_Inline) { |
| 21961 |
_inherits(Script, _Inline); |
| 21962 |
|
| 21963 |
function Script() { |
| 21964 |
_classCallCheck(this, Script); |
| 21965 |
|
| 21966 |
return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments)); |
| 21967 |
} |
| 21968 |
|
| 21969 |
_createClass(Script, null, [{ |
| 21970 |
key: 'create', |
| 21971 |
value: function create(value) { |
| 21972 |
if (value === 'super') { |
| 21973 |
return document.createElement('sup'); |
| 21974 |
} else if (value === 'sub') { |
| 21975 |
return document.createElement('sub'); |
| 21976 |
} else { |
| 21977 |
return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value); |
| 21978 |
} |
| 21979 |
} |
| 21980 |
}, { |
| 21981 |
key: 'formats', |
| 21982 |
value: function formats(domNode) { |
| 21983 |
if (domNode.tagName === 'SUB') return 'sub'; |
| 21984 |
if (domNode.tagName === 'SUP') return 'super'; |
| 21985 |
return undefined; |
| 21986 |
} |
| 21987 |
}]); |
| 21988 |
|
| 21989 |
return Script; |
| 21990 |
}(_inline2.default); |
| 21991 |
|
| 21992 |
Script.blotName = 'script'; |
| 21993 |
Script.tagName = ['SUB', 'SUP']; |
| 21994 |
|
| 21995 |
exports.default = Script; |
| 21996 |
|
| 21997 |
/***/ }), |
| 21998 |
/* 70 */ |
| 21999 |
/***/ (function(module, exports, __nested_webpack_require_393860__) { |
| 22000 |
|
| 22001 |
"use strict"; |
| 22002 |
|
| 22003 |
|
| 22004 |
Object.defineProperty(exports, "__esModule", { |
| 22005 |
value: true |
| 22006 |
}); |
| 22007 |
|
| 22008 |
var _inline = __nested_webpack_require_393860__(6); |
| 22009 |
|
| 22010 |
var _inline2 = _interopRequireDefault(_inline); |
| 22011 |
|
| 22012 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 22013 |
|
| 22014 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 22015 |
|
| 22016 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 22017 |
|
| 22018 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 22019 |
|
| 22020 |
var Strike = function (_Inline) { |
| 22021 |
_inherits(Strike, _Inline); |
| 22022 |
|
| 22023 |
function Strike() { |
| 22024 |
_classCallCheck(this, Strike); |
| 22025 |
|
| 22026 |
return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments)); |
| 22027 |
} |
| 22028 |
|
| 22029 |
return Strike; |
| 22030 |
}(_inline2.default); |
| 22031 |
|
| 22032 |
Strike.blotName = 'strike'; |
| 22033 |
Strike.tagName = 'S'; |
| 22034 |
|
| 22035 |
exports.default = Strike; |
| 22036 |
|
| 22037 |
/***/ }), |
| 22038 |
/* 71 */ |
| 22039 |
/***/ (function(module, exports, __nested_webpack_require_395462__) { |
| 22040 |
|
| 22041 |
"use strict"; |
| 22042 |
|
| 22043 |
|
| 22044 |
Object.defineProperty(exports, "__esModule", { |
| 22045 |
value: true |
| 22046 |
}); |
| 22047 |
|
| 22048 |
var _inline = __nested_webpack_require_395462__(6); |
| 22049 |
|
| 22050 |
var _inline2 = _interopRequireDefault(_inline); |
| 22051 |
|
| 22052 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 22053 |
|
| 22054 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 22055 |
|
| 22056 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 22057 |
|
| 22058 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 22059 |
|
| 22060 |
var Underline = function (_Inline) { |
| 22061 |
_inherits(Underline, _Inline); |
| 22062 |
|
| 22063 |
function Underline() { |
| 22064 |
_classCallCheck(this, Underline); |
| 22065 |
|
| 22066 |
return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments)); |
| 22067 |
} |
| 22068 |
|
| 22069 |
return Underline; |
| 22070 |
}(_inline2.default); |
| 22071 |
|
| 22072 |
Underline.blotName = 'underline'; |
| 22073 |
Underline.tagName = 'U'; |
| 22074 |
|
| 22075 |
exports.default = Underline; |
| 22076 |
|
| 22077 |
/***/ }), |
| 22078 |
/* 72 */ |
| 22079 |
/***/ (function(module, exports, __nested_webpack_require_397097__) { |
| 22080 |
|
| 22081 |
"use strict"; |
| 22082 |
|
| 22083 |
|
| 22084 |
Object.defineProperty(exports, "__esModule", { |
| 22085 |
value: true |
| 22086 |
}); |
| 22087 |
|
| 22088 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 22089 |
|
| 22090 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 22091 |
|
| 22092 |
var _parchment = __nested_webpack_require_397097__(0); |
| 22093 |
|
| 22094 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 22095 |
|
| 22096 |
var _link = __nested_webpack_require_397097__(27); |
| 22097 |
|
| 22098 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 22099 |
|
| 22100 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 22101 |
|
| 22102 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 22103 |
|
| 22104 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 22105 |
|
| 22106 |
var ATTRIBUTES = ['alt', 'height', 'width']; |
| 22107 |
|
| 22108 |
var Image = function (_Parchment$Embed) { |
| 22109 |
_inherits(Image, _Parchment$Embed); |
| 22110 |
|
| 22111 |
function Image() { |
| 22112 |
_classCallCheck(this, Image); |
| 22113 |
|
| 22114 |
return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments)); |
| 22115 |
} |
| 22116 |
|
| 22117 |
_createClass(Image, [{ |
| 22118 |
key: 'format', |
| 22119 |
value: function format(name, value) { |
| 22120 |
if (ATTRIBUTES.indexOf(name) > -1) { |
| 22121 |
if (value) { |
| 22122 |
this.domNode.setAttribute(name, value); |
| 22123 |
} else { |
| 22124 |
this.domNode.removeAttribute(name); |
| 22125 |
} |
| 22126 |
} else { |
| 22127 |
_get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value); |
| 22128 |
} |
| 22129 |
} |
| 22130 |
}], [{ |
| 22131 |
key: 'create', |
| 22132 |
value: function create(value) { |
| 22133 |
var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value); |
| 22134 |
if (typeof value === 'string') { |
| 22135 |
node.setAttribute('src', this.sanitize(value)); |
| 22136 |
} |
| 22137 |
return node; |
| 22138 |
} |
| 22139 |
}, { |
| 22140 |
key: 'formats', |
| 22141 |
value: function formats(domNode) { |
| 22142 |
return ATTRIBUTES.reduce(function (formats, attribute) { |
| 22143 |
if (domNode.hasAttribute(attribute)) { |
| 22144 |
formats[attribute] = domNode.getAttribute(attribute); |
| 22145 |
} |
| 22146 |
return formats; |
| 22147 |
}, {}); |
| 22148 |
} |
| 22149 |
}, { |
| 22150 |
key: 'match', |
| 22151 |
value: function match(url) { |
| 22152 |
return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url) |
| 22153 |
); |
| 22154 |
} |
| 22155 |
}, { |
| 22156 |
key: 'sanitize', |
| 22157 |
value: function sanitize(url) { |
| 22158 |
return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0'; |
| 22159 |
} |
| 22160 |
}, { |
| 22161 |
key: 'value', |
| 22162 |
value: function value(domNode) { |
| 22163 |
return domNode.getAttribute('src'); |
| 22164 |
} |
| 22165 |
}]); |
| 22166 |
|
| 22167 |
return Image; |
| 22168 |
}(_parchment2.default.Embed); |
| 22169 |
|
| 22170 |
Image.blotName = 'image'; |
| 22171 |
Image.tagName = 'IMG'; |
| 22172 |
|
| 22173 |
exports.default = Image; |
| 22174 |
|
| 22175 |
/***/ }), |
| 22176 |
/* 73 */ |
| 22177 |
/***/ (function(module, exports, __nested_webpack_require_401311__) { |
| 22178 |
|
| 22179 |
"use strict"; |
| 22180 |
|
| 22181 |
|
| 22182 |
Object.defineProperty(exports, "__esModule", { |
| 22183 |
value: true |
| 22184 |
}); |
| 22185 |
|
| 22186 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 22187 |
|
| 22188 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 22189 |
|
| 22190 |
var _block = __nested_webpack_require_401311__(4); |
| 22191 |
|
| 22192 |
var _link = __nested_webpack_require_401311__(27); |
| 22193 |
|
| 22194 |
var _link2 = _interopRequireDefault(_link); |
| 22195 |
|
| 22196 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 22197 |
|
| 22198 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 22199 |
|
| 22200 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 22201 |
|
| 22202 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 22203 |
|
| 22204 |
var ATTRIBUTES = ['height', 'width']; |
| 22205 |
|
| 22206 |
var Video = function (_BlockEmbed) { |
| 22207 |
_inherits(Video, _BlockEmbed); |
| 22208 |
|
| 22209 |
function Video() { |
| 22210 |
_classCallCheck(this, Video); |
| 22211 |
|
| 22212 |
return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments)); |
| 22213 |
} |
| 22214 |
|
| 22215 |
_createClass(Video, [{ |
| 22216 |
key: 'format', |
| 22217 |
value: function format(name, value) { |
| 22218 |
if (ATTRIBUTES.indexOf(name) > -1) { |
| 22219 |
if (value) { |
| 22220 |
this.domNode.setAttribute(name, value); |
| 22221 |
} else { |
| 22222 |
this.domNode.removeAttribute(name); |
| 22223 |
} |
| 22224 |
} else { |
| 22225 |
_get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value); |
| 22226 |
} |
| 22227 |
} |
| 22228 |
}], [{ |
| 22229 |
key: 'create', |
| 22230 |
value: function create(value) { |
| 22231 |
var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value); |
| 22232 |
node.setAttribute('frameborder', '0'); |
| 22233 |
node.setAttribute('allowfullscreen', true); |
| 22234 |
node.setAttribute('src', this.sanitize(value)); |
| 22235 |
return node; |
| 22236 |
} |
| 22237 |
}, { |
| 22238 |
key: 'formats', |
| 22239 |
value: function formats(domNode) { |
| 22240 |
return ATTRIBUTES.reduce(function (formats, attribute) { |
| 22241 |
if (domNode.hasAttribute(attribute)) { |
| 22242 |
formats[attribute] = domNode.getAttribute(attribute); |
| 22243 |
} |
| 22244 |
return formats; |
| 22245 |
}, {}); |
| 22246 |
} |
| 22247 |
}, { |
| 22248 |
key: 'sanitize', |
| 22249 |
value: function sanitize(url) { |
| 22250 |
return _link2.default.sanitize(url); |
| 22251 |
} |
| 22252 |
}, { |
| 22253 |
key: 'value', |
| 22254 |
value: function value(domNode) { |
| 22255 |
return domNode.getAttribute('src'); |
| 22256 |
} |
| 22257 |
}]); |
| 22258 |
|
| 22259 |
return Video; |
| 22260 |
}(_block.BlockEmbed); |
| 22261 |
|
| 22262 |
Video.blotName = 'video'; |
| 22263 |
Video.className = 'ql-video'; |
| 22264 |
Video.tagName = 'IFRAME'; |
| 22265 |
|
| 22266 |
exports.default = Video; |
| 22267 |
|
| 22268 |
/***/ }), |
| 22269 |
/* 74 */ |
| 22270 |
/***/ (function(module, exports, __nested_webpack_require_405371__) { |
| 22271 |
|
| 22272 |
"use strict"; |
| 22273 |
|
| 22274 |
|
| 22275 |
Object.defineProperty(exports, "__esModule", { |
| 22276 |
value: true |
| 22277 |
}); |
| 22278 |
exports.default = exports.FormulaBlot = undefined; |
| 22279 |
|
| 22280 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 22281 |
|
| 22282 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 22283 |
|
| 22284 |
var _embed = __nested_webpack_require_405371__(35); |
| 22285 |
|
| 22286 |
var _embed2 = _interopRequireDefault(_embed); |
| 22287 |
|
| 22288 |
var _quill = __nested_webpack_require_405371__(5); |
| 22289 |
|
| 22290 |
var _quill2 = _interopRequireDefault(_quill); |
| 22291 |
|
| 22292 |
var _module = __nested_webpack_require_405371__(9); |
| 22293 |
|
| 22294 |
var _module2 = _interopRequireDefault(_module); |
| 22295 |
|
| 22296 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 22297 |
|
| 22298 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 22299 |
|
| 22300 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 22301 |
|
| 22302 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 22303 |
|
| 22304 |
var FormulaBlot = function (_Embed) { |
| 22305 |
_inherits(FormulaBlot, _Embed); |
| 22306 |
|
| 22307 |
function FormulaBlot() { |
| 22308 |
_classCallCheck(this, FormulaBlot); |
| 22309 |
|
| 22310 |
return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments)); |
| 22311 |
} |
| 22312 |
|
| 22313 |
_createClass(FormulaBlot, null, [{ |
| 22314 |
key: 'create', |
| 22315 |
value: function create(value) { |
| 22316 |
var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value); |
| 22317 |
if (typeof value === 'string') { |
| 22318 |
window.katex.render(value, node, { |
| 22319 |
throwOnError: false, |
| 22320 |
errorColor: '#f00' |
| 22321 |
}); |
| 22322 |
node.setAttribute('data-value', value); |
| 22323 |
} |
| 22324 |
return node; |
| 22325 |
} |
| 22326 |
}, { |
| 22327 |
key: 'value', |
| 22328 |
value: function value(domNode) { |
| 22329 |
return domNode.getAttribute('data-value'); |
| 22330 |
} |
| 22331 |
}]); |
| 22332 |
|
| 22333 |
return FormulaBlot; |
| 22334 |
}(_embed2.default); |
| 22335 |
|
| 22336 |
FormulaBlot.blotName = 'formula'; |
| 22337 |
FormulaBlot.className = 'ql-formula'; |
| 22338 |
FormulaBlot.tagName = 'SPAN'; |
| 22339 |
|
| 22340 |
var Formula = function (_Module) { |
| 22341 |
_inherits(Formula, _Module); |
| 22342 |
|
| 22343 |
_createClass(Formula, null, [{ |
| 22344 |
key: 'register', |
| 22345 |
value: function register() { |
| 22346 |
_quill2.default.register(FormulaBlot, true); |
| 22347 |
} |
| 22348 |
}]); |
| 22349 |
|
| 22350 |
function Formula() { |
| 22351 |
_classCallCheck(this, Formula); |
| 22352 |
|
| 22353 |
var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this)); |
| 22354 |
|
| 22355 |
if (window.katex == null) { |
| 22356 |
throw new Error('Formula module requires KaTeX.'); |
| 22357 |
} |
| 22358 |
return _this2; |
| 22359 |
} |
| 22360 |
|
| 22361 |
return Formula; |
| 22362 |
}(_module2.default); |
| 22363 |
|
| 22364 |
exports.FormulaBlot = FormulaBlot; |
| 22365 |
exports.default = Formula; |
| 22366 |
|
| 22367 |
/***/ }), |
| 22368 |
/* 75 */ |
| 22369 |
/***/ (function(module, exports, __nested_webpack_require_409500__) { |
| 22370 |
|
| 22371 |
"use strict"; |
| 22372 |
|
| 22373 |
|
| 22374 |
Object.defineProperty(exports, "__esModule", { |
| 22375 |
value: true |
| 22376 |
}); |
| 22377 |
exports.default = exports.CodeToken = exports.CodeBlock = undefined; |
| 22378 |
|
| 22379 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 22380 |
|
| 22381 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 22382 |
|
| 22383 |
var _parchment = __nested_webpack_require_409500__(0); |
| 22384 |
|
| 22385 |
var _parchment2 = _interopRequireDefault(_parchment); |
| 22386 |
|
| 22387 |
var _quill = __nested_webpack_require_409500__(5); |
| 22388 |
|
| 22389 |
var _quill2 = _interopRequireDefault(_quill); |
| 22390 |
|
| 22391 |
var _module = __nested_webpack_require_409500__(9); |
| 22392 |
|
| 22393 |
var _module2 = _interopRequireDefault(_module); |
| 22394 |
|
| 22395 |
var _code = __nested_webpack_require_409500__(13); |
| 22396 |
|
| 22397 |
var _code2 = _interopRequireDefault(_code); |
| 22398 |
|
| 22399 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 22400 |
|
| 22401 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 22402 |
|
| 22403 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 22404 |
|
| 22405 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 22406 |
|
| 22407 |
var SyntaxCodeBlock = function (_CodeBlock) { |
| 22408 |
_inherits(SyntaxCodeBlock, _CodeBlock); |
| 22409 |
|
| 22410 |
function SyntaxCodeBlock() { |
| 22411 |
_classCallCheck(this, SyntaxCodeBlock); |
| 22412 |
|
| 22413 |
return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments)); |
| 22414 |
} |
| 22415 |
|
| 22416 |
_createClass(SyntaxCodeBlock, [{ |
| 22417 |
key: 'replaceWith', |
| 22418 |
value: function replaceWith(block) { |
| 22419 |
this.domNode.textContent = this.domNode.textContent; |
| 22420 |
this.attach(); |
| 22421 |
_get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block); |
| 22422 |
} |
| 22423 |
}, { |
| 22424 |
key: 'highlight', |
| 22425 |
value: function highlight(_highlight) { |
| 22426 |
var text = this.domNode.textContent; |
| 22427 |
if (this.cachedText !== text) { |
| 22428 |
if (text.trim().length > 0 || this.cachedText == null) { |
| 22429 |
this.domNode.innerHTML = _highlight(text); |
| 22430 |
this.domNode.normalize(); |
| 22431 |
this.attach(); |
| 22432 |
} |
| 22433 |
this.cachedText = text; |
| 22434 |
} |
| 22435 |
} |
| 22436 |
}]); |
| 22437 |
|
| 22438 |
return SyntaxCodeBlock; |
| 22439 |
}(_code2.default); |
| 22440 |
|
| 22441 |
SyntaxCodeBlock.className = 'ql-syntax'; |
| 22442 |
|
| 22443 |
var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', { |
| 22444 |
scope: _parchment2.default.Scope.INLINE |
| 22445 |
}); |
| 22446 |
|
| 22447 |
var Syntax = function (_Module) { |
| 22448 |
_inherits(Syntax, _Module); |
| 22449 |
|
| 22450 |
_createClass(Syntax, null, [{ |
| 22451 |
key: 'register', |
| 22452 |
value: function register() { |
| 22453 |
_quill2.default.register(CodeToken, true); |
| 22454 |
_quill2.default.register(SyntaxCodeBlock, true); |
| 22455 |
} |
| 22456 |
}]); |
| 22457 |
|
| 22458 |
function Syntax(quill, options) { |
| 22459 |
_classCallCheck(this, Syntax); |
| 22460 |
|
| 22461 |
var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options)); |
| 22462 |
|
| 22463 |
if (typeof _this2.options.highlight !== 'function') { |
| 22464 |
throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.'); |
| 22465 |
} |
| 22466 |
var timer = null; |
| 22467 |
_this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { |
| 22468 |
clearTimeout(timer); |
| 22469 |
timer = setTimeout(function () { |
| 22470 |
_this2.highlight(); |
| 22471 |
timer = null; |
| 22472 |
}, _this2.options.interval); |
| 22473 |
}); |
| 22474 |
_this2.highlight(); |
| 22475 |
return _this2; |
| 22476 |
} |
| 22477 |
|
| 22478 |
_createClass(Syntax, [{ |
| 22479 |
key: 'highlight', |
| 22480 |
value: function highlight() { |
| 22481 |
var _this3 = this; |
| 22482 |
|
| 22483 |
if (this.quill.selection.composing) return; |
| 22484 |
this.quill.update(_quill2.default.sources.USER); |
| 22485 |
var range = this.quill.getSelection(); |
| 22486 |
this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) { |
| 22487 |
code.highlight(_this3.options.highlight); |
| 22488 |
}); |
| 22489 |
this.quill.update(_quill2.default.sources.SILENT); |
| 22490 |
if (range != null) { |
| 22491 |
this.quill.setSelection(range, _quill2.default.sources.SILENT); |
| 22492 |
} |
| 22493 |
} |
| 22494 |
}]); |
| 22495 |
|
| 22496 |
return Syntax; |
| 22497 |
}(_module2.default); |
| 22498 |
|
| 22499 |
Syntax.DEFAULTS = { |
| 22500 |
highlight: function () { |
| 22501 |
if (window.hljs == null) return null; |
| 22502 |
return function (text) { |
| 22503 |
var result = window.hljs.highlightAuto(text); |
| 22504 |
return result.value; |
| 22505 |
}; |
| 22506 |
}(), |
| 22507 |
interval: 1000 |
| 22508 |
}; |
| 22509 |
|
| 22510 |
exports.CodeBlock = SyntaxCodeBlock; |
| 22511 |
exports.CodeToken = CodeToken; |
| 22512 |
exports.default = Syntax; |
| 22513 |
|
| 22514 |
/***/ }), |
| 22515 |
/* 76 */ |
| 22516 |
/***/ (function(module, exports) { |
| 22517 |
|
| 22518 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>"; |
| 22519 |
|
| 22520 |
/***/ }), |
| 22521 |
/* 77 */ |
| 22522 |
/***/ (function(module, exports) { |
| 22523 |
|
| 22524 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>"; |
| 22525 |
|
| 22526 |
/***/ }), |
| 22527 |
/* 78 */ |
| 22528 |
/***/ (function(module, exports) { |
| 22529 |
|
| 22530 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>"; |
| 22531 |
|
| 22532 |
/***/ }), |
| 22533 |
/* 79 */ |
| 22534 |
/***/ (function(module, exports) { |
| 22535 |
|
| 22536 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>"; |
| 22537 |
|
| 22538 |
/***/ }), |
| 22539 |
/* 80 */ |
| 22540 |
/***/ (function(module, exports) { |
| 22541 |
|
| 22542 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <g class=\"ql-fill ql-color-label\"> <polygon points=\"6 6.868 6 6 5 6 5 7 5.942 7 6 6.868\"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points=\"6.817 5 6 5 6 6 6.38 6 6.817 5\"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points=\"4 11.439 4 11 3 11 3 12 3.755 12 4 11.439\"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points=\"4.63 10 4 10 4 11 4.192 11 4.63 10\"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points=\"13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174\"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points=\"12 6.868 12 6 11.62 6 12 6.868\"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points=\"12.933 9 13 9 13 8 12.495 8 12.933 9\"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points=\"5.5 13 9 5 12.5 13\"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>"; |
| 22543 |
|
| 22544 |
/***/ }), |
| 22545 |
/* 81 */ |
| 22546 |
/***/ (function(module, exports) { |
| 22547 |
|
| 22548 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <rect class=\"ql-fill ql-stroke\" height=3 width=3 x=4 y=5></rect> <rect class=\"ql-fill ql-stroke\" height=3 width=3 x=11 y=5></rect> <path class=\"ql-even ql-fill ql-stroke\" d=M7,8c0,4.031-3,5-3,5></path> <path class=\"ql-even ql-fill ql-stroke\" d=M14,8c0,4.031-3,5-3,5></path> </svg>"; |
| 22549 |
|
| 22550 |
/***/ }), |
| 22551 |
/* 82 */ |
| 22552 |
/***/ (function(module, exports) { |
| 22553 |
|
| 22554 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>"; |
| 22555 |
|
| 22556 |
/***/ }), |
| 22557 |
/* 83 */ |
| 22558 |
/***/ (function(module, exports) { |
| 22559 |
|
| 22560 |
module.exports = "<svg class=\"\" viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>"; |
| 22561 |
|
| 22562 |
/***/ }), |
| 22563 |
/* 84 */ |
| 22564 |
/***/ (function(module, exports) { |
| 22565 |
|
| 22566 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=\"ql-color-label ql-stroke ql-transparent\" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points=\"5.5 11 9 3 12.5 11\"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>"; |
| 22567 |
|
| 22568 |
/***/ }), |
| 22569 |
/* 85 */ |
| 22570 |
/***/ (function(module, exports) { |
| 22571 |
|
| 22572 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <polygon class=\"ql-stroke ql-fill\" points=\"3 11 5 9 3 7 3 11\"></polygon> <line class=\"ql-stroke ql-fill\" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>"; |
| 22573 |
|
| 22574 |
/***/ }), |
| 22575 |
/* 86 */ |
| 22576 |
/***/ (function(module, exports) { |
| 22577 |
|
| 22578 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <polygon class=\"ql-stroke ql-fill\" points=\"15 12 13 10 15 8 15 12\"></polygon> <line class=\"ql-stroke ql-fill\" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>"; |
| 22579 |
|
| 22580 |
/***/ }), |
| 22581 |
/* 87 */ |
| 22582 |
/***/ (function(module, exports) { |
| 22583 |
|
| 22584 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>"; |
| 22585 |
|
| 22586 |
/***/ }), |
| 22587 |
/* 88 */ |
| 22588 |
/***/ (function(module, exports) { |
| 22589 |
|
| 22590 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>"; |
| 22591 |
|
| 22592 |
/***/ }), |
| 22593 |
/* 89 */ |
| 22594 |
/***/ (function(module, exports) { |
| 22595 |
|
| 22596 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>"; |
| 22597 |
|
| 22598 |
/***/ }), |
| 22599 |
/* 90 */ |
| 22600 |
/***/ (function(module, exports) { |
| 22601 |
|
| 22602 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform=\"translate(24 18) rotate(-180)\"/> </svg>"; |
| 22603 |
|
| 22604 |
/***/ }), |
| 22605 |
/* 91 */ |
| 22606 |
/***/ (function(module, exports) { |
| 22607 |
|
| 22608 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>"; |
| 22609 |
|
| 22610 |
/***/ }), |
| 22611 |
/* 92 */ |
| 22612 |
/***/ (function(module, exports) { |
| 22613 |
|
| 22614 |
module.exports = "<svg viewBox=\"0 0 18 18\"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>"; |
| 22615 |
|
| 22616 |
/***/ }), |
| 22617 |
/* 93 */ |
| 22618 |
/***/ (function(module, exports) { |
| 22619 |
|
| 22620 |
module.exports = "<svg viewBox=\"0 0 18 18\"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>"; |
| 22621 |
|
| 22622 |
/***/ }), |
| 22623 |
/* 94 */ |
| 22624 |
/***/ (function(module, exports) { |
| 22625 |
|
| 22626 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>"; |
| 22627 |
|
| 22628 |
/***/ }), |
| 22629 |
/* 95 */ |
| 22630 |
/***/ (function(module, exports) { |
| 22631 |
|
| 22632 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class=\"ql-even ql-fill\" points=\"5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12\"></polyline> </svg>"; |
| 22633 |
|
| 22634 |
/***/ }), |
| 22635 |
/* 96 */ |
| 22636 |
/***/ (function(module, exports) { |
| 22637 |
|
| 22638 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=\"ql-fill ql-stroke\" points=\"3 7 3 11 5 9 3 7\"></polyline> </svg>"; |
| 22639 |
|
| 22640 |
/***/ }), |
| 22641 |
/* 97 */ |
| 22642 |
/***/ (function(module, exports) { |
| 22643 |
|
| 22644 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points=\"5 7 5 11 3 9 5 7\"></polyline> </svg>"; |
| 22645 |
|
| 22646 |
/***/ }), |
| 22647 |
/* 98 */ |
| 22648 |
/***/ (function(module, exports) { |
| 22649 |
|
| 22650 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class=\"ql-even ql-stroke\" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class=\"ql-even ql-stroke\" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>"; |
| 22651 |
|
| 22652 |
/***/ }), |
| 22653 |
/* 99 */ |
| 22654 |
/***/ (function(module, exports) { |
| 22655 |
|
| 22656 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class=\"ql-stroke ql-thin\" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class=\"ql-stroke ql-thin\" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class=\"ql-stroke ql-thin\" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>"; |
| 22657 |
|
| 22658 |
/***/ }), |
| 22659 |
/* 100 */ |
| 22660 |
/***/ (function(module, exports) { |
| 22661 |
|
| 22662 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>"; |
| 22663 |
|
| 22664 |
/***/ }), |
| 22665 |
/* 101 */ |
| 22666 |
/***/ (function(module, exports) { |
| 22667 |
|
| 22668 |
module.exports = "<svg class=\"\" viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points=\"3 4 4 5 6 3\"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points=\"3 14 4 15 6 13\"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points=\"3 9 4 10 6 8\"></polyline> </svg>"; |
| 22669 |
|
| 22670 |
/***/ }), |
| 22671 |
/* 102 */ |
| 22672 |
/***/ (function(module, exports) { |
| 22673 |
|
| 22674 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>"; |
| 22675 |
|
| 22676 |
/***/ }), |
| 22677 |
/* 103 */ |
| 22678 |
/***/ (function(module, exports) { |
| 22679 |
|
| 22680 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>"; |
| 22681 |
|
| 22682 |
/***/ }), |
| 22683 |
/* 104 */ |
| 22684 |
/***/ (function(module, exports) { |
| 22685 |
|
| 22686 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=\"ql-stroke ql-thin\" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>"; |
| 22687 |
|
| 22688 |
/***/ }), |
| 22689 |
/* 105 */ |
| 22690 |
/***/ (function(module, exports) { |
| 22691 |
|
| 22692 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>"; |
| 22693 |
|
| 22694 |
/***/ }), |
| 22695 |
/* 106 */ |
| 22696 |
/***/ (function(module, exports) { |
| 22697 |
|
| 22698 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>"; |
| 22699 |
|
| 22700 |
/***/ }), |
| 22701 |
/* 107 */ |
| 22702 |
/***/ (function(module, exports) { |
| 22703 |
|
| 22704 |
module.exports = "<svg viewbox=\"0 0 18 18\"> <polygon class=ql-stroke points=\"7 11 9 13 11 11 7 11\"></polygon> <polygon class=ql-stroke points=\"7 7 9 5 11 7 7 7\"></polygon> </svg>"; |
| 22705 |
|
| 22706 |
/***/ }), |
| 22707 |
/* 108 */ |
| 22708 |
/***/ (function(module, exports, __nested_webpack_require_432266__) { |
| 22709 |
|
| 22710 |
"use strict"; |
| 22711 |
|
| 22712 |
|
| 22713 |
Object.defineProperty(exports, "__esModule", { |
| 22714 |
value: true |
| 22715 |
}); |
| 22716 |
exports.default = exports.BubbleTooltip = undefined; |
| 22717 |
|
| 22718 |
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; |
| 22719 |
|
| 22720 |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
| 22721 |
|
| 22722 |
var _extend = __nested_webpack_require_432266__(3); |
| 22723 |
|
| 22724 |
var _extend2 = _interopRequireDefault(_extend); |
| 22725 |
|
| 22726 |
var _emitter = __nested_webpack_require_432266__(8); |
| 22727 |
|
| 22728 |
var _emitter2 = _interopRequireDefault(_emitter); |
| 22729 |
|
| 22730 |
var _base = __nested_webpack_require_432266__(43); |
| 22731 |
|
| 22732 |
var _base2 = _interopRequireDefault(_base); |
| 22733 |
|
| 22734 |
var _selection = __nested_webpack_require_432266__(15); |
| 22735 |
|
| 22736 |
var _icons = __nested_webpack_require_432266__(41); |
| 22737 |
|
| 22738 |
var _icons2 = _interopRequireDefault(_icons); |
| 22739 |
|
| 22740 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
| 22741 |
|
| 22742 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 22743 |
|
| 22744 |
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } |
| 22745 |
|
| 22746 |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
| 22747 |
|
| 22748 |
var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']]; |
| 22749 |
|
| 22750 |
var BubbleTheme = function (_BaseTheme) { |
| 22751 |
_inherits(BubbleTheme, _BaseTheme); |
| 22752 |
|
| 22753 |
function BubbleTheme(quill, options) { |
| 22754 |
_classCallCheck(this, BubbleTheme); |
| 22755 |
|
| 22756 |
if (options.modules.toolbar != null && options.modules.toolbar.container == null) { |
| 22757 |
options.modules.toolbar.container = TOOLBAR_CONFIG; |
| 22758 |
} |
| 22759 |
|
| 22760 |
var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options)); |
| 22761 |
|
| 22762 |
_this.quill.container.classList.add('ql-bubble'); |
| 22763 |
return _this; |
| 22764 |
} |
| 22765 |
|
| 22766 |
_createClass(BubbleTheme, [{ |
| 22767 |
key: 'extendToolbar', |
| 22768 |
value: function extendToolbar(toolbar) { |
| 22769 |
this.tooltip = new BubbleTooltip(this.quill, this.options.bounds); |
| 22770 |
this.tooltip.root.appendChild(toolbar.container); |
| 22771 |
this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); |
| 22772 |
this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); |
| 22773 |
} |
| 22774 |
}]); |
| 22775 |
|
| 22776 |
return BubbleTheme; |
| 22777 |
}(_base2.default); |
| 22778 |
|
| 22779 |
BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { |
| 22780 |
modules: { |
| 22781 |
toolbar: { |
| 22782 |
handlers: { |
| 22783 |
link: function link(value) { |
| 22784 |
if (!value) { |
| 22785 |
this.quill.format('link', false); |
| 22786 |
} else { |
| 22787 |
this.quill.theme.tooltip.edit(); |
| 22788 |
} |
| 22789 |
} |
| 22790 |
} |
| 22791 |
} |
| 22792 |
} |
| 22793 |
}); |
| 22794 |
|
| 22795 |
var BubbleTooltip = function (_BaseTooltip) { |
| 22796 |
_inherits(BubbleTooltip, _BaseTooltip); |
| 22797 |
|
| 22798 |
function BubbleTooltip(quill, bounds) { |
| 22799 |
_classCallCheck(this, BubbleTooltip); |
| 22800 |
|
| 22801 |
var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds)); |
| 22802 |
|
| 22803 |
_this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) { |
| 22804 |
if (type !== _emitter2.default.events.SELECTION_CHANGE) return; |
| 22805 |
if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) { |
| 22806 |
_this2.show(); |
| 22807 |
// Lock our width so we will expand beyond our offsetParent boundaries |
| 22808 |
_this2.root.style.left = '0px'; |
| 22809 |
_this2.root.style.width = ''; |
| 22810 |
_this2.root.style.width = _this2.root.offsetWidth + 'px'; |
| 22811 |
var lines = _this2.quill.getLines(range.index, range.length); |
| 22812 |
if (lines.length === 1) { |
| 22813 |
_this2.position(_this2.quill.getBounds(range)); |
| 22814 |
} else { |
| 22815 |
var lastLine = lines[lines.length - 1]; |
| 22816 |
var index = _this2.quill.getIndex(lastLine); |
| 22817 |
var length = Math.min(lastLine.length() - 1, range.index + range.length - index); |
| 22818 |
var _bounds = _this2.quill.getBounds(new _selection.Range(index, length)); |
| 22819 |
_this2.position(_bounds); |
| 22820 |
} |
| 22821 |
} else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) { |
| 22822 |
_this2.hide(); |
| 22823 |
} |
| 22824 |
}); |
| 22825 |
return _this2; |
| 22826 |
} |
| 22827 |
|
| 22828 |
_createClass(BubbleTooltip, [{ |
| 22829 |
key: 'listen', |
| 22830 |
value: function listen() { |
| 22831 |
var _this3 = this; |
| 22832 |
|
| 22833 |
_get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this); |
| 22834 |
this.root.querySelector('.ql-close').addEventListener('click', function () { |
| 22835 |
_this3.root.classList.remove('ql-editing'); |
| 22836 |
}); |
| 22837 |
this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () { |
| 22838 |
// Let selection be restored by toolbar handlers before repositioning |
| 22839 |
setTimeout(function () { |
| 22840 |
if (_this3.root.classList.contains('ql-hidden')) return; |
| 22841 |
var range = _this3.quill.getSelection(); |
| 22842 |
if (range != null) { |
| 22843 |
_this3.position(_this3.quill.getBounds(range)); |
| 22844 |
} |
| 22845 |
}, 1); |
| 22846 |
}); |
| 22847 |
} |
| 22848 |
}, { |
| 22849 |
key: 'cancel', |
| 22850 |
value: function cancel() { |
| 22851 |
this.show(); |
| 22852 |
} |
| 22853 |
}, { |
| 22854 |
key: 'position', |
| 22855 |
value: function position(reference) { |
| 22856 |
var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference); |
| 22857 |
var arrow = this.root.querySelector('.ql-tooltip-arrow'); |
| 22858 |
arrow.style.marginLeft = ''; |
| 22859 |
if (shift === 0) return shift; |
| 22860 |
arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px'; |
| 22861 |
} |
| 22862 |
}]); |
| 22863 |
|
| 22864 |
return BubbleTooltip; |
| 22865 |
}(_base.BaseTooltip); |
| 22866 |
|
| 22867 |
BubbleTooltip.TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', '</div>'].join(''); |
| 22868 |
|
| 22869 |
exports.BubbleTooltip = BubbleTooltip; |
| 22870 |
exports.default = BubbleTheme; |
| 22871 |
|
| 22872 |
/***/ }), |
| 22873 |
/* 109 */ |
| 22874 |
/***/ (function(module, exports, __nested_webpack_require_439588__) { |
| 22875 |
|
| 22876 |
module.exports = __nested_webpack_require_439588__(63); |
| 22877 |
|
| 22878 |
|
| 22879 |
/***/ }) |
| 22880 |
/******/ ])["default"]; |
| 22881 |
}); |
| 22882 |
|
| 22883 |
/***/ }), |
| 22884 |
|
| 22885 |
/***/ 1167: |
| 22886 |
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { |
| 22887 |
|
| 22888 |
"use strict"; |
| 22889 |
|
| 22890 |
/* |
| 22891 |
React-Quill |
| 22892 |
https://github.com/zenoamaro/react-quill |
| 22893 |
*/ |
| 22894 |
var __extends = (this && this.__extends) || (function () { |
| 22895 |
var extendStatics = function (d, b) { |
| 22896 |
extendStatics = Object.setPrototypeOf || |
| 22897 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 22898 |
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 22899 |
return extendStatics(d, b); |
| 22900 |
}; |
| 22901 |
return function (d, b) { |
| 22902 |
extendStatics(d, b); |
| 22903 |
function __() { this.constructor = d; } |
| 22904 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 22905 |
}; |
| 22906 |
})(); |
| 22907 |
var __assign = (this && this.__assign) || function () { |
| 22908 |
__assign = Object.assign || function(t) { |
| 22909 |
for (var s, i = 1, n = arguments.length; i < n; i++) { |
| 22910 |
s = arguments[i]; |
| 22911 |
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) |
| 22912 |
t[p] = s[p]; |
| 22913 |
} |
| 22914 |
return t; |
| 22915 |
}; |
| 22916 |
return __assign.apply(this, arguments); |
| 22917 |
}; |
| 22918 |
var __spreadArrays = (this && this.__spreadArrays) || function () { |
| 22919 |
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; |
| 22920 |
for (var r = Array(s), k = 0, i = 0; i < il; i++) |
| 22921 |
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) |
| 22922 |
r[k] = a[j]; |
| 22923 |
return r; |
| 22924 |
}; |
| 22925 |
var __importDefault = (this && this.__importDefault) || function (mod) { |
| 22926 |
return (mod && mod.__esModule) ? mod : { "default": mod }; |
| 22927 |
}; |
| 22928 |
var react_1 = __importDefault(__webpack_require__(7363)); |
| 22929 |
var react_dom_1 = __importDefault(__webpack_require__(1533)); |
| 22930 |
var isEqual_1 = __importDefault(__webpack_require__(8446)); |
| 22931 |
var quill_1 = __importDefault(__webpack_require__(6095)); |
| 22932 |
var ReactQuill = /** @class */ (function (_super) { |
| 22933 |
__extends(ReactQuill, _super); |
| 22934 |
function ReactQuill(props) { |
| 22935 |
var _this = _super.call(this, props) || this; |
| 22936 |
/* |
| 22937 |
Changing one of these props should cause a full re-render and a |
| 22938 |
re-instantiation of the Quill editor. |
| 22939 |
*/ |
| 22940 |
_this.dirtyProps = [ |
| 22941 |
'modules', |
| 22942 |
'formats', |
| 22943 |
'bounds', |
| 22944 |
'theme', |
| 22945 |
'children', |
| 22946 |
]; |
| 22947 |
/* |
| 22948 |
Changing one of these props should cause a regular update. These are mostly |
| 22949 |
props that act on the container, rather than the quillized editing area. |
| 22950 |
*/ |
| 22951 |
_this.cleanProps = [ |
| 22952 |
'id', |
| 22953 |
'className', |
| 22954 |
'style', |
| 22955 |
'placeholder', |
| 22956 |
'tabIndex', |
| 22957 |
'onChange', |
| 22958 |
'onChangeSelection', |
| 22959 |
'onFocus', |
| 22960 |
'onBlur', |
| 22961 |
'onKeyPress', |
| 22962 |
'onKeyDown', |
| 22963 |
'onKeyUp', |
| 22964 |
]; |
| 22965 |
_this.state = { |
| 22966 |
generation: 0, |
| 22967 |
}; |
| 22968 |
/* |
| 22969 |
Tracks the internal selection of the Quill editor |
| 22970 |
*/ |
| 22971 |
_this.selection = null; |
| 22972 |
_this.onEditorChange = function (eventName, rangeOrDelta, oldRangeOrDelta, source) { |
| 22973 |
var _a, _b, _c, _d; |
| 22974 |
if (eventName === 'text-change') { |
| 22975 |
(_b = (_a = _this).onEditorChangeText) === null || _b === void 0 ? void 0 : _b.call(_a, _this.editor.root.innerHTML, rangeOrDelta, source, _this.unprivilegedEditor); |
| 22976 |
} |
| 22977 |
else if (eventName === 'selection-change') { |
| 22978 |
(_d = (_c = _this).onEditorChangeSelection) === null || _d === void 0 ? void 0 : _d.call(_c, rangeOrDelta, source, _this.unprivilegedEditor); |
| 22979 |
} |
| 22980 |
}; |
| 22981 |
var value = _this.isControlled() ? props.value : props.defaultValue; |
| 22982 |
_this.value = (value !== null && value !== void 0 ? value : ''); |
| 22983 |
return _this; |
| 22984 |
} |
| 22985 |
ReactQuill.prototype.validateProps = function (props) { |
| 22986 |
var _a; |
| 22987 |
if (react_1.default.Children.count(props.children) > 1) |
| 22988 |
throw new Error('The Quill editing area can only be composed of a single React element.'); |
| 22989 |
if (react_1.default.Children.count(props.children)) { |
| 22990 |
var child = react_1.default.Children.only(props.children); |
| 22991 |
if (((_a = child) === null || _a === void 0 ? void 0 : _a.type) === 'textarea') |
| 22992 |
throw new Error('Quill does not support editing on a <textarea>. Use a <div> instead.'); |
| 22993 |
} |
| 22994 |
if (this.lastDeltaChangeSet && |
| 22995 |
props.value === this.lastDeltaChangeSet) |
| 22996 |
throw new Error('You are passing the `delta` object from the `onChange` event back ' + |
| 22997 |
'as `value`. You most probably want `editor.getContents()` instead. ' + |
| 22998 |
'See: https://github.com/zenoamaro/react-quill#using-deltas'); |
| 22999 |
}; |
| 23000 |
ReactQuill.prototype.shouldComponentUpdate = function (nextProps, nextState) { |
| 23001 |
var _this = this; |
| 23002 |
var _a; |
| 23003 |
this.validateProps(nextProps); |
| 23004 |
// If the editor hasn't been instantiated yet, or the component has been |
| 23005 |
// regenerated, we already know we should update. |
| 23006 |
if (!this.editor || this.state.generation !== nextState.generation) { |
| 23007 |
return true; |
| 23008 |
} |
| 23009 |
// Handle value changes in-place |
| 23010 |
if ('value' in nextProps) { |
| 23011 |
var prevContents = this.getEditorContents(); |
| 23012 |
var nextContents = (_a = nextProps.value, (_a !== null && _a !== void 0 ? _a : '')); |
| 23013 |
// NOTE: Seeing that Quill is missing a way to prevent edits, we have to |
| 23014 |
// settle for a hybrid between controlled and uncontrolled mode. We |
| 23015 |
// can't prevent the change, but we'll still override content |
| 23016 |
// whenever `value` differs from current state. |
| 23017 |
// NOTE: Comparing an HTML string and a Quill Delta will always trigger a |
| 23018 |
// change, regardless of whether they represent the same document. |
| 23019 |
if (!this.isEqualValue(nextContents, prevContents)) { |
| 23020 |
this.setEditorContents(this.editor, nextContents); |
| 23021 |
} |
| 23022 |
} |
| 23023 |
// Handle read-only changes in-place |
| 23024 |
if (nextProps.readOnly !== this.props.readOnly) { |
| 23025 |
this.setEditorReadOnly(this.editor, nextProps.readOnly); |
| 23026 |
} |
| 23027 |
// Clean and Dirty props require a render |
| 23028 |
return __spreadArrays(this.cleanProps, this.dirtyProps).some(function (prop) { |
| 23029 |
return !isEqual_1.default(nextProps[prop], _this.props[prop]); |
| 23030 |
}); |
| 23031 |
}; |
| 23032 |
ReactQuill.prototype.shouldComponentRegenerate = function (nextProps) { |
| 23033 |
var _this = this; |
| 23034 |
// Whenever a `dirtyProp` changes, the editor needs reinstantiation. |
| 23035 |
return this.dirtyProps.some(function (prop) { |
| 23036 |
return !isEqual_1.default(nextProps[prop], _this.props[prop]); |
| 23037 |
}); |
| 23038 |
}; |
| 23039 |
ReactQuill.prototype.componentDidMount = function () { |
| 23040 |
this.instantiateEditor(); |
| 23041 |
this.setEditorContents(this.editor, this.getEditorContents()); |
| 23042 |
}; |
| 23043 |
ReactQuill.prototype.componentWillUnmount = function () { |
| 23044 |
this.destroyEditor(); |
| 23045 |
}; |
| 23046 |
ReactQuill.prototype.componentDidUpdate = function (prevProps, prevState) { |
| 23047 |
var _this = this; |
| 23048 |
// If we're changing one of the `dirtyProps`, the entire Quill Editor needs |
| 23049 |
// to be re-instantiated. Regenerating the editor will cause the whole tree, |
| 23050 |
// including the container, to be cleaned up and re-rendered from scratch. |
| 23051 |
// Store the contents so they can be restored later. |
| 23052 |
if (this.editor && this.shouldComponentRegenerate(prevProps)) { |
| 23053 |
var delta = this.editor.getContents(); |
| 23054 |
var selection = this.editor.getSelection(); |
| 23055 |
this.regenerationSnapshot = { delta: delta, selection: selection }; |
| 23056 |
this.setState({ generation: this.state.generation + 1 }); |
| 23057 |
this.destroyEditor(); |
| 23058 |
} |
| 23059 |
// The component has been regenerated, so it must be re-instantiated, and |
| 23060 |
// its content must be restored to the previous values from the snapshot. |
| 23061 |
if (this.state.generation !== prevState.generation) { |
| 23062 |
var _a = this.regenerationSnapshot, delta = _a.delta, selection_1 = _a.selection; |
| 23063 |
delete this.regenerationSnapshot; |
| 23064 |
this.instantiateEditor(); |
| 23065 |
var editor_1 = this.editor; |
| 23066 |
editor_1.setContents(delta); |
| 23067 |
postpone(function () { return _this.setEditorSelection(editor_1, selection_1); }); |
| 23068 |
} |
| 23069 |
}; |
| 23070 |
ReactQuill.prototype.instantiateEditor = function () { |
| 23071 |
if (this.editor) { |
| 23072 |
this.hookEditor(this.editor); |
| 23073 |
} |
| 23074 |
else { |
| 23075 |
this.editor = this.createEditor(this.getEditingArea(), this.getEditorConfig()); |
| 23076 |
} |
| 23077 |
}; |
| 23078 |
ReactQuill.prototype.destroyEditor = function () { |
| 23079 |
if (!this.editor) |
| 23080 |
return; |
| 23081 |
this.unhookEditor(this.editor); |
| 23082 |
}; |
| 23083 |
/* |
| 23084 |
We consider the component to be controlled if `value` is being sent in props. |
| 23085 |
*/ |
| 23086 |
ReactQuill.prototype.isControlled = function () { |
| 23087 |
return 'value' in this.props; |
| 23088 |
}; |
| 23089 |
ReactQuill.prototype.getEditorConfig = function () { |
| 23090 |
return { |
| 23091 |
bounds: this.props.bounds, |
| 23092 |
formats: this.props.formats, |
| 23093 |
modules: this.props.modules, |
| 23094 |
placeholder: this.props.placeholder, |
| 23095 |
readOnly: this.props.readOnly, |
| 23096 |
scrollingContainer: this.props.scrollingContainer, |
| 23097 |
tabIndex: this.props.tabIndex, |
| 23098 |
theme: this.props.theme, |
| 23099 |
}; |
| 23100 |
}; |
| 23101 |
ReactQuill.prototype.getEditor = function () { |
| 23102 |
if (!this.editor) |
| 23103 |
throw new Error('Accessing non-instantiated editor'); |
| 23104 |
return this.editor; |
| 23105 |
}; |
| 23106 |
/** |
| 23107 |
Creates an editor on the given element. The editor will be passed the |
| 23108 |
configuration, have its events bound, |
| 23109 |
*/ |
| 23110 |
ReactQuill.prototype.createEditor = function (element, config) { |
| 23111 |
var editor = new quill_1.default(element, config); |
| 23112 |
if (config.tabIndex != null) { |
| 23113 |
this.setEditorTabIndex(editor, config.tabIndex); |
| 23114 |
} |
| 23115 |
this.hookEditor(editor); |
| 23116 |
return editor; |
| 23117 |
}; |
| 23118 |
ReactQuill.prototype.hookEditor = function (editor) { |
| 23119 |
// Expose the editor on change events via a weaker, unprivileged proxy |
| 23120 |
// object that does not allow accidentally modifying editor state. |
| 23121 |
this.unprivilegedEditor = this.makeUnprivilegedEditor(editor); |
| 23122 |
// Using `editor-change` allows picking up silent updates, like selection |
| 23123 |
// changes on typing. |
| 23124 |
editor.on('editor-change', this.onEditorChange); |
| 23125 |
}; |
| 23126 |
ReactQuill.prototype.unhookEditor = function (editor) { |
| 23127 |
editor.off('editor-change', this.onEditorChange); |
| 23128 |
}; |
| 23129 |
ReactQuill.prototype.getEditorContents = function () { |
| 23130 |
return this.value; |
| 23131 |
}; |
| 23132 |
ReactQuill.prototype.getEditorSelection = function () { |
| 23133 |
return this.selection; |
| 23134 |
}; |
| 23135 |
/* |
| 23136 |
True if the value is a Delta instance or a Delta look-alike. |
| 23137 |
*/ |
| 23138 |
ReactQuill.prototype.isDelta = function (value) { |
| 23139 |
return value && value.ops; |
| 23140 |
}; |
| 23141 |
/* |
| 23142 |
Special comparison function that knows how to compare Deltas. |
| 23143 |
*/ |
| 23144 |
ReactQuill.prototype.isEqualValue = function (value, nextValue) { |
| 23145 |
if (this.isDelta(value) && this.isDelta(nextValue)) { |
| 23146 |
return isEqual_1.default(value.ops, nextValue.ops); |
| 23147 |
} |
| 23148 |
else { |
| 23149 |
return isEqual_1.default(value, nextValue); |
| 23150 |
} |
| 23151 |
}; |
| 23152 |
/* |
| 23153 |
Replace the contents of the editor, but keep the previous selection hanging |
| 23154 |
around so that the cursor won't move. |
| 23155 |
*/ |
| 23156 |
ReactQuill.prototype.setEditorContents = function (editor, value) { |
| 23157 |
var _this = this; |
| 23158 |
this.value = value; |
| 23159 |
var sel = this.getEditorSelection(); |
| 23160 |
if (typeof value === 'string') { |
| 23161 |
editor.setContents(editor.clipboard.convert(value)); |
| 23162 |
} |
| 23163 |
else { |
| 23164 |
editor.setContents(value); |
| 23165 |
} |
| 23166 |
postpone(function () { return _this.setEditorSelection(editor, sel); }); |
| 23167 |
}; |
| 23168 |
ReactQuill.prototype.setEditorSelection = function (editor, range) { |
| 23169 |
this.selection = range; |
| 23170 |
if (range) { |
| 23171 |
// Validate bounds before applying. |
| 23172 |
var length_1 = editor.getLength(); |
| 23173 |
range.index = Math.max(0, Math.min(range.index, length_1 - 1)); |
| 23174 |
range.length = Math.max(0, Math.min(range.length, (length_1 - 1) - range.index)); |
| 23175 |
editor.setSelection(range); |
| 23176 |
} |
| 23177 |
}; |
| 23178 |
ReactQuill.prototype.setEditorTabIndex = function (editor, tabIndex) { |
| 23179 |
var _a, _b; |
| 23180 |
if ((_b = (_a = editor) === null || _a === void 0 ? void 0 : _a.scroll) === null || _b === void 0 ? void 0 : _b.domNode) { |
| 23181 |
editor.scroll.domNode.tabIndex = tabIndex; |
| 23182 |
} |
| 23183 |
}; |
| 23184 |
ReactQuill.prototype.setEditorReadOnly = function (editor, value) { |
| 23185 |
if (value) { |
| 23186 |
editor.disable(); |
| 23187 |
} |
| 23188 |
else { |
| 23189 |
editor.enable(); |
| 23190 |
} |
| 23191 |
}; |
| 23192 |
/* |
| 23193 |
Returns a weaker, unprivileged proxy object that only exposes read-only |
| 23194 |
accessors found on the editor instance, without any state-modifying methods. |
| 23195 |
*/ |
| 23196 |
ReactQuill.prototype.makeUnprivilegedEditor = function (editor) { |
| 23197 |
var e = editor; |
| 23198 |
return { |
| 23199 |
getHTML: function () { return e.root.innerHTML; }, |
| 23200 |
getLength: e.getLength.bind(e), |
| 23201 |
getText: e.getText.bind(e), |
| 23202 |
getContents: e.getContents.bind(e), |
| 23203 |
getSelection: e.getSelection.bind(e), |
| 23204 |
getBounds: e.getBounds.bind(e), |
| 23205 |
}; |
| 23206 |
}; |
| 23207 |
ReactQuill.prototype.getEditingArea = function () { |
| 23208 |
if (!this.editingArea) { |
| 23209 |
throw new Error('Instantiating on missing editing area'); |
| 23210 |
} |
| 23211 |
var element = react_dom_1.default.findDOMNode(this.editingArea); |
| 23212 |
if (!element) { |
| 23213 |
throw new Error('Cannot find element for editing area'); |
| 23214 |
} |
| 23215 |
if (element.nodeType === 3) { |
| 23216 |
throw new Error('Editing area cannot be a text node'); |
| 23217 |
} |
| 23218 |
return element; |
| 23219 |
}; |
| 23220 |
/* |
| 23221 |
Renders an editor area, unless it has been provided one to clone. |
| 23222 |
*/ |
| 23223 |
ReactQuill.prototype.renderEditingArea = function () { |
| 23224 |
var _this = this; |
| 23225 |
var _a = this.props, children = _a.children, preserveWhitespace = _a.preserveWhitespace; |
| 23226 |
var generation = this.state.generation; |
| 23227 |
var properties = { |
| 23228 |
key: generation, |
| 23229 |
ref: function (instance) { |
| 23230 |
_this.editingArea = instance; |
| 23231 |
}, |
| 23232 |
}; |
| 23233 |
if (react_1.default.Children.count(children)) { |
| 23234 |
return react_1.default.cloneElement(react_1.default.Children.only(children), properties); |
| 23235 |
} |
| 23236 |
return preserveWhitespace ? |
| 23237 |
react_1.default.createElement("pre", __assign({}, properties)) : |
| 23238 |
react_1.default.createElement("div", __assign({}, properties)); |
| 23239 |
}; |
| 23240 |
ReactQuill.prototype.render = function () { |
| 23241 |
var _a; |
| 23242 |
return (react_1.default.createElement("div", { id: this.props.id, style: this.props.style, key: this.state.generation, className: "quill " + (_a = this.props.className, (_a !== null && _a !== void 0 ? _a : '')), onKeyPress: this.props.onKeyPress, onKeyDown: this.props.onKeyDown, onKeyUp: this.props.onKeyUp }, this.renderEditingArea())); |
| 23243 |
}; |
| 23244 |
ReactQuill.prototype.onEditorChangeText = function (value, delta, source, editor) { |
| 23245 |
var _a, _b; |
| 23246 |
if (!this.editor) |
| 23247 |
return; |
| 23248 |
// We keep storing the same type of value as what the user gives us, |
| 23249 |
// so that value comparisons will be more stable and predictable. |
| 23250 |
var nextContents = this.isDelta(this.value) |
| 23251 |
? editor.getContents() |
| 23252 |
: editor.getHTML(); |
| 23253 |
if (nextContents !== this.getEditorContents()) { |
| 23254 |
// Taint this `delta` object, so we can recognize whether the user |
| 23255 |
// is trying to send it back as `value`, preventing a likely loop. |
| 23256 |
this.lastDeltaChangeSet = delta; |
| 23257 |
this.value = nextContents; |
| 23258 |
(_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, value, delta, source, editor); |
| 23259 |
} |
| 23260 |
}; |
| 23261 |
ReactQuill.prototype.onEditorChangeSelection = function (nextSelection, source, editor) { |
| 23262 |
var _a, _b, _c, _d, _e, _f; |
| 23263 |
if (!this.editor) |
| 23264 |
return; |
| 23265 |
var currentSelection = this.getEditorSelection(); |
| 23266 |
var hasGainedFocus = !currentSelection && nextSelection; |
| 23267 |
var hasLostFocus = currentSelection && !nextSelection; |
| 23268 |
if (isEqual_1.default(nextSelection, currentSelection)) |
| 23269 |
return; |
| 23270 |
this.selection = nextSelection; |
| 23271 |
(_b = (_a = this.props).onChangeSelection) === null || _b === void 0 ? void 0 : _b.call(_a, nextSelection, source, editor); |
| 23272 |
if (hasGainedFocus) { |
| 23273 |
(_d = (_c = this.props).onFocus) === null || _d === void 0 ? void 0 : _d.call(_c, nextSelection, source, editor); |
| 23274 |
} |
| 23275 |
else if (hasLostFocus) { |
| 23276 |
(_f = (_e = this.props).onBlur) === null || _f === void 0 ? void 0 : _f.call(_e, currentSelection, source, editor); |
| 23277 |
} |
| 23278 |
}; |
| 23279 |
ReactQuill.prototype.focus = function () { |
| 23280 |
if (!this.editor) |
| 23281 |
return; |
| 23282 |
this.editor.focus(); |
| 23283 |
}; |
| 23284 |
ReactQuill.prototype.blur = function () { |
| 23285 |
if (!this.editor) |
| 23286 |
return; |
| 23287 |
this.selection = null; |
| 23288 |
this.editor.blur(); |
| 23289 |
}; |
| 23290 |
ReactQuill.displayName = 'React Quill'; |
| 23291 |
/* |
| 23292 |
Export Quill to be able to call `register` |
| 23293 |
*/ |
| 23294 |
ReactQuill.Quill = quill_1.default; |
| 23295 |
ReactQuill.defaultProps = { |
| 23296 |
theme: 'snow', |
| 23297 |
modules: {}, |
| 23298 |
readOnly: false, |
| 23299 |
}; |
| 23300 |
return ReactQuill; |
| 23301 |
}(react_1.default.Component)); |
| 23302 |
/* |
| 23303 |
Small helper to execute a function in the next micro-tick. |
| 23304 |
*/ |
| 23305 |
function postpone(fn) { |
| 23306 |
Promise.resolve().then(fn); |
| 23307 |
} |
| 23308 |
module.exports = ReactQuill; |
| 23309 |
//# sourceMappingURL=index.js.map |
| 23310 |
|
| 23311 |
/***/ }), |
| 23312 |
|
| 23313 |
/***/ 9655: |
| 23314 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 23315 |
|
| 23316 |
"use strict"; |
| 23317 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 23318 |
/* harmony export */ "cP": () => (/* binding */ createHashRouter), |
| 23319 |
/* harmony export */ "lr": () => (/* binding */ useSearchParams) |
| 23320 |
/* harmony export */ }); |
| 23321 |
/* unused harmony exports BrowserRouter, Form, HashRouter, Link, NavLink, ScrollRestoration, createBrowserRouter, createSearchParams, unstable_HistoryRouter, useFetcher, useFetchers, useFormAction, useLinkClickHandler, useSubmit */ |
| 23322 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7363); |
| 23323 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 23324 |
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9250); |
| 23325 |
/* harmony import */ var _remix_run_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2599); |
| 23326 |
/** |
| 23327 |
* React Router DOM v6.4.3 |
| 23328 |
* |
| 23329 |
* Copyright (c) Remix Software Inc. |
| 23330 |
* |
| 23331 |
* This source code is licensed under the MIT license found in the |
| 23332 |
* LICENSE.md file in the root directory of this source tree. |
| 23333 |
* |
| 23334 |
* @license MIT |
| 23335 |
*/ |
| 23336 |
|
| 23337 |
|
| 23338 |
|
| 23339 |
|
| 23340 |
|
| 23341 |
function _extends() { |
| 23342 |
_extends = Object.assign ? Object.assign.bind() : function (target) { |
| 23343 |
for (var i = 1; i < arguments.length; i++) { |
| 23344 |
var source = arguments[i]; |
| 23345 |
|
| 23346 |
for (var key in source) { |
| 23347 |
if (Object.prototype.hasOwnProperty.call(source, key)) { |
| 23348 |
target[key] = source[key]; |
| 23349 |
} |
| 23350 |
} |
| 23351 |
} |
| 23352 |
|
| 23353 |
return target; |
| 23354 |
}; |
| 23355 |
return _extends.apply(this, arguments); |
| 23356 |
} |
| 23357 |
|
| 23358 |
function _objectWithoutPropertiesLoose(source, excluded) { |
| 23359 |
if (source == null) return {}; |
| 23360 |
var target = {}; |
| 23361 |
var sourceKeys = Object.keys(source); |
| 23362 |
var key, i; |
| 23363 |
|
| 23364 |
for (i = 0; i < sourceKeys.length; i++) { |
| 23365 |
key = sourceKeys[i]; |
| 23366 |
if (excluded.indexOf(key) >= 0) continue; |
| 23367 |
target[key] = source[key]; |
| 23368 |
} |
| 23369 |
|
| 23370 |
return target; |
| 23371 |
} |
| 23372 |
|
| 23373 |
const defaultMethod = "get"; |
| 23374 |
const defaultEncType = "application/x-www-form-urlencoded"; |
| 23375 |
function isHtmlElement(object) { |
| 23376 |
return object != null && typeof object.tagName === "string"; |
| 23377 |
} |
| 23378 |
function isButtonElement(object) { |
| 23379 |
return isHtmlElement(object) && object.tagName.toLowerCase() === "button"; |
| 23380 |
} |
| 23381 |
function isFormElement(object) { |
| 23382 |
return isHtmlElement(object) && object.tagName.toLowerCase() === "form"; |
| 23383 |
} |
| 23384 |
function isInputElement(object) { |
| 23385 |
return isHtmlElement(object) && object.tagName.toLowerCase() === "input"; |
| 23386 |
} |
| 23387 |
|
| 23388 |
function isModifiedEvent(event) { |
| 23389 |
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); |
| 23390 |
} |
| 23391 |
|
| 23392 |
function shouldProcessLinkClick(event, target) { |
| 23393 |
return event.button === 0 && ( // Ignore everything but left clicks |
| 23394 |
!target || target === "_self") && // Let browser handle "target=_blank" etc. |
| 23395 |
!isModifiedEvent(event) // Ignore clicks with modifier keys |
| 23396 |
; |
| 23397 |
} |
| 23398 |
/** |
| 23399 |
* Creates a URLSearchParams object using the given initializer. |
| 23400 |
* |
| 23401 |
* This is identical to `new URLSearchParams(init)` except it also |
| 23402 |
* supports arrays as values in the object form of the initializer |
| 23403 |
* instead of just strings. This is convenient when you need multiple |
| 23404 |
* values for a given key, but don't want to use an array initializer. |
| 23405 |
* |
| 23406 |
* For example, instead of: |
| 23407 |
* |
| 23408 |
* let searchParams = new URLSearchParams([ |
| 23409 |
* ['sort', 'name'], |
| 23410 |
* ['sort', 'price'] |
| 23411 |
* ]); |
| 23412 |
* |
| 23413 |
* you can do: |
| 23414 |
* |
| 23415 |
* let searchParams = createSearchParams({ |
| 23416 |
* sort: ['name', 'price'] |
| 23417 |
* }); |
| 23418 |
*/ |
| 23419 |
|
| 23420 |
function createSearchParams(init) { |
| 23421 |
if (init === void 0) { |
| 23422 |
init = ""; |
| 23423 |
} |
| 23424 |
|
| 23425 |
return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => { |
| 23426 |
let value = init[key]; |
| 23427 |
return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]); |
| 23428 |
}, [])); |
| 23429 |
} |
| 23430 |
function getSearchParamsForLocation(locationSearch, defaultSearchParams) { |
| 23431 |
let searchParams = createSearchParams(locationSearch); |
| 23432 |
|
| 23433 |
for (let key of defaultSearchParams.keys()) { |
| 23434 |
if (!searchParams.has(key)) { |
| 23435 |
defaultSearchParams.getAll(key).forEach(value => { |
| 23436 |
searchParams.append(key, value); |
| 23437 |
}); |
| 23438 |
} |
| 23439 |
} |
| 23440 |
|
| 23441 |
return searchParams; |
| 23442 |
} |
| 23443 |
function getFormSubmissionInfo(target, defaultAction, options) { |
| 23444 |
let method; |
| 23445 |
let action; |
| 23446 |
let encType; |
| 23447 |
let formData; |
| 23448 |
|
| 23449 |
if (isFormElement(target)) { |
| 23450 |
let submissionTrigger = options.submissionTrigger; |
| 23451 |
method = options.method || target.getAttribute("method") || defaultMethod; |
| 23452 |
action = options.action || target.getAttribute("action") || defaultAction; |
| 23453 |
encType = options.encType || target.getAttribute("enctype") || defaultEncType; |
| 23454 |
formData = new FormData(target); |
| 23455 |
|
| 23456 |
if (submissionTrigger && submissionTrigger.name) { |
| 23457 |
formData.append(submissionTrigger.name, submissionTrigger.value); |
| 23458 |
} |
| 23459 |
} else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) { |
| 23460 |
let form = target.form; |
| 23461 |
|
| 23462 |
if (form == null) { |
| 23463 |
throw new Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>"); |
| 23464 |
} // <button>/<input type="submit"> may override attributes of <form> |
| 23465 |
|
| 23466 |
|
| 23467 |
method = options.method || target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod; |
| 23468 |
action = options.action || target.getAttribute("formaction") || form.getAttribute("action") || defaultAction; |
| 23469 |
encType = options.encType || target.getAttribute("formenctype") || form.getAttribute("enctype") || defaultEncType; |
| 23470 |
formData = new FormData(form); // Include name + value from a <button>, appending in case the button name |
| 23471 |
// matches an existing input name |
| 23472 |
|
| 23473 |
if (target.name) { |
| 23474 |
formData.append(target.name, target.value); |
| 23475 |
} |
| 23476 |
} else if (isHtmlElement(target)) { |
| 23477 |
throw new Error("Cannot submit element that is not <form>, <button>, or " + "<input type=\"submit|image\">"); |
| 23478 |
} else { |
| 23479 |
method = options.method || defaultMethod; |
| 23480 |
action = options.action || defaultAction; |
| 23481 |
encType = options.encType || defaultEncType; |
| 23482 |
|
| 23483 |
if (target instanceof FormData) { |
| 23484 |
formData = target; |
| 23485 |
} else { |
| 23486 |
formData = new FormData(); |
| 23487 |
|
| 23488 |
if (target instanceof URLSearchParams) { |
| 23489 |
for (let [name, value] of target) { |
| 23490 |
formData.append(name, value); |
| 23491 |
} |
| 23492 |
} else if (target != null) { |
| 23493 |
for (let name of Object.keys(target)) { |
| 23494 |
formData.append(name, target[name]); |
| 23495 |
} |
| 23496 |
} |
| 23497 |
} |
| 23498 |
} |
| 23499 |
|
| 23500 |
let { |
| 23501 |
protocol, |
| 23502 |
host |
| 23503 |
} = window.location; |
| 23504 |
let url = new URL(action, protocol + "//" + host); |
| 23505 |
return { |
| 23506 |
url, |
| 23507 |
method, |
| 23508 |
encType, |
| 23509 |
formData |
| 23510 |
}; |
| 23511 |
} |
| 23512 |
|
| 23513 |
const _excluded = (/* unused pure expression or super */ null && (["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"])), |
| 23514 |
_excluded2 = (/* unused pure expression or super */ null && (["aria-current", "caseSensitive", "className", "end", "style", "to", "children"])), |
| 23515 |
_excluded3 = (/* unused pure expression or super */ null && (["reloadDocument", "replace", "method", "action", "onSubmit", "fetcherKey", "routeId", "relative"])); |
| 23516 |
//#region Routers |
| 23517 |
//////////////////////////////////////////////////////////////////////////////// |
| 23518 |
|
| 23519 |
function createBrowserRouter(routes, opts) { |
| 23520 |
var _window; |
| 23521 |
|
| 23522 |
return createRouter({ |
| 23523 |
basename: opts == null ? void 0 : opts.basename, |
| 23524 |
history: createBrowserHistory({ |
| 23525 |
window: opts == null ? void 0 : opts.window |
| 23526 |
}), |
| 23527 |
hydrationData: (opts == null ? void 0 : opts.hydrationData) || ((_window = window) == null ? void 0 : _window.__staticRouterHydrationData), |
| 23528 |
routes: UNSAFE_enhanceManualRouteObjects(routes) |
| 23529 |
}).initialize(); |
| 23530 |
} |
| 23531 |
function createHashRouter(routes, opts) { |
| 23532 |
var _window2; |
| 23533 |
|
| 23534 |
return (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .createRouter */ .p7)({ |
| 23535 |
basename: opts == null ? void 0 : opts.basename, |
| 23536 |
history: (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .createHashHistory */ .q_)({ |
| 23537 |
window: opts == null ? void 0 : opts.window |
| 23538 |
}), |
| 23539 |
hydrationData: (opts == null ? void 0 : opts.hydrationData) || ((_window2 = window) == null ? void 0 : _window2.__staticRouterHydrationData), |
| 23540 |
routes: (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .UNSAFE_enhanceManualRouteObjects */ .DG)(routes) |
| 23541 |
}).initialize(); |
| 23542 |
} |
| 23543 |
/** |
| 23544 |
* A `<Router>` for use in web browsers. Provides the cleanest URLs. |
| 23545 |
*/ |
| 23546 |
|
| 23547 |
function BrowserRouter(_ref) { |
| 23548 |
let { |
| 23549 |
basename, |
| 23550 |
children, |
| 23551 |
window |
| 23552 |
} = _ref; |
| 23553 |
let historyRef = React.useRef(); |
| 23554 |
|
| 23555 |
if (historyRef.current == null) { |
| 23556 |
historyRef.current = createBrowserHistory({ |
| 23557 |
window, |
| 23558 |
v5Compat: true |
| 23559 |
}); |
| 23560 |
} |
| 23561 |
|
| 23562 |
let history = historyRef.current; |
| 23563 |
let [state, setState] = React.useState({ |
| 23564 |
action: history.action, |
| 23565 |
location: history.location |
| 23566 |
}); |
| 23567 |
React.useLayoutEffect(() => history.listen(setState), [history]); |
| 23568 |
return /*#__PURE__*/React.createElement(Router, { |
| 23569 |
basename: basename, |
| 23570 |
children: children, |
| 23571 |
location: state.location, |
| 23572 |
navigationType: state.action, |
| 23573 |
navigator: history |
| 23574 |
}); |
| 23575 |
} |
| 23576 |
/** |
| 23577 |
* A `<Router>` for use in web browsers. Stores the location in the hash |
| 23578 |
* portion of the URL so it is not sent to the server. |
| 23579 |
*/ |
| 23580 |
|
| 23581 |
function HashRouter(_ref2) { |
| 23582 |
let { |
| 23583 |
basename, |
| 23584 |
children, |
| 23585 |
window |
| 23586 |
} = _ref2; |
| 23587 |
let historyRef = React.useRef(); |
| 23588 |
|
| 23589 |
if (historyRef.current == null) { |
| 23590 |
historyRef.current = createHashHistory({ |
| 23591 |
window, |
| 23592 |
v5Compat: true |
| 23593 |
}); |
| 23594 |
} |
| 23595 |
|
| 23596 |
let history = historyRef.current; |
| 23597 |
let [state, setState] = React.useState({ |
| 23598 |
action: history.action, |
| 23599 |
location: history.location |
| 23600 |
}); |
| 23601 |
React.useLayoutEffect(() => history.listen(setState), [history]); |
| 23602 |
return /*#__PURE__*/React.createElement(Router, { |
| 23603 |
basename: basename, |
| 23604 |
children: children, |
| 23605 |
location: state.location, |
| 23606 |
navigationType: state.action, |
| 23607 |
navigator: history |
| 23608 |
}); |
| 23609 |
} |
| 23610 |
/** |
| 23611 |
* A `<Router>` that accepts a pre-instantiated history object. It's important |
| 23612 |
* to note that using your own history object is highly discouraged and may add |
| 23613 |
* two versions of the history library to your bundles unless you use the same |
| 23614 |
* version of the history library that React Router uses internally. |
| 23615 |
*/ |
| 23616 |
|
| 23617 |
function HistoryRouter(_ref3) { |
| 23618 |
let { |
| 23619 |
basename, |
| 23620 |
children, |
| 23621 |
history |
| 23622 |
} = _ref3; |
| 23623 |
const [state, setState] = React.useState({ |
| 23624 |
action: history.action, |
| 23625 |
location: history.location |
| 23626 |
}); |
| 23627 |
React.useLayoutEffect(() => history.listen(setState), [history]); |
| 23628 |
return /*#__PURE__*/React.createElement(Router, { |
| 23629 |
basename: basename, |
| 23630 |
children: children, |
| 23631 |
location: state.location, |
| 23632 |
navigationType: state.action, |
| 23633 |
navigator: history |
| 23634 |
}); |
| 23635 |
} |
| 23636 |
|
| 23637 |
if (false) {} |
| 23638 |
/** |
| 23639 |
* The public API for rendering a history-aware <a>. |
| 23640 |
*/ |
| 23641 |
|
| 23642 |
const Link = /*#__PURE__*/(/* unused pure expression or super */ null && (React.forwardRef(function LinkWithRef(_ref4, ref) { |
| 23643 |
let { |
| 23644 |
onClick, |
| 23645 |
relative, |
| 23646 |
reloadDocument, |
| 23647 |
replace, |
| 23648 |
state, |
| 23649 |
target, |
| 23650 |
to, |
| 23651 |
preventScrollReset |
| 23652 |
} = _ref4, |
| 23653 |
rest = _objectWithoutPropertiesLoose(_ref4, _excluded); |
| 23654 |
|
| 23655 |
let href = useHref(to, { |
| 23656 |
relative |
| 23657 |
}); |
| 23658 |
let internalOnClick = useLinkClickHandler(to, { |
| 23659 |
replace, |
| 23660 |
state, |
| 23661 |
target, |
| 23662 |
preventScrollReset, |
| 23663 |
relative |
| 23664 |
}); |
| 23665 |
|
| 23666 |
function handleClick(event) { |
| 23667 |
if (onClick) onClick(event); |
| 23668 |
|
| 23669 |
if (!event.defaultPrevented) { |
| 23670 |
internalOnClick(event); |
| 23671 |
} |
| 23672 |
} |
| 23673 |
|
| 23674 |
return ( |
| 23675 |
/*#__PURE__*/ |
| 23676 |
// eslint-disable-next-line jsx-a11y/anchor-has-content |
| 23677 |
React.createElement("a", _extends({}, rest, { |
| 23678 |
href: href, |
| 23679 |
onClick: reloadDocument ? onClick : handleClick, |
| 23680 |
ref: ref, |
| 23681 |
target: target |
| 23682 |
})) |
| 23683 |
); |
| 23684 |
}))); |
| 23685 |
|
| 23686 |
if (false) {} |
| 23687 |
/** |
| 23688 |
* A <Link> wrapper that knows if it's "active" or not. |
| 23689 |
*/ |
| 23690 |
|
| 23691 |
|
| 23692 |
const NavLink = /*#__PURE__*/(/* unused pure expression or super */ null && (React.forwardRef(function NavLinkWithRef(_ref5, ref) { |
| 23693 |
let { |
| 23694 |
"aria-current": ariaCurrentProp = "page", |
| 23695 |
caseSensitive = false, |
| 23696 |
className: classNameProp = "", |
| 23697 |
end = false, |
| 23698 |
style: styleProp, |
| 23699 |
to, |
| 23700 |
children |
| 23701 |
} = _ref5, |
| 23702 |
rest = _objectWithoutPropertiesLoose(_ref5, _excluded2); |
| 23703 |
|
| 23704 |
let path = useResolvedPath(to, { |
| 23705 |
relative: rest.relative |
| 23706 |
}); |
| 23707 |
let location = useLocation(); |
| 23708 |
let routerState = React.useContext(UNSAFE_DataRouterStateContext); |
| 23709 |
let toPathname = path.pathname; |
| 23710 |
let locationPathname = location.pathname; |
| 23711 |
let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null; |
| 23712 |
|
| 23713 |
if (!caseSensitive) { |
| 23714 |
locationPathname = locationPathname.toLowerCase(); |
| 23715 |
nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null; |
| 23716 |
toPathname = toPathname.toLowerCase(); |
| 23717 |
} |
| 23718 |
|
| 23719 |
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/"; |
| 23720 |
let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/"); |
| 23721 |
let ariaCurrent = isActive ? ariaCurrentProp : undefined; |
| 23722 |
let className; |
| 23723 |
|
| 23724 |
if (typeof classNameProp === "function") { |
| 23725 |
className = classNameProp({ |
| 23726 |
isActive, |
| 23727 |
isPending |
| 23728 |
}); |
| 23729 |
} else { |
| 23730 |
// If the className prop is not a function, we use a default `active` |
| 23731 |
// class for <NavLink />s that are active. In v5 `active` was the default |
| 23732 |
// value for `activeClassName`, but we are removing that API and can still |
| 23733 |
// use the old default behavior for a cleaner upgrade path and keep the |
| 23734 |
// simple styling rules working as they currently do. |
| 23735 |
className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null].filter(Boolean).join(" "); |
| 23736 |
} |
| 23737 |
|
| 23738 |
let style = typeof styleProp === "function" ? styleProp({ |
| 23739 |
isActive, |
| 23740 |
isPending |
| 23741 |
}) : styleProp; |
| 23742 |
return /*#__PURE__*/React.createElement(Link, _extends({}, rest, { |
| 23743 |
"aria-current": ariaCurrent, |
| 23744 |
className: className, |
| 23745 |
ref: ref, |
| 23746 |
style: style, |
| 23747 |
to: to |
| 23748 |
}), typeof children === "function" ? children({ |
| 23749 |
isActive, |
| 23750 |
isPending |
| 23751 |
}) : children); |
| 23752 |
}))); |
| 23753 |
|
| 23754 |
if (false) {} |
| 23755 |
/** |
| 23756 |
* A `@remix-run/router`-aware `<form>`. It behaves like a normal form except |
| 23757 |
* that the interaction with the server is with `fetch` instead of new document |
| 23758 |
* requests, allowing components to add nicer UX to the page as the form is |
| 23759 |
* submitted and returns with data. |
| 23760 |
*/ |
| 23761 |
|
| 23762 |
|
| 23763 |
const Form = /*#__PURE__*/(/* unused pure expression or super */ null && (React.forwardRef((props, ref) => { |
| 23764 |
return /*#__PURE__*/React.createElement(FormImpl, _extends({}, props, { |
| 23765 |
ref: ref |
| 23766 |
})); |
| 23767 |
}))); |
| 23768 |
|
| 23769 |
if (false) {} |
| 23770 |
|
| 23771 |
const FormImpl = /*#__PURE__*/(/* unused pure expression or super */ null && (React.forwardRef((_ref6, forwardedRef) => { |
| 23772 |
let { |
| 23773 |
reloadDocument, |
| 23774 |
replace, |
| 23775 |
method = defaultMethod, |
| 23776 |
action, |
| 23777 |
onSubmit, |
| 23778 |
fetcherKey, |
| 23779 |
routeId, |
| 23780 |
relative |
| 23781 |
} = _ref6, |
| 23782 |
props = _objectWithoutPropertiesLoose(_ref6, _excluded3); |
| 23783 |
|
| 23784 |
let submit = useSubmitImpl(fetcherKey, routeId); |
| 23785 |
let formMethod = method.toLowerCase() === "get" ? "get" : "post"; |
| 23786 |
let formAction = useFormAction(action, { |
| 23787 |
relative |
| 23788 |
}); |
| 23789 |
|
| 23790 |
let submitHandler = event => { |
| 23791 |
onSubmit && onSubmit(event); |
| 23792 |
if (event.defaultPrevented) return; |
| 23793 |
event.preventDefault(); |
| 23794 |
let submitter = event.nativeEvent.submitter; |
| 23795 |
submit(submitter || event.currentTarget, { |
| 23796 |
method, |
| 23797 |
replace, |
| 23798 |
relative |
| 23799 |
}); |
| 23800 |
}; |
| 23801 |
|
| 23802 |
return /*#__PURE__*/React.createElement("form", _extends({ |
| 23803 |
ref: forwardedRef, |
| 23804 |
method: formMethod, |
| 23805 |
action: formAction, |
| 23806 |
onSubmit: reloadDocument ? onSubmit : submitHandler |
| 23807 |
}, props)); |
| 23808 |
}))); |
| 23809 |
|
| 23810 |
if (false) {} |
| 23811 |
/** |
| 23812 |
* This component will emulate the browser's scroll restoration on location |
| 23813 |
* changes. |
| 23814 |
*/ |
| 23815 |
|
| 23816 |
|
| 23817 |
function ScrollRestoration(_ref7) { |
| 23818 |
let { |
| 23819 |
getKey, |
| 23820 |
storageKey |
| 23821 |
} = _ref7; |
| 23822 |
useScrollRestoration({ |
| 23823 |
getKey, |
| 23824 |
storageKey |
| 23825 |
}); |
| 23826 |
return null; |
| 23827 |
} |
| 23828 |
|
| 23829 |
if (false) {} //#endregion |
| 23830 |
//////////////////////////////////////////////////////////////////////////////// |
| 23831 |
//#region Hooks |
| 23832 |
//////////////////////////////////////////////////////////////////////////////// |
| 23833 |
|
| 23834 |
|
| 23835 |
var DataRouterHook; |
| 23836 |
|
| 23837 |
(function (DataRouterHook) { |
| 23838 |
DataRouterHook["UseScrollRestoration"] = "useScrollRestoration"; |
| 23839 |
DataRouterHook["UseSubmitImpl"] = "useSubmitImpl"; |
| 23840 |
DataRouterHook["UseFetcher"] = "useFetcher"; |
| 23841 |
})(DataRouterHook || (DataRouterHook = {})); |
| 23842 |
|
| 23843 |
var DataRouterStateHook; |
| 23844 |
|
| 23845 |
(function (DataRouterStateHook) { |
| 23846 |
DataRouterStateHook["UseFetchers"] = "useFetchers"; |
| 23847 |
DataRouterStateHook["UseScrollRestoration"] = "useScrollRestoration"; |
| 23848 |
})(DataRouterStateHook || (DataRouterStateHook = {})); |
| 23849 |
|
| 23850 |
function getDataRouterConsoleError(hookName) { |
| 23851 |
return hookName + " must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router."; |
| 23852 |
} |
| 23853 |
|
| 23854 |
function useDataRouterContext(hookName) { |
| 23855 |
let ctx = React.useContext(UNSAFE_DataRouterContext); |
| 23856 |
!ctx ? false ? 0 : invariant(false) : void 0; |
| 23857 |
return ctx; |
| 23858 |
} |
| 23859 |
|
| 23860 |
function useDataRouterState(hookName) { |
| 23861 |
let state = React.useContext(UNSAFE_DataRouterStateContext); |
| 23862 |
!state ? false ? 0 : invariant(false) : void 0; |
| 23863 |
return state; |
| 23864 |
} |
| 23865 |
/** |
| 23866 |
* Handles the click behavior for router `<Link>` components. This is useful if |
| 23867 |
* you need to create custom `<Link>` components with the same click behavior we |
| 23868 |
* use in our exported `<Link>`. |
| 23869 |
*/ |
| 23870 |
|
| 23871 |
|
| 23872 |
function useLinkClickHandler(to, _temp) { |
| 23873 |
let { |
| 23874 |
target, |
| 23875 |
replace: replaceProp, |
| 23876 |
state, |
| 23877 |
preventScrollReset, |
| 23878 |
relative |
| 23879 |
} = _temp === void 0 ? {} : _temp; |
| 23880 |
let navigate = useNavigate(); |
| 23881 |
let location = useLocation(); |
| 23882 |
let path = useResolvedPath(to, { |
| 23883 |
relative |
| 23884 |
}); |
| 23885 |
return React.useCallback(event => { |
| 23886 |
if (shouldProcessLinkClick(event, target)) { |
| 23887 |
event.preventDefault(); // If the URL hasn't changed, a regular <a> will do a replace instead of |
| 23888 |
// a push, so do the same here unless the replace prop is explicitly set |
| 23889 |
|
| 23890 |
let replace = replaceProp !== undefined ? replaceProp : createPath(location) === createPath(path); |
| 23891 |
navigate(to, { |
| 23892 |
replace, |
| 23893 |
state, |
| 23894 |
preventScrollReset, |
| 23895 |
relative |
| 23896 |
}); |
| 23897 |
} |
| 23898 |
}, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative]); |
| 23899 |
} |
| 23900 |
/** |
| 23901 |
* A convenient wrapper for reading and writing search parameters via the |
| 23902 |
* URLSearchParams interface. |
| 23903 |
*/ |
| 23904 |
|
| 23905 |
function useSearchParams(defaultInit) { |
| 23906 |
false ? 0 : void 0; |
| 23907 |
let defaultSearchParamsRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(createSearchParams(defaultInit)); |
| 23908 |
let location = (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .TH)(); |
| 23909 |
let searchParams = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => getSearchParamsForLocation(location.search, defaultSearchParamsRef.current), [location.search]); |
| 23910 |
let navigate = (0,react_router__WEBPACK_IMPORTED_MODULE_2__/* .useNavigate */ .s0)(); |
| 23911 |
let setSearchParams = react__WEBPACK_IMPORTED_MODULE_0__.useCallback((nextInit, navigateOptions) => { |
| 23912 |
const newSearchParams = createSearchParams(typeof nextInit === "function" ? nextInit(searchParams) : nextInit); |
| 23913 |
navigate("?" + newSearchParams, navigateOptions); |
| 23914 |
}, [navigate, searchParams]); |
| 23915 |
return [searchParams, setSearchParams]; |
| 23916 |
} |
| 23917 |
/** |
| 23918 |
* Returns a function that may be used to programmatically submit a form (or |
| 23919 |
* some arbitrary data) to the server. |
| 23920 |
*/ |
| 23921 |
|
| 23922 |
function useSubmit() { |
| 23923 |
return useSubmitImpl(); |
| 23924 |
} |
| 23925 |
|
| 23926 |
function useSubmitImpl(fetcherKey, routeId) { |
| 23927 |
let { |
| 23928 |
router |
| 23929 |
} = useDataRouterContext(DataRouterHook.UseSubmitImpl); |
| 23930 |
let defaultAction = useFormAction(); |
| 23931 |
return React.useCallback(function (target, options) { |
| 23932 |
if (options === void 0) { |
| 23933 |
options = {}; |
| 23934 |
} |
| 23935 |
|
| 23936 |
if (typeof document === "undefined") { |
| 23937 |
throw new Error("You are calling submit during the server render. " + "Try calling submit within a `useEffect` or callback instead."); |
| 23938 |
} |
| 23939 |
|
| 23940 |
let { |
| 23941 |
method, |
| 23942 |
encType, |
| 23943 |
formData, |
| 23944 |
url |
| 23945 |
} = getFormSubmissionInfo(target, defaultAction, options); |
| 23946 |
let href = url.pathname + url.search; |
| 23947 |
let opts = { |
| 23948 |
replace: options.replace, |
| 23949 |
formData, |
| 23950 |
formMethod: method, |
| 23951 |
formEncType: encType |
| 23952 |
}; |
| 23953 |
|
| 23954 |
if (fetcherKey) { |
| 23955 |
!(routeId != null) ? false ? 0 : invariant(false) : void 0; |
| 23956 |
router.fetch(fetcherKey, routeId, href, opts); |
| 23957 |
} else { |
| 23958 |
router.navigate(href, opts); |
| 23959 |
} |
| 23960 |
}, [defaultAction, router, fetcherKey, routeId]); |
| 23961 |
} |
| 23962 |
|
| 23963 |
function useFormAction(action, _temp2) { |
| 23964 |
let { |
| 23965 |
relative |
| 23966 |
} = _temp2 === void 0 ? {} : _temp2; |
| 23967 |
let { |
| 23968 |
basename |
| 23969 |
} = React.useContext(UNSAFE_NavigationContext); |
| 23970 |
let routeContext = React.useContext(UNSAFE_RouteContext); |
| 23971 |
!routeContext ? false ? 0 : invariant(false) : void 0; |
| 23972 |
let [match] = routeContext.matches.slice(-1); |
| 23973 |
let resolvedAction = action != null ? action : "."; // Shallow clone path so we can modify it below, otherwise we modify the |
| 23974 |
// object referenced by useMemo inside useResolvedPath |
| 23975 |
|
| 23976 |
let path = _extends({}, useResolvedPath(resolvedAction, { |
| 23977 |
relative |
| 23978 |
})); // Previously we set the default action to ".". The problem with this is that |
| 23979 |
// `useResolvedPath(".")` excludes search params and the hash of the resolved |
| 23980 |
// URL. This is the intended behavior of when "." is specifically provided as |
| 23981 |
// the form action, but inconsistent w/ browsers when the action is omitted. |
| 23982 |
// https://github.com/remix-run/remix/issues/927 |
| 23983 |
|
| 23984 |
|
| 23985 |
let location = useLocation(); |
| 23986 |
|
| 23987 |
if (action == null) { |
| 23988 |
// Safe to write to these directly here since if action was undefined, we |
| 23989 |
// would have called useResolvedPath(".") which will never include a search |
| 23990 |
// or hash |
| 23991 |
path.search = location.search; |
| 23992 |
path.hash = location.hash; // When grabbing search params from the URL, remove the automatically |
| 23993 |
// inserted ?index param so we match the useResolvedPath search behavior |
| 23994 |
// which would not include ?index |
| 23995 |
|
| 23996 |
if (match.route.index) { |
| 23997 |
let params = new URLSearchParams(path.search); |
| 23998 |
params.delete("index"); |
| 23999 |
path.search = params.toString() ? "?" + params.toString() : ""; |
| 24000 |
} |
| 24001 |
} |
| 24002 |
|
| 24003 |
if ((!action || action === ".") && match.route.index) { |
| 24004 |
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index"; |
| 24005 |
} // If we're operating within a basename, prepend it to the pathname prior |
| 24006 |
// to creating the form action. If this is a root navigation, then just use |
| 24007 |
// the raw basename which allows the basename to have full control over the |
| 24008 |
// presence of a trailing slash on root actions |
| 24009 |
|
| 24010 |
|
| 24011 |
if (basename !== "/") { |
| 24012 |
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]); |
| 24013 |
} |
| 24014 |
|
| 24015 |
return createPath(path); |
| 24016 |
} |
| 24017 |
|
| 24018 |
function createFetcherForm(fetcherKey, routeId) { |
| 24019 |
let FetcherForm = /*#__PURE__*/React.forwardRef((props, ref) => { |
| 24020 |
return /*#__PURE__*/React.createElement(FormImpl, _extends({}, props, { |
| 24021 |
ref: ref, |
| 24022 |
fetcherKey: fetcherKey, |
| 24023 |
routeId: routeId |
| 24024 |
})); |
| 24025 |
}); |
| 24026 |
|
| 24027 |
if (false) {} |
| 24028 |
|
| 24029 |
return FetcherForm; |
| 24030 |
} |
| 24031 |
|
| 24032 |
let fetcherId = 0; |
| 24033 |
/** |
| 24034 |
* Interacts with route loaders and actions without causing a navigation. Great |
| 24035 |
* for any interaction that stays on the same page. |
| 24036 |
*/ |
| 24037 |
|
| 24038 |
function useFetcher() { |
| 24039 |
var _route$matches; |
| 24040 |
|
| 24041 |
let { |
| 24042 |
router |
| 24043 |
} = useDataRouterContext(DataRouterHook.UseFetcher); |
| 24044 |
let route = React.useContext(UNSAFE_RouteContext); |
| 24045 |
!route ? false ? 0 : invariant(false) : void 0; |
| 24046 |
let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id; |
| 24047 |
!(routeId != null) ? false ? 0 : invariant(false) : void 0; |
| 24048 |
let [fetcherKey] = React.useState(() => String(++fetcherId)); |
| 24049 |
let [Form] = React.useState(() => { |
| 24050 |
!routeId ? false ? 0 : invariant(false) : void 0; |
| 24051 |
return createFetcherForm(fetcherKey, routeId); |
| 24052 |
}); |
| 24053 |
let [load] = React.useState(() => href => { |
| 24054 |
!router ? false ? 0 : invariant(false) : void 0; |
| 24055 |
!routeId ? false ? 0 : invariant(false) : void 0; |
| 24056 |
router.fetch(fetcherKey, routeId, href); |
| 24057 |
}); |
| 24058 |
let submit = useSubmitImpl(fetcherKey, routeId); |
| 24059 |
let fetcher = router.getFetcher(fetcherKey); |
| 24060 |
let fetcherWithComponents = React.useMemo(() => _extends({ |
| 24061 |
Form, |
| 24062 |
submit, |
| 24063 |
load |
| 24064 |
}, fetcher), [fetcher, Form, submit, load]); |
| 24065 |
React.useEffect(() => { |
| 24066 |
// Is this busted when the React team gets real weird and calls effects |
| 24067 |
// twice on mount? We really just need to garbage collect here when this |
| 24068 |
// fetcher is no longer around. |
| 24069 |
return () => { |
| 24070 |
if (!router) { |
| 24071 |
console.warn("No fetcher available to clean up from useFetcher()"); |
| 24072 |
return; |
| 24073 |
} |
| 24074 |
|
| 24075 |
router.deleteFetcher(fetcherKey); |
| 24076 |
}; |
| 24077 |
}, [router, fetcherKey]); |
| 24078 |
return fetcherWithComponents; |
| 24079 |
} |
| 24080 |
/** |
| 24081 |
* Provides all fetchers currently on the page. Useful for layouts and parent |
| 24082 |
* routes that need to provide pending/optimistic UI regarding the fetch. |
| 24083 |
*/ |
| 24084 |
|
| 24085 |
function useFetchers() { |
| 24086 |
let state = useDataRouterState(DataRouterStateHook.UseFetchers); |
| 24087 |
return [...state.fetchers.values()]; |
| 24088 |
} |
| 24089 |
const SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions"; |
| 24090 |
let savedScrollPositions = {}; |
| 24091 |
/** |
| 24092 |
* When rendered inside a RouterProvider, will restore scroll positions on navigations |
| 24093 |
*/ |
| 24094 |
|
| 24095 |
function useScrollRestoration(_temp3) { |
| 24096 |
let { |
| 24097 |
getKey, |
| 24098 |
storageKey |
| 24099 |
} = _temp3 === void 0 ? {} : _temp3; |
| 24100 |
let { |
| 24101 |
router |
| 24102 |
} = useDataRouterContext(DataRouterHook.UseScrollRestoration); |
| 24103 |
let { |
| 24104 |
restoreScrollPosition, |
| 24105 |
preventScrollReset |
| 24106 |
} = useDataRouterState(DataRouterStateHook.UseScrollRestoration); |
| 24107 |
let location = useLocation(); |
| 24108 |
let matches = useMatches(); |
| 24109 |
let navigation = useNavigation(); // Trigger manual scroll restoration while we're active |
| 24110 |
|
| 24111 |
React.useEffect(() => { |
| 24112 |
window.history.scrollRestoration = "manual"; |
| 24113 |
return () => { |
| 24114 |
window.history.scrollRestoration = "auto"; |
| 24115 |
}; |
| 24116 |
}, []); // Save positions on unload |
| 24117 |
|
| 24118 |
useBeforeUnload(React.useCallback(() => { |
| 24119 |
if (navigation.state === "idle") { |
| 24120 |
let key = (getKey ? getKey(location, matches) : null) || location.key; |
| 24121 |
savedScrollPositions[key] = window.scrollY; |
| 24122 |
} |
| 24123 |
|
| 24124 |
sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions)); |
| 24125 |
window.history.scrollRestoration = "auto"; |
| 24126 |
}, [storageKey, getKey, navigation.state, location, matches])); // Read in any saved scroll locations |
| 24127 |
|
| 24128 |
React.useLayoutEffect(() => { |
| 24129 |
try { |
| 24130 |
let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY); |
| 24131 |
|
| 24132 |
if (sessionPositions) { |
| 24133 |
savedScrollPositions = JSON.parse(sessionPositions); |
| 24134 |
} |
| 24135 |
} catch (e) {// no-op, use default empty object |
| 24136 |
} |
| 24137 |
}, [storageKey]); // Enable scroll restoration in the router |
| 24138 |
|
| 24139 |
React.useLayoutEffect(() => { |
| 24140 |
let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKey); |
| 24141 |
return () => disableScrollRestoration && disableScrollRestoration(); |
| 24142 |
}, [router, getKey]); // Restore scrolling when state.restoreScrollPosition changes |
| 24143 |
|
| 24144 |
React.useLayoutEffect(() => { |
| 24145 |
// Explicit false means don't do anything (used for submissions) |
| 24146 |
if (restoreScrollPosition === false) { |
| 24147 |
return; |
| 24148 |
} // been here before, scroll to it |
| 24149 |
|
| 24150 |
|
| 24151 |
if (typeof restoreScrollPosition === "number") { |
| 24152 |
window.scrollTo(0, restoreScrollPosition); |
| 24153 |
return; |
| 24154 |
} // try to scroll to the hash |
| 24155 |
|
| 24156 |
|
| 24157 |
if (location.hash) { |
| 24158 |
let el = document.getElementById(location.hash.slice(1)); |
| 24159 |
|
| 24160 |
if (el) { |
| 24161 |
el.scrollIntoView(); |
| 24162 |
return; |
| 24163 |
} |
| 24164 |
} // Opt out of scroll reset if this link requested it |
| 24165 |
|
| 24166 |
|
| 24167 |
if (preventScrollReset === true) { |
| 24168 |
return; |
| 24169 |
} // otherwise go to the top on new locations |
| 24170 |
|
| 24171 |
|
| 24172 |
window.scrollTo(0, 0); |
| 24173 |
}, [location, restoreScrollPosition, preventScrollReset]); |
| 24174 |
} |
| 24175 |
|
| 24176 |
function useBeforeUnload(callback) { |
| 24177 |
React.useEffect(() => { |
| 24178 |
window.addEventListener("beforeunload", callback); |
| 24179 |
return () => { |
| 24180 |
window.removeEventListener("beforeunload", callback); |
| 24181 |
}; |
| 24182 |
}, [callback]); |
| 24183 |
} //#endregion |
| 24184 |
//////////////////////////////////////////////////////////////////////////////// |
| 24185 |
//#region Utils |
| 24186 |
//////////////////////////////////////////////////////////////////////////////// |
| 24187 |
|
| 24188 |
|
| 24189 |
function warning(cond, message) { |
| 24190 |
if (!cond) { |
| 24191 |
// eslint-disable-next-line no-console |
| 24192 |
if (typeof console !== "undefined") console.warn(message); |
| 24193 |
|
| 24194 |
try { |
| 24195 |
// Welcome to debugging React Router! |
| 24196 |
// |
| 24197 |
// This error is thrown as a convenience so you can more easily |
| 24198 |
// find the source for a warning that appears in the console by |
| 24199 |
// enabling "pause on exceptions" in your JavaScript debugger. |
| 24200 |
throw new Error(message); // eslint-disable-next-line no-empty |
| 24201 |
} catch (e) {} |
| 24202 |
} |
| 24203 |
} //#endregion |
| 24204 |
|
| 24205 |
|
| 24206 |
//# sourceMappingURL=index.js.map |
| 24207 |
|
| 24208 |
|
| 24209 |
/***/ }), |
| 24210 |
|
| 24211 |
/***/ 9250: |
| 24212 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 24213 |
|
| 24214 |
"use strict"; |
| 24215 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 24216 |
/* harmony export */ "DG": () => (/* binding */ enhanceManualRouteObjects), |
| 24217 |
/* harmony export */ "TH": () => (/* binding */ useLocation), |
| 24218 |
/* harmony export */ "UO": () => (/* binding */ useParams), |
| 24219 |
/* harmony export */ "j3": () => (/* binding */ Outlet), |
| 24220 |
/* harmony export */ "pG": () => (/* binding */ RouterProvider), |
| 24221 |
/* harmony export */ "s0": () => (/* binding */ useNavigate) |
| 24222 |
/* harmony export */ }); |
| 24223 |
/* unused harmony exports Await, MemoryRouter, Navigate, Route, Router, Routes, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_DataStaticRouterContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createMemoryRouter, createRoutesFromChildren, createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useMatch, useMatches, useNavigation, useNavigationType, useOutlet, useOutletContext, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes */ |
| 24224 |
/* harmony import */ var _remix_run_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2599); |
| 24225 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7363); |
| 24226 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 24227 |
/** |
| 24228 |
* React Router v6.4.3 |
| 24229 |
* |
| 24230 |
* Copyright (c) Remix Software Inc. |
| 24231 |
* |
| 24232 |
* This source code is licensed under the MIT license found in the |
| 24233 |
* LICENSE.md file in the root directory of this source tree. |
| 24234 |
* |
| 24235 |
* @license MIT |
| 24236 |
*/ |
| 24237 |
|
| 24238 |
|
| 24239 |
|
| 24240 |
|
| 24241 |
function _extends() { |
| 24242 |
_extends = Object.assign ? Object.assign.bind() : function (target) { |
| 24243 |
for (var i = 1; i < arguments.length; i++) { |
| 24244 |
var source = arguments[i]; |
| 24245 |
|
| 24246 |
for (var key in source) { |
| 24247 |
if (Object.prototype.hasOwnProperty.call(source, key)) { |
| 24248 |
target[key] = source[key]; |
| 24249 |
} |
| 24250 |
} |
| 24251 |
} |
| 24252 |
|
| 24253 |
return target; |
| 24254 |
}; |
| 24255 |
return _extends.apply(this, arguments); |
| 24256 |
} |
| 24257 |
|
| 24258 |
/** |
| 24259 |
* Copyright (c) Facebook, Inc. and its affiliates. |
| 24260 |
* |
| 24261 |
* This source code is licensed under the MIT license found in the |
| 24262 |
* LICENSE file in the root directory of this source tree. |
| 24263 |
*/ |
| 24264 |
/** |
| 24265 |
* inlined Object.is polyfill to avoid requiring consumers ship their own |
| 24266 |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is |
| 24267 |
*/ |
| 24268 |
|
| 24269 |
function isPolyfill(x, y) { |
| 24270 |
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare |
| 24271 |
; |
| 24272 |
} |
| 24273 |
|
| 24274 |
const is = typeof Object.is === "function" ? Object.is : isPolyfill; // Intentionally not using named imports because Rollup uses dynamic |
| 24275 |
// dispatch for CommonJS interop named imports. |
| 24276 |
|
| 24277 |
const { |
| 24278 |
useState, |
| 24279 |
useEffect, |
| 24280 |
useLayoutEffect, |
| 24281 |
useDebugValue |
| 24282 |
} = react__WEBPACK_IMPORTED_MODULE_0__; |
| 24283 |
let didWarnOld18Alpha = false; |
| 24284 |
let didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works |
| 24285 |
// because of a very particular set of implementation details and assumptions |
| 24286 |
// -- change any one of them and it will break. The most important assumption |
| 24287 |
// is that updates are always synchronous, because concurrent rendering is |
| 24288 |
// only available in versions of React that also have a built-in |
| 24289 |
// useSyncExternalStore API. And we only use this shim when the built-in API |
| 24290 |
// does not exist. |
| 24291 |
// |
| 24292 |
// Do not assume that the clever hacks used by this hook also work in general. |
| 24293 |
// The point of this shim is to replace the need for hacks by other libraries. |
| 24294 |
|
| 24295 |
function useSyncExternalStore$2(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of |
| 24296 |
// React do not expose a way to check if we're hydrating. So users of the shim |
| 24297 |
// will need to track that themselves and return the correct value |
| 24298 |
// from `getSnapshot`. |
| 24299 |
getServerSnapshot) { |
| 24300 |
if (false) {} // Read the current snapshot from the store on every render. Again, this |
| 24301 |
// breaks the rules of React, and only works here because of specific |
| 24302 |
// implementation details, most importantly that updates are |
| 24303 |
// always synchronous. |
| 24304 |
|
| 24305 |
|
| 24306 |
const value = getSnapshot(); |
| 24307 |
|
| 24308 |
if (false) {} // Because updates are synchronous, we don't queue them. Instead we force a |
| 24309 |
// re-render whenever the subscribed state changes by updating an some |
| 24310 |
// arbitrary useState hook. Then, during render, we call getSnapshot to read |
| 24311 |
// the current value. |
| 24312 |
// |
| 24313 |
// Because we don't actually use the state returned by the useState hook, we |
| 24314 |
// can save a bit of memory by storing other stuff in that slot. |
| 24315 |
// |
| 24316 |
// To implement the early bailout, we need to track some things on a mutable |
| 24317 |
// object. Usually, we would put that in a useRef hook, but we can stash it in |
| 24318 |
// our useState hook instead. |
| 24319 |
// |
| 24320 |
// To force a re-render, we call forceUpdate({inst}). That works because the |
| 24321 |
// new object always fails an equality check. |
| 24322 |
|
| 24323 |
|
| 24324 |
const [{ |
| 24325 |
inst |
| 24326 |
}, forceUpdate] = useState({ |
| 24327 |
inst: { |
| 24328 |
value, |
| 24329 |
getSnapshot |
| 24330 |
} |
| 24331 |
}); // Track the latest getSnapshot function with a ref. This needs to be updated |
| 24332 |
// in the layout phase so we can access it during the tearing check that |
| 24333 |
// happens on subscribe. |
| 24334 |
|
| 24335 |
useLayoutEffect(() => { |
| 24336 |
inst.value = value; |
| 24337 |
inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the |
| 24338 |
// commit phase if there was an interleaved mutation. In concurrent mode |
| 24339 |
// this can happen all the time, but even in synchronous mode, an earlier |
| 24340 |
// effect may have mutated the store. |
| 24341 |
|
| 24342 |
if (checkIfSnapshotChanged(inst)) { |
| 24343 |
// Force a re-render. |
| 24344 |
forceUpdate({ |
| 24345 |
inst |
| 24346 |
}); |
| 24347 |
} // eslint-disable-next-line react-hooks/exhaustive-deps |
| 24348 |
|
| 24349 |
}, [subscribe, value, getSnapshot]); |
| 24350 |
useEffect(() => { |
| 24351 |
// Check for changes right before subscribing. Subsequent changes will be |
| 24352 |
// detected in the subscription handler. |
| 24353 |
if (checkIfSnapshotChanged(inst)) { |
| 24354 |
// Force a re-render. |
| 24355 |
forceUpdate({ |
| 24356 |
inst |
| 24357 |
}); |
| 24358 |
} |
| 24359 |
|
| 24360 |
const handleStoreChange = () => { |
| 24361 |
// TODO: Because there is no cross-renderer API for batching updates, it's |
| 24362 |
// up to the consumer of this library to wrap their subscription event |
| 24363 |
// with unstable_batchedUpdates. Should we try to detect when this isn't |
| 24364 |
// the case and print a warning in development? |
| 24365 |
// The store changed. Check if the snapshot changed since the last time we |
| 24366 |
// read from the store. |
| 24367 |
if (checkIfSnapshotChanged(inst)) { |
| 24368 |
// Force a re-render. |
| 24369 |
forceUpdate({ |
| 24370 |
inst |
| 24371 |
}); |
| 24372 |
} |
| 24373 |
}; // Subscribe to the store and return a clean-up function. |
| 24374 |
|
| 24375 |
|
| 24376 |
return subscribe(handleStoreChange); // eslint-disable-next-line react-hooks/exhaustive-deps |
| 24377 |
}, [subscribe]); |
| 24378 |
useDebugValue(value); |
| 24379 |
return value; |
| 24380 |
} |
| 24381 |
|
| 24382 |
function checkIfSnapshotChanged(inst) { |
| 24383 |
const latestGetSnapshot = inst.getSnapshot; |
| 24384 |
const prevValue = inst.value; |
| 24385 |
|
| 24386 |
try { |
| 24387 |
const nextValue = latestGetSnapshot(); |
| 24388 |
return !is(prevValue, nextValue); |
| 24389 |
} catch (error) { |
| 24390 |
return true; |
| 24391 |
} |
| 24392 |
} |
| 24393 |
|
| 24394 |
/** |
| 24395 |
* Copyright (c) Facebook, Inc. and its affiliates. |
| 24396 |
* |
| 24397 |
* This source code is licensed under the MIT license found in the |
| 24398 |
* LICENSE file in the root directory of this source tree. |
| 24399 |
* |
| 24400 |
* @flow |
| 24401 |
*/ |
| 24402 |
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) { |
| 24403 |
// Note: The shim does not use getServerSnapshot, because pre-18 versions of |
| 24404 |
// React do not expose a way to check if we're hydrating. So users of the shim |
| 24405 |
// will need to track that themselves and return the correct value |
| 24406 |
// from `getSnapshot`. |
| 24407 |
return getSnapshot(); |
| 24408 |
} |
| 24409 |
|
| 24410 |
/** |
| 24411 |
* Inlined into the react-router repo since use-sync-external-store does not |
| 24412 |
* provide a UMD-compatible package, so we need this to be able to distribute |
| 24413 |
* UMD react-router bundles |
| 24414 |
*/ |
| 24415 |
const canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); |
| 24416 |
const isServerEnvironment = !canUseDOM; |
| 24417 |
const shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore$2; |
| 24418 |
const useSyncExternalStore = "useSyncExternalStore" in react__WEBPACK_IMPORTED_MODULE_0__ ? (module => module.useSyncExternalStore)(react__WEBPACK_IMPORTED_MODULE_0__) : shim; |
| 24419 |
|
| 24420 |
// Contexts for data routers |
| 24421 |
const DataStaticRouterContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); |
| 24422 |
|
| 24423 |
if (false) {} |
| 24424 |
|
| 24425 |
const DataRouterContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); |
| 24426 |
|
| 24427 |
if (false) {} |
| 24428 |
|
| 24429 |
const DataRouterStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); |
| 24430 |
|
| 24431 |
if (false) {} |
| 24432 |
|
| 24433 |
const AwaitContext = /*#__PURE__*/(/* unused pure expression or super */ null && (React.createContext(null))); |
| 24434 |
|
| 24435 |
if (false) {} |
| 24436 |
|
| 24437 |
const NavigationContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); |
| 24438 |
|
| 24439 |
if (false) {} |
| 24440 |
|
| 24441 |
const LocationContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); |
| 24442 |
|
| 24443 |
if (false) {} |
| 24444 |
|
| 24445 |
const RouteContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext({ |
| 24446 |
outlet: null, |
| 24447 |
matches: [] |
| 24448 |
}); |
| 24449 |
|
| 24450 |
if (false) {} |
| 24451 |
|
| 24452 |
const RouteErrorContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); |
| 24453 |
|
| 24454 |
if (false) {} |
| 24455 |
|
| 24456 |
/** |
| 24457 |
* Returns the full href for the given "to" value. This is useful for building |
| 24458 |
* custom links that are also accessible and preserve right-click behavior. |
| 24459 |
* |
| 24460 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-href |
| 24461 |
*/ |
| 24462 |
|
| 24463 |
function useHref(to, _temp) { |
| 24464 |
let { |
| 24465 |
relative |
| 24466 |
} = _temp === void 0 ? {} : _temp; |
| 24467 |
!useInRouterContext() ? false ? 0 : invariant(false) : void 0; |
| 24468 |
let { |
| 24469 |
basename, |
| 24470 |
navigator |
| 24471 |
} = React.useContext(NavigationContext); |
| 24472 |
let { |
| 24473 |
hash, |
| 24474 |
pathname, |
| 24475 |
search |
| 24476 |
} = useResolvedPath(to, { |
| 24477 |
relative |
| 24478 |
}); |
| 24479 |
let joinedPathname = pathname; // If we're operating within a basename, prepend it to the pathname prior |
| 24480 |
// to creating the href. If this is a root navigation, then just use the raw |
| 24481 |
// basename which allows the basename to have full control over the presence |
| 24482 |
// of a trailing slash on root links |
| 24483 |
|
| 24484 |
if (basename !== "/") { |
| 24485 |
joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]); |
| 24486 |
} |
| 24487 |
|
| 24488 |
return navigator.createHref({ |
| 24489 |
pathname: joinedPathname, |
| 24490 |
search, |
| 24491 |
hash |
| 24492 |
}); |
| 24493 |
} |
| 24494 |
/** |
| 24495 |
* Returns true if this component is a descendant of a <Router>. |
| 24496 |
* |
| 24497 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-in-router-context |
| 24498 |
*/ |
| 24499 |
|
| 24500 |
function useInRouterContext() { |
| 24501 |
return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext) != null; |
| 24502 |
} |
| 24503 |
/** |
| 24504 |
* Returns the current location object, which represents the current URL in web |
| 24505 |
* browsers. |
| 24506 |
* |
| 24507 |
* Note: If you're using this it may mean you're doing some of your own |
| 24508 |
* "routing" in your app, and we'd like to know what your use case is. We may |
| 24509 |
* be able to provide something higher-level to better suit your needs. |
| 24510 |
* |
| 24511 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-location |
| 24512 |
*/ |
| 24513 |
|
| 24514 |
function useLocation() { |
| 24515 |
!useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; |
| 24516 |
return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext).location; |
| 24517 |
} |
| 24518 |
/** |
| 24519 |
* Returns the current navigation action which describes how the router came to |
| 24520 |
* the current location, either by a pop, push, or replace on the history stack. |
| 24521 |
* |
| 24522 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-navigation-type |
| 24523 |
*/ |
| 24524 |
|
| 24525 |
function useNavigationType() { |
| 24526 |
return React.useContext(LocationContext).navigationType; |
| 24527 |
} |
| 24528 |
/** |
| 24529 |
* Returns true if the URL for the given "to" value matches the current URL. |
| 24530 |
* This is useful for components that need to know "active" state, e.g. |
| 24531 |
* <NavLink>. |
| 24532 |
* |
| 24533 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-match |
| 24534 |
*/ |
| 24535 |
|
| 24536 |
function useMatch(pattern) { |
| 24537 |
!useInRouterContext() ? false ? 0 : invariant(false) : void 0; |
| 24538 |
let { |
| 24539 |
pathname |
| 24540 |
} = useLocation(); |
| 24541 |
return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]); |
| 24542 |
} |
| 24543 |
/** |
| 24544 |
* The interface for the navigate() function returned from useNavigate(). |
| 24545 |
*/ |
| 24546 |
|
| 24547 |
/** |
| 24548 |
* Returns an imperative method for changing the location. Used by <Link>s, but |
| 24549 |
* may also be used by other elements to change the location. |
| 24550 |
* |
| 24551 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-navigate |
| 24552 |
*/ |
| 24553 |
function useNavigate() { |
| 24554 |
!useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; |
| 24555 |
let { |
| 24556 |
basename, |
| 24557 |
navigator |
| 24558 |
} = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext); |
| 24559 |
let { |
| 24560 |
matches |
| 24561 |
} = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); |
| 24562 |
let { |
| 24563 |
pathname: locationPathname |
| 24564 |
} = useLocation(); |
| 24565 |
let routePathnamesJson = JSON.stringify((0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .UNSAFE_getPathContributingMatches */ .Zq)(matches).map(match => match.pathnameBase)); |
| 24566 |
let activeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); |
| 24567 |
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { |
| 24568 |
activeRef.current = true; |
| 24569 |
}); |
| 24570 |
let navigate = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (to, options) { |
| 24571 |
if (options === void 0) { |
| 24572 |
options = {}; |
| 24573 |
} |
| 24574 |
|
| 24575 |
false ? 0 : void 0; |
| 24576 |
if (!activeRef.current) return; |
| 24577 |
|
| 24578 |
if (typeof to === "number") { |
| 24579 |
navigator.go(to); |
| 24580 |
return; |
| 24581 |
} |
| 24582 |
|
| 24583 |
let path = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .resolveTo */ .pC)(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path"); // If we're operating within a basename, prepend it to the pathname prior |
| 24584 |
// to handing off to history. If this is a root navigation, then we |
| 24585 |
// navigate to the raw basename which allows the basename to have full |
| 24586 |
// control over the presence of a trailing slash on root links |
| 24587 |
|
| 24588 |
if (basename !== "/") { |
| 24589 |
path.pathname = path.pathname === "/" ? basename : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .joinPaths */ .RQ)([basename, path.pathname]); |
| 24590 |
} |
| 24591 |
|
| 24592 |
(!!options.replace ? navigator.replace : navigator.push)(path, options.state, options); |
| 24593 |
}, [basename, navigator, routePathnamesJson, locationPathname]); |
| 24594 |
return navigate; |
| 24595 |
} |
| 24596 |
const OutletContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null); |
| 24597 |
/** |
| 24598 |
* Returns the context (if provided) for the child route at this level of the route |
| 24599 |
* hierarchy. |
| 24600 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-outlet-context |
| 24601 |
*/ |
| 24602 |
|
| 24603 |
function useOutletContext() { |
| 24604 |
return React.useContext(OutletContext); |
| 24605 |
} |
| 24606 |
/** |
| 24607 |
* Returns the element for the child route at this level of the route |
| 24608 |
* hierarchy. Used internally by <Outlet> to render child routes. |
| 24609 |
* |
| 24610 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-outlet |
| 24611 |
*/ |
| 24612 |
|
| 24613 |
function useOutlet(context) { |
| 24614 |
let outlet = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext).outlet; |
| 24615 |
|
| 24616 |
if (outlet) { |
| 24617 |
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(OutletContext.Provider, { |
| 24618 |
value: context |
| 24619 |
}, outlet); |
| 24620 |
} |
| 24621 |
|
| 24622 |
return outlet; |
| 24623 |
} |
| 24624 |
/** |
| 24625 |
* Returns an object of key/value pairs of the dynamic params from the current |
| 24626 |
* URL that were matched by the route path. |
| 24627 |
* |
| 24628 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-params |
| 24629 |
*/ |
| 24630 |
|
| 24631 |
function useParams() { |
| 24632 |
let { |
| 24633 |
matches |
| 24634 |
} = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); |
| 24635 |
let routeMatch = matches[matches.length - 1]; |
| 24636 |
return routeMatch ? routeMatch.params : {}; |
| 24637 |
} |
| 24638 |
/** |
| 24639 |
* Resolves the pathname of the given `to` value against the current location. |
| 24640 |
* |
| 24641 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-resolved-path |
| 24642 |
*/ |
| 24643 |
|
| 24644 |
function useResolvedPath(to, _temp2) { |
| 24645 |
let { |
| 24646 |
relative |
| 24647 |
} = _temp2 === void 0 ? {} : _temp2; |
| 24648 |
let { |
| 24649 |
matches |
| 24650 |
} = React.useContext(RouteContext); |
| 24651 |
let { |
| 24652 |
pathname: locationPathname |
| 24653 |
} = useLocation(); |
| 24654 |
let routePathnamesJson = JSON.stringify(UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase)); |
| 24655 |
return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]); |
| 24656 |
} |
| 24657 |
/** |
| 24658 |
* Returns the element of the route that matched the current location, prepared |
| 24659 |
* with the correct context to render the remainder of the route tree. Route |
| 24660 |
* elements in the tree must render an <Outlet> to render their child route's |
| 24661 |
* element. |
| 24662 |
* |
| 24663 |
* @see https://reactrouter.com/docs/en/v6/hooks/use-routes |
| 24664 |
*/ |
| 24665 |
|
| 24666 |
function useRoutes(routes, locationArg) { |
| 24667 |
!useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; |
| 24668 |
let dataRouterStateContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterStateContext); |
| 24669 |
let { |
| 24670 |
matches: parentMatches |
| 24671 |
} = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); |
| 24672 |
let routeMatch = parentMatches[parentMatches.length - 1]; |
| 24673 |
let parentParams = routeMatch ? routeMatch.params : {}; |
| 24674 |
let parentPathname = routeMatch ? routeMatch.pathname : "/"; |
| 24675 |
let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/"; |
| 24676 |
let parentRoute = routeMatch && routeMatch.route; |
| 24677 |
|
| 24678 |
if (false) {} |
| 24679 |
|
| 24680 |
let locationFromContext = useLocation(); |
| 24681 |
let location; |
| 24682 |
|
| 24683 |
if (locationArg) { |
| 24684 |
var _parsedLocationArg$pa; |
| 24685 |
|
| 24686 |
let parsedLocationArg = typeof locationArg === "string" ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .parsePath */ .cP)(locationArg) : locationArg; |
| 24687 |
!(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; |
| 24688 |
location = parsedLocationArg; |
| 24689 |
} else { |
| 24690 |
location = locationFromContext; |
| 24691 |
} |
| 24692 |
|
| 24693 |
let pathname = location.pathname || "/"; |
| 24694 |
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/"; |
| 24695 |
let matches = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .matchRoutes */ .fp)(routes, { |
| 24696 |
pathname: remainingPathname |
| 24697 |
}); |
| 24698 |
|
| 24699 |
if (false) {} |
| 24700 |
|
| 24701 |
let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, { |
| 24702 |
params: Object.assign({}, parentParams, match.params), |
| 24703 |
pathname: (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .joinPaths */ .RQ)([parentPathnameBase, match.pathname]), |
| 24704 |
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .joinPaths */ .RQ)([parentPathnameBase, match.pathnameBase]) |
| 24705 |
})), parentMatches, dataRouterStateContext || undefined); // When a user passes in a `locationArg`, the associated routes need to |
| 24706 |
// be wrapped in a new `LocationContext.Provider` in order for `useLocation` |
| 24707 |
// to use the scoped location instead of the global location. |
| 24708 |
|
| 24709 |
|
| 24710 |
if (locationArg && renderedMatches) { |
| 24711 |
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(LocationContext.Provider, { |
| 24712 |
value: { |
| 24713 |
location: _extends({ |
| 24714 |
pathname: "/", |
| 24715 |
search: "", |
| 24716 |
hash: "", |
| 24717 |
state: null, |
| 24718 |
key: "default" |
| 24719 |
}, location), |
| 24720 |
navigationType: _remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .Action.Pop */ .aU.Pop |
| 24721 |
} |
| 24722 |
}, renderedMatches); |
| 24723 |
} |
| 24724 |
|
| 24725 |
return renderedMatches; |
| 24726 |
} |
| 24727 |
|
| 24728 |
function DefaultErrorElement() { |
| 24729 |
let error = useRouteError(); |
| 24730 |
let message = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .isRouteErrorResponse */ .WK)(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error); |
| 24731 |
let stack = error instanceof Error ? error.stack : null; |
| 24732 |
let lightgrey = "rgba(200,200,200, 0.5)"; |
| 24733 |
let preStyles = { |
| 24734 |
padding: "0.5rem", |
| 24735 |
backgroundColor: lightgrey |
| 24736 |
}; |
| 24737 |
let codeStyles = { |
| 24738 |
padding: "2px 4px", |
| 24739 |
backgroundColor: lightgrey |
| 24740 |
}; |
| 24741 |
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h2", null, "Unhandled Thrown Error!"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h3", { |
| 24742 |
style: { |
| 24743 |
fontStyle: "italic" |
| 24744 |
} |
| 24745 |
}, message), stack ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("pre", { |
| 24746 |
style: preStyles |
| 24747 |
}, stack) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "\uD83D\uDCBF Hey developer \uD83D\uDC4B"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own\xA0", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("code", { |
| 24748 |
style: codeStyles |
| 24749 |
}, "errorElement"), " props on\xA0", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("code", { |
| 24750 |
style: codeStyles |
| 24751 |
}, "<Route>"))); |
| 24752 |
} |
| 24753 |
|
| 24754 |
class RenderErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component { |
| 24755 |
constructor(props) { |
| 24756 |
super(props); |
| 24757 |
this.state = { |
| 24758 |
location: props.location, |
| 24759 |
error: props.error |
| 24760 |
}; |
| 24761 |
} |
| 24762 |
|
| 24763 |
static getDerivedStateFromError(error) { |
| 24764 |
return { |
| 24765 |
error: error |
| 24766 |
}; |
| 24767 |
} |
| 24768 |
|
| 24769 |
static getDerivedStateFromProps(props, state) { |
| 24770 |
// When we get into an error state, the user will likely click "back" to the |
| 24771 |
// previous page that didn't have an error. Because this wraps the entire |
| 24772 |
// application, that will have no effect--the error page continues to display. |
| 24773 |
// This gives us a mechanism to recover from the error when the location changes. |
| 24774 |
// |
| 24775 |
// Whether we're in an error state or not, we update the location in state |
| 24776 |
// so that when we are in an error state, it gets reset when a new location |
| 24777 |
// comes in and the user recovers from the error. |
| 24778 |
if (state.location !== props.location) { |
| 24779 |
return { |
| 24780 |
error: props.error, |
| 24781 |
location: props.location |
| 24782 |
}; |
| 24783 |
} // If we're not changing locations, preserve the location but still surface |
| 24784 |
// any new errors that may come through. We retain the existing error, we do |
| 24785 |
// this because the error provided from the app state may be cleared without |
| 24786 |
// the location changing. |
| 24787 |
|
| 24788 |
|
| 24789 |
return { |
| 24790 |
error: props.error || state.error, |
| 24791 |
location: state.location |
| 24792 |
}; |
| 24793 |
} |
| 24794 |
|
| 24795 |
componentDidCatch(error, errorInfo) { |
| 24796 |
console.error("React Router caught the following error during render", error, errorInfo); |
| 24797 |
} |
| 24798 |
|
| 24799 |
render() { |
| 24800 |
return this.state.error ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteErrorContext.Provider, { |
| 24801 |
value: this.state.error, |
| 24802 |
children: this.props.component |
| 24803 |
}) : this.props.children; |
| 24804 |
} |
| 24805 |
|
| 24806 |
} |
| 24807 |
|
| 24808 |
function RenderedRoute(_ref) { |
| 24809 |
let { |
| 24810 |
routeContext, |
| 24811 |
match, |
| 24812 |
children |
| 24813 |
} = _ref; |
| 24814 |
let dataStaticRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataStaticRouterContext); // Track how deep we got in our render pass to emulate SSR componentDidCatch |
| 24815 |
// in a DataStaticRouter |
| 24816 |
|
| 24817 |
if (dataStaticRouterContext && match.route.errorElement) { |
| 24818 |
dataStaticRouterContext._deepestRenderedBoundaryId = match.route.id; |
| 24819 |
} |
| 24820 |
|
| 24821 |
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteContext.Provider, { |
| 24822 |
value: routeContext |
| 24823 |
}, children); |
| 24824 |
} |
| 24825 |
|
| 24826 |
function _renderMatches(matches, parentMatches, dataRouterState) { |
| 24827 |
if (parentMatches === void 0) { |
| 24828 |
parentMatches = []; |
| 24829 |
} |
| 24830 |
|
| 24831 |
if (matches == null) { |
| 24832 |
if (dataRouterState != null && dataRouterState.errors) { |
| 24833 |
// Don't bail if we have data router errors so we can render them in the |
| 24834 |
// boundary. Use the pre-matched (or shimmed) matches |
| 24835 |
matches = dataRouterState.matches; |
| 24836 |
} else { |
| 24837 |
return null; |
| 24838 |
} |
| 24839 |
} |
| 24840 |
|
| 24841 |
let renderedMatches = matches; // If we have data errors, trim matches to the highest error boundary |
| 24842 |
|
| 24843 |
let errors = dataRouterState == null ? void 0 : dataRouterState.errors; |
| 24844 |
|
| 24845 |
if (errors != null) { |
| 24846 |
let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id])); |
| 24847 |
!(errorIndex >= 0) ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; |
| 24848 |
renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1)); |
| 24849 |
} |
| 24850 |
|
| 24851 |
return renderedMatches.reduceRight((outlet, match, index) => { |
| 24852 |
let error = match.route.id ? errors == null ? void 0 : errors[match.route.id] : null; // Only data routers handle errors |
| 24853 |
|
| 24854 |
let errorElement = dataRouterState ? match.route.errorElement || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(DefaultErrorElement, null) : null; |
| 24855 |
|
| 24856 |
let getChildren = () => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderedRoute, { |
| 24857 |
match: match, |
| 24858 |
routeContext: { |
| 24859 |
outlet, |
| 24860 |
matches: parentMatches.concat(renderedMatches.slice(0, index + 1)) |
| 24861 |
} |
| 24862 |
}, error ? errorElement : match.route.element !== undefined ? match.route.element : outlet); // Only wrap in an error boundary within data router usages when we have an |
| 24863 |
// errorElement on this route. Otherwise let it bubble up to an ancestor |
| 24864 |
// errorElement |
| 24865 |
|
| 24866 |
|
| 24867 |
return dataRouterState && (match.route.errorElement || index === 0) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderErrorBoundary, { |
| 24868 |
location: dataRouterState.location, |
| 24869 |
component: errorElement, |
| 24870 |
error: error, |
| 24871 |
children: getChildren() |
| 24872 |
}) : getChildren(); |
| 24873 |
}, null); |
| 24874 |
} |
| 24875 |
var DataRouterHook; |
| 24876 |
|
| 24877 |
(function (DataRouterHook) { |
| 24878 |
DataRouterHook["UseRevalidator"] = "useRevalidator"; |
| 24879 |
})(DataRouterHook || (DataRouterHook = {})); |
| 24880 |
|
| 24881 |
var DataRouterStateHook; |
| 24882 |
|
| 24883 |
(function (DataRouterStateHook) { |
| 24884 |
DataRouterStateHook["UseLoaderData"] = "useLoaderData"; |
| 24885 |
DataRouterStateHook["UseActionData"] = "useActionData"; |
| 24886 |
DataRouterStateHook["UseRouteError"] = "useRouteError"; |
| 24887 |
DataRouterStateHook["UseNavigation"] = "useNavigation"; |
| 24888 |
DataRouterStateHook["UseRouteLoaderData"] = "useRouteLoaderData"; |
| 24889 |
DataRouterStateHook["UseMatches"] = "useMatches"; |
| 24890 |
DataRouterStateHook["UseRevalidator"] = "useRevalidator"; |
| 24891 |
})(DataRouterStateHook || (DataRouterStateHook = {})); |
| 24892 |
|
| 24893 |
function getDataRouterConsoleError(hookName) { |
| 24894 |
return hookName + " must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router."; |
| 24895 |
} |
| 24896 |
|
| 24897 |
function useDataRouterContext(hookName) { |
| 24898 |
let ctx = React.useContext(DataRouterContext); |
| 24899 |
!ctx ? false ? 0 : invariant(false) : void 0; |
| 24900 |
return ctx; |
| 24901 |
} |
| 24902 |
|
| 24903 |
function useDataRouterState(hookName) { |
| 24904 |
let state = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterStateContext); |
| 24905 |
!state ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; |
| 24906 |
return state; |
| 24907 |
} |
| 24908 |
/** |
| 24909 |
* Returns the current navigation, defaulting to an "idle" navigation when |
| 24910 |
* no navigation is in progress |
| 24911 |
*/ |
| 24912 |
|
| 24913 |
|
| 24914 |
function useNavigation() { |
| 24915 |
let state = useDataRouterState(DataRouterStateHook.UseNavigation); |
| 24916 |
return state.navigation; |
| 24917 |
} |
| 24918 |
/** |
| 24919 |
* Returns a revalidate function for manually triggering revalidation, as well |
| 24920 |
* as the current state of any manual revalidations |
| 24921 |
*/ |
| 24922 |
|
| 24923 |
function useRevalidator() { |
| 24924 |
let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator); |
| 24925 |
let state = useDataRouterState(DataRouterStateHook.UseRevalidator); |
| 24926 |
return { |
| 24927 |
revalidate: dataRouterContext.router.revalidate, |
| 24928 |
state: state.revalidation |
| 24929 |
}; |
| 24930 |
} |
| 24931 |
/** |
| 24932 |
* Returns the active route matches, useful for accessing loaderData for |
| 24933 |
* parent/child routes or the route "handle" property |
| 24934 |
*/ |
| 24935 |
|
| 24936 |
function useMatches() { |
| 24937 |
let { |
| 24938 |
matches, |
| 24939 |
loaderData |
| 24940 |
} = useDataRouterState(DataRouterStateHook.UseMatches); |
| 24941 |
return React.useMemo(() => matches.map(match => { |
| 24942 |
let { |
| 24943 |
pathname, |
| 24944 |
params |
| 24945 |
} = match; // Note: This structure matches that created by createUseMatchesMatch |
| 24946 |
// in the @remix-run/router , so if you change this please also change |
| 24947 |
// that :) Eventually we'll DRY this up |
| 24948 |
|
| 24949 |
return { |
| 24950 |
id: match.route.id, |
| 24951 |
pathname, |
| 24952 |
params, |
| 24953 |
data: loaderData[match.route.id], |
| 24954 |
handle: match.route.handle |
| 24955 |
}; |
| 24956 |
}), [matches, loaderData]); |
| 24957 |
} |
| 24958 |
/** |
| 24959 |
* Returns the loader data for the nearest ancestor Route loader |
| 24960 |
*/ |
| 24961 |
|
| 24962 |
function useLoaderData() { |
| 24963 |
let state = useDataRouterState(DataRouterStateHook.UseLoaderData); |
| 24964 |
let route = React.useContext(RouteContext); |
| 24965 |
!route ? false ? 0 : invariant(false) : void 0; |
| 24966 |
let thisRoute = route.matches[route.matches.length - 1]; |
| 24967 |
!thisRoute.route.id ? false ? 0 : invariant(false) : void 0; |
| 24968 |
return state.loaderData[thisRoute.route.id]; |
| 24969 |
} |
| 24970 |
/** |
| 24971 |
* Returns the loaderData for the given routeId |
| 24972 |
*/ |
| 24973 |
|
| 24974 |
function useRouteLoaderData(routeId) { |
| 24975 |
let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData); |
| 24976 |
return state.loaderData[routeId]; |
| 24977 |
} |
| 24978 |
/** |
| 24979 |
* Returns the action data for the nearest ancestor Route action |
| 24980 |
*/ |
| 24981 |
|
| 24982 |
function useActionData() { |
| 24983 |
let state = useDataRouterState(DataRouterStateHook.UseActionData); |
| 24984 |
let route = React.useContext(RouteContext); |
| 24985 |
!route ? false ? 0 : invariant(false) : void 0; |
| 24986 |
return Object.values((state == null ? void 0 : state.actionData) || {})[0]; |
| 24987 |
} |
| 24988 |
/** |
| 24989 |
* Returns the nearest ancestor Route error, which could be a loader/action |
| 24990 |
* error or a render error. This is intended to be called from your |
| 24991 |
* errorElement to display a proper error message. |
| 24992 |
*/ |
| 24993 |
|
| 24994 |
function useRouteError() { |
| 24995 |
var _state$errors; |
| 24996 |
|
| 24997 |
let error = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteErrorContext); |
| 24998 |
let state = useDataRouterState(DataRouterStateHook.UseRouteError); |
| 24999 |
let route = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext); |
| 25000 |
let thisRoute = route.matches[route.matches.length - 1]; // If this was a render error, we put it in a RouteError context inside |
| 25001 |
// of RenderErrorBoundary |
| 25002 |
|
| 25003 |
if (error) { |
| 25004 |
return error; |
| 25005 |
} |
| 25006 |
|
| 25007 |
!route ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; |
| 25008 |
!thisRoute.route.id ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; // Otherwise look for errors from our data router state |
| 25009 |
|
| 25010 |
return (_state$errors = state.errors) == null ? void 0 : _state$errors[thisRoute.route.id]; |
| 25011 |
} |
| 25012 |
/** |
| 25013 |
* Returns the happy-path data from the nearest ancestor <Await /> value |
| 25014 |
*/ |
| 25015 |
|
| 25016 |
function useAsyncValue() { |
| 25017 |
let value = React.useContext(AwaitContext); |
| 25018 |
return value == null ? void 0 : value._data; |
| 25019 |
} |
| 25020 |
/** |
| 25021 |
* Returns the error from the nearest ancestor <Await /> value |
| 25022 |
*/ |
| 25023 |
|
| 25024 |
function useAsyncError() { |
| 25025 |
let value = React.useContext(AwaitContext); |
| 25026 |
return value == null ? void 0 : value._error; |
| 25027 |
} |
| 25028 |
const alreadyWarned = {}; |
| 25029 |
|
| 25030 |
function warningOnce(key, cond, message) { |
| 25031 |
if (!cond && !alreadyWarned[key]) { |
| 25032 |
alreadyWarned[key] = true; |
| 25033 |
false ? 0 : void 0; |
| 25034 |
} |
| 25035 |
} |
| 25036 |
|
| 25037 |
/** |
| 25038 |
* Given a Remix Router instance, render the appropriate UI |
| 25039 |
*/ |
| 25040 |
function RouterProvider(_ref) { |
| 25041 |
let { |
| 25042 |
fallbackElement, |
| 25043 |
router |
| 25044 |
} = _ref; |
| 25045 |
// Sync router state to our component state to force re-renders |
| 25046 |
let state = useSyncExternalStore(router.subscribe, () => router.state, // We have to provide this so React@18 doesn't complain during hydration, |
| 25047 |
// but we pass our serialized hydration data into the router so state here |
| 25048 |
// is already synced with what the server saw |
| 25049 |
() => router.state); |
| 25050 |
let navigator = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { |
| 25051 |
return { |
| 25052 |
createHref: router.createHref, |
| 25053 |
go: n => router.navigate(n), |
| 25054 |
push: (to, state, opts) => router.navigate(to, { |
| 25055 |
state, |
| 25056 |
preventScrollReset: opts == null ? void 0 : opts.preventScrollReset |
| 25057 |
}), |
| 25058 |
replace: (to, state, opts) => router.navigate(to, { |
| 25059 |
replace: true, |
| 25060 |
state, |
| 25061 |
preventScrollReset: opts == null ? void 0 : opts.preventScrollReset |
| 25062 |
}) |
| 25063 |
}; |
| 25064 |
}, [router]); |
| 25065 |
let basename = router.basename || "/"; |
| 25066 |
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataRouterContext.Provider, { |
| 25067 |
value: { |
| 25068 |
router, |
| 25069 |
navigator, |
| 25070 |
static: false, |
| 25071 |
// Do we need this? |
| 25072 |
basename |
| 25073 |
} |
| 25074 |
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataRouterStateContext.Provider, { |
| 25075 |
value: state |
| 25076 |
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Router, { |
| 25077 |
basename: router.basename, |
| 25078 |
location: router.state.location, |
| 25079 |
navigationType: router.state.historyAction, |
| 25080 |
navigator: navigator |
| 25081 |
}, router.state.initialized ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Routes, null) : fallbackElement))); |
| 25082 |
} |
| 25083 |
|
| 25084 |
/** |
| 25085 |
* A <Router> that stores all entries in memory. |
| 25086 |
* |
| 25087 |
* @see https://reactrouter.com/docs/en/v6/routers/memory-router |
| 25088 |
*/ |
| 25089 |
function MemoryRouter(_ref2) { |
| 25090 |
let { |
| 25091 |
basename, |
| 25092 |
children, |
| 25093 |
initialEntries, |
| 25094 |
initialIndex |
| 25095 |
} = _ref2; |
| 25096 |
let historyRef = React.useRef(); |
| 25097 |
|
| 25098 |
if (historyRef.current == null) { |
| 25099 |
historyRef.current = createMemoryHistory({ |
| 25100 |
initialEntries, |
| 25101 |
initialIndex, |
| 25102 |
v5Compat: true |
| 25103 |
}); |
| 25104 |
} |
| 25105 |
|
| 25106 |
let history = historyRef.current; |
| 25107 |
let [state, setState] = React.useState({ |
| 25108 |
action: history.action, |
| 25109 |
location: history.location |
| 25110 |
}); |
| 25111 |
React.useLayoutEffect(() => history.listen(setState), [history]); |
| 25112 |
return /*#__PURE__*/React.createElement(Router, { |
| 25113 |
basename: basename, |
| 25114 |
children: children, |
| 25115 |
location: state.location, |
| 25116 |
navigationType: state.action, |
| 25117 |
navigator: history |
| 25118 |
}); |
| 25119 |
} |
| 25120 |
|
| 25121 |
/** |
| 25122 |
* Changes the current location. |
| 25123 |
* |
| 25124 |
* Note: This API is mostly useful in React.Component subclasses that are not |
| 25125 |
* able to use hooks. In functional components, we recommend you use the |
| 25126 |
* `useNavigate` hook instead. |
| 25127 |
* |
| 25128 |
* @see https://reactrouter.com/docs/en/v6/components/navigate |
| 25129 |
*/ |
| 25130 |
function Navigate(_ref3) { |
| 25131 |
let { |
| 25132 |
to, |
| 25133 |
replace, |
| 25134 |
state, |
| 25135 |
relative |
| 25136 |
} = _ref3; |
| 25137 |
!useInRouterContext() ? false ? 0 : invariant(false) : void 0; |
| 25138 |
false ? 0 : void 0; |
| 25139 |
let dataRouterState = React.useContext(DataRouterStateContext); |
| 25140 |
let navigate = useNavigate(); |
| 25141 |
React.useEffect(() => { |
| 25142 |
// Avoid kicking off multiple navigations if we're in the middle of a |
| 25143 |
// data-router navigation, since components get re-rendered when we enter |
| 25144 |
// a submitting/loading state |
| 25145 |
if (dataRouterState && dataRouterState.navigation.state !== "idle") { |
| 25146 |
return; |
| 25147 |
} |
| 25148 |
|
| 25149 |
navigate(to, { |
| 25150 |
replace, |
| 25151 |
state, |
| 25152 |
relative |
| 25153 |
}); |
| 25154 |
}); |
| 25155 |
return null; |
| 25156 |
} |
| 25157 |
|
| 25158 |
/** |
| 25159 |
* Renders the child route's element, if there is one. |
| 25160 |
* |
| 25161 |
* @see https://reactrouter.com/docs/en/v6/components/outlet |
| 25162 |
*/ |
| 25163 |
function Outlet(props) { |
| 25164 |
return useOutlet(props.context); |
| 25165 |
} |
| 25166 |
|
| 25167 |
/** |
| 25168 |
* Declares an element that should be rendered at a certain URL path. |
| 25169 |
* |
| 25170 |
* @see https://reactrouter.com/docs/en/v6/components/route |
| 25171 |
*/ |
| 25172 |
function Route(_props) { |
| 25173 |
false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) ; |
| 25174 |
} |
| 25175 |
|
| 25176 |
/** |
| 25177 |
* Provides location context for the rest of the app. |
| 25178 |
* |
| 25179 |
* Note: You usually won't render a <Router> directly. Instead, you'll render a |
| 25180 |
* router that is more specific to your environment such as a <BrowserRouter> |
| 25181 |
* in web browsers or a <StaticRouter> for server rendering. |
| 25182 |
* |
| 25183 |
* @see https://reactrouter.com/docs/en/v6/routers/router |
| 25184 |
*/ |
| 25185 |
function Router(_ref4) { |
| 25186 |
let { |
| 25187 |
basename: basenameProp = "/", |
| 25188 |
children = null, |
| 25189 |
location: locationProp, |
| 25190 |
navigationType = _remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .Action.Pop */ .aU.Pop, |
| 25191 |
navigator, |
| 25192 |
static: staticProp = false |
| 25193 |
} = _ref4; |
| 25194 |
!!useInRouterContext() ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; // Preserve trailing slashes on basename, so we can let the user control |
| 25195 |
// the enforcement of trailing slashes throughout the app |
| 25196 |
|
| 25197 |
let basename = basenameProp.replace(/^\/*/, "/"); |
| 25198 |
let navigationContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({ |
| 25199 |
basename, |
| 25200 |
navigator, |
| 25201 |
static: staticProp |
| 25202 |
}), [basename, navigator, staticProp]); |
| 25203 |
|
| 25204 |
if (typeof locationProp === "string") { |
| 25205 |
locationProp = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .parsePath */ .cP)(locationProp); |
| 25206 |
} |
| 25207 |
|
| 25208 |
let { |
| 25209 |
pathname = "/", |
| 25210 |
search = "", |
| 25211 |
hash = "", |
| 25212 |
state = null, |
| 25213 |
key = "default" |
| 25214 |
} = locationProp; |
| 25215 |
let location = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { |
| 25216 |
let trailingPathname = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .stripBasename */ .Zn)(pathname, basename); |
| 25217 |
|
| 25218 |
if (trailingPathname == null) { |
| 25219 |
return null; |
| 25220 |
} |
| 25221 |
|
| 25222 |
return { |
| 25223 |
pathname: trailingPathname, |
| 25224 |
search, |
| 25225 |
hash, |
| 25226 |
state, |
| 25227 |
key |
| 25228 |
}; |
| 25229 |
}, [basename, pathname, search, hash, state, key]); |
| 25230 |
false ? 0 : void 0; |
| 25231 |
|
| 25232 |
if (location == null) { |
| 25233 |
return null; |
| 25234 |
} |
| 25235 |
|
| 25236 |
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(NavigationContext.Provider, { |
| 25237 |
value: navigationContext |
| 25238 |
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(LocationContext.Provider, { |
| 25239 |
children: children, |
| 25240 |
value: { |
| 25241 |
location, |
| 25242 |
navigationType |
| 25243 |
} |
| 25244 |
})); |
| 25245 |
} |
| 25246 |
|
| 25247 |
/** |
| 25248 |
* A container for a nested tree of <Route> elements that renders the branch |
| 25249 |
* that best matches the current location. |
| 25250 |
* |
| 25251 |
* @see https://reactrouter.com/docs/en/v6/components/routes |
| 25252 |
*/ |
| 25253 |
function Routes(_ref5) { |
| 25254 |
let { |
| 25255 |
children, |
| 25256 |
location |
| 25257 |
} = _ref5; |
| 25258 |
let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext); // When in a DataRouterContext _without_ children, we use the router routes |
| 25259 |
// directly. If we have children, then we're in a descendant tree and we |
| 25260 |
// need to use child routes. |
| 25261 |
|
| 25262 |
let routes = dataRouterContext && !children ? dataRouterContext.router.routes : createRoutesFromChildren(children); |
| 25263 |
return useRoutes(routes, location); |
| 25264 |
} |
| 25265 |
|
| 25266 |
/** |
| 25267 |
* Component to use for rendering lazily loaded data from returning defer() |
| 25268 |
* in a loader function |
| 25269 |
*/ |
| 25270 |
function Await(_ref6) { |
| 25271 |
let { |
| 25272 |
children, |
| 25273 |
errorElement, |
| 25274 |
resolve |
| 25275 |
} = _ref6; |
| 25276 |
return /*#__PURE__*/React.createElement(AwaitErrorBoundary, { |
| 25277 |
resolve: resolve, |
| 25278 |
errorElement: errorElement |
| 25279 |
}, /*#__PURE__*/React.createElement(ResolveAwait, null, children)); |
| 25280 |
} |
| 25281 |
var AwaitRenderStatus; |
| 25282 |
|
| 25283 |
(function (AwaitRenderStatus) { |
| 25284 |
AwaitRenderStatus[AwaitRenderStatus["pending"] = 0] = "pending"; |
| 25285 |
AwaitRenderStatus[AwaitRenderStatus["success"] = 1] = "success"; |
| 25286 |
AwaitRenderStatus[AwaitRenderStatus["error"] = 2] = "error"; |
| 25287 |
})(AwaitRenderStatus || (AwaitRenderStatus = {})); |
| 25288 |
|
| 25289 |
const neverSettledPromise = new Promise(() => {}); |
| 25290 |
|
| 25291 |
class AwaitErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component { |
| 25292 |
constructor(props) { |
| 25293 |
super(props); |
| 25294 |
this.state = { |
| 25295 |
error: null |
| 25296 |
}; |
| 25297 |
} |
| 25298 |
|
| 25299 |
static getDerivedStateFromError(error) { |
| 25300 |
return { |
| 25301 |
error |
| 25302 |
}; |
| 25303 |
} |
| 25304 |
|
| 25305 |
componentDidCatch(error, errorInfo) { |
| 25306 |
console.error("<Await> caught the following error during render", error, errorInfo); |
| 25307 |
} |
| 25308 |
|
| 25309 |
render() { |
| 25310 |
let { |
| 25311 |
children, |
| 25312 |
errorElement, |
| 25313 |
resolve |
| 25314 |
} = this.props; |
| 25315 |
let promise = null; |
| 25316 |
let status = AwaitRenderStatus.pending; |
| 25317 |
|
| 25318 |
if (!(resolve instanceof Promise)) { |
| 25319 |
// Didn't get a promise - provide as a resolved promise |
| 25320 |
status = AwaitRenderStatus.success; |
| 25321 |
promise = Promise.resolve(); |
| 25322 |
Object.defineProperty(promise, "_tracked", { |
| 25323 |
get: () => true |
| 25324 |
}); |
| 25325 |
Object.defineProperty(promise, "_data", { |
| 25326 |
get: () => resolve |
| 25327 |
}); |
| 25328 |
} else if (this.state.error) { |
| 25329 |
// Caught a render error, provide it as a rejected promise |
| 25330 |
status = AwaitRenderStatus.error; |
| 25331 |
let renderError = this.state.error; |
| 25332 |
promise = Promise.reject().catch(() => {}); // Avoid unhandled rejection warnings |
| 25333 |
|
| 25334 |
Object.defineProperty(promise, "_tracked", { |
| 25335 |
get: () => true |
| 25336 |
}); |
| 25337 |
Object.defineProperty(promise, "_error", { |
| 25338 |
get: () => renderError |
| 25339 |
}); |
| 25340 |
} else if (resolve._tracked) { |
| 25341 |
// Already tracked promise - check contents |
| 25342 |
promise = resolve; |
| 25343 |
status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending; |
| 25344 |
} else { |
| 25345 |
// Raw (untracked) promise - track it |
| 25346 |
status = AwaitRenderStatus.pending; |
| 25347 |
Object.defineProperty(resolve, "_tracked", { |
| 25348 |
get: () => true |
| 25349 |
}); |
| 25350 |
promise = resolve.then(data => Object.defineProperty(resolve, "_data", { |
| 25351 |
get: () => data |
| 25352 |
}), error => Object.defineProperty(resolve, "_error", { |
| 25353 |
get: () => error |
| 25354 |
})); |
| 25355 |
} |
| 25356 |
|
| 25357 |
if (status === AwaitRenderStatus.error && promise._error instanceof AbortedDeferredError) { |
| 25358 |
// Freeze the UI by throwing a never resolved promise |
| 25359 |
throw neverSettledPromise; |
| 25360 |
} |
| 25361 |
|
| 25362 |
if (status === AwaitRenderStatus.error && !errorElement) { |
| 25363 |
// No errorElement, throw to the nearest route-level error boundary |
| 25364 |
throw promise._error; |
| 25365 |
} |
| 25366 |
|
| 25367 |
if (status === AwaitRenderStatus.error) { |
| 25368 |
// Render via our errorElement |
| 25369 |
return /*#__PURE__*/React.createElement(AwaitContext.Provider, { |
| 25370 |
value: promise, |
| 25371 |
children: errorElement |
| 25372 |
}); |
| 25373 |
} |
| 25374 |
|
| 25375 |
if (status === AwaitRenderStatus.success) { |
| 25376 |
// Render children with resolved value |
| 25377 |
return /*#__PURE__*/React.createElement(AwaitContext.Provider, { |
| 25378 |
value: promise, |
| 25379 |
children: children |
| 25380 |
}); |
| 25381 |
} // Throw to the suspense boundary |
| 25382 |
|
| 25383 |
|
| 25384 |
throw promise; |
| 25385 |
} |
| 25386 |
|
| 25387 |
} |
| 25388 |
/** |
| 25389 |
* @private |
| 25390 |
* Indirection to leverage useAsyncValue for a render-prop API on <Await> |
| 25391 |
*/ |
| 25392 |
|
| 25393 |
|
| 25394 |
function ResolveAwait(_ref7) { |
| 25395 |
let { |
| 25396 |
children |
| 25397 |
} = _ref7; |
| 25398 |
let data = useAsyncValue(); |
| 25399 |
|
| 25400 |
if (typeof children === "function") { |
| 25401 |
return children(data); |
| 25402 |
} |
| 25403 |
|
| 25404 |
return /*#__PURE__*/React.createElement(React.Fragment, null, children); |
| 25405 |
} /////////////////////////////////////////////////////////////////////////////// |
| 25406 |
// UTILS |
| 25407 |
/////////////////////////////////////////////////////////////////////////////// |
| 25408 |
|
| 25409 |
/** |
| 25410 |
* Creates a route config from a React "children" object, which is usually |
| 25411 |
* either a `<Route>` element or an array of them. Used internally by |
| 25412 |
* `<Routes>` to create a route config from its children. |
| 25413 |
* |
| 25414 |
* @see https://reactrouter.com/docs/en/v6/utils/create-routes-from-children |
| 25415 |
*/ |
| 25416 |
|
| 25417 |
|
| 25418 |
function createRoutesFromChildren(children, parentPath) { |
| 25419 |
if (parentPath === void 0) { |
| 25420 |
parentPath = []; |
| 25421 |
} |
| 25422 |
|
| 25423 |
let routes = []; |
| 25424 |
react__WEBPACK_IMPORTED_MODULE_0__.Children.forEach(children, (element, index) => { |
| 25425 |
if (! /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(element)) { |
| 25426 |
// Ignore non-elements. This allows people to more easily inline |
| 25427 |
// conditionals in their route config. |
| 25428 |
return; |
| 25429 |
} |
| 25430 |
|
| 25431 |
if (element.type === react__WEBPACK_IMPORTED_MODULE_0__.Fragment) { |
| 25432 |
// Transparently support React.Fragment and its children. |
| 25433 |
routes.push.apply(routes, createRoutesFromChildren(element.props.children, parentPath)); |
| 25434 |
return; |
| 25435 |
} |
| 25436 |
|
| 25437 |
!(element.type === Route) ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; |
| 25438 |
!(!element.props.index || !element.props.children) ? false ? 0 : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__/* .invariant */ .kG)(false) : void 0; |
| 25439 |
let treePath = [...parentPath, index]; |
| 25440 |
let route = { |
| 25441 |
id: element.props.id || treePath.join("-"), |
| 25442 |
caseSensitive: element.props.caseSensitive, |
| 25443 |
element: element.props.element, |
| 25444 |
index: element.props.index, |
| 25445 |
path: element.props.path, |
| 25446 |
loader: element.props.loader, |
| 25447 |
action: element.props.action, |
| 25448 |
errorElement: element.props.errorElement, |
| 25449 |
hasErrorBoundary: element.props.errorElement != null, |
| 25450 |
shouldRevalidate: element.props.shouldRevalidate, |
| 25451 |
handle: element.props.handle |
| 25452 |
}; |
| 25453 |
|
| 25454 |
if (element.props.children) { |
| 25455 |
route.children = createRoutesFromChildren(element.props.children, treePath); |
| 25456 |
} |
| 25457 |
|
| 25458 |
routes.push(route); |
| 25459 |
}); |
| 25460 |
return routes; |
| 25461 |
} |
| 25462 |
/** |
| 25463 |
* Renders the result of `matchRoutes()` into a React element. |
| 25464 |
*/ |
| 25465 |
|
| 25466 |
function renderMatches(matches) { |
| 25467 |
return _renderMatches(matches); |
| 25468 |
} |
| 25469 |
/** |
| 25470 |
* @private |
| 25471 |
* Walk the route tree and add hasErrorBoundary if it's not provided, so that |
| 25472 |
* users providing manual route arrays can just specify errorElement |
| 25473 |
*/ |
| 25474 |
|
| 25475 |
function enhanceManualRouteObjects(routes) { |
| 25476 |
return routes.map(route => { |
| 25477 |
let routeClone = _extends({}, route); |
| 25478 |
|
| 25479 |
if (routeClone.hasErrorBoundary == null) { |
| 25480 |
routeClone.hasErrorBoundary = routeClone.errorElement != null; |
| 25481 |
} |
| 25482 |
|
| 25483 |
if (routeClone.children) { |
| 25484 |
routeClone.children = enhanceManualRouteObjects(routeClone.children); |
| 25485 |
} |
| 25486 |
|
| 25487 |
return routeClone; |
| 25488 |
}); |
| 25489 |
} |
| 25490 |
|
| 25491 |
function createMemoryRouter(routes, opts) { |
| 25492 |
return createRouter({ |
| 25493 |
basename: opts == null ? void 0 : opts.basename, |
| 25494 |
history: createMemoryHistory({ |
| 25495 |
initialEntries: opts == null ? void 0 : opts.initialEntries, |
| 25496 |
initialIndex: opts == null ? void 0 : opts.initialIndex |
| 25497 |
}), |
| 25498 |
hydrationData: opts == null ? void 0 : opts.hydrationData, |
| 25499 |
routes: enhanceManualRouteObjects(routes) |
| 25500 |
}).initialize(); |
| 25501 |
} /////////////////////////////////////////////////////////////////////////////// |
| 25502 |
|
| 25503 |
|
| 25504 |
//# sourceMappingURL=index.js.map |
| 25505 |
|
| 25506 |
|
| 25507 |
/***/ }), |
| 25508 |
|
| 25509 |
/***/ 5097: |
| 25510 |
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { |
| 25511 |
|
| 25512 |
"use strict"; |
| 25513 |
/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3379); |
| 25514 |
/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); |
| 25515 |
/* harmony import */ var _css_loader_dist_cjs_js_quill_snow_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7006); |
| 25516 |
|
| 25517 |
|
| 25518 |
|
| 25519 |
var options = {}; |
| 25520 |
|
| 25521 |
options.insert = "head"; |
| 25522 |
options.singleton = false; |
| 25523 |
|
| 25524 |
var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_quill_snow_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, options); |
| 25525 |
|
| 25526 |
|
| 25527 |
|
| 25528 |
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (_css_loader_dist_cjs_js_quill_snow_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"].locals */ .Z.locals || {}); |
| 25529 |
|
| 25530 |
/***/ }), |
| 25531 |
|
| 25532 |
/***/ 3379: |
| 25533 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 25534 |
|
| 25535 |
"use strict"; |
| 25536 |
|
| 25537 |
|
| 25538 |
var isOldIE = function isOldIE() { |
| 25539 |
var memo; |
| 25540 |
return function memorize() { |
| 25541 |
if (typeof memo === 'undefined') { |
| 25542 |
// Test for IE <= 9 as proposed by Browserhacks |
| 25543 |
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 |
| 25544 |
// Tests for existence of standard globals is to allow style-loader |
| 25545 |
// to operate correctly into non-standard environments |
| 25546 |
// @see https://github.com/webpack-contrib/style-loader/issues/177 |
| 25547 |
memo = Boolean(window && document && document.all && !window.atob); |
| 25548 |
} |
| 25549 |
|
| 25550 |
return memo; |
| 25551 |
}; |
| 25552 |
}(); |
| 25553 |
|
| 25554 |
var getTarget = function getTarget() { |
| 25555 |
var memo = {}; |
| 25556 |
return function memorize(target) { |
| 25557 |
if (typeof memo[target] === 'undefined') { |
| 25558 |
var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself |
| 25559 |
|
| 25560 |
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { |
| 25561 |
try { |
| 25562 |
// This will throw an exception if access to iframe is blocked |
| 25563 |
// due to cross-origin restrictions |
| 25564 |
styleTarget = styleTarget.contentDocument.head; |
| 25565 |
} catch (e) { |
| 25566 |
// istanbul ignore next |
| 25567 |
styleTarget = null; |
| 25568 |
} |
| 25569 |
} |
| 25570 |
|
| 25571 |
memo[target] = styleTarget; |
| 25572 |
} |
| 25573 |
|
| 25574 |
return memo[target]; |
| 25575 |
}; |
| 25576 |
}(); |
| 25577 |
|
| 25578 |
var stylesInDom = []; |
| 25579 |
|
| 25580 |
function getIndexByIdentifier(identifier) { |
| 25581 |
var result = -1; |
| 25582 |
|
| 25583 |
for (var i = 0; i < stylesInDom.length; i++) { |
| 25584 |
if (stylesInDom[i].identifier === identifier) { |
| 25585 |
result = i; |
| 25586 |
break; |
| 25587 |
} |
| 25588 |
} |
| 25589 |
|
| 25590 |
return result; |
| 25591 |
} |
| 25592 |
|
| 25593 |
function modulesToDom(list, options) { |
| 25594 |
var idCountMap = {}; |
| 25595 |
var identifiers = []; |
| 25596 |
|
| 25597 |
for (var i = 0; i < list.length; i++) { |
| 25598 |
var item = list[i]; |
| 25599 |
var id = options.base ? item[0] + options.base : item[0]; |
| 25600 |
var count = idCountMap[id] || 0; |
| 25601 |
var identifier = "".concat(id, " ").concat(count); |
| 25602 |
idCountMap[id] = count + 1; |
| 25603 |
var index = getIndexByIdentifier(identifier); |
| 25604 |
var obj = { |
| 25605 |
css: item[1], |
| 25606 |
media: item[2], |
| 25607 |
sourceMap: item[3] |
| 25608 |
}; |
| 25609 |
|
| 25610 |
if (index !== -1) { |
| 25611 |
stylesInDom[index].references++; |
| 25612 |
stylesInDom[index].updater(obj); |
| 25613 |
} else { |
| 25614 |
stylesInDom.push({ |
| 25615 |
identifier: identifier, |
| 25616 |
updater: addStyle(obj, options), |
| 25617 |
references: 1 |
| 25618 |
}); |
| 25619 |
} |
| 25620 |
|
| 25621 |
identifiers.push(identifier); |
| 25622 |
} |
| 25623 |
|
| 25624 |
return identifiers; |
| 25625 |
} |
| 25626 |
|
| 25627 |
function insertStyleElement(options) { |
| 25628 |
var style = document.createElement('style'); |
| 25629 |
var attributes = options.attributes || {}; |
| 25630 |
|
| 25631 |
if (typeof attributes.nonce === 'undefined') { |
| 25632 |
var nonce = true ? __webpack_require__.nc : 0; |
| 25633 |
|
| 25634 |
if (nonce) { |
| 25635 |
attributes.nonce = nonce; |
| 25636 |
} |
| 25637 |
} |
| 25638 |
|
| 25639 |
Object.keys(attributes).forEach(function (key) { |
| 25640 |
style.setAttribute(key, attributes[key]); |
| 25641 |
}); |
| 25642 |
|
| 25643 |
if (typeof options.insert === 'function') { |
| 25644 |
options.insert(style); |
| 25645 |
} else { |
| 25646 |
var target = getTarget(options.insert || 'head'); |
| 25647 |
|
| 25648 |
if (!target) { |
| 25649 |
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); |
| 25650 |
} |
| 25651 |
|
| 25652 |
target.appendChild(style); |
| 25653 |
} |
| 25654 |
|
| 25655 |
return style; |
| 25656 |
} |
| 25657 |
|
| 25658 |
function removeStyleElement(style) { |
| 25659 |
// istanbul ignore if |
| 25660 |
if (style.parentNode === null) { |
| 25661 |
return false; |
| 25662 |
} |
| 25663 |
|
| 25664 |
style.parentNode.removeChild(style); |
| 25665 |
} |
| 25666 |
/* istanbul ignore next */ |
| 25667 |
|
| 25668 |
|
| 25669 |
var replaceText = function replaceText() { |
| 25670 |
var textStore = []; |
| 25671 |
return function replace(index, replacement) { |
| 25672 |
textStore[index] = replacement; |
| 25673 |
return textStore.filter(Boolean).join('\n'); |
| 25674 |
}; |
| 25675 |
}(); |
| 25676 |
|
| 25677 |
function applyToSingletonTag(style, index, remove, obj) { |
| 25678 |
var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE |
| 25679 |
|
| 25680 |
/* istanbul ignore if */ |
| 25681 |
|
| 25682 |
if (style.styleSheet) { |
| 25683 |
style.styleSheet.cssText = replaceText(index, css); |
| 25684 |
} else { |
| 25685 |
var cssNode = document.createTextNode(css); |
| 25686 |
var childNodes = style.childNodes; |
| 25687 |
|
| 25688 |
if (childNodes[index]) { |
| 25689 |
style.removeChild(childNodes[index]); |
| 25690 |
} |
| 25691 |
|
| 25692 |
if (childNodes.length) { |
| 25693 |
style.insertBefore(cssNode, childNodes[index]); |
| 25694 |
} else { |
| 25695 |
style.appendChild(cssNode); |
| 25696 |
} |
| 25697 |
} |
| 25698 |
} |
| 25699 |
|
| 25700 |
function applyToTag(style, options, obj) { |
| 25701 |
var css = obj.css; |
| 25702 |
var media = obj.media; |
| 25703 |
var sourceMap = obj.sourceMap; |
| 25704 |
|
| 25705 |
if (media) { |
| 25706 |
style.setAttribute('media', media); |
| 25707 |
} else { |
| 25708 |
style.removeAttribute('media'); |
| 25709 |
} |
| 25710 |
|
| 25711 |
if (sourceMap && typeof btoa !== 'undefined') { |
| 25712 |
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); |
| 25713 |
} // For old IE |
| 25714 |
|
| 25715 |
/* istanbul ignore if */ |
| 25716 |
|
| 25717 |
|
| 25718 |
if (style.styleSheet) { |
| 25719 |
style.styleSheet.cssText = css; |
| 25720 |
} else { |
| 25721 |
while (style.firstChild) { |
| 25722 |
style.removeChild(style.firstChild); |
| 25723 |
} |
| 25724 |
|
| 25725 |
style.appendChild(document.createTextNode(css)); |
| 25726 |
} |
| 25727 |
} |
| 25728 |
|
| 25729 |
var singleton = null; |
| 25730 |
var singletonCounter = 0; |
| 25731 |
|
| 25732 |
function addStyle(obj, options) { |
| 25733 |
var style; |
| 25734 |
var update; |
| 25735 |
var remove; |
| 25736 |
|
| 25737 |
if (options.singleton) { |
| 25738 |
var styleIndex = singletonCounter++; |
| 25739 |
style = singleton || (singleton = insertStyleElement(options)); |
| 25740 |
update = applyToSingletonTag.bind(null, style, styleIndex, false); |
| 25741 |
remove = applyToSingletonTag.bind(null, style, styleIndex, true); |
| 25742 |
} else { |
| 25743 |
style = insertStyleElement(options); |
| 25744 |
update = applyToTag.bind(null, style, options); |
| 25745 |
|
| 25746 |
remove = function remove() { |
| 25747 |
removeStyleElement(style); |
| 25748 |
}; |
| 25749 |
} |
| 25750 |
|
| 25751 |
update(obj); |
| 25752 |
return function updateStyle(newObj) { |
| 25753 |
if (newObj) { |
| 25754 |
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) { |
| 25755 |
return; |
| 25756 |
} |
| 25757 |
|
| 25758 |
update(obj = newObj); |
| 25759 |
} else { |
| 25760 |
remove(); |
| 25761 |
} |
| 25762 |
}; |
| 25763 |
} |
| 25764 |
|
| 25765 |
module.exports = function (list, options) { |
| 25766 |
options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> |
| 25767 |
// tags it will allow on a page |
| 25768 |
|
| 25769 |
if (!options.singleton && typeof options.singleton !== 'boolean') { |
| 25770 |
options.singleton = isOldIE(); |
| 25771 |
} |
| 25772 |
|
| 25773 |
list = list || []; |
| 25774 |
var lastIdentifiers = modulesToDom(list, options); |
| 25775 |
return function update(newList) { |
| 25776 |
newList = newList || []; |
| 25777 |
|
| 25778 |
if (Object.prototype.toString.call(newList) !== '[object Array]') { |
| 25779 |
return; |
| 25780 |
} |
| 25781 |
|
| 25782 |
for (var i = 0; i < lastIdentifiers.length; i++) { |
| 25783 |
var identifier = lastIdentifiers[i]; |
| 25784 |
var index = getIndexByIdentifier(identifier); |
| 25785 |
stylesInDom[index].references--; |
| 25786 |
} |
| 25787 |
|
| 25788 |
var newLastIdentifiers = modulesToDom(newList, options); |
| 25789 |
|
| 25790 |
for (var _i = 0; _i < lastIdentifiers.length; _i++) { |
| 25791 |
var _identifier = lastIdentifiers[_i]; |
| 25792 |
|
| 25793 |
var _index = getIndexByIdentifier(_identifier); |
| 25794 |
|
| 25795 |
if (stylesInDom[_index].references === 0) { |
| 25796 |
stylesInDom[_index].updater(); |
| 25797 |
|
| 25798 |
stylesInDom.splice(_index, 1); |
| 25799 |
} |
| 25800 |
} |
| 25801 |
|
| 25802 |
lastIdentifiers = newLastIdentifiers; |
| 25803 |
}; |
| 25804 |
}; |
| 25805 |
|
| 25806 |
/***/ }), |
| 25807 |
|
| 25808 |
/***/ 7363: |
| 25809 |
/***/ ((module) => { |
| 25810 |
|
| 25811 |
"use strict"; |
| 25812 |
module.exports = React; |
| 25813 |
|
| 25814 |
/***/ }), |
| 25815 |
|
| 25816 |
/***/ 1533: |
| 25817 |
/***/ ((module) => { |
| 25818 |
|
| 25819 |
"use strict"; |
| 25820 |
module.exports = ReactDOM; |
| 25821 |
|
| 25822 |
/***/ }), |
| 25823 |
|
| 25824 |
/***/ 1721: |
| 25825 |
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
| 25826 |
|
| 25827 |
"use strict"; |
| 25828 |
|
| 25829 |
// EXPORTS |
| 25830 |
__webpack_require__.d(__webpack_exports__, { |
| 25831 |
"ZP": () => (/* binding */ node_modules_axios) |
| 25832 |
}); |
| 25833 |
|
| 25834 |
// UNUSED EXPORTS: Axios, AxiosError, Cancel, CancelToken, CanceledError, VERSION, all, isAxiosError, isCancel, spread, toFormData |
| 25835 |
|
| 25836 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/bind.js |
| 25837 |
|
| 25838 |
|
| 25839 |
function bind(fn, thisArg) { |
| 25840 |
return function wrap() { |
| 25841 |
return fn.apply(thisArg, arguments); |
| 25842 |
}; |
| 25843 |
} |
| 25844 |
|
| 25845 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/utils.js |
| 25846 |
|
| 25847 |
|
| 25848 |
|
| 25849 |
|
| 25850 |
// utils is a library of generic helper functions non-specific to axios |
| 25851 |
|
| 25852 |
const {toString: utils_toString} = Object.prototype; |
| 25853 |
const {getPrototypeOf} = Object; |
| 25854 |
|
| 25855 |
const kindOf = (cache => thing => { |
| 25856 |
const str = utils_toString.call(thing); |
| 25857 |
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); |
| 25858 |
})(Object.create(null)); |
| 25859 |
|
| 25860 |
const kindOfTest = (type) => { |
| 25861 |
type = type.toLowerCase(); |
| 25862 |
return (thing) => kindOf(thing) === type |
| 25863 |
} |
| 25864 |
|
| 25865 |
const typeOfTest = type => thing => typeof thing === type; |
| 25866 |
|
| 25867 |
/** |
| 25868 |
* Determine if a value is an Array |
| 25869 |
* |
| 25870 |
* @param {Object} val The value to test |
| 25871 |
* |
| 25872 |
* @returns {boolean} True if value is an Array, otherwise false |
| 25873 |
*/ |
| 25874 |
const {isArray} = Array; |
| 25875 |
|
| 25876 |
/** |
| 25877 |
* Determine if a value is undefined |
| 25878 |
* |
| 25879 |
* @param {*} val The value to test |
| 25880 |
* |
| 25881 |
* @returns {boolean} True if the value is undefined, otherwise false |
| 25882 |
*/ |
| 25883 |
const isUndefined = typeOfTest('undefined'); |
| 25884 |
|
| 25885 |
/** |
| 25886 |
* Determine if a value is a Buffer |
| 25887 |
* |
| 25888 |
* @param {*} val The value to test |
| 25889 |
* |
| 25890 |
* @returns {boolean} True if value is a Buffer, otherwise false |
| 25891 |
*/ |
| 25892 |
function isBuffer(val) { |
| 25893 |
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) |
| 25894 |
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); |
| 25895 |
} |
| 25896 |
|
| 25897 |
/** |
| 25898 |
* Determine if a value is an ArrayBuffer |
| 25899 |
* |
| 25900 |
* @param {*} val The value to test |
| 25901 |
* |
| 25902 |
* @returns {boolean} True if value is an ArrayBuffer, otherwise false |
| 25903 |
*/ |
| 25904 |
const isArrayBuffer = kindOfTest('ArrayBuffer'); |
| 25905 |
|
| 25906 |
|
| 25907 |
/** |
| 25908 |
* Determine if a value is a view on an ArrayBuffer |
| 25909 |
* |
| 25910 |
* @param {*} val The value to test |
| 25911 |
* |
| 25912 |
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false |
| 25913 |
*/ |
| 25914 |
function isArrayBufferView(val) { |
| 25915 |
let result; |
| 25916 |
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { |
| 25917 |
result = ArrayBuffer.isView(val); |
| 25918 |
} else { |
| 25919 |
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); |
| 25920 |
} |
| 25921 |
return result; |
| 25922 |
} |
| 25923 |
|
| 25924 |
/** |
| 25925 |
* Determine if a value is a String |
| 25926 |
* |
| 25927 |
* @param {*} val The value to test |
| 25928 |
* |
| 25929 |
* @returns {boolean} True if value is a String, otherwise false |
| 25930 |
*/ |
| 25931 |
const isString = typeOfTest('string'); |
| 25932 |
|
| 25933 |
/** |
| 25934 |
* Determine if a value is a Function |
| 25935 |
* |
| 25936 |
* @param {*} val The value to test |
| 25937 |
* @returns {boolean} True if value is a Function, otherwise false |
| 25938 |
*/ |
| 25939 |
const isFunction = typeOfTest('function'); |
| 25940 |
|
| 25941 |
/** |
| 25942 |
* Determine if a value is a Number |
| 25943 |
* |
| 25944 |
* @param {*} val The value to test |
| 25945 |
* |
| 25946 |
* @returns {boolean} True if value is a Number, otherwise false |
| 25947 |
*/ |
| 25948 |
const isNumber = typeOfTest('number'); |
| 25949 |
|
| 25950 |
/** |
| 25951 |
* Determine if a value is an Object |
| 25952 |
* |
| 25953 |
* @param {*} thing The value to test |
| 25954 |
* |
| 25955 |
* @returns {boolean} True if value is an Object, otherwise false |
| 25956 |
*/ |
| 25957 |
const isObject = (thing) => thing !== null && typeof thing === 'object'; |
| 25958 |
|
| 25959 |
/** |
| 25960 |
* Determine if a value is a Boolean |
| 25961 |
* |
| 25962 |
* @param {*} thing The value to test |
| 25963 |
* @returns {boolean} True if value is a Boolean, otherwise false |
| 25964 |
*/ |
| 25965 |
const isBoolean = thing => thing === true || thing === false; |
| 25966 |
|
| 25967 |
/** |
| 25968 |
* Determine if a value is a plain Object |
| 25969 |
* |
| 25970 |
* @param {*} val The value to test |
| 25971 |
* |
| 25972 |
* @returns {boolean} True if value is a plain Object, otherwise false |
| 25973 |
*/ |
| 25974 |
const isPlainObject = (val) => { |
| 25975 |
if (kindOf(val) !== 'object') { |
| 25976 |
return false; |
| 25977 |
} |
| 25978 |
|
| 25979 |
const prototype = getPrototypeOf(val); |
| 25980 |
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); |
| 25981 |
} |
| 25982 |
|
| 25983 |
/** |
| 25984 |
* Determine if a value is a Date |
| 25985 |
* |
| 25986 |
* @param {*} val The value to test |
| 25987 |
* |
| 25988 |
* @returns {boolean} True if value is a Date, otherwise false |
| 25989 |
*/ |
| 25990 |
const isDate = kindOfTest('Date'); |
| 25991 |
|
| 25992 |
/** |
| 25993 |
* Determine if a value is a File |
| 25994 |
* |
| 25995 |
* @param {*} val The value to test |
| 25996 |
* |
| 25997 |
* @returns {boolean} True if value is a File, otherwise false |
| 25998 |
*/ |
| 25999 |
const isFile = kindOfTest('File'); |
| 26000 |
|
| 26001 |
/** |
| 26002 |
* Determine if a value is a Blob |
| 26003 |
* |
| 26004 |
* @param {*} val The value to test |
| 26005 |
* |
| 26006 |
* @returns {boolean} True if value is a Blob, otherwise false |
| 26007 |
*/ |
| 26008 |
const isBlob = kindOfTest('Blob'); |
| 26009 |
|
| 26010 |
/** |
| 26011 |
* Determine if a value is a FileList |
| 26012 |
* |
| 26013 |
* @param {*} val The value to test |
| 26014 |
* |
| 26015 |
* @returns {boolean} True if value is a File, otherwise false |
| 26016 |
*/ |
| 26017 |
const isFileList = kindOfTest('FileList'); |
| 26018 |
|
| 26019 |
/** |
| 26020 |
* Determine if a value is a Stream |
| 26021 |
* |
| 26022 |
* @param {*} val The value to test |
| 26023 |
* |
| 26024 |
* @returns {boolean} True if value is a Stream, otherwise false |
| 26025 |
*/ |
| 26026 |
const isStream = (val) => isObject(val) && isFunction(val.pipe); |
| 26027 |
|
| 26028 |
/** |
| 26029 |
* Determine if a value is a FormData |
| 26030 |
* |
| 26031 |
* @param {*} thing The value to test |
| 26032 |
* |
| 26033 |
* @returns {boolean} True if value is an FormData, otherwise false |
| 26034 |
*/ |
| 26035 |
const isFormData = (thing) => { |
| 26036 |
const pattern = '[object FormData]'; |
| 26037 |
return thing && ( |
| 26038 |
(typeof FormData === 'function' && thing instanceof FormData) || |
| 26039 |
utils_toString.call(thing) === pattern || |
| 26040 |
(isFunction(thing.toString) && thing.toString() === pattern) |
| 26041 |
); |
| 26042 |
} |
| 26043 |
|
| 26044 |
/** |
| 26045 |
* Determine if a value is a URLSearchParams object |
| 26046 |
* |
| 26047 |
* @param {*} val The value to test |
| 26048 |
* |
| 26049 |
* @returns {boolean} True if value is a URLSearchParams object, otherwise false |
| 26050 |
*/ |
| 26051 |
const isURLSearchParams = kindOfTest('URLSearchParams'); |
| 26052 |
|
| 26053 |
/** |
| 26054 |
* Trim excess whitespace off the beginning and end of a string |
| 26055 |
* |
| 26056 |
* @param {String} str The String to trim |
| 26057 |
* |
| 26058 |
* @returns {String} The String freed of excess whitespace |
| 26059 |
*/ |
| 26060 |
const trim = (str) => str.trim ? |
| 26061 |
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); |
| 26062 |
|
| 26063 |
/** |
| 26064 |
* Iterate over an Array or an Object invoking a function for each item. |
| 26065 |
* |
| 26066 |
* If `obj` is an Array callback will be called passing |
| 26067 |
* the value, index, and complete array for each item. |
| 26068 |
* |
| 26069 |
* If 'obj' is an Object callback will be called passing |
| 26070 |
* the value, key, and complete object for each property. |
| 26071 |
* |
| 26072 |
* @param {Object|Array} obj The object to iterate |
| 26073 |
* @param {Function} fn The callback to invoke for each item |
| 26074 |
* |
| 26075 |
* @param {Boolean} [allOwnKeys = false] |
| 26076 |
* @returns {void} |
| 26077 |
*/ |
| 26078 |
function forEach(obj, fn, {allOwnKeys = false} = {}) { |
| 26079 |
// Don't bother if no value provided |
| 26080 |
if (obj === null || typeof obj === 'undefined') { |
| 26081 |
return; |
| 26082 |
} |
| 26083 |
|
| 26084 |
let i; |
| 26085 |
let l; |
| 26086 |
|
| 26087 |
// Force an array if not already something iterable |
| 26088 |
if (typeof obj !== 'object') { |
| 26089 |
/*eslint no-param-reassign:0*/ |
| 26090 |
obj = [obj]; |
| 26091 |
} |
| 26092 |
|
| 26093 |
if (isArray(obj)) { |
| 26094 |
// Iterate over array values |
| 26095 |
for (i = 0, l = obj.length; i < l; i++) { |
| 26096 |
fn.call(null, obj[i], i, obj); |
| 26097 |
} |
| 26098 |
} else { |
| 26099 |
// Iterate over object keys |
| 26100 |
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); |
| 26101 |
const len = keys.length; |
| 26102 |
let key; |
| 26103 |
|
| 26104 |
for (i = 0; i < len; i++) { |
| 26105 |
key = keys[i]; |
| 26106 |
fn.call(null, obj[key], key, obj); |
| 26107 |
} |
| 26108 |
} |
| 26109 |
} |
| 26110 |
|
| 26111 |
/** |
| 26112 |
* Accepts varargs expecting each argument to be an object, then |
| 26113 |
* immutably merges the properties of each object and returns result. |
| 26114 |
* |
| 26115 |
* When multiple objects contain the same key the later object in |
| 26116 |
* the arguments list will take precedence. |
| 26117 |
* |
| 26118 |
* Example: |
| 26119 |
* |
| 26120 |
* ```js |
| 26121 |
* var result = merge({foo: 123}, {foo: 456}); |
| 26122 |
* console.log(result.foo); // outputs 456 |
| 26123 |
* ``` |
| 26124 |
* |
| 26125 |
* @param {Object} obj1 Object to merge |
| 26126 |
* |
| 26127 |
* @returns {Object} Result of all merge properties |
| 26128 |
*/ |
| 26129 |
function merge(/* obj1, obj2, obj3, ... */) { |
| 26130 |
const result = {}; |
| 26131 |
const assignValue = (val, key) => { |
| 26132 |
if (isPlainObject(result[key]) && isPlainObject(val)) { |
| 26133 |
result[key] = merge(result[key], val); |
| 26134 |
} else if (isPlainObject(val)) { |
| 26135 |
result[key] = merge({}, val); |
| 26136 |
} else if (isArray(val)) { |
| 26137 |
result[key] = val.slice(); |
| 26138 |
} else { |
| 26139 |
result[key] = val; |
| 26140 |
} |
| 26141 |
} |
| 26142 |
|
| 26143 |
for (let i = 0, l = arguments.length; i < l; i++) { |
| 26144 |
arguments[i] && forEach(arguments[i], assignValue); |
| 26145 |
} |
| 26146 |
return result; |
| 26147 |
} |
| 26148 |
|
| 26149 |
/** |
| 26150 |
* Extends object a by mutably adding to it the properties of object b. |
| 26151 |
* |
| 26152 |
* @param {Object} a The object to be extended |
| 26153 |
* @param {Object} b The object to copy properties from |
| 26154 |
* @param {Object} thisArg The object to bind function to |
| 26155 |
* |
| 26156 |
* @param {Boolean} [allOwnKeys] |
| 26157 |
* @returns {Object} The resulting value of object a |
| 26158 |
*/ |
| 26159 |
const extend = (a, b, thisArg, {allOwnKeys}= {}) => { |
| 26160 |
forEach(b, (val, key) => { |
| 26161 |
if (thisArg && isFunction(val)) { |
| 26162 |
a[key] = bind(val, thisArg); |
| 26163 |
} else { |
| 26164 |
a[key] = val; |
| 26165 |
} |
| 26166 |
}, {allOwnKeys}); |
| 26167 |
return a; |
| 26168 |
} |
| 26169 |
|
| 26170 |
/** |
| 26171 |
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) |
| 26172 |
* |
| 26173 |
* @param {string} content with BOM |
| 26174 |
* |
| 26175 |
* @returns {string} content value without BOM |
| 26176 |
*/ |
| 26177 |
const stripBOM = (content) => { |
| 26178 |
if (content.charCodeAt(0) === 0xFEFF) { |
| 26179 |
content = content.slice(1); |
| 26180 |
} |
| 26181 |
return content; |
| 26182 |
} |
| 26183 |
|
| 26184 |
/** |
| 26185 |
* Inherit the prototype methods from one constructor into another |
| 26186 |
* @param {function} constructor |
| 26187 |
* @param {function} superConstructor |
| 26188 |
* @param {object} [props] |
| 26189 |
* @param {object} [descriptors] |
| 26190 |
* |
| 26191 |
* @returns {void} |
| 26192 |
*/ |
| 26193 |
const inherits = (constructor, superConstructor, props, descriptors) => { |
| 26194 |
constructor.prototype = Object.create(superConstructor.prototype, descriptors); |
| 26195 |
constructor.prototype.constructor = constructor; |
| 26196 |
Object.defineProperty(constructor, 'super', { |
| 26197 |
value: superConstructor.prototype |
| 26198 |
}); |
| 26199 |
props && Object.assign(constructor.prototype, props); |
| 26200 |
} |
| 26201 |
|
| 26202 |
/** |
| 26203 |
* Resolve object with deep prototype chain to a flat object |
| 26204 |
* @param {Object} sourceObj source object |
| 26205 |
* @param {Object} [destObj] |
| 26206 |
* @param {Function|Boolean} [filter] |
| 26207 |
* @param {Function} [propFilter] |
| 26208 |
* |
| 26209 |
* @returns {Object} |
| 26210 |
*/ |
| 26211 |
const toFlatObject = (sourceObj, destObj, filter, propFilter) => { |
| 26212 |
let props; |
| 26213 |
let i; |
| 26214 |
let prop; |
| 26215 |
const merged = {}; |
| 26216 |
|
| 26217 |
destObj = destObj || {}; |
| 26218 |
// eslint-disable-next-line no-eq-null,eqeqeq |
| 26219 |
if (sourceObj == null) return destObj; |
| 26220 |
|
| 26221 |
do { |
| 26222 |
props = Object.getOwnPropertyNames(sourceObj); |
| 26223 |
i = props.length; |
| 26224 |
while (i-- > 0) { |
| 26225 |
prop = props[i]; |
| 26226 |
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { |
| 26227 |
destObj[prop] = sourceObj[prop]; |
| 26228 |
merged[prop] = true; |
| 26229 |
} |
| 26230 |
} |
| 26231 |
sourceObj = filter !== false && getPrototypeOf(sourceObj); |
| 26232 |
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); |
| 26233 |
|
| 26234 |
return destObj; |
| 26235 |
} |
| 26236 |
|
| 26237 |
/** |
| 26238 |
* Determines whether a string ends with the characters of a specified string |
| 26239 |
* |
| 26240 |
* @param {String} str |
| 26241 |
* @param {String} searchString |
| 26242 |
* @param {Number} [position= 0] |
| 26243 |
* |
| 26244 |
* @returns {boolean} |
| 26245 |
*/ |
| 26246 |
const endsWith = (str, searchString, position) => { |
| 26247 |
str = String(str); |
| 26248 |
if (position === undefined || position > str.length) { |
| 26249 |
position = str.length; |
| 26250 |
} |
| 26251 |
position -= searchString.length; |
| 26252 |
const lastIndex = str.indexOf(searchString, position); |
| 26253 |
return lastIndex !== -1 && lastIndex === position; |
| 26254 |
} |
| 26255 |
|
| 26256 |
|
| 26257 |
/** |
| 26258 |
* Returns new array from array like object or null if failed |
| 26259 |
* |
| 26260 |
* @param {*} [thing] |
| 26261 |
* |
| 26262 |
* @returns {?Array} |
| 26263 |
*/ |
| 26264 |
const toArray = (thing) => { |
| 26265 |
if (!thing) return null; |
| 26266 |
if (isArray(thing)) return thing; |
| 26267 |
let i = thing.length; |
| 26268 |
if (!isNumber(i)) return null; |
| 26269 |
const arr = new Array(i); |
| 26270 |
while (i-- > 0) { |
| 26271 |
arr[i] = thing[i]; |
| 26272 |
} |
| 26273 |
return arr; |
| 26274 |
} |
| 26275 |
|
| 26276 |
/** |
| 26277 |
* Checking if the Uint8Array exists and if it does, it returns a function that checks if the |
| 26278 |
* thing passed in is an instance of Uint8Array |
| 26279 |
* |
| 26280 |
* @param {TypedArray} |
| 26281 |
* |
| 26282 |
* @returns {Array} |
| 26283 |
*/ |
| 26284 |
// eslint-disable-next-line func-names |
| 26285 |
const isTypedArray = (TypedArray => { |
| 26286 |
// eslint-disable-next-line func-names |
| 26287 |
return thing => { |
| 26288 |
return TypedArray && thing instanceof TypedArray; |
| 26289 |
}; |
| 26290 |
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); |
| 26291 |
|
| 26292 |
/** |
| 26293 |
* For each entry in the object, call the function with the key and value. |
| 26294 |
* |
| 26295 |
* @param {Object<any, any>} obj - The object to iterate over. |
| 26296 |
* @param {Function} fn - The function to call for each entry. |
| 26297 |
* |
| 26298 |
* @returns {void} |
| 26299 |
*/ |
| 26300 |
const forEachEntry = (obj, fn) => { |
| 26301 |
const generator = obj && obj[Symbol.iterator]; |
| 26302 |
|
| 26303 |
const iterator = generator.call(obj); |
| 26304 |
|
| 26305 |
let result; |
| 26306 |
|
| 26307 |
while ((result = iterator.next()) && !result.done) { |
| 26308 |
const pair = result.value; |
| 26309 |
fn.call(obj, pair[0], pair[1]); |
| 26310 |
} |
| 26311 |
} |
| 26312 |
|
| 26313 |
/** |
| 26314 |
* It takes a regular expression and a string, and returns an array of all the matches |
| 26315 |
* |
| 26316 |
* @param {string} regExp - The regular expression to match against. |
| 26317 |
* @param {string} str - The string to search. |
| 26318 |
* |
| 26319 |
* @returns {Array<boolean>} |
| 26320 |
*/ |
| 26321 |
const matchAll = (regExp, str) => { |
| 26322 |
let matches; |
| 26323 |
const arr = []; |
| 26324 |
|
| 26325 |
while ((matches = regExp.exec(str)) !== null) { |
| 26326 |
arr.push(matches); |
| 26327 |
} |
| 26328 |
|
| 26329 |
return arr; |
| 26330 |
} |
| 26331 |
|
| 26332 |
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ |
| 26333 |
const isHTMLForm = kindOfTest('HTMLFormElement'); |
| 26334 |
|
| 26335 |
const toCamelCase = str => { |
| 26336 |
return str.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g, |
| 26337 |
function replacer(m, p1, p2) { |
| 26338 |
return p1.toUpperCase() + p2; |
| 26339 |
} |
| 26340 |
); |
| 26341 |
}; |
| 26342 |
|
| 26343 |
/* Creating a function that will check if an object has a property. */ |
| 26344 |
const utils_hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); |
| 26345 |
|
| 26346 |
/** |
| 26347 |
* Determine if a value is a RegExp object |
| 26348 |
* |
| 26349 |
* @param {*} val The value to test |
| 26350 |
* |
| 26351 |
* @returns {boolean} True if value is a RegExp object, otherwise false |
| 26352 |
*/ |
| 26353 |
const isRegExp = kindOfTest('RegExp'); |
| 26354 |
|
| 26355 |
const reduceDescriptors = (obj, reducer) => { |
| 26356 |
const descriptors = Object.getOwnPropertyDescriptors(obj); |
| 26357 |
const reducedDescriptors = {}; |
| 26358 |
|
| 26359 |
forEach(descriptors, (descriptor, name) => { |
| 26360 |
if (reducer(descriptor, name, obj) !== false) { |
| 26361 |
reducedDescriptors[name] = descriptor; |
| 26362 |
} |
| 26363 |
}); |
| 26364 |
|
| 26365 |
Object.defineProperties(obj, reducedDescriptors); |
| 26366 |
} |
| 26367 |
|
| 26368 |
/** |
| 26369 |
* Makes all methods read-only |
| 26370 |
* @param {Object} obj |
| 26371 |
*/ |
| 26372 |
|
| 26373 |
const freezeMethods = (obj) => { |
| 26374 |
reduceDescriptors(obj, (descriptor, name) => { |
| 26375 |
const value = obj[name]; |
| 26376 |
|
| 26377 |
if (!isFunction(value)) return; |
| 26378 |
|
| 26379 |
descriptor.enumerable = false; |
| 26380 |
|
| 26381 |
if ('writable' in descriptor) { |
| 26382 |
descriptor.writable = false; |
| 26383 |
return; |
| 26384 |
} |
| 26385 |
|
| 26386 |
if (!descriptor.set) { |
| 26387 |
descriptor.set = () => { |
| 26388 |
throw Error('Can not read-only method \'' + name + '\''); |
| 26389 |
}; |
| 26390 |
} |
| 26391 |
}); |
| 26392 |
} |
| 26393 |
|
| 26394 |
const toObjectSet = (arrayOrString, delimiter) => { |
| 26395 |
const obj = {}; |
| 26396 |
|
| 26397 |
const define = (arr) => { |
| 26398 |
arr.forEach(value => { |
| 26399 |
obj[value] = true; |
| 26400 |
}); |
| 26401 |
} |
| 26402 |
|
| 26403 |
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); |
| 26404 |
|
| 26405 |
return obj; |
| 26406 |
} |
| 26407 |
|
| 26408 |
const noop = () => {} |
| 26409 |
|
| 26410 |
const toFiniteNumber = (value, defaultValue) => { |
| 26411 |
value = +value; |
| 26412 |
return Number.isFinite(value) ? value : defaultValue; |
| 26413 |
} |
| 26414 |
|
| 26415 |
/* harmony default export */ const utils = ({ |
| 26416 |
isArray, |
| 26417 |
isArrayBuffer, |
| 26418 |
isBuffer, |
| 26419 |
isFormData, |
| 26420 |
isArrayBufferView, |
| 26421 |
isString, |
| 26422 |
isNumber, |
| 26423 |
isBoolean, |
| 26424 |
isObject, |
| 26425 |
isPlainObject, |
| 26426 |
isUndefined, |
| 26427 |
isDate, |
| 26428 |
isFile, |
| 26429 |
isBlob, |
| 26430 |
isRegExp, |
| 26431 |
isFunction, |
| 26432 |
isStream, |
| 26433 |
isURLSearchParams, |
| 26434 |
isTypedArray, |
| 26435 |
isFileList, |
| 26436 |
forEach, |
| 26437 |
merge, |
| 26438 |
extend, |
| 26439 |
trim, |
| 26440 |
stripBOM, |
| 26441 |
inherits, |
| 26442 |
toFlatObject, |
| 26443 |
kindOf, |
| 26444 |
kindOfTest, |
| 26445 |
endsWith, |
| 26446 |
toArray, |
| 26447 |
forEachEntry, |
| 26448 |
matchAll, |
| 26449 |
isHTMLForm, |
| 26450 |
hasOwnProperty: utils_hasOwnProperty, |
| 26451 |
hasOwnProp: utils_hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection |
| 26452 |
reduceDescriptors, |
| 26453 |
freezeMethods, |
| 26454 |
toObjectSet, |
| 26455 |
toCamelCase, |
| 26456 |
noop, |
| 26457 |
toFiniteNumber |
| 26458 |
}); |
| 26459 |
|
| 26460 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/core/AxiosError.js |
| 26461 |
|
| 26462 |
|
| 26463 |
|
| 26464 |
|
| 26465 |
/** |
| 26466 |
* Create an Error with the specified message, config, error code, request and response. |
| 26467 |
* |
| 26468 |
* @param {string} message The error message. |
| 26469 |
* @param {string} [code] The error code (for example, 'ECONNABORTED'). |
| 26470 |
* @param {Object} [config] The config. |
| 26471 |
* @param {Object} [request] The request. |
| 26472 |
* @param {Object} [response] The response. |
| 26473 |
* |
| 26474 |
* @returns {Error} The created error. |
| 26475 |
*/ |
| 26476 |
function AxiosError(message, code, config, request, response) { |
| 26477 |
Error.call(this); |
| 26478 |
|
| 26479 |
if (Error.captureStackTrace) { |
| 26480 |
Error.captureStackTrace(this, this.constructor); |
| 26481 |
} else { |
| 26482 |
this.stack = (new Error()).stack; |
| 26483 |
} |
| 26484 |
|
| 26485 |
this.message = message; |
| 26486 |
this.name = 'AxiosError'; |
| 26487 |
code && (this.code = code); |
| 26488 |
config && (this.config = config); |
| 26489 |
request && (this.request = request); |
| 26490 |
response && (this.response = response); |
| 26491 |
} |
| 26492 |
|
| 26493 |
utils.inherits(AxiosError, Error, { |
| 26494 |
toJSON: function toJSON() { |
| 26495 |
return { |
| 26496 |
// Standard |
| 26497 |
message: this.message, |
| 26498 |
name: this.name, |
| 26499 |
// Microsoft |
| 26500 |
description: this.description, |
| 26501 |
number: this.number, |
| 26502 |
// Mozilla |
| 26503 |
fileName: this.fileName, |
| 26504 |
lineNumber: this.lineNumber, |
| 26505 |
columnNumber: this.columnNumber, |
| 26506 |
stack: this.stack, |
| 26507 |
// Axios |
| 26508 |
config: this.config, |
| 26509 |
code: this.code, |
| 26510 |
status: this.response && this.response.status ? this.response.status : null |
| 26511 |
}; |
| 26512 |
} |
| 26513 |
}); |
| 26514 |
|
| 26515 |
const AxiosError_prototype = AxiosError.prototype; |
| 26516 |
const descriptors = {}; |
| 26517 |
|
| 26518 |
[ |
| 26519 |
'ERR_BAD_OPTION_VALUE', |
| 26520 |
'ERR_BAD_OPTION', |
| 26521 |
'ECONNABORTED', |
| 26522 |
'ETIMEDOUT', |
| 26523 |
'ERR_NETWORK', |
| 26524 |
'ERR_FR_TOO_MANY_REDIRECTS', |
| 26525 |
'ERR_DEPRECATED', |
| 26526 |
'ERR_BAD_RESPONSE', |
| 26527 |
'ERR_BAD_REQUEST', |
| 26528 |
'ERR_CANCELED', |
| 26529 |
'ERR_NOT_SUPPORT', |
| 26530 |
'ERR_INVALID_URL' |
| 26531 |
// eslint-disable-next-line func-names |
| 26532 |
].forEach(code => { |
| 26533 |
descriptors[code] = {value: code}; |
| 26534 |
}); |
| 26535 |
|
| 26536 |
Object.defineProperties(AxiosError, descriptors); |
| 26537 |
Object.defineProperty(AxiosError_prototype, 'isAxiosError', {value: true}); |
| 26538 |
|
| 26539 |
// eslint-disable-next-line func-names |
| 26540 |
AxiosError.from = (error, code, config, request, response, customProps) => { |
| 26541 |
const axiosError = Object.create(AxiosError_prototype); |
| 26542 |
|
| 26543 |
utils.toFlatObject(error, axiosError, function filter(obj) { |
| 26544 |
return obj !== Error.prototype; |
| 26545 |
}, prop => { |
| 26546 |
return prop !== 'isAxiosError'; |
| 26547 |
}); |
| 26548 |
|
| 26549 |
AxiosError.call(axiosError, error.message, code, config, request, response); |
| 26550 |
|
| 26551 |
axiosError.cause = error; |
| 26552 |
|
| 26553 |
axiosError.name = error.name; |
| 26554 |
|
| 26555 |
customProps && Object.assign(axiosError, customProps); |
| 26556 |
|
| 26557 |
return axiosError; |
| 26558 |
}; |
| 26559 |
|
| 26560 |
/* harmony default export */ const core_AxiosError = (AxiosError); |
| 26561 |
|
| 26562 |
// EXTERNAL MODULE: ./node_modules/form-data/lib/browser.js |
| 26563 |
var browser = __webpack_require__(6230); |
| 26564 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/env/classes/FormData.js |
| 26565 |
|
| 26566 |
/* harmony default export */ const classes_FormData = (browser); |
| 26567 |
|
| 26568 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/toFormData.js |
| 26569 |
|
| 26570 |
|
| 26571 |
|
| 26572 |
|
| 26573 |
|
| 26574 |
|
| 26575 |
/** |
| 26576 |
* Determines if the given thing is a array or js object. |
| 26577 |
* |
| 26578 |
* @param {string} thing - The object or array to be visited. |
| 26579 |
* |
| 26580 |
* @returns {boolean} |
| 26581 |
*/ |
| 26582 |
function isVisitable(thing) { |
| 26583 |
return utils.isPlainObject(thing) || utils.isArray(thing); |
| 26584 |
} |
| 26585 |
|
| 26586 |
/** |
| 26587 |
* It removes the brackets from the end of a string |
| 26588 |
* |
| 26589 |
* @param {string} key - The key of the parameter. |
| 26590 |
* |
| 26591 |
* @returns {string} the key without the brackets. |
| 26592 |
*/ |
| 26593 |
function removeBrackets(key) { |
| 26594 |
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key; |
| 26595 |
} |
| 26596 |
|
| 26597 |
/** |
| 26598 |
* It takes a path, a key, and a boolean, and returns a string |
| 26599 |
* |
| 26600 |
* @param {string} path - The path to the current key. |
| 26601 |
* @param {string} key - The key of the current object being iterated over. |
| 26602 |
* @param {string} dots - If true, the key will be rendered with dots instead of brackets. |
| 26603 |
* |
| 26604 |
* @returns {string} The path to the current key. |
| 26605 |
*/ |
| 26606 |
function renderKey(path, key, dots) { |
| 26607 |
if (!path) return key; |
| 26608 |
return path.concat(key).map(function each(token, i) { |
| 26609 |
// eslint-disable-next-line no-param-reassign |
| 26610 |
token = removeBrackets(token); |
| 26611 |
return !dots && i ? '[' + token + ']' : token; |
| 26612 |
}).join(dots ? '.' : ''); |
| 26613 |
} |
| 26614 |
|
| 26615 |
/** |
| 26616 |
* If the array is an array and none of its elements are visitable, then it's a flat array. |
| 26617 |
* |
| 26618 |
* @param {Array<any>} arr - The array to check |
| 26619 |
* |
| 26620 |
* @returns {boolean} |
| 26621 |
*/ |
| 26622 |
function isFlatArray(arr) { |
| 26623 |
return utils.isArray(arr) && !arr.some(isVisitable); |
| 26624 |
} |
| 26625 |
|
| 26626 |
const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) { |
| 26627 |
return /^is[A-Z]/.test(prop); |
| 26628 |
}); |
| 26629 |
|
| 26630 |
/** |
| 26631 |
* If the thing is a FormData object, return true, otherwise return false. |
| 26632 |
* |
| 26633 |
* @param {unknown} thing - The thing to check. |
| 26634 |
* |
| 26635 |
* @returns {boolean} |
| 26636 |
*/ |
| 26637 |
function isSpecCompliant(thing) { |
| 26638 |
return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]; |
| 26639 |
} |
| 26640 |
|
| 26641 |
/** |
| 26642 |
* Convert a data object to FormData |
| 26643 |
* |
| 26644 |
* @param {Object} obj |
| 26645 |
* @param {?Object} [formData] |
| 26646 |
* @param {?Object} [options] |
| 26647 |
* @param {Function} [options.visitor] |
| 26648 |
* @param {Boolean} [options.metaTokens = true] |
| 26649 |
* @param {Boolean} [options.dots = false] |
| 26650 |
* @param {?Boolean} [options.indexes = false] |
| 26651 |
* |
| 26652 |
* @returns {Object} |
| 26653 |
**/ |
| 26654 |
|
| 26655 |
/** |
| 26656 |
* It converts an object into a FormData object |
| 26657 |
* |
| 26658 |
* @param {Object<any, any>} obj - The object to convert to form data. |
| 26659 |
* @param {string} formData - The FormData object to append to. |
| 26660 |
* @param {Object<string, any>} options |
| 26661 |
* |
| 26662 |
* @returns |
| 26663 |
*/ |
| 26664 |
function toFormData(obj, formData, options) { |
| 26665 |
if (!utils.isObject(obj)) { |
| 26666 |
throw new TypeError('target must be an object'); |
| 26667 |
} |
| 26668 |
|
| 26669 |
// eslint-disable-next-line no-param-reassign |
| 26670 |
formData = formData || new (classes_FormData || FormData)(); |
| 26671 |
|
| 26672 |
// eslint-disable-next-line no-param-reassign |
| 26673 |
options = utils.toFlatObject(options, { |
| 26674 |
metaTokens: true, |
| 26675 |
dots: false, |
| 26676 |
indexes: false |
| 26677 |
}, false, function defined(option, source) { |
| 26678 |
// eslint-disable-next-line no-eq-null,eqeqeq |
| 26679 |
return !utils.isUndefined(source[option]); |
| 26680 |
}); |
| 26681 |
|
| 26682 |
const metaTokens = options.metaTokens; |
| 26683 |
// eslint-disable-next-line no-use-before-define |
| 26684 |
const visitor = options.visitor || defaultVisitor; |
| 26685 |
const dots = options.dots; |
| 26686 |
const indexes = options.indexes; |
| 26687 |
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; |
| 26688 |
const useBlob = _Blob && isSpecCompliant(formData); |
| 26689 |
|
| 26690 |
if (!utils.isFunction(visitor)) { |
| 26691 |
throw new TypeError('visitor must be a function'); |
| 26692 |
} |
| 26693 |
|
| 26694 |
function convertValue(value) { |
| 26695 |
if (value === null) return ''; |
| 26696 |
|
| 26697 |
if (utils.isDate(value)) { |
| 26698 |
return value.toISOString(); |
| 26699 |
} |
| 26700 |
|
| 26701 |
if (!useBlob && utils.isBlob(value)) { |
| 26702 |
throw new core_AxiosError('Blob is not supported. Use a Buffer instead.'); |
| 26703 |
} |
| 26704 |
|
| 26705 |
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { |
| 26706 |
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); |
| 26707 |
} |
| 26708 |
|
| 26709 |
return value; |
| 26710 |
} |
| 26711 |
|
| 26712 |
/** |
| 26713 |
* Default visitor. |
| 26714 |
* |
| 26715 |
* @param {*} value |
| 26716 |
* @param {String|Number} key |
| 26717 |
* @param {Array<String|Number>} path |
| 26718 |
* @this {FormData} |
| 26719 |
* |
| 26720 |
* @returns {boolean} return true to visit the each prop of the value recursively |
| 26721 |
*/ |
| 26722 |
function defaultVisitor(value, key, path) { |
| 26723 |
let arr = value; |
| 26724 |
|
| 26725 |
if (value && !path && typeof value === 'object') { |
| 26726 |
if (utils.endsWith(key, '{}')) { |
| 26727 |
// eslint-disable-next-line no-param-reassign |
| 26728 |
key = metaTokens ? key : key.slice(0, -2); |
| 26729 |
// eslint-disable-next-line no-param-reassign |
| 26730 |
value = JSON.stringify(value); |
| 26731 |
} else if ( |
| 26732 |
(utils.isArray(value) && isFlatArray(value)) || |
| 26733 |
(utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value)) |
| 26734 |
)) { |
| 26735 |
// eslint-disable-next-line no-param-reassign |
| 26736 |
key = removeBrackets(key); |
| 26737 |
|
| 26738 |
arr.forEach(function each(el, index) { |
| 26739 |
!(utils.isUndefined(el) || el === null) && formData.append( |
| 26740 |
// eslint-disable-next-line no-nested-ternary |
| 26741 |
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), |
| 26742 |
convertValue(el) |
| 26743 |
); |
| 26744 |
}); |
| 26745 |
return false; |
| 26746 |
} |
| 26747 |
} |
| 26748 |
|
| 26749 |
if (isVisitable(value)) { |
| 26750 |
return true; |
| 26751 |
} |
| 26752 |
|
| 26753 |
formData.append(renderKey(path, key, dots), convertValue(value)); |
| 26754 |
|
| 26755 |
return false; |
| 26756 |
} |
| 26757 |
|
| 26758 |
const stack = []; |
| 26759 |
|
| 26760 |
const exposedHelpers = Object.assign(predicates, { |
| 26761 |
defaultVisitor, |
| 26762 |
convertValue, |
| 26763 |
isVisitable |
| 26764 |
}); |
| 26765 |
|
| 26766 |
function build(value, path) { |
| 26767 |
if (utils.isUndefined(value)) return; |
| 26768 |
|
| 26769 |
if (stack.indexOf(value) !== -1) { |
| 26770 |
throw Error('Circular reference detected in ' + path.join('.')); |
| 26771 |
} |
| 26772 |
|
| 26773 |
stack.push(value); |
| 26774 |
|
| 26775 |
utils.forEach(value, function each(el, key) { |
| 26776 |
const result = !(utils.isUndefined(el) || el === null) && visitor.call( |
| 26777 |
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers |
| 26778 |
); |
| 26779 |
|
| 26780 |
if (result === true) { |
| 26781 |
build(el, path ? path.concat(key) : [key]); |
| 26782 |
} |
| 26783 |
}); |
| 26784 |
|
| 26785 |
stack.pop(); |
| 26786 |
} |
| 26787 |
|
| 26788 |
if (!utils.isObject(obj)) { |
| 26789 |
throw new TypeError('data must be an object'); |
| 26790 |
} |
| 26791 |
|
| 26792 |
build(obj); |
| 26793 |
|
| 26794 |
return formData; |
| 26795 |
} |
| 26796 |
|
| 26797 |
/* harmony default export */ const helpers_toFormData = (toFormData); |
| 26798 |
|
| 26799 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js |
| 26800 |
|
| 26801 |
|
| 26802 |
|
| 26803 |
|
| 26804 |
/** |
| 26805 |
* It encodes a string by replacing all characters that are not in the unreserved set with |
| 26806 |
* their percent-encoded equivalents |
| 26807 |
* |
| 26808 |
* @param {string} str - The string to encode. |
| 26809 |
* |
| 26810 |
* @returns {string} The encoded string. |
| 26811 |
*/ |
| 26812 |
function encode(str) { |
| 26813 |
const charMap = { |
| 26814 |
'!': '%21', |
| 26815 |
"'": '%27', |
| 26816 |
'(': '%28', |
| 26817 |
')': '%29', |
| 26818 |
'~': '%7E', |
| 26819 |
'%20': '+', |
| 26820 |
'%00': '\x00' |
| 26821 |
}; |
| 26822 |
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { |
| 26823 |
return charMap[match]; |
| 26824 |
}); |
| 26825 |
} |
| 26826 |
|
| 26827 |
/** |
| 26828 |
* It takes a params object and converts it to a FormData object |
| 26829 |
* |
| 26830 |
* @param {Object<string, any>} params - The parameters to be converted to a FormData object. |
| 26831 |
* @param {Object<string, any>} options - The options object passed to the Axios constructor. |
| 26832 |
* |
| 26833 |
* @returns {void} |
| 26834 |
*/ |
| 26835 |
function AxiosURLSearchParams(params, options) { |
| 26836 |
this._pairs = []; |
| 26837 |
|
| 26838 |
params && helpers_toFormData(params, this, options); |
| 26839 |
} |
| 26840 |
|
| 26841 |
const AxiosURLSearchParams_prototype = AxiosURLSearchParams.prototype; |
| 26842 |
|
| 26843 |
AxiosURLSearchParams_prototype.append = function append(name, value) { |
| 26844 |
this._pairs.push([name, value]); |
| 26845 |
}; |
| 26846 |
|
| 26847 |
AxiosURLSearchParams_prototype.toString = function toString(encoder) { |
| 26848 |
const _encode = encoder ? function(value) { |
| 26849 |
return encoder.call(this, value, encode); |
| 26850 |
} : encode; |
| 26851 |
|
| 26852 |
return this._pairs.map(function each(pair) { |
| 26853 |
return _encode(pair[0]) + '=' + _encode(pair[1]); |
| 26854 |
}, '').join('&'); |
| 26855 |
}; |
| 26856 |
|
| 26857 |
/* harmony default export */ const helpers_AxiosURLSearchParams = (AxiosURLSearchParams); |
| 26858 |
|
| 26859 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/buildURL.js |
| 26860 |
|
| 26861 |
|
| 26862 |
|
| 26863 |
|
| 26864 |
|
| 26865 |
/** |
| 26866 |
* It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their |
| 26867 |
* URI encoded counterparts |
| 26868 |
* |
| 26869 |
* @param {string} val The value to be encoded. |
| 26870 |
* |
| 26871 |
* @returns {string} The encoded value. |
| 26872 |
*/ |
| 26873 |
function buildURL_encode(val) { |
| 26874 |
return encodeURIComponent(val). |
| 26875 |
replace(/%3A/gi, ':'). |
| 26876 |
replace(/%24/g, '$'). |
| 26877 |
replace(/%2C/gi, ','). |
| 26878 |
replace(/%20/g, '+'). |
| 26879 |
replace(/%5B/gi, '['). |
| 26880 |
replace(/%5D/gi, ']'); |
| 26881 |
} |
| 26882 |
|
| 26883 |
/** |
| 26884 |
* Build a URL by appending params to the end |
| 26885 |
* |
| 26886 |
* @param {string} url The base of the url (e.g., http://www.google.com) |
| 26887 |
* @param {object} [params] The params to be appended |
| 26888 |
* @param {?object} options |
| 26889 |
* |
| 26890 |
* @returns {string} The formatted url |
| 26891 |
*/ |
| 26892 |
function buildURL(url, params, options) { |
| 26893 |
/*eslint no-param-reassign:0*/ |
| 26894 |
if (!params) { |
| 26895 |
return url; |
| 26896 |
} |
| 26897 |
|
| 26898 |
const _encode = options && options.encode || buildURL_encode; |
| 26899 |
|
| 26900 |
const serializeFn = options && options.serialize; |
| 26901 |
|
| 26902 |
let serializedParams; |
| 26903 |
|
| 26904 |
if (serializeFn) { |
| 26905 |
serializedParams = serializeFn(params, options); |
| 26906 |
} else { |
| 26907 |
serializedParams = utils.isURLSearchParams(params) ? |
| 26908 |
params.toString() : |
| 26909 |
new helpers_AxiosURLSearchParams(params, options).toString(_encode); |
| 26910 |
} |
| 26911 |
|
| 26912 |
if (serializedParams) { |
| 26913 |
const hashmarkIndex = url.indexOf("#"); |
| 26914 |
|
| 26915 |
if (hashmarkIndex !== -1) { |
| 26916 |
url = url.slice(0, hashmarkIndex); |
| 26917 |
} |
| 26918 |
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; |
| 26919 |
} |
| 26920 |
|
| 26921 |
return url; |
| 26922 |
} |
| 26923 |
|
| 26924 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/core/InterceptorManager.js |
| 26925 |
|
| 26926 |
|
| 26927 |
|
| 26928 |
|
| 26929 |
class InterceptorManager { |
| 26930 |
constructor() { |
| 26931 |
this.handlers = []; |
| 26932 |
} |
| 26933 |
|
| 26934 |
/** |
| 26935 |
* Add a new interceptor to the stack |
| 26936 |
* |
| 26937 |
* @param {Function} fulfilled The function to handle `then` for a `Promise` |
| 26938 |
* @param {Function} rejected The function to handle `reject` for a `Promise` |
| 26939 |
* |
| 26940 |
* @return {Number} An ID used to remove interceptor later |
| 26941 |
*/ |
| 26942 |
use(fulfilled, rejected, options) { |
| 26943 |
this.handlers.push({ |
| 26944 |
fulfilled, |
| 26945 |
rejected, |
| 26946 |
synchronous: options ? options.synchronous : false, |
| 26947 |
runWhen: options ? options.runWhen : null |
| 26948 |
}); |
| 26949 |
return this.handlers.length - 1; |
| 26950 |
} |
| 26951 |
|
| 26952 |
/** |
| 26953 |
* Remove an interceptor from the stack |
| 26954 |
* |
| 26955 |
* @param {Number} id The ID that was returned by `use` |
| 26956 |
* |
| 26957 |
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise |
| 26958 |
*/ |
| 26959 |
eject(id) { |
| 26960 |
if (this.handlers[id]) { |
| 26961 |
this.handlers[id] = null; |
| 26962 |
} |
| 26963 |
} |
| 26964 |
|
| 26965 |
/** |
| 26966 |
* Clear all interceptors from the stack |
| 26967 |
* |
| 26968 |
* @returns {void} |
| 26969 |
*/ |
| 26970 |
clear() { |
| 26971 |
if (this.handlers) { |
| 26972 |
this.handlers = []; |
| 26973 |
} |
| 26974 |
} |
| 26975 |
|
| 26976 |
/** |
| 26977 |
* Iterate over all the registered interceptors |
| 26978 |
* |
| 26979 |
* This method is particularly useful for skipping over any |
| 26980 |
* interceptors that may have become `null` calling `eject`. |
| 26981 |
* |
| 26982 |
* @param {Function} fn The function to call for each interceptor |
| 26983 |
* |
| 26984 |
* @returns {void} |
| 26985 |
*/ |
| 26986 |
forEach(fn) { |
| 26987 |
utils.forEach(this.handlers, function forEachHandler(h) { |
| 26988 |
if (h !== null) { |
| 26989 |
fn(h); |
| 26990 |
} |
| 26991 |
}); |
| 26992 |
} |
| 26993 |
} |
| 26994 |
|
| 26995 |
/* harmony default export */ const core_InterceptorManager = (InterceptorManager); |
| 26996 |
|
| 26997 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/defaults/transitional.js |
| 26998 |
|
| 26999 |
|
| 27000 |
/* harmony default export */ const defaults_transitional = ({ |
| 27001 |
silentJSONParsing: true, |
| 27002 |
forcedJSONParsing: true, |
| 27003 |
clarifyTimeoutError: false |
| 27004 |
}); |
| 27005 |
|
| 27006 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js |
| 27007 |
|
| 27008 |
|
| 27009 |
|
| 27010 |
/* harmony default export */ const classes_URLSearchParams = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : helpers_AxiosURLSearchParams); |
| 27011 |
|
| 27012 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/platform/browser/classes/FormData.js |
| 27013 |
|
| 27014 |
|
| 27015 |
/* harmony default export */ const browser_classes_FormData = (FormData); |
| 27016 |
|
| 27017 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/platform/browser/index.js |
| 27018 |
|
| 27019 |
|
| 27020 |
|
| 27021 |
/** |
| 27022 |
* Determine if we're running in a standard browser environment |
| 27023 |
* |
| 27024 |
* This allows axios to run in a web worker, and react-native. |
| 27025 |
* Both environments support XMLHttpRequest, but not fully standard globals. |
| 27026 |
* |
| 27027 |
* web workers: |
| 27028 |
* typeof window -> undefined |
| 27029 |
* typeof document -> undefined |
| 27030 |
* |
| 27031 |
* react-native: |
| 27032 |
* navigator.product -> 'ReactNative' |
| 27033 |
* nativescript |
| 27034 |
* navigator.product -> 'NativeScript' or 'NS' |
| 27035 |
* |
| 27036 |
* @returns {boolean} |
| 27037 |
*/ |
| 27038 |
const isStandardBrowserEnv = (() => { |
| 27039 |
let product; |
| 27040 |
if (typeof navigator !== 'undefined' && ( |
| 27041 |
(product = navigator.product) === 'ReactNative' || |
| 27042 |
product === 'NativeScript' || |
| 27043 |
product === 'NS') |
| 27044 |
) { |
| 27045 |
return false; |
| 27046 |
} |
| 27047 |
|
| 27048 |
return typeof window !== 'undefined' && typeof document !== 'undefined'; |
| 27049 |
})(); |
| 27050 |
|
| 27051 |
/* harmony default export */ const platform_browser = ({ |
| 27052 |
isBrowser: true, |
| 27053 |
classes: { |
| 27054 |
URLSearchParams: classes_URLSearchParams, |
| 27055 |
FormData: browser_classes_FormData, |
| 27056 |
Blob |
| 27057 |
}, |
| 27058 |
isStandardBrowserEnv, |
| 27059 |
protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] |
| 27060 |
}); |
| 27061 |
|
| 27062 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/platform/index.js |
| 27063 |
|
| 27064 |
|
| 27065 |
|
| 27066 |
|
| 27067 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/toURLEncodedForm.js |
| 27068 |
|
| 27069 |
|
| 27070 |
|
| 27071 |
|
| 27072 |
|
| 27073 |
|
| 27074 |
function toURLEncodedForm(data, options) { |
| 27075 |
return helpers_toFormData(data, new platform_browser.classes.URLSearchParams(), Object.assign({ |
| 27076 |
visitor: function(value, key, path, helpers) { |
| 27077 |
if (platform_browser.isNode && utils.isBuffer(value)) { |
| 27078 |
this.append(key, value.toString('base64')); |
| 27079 |
return false; |
| 27080 |
} |
| 27081 |
|
| 27082 |
return helpers.defaultVisitor.apply(this, arguments); |
| 27083 |
} |
| 27084 |
}, options)); |
| 27085 |
} |
| 27086 |
|
| 27087 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/formDataToJSON.js |
| 27088 |
|
| 27089 |
|
| 27090 |
|
| 27091 |
|
| 27092 |
/** |
| 27093 |
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] |
| 27094 |
* |
| 27095 |
* @param {string} name - The name of the property to get. |
| 27096 |
* |
| 27097 |
* @returns An array of strings. |
| 27098 |
*/ |
| 27099 |
function parsePropPath(name) { |
| 27100 |
// foo[x][y][z] |
| 27101 |
// foo.x.y.z |
| 27102 |
// foo-x-y-z |
| 27103 |
// foo x y z |
| 27104 |
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => { |
| 27105 |
return match[0] === '[]' ? '' : match[1] || match[0]; |
| 27106 |
}); |
| 27107 |
} |
| 27108 |
|
| 27109 |
/** |
| 27110 |
* Convert an array to an object. |
| 27111 |
* |
| 27112 |
* @param {Array<any>} arr - The array to convert to an object. |
| 27113 |
* |
| 27114 |
* @returns An object with the same keys and values as the array. |
| 27115 |
*/ |
| 27116 |
function arrayToObject(arr) { |
| 27117 |
const obj = {}; |
| 27118 |
const keys = Object.keys(arr); |
| 27119 |
let i; |
| 27120 |
const len = keys.length; |
| 27121 |
let key; |
| 27122 |
for (i = 0; i < len; i++) { |
| 27123 |
key = keys[i]; |
| 27124 |
obj[key] = arr[key]; |
| 27125 |
} |
| 27126 |
return obj; |
| 27127 |
} |
| 27128 |
|
| 27129 |
/** |
| 27130 |
* It takes a FormData object and returns a JavaScript object |
| 27131 |
* |
| 27132 |
* @param {string} formData The FormData object to convert to JSON. |
| 27133 |
* |
| 27134 |
* @returns {Object<string, any> | null} The converted object. |
| 27135 |
*/ |
| 27136 |
function formDataToJSON(formData) { |
| 27137 |
function buildPath(path, value, target, index) { |
| 27138 |
let name = path[index++]; |
| 27139 |
const isNumericKey = Number.isFinite(+name); |
| 27140 |
const isLast = index >= path.length; |
| 27141 |
name = !name && utils.isArray(target) ? target.length : name; |
| 27142 |
|
| 27143 |
if (isLast) { |
| 27144 |
if (utils.hasOwnProp(target, name)) { |
| 27145 |
target[name] = [target[name], value]; |
| 27146 |
} else { |
| 27147 |
target[name] = value; |
| 27148 |
} |
| 27149 |
|
| 27150 |
return !isNumericKey; |
| 27151 |
} |
| 27152 |
|
| 27153 |
if (!target[name] || !utils.isObject(target[name])) { |
| 27154 |
target[name] = []; |
| 27155 |
} |
| 27156 |
|
| 27157 |
const result = buildPath(path, value, target[name], index); |
| 27158 |
|
| 27159 |
if (result && utils.isArray(target[name])) { |
| 27160 |
target[name] = arrayToObject(target[name]); |
| 27161 |
} |
| 27162 |
|
| 27163 |
return !isNumericKey; |
| 27164 |
} |
| 27165 |
|
| 27166 |
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) { |
| 27167 |
const obj = {}; |
| 27168 |
|
| 27169 |
utils.forEachEntry(formData, (name, value) => { |
| 27170 |
buildPath(parsePropPath(name), value, obj, 0); |
| 27171 |
}); |
| 27172 |
|
| 27173 |
return obj; |
| 27174 |
} |
| 27175 |
|
| 27176 |
return null; |
| 27177 |
} |
| 27178 |
|
| 27179 |
/* harmony default export */ const helpers_formDataToJSON = (formDataToJSON); |
| 27180 |
|
| 27181 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/core/settle.js |
| 27182 |
|
| 27183 |
|
| 27184 |
|
| 27185 |
|
| 27186 |
/** |
| 27187 |
* Resolve or reject a Promise based on response status. |
| 27188 |
* |
| 27189 |
* @param {Function} resolve A function that resolves the promise. |
| 27190 |
* @param {Function} reject A function that rejects the promise. |
| 27191 |
* @param {object} response The response. |
| 27192 |
* |
| 27193 |
* @returns {object} The response. |
| 27194 |
*/ |
| 27195 |
function settle(resolve, reject, response) { |
| 27196 |
const validateStatus = response.config.validateStatus; |
| 27197 |
if (!response.status || !validateStatus || validateStatus(response.status)) { |
| 27198 |
resolve(response); |
| 27199 |
} else { |
| 27200 |
reject(new core_AxiosError( |
| 27201 |
'Request failed with status code ' + response.status, |
| 27202 |
[core_AxiosError.ERR_BAD_REQUEST, core_AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], |
| 27203 |
response.config, |
| 27204 |
response.request, |
| 27205 |
response |
| 27206 |
)); |
| 27207 |
} |
| 27208 |
} |
| 27209 |
|
| 27210 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/cookies.js |
| 27211 |
|
| 27212 |
|
| 27213 |
|
| 27214 |
|
| 27215 |
|
| 27216 |
/* harmony default export */ const cookies = (platform_browser.isStandardBrowserEnv ? |
| 27217 |
|
| 27218 |
// Standard browser envs support document.cookie |
| 27219 |
(function standardBrowserEnv() { |
| 27220 |
return { |
| 27221 |
write: function write(name, value, expires, path, domain, secure) { |
| 27222 |
const cookie = []; |
| 27223 |
cookie.push(name + '=' + encodeURIComponent(value)); |
| 27224 |
|
| 27225 |
if (utils.isNumber(expires)) { |
| 27226 |
cookie.push('expires=' + new Date(expires).toGMTString()); |
| 27227 |
} |
| 27228 |
|
| 27229 |
if (utils.isString(path)) { |
| 27230 |
cookie.push('path=' + path); |
| 27231 |
} |
| 27232 |
|
| 27233 |
if (utils.isString(domain)) { |
| 27234 |
cookie.push('domain=' + domain); |
| 27235 |
} |
| 27236 |
|
| 27237 |
if (secure === true) { |
| 27238 |
cookie.push('secure'); |
| 27239 |
} |
| 27240 |
|
| 27241 |
document.cookie = cookie.join('; '); |
| 27242 |
}, |
| 27243 |
|
| 27244 |
read: function read(name) { |
| 27245 |
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); |
| 27246 |
return (match ? decodeURIComponent(match[3]) : null); |
| 27247 |
}, |
| 27248 |
|
| 27249 |
remove: function remove(name) { |
| 27250 |
this.write(name, '', Date.now() - 86400000); |
| 27251 |
} |
| 27252 |
}; |
| 27253 |
})() : |
| 27254 |
|
| 27255 |
// Non standard browser env (web workers, react-native) lack needed support. |
| 27256 |
(function nonStandardBrowserEnv() { |
| 27257 |
return { |
| 27258 |
write: function write() {}, |
| 27259 |
read: function read() { return null; }, |
| 27260 |
remove: function remove() {} |
| 27261 |
}; |
| 27262 |
})()); |
| 27263 |
|
| 27264 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/isAbsoluteURL.js |
| 27265 |
|
| 27266 |
|
| 27267 |
/** |
| 27268 |
* Determines whether the specified URL is absolute |
| 27269 |
* |
| 27270 |
* @param {string} url The URL to test |
| 27271 |
* |
| 27272 |
* @returns {boolean} True if the specified URL is absolute, otherwise false |
| 27273 |
*/ |
| 27274 |
function isAbsoluteURL(url) { |
| 27275 |
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). |
| 27276 |
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed |
| 27277 |
// by any combination of letters, digits, plus, period, or hyphen. |
| 27278 |
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); |
| 27279 |
} |
| 27280 |
|
| 27281 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/combineURLs.js |
| 27282 |
|
| 27283 |
|
| 27284 |
/** |
| 27285 |
* Creates a new URL by combining the specified URLs |
| 27286 |
* |
| 27287 |
* @param {string} baseURL The base URL |
| 27288 |
* @param {string} relativeURL The relative URL |
| 27289 |
* |
| 27290 |
* @returns {string} The combined URL |
| 27291 |
*/ |
| 27292 |
function combineURLs(baseURL, relativeURL) { |
| 27293 |
return relativeURL |
| 27294 |
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') |
| 27295 |
: baseURL; |
| 27296 |
} |
| 27297 |
|
| 27298 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/core/buildFullPath.js |
| 27299 |
|
| 27300 |
|
| 27301 |
|
| 27302 |
|
| 27303 |
|
| 27304 |
/** |
| 27305 |
* Creates a new URL by combining the baseURL with the requestedURL, |
| 27306 |
* only when the requestedURL is not already an absolute URL. |
| 27307 |
* If the requestURL is absolute, this function returns the requestedURL untouched. |
| 27308 |
* |
| 27309 |
* @param {string} baseURL The base URL |
| 27310 |
* @param {string} requestedURL Absolute or relative URL to combine |
| 27311 |
* |
| 27312 |
* @returns {string} The combined full path |
| 27313 |
*/ |
| 27314 |
function buildFullPath(baseURL, requestedURL) { |
| 27315 |
if (baseURL && !isAbsoluteURL(requestedURL)) { |
| 27316 |
return combineURLs(baseURL, requestedURL); |
| 27317 |
} |
| 27318 |
return requestedURL; |
| 27319 |
} |
| 27320 |
|
| 27321 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/isURLSameOrigin.js |
| 27322 |
|
| 27323 |
|
| 27324 |
|
| 27325 |
|
| 27326 |
|
| 27327 |
/* harmony default export */ const isURLSameOrigin = (platform_browser.isStandardBrowserEnv ? |
| 27328 |
|
| 27329 |
// Standard browser envs have full support of the APIs needed to test |
| 27330 |
// whether the request URL is of the same origin as current location. |
| 27331 |
(function standardBrowserEnv() { |
| 27332 |
const msie = /(msie|trident)/i.test(navigator.userAgent); |
| 27333 |
const urlParsingNode = document.createElement('a'); |
| 27334 |
let originURL; |
| 27335 |
|
| 27336 |
/** |
| 27337 |
* Parse a URL to discover it's components |
| 27338 |
* |
| 27339 |
* @param {String} url The URL to be parsed |
| 27340 |
* @returns {Object} |
| 27341 |
*/ |
| 27342 |
function resolveURL(url) { |
| 27343 |
let href = url; |
| 27344 |
|
| 27345 |
if (msie) { |
| 27346 |
// IE needs attribute set twice to normalize properties |
| 27347 |
urlParsingNode.setAttribute('href', href); |
| 27348 |
href = urlParsingNode.href; |
| 27349 |
} |
| 27350 |
|
| 27351 |
urlParsingNode.setAttribute('href', href); |
| 27352 |
|
| 27353 |
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
| 27354 |
return { |
| 27355 |
href: urlParsingNode.href, |
| 27356 |
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
| 27357 |
host: urlParsingNode.host, |
| 27358 |
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
| 27359 |
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
| 27360 |
hostname: urlParsingNode.hostname, |
| 27361 |
port: urlParsingNode.port, |
| 27362 |
pathname: (urlParsingNode.pathname.charAt(0) === '/') ? |
| 27363 |
urlParsingNode.pathname : |
| 27364 |
'/' + urlParsingNode.pathname |
| 27365 |
}; |
| 27366 |
} |
| 27367 |
|
| 27368 |
originURL = resolveURL(window.location.href); |
| 27369 |
|
| 27370 |
/** |
| 27371 |
* Determine if a URL shares the same origin as the current location |
| 27372 |
* |
| 27373 |
* @param {String} requestURL The URL to test |
| 27374 |
* @returns {boolean} True if URL shares the same origin, otherwise false |
| 27375 |
*/ |
| 27376 |
return function isURLSameOrigin(requestURL) { |
| 27377 |
const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; |
| 27378 |
return (parsed.protocol === originURL.protocol && |
| 27379 |
parsed.host === originURL.host); |
| 27380 |
}; |
| 27381 |
})() : |
| 27382 |
|
| 27383 |
// Non standard browser envs (web workers, react-native) lack needed support. |
| 27384 |
(function nonStandardBrowserEnv() { |
| 27385 |
return function isURLSameOrigin() { |
| 27386 |
return true; |
| 27387 |
}; |
| 27388 |
})()); |
| 27389 |
|
| 27390 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/cancel/CanceledError.js |
| 27391 |
|
| 27392 |
|
| 27393 |
|
| 27394 |
|
| 27395 |
|
| 27396 |
/** |
| 27397 |
* A `CanceledError` is an object that is thrown when an operation is canceled. |
| 27398 |
* |
| 27399 |
* @param {string=} message The message. |
| 27400 |
* @param {Object=} config The config. |
| 27401 |
* @param {Object=} request The request. |
| 27402 |
* |
| 27403 |
* @returns {CanceledError} The created error. |
| 27404 |
*/ |
| 27405 |
function CanceledError(message, config, request) { |
| 27406 |
// eslint-disable-next-line no-eq-null,eqeqeq |
| 27407 |
core_AxiosError.call(this, message == null ? 'canceled' : message, core_AxiosError.ERR_CANCELED, config, request); |
| 27408 |
this.name = 'CanceledError'; |
| 27409 |
} |
| 27410 |
|
| 27411 |
utils.inherits(CanceledError, core_AxiosError, { |
| 27412 |
__CANCEL__: true |
| 27413 |
}); |
| 27414 |
|
| 27415 |
/* harmony default export */ const cancel_CanceledError = (CanceledError); |
| 27416 |
|
| 27417 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseProtocol.js |
| 27418 |
|
| 27419 |
|
| 27420 |
function parseProtocol(url) { |
| 27421 |
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); |
| 27422 |
return match && match[1] || ''; |
| 27423 |
} |
| 27424 |
|
| 27425 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseHeaders.js |
| 27426 |
|
| 27427 |
|
| 27428 |
|
| 27429 |
|
| 27430 |
// RawAxiosHeaders whose duplicates are ignored by node |
| 27431 |
// c.f. https://nodejs.org/api/http.html#http_message_headers |
| 27432 |
const ignoreDuplicateOf = utils.toObjectSet([ |
| 27433 |
'age', 'authorization', 'content-length', 'content-type', 'etag', |
| 27434 |
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', |
| 27435 |
'last-modified', 'location', 'max-forwards', 'proxy-authorization', |
| 27436 |
'referer', 'retry-after', 'user-agent' |
| 27437 |
]); |
| 27438 |
|
| 27439 |
/** |
| 27440 |
* Parse headers into an object |
| 27441 |
* |
| 27442 |
* ``` |
| 27443 |
* Date: Wed, 27 Aug 2014 08:58:49 GMT |
| 27444 |
* Content-Type: application/json |
| 27445 |
* Connection: keep-alive |
| 27446 |
* Transfer-Encoding: chunked |
| 27447 |
* ``` |
| 27448 |
* |
| 27449 |
* @param {String} rawHeaders Headers needing to be parsed |
| 27450 |
* |
| 27451 |
* @returns {Object} Headers parsed into an object |
| 27452 |
*/ |
| 27453 |
/* harmony default export */ const parseHeaders = (rawHeaders => { |
| 27454 |
const parsed = {}; |
| 27455 |
let key; |
| 27456 |
let val; |
| 27457 |
let i; |
| 27458 |
|
| 27459 |
rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { |
| 27460 |
i = line.indexOf(':'); |
| 27461 |
key = line.substring(0, i).trim().toLowerCase(); |
| 27462 |
val = line.substring(i + 1).trim(); |
| 27463 |
|
| 27464 |
if (!key || (parsed[key] && ignoreDuplicateOf[key])) { |
| 27465 |
return; |
| 27466 |
} |
| 27467 |
|
| 27468 |
if (key === 'set-cookie') { |
| 27469 |
if (parsed[key]) { |
| 27470 |
parsed[key].push(val); |
| 27471 |
} else { |
| 27472 |
parsed[key] = [val]; |
| 27473 |
} |
| 27474 |
} else { |
| 27475 |
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; |
| 27476 |
} |
| 27477 |
}); |
| 27478 |
|
| 27479 |
return parsed; |
| 27480 |
}); |
| 27481 |
|
| 27482 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/core/AxiosHeaders.js |
| 27483 |
|
| 27484 |
|
| 27485 |
|
| 27486 |
|
| 27487 |
|
| 27488 |
const $internals = Symbol('internals'); |
| 27489 |
const $defaults = Symbol('defaults'); |
| 27490 |
|
| 27491 |
function normalizeHeader(header) { |
| 27492 |
return header && String(header).trim().toLowerCase(); |
| 27493 |
} |
| 27494 |
|
| 27495 |
function normalizeValue(value) { |
| 27496 |
if (value === false || value == null) { |
| 27497 |
return value; |
| 27498 |
} |
| 27499 |
|
| 27500 |
return utils.isArray(value) ? value.map(normalizeValue) : String(value); |
| 27501 |
} |
| 27502 |
|
| 27503 |
function parseTokens(str) { |
| 27504 |
const tokens = Object.create(null); |
| 27505 |
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; |
| 27506 |
let match; |
| 27507 |
|
| 27508 |
while ((match = tokensRE.exec(str))) { |
| 27509 |
tokens[match[1]] = match[2]; |
| 27510 |
} |
| 27511 |
|
| 27512 |
return tokens; |
| 27513 |
} |
| 27514 |
|
| 27515 |
function matchHeaderValue(context, value, header, filter) { |
| 27516 |
if (utils.isFunction(filter)) { |
| 27517 |
return filter.call(this, value, header); |
| 27518 |
} |
| 27519 |
|
| 27520 |
if (!utils.isString(value)) return; |
| 27521 |
|
| 27522 |
if (utils.isString(filter)) { |
| 27523 |
return value.indexOf(filter) !== -1; |
| 27524 |
} |
| 27525 |
|
| 27526 |
if (utils.isRegExp(filter)) { |
| 27527 |
return filter.test(value); |
| 27528 |
} |
| 27529 |
} |
| 27530 |
|
| 27531 |
function formatHeader(header) { |
| 27532 |
return header.trim() |
| 27533 |
.toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { |
| 27534 |
return char.toUpperCase() + str; |
| 27535 |
}); |
| 27536 |
} |
| 27537 |
|
| 27538 |
function buildAccessors(obj, header) { |
| 27539 |
const accessorName = utils.toCamelCase(' ' + header); |
| 27540 |
|
| 27541 |
['get', 'set', 'has'].forEach(methodName => { |
| 27542 |
Object.defineProperty(obj, methodName + accessorName, { |
| 27543 |
value: function(arg1, arg2, arg3) { |
| 27544 |
return this[methodName].call(this, header, arg1, arg2, arg3); |
| 27545 |
}, |
| 27546 |
configurable: true |
| 27547 |
}); |
| 27548 |
}); |
| 27549 |
} |
| 27550 |
|
| 27551 |
function findKey(obj, key) { |
| 27552 |
key = key.toLowerCase(); |
| 27553 |
const keys = Object.keys(obj); |
| 27554 |
let i = keys.length; |
| 27555 |
let _key; |
| 27556 |
while (i-- > 0) { |
| 27557 |
_key = keys[i]; |
| 27558 |
if (key === _key.toLowerCase()) { |
| 27559 |
return _key; |
| 27560 |
} |
| 27561 |
} |
| 27562 |
return null; |
| 27563 |
} |
| 27564 |
|
| 27565 |
function AxiosHeaders(headers, defaults) { |
| 27566 |
headers && this.set(headers); |
| 27567 |
this[$defaults] = defaults || null; |
| 27568 |
} |
| 27569 |
|
| 27570 |
Object.assign(AxiosHeaders.prototype, { |
| 27571 |
set: function(header, valueOrRewrite, rewrite) { |
| 27572 |
const self = this; |
| 27573 |
|
| 27574 |
function setHeader(_value, _header, _rewrite) { |
| 27575 |
const lHeader = normalizeHeader(_header); |
| 27576 |
|
| 27577 |
if (!lHeader) { |
| 27578 |
throw new Error('header name must be a non-empty string'); |
| 27579 |
} |
| 27580 |
|
| 27581 |
const key = findKey(self, lHeader); |
| 27582 |
|
| 27583 |
if (key && _rewrite !== true && (self[key] === false || _rewrite === false)) { |
| 27584 |
return; |
| 27585 |
} |
| 27586 |
|
| 27587 |
self[key || _header] = normalizeValue(_value); |
| 27588 |
} |
| 27589 |
|
| 27590 |
if (utils.isPlainObject(header)) { |
| 27591 |
utils.forEach(header, (_value, _header) => { |
| 27592 |
setHeader(_value, _header, valueOrRewrite); |
| 27593 |
}); |
| 27594 |
} else { |
| 27595 |
setHeader(valueOrRewrite, header, rewrite); |
| 27596 |
} |
| 27597 |
|
| 27598 |
return this; |
| 27599 |
}, |
| 27600 |
|
| 27601 |
get: function(header, parser) { |
| 27602 |
header = normalizeHeader(header); |
| 27603 |
|
| 27604 |
if (!header) return undefined; |
| 27605 |
|
| 27606 |
const key = findKey(this, header); |
| 27607 |
|
| 27608 |
if (key) { |
| 27609 |
const value = this[key]; |
| 27610 |
|
| 27611 |
if (!parser) { |
| 27612 |
return value; |
| 27613 |
} |
| 27614 |
|
| 27615 |
if (parser === true) { |
| 27616 |
return parseTokens(value); |
| 27617 |
} |
| 27618 |
|
| 27619 |
if (utils.isFunction(parser)) { |
| 27620 |
return parser.call(this, value, key); |
| 27621 |
} |
| 27622 |
|
| 27623 |
if (utils.isRegExp(parser)) { |
| 27624 |
return parser.exec(value); |
| 27625 |
} |
| 27626 |
|
| 27627 |
throw new TypeError('parser must be boolean|regexp|function'); |
| 27628 |
} |
| 27629 |
}, |
| 27630 |
|
| 27631 |
has: function(header, matcher) { |
| 27632 |
header = normalizeHeader(header); |
| 27633 |
|
| 27634 |
if (header) { |
| 27635 |
const key = findKey(this, header); |
| 27636 |
|
| 27637 |
return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher))); |
| 27638 |
} |
| 27639 |
|
| 27640 |
return false; |
| 27641 |
}, |
| 27642 |
|
| 27643 |
delete: function(header, matcher) { |
| 27644 |
const self = this; |
| 27645 |
let deleted = false; |
| 27646 |
|
| 27647 |
function deleteHeader(_header) { |
| 27648 |
_header = normalizeHeader(_header); |
| 27649 |
|
| 27650 |
if (_header) { |
| 27651 |
const key = findKey(self, _header); |
| 27652 |
|
| 27653 |
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { |
| 27654 |
delete self[key]; |
| 27655 |
|
| 27656 |
deleted = true; |
| 27657 |
} |
| 27658 |
} |
| 27659 |
} |
| 27660 |
|
| 27661 |
if (utils.isArray(header)) { |
| 27662 |
header.forEach(deleteHeader); |
| 27663 |
} else { |
| 27664 |
deleteHeader(header); |
| 27665 |
} |
| 27666 |
|
| 27667 |
return deleted; |
| 27668 |
}, |
| 27669 |
|
| 27670 |
clear: function() { |
| 27671 |
return Object.keys(this).forEach(this.delete.bind(this)); |
| 27672 |
}, |
| 27673 |
|
| 27674 |
normalize: function(format) { |
| 27675 |
const self = this; |
| 27676 |
const headers = {}; |
| 27677 |
|
| 27678 |
utils.forEach(this, (value, header) => { |
| 27679 |
const key = findKey(headers, header); |
| 27680 |
|
| 27681 |
if (key) { |
| 27682 |
self[key] = normalizeValue(value); |
| 27683 |
delete self[header]; |
| 27684 |
return; |
| 27685 |
} |
| 27686 |
|
| 27687 |
const normalized = format ? formatHeader(header) : String(header).trim(); |
| 27688 |
|
| 27689 |
if (normalized !== header) { |
| 27690 |
delete self[header]; |
| 27691 |
} |
| 27692 |
|
| 27693 |
self[normalized] = normalizeValue(value); |
| 27694 |
|
| 27695 |
headers[normalized] = true; |
| 27696 |
}); |
| 27697 |
|
| 27698 |
return this; |
| 27699 |
}, |
| 27700 |
|
| 27701 |
toJSON: function(asStrings) { |
| 27702 |
const obj = Object.create(null); |
| 27703 |
|
| 27704 |
utils.forEach(Object.assign({}, this[$defaults] || null, this), |
| 27705 |
(value, header) => { |
| 27706 |
if (value == null || value === false) return; |
| 27707 |
obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value; |
| 27708 |
}); |
| 27709 |
|
| 27710 |
return obj; |
| 27711 |
} |
| 27712 |
}); |
| 27713 |
|
| 27714 |
Object.assign(AxiosHeaders, { |
| 27715 |
from: function(thing) { |
| 27716 |
if (utils.isString(thing)) { |
| 27717 |
return new this(parseHeaders(thing)); |
| 27718 |
} |
| 27719 |
return thing instanceof this ? thing : new this(thing); |
| 27720 |
}, |
| 27721 |
|
| 27722 |
accessor: function(header) { |
| 27723 |
const internals = this[$internals] = (this[$internals] = { |
| 27724 |
accessors: {} |
| 27725 |
}); |
| 27726 |
|
| 27727 |
const accessors = internals.accessors; |
| 27728 |
const prototype = this.prototype; |
| 27729 |
|
| 27730 |
function defineAccessor(_header) { |
| 27731 |
const lHeader = normalizeHeader(_header); |
| 27732 |
|
| 27733 |
if (!accessors[lHeader]) { |
| 27734 |
buildAccessors(prototype, _header); |
| 27735 |
accessors[lHeader] = true; |
| 27736 |
} |
| 27737 |
} |
| 27738 |
|
| 27739 |
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); |
| 27740 |
|
| 27741 |
return this; |
| 27742 |
} |
| 27743 |
}); |
| 27744 |
|
| 27745 |
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent']); |
| 27746 |
|
| 27747 |
utils.freezeMethods(AxiosHeaders.prototype); |
| 27748 |
utils.freezeMethods(AxiosHeaders); |
| 27749 |
|
| 27750 |
/* harmony default export */ const core_AxiosHeaders = (AxiosHeaders); |
| 27751 |
|
| 27752 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/speedometer.js |
| 27753 |
|
| 27754 |
|
| 27755 |
/** |
| 27756 |
* Calculate data maxRate |
| 27757 |
* @param {Number} [samplesCount= 10] |
| 27758 |
* @param {Number} [min= 1000] |
| 27759 |
* @returns {Function} |
| 27760 |
*/ |
| 27761 |
function speedometer(samplesCount, min) { |
| 27762 |
samplesCount = samplesCount || 10; |
| 27763 |
const bytes = new Array(samplesCount); |
| 27764 |
const timestamps = new Array(samplesCount); |
| 27765 |
let head = 0; |
| 27766 |
let tail = 0; |
| 27767 |
let firstSampleTS; |
| 27768 |
|
| 27769 |
min = min !== undefined ? min : 1000; |
| 27770 |
|
| 27771 |
return function push(chunkLength) { |
| 27772 |
const now = Date.now(); |
| 27773 |
|
| 27774 |
const startedAt = timestamps[tail]; |
| 27775 |
|
| 27776 |
if (!firstSampleTS) { |
| 27777 |
firstSampleTS = now; |
| 27778 |
} |
| 27779 |
|
| 27780 |
bytes[head] = chunkLength; |
| 27781 |
timestamps[head] = now; |
| 27782 |
|
| 27783 |
let i = tail; |
| 27784 |
let bytesCount = 0; |
| 27785 |
|
| 27786 |
while (i !== head) { |
| 27787 |
bytesCount += bytes[i++]; |
| 27788 |
i = i % samplesCount; |
| 27789 |
} |
| 27790 |
|
| 27791 |
head = (head + 1) % samplesCount; |
| 27792 |
|
| 27793 |
if (head === tail) { |
| 27794 |
tail = (tail + 1) % samplesCount; |
| 27795 |
} |
| 27796 |
|
| 27797 |
if (now - firstSampleTS < min) { |
| 27798 |
return; |
| 27799 |
} |
| 27800 |
|
| 27801 |
const passed = startedAt && now - startedAt; |
| 27802 |
|
| 27803 |
return passed ? Math.round(bytesCount * 1000 / passed) : undefined; |
| 27804 |
}; |
| 27805 |
} |
| 27806 |
|
| 27807 |
/* harmony default export */ const helpers_speedometer = (speedometer); |
| 27808 |
|
| 27809 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/adapters/xhr.js |
| 27810 |
|
| 27811 |
|
| 27812 |
|
| 27813 |
|
| 27814 |
|
| 27815 |
|
| 27816 |
|
| 27817 |
|
| 27818 |
|
| 27819 |
|
| 27820 |
|
| 27821 |
|
| 27822 |
|
| 27823 |
|
| 27824 |
|
| 27825 |
|
| 27826 |
function progressEventReducer(listener, isDownloadStream) { |
| 27827 |
let bytesNotified = 0; |
| 27828 |
const _speedometer = helpers_speedometer(50, 250); |
| 27829 |
|
| 27830 |
return e => { |
| 27831 |
const loaded = e.loaded; |
| 27832 |
const total = e.lengthComputable ? e.total : undefined; |
| 27833 |
const progressBytes = loaded - bytesNotified; |
| 27834 |
const rate = _speedometer(progressBytes); |
| 27835 |
const inRange = loaded <= total; |
| 27836 |
|
| 27837 |
bytesNotified = loaded; |
| 27838 |
|
| 27839 |
const data = { |
| 27840 |
loaded, |
| 27841 |
total, |
| 27842 |
progress: total ? (loaded / total) : undefined, |
| 27843 |
bytes: progressBytes, |
| 27844 |
rate: rate ? rate : undefined, |
| 27845 |
estimated: rate && total && inRange ? (total - loaded) / rate : undefined |
| 27846 |
}; |
| 27847 |
|
| 27848 |
data[isDownloadStream ? 'download' : 'upload'] = true; |
| 27849 |
|
| 27850 |
listener(data); |
| 27851 |
}; |
| 27852 |
} |
| 27853 |
|
| 27854 |
function xhrAdapter(config) { |
| 27855 |
return new Promise(function dispatchXhrRequest(resolve, reject) { |
| 27856 |
let requestData = config.data; |
| 27857 |
const requestHeaders = core_AxiosHeaders.from(config.headers).normalize(); |
| 27858 |
const responseType = config.responseType; |
| 27859 |
let onCanceled; |
| 27860 |
function done() { |
| 27861 |
if (config.cancelToken) { |
| 27862 |
config.cancelToken.unsubscribe(onCanceled); |
| 27863 |
} |
| 27864 |
|
| 27865 |
if (config.signal) { |
| 27866 |
config.signal.removeEventListener('abort', onCanceled); |
| 27867 |
} |
| 27868 |
} |
| 27869 |
|
| 27870 |
if (utils.isFormData(requestData) && platform_browser.isStandardBrowserEnv) { |
| 27871 |
requestHeaders.setContentType(false); // Let the browser set it |
| 27872 |
} |
| 27873 |
|
| 27874 |
let request = new XMLHttpRequest(); |
| 27875 |
|
| 27876 |
// HTTP basic authentication |
| 27877 |
if (config.auth) { |
| 27878 |
const username = config.auth.username || ''; |
| 27879 |
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; |
| 27880 |
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); |
| 27881 |
} |
| 27882 |
|
| 27883 |
const fullPath = buildFullPath(config.baseURL, config.url); |
| 27884 |
|
| 27885 |
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); |
| 27886 |
|
| 27887 |
// Set the request timeout in MS |
| 27888 |
request.timeout = config.timeout; |
| 27889 |
|
| 27890 |
function onloadend() { |
| 27891 |
if (!request) { |
| 27892 |
return; |
| 27893 |
} |
| 27894 |
// Prepare the response |
| 27895 |
const responseHeaders = core_AxiosHeaders.from( |
| 27896 |
'getAllResponseHeaders' in request && request.getAllResponseHeaders() |
| 27897 |
); |
| 27898 |
const responseData = !responseType || responseType === 'text' || responseType === 'json' ? |
| 27899 |
request.responseText : request.response; |
| 27900 |
const response = { |
| 27901 |
data: responseData, |
| 27902 |
status: request.status, |
| 27903 |
statusText: request.statusText, |
| 27904 |
headers: responseHeaders, |
| 27905 |
config, |
| 27906 |
request |
| 27907 |
}; |
| 27908 |
|
| 27909 |
settle(function _resolve(value) { |
| 27910 |
resolve(value); |
| 27911 |
done(); |
| 27912 |
}, function _reject(err) { |
| 27913 |
reject(err); |
| 27914 |
done(); |
| 27915 |
}, response); |
| 27916 |
|
| 27917 |
// Clean up request |
| 27918 |
request = null; |
| 27919 |
} |
| 27920 |
|
| 27921 |
if ('onloadend' in request) { |
| 27922 |
// Use onloadend if available |
| 27923 |
request.onloadend = onloadend; |
| 27924 |
} else { |
| 27925 |
// Listen for ready state to emulate onloadend |
| 27926 |
request.onreadystatechange = function handleLoad() { |
| 27927 |
if (!request || request.readyState !== 4) { |
| 27928 |
return; |
| 27929 |
} |
| 27930 |
|
| 27931 |
// The request errored out and we didn't get a response, this will be |
| 27932 |
// handled by onerror instead |
| 27933 |
// With one exception: request that using file: protocol, most browsers |
| 27934 |
// will return status as 0 even though it's a successful request |
| 27935 |
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { |
| 27936 |
return; |
| 27937 |
} |
| 27938 |
// readystate handler is calling before onerror or ontimeout handlers, |
| 27939 |
// so we should call onloadend on the next 'tick' |
| 27940 |
setTimeout(onloadend); |
| 27941 |
}; |
| 27942 |
} |
| 27943 |
|
| 27944 |
// Handle browser request cancellation (as opposed to a manual cancellation) |
| 27945 |
request.onabort = function handleAbort() { |
| 27946 |
if (!request) { |
| 27947 |
return; |
| 27948 |
} |
| 27949 |
|
| 27950 |
reject(new core_AxiosError('Request aborted', core_AxiosError.ECONNABORTED, config, request)); |
| 27951 |
|
| 27952 |
// Clean up request |
| 27953 |
request = null; |
| 27954 |
}; |
| 27955 |
|
| 27956 |
// Handle low level network errors |
| 27957 |
request.onerror = function handleError() { |
| 27958 |
// Real errors are hidden from us by the browser |
| 27959 |
// onerror should only fire if it's a network error |
| 27960 |
reject(new core_AxiosError('Network Error', core_AxiosError.ERR_NETWORK, config, request)); |
| 27961 |
|
| 27962 |
// Clean up request |
| 27963 |
request = null; |
| 27964 |
}; |
| 27965 |
|
| 27966 |
// Handle timeout |
| 27967 |
request.ontimeout = function handleTimeout() { |
| 27968 |
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; |
| 27969 |
const transitional = config.transitional || defaults_transitional; |
| 27970 |
if (config.timeoutErrorMessage) { |
| 27971 |
timeoutErrorMessage = config.timeoutErrorMessage; |
| 27972 |
} |
| 27973 |
reject(new core_AxiosError( |
| 27974 |
timeoutErrorMessage, |
| 27975 |
transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED, |
| 27976 |
config, |
| 27977 |
request)); |
| 27978 |
|
| 27979 |
// Clean up request |
| 27980 |
request = null; |
| 27981 |
}; |
| 27982 |
|
| 27983 |
// Add xsrf header |
| 27984 |
// This is only done if running in a standard browser environment. |
| 27985 |
// Specifically not if we're in a web worker, or react-native. |
| 27986 |
if (platform_browser.isStandardBrowserEnv) { |
| 27987 |
// Add xsrf header |
| 27988 |
const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) |
| 27989 |
&& config.xsrfCookieName && cookies.read(config.xsrfCookieName); |
| 27990 |
|
| 27991 |
if (xsrfValue) { |
| 27992 |
requestHeaders.set(config.xsrfHeaderName, xsrfValue); |
| 27993 |
} |
| 27994 |
} |
| 27995 |
|
| 27996 |
// Remove Content-Type if data is undefined |
| 27997 |
requestData === undefined && requestHeaders.setContentType(null); |
| 27998 |
|
| 27999 |
// Add headers to the request |
| 28000 |
if ('setRequestHeader' in request) { |
| 28001 |
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { |
| 28002 |
request.setRequestHeader(key, val); |
| 28003 |
}); |
| 28004 |
} |
| 28005 |
|
| 28006 |
// Add withCredentials to request if needed |
| 28007 |
if (!utils.isUndefined(config.withCredentials)) { |
| 28008 |
request.withCredentials = !!config.withCredentials; |
| 28009 |
} |
| 28010 |
|
| 28011 |
// Add responseType to request if needed |
| 28012 |
if (responseType && responseType !== 'json') { |
| 28013 |
request.responseType = config.responseType; |
| 28014 |
} |
| 28015 |
|
| 28016 |
// Handle progress if needed |
| 28017 |
if (typeof config.onDownloadProgress === 'function') { |
| 28018 |
request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); |
| 28019 |
} |
| 28020 |
|
| 28021 |
// Not all browsers support upload events |
| 28022 |
if (typeof config.onUploadProgress === 'function' && request.upload) { |
| 28023 |
request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); |
| 28024 |
} |
| 28025 |
|
| 28026 |
if (config.cancelToken || config.signal) { |
| 28027 |
// Handle cancellation |
| 28028 |
// eslint-disable-next-line func-names |
| 28029 |
onCanceled = cancel => { |
| 28030 |
if (!request) { |
| 28031 |
return; |
| 28032 |
} |
| 28033 |
reject(!cancel || cancel.type ? new cancel_CanceledError(null, config, request) : cancel); |
| 28034 |
request.abort(); |
| 28035 |
request = null; |
| 28036 |
}; |
| 28037 |
|
| 28038 |
config.cancelToken && config.cancelToken.subscribe(onCanceled); |
| 28039 |
if (config.signal) { |
| 28040 |
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); |
| 28041 |
} |
| 28042 |
} |
| 28043 |
|
| 28044 |
const protocol = parseProtocol(fullPath); |
| 28045 |
|
| 28046 |
if (protocol && platform_browser.protocols.indexOf(protocol) === -1) { |
| 28047 |
reject(new core_AxiosError('Unsupported protocol ' + protocol + ':', core_AxiosError.ERR_BAD_REQUEST, config)); |
| 28048 |
return; |
| 28049 |
} |
| 28050 |
|
| 28051 |
|
| 28052 |
// Send the request |
| 28053 |
request.send(requestData || null); |
| 28054 |
}); |
| 28055 |
} |
| 28056 |
|
| 28057 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/adapters/index.js |
| 28058 |
|
| 28059 |
|
| 28060 |
|
| 28061 |
|
| 28062 |
const adapters = { |
| 28063 |
http: xhrAdapter, |
| 28064 |
xhr: xhrAdapter |
| 28065 |
} |
| 28066 |
|
| 28067 |
/* harmony default export */ const lib_adapters = ({ |
| 28068 |
getAdapter: (nameOrAdapter) => { |
| 28069 |
if(utils.isString(nameOrAdapter)){ |
| 28070 |
const adapter = adapters[nameOrAdapter]; |
| 28071 |
|
| 28072 |
if (!nameOrAdapter) { |
| 28073 |
throw Error( |
| 28074 |
utils.hasOwnProp(nameOrAdapter) ? |
| 28075 |
`Adapter '${nameOrAdapter}' is not available in the build` : |
| 28076 |
`Can not resolve adapter '${nameOrAdapter}'` |
| 28077 |
); |
| 28078 |
} |
| 28079 |
|
| 28080 |
return adapter |
| 28081 |
} |
| 28082 |
|
| 28083 |
if (!utils.isFunction(nameOrAdapter)) { |
| 28084 |
throw new TypeError('adapter is not a function'); |
| 28085 |
} |
| 28086 |
|
| 28087 |
return nameOrAdapter; |
| 28088 |
}, |
| 28089 |
adapters |
| 28090 |
}); |
| 28091 |
|
| 28092 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/defaults/index.js |
| 28093 |
|
| 28094 |
|
| 28095 |
|
| 28096 |
|
| 28097 |
|
| 28098 |
|
| 28099 |
|
| 28100 |
|
| 28101 |
|
| 28102 |
|
| 28103 |
|
| 28104 |
const DEFAULT_CONTENT_TYPE = { |
| 28105 |
'Content-Type': 'application/x-www-form-urlencoded' |
| 28106 |
}; |
| 28107 |
|
| 28108 |
/** |
| 28109 |
* If the browser has an XMLHttpRequest object, use the XHR adapter, otherwise use the HTTP |
| 28110 |
* adapter |
| 28111 |
* |
| 28112 |
* @returns {Function} |
| 28113 |
*/ |
| 28114 |
function getDefaultAdapter() { |
| 28115 |
let adapter; |
| 28116 |
if (typeof XMLHttpRequest !== 'undefined') { |
| 28117 |
// For browsers use XHR adapter |
| 28118 |
adapter = lib_adapters.getAdapter('xhr'); |
| 28119 |
} else if (typeof process !== 'undefined' && utils.kindOf(process) === 'process') { |
| 28120 |
// For node use HTTP adapter |
| 28121 |
adapter = lib_adapters.getAdapter('http'); |
| 28122 |
} |
| 28123 |
return adapter; |
| 28124 |
} |
| 28125 |
|
| 28126 |
/** |
| 28127 |
* It takes a string, tries to parse it, and if it fails, it returns the stringified version |
| 28128 |
* of the input |
| 28129 |
* |
| 28130 |
* @param {any} rawValue - The value to be stringified. |
| 28131 |
* @param {Function} parser - A function that parses a string into a JavaScript object. |
| 28132 |
* @param {Function} encoder - A function that takes a value and returns a string. |
| 28133 |
* |
| 28134 |
* @returns {string} A stringified version of the rawValue. |
| 28135 |
*/ |
| 28136 |
function stringifySafely(rawValue, parser, encoder) { |
| 28137 |
if (utils.isString(rawValue)) { |
| 28138 |
try { |
| 28139 |
(parser || JSON.parse)(rawValue); |
| 28140 |
return utils.trim(rawValue); |
| 28141 |
} catch (e) { |
| 28142 |
if (e.name !== 'SyntaxError') { |
| 28143 |
throw e; |
| 28144 |
} |
| 28145 |
} |
| 28146 |
} |
| 28147 |
|
| 28148 |
return (encoder || JSON.stringify)(rawValue); |
| 28149 |
} |
| 28150 |
|
| 28151 |
const defaults = { |
| 28152 |
|
| 28153 |
transitional: defaults_transitional, |
| 28154 |
|
| 28155 |
adapter: getDefaultAdapter(), |
| 28156 |
|
| 28157 |
transformRequest: [function transformRequest(data, headers) { |
| 28158 |
const contentType = headers.getContentType() || ''; |
| 28159 |
const hasJSONContentType = contentType.indexOf('application/json') > -1; |
| 28160 |
const isObjectPayload = utils.isObject(data); |
| 28161 |
|
| 28162 |
if (isObjectPayload && utils.isHTMLForm(data)) { |
| 28163 |
data = new FormData(data); |
| 28164 |
} |
| 28165 |
|
| 28166 |
const isFormData = utils.isFormData(data); |
| 28167 |
|
| 28168 |
if (isFormData) { |
| 28169 |
if (!hasJSONContentType) { |
| 28170 |
return data; |
| 28171 |
} |
| 28172 |
return hasJSONContentType ? JSON.stringify(helpers_formDataToJSON(data)) : data; |
| 28173 |
} |
| 28174 |
|
| 28175 |
if (utils.isArrayBuffer(data) || |
| 28176 |
utils.isBuffer(data) || |
| 28177 |
utils.isStream(data) || |
| 28178 |
utils.isFile(data) || |
| 28179 |
utils.isBlob(data) |
| 28180 |
) { |
| 28181 |
return data; |
| 28182 |
} |
| 28183 |
if (utils.isArrayBufferView(data)) { |
| 28184 |
return data.buffer; |
| 28185 |
} |
| 28186 |
if (utils.isURLSearchParams(data)) { |
| 28187 |
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); |
| 28188 |
return data.toString(); |
| 28189 |
} |
| 28190 |
|
| 28191 |
let isFileList; |
| 28192 |
|
| 28193 |
if (isObjectPayload) { |
| 28194 |
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { |
| 28195 |
return toURLEncodedForm(data, this.formSerializer).toString(); |
| 28196 |
} |
| 28197 |
|
| 28198 |
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { |
| 28199 |
const _FormData = this.env && this.env.FormData; |
| 28200 |
|
| 28201 |
return helpers_toFormData( |
| 28202 |
isFileList ? {'files[]': data} : data, |
| 28203 |
_FormData && new _FormData(), |
| 28204 |
this.formSerializer |
| 28205 |
); |
| 28206 |
} |
| 28207 |
} |
| 28208 |
|
| 28209 |
if (isObjectPayload || hasJSONContentType ) { |
| 28210 |
headers.setContentType('application/json', false); |
| 28211 |
return stringifySafely(data); |
| 28212 |
} |
| 28213 |
|
| 28214 |
return data; |
| 28215 |
}], |
| 28216 |
|
| 28217 |
transformResponse: [function transformResponse(data) { |
| 28218 |
const transitional = this.transitional || defaults.transitional; |
| 28219 |
const forcedJSONParsing = transitional && transitional.forcedJSONParsing; |
| 28220 |
const JSONRequested = this.responseType === 'json'; |
| 28221 |
|
| 28222 |
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { |
| 28223 |
const silentJSONParsing = transitional && transitional.silentJSONParsing; |
| 28224 |
const strictJSONParsing = !silentJSONParsing && JSONRequested; |
| 28225 |
|
| 28226 |
try { |
| 28227 |
return JSON.parse(data); |
| 28228 |
} catch (e) { |
| 28229 |
if (strictJSONParsing) { |
| 28230 |
if (e.name === 'SyntaxError') { |
| 28231 |
throw core_AxiosError.from(e, core_AxiosError.ERR_BAD_RESPONSE, this, null, this.response); |
| 28232 |
} |
| 28233 |
throw e; |
| 28234 |
} |
| 28235 |
} |
| 28236 |
} |
| 28237 |
|
| 28238 |
return data; |
| 28239 |
}], |
| 28240 |
|
| 28241 |
/** |
| 28242 |
* A timeout in milliseconds to abort a request. If set to 0 (default) a |
| 28243 |
* timeout is not created. |
| 28244 |
*/ |
| 28245 |
timeout: 0, |
| 28246 |
|
| 28247 |
xsrfCookieName: 'XSRF-TOKEN', |
| 28248 |
xsrfHeaderName: 'X-XSRF-TOKEN', |
| 28249 |
|
| 28250 |
maxContentLength: -1, |
| 28251 |
maxBodyLength: -1, |
| 28252 |
|
| 28253 |
env: { |
| 28254 |
FormData: platform_browser.classes.FormData, |
| 28255 |
Blob: platform_browser.classes.Blob |
| 28256 |
}, |
| 28257 |
|
| 28258 |
validateStatus: function validateStatus(status) { |
| 28259 |
return status >= 200 && status < 300; |
| 28260 |
}, |
| 28261 |
|
| 28262 |
headers: { |
| 28263 |
common: { |
| 28264 |
'Accept': 'application/json, text/plain, */*' |
| 28265 |
} |
| 28266 |
} |
| 28267 |
}; |
| 28268 |
|
| 28269 |
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { |
| 28270 |
defaults.headers[method] = {}; |
| 28271 |
}); |
| 28272 |
|
| 28273 |
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { |
| 28274 |
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); |
| 28275 |
}); |
| 28276 |
|
| 28277 |
/* harmony default export */ const lib_defaults = (defaults); |
| 28278 |
|
| 28279 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/core/transformData.js |
| 28280 |
|
| 28281 |
|
| 28282 |
|
| 28283 |
|
| 28284 |
|
| 28285 |
|
| 28286 |
/** |
| 28287 |
* Transform the data for a request or a response |
| 28288 |
* |
| 28289 |
* @param {Array|Function} fns A single function or Array of functions |
| 28290 |
* @param {?Object} response The response object |
| 28291 |
* |
| 28292 |
* @returns {*} The resulting transformed data |
| 28293 |
*/ |
| 28294 |
function transformData(fns, response) { |
| 28295 |
const config = this || lib_defaults; |
| 28296 |
const context = response || config; |
| 28297 |
const headers = core_AxiosHeaders.from(context.headers); |
| 28298 |
let data = context.data; |
| 28299 |
|
| 28300 |
utils.forEach(fns, function transform(fn) { |
| 28301 |
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); |
| 28302 |
}); |
| 28303 |
|
| 28304 |
headers.normalize(); |
| 28305 |
|
| 28306 |
return data; |
| 28307 |
} |
| 28308 |
|
| 28309 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/cancel/isCancel.js |
| 28310 |
|
| 28311 |
|
| 28312 |
function isCancel(value) { |
| 28313 |
return !!(value && value.__CANCEL__); |
| 28314 |
} |
| 28315 |
|
| 28316 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/core/dispatchRequest.js |
| 28317 |
|
| 28318 |
|
| 28319 |
|
| 28320 |
|
| 28321 |
|
| 28322 |
|
| 28323 |
|
| 28324 |
|
| 28325 |
/** |
| 28326 |
* Throws a `CanceledError` if cancellation has been requested. |
| 28327 |
* |
| 28328 |
* @param {Object} config The config that is to be used for the request |
| 28329 |
* |
| 28330 |
* @returns {void} |
| 28331 |
*/ |
| 28332 |
function throwIfCancellationRequested(config) { |
| 28333 |
if (config.cancelToken) { |
| 28334 |
config.cancelToken.throwIfRequested(); |
| 28335 |
} |
| 28336 |
|
| 28337 |
if (config.signal && config.signal.aborted) { |
| 28338 |
throw new cancel_CanceledError(); |
| 28339 |
} |
| 28340 |
} |
| 28341 |
|
| 28342 |
/** |
| 28343 |
* Dispatch a request to the server using the configured adapter. |
| 28344 |
* |
| 28345 |
* @param {object} config The config that is to be used for the request |
| 28346 |
* |
| 28347 |
* @returns {Promise} The Promise to be fulfilled |
| 28348 |
*/ |
| 28349 |
function dispatchRequest(config) { |
| 28350 |
throwIfCancellationRequested(config); |
| 28351 |
|
| 28352 |
config.headers = core_AxiosHeaders.from(config.headers); |
| 28353 |
|
| 28354 |
// Transform request data |
| 28355 |
config.data = transformData.call( |
| 28356 |
config, |
| 28357 |
config.transformRequest |
| 28358 |
); |
| 28359 |
|
| 28360 |
const adapter = config.adapter || lib_defaults.adapter; |
| 28361 |
|
| 28362 |
return adapter(config).then(function onAdapterResolution(response) { |
| 28363 |
throwIfCancellationRequested(config); |
| 28364 |
|
| 28365 |
// Transform response data |
| 28366 |
response.data = transformData.call( |
| 28367 |
config, |
| 28368 |
config.transformResponse, |
| 28369 |
response |
| 28370 |
); |
| 28371 |
|
| 28372 |
response.headers = core_AxiosHeaders.from(response.headers); |
| 28373 |
|
| 28374 |
return response; |
| 28375 |
}, function onAdapterRejection(reason) { |
| 28376 |
if (!isCancel(reason)) { |
| 28377 |
throwIfCancellationRequested(config); |
| 28378 |
|
| 28379 |
// Transform response data |
| 28380 |
if (reason && reason.response) { |
| 28381 |
reason.response.data = transformData.call( |
| 28382 |
config, |
| 28383 |
config.transformResponse, |
| 28384 |
reason.response |
| 28385 |
); |
| 28386 |
reason.response.headers = core_AxiosHeaders.from(reason.response.headers); |
| 28387 |
} |
| 28388 |
} |
| 28389 |
|
| 28390 |
return Promise.reject(reason); |
| 28391 |
}); |
| 28392 |
} |
| 28393 |
|
| 28394 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/core/mergeConfig.js |
| 28395 |
|
| 28396 |
|
| 28397 |
|
| 28398 |
|
| 28399 |
/** |
| 28400 |
* Config-specific merge-function which creates a new config-object |
| 28401 |
* by merging two configuration objects together. |
| 28402 |
* |
| 28403 |
* @param {Object} config1 |
| 28404 |
* @param {Object} config2 |
| 28405 |
* |
| 28406 |
* @returns {Object} New object resulting from merging config2 to config1 |
| 28407 |
*/ |
| 28408 |
function mergeConfig(config1, config2) { |
| 28409 |
// eslint-disable-next-line no-param-reassign |
| 28410 |
config2 = config2 || {}; |
| 28411 |
const config = {}; |
| 28412 |
|
| 28413 |
function getMergedValue(target, source) { |
| 28414 |
if (utils.isPlainObject(target) && utils.isPlainObject(source)) { |
| 28415 |
return utils.merge(target, source); |
| 28416 |
} else if (utils.isPlainObject(source)) { |
| 28417 |
return utils.merge({}, source); |
| 28418 |
} else if (utils.isArray(source)) { |
| 28419 |
return source.slice(); |
| 28420 |
} |
| 28421 |
return source; |
| 28422 |
} |
| 28423 |
|
| 28424 |
// eslint-disable-next-line consistent-return |
| 28425 |
function mergeDeepProperties(prop) { |
| 28426 |
if (!utils.isUndefined(config2[prop])) { |
| 28427 |
return getMergedValue(config1[prop], config2[prop]); |
| 28428 |
} else if (!utils.isUndefined(config1[prop])) { |
| 28429 |
return getMergedValue(undefined, config1[prop]); |
| 28430 |
} |
| 28431 |
} |
| 28432 |
|
| 28433 |
// eslint-disable-next-line consistent-return |
| 28434 |
function valueFromConfig2(prop) { |
| 28435 |
if (!utils.isUndefined(config2[prop])) { |
| 28436 |
return getMergedValue(undefined, config2[prop]); |
| 28437 |
} |
| 28438 |
} |
| 28439 |
|
| 28440 |
// eslint-disable-next-line consistent-return |
| 28441 |
function defaultToConfig2(prop) { |
| 28442 |
if (!utils.isUndefined(config2[prop])) { |
| 28443 |
return getMergedValue(undefined, config2[prop]); |
| 28444 |
} else if (!utils.isUndefined(config1[prop])) { |
| 28445 |
return getMergedValue(undefined, config1[prop]); |
| 28446 |
} |
| 28447 |
} |
| 28448 |
|
| 28449 |
// eslint-disable-next-line consistent-return |
| 28450 |
function mergeDirectKeys(prop) { |
| 28451 |
if (prop in config2) { |
| 28452 |
return getMergedValue(config1[prop], config2[prop]); |
| 28453 |
} else if (prop in config1) { |
| 28454 |
return getMergedValue(undefined, config1[prop]); |
| 28455 |
} |
| 28456 |
} |
| 28457 |
|
| 28458 |
const mergeMap = { |
| 28459 |
'url': valueFromConfig2, |
| 28460 |
'method': valueFromConfig2, |
| 28461 |
'data': valueFromConfig2, |
| 28462 |
'baseURL': defaultToConfig2, |
| 28463 |
'transformRequest': defaultToConfig2, |
| 28464 |
'transformResponse': defaultToConfig2, |
| 28465 |
'paramsSerializer': defaultToConfig2, |
| 28466 |
'timeout': defaultToConfig2, |
| 28467 |
'timeoutMessage': defaultToConfig2, |
| 28468 |
'withCredentials': defaultToConfig2, |
| 28469 |
'adapter': defaultToConfig2, |
| 28470 |
'responseType': defaultToConfig2, |
| 28471 |
'xsrfCookieName': defaultToConfig2, |
| 28472 |
'xsrfHeaderName': defaultToConfig2, |
| 28473 |
'onUploadProgress': defaultToConfig2, |
| 28474 |
'onDownloadProgress': defaultToConfig2, |
| 28475 |
'decompress': defaultToConfig2, |
| 28476 |
'maxContentLength': defaultToConfig2, |
| 28477 |
'maxBodyLength': defaultToConfig2, |
| 28478 |
'beforeRedirect': defaultToConfig2, |
| 28479 |
'transport': defaultToConfig2, |
| 28480 |
'httpAgent': defaultToConfig2, |
| 28481 |
'httpsAgent': defaultToConfig2, |
| 28482 |
'cancelToken': defaultToConfig2, |
| 28483 |
'socketPath': defaultToConfig2, |
| 28484 |
'responseEncoding': defaultToConfig2, |
| 28485 |
'validateStatus': mergeDirectKeys |
| 28486 |
}; |
| 28487 |
|
| 28488 |
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { |
| 28489 |
const merge = mergeMap[prop] || mergeDeepProperties; |
| 28490 |
const configValue = merge(prop); |
| 28491 |
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); |
| 28492 |
}); |
| 28493 |
|
| 28494 |
return config; |
| 28495 |
} |
| 28496 |
|
| 28497 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/env/data.js |
| 28498 |
const VERSION = "1.1.3"; |
| 28499 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/validator.js |
| 28500 |
|
| 28501 |
|
| 28502 |
|
| 28503 |
|
| 28504 |
|
| 28505 |
const validators = {}; |
| 28506 |
|
| 28507 |
// eslint-disable-next-line func-names |
| 28508 |
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { |
| 28509 |
validators[type] = function validator(thing) { |
| 28510 |
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; |
| 28511 |
}; |
| 28512 |
}); |
| 28513 |
|
| 28514 |
const deprecatedWarnings = {}; |
| 28515 |
|
| 28516 |
/** |
| 28517 |
* Transitional option validator |
| 28518 |
* |
| 28519 |
* @param {function|boolean?} validator - set to false if the transitional option has been removed |
| 28520 |
* @param {string?} version - deprecated version / removed since version |
| 28521 |
* @param {string?} message - some message with additional info |
| 28522 |
* |
| 28523 |
* @returns {function} |
| 28524 |
*/ |
| 28525 |
validators.transitional = function transitional(validator, version, message) { |
| 28526 |
function formatMessage(opt, desc) { |
| 28527 |
return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); |
| 28528 |
} |
| 28529 |
|
| 28530 |
// eslint-disable-next-line func-names |
| 28531 |
return (value, opt, opts) => { |
| 28532 |
if (validator === false) { |
| 28533 |
throw new core_AxiosError( |
| 28534 |
formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), |
| 28535 |
core_AxiosError.ERR_DEPRECATED |
| 28536 |
); |
| 28537 |
} |
| 28538 |
|
| 28539 |
if (version && !deprecatedWarnings[opt]) { |
| 28540 |
deprecatedWarnings[opt] = true; |
| 28541 |
// eslint-disable-next-line no-console |
| 28542 |
console.warn( |
| 28543 |
formatMessage( |
| 28544 |
opt, |
| 28545 |
' has been deprecated since v' + version + ' and will be removed in the near future' |
| 28546 |
) |
| 28547 |
); |
| 28548 |
} |
| 28549 |
|
| 28550 |
return validator ? validator(value, opt, opts) : true; |
| 28551 |
}; |
| 28552 |
}; |
| 28553 |
|
| 28554 |
/** |
| 28555 |
* Assert object's properties type |
| 28556 |
* |
| 28557 |
* @param {object} options |
| 28558 |
* @param {object} schema |
| 28559 |
* @param {boolean?} allowUnknown |
| 28560 |
* |
| 28561 |
* @returns {object} |
| 28562 |
*/ |
| 28563 |
|
| 28564 |
function assertOptions(options, schema, allowUnknown) { |
| 28565 |
if (typeof options !== 'object') { |
| 28566 |
throw new core_AxiosError('options must be an object', core_AxiosError.ERR_BAD_OPTION_VALUE); |
| 28567 |
} |
| 28568 |
const keys = Object.keys(options); |
| 28569 |
let i = keys.length; |
| 28570 |
while (i-- > 0) { |
| 28571 |
const opt = keys[i]; |
| 28572 |
const validator = schema[opt]; |
| 28573 |
if (validator) { |
| 28574 |
const value = options[opt]; |
| 28575 |
const result = value === undefined || validator(value, opt, options); |
| 28576 |
if (result !== true) { |
| 28577 |
throw new core_AxiosError('option ' + opt + ' must be ' + result, core_AxiosError.ERR_BAD_OPTION_VALUE); |
| 28578 |
} |
| 28579 |
continue; |
| 28580 |
} |
| 28581 |
if (allowUnknown !== true) { |
| 28582 |
throw new core_AxiosError('Unknown option ' + opt, core_AxiosError.ERR_BAD_OPTION); |
| 28583 |
} |
| 28584 |
} |
| 28585 |
} |
| 28586 |
|
| 28587 |
/* harmony default export */ const validator = ({ |
| 28588 |
assertOptions, |
| 28589 |
validators |
| 28590 |
}); |
| 28591 |
|
| 28592 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/core/Axios.js |
| 28593 |
|
| 28594 |
|
| 28595 |
|
| 28596 |
|
| 28597 |
|
| 28598 |
|
| 28599 |
|
| 28600 |
|
| 28601 |
|
| 28602 |
|
| 28603 |
|
| 28604 |
const Axios_validators = validator.validators; |
| 28605 |
|
| 28606 |
/** |
| 28607 |
* Create a new instance of Axios |
| 28608 |
* |
| 28609 |
* @param {Object} instanceConfig The default config for the instance |
| 28610 |
* |
| 28611 |
* @return {Axios} A new instance of Axios |
| 28612 |
*/ |
| 28613 |
class Axios { |
| 28614 |
constructor(instanceConfig) { |
| 28615 |
this.defaults = instanceConfig; |
| 28616 |
this.interceptors = { |
| 28617 |
request: new core_InterceptorManager(), |
| 28618 |
response: new core_InterceptorManager() |
| 28619 |
}; |
| 28620 |
} |
| 28621 |
|
| 28622 |
/** |
| 28623 |
* Dispatch a request |
| 28624 |
* |
| 28625 |
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) |
| 28626 |
* @param {?Object} config |
| 28627 |
* |
| 28628 |
* @returns {Promise} The Promise to be fulfilled |
| 28629 |
*/ |
| 28630 |
request(configOrUrl, config) { |
| 28631 |
/*eslint no-param-reassign:0*/ |
| 28632 |
// Allow for axios('example/url'[, config]) a la fetch API |
| 28633 |
if (typeof configOrUrl === 'string') { |
| 28634 |
config = config || {}; |
| 28635 |
config.url = configOrUrl; |
| 28636 |
} else { |
| 28637 |
config = configOrUrl || {}; |
| 28638 |
} |
| 28639 |
|
| 28640 |
config = mergeConfig(this.defaults, config); |
| 28641 |
|
| 28642 |
const {transitional, paramsSerializer} = config; |
| 28643 |
|
| 28644 |
if (transitional !== undefined) { |
| 28645 |
validator.assertOptions(transitional, { |
| 28646 |
silentJSONParsing: Axios_validators.transitional(Axios_validators.boolean), |
| 28647 |
forcedJSONParsing: Axios_validators.transitional(Axios_validators.boolean), |
| 28648 |
clarifyTimeoutError: Axios_validators.transitional(Axios_validators.boolean) |
| 28649 |
}, false); |
| 28650 |
} |
| 28651 |
|
| 28652 |
if (paramsSerializer !== undefined) { |
| 28653 |
validator.assertOptions(paramsSerializer, { |
| 28654 |
encode: Axios_validators.function, |
| 28655 |
serialize: Axios_validators.function |
| 28656 |
}, true); |
| 28657 |
} |
| 28658 |
|
| 28659 |
// Set config.method |
| 28660 |
config.method = (config.method || this.defaults.method || 'get').toLowerCase(); |
| 28661 |
|
| 28662 |
// Flatten headers |
| 28663 |
const defaultHeaders = config.headers && utils.merge( |
| 28664 |
config.headers.common, |
| 28665 |
config.headers[config.method] |
| 28666 |
); |
| 28667 |
|
| 28668 |
defaultHeaders && utils.forEach( |
| 28669 |
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], |
| 28670 |
function cleanHeaderConfig(method) { |
| 28671 |
delete config.headers[method]; |
| 28672 |
} |
| 28673 |
); |
| 28674 |
|
| 28675 |
config.headers = new core_AxiosHeaders(config.headers, defaultHeaders); |
| 28676 |
|
| 28677 |
// filter out skipped interceptors |
| 28678 |
const requestInterceptorChain = []; |
| 28679 |
let synchronousRequestInterceptors = true; |
| 28680 |
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { |
| 28681 |
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { |
| 28682 |
return; |
| 28683 |
} |
| 28684 |
|
| 28685 |
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; |
| 28686 |
|
| 28687 |
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); |
| 28688 |
}); |
| 28689 |
|
| 28690 |
const responseInterceptorChain = []; |
| 28691 |
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { |
| 28692 |
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); |
| 28693 |
}); |
| 28694 |
|
| 28695 |
let promise; |
| 28696 |
let i = 0; |
| 28697 |
let len; |
| 28698 |
|
| 28699 |
if (!synchronousRequestInterceptors) { |
| 28700 |
const chain = [dispatchRequest.bind(this), undefined]; |
| 28701 |
chain.unshift.apply(chain, requestInterceptorChain); |
| 28702 |
chain.push.apply(chain, responseInterceptorChain); |
| 28703 |
len = chain.length; |
| 28704 |
|
| 28705 |
promise = Promise.resolve(config); |
| 28706 |
|
| 28707 |
while (i < len) { |
| 28708 |
promise = promise.then(chain[i++], chain[i++]); |
| 28709 |
} |
| 28710 |
|
| 28711 |
return promise; |
| 28712 |
} |
| 28713 |
|
| 28714 |
len = requestInterceptorChain.length; |
| 28715 |
|
| 28716 |
let newConfig = config; |
| 28717 |
|
| 28718 |
i = 0; |
| 28719 |
|
| 28720 |
while (i < len) { |
| 28721 |
const onFulfilled = requestInterceptorChain[i++]; |
| 28722 |
const onRejected = requestInterceptorChain[i++]; |
| 28723 |
try { |
| 28724 |
newConfig = onFulfilled(newConfig); |
| 28725 |
} catch (error) { |
| 28726 |
onRejected.call(this, error); |
| 28727 |
break; |
| 28728 |
} |
| 28729 |
} |
| 28730 |
|
| 28731 |
try { |
| 28732 |
promise = dispatchRequest.call(this, newConfig); |
| 28733 |
} catch (error) { |
| 28734 |
return Promise.reject(error); |
| 28735 |
} |
| 28736 |
|
| 28737 |
i = 0; |
| 28738 |
len = responseInterceptorChain.length; |
| 28739 |
|
| 28740 |
while (i < len) { |
| 28741 |
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); |
| 28742 |
} |
| 28743 |
|
| 28744 |
return promise; |
| 28745 |
} |
| 28746 |
|
| 28747 |
getUri(config) { |
| 28748 |
config = mergeConfig(this.defaults, config); |
| 28749 |
const fullPath = buildFullPath(config.baseURL, config.url); |
| 28750 |
return buildURL(fullPath, config.params, config.paramsSerializer); |
| 28751 |
} |
| 28752 |
} |
| 28753 |
|
| 28754 |
// Provide aliases for supported request methods |
| 28755 |
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { |
| 28756 |
/*eslint func-names:0*/ |
| 28757 |
Axios.prototype[method] = function(url, config) { |
| 28758 |
return this.request(mergeConfig(config || {}, { |
| 28759 |
method, |
| 28760 |
url, |
| 28761 |
data: (config || {}).data |
| 28762 |
})); |
| 28763 |
}; |
| 28764 |
}); |
| 28765 |
|
| 28766 |
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { |
| 28767 |
/*eslint func-names:0*/ |
| 28768 |
|
| 28769 |
function generateHTTPMethod(isForm) { |
| 28770 |
return function httpMethod(url, data, config) { |
| 28771 |
return this.request(mergeConfig(config || {}, { |
| 28772 |
method, |
| 28773 |
headers: isForm ? { |
| 28774 |
'Content-Type': 'multipart/form-data' |
| 28775 |
} : {}, |
| 28776 |
url, |
| 28777 |
data |
| 28778 |
})); |
| 28779 |
}; |
| 28780 |
} |
| 28781 |
|
| 28782 |
Axios.prototype[method] = generateHTTPMethod(); |
| 28783 |
|
| 28784 |
Axios.prototype[method + 'Form'] = generateHTTPMethod(true); |
| 28785 |
}); |
| 28786 |
|
| 28787 |
/* harmony default export */ const core_Axios = (Axios); |
| 28788 |
|
| 28789 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/cancel/CancelToken.js |
| 28790 |
|
| 28791 |
|
| 28792 |
|
| 28793 |
|
| 28794 |
/** |
| 28795 |
* A `CancelToken` is an object that can be used to request cancellation of an operation. |
| 28796 |
* |
| 28797 |
* @param {Function} executor The executor function. |
| 28798 |
* |
| 28799 |
* @returns {CancelToken} |
| 28800 |
*/ |
| 28801 |
class CancelToken { |
| 28802 |
constructor(executor) { |
| 28803 |
if (typeof executor !== 'function') { |
| 28804 |
throw new TypeError('executor must be a function.'); |
| 28805 |
} |
| 28806 |
|
| 28807 |
let resolvePromise; |
| 28808 |
|
| 28809 |
this.promise = new Promise(function promiseExecutor(resolve) { |
| 28810 |
resolvePromise = resolve; |
| 28811 |
}); |
| 28812 |
|
| 28813 |
const token = this; |
| 28814 |
|
| 28815 |
// eslint-disable-next-line func-names |
| 28816 |
this.promise.then(cancel => { |
| 28817 |
if (!token._listeners) return; |
| 28818 |
|
| 28819 |
let i = token._listeners.length; |
| 28820 |
|
| 28821 |
while (i-- > 0) { |
| 28822 |
token._listeners[i](cancel); |
| 28823 |
} |
| 28824 |
token._listeners = null; |
| 28825 |
}); |
| 28826 |
|
| 28827 |
// eslint-disable-next-line func-names |
| 28828 |
this.promise.then = onfulfilled => { |
| 28829 |
let _resolve; |
| 28830 |
// eslint-disable-next-line func-names |
| 28831 |
const promise = new Promise(resolve => { |
| 28832 |
token.subscribe(resolve); |
| 28833 |
_resolve = resolve; |
| 28834 |
}).then(onfulfilled); |
| 28835 |
|
| 28836 |
promise.cancel = function reject() { |
| 28837 |
token.unsubscribe(_resolve); |
| 28838 |
}; |
| 28839 |
|
| 28840 |
return promise; |
| 28841 |
}; |
| 28842 |
|
| 28843 |
executor(function cancel(message, config, request) { |
| 28844 |
if (token.reason) { |
| 28845 |
// Cancellation has already been requested |
| 28846 |
return; |
| 28847 |
} |
| 28848 |
|
| 28849 |
token.reason = new cancel_CanceledError(message, config, request); |
| 28850 |
resolvePromise(token.reason); |
| 28851 |
}); |
| 28852 |
} |
| 28853 |
|
| 28854 |
/** |
| 28855 |
* Throws a `CanceledError` if cancellation has been requested. |
| 28856 |
*/ |
| 28857 |
throwIfRequested() { |
| 28858 |
if (this.reason) { |
| 28859 |
throw this.reason; |
| 28860 |
} |
| 28861 |
} |
| 28862 |
|
| 28863 |
/** |
| 28864 |
* Subscribe to the cancel signal |
| 28865 |
*/ |
| 28866 |
|
| 28867 |
subscribe(listener) { |
| 28868 |
if (this.reason) { |
| 28869 |
listener(this.reason); |
| 28870 |
return; |
| 28871 |
} |
| 28872 |
|
| 28873 |
if (this._listeners) { |
| 28874 |
this._listeners.push(listener); |
| 28875 |
} else { |
| 28876 |
this._listeners = [listener]; |
| 28877 |
} |
| 28878 |
} |
| 28879 |
|
| 28880 |
/** |
| 28881 |
* Unsubscribe from the cancel signal |
| 28882 |
*/ |
| 28883 |
|
| 28884 |
unsubscribe(listener) { |
| 28885 |
if (!this._listeners) { |
| 28886 |
return; |
| 28887 |
} |
| 28888 |
const index = this._listeners.indexOf(listener); |
| 28889 |
if (index !== -1) { |
| 28890 |
this._listeners.splice(index, 1); |
| 28891 |
} |
| 28892 |
} |
| 28893 |
|
| 28894 |
/** |
| 28895 |
* Returns an object that contains a new `CancelToken` and a function that, when called, |
| 28896 |
* cancels the `CancelToken`. |
| 28897 |
*/ |
| 28898 |
static source() { |
| 28899 |
let cancel; |
| 28900 |
const token = new CancelToken(function executor(c) { |
| 28901 |
cancel = c; |
| 28902 |
}); |
| 28903 |
return { |
| 28904 |
token, |
| 28905 |
cancel |
| 28906 |
}; |
| 28907 |
} |
| 28908 |
} |
| 28909 |
|
| 28910 |
/* harmony default export */ const cancel_CancelToken = (CancelToken); |
| 28911 |
|
| 28912 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/spread.js |
| 28913 |
|
| 28914 |
|
| 28915 |
/** |
| 28916 |
* Syntactic sugar for invoking a function and expanding an array for arguments. |
| 28917 |
* |
| 28918 |
* Common use case would be to use `Function.prototype.apply`. |
| 28919 |
* |
| 28920 |
* ```js |
| 28921 |
* function f(x, y, z) {} |
| 28922 |
* var args = [1, 2, 3]; |
| 28923 |
* f.apply(null, args); |
| 28924 |
* ``` |
| 28925 |
* |
| 28926 |
* With `spread` this example can be re-written. |
| 28927 |
* |
| 28928 |
* ```js |
| 28929 |
* spread(function(x, y, z) {})([1, 2, 3]); |
| 28930 |
* ``` |
| 28931 |
* |
| 28932 |
* @param {Function} callback |
| 28933 |
* |
| 28934 |
* @returns {Function} |
| 28935 |
*/ |
| 28936 |
function spread(callback) { |
| 28937 |
return function wrap(arr) { |
| 28938 |
return callback.apply(null, arr); |
| 28939 |
}; |
| 28940 |
} |
| 28941 |
|
| 28942 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/isAxiosError.js |
| 28943 |
|
| 28944 |
|
| 28945 |
|
| 28946 |
|
| 28947 |
/** |
| 28948 |
* Determines whether the payload is an error thrown by Axios |
| 28949 |
* |
| 28950 |
* @param {*} payload The value to test |
| 28951 |
* |
| 28952 |
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false |
| 28953 |
*/ |
| 28954 |
function isAxiosError(payload) { |
| 28955 |
return utils.isObject(payload) && (payload.isAxiosError === true); |
| 28956 |
} |
| 28957 |
|
| 28958 |
;// CONCATENATED MODULE: ./node_modules/axios/lib/axios.js |
| 28959 |
|
| 28960 |
|
| 28961 |
|
| 28962 |
|
| 28963 |
|
| 28964 |
|
| 28965 |
|
| 28966 |
|
| 28967 |
|
| 28968 |
|
| 28969 |
|
| 28970 |
|
| 28971 |
|
| 28972 |
|
| 28973 |
|
| 28974 |
|
| 28975 |
|
| 28976 |
/** |
| 28977 |
* Create an instance of Axios |
| 28978 |
* |
| 28979 |
* @param {Object} defaultConfig The default config for the instance |
| 28980 |
* |
| 28981 |
* @returns {Axios} A new instance of Axios |
| 28982 |
*/ |
| 28983 |
function createInstance(defaultConfig) { |
| 28984 |
const context = new core_Axios(defaultConfig); |
| 28985 |
const instance = bind(core_Axios.prototype.request, context); |
| 28986 |
|
| 28987 |
// Copy axios.prototype to instance |
| 28988 |
utils.extend(instance, core_Axios.prototype, context, {allOwnKeys: true}); |
| 28989 |
|
| 28990 |
// Copy context to instance |
| 28991 |
utils.extend(instance, context, null, {allOwnKeys: true}); |
| 28992 |
|
| 28993 |
// Factory for creating new instances |
| 28994 |
instance.create = function create(instanceConfig) { |
| 28995 |
return createInstance(mergeConfig(defaultConfig, instanceConfig)); |
| 28996 |
}; |
| 28997 |
|
| 28998 |
return instance; |
| 28999 |
} |
| 29000 |
|
| 29001 |
// Create the default instance to be exported |
| 29002 |
const axios = createInstance(lib_defaults); |
| 29003 |
|
| 29004 |
// Expose Axios class to allow class inheritance |
| 29005 |
axios.Axios = core_Axios; |
| 29006 |
|
| 29007 |
// Expose Cancel & CancelToken |
| 29008 |
axios.CanceledError = cancel_CanceledError; |
| 29009 |
axios.CancelToken = cancel_CancelToken; |
| 29010 |
axios.isCancel = isCancel; |
| 29011 |
axios.VERSION = VERSION; |
| 29012 |
axios.toFormData = helpers_toFormData; |
| 29013 |
|
| 29014 |
// Expose AxiosError class |
| 29015 |
axios.AxiosError = core_AxiosError; |
| 29016 |
|
| 29017 |
// alias for CanceledError for backward compatibility |
| 29018 |
axios.Cancel = axios.CanceledError; |
| 29019 |
|
| 29020 |
// Expose all/spread |
| 29021 |
axios.all = function all(promises) { |
| 29022 |
return Promise.all(promises); |
| 29023 |
}; |
| 29024 |
|
| 29025 |
axios.spread = spread; |
| 29026 |
|
| 29027 |
// Expose isAxiosError |
| 29028 |
axios.isAxiosError = isAxiosError; |
| 29029 |
|
| 29030 |
axios.formToJSON = thing => { |
| 29031 |
return helpers_formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); |
| 29032 |
}; |
| 29033 |
|
| 29034 |
/* harmony default export */ const lib_axios = (axios); |
| 29035 |
|
| 29036 |
;// CONCATENATED MODULE: ./node_modules/axios/index.js |
| 29037 |
|
| 29038 |
|
| 29039 |
// Keep top-level export same with static properties |
| 29040 |
// so that it can keep same with es module or cjs |
| 29041 |
const { |
| 29042 |
Axios: axios_Axios, |
| 29043 |
AxiosError: axios_AxiosError, |
| 29044 |
CanceledError: axios_CanceledError, |
| 29045 |
isCancel: axios_isCancel, |
| 29046 |
CancelToken: axios_CancelToken, |
| 29047 |
VERSION: axios_VERSION, |
| 29048 |
all: axios_all, |
| 29049 |
Cancel, |
| 29050 |
isAxiosError: axios_isAxiosError, |
| 29051 |
spread: axios_spread, |
| 29052 |
toFormData: axios_toFormData |
| 29053 |
} = lib_axios; |
| 29054 |
|
| 29055 |
/* harmony default export */ const node_modules_axios = (lib_axios); |
| 29056 |
|
| 29057 |
|
| 29058 |
|
| 29059 |
/***/ }) |
| 29060 |
|
| 29061 |
/******/ }); |
| 29062 |
/************************************************************************/ |
| 29063 |
/******/ // The module cache |
| 29064 |
/******/ var __webpack_module_cache__ = {}; |
| 29065 |
/******/ |
| 29066 |
/******/ // The require function |
| 29067 |
/******/ function __webpack_require__(moduleId) { |
| 29068 |
/******/ // Check if module is in cache |
| 29069 |
/******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 29070 |
/******/ if (cachedModule !== undefined) { |
| 29071 |
/******/ return cachedModule.exports; |
| 29072 |
/******/ } |
| 29073 |
/******/ // Create a new module (and put it into the cache) |
| 29074 |
/******/ var module = __webpack_module_cache__[moduleId] = { |
| 29075 |
/******/ id: moduleId, |
| 29076 |
/******/ loaded: false, |
| 29077 |
/******/ exports: {} |
| 29078 |
/******/ }; |
| 29079 |
/******/ |
| 29080 |
/******/ // Execute the module function |
| 29081 |
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
| 29082 |
/******/ |
| 29083 |
/******/ // Flag the module as loaded |
| 29084 |
/******/ module.loaded = true; |
| 29085 |
/******/ |
| 29086 |
/******/ // Return the exports of the module |
| 29087 |
/******/ return module.exports; |
| 29088 |
/******/ } |
| 29089 |
/******/ |
| 29090 |
/******/ // expose the modules object (__webpack_modules__) |
| 29091 |
/******/ __webpack_require__.m = __webpack_modules__; |
| 29092 |
/******/ |
| 29093 |
/************************************************************************/ |
| 29094 |
/******/ /* webpack/runtime/compat get default export */ |
| 29095 |
/******/ (() => { |
| 29096 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
| 29097 |
/******/ __webpack_require__.n = (module) => { |
| 29098 |
/******/ var getter = module && module.__esModule ? |
| 29099 |
/******/ () => (module['default']) : |
| 29100 |
/******/ () => (module); |
| 29101 |
/******/ __webpack_require__.d(getter, { a: getter }); |
| 29102 |
/******/ return getter; |
| 29103 |
/******/ }; |
| 29104 |
/******/ })(); |
| 29105 |
/******/ |
| 29106 |
/******/ /* webpack/runtime/define property getters */ |
| 29107 |
/******/ (() => { |
| 29108 |
/******/ // define getter functions for harmony exports |
| 29109 |
/******/ __webpack_require__.d = (exports, definition) => { |
| 29110 |
/******/ for(var key in definition) { |
| 29111 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 29112 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 29113 |
/******/ } |
| 29114 |
/******/ } |
| 29115 |
/******/ }; |
| 29116 |
/******/ })(); |
| 29117 |
/******/ |
| 29118 |
/******/ /* webpack/runtime/ensure chunk */ |
| 29119 |
/******/ (() => { |
| 29120 |
/******/ __webpack_require__.f = {}; |
| 29121 |
/******/ // This file contains only the entry chunk. |
| 29122 |
/******/ // The chunk loading function for additional chunks |
| 29123 |
/******/ __webpack_require__.e = (chunkId) => { |
| 29124 |
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { |
| 29125 |
/******/ __webpack_require__.f[key](chunkId, promises); |
| 29126 |
/******/ return promises; |
| 29127 |
/******/ }, [])); |
| 29128 |
/******/ }; |
| 29129 |
/******/ })(); |
| 29130 |
/******/ |
| 29131 |
/******/ /* webpack/runtime/get javascript chunk filename */ |
| 29132 |
/******/ (() => { |
| 29133 |
/******/ // This function allow to reference async chunks |
| 29134 |
/******/ __webpack_require__.u = (chunkId) => { |
| 29135 |
/******/ // return url for filenames based on template |
| 29136 |
/******/ return "chunk/" + chunkId + ".chunk.js"; |
| 29137 |
/******/ }; |
| 29138 |
/******/ })(); |
| 29139 |
/******/ |
| 29140 |
/******/ /* webpack/runtime/global */ |
| 29141 |
/******/ (() => { |
| 29142 |
/******/ __webpack_require__.g = (function() { |
| 29143 |
/******/ if (typeof globalThis === 'object') return globalThis; |
| 29144 |
/******/ try { |
| 29145 |
/******/ return this || new Function('return this')(); |
| 29146 |
/******/ } catch (e) { |
| 29147 |
/******/ if (typeof window === 'object') return window; |
| 29148 |
/******/ } |
| 29149 |
/******/ })(); |
| 29150 |
/******/ })(); |
| 29151 |
/******/ |
| 29152 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 29153 |
/******/ (() => { |
| 29154 |
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| 29155 |
/******/ })(); |
| 29156 |
/******/ |
| 29157 |
/******/ /* webpack/runtime/load script */ |
| 29158 |
/******/ (() => { |
| 29159 |
/******/ var inProgress = {}; |
| 29160 |
/******/ var dataWebpackPrefix = "timetics:"; |
| 29161 |
/******/ // loadScript function to load a script via script tag |
| 29162 |
/******/ __webpack_require__.l = (url, done, key, chunkId) => { |
| 29163 |
/******/ if(inProgress[url]) { inProgress[url].push(done); return; } |
| 29164 |
/******/ var script, needAttach; |
| 29165 |
/******/ if(key !== undefined) { |
| 29166 |
/******/ var scripts = document.getElementsByTagName("script"); |
| 29167 |
/******/ for(var i = 0; i < scripts.length; i++) { |
| 29168 |
/******/ var s = scripts[i]; |
| 29169 |
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } |
| 29170 |
/******/ } |
| 29171 |
/******/ } |
| 29172 |
/******/ if(!script) { |
| 29173 |
/******/ needAttach = true; |
| 29174 |
/******/ script = document.createElement('script'); |
| 29175 |
/******/ |
| 29176 |
/******/ script.charset = 'utf-8'; |
| 29177 |
/******/ script.timeout = 120; |
| 29178 |
/******/ if (__webpack_require__.nc) { |
| 29179 |
/******/ script.setAttribute("nonce", __webpack_require__.nc); |
| 29180 |
/******/ } |
| 29181 |
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key); |
| 29182 |
/******/ script.src = url; |
| 29183 |
/******/ } |
| 29184 |
/******/ inProgress[url] = [done]; |
| 29185 |
/******/ var onScriptComplete = (prev, event) => { |
| 29186 |
/******/ // avoid mem leaks in IE. |
| 29187 |
/******/ script.onerror = script.onload = null; |
| 29188 |
/******/ clearTimeout(timeout); |
| 29189 |
/******/ var doneFns = inProgress[url]; |
| 29190 |
/******/ delete inProgress[url]; |
| 29191 |
/******/ script.parentNode && script.parentNode.removeChild(script); |
| 29192 |
/******/ doneFns && doneFns.forEach((fn) => (fn(event))); |
| 29193 |
/******/ if(prev) return prev(event); |
| 29194 |
/******/ }; |
| 29195 |
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); |
| 29196 |
/******/ script.onerror = onScriptComplete.bind(null, script.onerror); |
| 29197 |
/******/ script.onload = onScriptComplete.bind(null, script.onload); |
| 29198 |
/******/ needAttach && document.head.appendChild(script); |
| 29199 |
/******/ }; |
| 29200 |
/******/ })(); |
| 29201 |
/******/ |
| 29202 |
/******/ /* webpack/runtime/make namespace object */ |
| 29203 |
/******/ (() => { |
| 29204 |
/******/ // define __esModule on exports |
| 29205 |
/******/ __webpack_require__.r = (exports) => { |
| 29206 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| 29207 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 29208 |
/******/ } |
| 29209 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 29210 |
/******/ }; |
| 29211 |
/******/ })(); |
| 29212 |
/******/ |
| 29213 |
/******/ /* webpack/runtime/node module decorator */ |
| 29214 |
/******/ (() => { |
| 29215 |
/******/ __webpack_require__.nmd = (module) => { |
| 29216 |
/******/ module.paths = []; |
| 29217 |
/******/ if (!module.children) module.children = []; |
| 29218 |
/******/ return module; |
| 29219 |
/******/ }; |
| 29220 |
/******/ })(); |
| 29221 |
/******/ |
| 29222 |
/******/ /* webpack/runtime/publicPath */ |
| 29223 |
/******/ (() => { |
| 29224 |
/******/ var scriptUrl; |
| 29225 |
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; |
| 29226 |
/******/ var document = __webpack_require__.g.document; |
| 29227 |
/******/ if (!scriptUrl && document) { |
| 29228 |
/******/ if (document.currentScript) |
| 29229 |
/******/ scriptUrl = document.currentScript.src |
| 29230 |
/******/ if (!scriptUrl) { |
| 29231 |
/******/ var scripts = document.getElementsByTagName("script"); |
| 29232 |
/******/ if(scripts.length) scriptUrl = scripts[scripts.length - 1].src |
| 29233 |
/******/ } |
| 29234 |
/******/ } |
| 29235 |
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration |
| 29236 |
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. |
| 29237 |
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); |
| 29238 |
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); |
| 29239 |
/******/ __webpack_require__.p = scriptUrl; |
| 29240 |
/******/ })(); |
| 29241 |
/******/ |
| 29242 |
/******/ /* webpack/runtime/jsonp chunk loading */ |
| 29243 |
/******/ (() => { |
| 29244 |
/******/ // no baseURI |
| 29245 |
/******/ |
| 29246 |
/******/ // object to store loaded and loading chunks |
| 29247 |
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| 29248 |
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| 29249 |
/******/ var installedChunks = { |
| 29250 |
/******/ 966: 0 |
| 29251 |
/******/ }; |
| 29252 |
/******/ |
| 29253 |
/******/ __webpack_require__.f.j = (chunkId, promises) => { |
| 29254 |
/******/ // JSONP chunk loading for javascript |
| 29255 |
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; |
| 29256 |
/******/ if(installedChunkData !== 0) { // 0 means "already installed". |
| 29257 |
/******/ |
| 29258 |
/******/ // a Promise means "currently loading". |
| 29259 |
/******/ if(installedChunkData) { |
| 29260 |
/******/ promises.push(installedChunkData[2]); |
| 29261 |
/******/ } else { |
| 29262 |
/******/ if(true) { // all chunks have JS |
| 29263 |
/******/ // setup Promise in chunk cache |
| 29264 |
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); |
| 29265 |
/******/ promises.push(installedChunkData[2] = promise); |
| 29266 |
/******/ |
| 29267 |
/******/ // start chunk loading |
| 29268 |
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); |
| 29269 |
/******/ // create error before stack unwound to get useful stacktrace later |
| 29270 |
/******/ var error = new Error(); |
| 29271 |
/******/ var loadingEnded = (event) => { |
| 29272 |
/******/ if(__webpack_require__.o(installedChunks, chunkId)) { |
| 29273 |
/******/ installedChunkData = installedChunks[chunkId]; |
| 29274 |
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; |
| 29275 |
/******/ if(installedChunkData) { |
| 29276 |
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); |
| 29277 |
/******/ var realSrc = event && event.target && event.target.src; |
| 29278 |
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; |
| 29279 |
/******/ error.name = 'ChunkLoadError'; |
| 29280 |
/******/ error.type = errorType; |
| 29281 |
/******/ error.request = realSrc; |
| 29282 |
/******/ installedChunkData[1](error); |
| 29283 |
/******/ } |
| 29284 |
/******/ } |
| 29285 |
/******/ }; |
| 29286 |
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); |
| 29287 |
/******/ } else installedChunks[chunkId] = 0; |
| 29288 |
/******/ } |
| 29289 |
/******/ } |
| 29290 |
/******/ }; |
| 29291 |
/******/ |
| 29292 |
/******/ // no prefetching |
| 29293 |
/******/ |
| 29294 |
/******/ // no preloaded |
| 29295 |
/******/ |
| 29296 |
/******/ // no HMR |
| 29297 |
/******/ |
| 29298 |
/******/ // no HMR manifest |
| 29299 |
/******/ |
| 29300 |
/******/ // no on chunks loaded |
| 29301 |
/******/ |
| 29302 |
/******/ // install a JSONP callback for chunk loading |
| 29303 |
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| 29304 |
/******/ var [chunkIds, moreModules, runtime] = data; |
| 29305 |
/******/ // add "moreModules" to the modules object, |
| 29306 |
/******/ // then flag all "chunkIds" as loaded and fire callback |
| 29307 |
/******/ var moduleId, chunkId, i = 0; |
| 29308 |
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| 29309 |
/******/ for(moduleId in moreModules) { |
| 29310 |
/******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| 29311 |
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| 29312 |
/******/ } |
| 29313 |
/******/ } |
| 29314 |
/******/ if(runtime) var result = runtime(__webpack_require__); |
| 29315 |
/******/ } |
| 29316 |
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| 29317 |
/******/ for(;i < chunkIds.length; i++) { |
| 29318 |
/******/ chunkId = chunkIds[i]; |
| 29319 |
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| 29320 |
/******/ installedChunks[chunkId][0](); |
| 29321 |
/******/ } |
| 29322 |
/******/ installedChunks[chunkId] = 0; |
| 29323 |
/******/ } |
| 29324 |
/******/ |
| 29325 |
/******/ } |
| 29326 |
/******/ |
| 29327 |
/******/ var chunkLoadingGlobal = self["webpackChunktimetics"] = self["webpackChunktimetics"] || []; |
| 29328 |
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| 29329 |
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| 29330 |
/******/ })(); |
| 29331 |
/******/ |
| 29332 |
/******/ /* webpack/runtime/nonce */ |
| 29333 |
/******/ (() => { |
| 29334 |
/******/ __webpack_require__.nc = undefined; |
| 29335 |
/******/ })(); |
| 29336 |
/******/ |
| 29337 |
/************************************************************************/ |
| 29338 |
var __webpack_exports__ = {}; |
| 29339 |
// This entry need to be wrapped in an IIFE because it need to be in strict mode. |
| 29340 |
(() => { |
| 29341 |
"use strict"; |
| 29342 |
|
| 29343 |
// EXTERNAL MODULE: ./node_modules/react-router/dist/index.js |
| 29344 |
var dist = __webpack_require__(9250); |
| 29345 |
// EXTERNAL MODULE: ./node_modules/react-router-dom/dist/index.js |
| 29346 |
var react_router_dom_dist = __webpack_require__(9655); |
| 29347 |
// EXTERNAL MODULE: ./assets/src/common/Spinner.js |
| 29348 |
var Spinner = __webpack_require__(5729); |
| 29349 |
// EXTERNAL MODULE: ./assets/src/helper/helpers.js |
| 29350 |
var helpers = __webpack_require__(4903); |
| 29351 |
// EXTERNAL MODULE: ./assets/src/admin/actionCreators/actions.js |
| 29352 |
var actionCreators_actions = __webpack_require__(3632); |
| 29353 |
// EXTERNAL MODULE: ./assets/src/admin/actionCreators/common.js |
| 29354 |
var common = __webpack_require__(7157); |
| 29355 |
// EXTERNAL MODULE: ./assets/src/admin/components/Schedules.js |
| 29356 |
var Schedules = __webpack_require__(8253); |
| 29357 |
// EXTERNAL MODULE: ./assets/src/admin/context/provider.js + 9 modules |
| 29358 |
var provider = __webpack_require__(7258); |
| 29359 |
// EXTERNAL MODULE: ./assets/src/admin/services/meetings.js |
| 29360 |
var meetings = __webpack_require__(3538); |
| 29361 |
// EXTERNAL MODULE: ./assets/src/admin/pages/meeting/hook/useMeetings.js |
| 29362 |
var hook_useMeetings = __webpack_require__(7026); |
| 29363 |
// EXTERNAL MODULE: ./assets/src/common/SelectInput.js |
| 29364 |
var common_SelectInput = __webpack_require__(4378); |
| 29365 |
// EXTERNAL MODULE: ./node_modules/react-quill/lib/index.js |
| 29366 |
var lib = __webpack_require__(1167); |
| 29367 |
// EXTERNAL MODULE: ./node_modules/react-quill/dist/quill.snow.css |
| 29368 |
var quill_snow = __webpack_require__(5097); |
| 29369 |
// EXTERNAL MODULE: ./assets/src/common/TextInput.js |
| 29370 |
var common_TextInput = __webpack_require__(6582); |
| 29371 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/meeting/notification/EmailCustomizeModal.js |
| 29372 |
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 29373 |
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 29374 |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 29375 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 29376 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 29377 |
function _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); } |
| 29378 |
function _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; } |
| 29379 |
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 29380 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 29381 |
var useState = window.React.useState; |
| 29382 |
var _window$antd = window.antd, |
| 29383 |
Modal = _window$antd.Modal, |
| 29384 |
Form = _window$antd.Form, |
| 29385 |
Input = _window$antd.Input, |
| 29386 |
Button = _window$antd.Button, |
| 29387 |
Space = _window$antd.Space, |
| 29388 |
Row = _window$antd.Row, |
| 29389 |
Typography = _window$antd.Typography; |
| 29390 |
var Title = Typography.Title; |
| 29391 |
var __ = wp.i18n.__; |
| 29392 |
|
| 29393 |
|
| 29394 |
|
| 29395 |
|
| 29396 |
|
| 29397 |
|
| 29398 |
|
| 29399 |
|
| 29400 |
function EmailCustomizeModal_EmailCustomizeModal(_ref) { |
| 29401 |
var open = _ref.open, |
| 29402 |
dispatch = _ref.dispatch, |
| 29403 |
title = _ref.title; |
| 29404 |
var _useStateValue = useStateValue(), |
| 29405 |
_useStateValue2 = _slicedToArray(_useStateValue, 1), |
| 29406 |
meetingReducer = _useStateValue2[0].meeting; |
| 29407 |
var _Form$useForm = Form.useForm(), |
| 29408 |
_Form$useForm2 = _slicedToArray(_Form$useForm, 1), |
| 29409 |
form = _Form$useForm2[0]; |
| 29410 |
var _useState = useState(""), |
| 29411 |
_useState2 = _slicedToArray(_useState, 2), |
| 29412 |
value = _useState2[0], |
| 29413 |
setValue = _useState2[1]; |
| 29414 |
var notificationDataPrefix = meetingReducer.notificationDataPrefix, |
| 29415 |
meeting = meetingReducer.meeting; |
| 29416 |
var onSaveEmailData = function onSaveEmailData(values) { |
| 29417 |
var _meeting = _objectSpread({}, meeting); |
| 29418 |
_meeting.notifications = _objectSpread(_objectSpread({}, _meeting.notifications), values); |
| 29419 |
setState({ |
| 29420 |
dispatch: dispatch, |
| 29421 |
name: "meeting", |
| 29422 |
value: _meeting |
| 29423 |
}); |
| 29424 |
dispatch({ |
| 29425 |
type: actions.SET_EMAIL_CUSTOMIZE_DATA, |
| 29426 |
payload: { |
| 29427 |
customizeEmail: false |
| 29428 |
} |
| 29429 |
}); |
| 29430 |
}; |
| 29431 |
var onReset = function onReset() { |
| 29432 |
form.resetFields(); |
| 29433 |
dispatch({ |
| 29434 |
type: actions.SET_EMAIL_CUSTOMIZE_DATA, |
| 29435 |
payload: { |
| 29436 |
customizeEmail: false |
| 29437 |
} |
| 29438 |
}); |
| 29439 |
}; |
| 29440 |
return /*#__PURE__*/React.createElement(Modal, { |
| 29441 |
className: "tt-booking-modal", |
| 29442 |
centered: true, |
| 29443 |
style: { |
| 29444 |
top: 40 |
| 29445 |
}, |
| 29446 |
open: open, |
| 29447 |
onOk: function onOk() { |
| 29448 |
return setState({ |
| 29449 |
dispatch: dispatch, |
| 29450 |
name: "customizeEmail", |
| 29451 |
value: false |
| 29452 |
}); |
| 29453 |
}, |
| 29454 |
onCancel: function onCancel() { |
| 29455 |
return setState({ |
| 29456 |
dispatch: dispatch, |
| 29457 |
name: "customizeEmail", |
| 29458 |
value: false |
| 29459 |
}); |
| 29460 |
}, |
| 29461 |
width: 670, |
| 29462 |
okText: "Save", |
| 29463 |
cancelText: "Cancel", |
| 29464 |
closeIcon: /*#__PURE__*/React.createElement(CloseFillIcon, null), |
| 29465 |
footer: null |
| 29466 |
}, /*#__PURE__*/React.createElement("div", { |
| 29467 |
className: "tt-booking-modal-wrapper tt-mb-30" |
| 29468 |
}, /*#__PURE__*/React.createElement(Title, { |
| 29469 |
level: 3, |
| 29470 |
className: "tt-mt-0 tt-mb-15" |
| 29471 |
}, __(title, "timetics")), /*#__PURE__*/React.createElement("div", { |
| 29472 |
className: "" |
| 29473 |
}, /*#__PURE__*/React.createElement(Form, { |
| 29474 |
layout: "vertical", |
| 29475 |
form: form, |
| 29476 |
onFinish: onSaveEmailData, |
| 29477 |
initialValues: meeting === null || meeting === void 0 ? void 0 : meeting.notifications |
| 29478 |
}, /*#__PURE__*/React.createElement(TextInput, { |
| 29479 |
label: __("FROM", "timetics"), |
| 29480 |
name: "".concat(notificationDataPrefix, "email_from"), |
| 29481 |
required: true, |
| 29482 |
rules: [{ |
| 29483 |
required: true, |
| 29484 |
type: "email", |
| 29485 |
message: __("Please enter valid E-mail", "timetics") |
| 29486 |
}], |
| 29487 |
type: "email", |
| 29488 |
size: "small", |
| 29489 |
placeholder: __("Select email", "timetics") |
| 29490 |
}), /*#__PURE__*/React.createElement(TextInput, { |
| 29491 |
label: __("EMAIL SUJECT", "timetics"), |
| 29492 |
name: "".concat(notificationDataPrefix, "email_title"), |
| 29493 |
required: true, |
| 29494 |
rules: [{ |
| 29495 |
required: true, |
| 29496 |
message: __("Please enter E-mail subject!", "timetics") |
| 29497 |
}], |
| 29498 |
type: "text", |
| 29499 |
size: "small", |
| 29500 |
placeholder: __("Your meeting with {BOOKING-TITLE}", "timetics") |
| 29501 |
}), /*#__PURE__*/React.createElement(Form.Item, { |
| 29502 |
className: "timetics-input", |
| 29503 |
label: __("EMAIL BODY"), |
| 29504 |
labelCol: 24, |
| 29505 |
wrapperCol: 24, |
| 29506 |
name: "".concat(notificationDataPrefix, "email_body") |
| 29507 |
}, /*#__PURE__*/React.createElement(ReactQuill, { |
| 29508 |
theme: "snow", |
| 29509 |
value: value, |
| 29510 |
onChange: setValue, |
| 29511 |
modules: modules |
| 29512 |
})), /*#__PURE__*/React.createElement(Row, { |
| 29513 |
justify: "end" |
| 29514 |
}, /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, { |
| 29515 |
type: "default", |
| 29516 |
htmlType: "button", |
| 29517 |
onClick: onReset |
| 29518 |
}, __("Cancel")), /*#__PURE__*/React.createElement(Button, { |
| 29519 |
type: "primary", |
| 29520 |
htmlType: "submit" |
| 29521 |
}, __("Save"))))))))); |
| 29522 |
} |
| 29523 |
/* harmony default export */ const notification_EmailCustomizeModal = ((/* unused pure expression or super */ null && (EmailCustomizeModal_EmailCustomizeModal))); |
| 29524 |
var modules = { |
| 29525 |
toolbar: [[{ |
| 29526 |
header: [1, 2, false] |
| 29527 |
}, { |
| 29528 |
font: [] |
| 29529 |
}], ["bold", "italic", "underline", "strike", "blockquote"], [{ |
| 29530 |
list: "ordered" |
| 29531 |
}, { |
| 29532 |
list: "bullet" |
| 29533 |
}, { |
| 29534 |
indent: "-1" |
| 29535 |
}, { |
| 29536 |
indent: "+1" |
| 29537 |
}], ["link", "image"], ["clean"]] |
| 29538 |
}; |
| 29539 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/meeting/notification/NotificationOption.js |
| 29540 |
function NotificationOption_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 29541 |
function NotificationOption_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? NotificationOption_ownKeys(Object(source), !0).forEach(function (key) { NotificationOption_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : NotificationOption_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 29542 |
function NotificationOption_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 29543 |
function NotificationOption_slicedToArray(arr, i) { return NotificationOption_arrayWithHoles(arr) || NotificationOption_iterableToArrayLimit(arr, i) || NotificationOption_unsupportedIterableToArray(arr, i) || NotificationOption_nonIterableRest(); } |
| 29544 |
function NotificationOption_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 29545 |
function NotificationOption_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return NotificationOption_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 NotificationOption_arrayLikeToArray(o, minLen); } |
| 29546 |
function NotificationOption_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; } |
| 29547 |
function NotificationOption_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 29548 |
function NotificationOption_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 29549 |
|
| 29550 |
|
| 29551 |
|
| 29552 |
var NotificationOption_window$antd = window.antd, |
| 29553 |
Collapse = NotificationOption_window$antd.Collapse, |
| 29554 |
NotificationOption_Space = NotificationOption_window$antd.Space, |
| 29555 |
Switch = NotificationOption_window$antd.Switch, |
| 29556 |
NotificationOption_Button = NotificationOption_window$antd.Button, |
| 29557 |
Divider = NotificationOption_window$antd.Divider, |
| 29558 |
NotificationOption_Row = NotificationOption_window$antd.Row, |
| 29559 |
Col = NotificationOption_window$antd.Col, |
| 29560 |
NotificationOption_Typography = NotificationOption_window$antd.Typography; |
| 29561 |
var Panel = Collapse.Panel; |
| 29562 |
var NotificationOption_Title = NotificationOption_Typography.Title; |
| 29563 |
var NotificationOption_ = wp.i18n.__; |
| 29564 |
function NotificationOption_NotificationOption(_ref) { |
| 29565 |
var i = _ref.i, |
| 29566 |
activeKey = _ref.activeKey, |
| 29567 |
setActiveKey = _ref.setActiveKey, |
| 29568 |
title = _ref.title, |
| 29569 |
customerActionDescription = _ref.customerActionDescription, |
| 29570 |
hostActionDescription = _ref.hostActionDescription, |
| 29571 |
customerNotification = _ref.customerNotification, |
| 29572 |
hostNotification = _ref.hostNotification, |
| 29573 |
children = _ref.children, |
| 29574 |
notificationToCustomer = _ref.notificationToCustomer, |
| 29575 |
notificationToHost = _ref.notificationToHost, |
| 29576 |
emailDataPrefix = _ref.emailDataPrefix; |
| 29577 |
var _useStateValue = useStateValue(), |
| 29578 |
_useStateValue2 = NotificationOption_slicedToArray(_useStateValue, 2), |
| 29579 |
meetingReducer = _useStateValue2[0].meeting, |
| 29580 |
dispatch = _useStateValue2[1]; |
| 29581 |
var meeting = meetingReducer.meeting; |
| 29582 |
var onNotificationStatusChange = function onNotificationStatusChange(checked, notificationStatusKey) { |
| 29583 |
var _meeting = NotificationOption_objectSpread({}, meeting); |
| 29584 |
_meeting.notifications = NotificationOption_objectSpread(NotificationOption_objectSpread({}, _meeting.notifications), {}, NotificationOption_defineProperty({}, notificationStatusKey, checked)); |
| 29585 |
setState({ |
| 29586 |
dispatch: dispatch, |
| 29587 |
name: "meeting", |
| 29588 |
value: _meeting |
| 29589 |
}); |
| 29590 |
}; |
| 29591 |
return /*#__PURE__*/React.createElement(NotificationOption_Space, { |
| 29592 |
direction: "vertical", |
| 29593 |
size: "middle", |
| 29594 |
style: { |
| 29595 |
display: "flex" |
| 29596 |
}, |
| 29597 |
className: "tt-mb-20" |
| 29598 |
}, /*#__PURE__*/React.createElement(Collapse, { |
| 29599 |
accordion: true, |
| 29600 |
expandIconPosition: "end", |
| 29601 |
activeKey: activeKey, |
| 29602 |
onChange: function onChange(e) { |
| 29603 |
setActiveKey(e); |
| 29604 |
} |
| 29605 |
}, /*#__PURE__*/React.createElement(Panel, { |
| 29606 |
className: "tt-notification-content", |
| 29607 |
header: title, |
| 29608 |
key: i |
| 29609 |
}, children ? children : null, /*#__PURE__*/React.createElement(NotificationOption_Row, null, /*#__PURE__*/React.createElement(Col, { |
| 29610 |
span: 18 |
| 29611 |
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NotificationOption_Title, { |
| 29612 |
level: 4, |
| 29613 |
className: "tt-margin-0" |
| 29614 |
}, NotificationOption_(" Notification to customer", "timetics")), /*#__PURE__*/React.createElement("p", { |
| 29615 |
className: "tt-margin-0" |
| 29616 |
}, NotificationOption_(customerActionDescription, "timetics")))), /*#__PURE__*/React.createElement(Col, { |
| 29617 |
span: 6 |
| 29618 |
}, /*#__PURE__*/React.createElement("div", { |
| 29619 |
className: "tt-text-right" |
| 29620 |
}, /*#__PURE__*/React.createElement(Switch, { |
| 29621 |
checked: !!(meeting !== null && meeting !== void 0 && meeting.notifications[notificationToCustomer]), |
| 29622 |
onChange: function onChange(checked) { |
| 29623 |
onNotificationStatusChange(checked, notificationToCustomer); |
| 29624 |
} |
| 29625 |
}), /*#__PURE__*/React.createElement(NotificationOption_Button, { |
| 29626 |
type: "link", |
| 29627 |
className: "tt-link-btn tt-mt-10", |
| 29628 |
onClick: function onClick(e) { |
| 29629 |
dispatch({ |
| 29630 |
type: actions.SET_EMAIL_CUSTOMIZE_DATA, |
| 29631 |
payload: { |
| 29632 |
customizeEmail: true, |
| 29633 |
modalTitle: "Customize email notification to\n customer ".concat(title), |
| 29634 |
notificationDataPrefix: "".concat(emailDataPrefix, "customer_") |
| 29635 |
} |
| 29636 |
}); |
| 29637 |
} |
| 29638 |
}, NotificationOption_("Customize Email", "timetics"))))), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(NotificationOption_Row, null, /*#__PURE__*/React.createElement(Col, { |
| 29639 |
span: 18 |
| 29640 |
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NotificationOption_Title, { |
| 29641 |
level: 4, |
| 29642 |
className: "tt-margin-0" |
| 29643 |
}, NotificationOption_("Notification to host", "timetics")), /*#__PURE__*/React.createElement("p", { |
| 29644 |
className: "tt-margin-0" |
| 29645 |
}, NotificationOption_(hostActionDescription, "timetics")))), /*#__PURE__*/React.createElement(Col, { |
| 29646 |
span: 6 |
| 29647 |
}, /*#__PURE__*/React.createElement("div", { |
| 29648 |
className: "tt-text-right" |
| 29649 |
}, /*#__PURE__*/React.createElement(Switch, { |
| 29650 |
checked: !!(meeting !== null && meeting !== void 0 && meeting.notifications[notificationToHost]), |
| 29651 |
onChange: function onChange(checked) { |
| 29652 |
onNotificationStatusChange(checked, notificationToHost); |
| 29653 |
} |
| 29654 |
}), /*#__PURE__*/React.createElement(NotificationOption_Button, { |
| 29655 |
type: "link", |
| 29656 |
className: "tt-link-btn tt-mt-10", |
| 29657 |
onClick: function onClick(e) { |
| 29658 |
dispatch({ |
| 29659 |
type: actions.SET_EMAIL_CUSTOMIZE_DATA, |
| 29660 |
payload: { |
| 29661 |
customizeEmail: true, |
| 29662 |
modalTitle: "Customize email notification to\n host ".concat(title), |
| 29663 |
notificationDataPrefix: "".concat(emailDataPrefix, "host_") |
| 29664 |
} |
| 29665 |
}); |
| 29666 |
} |
| 29667 |
}, NotificationOption_("Customize Email", "timetics")))))))); |
| 29668 |
} |
| 29669 |
/* harmony default export */ const notification_NotificationOption = ((/* unused pure expression or super */ null && (NotificationOption_NotificationOption))); |
| 29670 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/meeting/notification/NotificationTypes.js |
| 29671 |
function NotificationTypes_slicedToArray(arr, i) { return NotificationTypes_arrayWithHoles(arr) || NotificationTypes_iterableToArrayLimit(arr, i) || NotificationTypes_unsupportedIterableToArray(arr, i) || NotificationTypes_nonIterableRest(); } |
| 29672 |
function NotificationTypes_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 29673 |
function NotificationTypes_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return NotificationTypes_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 NotificationTypes_arrayLikeToArray(o, minLen); } |
| 29674 |
function NotificationTypes_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; } |
| 29675 |
function NotificationTypes_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 29676 |
function NotificationTypes_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 29677 |
var Radio = window.antd.Radio; |
| 29678 |
var NotificationTypes_useState = window.React.useState; |
| 29679 |
function NotificationTypes() { |
| 29680 |
var _useState = NotificationTypes_useState("Email notifications"), |
| 29681 |
_useState2 = NotificationTypes_slicedToArray(_useState, 2), |
| 29682 |
type = _useState2[0], |
| 29683 |
setType = _useState2[1]; |
| 29684 |
var types = ["Email notifications", "SMS notifications", "Customize form"]; |
| 29685 |
var onSelectTypes = function onSelectTypes(_ref) { |
| 29686 |
var value = _ref.target.value; |
| 29687 |
setType(value); |
| 29688 |
}; |
| 29689 |
return /*#__PURE__*/React.createElement("div", { |
| 29690 |
className: "tt-mb-30" |
| 29691 |
}, /*#__PURE__*/React.createElement(Radio.Group, { |
| 29692 |
options: types, |
| 29693 |
onChange: onSelectTypes, |
| 29694 |
value: type |
| 29695 |
})); |
| 29696 |
} |
| 29697 |
/* harmony default export */ const notification_NotificationTypes = ((/* unused pure expression or super */ null && (NotificationTypes))); |
| 29698 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/meeting/notification/ReminderTime.js |
| 29699 |
function ReminderTime_slicedToArray(arr, i) { return ReminderTime_arrayWithHoles(arr) || ReminderTime_iterableToArrayLimit(arr, i) || ReminderTime_unsupportedIterableToArray(arr, i) || ReminderTime_nonIterableRest(); } |
| 29700 |
function ReminderTime_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 29701 |
function ReminderTime_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ReminderTime_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 ReminderTime_arrayLikeToArray(o, minLen); } |
| 29702 |
function ReminderTime_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; } |
| 29703 |
function ReminderTime_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 29704 |
function ReminderTime_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 29705 |
|
| 29706 |
|
| 29707 |
|
| 29708 |
|
| 29709 |
var ReminderTime_ = wp.i18n.__; |
| 29710 |
var ReminderTime_window$antd = window.antd, |
| 29711 |
ReminderTime_Col = ReminderTime_window$antd.Col, |
| 29712 |
ReminderTime_Row = ReminderTime_window$antd.Row, |
| 29713 |
ReminderTime_Typography = ReminderTime_window$antd.Typography; |
| 29714 |
var ReminderTime_Title = ReminderTime_Typography.Title; |
| 29715 |
var _window$React = window.React, |
| 29716 |
ReminderTime_useState = _window$React.useState, |
| 29717 |
useEffect = _window$React.useEffect; |
| 29718 |
function ReminderTime_ReminderTime() { |
| 29719 |
var _useState = ReminderTime_useState(null), |
| 29720 |
_useState2 = ReminderTime_slicedToArray(_useState, 2), |
| 29721 |
meetingCustom = _useState2[0], |
| 29722 |
setMeetingCustom = _useState2[1]; |
| 29723 |
var _useState3 = ReminderTime_useState(1), |
| 29724 |
_useState4 = ReminderTime_slicedToArray(_useState3, 2), |
| 29725 |
customDuration = _useState4[0], |
| 29726 |
setCustomDuration = _useState4[1]; |
| 29727 |
var _useState5 = ReminderTime_useState("hour"), |
| 29728 |
_useState6 = ReminderTime_slicedToArray(_useState5, 2), |
| 29729 |
customDurationTime = _useState6[0], |
| 29730 |
setCustomDurationTime = _useState6[1]; |
| 29731 |
var _useStateValue = useStateValue(0), |
| 29732 |
_useStateValue2 = ReminderTime_slicedToArray(_useStateValue, 2), |
| 29733 |
meetingReducer = _useStateValue2[0].meeting, |
| 29734 |
dispatch = _useStateValue2[1]; |
| 29735 |
var meeting = meetingReducer.meeting, |
| 29736 |
booking_reminder_time_key = meetingReducer.booking_reminder_time_key, |
| 29737 |
booking_reminder_time_value = meetingReducer.booking_reminder_time_value; |
| 29738 |
var splitBookingReminderTime = function splitBookingReminderTime(time) { |
| 29739 |
if (!time) { |
| 29740 |
return [1, "hour"]; |
| 29741 |
} |
| 29742 |
return time === null || time === void 0 ? void 0 : time.split(" "); |
| 29743 |
}; |
| 29744 |
useEffect(function () { |
| 29745 |
var _meeting$notification; |
| 29746 |
if (meeting !== null && meeting !== void 0 && meeting.notifications && meeting !== null && meeting !== void 0 && (_meeting$notification = meeting.notifications) !== null && _meeting$notification !== void 0 && _meeting$notification.booking_reminder_time) { |
| 29747 |
var _meeting$notification2, _meeting$notification3; |
| 29748 |
setState({ |
| 29749 |
dispatch: dispatch, |
| 29750 |
name: "booking_reminder_time_key", |
| 29751 |
value: splitBookingReminderTime(meeting === null || meeting === void 0 ? void 0 : (_meeting$notification2 = meeting.notifications) === null || _meeting$notification2 === void 0 ? void 0 : _meeting$notification2.booking_reminder_time)[1] |
| 29752 |
}); |
| 29753 |
setState({ |
| 29754 |
dispatch: dispatch, |
| 29755 |
name: "booking_reminder_time_value", |
| 29756 |
value: splitBookingReminderTime(meeting === null || meeting === void 0 ? void 0 : (_meeting$notification3 = meeting.notifications) === null || _meeting$notification3 === void 0 ? void 0 : _meeting$notification3.booking_reminder_time)[0] |
| 29757 |
}); |
| 29758 |
} else { |
| 29759 |
setState({ |
| 29760 |
dispatch: dispatch, |
| 29761 |
name: "booking_reminder_time_key", |
| 29762 |
value: "hour" |
| 29763 |
}); |
| 29764 |
setState({ |
| 29765 |
dispatch: dispatch, |
| 29766 |
name: "booking_reminder_time_value", |
| 29767 |
value: 1 |
| 29768 |
}); |
| 29769 |
} |
| 29770 |
}, []); |
| 29771 |
|
| 29772 |
/** |
| 29773 |
*Handler for Reminder time of meeting notification. |
| 29774 |
* @param {*} value reminder time |
| 29775 |
*/ |
| 29776 |
var selectReminderTime = function selectReminderTime(_ref) { |
| 29777 |
var key = _ref.key, |
| 29778 |
value = _ref.value; |
| 29779 |
setState({ |
| 29780 |
dispatch: dispatch, |
| 29781 |
name: key, |
| 29782 |
value: value |
| 29783 |
}); |
| 29784 |
}; |
| 29785 |
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ReminderTime_Row, { |
| 29786 |
align: "end", |
| 29787 |
gutter: 16 |
| 29788 |
}, /*#__PURE__*/React.createElement(ReminderTime_Col, { |
| 29789 |
span: 12 |
| 29790 |
}, /*#__PURE__*/React.createElement(ReminderTime_Title, { |
| 29791 |
level: 4 |
| 29792 |
}, ReminderTime_("When will this email be sent?"))), /*#__PURE__*/React.createElement(ReminderTime_Col, { |
| 29793 |
span: 6 |
| 29794 |
}, /*#__PURE__*/React.createElement(TextInput |
| 29795 |
// name={"custom_duration"} |
| 29796 |
, { |
| 29797 |
key: "custom_duration", |
| 29798 |
type: "number", |
| 29799 |
min: 1, |
| 29800 |
label: ReminderTime_("Set custom time", "timetics"), |
| 29801 |
onChange: function onChange(e) { |
| 29802 |
selectReminderTime({ |
| 29803 |
key: "booking_reminder_time_value", |
| 29804 |
value: e.target.value |
| 29805 |
}); |
| 29806 |
}, |
| 29807 |
value: booking_reminder_time_value |
| 29808 |
})), /*#__PURE__*/React.createElement(ReminderTime_Col, { |
| 29809 |
span: 6 |
| 29810 |
}, /*#__PURE__*/React.createElement(SelectInput, { |
| 29811 |
label: ReminderTime_("day / hour / min", "timetics") |
| 29812 |
// name={"custom_duration_time"} |
| 29813 |
// key={"custom_duration_time"} |
| 29814 |
, |
| 29815 |
style: { |
| 29816 |
width: "100%" |
| 29817 |
}, |
| 29818 |
data: reminderTime, |
| 29819 |
labelCol: 24, |
| 29820 |
wrapperCol: 24, |
| 29821 |
onChange: function onChange(value) { |
| 29822 |
selectReminderTime({ |
| 29823 |
key: "booking_reminder_time_key", |
| 29824 |
value: value |
| 29825 |
}); |
| 29826 |
}, |
| 29827 |
value: booking_reminder_time_key |
| 29828 |
})))); |
| 29829 |
} |
| 29830 |
/* harmony default export */ const notification_ReminderTime = ((/* unused pure expression or super */ null && (ReminderTime_ReminderTime))); |
| 29831 |
var reminderTime = [{ |
| 29832 |
id: 1, |
| 29833 |
label: "day(s) befor", |
| 29834 |
value: "day" |
| 29835 |
}, { |
| 29836 |
id: 2, |
| 29837 |
label: "hour(s) befor", |
| 29838 |
value: "hour" |
| 29839 |
}, { |
| 29840 |
id: 3, |
| 29841 |
label: "min(s) befor", |
| 29842 |
value: "min" |
| 29843 |
}]; |
| 29844 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/meeting/notification/Notification.js |
| 29845 |
function Notification_slicedToArray(arr, i) { return Notification_arrayWithHoles(arr) || Notification_iterableToArrayLimit(arr, i) || Notification_unsupportedIterableToArray(arr, i) || Notification_nonIterableRest(); } |
| 29846 |
function Notification_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 29847 |
function Notification_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Notification_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 Notification_arrayLikeToArray(o, minLen); } |
| 29848 |
function Notification_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; } |
| 29849 |
function Notification_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 29850 |
function Notification_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 29851 |
var Notification_window$antd = window.antd, |
| 29852 |
Notification_Button = Notification_window$antd.Button, |
| 29853 |
Notification_Row = Notification_window$antd.Row, |
| 29854 |
Notification_Col = Notification_window$antd.Col; |
| 29855 |
var Notification_useState = window.React.useState; |
| 29856 |
|
| 29857 |
|
| 29858 |
|
| 29859 |
|
| 29860 |
|
| 29861 |
|
| 29862 |
|
| 29863 |
|
| 29864 |
|
| 29865 |
var Notification_ = wp.i18n.__; |
| 29866 |
function Notification() { |
| 29867 |
var _useState = Notification_useState(0), |
| 29868 |
_useState2 = Notification_slicedToArray(_useState, 2), |
| 29869 |
activeKey = _useState2[0], |
| 29870 |
setActiveKey = _useState2[1]; |
| 29871 |
var _useMeetings = useMeetings(), |
| 29872 |
submitMeeting = _useMeetings.submitMeeting; |
| 29873 |
var _useStateValue = useStateValue(), |
| 29874 |
_useStateValue2 = Notification_slicedToArray(_useStateValue, 2), |
| 29875 |
meetingReducer = _useStateValue2[0].meeting, |
| 29876 |
dispatch = _useStateValue2[1]; |
| 29877 |
var _useSearchParams = useSearchParams(), |
| 29878 |
_useSearchParams2 = Notification_slicedToArray(_useSearchParams, 1), |
| 29879 |
searchParams = _useSearchParams2[0]; |
| 29880 |
var customizeEmail = meetingReducer.customizeEmail, |
| 29881 |
modalTitle = meetingReducer.modalTitle, |
| 29882 |
meeting = meetingReducer.meeting; |
| 29883 |
var options = getNotificationOptions(); |
| 29884 |
var id = searchParams.get("id"); |
| 29885 |
var saveNotificationUpdate = function saveNotificationUpdate() { |
| 29886 |
//TODO need to save meeting here... |
| 29887 |
|
| 29888 |
submitMeeting({ |
| 29889 |
values: meeting, |
| 29890 |
id: id |
| 29891 |
}); |
| 29892 |
}; |
| 29893 |
return /*#__PURE__*/React.createElement(React.Fragment, null, options === null || options === void 0 ? void 0 : options.map(function (_ref, index) { |
| 29894 |
var title = _ref.title, |
| 29895 |
customerActionDescription = _ref.customerActionDescription, |
| 29896 |
customerNotification = _ref.customerNotification, |
| 29897 |
hostActionDescription = _ref.hostActionDescription, |
| 29898 |
hostNotification = _ref.hostNotification, |
| 29899 |
notificationToCustomer = _ref.notificationToCustomer, |
| 29900 |
notificationToHost = _ref.notificationToHost, |
| 29901 |
children = _ref.children, |
| 29902 |
emailDataPrefix = _ref.emailDataPrefix; |
| 29903 |
return /*#__PURE__*/React.createElement(NotificationOption, { |
| 29904 |
key: "".concat(index, "-notification-item"), |
| 29905 |
i: index, |
| 29906 |
activeKey: activeKey, |
| 29907 |
setActiveKey: setActiveKey, |
| 29908 |
title: title, |
| 29909 |
customerActionDescription: customerActionDescription, |
| 29910 |
hostActionDescription: hostActionDescription, |
| 29911 |
customerNotification: customerNotification, |
| 29912 |
hostNotification: hostNotification, |
| 29913 |
children: children, |
| 29914 |
notificationToCustomer: notificationToCustomer, |
| 29915 |
notificationToHost: notificationToHost, |
| 29916 |
emailDataPrefix: emailDataPrefix |
| 29917 |
}); |
| 29918 |
}), /*#__PURE__*/React.createElement(Notification_Row, { |
| 29919 |
justify: "end" |
| 29920 |
}, /*#__PURE__*/React.createElement(Notification_Button, { |
| 29921 |
size: "large", |
| 29922 |
type: "primary", |
| 29923 |
htmlType: "button", |
| 29924 |
onClick: function onClick() { |
| 29925 |
saveNotificationUpdate(); |
| 29926 |
} |
| 29927 |
}, Notification_("Save Updates", "timetics"))), /*#__PURE__*/React.createElement(EmailCustomizeModal, { |
| 29928 |
open: customizeEmail, |
| 29929 |
dispatch: dispatch, |
| 29930 |
title: modalTitle |
| 29931 |
})); |
| 29932 |
} |
| 29933 |
/* harmony default export */ const notification_Notification = ((/* unused pure expression or super */ null && (Notification))); |
| 29934 |
function getNotificationOptions(notifications) { |
| 29935 |
var _useStateValue3 = useStateValue(), |
| 29936 |
_useStateValue4 = Notification_slicedToArray(_useStateValue3, 2), |
| 29937 |
meetingReducer = _useStateValue4[0].meeting, |
| 29938 |
dispatch = _useStateValue4[1]; |
| 29939 |
var customizeEmail = meetingReducer.customizeEmail, |
| 29940 |
modalTitle = meetingReducer.modalTitle, |
| 29941 |
meeting = meetingReducer.meeting; |
| 29942 |
return [{ |
| 29943 |
title: "After booking made", |
| 29944 |
customerActionDescription: "Your guest will receive an email confirmation with links to create their own calendar event", |
| 29945 |
hostActionDescription: "Your guest will receive an email confirmation with links to create their own calendar event.", |
| 29946 |
customerNotification: "booking_created_email_customer", |
| 29947 |
hostNotification: "booking_created_email_host", |
| 29948 |
notificationToHost: "booking_created_host", |
| 29949 |
notificationToCustomer: "booking_created_customer", |
| 29950 |
emailDataPrefix: "booking_created_" |
| 29951 |
}, { |
| 29952 |
title: "After booking canceled", |
| 29953 |
customerActionDescription: "Your guest will receive an email confirmation with links", |
| 29954 |
hostActionDescription: "Your guest will receive an email confirmation with links to create their own calendar event.", |
| 29955 |
customerNotification: "booking_canceled_email_customer", |
| 29956 |
hostNotification: "booking_canceled_email_host", |
| 29957 |
notificationToHost: "booking_canceled_host", |
| 29958 |
notificationToCustomer: "booking_canceled_customer", |
| 29959 |
emailDataPrefix: "booking_canceled_" |
| 29960 |
}, { |
| 29961 |
title: "After booking rescheduled", |
| 29962 |
customerActionDescription: "Your guest will receive an email confirmation with links to create their own calendar event.", |
| 29963 |
hostActionDescription: "Your guest will receive an email confirmation with links to create their own calendar event.", |
| 29964 |
customerNotification: "booking_rescheduled_email_customer", |
| 29965 |
hostNotification: "booking_rescheduled_email_host", |
| 29966 |
notificationToHost: "booking_rescheduled_host", |
| 29967 |
notificationToCustomer: "booking_rescheduled_customer", |
| 29968 |
emailDataPrefix: "booking_rescheduled_" |
| 29969 |
}, { |
| 29970 |
title: "Reminder before meeting", |
| 29971 |
customerActionDescription: "Your guest will receive an email confirmation with links to create their own calendar event.", |
| 29972 |
hostActionDescription: "Your guest will receive an email confirmation with links to create their own calendar event.", |
| 29973 |
customerNotification: "booking_created_email_customer", |
| 29974 |
hostNotification: "booking_created_email_host", |
| 29975 |
children: /*#__PURE__*/React.createElement(ReminderTime, null), |
| 29976 |
notificationToHost: "booking_reminder_host", |
| 29977 |
notificationToCustomer: "booking_reminder_customer", |
| 29978 |
emailDataPrefix: "booking_reminder_" |
| 29979 |
// key: notifications.booking_created_email_form, |
| 29980 |
}]; |
| 29981 |
} |
| 29982 |
// EXTERNAL MODULE: ./assets/src/admin/pages/meeting/steps/FirstStep.js + 5 modules |
| 29983 |
var FirstStep = __webpack_require__(7004); |
| 29984 |
// EXTERNAL MODULE: ./assets/src/admin/pages/meeting/steps/SecondStep.js |
| 29985 |
var SecondStep = __webpack_require__(9622); |
| 29986 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/meeting/UpdateMeeting.js |
| 29987 |
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } |
| 29988 |
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
| 29989 |
function UpdateMeeting_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| 29990 |
function UpdateMeeting_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? UpdateMeeting_ownKeys(Object(source), !0).forEach(function (key) { UpdateMeeting_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : UpdateMeeting_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| 29991 |
function UpdateMeeting_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
| 29992 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
| 29993 |
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
| 29994 |
function UpdateMeeting_slicedToArray(arr, i) { return UpdateMeeting_arrayWithHoles(arr) || UpdateMeeting_iterableToArrayLimit(arr, i) || UpdateMeeting_unsupportedIterableToArray(arr, i) || UpdateMeeting_nonIterableRest(); } |
| 29995 |
function UpdateMeeting_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 29996 |
function UpdateMeeting_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return UpdateMeeting_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 UpdateMeeting_arrayLikeToArray(o, minLen); } |
| 29997 |
function UpdateMeeting_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; } |
| 29998 |
function UpdateMeeting_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 29999 |
function UpdateMeeting_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 30000 |
|
| 30001 |
|
| 30002 |
|
| 30003 |
|
| 30004 |
|
| 30005 |
|
| 30006 |
|
| 30007 |
|
| 30008 |
|
| 30009 |
|
| 30010 |
|
| 30011 |
|
| 30012 |
var UpdateMeeting_React = window.React; |
| 30013 |
var UpdateMeeting_useEffect = UpdateMeeting_React.useEffect, |
| 30014 |
UpdateMeeting_useState = UpdateMeeting_React.useState; |
| 30015 |
var UpdateMeeting_window$antd = window.antd, |
| 30016 |
UpdateMeeting_Row = UpdateMeeting_window$antd.Row, |
| 30017 |
Tabs = UpdateMeeting_window$antd.Tabs, |
| 30018 |
UpdateMeeting_Typography = UpdateMeeting_window$antd.Typography, |
| 30019 |
UpdateMeeting_Form = UpdateMeeting_window$antd.Form; |
| 30020 |
var UpdateMeeting_Title = UpdateMeeting_Typography.Title; |
| 30021 |
var UpdateMeeting_ = wp.i18n.__; |
| 30022 |
function UpdateMeeting() { |
| 30023 |
var _useStateValue = (0,provider/* useStateValue */.K)(), |
| 30024 |
_useStateValue2 = UpdateMeeting_slicedToArray(_useStateValue, 2), |
| 30025 |
_useStateValue2$ = _useStateValue2[0], |
| 30026 |
meetingReducer = _useStateValue2$.meeting, |
| 30027 |
staff = _useStateValue2$.staff, |
| 30028 |
dispatch = _useStateValue2[1]; |
| 30029 |
var _useMeetings = (0,hook_useMeetings/* default */.Z)(), |
| 30030 |
submitMeeting = _useMeetings.submitMeeting; |
| 30031 |
var _Form$useForm = UpdateMeeting_Form.useForm(), |
| 30032 |
_Form$useForm2 = UpdateMeeting_slicedToArray(_Form$useForm, 1), |
| 30033 |
form = _Form$useForm2[0]; |
| 30034 |
var _useSearchParams = (0,react_router_dom_dist/* useSearchParams */.lr)(), |
| 30035 |
_useSearchParams2 = UpdateMeeting_slicedToArray(_useSearchParams, 1), |
| 30036 |
searchParams = _useSearchParams2[0]; |
| 30037 |
var _useState = UpdateMeeting_useState(1), |
| 30038 |
_useState2 = UpdateMeeting_slicedToArray(_useState, 2), |
| 30039 |
current = _useState2[0], |
| 30040 |
setCurrent = _useState2[1]; |
| 30041 |
var id = searchParams.get("id"); |
| 30042 |
var staffs = staff.staffs; |
| 30043 |
var loading = meetingReducer.loading, |
| 30044 |
meetingTitle = meetingReducer.meetingTitle; |
| 30045 |
UpdateMeeting_useEffect(function () { |
| 30046 |
var loadData = /*#__PURE__*/function () { |
| 30047 |
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { |
| 30048 |
var _data$data, _data$data3, _data$data7, _data$data11, _data$data11$staff, _data$data12, _data$data13, _data$data14, _data$data15, _data$data15$availabi, _data$data16, _data$data16$availabi, _yield$getSingleMeeti, data, addressType, _data$data2, _data$data2$locations, _meetingDuration, _meetinBufferTime, _data$data4, _data$data4$duration, _data$data5, _data$data6, _data$data8, _data$data8$buffer_ti, _data$data9, _data$data10, _selectedStaffIds, _selectedStaff; |
| 30049 |
return _regeneratorRuntime().wrap(function _callee$(_context) { |
| 30050 |
while (1) { |
| 30051 |
switch (_context.prev = _context.next) { |
| 30052 |
case 0: |
| 30053 |
//TODO need to rename meeting related property in context as updateMeeting |
| 30054 |
(0,common/* setState */.I)({ |
| 30055 |
dispatch: dispatch, |
| 30056 |
name: "meetingId", |
| 30057 |
value: id |
| 30058 |
}); |
| 30059 |
if (!id) { |
| 30060 |
_context.next = 19; |
| 30061 |
break; |
| 30062 |
} |
| 30063 |
(0,common/* setState */.I)({ |
| 30064 |
dispatch: dispatch, |
| 30065 |
name: "loading", |
| 30066 |
value: true |
| 30067 |
}); |
| 30068 |
_context.next = 5; |
| 30069 |
return (0,meetings/* getSingleMeeting */.e5)({ |
| 30070 |
method: "GET" |
| 30071 |
}, id); |
| 30072 |
case 5: |
| 30073 |
_yield$getSingleMeeti = _context.sent; |
| 30074 |
data = _yield$getSingleMeeti.data; |
| 30075 |
addressType = []; |
| 30076 |
if (Array.isArray(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.locations)) { |
| 30077 |
data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$locations = _data$data2.locations) === null || _data$data2$locations === void 0 ? void 0 : _data$data2$locations.map(function (item) { |
| 30078 |
addressType.push(item.location_type); |
| 30079 |
}); |
| 30080 |
} |
| 30081 |
_meetingDuration = 10; |
| 30082 |
_meetinBufferTime = 0; |
| 30083 |
if (data !== null && data !== void 0 && (_data$data3 = data.data) !== null && _data$data3 !== void 0 && _data$data3.duration) { |
| 30084 |
if ((data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : (_data$data4$duration = _data$data4.duration) === null || _data$data4$duration === void 0 ? void 0 : _data$data4$duration.split(" ")[1]) == "hr") { |
| 30085 |
_meetingDuration = +(data === null || data === void 0 ? void 0 : (_data$data5 = data.data) === null || _data$data5 === void 0 ? void 0 : _data$data5.duration.split(" ")[0]) * 60; |
| 30086 |
} else { |
| 30087 |
_meetingDuration = +(data === null || data === void 0 ? void 0 : (_data$data6 = data.data) === null || _data$data6 === void 0 ? void 0 : _data$data6.duration.split(" ")[0]); |
| 30088 |
} |
| 30089 |
} |
| 30090 |
if (data !== null && data !== void 0 && (_data$data7 = data.data) !== null && _data$data7 !== void 0 && _data$data7.buffer_time) { |
| 30091 |
if ((data === null || data === void 0 ? void 0 : (_data$data8 = data.data) === null || _data$data8 === void 0 ? void 0 : (_data$data8$buffer_ti = _data$data8.buffer_time) === null || _data$data8$buffer_ti === void 0 ? void 0 : _data$data8$buffer_ti.split(" ")[1]) == "hr") { |
| 30092 |
_meetinBufferTime = +(data === null || data === void 0 ? void 0 : (_data$data9 = data.data) === null || _data$data9 === void 0 ? void 0 : _data$data9.buffer_time.split(" ")[0]) * 60; |
| 30093 |
} else { |
| 30094 |
_meetinBufferTime = +(data === null || data === void 0 ? void 0 : (_data$data10 = data.data) === null || _data$data10 === void 0 ? void 0 : _data$data10.buffer_time.split(" ")[0]); |
| 30095 |
} |
| 30096 |
} |
| 30097 |
_selectedStaffIds = data === null || data === void 0 ? void 0 : (_data$data11 = data.data) === null || _data$data11 === void 0 ? void 0 : (_data$data11$staff = _data$data11.staff) === null || _data$data11$staff === void 0 ? void 0 : _data$data11$staff.map(function (item) { |
| 30098 |
return item.id; |
| 30099 |
}); |
| 30100 |
_selectedStaff = data === null || data === void 0 ? void 0 : (_data$data12 = data.data) === null || _data$data12 === void 0 ? void 0 : _data$data12.staff; |
| 30101 |
(0,helpers/* setScheduleDataToContex */.Ne)({ |
| 30102 |
dispatch: dispatch, |
| 30103 |
meeting: data === null || data === void 0 ? void 0 : data.data, |
| 30104 |
staffs: staffs |
| 30105 |
}); |
| 30106 |
(0,common/* setState */.I)({ |
| 30107 |
dispatch: dispatch, |
| 30108 |
name: "meeting", |
| 30109 |
value: UpdateMeeting_objectSpread({}, data === null || data === void 0 ? void 0 : data.data) |
| 30110 |
}); |
| 30111 |
dispatch({ |
| 30112 |
type: actionCreators_actions/* actions.SET_META_DATA_WITH_MEETING */.N.SET_META_DATA_WITH_MEETING, |
| 30113 |
payload: { |
| 30114 |
addressType: addressType, |
| 30115 |
meetingType: data === null || data === void 0 ? void 0 : (_data$data13 = data.data) === null || _data$data13 === void 0 ? void 0 : _data$data13.type, |
| 30116 |
meetingTitle: "Update ".concat(data === null || data === void 0 ? void 0 : (_data$data14 = data.data) === null || _data$data14 === void 0 ? void 0 : _data$data14.type, " Meeting"), |
| 30117 |
meetingDuration: _meetingDuration, |
| 30118 |
meetingBufferTime: _meetinBufferTime, |
| 30119 |
selectedStaffIds: _selectedStaffIds, |
| 30120 |
selectedStaff: _selectedStaff, |
| 30121 |
meetingStartDate: data === null || data === void 0 ? void 0 : (_data$data15 = data.data) === null || _data$data15 === void 0 ? void 0 : (_data$data15$availabi = _data$data15.availability) === null || _data$data15$availabi === void 0 ? void 0 : _data$data15$availabi.start, |
| 30122 |
meetingEndDate: data === null || data === void 0 ? void 0 : (_data$data16 = data.data) === null || _data$data16 === void 0 ? void 0 : (_data$data16$availabi = _data$data16.availability) === null || _data$data16$availabi === void 0 ? void 0 : _data$data16$availabi.end |
| 30123 |
} |
| 30124 |
}); |
| 30125 |
(0,common/* setState */.I)({ |
| 30126 |
dispatch: dispatch, |
| 30127 |
name: "loading", |
| 30128 |
value: false |
| 30129 |
}); |
| 30130 |
case 19: |
| 30131 |
case "end": |
| 30132 |
return _context.stop(); |
| 30133 |
} |
| 30134 |
} |
| 30135 |
}, _callee); |
| 30136 |
})); |
| 30137 |
return function loadData() { |
| 30138 |
return _ref.apply(this, arguments); |
| 30139 |
}; |
| 30140 |
}(); |
| 30141 |
loadData(); |
| 30142 |
}, [staffs]); |
| 30143 |
UpdateMeeting_useEffect(function () { |
| 30144 |
return function () { |
| 30145 |
dispatch({ |
| 30146 |
type: actionCreators_actions/* actions.CLEAR_MEETING_DATA_FOR_UPDATE */.N.CLEAR_MEETING_DATA_FOR_UPDATE, |
| 30147 |
payload: null |
| 30148 |
}); |
| 30149 |
}; |
| 30150 |
}, []); |
| 30151 |
|
| 30152 |
/** |
| 30153 |
* |
| 30154 |
* @param {Object} values all the values of form submission(if any) |
| 30155 |
*/ |
| 30156 |
var onFinish = function onFinish(values) { |
| 30157 |
//TODO need to add update functionality; |
| 30158 |
submitMeeting({ |
| 30159 |
values: values, |
| 30160 |
id: id |
| 30161 |
}); |
| 30162 |
}; |
| 30163 |
/** |
| 30164 |
* |
| 30165 |
* @param {Object} errorInfo Error details of form submission(if any) |
| 30166 |
*/ |
| 30167 |
var onFinishFailed = function onFinishFailed(errorInfo) { |
| 30168 |
// console.log("Failed:", errorInfo); |
| 30169 |
}; |
| 30170 |
|
| 30171 |
/** |
| 30172 |
* Tabs data |
| 30173 |
*/ |
| 30174 |
var tabsData = [{ |
| 30175 |
label: UpdateMeeting_("Basic info", "timetics"), |
| 30176 |
key: "basicinfo", |
| 30177 |
children: /*#__PURE__*/UpdateMeeting_React.createElement(FirstStep/* default */.Z, { |
| 30178 |
onFinish: onFinish, |
| 30179 |
onFinishFailed: onFinishFailed, |
| 30180 |
current: current, |
| 30181 |
setCurrent: setCurrent, |
| 30182 |
form: form |
| 30183 |
}) |
| 30184 |
}, { |
| 30185 |
label: UpdateMeeting_("Time and availability", "timetics"), |
| 30186 |
key: "availability", |
| 30187 |
children: /*#__PURE__*/UpdateMeeting_React.createElement(SecondStep/* default */.Z, { |
| 30188 |
onFinishFailed: onFinishFailed, |
| 30189 |
saveUpdate: onFinish, |
| 30190 |
current: current, |
| 30191 |
setCurrent: setCurrent |
| 30192 |
}) |
| 30193 |
} |
| 30194 |
// { |
| 30195 |
// label: __("Notifications", "timetics"), |
| 30196 |
// key: "notifications", |
| 30197 |
// children: <Notification />, |
| 30198 |
// }, |
| 30199 |
// { |
| 30200 |
// label: __("Customize fields", "timetics"), |
| 30201 |
// key: "customfields", |
| 30202 |
// children: <h1>Customize fields</h1>, |
| 30203 |
// }, |
| 30204 |
]; |
| 30205 |
|
| 30206 |
if (loading) { |
| 30207 |
return /*#__PURE__*/UpdateMeeting_React.createElement(Spinner/* default */.Z, { |
| 30208 |
tip: UpdateMeeting_("Loading...", "timetics"), |
| 30209 |
msg: UpdateMeeting_("Please Wait.", "timetics"), |
| 30210 |
desc: UpdateMeeting_("Loader will vanish after all data load.", "timetics"), |
| 30211 |
type: "info", |
| 30212 |
size: "large", |
| 30213 |
wrapperClassName: "tt-spinner-wrapper" |
| 30214 |
}); |
| 30215 |
} |
| 30216 |
return /*#__PURE__*/UpdateMeeting_React.createElement(UpdateMeeting_React.Fragment, null, /*#__PURE__*/UpdateMeeting_React.createElement("div", { |
| 30217 |
className: "tt-container-wrapper" |
| 30218 |
}, /*#__PURE__*/UpdateMeeting_React.createElement(UpdateMeeting_Title, { |
| 30219 |
level: 3, |
| 30220 |
className: "tt-meeting-type" |
| 30221 |
}, meetingTitle), /*#__PURE__*/UpdateMeeting_React.createElement("div", { |
| 30222 |
className: "tt-form-container" |
| 30223 |
}, /*#__PURE__*/UpdateMeeting_React.createElement(Tabs, { |
| 30224 |
defaultActiveKey: "general", |
| 30225 |
size: "large", |
| 30226 |
items: tabsData |
| 30227 |
})))); |
| 30228 |
} |
| 30229 |
/* harmony default export */ const meeting_UpdateMeeting = (UpdateMeeting); |
| 30230 |
// EXTERNAL MODULE: ./assets/src/admin/components/MainPageHeader.js |
| 30231 |
var MainPageHeader = __webpack_require__(8494); |
| 30232 |
// EXTERNAL MODULE: ./assets/src/common/icons/Icons.js |
| 30233 |
var Icons = __webpack_require__(2751); |
| 30234 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/shortcodes/BookingForm.js |
| 30235 |
function BookingForm_typeof(obj) { "@babel/helpers - typeof"; return BookingForm_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BookingForm_typeof(obj); } |
| 30236 |
function BookingForm_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ BookingForm_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == BookingForm_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
| 30237 |
function BookingForm_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
| 30238 |
function BookingForm_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { BookingForm_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { BookingForm_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
| 30239 |
function BookingForm_slicedToArray(arr, i) { return BookingForm_arrayWithHoles(arr) || BookingForm_iterableToArrayLimit(arr, i) || BookingForm_unsupportedIterableToArray(arr, i) || BookingForm_nonIterableRest(); } |
| 30240 |
function BookingForm_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 30241 |
function BookingForm_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return BookingForm_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 BookingForm_arrayLikeToArray(o, minLen); } |
| 30242 |
function BookingForm_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; } |
| 30243 |
function BookingForm_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 30244 |
function BookingForm_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 30245 |
var BookingForm_window$React = window.React, |
| 30246 |
BookingForm_useState = BookingForm_window$React.useState, |
| 30247 |
BookingForm_useEffect = BookingForm_window$React.useEffect; |
| 30248 |
|
| 30249 |
var BookingForm_window$antd = window.antd, |
| 30250 |
Skeleton = BookingForm_window$antd.Skeleton, |
| 30251 |
BookingForm_Form = BookingForm_window$antd.Form, |
| 30252 |
BookingForm_Button = BookingForm_window$antd.Button, |
| 30253 |
message = BookingForm_window$antd.message; |
| 30254 |
var BookingForm_ = wp.i18n.__; |
| 30255 |
|
| 30256 |
|
| 30257 |
|
| 30258 |
|
| 30259 |
function BookingForm() { |
| 30260 |
var _useState = BookingForm_useState(false), |
| 30261 |
_useState2 = BookingForm_slicedToArray(_useState, 2), |
| 30262 |
loading = _useState2[0], |
| 30263 |
setLoading = _useState2[1]; |
| 30264 |
var _useState3 = BookingForm_useState(), |
| 30265 |
_useState4 = BookingForm_slicedToArray(_useState3, 2), |
| 30266 |
meetingData = _useState4[0], |
| 30267 |
setMeetingData = _useState4[1]; |
| 30268 |
var _useState5 = BookingForm_useState(), |
| 30269 |
_useState6 = BookingForm_slicedToArray(_useState5, 2), |
| 30270 |
meetingId = _useState6[0], |
| 30271 |
setMeetingId = _useState6[1]; |
| 30272 |
var _useState7 = BookingForm_useState(false), |
| 30273 |
_useState8 = BookingForm_slicedToArray(_useState7, 2), |
| 30274 |
enableField = _useState8[0], |
| 30275 |
setEnableField = _useState8[1]; |
| 30276 |
|
| 30277 |
/** |
| 30278 |
* fetch meetings to call api |
| 30279 |
* @param {number} per_page posts per pages |
| 30280 |
* @param {number} page page number |
| 30281 |
*/ |
| 30282 |
var fetchMeetingList = /*#__PURE__*/function () { |
| 30283 |
var _ref = BookingForm_asyncToGenerator( /*#__PURE__*/BookingForm_regeneratorRuntime().mark(function _callee(per_page, page) { |
| 30284 |
var res; |
| 30285 |
return BookingForm_regeneratorRuntime().wrap(function _callee$(_context) { |
| 30286 |
while (1) { |
| 30287 |
switch (_context.prev = _context.next) { |
| 30288 |
case 0: |
| 30289 |
_context.next = 2; |
| 30290 |
return (0,meetings/* getAllMeetings */.MY)({ |
| 30291 |
method: "GET", |
| 30292 |
params: { |
| 30293 |
per_page: per_page, |
| 30294 |
paged: page |
| 30295 |
} |
| 30296 |
}); |
| 30297 |
case 2: |
| 30298 |
res = _context.sent; |
| 30299 |
return _context.abrupt("return", res); |
| 30300 |
case 4: |
| 30301 |
case "end": |
| 30302 |
return _context.stop(); |
| 30303 |
} |
| 30304 |
} |
| 30305 |
}, _callee); |
| 30306 |
})); |
| 30307 |
return function fetchMeetingList(_x, _x2) { |
| 30308 |
return _ref.apply(this, arguments); |
| 30309 |
}; |
| 30310 |
}(); |
| 30311 |
BookingForm_useEffect(function () { |
| 30312 |
var loadData = /*#__PURE__*/function () { |
| 30313 |
var _ref2 = BookingForm_asyncToGenerator( /*#__PURE__*/BookingForm_regeneratorRuntime().mark(function _callee2() { |
| 30314 |
var _res$data, _res$data$data; |
| 30315 |
var res, items; |
| 30316 |
return BookingForm_regeneratorRuntime().wrap(function _callee2$(_context2) { |
| 30317 |
while (1) { |
| 30318 |
switch (_context2.prev = _context2.next) { |
| 30319 |
case 0: |
| 30320 |
_context2.next = 2; |
| 30321 |
return fetchMeetingList(-1, 1); |
| 30322 |
case 2: |
| 30323 |
res = _context2.sent; |
| 30324 |
items = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$data = _res$data.data) === null || _res$data$data === void 0 ? void 0 : _res$data$data.items; |
| 30325 |
setMeetingData(items); |
| 30326 |
case 5: |
| 30327 |
case "end": |
| 30328 |
return _context2.stop(); |
| 30329 |
} |
| 30330 |
} |
| 30331 |
}, _callee2); |
| 30332 |
})); |
| 30333 |
return function loadData() { |
| 30334 |
return _ref2.apply(this, arguments); |
| 30335 |
}; |
| 30336 |
}(); |
| 30337 |
loadData(); |
| 30338 |
return function () {}; |
| 30339 |
}, []); |
| 30340 |
|
| 30341 |
/** |
| 30342 |
* On finish method that can handle staff create |
| 30343 |
* @param {Object} values |
| 30344 |
*/ |
| 30345 |
var onFinish = /*#__PURE__*/function () { |
| 30346 |
var _ref3 = BookingForm_asyncToGenerator( /*#__PURE__*/BookingForm_regeneratorRuntime().mark(function _callee3(values) { |
| 30347 |
return BookingForm_regeneratorRuntime().wrap(function _callee3$(_context3) { |
| 30348 |
while (1) { |
| 30349 |
switch (_context3.prev = _context3.next) { |
| 30350 |
case 0: |
| 30351 |
setMeetingId(values === null || values === void 0 ? void 0 : values.meeting); |
| 30352 |
setEnableField(true); |
| 30353 |
case 2: |
| 30354 |
case "end": |
| 30355 |
return _context3.stop(); |
| 30356 |
} |
| 30357 |
} |
| 30358 |
}, _callee3); |
| 30359 |
})); |
| 30360 |
return function onFinish(_x3) { |
| 30361 |
return _ref3.apply(this, arguments); |
| 30362 |
}; |
| 30363 |
}(); |
| 30364 |
var copyToClipBored = function copyToClipBored(e) { |
| 30365 |
navigator.clipboard.writeText("[timetics-booking-form id=".concat(meetingId, "]")); |
| 30366 |
message.success({ |
| 30367 |
content: "Copied the shortcode", |
| 30368 |
style: { |
| 30369 |
marginTop: "5vh" |
| 30370 |
} |
| 30371 |
}); |
| 30372 |
}; |
| 30373 |
return /*#__PURE__*/React.createElement(BookingForm_Form, { |
| 30374 |
layout: "vertical", |
| 30375 |
autoComplete: "off", |
| 30376 |
onFinish: onFinish |
| 30377 |
}, /*#__PURE__*/React.createElement(common_SelectInput/* default */.Z, { |
| 30378 |
label: BookingForm_("Select Meeting", "timetics"), |
| 30379 |
key: "meeeting", |
| 30380 |
options: meetingData, |
| 30381 |
fieldNames: { |
| 30382 |
label: "name", |
| 30383 |
value: "id" |
| 30384 |
}, |
| 30385 |
name: "meeting", |
| 30386 |
showSearch: true, |
| 30387 |
allowClear: true, |
| 30388 |
placeholder: BookingForm_("Please Select Your Meeting", "timetics"), |
| 30389 |
filterOption: function filterOption(input, option) { |
| 30390 |
var _option$name; |
| 30391 |
return ((_option$name = option === null || option === void 0 ? void 0 : option.name) !== null && _option$name !== void 0 ? _option$name : "").includes(input); |
| 30392 |
}, |
| 30393 |
rules: [{ |
| 30394 |
required: true, |
| 30395 |
message: BookingForm_("Meeting title is required", "timetics") |
| 30396 |
}] |
| 30397 |
}), /*#__PURE__*/React.createElement(BookingForm_Button, { |
| 30398 |
type: "primary", |
| 30399 |
htmlType: "submit", |
| 30400 |
size: "large", |
| 30401 |
className: "tt-mb-20", |
| 30402 |
loading: loading |
| 30403 |
}, BookingForm_("Generate Shortcode", "timetics")), enableField && /*#__PURE__*/React.createElement("div", { |
| 30404 |
onClick: copyToClipBored, |
| 30405 |
style: { |
| 30406 |
cursor: "pointer" |
| 30407 |
} |
| 30408 |
}, /*#__PURE__*/React.createElement(common_TextInput/* default */.Z, { |
| 30409 |
type: "text", |
| 30410 |
size: "middle", |
| 30411 |
readOnly: true, |
| 30412 |
addonAfter: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icons/* CloneIcon */.Qr, { |
| 30413 |
color: "#3161F1", |
| 30414 |
height: "25", |
| 30415 |
width: "25" |
| 30416 |
})), |
| 30417 |
value: "[timetics-booking-form id=".concat(meetingId, "]"), |
| 30418 |
tooltip: BookingForm_("Copy the shortcode and paste where you want to show booking form", "timetics") |
| 30419 |
}))); |
| 30420 |
} |
| 30421 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/shortcodes/MeetingList.js |
| 30422 |
function MeetingList_typeof(obj) { "@babel/helpers - typeof"; return MeetingList_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MeetingList_typeof(obj); } |
| 30423 |
function MeetingList_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ MeetingList_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == MeetingList_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
| 30424 |
function MeetingList_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
| 30425 |
function MeetingList_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { MeetingList_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { MeetingList_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
| 30426 |
function MeetingList_slicedToArray(arr, i) { return MeetingList_arrayWithHoles(arr) || MeetingList_iterableToArrayLimit(arr, i) || MeetingList_unsupportedIterableToArray(arr, i) || MeetingList_nonIterableRest(); } |
| 30427 |
function MeetingList_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 30428 |
function MeetingList_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return MeetingList_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 MeetingList_arrayLikeToArray(o, minLen); } |
| 30429 |
function MeetingList_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; } |
| 30430 |
function MeetingList_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 30431 |
function MeetingList_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 30432 |
var MeetingList_window$React = window.React, |
| 30433 |
MeetingList_useState = MeetingList_window$React.useState, |
| 30434 |
MeetingList_useEffect = MeetingList_window$React.useEffect; |
| 30435 |
var MeetingList_window$antd = window.antd, |
| 30436 |
MeetingList_Skeleton = MeetingList_window$antd.Skeleton, |
| 30437 |
MeetingList_Form = MeetingList_window$antd.Form, |
| 30438 |
MeetingList_Button = MeetingList_window$antd.Button, |
| 30439 |
MeetingList_message = MeetingList_window$antd.message; |
| 30440 |
var MeetingList_ = wp.i18n.__; |
| 30441 |
|
| 30442 |
|
| 30443 |
|
| 30444 |
|
| 30445 |
function MeetingList() { |
| 30446 |
var _useState = MeetingList_useState(false), |
| 30447 |
_useState2 = MeetingList_slicedToArray(_useState, 2), |
| 30448 |
loading = _useState2[0], |
| 30449 |
setLoading = _useState2[1]; |
| 30450 |
var _useState3 = MeetingList_useState(), |
| 30451 |
_useState4 = MeetingList_slicedToArray(_useState3, 2), |
| 30452 |
meetingLimit = _useState4[0], |
| 30453 |
setMeetingLimit = _useState4[1]; |
| 30454 |
var _useState5 = MeetingList_useState(false), |
| 30455 |
_useState6 = MeetingList_slicedToArray(_useState5, 2), |
| 30456 |
enableField = _useState6[0], |
| 30457 |
setEnableField = _useState6[1]; |
| 30458 |
/** |
| 30459 |
* On finish method that can handle staff create |
| 30460 |
* @param {Object} values |
| 30461 |
*/ |
| 30462 |
var onFinish = /*#__PURE__*/function () { |
| 30463 |
var _ref = MeetingList_asyncToGenerator( /*#__PURE__*/MeetingList_regeneratorRuntime().mark(function _callee(values) { |
| 30464 |
return MeetingList_regeneratorRuntime().wrap(function _callee$(_context) { |
| 30465 |
while (1) { |
| 30466 |
switch (_context.prev = _context.next) { |
| 30467 |
case 0: |
| 30468 |
setMeetingLimit(values === null || values === void 0 ? void 0 : values.limit); |
| 30469 |
setEnableField(true); |
| 30470 |
case 2: |
| 30471 |
case "end": |
| 30472 |
return _context.stop(); |
| 30473 |
} |
| 30474 |
} |
| 30475 |
}, _callee); |
| 30476 |
})); |
| 30477 |
return function onFinish(_x) { |
| 30478 |
return _ref.apply(this, arguments); |
| 30479 |
}; |
| 30480 |
}(); |
| 30481 |
var copyToClipBored = function copyToClipBored(e) { |
| 30482 |
navigator.clipboard.writeText("[timetics-meeting-list limit=".concat(meetingLimit, "]")); |
| 30483 |
MeetingList_message.success({ |
| 30484 |
content: "Copied the shortcode", |
| 30485 |
style: { |
| 30486 |
marginTop: "5vh" |
| 30487 |
} |
| 30488 |
}); |
| 30489 |
}; |
| 30490 |
return /*#__PURE__*/React.createElement(MeetingList_Form, { |
| 30491 |
layout: "vertical", |
| 30492 |
autoComplete: "off", |
| 30493 |
initialValues: { |
| 30494 |
limit: "5" |
| 30495 |
}, |
| 30496 |
onFinish: onFinish |
| 30497 |
}, /*#__PURE__*/React.createElement(common_TextInput/* default */.Z, { |
| 30498 |
label: MeetingList_("Meeting Limit", "timetics"), |
| 30499 |
name: "limit", |
| 30500 |
type: "number", |
| 30501 |
size: "middle" |
| 30502 |
}), /*#__PURE__*/React.createElement(MeetingList_Button, { |
| 30503 |
type: "primary", |
| 30504 |
htmlType: "submit", |
| 30505 |
size: "large", |
| 30506 |
className: "tt-mb-20", |
| 30507 |
loading: loading |
| 30508 |
}, MeetingList_("Generate Shortcode", "timetics")), enableField && /*#__PURE__*/React.createElement("div", { |
| 30509 |
onClick: copyToClipBored, |
| 30510 |
style: { |
| 30511 |
cursor: "pointer" |
| 30512 |
} |
| 30513 |
}, /*#__PURE__*/React.createElement(common_TextInput/* default */.Z, { |
| 30514 |
type: "text", |
| 30515 |
size: "middle", |
| 30516 |
readOnly: true, |
| 30517 |
addonAfter: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icons/* CloneIcon */.Qr, { |
| 30518 |
color: "#3161F1", |
| 30519 |
height: "25", |
| 30520 |
width: "25" |
| 30521 |
})), |
| 30522 |
value: "[timetics-meeting-list limit=".concat(meetingLimit, "]") |
| 30523 |
}))); |
| 30524 |
} |
| 30525 |
;// CONCATENATED MODULE: ./assets/src/admin/pages/shortcodes/index.js |
| 30526 |
function shortcodes_slicedToArray(arr, i) { return shortcodes_arrayWithHoles(arr) || shortcodes_iterableToArrayLimit(arr, i) || shortcodes_unsupportedIterableToArray(arr, i) || shortcodes_nonIterableRest(); } |
| 30527 |
function shortcodes_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
| 30528 |
function shortcodes_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return shortcodes_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 shortcodes_arrayLikeToArray(o, minLen); } |
| 30529 |
function shortcodes_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; } |
| 30530 |
function shortcodes_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } |
| 30531 |
function shortcodes_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 30532 |
var shortcodes_window$React = window.React, |
| 30533 |
shortcodes_useState = shortcodes_window$React.useState, |
| 30534 |
shortcodes_useEffect = shortcodes_window$React.useEffect; |
| 30535 |
|
| 30536 |
|
| 30537 |
|
| 30538 |
var shortcodes_window$antd = window.antd, |
| 30539 |
shortcodes_Skeleton = shortcodes_window$antd.Skeleton, |
| 30540 |
shortcodes_Form = shortcodes_window$antd.Form, |
| 30541 |
shortcodes_Button = shortcodes_window$antd.Button, |
| 30542 |
shortcodes_message = shortcodes_window$antd.message, |
| 30543 |
shortcodes_Collapse = shortcodes_window$antd.Collapse, |
| 30544 |
shortcodes_Typography = shortcodes_window$antd.Typography; |
| 30545 |
var shortcodes_Title = shortcodes_Typography.Title; |
| 30546 |
var shortcodes_Panel = shortcodes_Collapse.Panel; |
| 30547 |
var shortcodes_ = wp.i18n.__; |
| 30548 |
/** |
| 30549 |
* Get shortcodes |
| 30550 |
*/ |
| 30551 |
function Shortcodes() { |
| 30552 |
var _useState = shortcodes_useState(false), |
| 30553 |
_useState2 = shortcodes_slicedToArray(_useState, 2), |
| 30554 |
loading = _useState2[0], |
| 30555 |
setLoading = _useState2[1]; |
| 30556 |
return /*#__PURE__*/React.createElement(React.Fragment, null, loading ? /*#__PURE__*/React.createElement(shortcodes_Skeleton, { |
| 30557 |
active: true |
| 30558 |
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MainPageHeader/* default */.Z, { |
| 30559 |
title: shortcodes_("Shortcodes", "timetics") |
| 30560 |
})), /*#__PURE__*/React.createElement("div", { |
| 30561 |
className: "tt-shortcode-list tt-container-wrapper mb-30" |
| 30562 |
}, /*#__PURE__*/React.createElement("div", { |
| 30563 |
className: "tt-form-container" |
| 30564 |
}, /*#__PURE__*/React.createElement(shortcodes_Title, { |
| 30565 |
level: 4, |
| 30566 |
className: "tt-mt-0" |
| 30567 |
}, shortcodes_("Get booking form shortcode", "timetics")), /*#__PURE__*/React.createElement(shortcodes_Collapse, { |
| 30568 |
accordion: true, |
| 30569 |
expandIconPosition: "end", |
| 30570 |
className: "tt-mb-30", |
| 30571 |
defaultActiveKey: ["booking-form"] |
| 30572 |
}, /*#__PURE__*/React.createElement(shortcodes_Panel, { |
| 30573 |
header: shortcodes_("Booking form", "timetics"), |
| 30574 |
key: "booking-form" |
| 30575 |
}, /*#__PURE__*/React.createElement(BookingForm, null))), /*#__PURE__*/React.createElement(shortcodes_Title, { |
| 30576 |
level: 4, |
| 30577 |
className: "tt-mt-0" |
| 30578 |
}, shortcodes_("Get meeting list shortcode", "timetics")), /*#__PURE__*/React.createElement(shortcodes_Collapse, { |
| 30579 |
accordion: true, |
| 30580 |
expandIconPosition: "end", |
| 30581 |
defaultActiveKey: ["meeting-list"] |
| 30582 |
}, /*#__PURE__*/React.createElement(shortcodes_Panel, { |
| 30583 |
header: shortcodes_("Meeting List", "timetics"), |
| 30584 |
key: "meeting-list" |
| 30585 |
}, /*#__PURE__*/React.createElement(MeetingList, null))))))); |
| 30586 |
} |
| 30587 |
/* harmony default export */ const shortcodes = (Shortcodes); |
| 30588 |
;// CONCATENATED MODULE: ./assets/src/admin/router.js |
| 30589 |
|
| 30590 |
|
| 30591 |
|
| 30592 |
var Overview = React.lazy(function () { |
| 30593 |
return __webpack_require__.e(/* import() */ 226).then(__webpack_require__.bind(__webpack_require__, 3226)); |
| 30594 |
}); |
| 30595 |
var Staff = React.lazy(function () { |
| 30596 |
return Promise.all(/* import() */[__webpack_require__.e(764), __webpack_require__.e(251)]).then(__webpack_require__.bind(__webpack_require__, 9251)); |
| 30597 |
}); |
| 30598 |
var StaffList = React.lazy(function () { |
| 30599 |
return Promise.all(/* import() */[__webpack_require__.e(582), __webpack_require__.e(179)]).then(__webpack_require__.bind(__webpack_require__, 1179)); |
| 30600 |
}); |
| 30601 |
var CreateStaff = React.lazy(function () { |
| 30602 |
return Promise.all(/* import() */[__webpack_require__.e(764), __webpack_require__.e(808), __webpack_require__.e(623)]).then(__webpack_require__.bind(__webpack_require__, 1623)); |
| 30603 |
}); |
| 30604 |
var UpdateStaff = React.lazy(function () { |
| 30605 |
return Promise.all(/* import() */[__webpack_require__.e(764), __webpack_require__.e(808), __webpack_require__.e(434)]).then(__webpack_require__.bind(__webpack_require__, 5434)); |
| 30606 |
}); |
| 30607 |
var Meeting = React.lazy(function () { |
| 30608 |
return Promise.all(/* import() */[__webpack_require__.e(764), __webpack_require__.e(20), __webpack_require__.e(165)]).then(__webpack_require__.bind(__webpack_require__, 4165)); |
| 30609 |
}); |
| 30610 |
var Settings = React.lazy(function () { |
| 30611 |
return Promise.all(/* import() */[__webpack_require__.e(764), __webpack_require__.e(90)]).then(__webpack_require__.bind(__webpack_require__, 2090)); |
| 30612 |
}); |
| 30613 |
var Customers = React.lazy(function () { |
| 30614 |
return __webpack_require__.e(/* import() */ 678).then(__webpack_require__.bind(__webpack_require__, 1678)); |
| 30615 |
}); |
| 30616 |
var CustomerList = React.lazy(function () { |
| 30617 |
return Promise.all(/* import() */[__webpack_require__.e(582), __webpack_require__.e(121)]).then(__webpack_require__.bind(__webpack_require__, 3121)); |
| 30618 |
}); |
| 30619 |
var Bookings = React.lazy(function () { |
| 30620 |
return __webpack_require__.e(/* import() */ 621).then(__webpack_require__.bind(__webpack_require__, 4621)); |
| 30621 |
}); |
| 30622 |
var CreateBooking = React.lazy(function () { |
| 30623 |
return Promise.all(/* import() */[__webpack_require__.e(13), __webpack_require__.e(123), __webpack_require__.e(133)]).then(__webpack_require__.bind(__webpack_require__, 7133)); |
| 30624 |
}); |
| 30625 |
var EditBooking = React.lazy(function () { |
| 30626 |
return Promise.all(/* import() */[__webpack_require__.e(13), __webpack_require__.e(123), __webpack_require__.e(463)]).then(__webpack_require__.bind(__webpack_require__, 3463)); |
| 30627 |
}); |
| 30628 |
var BookingLists = React.lazy(function () { |
| 30629 |
return Promise.all(/* import() */[__webpack_require__.e(13), __webpack_require__.e(582), __webpack_require__.e(223)]).then(__webpack_require__.bind(__webpack_require__, 5223)); |
| 30630 |
}); |
| 30631 |
var CreateMeeting = React.lazy(function () { |
| 30632 |
return Promise.all(/* import() */[__webpack_require__.e(20), __webpack_require__.e(458)]).then(__webpack_require__.bind(__webpack_require__, 4458)); |
| 30633 |
}); |
| 30634 |
var router_MeetingList = React.lazy(function () { |
| 30635 |
return Promise.all(/* import() */[__webpack_require__.e(20), __webpack_require__.e(377)]).then(__webpack_require__.bind(__webpack_require__, 5377)); |
| 30636 |
}); |
| 30637 |
var applyFilters = wp.hooks.applyFilters; |
| 30638 |
var routerList = [{ |
| 30639 |
path: "/", |
| 30640 |
element: /*#__PURE__*/React.createElement(Overview, null) |
| 30641 |
}, { |
| 30642 |
path: "meetings", |
| 30643 |
element: /*#__PURE__*/React.createElement(Meeting, null), |
| 30644 |
children: [{ |
| 30645 |
path: "", |
| 30646 |
element: /*#__PURE__*/React.createElement(router_MeetingList, null) |
| 30647 |
// loader: teamLoader, |
| 30648 |
}, { |
| 30649 |
path: "create-new", |
| 30650 |
element: /*#__PURE__*/React.createElement(CreateMeeting, null) |
| 30651 |
// loader: teamLoader, |
| 30652 |
}, { |
| 30653 |
path: "update", |
| 30654 |
element: /*#__PURE__*/React.createElement(meeting_UpdateMeeting, null) |
| 30655 |
// loader: teamLoader, |
| 30656 |
}] |
| 30657 |
}, { |
| 30658 |
path: "/staff", |
| 30659 |
element: /*#__PURE__*/React.createElement(Staff, null), |
| 30660 |
children: [{ |
| 30661 |
path: "", |
| 30662 |
element: /*#__PURE__*/React.createElement(StaffList, null) |
| 30663 |
}, { |
| 30664 |
path: "create-new", |
| 30665 |
element: /*#__PURE__*/React.createElement(CreateStaff, null) |
| 30666 |
}, { |
| 30667 |
path: "update", |
| 30668 |
element: /*#__PURE__*/React.createElement(UpdateStaff, { |
| 30669 |
staffPage: true |
| 30670 |
}) |
| 30671 |
}] |
| 30672 |
}, { |
| 30673 |
path: "/bookings", |
| 30674 |
element: /*#__PURE__*/React.createElement(Bookings, null), |
| 30675 |
children: [{ |
| 30676 |
path: "", |
| 30677 |
element: /*#__PURE__*/React.createElement(BookingLists, null) |
| 30678 |
}, { |
| 30679 |
path: "create-new", |
| 30680 |
element: /*#__PURE__*/React.createElement(CreateBooking, null) |
| 30681 |
}, { |
| 30682 |
path: "update", |
| 30683 |
element: /*#__PURE__*/React.createElement(EditBooking, null) |
| 30684 |
}] |
| 30685 |
}, { |
| 30686 |
path: "/customers", |
| 30687 |
element: /*#__PURE__*/React.createElement(Customers, null), |
| 30688 |
children: [{ |
| 30689 |
path: "", |
| 30690 |
element: /*#__PURE__*/React.createElement(CustomerList, null) |
| 30691 |
}] |
| 30692 |
}, { |
| 30693 |
path: "/settings", |
| 30694 |
element: /*#__PURE__*/React.createElement(Settings, null) |
| 30695 |
}, { |
| 30696 |
path: "/my-profile", |
| 30697 |
element: /*#__PURE__*/React.createElement(UpdateStaff, { |
| 30698 |
staffPage: false |
| 30699 |
}) |
| 30700 |
}, { |
| 30701 |
path: "/shortcodes", |
| 30702 |
element: /*#__PURE__*/React.createElement(shortcodes, null) |
| 30703 |
}]; |
| 30704 |
var routerLists = applyFilters("timetics_router", routerList, { |
| 30705 |
Outlet: dist/* Outlet */.j3, |
| 30706 |
useNavigate: dist/* useNavigate */.s0, |
| 30707 |
useSearchParams: react_router_dom_dist/* useSearchParams */.lr, |
| 30708 |
useParams: dist/* useParams */.UO |
| 30709 |
}); |
| 30710 |
var router = (0,react_router_dom_dist/* createHashRouter */.cP)(routerLists); |
| 30711 |
/* harmony default export */ const admin_router = (router); |
| 30712 |
;// CONCATENATED MODULE: ./assets/src/admin/app.js |
| 30713 |
var app_React = window.React; |
| 30714 |
var Suspense = app_React.Suspense, |
| 30715 |
app_useEffect = app_React.useEffect; |
| 30716 |
var app_ = wp.i18n.__; |
| 30717 |
|
| 30718 |
|
| 30719 |
|
| 30720 |
|
| 30721 |
var App = function App() { |
| 30722 |
return /*#__PURE__*/app_React.createElement(provider/* default */.Z, null, /*#__PURE__*/app_React.createElement(Suspense, { |
| 30723 |
fallback: /*#__PURE__*/app_React.createElement(Spinner/* default */.Z, { |
| 30724 |
tip: app_("Loading...", "timetics"), |
| 30725 |
msg: app_("Please Wait.", "timetics"), |
| 30726 |
desc: app_("Loader will vanish after the page load.", "timetics"), |
| 30727 |
type: "info", |
| 30728 |
size: "large", |
| 30729 |
wrapperClassName: "tt-spinner-wrapper" |
| 30730 |
}) |
| 30731 |
}, /*#__PURE__*/app_React.createElement(dist/* RouterProvider */.pG, { |
| 30732 |
router: admin_router |
| 30733 |
}))); |
| 30734 |
}; |
| 30735 |
/* harmony default export */ const app = (App); |
| 30736 |
;// CONCATENATED MODULE: ./assets/src/admin/utils/admin-menu.js |
| 30737 |
/** |
| 30738 |
* As we are using hash based navigation, hack fix |
| 30739 |
* to highlight the current selected menu |
| 30740 |
* |
| 30741 |
* Requires jQuery |
| 30742 |
*/ |
| 30743 |
function menuFix(slug) { |
| 30744 |
var $ = jQuery; |
| 30745 |
var menuRoot = $('#toplevel_page_' + slug); |
| 30746 |
var currentUrl = window.location.href; |
| 30747 |
var currentPath = currentUrl.substr(currentUrl.indexOf('admin.php')); |
| 30748 |
menuRoot.on('click', 'a', function () { |
| 30749 |
var self = $(this); |
| 30750 |
$('ul.wp-submenu li', menuRoot).removeClass('current'); |
| 30751 |
if (self.hasClass('wp-has-submenu')) { |
| 30752 |
$('li.wp-first-item', menuRoot).addClass('current'); |
| 30753 |
} else { |
| 30754 |
self.parents('li').addClass('current'); |
| 30755 |
} |
| 30756 |
}); |
| 30757 |
$('ul.wp-submenu a', menuRoot).each(function (index, el) { |
| 30758 |
if ($(el).attr('href') === currentPath) { |
| 30759 |
$(el).parent().addClass('current'); |
| 30760 |
return; |
| 30761 |
} |
| 30762 |
}); |
| 30763 |
} |
| 30764 |
/* harmony default export */ const admin_menu = (menuFix); |
| 30765 |
;// CONCATENATED MODULE: ./assets/src/admin/index.js |
| 30766 |
var admin_React = window.React; |
| 30767 |
var ReactDOM = window.ReactDOM; |
| 30768 |
|
| 30769 |
|
| 30770 |
var root = ReactDOM.createRoot(document.getElementById("time_tics_dashboard")); |
| 30771 |
if (root) { |
| 30772 |
root.render( /*#__PURE__*/admin_React.createElement(app, null)); |
| 30773 |
} |
| 30774 |
admin_menu("timetics"); |
| 30775 |
;// CONCATENATED MODULE: ./assets/src/dashboard.js |
| 30776 |
|
| 30777 |
})(); |
| 30778 |
|
| 30779 |
/******/ })() |
| 30780 |
; |