From 9d82a668a4a8a2762d8f1f6a9754234a99888313 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 6 Jan 2025 15:54:16 -0500 Subject: [PATCH] Release v4.2.0 --- .../ISSUE_TEMPLATE/01-feature_request.yaml | 2 +- .github/ISSUE_TEMPLATE/02-bug_report.yaml | 2 +- docs/development/release-checklist.md | 8 +- docs/release-notes/version-4.2.md | 5 +- mkdocs.yml | 1 + .../dist/graphiql/graphiql.min.js | 128178 ++++++++------- netbox/project-static/dist/netbox.js | 6 +- netbox/project-static/dist/netbox.js.map | 4 +- .../netbox-graphiql/package.json | 6 +- netbox/project-static/package.json | 4 +- netbox/project-static/yarn.lock | 66 +- netbox/translations/fr/LC_MESSAGES/django.mo | Bin 237343 -> 237945 bytes netbox/translations/fr/LC_MESSAGES/django.po | 244 +- requirements.txt | 2 +- 14 files changed, 66929 insertions(+), 61599 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01-feature_request.yaml b/.github/ISSUE_TEMPLATE/01-feature_request.yaml index cb39ae9be9b..7cb6057eaea 100644 --- a/.github/ISSUE_TEMPLATE/01-feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/01-feature_request.yaml @@ -14,7 +14,7 @@ body: attributes: label: NetBox version description: What version of NetBox are you currently running? - placeholder: v4.1.11 + placeholder: v4.2.0 validations: required: true - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/02-bug_report.yaml b/.github/ISSUE_TEMPLATE/02-bug_report.yaml index e42ff304536..e2145543d5d 100644 --- a/.github/ISSUE_TEMPLATE/02-bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/02-bug_report.yaml @@ -39,7 +39,7 @@ body: attributes: label: NetBox Version description: What version of NetBox are you currently running? - placeholder: v4.1.11 + placeholder: v4.2.0 validations: required: true - type: dropdown diff --git a/docs/development/release-checklist.md b/docs/development/release-checklist.md index 557d01671b7..c74fcf8f603 100644 --- a/docs/development/release-checklist.md +++ b/docs/development/release-checklist.md @@ -120,15 +120,9 @@ Then, compile these portable (`.po`) files for use in the application: * Update the example version numbers in the feature request and bug report templates under `.github/ISSUE_TEMPLATES/`. * Replace the "FUTURE" placeholder in the release notes with the current date. -Commit these changes to the `main` branch and push upstream. - -### Verify CI Build Status - -Ensure that continuous integration testing on the `main` branch is completing successfully. If it fails, take action to correct the failure before proceeding with the release. - ### Submit a Pull Request -Submit a pull request titled **"Release vX.Y.Z"** to merge the current release branch (e.g. `release-vX.Y.Z`) into `main`. Copy the documented release notes into the pull request's body. +Commit the above changes and submit a pull request titled **"Release vX.Y.Z"** to merge the current release branch (e.g. `release-vX.Y.Z`) into `main`. Copy the documented release notes into the pull request's body. Once CI has completed and a colleague has reviewed the PR, merge it. This effects a new release in the `main` branch. diff --git a/docs/release-notes/version-4.2.md b/docs/release-notes/version-4.2.md index f0ad3766c02..75a7765731b 100644 --- a/docs/release-notes/version-4.2.md +++ b/docs/release-notes/version-4.2.md @@ -1,9 +1,6 @@ # NetBox v4.2 -## v4.2-beta1 (2024-12-02) - -!!! danger "Not for Production Use" - This is a beta release of NetBox intended for testing and evaluation. **Do not use this software in production.** Also be aware that no upgrade path is provided to future releases. +## v4.2.0 (2025-01-06) ### Breaking Changes diff --git a/mkdocs.yml b/mkdocs.yml index f870b69d6e4..db6798eae40 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -176,6 +176,7 @@ nav: - Provider Network: 'models/circuits/providernetwork.md' - Virtual Circuit: 'models/circuits/virtualcircuit.md' - Virtual Circuit Termination: 'models/circuits/virtualcircuittermination.md' + - Virtual Circuit Type: 'models/circuits/virtualcircuittype.md' - Core: - DataFile: 'models/core/datafile.md' - DataSource: 'models/core/datasource.md' diff --git a/netbox/project-static/dist/graphiql/graphiql.min.js b/netbox/project-static/dist/graphiql/graphiql.min.js index 03d4ac1e184..229d3ebe67d 100644 --- a/netbox/project-static/dist/graphiql/graphiql.min.js +++ b/netbox/project-static/dist/graphiql/graphiql.min.js @@ -1,5 +1,4 @@ /******/ (function() { // webpackBootstrap -/******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js": @@ -8,6 +7,7 @@ \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -34,6 +34,7 @@ var _default = exports["default"] = index; \**************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -57,6 +58,7 @@ var _default = exports["default"] = memoize; \****************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -1194,6 +1196,7 @@ exports.size = size; \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -1901,6 +1904,7 @@ exports.computePosition = computePosition; \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2256,6 +2260,7 @@ function useFloating(options) { \***********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2432,6 +2437,7 @@ exports.Animation = Animation; \*******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2460,6 +2466,7 @@ var _easingEs = __webpack_require__(/*! ./utils/easing.es.js */ "../../../node_m \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2501,6 +2508,7 @@ function getEasingFunction(definition) { \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2698,6 +2706,7 @@ function animateStyle(element, key, keyframesDefinition, options = {}) { \********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2731,6 +2740,7 @@ function getMotionValue(motionValues, name) { \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2779,6 +2789,7 @@ function animate(elements, keyframes, options = {}) { \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2816,6 +2827,7 @@ const style = exports.style = { \******************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2895,6 +2907,7 @@ const selectFinished = animation => animation.finished; \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2932,6 +2945,7 @@ function registerCssVariable(name) { \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2952,6 +2966,7 @@ exports.cubicBezierAsString = cubicBezierAsString; \***************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -2995,6 +3010,7 @@ for (const key in featureTests) { \************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3015,6 +3031,7 @@ function getStyleName(key) { \*******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3041,6 +3058,7 @@ exports.keyframesList = keyframesList; \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3064,6 +3082,7 @@ exports.getOptions = getOptions; \************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3091,6 +3110,7 @@ function stopAnimation(animation, needsCommit = true) { \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3134,6 +3154,7 @@ function createStyles(keyframes) { \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3161,6 +3182,7 @@ function createStyleString(target = {}) { \********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3253,6 +3275,7 @@ const transformListToString = (template, name) => `${template} ${name}(var(${asT \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3346,6 +3369,7 @@ const isNumberOrNull = value => typeof value !== "string"; \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3364,6 +3388,7 @@ const glide = exports.glide = (0, _createGeneratorEasingEs.createGeneratorEasing \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3382,6 +3407,7 @@ const spring = exports.spring = (0, _createGeneratorEasingEs.createGeneratorEasi \************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3447,6 +3473,7 @@ function inView(elementOrSelector, onStart, { \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3529,6 +3556,7 @@ function resizeElement(target, handler) { \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3571,6 +3599,7 @@ function resizeWindow(callback) { \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3591,6 +3620,7 @@ function resize(a, b) { \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3682,6 +3712,7 @@ function scroll(onScroll, _a = {}) { \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3751,6 +3782,7 @@ function updateScrollInfo(element, info, time) { \************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3807,6 +3839,7 @@ function resolveEdge(edge, length, inset = 0) { \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3884,6 +3917,7 @@ function resolveOffsets(container, info, options) { \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3927,6 +3961,7 @@ function calcInset(element, container) { \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3973,6 +4008,7 @@ function resolveOffset(offset, containerLength, targetLength, targetInset) { \***************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -3994,6 +4030,7 @@ const ScrollOffset = exports.ScrollOffset = { \*****************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4065,6 +4102,7 @@ function scrubAnimation(controls, axisInfo) { \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4204,6 +4242,7 @@ var _styleStringEs = __webpack_require__(/*! ./animate/utils/style-string.es.js \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4241,6 +4280,7 @@ const hover = exports.hover = { \******************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4283,6 +4323,7 @@ const inView = exports.inView = { \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4322,6 +4363,7 @@ const press = exports.press = { \*******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4511,6 +4553,7 @@ function createMotionState(options = {}, parent) { \**************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4548,6 +4591,7 @@ function dispatchViewEvent(element, name, entry) { \*******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4577,6 +4621,7 @@ function shallowCompare(next, prev) { \******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4595,6 +4640,7 @@ function isVariant(definition) { \***********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4618,6 +4664,7 @@ function resolveVariant(definition, variants) { \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4657,6 +4704,7 @@ const fireNext = iterator => iterator.next(); \**********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4869,6 +4917,7 @@ function getValueSequence(name, sequences) { \********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4897,6 +4946,7 @@ function calcNextTime(current, next, prev, labels) { \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4939,6 +4989,7 @@ function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { \***************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4961,6 +5012,7 @@ function compareByTime(a, b) { \******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -4993,6 +5045,7 @@ function resolveElements(elements, selectorCache) { \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5040,6 +5093,7 @@ function resolveOption(option, i, total) { \***********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5102,6 +5156,7 @@ function cubicBezier(mX1, mY1, mX2, mY2) { \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5130,6 +5185,7 @@ var _stepsEs = __webpack_require__(/*! ./steps.es.js */ "../../../node_modules/@ \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5153,6 +5209,7 @@ exports.steps = steps; \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5264,6 +5321,7 @@ exports.glide = glide; \********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5306,6 +5364,7 @@ var _velocityEs = __webpack_require__(/*! ./utils/velocity.es.js */ "../../../no \******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5326,6 +5385,7 @@ const defaults = exports.defaults = { \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5388,6 +5448,7 @@ exports.spring = spring; \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5406,6 +5467,7 @@ exports.calcDampingRatio = calcDampingRatio; \***************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5424,6 +5486,7 @@ function hasReachedTarget(origin, target, current) { \******************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5467,6 +5530,7 @@ function pregenerateKeyframes(generator, toUnit = _utils.noopReturn) { \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5488,6 +5552,7 @@ function calcGeneratorVelocity(resolveValue, t, current) { \*********************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5519,6 +5584,7 @@ exports.MotionValue = MotionValue; \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5540,6 +5606,7 @@ var _MotionValueEs = __webpack_require__(/*! ./MotionValue.es.js */ "../../../no \***************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5563,6 +5630,7 @@ function removeItem(arr, item) { \***************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5580,6 +5648,7 @@ exports.clamp = clamp; \******************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5602,6 +5671,7 @@ const defaults = exports.defaults = { \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5622,6 +5692,7 @@ function getEasingForSegment(easing, i) { \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5780,6 +5851,7 @@ var _wrapEs = __webpack_require__(/*! ./wrap.es.js */ "../../../node_modules/@mo \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5822,6 +5894,7 @@ function interpolate(output, input = (0, _offsetEs.defaultOffset)(output.length) \*************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5840,6 +5913,7 @@ exports.isCubicBezier = isCubicBezier; \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5857,6 +5931,7 @@ exports.isEasingGenerator = isEasingGenerator; \************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5875,6 +5950,7 @@ exports.isEasingList = isEasingList; \*********************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5892,6 +5968,7 @@ exports.isFunction = isFunction; \*******************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5909,6 +5986,7 @@ exports.isNumber = isNumber; \*******************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5926,6 +6004,7 @@ exports.isString = isString; \*************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5943,6 +6022,7 @@ exports.mix = mix; \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5962,6 +6042,7 @@ exports.noopReturn = noopReturn; \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -5992,6 +6073,7 @@ function defaultOffset(length) { \******************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -6009,6 +6091,7 @@ exports.progress = progress; \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -6028,6 +6111,7 @@ const time = exports.time = { \******************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -6052,6 +6136,7 @@ function velocityPerSecond(velocity, frameDuration) { \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -6072,6 +6157,7 @@ exports.wrap = wrap; \********************************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -6214,6 +6300,7 @@ exports.makePushPullAsyncIterableIterator = makePushPullAsyncIterableIterator; \***************************************************************/ /***/ (function(module) { +"use strict"; function $parcel$export(e, n, v, s) { @@ -6242,6 +6329,7 @@ function $1a6a90a521dcd173$export$b9ecd428b558ff10(originalEventHandler, ourEven \*****************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $eQpDd$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -6297,6 +6385,7 @@ const $09f4ad68a9251bc3$export$be92b6f5f03c0fe9 = $09f4ad68a9251bc3$export$21b07 \**********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $hnlpS$react = __webpack_require__(/*! react */ "react"); @@ -6428,6 +6517,7 @@ function $1a96635ec239608b$export$c74125a8e3af6bb2(name) { \************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $dJwbH$react = __webpack_require__(/*! react */ "react"); @@ -6473,6 +6563,7 @@ function $9c2aaba23466b352$export$c7b2cbe3552a0d05(...refs) { \*******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $4O1Ne$react = __webpack_require__(/*! react */ "react"); @@ -6606,6 +6697,7 @@ function $dec3cc0142d4f286$var$composeContextScopes(...scopes) { \******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $aJCrN$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -7041,6 +7133,7 @@ const $f4833395aa1bca1a$export$f39c2d165cd861fe = $f4833395aa1bca1a$export$fba2f \*********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $9g4ps$react = __webpack_require__(/*! react */ "react"); @@ -7083,6 +7176,7 @@ const $cc45c1b701a63adc$export$2881499e37b75b9a = $cc45c1b701a63adc$export$c760c \*****************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $g2vWm$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -7366,6 +7460,7 @@ const $d715e0554b679f1f$export$aecb2ddcb55c95be = $d715e0554b679f1f$export$4d5eb \*************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $7dQ7Q$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -7826,6 +7921,7 @@ const $d1bf075a6b218014$export$6d4de93b380beddf = $d1bf075a6b218014$export$f34ec \************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $cnctE$react = __webpack_require__(/*! react */ "react"); @@ -7881,6 +7977,7 @@ const $71476a6ed7dbbaf3$export$be92b6f5f03c0fe9 = $71476a6ed7dbbaf3$export$ac5b5 \***********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $buum9$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -8186,6 +8283,7 @@ const $2bc01e66e04aa9ed$export$be92b6f5f03c0fe9 = $2bc01e66e04aa9ed$export$20e40 \**************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $47woD$react = __webpack_require__(/*! react */ "react"); @@ -8217,6 +8315,7 @@ function $dc478e4659f630c5$export$f680877a34711e37(deterministicId) { \****************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $cnSS2$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -9284,6 +9383,7 @@ const $213e4d2df823067d$export$6d4de93b380beddf = $213e4d2df823067d$export$e7142 \******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $50Iv9$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -9639,6 +9739,7 @@ const $34310caa050a8d63$export$21b07c8f274aebd5 = $34310caa050a8d63$export$79d62 \******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $amzHf$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -9688,6 +9789,7 @@ const $913a70b877676c16$export$be92b6f5f03c0fe9 = $913a70b877676c16$export$602ea \********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $fnLeV$react = __webpack_require__(/*! react */ "react"); @@ -9829,6 +9931,7 @@ function $a2fa0214bb2735a1$var$getAnimationName(styles) { \*********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $iMixA$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -9927,6 +10030,7 @@ const $c3def6332c2749a6$export$be92b6f5f03c0fe9 = $c3def6332c2749a6$export$250ff \************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $9QJ9Y$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -10180,6 +10284,7 @@ const $0063afae63b3fa70$export$6d08773d2e66f8f2 = $0063afae63b3fa70$export$ab9df \****************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $dAvBt$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -10292,6 +10397,7 @@ const $82dc8d030dec7549$export$be92b6f5f03c0fe9 = $82dc8d030dec7549$export$8c6ed \*******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $iVrL9$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -10873,6 +10979,7 @@ const $c34afbc43c90cc6f$export$21b07c8f274aebd5 = $c34afbc43c90cc6f$export$c27ee \****************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $92muK$react = __webpack_require__(/*! react */ "react"); @@ -10909,6 +11016,7 @@ function $28e03942f763e819$export$25bec8c6f54ee79a(callback) { \**********************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $ijazI$react = __webpack_require__(/*! react */ "react"); @@ -10968,6 +11076,7 @@ function $b84d42d44371bff7$var$useUncontrolledState({ \******************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $b0gz3$react = __webpack_require__(/*! react */ "react"); @@ -11004,6 +11113,7 @@ function $24c84e9f83c4454f$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDoc \*****************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $caHyQ$react = __webpack_require__(/*! react */ "react"); @@ -11034,6 +11144,7 @@ const $ca21affb0542a8a4$export$e5c5a5f917a5871c = Boolean(globalThis === null || \********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $ksDzM$react = __webpack_require__(/*! react */ "react"); @@ -11100,6 +11211,7 @@ function $d2c1d285af17635b$export$1ab7ae714698c4b8(element) { \***************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var $awrN2$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); @@ -11157,6 +11269,7 @@ const $685371e9c20848e2$export$be92b6f5f03c0fe9 = $685371e9c20848e2$export$439d2 \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -11346,6 +11459,7 @@ exports.suppressOthers = suppressOthers; \*************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -11368,11206 +11482,17281 @@ var _default = exports["default"] = clsx; /***/ }), -/***/ "../../../node_modules/copy-to-clipboard/index.js": -/*!********************************************************!*\ - !*** ../../../node_modules/copy-to-clipboard/index.js ***! - \********************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ "../../../node_modules/codemirror/addon/comment/comment.js": +/*!*****************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/comment/comment.js ***! + \*****************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -var deselectCurrent = __webpack_require__(/*! toggle-selection */ "../../../node_modules/toggle-selection/index.js"); -var clipboardToIE11Formatting = { - "text/plain": "Text", - "text/html": "Url", - "default": "Text" -}; -var defaultMessage = "Copy to clipboard: #{key}, Enter"; -function format(message) { - var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C"; - return message.replace(/#{\s*key\s*}/g, copyKey); -} -function copy(text, options) { - var debug, - message, - reselectPrevious, - range, - selection, - mark, - success = false; - if (!options) { - options = {}; +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"));else {} +})(function (CodeMirror) { + "use strict"; + + var noOptions = {}; + var nonWS = /[^\s\u00a0]/; + var Pos = CodeMirror.Pos, + cmp = CodeMirror.cmpPos; + function firstNonWS(str) { + var found = str.search(nonWS); + return found == -1 ? 0 : found; } - debug = options.debug || false; - try { - reselectPrevious = deselectCurrent(); - range = document.createRange(); - selection = document.getSelection(); - mark = document.createElement("span"); - mark.textContent = text; - // avoid screen readers from reading out loud the text - mark.ariaHidden = "true"; - // reset user styles for span element - mark.style.all = "unset"; - // prevents scrolling to the end of the page - mark.style.position = "fixed"; - mark.style.top = 0; - mark.style.clip = "rect(0, 0, 0, 0)"; - // used to preserve spaces and line breaks - mark.style.whiteSpace = "pre"; - // do not inherit user-select (it may be `none`) - mark.style.webkitUserSelect = "text"; - mark.style.MozUserSelect = "text"; - mark.style.msUserSelect = "text"; - mark.style.userSelect = "text"; - mark.addEventListener("copy", function (e) { - e.stopPropagation(); - if (options.format) { - e.preventDefault(); - if (typeof e.clipboardData === "undefined") { - // IE 11 - debug && console.warn("unable to use e.clipboardData"); - debug && console.warn("trying IE specific stuff"); - window.clipboardData.clearData(); - var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"]; - window.clipboardData.setData(format, text); - } else { - // all other browsers - e.clipboardData.clearData(); - e.clipboardData.setData(options.format, text); + CodeMirror.commands.toggleComment = function (cm) { + cm.toggleComment(); + }; + CodeMirror.defineExtension("toggleComment", function (options) { + if (!options) options = noOptions; + var cm = this; + var minLine = Infinity, + ranges = this.listSelections(), + mode = null; + for (var i = ranges.length - 1; i >= 0; i--) { + var from = ranges[i].from(), + to = ranges[i].to(); + if (from.line >= minLine) continue; + if (to.line >= minLine) to = Pos(minLine, 0); + minLine = from.line; + if (mode == null) { + if (cm.uncomment(from, to, options)) mode = "un";else { + cm.lineComment(from, to, options); + mode = "line"; } + } else if (mode == "un") { + cm.uncomment(from, to, options); + } else { + cm.lineComment(from, to, options); } - if (options.onCopy) { - e.preventDefault(); - options.onCopy(e.clipboardData); - } - }); - document.body.appendChild(mark); - range.selectNodeContents(mark); - selection.addRange(range); - var successful = document.execCommand("copy"); - if (!successful) { - throw new Error("copy command was unsuccessful"); } - success = true; - } catch (err) { - debug && console.error("unable to copy using execCommand: ", err); - debug && console.warn("trying IE specific stuff"); - try { - window.clipboardData.setData(options.format || "text", text); - options.onCopy && options.onCopy(window.clipboardData); - success = true; - } catch (err) { - debug && console.error("unable to copy using clipboardData: ", err); - debug && console.error("falling back to prompt"); - message = format("message" in options ? options.message : defaultMessage); - window.prompt(message, text); + }); + + // Rough heuristic to try and detect lines that are part of multi-line string + function probablyInsideString(cm, pos, line) { + return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"\`]/.test(line); + } + function getMode(cm, pos) { + var mode = cm.getMode(); + return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos); + } + CodeMirror.defineExtension("lineComment", function (from, to, options) { + if (!options) options = noOptions; + var self = this, + mode = getMode(self, from); + var firstLine = self.getLine(from.line); + if (firstLine == null || probablyInsideString(self, from, firstLine)) return; + var commentString = options.lineComment || mode.lineComment; + if (!commentString) { + if (options.blockCommentStart || mode.blockCommentStart) { + options.fullLines = true; + self.blockComment(from, to, options); + } + return; } - } finally { - if (selection) { - if (typeof selection.removeRange == "function") { - selection.removeRange(range); + var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1); + var pad = options.padding == null ? " " : options.padding; + var blankLines = options.commentBlankLines || from.line == to.line; + self.operation(function () { + if (options.indent) { + var baseString = null; + for (var i = from.line; i < end; ++i) { + var line = self.getLine(i); + var whitespace = line.slice(0, firstNonWS(line)); + if (baseString == null || baseString.length > whitespace.length) { + baseString = whitespace; + } + } + for (var i = from.line; i < end; ++i) { + var line = self.getLine(i), + cut = baseString.length; + if (!blankLines && !nonWS.test(line)) continue; + if (line.slice(0, cut) != baseString) cut = firstNonWS(line); + self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut)); + } } else { - selection.removeAllRanges(); + for (var i = from.line; i < end; ++i) { + if (blankLines || nonWS.test(self.getLine(i))) self.replaceRange(commentString + pad, Pos(i, 0)); + } } + }); + }); + CodeMirror.defineExtension("blockComment", function (from, to, options) { + if (!options) options = noOptions; + var self = this, + mode = getMode(self, from); + var startString = options.blockCommentStart || mode.blockCommentStart; + var endString = options.blockCommentEnd || mode.blockCommentEnd; + if (!startString || !endString) { + if ((options.lineComment || mode.lineComment) && options.fullLines != false) self.lineComment(from, to, options); + return; } - if (mark) { - document.body.removeChild(mark); - } - reselectPrevious(); - } - return success; -} -module.exports = copy; + if (/\bcomment\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return; + var end = Math.min(to.line, self.lastLine()); + if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end; + var pad = options.padding == null ? " " : options.padding; + if (from.line > end) return; + self.operation(function () { + if (options.fullLines != false) { + var lastLineHasText = nonWS.test(self.getLine(end)); + self.replaceRange(pad + endString, Pos(end)); + self.replaceRange(startString + pad, Pos(from.line, 0)); + var lead = options.blockCommentLead || mode.blockCommentLead; + if (lead != null) for (var i = from.line + 1; i <= end; ++i) if (i != end || lastLineHasText) self.replaceRange(lead + pad, Pos(i, 0)); + } else { + var atCursor = cmp(self.getCursor("to"), to) == 0, + empty = !self.somethingSelected(); + self.replaceRange(endString, to); + if (atCursor) self.setSelection(empty ? to : self.getCursor("from"), to); + self.replaceRange(startString, from); + } + }); + }); + CodeMirror.defineExtension("uncomment", function (from, to, options) { + if (!options) options = noOptions; + var self = this, + mode = getMode(self, from); + var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), + start = Math.min(from.line, end); + + // Try finding line comments + var lineString = options.lineComment || mode.lineComment, + lines = []; + var pad = options.padding == null ? " " : options.padding, + didSomething; + lineComment: { + if (!lineString) break lineComment; + for (var i = start; i <= end; ++i) { + var line = self.getLine(i); + var found = line.indexOf(lineString); + if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1; + if (found == -1 && nonWS.test(line)) break lineComment; + if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment; + lines.push(line); + } + self.operation(function () { + for (var i = start; i <= end; ++i) { + var line = lines[i - start]; + var pos = line.indexOf(lineString), + endPos = pos + lineString.length; + if (pos < 0) continue; + if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length; + didSomething = true; + self.replaceRange("", Pos(i, pos), Pos(i, endPos)); + } + }); + if (didSomething) return true; + } + + // Try block comments + var startString = options.blockCommentStart || mode.blockCommentStart; + var endString = options.blockCommentEnd || mode.blockCommentEnd; + if (!startString || !endString) return false; + var lead = options.blockCommentLead || mode.blockCommentLead; + var startLine = self.getLine(start), + open = startLine.indexOf(startString); + if (open == -1) return false; + var endLine = end == start ? startLine : self.getLine(end); + var close = endLine.indexOf(endString, end == start ? open + startString.length : 0); + var insideStart = Pos(start, open + 1), + insideEnd = Pos(end, close + 1); + if (close == -1 || !/comment/.test(self.getTokenTypeAt(insideStart)) || !/comment/.test(self.getTokenTypeAt(insideEnd)) || self.getRange(insideStart, insideEnd, "\n").indexOf(endString) > -1) return false; + + // Avoid killing block comments completely outside the selection. + // Positions of the last startString before the start of the selection, and the first endString after it. + var lastStart = startLine.lastIndexOf(startString, from.ch); + var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length); + if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false; + // Positions of the first endString after the end of the selection, and the last startString before it. + firstEnd = endLine.indexOf(endString, to.ch); + var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch); + lastStart = firstEnd == -1 || almostLastStart == -1 ? -1 : to.ch + almostLastStart; + if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false; + self.operation(function () { + self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)), Pos(end, close + endString.length)); + var openEnd = open + startString.length; + if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length; + self.replaceRange("", Pos(start, open), Pos(start, openEnd)); + if (lead) for (var i = start + 1; i <= end; ++i) { + var line = self.getLine(i), + found = line.indexOf(lead); + if (found == -1 || nonWS.test(line.slice(0, found))) continue; + var foundEnd = found + lead.length; + if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length; + self.replaceRange("", Pos(i, found), Pos(i, foundEnd)); + } + }); + return true; + }); +}); /***/ }), -/***/ "../../../node_modules/detect-node-es/esm/browser.js": -/*!***********************************************************!*\ - !*** ../../../node_modules/detect-node-es/esm/browser.js ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/codemirror/addon/dialog/dialog.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/dialog/dialog.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isNode = void 0; -const isNode = exports.isNode = false; +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +// Open simple dialogs on top of an editor. Relies on dialog.css. + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"));else {} +})(function (CodeMirror) { + function dialogDiv(cm, template, bottom) { + var wrap = cm.getWrapperElement(); + var dialog; + dialog = wrap.appendChild(document.createElement("div")); + if (bottom) dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";else dialog.className = "CodeMirror-dialog CodeMirror-dialog-top"; + if (typeof template == "string") { + dialog.innerHTML = template; + } else { + // Assuming it's a detached DOM element. + dialog.appendChild(template); + } + CodeMirror.addClass(wrap, 'dialog-opened'); + return dialog; + } + function closeNotification(cm, newVal) { + if (cm.state.currentNotificationClose) cm.state.currentNotificationClose(); + cm.state.currentNotificationClose = newVal; + } + CodeMirror.defineExtension("openDialog", function (template, callback, options) { + if (!options) options = {}; + closeNotification(this, null); + var dialog = dialogDiv(this, template, options.bottom); + var closed = false, + me = this; + function close(newVal) { + if (typeof newVal == 'string') { + inp.value = newVal; + } else { + if (closed) return; + closed = true; + CodeMirror.rmClass(dialog.parentNode, 'dialog-opened'); + dialog.parentNode.removeChild(dialog); + me.focus(); + if (options.onClose) options.onClose(dialog); + } + } + var inp = dialog.getElementsByTagName("input")[0], + button; + if (inp) { + inp.focus(); + if (options.value) { + inp.value = options.value; + if (options.selectValueOnOpen !== false) { + inp.select(); + } + } + if (options.onInput) CodeMirror.on(inp, "input", function (e) { + options.onInput(e, inp.value, close); + }); + if (options.onKeyUp) CodeMirror.on(inp, "keyup", function (e) { + options.onKeyUp(e, inp.value, close); + }); + CodeMirror.on(inp, "keydown", function (e) { + if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { + return; + } + if (e.keyCode == 27 || options.closeOnEnter !== false && e.keyCode == 13) { + inp.blur(); + CodeMirror.e_stop(e); + close(); + } + if (e.keyCode == 13) callback(inp.value, e); + }); + if (options.closeOnBlur !== false) CodeMirror.on(dialog, "focusout", function (evt) { + if (evt.relatedTarget !== null) close(); + }); + } else if (button = dialog.getElementsByTagName("button")[0]) { + CodeMirror.on(button, "click", function () { + close(); + me.focus(); + }); + if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close); + button.focus(); + } + return close; + }); + CodeMirror.defineExtension("openConfirm", function (template, callbacks, options) { + closeNotification(this, null); + var dialog = dialogDiv(this, template, options && options.bottom); + var buttons = dialog.getElementsByTagName("button"); + var closed = false, + me = this, + blurring = 1; + function close() { + if (closed) return; + closed = true; + CodeMirror.rmClass(dialog.parentNode, 'dialog-opened'); + dialog.parentNode.removeChild(dialog); + me.focus(); + } + buttons[0].focus(); + for (var i = 0; i < buttons.length; ++i) { + var b = buttons[i]; + (function (callback) { + CodeMirror.on(b, "click", function (e) { + CodeMirror.e_preventDefault(e); + close(); + if (callback) callback(me); + }); + })(callbacks[i]); + CodeMirror.on(b, "blur", function () { + --blurring; + setTimeout(function () { + if (blurring <= 0) close(); + }, 200); + }); + CodeMirror.on(b, "focus", function () { + ++blurring; + }); + } + }); + + /* + * openNotification + * Opens a notification, that can be closed with an optional timer + * (default 5000ms timer) and always closes on click. + * + * If a notification is opened while another is opened, it will close the + * currently opened one and open the new one immediately. + */ + CodeMirror.defineExtension("openNotification", function (template, options) { + closeNotification(this, close); + var dialog = dialogDiv(this, template, options && options.bottom); + var closed = false, + doneTimer; + var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000; + function close() { + if (closed) return; + closed = true; + clearTimeout(doneTimer); + CodeMirror.rmClass(dialog.parentNode, 'dialog-opened'); + dialog.parentNode.removeChild(dialog); + } + CodeMirror.on(dialog, 'click', function (e) { + CodeMirror.e_preventDefault(e); + close(); + }); + if (duration) doneTimer = setTimeout(close, duration); + return close; + }); +}); /***/ }), -/***/ "../../../node_modules/entities/lib/decode.js": -/*!****************************************************!*\ - !*** ../../../node_modules/entities/lib/decode.js ***! - \****************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/codemirror/addon/edit/closebrackets.js": +/*!********************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/edit/closebrackets.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k]; +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"));else {} +})(function (CodeMirror) { + var defaults = { + pairs: "()[]{}''\"\"", + closeBefore: ")]}'\":;>", + triples: "", + explode: "[]{}" + }; + var Pos = CodeMirror.Pos; + CodeMirror.defineOption("autoCloseBrackets", false, function (cm, val, old) { + if (old && old != CodeMirror.Init) { + cm.removeKeyMap(keyMap); + cm.state.closeBrackets = null; + } + if (val) { + ensureBound(getOption(val, "pairs")); + cm.state.closeBrackets = val; + cm.addKeyMap(keyMap); + } + }); + function getOption(conf, name) { + if (name == "pairs" && typeof conf == "string") return conf; + if (typeof conf == "object" && conf[name] != null) return conf[name]; + return defaults[name]; + } + var keyMap = { + Backspace: handleBackspace, + Enter: handleEnter + }; + function ensureBound(chars) { + for (var i = 0; i < chars.length; i++) { + var ch = chars.charAt(i), + key = "'" + ch + "'"; + if (!keyMap[key]) keyMap[key] = handler(ch); + } + } + ensureBound(defaults.pairs + "`"); + function handler(ch) { + return function (cm) { + return handleChar(cm, ch); + }; + } + function getConfig(cm) { + var deflt = cm.state.closeBrackets; + if (!deflt || deflt.override) return deflt; + var mode = cm.getModeAt(cm.getCursor()); + return mode.closeBrackets || deflt; + } + function handleBackspace(cm) { + var conf = getConfig(cm); + if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; + var pairs = getOption(conf, "pairs"); + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) return CodeMirror.Pass; + var around = charsAround(cm, ranges[i].head); + if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; + } + for (var i = ranges.length - 1; i >= 0; i--) { + var cur = ranges[i].head; + cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete"); + } + } + function handleEnter(cm) { + var conf = getConfig(cm); + var explode = conf && getOption(conf, "explode"); + if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass; + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) return CodeMirror.Pass; + var around = charsAround(cm, ranges[i].head); + if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass; + } + cm.operation(function () { + var linesep = cm.lineSeparator() || "\n"; + cm.replaceSelection(linesep + linesep, null); + moveSel(cm, -1); + ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var line = ranges[i].head.line; + cm.indentLine(line, null, true); + cm.indentLine(line + 1, null, true); } + }); + } + function moveSel(cm, dir) { + var newRanges = [], + ranges = cm.listSelections(), + primary = 0; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.head == cm.getCursor()) primary = i; + var pos = range.head.ch || dir > 0 ? { + line: range.head.line, + ch: range.head.ch + dir + } : { + line: range.head.line - 1 + }; + newRanges.push({ + anchor: pos, + head: pos + }); + } + cm.setSelections(newRanges, primary); + } + function contractSelection(sel) { + var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0; + return { + anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)), + head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1)) }; } - Object.defineProperty(o, k2, desc); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); -var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); -var __importStar = void 0 && (void 0).__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __importDefault = void 0 && (void 0).__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTMLAttribute = exports.decodeHTML = exports.determineBranch = exports.EntityDecoder = exports.DecodingMode = exports.BinTrieFlags = exports.fromCodePoint = exports.replaceCodePoint = exports.decodeCodePoint = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0; -var decode_data_html_js_1 = __importDefault(__webpack_require__(/*! ./generated/decode-data-html.js */ "../../../node_modules/entities/lib/generated/decode-data-html.js")); -exports.htmlDecodeTree = decode_data_html_js_1.default; -var decode_data_xml_js_1 = __importDefault(__webpack_require__(/*! ./generated/decode-data-xml.js */ "../../../node_modules/entities/lib/generated/decode-data-xml.js")); -exports.xmlDecodeTree = decode_data_xml_js_1.default; -var decode_codepoint_js_1 = __importStar(__webpack_require__(/*! ./decode_codepoint.js */ "../../../node_modules/entities/lib/decode_codepoint.js")); -exports.decodeCodePoint = decode_codepoint_js_1.default; -var decode_codepoint_js_2 = __webpack_require__(/*! ./decode_codepoint.js */ "../../../node_modules/entities/lib/decode_codepoint.js"); -Object.defineProperty(exports, "replaceCodePoint", ({ - enumerable: true, - get: function () { - return decode_codepoint_js_2.replaceCodePoint; + function handleChar(cm, ch) { + var conf = getConfig(cm); + if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; + var pairs = getOption(conf, "pairs"); + var pos = pairs.indexOf(ch); + if (pos == -1) return CodeMirror.Pass; + var closeBefore = getOption(conf, "closeBefore"); + var triples = getOption(conf, "triples"); + var identical = pairs.charAt(pos + 1) == ch; + var ranges = cm.listSelections(); + var opening = pos % 2 == 0; + var type; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i], + cur = range.head, + curType; + var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); + if (opening && !range.empty()) { + curType = "surround"; + } else if ((identical || !opening) && next == ch) { + if (identical && stringStartsAfter(cm, cur)) curType = "both";else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch) curType = "skipThree";else curType = "skip"; + } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) { + if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass; + curType = "addFour"; + } else if (identical) { + var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur); + if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";else return CodeMirror.Pass; + } else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) { + curType = "both"; + } else { + return CodeMirror.Pass; + } + if (!type) type = curType;else if (type != curType) return CodeMirror.Pass; + } + var left = pos % 2 ? pairs.charAt(pos - 1) : ch; + var right = pos % 2 ? ch : pairs.charAt(pos + 1); + cm.operation(function () { + if (type == "skip") { + moveSel(cm, 1); + } else if (type == "skipThree") { + moveSel(cm, 3); + } else if (type == "surround") { + var sels = cm.getSelections(); + for (var i = 0; i < sels.length; i++) sels[i] = left + sels[i] + right; + cm.replaceSelections(sels, "around"); + sels = cm.listSelections().slice(); + for (var i = 0; i < sels.length; i++) sels[i] = contractSelection(sels[i]); + cm.setSelections(sels); + } else if (type == "both") { + cm.replaceSelection(left + right, null); + cm.triggerElectric(left + right); + moveSel(cm, -1); + } else if (type == "addFour") { + cm.replaceSelection(left + left + left + left, "before"); + moveSel(cm, 1); + } + }); } -})); -Object.defineProperty(exports, "fromCodePoint", ({ - enumerable: true, - get: function () { - return decode_codepoint_js_2.fromCodePoint; + function charsAround(cm, pos) { + var str = cm.getRange(Pos(pos.line, pos.ch - 1), Pos(pos.line, pos.ch + 1)); + return str.length == 2 ? str : null; } -})); -var CharCodes; -(function (CharCodes) { - CharCodes[CharCodes["NUM"] = 35] = "NUM"; - CharCodes[CharCodes["SEMI"] = 59] = "SEMI"; - CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS"; - CharCodes[CharCodes["ZERO"] = 48] = "ZERO"; - CharCodes[CharCodes["NINE"] = 57] = "NINE"; - CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A"; - CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F"; - CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X"; - CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z"; - CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A"; - CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F"; - CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z"; -})(CharCodes || (CharCodes = {})); -/** Bit that needs to be set to convert an upper case ASCII character to lower case */ -var TO_LOWER_BIT = 32; -var BinTrieFlags; -(function (BinTrieFlags) { - BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; - BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; - BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE"; -})(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {})); -function isNumber(code) { - return code >= CharCodes.ZERO && code <= CharCodes.NINE; -} -function isHexadecimalCharacter(code) { - return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F; -} -function isAsciiAlphaNumeric(code) { - return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code); -} -/** - * Checks if the given character is a valid end character for an entity in an attribute. - * - * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error. - * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state - */ -function isEntityInAttributeInvalidEnd(code) { - return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code); -} -var EntityDecoderState; -(function (EntityDecoderState) { - EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart"; - EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart"; - EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal"; - EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex"; - EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity"; -})(EntityDecoderState || (EntityDecoderState = {})); -var DecodingMode; -(function (DecodingMode) { - /** Entities in text nodes that can end with any character. */ - DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy"; - /** Only allow entities terminated with a semicolon. */ - DecodingMode[DecodingMode["Strict"] = 1] = "Strict"; - /** Entities in attributes have limitations on ending characters. */ - DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute"; -})(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {})); -/** - * Token decoder with support of writing partial entities. - */ -var EntityDecoder = /** @class */function () { - function EntityDecoder( /** The tree used to decode entities. */ - decodeTree, - /** - * The function that is called when a codepoint is decoded. - * - * For multi-byte named entities, this will be called multiple times, - * with the second codepoint, and the same `consumed` value. - * - * @param codepoint The decoded codepoint. - * @param consumed The number of bytes consumed by the decoder. - */ - emitCodePoint, /** An object that is used to produce errors. */ - errors) { - this.decodeTree = decodeTree; - this.emitCodePoint = emitCodePoint; - this.errors = errors; - /** The current state of the decoder. */ - this.state = EntityDecoderState.EntityStart; - /** Characters that were consumed while parsing an entity. */ - this.consumed = 1; - /** - * The result of the entity. - * - * Either the result index of a numeric entity, or the codepoint of a - * numeric entity. - */ - this.result = 0; - /** The current index in the decode tree. */ - this.treeIndex = 0; - /** The number of characters that were consumed in excess. */ - this.excess = 1; - /** The mode in which the decoder is operating. */ - this.decodeMode = DecodingMode.Strict; + function stringStartsAfter(cm, pos) { + var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1)); + return /\bstring/.test(token.type) && token.start == pos.ch && (pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos))); } - /** Resets the instance to make it reusable. */ - EntityDecoder.prototype.startEntity = function (decodeMode) { - this.decodeMode = decodeMode; - this.state = EntityDecoderState.EntityStart; - this.result = 0; - this.treeIndex = 0; - this.excess = 1; - this.consumed = 1; +}); + +/***/ }), + +/***/ "../../../node_modules/codemirror/addon/edit/matchbrackets.js": +/*!********************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/edit/matchbrackets.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"));else {} +})(function (CodeMirror) { + var ie_lt8 = /MSIE \d/.test(navigator.userAgent) && (document.documentMode == null || document.documentMode < 8); + var Pos = CodeMirror.Pos; + var matching = { + "(": ")>", + ")": "(<", + "[": "]>", + "]": "[<", + "{": "}>", + "}": "{<", + "<": ">>", + ">": "<<" }; - /** - * Write an entity to the decoder. This can be called multiple times with partial entities. - * If the entity is incomplete, the decoder will return -1. - * - * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the - * entity is incomplete, and resume when the next string is written. - * - * @param string The string containing the entity (or a continuation of the entity). - * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. - * @returns The number of characters that were consumed, or -1 if the entity is incomplete. - */ - EntityDecoder.prototype.write = function (str, offset) { - switch (this.state) { - case EntityDecoderState.EntityStart: - { - if (str.charCodeAt(offset) === CharCodes.NUM) { - this.state = EntityDecoderState.NumericStart; - this.consumed += 1; - return this.stateNumericStart(str, offset + 1); - } - this.state = EntityDecoderState.NamedEntity; - return this.stateNamedEntity(str, offset); - } - case EntityDecoderState.NumericStart: - { - return this.stateNumericStart(str, offset); - } - case EntityDecoderState.NumericDecimal: - { - return this.stateNumericDecimal(str, offset); - } - case EntityDecoderState.NumericHex: - { - return this.stateNumericHex(str, offset); - } - case EntityDecoderState.NamedEntity: - { - return this.stateNamedEntity(str, offset); - } + function bracketRegex(config) { + return config && config.bracketRegex || /[(){}[\]]/; + } + function findMatchingBracket(cm, where, config) { + var line = cm.getLineHandle(where.line), + pos = where.ch - 1; + var afterCursor = config && config.afterCursor; + if (afterCursor == null) afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className); + var re = bracketRegex(config); + + // A cursor is defined as between two characters, but in in vim command mode + // (i.e. not insert mode), the cursor is visually represented as a + // highlighted box on top of the 2nd character. Otherwise, we allow matches + // from before or after the cursor. + var match = !afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)] || re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)]; + if (!match) return null; + var dir = match.charAt(1) == ">" ? 1 : -1; + if (config && config.strict && dir > 0 != (pos == where.ch)) return null; + var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); + var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config); + if (found == null) return null; + return { + from: Pos(where.line, pos), + to: found && found.pos, + match: found && found.ch == match.charAt(0), + forward: dir > 0 + }; + } + + // bracketRegex is used to specify which type of bracket to scan + // should be a regexp, e.g. /[[\]]/ + // + // Note: If "where" is on an open bracket, then this bracket is ignored. + // + // Returns false when no bracket was found, null when it reached + // maxScanLines and gave up + function scanForBracket(cm, where, dir, style, config) { + var maxScanLen = config && config.maxScanLineLength || 10000; + var maxScanLines = config && config.maxScanLines || 1000; + var stack = []; + var re = bracketRegex(config); + var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) : Math.max(cm.firstLine() - 1, where.line - maxScanLines); + for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { + var line = cm.getLine(lineNo); + if (!line) continue; + var pos = dir > 0 ? 0 : line.length - 1, + end = dir > 0 ? line.length : -1; + if (line.length > maxScanLen) continue; + if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); + for (; pos != end; pos += dir) { + var ch = line.charAt(pos); + if (re.test(ch) && (style === undefined || (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || "") == (style || ""))) { + var match = matching[ch]; + if (match && match.charAt(1) == ">" == dir > 0) stack.push(ch);else if (!stack.length) return { + pos: Pos(lineNo, pos), + ch: ch + };else stack.pop(); + } + } + } + return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null; + } + function matchBrackets(cm, autoclear, config) { + // Disable brace matching in long lines, since it'll cause hugely slow updates + var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000, + highlightNonMatching = config && config.highlightNonMatching; + var marks = [], + ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config); + if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) { + var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; + marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), { + className: style + })); + if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), { + className: style + })); + } } - }; - /** - * Switches between the numeric decimal and hexadecimal states. - * - * Equivalent to the `Numeric character reference state` in the HTML spec. - * - * @param str The string containing the entity (or a continuation of the entity). - * @param offset The current offset. - * @returns The number of characters that were consumed, or -1 if the entity is incomplete. - */ - EntityDecoder.prototype.stateNumericStart = function (str, offset) { - if (offset >= str.length) { - return -1; + if (marks.length) { + // Kludge to work around the IE bug from issue #1193, where text + // input stops going to the textarea whenever this fires. + if (ie_lt8 && cm.state.focused) cm.focus(); + var clear = function () { + cm.operation(function () { + for (var i = 0; i < marks.length; i++) marks[i].clear(); + }); + }; + if (autoclear) setTimeout(clear, 800);else return clear; } - if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { - this.state = EntityDecoderState.NumericHex; - this.consumed += 1; - return this.stateNumericHex(str, offset + 1); + } + function doMatchBrackets(cm) { + cm.operation(function () { + if (cm.state.matchBrackets.currentlyHighlighted) { + cm.state.matchBrackets.currentlyHighlighted(); + cm.state.matchBrackets.currentlyHighlighted = null; + } + cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); + }); + } + function clearHighlighted(cm) { + if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) { + cm.state.matchBrackets.currentlyHighlighted(); + cm.state.matchBrackets.currentlyHighlighted = null; } - this.state = EntityDecoderState.NumericDecimal; - return this.stateNumericDecimal(str, offset); - }; - EntityDecoder.prototype.addToNumericResult = function (str, start, end, base) { - if (start !== end) { - var digitCount = end - start; - this.result = this.result * Math.pow(base, digitCount) + parseInt(str.substr(start, digitCount), base); - this.consumed += digitCount; + } + CodeMirror.defineOption("matchBrackets", false, function (cm, val, old) { + if (old && old != CodeMirror.Init) { + cm.off("cursorActivity", doMatchBrackets); + cm.off("focus", doMatchBrackets); + cm.off("blur", clearHighlighted); + clearHighlighted(cm); } - }; - /** - * Parses a hexadecimal numeric entity. - * - * Equivalent to the `Hexademical character reference state` in the HTML spec. - * - * @param str The string containing the entity (or a continuation of the entity). - * @param offset The current offset. - * @returns The number of characters that were consumed, or -1 if the entity is incomplete. - */ - EntityDecoder.prototype.stateNumericHex = function (str, offset) { - var startIdx = offset; - while (offset < str.length) { - var char = str.charCodeAt(offset); - if (isNumber(char) || isHexadecimalCharacter(char)) { - offset += 1; - } else { - this.addToNumericResult(str, startIdx, offset, 16); - return this.emitNumericEntity(char, 3); - } + if (val) { + cm.state.matchBrackets = typeof val == "object" ? val : {}; + cm.on("cursorActivity", doMatchBrackets); + cm.on("focus", doMatchBrackets); + cm.on("blur", clearHighlighted); } - this.addToNumericResult(str, startIdx, offset, 16); - return -1; - }; - /** - * Parses a decimal numeric entity. - * - * Equivalent to the `Decimal character reference state` in the HTML spec. - * - * @param str The string containing the entity (or a continuation of the entity). - * @param offset The current offset. - * @returns The number of characters that were consumed, or -1 if the entity is incomplete. - */ - EntityDecoder.prototype.stateNumericDecimal = function (str, offset) { - var startIdx = offset; - while (offset < str.length) { - var char = str.charCodeAt(offset); - if (isNumber(char)) { - offset += 1; + }); + CodeMirror.defineExtension("matchBrackets", function () { + matchBrackets(this, true); + }); + CodeMirror.defineExtension("findMatchingBracket", function (pos, config, oldConfig) { + // Backwards-compatibility kludge + if (oldConfig || typeof config == "boolean") { + if (!oldConfig) { + config = config ? { + strict: true + } : null; } else { - this.addToNumericResult(str, startIdx, offset, 10); - return this.emitNumericEntity(char, 2); + oldConfig.strict = config; + config = oldConfig; } } - this.addToNumericResult(str, startIdx, offset, 10); - return -1; - }; - /** - * Validate and emit a numeric entity. - * - * Implements the logic from the `Hexademical character reference start - * state` and `Numeric character reference end state` in the HTML spec. - * - * @param lastCp The last code point of the entity. Used to see if the - * entity was terminated with a semicolon. - * @param expectedLength The minimum number of characters that should be - * consumed. Used to validate that at least one digit - * was consumed. - * @returns The number of characters that were consumed. - */ - EntityDecoder.prototype.emitNumericEntity = function (lastCp, expectedLength) { - var _a; - // Ensure we consumed at least one digit. - if (this.consumed <= expectedLength) { - (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); - return 0; + return findMatchingBracket(this, pos, config); + }); + CodeMirror.defineExtension("scanForBracket", function (pos, dir, style, config) { + return scanForBracket(this, pos, dir, style, config); + }); +}); + +/***/ }), + +/***/ "../../../node_modules/codemirror/addon/fold/brace-fold.js": +/*!*****************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/fold/brace-fold.js ***! + \*****************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"));else {} +})(function (CodeMirror) { + "use strict"; + + function bracketFolding(pairs) { + return function (cm, start) { + var line = start.line, + lineText = cm.getLine(line); + function findOpening(pair) { + var tokenType; + for (var at = start.ch, pass = 0;;) { + var found = at <= 0 ? -1 : lineText.lastIndexOf(pair[0], at - 1); + if (found == -1) { + if (pass == 1) break; + pass = 1; + at = lineText.length; + continue; + } + if (pass == 1 && found < start.ch) break; + tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)); + if (!/^(comment|string)/.test(tokenType)) return { + ch: found + 1, + tokenType: tokenType, + pair: pair + }; + at = found - 1; + } + } + function findRange(found) { + var count = 1, + lastLine = cm.lastLine(), + end, + startCh = found.ch, + endCh; + outer: for (var i = line; i <= lastLine; ++i) { + var text = cm.getLine(i), + pos = i == line ? startCh : 0; + for (;;) { + var nextOpen = text.indexOf(found.pair[0], pos), + nextClose = text.indexOf(found.pair[1], pos); + if (nextOpen < 0) nextOpen = text.length; + if (nextClose < 0) nextClose = text.length; + pos = Math.min(nextOpen, nextClose); + if (pos == text.length) break; + if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == found.tokenType) { + if (pos == nextOpen) ++count;else if (! --count) { + end = i; + endCh = pos; + break outer; + } + } + ++pos; + } + } + if (end == null || line == end) return null; + return { + from: CodeMirror.Pos(line, startCh), + to: CodeMirror.Pos(end, endCh) + }; + } + var found = []; + for (var i = 0; i < pairs.length; i++) { + var open = findOpening(pairs[i]); + if (open) found.push(open); + } + found.sort(function (a, b) { + return a.ch - b.ch; + }); + for (var i = 0; i < found.length; i++) { + var range = findRange(found[i]); + if (range) return range; + } + return null; + }; + } + CodeMirror.registerHelper("fold", "brace", bracketFolding([["{", "}"], ["[", "]"]])); + CodeMirror.registerHelper("fold", "brace-paren", bracketFolding([["{", "}"], ["[", "]"], ["(", ")"]])); + CodeMirror.registerHelper("fold", "import", function (cm, start) { + function hasImport(line) { + if (line < cm.firstLine() || line > cm.lastLine()) return null; + var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); + if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); + if (start.type != "keyword" || start.string != "import") return null; + // Now find closing semicolon, return its position + for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { + var text = cm.getLine(i), + semi = text.indexOf(";"); + if (semi != -1) return { + startCh: start.end, + end: CodeMirror.Pos(i, semi) + }; + } } - // Figure out if this is a legit end of the entity - if (lastCp === CharCodes.SEMI) { - this.consumed += 1; - } else if (this.decodeMode === DecodingMode.Strict) { - return 0; + var startLine = start.line, + has = hasImport(startLine), + prev; + if (!has || hasImport(startLine - 1) || (prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1) return null; + for (var end = has.end;;) { + var next = hasImport(end.line + 1); + if (next == null) break; + end = next.end; } - this.emitCodePoint((0, decode_codepoint_js_1.replaceCodePoint)(this.result), this.consumed); - if (this.errors) { - if (lastCp !== CharCodes.SEMI) { - this.errors.missingSemicolonAfterCharacterReference(); - } - this.errors.validateNumericCharacterReference(this.result); + return { + from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), + to: end + }; + }); + CodeMirror.registerHelper("fold", "include", function (cm, start) { + function hasInclude(line) { + if (line < cm.firstLine() || line > cm.lastLine()) return null; + var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); + if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); + if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; + } + var startLine = start.line, + has = hasInclude(startLine); + if (has == null || hasInclude(startLine - 1) != null) return null; + for (var end = startLine;;) { + var next = hasInclude(end + 1); + if (next == null) break; + ++end; } - return this.consumed; - }; - /** - * Parses a named entity. - * - * Equivalent to the `Named character reference state` in the HTML spec. - * - * @param str The string containing the entity (or a continuation of the entity). - * @param offset The current offset. - * @returns The number of characters that were consumed, or -1 if the entity is incomplete. - */ - EntityDecoder.prototype.stateNamedEntity = function (str, offset) { - var decodeTree = this.decodeTree; - var current = decodeTree[this.treeIndex]; - // The mask is the number of bytes of the value, including the current byte. - var valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; - for (; offset < str.length; offset++, this.excess++) { - var char = str.charCodeAt(offset); - this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); - if (this.treeIndex < 0) { - return this.result === 0 || - // If we are parsing an attribute - this.decodeMode === DecodingMode.Attribute && ( - // We shouldn't have consumed any characters after the entity, - valueLength === 0 || - // And there should be no invalid characters. - isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity(); - } - current = decodeTree[this.treeIndex]; - valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; - // If the branch is a value, store it and continue - if (valueLength !== 0) { - // If the entity is terminated by a semicolon, we are done. - if (char === CharCodes.SEMI) { - return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); - } - // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it. - if (this.decodeMode !== DecodingMode.Strict) { - this.result = this.treeIndex; - this.consumed += this.excess; - this.excess = 0; + return { + from: CodeMirror.Pos(startLine, has + 1), + to: cm.clipPos(CodeMirror.Pos(end)) + }; + }); +}); + +/***/ }), + +/***/ "../../../node_modules/codemirror/addon/fold/foldcode.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/fold/foldcode.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"));else {} +})(function (CodeMirror) { + "use strict"; + + function doFold(cm, pos, options, force) { + if (options && options.call) { + var finder = options; + options = null; + } else { + var finder = getOption(cm, options, "rangeFinder"); + } + if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); + var minSize = getOption(cm, options, "minFoldSize"); + function getRange(allowFolded) { + var range = finder(cm, pos); + if (!range || range.to.line - range.from.line < minSize) return null; + if (force === "fold") return range; + var marks = cm.findMarksAt(range.from); + for (var i = 0; i < marks.length; ++i) { + if (marks[i].__isFold) { + if (!allowFolded) return null; + range.cleared = true; + marks[i].clear(); } } + return range; } - return -1; + var range = getRange(true); + if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) { + pos = CodeMirror.Pos(pos.line - 1, 0); + range = getRange(false); + } + if (!range || range.cleared || force === "unfold") return; + var myWidget = makeWidget(cm, options, range); + CodeMirror.on(myWidget, "mousedown", function (e) { + myRange.clear(); + CodeMirror.e_preventDefault(e); + }); + var myRange = cm.markText(range.from, range.to, { + replacedWith: myWidget, + clearOnEnter: getOption(cm, options, "clearOnEnter"), + __isFold: true + }); + myRange.on("clear", function (from, to) { + CodeMirror.signal(cm, "unfold", cm, from, to); + }); + CodeMirror.signal(cm, "fold", cm, range.from, range.to); + } + function makeWidget(cm, options, range) { + var widget = getOption(cm, options, "widget"); + if (typeof widget == "function") { + widget = widget(range.from, range.to); + } + if (typeof widget == "string") { + var text = document.createTextNode(widget); + widget = document.createElement("span"); + widget.appendChild(text); + widget.className = "CodeMirror-foldmarker"; + } else if (widget) { + widget = widget.cloneNode(true); + } + return widget; + } + + // Clumsy backwards-compatible interface + CodeMirror.newFoldFunction = function (rangeFinder, widget) { + return function (cm, pos) { + doFold(cm, pos, { + rangeFinder: rangeFinder, + widget: widget + }); + }; }; - /** - * Emit a named entity that was not terminated with a semicolon. - * - * @returns The number of characters consumed. - */ - EntityDecoder.prototype.emitNotTerminatedNamedEntity = function () { - var _a; - var _b = this, - result = _b.result, - decodeTree = _b.decodeTree; - var valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; - this.emitNamedEntityData(result, valueLength, this.consumed); - (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference(); - return this.consumed; + + // New-style interface + CodeMirror.defineExtension("foldCode", function (pos, options, force) { + doFold(this, pos, options, force); + }); + CodeMirror.defineExtension("isFolded", function (pos) { + var marks = this.findMarksAt(pos); + for (var i = 0; i < marks.length; ++i) if (marks[i].__isFold) return true; + }); + CodeMirror.commands.toggleFold = function (cm) { + cm.foldCode(cm.getCursor()); }; - /** - * Emit a named entity. - * - * @param result The index of the entity in the decode tree. - * @param valueLength The number of bytes in the entity. - * @param consumed The number of characters consumed. - * - * @returns The number of characters consumed. - */ - EntityDecoder.prototype.emitNamedEntityData = function (result, valueLength, consumed) { - var decodeTree = this.decodeTree; - this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed); - if (valueLength === 3) { - // For multi-byte values, we need to emit the second byte. - this.emitCodePoint(decodeTree[result + 2], consumed); - } - return consumed; + CodeMirror.commands.fold = function (cm) { + cm.foldCode(cm.getCursor(), null, "fold"); }; - /** - * Signal to the parser that the end of the input was reached. - * - * Remaining data will be emitted and relevant errors will be produced. - * - * @returns The number of characters consumed. - */ - EntityDecoder.prototype.end = function () { - var _a; - switch (this.state) { - case EntityDecoderState.NamedEntity: - { - // Emit a named entity if we have one. - return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0; - } - // Otherwise, emit a numeric entity if we have one. - case EntityDecoderState.NumericDecimal: - { - return this.emitNumericEntity(0, 2); - } - case EntityDecoderState.NumericHex: - { - return this.emitNumericEntity(0, 3); - } - case EntityDecoderState.NumericStart: - { - (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); - return 0; - } - case EntityDecoderState.EntityStart: - { - // Return 0 if we have no entity. - return 0; - } - } + CodeMirror.commands.unfold = function (cm) { + cm.foldCode(cm.getCursor(), { + scanUp: false + }, "unfold"); }; - return EntityDecoder; -}(); -exports.EntityDecoder = EntityDecoder; -/** - * Creates a function that decodes entities in a string. - * - * @param decodeTree The decode tree. - * @returns A function that decodes entities in a string. - */ -function getDecoder(decodeTree) { - var ret = ""; - var decoder = new EntityDecoder(decodeTree, function (str) { - return ret += (0, decode_codepoint_js_1.fromCodePoint)(str); - }); - return function decodeWithTrie(str, decodeMode) { - var lastIndex = 0; - var offset = 0; - while ((offset = str.indexOf("&", offset)) >= 0) { - ret += str.slice(lastIndex, offset); - decoder.startEntity(decodeMode); - var len = decoder.write(str, - // Skip the "&" - offset + 1); - if (len < 0) { - lastIndex = offset + decoder.end(); - break; + CodeMirror.commands.foldAll = function (cm) { + cm.operation(function () { + for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) cm.foldCode(CodeMirror.Pos(i, 0), { + scanUp: false + }, "fold"); + }); + }; + CodeMirror.commands.unfoldAll = function (cm) { + cm.operation(function () { + for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) cm.foldCode(CodeMirror.Pos(i, 0), { + scanUp: false + }, "unfold"); + }); + }; + CodeMirror.registerHelper("fold", "combine", function () { + var funcs = Array.prototype.slice.call(arguments, 0); + return function (cm, start) { + for (var i = 0; i < funcs.length; ++i) { + var found = funcs[i](cm, start); + if (found) return found; } - lastIndex = offset + len; - // If `len` is 0, skip the current `&` and continue. - offset = len === 0 ? lastIndex + 1 : lastIndex; + }; + }); + CodeMirror.registerHelper("fold", "auto", function (cm, start) { + var helpers = cm.getHelpers(start, "fold"); + for (var i = 0; i < helpers.length; i++) { + var cur = helpers[i](cm, start); + if (cur) return cur; } - var result = ret + str.slice(lastIndex); - // Make sure we don't keep a reference to the final string. - ret = ""; - return result; + }); + var defaultOptions = { + rangeFinder: CodeMirror.fold.auto, + widget: "\u2194", + minFoldSize: 0, + scanUp: false, + clearOnEnter: true }; -} -/** - * Determines the branch of the current node that is taken given the current - * character. This function is used to traverse the trie. - * - * @param decodeTree The trie. - * @param current The current node. - * @param nodeIdx The index right after the current node and its value. - * @param char The current character. - * @returns The index of the next node, or -1 if no branch is taken. - */ -function determineBranch(decodeTree, current, nodeIdx, char) { - var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; - var jumpOffset = current & BinTrieFlags.JUMP_TABLE; - // Case 1: Single branch encoded in jump offset - if (branchCount === 0) { - return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; + CodeMirror.defineOption("foldOptions", null); + function getOption(cm, options, name) { + if (options && options[name] !== undefined) return options[name]; + var editorOptions = cm.options.foldOptions; + if (editorOptions && editorOptions[name] !== undefined) return editorOptions[name]; + return defaultOptions[name]; + } + CodeMirror.defineExtension("foldOption", function (options, name) { + return getOption(this, options, name); + }); +}); + +/***/ }), + +/***/ "../../../node_modules/codemirror/addon/fold/foldgutter.js": +/*!*****************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/fold/foldgutter.js ***! + \*****************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"), __webpack_require__(/*! ./foldcode */ "../../../node_modules/codemirror/addon/fold/foldcode.js"));else {} +})(function (CodeMirror) { + "use strict"; + + CodeMirror.defineOption("foldGutter", false, function (cm, val, old) { + if (old && old != CodeMirror.Init) { + cm.clearGutter(cm.state.foldGutter.options.gutter); + cm.state.foldGutter = null; + cm.off("gutterClick", onGutterClick); + cm.off("changes", onChange); + cm.off("viewportChange", onViewportChange); + cm.off("fold", onFold); + cm.off("unfold", onFold); + cm.off("swapDoc", onChange); + } + if (val) { + cm.state.foldGutter = new State(parseOptions(val)); + updateInViewport(cm); + cm.on("gutterClick", onGutterClick); + cm.on("changes", onChange); + cm.on("viewportChange", onViewportChange); + cm.on("fold", onFold); + cm.on("unfold", onFold); + cm.on("swapDoc", onChange); + } + }); + var Pos = CodeMirror.Pos; + function State(options) { + this.options = options; + this.from = this.to = 0; + } + function parseOptions(opts) { + if (opts === true) opts = {}; + if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter"; + if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open"; + if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded"; + return opts; + } + function isFolded(cm, line) { + var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0)); + for (var i = 0; i < marks.length; ++i) { + if (marks[i].__isFold) { + var fromPos = marks[i].find(-1); + if (fromPos && fromPos.line === line) return marks[i]; + } + } + } + function marker(spec) { + if (typeof spec == "string") { + var elt = document.createElement("div"); + elt.className = spec + " CodeMirror-guttermarker-subtle"; + return elt; + } else { + return spec.cloneNode(true); + } + } + function updateFoldInfo(cm, from, to) { + var opts = cm.state.foldGutter.options, + cur = from - 1; + var minSize = cm.foldOption(opts, "minFoldSize"); + var func = cm.foldOption(opts, "rangeFinder"); + // we can reuse the built-in indicator element if its className matches the new state + var clsFolded = typeof opts.indicatorFolded == "string" && classTest(opts.indicatorFolded); + var clsOpen = typeof opts.indicatorOpen == "string" && classTest(opts.indicatorOpen); + cm.eachLine(from, to, function (line) { + ++cur; + var mark = null; + var old = line.gutterMarkers; + if (old) old = old[opts.gutter]; + if (isFolded(cm, cur)) { + if (clsFolded && old && clsFolded.test(old.className)) return; + mark = marker(opts.indicatorFolded); + } else { + var pos = Pos(cur, 0); + var range = func && func(cm, pos); + if (range && range.to.line - range.from.line >= minSize) { + if (clsOpen && old && clsOpen.test(old.className)) return; + mark = marker(opts.indicatorOpen); + } + } + if (!mark && !old) return; + cm.setGutterMarker(line, opts.gutter, mark); + }); } - // Case 2: Multiple branches encoded in jump table - if (jumpOffset) { - var value = char - jumpOffset; - return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1; + + // copied from CodeMirror/src/util/dom.js + function classTest(cls) { + return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); } - // Case 3: Multiple branches encoded in dictionary - // Binary search for the character. - var lo = nodeIdx; - var hi = lo + branchCount - 1; - while (lo <= hi) { - var mid = lo + hi >>> 1; - var midVal = decodeTree[mid]; - if (midVal < char) { - lo = mid + 1; - } else if (midVal > char) { - hi = mid - 1; - } else { - return decodeTree[mid + branchCount]; - } + function updateInViewport(cm) { + var vp = cm.getViewport(), + state = cm.state.foldGutter; + if (!state) return; + cm.operation(function () { + updateFoldInfo(cm, vp.from, vp.to); + }); + state.from = vp.from; + state.to = vp.to; + } + function onGutterClick(cm, line, gutter) { + var state = cm.state.foldGutter; + if (!state) return; + var opts = state.options; + if (gutter != opts.gutter) return; + var folded = isFolded(cm, line); + if (folded) folded.clear();else cm.foldCode(Pos(line, 0), opts); + } + function onChange(cm) { + var state = cm.state.foldGutter; + if (!state) return; + var opts = state.options; + state.from = state.to = 0; + clearTimeout(state.changeUpdate); + state.changeUpdate = setTimeout(function () { + updateInViewport(cm); + }, opts.foldOnChangeTimeSpan || 600); + } + function onViewportChange(cm) { + var state = cm.state.foldGutter; + if (!state) return; + var opts = state.options; + clearTimeout(state.changeUpdate); + state.changeUpdate = setTimeout(function () { + var vp = cm.getViewport(); + if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { + updateInViewport(cm); + } else { + cm.operation(function () { + if (vp.from < state.from) { + updateFoldInfo(cm, vp.from, state.from); + state.from = vp.from; + } + if (vp.to > state.to) { + updateFoldInfo(cm, state.to, vp.to); + state.to = vp.to; + } + }); + } + }, opts.updateViewportTimeSpan || 400); } - return -1; -} -exports.determineBranch = determineBranch; -var htmlDecoder = getDecoder(decode_data_html_js_1.default); -var xmlDecoder = getDecoder(decode_data_xml_js_1.default); -/** - * Decodes an HTML string. - * - * @param str The string to decode. - * @param mode The decoding mode. - * @returns The decoded string. - */ -function decodeHTML(str, mode) { - if (mode === void 0) { - mode = DecodingMode.Legacy; + function onFold(cm, from) { + var state = cm.state.foldGutter; + if (!state) return; + var line = from.line; + if (line >= state.from && line < state.to) updateFoldInfo(cm, line, line + 1); } - return htmlDecoder(str, mode); -} -exports.decodeHTML = decodeHTML; -/** - * Decodes an HTML string in an attribute. - * - * @param str The string to decode. - * @returns The decoded string. - */ -function decodeHTMLAttribute(str) { - return htmlDecoder(str, DecodingMode.Attribute); -} -exports.decodeHTMLAttribute = decodeHTMLAttribute; -/** - * Decodes an HTML string, requiring all entities to be terminated by a semicolon. - * - * @param str The string to decode. - * @returns The decoded string. - */ -function decodeHTMLStrict(str) { - return htmlDecoder(str, DecodingMode.Strict); -} -exports.decodeHTMLStrict = decodeHTMLStrict; -/** - * Decodes an XML string, requiring all entities to be terminated by a semicolon. - * - * @param str The string to decode. - * @returns The decoded string. - */ -function decodeXML(str) { - return xmlDecoder(str, DecodingMode.Strict); -} -exports.decodeXML = decodeXML; +}); /***/ }), -/***/ "../../../node_modules/entities/lib/decode_codepoint.js": -/*!**************************************************************!*\ - !*** ../../../node_modules/entities/lib/decode_codepoint.js ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - +/***/ "../../../node_modules/codemirror/addon/hint/show-hint.js": +/*!****************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/hint/show-hint.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134 -var _a; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.replaceCodePoint = exports.fromCodePoint = void 0; -var decodeMap = new Map([[0, 65533], -// C1 Unicode control character reference replacements -[128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376]]); -/** - * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. - */ -exports.fromCodePoint = -// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins -(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) { - var output = ""; - if (codePoint > 0xffff) { - codePoint -= 0x10000; - output += String.fromCharCode(codePoint >>> 10 & 0x3ff | 0xd800); - codePoint = 0xdc00 | codePoint & 0x3ff; - } - output += String.fromCharCode(codePoint); - return output; -}; -/** - * Replace the given code point with a replacement character if it is a - * surrogate or is outside the valid range. Otherwise return the code - * point unchanged. - */ -function replaceCodePoint(codePoint) { - var _a; - if (codePoint >= 0xd800 && codePoint <= 0xdfff || codePoint > 0x10ffff) { - return 0xfffd; - } - return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint; -} -exports.replaceCodePoint = replaceCodePoint; -/** - * Replace the code point if relevant, then convert it to a string. - * - * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead. - * @param codePoint The code point to decode. - * @returns The decoded code point. - */ -function decodeCodePoint(codePoint) { - return (0, exports.fromCodePoint)(replaceCodePoint(codePoint)); -} -exports["default"] = decodeCodePoint; -/***/ }), +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE -/***/ "../../../node_modules/entities/lib/encode.js": -/*!****************************************************!*\ - !*** ../../../node_modules/entities/lib/encode.js ***! - \****************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +// declare global: DOMRect +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"));else {} +})(function (CodeMirror) { + "use strict"; + var HINT_ELEMENT_CLASS = "CodeMirror-hint"; + var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active"; -var __importDefault = void 0 && (void 0).__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod + // This is the old interface, kept around for now to stay + // backwards-compatible. + CodeMirror.showHint = function (cm, getHints, options) { + if (!getHints) return cm.showHint(options); + if (options && options.async) getHints.async = true; + var newOpts = { + hint: getHints + }; + if (options) for (var prop in options) newOpts[prop] = options[prop]; + return cm.showHint(newOpts); }; -}; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.encodeNonAsciiHTML = exports.encodeHTML = void 0; -var encode_html_js_1 = __importDefault(__webpack_require__(/*! ./generated/encode-html.js */ "../../../node_modules/entities/lib/generated/encode-html.js")); -var escape_js_1 = __webpack_require__(/*! ./escape.js */ "../../../node_modules/entities/lib/escape.js"); -var htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g; -/** - * Encodes all characters in the input using HTML entities. This includes - * characters that are valid ASCII characters in HTML documents, such as `#`. - * - * To get a more compact output, consider using the `encodeNonAsciiHTML` - * function, which will only encode characters that are not valid in HTML - * documents, as well as non-ASCII characters. - * - * If a character has no equivalent entity, a numeric hexadecimal reference - * (eg. `ü`) will be used. - */ -function encodeHTML(data) { - return encodeHTMLTrieRe(htmlReplacer, data); -} -exports.encodeHTML = encodeHTML; -/** - * Encodes all non-ASCII characters, as well as characters not valid in HTML - * documents using HTML entities. This function will not encode characters that - * are valid in HTML documents, such as `#`. - * - * If a character has no equivalent entity, a numeric hexadecimal reference - * (eg. `ü`) will be used. - */ -function encodeNonAsciiHTML(data) { - return encodeHTMLTrieRe(escape_js_1.xmlReplacer, data); -} -exports.encodeNonAsciiHTML = encodeNonAsciiHTML; -function encodeHTMLTrieRe(regExp, str) { - var ret = ""; - var lastIdx = 0; - var match; - while ((match = regExp.exec(str)) !== null) { - var i = match.index; - ret += str.substring(lastIdx, i); - var char = str.charCodeAt(i); - var next = encode_html_js_1.default.get(char); - if (typeof next === "object") { - // We are in a branch. Try to match the next char. - if (i + 1 < str.length) { - var nextChar = str.charCodeAt(i + 1); - var value = typeof next.n === "number" ? next.n === nextChar ? next.o : undefined : next.n.get(nextChar); - if (value !== undefined) { - ret += value; - lastIdx = regExp.lastIndex += 1; - continue; + CodeMirror.defineExtension("showHint", function (options) { + options = parseOptions(this, this.getCursor("start"), options); + var selections = this.listSelections(); + if (selections.length > 1) return; + // By default, don't allow completion when something is selected. + // A hint function can have a `supportsSelection` property to + // indicate that it can handle selections. + if (this.somethingSelected()) { + if (!options.hint.supportsSelection) return; + // Don't try with cross-line selections + for (var i = 0; i < selections.length; i++) if (selections[i].head.line != selections[i].anchor.line) return; + } + if (this.state.completionActive) this.state.completionActive.close(); + var completion = this.state.completionActive = new Completion(this, options); + if (!completion.options.hint) return; + CodeMirror.signal(this, "startCompletion", this); + completion.update(true); + }); + CodeMirror.defineExtension("closeHint", function () { + if (this.state.completionActive) this.state.completionActive.close(); + }); + function Completion(cm, options) { + this.cm = cm; + this.options = options; + this.widget = null; + this.debounce = 0; + this.tick = 0; + this.startPos = this.cm.getCursor("start"); + this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length; + if (this.options.updateOnCursorActivity) { + var self = this; + cm.on("cursorActivity", this.activityFunc = function () { + self.cursorActivity(); + }); + } + } + var requestAnimationFrame = window.requestAnimationFrame || function (fn) { + return setTimeout(fn, 1000 / 60); + }; + var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; + Completion.prototype = { + close: function () { + if (!this.active()) return; + this.cm.state.completionActive = null; + this.tick = null; + if (this.options.updateOnCursorActivity) { + this.cm.off("cursorActivity", this.activityFunc); + } + if (this.widget && this.data) CodeMirror.signal(this.data, "close"); + if (this.widget) this.widget.close(); + CodeMirror.signal(this.cm, "endCompletion", this.cm); + }, + active: function () { + return this.cm.state.completionActive == this; + }, + pick: function (data, i) { + var completion = data.list[i], + self = this; + this.cm.operation(function () { + if (completion.hint) completion.hint(self.cm, data, completion);else self.cm.replaceRange(getText(completion), completion.from || data.from, completion.to || data.to, "complete"); + CodeMirror.signal(data, "pick", completion); + self.cm.scrollIntoView(); + }); + if (this.options.closeOnPick) { + this.close(); + } + }, + cursorActivity: function () { + if (this.debounce) { + cancelAnimationFrame(this.debounce); + this.debounce = 0; + } + var identStart = this.startPos; + if (this.data) { + identStart = this.data.from; + } + var pos = this.cm.getCursor(), + line = this.cm.getLine(pos.line); + if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || pos.ch < identStart.ch || this.cm.somethingSelected() || !pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1))) { + this.close(); + } else { + var self = this; + this.debounce = requestAnimationFrame(function () { + self.update(); + }); + if (this.widget) this.widget.disable(); + } + }, + update: function (first) { + if (this.tick == null) return; + var self = this, + myTick = ++this.tick; + fetchHints(this.options.hint, this.cm, this.options, function (data) { + if (self.tick == myTick) self.finishUpdate(data, first); + }); + }, + finishUpdate: function (data, first) { + if (this.data) CodeMirror.signal(this.data, "update"); + var picked = this.widget && this.widget.picked || first && this.options.completeSingle; + if (this.widget) this.widget.close(); + this.data = data; + if (data && data.list.length) { + if (picked && data.list.length == 1) { + this.pick(data, 0); + } else { + this.widget = new Widget(this, data); + CodeMirror.signal(data, "shown"); } } - next = next.v; } - // We might have a tree node without a value; skip and use a numeric entity. - if (next !== undefined) { - ret += next; - lastIdx = i + 1; - } else { - var cp = (0, escape_js_1.getCodePoint)(str, i); - ret += "&#x".concat(cp.toString(16), ";"); - // Increase by 1 if we have a surrogate pair - lastIdx = regExp.lastIndex += Number(cp !== char); + }; + function parseOptions(cm, pos, options) { + var editor = cm.options.hintOptions; + var out = {}; + for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; + if (editor) for (var prop in editor) if (editor[prop] !== undefined) out[prop] = editor[prop]; + if (options) for (var prop in options) if (options[prop] !== undefined) out[prop] = options[prop]; + if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos); + return out; + } + function getText(completion) { + if (typeof completion == "string") return completion;else return completion.text; + } + function buildKeyMap(completion, handle) { + var baseMap = { + Up: function () { + handle.moveFocus(-1); + }, + Down: function () { + handle.moveFocus(1); + }, + PageUp: function () { + handle.moveFocus(-handle.menuSize() + 1, true); + }, + PageDown: function () { + handle.moveFocus(handle.menuSize() - 1, true); + }, + Home: function () { + handle.setFocus(0); + }, + End: function () { + handle.setFocus(handle.length - 1); + }, + Enter: handle.pick, + Tab: handle.pick, + Esc: handle.close + }; + var mac = /Mac/.test(navigator.platform); + if (mac) { + baseMap["Ctrl-P"] = function () { + handle.moveFocus(-1); + }; + baseMap["Ctrl-N"] = function () { + handle.moveFocus(1); + }; } + var custom = completion.options.customKeys; + var ourMap = custom ? {} : baseMap; + function addBinding(key, val) { + var bound; + if (typeof val != "string") bound = function (cm) { + return val(cm, handle); + }; + // This mechanism is deprecated + else if (baseMap.hasOwnProperty(val)) bound = baseMap[val];else bound = val; + ourMap[key] = bound; + } + if (custom) for (var key in custom) if (custom.hasOwnProperty(key)) addBinding(key, custom[key]); + var extra = completion.options.extraKeys; + if (extra) for (var key in extra) if (extra.hasOwnProperty(key)) addBinding(key, extra[key]); + return ourMap; + } + function getHintElement(hintsElement, el) { + while (el && el != hintsElement) { + if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el; + el = el.parentNode; + } + } + function Widget(completion, data) { + this.id = "cm-complete-" + Math.floor(Math.random(1e6)); + this.completion = completion; + this.data = data; + this.picked = false; + var widget = this, + cm = completion.cm; + var ownerDocument = cm.getInputField().ownerDocument; + var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow; + var hints = this.hints = ownerDocument.createElement("ul"); + hints.setAttribute("role", "listbox"); + hints.setAttribute("aria-expanded", "true"); + hints.id = this.id; + var theme = completion.cm.options.theme; + hints.className = "CodeMirror-hints " + theme; + this.selectedHint = data.selectedHint || 0; + var completions = data.list; + for (var i = 0; i < completions.length; ++i) { + var elt = hints.appendChild(ownerDocument.createElement("li")), + cur = completions[i]; + var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS); + if (cur.className != null) className = cur.className + " " + className; + elt.className = className; + if (i == this.selectedHint) elt.setAttribute("aria-selected", "true"); + elt.id = this.id + "-" + i; + elt.setAttribute("role", "option"); + if (cur.render) cur.render(elt, data, cur);else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur))); + elt.hintId = i; + } + var container = completion.options.container || ownerDocument.body; + var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); + var left = pos.left, + top = pos.bottom, + below = true; + var offsetLeft = 0, + offsetTop = 0; + if (container !== ownerDocument.body) { + // We offset the cursor position because left and top are relative to the offsetParent's top left corner. + var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1; + var offsetParent = isContainerPositioned ? container : container.offsetParent; + var offsetParentPosition = offsetParent.getBoundingClientRect(); + var bodyPosition = ownerDocument.body.getBoundingClientRect(); + offsetLeft = offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft; + offsetTop = offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop; + } + hints.style.left = left - offsetLeft + "px"; + hints.style.top = top - offsetTop + "px"; + + // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. + var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth); + var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight); + container.appendChild(hints); + cm.getInputField().setAttribute("aria-autocomplete", "list"); + cm.getInputField().setAttribute("aria-owns", this.id); + cm.getInputField().setAttribute("aria-activedescendant", this.id + "-" + this.selectedHint); + var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect(); + var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false; + + // Compute in the timeout to avoid reflow on init + var startScroll; + setTimeout(function () { + startScroll = cm.getScrollInfo(); + }); + var overlapY = box.bottom - winH; + if (overlapY > 0) { + var height = box.bottom - box.top, + curTop = pos.top - (pos.bottom - box.top); + if (curTop - height > 0) { + // Fits above cursor + hints.style.top = (top = pos.top - height - offsetTop) + "px"; + below = false; + } else if (height > winH) { + hints.style.height = winH - 5 + "px"; + hints.style.top = (top = pos.bottom - box.top - offsetTop) + "px"; + var cursor = cm.getCursor(); + if (data.from.ch != cursor.ch) { + pos = cm.cursorCoords(cursor); + hints.style.left = (left = pos.left - offsetLeft) + "px"; + box = hints.getBoundingClientRect(); + } + } + } + var overlapX = box.right - winW; + if (scrolls) overlapX += cm.display.nativeBarWidth; + if (overlapX > 0) { + if (box.right - box.left > winW) { + hints.style.width = winW - 5 + "px"; + overlapX -= box.right - box.left - winW; + } + hints.style.left = (left = pos.left - overlapX - offsetLeft) + "px"; + } + if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling) node.style.paddingRight = cm.display.nativeBarWidth + "px"; + cm.addKeyMap(this.keyMap = buildKeyMap(completion, { + moveFocus: function (n, avoidWrap) { + widget.changeActive(widget.selectedHint + n, avoidWrap); + }, + setFocus: function (n) { + widget.changeActive(n); + }, + menuSize: function () { + return widget.screenAmount(); + }, + length: completions.length, + close: function () { + completion.close(); + }, + pick: function () { + widget.pick(); + }, + data: data + })); + if (completion.options.closeOnUnfocus) { + var closingOnBlur; + cm.on("blur", this.onBlur = function () { + closingOnBlur = setTimeout(function () { + completion.close(); + }, 100); + }); + cm.on("focus", this.onFocus = function () { + clearTimeout(closingOnBlur); + }); + } + cm.on("scroll", this.onScroll = function () { + var curScroll = cm.getScrollInfo(), + editor = cm.getWrapperElement().getBoundingClientRect(); + if (!startScroll) startScroll = cm.getScrollInfo(); + var newTop = top + startScroll.top - curScroll.top; + var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop); + if (!below) point += hints.offsetHeight; + if (point <= editor.top || point >= editor.bottom) return completion.close(); + hints.style.top = newTop + "px"; + hints.style.left = left + startScroll.left - curScroll.left + "px"; + }); + CodeMirror.on(hints, "dblclick", function (e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) { + widget.changeActive(t.hintId); + widget.pick(); + } + }); + CodeMirror.on(hints, "click", function (e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) { + widget.changeActive(t.hintId); + if (completion.options.completeOnSingleClick) widget.pick(); + } + }); + CodeMirror.on(hints, "mousedown", function () { + setTimeout(function () { + cm.focus(); + }, 20); + }); + + // The first hint doesn't need to be scrolled to on init + var selectedHintRange = this.getSelectedHintRange(); + if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) { + this.scrollToActive(); + } + CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]); + return true; } - return ret + str.substr(lastIdx); -} + Widget.prototype = { + close: function () { + if (this.completion.widget != this) return; + this.completion.widget = null; + if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints); + this.completion.cm.removeKeyMap(this.keyMap); + var input = this.completion.cm.getInputField(); + input.removeAttribute("aria-activedescendant"); + input.removeAttribute("aria-owns"); + var cm = this.completion.cm; + if (this.completion.options.closeOnUnfocus) { + cm.off("blur", this.onBlur); + cm.off("focus", this.onFocus); + } + cm.off("scroll", this.onScroll); + }, + disable: function () { + this.completion.cm.removeKeyMap(this.keyMap); + var widget = this; + this.keyMap = { + Enter: function () { + widget.picked = true; + } + }; + this.completion.cm.addKeyMap(this.keyMap); + }, + pick: function () { + this.completion.pick(this.data, this.selectedHint); + }, + changeActive: function (i, avoidWrap) { + if (i >= this.data.list.length) i = avoidWrap ? this.data.list.length - 1 : 0;else if (i < 0) i = avoidWrap ? 0 : this.data.list.length - 1; + if (this.selectedHint == i) return; + var node = this.hints.childNodes[this.selectedHint]; + if (node) { + node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); + node.removeAttribute("aria-selected"); + } + node = this.hints.childNodes[this.selectedHint = i]; + node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; + node.setAttribute("aria-selected", "true"); + this.completion.cm.getInputField().setAttribute("aria-activedescendant", node.id); + this.scrollToActive(); + CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); + }, + scrollToActive: function () { + var selectedHintRange = this.getSelectedHintRange(); + var node1 = this.hints.childNodes[selectedHintRange.from]; + var node2 = this.hints.childNodes[selectedHintRange.to]; + var firstNode = this.hints.firstChild; + if (node1.offsetTop < this.hints.scrollTop) this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop; + }, + screenAmount: function () { + return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; + }, + getSelectedHintRange: function () { + var margin = this.completion.options.scrollMargin || 0; + return { + from: Math.max(0, this.selectedHint - margin), + to: Math.min(this.data.list.length - 1, this.selectedHint + margin) + }; + } + }; + function applicableHelpers(cm, helpers) { + if (!cm.somethingSelected()) return helpers; + var result = []; + for (var i = 0; i < helpers.length; i++) if (helpers[i].supportsSelection) result.push(helpers[i]); + return result; + } + function fetchHints(hint, cm, options, callback) { + if (hint.async) { + hint(cm, callback, options); + } else { + var result = hint(cm, options); + if (result && result.then) result.then(callback);else callback(result); + } + } + function resolveAutoHints(cm, pos) { + var helpers = cm.getHelpers(pos, "hint"), + words; + if (helpers.length) { + var resolved = function (cm, callback, options) { + var app = applicableHelpers(cm, helpers); + function run(i) { + if (i == app.length) return callback(null); + fetchHints(app[i], cm, options, function (result) { + if (result && result.list.length > 0) callback(result);else run(i + 1); + }); + } + run(0); + }; + resolved.async = true; + resolved.supportsSelection = true; + return resolved; + } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { + return function (cm) { + return CodeMirror.hint.fromList(cm, { + words: words + }); + }; + } else if (CodeMirror.hint.anyword) { + return function (cm, options) { + return CodeMirror.hint.anyword(cm, options); + }; + } else { + return function () {}; + } + } + CodeMirror.registerHelper("hint", "auto", { + resolve: resolveAutoHints + }); + CodeMirror.registerHelper("hint", "fromList", function (cm, options) { + var cur = cm.getCursor(), + token = cm.getTokenAt(cur); + var term, + from = CodeMirror.Pos(cur.line, token.start), + to = cur; + if (token.start < cur.ch && /\w/.test(token.string.charAt(cur.ch - token.start - 1))) { + term = token.string.substr(0, cur.ch - token.start); + } else { + term = ""; + from = cur; + } + var found = []; + for (var i = 0; i < options.words.length; i++) { + var word = options.words[i]; + if (word.slice(0, term.length) == term) found.push(word); + } + if (found.length) return { + list: found, + from: from, + to: to + }; + }); + CodeMirror.commands.autocomplete = CodeMirror.showHint; + var defaultOptions = { + hint: CodeMirror.hint.auto, + completeSingle: true, + alignWithWord: true, + closeCharacters: /[\s()\[\]{};:>,]/, + closeOnPick: true, + closeOnUnfocus: true, + updateOnCursorActivity: true, + completeOnSingleClick: true, + container: null, + customKeys: null, + extraKeys: null, + paddingForScrollbar: true, + moveOnOverlap: true + }; + CodeMirror.defineOption("hintOptions", null); +}); /***/ }), -/***/ "../../../node_modules/entities/lib/escape.js": -/*!****************************************************!*\ - !*** ../../../node_modules/entities/lib/escape.js ***! - \****************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - +/***/ "../../../node_modules/codemirror/addon/lint/lint.js": +/*!***********************************************************!*\ + !*** ../../../node_modules/codemirror/addon/lint/lint.js ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.getCodePoint = exports.xmlReplacer = void 0; -exports.xmlReplacer = /["&'<>$\x80-\uFFFF]/g; -var xmlCodeMap = new Map([[34, """], [38, "&"], [39, "'"], [60, "<"], [62, ">"]]); -// For compatibility with node < 4, we wrap `codePointAt` -exports.getCodePoint = -// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -String.prototype.codePointAt != null ? function (str, index) { - return str.codePointAt(index); -} : -// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae -function (c, index) { - return (c.charCodeAt(index) & 0xfc00) === 0xd800 ? (c.charCodeAt(index) - 0xd800) * 0x400 + c.charCodeAt(index + 1) - 0xdc00 + 0x10000 : c.charCodeAt(index); -}; -/** - * Encodes all non-ASCII characters, as well as characters not valid in XML - * documents using XML entities. - * - * If a character has no equivalent entity, a - * numeric hexadecimal reference (eg. `ü`) will be used. - */ -function encodeXML(str) { - var ret = ""; - var lastIdx = 0; - var match; - while ((match = exports.xmlReplacer.exec(str)) !== null) { - var i = match.index; - var char = str.charCodeAt(i); - var next = xmlCodeMap.get(char); - if (next !== undefined) { - ret += str.substring(lastIdx, i) + next; - lastIdx = i + 1; +"use strict"; + + +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"));else {} +})(function (CodeMirror) { + "use strict"; + + var GUTTER_ID = "CodeMirror-lint-markers"; + var LINT_LINE_ID = "CodeMirror-lint-line-"; + function showTooltip(cm, e, content) { + var tt = document.createElement("div"); + tt.className = "CodeMirror-lint-tooltip cm-s-" + cm.options.theme; + tt.appendChild(content.cloneNode(true)); + if (cm.state.lint.options.selfContain) cm.getWrapperElement().appendChild(tt);else document.body.appendChild(tt); + function position(e) { + if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position); + tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px"; + tt.style.left = e.clientX + 5 + "px"; + } + CodeMirror.on(document, "mousemove", position); + position(e); + if (tt.style.opacity != null) tt.style.opacity = 1; + return tt; + } + function rm(elt) { + if (elt.parentNode) elt.parentNode.removeChild(elt); + } + function hideTooltip(tt) { + if (!tt.parentNode) return; + if (tt.style.opacity == null) rm(tt); + tt.style.opacity = 0; + setTimeout(function () { + rm(tt); + }, 600); + } + function showTooltipFor(cm, e, content, node) { + var tooltip = showTooltip(cm, e, content); + function hide() { + CodeMirror.off(node, "mouseout", hide); + if (tooltip) { + hideTooltip(tooltip); + tooltip = null; + } + } + var poll = setInterval(function () { + if (tooltip) for (var n = node;; n = n.parentNode) { + if (n && n.nodeType == 11) n = n.host; + if (n == document.body) return; + if (!n) { + hide(); + break; + } + } + if (!tooltip) return clearInterval(poll); + }, 400); + CodeMirror.on(node, "mouseout", hide); + } + function LintState(cm, conf, hasGutter) { + this.marked = []; + if (conf instanceof Function) conf = { + getAnnotations: conf + }; + if (!conf || conf === true) conf = {}; + this.options = {}; + this.linterOptions = conf.options || {}; + for (var prop in defaults) this.options[prop] = defaults[prop]; + for (var prop in conf) { + if (defaults.hasOwnProperty(prop)) { + if (conf[prop] != null) this.options[prop] = conf[prop]; + } else if (!conf.options) { + this.linterOptions[prop] = conf[prop]; + } + } + this.timeout = null; + this.hasGutter = hasGutter; + this.onMouseOver = function (e) { + onMouseOver(cm, e); + }; + this.waitingFor = 0; + } + var defaults = { + highlightLines: false, + tooltips: true, + delay: 500, + lintOnChange: true, + getAnnotations: null, + async: false, + selfContain: null, + formatAnnotation: null, + onUpdateLinting: null + }; + function clearMarks(cm) { + var state = cm.state.lint; + if (state.hasGutter) cm.clearGutter(GUTTER_ID); + if (state.options.highlightLines) clearErrorLines(cm); + for (var i = 0; i < state.marked.length; ++i) state.marked[i].clear(); + state.marked.length = 0; + } + function clearErrorLines(cm) { + cm.eachLine(function (line) { + var has = line.wrapClass && /\bCodeMirror-lint-line-\w+\b/.exec(line.wrapClass); + if (has) cm.removeLineClass(line, "wrap", has[0]); + }); + } + function makeMarker(cm, labels, severity, multiple, tooltips) { + var marker = document.createElement("div"), + inner = marker; + marker.className = "CodeMirror-lint-marker CodeMirror-lint-marker-" + severity; + if (multiple) { + inner = marker.appendChild(document.createElement("div")); + inner.className = "CodeMirror-lint-marker CodeMirror-lint-marker-multiple"; + } + if (tooltips != false) CodeMirror.on(inner, "mouseover", function (e) { + showTooltipFor(cm, e, labels, inner); + }); + return marker; + } + function getMaxSeverity(a, b) { + if (a == "error") return a;else return b; + } + function groupByLine(annotations) { + var lines = []; + for (var i = 0; i < annotations.length; ++i) { + var ann = annotations[i], + line = ann.from.line; + (lines[line] || (lines[line] = [])).push(ann); + } + return lines; + } + function annotationTooltip(ann) { + var severity = ann.severity; + if (!severity) severity = "error"; + var tip = document.createElement("div"); + tip.className = "CodeMirror-lint-message CodeMirror-lint-message-" + severity; + if (typeof ann.messageHTML != 'undefined') { + tip.innerHTML = ann.messageHTML; } else { - ret += "".concat(str.substring(lastIdx, i), "&#x").concat((0, exports.getCodePoint)(str, i).toString(16), ";"); - // Increase by 1 if we have a surrogate pair - lastIdx = exports.xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800); + tip.appendChild(document.createTextNode(ann.message)); + } + return tip; + } + function lintAsync(cm, getAnnotations) { + var state = cm.state.lint; + var id = ++state.waitingFor; + function abort() { + id = -1; + cm.off("change", abort); + } + cm.on("change", abort); + getAnnotations(cm.getValue(), function (annotations, arg2) { + cm.off("change", abort); + if (state.waitingFor != id) return; + if (arg2 && annotations instanceof CodeMirror) annotations = arg2; + cm.operation(function () { + updateLinting(cm, annotations); + }); + }, state.linterOptions, cm); + } + function startLinting(cm) { + var state = cm.state.lint; + if (!state) return; + var options = state.options; + /* + * Passing rules in `options` property prevents JSHint (and other linters) from complaining + * about unrecognized rules like `onUpdateLinting`, `delay`, `lintOnChange`, etc. + */ + var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint"); + if (!getAnnotations) return; + if (options.async || getAnnotations.async) { + lintAsync(cm, getAnnotations); + } else { + var annotations = getAnnotations(cm.getValue(), state.linterOptions, cm); + if (!annotations) return; + if (annotations.then) annotations.then(function (issues) { + cm.operation(function () { + updateLinting(cm, issues); + }); + });else cm.operation(function () { + updateLinting(cm, annotations); + }); } } - return ret + str.substr(lastIdx); -} -exports.encodeXML = encodeXML; -/** - * Encodes all non-ASCII characters, as well as characters not valid in XML - * documents using numeric hexadecimal reference (eg. `ü`). - * - * Have a look at `escapeUTF8` if you want a more concise output at the expense - * of reduced transportability. - * - * @param data String to escape. - */ -exports.escape = encodeXML; -/** - * Creates a function that escapes all characters matched by the given regular - * expression using the given map of characters to escape to their entities. - * - * @param regex Regular expression to match characters to escape. - * @param map Map of characters to escape to their entities. - * - * @returns Function that escapes all characters matched by the given regular - * expression using the given map of characters to escape to their entities. - */ -function getEscaper(regex, map) { - return function escape(data) { - var match; - var lastIdx = 0; - var result = ""; - while (match = regex.exec(data)) { - if (lastIdx !== match.index) { - result += data.substring(lastIdx, match.index); + function updateLinting(cm, annotationsNotSorted) { + var state = cm.state.lint; + if (!state) return; + var options = state.options; + clearMarks(cm); + var annotations = groupByLine(annotationsNotSorted); + for (var line = 0; line < annotations.length; ++line) { + var anns = annotations[line]; + if (!anns) continue; + + // filter out duplicate messages + var message = []; + anns = anns.filter(function (item) { + return message.indexOf(item.message) > -1 ? false : message.push(item.message); + }); + var maxSeverity = null; + var tipLabel = state.hasGutter && document.createDocumentFragment(); + for (var i = 0; i < anns.length; ++i) { + var ann = anns[i]; + var severity = ann.severity; + if (!severity) severity = "error"; + maxSeverity = getMaxSeverity(maxSeverity, severity); + if (options.formatAnnotation) ann = options.formatAnnotation(ann); + if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann)); + if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, { + className: "CodeMirror-lint-mark CodeMirror-lint-mark-" + severity, + __annotation: ann + })); } - // We know that this character will be in the map. - result += map.get(match[0].charCodeAt(0)); - // Every match will be of length 1 - lastIdx = match.index + 1; + // use original annotations[line] to show multiple messages + if (state.hasGutter) cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, annotations[line].length > 1, options.tooltips)); + if (options.highlightLines) cm.addLineClass(line, "wrap", LINT_LINE_ID + maxSeverity); + } + if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm); + } + function onChange(cm) { + var state = cm.state.lint; + if (!state) return; + clearTimeout(state.timeout); + state.timeout = setTimeout(function () { + startLinting(cm); + }, state.options.delay); + } + function popupTooltips(cm, annotations, e) { + var target = e.target || e.srcElement; + var tooltip = document.createDocumentFragment(); + for (var i = 0; i < annotations.length; i++) { + var ann = annotations[i]; + tooltip.appendChild(annotationTooltip(ann)); + } + showTooltipFor(cm, e, tooltip, target); + } + function onMouseOver(cm, e) { + var target = e.target || e.srcElement; + if (!/\bCodeMirror-lint-mark-/.test(target.className)) return; + var box = target.getBoundingClientRect(), + x = (box.left + box.right) / 2, + y = (box.top + box.bottom) / 2; + var spans = cm.findMarksAt(cm.coordsChar({ + left: x, + top: y + }, "client")); + var annotations = []; + for (var i = 0; i < spans.length; ++i) { + var ann = spans[i].__annotation; + if (ann) annotations.push(ann); } - return result + data.substring(lastIdx); - }; -} -/** - * Encodes all characters not valid in XML documents using XML entities. - * - * Note that the output will be character-set dependent. - * - * @param data String to escape. - */ -exports.escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap); -/** - * Encodes all characters that have to be escaped in HTML attributes, - * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. - * - * @param data String to escape. - */ -exports.escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([[34, """], [38, "&"], [160, " "]])); -/** - * Encodes all characters that have to be escaped in HTML text, - * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. - * - * @param data String to escape. - */ -exports.escapeText = getEscaper(/[&<>\u00A0]/g, new Map([[38, "&"], [60, "<"], [62, ">"], [160, " "]])); + if (annotations.length) popupTooltips(cm, annotations, e); + } + CodeMirror.defineOption("lint", false, function (cm, val, old) { + if (old && old != CodeMirror.Init) { + clearMarks(cm); + if (cm.state.lint.options.lintOnChange !== false) cm.off("change", onChange); + CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver); + clearTimeout(cm.state.lint.timeout); + delete cm.state.lint; + } + if (val) { + var gutters = cm.getOption("gutters"), + hasLintGutter = false; + for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true; + var state = cm.state.lint = new LintState(cm, val, hasLintGutter); + if (state.options.lintOnChange) cm.on("change", onChange); + if (state.options.tooltips != false && state.options.tooltips != "gutter") CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); + startLinting(cm); + } + }); + CodeMirror.defineExtension("performLint", function () { + startLinting(this); + }); +}); /***/ }), -/***/ "../../../node_modules/entities/lib/generated/decode-data-html.js": -/*!************************************************************************!*\ - !*** ../../../node_modules/entities/lib/generated/decode-data-html.js ***! - \************************************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/codemirror/addon/search/jump-to-line.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/search/jump-to-line.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -// Generated using scripts/write-decode-map.ts -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = new Uint16Array( -// prettier-ignore -"\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b\"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c".split("").map(function (c) { - return c.charCodeAt(0); -})); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +// Defines jumpToLine command. Uses dialog.js if present. + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"), __webpack_require__(/*! ../dialog/dialog */ "../../../node_modules/codemirror/addon/dialog/dialog.js"));else {} +})(function (CodeMirror) { + "use strict"; + + // default search panel location + CodeMirror.defineOption("search", { + bottom: false + }); + function dialog(cm, text, shortText, deflt, f) { + if (cm.openDialog) cm.openDialog(text, f, { + value: deflt, + selectValueOnOpen: true, + bottom: cm.options.search.bottom + });else f(prompt(shortText, deflt)); + } + function getJumpDialog(cm) { + return cm.phrase("Jump to line:") + ' ' + cm.phrase("(Use line:column or scroll% syntax)") + ''; + } + function interpretLine(cm, string) { + var num = Number(string); + if (/^[-+]/.test(string)) return cm.getCursor().line + num;else return num - 1; + } + CodeMirror.commands.jumpToLine = function (cm) { + var cur = cm.getCursor(); + dialog(cm, getJumpDialog(cm), cm.phrase("Jump to line:"), cur.line + 1 + ":" + cur.ch, function (posStr) { + if (!posStr) return; + var match; + if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) { + cm.setCursor(interpretLine(cm, match[1]), Number(match[2])); + } else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) { + var line = Math.round(cm.lineCount() * Number(match[1]) / 100); + if (/^[-+]/.test(match[1])) line = cur.line + line + 1; + cm.setCursor(line - 1, cur.ch); + } else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) { + cm.setCursor(interpretLine(cm, match[1]), cur.ch); + } + }); + }; + CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine"; +}); /***/ }), -/***/ "../../../node_modules/entities/lib/generated/decode-data-xml.js": -/*!***********************************************************************!*\ - !*** ../../../node_modules/entities/lib/generated/decode-data-xml.js ***! - \***********************************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/codemirror/addon/search/search.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/search/search.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -// Generated using scripts/write-decode-map.ts -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = new Uint16Array( -// prettier-ignore -"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022".split("").map(function (c) { - return c.charCodeAt(0); -})); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +// Define search commands. Depends on dialog.js or another +// implementation of the openDialog method. + +// Replace works a little oddly -- it will do the replace on the next +// Ctrl-G (or whatever is bound to findNext) press. You prevent a +// replace by making sure the match is no longer selected when hitting +// Ctrl-G. + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"), __webpack_require__(/*! ./searchcursor */ "../../../node_modules/codemirror/addon/search/searchcursor.js"), __webpack_require__(/*! ../dialog/dialog */ "../../../node_modules/codemirror/addon/dialog/dialog.js"));else {} +})(function (CodeMirror) { + "use strict"; + + // default search panel location + CodeMirror.defineOption("search", { + bottom: false + }); + function searchOverlay(query, caseInsensitive) { + if (typeof query == "string") query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");else if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "gi" : "g"); + return { + token: function (stream) { + query.lastIndex = stream.pos; + var match = query.exec(stream.string); + if (match && match.index == stream.pos) { + stream.pos += match[0].length || 1; + return "searching"; + } else if (match) { + stream.pos = match.index; + } else { + stream.skipToEnd(); + } + } + }; + } + function SearchState() { + this.posFrom = this.posTo = this.lastQuery = this.query = null; + this.overlay = null; + } + function getSearchState(cm) { + return cm.state.search || (cm.state.search = new SearchState()); + } + function queryCaseInsensitive(query) { + return typeof query == "string" && query == query.toLowerCase(); + } + function getSearchCursor(cm, query, pos) { + // Heuristic: if the query string is all lowercase, do a case insensitive search. + return cm.getSearchCursor(query, pos, { + caseFold: queryCaseInsensitive(query), + multiline: true + }); + } + function persistentDialog(cm, text, deflt, onEnter, onKeyDown) { + cm.openDialog(text, onEnter, { + value: deflt, + selectValueOnOpen: true, + closeOnEnter: false, + onClose: function () { + clearSearch(cm); + }, + onKeyDown: onKeyDown, + bottom: cm.options.search.bottom + }); + } + function dialog(cm, text, shortText, deflt, f) { + if (cm.openDialog) cm.openDialog(text, f, { + value: deflt, + selectValueOnOpen: true, + bottom: cm.options.search.bottom + });else f(prompt(shortText, deflt)); + } + function confirmDialog(cm, text, shortText, fs) { + if (cm.openConfirm) cm.openConfirm(text, fs);else if (confirm(shortText)) fs[0](); + } + function parseString(string) { + return string.replace(/\\([nrt\\])/g, function (match, ch) { + if (ch == "n") return "\n"; + if (ch == "r") return "\r"; + if (ch == "t") return "\t"; + if (ch == "\\") return "\\"; + return match; + }); + } + function parseQuery(query) { + var isRE = query.match(/^\/(.*)\/([a-z]*)$/); + if (isRE) { + try { + query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); + } catch (e) {} // Not a regular expression after all, do a string search + } else { + query = parseString(query); + } + if (typeof query == "string" ? query == "" : query.test("")) query = /x^/; + return query; + } + function startSearch(cm, state, query) { + state.queryText = query; + state.query = parseQuery(query); + cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query)); + state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query)); + cm.addOverlay(state.overlay); + if (cm.showMatchesOnScrollbar) { + if (state.annotate) { + state.annotate.clear(); + state.annotate = null; + } + state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query)); + } + } + function doSearch(cm, rev, persistent, immediate) { + var state = getSearchState(cm); + if (state.query) return findNext(cm, rev); + var q = cm.getSelection() || state.lastQuery; + if (q instanceof RegExp && q.source == "x^") q = null; + if (persistent && cm.openDialog) { + var hiding = null; + var searchNext = function (query, event) { + CodeMirror.e_stop(event); + if (!query) return; + if (query != state.queryText) { + startSearch(cm, state, query); + state.posFrom = state.posTo = cm.getCursor(); + } + if (hiding) hiding.style.opacity = 1; + findNext(cm, event.shiftKey, function (_, to) { + var dialog; + if (to.line < 3 && document.querySelector && (dialog = cm.display.wrapper.querySelector(".CodeMirror-dialog")) && dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top) (hiding = dialog).style.opacity = .4; + }); + }; + persistentDialog(cm, getQueryDialog(cm), q, searchNext, function (event, query) { + var keyName = CodeMirror.keyName(event); + var extra = cm.getOption('extraKeys'), + cmd = extra && extra[keyName] || CodeMirror.keyMap[cm.getOption("keyMap")][keyName]; + if (cmd == "findNext" || cmd == "findPrev" || cmd == "findPersistentNext" || cmd == "findPersistentPrev") { + CodeMirror.e_stop(event); + startSearch(cm, getSearchState(cm), query); + cm.execCommand(cmd); + } else if (cmd == "find" || cmd == "findPersistent") { + CodeMirror.e_stop(event); + searchNext(query, event); + } + }); + if (immediate && q) { + startSearch(cm, state, q); + findNext(cm, rev); + } + } else { + dialog(cm, getQueryDialog(cm), "Search for:", q, function (query) { + if (query && !state.query) cm.operation(function () { + startSearch(cm, state, query); + state.posFrom = state.posTo = cm.getCursor(); + findNext(cm, rev); + }); + }); + } + } + function findNext(cm, rev, callback) { + cm.operation(function () { + var state = getSearchState(cm); + var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); + if (!cursor.find(rev)) { + cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0)); + if (!cursor.find(rev)) return; + } + cm.setSelection(cursor.from(), cursor.to()); + cm.scrollIntoView({ + from: cursor.from(), + to: cursor.to() + }, 20); + state.posFrom = cursor.from(); + state.posTo = cursor.to(); + if (callback) callback(cursor.from(), cursor.to()); + }); + } + function clearSearch(cm) { + cm.operation(function () { + var state = getSearchState(cm); + state.lastQuery = state.query; + if (!state.query) return; + state.query = state.queryText = null; + cm.removeOverlay(state.overlay); + if (state.annotate) { + state.annotate.clear(); + state.annotate = null; + } + }); + } + function el(tag, attrs) { + var element = tag ? document.createElement(tag) : document.createDocumentFragment(); + for (var key in attrs) { + element[key] = attrs[key]; + } + for (var i = 2; i < arguments.length; i++) { + var child = arguments[i]; + element.appendChild(typeof child == "string" ? document.createTextNode(child) : child); + } + return element; + } + function getQueryDialog(cm) { + return el("", null, el("span", { + className: "CodeMirror-search-label" + }, cm.phrase("Search:")), " ", el("input", { + type: "text", + "style": "width: 10em", + className: "CodeMirror-search-field" + }), " ", el("span", { + style: "color: #888", + className: "CodeMirror-search-hint" + }, cm.phrase("(Use /re/ syntax for regexp search)"))); + } + function getReplaceQueryDialog(cm) { + return el("", null, " ", el("input", { + type: "text", + "style": "width: 10em", + className: "CodeMirror-search-field" + }), " ", el("span", { + style: "color: #888", + className: "CodeMirror-search-hint" + }, cm.phrase("(Use /re/ syntax for regexp search)"))); + } + function getReplacementQueryDialog(cm) { + return el("", null, el("span", { + className: "CodeMirror-search-label" + }, cm.phrase("With:")), " ", el("input", { + type: "text", + "style": "width: 10em", + className: "CodeMirror-search-field" + })); + } + function getDoReplaceConfirm(cm) { + return el("", null, el("span", { + className: "CodeMirror-search-label" + }, cm.phrase("Replace?")), " ", el("button", {}, cm.phrase("Yes")), " ", el("button", {}, cm.phrase("No")), " ", el("button", {}, cm.phrase("All")), " ", el("button", {}, cm.phrase("Stop"))); + } + function replaceAll(cm, query, text) { + cm.operation(function () { + for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { + if (typeof query != "string") { + var match = cm.getRange(cursor.from(), cursor.to()).match(query); + cursor.replace(text.replace(/\$(\d)/g, function (_, i) { + return match[i]; + })); + } else cursor.replace(text); + } + }); + } + function replace(cm, all) { + if (cm.getOption("readOnly")) return; + var query = cm.getSelection() || getSearchState(cm).lastQuery; + var dialogText = all ? cm.phrase("Replace all:") : cm.phrase("Replace:"); + var fragment = el("", null, el("span", { + className: "CodeMirror-search-label" + }, dialogText), getReplaceQueryDialog(cm)); + dialog(cm, fragment, dialogText, query, function (query) { + if (!query) return; + query = parseQuery(query); + dialog(cm, getReplacementQueryDialog(cm), cm.phrase("Replace with:"), "", function (text) { + text = parseString(text); + if (all) { + replaceAll(cm, query, text); + } else { + clearSearch(cm); + var cursor = getSearchCursor(cm, query, cm.getCursor("from")); + var advance = function () { + var start = cursor.from(), + match; + if (!(match = cursor.findNext())) { + cursor = getSearchCursor(cm, query); + if (!(match = cursor.findNext()) || start && cursor.from().line == start.line && cursor.from().ch == start.ch) return; + } + cm.setSelection(cursor.from(), cursor.to()); + cm.scrollIntoView({ + from: cursor.from(), + to: cursor.to() + }); + confirmDialog(cm, getDoReplaceConfirm(cm), cm.phrase("Replace?"), [function () { + doReplace(match); + }, advance, function () { + replaceAll(cm, query, text); + }]); + }; + var doReplace = function (match) { + cursor.replace(typeof query == "string" ? text : text.replace(/\$(\d)/g, function (_, i) { + return match[i]; + })); + advance(); + }; + advance(); + } + }); + }); + } + CodeMirror.commands.find = function (cm) { + clearSearch(cm); + doSearch(cm); + }; + CodeMirror.commands.findPersistent = function (cm) { + clearSearch(cm); + doSearch(cm, false, true); + }; + CodeMirror.commands.findPersistentNext = function (cm) { + doSearch(cm, false, true, true); + }; + CodeMirror.commands.findPersistentPrev = function (cm) { + doSearch(cm, true, true, true); + }; + CodeMirror.commands.findNext = doSearch; + CodeMirror.commands.findPrev = function (cm) { + doSearch(cm, true); + }; + CodeMirror.commands.clearSearch = clearSearch; + CodeMirror.commands.replace = replace; + CodeMirror.commands.replaceAll = function (cm) { + replace(cm, true); + }; +}); /***/ }), -/***/ "../../../node_modules/entities/lib/generated/encode-html.js": -/*!*******************************************************************!*\ - !*** ../../../node_modules/entities/lib/generated/encode-html.js ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/codemirror/addon/search/searchcursor.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/codemirror/addon/search/searchcursor.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"));else {} +})(function (CodeMirror) { + "use strict"; + + var Pos = CodeMirror.Pos; + function regexpFlags(regexp) { + var flags = regexp.flags; + return flags != null ? flags : (regexp.ignoreCase ? "i" : "") + (regexp.global ? "g" : "") + (regexp.multiline ? "m" : ""); + } + function ensureFlags(regexp, flags) { + var current = regexpFlags(regexp), + target = current; + for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1) target += flags.charAt(i); + return current == target ? regexp : new RegExp(regexp.source, target); + } + function maybeMultiline(regexp) { + return /\\s|\\n|\n|\\W|\\D|\[\^/.test(regexp.source); + } + function searchRegexpForward(doc, regexp, start) { + regexp = ensureFlags(regexp, "g"); + for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) { + regexp.lastIndex = ch; + var string = doc.getLine(line), + match = regexp.exec(string); + if (match) return { + from: Pos(line, match.index), + to: Pos(line, match.index + match[0].length), + match: match + }; + } + } + function searchRegexpForwardMultiline(doc, regexp, start) { + if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start); + regexp = ensureFlags(regexp, "gm"); + var string, + chunk = 1; + for (var line = start.line, last = doc.lastLine(); line <= last;) { + // This grows the search buffer in exponentially-sized chunks + // between matches, so that nearby matches are fast and don't + // require concatenating the whole document (in case we're + // searching for something that has tons of matches), but at the + // same time, the amount of retries is limited. + for (var i = 0; i < chunk; i++) { + if (line > last) break; + var curLine = doc.getLine(line++); + string = string == null ? curLine : string + "\n" + curLine; + } + chunk = chunk * 2; + regexp.lastIndex = start.ch; + var match = regexp.exec(string); + if (match) { + var before = string.slice(0, match.index).split("\n"), + inside = match[0].split("\n"); + var startLine = start.line + before.length - 1, + startCh = before[before.length - 1].length; + return { + from: Pos(startLine, startCh), + to: Pos(startLine + inside.length - 1, inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), + match: match + }; + } + } + } + function lastMatchIn(string, regexp, endMargin) { + var match, + from = 0; + while (from <= string.length) { + regexp.lastIndex = from; + var newMatch = regexp.exec(string); + if (!newMatch) break; + var end = newMatch.index + newMatch[0].length; + if (end > string.length - endMargin) break; + if (!match || end > match.index + match[0].length) match = newMatch; + from = newMatch.index + 1; + } + return match; + } + function searchRegexpBackward(doc, regexp, start) { + regexp = ensureFlags(regexp, "g"); + for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) { + var string = doc.getLine(line); + var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch); + if (match) return { + from: Pos(line, match.index), + to: Pos(line, match.index + match[0].length), + match: match + }; + } + } + function searchRegexpBackwardMultiline(doc, regexp, start) { + if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start); + regexp = ensureFlags(regexp, "gm"); + var string, + chunkSize = 1, + endMargin = doc.getLine(start.line).length - start.ch; + for (var line = start.line, first = doc.firstLine(); line >= first;) { + for (var i = 0; i < chunkSize && line >= first; i++) { + var curLine = doc.getLine(line--); + string = string == null ? curLine : curLine + "\n" + string; + } + chunkSize *= 2; + var match = lastMatchIn(string, regexp, endMargin); + if (match) { + var before = string.slice(0, match.index).split("\n"), + inside = match[0].split("\n"); + var startLine = line + before.length, + startCh = before[before.length - 1].length; + return { + from: Pos(startLine, startCh), + to: Pos(startLine + inside.length - 1, inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), + match: match + }; + } + } + } + var doFold, noFold; + if (String.prototype.normalize) { + doFold = function (str) { + return str.normalize("NFD").toLowerCase(); + }; + noFold = function (str) { + return str.normalize("NFD"); + }; + } else { + doFold = function (str) { + return str.toLowerCase(); + }; + noFold = function (str) { + return str; + }; + } + + // Maps a position in a case-folded line back to a position in the original line + // (compensating for codepoints increasing in number during folding) + function adjustPos(orig, folded, pos, foldFunc) { + if (orig.length == folded.length) return pos; + for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) { + if (min == max) return min; + var mid = min + max >> 1; + var len = foldFunc(orig.slice(0, mid)).length; + if (len == pos) return mid;else if (len > pos) max = mid;else min = mid + 1; + } + } + function searchStringForward(doc, query, start, caseFold) { + // Empty string would match anything and never progress, so we + // define it to match nothing instead. + if (!query.length) return null; + var fold = caseFold ? doFold : noFold; + var lines = fold(query).split(/\r|\n\r?/); + search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) { + var orig = doc.getLine(line).slice(ch), + string = fold(orig); + if (lines.length == 1) { + var found = string.indexOf(lines[0]); + if (found == -1) continue search; + var start = adjustPos(orig, string, found, fold) + ch; + return { + from: Pos(line, adjustPos(orig, string, found, fold) + ch), + to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch) + }; + } else { + var cutFrom = string.length - lines[0].length; + if (string.slice(cutFrom) != lines[0]) continue search; + for (var i = 1; i < lines.length - 1; i++) if (fold(doc.getLine(line + i)) != lines[i]) continue search; + var end = doc.getLine(line + lines.length - 1), + endString = fold(end), + lastLine = lines[lines.length - 1]; + if (endString.slice(0, lastLine.length) != lastLine) continue search; + return { + from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch), + to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold)) + }; + } + } + } + function searchStringBackward(doc, query, start, caseFold) { + if (!query.length) return null; + var fold = caseFold ? doFold : noFold; + var lines = fold(query).split(/\r|\n\r?/); + search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) { + var orig = doc.getLine(line); + if (ch > -1) orig = orig.slice(0, ch); + var string = fold(orig); + if (lines.length == 1) { + var found = string.lastIndexOf(lines[0]); + if (found == -1) continue search; + return { + from: Pos(line, adjustPos(orig, string, found, fold)), + to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold)) + }; + } else { + var lastLine = lines[lines.length - 1]; + if (string.slice(0, lastLine.length) != lastLine) continue search; + for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++) if (fold(doc.getLine(start + i)) != lines[i]) continue search; + var top = doc.getLine(line + 1 - lines.length), + topString = fold(top); + if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search; + return { + from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)), + to: Pos(line, adjustPos(orig, string, lastLine.length, fold)) + }; + } + } + } + function SearchCursor(doc, query, pos, options) { + this.atOccurrence = false; + this.afterEmptyMatch = false; + this.doc = doc; + pos = pos ? doc.clipPos(pos) : Pos(0, 0); + this.pos = { + from: pos, + to: pos + }; + var caseFold; + if (typeof options == "object") { + caseFold = options.caseFold; + } else { + // Backwards compat for when caseFold was the 4th argument + caseFold = options; + options = null; + } + if (typeof query == "string") { + if (caseFold == null) caseFold = false; + this.matches = function (reverse, pos) { + return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold); + }; + } else { + query = ensureFlags(query, "gm"); + if (!options || options.multiline !== false) this.matches = function (reverse, pos) { + return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos); + };else this.matches = function (reverse, pos) { + return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos); + }; + } + } + SearchCursor.prototype = { + findNext: function () { + return this.find(false); + }, + findPrevious: function () { + return this.find(true); + }, + find: function (reverse) { + var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to); + if (this.afterEmptyMatch && this.atOccurrence) { + // do not return the same 0 width match twice + head = Pos(head.line, head.ch); + if (reverse) { + head.ch--; + if (head.ch < 0) { + head.line--; + head.ch = (this.doc.getLine(head.line) || "").length; + } + } else { + head.ch++; + if (head.ch > (this.doc.getLine(head.line) || "").length) { + head.ch = 0; + head.line++; + } + } + if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) { + return this.atOccurrence = false; + } + } + var result = this.matches(reverse, head); + this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0; + if (result) { + this.pos = result; + this.atOccurrence = true; + return this.pos.match || true; + } else { + var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0); + this.pos = { + from: end, + to: end + }; + return this.atOccurrence = false; + } + }, + from: function () { + if (this.atOccurrence) return this.pos.from; + }, + to: function () { + if (this.atOccurrence) return this.pos.to; + }, + replace: function (newText, origin) { + if (!this.atOccurrence) return; + var lines = CodeMirror.splitLines(newText); + this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin); + this.pos.to = Pos(this.pos.from.line + lines.length - 1, lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0)); + } + }; + CodeMirror.defineExtension("getSearchCursor", function (query, pos, caseFold) { + return new SearchCursor(this.doc, query, pos, caseFold); + }); + CodeMirror.defineDocExtension("getSearchCursor", function (query, pos, caseFold) { + return new SearchCursor(this, query, pos, caseFold); + }); + CodeMirror.defineExtension("selectMatches", function (query, caseFold) { + var ranges = []; + var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold); + while (cur.findNext()) { + if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break; + ranges.push({ + anchor: cur.from(), + head: cur.to() + }); + } + if (ranges.length) this.setSelections(ranges, 0); + }); +}); + +/***/ }), + +/***/ "../../../node_modules/codemirror/keymap/sublime.js": +/*!**********************************************************!*\ + !*** ../../../node_modules/codemirror/keymap/sublime.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -// Generated using scripts/write-encode-map.ts -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -function restoreDiff(arr) { - for (var i = 1; i < arr.length; i++) { - arr[i][0] += arr[i - 1][0] + 1; +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +// A rough approximation of Sublime Text's keybindings +// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js + +(function (mod) { + if (true) + // CommonJS + mod(__webpack_require__(/*! ../lib/codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"), __webpack_require__(/*! ../addon/search/searchcursor */ "../../../node_modules/codemirror/addon/search/searchcursor.js"), __webpack_require__(/*! ../addon/edit/matchbrackets */ "../../../node_modules/codemirror/addon/edit/matchbrackets.js"));else {} +})(function (CodeMirror) { + "use strict"; + + var cmds = CodeMirror.commands; + var Pos = CodeMirror.Pos; + + // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that. + function findPosSubword(doc, start, dir) { + if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1)); + var line = doc.getLine(start.line); + if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0)); + var state = "start", + type, + startPos = start.ch; + for (var pos = startPos, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) { + var next = line.charAt(dir < 0 ? pos - 1 : pos); + var cat = next != "_" && CodeMirror.isWordChar(next) ? "w" : "o"; + if (cat == "w" && next.toUpperCase() == next) cat = "W"; + if (state == "start") { + if (cat != "o") { + state = "in"; + type = cat; + } else startPos = pos + dir; + } else if (state == "in") { + if (type != cat) { + if (type == "w" && cat == "W" && dir < 0) pos--; + if (type == "W" && cat == "w" && dir > 0) { + // From uppercase to lowercase + if (pos == startPos + 1) { + type = "w"; + continue; + } else pos--; + } + break; + } + } + } + return Pos(start.line, pos); } - return arr; -} -// prettier-ignore -exports["default"] = new Map( /* #__PURE__ */restoreDiff([[9, " "], [0, " "], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { - v: "<", - n: 8402, - o: "<⃒" -}], [0, { - v: "=", - n: 8421, - o: "=⃥" -}], [0, { - v: ">", - n: 8402, - o: ">⃒" -}], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { - n: 106, - o: "fj" -}], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "¬"], [0, "­"], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, "‌"], [0, "‍"], [0, "‎"], [0, "‏"], [0, "‐"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { - v: " ", - n: 8202, - o: "  " -}], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { - v: "↝", - n: 824, - o: "↝̸" -}], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { - v: "∂", - n: 824, - o: "∂̸" -}], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { - v: "∠", - n: 8402, - o: "∠⃒" -}], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { - v: "∩", - n: 65024, - o: "∩︀" -}], [0, { - v: "∪", - n: 65024, - o: "∪︀" -}], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { - v: "∼", - n: 8402, - o: "∼⃒" -}], [0, { - v: "∽", - n: 817, - o: "∽̱" -}], [0, { - v: "∾", - n: 819, - o: "∾̳" -}], [0, "∿"], [0, "≀"], [0, "≁"], [0, { - v: "≂", - n: 824, - o: "≂̸" -}], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { - v: "≋", - n: 824, - o: "≋̸" -}], [0, "≌"], [0, { - v: "≍", - n: 8402, - o: "≍⃒" -}], [0, { - v: "≎", - n: 824, - o: "≎̸" -}], [0, { - v: "≏", - n: 824, - o: "≏̸" -}], [0, { - v: "≐", - n: 824, - o: "≐̸" -}], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { - v: "≡", - n: 8421, - o: "≡⃥" -}], [0, "≢"], [1, { - v: "≤", - n: 8402, - o: "≤⃒" -}], [0, { - v: "≥", - n: 8402, - o: "≥⃒" -}], [0, { - v: "≦", - n: 824, - o: "≦̸" -}], [0, { - v: "≧", - n: 824, - o: "≧̸" -}], [0, { - v: "≨", - n: 65024, - o: "≨︀" -}], [0, { - v: "≩", - n: 65024, - o: "≩︀" -}], [0, { - v: "≪", - n: new Map( /* #__PURE__ */restoreDiff([[824, "≪̸"], [7577, "≪⃒"]])) -}], [0, { - v: "≫", - n: new Map( /* #__PURE__ */restoreDiff([[824, "≫̸"], [7577, "≫⃒"]])) -}], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { - v: "≿", - n: 824, - o: "≿̸" -}], [0, "⊀"], [0, "⊁"], [0, { - v: "⊂", - n: 8402, - o: "⊂⃒" -}], [0, { - v: "⊃", - n: 8402, - o: "⊃⃒" -}], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { - v: "⊊", - n: 65024, - o: "⊊︀" -}], [0, { - v: "⊋", - n: 65024, - o: "⊋︀" -}], [1, "⊍"], [0, "⊎"], [0, { - v: "⊏", - n: 824, - o: "⊏̸" -}], [0, { - v: "⊐", - n: 824, - o: "⊐̸" -}], [0, "⊑"], [0, "⊒"], [0, { - v: "⊓", - n: 65024, - o: "⊓︀" -}], [0, { - v: "⊔", - n: 65024, - o: "⊔︀" -}], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { - v: "⊴", - n: 8402, - o: "⊴⃒" -}], [0, { - v: "⊵", - n: 8402, - o: "⊵⃒" -}], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { - v: "⋘", - n: 824, - o: "⋘̸" -}], [0, { - v: "⋙", - n: 824, - o: "⋙̸" -}], [0, { - v: "⋚", - n: 65024, - o: "⋚︀" -}], [0, { - v: "⋛", - n: 65024, - o: "⋛︀" -}], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { - v: "⋵", - n: 824, - o: "⋵̸" -}], [0, "⋶"], [0, "⋷"], [1, { - v: "⋹", - n: 824, - o: "⋹̸" -}], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "⟨"], [0, "⟩"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { - v: "⤳", - n: 824, - o: "⤳̸" -}], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { - v: "⧏", - n: 824, - o: "⧏̸" -}], [0, { - v: "⧐", - n: 824, - o: "⧐̸" -}], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { - v: "⩭", - n: 824, - o: "⩭̸" -}], [0, "⩮"], [0, "⩯"], [0, { - v: "⩰", - n: 824, - o: "⩰̸" -}], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { - v: "⩽", - n: 824, - o: "⩽̸" -}], [0, { - v: "⩾", - n: 824, - o: "⩾̸" -}], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { - v: "⪡", - n: 824, - o: "⪡̸" -}], [0, { - v: "⪢", - n: 824, - o: "⪢̸" -}], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { - v: "⪬", - n: 65024, - o: "⪬︀" -}], [0, { - v: "⪭", - n: 65024, - o: "⪭︀" -}], [0, "⪮"], [0, { - v: "⪯", - n: 824, - o: "⪯̸" -}], [0, { - v: "⪰", - n: 824, - o: "⪰̸" -}], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { - v: "⫅", - n: 824, - o: "⫅̸" -}], [0, { - v: "⫆", - n: 824, - o: "⫆̸" -}], [0, "⫇"], [0, "⫈"], [2, { - v: "⫋", - n: 65024, - o: "⫋︀" -}], [0, { - v: "⫌", - n: 65024, - o: "⫌︀" -}], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { - v: "⫽", - n: 8421, - o: "⫽⃥" -}], [44343, { - n: new Map( /* #__PURE__ */restoreDiff([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) -}], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]])); - -/***/ }), - -/***/ "../../../node_modules/entities/lib/index.js": -/*!***************************************************!*\ - !*** ../../../node_modules/entities/lib/index.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLAttribute = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.DecodingMode = exports.EntityDecoder = exports.encodeHTML5 = exports.encodeHTML4 = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.EntityLevel = void 0; -var decode_js_1 = __webpack_require__(/*! ./decode.js */ "../../../node_modules/entities/lib/decode.js"); -var encode_js_1 = __webpack_require__(/*! ./encode.js */ "../../../node_modules/entities/lib/encode.js"); -var escape_js_1 = __webpack_require__(/*! ./escape.js */ "../../../node_modules/entities/lib/escape.js"); -/** The level of entities to support. */ -var EntityLevel; -(function (EntityLevel) { - /** Support only XML entities. */ - EntityLevel[EntityLevel["XML"] = 0] = "XML"; - /** Support HTML entities, which are a superset of XML entities. */ - EntityLevel[EntityLevel["HTML"] = 1] = "HTML"; -})(EntityLevel = exports.EntityLevel || (exports.EntityLevel = {})); -var EncodingMode; -(function (EncodingMode) { - /** - * The output is UTF-8 encoded. Only characters that need escaping within - * XML will be escaped. - */ - EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8"; - /** - * The output consists only of ASCII characters. Characters that need - * escaping within HTML, and characters that aren't ASCII characters will - * be escaped. - */ - EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII"; - /** - * Encode all characters that have an equivalent entity, as well as all - * characters that are not ASCII characters. - */ - EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive"; - /** - * Encode all characters that have to be escaped in HTML attributes, - * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. - */ - EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute"; - /** - * Encode all characters that have to be escaped in HTML text, - * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. - */ - EncodingMode[EncodingMode["Text"] = 4] = "Text"; -})(EncodingMode = exports.EncodingMode || (exports.EncodingMode = {})); -/** - * Decodes a string with entities. - * - * @param data String to decode. - * @param options Decoding options. - */ -function decode(data, options) { - if (options === void 0) { - options = EntityLevel.XML; - } - var level = typeof options === "number" ? options : options.level; - if (level === EntityLevel.HTML) { - var mode = typeof options === "object" ? options.mode : undefined; - return (0, decode_js_1.decodeHTML)(data, mode); + function moveSubword(cm, dir) { + cm.extendSelectionsBy(function (range) { + if (cm.display.shift || cm.doc.extend || range.empty()) return findPosSubword(cm.doc, range.head, dir);else return dir < 0 ? range.from() : range.to(); + }); } - return (0, decode_js_1.decodeXML)(data); -} -exports.decode = decode; -/** - * Decodes a string with entities. Does not allow missing trailing semicolons for entities. - * - * @param data String to decode. - * @param options Decoding options. - * @deprecated Use `decode` with the `mode` set to `Strict`. - */ -function decodeStrict(data, options) { - var _a; - if (options === void 0) { - options = EntityLevel.XML; + cmds.goSubwordLeft = function (cm) { + moveSubword(cm, -1); + }; + cmds.goSubwordRight = function (cm) { + moveSubword(cm, 1); + }; + cmds.scrollLineUp = function (cm) { + var info = cm.getScrollInfo(); + if (!cm.somethingSelected()) { + var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local"); + if (cm.getCursor().line >= visibleBottomLine) cm.execCommand("goLineUp"); + } + cm.scrollTo(null, info.top - cm.defaultTextHeight()); + }; + cmds.scrollLineDown = function (cm) { + var info = cm.getScrollInfo(); + if (!cm.somethingSelected()) { + var visibleTopLine = cm.lineAtHeight(info.top, "local") + 1; + if (cm.getCursor().line <= visibleTopLine) cm.execCommand("goLineDown"); + } + cm.scrollTo(null, info.top + cm.defaultTextHeight()); + }; + cmds.splitSelectionByLine = function (cm) { + var ranges = cm.listSelections(), + lineRanges = []; + for (var i = 0; i < ranges.length; i++) { + var from = ranges[i].from(), + to = ranges[i].to(); + for (var line = from.line; line <= to.line; ++line) if (!(to.line > from.line && line == to.line && to.ch == 0)) lineRanges.push({ + anchor: line == from.line ? from : Pos(line, 0), + head: line == to.line ? to : Pos(line) + }); + } + cm.setSelections(lineRanges, 0); + }; + cmds.singleSelectionTop = function (cm) { + var range = cm.listSelections()[0]; + cm.setSelection(range.anchor, range.head, { + scroll: false + }); + }; + cmds.selectLine = function (cm) { + var ranges = cm.listSelections(), + extended = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + extended.push({ + anchor: Pos(range.from().line, 0), + head: Pos(range.to().line + 1, 0) + }); + } + cm.setSelections(extended); + }; + function insertLine(cm, above) { + if (cm.isReadOnly()) return CodeMirror.Pass; + cm.operation(function () { + var len = cm.listSelections().length, + newSelection = [], + last = -1; + for (var i = 0; i < len; i++) { + var head = cm.listSelections()[i].head; + if (head.line <= last) continue; + var at = Pos(head.line + (above ? 0 : 1), 0); + cm.replaceRange("\n", at, null, "+insertLine"); + cm.indentLine(at.line, null, true); + newSelection.push({ + head: at, + anchor: at + }); + last = head.line + 1; + } + cm.setSelections(newSelection); + }); + cm.execCommand("indentAuto"); } - var opts = typeof options === "number" ? { - level: options - } : options; - (_a = opts.mode) !== null && _a !== void 0 ? _a : opts.mode = decode_js_1.DecodingMode.Strict; - return decode(data, opts); -} -exports.decodeStrict = decodeStrict; -/** - * Encodes a string with entities. - * - * @param data String to encode. - * @param options Encoding options. - */ -function encode(data, options) { - if (options === void 0) { - options = EntityLevel.XML; + cmds.insertLineAfter = function (cm) { + return insertLine(cm, false); + }; + cmds.insertLineBefore = function (cm) { + return insertLine(cm, true); + }; + function wordAt(cm, pos) { + var start = pos.ch, + end = start, + line = cm.getLine(pos.line); + while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start; + while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end; + return { + from: Pos(pos.line, start), + to: Pos(pos.line, end), + word: line.slice(start, end) + }; } - var opts = typeof options === "number" ? { - level: options - } : options; - // Mode `UTF8` just escapes XML entities - if (opts.mode === EncodingMode.UTF8) return (0, escape_js_1.escapeUTF8)(data); - if (opts.mode === EncodingMode.Attribute) return (0, escape_js_1.escapeAttribute)(data); - if (opts.mode === EncodingMode.Text) return (0, escape_js_1.escapeText)(data); - if (opts.level === EntityLevel.HTML) { - if (opts.mode === EncodingMode.ASCII) { - return (0, encode_js_1.encodeNonAsciiHTML)(data); + cmds.selectNextOccurrence = function (cm) { + var from = cm.getCursor("from"), + to = cm.getCursor("to"); + var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel; + if (CodeMirror.cmpPos(from, to) == 0) { + var word = wordAt(cm, from); + if (!word.word) return; + cm.setSelection(word.from, word.to); + fullWord = true; + } else { + var text = cm.getRange(from, to); + var query = fullWord ? new RegExp("\\b" + text + "\\b") : text; + var cur = cm.getSearchCursor(query, to); + var found = cur.findNext(); + if (!found) { + cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0)); + found = cur.findNext(); + } + if (!found || isSelectedRange(cm.listSelections(), cur.from(), cur.to())) return; + cm.addSelection(cur.from(), cur.to()); + } + if (fullWord) cm.state.sublimeFindFullWord = cm.doc.sel; + }; + cmds.skipAndSelectNextOccurrence = function (cm) { + var prevAnchor = cm.getCursor("anchor"), + prevHead = cm.getCursor("head"); + cmds.selectNextOccurrence(cm); + if (CodeMirror.cmpPos(prevAnchor, prevHead) != 0) { + cm.doc.setSelections(cm.doc.listSelections().filter(function (sel) { + return sel.anchor != prevAnchor || sel.head != prevHead; + })); } - return (0, encode_js_1.encodeHTML)(data); + }; + function addCursorToSelection(cm, dir) { + var ranges = cm.listSelections(), + newRanges = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + var newAnchor = cm.findPosV(range.anchor, dir, "line", range.anchor.goalColumn); + var newHead = cm.findPosV(range.head, dir, "line", range.head.goalColumn); + newAnchor.goalColumn = range.anchor.goalColumn != null ? range.anchor.goalColumn : cm.cursorCoords(range.anchor, "div").left; + newHead.goalColumn = range.head.goalColumn != null ? range.head.goalColumn : cm.cursorCoords(range.head, "div").left; + var newRange = { + anchor: newAnchor, + head: newHead + }; + newRanges.push(range); + newRanges.push(newRange); + } + cm.setSelections(newRanges); } - // ASCII and Extensive are equivalent - return (0, escape_js_1.encodeXML)(data); -} -exports.encode = encode; -var escape_js_2 = __webpack_require__(/*! ./escape.js */ "../../../node_modules/entities/lib/escape.js"); -Object.defineProperty(exports, "encodeXML", ({ - enumerable: true, - get: function () { - return escape_js_2.encodeXML; + cmds.addCursorToPrevLine = function (cm) { + addCursorToSelection(cm, -1); + }; + cmds.addCursorToNextLine = function (cm) { + addCursorToSelection(cm, 1); + }; + function isSelectedRange(ranges, from, to) { + for (var i = 0; i < ranges.length; i++) if (CodeMirror.cmpPos(ranges[i].from(), from) == 0 && CodeMirror.cmpPos(ranges[i].to(), to) == 0) return true; + return false; } -})); -Object.defineProperty(exports, "escape", ({ - enumerable: true, - get: function () { - return escape_js_2.escape; + var mirror = "(){}[]"; + function selectBetweenBrackets(cm) { + var ranges = cm.listSelections(), + newRanges = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i], + pos = range.head, + opening = cm.scanForBracket(pos, -1); + if (!opening) return false; + for (;;) { + var closing = cm.scanForBracket(pos, 1); + if (!closing) return false; + if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) { + var startPos = Pos(opening.pos.line, opening.pos.ch + 1); + if (CodeMirror.cmpPos(startPos, range.from()) == 0 && CodeMirror.cmpPos(closing.pos, range.to()) == 0) { + opening = cm.scanForBracket(opening.pos, -1); + if (!opening) return false; + } else { + newRanges.push({ + anchor: startPos, + head: closing.pos + }); + break; + } + } + pos = Pos(closing.pos.line, closing.pos.ch + 1); + } + } + cm.setSelections(newRanges); + return true; } -})); -Object.defineProperty(exports, "escapeUTF8", ({ - enumerable: true, - get: function () { - return escape_js_2.escapeUTF8; + cmds.selectScope = function (cm) { + selectBetweenBrackets(cm) || cm.execCommand("selectAll"); + }; + cmds.selectBetweenBrackets = function (cm) { + if (!selectBetweenBrackets(cm)) return CodeMirror.Pass; + }; + function puncType(type) { + return !type ? null : /\bpunctuation\b/.test(type) ? type : undefined; + } + cmds.goToBracket = function (cm) { + cm.extendSelectionsBy(function (range) { + var next = cm.scanForBracket(range.head, 1, puncType(cm.getTokenTypeAt(range.head))); + if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos; + var prev = cm.scanForBracket(range.head, -1, puncType(cm.getTokenTypeAt(Pos(range.head.line, range.head.ch + 1)))); + return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head; + }); + }; + cmds.swapLineUp = function (cm) { + if (cm.isReadOnly()) return CodeMirror.Pass; + var ranges = cm.listSelections(), + linesToMove = [], + at = cm.firstLine() - 1, + newSels = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i], + from = range.from().line - 1, + to = range.to().line; + newSels.push({ + anchor: Pos(range.anchor.line - 1, range.anchor.ch), + head: Pos(range.head.line - 1, range.head.ch) + }); + if (range.to().ch == 0 && !range.empty()) --to; + if (from > at) linesToMove.push(from, to);else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; + at = to; + } + cm.operation(function () { + for (var i = 0; i < linesToMove.length; i += 2) { + var from = linesToMove[i], + to = linesToMove[i + 1]; + var line = cm.getLine(from); + cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine"); + if (to > cm.lastLine()) cm.replaceRange("\n" + line, Pos(cm.lastLine()), null, "+swapLine");else cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine"); + } + cm.setSelections(newSels); + cm.scrollIntoView(); + }); + }; + cmds.swapLineDown = function (cm) { + if (cm.isReadOnly()) return CodeMirror.Pass; + var ranges = cm.listSelections(), + linesToMove = [], + at = cm.lastLine() + 1; + for (var i = ranges.length - 1; i >= 0; i--) { + var range = ranges[i], + from = range.to().line + 1, + to = range.from().line; + if (range.to().ch == 0 && !range.empty()) from--; + if (from < at) linesToMove.push(from, to);else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; + at = to; + } + cm.operation(function () { + for (var i = linesToMove.length - 2; i >= 0; i -= 2) { + var from = linesToMove[i], + to = linesToMove[i + 1]; + var line = cm.getLine(from); + if (from == cm.lastLine()) cm.replaceRange("", Pos(from - 1), Pos(from), "+swapLine");else cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine"); + cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine"); + } + cm.scrollIntoView(); + }); + }; + cmds.toggleCommentIndented = function (cm) { + cm.toggleComment({ + indent: true + }); + }; + cmds.joinLines = function (cm) { + var ranges = cm.listSelections(), + joined = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i], + from = range.from(); + var start = from.line, + end = range.to().line; + while (i < ranges.length - 1 && ranges[i + 1].from().line == end) end = ranges[++i].to().line; + joined.push({ + start: start, + end: end, + anchor: !range.empty() && from + }); + } + cm.operation(function () { + var offset = 0, + ranges = []; + for (var i = 0; i < joined.length; i++) { + var obj = joined[i]; + var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), + head; + for (var line = obj.start; line <= obj.end; line++) { + var actual = line - offset; + if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1); + if (actual < cm.lastLine()) { + cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length)); + ++offset; + } + } + ranges.push({ + anchor: anchor || head, + head: head + }); + } + cm.setSelections(ranges, 0); + }); + }; + cmds.duplicateLine = function (cm) { + cm.operation(function () { + var rangeCount = cm.listSelections().length; + for (var i = 0; i < rangeCount; i++) { + var range = cm.listSelections()[i]; + if (range.empty()) cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0));else cm.replaceRange(cm.getRange(range.from(), range.to()), range.from()); + } + cm.scrollIntoView(); + }); + }; + function sortLines(cm, caseSensitive, direction) { + if (cm.isReadOnly()) return CodeMirror.Pass; + var ranges = cm.listSelections(), + toSort = [], + selected; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.empty()) continue; + var from = range.from().line, + to = range.to().line; + while (i < ranges.length - 1 && ranges[i + 1].from().line == to) to = ranges[++i].to().line; + if (!ranges[i].to().ch) to--; + toSort.push(from, to); + } + if (toSort.length) selected = true;else toSort.push(cm.firstLine(), cm.lastLine()); + cm.operation(function () { + var ranges = []; + for (var i = 0; i < toSort.length; i += 2) { + var from = toSort[i], + to = toSort[i + 1]; + var start = Pos(from, 0), + end = Pos(to); + var lines = cm.getRange(start, end, false); + if (caseSensitive) lines.sort(function (a, b) { + return a < b ? -direction : a == b ? 0 : direction; + });else lines.sort(function (a, b) { + var au = a.toUpperCase(), + bu = b.toUpperCase(); + if (au != bu) { + a = au; + b = bu; + } + return a < b ? -direction : a == b ? 0 : direction; + }); + cm.replaceRange(lines, start, end); + if (selected) ranges.push({ + anchor: start, + head: Pos(to + 1, 0) + }); + } + if (selected) cm.setSelections(ranges, 0); + }); } -})); -Object.defineProperty(exports, "escapeAttribute", ({ - enumerable: true, - get: function () { - return escape_js_2.escapeAttribute; + cmds.sortLines = function (cm) { + sortLines(cm, true, 1); + }; + cmds.reverseSortLines = function (cm) { + sortLines(cm, true, -1); + }; + cmds.sortLinesInsensitive = function (cm) { + sortLines(cm, false, 1); + }; + cmds.reverseSortLinesInsensitive = function (cm) { + sortLines(cm, false, -1); + }; + cmds.nextBookmark = function (cm) { + var marks = cm.state.sublimeBookmarks; + if (marks) while (marks.length) { + var current = marks.shift(); + var found = current.find(); + if (found) { + marks.push(current); + return cm.setSelection(found.from, found.to); + } + } + }; + cmds.prevBookmark = function (cm) { + var marks = cm.state.sublimeBookmarks; + if (marks) while (marks.length) { + marks.unshift(marks.pop()); + var found = marks[marks.length - 1].find(); + if (!found) marks.pop();else return cm.setSelection(found.from, found.to); + } + }; + cmds.toggleBookmark = function (cm) { + var ranges = cm.listSelections(); + var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []); + for (var i = 0; i < ranges.length; i++) { + var from = ranges[i].from(), + to = ranges[i].to(); + var found = ranges[i].empty() ? cm.findMarksAt(from) : cm.findMarks(from, to); + for (var j = 0; j < found.length; j++) { + if (found[j].sublimeBookmark) { + found[j].clear(); + for (var k = 0; k < marks.length; k++) if (marks[k] == found[j]) marks.splice(k--, 1); + break; + } + } + if (j == found.length) marks.push(cm.markText(from, to, { + sublimeBookmark: true, + clearWhenEmpty: false + })); + } + }; + cmds.clearBookmarks = function (cm) { + var marks = cm.state.sublimeBookmarks; + if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear(); + marks.length = 0; + }; + cmds.selectBookmarks = function (cm) { + var marks = cm.state.sublimeBookmarks, + ranges = []; + if (marks) for (var i = 0; i < marks.length; i++) { + var found = marks[i].find(); + if (!found) marks.splice(i--, 0);else ranges.push({ + anchor: found.from, + head: found.to + }); + } + if (ranges.length) cm.setSelections(ranges, 0); + }; + function modifyWordOrSelection(cm, mod) { + cm.operation(function () { + var ranges = cm.listSelections(), + indices = [], + replacements = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.empty()) { + indices.push(i); + replacements.push(""); + } else replacements.push(mod(cm.getRange(range.from(), range.to()))); + } + cm.replaceSelections(replacements, "around", "case"); + for (var i = indices.length - 1, at; i >= 0; i--) { + var range = ranges[indices[i]]; + if (at && CodeMirror.cmpPos(range.head, at) > 0) continue; + var word = wordAt(cm, range.head); + at = word.from; + cm.replaceRange(mod(word.word), word.from, word.to); + } + }); } -})); -Object.defineProperty(exports, "escapeText", ({ - enumerable: true, - get: function () { - return escape_js_2.escapeText; + cmds.smartBackspace = function (cm) { + if (cm.somethingSelected()) return CodeMirror.Pass; + cm.operation(function () { + var cursors = cm.listSelections(); + var indentUnit = cm.getOption("indentUnit"); + for (var i = cursors.length - 1; i >= 0; i--) { + var cursor = cursors[i].head; + var toStartOfLine = cm.getRange({ + line: cursor.line, + ch: 0 + }, cursor); + var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize")); + + // Delete by one character by default + var deletePos = cm.findPosH(cursor, -1, "char", false); + if (toStartOfLine && !/\S/.test(toStartOfLine) && column % indentUnit == 0) { + var prevIndent = new Pos(cursor.line, CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit)); + + // Smart delete only if we found a valid prevIndent location + if (prevIndent.ch != cursor.ch) deletePos = prevIndent; + } + cm.replaceRange("", deletePos, cursor, "+delete"); + } + }); + }; + cmds.delLineRight = function (cm) { + cm.operation(function () { + var ranges = cm.listSelections(); + for (var i = ranges.length - 1; i >= 0; i--) cm.replaceRange("", ranges[i].anchor, Pos(ranges[i].to().line), "+delete"); + cm.scrollIntoView(); + }); + }; + cmds.upcaseAtCursor = function (cm) { + modifyWordOrSelection(cm, function (str) { + return str.toUpperCase(); + }); + }; + cmds.downcaseAtCursor = function (cm) { + modifyWordOrSelection(cm, function (str) { + return str.toLowerCase(); + }); + }; + cmds.setSublimeMark = function (cm) { + if (cm.state.sublimeMark) cm.state.sublimeMark.clear(); + cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); + }; + cmds.selectToSublimeMark = function (cm) { + var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); + if (found) cm.setSelection(cm.getCursor(), found); + }; + cmds.deleteToSublimeMark = function (cm) { + var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); + if (found) { + var from = cm.getCursor(), + to = found; + if (CodeMirror.cmpPos(from, to) > 0) { + var tmp = to; + to = from; + from = tmp; + } + cm.state.sublimeKilled = cm.getRange(from, to); + cm.replaceRange("", from, to); + } + }; + cmds.swapWithSublimeMark = function (cm) { + var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); + if (found) { + cm.state.sublimeMark.clear(); + cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); + cm.setCursor(found); + } + }; + cmds.sublimeYank = function (cm) { + if (cm.state.sublimeKilled != null) cm.replaceSelection(cm.state.sublimeKilled, null, "paste"); + }; + cmds.showInCenter = function (cm) { + var pos = cm.cursorCoords(null, "local"); + cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2); + }; + function getTarget(cm) { + var from = cm.getCursor("from"), + to = cm.getCursor("to"); + if (CodeMirror.cmpPos(from, to) == 0) { + var word = wordAt(cm, from); + if (!word.word) return; + from = word.from; + to = word.to; + } + return { + from: from, + to: to, + query: cm.getRange(from, to), + word: word + }; } -})); -var encode_js_2 = __webpack_require__(/*! ./encode.js */ "../../../node_modules/entities/lib/encode.js"); -Object.defineProperty(exports, "encodeHTML", ({ - enumerable: true, - get: function () { - return encode_js_2.encodeHTML; + function findAndGoTo(cm, forward) { + var target = getTarget(cm); + if (!target) return; + var query = target.query; + var cur = cm.getSearchCursor(query, forward ? target.to : target.from); + if (forward ? cur.findNext() : cur.findPrevious()) { + cm.setSelection(cur.from(), cur.to()); + } else { + cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0) : cm.clipPos(Pos(cm.lastLine()))); + if (forward ? cur.findNext() : cur.findPrevious()) cm.setSelection(cur.from(), cur.to());else if (target.word) cm.setSelection(target.from, target.to); + } } -})); -Object.defineProperty(exports, "encodeNonAsciiHTML", ({ - enumerable: true, - get: function () { - return encode_js_2.encodeNonAsciiHTML; + ; + cmds.findUnder = function (cm) { + findAndGoTo(cm, true); + }; + cmds.findUnderPrevious = function (cm) { + findAndGoTo(cm, false); + }; + cmds.findAllUnder = function (cm) { + var target = getTarget(cm); + if (!target) return; + var cur = cm.getSearchCursor(target.query); + var matches = []; + var primaryIndex = -1; + while (cur.findNext()) { + matches.push({ + anchor: cur.from(), + head: cur.to() + }); + if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch) primaryIndex++; + } + cm.setSelections(matches, primaryIndex); + }; + var keyMap = CodeMirror.keyMap; + keyMap.macSublime = { + "Cmd-Left": "goLineStartSmart", + "Shift-Tab": "indentLess", + "Shift-Ctrl-K": "deleteLine", + "Alt-Q": "wrapLines", + "Ctrl-Left": "goSubwordLeft", + "Ctrl-Right": "goSubwordRight", + "Ctrl-Alt-Up": "scrollLineUp", + "Ctrl-Alt-Down": "scrollLineDown", + "Cmd-L": "selectLine", + "Shift-Cmd-L": "splitSelectionByLine", + "Esc": "singleSelectionTop", + "Cmd-Enter": "insertLineAfter", + "Shift-Cmd-Enter": "insertLineBefore", + "Cmd-D": "selectNextOccurrence", + "Shift-Cmd-Space": "selectScope", + "Shift-Cmd-M": "selectBetweenBrackets", + "Cmd-M": "goToBracket", + "Cmd-Ctrl-Up": "swapLineUp", + "Cmd-Ctrl-Down": "swapLineDown", + "Cmd-/": "toggleCommentIndented", + "Cmd-J": "joinLines", + "Shift-Cmd-D": "duplicateLine", + "F5": "sortLines", + "Shift-F5": "reverseSortLines", + "Cmd-F5": "sortLinesInsensitive", + "Shift-Cmd-F5": "reverseSortLinesInsensitive", + "F2": "nextBookmark", + "Shift-F2": "prevBookmark", + "Cmd-F2": "toggleBookmark", + "Shift-Cmd-F2": "clearBookmarks", + "Alt-F2": "selectBookmarks", + "Backspace": "smartBackspace", + "Cmd-K Cmd-D": "skipAndSelectNextOccurrence", + "Cmd-K Cmd-K": "delLineRight", + "Cmd-K Cmd-U": "upcaseAtCursor", + "Cmd-K Cmd-L": "downcaseAtCursor", + "Cmd-K Cmd-Space": "setSublimeMark", + "Cmd-K Cmd-A": "selectToSublimeMark", + "Cmd-K Cmd-W": "deleteToSublimeMark", + "Cmd-K Cmd-X": "swapWithSublimeMark", + "Cmd-K Cmd-Y": "sublimeYank", + "Cmd-K Cmd-C": "showInCenter", + "Cmd-K Cmd-G": "clearBookmarks", + "Cmd-K Cmd-Backspace": "delLineLeft", + "Cmd-K Cmd-1": "foldAll", + "Cmd-K Cmd-0": "unfoldAll", + "Cmd-K Cmd-J": "unfoldAll", + "Ctrl-Shift-Up": "addCursorToPrevLine", + "Ctrl-Shift-Down": "addCursorToNextLine", + "Cmd-F3": "findUnder", + "Shift-Cmd-F3": "findUnderPrevious", + "Alt-F3": "findAllUnder", + "Shift-Cmd-[": "fold", + "Shift-Cmd-]": "unfold", + "Cmd-I": "findIncremental", + "Shift-Cmd-I": "findIncrementalReverse", + "Cmd-H": "replace", + "F3": "findNext", + "Shift-F3": "findPrev", + "fallthrough": "macDefault" + }; + CodeMirror.normalizeKeyMap(keyMap.macSublime); + keyMap.pcSublime = { + "Shift-Tab": "indentLess", + "Shift-Ctrl-K": "deleteLine", + "Alt-Q": "wrapLines", + "Ctrl-T": "transposeChars", + "Alt-Left": "goSubwordLeft", + "Alt-Right": "goSubwordRight", + "Ctrl-Up": "scrollLineUp", + "Ctrl-Down": "scrollLineDown", + "Ctrl-L": "selectLine", + "Shift-Ctrl-L": "splitSelectionByLine", + "Esc": "singleSelectionTop", + "Ctrl-Enter": "insertLineAfter", + "Shift-Ctrl-Enter": "insertLineBefore", + "Ctrl-D": "selectNextOccurrence", + "Shift-Ctrl-Space": "selectScope", + "Shift-Ctrl-M": "selectBetweenBrackets", + "Ctrl-M": "goToBracket", + "Shift-Ctrl-Up": "swapLineUp", + "Shift-Ctrl-Down": "swapLineDown", + "Ctrl-/": "toggleCommentIndented", + "Ctrl-J": "joinLines", + "Shift-Ctrl-D": "duplicateLine", + "F9": "sortLines", + "Shift-F9": "reverseSortLines", + "Ctrl-F9": "sortLinesInsensitive", + "Shift-Ctrl-F9": "reverseSortLinesInsensitive", + "F2": "nextBookmark", + "Shift-F2": "prevBookmark", + "Ctrl-F2": "toggleBookmark", + "Shift-Ctrl-F2": "clearBookmarks", + "Alt-F2": "selectBookmarks", + "Backspace": "smartBackspace", + "Ctrl-K Ctrl-D": "skipAndSelectNextOccurrence", + "Ctrl-K Ctrl-K": "delLineRight", + "Ctrl-K Ctrl-U": "upcaseAtCursor", + "Ctrl-K Ctrl-L": "downcaseAtCursor", + "Ctrl-K Ctrl-Space": "setSublimeMark", + "Ctrl-K Ctrl-A": "selectToSublimeMark", + "Ctrl-K Ctrl-W": "deleteToSublimeMark", + "Ctrl-K Ctrl-X": "swapWithSublimeMark", + "Ctrl-K Ctrl-Y": "sublimeYank", + "Ctrl-K Ctrl-C": "showInCenter", + "Ctrl-K Ctrl-G": "clearBookmarks", + "Ctrl-K Ctrl-Backspace": "delLineLeft", + "Ctrl-K Ctrl-1": "foldAll", + "Ctrl-K Ctrl-0": "unfoldAll", + "Ctrl-K Ctrl-J": "unfoldAll", + "Ctrl-Alt-Up": "addCursorToPrevLine", + "Ctrl-Alt-Down": "addCursorToNextLine", + "Ctrl-F3": "findUnder", + "Shift-Ctrl-F3": "findUnderPrevious", + "Alt-F3": "findAllUnder", + "Shift-Ctrl-[": "fold", + "Shift-Ctrl-]": "unfold", + "Ctrl-I": "findIncremental", + "Shift-Ctrl-I": "findIncrementalReverse", + "Ctrl-H": "replace", + "F3": "findNext", + "Shift-F3": "findPrev", + "fallthrough": "pcDefault" + }; + CodeMirror.normalizeKeyMap(keyMap.pcSublime); + var mac = keyMap.default == keyMap.macDefault; + keyMap.sublime = mac ? keyMap.macSublime : keyMap.pcSublime; +}); + +/***/ }), + +/***/ "../../../node_modules/codemirror/lib/codemirror.js": +/*!**********************************************************!*\ + !*** ../../../node_modules/codemirror/lib/codemirror.js ***! + \**********************************************************/ +/***/ (function(module) { + +"use strict"; + + +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +// This is CodeMirror (https://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . + +(function (global, factory) { + true ? module.exports = factory() : 0; +})(void 0, function () { + 'use strict'; + + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. + var userAgent = navigator.userAgent; + var platform = navigator.platform; + var gecko = /gecko\/\d/i.test(userAgent); + var ie_upto10 = /MSIE \d/.test(userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); + var edge = /Edge\/(\d+)/.exec(userAgent); + var ie = ie_upto10 || ie_11up || edge; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); + var webkit = !edge && /WebKit\//.test(userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); + var chrome = !edge && /Chrome\//.test(userAgent); + var presto = /Opera\//.test(userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); + var phantom = /PhantomJS/.test(userAgent); + var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2); + var android = /Android/.test(userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); + var mac = ios || /Mac/.test(platform); + var chromeOS = /\bCrOS\b/.test(userAgent); + var windows = /win/i.test(platform); + var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) { + presto_version = Number(presto_version[1]); + } + if (presto_version && presto_version >= 15) { + presto = false; + webkit = true; + } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || ie && ie_version >= 9; + function classTest(cls) { + return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); + } + var rmClass = function (node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) { + e.removeChild(e.firstChild); + } + return e; } -})); -// Legacy aliases (deprecated) -Object.defineProperty(exports, "encodeHTML4", ({ - enumerable: true, - get: function () { - return encode_js_2.encodeHTML; + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e); } -})); -Object.defineProperty(exports, "encodeHTML5", ({ - enumerable: true, - get: function () { - return encode_js_2.encodeHTML; + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) { + e.className = className; + } + if (style) { + e.style.cssText = style; + } + if (typeof content == "string") { + e.appendChild(document.createTextNode(content)); + } else if (content) { + for (var i = 0; i < content.length; ++i) { + e.appendChild(content[i]); + } + } + return e; } -})); -var decode_js_2 = __webpack_require__(/*! ./decode.js */ "../../../node_modules/entities/lib/decode.js"); -Object.defineProperty(exports, "EntityDecoder", ({ - enumerable: true, - get: function () { - return decode_js_2.EntityDecoder; + // wrapper for elt, which removes the elt from the accessibility tree + function eltP(tag, content, className, style) { + var e = elt(tag, content, className, style); + e.setAttribute("role", "presentation"); + return e; } -})); -Object.defineProperty(exports, "DecodingMode", ({ - enumerable: true, - get: function () { - return decode_js_2.DecodingMode; + var range; + if (document.createRange) { + range = function (node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r; + }; + } else { + range = function (node, start, end) { + var r = document.body.createTextRange(); + try { + r.moveToElementText(node.parentNode); + } catch (e) { + return r; + } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r; + }; } -})); -Object.defineProperty(exports, "decodeXML", ({ - enumerable: true, - get: function () { - return decode_js_2.decodeXML; + function contains(parent, child) { + if (child.nodeType == 3) + // Android browser always returns false when child is a textnode + { + child = child.parentNode; + } + if (parent.contains) { + return parent.contains(child); + } + do { + if (child.nodeType == 11) { + child = child.host; + } + if (child == parent) { + return true; + } + } while (child = child.parentNode); } -})); -Object.defineProperty(exports, "decodeHTML", ({ - enumerable: true, - get: function () { - return decode_js_2.decodeHTML; + function activeElt() { + // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. + // IE < 10 will throw when accessed while the page is loading or in an iframe. + // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var activeElement; + try { + activeElement = document.activeElement; + } catch (e) { + activeElement = document.body || null; + } + while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) { + activeElement = activeElement.shadowRoot.activeElement; + } + return activeElement; } -})); -Object.defineProperty(exports, "decodeHTMLStrict", ({ - enumerable: true, - get: function () { - return decode_js_2.decodeHTMLStrict; + function addClass(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) { + node.className += (current ? " " : "") + cls; + } } -})); -Object.defineProperty(exports, "decodeHTMLAttribute", ({ - enumerable: true, - get: function () { - return decode_js_2.decodeHTMLAttribute; + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) { + if (as[i] && !classTest(as[i]).test(b)) { + b += " " + as[i]; + } + } + return b; } -})); -// Legacy aliases (deprecated) -Object.defineProperty(exports, "decodeHTML4", ({ - enumerable: true, - get: function () { - return decode_js_2.decodeHTML; + var selectInput = function (node) { + node.select(); + }; + if (ios) + // Mobile Safari apparently has a bug where select() is broken. + { + selectInput = function (node) { + node.selectionStart = 0; + node.selectionEnd = node.value.length; + }; + } else if (ie) + // Suppress mysterious IE10 errors + { + selectInput = function (node) { + try { + node.select(); + } catch (_e) {} + }; + } + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function () { + return f.apply(null, args); + }; } -})); -Object.defineProperty(exports, "decodeHTML5", ({ - enumerable: true, - get: function () { - return decode_js_2.decodeHTML; + function copyObj(obj, target, overwrite) { + if (!target) { + target = {}; + } + for (var prop in obj) { + if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) { + target[prop] = obj[prop]; + } + } + return target; } -})); -Object.defineProperty(exports, "decodeHTML4Strict", ({ - enumerable: true, - get: function () { - return decode_js_2.decodeHTMLStrict; + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) { + end = string.length; + } + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) { + return n + (end - i); + } + n += nextTab - i; + n += tabSize - n % tabSize; + i = nextTab + 1; + } } -})); -Object.defineProperty(exports, "decodeHTML5Strict", ({ - enumerable: true, - get: function () { - return decode_js_2.decodeHTMLStrict; + var Delayed = function () { + this.id = null; + this.f = null; + this.time = 0; + this.handler = bind(this.onTimeout, this); + }; + Delayed.prototype.onTimeout = function (self) { + self.id = 0; + if (self.time <= +new Date()) { + self.f(); + } else { + setTimeout(self.handler, self.time - +new Date()); + } + }; + Delayed.prototype.set = function (ms, f) { + this.f = f; + var time = +new Date() + ms; + if (!this.id || time < this.time) { + clearTimeout(this.id); + this.id = setTimeout(this.handler, ms); + this.time = time; + } + }; + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) { + if (array[i] == elt) { + return i; + } + } + return -1; } -})); -Object.defineProperty(exports, "decodeXMLStrict", ({ - enumerable: true, - get: function () { - return decode_js_2.decodeXML; + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 50; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = { + toString: function () { + return "CodeMirror.Pass"; + } + }; + + // Reused option objects for setSelection & friends + var sel_dontScroll = { + scroll: false + }, + sel_mouse = { + origin: "*mouse" + }, + sel_move = { + origin: "+move" + }; + + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) { + nextTab = string.length; + } + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) { + return pos + Math.min(skipped, goal - col); + } + col += nextTab - pos; + col += tabSize - col % tabSize; + pos = nextTab + 1; + if (col >= goal) { + return pos; + } + } + } + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) { + spaceStrs.push(lst(spaceStrs) + " "); + } + return spaceStrs[n]; + } + function lst(arr) { + return arr[arr.length - 1]; + } + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) { + out[i] = f(array[i], i); + } + return out; + } + function insertSorted(array, value, score) { + var pos = 0, + priority = score(value); + while (pos < array.length && score(array[pos]) <= priority) { + pos++; + } + array.splice(pos, 0, value); + } + function nothing() {} + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) { + copyObj(props, inst); + } + return inst; + } + var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + function isWordCharBasic(ch) { + return /\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); + } + function isWordChar(ch, helper) { + if (!helper) { + return isWordCharBasic(ch); + } + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { + return true; + } + return helper.test(ch); + } + function isEmpty(obj) { + for (var n in obj) { + if (obj.hasOwnProperty(n) && obj[n]) { + return false; + } + } + return true; } -})); -/***/ }), + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; + function isExtendingChar(ch) { + return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); + } -/***/ "../../../node_modules/framer-motion/dist/cjs/index.js": -/*!*************************************************************!*\ - !*** ../../../node_modules/framer-motion/dist/cjs/index.js ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. + function skipExtendingChars(str, pos, dir) { + while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { + pos += dir; + } + return pos; + } + // Returns the value from the range [`from`; `to`] that satisfies + // `pred` and is closest to `from`. Assumes that at least `to` + // satisfies `pred`. Supports `from` being greater than `to`. + function findFirst(pred, from, to) { + // At any point we are certain `to` satisfies `pred`, don't know + // whether `from` does. + var dir = from > to ? -1 : 1; + for (;;) { + if (from == to) { + return from; + } + var midF = (from + to) / 2, + mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); + if (mid == from) { + return pred(mid) ? from : to; + } + if (pred(mid)) { + to = mid; + } else { + from = mid + dir; + } + } + } + // BIDI HELPERS -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -var tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); -var React = __webpack_require__(/*! react */ "react"); -var heyListen = __webpack_require__(/*! hey-listen */ "../../../node_modules/hey-listen/dist/hey-listen.es.js"); -var styleValueTypes = __webpack_require__(/*! style-value-types */ "../../../node_modules/style-value-types/dist/valueTypes.cjs.js"); -var popmotion = __webpack_require__(/*! popmotion */ "../../../node_modules/popmotion/dist/popmotion.cjs.js"); -var sync = __webpack_require__(/*! framesync */ "../../../node_modules/framesync/dist/framesync.cjs.js"); -var dom = __webpack_require__(/*! @motionone/dom */ "../../../node_modules/@motionone/dom/dist/index.es.js"); -function _interopDefaultLegacy(e) { - return e && typeof e === 'object' && 'default' in e ? e : { - 'default': e - }; -} -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; + function iterateBidiSections(order, from, to, f) { + if (!order) { + return f(from, to, "ltr", 0); + } + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i); + found = true; + } + } + if (!found) { + f(from, to, "ltr"); + } + } + var bidiOther = null; + function getBidiPartAt(order, ch, sticky) { + var found; + bidiOther = null; + for (var i = 0; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < ch && cur.to > ch) { + return i; + } + if (cur.to == ch) { + if (cur.from != cur.to && sticky == "before") { + found = i; + } else { + bidiOther = i; + } + } + if (cur.from == ch) { + if (cur.from != cur.to && sticky != "before") { + found = i; + } else { + bidiOther = i; + } + } + } + return found != null ? found : bidiOther; + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = function () { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6f9 + var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; + function charType(code) { + if (code <= 0xf7) { + return lowTypes.charAt(code); + } else if (0x590 <= code && code <= 0x5f4) { + return "R"; + } else if (0x600 <= code && code <= 0x6f9) { + return arabicTypes.charAt(code - 0x600); + } else if (0x6ee <= code && code <= 0x8ac) { + return "r"; + } else if (0x2000 <= code && code <= 0x200b) { + return "w"; + } else if (code == 0x200c) { + return "b"; + } else { + return "L"; + } + } + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, + isStrong = /[LRr]/, + countsAsLeft = /[Lb1n]/, + countsAsNum = /[1n]/; + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; + this.to = to; + } + return function (str, direction) { + var outerType = direction == "ltr" ? "L" : "R"; + if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { + return false; + } + var len = str.length, + types = []; + for (var i = 0; i < len; ++i) { + types.push(charType(str.charCodeAt(i))); + } + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { + var type = types[i$1]; + if (type == "m") { + types[i$1] = prev; + } else { + prev = type; + } + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { + var type$1 = types[i$2]; + if (type$1 == "1" && cur == "r") { + types[i$2] = "n"; + } else if (isStrong.test(type$1)) { + cur = type$1; + if (type$1 == "r") { + types[i$2] = "R"; + } + } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { + var type$2 = types[i$3]; + if (type$2 == "+" && prev$1 == "1" && types[i$3 + 1] == "1") { + types[i$3] = "1"; + } else if (type$2 == "," && prev$1 == types[i$3 + 1] && (prev$1 == "1" || prev$1 == "n")) { + types[i$3] = prev$1; + } + prev$1 = type$2; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i$4 = 0; i$4 < len; ++i$4) { + var type$3 = types[i$4]; + if (type$3 == ",") { + types[i$4] = "N"; + } else if (type$3 == "%") { + var end = void 0; + for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} + var replace = i$4 && types[i$4 - 1] == "!" || end < len && types[end] == "1" ? "1" : "N"; + for (var j = i$4; j < end; ++j) { + types[j] = replace; + } + i$4 = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { + var type$4 = types[i$5]; + if (cur$1 == "L" && type$4 == "1") { + types[i$5] = "L"; + } else if (isStrong.test(type$4)) { + cur$1 = type$4; + } + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i$6 = 0; i$6 < len; ++i$6) { + if (isNeutral.test(types[i$6])) { + var end$1 = void 0; + for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} + var before = (i$6 ? types[i$6 - 1] : outerType) == "L"; + var after = (end$1 < len ? types[end$1] : outerType) == "L"; + var replace$1 = before == after ? before ? "L" : "R" : outerType; + for (var j$1 = i$6; j$1 < end$1; ++j$1) { + types[j$1] = replace$1; + } + i$6 = end$1 - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], + m; + for (var i$7 = 0; i$7 < len;) { + if (countsAsLeft.test(types[i$7])) { + var start = i$7; + for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} + order.push(new BidiSpan(0, start, i$7)); + } else { + var pos = i$7, + at = order.length, + isRTL = direction == "rtl" ? 1 : 0; + for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} + for (var j$2 = pos; j$2 < i$7;) { + if (countsAsNum.test(types[j$2])) { + if (pos < j$2) { + order.splice(at, 0, new BidiSpan(1, pos, j$2)); + at += isRTL; + } + var nstart = j$2; + for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} + order.splice(at, 0, new BidiSpan(2, nstart, j$2)); + at += isRTL; + pos = j$2; + } else { + ++j$2; + } } - }); + if (pos < i$7) { + order.splice(at, 0, new BidiSpan(1, pos, i$7)); + } + } } - }); + if (direction == "ltr") { + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + } + return direction == "rtl" ? order.reverse() : order; + }; + }(); + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line, direction) { + var order = line.order; + if (order == null) { + order = line.order = bidiOrdering(line.text, direction); + } + return order; } - n["default"] = e; - return Object.freeze(n); -} -var React__namespace = /*#__PURE__*/_interopNamespace(React); -var React__default = /*#__PURE__*/_interopDefaultLegacy(React); -var sync__default = /*#__PURE__*/_interopDefaultLegacy(sync); -/** - * Browser-safe usage of process - */ -var defaultEnvironment = "production"; -var env = typeof process === "undefined" || process.env === undefined ? defaultEnvironment : "development" || 0; -var createDefinition = function (propNames) { - return { - isEnabled: function (props) { - return propNames.some(function (name) { - return !!props[name]; - }); + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var noHandlers = []; + var on = function (emitter, type, f) { + if (emitter.addEventListener) { + emitter.addEventListener(type, f, false); + } else if (emitter.attachEvent) { + emitter.attachEvent("on" + type, f); + } else { + var map = emitter._handlers || (emitter._handlers = {}); + map[type] = (map[type] || noHandlers).concat(f); } }; -}; -var featureDefinitions = { - measureLayout: createDefinition(["layout", "layoutId", "drag"]), - animation: createDefinition(["animate", "exit", "variants", "whileHover", "whileTap", "whileFocus", "whileDrag", "whileInView"]), - exit: createDefinition(["exit"]), - drag: createDefinition(["drag", "dragControls"]), - focus: createDefinition(["whileFocus"]), - hover: createDefinition(["whileHover", "onHoverStart", "onHoverEnd"]), - tap: createDefinition(["whileTap", "onTap", "onTapStart", "onTapCancel"]), - pan: createDefinition(["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"]), - inView: createDefinition(["whileInView", "onViewportEnter", "onViewportLeave"]) -}; -function loadFeatures(features) { - for (var key in features) { - if (features[key] === null) continue; - if (key === "projectionNodeConstructor") { - featureDefinitions.projectionNodeConstructor = features[key]; + function getHandlers(emitter, type) { + return emitter._handlers && emitter._handlers[type] || noHandlers; + } + function off(emitter, type, f) { + if (emitter.removeEventListener) { + emitter.removeEventListener(type, f, false); + } else if (emitter.detachEvent) { + emitter.detachEvent("on" + type, f); } else { - featureDefinitions[key].Component = features[key]; + var map = emitter._handlers, + arr = map && map[type]; + if (arr) { + var index = indexOf(arr, f); + if (index > -1) { + map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); + } + } } } -} -var LazyContext = React.createContext({ - strict: false -}); -var featureNames = Object.keys(featureDefinitions); -var numFeatures = featureNames.length; -/** - * Load features via renderless components based on the provided MotionProps. - */ -function useFeatures(props, visualElement, preloadedFeatures) { - var features = []; - var lazyContext = React.useContext(LazyContext); - if (!visualElement) return null; - /** - * If we're in development mode, check to make sure we're not rendering a motion component - * as a child of LazyMotion, as this will break the file-size benefits of using it. - */ - if (env !== "production" && preloadedFeatures && lazyContext.strict) { - heyListen.invariant(false, "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."); + function signal(emitter, type /*, values...*/) { + var handlers = getHandlers(emitter, type); + if (!handlers.length) { + return; + } + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < handlers.length; ++i) { + handlers[i].apply(null, args); + } } - for (var i = 0; i < numFeatures; i++) { - var name_1 = featureNames[i]; - var _a = featureDefinitions[name_1], - isEnabled = _a.isEnabled, - Component = _a.Component; - /** - * It might be possible in the future to use this moment to - * dynamically request functionality. In initial tests this - * was producing a lot of duplication amongst bundles. - */ - if (isEnabled(props) && Component) { - features.push(React__namespace.createElement(Component, tslib.__assign({ - key: name_1 - }, props, { - visualElement: visualElement - }))); + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") { + e = { + type: e, + preventDefault: function () { + this.defaultPrevented = true; + } + }; } + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore; + } + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) { + return; + } + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) { + if (indexOf(set, arr[i]) == -1) { + set.push(arr[i]); + } + } + } + function hasHandler(emitter, type) { + return getHandlers(emitter, type).length > 0; } - return features; -} -/** - * @public - */ -var MotionConfigContext = React.createContext({ - transformPagePoint: function (p) { - return p; - }, - isStatic: false, - reducedMotion: "never" -}); -var MotionContext = React.createContext({}); -function useVisualElementContext() { - return React.useContext(MotionContext).visualElement; -} + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function (type, f) { + on(this, type, f); + }; + ctor.prototype.off = function (type, f) { + off(this, type, f); + }; + } -/** - * @public - */ -var PresenceContext = React.createContext(null); -var isBrowser = typeof document !== "undefined"; -var useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useEffect; + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. -// Does this device prefer reduced motion? Returns `null` server-side. -var prefersReducedMotion = { - current: null -}; -var hasDetected = false; -function initPrefersReducedMotion() { - hasDetected = true; - if (!isBrowser) return; - if (window.matchMedia) { - var motionMediaQuery_1 = window.matchMedia("(prefers-reduced-motion)"); - var setReducedMotionPreferences = function () { - return prefersReducedMotion.current = motionMediaQuery_1.matches; - }; - motionMediaQuery_1.addListener(setReducedMotionPreferences); - setReducedMotionPreferences(); - } else { - prefersReducedMotion.current = false; + function e_preventDefault(e) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } } -} -/** - * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. - * - * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing - * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. - * - * It will actively respond to changes and re-render your components with the latest setting. - * - * ```jsx - * export function Sidebar({ isOpen }) { - * const shouldReduceMotion = useReducedMotion() - * const closedX = shouldReduceMotion ? 0 : "-100%" - * - * return ( - * - * ) - * } - * ``` - * - * @return boolean - * - * @public - */ -function useReducedMotion() { - /** - * Lazy initialisation of prefersReducedMotion - */ - !hasDetected && initPrefersReducedMotion(); - var _a = tslib.__read(React.useState(prefersReducedMotion.current), 1), - shouldReduceMotion = _a[0]; - /** - * TODO See if people miss automatically updating shouldReduceMotion setting - */ - return shouldReduceMotion; -} -function useReducedMotionConfig() { - var reducedMotionPreference = useReducedMotion(); - var reducedMotion = React.useContext(MotionConfigContext).reducedMotion; - if (reducedMotion === "never") { - return false; - } else if (reducedMotion === "always") { - return true; - } else { - return reducedMotionPreference; + function e_stopPropagation(e) { + if (e.stopPropagation) { + e.stopPropagation(); + } else { + e.cancelBubble = true; + } } -} -function useVisualElement(Component, visualState, props, createVisualElement) { - var lazyContext = React.useContext(LazyContext); - var parent = useVisualElementContext(); - var presenceContext = React.useContext(PresenceContext); - var shouldReduceMotion = useReducedMotionConfig(); - var visualElementRef = React.useRef(undefined); - /** - * If we haven't preloaded a renderer, check to see if we have one lazy-loaded - */ - if (!createVisualElement) createVisualElement = lazyContext.renderer; - if (!visualElementRef.current && createVisualElement) { - visualElementRef.current = createVisualElement(Component, { - visualState: visualState, - parent: parent, - props: props, - presenceId: presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id, - blockInitialAnimation: (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false, - shouldReduceMotion: shouldReduceMotion - }); + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; + } + function e_stop(e) { + e_preventDefault(e); + e_stopPropagation(e); + } + function e_target(e) { + return e.target || e.srcElement; + } + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) { + b = 1; + } else if (e.button & 2) { + b = 3; + } else if (e.button & 4) { + b = 2; + } + } + if (mac && e.ctrlKey && b == 1) { + b = 3; + } + return b; } - var visualElement = visualElementRef.current; - useIsomorphicLayoutEffect(function () { - visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender(); - }); - React.useEffect(function () { - var _a; - (_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.animationState) === null || _a === void 0 ? void 0 : _a.animateChanges(); - }); - useIsomorphicLayoutEffect(function () { - return function () { - return visualElement === null || visualElement === void 0 ? void 0 : visualElement.notifyUnmount(); - }; - }, []); - return visualElement; -} -function isRefObject(ref) { - return typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current"); -} -/** - * Creates a ref function that, when called, hydrates the provided - * external ref and VisualElement. - */ -function useMotionRef(visualState, visualElement, externalRef) { - return React.useCallback(function (instance) { - var _a; - instance && ((_a = visualState.mount) === null || _a === void 0 ? void 0 : _a.call(visualState, instance)); - if (visualElement) { - instance ? visualElement.mount(instance) : visualElement.unmount(); + // Detect drag-and-drop + var dragAndDrop = function () { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) { + return false; } - if (externalRef) { - if (typeof externalRef === "function") { - externalRef(instance); - } else if (isRefObject(externalRef)) { - externalRef.current = instance; + var div = elt('div'); + return "draggable" in div || "dragDrop" in div; + }(); + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) { + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); } } - }, - /** - * Only pass a new ref callback to React if we've received a visual element - * factory. Otherwise we'll be mounting/remounting every time externalRef - * or other dependencies change. - */ - [visualElement]); -} + var node = zwspSupported ? elt("span", "\u200b") : elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node; + } -/** - * Decides if the supplied variable is an array of variant labels - */ -function isVariantLabels(v) { - return Array.isArray(v); -} -/** - * Decides if the supplied variable is variant label - */ -function isVariantLabel(v) { - return typeof v === "string" || isVariantLabels(v); -} -/** - * Creates an object containing the latest state of every MotionValue on a VisualElement - */ -function getCurrent(visualElement) { - var current = {}; - visualElement.forEachValue(function (value, key) { - return current[key] = value.get(); - }); - return current; -} -/** - * Creates an object containing the latest velocity of every MotionValue on a VisualElement - */ -function getVelocity$1(visualElement) { - var velocity = {}; - visualElement.forEachValue(function (value, key) { - return velocity[key] = value.getVelocity(); - }); - return velocity; -} -function resolveVariantFromProps(props, definition, custom, currentValues, currentVelocity) { - var _a; - if (currentValues === void 0) { - currentValues = {}; + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) { + return badBidiRects; + } + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + var r1 = range(txt, 1, 2).getBoundingClientRect(); + removeChildren(measure); + if (!r0 || r0.left == r0.right) { + return false; + } // Safari returns null in some cases (#2780) + return badBidiRects = r1.right - r0.right < 3; + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { + var pos = 0, + result = [], + l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) { + nl = string.length; + } + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result; + } : function (string) { + return string.split(/\r\n?|\n/); + }; + var hasSelection = window.getSelection ? function (te) { + try { + return te.selectionStart != te.selectionEnd; + } catch (e) { + return false; + } + } : function (te) { + var range; + try { + range = te.ownerDocument.selection.createRange(); + } catch (e) {} + if (!range || range.parentElement() != te) { + return false; + } + return range.compareEndPoints("StartToEnd", range) != 0; + }; + var hasCopyEvent = function () { + var e = elt("div"); + if ("oncopy" in e) { + return true; + } + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function"; + }(); + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) { + return badZoomedRects; + } + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; + } + + // Known modes, by name and by MIME + var modes = {}, + mimeModes = {}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + function defineMode(name, mode) { + if (arguments.length > 2) { + mode.dependencies = Array.prototype.slice.call(arguments, 2); + } + modes[name] = mode; + } + function defineMIME(mime, spec) { + mimeModes[mime] = spec; + } + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + function resolveMode(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") { + found = { + name: found + }; + } + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return resolveMode("application/xml"); + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { + return resolveMode("application/json"); + } + if (typeof spec == "string") { + return { + name: spec + }; + } else { + return spec || { + name: "null" + }; + } } - if (currentVelocity === void 0) { - currentVelocity = {}; + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + function getMode(options, spec) { + spec = resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) { + return getMode(options, "text/plain"); + } + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) { + continue; + } + if (modeObj.hasOwnProperty(prop)) { + modeObj["_" + prop] = modeObj[prop]; + } + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) { + modeObj.helperType = spec.helperType; + } + if (spec.modeProps) { + for (var prop$1 in spec.modeProps) { + modeObj[prop$1] = spec.modeProps[prop$1]; + } + } + return modeObj; } - /** - * If the variant definition is a function, resolve. - */ - if (typeof definition === "function") { - definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = {}; + function extendMode(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : modeExtensions[mode] = {}; + copyObj(properties, exts); } - /** - * If the variant definition is a variant label, or - * the function returned a variant label, resolve. - */ - if (typeof definition === "string") { - definition = (_a = props.variants) === null || _a === void 0 ? void 0 : _a[definition]; + function copyState(mode, state) { + if (state === true) { + return state; + } + if (mode.copyState) { + return mode.copyState(state); + } + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) { + val = val.concat([]); + } + nstate[n] = val; + } + return nstate; } - /** - * At this point we've resolved both functions and variant labels, - * but the resolved variant label might itself have been a function. - * If so, resolve. This can only have returned a valid target object. - */ - if (typeof definition === "function") { - definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); - } - return definition; -} -function resolveVariant(visualElement, definition, custom) { - var props = visualElement.getProps(); - return resolveVariantFromProps(props, definition, custom !== null && custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity$1(visualElement)); -} -function checkIfControllingVariants(props) { - var _a; - return typeof ((_a = props.animate) === null || _a === void 0 ? void 0 : _a.start) === "function" || isVariantLabel(props.initial) || isVariantLabel(props.animate) || isVariantLabel(props.whileHover) || isVariantLabel(props.whileDrag) || isVariantLabel(props.whileTap) || isVariantLabel(props.whileFocus) || isVariantLabel(props.exit); -} -function checkIfVariantNode(props) { - return Boolean(checkIfControllingVariants(props) || props.variants); -} -function getCurrentTreeVariants(props, context) { - if (checkIfControllingVariants(props)) { - var initial = props.initial, - animate = props.animate; - return { - initial: initial === false || isVariantLabel(initial) ? initial : undefined, - animate: isVariantLabel(animate) ? animate : undefined + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + function innerMode(mode, state) { + var info; + while (mode.innerMode) { + info = mode.innerMode(state); + if (!info || info.mode == mode) { + break; + } + state = info.state; + mode = info.mode; + } + return info || { + mode: mode, + state: state }; } - return props.inherit !== false ? context : {}; -} -function useCreateMotionContext(props) { - var _a = getCurrentTreeVariants(props, React.useContext(MotionContext)), - initial = _a.initial, - animate = _a.animate; - return React.useMemo(function () { - return { - initial: initial, - animate: animate - }; - }, [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); -} -function variantLabelsAsDependency(prop) { - return Array.isArray(prop) ? prop.join(" ") : prop; -} - -/** - * Creates a constant value over the lifecycle of a component. - * - * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer - * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` - * you can ensure that initialisers don't execute twice or more. - */ -function useConstant(init) { - var ref = React.useRef(null); - if (ref.current === null) { - ref.current = init(); + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; } - return ref.current; -} -/** - * This should only ever be modified on the client otherwise it'll - * persist through server requests. If we need instanced states we - * could lazy-init via root. - */ -var globalProjectionState = { - /** - * Global flag as to whether the tree has animated since the last time - * we resized the window - */ - hasAnimatedSinceResize: true, - /** - * We set this to true once, on the first update. Any nodes added to the tree beyond that - * update will be given a `data-projection-id` attribute. - */ - hasEverUpdated: false -}; -var id$1 = 1; -function useProjectionId() { - return useConstant(function () { - if (globalProjectionState.hasEverUpdated) { - return id$1++; - } - }); -} -var LayoutGroupContext = React.createContext({}); + // STRING STREAM -/** - * Internal, exported only for usage in Framer - */ -var SwitchLayoutGroupContext = React.createContext({}); -function useProjection(projectionId, _a, visualElement, ProjectionNodeConstructor) { - var _b; - var layoutId = _a.layoutId, - layout = _a.layout, - drag = _a.drag, - dragConstraints = _a.dragConstraints, - layoutScroll = _a.layoutScroll; - var initialPromotionConfig = React.useContext(SwitchLayoutGroupContext); - if (!ProjectionNodeConstructor || !visualElement || (visualElement === null || visualElement === void 0 ? void 0 : visualElement.projection)) { - return; - } - visualElement.projection = new ProjectionNodeConstructor(projectionId, visualElement.getLatestValues(), (_b = visualElement.parent) === null || _b === void 0 ? void 0 : _b.projection); - visualElement.projection.setOptions({ - layoutId: layoutId, - layout: layout, - alwaysMeasureLayout: Boolean(drag) || dragConstraints && isRefObject(dragConstraints), - visualElement: visualElement, - scheduleRender: function () { - return visualElement.scheduleRender(); - }, - /** - * TODO: Update options in an effect. This could be tricky as it'll be too late - * to update by the time layout animations run. - * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, - * ensuring it gets called if there's no potential layout animations. - * - */ - animationType: typeof layout === "string" ? layout : "both", - initialPromotionConfig: initialPromotionConfig, - layoutScroll: layoutScroll - }); -} -var VisualElementHandler = /** @class */function (_super) { - tslib.__extends(VisualElementHandler, _super); - function VisualElementHandler() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Update visual element props as soon as we know this update is going to be commited. - */ - VisualElementHandler.prototype.getSnapshotBeforeUpdate = function () { - this.updateProps(); - return null; + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = function (string, tabSize, lineOracle) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + this.lineOracle = lineOracle; }; - VisualElementHandler.prototype.componentDidUpdate = function () {}; - VisualElementHandler.prototype.updateProps = function () { - var _a = this.props, - visualElement = _a.visualElement, - props = _a.props; - if (visualElement) visualElement.setProps(props); + StringStream.prototype.eol = function () { + return this.pos >= this.string.length; }; - VisualElementHandler.prototype.render = function () { - return this.props.children; + StringStream.prototype.sol = function () { + return this.pos == this.lineStart; + }; + StringStream.prototype.peek = function () { + return this.string.charAt(this.pos) || undefined; + }; + StringStream.prototype.next = function () { + if (this.pos < this.string.length) { + return this.string.charAt(this.pos++); + } + }; + StringStream.prototype.eat = function (match) { + var ch = this.string.charAt(this.pos); + var ok; + if (typeof match == "string") { + ok = ch == match; + } else { + ok = ch && (match.test ? match.test(ch) : match(ch)); + } + if (ok) { + ++this.pos; + return ch; + } + }; + StringStream.prototype.eatWhile = function (match) { + var start = this.pos; + while (this.eat(match)) {} + return this.pos > start; + }; + StringStream.prototype.eatSpace = function () { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { + ++this.pos; + } + return this.pos > start; + }; + StringStream.prototype.skipToEnd = function () { + this.pos = this.string.length; + }; + StringStream.prototype.skipTo = function (ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) { + this.pos = found; + return true; + } + }; + StringStream.prototype.backUp = function (n) { + this.pos -= n; + }; + StringStream.prototype.column = function () { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }; + StringStream.prototype.indentation = function () { + return countColumn(this.string, null, this.tabSize) - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }; + StringStream.prototype.match = function (pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function (str) { + return caseInsensitive ? str.toLowerCase() : str; + }; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) { + this.pos += pattern.length; + } + return true; + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) { + return null; + } + if (match && consume !== false) { + this.pos += match[0].length; + } + return match; + } + }; + StringStream.prototype.current = function () { + return this.string.slice(this.start, this.pos); + }; + StringStream.prototype.hideFirstChars = function (n, inner) { + this.lineStart += n; + try { + return inner(); + } finally { + this.lineStart -= n; + } + }; + StringStream.prototype.lookAhead = function (n) { + var oracle = this.lineOracle; + return oracle && oracle.lookAhead(n); + }; + StringStream.prototype.baseToken = function () { + var oracle = this.lineOracle; + return oracle && oracle.baseToken(this.pos); }; - return VisualElementHandler; -}(React__default["default"].Component); -/** - * Create a `motion` component. - * - * This function accepts a Component argument, which can be either a string (ie "div" - * for `motion.div`), or an actual React component. - * - * Alongside this is a config option which provides a way of rendering the provided - * component "offline", or outside the React render cycle. - */ -function createMotionComponent(_a) { - var preloadedFeatures = _a.preloadedFeatures, - createVisualElement = _a.createVisualElement, - projectionNodeConstructor = _a.projectionNodeConstructor, - useRender = _a.useRender, - useVisualState = _a.useVisualState, - Component = _a.Component; - preloadedFeatures && loadFeatures(preloadedFeatures); - function MotionComponent(props, externalRef) { - var layoutId = useLayoutId(props); - props = tslib.__assign(tslib.__assign({}, props), { - layoutId: layoutId - }); - /** - * If we're rendering in a static environment, we only visually update the component - * as a result of a React-rerender rather than interactions or animations. This - * means we don't need to load additional memory structures like VisualElement, - * or any gesture/animation features. - */ - var config = React.useContext(MotionConfigContext); - var features = null; - var context = useCreateMotionContext(props); - /** - * Create a unique projection ID for this component. If a new component is added - * during a layout animation we'll use this to query the DOM and hydrate its ref early, allowing - * us to measure it as soon as any layout effect flushes pending layout animations. - * - * Performance note: It'd be better not to have to search the DOM for these elements. - * For newly-entering components it could be enough to only correct treeScale, in which - * case we could mount in a scale-correction mode. This wouldn't be enough for - * shared element transitions however. Perhaps for those we could revert to a root node - * that gets forceRendered and layout animations are triggered on its layout effect. - */ - var projectionId = config.isStatic ? undefined : useProjectionId(); - /** - * - */ - var visualState = useVisualState(props, config.isStatic); - if (!config.isStatic && isBrowser) { - /** - * Create a VisualElement for this component. A VisualElement provides a common - * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as - * providing a way of rendering to these APIs outside of the React render loop - * for more performant animations and interactions - */ - context.visualElement = useVisualElement(Component, visualState, tslib.__assign(tslib.__assign({}, config), props), createVisualElement); - useProjection(projectionId, props, context.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor); - /** - * Load Motion gesture and animation features. These are rendered as renderless - * components so each feature can optionally make use of React lifecycle methods. - */ - features = useFeatures(props, context.visualElement, preloadedFeatures); + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) { + throw new Error("There is no line " + (n + doc.first) + " in the document."); + } + var chunk = doc; + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], + sz = child.chunkSize(); + if (n < sz) { + chunk = child; + break; + } + n -= sz; + } } - /** - * The mount order and hierarchy is specific to ensure our element ref - * is hydrated by the time features fire their effects. - */ - return React__namespace.createElement(VisualElementHandler, { - visualElement: context.visualElement, - props: tslib.__assign(tslib.__assign({}, config), props) - }, features, React__namespace.createElement(MotionContext.Provider, { - value: context - }, useRender(Component, props, projectionId, useMotionRef(visualState, context.visualElement, externalRef), visualState, config.isStatic, context.visualElement))); + return chunk.lines[n]; } - return React.forwardRef(MotionComponent); -} -function useLayoutId(_a) { - var _b; - var layoutId = _a.layoutId; - var layoutGroupId = (_b = React.useContext(LayoutGroupContext)) === null || _b === void 0 ? void 0 : _b.id; - return layoutGroupId && layoutId !== undefined ? layoutGroupId + "-" + layoutId : layoutId; -} -/** - * Convert any React component into a `motion` component. The provided component - * **must** use `React.forwardRef` to the underlying DOM component you want to animate. - * - * ```jsx - * const Component = React.forwardRef((props, ref) => { - * return
- * }) - * - * const MotionComponent = motion(Component) - * ``` - * - * @public - */ -function createMotionProxy(createConfig) { - function custom(Component, customMotionComponentConfig) { - if (customMotionComponentConfig === void 0) { - customMotionComponentConfig = {}; + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], + n = start.line; + doc.iter(start.line, end.line + 1, function (line) { + var text = line.text; + if (n == end.line) { + text = text.slice(0, end.ch); + } + if (n == start.line) { + text = text.slice(start.ch); + } + out.push(text); + ++n; + }); + return out; + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to) { + var out = []; + doc.iter(from, to, function (line) { + out.push(line.text); + }); // iter aborts when callback returns truthy value + return out; + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) { + for (var n = line; n; n = n.parent) { + n.height += diff; + } } - return createMotionComponent(createConfig(Component, customMotionComponentConfig)); } - if (typeof Proxy === "undefined") { - return custom; + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) { + return null; + } + var cur = line.parent, + no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) { + break; + } + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first; } - /** - * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. - * Rather than generating them anew every render. - */ - var componentCache = new Map(); - return new Proxy(custom, { - /** - * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. - * The prop name is passed through as `key` and we can use that to generate a `motion` - * DOM component with that name. - */ - get: function (_target, key) { - /** - * If this element doesn't exist in the component cache, create it and cache. - */ - if (!componentCache.has(key)) { - componentCache.set(key, custom(key)); + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { + var child = chunk.children[i$1], + ch = child.height; + if (h < ch) { + chunk = child; + continue outer; + } + h -= ch; + n += child.chunkSize(); } - return componentCache.get(key); + return n; + } while (!chunk.lines); + var i = 0; + for (; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], + lh = line.height; + if (h < lh) { + break; + } + h -= lh; } - }); -} + return n + i; + } + function isLine(doc, l) { + return l >= doc.first && l < doc.first + doc.size; + } + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)); + } -/** - * We keep these listed seperately as we use the lowercase tag names as part - * of the runtime bundle to detect SVG components - */ -var lowercaseSVGElements = ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view"]; -function isSVGComponent(Component) { - if ( - /** - * If it's not a string, it's a custom React component. Currently we only support - * HTML custom React components. - */ - typeof Component !== "string" || - /** - * If it contains a dash, the element is a custom HTML webcomponent. - */ - Component.includes("-")) { - return false; - } else if ( - /** - * If it's in our list of lowercase SVG tags, it's an SVG component - */ - lowercaseSVGElements.indexOf(Component) > -1 || - /** - * If it contains a capital letter, it's an SVG component - */ - /[A-Z]/.test(Component)) { - return true; + // A Pos instance represents a position within the text. + function Pos(line, ch, sticky) { + if (sticky === void 0) sticky = null; + if (!(this instanceof Pos)) { + return new Pos(line, ch, sticky); + } + this.line = line; + this.ch = ch; + this.sticky = sticky; } - return false; -} -var scaleCorrectors = {}; -function addScaleCorrector(correctors) { - Object.assign(scaleCorrectors, correctors); -} -/** - * A list of all transformable axes. We'll use this list to generated a version - * of each axes for each transform. - */ -var transformAxes = ["", "X", "Y", "Z"]; -/** - * An ordered array of each transformable value. By default, transform values - * will be sorted to this order. - */ -var order = ["translate", "scale", "rotate", "skew"]; -/** - * Generate a list of every possible transform key. - */ -var transformProps = ["transformPerspective", "x", "y", "z"]; -order.forEach(function (operationKey) { - return transformAxes.forEach(function (axesKey) { - return transformProps.push(operationKey + axesKey); - }); -}); -/** - * A function to use with Array.sort to sort transform keys by their default order. - */ -function sortTransformProps(a, b) { - return transformProps.indexOf(a) - transformProps.indexOf(b); -} -/** - * A quick lookup for transform props. - */ -var transformPropSet = new Set(transformProps); -function isTransformProp(key) { - return transformPropSet.has(key); -} -/** - * A quick lookup for transform origin props - */ -var transformOriginProps = new Set(["originX", "originY", "originZ"]); -function isTransformOriginProp(key) { - return transformOriginProps.has(key); -} -function isForcedMotionValue(key, _a) { - var layout = _a.layout, - layoutId = _a.layoutId; - return isTransformProp(key) || isTransformOriginProp(key) || (layout || layoutId !== undefined) && (!!scaleCorrectors[key] || key === "opacity"); -} -var isMotionValue = function (value) { - return Boolean(value !== null && typeof value === "object" && value.getVelocity); -}; -var translateAlias = { - x: "translateX", - y: "translateY", - z: "translateZ", - transformPerspective: "perspective" -}; -/** - * Build a CSS transform style from individual x/y/scale etc properties. - * - * This outputs with a default order of transforms/scales/rotations, this can be customised by - * providing a transformTemplate function. - */ -function buildTransform(_a, _b, transformIsDefault, transformTemplate) { - var transform = _a.transform, - transformKeys = _a.transformKeys; - var _c = _b.enableHardwareAcceleration, - enableHardwareAcceleration = _c === void 0 ? true : _c, - _d = _b.allowTransformNone, - allowTransformNone = _d === void 0 ? true : _d; - // The transform string we're going to build into. - var transformString = ""; - // Transform keys into their default order - this will determine the output order. - transformKeys.sort(sortTransformProps); - // Track whether the defined transform has a defined z so we don't add a - // second to enable hardware acceleration - var transformHasZ = false; - // Loop over each transform and build them into transformString - var numTransformKeys = transformKeys.length; - for (var i = 0; i < numTransformKeys; i++) { - var key = transformKeys[i]; - transformString += "".concat(translateAlias[key] || key, "(").concat(transform[key], ") "); - if (key === "z") transformHasZ = true; + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + function cmp(a, b) { + return a.line - b.line || a.ch - b.ch; } - if (!transformHasZ && enableHardwareAcceleration) { - transformString += "translateZ(0)"; - } else { - transformString = transformString.trim(); + function equalCursorPos(a, b) { + return a.sticky == b.sticky && cmp(a, b) == 0; } - // If we have a custom `transform` template, pass our transform values and - // generated transformString to that before returning - if (transformTemplate) { - transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); - } else if (allowTransformNone && transformIsDefault) { - transformString = "none"; + function copyPos(x) { + return Pos(x.line, x.ch); + } + function maxPos(a, b) { + return cmp(a, b) < 0 ? b : a; + } + function minPos(a, b) { + return cmp(a, b) < 0 ? a : b; } - return transformString; -} -/** - * Build a transformOrigin style. Uses the same defaults as the browser for - * undefined origins. - */ -function buildTransformOrigin(_a) { - var _b = _a.originX, - originX = _b === void 0 ? "50%" : _b, - _c = _a.originY, - originY = _c === void 0 ? "50%" : _c, - _d = _a.originZ, - originZ = _d === void 0 ? 0 : _d; - return "".concat(originX, " ").concat(originY, " ").concat(originZ); -} -/** - * Returns true if the provided key is a CSS variable - */ -function isCSSVariable$1(key) { - return key.startsWith("--"); -} + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) { + return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1)); + } + function clipPos(doc, pos) { + if (pos.line < doc.first) { + return Pos(doc.first, 0); + } + var last = doc.first + doc.size - 1; + if (pos.line > last) { + return Pos(last, getLine(doc, last).text.length); + } + return clipToLen(pos, getLine(doc, pos.line).text.length); + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) { + return Pos(pos.line, linelen); + } else if (ch < 0) { + return Pos(pos.line, 0); + } else { + return pos; + } + } + function clipPosArray(doc, array) { + var out = []; + for (var i = 0; i < array.length; i++) { + out[i] = clipPos(doc, array[i]); + } + return out; + } + var SavedContext = function (state, lookAhead) { + this.state = state; + this.lookAhead = lookAhead; + }; + var Context = function (doc, state, line, lookAhead) { + this.state = state; + this.doc = doc; + this.line = line; + this.maxLookAhead = lookAhead || 0; + this.baseTokens = null; + this.baseTokenPos = 1; + }; + Context.prototype.lookAhead = function (n) { + var line = this.doc.getLine(this.line + n); + if (line != null && n > this.maxLookAhead) { + this.maxLookAhead = n; + } + return line; + }; + Context.prototype.baseToken = function (n) { + if (!this.baseTokens) { + return null; + } + while (this.baseTokens[this.baseTokenPos] <= n) { + this.baseTokenPos += 2; + } + var type = this.baseTokens[this.baseTokenPos + 1]; + return { + type: type && type.replace(/( |^)overlay .*/, ""), + size: this.baseTokens[this.baseTokenPos] - n + }; + }; + Context.prototype.nextLine = function () { + this.line++; + if (this.maxLookAhead > 0) { + this.maxLookAhead--; + } + }; + Context.fromSaved = function (doc, saved, line) { + if (saved instanceof SavedContext) { + return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead); + } else { + return new Context(doc, copyState(doc.mode, saved), line); + } + }; + Context.prototype.save = function (copy) { + var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; + return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state; + }; -/** - * Provided a value and a ValueType, returns the value as that value type. - */ -var getValueAsType = function (value, type) { - return type && typeof value === "number" ? type.transform(value) : value; -}; -var int = tslib.__assign(tslib.__assign({}, styleValueTypes.number), { - transform: Math.round -}); -var numberValueTypes = { - // Border props - borderWidth: styleValueTypes.px, - borderTopWidth: styleValueTypes.px, - borderRightWidth: styleValueTypes.px, - borderBottomWidth: styleValueTypes.px, - borderLeftWidth: styleValueTypes.px, - borderRadius: styleValueTypes.px, - radius: styleValueTypes.px, - borderTopLeftRadius: styleValueTypes.px, - borderTopRightRadius: styleValueTypes.px, - borderBottomRightRadius: styleValueTypes.px, - borderBottomLeftRadius: styleValueTypes.px, - // Positioning props - width: styleValueTypes.px, - maxWidth: styleValueTypes.px, - height: styleValueTypes.px, - maxHeight: styleValueTypes.px, - size: styleValueTypes.px, - top: styleValueTypes.px, - right: styleValueTypes.px, - bottom: styleValueTypes.px, - left: styleValueTypes.px, - // Spacing props - padding: styleValueTypes.px, - paddingTop: styleValueTypes.px, - paddingRight: styleValueTypes.px, - paddingBottom: styleValueTypes.px, - paddingLeft: styleValueTypes.px, - margin: styleValueTypes.px, - marginTop: styleValueTypes.px, - marginRight: styleValueTypes.px, - marginBottom: styleValueTypes.px, - marginLeft: styleValueTypes.px, - // Transform props - rotate: styleValueTypes.degrees, - rotateX: styleValueTypes.degrees, - rotateY: styleValueTypes.degrees, - rotateZ: styleValueTypes.degrees, - scale: styleValueTypes.scale, - scaleX: styleValueTypes.scale, - scaleY: styleValueTypes.scale, - scaleZ: styleValueTypes.scale, - skew: styleValueTypes.degrees, - skewX: styleValueTypes.degrees, - skewY: styleValueTypes.degrees, - distance: styleValueTypes.px, - translateX: styleValueTypes.px, - translateY: styleValueTypes.px, - translateZ: styleValueTypes.px, - x: styleValueTypes.px, - y: styleValueTypes.px, - z: styleValueTypes.px, - perspective: styleValueTypes.px, - transformPerspective: styleValueTypes.px, - opacity: styleValueTypes.alpha, - originX: styleValueTypes.progressPercentage, - originY: styleValueTypes.progressPercentage, - originZ: styleValueTypes.px, - // Misc - zIndex: int, - // SVG - fillOpacity: styleValueTypes.alpha, - strokeOpacity: styleValueTypes.alpha, - numOctaves: int -}; -function buildHTMLStyles(state, latestValues, options, transformTemplate) { - var _a; - var style = state.style, - vars = state.vars, - transform = state.transform, - transformKeys = state.transformKeys, - transformOrigin = state.transformOrigin; - // Empty the transformKeys array. As we're throwing out refs to its items - // this might not be as cheap as suspected. Maybe using the array as a buffer - // with a manual incrementation would be better. - transformKeys.length = 0; - // Track whether we encounter any transform or transformOrigin values. - var hasTransform = false; - var hasTransformOrigin = false; - // Does the calculated transform essentially equal "none"? - var transformIsNone = true; - /** - * Loop over all our latest animated values and decide whether to handle them - * as a style or CSS variable. - * - * Transforms and transform origins are kept seperately for further processing. - */ - for (var key in latestValues) { - var value = latestValues[key]; - /** - * If this is a CSS variable we don't do any further processing. - */ - if (isCSSVariable$1(key)) { - vars[key] = value; - continue; + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, context, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], + lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, context, function (end, style) { + return st.push(end, style); + }, lineClasses, forceToEnd); + var state = context.state; + + // Run overlays, adjust style array. + var loop = function (o) { + context.baseTokens = st; + var overlay = cm.state.overlays[o], + i = 1, + at = 0; + context.state = true; + runMode(cm, line.text, overlay.mode, context, function (end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) { + st.splice(i, 1, end, st[i + 1], i_end); + } + i += 2; + at = Math.min(end, i_end); + } + if (!style) { + return; + } + if (overlay.opaque) { + st.splice(start, i - start, end, "overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start + 1]; + st[start + 1] = (cur ? cur + " " : "") + "overlay " + style; + } + } + }, lineClasses); + context.state = state; + context.baseTokens = null; + context.baseTokenPos = 1; + }; + for (var o = 0; o < cm.state.overlays.length; ++o) loop(o); + return { + styles: st, + classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null + }; + } + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var context = getContextBefore(cm, lineNo(line)); + var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); + var result = highlightLine(cm, line, context); + if (resetState) { + context.state = resetState; + } + line.stateAfter = context.save(!resetState); + line.styles = result.styles; + if (result.classes) { + line.styleClasses = result.classes; + } else if (line.styleClasses) { + line.styleClasses = null; + } + if (updateFrontier === cm.doc.highlightFrontier) { + cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); + } + } + return line.styles; + } + function getContextBefore(cm, n, precise) { + var doc = cm.doc, + display = cm.display; + if (!doc.mode.startState) { + return new Context(doc, true, n); + } + var start = findStartLine(cm, n, precise); + var saved = start > doc.first && getLine(doc, start - 1).stateAfter; + var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); + doc.iter(start, n, function (line) { + processLine(cm, line.text, context); + var pos = context.line; + line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; + context.nextLine(); + }); + if (precise) { + doc.modeFrontier = context.line; } - // Convert the value to its default value type, ie 0 -> "0px" - var valueType = numberValueTypes[key]; - var valueAsType = getValueAsType(value, valueType); - if (isTransformProp(key)) { - // If this is a transform, flag to enable further transform processing - hasTransform = true; - transform[key] = valueAsType; - transformKeys.push(key); - // If we already know we have a non-default transform, early return - if (!transformIsNone) continue; - // Otherwise check to see if this is a default transform - if (value !== ((_a = valueType.default) !== null && _a !== void 0 ? _a : 0)) transformIsNone = false; - } else if (isTransformOriginProp(key)) { - transformOrigin[key] = valueAsType; - // If this is a transform origin, flag and enable further transform-origin processing - hasTransformOrigin = true; - } else { - style[key] = valueAsType; + return context; + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, context, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize, context); + stream.start = stream.pos = startAt || 0; + if (text == "") { + callBlankLine(mode, context.state); + } + while (!stream.eol()) { + readToken(mode, stream, context.state); + stream.start = stream.pos; } } - if (hasTransform) { - style.transform = buildTransform(state, options, transformIsNone, transformTemplate); - } else if (transformTemplate) { - style.transform = transformTemplate({}, ""); - } else if (!latestValues.transform && style.transform) { - style.transform = "none"; + function callBlankLine(mode, state) { + if (mode.blankLine) { + return mode.blankLine(state); + } + if (!mode.innerMode) { + return; + } + var inner = innerMode(mode, state); + if (inner.mode.blankLine) { + return inner.mode.blankLine(inner.state); + } } - if (hasTransformOrigin) { - style.transformOrigin = buildTransformOrigin(transformOrigin); + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) { + inner[0] = innerMode(mode, state).mode; + } + var style = mode.token(stream, state); + if (stream.pos > stream.start) { + return style; + } + } + throw new Error("Mode " + mode.name + " failed to advance stream."); } -} -var createHtmlRenderState = function () { - return { - style: {}, - transform: {}, - transformKeys: [], - transformOrigin: {}, - vars: {} + var Token = function (stream, type, state) { + this.start = stream.start; + this.end = stream.pos; + this.string = stream.current(); + this.type = type || null; + this.state = state; }; -}; -function copyRawValuesOnly(target, source, props) { - for (var key in source) { - if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { - target[key] = source[key]; + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + var doc = cm.doc, + mode = doc.mode, + style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), + context = getContextBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize, context), + tokens; + if (asArray) { + tokens = []; + } + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, context.state); + if (asArray) { + tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); + } + } + return asArray ? tokens : new Token(stream, style, context.state); + } + function extractLineClasses(type, output) { + if (type) { + for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) { + break; + } + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) { + output[prop] = lineClass[2]; + } else if (!new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)").test(output[prop])) { + output[prop] += " " + lineClass[2]; + } + } } + return type; } -} -function useInitialMotionValues(_a, visualState, isStatic) { - var transformTemplate = _a.transformTemplate; - return React.useMemo(function () { - var state = createHtmlRenderState(); - buildHTMLStyles(state, visualState, { - enableHardwareAcceleration: !isStatic - }, transformTemplate); - var vars = state.vars, - style = state.style; - return tslib.__assign(tslib.__assign({}, vars), style); - }, [visualState]); -} -function useStyle(props, visualState, isStatic) { - var styleProp = props.style || {}; - var style = {}; - /** - * Copy non-Motion Values straight into style - */ - copyRawValuesOnly(style, styleProp, props); - Object.assign(style, useInitialMotionValues(props, visualState, isStatic)); - if (props.transformValues) { - style = props.transformValues(style); - } - return style; -} -function useHTMLProps(props, visualState, isStatic) { - // The `any` isn't ideal but it is the type of createElement props argument - var htmlProps = {}; - var style = useStyle(props, visualState, isStatic); - if (Boolean(props.drag) && props.dragListener !== false) { - // Disable the ghost element when a user drags - htmlProps.draggable = false; - // Disable text selection - style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = "none"; - // Disable scrolling on the draggable direction - style.touchAction = props.drag === true ? "none" : "pan-".concat(props.drag === "x" ? "y" : "x"); + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) { + flattenSpans = cm.options.flattenSpans; + } + var curStart = 0, + curStyle = null; + var stream = new StringStream(text, cm.options.tabSize, context), + style; + var inner = cm.options.addModeClass && [null]; + if (text == "") { + extractLineClasses(callBlankLine(mode, context.state), lineClasses); + } + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) { + processLine(cm, text, context, stream.pos); + } + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) { + style = "m-" + (style ? mName + " " + style : mName); + } + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 5000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 + // characters, and returns inaccurate measurements in nodes + // starting around 5000 chars. + var pos = Math.min(stream.pos, curStart + 5000); + f(pos, curStyle); + curStart = pos; + } } - htmlProps.style = style; - return htmlProps; -} -/** - * A list of all valid MotionProps. - * - * @privateRemarks - * This doesn't throw if a `MotionProp` name is missing - it should. - */ -var validMotionProps = new Set(["initial", "animate", "exit", "style", "variants", "transition", "transformTemplate", "transformValues", "custom", "inherit", "layout", "layoutId", "layoutDependency", "onLayoutAnimationStart", "onLayoutAnimationComplete", "onLayoutMeasure", "onBeforeLayoutMeasure", "onAnimationStart", "onAnimationComplete", "onUpdate", "onDragStart", "onDrag", "onDragEnd", "onMeasureDragConstraints", "onDirectionLock", "onDragTransitionEnd", "drag", "dragControls", "dragListener", "dragConstraints", "dragDirectionLock", "dragSnapToOrigin", "_dragX", "_dragY", "dragElastic", "dragMomentum", "dragPropagation", "dragTransition", "whileDrag", "onPan", "onPanStart", "onPanEnd", "onPanSessionStart", "onTap", "onTapStart", "onTapCancel", "onHoverStart", "onHoverEnd", "whileFocus", "whileTap", "whileHover", "whileInView", "onViewportEnter", "onViewportLeave", "viewport", "layoutScroll"]); -/** - * Check whether a prop name is a valid `MotionProp` key. - * - * @param key - Name of the property to check - * @returns `true` is key is a valid `MotionProp`. - * - * @public - */ -function isValidMotionProp(key) { - return validMotionProps.has(key); -} -var shouldForward = function (key) { - return !isValidMotionProp(key); -}; -function loadExternalIsValidProp(isValidProp) { - if (!isValidProp) return; - // Explicitly filter our events - shouldForward = function (key) { - return key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); - }; -} -/** - * Emotion and Styled Components both allow users to pass through arbitrary props to their components - * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which - * of these should be passed to the underlying DOM node. - * - * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props - * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props - * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of - * `@emotion/is-prop-valid`, however to fix this problem we need to use it. - * - * By making it an optionalDependency we can offer this functionality only in the situations where it's - * actually required. - */ -try { - /** - * We attempt to import this package but require won't be defined in esm environments, in that case - * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed - * in favour of explicit injection. - */ - loadExternalIsValidProp((__webpack_require__(/*! @emotion/is-prop-valid */ "../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js")["default"])); -} catch (_a) { - // We don't need to actually do anything here - the fallback is the existing `isPropValid`. -} -function filterProps(props, isDom, forwardMotionProps) { - var filteredProps = {}; - for (var key in props) { - if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || - // If trying to use native HTML drag events, forward drag listeners - props["draggable"] && key.startsWith("onDrag")) { - filteredProps[key] = props[key]; + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, + minline, + doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) { + return doc.first; + } + var line = getLine(doc, search - 1), + after = line.stateAfter; + if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) { + return search; + } + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } } + return minline; } - return filteredProps; -} -function calcOrigin$1(origin, offset, size) { - return typeof origin === "string" ? origin : styleValueTypes.px.transform(offset + size * origin); -} -/** - * The SVG transform origin defaults are different to CSS and is less intuitive, - * so we use the measured dimensions of the SVG to reconcile these. - */ -function calcSVGTransformOrigin(dimensions, originX, originY) { - var pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width); - var pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height); - return "".concat(pxOriginX, " ").concat(pxOriginY); -} -var dashKeys = { - offset: "stroke-dashoffset", - array: "stroke-dasharray" -}; -var camelKeys = { - offset: "strokeDashoffset", - array: "strokeDasharray" -}; -/** - * Build SVG path properties. Uses the path's measured length to convert - * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset - * and stroke-dasharray attributes. - * - * This function is mutative to reduce per-frame GC. - */ -function buildSVGPath(attrs, length, spacing, offset, useDashCase) { - if (spacing === void 0) { - spacing = 1; + function retreatFrontier(doc, n) { + doc.modeFrontier = Math.min(doc.modeFrontier, n); + if (doc.highlightFrontier < n - 10) { + return; + } + var start = doc.first; + for (var line = n - 1; line > start; line--) { + var saved = getLine(doc, line).stateAfter; + // change is on 3 + // state on line 1 looked ahead 2 -- so saw 3 + // test 1 + 2 < 3 should cover this + if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { + start = line + 1; + break; + } + } + doc.highlightFrontier = Math.min(doc.highlightFrontier, start); } - if (offset === void 0) { - offset = 0; + + // Optimize some code when these features are not used. + var sawReadOnlySpans = false, + sawCollapsedSpans = false; + function seeReadOnlySpans() { + sawReadOnlySpans = true; } - if (useDashCase === void 0) { - useDashCase = true; + function seeCollapsedSpans() { + sawCollapsedSpans = true; } - // Normalise path length by setting SVG attribute pathLength to 1 - attrs.pathLength = 1; - // We use dash case when setting attributes directly to the DOM node and camel case - // when defining props on a React component. - var keys = useDashCase ? dashKeys : camelKeys; - // Build the dash offset - attrs[keys.offset] = styleValueTypes.px.transform(-offset); - // Build the dash array - var pathLength = styleValueTypes.px.transform(length); - var pathSpacing = styleValueTypes.px.transform(spacing); - attrs[keys.array] = "".concat(pathLength, " ").concat(pathSpacing); -} -/** - * Build SVG visual attrbutes, like cx and style.transform - */ -function buildSVGAttrs(state, _a, options, transformTemplate) { - var attrX = _a.attrX, - attrY = _a.attrY, - originX = _a.originX, - originY = _a.originY, - pathLength = _a.pathLength, - _b = _a.pathSpacing, - pathSpacing = _b === void 0 ? 1 : _b, - _c = _a.pathOffset, - pathOffset = _c === void 0 ? 0 : _c, - // This is object creation, which we try to avoid per-frame. - latest = tslib.__rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]); - buildHTMLStyles(state, latest, options, transformTemplate); - state.attrs = state.style; - state.style = {}; - var attrs = state.attrs, - style = state.style, - dimensions = state.dimensions; - /** - * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs - * and copy it into style. - */ - if (attrs.transform) { - if (dimensions) style.transform = attrs.transform; - delete attrs.transform; + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; + this.to = to; } - // Parse transformOrigin - if (dimensions && (originX !== undefined || originY !== undefined || style.transform)) { - style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5); + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) { + return span; + } + } + } } - // Treat x/y not as shortcuts but as actual attributes - if (attrX !== undefined) attrs.x = attrX; - if (attrY !== undefined) attrs.y = attrY; - // Build SVG path if one has been defined - if (pathLength !== undefined) { - buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + var r; + for (var i = 0; i < spans.length; ++i) { + if (spans[i] != span) { + (r || (r = [])).push(spans[i]); + } + } + return r; } -} -var createSvgRenderState = function () { - return tslib.__assign(tslib.__assign({}, createHtmlRenderState()), { - attrs: {} - }); -}; -function useSVGProps(props, visualState) { - var visualProps = React.useMemo(function () { - var state = createSvgRenderState(); - buildSVGAttrs(state, visualState, { - enableHardwareAcceleration: false - }, props.transformTemplate); - return tslib.__assign(tslib.__assign({}, state.attrs), { - style: tslib.__assign({}, state.style) - }); - }, [visualState]); - if (props.style) { - var rawStyles = {}; - copyRawValuesOnly(rawStyles, props.style, props); - visualProps.style = tslib.__assign(tslib.__assign({}, rawStyles), visualProps.style); + + // Add a span to a line. + function addMarkedSpan(line, span, op) { + var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet())); + if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) { + line.markedSpans.push(span); + } else { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + if (inThisOp) { + inThisOp.add(line.markedSpans); + } + } + span.marker.attachLine(line); } - return visualProps; -} -function createUseRender(forwardMotionProps) { - if (forwardMotionProps === void 0) { - forwardMotionProps = false; + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + var nw; + if (old) { + for (var i = 0; i < old.length; ++i) { + var span = old[i], + marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); + (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } + } + return nw; } - var useRender = function (Component, props, projectionId, ref, _a, isStatic) { - var latestValues = _a.latestValues; - var useVisualProps = isSVGComponent(Component) ? useSVGProps : useHTMLProps; - var visualProps = useVisualProps(props, latestValues, isStatic); - var filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); - var elementProps = tslib.__assign(tslib.__assign(tslib.__assign({}, filteredProps), visualProps), { - ref: ref - }); - if (projectionId) { - elementProps["data-projection-id"] = projectionId; + function markedSpansAfter(old, endCh, isInsert) { + var nw; + if (old) { + for (var i = 0; i < old.length; ++i) { + var span = old[i], + marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); + (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, span.to == null ? null : span.to - endCh)); + } + } } - return React.createElement(Component, elementProps); - }; - return useRender; -} -var CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g; -var REPLACE_TEMPLATE = "$1-$2"; -/** - * Convert camelCase to dash-case properties. - */ -var camelToDash = function (str) { - return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase(); -}; -function renderHTML(element, _a, styleProp, projection) { - var style = _a.style, - vars = _a.vars; - Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp)); - // Loop over any CSS variables and assign those. - for (var key in vars) { - element.style.setProperty(key, vars[key]); + return nw; } -} -/** - * A set of attribute names that are always read/written as camel case. - */ -var camelCaseAttributes = new Set(["baseFrequency", "diffuseConstant", "kernelMatrix", "kernelUnitLength", "keySplines", "keyTimes", "limitingConeAngle", "markerHeight", "markerWidth", "numOctaves", "targetX", "targetY", "surfaceScale", "specularConstant", "specularExponent", "stdDeviation", "tableValues", "viewBox", "gradientTransform", "pathLength"]); -function renderSVG(element, renderState, _styleProp, projection) { - renderHTML(element, renderState, undefined, projection); - for (var key in renderState.attrs) { - element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); - } -} -function scrapeMotionValuesFromProps$1(props) { - var style = props.style; - var newValues = {}; - for (var key in style) { - if (isMotionValue(style[key]) || isForcedMotionValue(key, props)) { - newValues[key] = style[key]; + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) { + return null; + } + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) { + return null; + } + var startCh = change.from.ch, + endCh = change.to.ch, + isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, + offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) { + span.to = startCh; + } else if (sameLine) { + span.to = found.to == null ? null : found.to + offset; + } + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i$1 = 0; i$1 < last.length; ++i$1) { + var span$1 = last[i$1]; + if (span$1.to != null) { + span$1.to += offset; + } + if (span$1.from == null) { + var found$1 = getMarkedSpanFor(first, span$1.marker); + if (!found$1) { + span$1.from = offset; + if (sameLine) { + (first || (first = [])).push(span$1); + } + } + } else { + span$1.from += offset; + if (sameLine) { + (first || (first = [])).push(span$1); + } + } + } + } + // Make sure we didn't create any zero-length spans + if (first) { + first = clearEmptySpans(first); } + if (last && last != first) { + last = clearEmptySpans(last); + } + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, + gapMarkers; + if (gap > 0 && first) { + for (var i$2 = 0; i$2 < first.length; ++i$2) { + if (first[i$2].to == null) { + (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); + } + } + } + for (var i$3 = 0; i$3 < gap; ++i$3) { + newMarkers.push(gapMarkers); + } + newMarkers.push(last); + } + return newMarkers; } - return newValues; -} -function scrapeMotionValuesFromProps(props) { - var newValues = scrapeMotionValuesFromProps$1(props); - for (var key in props) { - if (isMotionValue(props[key])) { - var targetKey = key === "x" || key === "y" ? "attr" + key.toUpperCase() : key; - newValues[targetKey] = props[key]; + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) { + spans.splice(i--, 1); + } } + if (!spans.length) { + return null; + } + return spans; } - return newValues; -} -function isAnimationControls(v) { - return typeof v === "object" && typeof v.start === "function"; -} -var isKeyframesTarget = function (v) { - return Array.isArray(v); -}; -var isCustomValue = function (v) { - return Boolean(v && typeof v === "object" && v.mix && v.toValue); -}; -var resolveFinalValueInKeyframes = function (v) { - // TODO maybe throw if v.length - 1 is placeholder token? - return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; -}; -/** - * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself - * - * TODO: Remove and move to library - */ -function resolveMotionValue(value) { - var unwrappedValue = isMotionValue(value) ? value.get() : value; - return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue; -} -function makeState(_a, props, context, presenceContext) { - var scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps, - createRenderState = _a.createRenderState, - onMount = _a.onMount; - var state = { - latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), - renderState: createRenderState() - }; - if (onMount) { - state.mount = function (instance) { - return onMount(props, instance, state); - }; - } - return state; -} -var makeUseVisualState = function (config) { - return function (props, isStatic) { - var context = React.useContext(MotionContext); - var presenceContext = React.useContext(PresenceContext); - return isStatic ? makeState(config, props, context, presenceContext) : useConstant(function () { - return makeState(config, props, context, presenceContext); + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function (line) { + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) { + (markers || (markers = [])).push(mark); + } + } + } }); - }; -}; -function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { - var values = {}; - var blockInitialAnimation = (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false; - var motionValues = scrapeMotionValues(props); - for (var key in motionValues) { - values[key] = resolveMotionValue(motionValues[key]); + if (!markers) { + return null; + } + var parts = [{ + from: from, + to: to + }]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], + m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { + continue; + } + var newParts = [j, 1], + dfrom = cmp(p.from, m.from), + dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) { + newParts.push({ + from: p.from, + to: m.from + }); + } + if (dto > 0 || !mk.inclusiveRight && !dto) { + newParts.push({ + from: m.to, + to: p.to + }); + } + parts.splice.apply(parts, newParts); + j += newParts.length - 3; + } + } + return parts; } - var initial = props.initial, - animate = props.animate; - var isControllingVariants = checkIfControllingVariants(props); - var isVariantNode = checkIfVariantNode(props); - if (context && isVariantNode && !isControllingVariants && props.inherit !== false) { - initial !== null && initial !== void 0 ? initial : initial = context.initial; - animate !== null && animate !== void 0 ? animate : animate = context.animate; + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) { + return; + } + for (var i = 0; i < spans.length; ++i) { + spans[i].marker.detachLine(line); + } + line.markedSpans = null; } - var initialAnimationIsBlocked = blockInitialAnimation || initial === false; - var variantToSet = initialAnimationIsBlocked ? animate : initial; - if (variantToSet && typeof variantToSet !== "boolean" && !isAnimationControls(variantToSet)) { - var list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; - list.forEach(function (definition) { - var resolved = resolveVariantFromProps(props, definition); - if (!resolved) return; - var transitionEnd = resolved.transitionEnd; - resolved.transition; - var target = tslib.__rest(resolved, ["transitionEnd", "transition"]); - for (var key in target) { - var valueTarget = target[key]; - if (Array.isArray(valueTarget)) { - /** - * Take final keyframe if the initial animation is blocked because - * we want to initialise at the end of that blocked animation. - */ - var index = initialAnimationIsBlocked ? valueTarget.length - 1 : 0; - valueTarget = valueTarget[index]; + function attachMarkedSpans(line, spans) { + if (!spans) { + return; + } + for (var i = 0; i < spans.length; ++i) { + spans[i].marker.attachLine(line); + } + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { + return marker.inclusiveLeft ? -1 : 0; + } + function extraRight(marker) { + return marker.inclusiveRight ? 1 : 0; + } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) { + return lenDiff; + } + var aPos = a.find(), + bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) { + return -fromCmp; + } + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) { + return toCmp; + } + return b.id - a.id; + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, + found; + if (sps) { + for (var sp = void 0, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { + found = sp.marker; } - if (valueTarget !== null) { - values[key] = valueTarget; + } + } + return found; + } + function collapsedSpanAtStart(line) { + return collapsedSpanAtSide(line, true); + } + function collapsedSpanAtEnd(line) { + return collapsedSpanAtSide(line, false); + } + function collapsedSpanAround(line, ch) { + var sps = sawCollapsedSpans && line.markedSpans, + found; + if (sps) { + for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { + found = sp.marker; } } - for (var key in transitionEnd) values[key] = transitionEnd[key]; - }); + } + return found; } - return values; -} -var svgMotionConfig = { - useVisualState: makeUseVisualState({ - scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, - createRenderState: createSvgRenderState, - onMount: function (props, instance, _a) { - var renderState = _a.renderState, - latestValues = _a.latestValues; - try { - renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect(); - } catch (e) { - // Most likely trying to measure an unrendered element under Firefox - renderState.dimensions = { - x: 0, - y: 0, - width: 0, - height: 0 - }; + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { + for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) { + continue; + } + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { + continue; + } + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) { + return true; + } } - buildSVGAttrs(renderState, latestValues, { - enableHardwareAcceleration: false - }, props.transformTemplate); - renderSVG(instance, renderState); } - }) -}; -var htmlMotionConfig = { - useVisualState: makeUseVisualState({ - scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1, - createRenderState: createHtmlRenderState - }) -}; -function createDomMotionConfig(Component, _a, preloadedFeatures, createVisualElement, projectionNodeConstructor) { - var _b = _a.forwardMotionProps, - forwardMotionProps = _b === void 0 ? false : _b; - var baseConfig = isSVGComponent(Component) ? svgMotionConfig : htmlMotionConfig; - return tslib.__assign(tslib.__assign({}, baseConfig), { - preloadedFeatures: preloadedFeatures, - useRender: createUseRender(forwardMotionProps), - createVisualElement: createVisualElement, - projectionNodeConstructor: projectionNodeConstructor, - Component: Component - }); -} -exports.AnimationType = void 0; -(function (AnimationType) { - AnimationType["Animate"] = "animate"; - AnimationType["Hover"] = "whileHover"; - AnimationType["Tap"] = "whileTap"; - AnimationType["Drag"] = "whileDrag"; - AnimationType["Focus"] = "whileFocus"; - AnimationType["InView"] = "whileInView"; - AnimationType["Exit"] = "exit"; -})(exports.AnimationType || (exports.AnimationType = {})); -function addDomEvent(target, eventName, handler, options) { - if (options === void 0) { - options = { - passive: true - }; } - target.addEventListener(eventName, handler, options); - return function () { - return target.removeEventListener(eventName, handler); - }; -} -/** - * Attaches an event listener directly to the provided DOM element. - * - * Bypassing React's event system can be desirable, for instance when attaching non-passive - * event handlers. - * - * ```jsx - * const ref = useRef(null) - * - * useDomEvent(ref, 'wheel', onWheel, { passive: false }) - * - * return
- * ``` - * - * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. - * @param eventName - Name of the event you want listen for. - * @param handler - Function to fire when receiving the event. - * @param options - Options to pass to `Event.addEventListener`. - * - * @public - */ -function useDomEvent(ref, eventName, handler, options) { - React.useEffect(function () { - var element = ref.current; - if (handler && element) { - return addDomEvent(element, eventName, handler, options); + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) { + line = merged.find(-1, true).line; } - }, [ref, eventName, handler, options]); -} + return line; + } + function visualLineEnd(line) { + var merged; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + } + return line; + } -/** - * - * @param props - * @param ref - * @internal - */ -function useFocusGesture(_a) { - var whileFocus = _a.whileFocus, - visualElement = _a.visualElement; - var onFocus = function () { - var _a; - (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Focus, true); - }; - var onBlur = function () { - var _a; - (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Focus, false); - }; - useDomEvent(visualElement, "focus", whileFocus ? onFocus : undefined); - useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined); -} -function isMouseEvent(event) { - // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check. - if (typeof PointerEvent !== "undefined" && event instanceof PointerEvent) { - return !!(event.pointerType === "mouse"); + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + (lines || (lines = [])).push(line); + } + return lines; } - return event instanceof MouseEvent; -} -function isTouchEvent(event) { - var hasTouches = !!event.touches; - return hasTouches; -} -/** - * Filters out events not attached to the primary pointer (currently left mouse button) - * @param eventHandler - */ -function filterPrimaryPointer(eventHandler) { - return function (event) { - var isMouseEvent = event instanceof MouseEvent; - var isPrimaryPointer = !isMouseEvent || isMouseEvent && event.button === 0; - if (isPrimaryPointer) { - eventHandler(event); + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), + vis = visualLine(line); + if (line == vis) { + return lineN; } - }; -} -var defaultPagePoint = { - pageX: 0, - pageY: 0 -}; -function pointFromTouch(e, pointType) { - if (pointType === void 0) { - pointType = "page"; + return lineNo(vis); } - var primaryTouch = e.touches[0] || e.changedTouches[0]; - var point = primaryTouch || defaultPagePoint; - return { - x: point[pointType + "X"], - y: point[pointType + "Y"] - }; -} -function pointFromMouse(point, pointType) { - if (pointType === void 0) { - pointType = "page"; + + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) { + return lineN; + } + var line = getLine(doc, lineN), + merged; + if (!lineIsHidden(doc, line)) { + return lineN; + } + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + } + return lineNo(line) + 1; } - return { - x: point[pointType + "X"], - y: point[pointType + "Y"] - }; -} -function extractEventInfo(event, pointType) { - if (pointType === void 0) { - pointType = "page"; + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { + for (var sp = void 0, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) { + continue; + } + if (sp.from == null) { + return true; + } + if (sp.marker.widgetNode) { + continue; + } + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) { + return true; + } + } + } } - return { - point: isTouchEvent(event) ? pointFromTouch(event, pointType) : pointFromMouse(event, pointType) - }; -} -var wrapHandler = function (handler, shouldFilterPrimaryPointer) { - if (shouldFilterPrimaryPointer === void 0) { - shouldFilterPrimaryPointer = false; + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); + } + if (span.marker.inclusiveRight && span.to == line.text.length) { + return true; + } + for (var sp = void 0, i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && (sp.to == null || sp.to != span.from) && (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && lineIsHiddenInner(doc, line, sp)) { + return true; + } + } } - var listener = function (event) { - return handler(event, extractEventInfo(event)); - }; - return shouldFilterPrimaryPointer ? filterPrimaryPointer(listener) : listener; -}; -// We check for event support via functions in case they've been mocked by a testing suite. -var supportsPointerEvents = function () { - return isBrowser && window.onpointerdown === null; -}; -var supportsTouchEvents = function () { - return isBrowser && window.ontouchstart === null; -}; -var supportsMouseEvents = function () { - return isBrowser && window.onmousedown === null; -}; -var mouseEventNames = { - pointerdown: "mousedown", - pointermove: "mousemove", - pointerup: "mouseup", - pointercancel: "mousecancel", - pointerover: "mouseover", - pointerout: "mouseout", - pointerenter: "mouseenter", - pointerleave: "mouseleave" -}; -var touchEventNames = { - pointerdown: "touchstart", - pointermove: "touchmove", - pointerup: "touchend", - pointercancel: "touchcancel" -}; -function getPointerEventName(name) { - if (supportsPointerEvents()) { - return name; - } else if (supportsTouchEvents()) { - return touchEventNames[name]; - } else if (supportsMouseEvents()) { - return mouseEventNames[name]; - } - return name; -} -function addPointerEvent(target, eventName, handler, options) { - return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === "pointerdown"), options); -} -function usePointerEvent(ref, eventName, handler, options) { - return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === "pointerdown"), options); -} -function createLock(name) { - var lock = null; - return function () { - var openLock = function () { - lock = null; - }; - if (lock === null) { - lock = name; - return openLock; + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + var h = 0, + chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) { + break; + } else { + h += line.height; + } } - return false; - }; -} -var globalHorizontalLock = createLock("dragHorizontal"); -var globalVerticalLock = createLock("dragVertical"); -function getGlobalLock(drag) { - var lock = false; - if (drag === "y") { - lock = globalVerticalLock(); - } else if (drag === "x") { - lock = globalHorizontalLock(); - } else { - var openHorizontal_1 = globalHorizontalLock(); - var openVertical_1 = globalVerticalLock(); - if (openHorizontal_1 && openVertical_1) { - lock = function () { - openHorizontal_1(); - openVertical_1(); - }; - } else { - // Release the locks because we don't use them - if (openHorizontal_1) openHorizontal_1(); - if (openVertical_1) openVertical_1(); + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i$1 = 0; i$1 < p.children.length; ++i$1) { + var cur = p.children[i$1]; + if (cur == chunk) { + break; + } else { + h += cur.height; + } + } } + return h; } - return lock; -} -function isDragActive() { - // Check the gesture lock - if we get it, it means no drag gesture is active - // and we can safely fire the tap gesture. - var openGestureLock = getGlobalLock(true); - if (!openGestureLock) return true; - openGestureLock(); - return false; -} -function createHoverEvent(visualElement, isActive, callback) { - return function (event, info) { - var _a; - if (!isMouseEvent(event) || isDragActive()) return; - /** - * Ensure we trigger animations before firing event callback - */ - (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Hover, isActive); - callback === null || callback === void 0 ? void 0 : callback(event, info); - }; -} -function useHoverGesture(_a) { - var onHoverStart = _a.onHoverStart, - onHoverEnd = _a.onHoverEnd, - whileHover = _a.whileHover, - visualElement = _a.visualElement; - usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover ? createHoverEvent(visualElement, true, onHoverStart) : undefined, { - passive: !onHoverStart - }); - usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover ? createHoverEvent(visualElement, false, onHoverEnd) : undefined, { - passive: !onHoverEnd - }); -} -/** - * Recursively traverse up the tree to check whether the provided child node - * is the parent or a descendant of it. - * - * @param parent - Element to find - * @param child - Element to test against parent - */ -var isNodeOrChild = function (parent, child) { - if (!child) { - return false; - } else if (parent === child) { - return true; - } else { - return isNodeOrChild(parent, child.parentElement); + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) { + return 0; + } + var len = line.text.length, + merged, + cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found$1 = merged.find(0, true); + len -= cur.text.length - found$1.from.ch; + cur = found$1.to.line; + len += cur.text.length - found$1.to.ch; + } + return len; + } + + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, + doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function (line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); } -}; -function useUnmountEffect(callback) { - return React.useEffect(function () { - return function () { - return callback(); - }; - }, []); -} -/** - * @param handlers - - * @internal - */ -function useTapGesture(_a) { - var onTap = _a.onTap, - onTapStart = _a.onTapStart, - onTapCancel = _a.onTapCancel, - whileTap = _a.whileTap, - visualElement = _a.visualElement; - var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap; - var isPressing = React.useRef(false); - var cancelPointerEndListeners = React.useRef(null); - /** - * Only set listener to passive if there are no external listeners. - */ - var eventOptions = { - passive: !(onTapStart || onTap || onTapCancel || onPointerDown) + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = function (text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; }; - function removePointerEndListener() { - var _a; - (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners); - cancelPointerEndListeners.current = null; + Line.prototype.lineNo = function () { + return lineNo(this); + }; + eventMixin(Line); + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) { + line.stateAfter = null; + } + if (line.styles) { + line.styles = null; + } + if (line.order != null) { + line.order = null; + } + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) { + updateLineHeight(line, estHeight); + } } - function checkPointerEnd() { - var _a; - removePointerEndListener(); - isPressing.current = false; - (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Tap, false); - return !isDragActive(); + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); } - function onPointerUp(event, info) { - if (!checkPointerEnd()) return; - /** - * We only count this as a tap gesture if the event.target is the same - * as, or a child of, this component's element - */ - !isNodeOrChild(visualElement.getInstance(), event.target) ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info) : onTap === null || onTap === void 0 ? void 0 : onTap(event, info); + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}, + styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) { + return null; + } + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&")); + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = { + pre: eltP("pre", [content], "CodeMirror-line"), + content: content, + col: 0, + pos: 0, + cm: cm, + trailingSpace: false, + splitSpaces: cm.getOption("lineWrapping") + }; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, + order = void 0; + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) { + builder.addToken = buildTokenBadBidi(builder.addToken, order); + } + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) { + builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); + } + if (line.styleClasses.textClass) { + builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); + } + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) { + builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); + } + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); + (lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit) { + var last = builder.content.lastChild; + if (/\bcm-tab\b/.test(last.className) || last.querySelector && last.querySelector(".cm-tab")) { + builder.content.className = "cm-tab-wrap-hack"; + } + } + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) { + builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); + } + return builder; } - function onPointerCancel(event, info) { - if (!checkPointerEnd()) return; - onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info); + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token; } - function onPointerDown(event, info) { - var _a; - removePointerEndListener(); - if (isPressing.current) return; - isPressing.current = true; - cancelPointerEndListeners.current = popmotion.pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions)); - /** - * Ensure we trigger animations before firing event callback - */ - (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Tap, true); - onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info); - } - usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined, eventOptions); - useUnmountEffect(removePointerEndListener); -} -var warned = new Set(); -function warnOnce(condition, message, element) { - if (condition || warned.has(message)) return; - console.warn(message); - if (element) console.warn(element); - warned.add(message); -} -/** - * Map an IntersectionHandler callback to an element. We only ever make one handler for one - * element, so even though these handlers might all be triggered by different - * observers, we can keep them in the same map. - */ -var observerCallbacks = new WeakMap(); -/** - * Multiple observers can be created for multiple element/document roots. Each with - * different settings. So here we store dictionaries of observers to each root, - * using serialised settings (threshold/margin) as lookup keys. - */ -var observers = new WeakMap(); -var fireObserverCallback = function (entry) { - var _a; - (_a = observerCallbacks.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry); -}; -var fireAllObserverCallbacks = function (entries) { - entries.forEach(fireObserverCallback); -}; -function initIntersectionObserver(_a) { - var root = _a.root, - options = tslib.__rest(_a, ["root"]); - var lookupRoot = root || document; - /** - * If we don't have an observer lookup map for this root, create one. - */ - if (!observers.has(lookupRoot)) { - observers.set(lookupRoot, {}); + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, css, attributes) { + if (!text) { + return; + } + var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; + var special = builder.cm.state.specialChars, + mustWrap = false; + var content; + if (!special.test(text)) { + builder.col += text.length; + content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) { + mustWrap = true; + } + builder.pos += text.length; + } else { + content = document.createDocumentFragment(); + var pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) { + content.appendChild(elt("span", [txt])); + } else { + content.appendChild(txt); + } + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) { + break; + } + pos += skipped + 1; + var txt$1 = void 0; + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, + tabWidth = tabSize - builder.col % tabSize; + txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt$1.setAttribute("role", "presentation"); + txt$1.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else if (m[0] == "\r" || m[0] == "\n") { + txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); + txt$1.setAttribute("cm-text", m[0]); + builder.col += 1; + } else { + txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); + txt$1.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) { + content.appendChild(elt("span", [txt$1])); + } else { + content.appendChild(txt$1); + } + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt$1); + builder.pos++; + } + } + builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; + if (style || startStyle || endStyle || mustWrap || css || attributes) { + var fullStyle = style || ""; + if (startStyle) { + fullStyle += startStyle; + } + if (endStyle) { + fullStyle += endStyle; + } + var token = elt("span", [content], fullStyle, css); + if (attributes) { + for (var attr in attributes) { + if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class") { + token.setAttribute(attr, attributes[attr]); + } + } + } + return builder.content.appendChild(token); + } + builder.content.appendChild(content); } - var rootObservers = observers.get(lookupRoot); - var key = JSON.stringify(options); - /** - * If we don't have an observer for this combination of root and settings, - * create one. - */ - if (!rootObservers[key]) { - rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, tslib.__assign({ - root: root - }, options)); + + // Change some spaces to NBSP to prevent the browser from collapsing + // trailing spaces at the end of a line when rendering text (issue #1362). + function splitSpaces(text, trailingBefore) { + if (text.length > 1 && !/ /.test(text)) { + return text; + } + var spaceBefore = trailingBefore, + result = ""; + for (var i = 0; i < text.length; i++) { + var ch = text.charAt(i); + if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) { + ch = "\u00a0"; + } + result += ch; + spaceBefore = ch == " "; + } + return result; } - return rootObservers[key]; -} -function observeIntersection(element, options, callback) { - var rootInteresectionObserver = initIntersectionObserver(options); - observerCallbacks.set(element, callback); - rootInteresectionObserver.observe(element); - return function () { - observerCallbacks.delete(element); - rootInteresectionObserver.unobserve(element); - }; -} -function useViewport(_a) { - var visualElement = _a.visualElement, - whileInView = _a.whileInView, - onViewportEnter = _a.onViewportEnter, - onViewportLeave = _a.onViewportLeave, - _b = _a.viewport, - viewport = _b === void 0 ? {} : _b; - var state = React.useRef({ - hasEnteredView: false, - isInView: false - }); - var shouldObserve = Boolean(whileInView || onViewportEnter || onViewportLeave); - if (viewport.once && state.current.hasEnteredView) shouldObserve = false; - var useObserver = typeof IntersectionObserver === "undefined" ? useMissingIntersectionObserver : useIntersectionObserver; - useObserver(shouldObserve, state.current, visualElement, viewport); -} -var thresholdNames = { - some: 0, - all: 1 -}; -function useIntersectionObserver(shouldObserve, state, visualElement, _a) { - var root = _a.root, - rootMargin = _a.margin, - _b = _a.amount, - amount = _b === void 0 ? "some" : _b, - once = _a.once; - React.useEffect(function () { - if (!shouldObserve) return; - var options = { - root: root === null || root === void 0 ? void 0 : root.current, - rootMargin: rootMargin, - threshold: typeof amount === "number" ? amount : thresholdNames[amount] - }; - var intersectionCallback = function (entry) { - var _a; - var isIntersecting = entry.isIntersecting; - /** - * If there's been no change in the viewport state, early return. - */ - if (state.isInView === isIntersecting) return; - state.isInView = isIntersecting; - /** - * Handle hasEnteredView. If this is only meant to run once, and - * element isn't visible, early return. Otherwise set hasEnteredView to true. - */ - if (once && !isIntersecting && state.hasEnteredView) { - return; - } else if (isIntersecting) { - state.hasEnteredView = true; + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function (builder, text, style, startStyle, endStyle, css, attributes) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, + end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + var part = void 0; + for (var i = 0; i < order.length; i++) { + part = order[i]; + if (part.to > start && part.from <= start) { + break; + } + } + if (part.to >= end) { + return inner(builder, text, style, startStyle, endStyle, css, attributes); + } + inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; } - (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.InView, isIntersecting); - /** - * Use the latest committed props rather than the ones in scope - * when this observer is created - */ - var props = visualElement.getProps(); - var callback = isIntersecting ? props.onViewportEnter : props.onViewportLeave; - callback === null || callback === void 0 ? void 0 : callback(entry); }; - return observeIntersection(visualElement.getInstance(), options, intersectionCallback); - }, [shouldObserve, root, rootMargin, amount]); -} -/** - * If IntersectionObserver is missing, we activate inView and fire onViewportEnter - * on mount. This way, the page will be in the state the author expects users - * to see it in for everyone. - */ -function useMissingIntersectionObserver(shouldObserve, state, visualElement, _a) { - var _b = _a.fallback, - fallback = _b === void 0 ? true : _b; - React.useEffect(function () { - if (!shouldObserve || !fallback) return; - if (env !== "production") { - warnOnce(false, "IntersectionObserver not available on this device. whileInView animations will trigger on mount."); + } + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) { + builder.map.push(builder.pos, builder.pos + size, widget); } - /** - * Fire this in an rAF because, at this point, the animation state - * won't have flushed for the first time and there's certain logic in - * there that behaves differently on the initial animation. - * - * This hook should be quite rarely called so setting this in an rAF - * is preferred to changing the behaviour of the animation state. - */ - requestAnimationFrame(function () { - var _a; - state.hasEnteredView = true; - var onViewportEnter = visualElement.getProps().onViewportEnter; - onViewportEnter === null || onViewportEnter === void 0 ? void 0 : onViewportEnter(null); - (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.InView, true); - }); - }, [shouldObserve]); -} -var makeRenderlessComponent = function (hook) { - return function (props) { - hook(props); - return null; - }; -}; -var gestureAnimations = { - inView: makeRenderlessComponent(useViewport), - tap: makeRenderlessComponent(useTapGesture), - focus: makeRenderlessComponent(useFocusGesture), - hover: makeRenderlessComponent(useHoverGesture) -}; -var counter = 0; -var incrementId = function () { - return counter++; -}; -var useId = function () { - return useConstant(incrementId); -}; -/** - * Ideally we'd use the following code to support React 18 optionally. - * But this fairly fails in Webpack (otherwise treeshaking wouldn't work at all). - * Need to come up with a different way of figuring this out. - */ -// export const useId = (React as any).useId -// ? (React as any).useId -// : () => useConstant(incrementId) + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) { + widget = builder.content.appendChild(document.createElement("span")); + } + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + builder.trailingSpace = false; + } -/** - * When a component is the child of `AnimatePresence`, it can use `usePresence` - * to access information about whether it's still present in the React tree. - * - * ```jsx - * import { usePresence } from "framer-motion" - * - * export const Component = () => { - * const [isPresent, safeToRemove] = usePresence() - * - * useEffect(() => { - * !isPresent && setTimeout(safeToRemove, 1000) - * }, [isPresent]) - * - * return
- * } - * ``` - * - * If `isPresent` is `false`, it means that a component has been removed the tree, but - * `AnimatePresence` won't really remove it until `safeToRemove` has been called. - * - * @public - */ -function usePresence() { - var context = React.useContext(PresenceContext); - if (context === null) return [true, null]; - var isPresent = context.isPresent, - onExitComplete = context.onExitComplete, - register = context.register; - // It's safe to call the following hooks conditionally (after an early return) because the context will always - // either be null or non-null for the lifespan of the component. - // Replace with useId when released in React - var id = useId(); - React.useEffect(function () { - return register(id); - }, []); - var safeToRemove = function () { - return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); - }; - return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; -} -/** - * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. - * There is no `safeToRemove` function. - * - * ```jsx - * import { useIsPresent } from "framer-motion" - * - * export const Component = () => { - * const isPresent = useIsPresent() - * - * useEffect(() => { - * !isPresent && console.log("I've been removed!") - * }, [isPresent]) - * - * return
- * } - * ``` - * - * @public - */ -function useIsPresent() { - return isPresent(React.useContext(PresenceContext)); -} -function isPresent(context) { - return context === null ? true : context.isPresent; -} -function shallowCompare(next, prev) { - if (!Array.isArray(prev)) return false; - var prevLength = prev.length; - if (prevLength !== next.length) return false; - for (var i = 0; i < prevLength; i++) { - if (prev[i] !== next[i]) return false; + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, + allText = line.text, + at = 0; + if (!spans) { + for (var i$1 = 1; i$1 < styles.length; i$1 += 2) { + builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1 + 1], builder.cm.options)); + } + return; + } + var len = allText.length, + pos = 0, + i = 1, + text = "", + style, + css; + var nextChange = 0, + spanStyle, + spanEndStyle, + spanStartStyle, + collapsed, + attributes; + for (;;) { + if (nextChange == pos) { + // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = css = ""; + attributes = null; + collapsed = null; + nextChange = Infinity; + var foundBookmarks = [], + endStyles = void 0; + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], + m = sp.marker; + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m); + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to; + spanEndStyle = ""; + } + if (m.className) { + spanStyle += " " + m.className; + } + if (m.css) { + css = (css ? css + ";" : "") + m.css; + } + if (m.startStyle && sp.from == pos) { + spanStartStyle += " " + m.startStyle; + } + if (m.endStyle && sp.to == nextChange) { + (endStyles || (endStyles = [])).push(m.endStyle, sp.to); + } + // support for the old title property + // https://github.com/codemirror/CodeMirror/pull/5673 + if (m.title) { + (attributes || (attributes = {})).title = m.title; + } + if (m.attributes) { + for (var attr in m.attributes) { + (attributes || (attributes = {}))[attr] = m.attributes[attr]; + } + } + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) { + collapsed = sp; + } + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + } + if (endStyles) { + for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) { + if (endStyles[j$1 + 1] == nextChange) { + spanEndStyle += " " + endStyles[j$1]; + } + } + } + if (!collapsed || collapsed.from == pos) { + for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) { + buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); + } + } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null); + if (collapsed.to == null) { + return; + } + if (collapsed.to == pos) { + collapsed = false; + } + } + } + if (pos >= len) { + break; + } + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes); + } + if (end >= upto) { + text = text.slice(upto - pos); + pos = upto; + break; + } + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } } - return true; -} -/** - * Converts seconds to milliseconds - * - * @param seconds - Time in seconds. - * @return milliseconds - Converted time in milliseconds. - */ -var secondsToMilliseconds = function (seconds) { - return seconds * 1000; -}; -var easingLookup = { - linear: popmotion.linear, - easeIn: popmotion.easeIn, - easeInOut: popmotion.easeInOut, - easeOut: popmotion.easeOut, - circIn: popmotion.circIn, - circInOut: popmotion.circInOut, - circOut: popmotion.circOut, - backIn: popmotion.backIn, - backInOut: popmotion.backInOut, - backOut: popmotion.backOut, - anticipate: popmotion.anticipate, - bounceIn: popmotion.bounceIn, - bounceInOut: popmotion.bounceInOut, - bounceOut: popmotion.bounceOut -}; -var easingDefinitionToFunction = function (definition) { - if (Array.isArray(definition)) { - // If cubic bezier definition, create bezier curve - heyListen.invariant(definition.length === 4, "Cubic bezier arrays must contain four numerical values."); - var _a = tslib.__read(definition, 4), - x1 = _a[0], - y1 = _a[1], - x2 = _a[2], - y2 = _a[3]; - return popmotion.cubicBezier(x1, y1, x2, y2); - } else if (typeof definition === "string") { - // Else lookup from table - heyListen.invariant(easingLookup[definition] !== undefined, "Invalid easing type '".concat(definition, "'")); - return easingLookup[definition]; + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], + nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array; + } + var operationGroup = null; + function pushOperation(op) { + if (operationGroup) { + operationGroup.ops.push(op); + } else { + op.ownsGroup = operationGroup = { + ops: [op], + delayedCallbacks: [] + }; + } + } + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, + i = 0; + do { + for (; i < callbacks.length; i++) { + callbacks[i].call(null); + } + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) { + while (op.cursorActivityCalled < op.cursorActivityHandlers.length) { + op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); + } + } + } + } while (i < callbacks.length); + } + function finishOperation(op, endCb) { + var group = op.ownsGroup; + if (!group) { + return; + } + try { + fireCallbacksForOps(group); + } finally { + operationGroup = null; + endCb(group); + } + } + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = getHandlers(emitter, type); + if (!arr.length) { + return; + } + var args = Array.prototype.slice.call(arguments, 2), + list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + var loop = function (i) { + list.push(function () { + return arr[i].apply(null, args); + }); + }; + for (var i = 0; i < arr.length; ++i) loop(i); + } + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) { + delayed[i](); + } } - return definition; -}; -var isEasingArray = function (ease) { - return Array.isArray(ease) && typeof ease[0] !== "number"; -}; -/** - * Check if a value is animatable. Examples: - * - * ✅: 100, "100px", "#fff" - * ❌: "block", "url(2.jpg)" - * @param value - * - * @internal - */ -var isAnimatable = function (key, value) { - // If the list of keys tat might be non-animatable grows, replace with Set - if (key === "zIndex") return false; - // If it's a number or a keyframes array, we can animate it. We might at some point - // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, - // but for now lets leave it like this for performance reasons - if (typeof value === "number" || Array.isArray(value)) return true; - if (typeof value === "string" && - // It's animatable if we have a string - styleValueTypes.complex.test(value) && - // And it contains numbers and/or colors - !value.startsWith("url(") // Unless it starts with "url(" - ) { - return true; + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") { + updateLineText(cm, lineView); + } else if (type == "gutter") { + updateLineGutter(cm, lineView, lineN, dims); + } else if (type == "class") { + updateLineClasses(cm, lineView); + } else if (type == "widget") { + updateLineWidgets(cm, lineView, dims); + } + } + lineView.changes = null; } - return false; -}; -var underDampedSpring = function () { - return { - type: "spring", - stiffness: 500, - damping: 25, - restSpeed: 10 - }; -}; -var criticallyDampedSpring = function (to) { - return { - type: "spring", - stiffness: 550, - damping: to === 0 ? 2 * Math.sqrt(550) : 30, - restSpeed: 10 - }; -}; -var linearTween = function () { - return { - type: "keyframes", - ease: "linear", - duration: 0.3 - }; -}; -var keyframes = function (values) { - return { - type: "keyframes", - duration: 0.8, - values: values - }; -}; -var defaultTransitions = { - x: underDampedSpring, - y: underDampedSpring, - z: underDampedSpring, - rotate: underDampedSpring, - rotateX: underDampedSpring, - rotateY: underDampedSpring, - rotateZ: underDampedSpring, - scaleX: criticallyDampedSpring, - scaleY: criticallyDampedSpring, - scale: criticallyDampedSpring, - opacity: linearTween, - backgroundColor: linearTween, - color: linearTween, - default: criticallyDampedSpring -}; -var getDefaultTransition = function (valueKey, to) { - var transitionFactory; - if (isKeyframesTarget(to)) { - transitionFactory = keyframes; - } else { - transitionFactory = defaultTransitions[valueKey] || defaultTransitions.default; + + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) { + lineView.text.parentNode.replaceChild(lineView.node, lineView.text); + } + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) { + lineView.node.style.zIndex = 2; + } + } + return lineView.node; + } + function updateLineBackground(cm, lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) { + cls += " CodeMirror-linebackground"; + } + if (lineView.background) { + if (cls) { + lineView.background.className = cls; + } else { + lineView.background.parentNode.removeChild(lineView.background); + lineView.background = null; + } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + cm.display.input.setUneditable(lineView.background); + } + } + + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built; + } + return buildLineContent(cm, lineView); + } + + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) { + lineView.node = built.pre; + } + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(cm, lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + function updateLineClasses(cm, lineView) { + updateLineBackground(cm, lineView); + if (lineView.line.wrapClass) { + ensureLineWrapped(lineView).className = lineView.line.wrapClass; + } else if (lineView.node != lineView.text) { + lineView.node.className = ""; + } + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; + } + if (lineView.gutterBackground) { + lineView.node.removeChild(lineView.gutterBackground); + lineView.gutterBackground = null; + } + if (lineView.line.gutterClass) { + var wrap = ensureLineWrapped(lineView); + lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + dims.gutterTotalWidth + "px"); + cm.display.input.setUneditable(lineView.gutterBackground); + wrap.insertBefore(lineView.gutterBackground, lineView.text); + } + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap$1 = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"); + gutterWrap.setAttribute("aria-hidden", "true"); + cm.display.input.setUneditable(gutterWrap); + wrap$1.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) { + gutterWrap.className += " " + lineView.line.gutterClass; + } + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) { + lineView.lineNumber = gutterWrap.appendChild(elt("div", lineNumberFor(cm.options, lineN), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + cm.display.lineNumInnerWidth + "px")); + } + if (markers) { + for (var k = 0; k < cm.display.gutterSpecs.length; ++k) { + var id = cm.display.gutterSpecs[k].className, + found = markers.hasOwnProperty(id) && markers[id]; + if (found) { + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } + } + } + } + } + function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) { + lineView.alignable = null; + } + var isWidget = classTest("CodeMirror-linewidget"); + for (var node = lineView.node.firstChild, next = void 0; node; node = next) { + next = node.nextSibling; + if (isWidget.test(node.className)) { + lineView.node.removeChild(node); + } + } + insertLineWidgets(cm, lineView, dims); } - return tslib.__assign({ - to: to - }, transitionFactory(to)); -}; -/** - * A map of default value types for common values - */ -var defaultValueTypes = tslib.__assign(tslib.__assign({}, numberValueTypes), { - // Color props - color: styleValueTypes.color, - backgroundColor: styleValueTypes.color, - outlineColor: styleValueTypes.color, - fill: styleValueTypes.color, - stroke: styleValueTypes.color, - // Border props - borderColor: styleValueTypes.color, - borderTopColor: styleValueTypes.color, - borderRightColor: styleValueTypes.color, - borderBottomColor: styleValueTypes.color, - borderLeftColor: styleValueTypes.color, - filter: styleValueTypes.filter, - WebkitFilter: styleValueTypes.filter -}); -/** - * Gets the default ValueType for the provided value key - */ -var getDefaultValueType = function (key) { - return defaultValueTypes[key]; -}; -function getAnimatableNone(key, value) { - var _a; - var defaultValueType = getDefaultValueType(key); - if (defaultValueType !== styleValueTypes.filter) defaultValueType = styleValueTypes.complex; - // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target - return (_a = defaultValueType.getAnimatableNone) === null || _a === void 0 ? void 0 : _a.call(defaultValueType, value); -} -var instantAnimationState = { - current: false -}; + // Build a line's DOM representation from scratch + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) { + lineView.bgClass = built.bgClass; + } + if (built.textClass) { + lineView.textClass = built.textClass; + } + updateLineClasses(cm, lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); + return lineView.node; + } -/** - * Decide whether a transition is defined on a given Transition. - * This filters out orchestration options and returns true - * if any options are left. - */ -function isTransitionDefined(_a) { - _a.when; - _a.delay; - _a.delayChildren; - _a.staggerChildren; - _a.staggerDirection; - _a.repeat; - _a.repeatType; - _a.repeatDelay; - _a.from; - var transition = tslib.__rest(_a, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from"]); - return !!Object.keys(transition).length; -} -var legacyRepeatWarning = false; -/** - * Convert Framer Motion's Transition type into Popmotion-compatible options. - */ -function convertTransitionToAnimationOptions(_a) { - var ease = _a.ease, - times = _a.times, - yoyo = _a.yoyo, - flip = _a.flip, - loop = _a.loop, - transition = tslib.__rest(_a, ["ease", "times", "yoyo", "flip", "loop"]); - var options = tslib.__assign({}, transition); - if (times) options["offset"] = times; - /** - * Convert any existing durations from seconds to milliseconds - */ - if (transition.duration) options["duration"] = secondsToMilliseconds(transition.duration); - if (transition.repeatDelay) options.repeatDelay = secondsToMilliseconds(transition.repeatDelay); - /** - * Map easing names to Popmotion's easing functions - */ - if (ease) { - options["ease"] = isEasingArray(ease) ? ease.map(easingDefinitionToFunction) : easingDefinitionToFunction(ease); + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. + function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); + if (lineView.rest) { + for (var i = 0; i < lineView.rest.length; i++) { + insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); + } + } } - /** - * Support legacy transition API - */ - if (transition.type === "tween") options.type = "keyframes"; - /** - * TODO: These options are officially removed from the API. - */ - if (yoyo || loop || flip) { - heyListen.warning(!legacyRepeatWarning, "yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."); - legacyRepeatWarning = true; - if (yoyo) { - options.repeatType = "reverse"; - } else if (loop) { - options.repeatType = "loop"; - } else if (flip) { - options.repeatType = "mirror"; + function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) { + return; + } + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], + node = elt("div", [widget.node], "CodeMirror-linewidget" + (widget.className ? " " + widget.className : "")); + if (!widget.handleMouseEvents) { + node.setAttribute("cm-ignore-events", "true"); + } + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); + if (allowAbove && widget.above) { + wrap.insertBefore(node, lineView.gutter || lineView.text); + } else { + wrap.appendChild(node); + } + signalLater(widget, "redraw"); } - options.repeat = loop || yoyo || flip || transition.repeat; } - /** - * TODO: Popmotion 9 has the ability to automatically detect whether to use - * a keyframes or spring animation, but does so by detecting velocity and other spring options. - * It'd be good to introduce a similar thing here. - */ - if (transition.type !== "spring") options.type = "keyframes"; - return options; -} -/** - * Get the delay for a value by checking Transition with decreasing specificity. - */ -function getDelayFromTransition(transition, key) { - var _a, _b; - var valueTransition = getValueTransition(transition, key) || {}; - return (_b = (_a = valueTransition.delay) !== null && _a !== void 0 ? _a : transition.delay) !== null && _b !== void 0 ? _b : 0; -} -function hydrateKeyframes(options) { - if (Array.isArray(options.to) && options.to[0] === null) { - options.to = tslib.__spreadArray([], tslib.__read(options.to), false); - options.to[0] = options.from; + function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) { + node.style.marginLeft = -dims.gutterTotalWidth + "px"; + } + } } - return options; -} -function getPopmotionAnimationOptions(transition, options, key) { - var _a; - if (Array.isArray(options.to)) { - (_a = transition.duration) !== null && _a !== void 0 ? _a : transition.duration = 0.8; + function widgetHeight(widget) { + if (widget.height != null) { + return widget.height; + } + var cm = widget.doc.cm; + if (!cm) { + return 0; + } + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) { + parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; + } + if (widget.noHScroll) { + parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; + } + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.parentNode.offsetHeight; } - hydrateKeyframes(options); - /** - * Get a default transition if none is determined to be defined. - */ - if (!isTransitionDefined(transition)) { - transition = tslib.__assign(tslib.__assign({}, transition), getDefaultTransition(key, options.to)); + + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true" || n.parentNode == display.sizer && n != display.mover) { + return true; + } + } } - return tslib.__assign(tslib.__assign({}, options), convertTransitionToAnimationOptions(transition)); -} -/** - * - */ -function getAnimation(key, value, target, transition, onComplete) { - var _a; - var valueTransition = getValueTransition(transition, key); - var origin = (_a = valueTransition.from) !== null && _a !== void 0 ? _a : value.get(); - var isTargetAnimatable = isAnimatable(key, target); - if (origin === "none" && isTargetAnimatable && typeof target === "string") { - /** - * If we're trying to animate from "none", try and get an animatable version - * of the target. This could be improved to work both ways. - */ - origin = getAnimatableNone(key, target); - } else if (isZero(origin) && typeof target === "string") { - origin = getZeroUnit(target); - } else if (!Array.isArray(target) && isZero(target) && typeof origin === "string") { - target = getZeroUnit(origin); + + // POSITION MEASUREMENT + + function paddingTop(display) { + return display.lineSpace.offsetTop; } - var isOriginAnimatable = isAnimatable(key, origin); - heyListen.warning(isOriginAnimatable === isTargetAnimatable, "You are trying to animate ".concat(key, " from \"").concat(origin, "\" to \"").concat(target, "\". ").concat(origin, " is not an animatable value - to enable this animation set ").concat(origin, " to a value animatable to ").concat(target, " via the `style` property.")); - function start() { - var options = { - from: origin, - to: target, - velocity: value.getVelocity(), - onComplete: onComplete, - onUpdate: function (v) { - return value.set(v); - } - }; - return valueTransition.type === "inertia" || valueTransition.type === "decay" ? popmotion.inertia(tslib.__assign(tslib.__assign({}, options), valueTransition)) : popmotion.animate(tslib.__assign(tslib.__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { - onUpdate: function (v) { - var _a; - options.onUpdate(v); - (_a = valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, v); - }, - onComplete: function () { - var _a; - options.onComplete(); - (_a = valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition); - } - })); + function paddingVert(display) { + return display.mover.offsetHeight - display.lineSpace.offsetHeight; } - function set() { - var _a, _b; - var finalTarget = resolveFinalValueInKeyframes(target); - value.set(finalTarget); - onComplete(); - (_a = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, finalTarget); - (_b = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onComplete) === null || _b === void 0 ? void 0 : _b.call(valueTransition); - return { - stop: function () {} + function paddingH(display) { + if (display.cachedPaddingH) { + return display.cachedPaddingH; + } + var e = removeChildrenAndAdd(display.measure, elt("pre", "x", "CodeMirror-line-like")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = { + left: parseInt(style.paddingLeft), + right: parseInt(style.paddingRight) }; + if (!isNaN(data.left) && !isNaN(data.right)) { + display.cachedPaddingH = data; + } + return data; } - return !isOriginAnimatable || !isTargetAnimatable || valueTransition.type === false ? set : start; -} -function isZero(value) { - return value === 0 || typeof value === "string" && parseFloat(value) === 0 && value.indexOf(" ") === -1; -} -function getZeroUnit(potentialUnitType) { - return typeof potentialUnitType === "number" ? 0 : getAnimatableNone("", potentialUnitType); -} -function getValueTransition(transition, key) { - return transition[key] || transition["default"] || transition; -} -/** - * Start animation on a MotionValue. This function is an interface between - * Framer Motion and Popmotion - */ -function startAnimation(key, value, target, transition) { - if (transition === void 0) { - transition = {}; + function scrollGap(cm) { + return scrollerGap - cm.display.nativeBarWidth; } - if (instantAnimationState.current) { - transition = { - type: false - }; + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; } - return value.start(function (onComplete) { - var delayTimer; - var controls; - var animation = getAnimation(key, value, target, transition, onComplete); - var delay = getDelayFromTransition(transition, key); - var start = function () { - return controls = animation(); - }; - if (delay) { - delayTimer = window.setTimeout(start, secondsToMilliseconds(delay)); - } else { - start(); + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], + next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) { + heights.push((cur.bottom + next.top) / 2 - rect.top); + } + } + } + heights.push(rect.bottom - rect.top); } - return function () { - clearTimeout(delayTimer); - controls === null || controls === void 0 ? void 0 : controls.stop(); - }; - }); -} + } -/** - * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" - */ -var isNumericalString = function (v) { - return /^\-?\d*\.?\d+$/.test(v); -}; + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) { + return { + map: lineView.measure.map, + cache: lineView.measure.cache + }; + } + if (lineView.rest) { + for (var i = 0; i < lineView.rest.length; i++) { + if (lineView.rest[i] == line) { + return { + map: lineView.measure.maps[i], + cache: lineView.measure.caches[i] + }; + } + } + for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) { + if (lineNo(lineView.rest[i$1]) > lineN) { + return { + map: lineView.measure.maps[i$1], + cache: lineView.measure.caches[i$1], + before: true + }; + } + } + } + } -/** - * Check if the value is a zero value string like "0px" or "0%" - */ -var isZeroValueString = function (v) { - return /^0[^.\s]+$/.test(v); -}; -function addUniqueItem(arr, item) { - arr.indexOf(item) === -1 && arr.push(item); -} -function removeItem(arr, item) { - var index = arr.indexOf(item); - index > -1 && arr.splice(index, 1); -} -// Adapted from array-move -function moveItem(_a, fromIndex, toIndex) { - var _b = tslib.__read(_a), - arr = _b.slice(0); - var startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; - if (startIndex >= 0 && startIndex < arr.length) { - var endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; - var _c = tslib.__read(arr.splice(fromIndex, 1), 1), - item = _c[0]; - arr.splice(endIndex, 0, item); + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view; } - return arr; -} -var SubscriptionManager = /** @class */function () { - function SubscriptionManager() { - this.subscriptions = []; + + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); } - SubscriptionManager.prototype.add = function (handler) { - var _this = this; - addUniqueItem(this.subscriptions, handler); - return function () { - return removeItem(_this.subscriptions, handler); + + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) { + return cm.display.view[findViewIndex(cm, lineN)]; + } + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) { + return ext; + } + } + + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) { + view = null; + } else if (view && view.changes) { + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + cm.curOp.forceUpdate = true; + } + if (!view) { + view = updateExternalMeasurement(cm, line); + } + var info = mapFromLineView(view, line, lineN); + return { + line: line, + view: view, + rect: null, + map: info.map, + cache: info.cache, + before: info.before, + hasHeights: false }; - }; - SubscriptionManager.prototype.notify = function (a, b, c) { - var numSubscriptions = this.subscriptions.length; - if (!numSubscriptions) return; - if (numSubscriptions === 1) { - /** - * If there's only a single handler we can just call it without invoking a loop. - */ - this.subscriptions[0](a, b, c); + } + + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) { + ch = -1; + } + var key = ch + (bias || ""), + found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; } else { - for (var i = 0; i < numSubscriptions; i++) { - /** - * Check whether the handler exists before firing as it's possible - * the subscriptions were modified during this loop running. - */ - var handler = this.subscriptions[i]; - handler && handler(a, b, c); + if (!prepared.rect) { + prepared.rect = prepared.view.text.getBoundingClientRect(); + } + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) { + prepared.cache[key] = found; } } + return { + left: found.left, + right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom + }; + } + var nullRect = { + left: 0, + right: 0, + top: 0, + bottom: 0 }; - SubscriptionManager.prototype.getSize = function () { - return this.subscriptions.length; - }; - SubscriptionManager.prototype.clear = function () { - this.subscriptions.length = 0; - }; - return SubscriptionManager; -}(); -var isFloat = function (value) { - return !isNaN(parseFloat(value)); -}; -/** - * `MotionValue` is used to track the state and velocity of motion values. - * - * @public - */ -var MotionValue = /** @class */function () { - /** - * @param init - The initiating value - * @param config - Optional configuration options - * - * - `transformer`: A function to transform incoming values with. - * - * @internal - */ - function MotionValue(init) { - var _this = this; - /** - * This will be replaced by the build step with the latest version number. - * When MotionValues are provided to motion components, warn if versions are mixed. - */ - this.version = "6.5.1"; - /** - * Duration, in milliseconds, since last updating frame. - * - * @internal - */ - this.timeDelta = 0; - /** - * Timestamp of the last time this `MotionValue` was updated. - * - * @internal - */ - this.lastUpdated = 0; - /** - * Functions to notify when the `MotionValue` updates. - * - * @internal - */ - this.updateSubscribers = new SubscriptionManager(); - /** - * Functions to notify when the velocity updates. - * - * @internal - */ - this.velocityUpdateSubscribers = new SubscriptionManager(); - /** - * Functions to notify when the `MotionValue` updates and `render` is set to `true`. - * - * @internal - */ - this.renderSubscribers = new SubscriptionManager(); - /** - * Tracks whether this value can output a velocity. Currently this is only true - * if the value is numerical, but we might be able to widen the scope here and support - * other value types. - * - * @internal - */ - this.canTrackVelocity = false; - this.updateAndNotify = function (v, render) { - if (render === void 0) { - render = true; + function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse, mStart, mEnd; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + mStart = map[i]; + mEnd = map[i + 1]; + if (ch < mStart) { + start = 0; + end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) { + collapse = "right"; + } + } + if (start != null) { + node = map[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) { + collapse = bias; + } + if (bias == "left" && start == 0) { + while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2]; + collapse = "left"; + } + } + if (bias == "right" && start == mEnd - mStart) { + while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2]; + collapse = "right"; + } + } + break; } - _this.prev = _this.current; - _this.current = v; - // Update timestamp - var _a = sync.getFrameData(), - delta = _a.delta, - timestamp = _a.timestamp; - if (_this.lastUpdated !== timestamp) { - _this.timeDelta = delta; - _this.lastUpdated = timestamp; - sync__default["default"].postRender(_this.scheduleVelocityCheck); + } + return { + node: node, + start: start, + end: end, + collapse: collapse, + coverStart: mStart, + coverEnd: mEnd + }; + } + function getUsefulRect(rects, bias) { + var rect = nullRect; + if (bias == "left") { + for (var i = 0; i < rects.length; i++) { + if ((rect = rects[i]).left != rect.right) { + break; + } } - // Update update subscribers - if (_this.prev !== _this.current) { - _this.updateSubscribers.notify(_this.current); + } else { + for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { + if ((rect = rects[i$1]).left != rect.right) { + break; + } } - // Update velocity subscribers - if (_this.velocityUpdateSubscribers.getSize()) { - _this.velocityUpdateSubscribers.notify(_this.getVelocity()); + } + return rect; + } + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, + start = place.start, + end = place.end, + collapse = place.collapse; + var rect; + if (node.nodeType == 3) { + // If it is a text node, use a range to retrieve the coordinates. + for (var i$1 = 0; i$1 < 4; i$1++) { + // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { + --start; + } + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { + ++end; + } + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { + rect = node.parentNode.getBoundingClientRect(); + } else { + rect = getUsefulRect(range(node, start, end).getClientRects(), bias); + } + if (rect.left || rect.right || start == 0) { + break; + } + end = start; + start = start - 1; + collapse = "right"; } - // Update render subscribers - if (render) { - _this.renderSubscribers.notify(_this.current); + if (ie && ie_version < 11) { + rect = maybeUpdateRectForZooming(cm.display.measure, rect); + } + } else { + // If it is a widget, simply get the box for the whole widget. + if (start > 0) { + collapse = bias = "right"; + } + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) { + rect = rects[bias == "right" ? rects.length - 1 : 0]; + } else { + rect = node.getBoundingClientRect(); + } + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) { + rect = { + left: rSpan.left, + right: rSpan.left + charWidth(cm.display), + top: rSpan.top, + bottom: rSpan.bottom + }; + } else { + rect = nullRect; } + } + var rtop = rect.top - prepared.rect.top, + rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + var i = 0; + for (; i < heights.length - 1; i++) { + if (mid < heights[i]) { + break; + } + } + var top = i ? heights[i - 1] : 0, + bot = heights[i]; + var result = { + left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, + bottom: bot }; - /** - * Schedule a velocity check for the next frame. - * - * This is an instanced and bound function to prevent generating a new - * function once per frame. - * - * @internal - */ - this.scheduleVelocityCheck = function () { - return sync__default["default"].postRender(_this.velocityCheck); + if (!rect.left && !rect.right) { + result.bogus = true; + } + if (!cm.options.singleCursorHeightPerLine) { + result.rtop = rtop; + result.rbottom = rbot; + } + return result; + } + + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) { + return rect; + } + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return { + left: rect.left * scaleX, + right: rect.right * scaleX, + top: rect.top * scaleY, + bottom: rect.bottom * scaleY }; - /** - * Updates `prev` with `current` if the value hasn't been updated this frame. - * This ensures velocity calculations return `0`. - * - * This is an instanced and bound function to prevent generating a new - * function once per frame. - * - * @internal - */ - this.velocityCheck = function (_a) { - var timestamp = _a.timestamp; - if (timestamp !== _this.lastUpdated) { - _this.prev = _this.current; - _this.velocityUpdateSubscribers.notify(_this.getVelocity()); + } + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) { + for (var i = 0; i < lineView.rest.length; i++) { + lineView.measure.caches[i] = {}; + } } - }; - this.hasAnimated = false; - this.prev = this.current = init; - this.canTrackVelocity = isFloat(this.current); + } } - /** - * Adds a function that will be notified when the `MotionValue` is updated. - * - * It returns a function that, when called, will cancel the subscription. - * - * When calling `onChange` inside a React component, it should be wrapped with the - * `useEffect` hook. As it returns an unsubscribe function, this should be returned - * from the `useEffect` function to ensure you don't add duplicate subscribers.. - * - * ```jsx - * export const MyComponent = () => { - * const x = useMotionValue(0) - * const y = useMotionValue(0) - * const opacity = useMotionValue(1) - * - * useEffect(() => { - * function updateOpacity() { - * const maxXY = Math.max(x.get(), y.get()) - * const newOpacity = transform(maxXY, [0, 100], [1, 0]) - * opacity.set(newOpacity) - * } - * - * const unsubscribeX = x.onChange(updateOpacity) - * const unsubscribeY = y.onChange(updateOpacity) - * - * return () => { - * unsubscribeX() - * unsubscribeY() - * } - * }, []) - * - * return - * } - * ``` - * - * @privateRemarks - * - * We could look into a `useOnChange` hook if the above lifecycle management proves confusing. - * - * ```jsx - * useOnChange(x, () => {}) - * ``` - * - * @param subscriber - A function that receives the latest value. - * @returns A function that, when called, will cancel this subscription. - * - * @public - */ - MotionValue.prototype.onChange = function (subscription) { - return this.updateSubscribers.add(subscription); - }; - MotionValue.prototype.clearListeners = function () { - this.updateSubscribers.clear(); - }; - /** - * Adds a function that will be notified when the `MotionValue` requests a render. - * - * @param subscriber - A function that's provided the latest value. - * @returns A function that, when called, will cancel this subscription. - * - * @internal - */ - MotionValue.prototype.onRenderRequest = function (subscription) { - // Render immediately - subscription(this.get()); - return this.renderSubscribers.add(subscription); - }; - /** - * Attaches a passive effect to the `MotionValue`. - * - * @internal - */ - MotionValue.prototype.attach = function (passiveEffect) { - this.passiveEffect = passiveEffect; - }; - /** - * Sets the state of the `MotionValue`. - * - * @remarks - * - * ```jsx - * const x = useMotionValue(0) - * x.set(10) - * ``` - * - * @param latest - Latest value to set. - * @param render - Whether to notify render subscribers. Defaults to `true` - * - * @public - */ - MotionValue.prototype.set = function (v, render) { - if (render === void 0) { - render = true; + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) { + clearLineMeasurementCacheFor(cm.display.view[i]); } - if (!render || !this.passiveEffect) { - this.updateAndNotify(v, render); - } else { - this.passiveEffect(v, this.updateAndNotify); + } + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) { + cm.display.maxLineChanged = true; } - }; - /** - * Returns the latest state of `MotionValue` - * - * @returns - The latest state of `MotionValue` - * - * @public - */ - MotionValue.prototype.get = function () { - return this.current; - }; - /** - * @public - */ - MotionValue.prototype.getPrevious = function () { - return this.prev; - }; - /** - * Returns the latest velocity of `MotionValue` - * - * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. - * - * @public - */ - MotionValue.prototype.getVelocity = function () { - // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful - return this.canTrackVelocity ? - // These casts could be avoided if parseFloat would be typed better - popmotion.velocityPerSecond(parseFloat(this.current) - parseFloat(this.prev), this.timeDelta) : 0; - }; - /** - * Registers a new animation to control this `MotionValue`. Only one - * animation can drive a `MotionValue` at one time. - * - * ```jsx - * value.start() - * ``` - * - * @param animation - A function that starts the provided animation - * - * @internal - */ - MotionValue.prototype.start = function (animation) { - var _this = this; - this.stop(); - return new Promise(function (resolve) { - _this.hasAnimated = true; - _this.stopAnimation = animation(resolve); - }).then(function () { - return _this.clearAnimation(); - }); - }; - /** - * Stop the currently active animation. - * - * @public - */ - MotionValue.prototype.stop = function () { - if (this.stopAnimation) this.stopAnimation(); - this.clearAnimation(); - }; - /** - * Returns `true` if this value is currently animating. - * - * @public - */ - MotionValue.prototype.isAnimating = function () { - return !!this.stopAnimation; - }; - MotionValue.prototype.clearAnimation = function () { - this.stopAnimation = null; - }; - /** - * Destroy and clean up subscribers to this `MotionValue`. - * - * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically - * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually - * created a `MotionValue` via the `motionValue` function. - * - * @public - */ - MotionValue.prototype.destroy = function () { - this.updateSubscribers.clear(); - this.renderSubscribers.clear(); - this.stop(); - }; - return MotionValue; -}(); -function motionValue(init) { - return new MotionValue(init); -} - -/** - * Tests a provided value against a ValueType - */ -var testValueType = function (v) { - return function (type) { - return type.test(v); - }; -}; - -/** - * ValueType for "auto" - */ -var auto = { - test: function (v) { - return v === "auto"; - }, - parse: function (v) { - return v; + cm.display.lineNumChars = null; + } + function pageScrollX() { + // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 + // which causes page_Offset and bounding client rects to use + // different reference viewports and invalidate our calculations. + if (chrome && android) { + return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)); + } + return window.pageXOffset || (document.documentElement || document.body).scrollLeft; + } + function pageScrollY() { + if (chrome && android) { + return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)); + } + return window.pageYOffset || (document.documentElement || document.body).scrollTop; + } + function widgetTopHeight(lineObj) { + var ref = visualLine(lineObj); + var widgets = ref.widgets; + var height = 0; + if (widgets) { + for (var i = 0; i < widgets.length; ++i) { + if (widgets[i].above) { + height += widgetHeight(widgets[i]); + } + } + } + return height; } -}; - -/** - * A list of value types commonly used for dimensions - */ -var dimensionValueTypes = [styleValueTypes.number, styleValueTypes.px, styleValueTypes.percent, styleValueTypes.degrees, styleValueTypes.vw, styleValueTypes.vh, auto]; -/** - * Tests a dimensional value against the list of dimension ValueTypes - */ -var findDimensionValueType = function (v) { - return dimensionValueTypes.find(testValueType(v)); -}; -/** - * A list of all ValueTypes - */ -var valueTypes = tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(dimensionValueTypes), false), [styleValueTypes.color, styleValueTypes.complex], false); -/** - * Tests a value against the list of ValueTypes - */ -var findValueType = function (v) { - return valueTypes.find(testValueType(v)); -}; + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"./null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { + if (!includeWidgets) { + var height = widgetTopHeight(lineObj); + rect.top += height; + rect.bottom += height; + } + if (context == "line") { + return rect; + } + if (!context) { + context = "local"; + } + var yOff = heightAtLine(lineObj); + if (context == "local") { + yOff += paddingTop(cm.display); + } else { + yOff -= cm.display.viewOffset; + } + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; + rect.right += xOff; + } + rect.top += yOff; + rect.bottom += yOff; + return rect; + } -/** - * Set VisualElement's MotionValue, creating a new MotionValue for it if - * it doesn't exist. - */ -function setMotionValue(visualElement, key, value) { - if (visualElement.hasValue(key)) { - visualElement.getValue(key).set(value); - } else { - visualElement.addValue(key, motionValue(value)); + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"./null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") { + return coords; + } + var left = coords.left, + top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(); + top -= pageScrollY(); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return { + left: left - lineSpaceBox.left, + top: top - lineSpaceBox.top + }; } -} -function setTarget(visualElement, definition) { - var resolved = resolveVariant(visualElement, definition); - var _a = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {}, - _b = _a.transitionEnd, - transitionEnd = _b === void 0 ? {} : _b; - _a.transition; - var target = tslib.__rest(_a, ["transitionEnd", "transition"]); - target = tslib.__assign(tslib.__assign({}, target), transitionEnd); - for (var key in target) { - var value = resolveFinalValueInKeyframes(target[key]); - setMotionValue(visualElement, key, value); + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) { + lineObj = getLine(cm.doc, pos.line); + } + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); + } + + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + // A cursor Pos(line, char, "before") is on the same visual line as `char - 1` + // and after `char - 1` in writing order of `char - 1` + // A cursor Pos(line, char, "after") is on the same visual line as `char` + // and before `char` in writing order of `char` + // Examples (upper-case letters are RTL, lower-case are LTR): + // Pos(0, 1, ...) + // before after + // ab a|b a|b + // aB a|B aB| + // Ab |Ab A|b + // AB B|A B|A + // Every position after the last character on a line is considered to stick + // to the last character on the line. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) { + preparedMeasure = prepareMeasureForLine(cm, lineObj); + } + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) { + m.left = m.right; + } else { + m.right = m.left; + } + return intoCoordSystem(cm, lineObj, m, context); + } + var order = getOrder(lineObj, cm.doc.direction), + ch = pos.ch, + sticky = pos.sticky; + if (ch >= lineObj.text.length) { + ch = lineObj.text.length; + sticky = "before"; + } else if (ch <= 0) { + ch = 0; + sticky = "after"; + } + if (!order) { + return get(sticky == "before" ? ch - 1 : ch, sticky == "before"); + } + function getBidi(ch, partPos, invert) { + var part = order[partPos], + right = part.level == 1; + return get(invert ? ch - 1 : ch, right != invert); + } + var partPos = getBidiPartAt(order, ch, sticky); + var other = bidiOther; + var val = getBidi(ch, partPos, sticky == "before"); + if (other != null) { + val.other = getBidi(ch, other, sticky != "before"); + } + return val; + } + + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0; + pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) { + left = charWidth(cm.display) * pos.ch; + } + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return { + left: left, + right: left, + top: top, + bottom: top + lineObj.height + }; } -} -function setVariants(visualElement, variantLabels) { - var reversedLabels = tslib.__spreadArray([], tslib.__read(variantLabels), false).reverse(); - reversedLabels.forEach(function (key) { - var _a; - var variant = visualElement.getVariant(key); - variant && setTarget(visualElement, variant); - (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { - setVariants(child, variantLabels); - }); - }); -} -function setValues(visualElement, definition) { - if (Array.isArray(definition)) { - return setVariants(visualElement, definition); - } else if (typeof definition === "string") { - return setVariants(visualElement, [definition]); - } else { - setTarget(visualElement, definition); + + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, sticky, outside, xRel) { + var pos = Pos(line, ch, sticky); + pos.xRel = xRel; + if (outside) { + pos.outside = outside; + } + return pos; } -} -function checkTargetForNewValues(visualElement, target, origin) { - var _a, _b, _c; - var _d; - var newValueKeys = Object.keys(target).filter(function (key) { - return !visualElement.hasValue(key); - }); - var numNewValues = newValueKeys.length; - if (!numNewValues) return; - for (var i = 0; i < numNewValues; i++) { - var key = newValueKeys[i]; - var targetValue = target[key]; - var value = null; - /** - * If the target is a series of keyframes, we can use the first value - * in the array. If this first value is null, we'll still need to read from the DOM. - */ - if (Array.isArray(targetValue)) { - value = targetValue[0]; + + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) { + return PosWithInfo(doc.first, 0, null, -1, -1); } - /** - * If the target isn't keyframes, or the first keyframe was null, we need to - * first check if an origin value was explicitly defined in the transition as "from", - * if not read the value from the DOM. As an absolute fallback, take the defined target value. - */ - if (value === null) { - value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key]; + var lineN = lineAtHeight(doc, y), + last = doc.first + doc.size - 1; + if (lineN > last) { + return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1); } - /** - * If value is still undefined or null, ignore it. Preferably this would throw, - * but this was causing issues in Framer. - */ - if (value === undefined || value === null) continue; - if (typeof value === "string" && (isNumericalString(value) || isZeroValueString(value))) { - // If this is a number read as a string, ie "0" or "200", convert it to a number - value = parseFloat(value); - } else if (!findValueType(value) && styleValueTypes.complex.test(targetValue)) { - value = getAnimatableNone(key, targetValue); + if (x < 0) { + x = 0; + } + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0)); + if (!collapsed) { + return found; + } + var rangeEnd = collapsed.find(1); + if (rangeEnd.line == lineN) { + return rangeEnd; + } + lineObj = getLine(doc, lineN = rangeEnd.line); } - visualElement.addValue(key, motionValue(value)); - (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : _d[key] = value; - visualElement.setBaseTarget(key, value); } -} -function getOriginFromTransition(key, transition) { - if (!transition) return; - var valueTransition = transition[key] || transition["default"] || transition; - return valueTransition.from; -} -function getOrigin(target, transition, visualElement) { - var _a, _b; - var origin = {}; - for (var key in target) { - origin[key] = (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get(); + function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { + y -= widgetTopHeight(lineObj); + var end = lineObj.text.length; + var begin = findFirst(function (ch) { + return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; + }, end, 0); + end = findFirst(function (ch) { + return measureCharPrepared(cm, preparedMeasure, ch).top > y; + }, begin, end); + return { + begin: begin, + end: end + }; } - return origin; -} -function animateVisualElement(visualElement, definition, options) { - if (options === void 0) { - options = {}; + function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { + if (!preparedMeasure) { + preparedMeasure = prepareMeasureForLine(cm, lineObj); + } + var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; + return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop); + } + + // Returns true if the given side of a box is after the given + // coordinates, in top-to-bottom, left-to-right order. + function boxIsAfter(box, x, y, left) { + return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x; + } + function coordsCharInner(cm, lineObj, lineNo, x, y) { + // Move y into line-local coordinate space + y -= heightAtLine(lineObj); + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + // When directly calling `measureCharPrepared`, we have to adjust + // for the widgets at this line. + var widgetHeight = widgetTopHeight(lineObj); + var begin = 0, + end = lineObj.text.length, + ltr = true; + var order = getOrder(lineObj, cm.doc.direction); + // If the line isn't plain left-to-right text, first figure out + // which bidi section the coordinates fall into. + if (order) { + var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)(cm, lineObj, lineNo, preparedMeasure, order, x, y); + ltr = part.level != 1; + // The awkward -1 offsets are needed because findFirst (called + // on these below) will treat its first bound as inclusive, + // second as exclusive, but we want to actually address the + // characters in the part's range + begin = ltr ? part.from : part.to - 1; + end = ltr ? part.to : part.from - 1; + } + + // A binary search to find the first character whose bounding box + // starts after the coordinates. If we run across any whose box wrap + // the coordinates, store that. + var chAround = null, + boxAround = null; + var ch = findFirst(function (ch) { + var box = measureCharPrepared(cm, preparedMeasure, ch); + box.top += widgetHeight; + box.bottom += widgetHeight; + if (!boxIsAfter(box, x, y, false)) { + return false; + } + if (box.top <= y && box.left <= x) { + chAround = ch; + boxAround = box; + } + return true; + }, begin, end); + var baseX, + sticky, + outside = false; + // If a box around the coordinates was found, use that + if (boxAround) { + // Distinguish coordinates nearer to the left or right side of the box + var atLeft = x - boxAround.left < boxAround.right - x, + atStart = atLeft == ltr; + ch = chAround + (atStart ? 0 : 1); + sticky = atStart ? "after" : "before"; + baseX = atLeft ? boxAround.left : boxAround.right; + } else { + // (Adjust for extended bound, if necessary.) + if (!ltr && (ch == end || ch == begin)) { + ch++; + } + // To determine which side to associate with, get the box to the + // left of the character and compare it's vertical position to the + // coordinates + sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y == ltr ? "after" : "before"; + // Now get accurate coordinates for this place, in order to get a + // base X position + var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure); + baseX = coords.left; + outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0; + } + ch = skipExtendingChars(lineObj.text, ch, 1); + return PosWithInfo(lineNo, ch, sticky, outside, x - baseX); + } + function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) { + // Bidi parts are sorted left-to-right, and in a non-line-wrapping + // situation, we can take this ordering to correspond to the visual + // ordering. This finds the first part whose end is after the given + // coordinates. + var index = findFirst(function (i) { + var part = order[i], + ltr = part.level != 1; + return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"), "line", lineObj, preparedMeasure), x, y, true); + }, 0, order.length - 1); + var part = order[index]; + // If this isn't the first part, the part's start is also after + // the coordinates, and the coordinates aren't on the same line as + // that start, move one part back. + if (index > 0) { + var ltr = part.level != 1; + var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"), "line", lineObj, preparedMeasure); + if (boxIsAfter(start, x, y, true) && start.top > y) { + part = order[index - 1]; + } + } + return part; + } + function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { + // In a wrapped line, rtl text on wrapping boundaries can do things + // that don't correspond to the ordering in our `order` array at + // all, so a binary search doesn't work, and we want to return a + // part that only spans one line so that the binary search in + // coordsCharInner is safe. As such, we first find the extent of the + // wrapped line, and then do a flat search in which we discard any + // spans that aren't on the line. + var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); + var begin = ref.begin; + var end = ref.end; + if (/\s/.test(lineObj.text.charAt(end - 1))) { + end--; + } + var part = null, + closestDist = null; + for (var i = 0; i < order.length; i++) { + var p = order[i]; + if (p.from >= end || p.to <= begin) { + continue; + } + var ltr = p.level != 1; + var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right; + // Weigh against spans ending before this, so that they are only + // picked if nothing ends after + var dist = endX < x ? x - endX + 1e9 : endX - x; + if (!part || closestDist > dist) { + part = p; + closestDist = dist; + } + } + if (!part) { + part = order[order.length - 1]; + } + // Clip the part to the wrapped line. + if (part.from < begin) { + part = { + from: begin, + to: part.to, + level: part.level + }; + } + if (part.to > end) { + part = { + from: part.from, + to: end, + level: part.level + }; + } + return part; + } + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) { + return display.cachedTextHeight; + } + if (measureText == null) { + measureText = elt("pre", null, "CodeMirror-line-like"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) { + display.cachedTextHeight = height; + } + removeChildren(display.measure); + return height || 1; + } + + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) { + return display.cachedCharWidth; + } + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor], "CodeMirror-line-like"); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), + width = (rect.right - rect.left) / 10; + if (width > 2) { + display.cachedCharWidth = width; + } + return width || 10; + } + + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, + left = {}, + width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + var id = cm.display.gutterSpecs[i].className; + left[id] = n.offsetLeft + n.clientLeft + gutterLeft; + width[id] = n.clientWidth; + } + return { + fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth + }; } - visualElement.notifyAnimationStart(definition); - var animation; - if (Array.isArray(definition)) { - var animations = definition.map(function (variant) { - return animateVariant(visualElement, variant, options); - }); - animation = Promise.all(animations); - } else if (typeof definition === "string") { - animation = animateVariant(visualElement, definition, options); - } else { - var resolvedDefinition = typeof definition === "function" ? resolveVariant(visualElement, definition, options.custom) : definition; - animation = animateTarget(visualElement, resolvedDefinition, options); + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; } - return animation.then(function () { - return visualElement.notifyAnimationComplete(definition); - }); -} -function animateVariant(visualElement, variant, options) { - var _a; - if (options === void 0) { - options = {}; + + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), + wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function (line) { + if (lineIsHidden(cm.doc, line)) { + return 0; + } + var widgetsHeight = 0; + if (line.widgets) { + for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) { + widgetsHeight += line.widgets[i].height; + } + } + } + if (wrapping) { + return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; + } else { + return widgetsHeight + th; + } + }; } - var resolved = resolveVariant(visualElement, variant, options.custom); - var _b = (resolved || {}).transition, - transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b; - if (options.transitionOverride) { - transition = options.transitionOverride; + function estimateLineHeights(cm) { + var doc = cm.doc, + est = estimateHeight(cm); + doc.iter(function (line) { + var estHeight = est(line); + if (estHeight != line.height) { + updateLineHeight(line, estHeight); + } + }); } - /** - * If we have a variant, create a callback that runs it as an animation. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - var getAnimation = resolved ? function () { - return animateTarget(visualElement, resolved, options); - } : function () { - return Promise.resolve(); - }; - /** - * If we have children, create a callback that runs all their animations. - * Otherwise, we resolve a Promise immediately for a composable no-op. - */ - var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size) ? function (forwardDelay) { - if (forwardDelay === void 0) { - forwardDelay = 0; + + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { + return null; } - var _a = transition.delayChildren, - delayChildren = _a === void 0 ? 0 : _a, - staggerChildren = transition.staggerChildren, - staggerDirection = transition.staggerDirection; - return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options); - } : function () { - return Promise.resolve(); - }; - /** - * If the transition explicitly defines a "when" option, we need to resolve either - * this animation or all children animations before playing the other. - */ - var when = transition.when; - if (when) { - var _c = tslib.__read(when === "beforeChildren" ? [getAnimation, getChildAnimations] : [getChildAnimations, getAnimation], 2), - first = _c[0], - last = _c[1]; - return first().then(last); - } else { - return Promise.all([getAnimation(), getChildAnimations(options.delay)]); - } -} -/** - * @internal - */ -function animateTarget(visualElement, definition, _a) { - var _b; - var _c = _a === void 0 ? {} : _a, - _d = _c.delay, - delay = _d === void 0 ? 0 : _d, - transitionOverride = _c.transitionOverride, - type = _c.type; - var _e = visualElement.makeTargetAnimatable(definition), - _f = _e.transition, - transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, - transitionEnd = _e.transitionEnd, - target = tslib.__rest(_e, ["transition", "transitionEnd"]); - if (transitionOverride) transition = transitionOverride; - var animations = []; - var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]); - for (var key in target) { - var value = visualElement.getValue(key); - var valueTarget = target[key]; - if (!value || valueTarget === undefined || animationTypeState && shouldBlockAnimation(animationTypeState, key)) { - continue; + var x, + y, + space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { + x = e.clientX - space.left; + y = e.clientY - space.top; + } catch (e$1) { + return null; } - var valueTransition = tslib.__assign({ - delay: delay - }, transition); - /** - * Make animation instant if this is a transform prop and we should reduce motion. - */ - if (visualElement.shouldReduceMotion && isTransformProp(key)) { - valueTransition = tslib.__assign(tslib.__assign({}, valueTransition), { - type: false, - delay: 0 - }); + var coords = coordsChar(cm, x, y), + line; + if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); } - var animation = startAnimation(key, value, valueTarget, valueTransition); - animations.push(animation); - } - return Promise.all(animations).then(function () { - transitionEnd && setTarget(visualElement, transitionEnd); - }); -} -function animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) { - if (delayChildren === void 0) { - delayChildren = 0; + return coords; } - if (staggerChildren === void 0) { - staggerChildren = 0; + + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) { + return null; + } + n -= cm.display.viewFrom; + if (n < 0) { + return null; + } + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) { + return i; + } + } } - if (staggerDirection === void 0) { - staggerDirection = 1; + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) { + from = cm.doc.first; + } + if (to == null) { + to = cm.doc.first + cm.doc.size; + } + if (!lendiff) { + lendiff = 0; + } + var display = cm.display; + if (lendiff && to < display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers > from)) { + display.updateLineNumbers = from; + } + cm.curOp.viewChanged = true; + if (from >= display.viewTo) { + // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) { + resetView(cm); + } + } else if (to <= display.viewFrom) { + // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { + // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { + // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { + // Bottom overlap + var cut$1 = viewCuttingPoint(cm, from, from, -1); + if (cut$1) { + display.view = display.view.slice(0, cut$1.index); + display.viewTo = cut$1.lineN; + } else { + resetView(cm); + } + } else { + // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index).concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)).concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) { + ext.lineN += lendiff; + } else if (from < ext.lineN + ext.size) { + display.externalMeasured = null; + } + } } - var animations = []; - var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; - var generateStaggerDuration = staggerDirection === 1 ? function (i) { - if (i === void 0) { - i = 0; + + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, + ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) { + display.externalMeasured = null; } - return i * staggerChildren; - } : function (i) { - if (i === void 0) { - i = 0; + if (line < display.viewFrom || line >= display.viewTo) { + return; } - return maxStaggerDuration - i * staggerChildren; - }; - Array.from(visualElement.variantChildren).sort(sortByTreeOrder).forEach(function (child, i) { - animations.push(animateVariant(child, variant, tslib.__assign(tslib.__assign({}, options), { - delay: delayChildren + generateStaggerDuration(i) - })).then(function () { - return child.notifyAnimationComplete(variant); - })); - }); - return Promise.all(animations); -} -function stopAnimation(visualElement) { - visualElement.forEachValue(function (value) { - return value.stop(); - }); -} -function sortByTreeOrder(a, b) { - return a.sortNodePosition(b); -} -/** - * Decide whether we should block this animation. Previously, we achieved this - * just by checking whether the key was listed in protectedKeys, but this - * posed problems if an animation was triggered by afterChildren and protectedKeys - * had been set to true in the meantime. - */ -function shouldBlockAnimation(_a, key) { - var protectedKeys = _a.protectedKeys, - needsAnimating = _a.needsAnimating; - var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; - needsAnimating[key] = false; - return shouldBlock; -} -var variantPriorityOrder = [exports.AnimationType.Animate, exports.AnimationType.InView, exports.AnimationType.Focus, exports.AnimationType.Hover, exports.AnimationType.Tap, exports.AnimationType.Drag, exports.AnimationType.Exit]; -var reversePriorityOrder = tslib.__spreadArray([], tslib.__read(variantPriorityOrder), false).reverse(); -var numAnimationTypes = variantPriorityOrder.length; -function animateList(visualElement) { - return function (animations) { - return Promise.all(animations.map(function (_a) { - var animation = _a.animation, - options = _a.options; - return animateVisualElement(visualElement, animation, options); - })); - }; -} -function createAnimationState(visualElement) { - var animate = animateList(visualElement); - var state = createState(); - var allAnimatedKeys = {}; - var isInitialRender = true; - /** - * This function will be used to reduce the animation definitions for - * each active animation type into an object of resolved values for it. - */ - var buildResolvedTypeValues = function (acc, definition) { - var resolved = resolveVariant(visualElement, definition); - if (resolved) { - resolved.transition; - var transitionEnd = resolved.transitionEnd, - target = tslib.__rest(resolved, ["transition", "transitionEnd"]); - acc = tslib.__assign(tslib.__assign(tslib.__assign({}, acc), target), transitionEnd); + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) { + return; + } + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) { + arr.push(type); } - return acc; - }; - function isAnimated(key) { - return allAnimatedKeys[key] !== undefined; } - /** - * This just allows us to inject mocked animation functions - * @internal - */ - function setAnimateFunction(makeAnimator) { - animate = makeAnimator(visualElement); + + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; } - /** - * When we receive new props, we need to: - * 1. Create a list of protected keys for each type. This is a directory of - * value keys that are currently being "handled" by types of a higher priority - * so that whenever an animation is played of a given type, these values are - * protected from being animated. - * 2. Determine if an animation type needs animating. - * 3. Determine if any values have been removed from a type and figure out - * what to animate those to. - */ - function animateChanges(options, changedActiveType) { - var _a; - var props = visualElement.getProps(); - var context = visualElement.getVariantContext(true) || {}; - /** - * A list of animations that we'll build into as we iterate through the animation - * types. This will get executed at the end of the function. - */ - var animations = []; - /** - * Keep track of which values have been removed. Then, as we hit lower priority - * animation types, we can check if they contain removed values and animate to that. - */ - var removedKeys = new Set(); - /** - * A dictionary of all encountered keys. This is an object to let us build into and - * copy it without iteration. Each time we hit an animation type we set its protected - * keys - the keys its not allowed to animate - to the latest version of this object. - */ - var encounteredKeys = {}; - /** - * If a variant has been removed at a given index, and this component is controlling - * variant animations, we want to ensure lower-priority variants are forced to animate. - */ - var removedVariantIndex = Infinity; - var _loop_1 = function (i) { - var type = reversePriorityOrder[i]; - var typeState = state[type]; - var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type]; - var propIsVariant = isVariantLabel(prop); - /** - * If this type has *just* changed isActive status, set activeDelta - * to that status. Otherwise set to null. - */ - var activeDelta = type === changedActiveType ? typeState.isActive : null; - if (activeDelta === false) removedVariantIndex = i; - /** - * If this prop is an inherited variant, rather than been set directly on the - * component itself, we want to make sure we allow the parent to trigger animations. - * - * TODO: Can probably change this to a !isControllingVariants check - */ - var isInherited = prop === context[type] && prop !== props[type] && propIsVariant; - /** - * - */ - if (isInherited && isInitialRender && visualElement.manuallyAnimateOnMount) { - isInherited = false; + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), + diff, + view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) { + return { + index: index, + lineN: newN + }; + } + var n = cm.display.viewFrom; + for (var i = 0; i < index; i++) { + n += view[i].size; + } + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) { + return null; + } + diff = n + view[index].size - oldN; + index++; + } else { + diff = n - oldN; } - /** - * Set all encountered keys so far as the protected keys for this type. This will - * be any key that has been animated or otherwise handled by active, higher-priortiy types. - */ - typeState.protectedKeys = tslib.__assign({}, encounteredKeys); - // Check if we can skip analysing this prop early - if ( - // If it isn't active and hasn't *just* been set as inactive - !typeState.isActive && activeDelta === null || - // If we didn't and don't have any defined prop for this animation type - !prop && !typeState.prevProp || - // Or if the prop doesn't define an animation - isAnimationControls(prop) || typeof prop === "boolean") { - return "continue"; + oldN += diff; + newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) { + return null; } - /** - * As we go look through the values defined on this type, if we detect - * a changed value or a value that was removed in a higher priority, we set - * this to true and add this prop to the animation list. - */ - var variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); - var shouldAnimateType = variantDidChange || - // If we're making this variant active, we want to always make it active - type === changedActiveType && typeState.isActive && !isInherited && propIsVariant || - // If we removed a higher-priority variant (i is in reverse order) - i > removedVariantIndex && propIsVariant; - /** - * As animations can be set as variant lists, variants or target objects, we - * coerce everything to an array if it isn't one already - */ - var definitionList = Array.isArray(prop) ? prop : [prop]; - /** - * Build an object of all the resolved values. We'll use this in the subsequent - * animateChanges calls to determine whether a value has changed. - */ - var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {}); - if (activeDelta === false) resolvedValues = {}; - /** - * Now we need to loop through all the keys in the prev prop and this prop, - * and decide: - * 1. If the value has changed, and needs animating - * 2. If it has been removed, and needs adding to the removedKeys set - * 3. If it has been removed in a higher priority type and needs animating - * 4. If it hasn't been removed in a higher priority but hasn't changed, and - * needs adding to the type's protectedKeys list. - */ - var _b = typeState.prevResolvedValues, - prevResolvedValues = _b === void 0 ? {} : _b; - var allKeys = tslib.__assign(tslib.__assign({}, prevResolvedValues), resolvedValues); - var markToAnimate = function (key) { - shouldAnimateType = true; - removedKeys.delete(key); - typeState.needsAnimating[key] = true; - }; - for (var key in allKeys) { - var next = resolvedValues[key]; - var prev = prevResolvedValues[key]; - // If we've already handled this we can just skip ahead - if (encounteredKeys.hasOwnProperty(key)) continue; - /** - * If the value has changed, we probably want to animate it. - */ - if (next !== prev) { - /** - * If both values are keyframes, we need to shallow compare them to - * detect whether any value has changed. If it has, we animate it. - */ - if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { - if (!shallowCompare(next, prev) || variantDidChange) { - markToAnimate(key); - } else { - /** - * If it hasn't changed, we want to ensure it doesn't animate by - * adding it to the list of protected keys. - */ - typeState.protectedKeys[key] = true; - } - } else if (next !== undefined) { - // If next is defined and doesn't equal prev, it needs animating - markToAnimate(key); + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return { + index: index, + lineN: newN + }; + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, + view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) { + display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); + } else if (display.viewFrom < from) { + display.view = display.view.slice(findViewIndex(cm, from)); + } + display.viewFrom = from; + if (display.viewTo < to) { + display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); + } else if (display.viewTo > to) { + display.view = display.view.slice(0, findViewIndex(cm, to)); + } + } + display.viewTo = to; + } + + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, + dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) { + ++dirty; + } + } + return dirty; + } + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } + function prepareSelection(cm, primary) { + if (primary === void 0) primary = true; + var doc = cm.doc, + result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); + var customCursor = cm.options.$customCursor; + if (customCursor) { + primary = true; + } + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (!primary && i == doc.sel.primIndex) { + continue; + } + var range = doc.sel.ranges[i]; + if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { + continue; + } + var collapsed = range.empty(); + if (customCursor) { + var head = customCursor(cm, range); + if (head) { + drawSelectionCursor(cm, head, curFragment); + } + } else if (collapsed || cm.options.showCursorWhenSelecting) { + drawSelectionCursor(cm, range.head, curFragment); + } + if (!collapsed) { + drawSelectionRange(cm, range, selFragment); + } + } + return result; + } + + // Draws a cursor for the given range + function drawSelectionCursor(cm, head, output) { + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) { + var charPos = charCoords(cm, head, "div", null, null); + var width = charPos.right - charPos.left; + cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px"; + } + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } + function cmpCoords(a, b) { + return a.top - b.top || a.left - b.left; + } + + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range, output) { + var display = cm.display, + doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), + leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + var docLTR = doc.direction == "ltr"; + function add(left, top, width, bottom) { + if (top < 0) { + top = 0; + } + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")); + } + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias); + } + function wrapX(pos, dir, side) { + var extent = wrappedLineExtentChar(cm, lineObj, null, pos); + var prop = dir == "ltr" == (side == "after") ? "left" : "right"; + var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); + return coords(ch, prop)[prop]; + } + var order = getOrder(lineObj, doc.direction); + iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { + var ltr = dir == "ltr"; + var fromPos = coords(from, ltr ? "left" : "right"); + var toPos = coords(to - 1, ltr ? "right" : "left"); + var openStart = fromArg == null && from == 0, + openEnd = toArg == null && to == lineLen; + var first = i == 0, + last = !order || i == order.length - 1; + if (toPos.top - fromPos.top <= 3) { + // Single line + var openLeft = (docLTR ? openStart : openEnd) && first; + var openRight = (docLTR ? openEnd : openStart) && last; + var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; + var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; + add(left, fromPos.top, right - left, fromPos.bottom); + } else { + // Multiple lines + var topLeft, topRight, botLeft, botRight; + if (ltr) { + topLeft = docLTR && openStart && first ? leftSide : fromPos.left; + topRight = docLTR ? rightSide : wrapX(from, dir, "before"); + botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); + botRight = docLTR && openEnd && last ? rightSide : toPos.right; } else { - // If it's undefined, it's been removed. - removedKeys.add(key); + topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); + topRight = !docLTR && openStart && first ? rightSide : fromPos.right; + botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; + botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); } - } else if (next !== undefined && removedKeys.has(key)) { - /** - * If next hasn't changed and it isn't undefined, we want to check if it's - * been removed by a higher priority - */ - markToAnimate(key); + add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); + if (fromPos.bottom < toPos.top) { + add(leftSide, fromPos.bottom, null, toPos.top); + } + add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); + } + if (!start || cmpCoords(fromPos, start) < 0) { + start = fromPos; + } + if (cmpCoords(toPos, start) < 0) { + start = toPos; + } + if (!end || cmpCoords(fromPos, end) < 0) { + end = fromPos; + } + if (cmpCoords(toPos, end) < 0) { + end = toPos; + } + }); + return { + start: start, + end: end + }; + } + var sFrom = range.from(), + sTo = range.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), + toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); } else { - /** - * If it hasn't changed, we add it to the list of protected values - * to ensure it doesn't get animated. - */ - typeState.protectedKeys[key] = true; + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); } } - /** - * Update the typeState so next time animateChanges is called we can compare the - * latest prop and resolvedValues to these. - */ - typeState.prevProp = prop; - typeState.prevResolvedValues = resolvedValues; - /** - * - */ - if (typeState.isActive) { - encounteredKeys = tslib.__assign(tslib.__assign({}, encounteredKeys), resolvedValues); + if (leftEnd.bottom < rightStart.top) { + add(leftSide, leftEnd.bottom, null, rightStart.top); } - if (isInitialRender && visualElement.blockInitialAnimation) { - shouldAnimateType = false; + } + output.appendChild(fragment); + } + + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) { + return; + } + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) { + display.blinker = setInterval(function () { + if (!cm.hasFocus()) { + onBlur(cm); + } + display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); + } else if (cm.options.cursorBlinkRate < 0) { + display.cursorDiv.style.visibility = "hidden"; + } + } + function ensureFocus(cm) { + if (!cm.hasFocus()) { + cm.display.input.focus(); + if (!cm.state.focused) { + onFocus(cm); } - /** - * If this is an inherited prop we want to hard-block animations - * TODO: Test as this should probably still handle animations triggered - * by removed values? - */ - if (shouldAnimateType && !isInherited) { - animations.push.apply(animations, tslib.__spreadArray([], tslib.__read(definitionList.map(function (animation) { - return { - animation: animation, - options: tslib.__assign({ - type: type - }, options) - }; - })), false)); + } + } + function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true; + setTimeout(function () { + if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + if (cm.state.focused) { + onBlur(cm); + } + } + }, 100); + } + function onFocus(cm, e) { + if (cm.state.delayingBlurEvent && !cm.state.draggingText) { + cm.state.delayingBlurEvent = false; + } + if (cm.options.readOnly == "nocursor") { + return; + } + if (!cm.state.focused) { + signal(cm, "focus", cm, e); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) { + setTimeout(function () { + return cm.display.input.reset(true); + }, 20); + } // Issue #1730 } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm, e) { + if (cm.state.delayingBlurEvent) { + return; + } + if (cm.state.focused) { + signal(cm, "blur", cm, e); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function () { + if (!cm.state.focused) { + cm.display.shift = false; + } + }, 150); + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top); + var oldHeight = display.lineDiv.getBoundingClientRect().top; + var mustScroll = 0; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], + wrapping = cm.options.lineWrapping; + var height = void 0, + width = 0; + if (cur.hidden) { + continue; + } + oldHeight += cur.line.height; + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + // Check that lines don't extend past the right of the current + // editor width + if (!wrapping && cur.text.firstChild) { + width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; + } + } + var diff = cur.line.height - height; + if (diff > .005 || diff < -.005) { + if (oldHeight < viewTop) { + mustScroll -= diff; + } + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) { + for (var j = 0; j < cur.rest.length; j++) { + updateWidgetHeight(cur.rest[j]); + } + } + } + if (width > cm.display.sizerWidth) { + var chWidth = Math.ceil(width / charWidth(cm.display)); + if (chWidth > cm.display.maxLineLength) { + cm.display.maxLineLength = chWidth; + cm.display.maxLine = cur.line; + cm.display.maxLineChanged = true; + } + } + } + if (Math.abs(mustScroll) > 2) { + display.scroller.scrollTop += mustScroll; + } + } + + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) { + for (var i = 0; i < line.widgets.length; ++i) { + var w = line.widgets[i], + parent = w.node.parentNode; + if (parent) { + w.height = parent.offsetHeight; + } + } + } + } + + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + var from = lineAtHeight(doc, top), + to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, + ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } + } + return { + from: from, + to: Math.max(to, from + 1) }; - /** - * Iterate through all animation types in reverse priority order. For each, we want to - * detect which values it's handling and whether or not they've changed (and therefore - * need to be animated). If any values have been removed, we want to detect those in - * lower priority props and flag for animation. - */ - for (var i = 0; i < numAnimationTypes; i++) { - _loop_1(i); + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, rect) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) { + return; } - allAnimatedKeys = tslib.__assign({}, encounteredKeys); - /** - * If there are some removed value that haven't been dealt with, - * we need to create a new animation that falls back either to the value - * defined in the style prop, or the last read value. - */ - if (removedKeys.size) { - var fallbackAnimation_1 = {}; - removedKeys.forEach(function (key) { - var fallbackTarget = visualElement.getBaseTarget(key); - if (fallbackTarget !== undefined) { - fallbackAnimation_1[key] = fallbackTarget; + var display = cm.display, + box = display.sizer.getBoundingClientRect(), + doScroll = null; + if (rect.top + box.top < 0) { + doScroll = true; + } else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { + doScroll = false; + } + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, "position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + rect.left + "px; width: " + Math.max(2, rect.right - rect.left) + "px;"); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) { + margin = 0; + } + var rect; + if (!cm.options.lineWrapping && pos == end) { + // Set pos and end to the cursor positions around the character pos sticks to + // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch + // If pos == Pos(_, 0, "before"), pos and end are unchanged + end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; + pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; + } + for (var limit = 0; limit < 5; limit++) { + var changed = false; + var coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + rect = { + left: Math.min(coords.left, endCoords.left), + top: Math.min(coords.top, endCoords.top) - margin, + right: Math.max(coords.left, endCoords.left), + bottom: Math.max(coords.bottom, endCoords.bottom) + margin + }; + var scrollPos = calculateScrollPos(cm, rect); + var startTop = cm.doc.scrollTop, + startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) { + changed = true; } - }); - animations.push({ - animation: fallbackAnimation_1 - }); + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { + changed = true; + } + } + if (!changed) { + break; + } } - var shouldAnimate = Boolean(animations.length); - if (isInitialRender && props.initial === false && !visualElement.manuallyAnimateOnMount) { - shouldAnimate = false; + return rect; + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, rect) { + var scrollPos = calculateScrollPos(cm, rect); + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + } + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, rect) { + var display = cm.display, + snapMargin = textHeight(cm.display); + if (rect.top < 0) { + rect.top = 0; + } + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), + result = {}; + if (rect.bottom - rect.top > screen) { + rect.bottom = rect.top + screen; + } + var docBottom = cm.doc.height + paddingVert(display); + var atTop = rect.top < snapMargin, + atBottom = rect.bottom > docBottom - snapMargin; + if (rect.top < screentop) { + result.scrollTop = atTop ? 0 : rect.top; + } else if (rect.bottom > screentop + screen) { + var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); + if (newTop != screentop) { + result.scrollTop = newTop; + } + } + var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth; + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace; + var screenw = displayWidth(cm) - display.gutters.offsetWidth; + var tooWide = rect.right - rect.left > screenw; + if (tooWide) { + rect.right = rect.left + screenw; + } + if (rect.left < 10) { + result.scrollLeft = 0; + } else if (rect.left < screenleft) { + result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); + } else if (rect.right > screenw + screenleft - 3) { + result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; } - isInitialRender = false; - return shouldAnimate ? animate(animations) : Promise.resolve(); + return result; } - /** - * Change whether a certain animation type is active. - */ - function setActive(type, isActive, options) { - var _a; - // If the active state hasn't changed, we can safely do nothing here - if (state[type].isActive === isActive) return Promise.resolve(); - // Propagate active change to children - (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { - var _a; - return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); - }); - state[type].isActive = isActive; - var animations = animateChanges(options, type); - for (var key in state) { - state[key].protectedKeys = {}; + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollTop(cm, top) { + if (top == null) { + return; } - return animations; + resolveScrollToPos(cm); + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; } - return { - isAnimated: isAnimated, - animateChanges: animateChanges, - setActive: setActive, - setAnimateFunction: setAnimateFunction, - getState: function () { - return state; + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(); + cm.curOp.scrollToPos = { + from: cur, + to: cur, + margin: cm.options.cursorScrollMargin + }; + } + function scrollToCoords(cm, x, y) { + if (x != null || y != null) { + resolveScrollToPos(cm); + } + if (x != null) { + cm.curOp.scrollLeft = x; + } + if (y != null) { + cm.curOp.scrollTop = y; } - }; -} -function checkVariantsDidChange(prev, next) { - if (typeof next === "string") { - return next !== prev; - } else if (isVariantLabels(next)) { - return !shallowCompare(next, prev); } - return false; -} -function createTypeState(isActive) { - if (isActive === void 0) { - isActive = false; + function scrollToRange(cm, range) { + resolveScrollToPos(cm); + cm.curOp.scrollToPos = range; } - return { - isActive: isActive, - protectedKeys: {}, - needsAnimating: {}, - prevResolvedValues: {} - }; -} -function createState() { - var _a; - return _a = {}, _a[exports.AnimationType.Animate] = createTypeState(true), _a[exports.AnimationType.InView] = createTypeState(), _a[exports.AnimationType.Hover] = createTypeState(), _a[exports.AnimationType.Tap] = createTypeState(), _a[exports.AnimationType.Drag] = createTypeState(), _a[exports.AnimationType.Focus] = createTypeState(), _a[exports.AnimationType.Exit] = createTypeState(), _a; -} -var animations = { - animation: makeRenderlessComponent(function (_a) { - var visualElement = _a.visualElement, - animate = _a.animate; - /** - * We dynamically generate the AnimationState manager as it contains a reference - * to the underlying animation library. We only want to load that if we load this, - * so people can optionally code split it out using the `m` component. - */ - visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement)); - /** - * Subscribe any provided AnimationControls to the component's VisualElement - */ - if (isAnimationControls(animate)) { - React.useEffect(function () { - return animate.subscribe(visualElement); - }, [animate]); + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos; + if (range) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range.from), + to = estimateCoords(cm, range.to); + scrollToCoordsRange(cm, from, to, range.margin); + } + } + function scrollToCoordsRange(cm, from, to, margin) { + var sPos = calculateScrollPos(cm, { + left: Math.min(from.left, to.left), + top: Math.min(from.top, to.top) - margin, + right: Math.max(from.right, to.right), + bottom: Math.max(from.bottom, to.bottom) + margin + }); + scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); + } + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function updateScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) { + return; } - }), - exit: makeRenderlessComponent(function (props) { - var custom = props.custom, - visualElement = props.visualElement; - var _a = tslib.__read(usePresence(), 2), - isPresent = _a[0], - safeToRemove = _a[1]; - var presenceContext = React.useContext(PresenceContext); - React.useEffect(function () { - var _a, _b; - visualElement.isPresent = isPresent; - var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Exit, !isPresent, { - custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom + if (!gecko) { + updateDisplaySimple(cm, { + top: val }); - !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(safeToRemove)); - }, [isPresent]); - }) -}; + } + setScrollTop(cm, val, true); + if (gecko) { + updateDisplaySimple(cm); + } + startWorker(cm, 100); + } + function setScrollTop(cm, val, forceScroll) { + val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)); + if (cm.display.scroller.scrollTop == val && !forceScroll) { + return; + } + cm.doc.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (cm.display.scroller.scrollTop != val) { + cm.display.scroller.scrollTop = val; + } + } -/** - * @internal - */ -var PanSession = /** @class */function () { - function PanSession(event, handlers, _a) { - var _this = this; - var _b = _a === void 0 ? {} : _a, - transformPagePoint = _b.transformPagePoint; - /** - * @internal - */ - this.startEvent = null; - /** - * @internal - */ - this.lastMoveEvent = null; - /** - * @internal - */ - this.lastMoveEventInfo = null; - /** - * @internal - */ - this.handlers = {}; - this.updatePoint = function () { - if (!(_this.lastMoveEvent && _this.lastMoveEventInfo)) return; - var info = getPanInfo(_this.lastMoveEventInfo, _this.history); - var isPanStarted = _this.startEvent !== null; - // Only start panning if the offset is larger than 3 pixels. If we make it - // any larger than this we'll want to reset the pointer history - // on the first update to avoid visual snapping to the cursoe. - var isDistancePastThreshold = popmotion.distance(info.offset, { - x: 0, - y: 0 - }) >= 3; - if (!isPanStarted && !isDistancePastThreshold) return; - var point = info.point; - var timestamp = sync.getFrameData().timestamp; - _this.history.push(tslib.__assign(tslib.__assign({}, point), { - timestamp: timestamp - })); - var _a = _this.handlers, - onStart = _a.onStart, - onMove = _a.onMove; - if (!isPanStarted) { - onStart && onStart(_this.lastMoveEvent, info); - _this.startEvent = _this.lastMoveEvent; - } - onMove && onMove(_this.lastMoveEvent, info); + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller, forceScroll) { + val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)); + if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { + return; + } + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) { + cm.display.scroller.scrollLeft = val; + } + cm.display.scrollbars.setScrollLeft(val); + } + + // SCROLLBARS + + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, + gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, + clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW }; - this.handlePointerMove = function (event, info) { - _this.lastMoveEvent = event; - _this.lastMoveEventInfo = transformPoint(info, _this.transformPagePoint); - // Because Safari doesn't trigger mouseup events when it's above a `` + if (isMouseEvent(event) && event.buttons === 0) { + _this.handlePointerUp(event, info); + return; + } + // Throttle mouse move event to once per frame + sync__default["default"].update(_this.updatePoint, true); + }; + this.handlePointerUp = function (event, info) { + _this.end(); + var _a = _this.handlers, + onEnd = _a.onEnd, + onSessionEnd = _a.onSessionEnd; + var panInfo = getPanInfo(transformPoint(info, _this.transformPagePoint), _this.history); + if (_this.startEvent && onEnd) { + onEnd(event, panInfo); + } + onSessionEnd && onSessionEnd(event, panInfo); + }; + // If we have more than one touch, don't start detecting this gesture + if (isTouchEvent(event) && event.touches.length > 1) return; + this.handlers = handlers; + this.transformPagePoint = transformPagePoint; + var info = extractEventInfo(event); + var initialInfo = transformPoint(info, this.transformPagePoint); + var point = initialInfo.point; + var timestamp = sync.getFrameData().timestamp; + this.history = [tslib.__assign(tslib.__assign({}, point), { + timestamp: timestamp + })]; + var onSessionStart = handlers.onSessionStart; + onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history)); + this.removeListeners = popmotion.pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp)); } -})); -Object.defineProperty(exports, "buildSchema", ({ - enumerable: true, - get: function () { - return _index6.buildSchema; + PanSession.prototype.updateHandlers = function (handlers) { + this.handlers = handlers; + }; + PanSession.prototype.end = function () { + this.removeListeners && this.removeListeners(); + sync.cancelSync.update(this.updatePoint); + }; + return PanSession; +}(); +function transformPoint(info, transformPagePoint) { + return transformPagePoint ? { + point: transformPagePoint(info.point) + } : info; +} +function subtractPoint(a, b) { + return { + x: a.x - b.x, + y: a.y - b.y + }; +} +function getPanInfo(_a, history) { + var point = _a.point; + return { + point: point, + delta: subtractPoint(point, lastDevicePoint(history)), + offset: subtractPoint(point, startDevicePoint(history)), + velocity: getVelocity(history, 0.1) + }; +} +function startDevicePoint(history) { + return history[0]; +} +function lastDevicePoint(history) { + return history[history.length - 1]; +} +function getVelocity(history, timeDelta) { + if (history.length < 2) { + return { + x: 0, + y: 0 + }; } -})); -Object.defineProperty(exports, "coerceInputValue", ({ - enumerable: true, - get: function () { - return _index6.coerceInputValue; + var i = history.length - 1; + var timestampedPoint = null; + var lastPoint = lastDevicePoint(history); + while (i >= 0) { + timestampedPoint = history[i]; + if (lastPoint.timestamp - timestampedPoint.timestamp > secondsToMilliseconds(timeDelta)) { + break; + } + i--; } -})); -Object.defineProperty(exports, "concatAST", ({ - enumerable: true, - get: function () { - return _index6.concatAST; + if (!timestampedPoint) { + return { + x: 0, + y: 0 + }; } -})); -Object.defineProperty(exports, "createSourceEventStream", ({ - enumerable: true, - get: function () { - return _index3.createSourceEventStream; + var time = (lastPoint.timestamp - timestampedPoint.timestamp) / 1000; + if (time === 0) { + return { + x: 0, + y: 0 + }; } -})); -Object.defineProperty(exports, "defaultFieldResolver", ({ - enumerable: true, - get: function () { - return _index3.defaultFieldResolver; + var currentVelocity = { + x: (lastPoint.x - timestampedPoint.x) / time, + y: (lastPoint.y - timestampedPoint.y) / time + }; + if (currentVelocity.x === Infinity) { + currentVelocity.x = 0; } -})); -Object.defineProperty(exports, "defaultTypeResolver", ({ - enumerable: true, - get: function () { - return _index3.defaultTypeResolver; + if (currentVelocity.y === Infinity) { + currentVelocity.y = 0; } -})); -Object.defineProperty(exports, "doTypesOverlap", ({ - enumerable: true, - get: function () { - return _index6.doTypesOverlap; + return currentVelocity; +} +function calcLength(axis) { + return axis.max - axis.min; +} +function isNear(value, target, maxDistance) { + if (target === void 0) { + target = 0; } -})); -Object.defineProperty(exports, "execute", ({ - enumerable: true, - get: function () { - return _index3.execute; + if (maxDistance === void 0) { + maxDistance = 0.01; } -})); -Object.defineProperty(exports, "executeSync", ({ - enumerable: true, - get: function () { - return _index3.executeSync; + return popmotion.distance(value, target) < maxDistance; +} +function calcAxisDelta(delta, source, target, origin) { + if (origin === void 0) { + origin = 0.5; } -})); -Object.defineProperty(exports, "extendSchema", ({ - enumerable: true, - get: function () { - return _index6.extendSchema; + delta.origin = origin; + delta.originPoint = popmotion.mix(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + if (isNear(delta.scale, 1, 0.0001) || isNaN(delta.scale)) delta.scale = 1; + delta.translate = popmotion.mix(target.min, target.max, delta.origin) - delta.originPoint; + if (isNear(delta.translate) || isNaN(delta.translate)) delta.translate = 0; +} +function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin === null || origin === void 0 ? void 0 : origin.originX); + calcAxisDelta(delta.y, source.y, target.y, origin === null || origin === void 0 ? void 0 : origin.originY); +} +function calcRelativeAxis(target, relative, parent) { + target.min = parent.min + relative.min; + target.max = target.min + calcLength(relative); +} +function calcRelativeBox(target, relative, parent) { + calcRelativeAxis(target.x, relative.x, parent.x); + calcRelativeAxis(target.y, relative.y, parent.y); +} +function calcRelativeAxisPosition(target, layout, parent) { + target.min = layout.min - parent.min; + target.max = target.min + calcLength(layout); +} +function calcRelativePosition(target, layout, parent) { + calcRelativeAxisPosition(target.x, layout.x, parent.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y); +} + +/** + * Apply constraints to a point. These constraints are both physical along an + * axis, and an elastic factor that determines how much to constrain the point + * by if it does lie outside the defined parameters. + */ +function applyConstraints(point, _a, elastic) { + var min = _a.min, + max = _a.max; + if (min !== undefined && point < min) { + // If we have a min point defined, and this is outside of that, constrain + point = elastic ? popmotion.mix(min, point, elastic.min) : Math.max(point, min); + } else if (max !== undefined && point > max) { + // If we have a max point defined, and this is outside of that, constrain + point = elastic ? popmotion.mix(max, point, elastic.max) : Math.min(point, max); } -})); -Object.defineProperty(exports, "findBreakingChanges", ({ - enumerable: true, - get: function () { - return _index6.findBreakingChanges; + return point; +} +/** + * Calculate constraints in terms of the viewport when defined relatively to the + * measured axis. This is measured from the nearest edge, so a max constraint of 200 + * on an axis with a max value of 300 would return a constraint of 500 - axis length + */ +function calcRelativeAxisConstraints(axis, min, max) { + return { + min: min !== undefined ? axis.min + min : undefined, + max: max !== undefined ? axis.max + max - (axis.max - axis.min) : undefined + }; +} +/** + * Calculate constraints in terms of the viewport when + * defined relatively to the measured bounding box. + */ +function calcRelativeConstraints(layoutBox, _a) { + var top = _a.top, + left = _a.left, + bottom = _a.bottom, + right = _a.right; + return { + x: calcRelativeAxisConstraints(layoutBox.x, left, right), + y: calcRelativeAxisConstraints(layoutBox.y, top, bottom) + }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative axis + */ +function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { + var _a; + var min = constraintsAxis.min - layoutAxis.min; + var max = constraintsAxis.max - layoutAxis.max; + // If the constraints axis is actually smaller than the layout axis then we can + // flip the constraints + if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) { + _a = tslib.__read([max, min], 2), min = _a[0], max = _a[1]; } -})); -Object.defineProperty(exports, "findDangerousChanges", ({ - enumerable: true, - get: function () { - return _index6.findDangerousChanges; + return { + min: min, + max: max + }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative box + */ +function calcViewportConstraints(layoutBox, constraintsBox) { + return { + x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), + y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y) + }; +} +/** + * Calculate a transform origin relative to the source axis, between 0-1, that results + * in an asthetically pleasing scale/transform needed to project from source to target. + */ +function calcOrigin(source, target) { + var origin = 0.5; + var sourceLength = calcLength(source); + var targetLength = calcLength(target); + if (targetLength > sourceLength) { + origin = popmotion.progress(target.min, target.max - sourceLength, source.min); + } else if (sourceLength > targetLength) { + origin = popmotion.progress(source.min, source.max - targetLength, target.min); } -})); -Object.defineProperty(exports, "formatError", ({ - enumerable: true, - get: function () { - return _index5.formatError; + return popmotion.clamp(0, 1, origin); +} +/** + * Rebase the calculated viewport constraints relative to the layout.min point. + */ +function rebaseAxisConstraints(layout, constraints) { + var relativeConstraints = {}; + if (constraints.min !== undefined) { + relativeConstraints.min = constraints.min - layout.min; } -})); -Object.defineProperty(exports, "getArgumentValues", ({ - enumerable: true, - get: function () { - return _index3.getArgumentValues; + if (constraints.max !== undefined) { + relativeConstraints.max = constraints.max - layout.min; } -})); -Object.defineProperty(exports, "getDirectiveValues", ({ - enumerable: true, - get: function () { - return _index3.getDirectiveValues; + return relativeConstraints; +} +var defaultElastic = 0.35; +/** + * Accepts a dragElastic prop and returns resolved elastic values for each axis. + */ +function resolveDragElastic(dragElastic) { + if (dragElastic === void 0) { + dragElastic = defaultElastic; } -})); -Object.defineProperty(exports, "getEnterLeaveForKind", ({ - enumerable: true, - get: function () { - return _index2.getEnterLeaveForKind; + if (dragElastic === false) { + dragElastic = 0; + } else if (dragElastic === true) { + dragElastic = defaultElastic; } -})); -Object.defineProperty(exports, "getIntrospectionQuery", ({ - enumerable: true, - get: function () { - return _index6.getIntrospectionQuery; - } -})); -Object.defineProperty(exports, "getLocation", ({ - enumerable: true, - get: function () { - return _index2.getLocation; - } -})); -Object.defineProperty(exports, "getNamedType", ({ - enumerable: true, - get: function () { - return _index.getNamedType; - } -})); -Object.defineProperty(exports, "getNullableType", ({ - enumerable: true, - get: function () { - return _index.getNullableType; - } -})); -Object.defineProperty(exports, "getOperationAST", ({ - enumerable: true, - get: function () { - return _index6.getOperationAST; - } -})); -Object.defineProperty(exports, "getOperationRootType", ({ - enumerable: true, - get: function () { - return _index6.getOperationRootType; - } -})); -Object.defineProperty(exports, "getVariableValues", ({ - enumerable: true, - get: function () { - return _index3.getVariableValues; - } -})); -Object.defineProperty(exports, "getVisitFn", ({ - enumerable: true, - get: function () { - return _index2.getVisitFn; - } -})); -Object.defineProperty(exports, "graphql", ({ - enumerable: true, - get: function () { - return _graphql.graphql; - } -})); -Object.defineProperty(exports, "graphqlSync", ({ - enumerable: true, - get: function () { - return _graphql.graphqlSync; - } -})); -Object.defineProperty(exports, "introspectionFromSchema", ({ - enumerable: true, - get: function () { - return _index6.introspectionFromSchema; - } -})); -Object.defineProperty(exports, "introspectionTypes", ({ - enumerable: true, - get: function () { - return _index.introspectionTypes; - } -})); -Object.defineProperty(exports, "isAbstractType", ({ - enumerable: true, - get: function () { - return _index.isAbstractType; - } -})); -Object.defineProperty(exports, "isCompositeType", ({ - enumerable: true, - get: function () { - return _index.isCompositeType; - } -})); -Object.defineProperty(exports, "isConstValueNode", ({ - enumerable: true, - get: function () { - return _index2.isConstValueNode; - } -})); -Object.defineProperty(exports, "isDefinitionNode", ({ - enumerable: true, - get: function () { - return _index2.isDefinitionNode; - } -})); -Object.defineProperty(exports, "isDirective", ({ - enumerable: true, - get: function () { - return _index.isDirective; - } -})); -Object.defineProperty(exports, "isEnumType", ({ - enumerable: true, - get: function () { - return _index.isEnumType; - } -})); -Object.defineProperty(exports, "isEqualType", ({ - enumerable: true, - get: function () { - return _index6.isEqualType; - } -})); -Object.defineProperty(exports, "isExecutableDefinitionNode", ({ - enumerable: true, - get: function () { - return _index2.isExecutableDefinitionNode; - } -})); -Object.defineProperty(exports, "isInputObjectType", ({ - enumerable: true, - get: function () { - return _index.isInputObjectType; - } -})); -Object.defineProperty(exports, "isInputType", ({ - enumerable: true, - get: function () { - return _index.isInputType; - } -})); -Object.defineProperty(exports, "isInterfaceType", ({ - enumerable: true, - get: function () { - return _index.isInterfaceType; - } -})); -Object.defineProperty(exports, "isIntrospectionType", ({ - enumerable: true, - get: function () { - return _index.isIntrospectionType; - } -})); -Object.defineProperty(exports, "isLeafType", ({ - enumerable: true, - get: function () { - return _index.isLeafType; - } -})); -Object.defineProperty(exports, "isListType", ({ - enumerable: true, - get: function () { - return _index.isListType; - } -})); -Object.defineProperty(exports, "isNamedType", ({ - enumerable: true, - get: function () { - return _index.isNamedType; - } -})); -Object.defineProperty(exports, "isNonNullType", ({ - enumerable: true, - get: function () { - return _index.isNonNullType; - } -})); -Object.defineProperty(exports, "isNullableType", ({ - enumerable: true, - get: function () { - return _index.isNullableType; - } -})); -Object.defineProperty(exports, "isObjectType", ({ - enumerable: true, - get: function () { - return _index.isObjectType; - } -})); -Object.defineProperty(exports, "isOutputType", ({ - enumerable: true, - get: function () { - return _index.isOutputType; - } -})); -Object.defineProperty(exports, "isRequiredArgument", ({ - enumerable: true, - get: function () { - return _index.isRequiredArgument; - } -})); -Object.defineProperty(exports, "isRequiredInputField", ({ - enumerable: true, - get: function () { - return _index.isRequiredInputField; - } -})); -Object.defineProperty(exports, "isScalarType", ({ - enumerable: true, - get: function () { - return _index.isScalarType; - } -})); -Object.defineProperty(exports, "isSchema", ({ - enumerable: true, - get: function () { - return _index.isSchema; - } -})); -Object.defineProperty(exports, "isSelectionNode", ({ - enumerable: true, - get: function () { - return _index2.isSelectionNode; - } -})); -Object.defineProperty(exports, "isSpecifiedDirective", ({ - enumerable: true, - get: function () { - return _index.isSpecifiedDirective; - } -})); -Object.defineProperty(exports, "isSpecifiedScalarType", ({ - enumerable: true, - get: function () { - return _index.isSpecifiedScalarType; + return { + x: resolveAxisElastic(dragElastic, "left", "right"), + y: resolveAxisElastic(dragElastic, "top", "bottom") + }; +} +function resolveAxisElastic(dragElastic, minLabel, maxLabel) { + return { + min: resolvePointElastic(dragElastic, minLabel), + max: resolvePointElastic(dragElastic, maxLabel) + }; +} +function resolvePointElastic(dragElastic, label) { + var _a; + return typeof dragElastic === "number" ? dragElastic : (_a = dragElastic[label]) !== null && _a !== void 0 ? _a : 0; +} +var createAxisDelta = function () { + return { + translate: 0, + scale: 1, + origin: 0, + originPoint: 0 + }; +}; +var createDelta = function () { + return { + x: createAxisDelta(), + y: createAxisDelta() + }; +}; +var createAxis = function () { + return { + min: 0, + max: 0 + }; +}; +var createBox = function () { + return { + x: createAxis(), + y: createAxis() + }; +}; +function eachAxis(callback) { + return [callback("x"), callback("y")]; +} + +/** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ +function convertBoundingBoxToBox(_a) { + var top = _a.top, + left = _a.left, + right = _a.right, + bottom = _a.bottom; + return { + x: { + min: left, + max: right + }, + y: { + min: top, + max: bottom + } + }; +} +function convertBoxToBoundingBox(_a) { + var x = _a.x, + y = _a.y; + return { + top: y.min, + right: x.max, + bottom: y.max, + left: x.min + }; +} +/** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ +function transformBoxPoints(point, transformPoint) { + if (!transformPoint) return point; + var topLeft = transformPoint({ + x: point.left, + y: point.top + }); + var bottomRight = transformPoint({ + x: point.right, + y: point.bottom + }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x + }; +} +function isIdentityScale(scale) { + return scale === undefined || scale === 1; +} +function hasScale(_a) { + var scale = _a.scale, + scaleX = _a.scaleX, + scaleY = _a.scaleY; + return !isIdentityScale(scale) || !isIdentityScale(scaleX) || !isIdentityScale(scaleY); +} +function hasTransform(values) { + return hasScale(values) || hasTranslate(values.x) || hasTranslate(values.y) || values.z || values.rotate || values.rotateX || values.rotateY; +} +function hasTranslate(value) { + return value && value !== "0%"; +} + +/** + * Scales a point based on a factor and an originPoint + */ +function scalePoint(point, scale, originPoint) { + var distanceFromOrigin = point - originPoint; + var scaled = scale * distanceFromOrigin; + return originPoint + scaled; +} +/** + * Applies a translate/scale delta to a point + */ +function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); } -})); -Object.defineProperty(exports, "isType", ({ - enumerable: true, - get: function () { - return _index.isType; + return scalePoint(point, scale, originPoint) + translate; +} +/** + * Applies a translate/scale delta to an axis + */ +function applyAxisDelta(axis, translate, scale, originPoint, boxScale) { + if (translate === void 0) { + translate = 0; } -})); -Object.defineProperty(exports, "isTypeDefinitionNode", ({ - enumerable: true, - get: function () { - return _index2.isTypeDefinitionNode; + if (scale === void 0) { + scale = 1; } -})); -Object.defineProperty(exports, "isTypeExtensionNode", ({ - enumerable: true, - get: function () { - return _index2.isTypeExtensionNode; + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); +} +/** + * Applies a translate/scale delta to a box + */ +function applyBoxDelta(box, _a) { + var x = _a.x, + y = _a.y; + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); +} +/** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ +function applyTreeDeltas(box, treeScale, treePath, isSharedTransition) { + var _a, _b; + if (isSharedTransition === void 0) { + isSharedTransition = false; } -})); -Object.defineProperty(exports, "isTypeNode", ({ - enumerable: true, - get: function () { - return _index2.isTypeNode; + var treeLength = treePath.length; + if (!treeLength) return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + var node; + var delta; + for (var i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + if (((_b = (_a = node.instance) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === "contents") continue; + if (isSharedTransition && node.options.layoutScroll && node.scroll && node !== node.root) { + transformBox(box, { + x: -node.scroll.x, + y: -node.scroll.y + }); + } + if (delta) { + // Incoporate each ancestor's scale into a culmulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues); + } } -})); -Object.defineProperty(exports, "isTypeSubTypeOf", ({ - enumerable: true, - get: function () { - return _index6.isTypeSubTypeOf; +} +function translateAxis(axis, distance) { + axis.min = axis.min + distance; + axis.max = axis.max + distance; +} +/** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ +function transformAxis(axis, transforms, _a) { + var _b = tslib.__read(_a, 3), + key = _b[0], + scaleKey = _b[1], + originKey = _b[2]; + var axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5; + var originPoint = popmotion.mix(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, transforms[key], transforms[scaleKey], originPoint, transforms.scale); +} +/** + * The names of the motion values we want to apply as translation, scale and origin. + */ +var xKeys$1 = ["x", "scaleX", "originX"]; +var yKeys$1 = ["y", "scaleY", "originY"]; +/** + * Apply a transform to a box from the latest resolved motion values. + */ +function transformBox(box, transform) { + transformAxis(box.x, transform, xKeys$1); + transformAxis(box.y, transform, yKeys$1); +} +function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); +} +function measurePageBox(element, rootProjectionNode, transformPagePoint) { + var viewportBox = measureViewportBox(element, transformPagePoint); + var scroll = rootProjectionNode.scroll; + if (scroll) { + translateAxis(viewportBox.x, scroll.x); + translateAxis(viewportBox.y, scroll.y); } -})); -Object.defineProperty(exports, "isTypeSystemDefinitionNode", ({ - enumerable: true, - get: function () { - return _index2.isTypeSystemDefinitionNode; + return viewportBox; +} +var elementDragControls = new WeakMap(); +/** + * + */ +// let latestPointerEvent: AnyPointerEvent +var VisualElementDragControls = /** @class */function () { + function VisualElementDragControls(visualElement) { + // This is a reference to the global drag gesture lock, ensuring only one component + // can "capture" the drag of one or both axes. + // TODO: Look into moving this into pansession? + this.openGlobalLock = null; + this.isDragging = false; + this.currentDirection = null; + this.originPoint = { + x: 0, + y: 0 + }; + /** + * The permitted boundaries of travel, in pixels. + */ + this.constraints = false; + this.hasMutatedConstraints = false; + /** + * The per-axis resolved elastic values. + */ + this.elastic = createBox(); + this.visualElement = visualElement; } -})); -Object.defineProperty(exports, "isTypeSystemExtensionNode", ({ - enumerable: true, - get: function () { - return _index2.isTypeSystemExtensionNode; - } -})); -Object.defineProperty(exports, "isUnionType", ({ - enumerable: true, - get: function () { - return _index.isUnionType; - } -})); -Object.defineProperty(exports, "isValidNameError", ({ - enumerable: true, - get: function () { - return _index6.isValidNameError; - } -})); -Object.defineProperty(exports, "isValueNode", ({ - enumerable: true, - get: function () { - return _index2.isValueNode; - } -})); -Object.defineProperty(exports, "isWrappingType", ({ - enumerable: true, - get: function () { - return _index.isWrappingType; - } -})); -Object.defineProperty(exports, "lexicographicSortSchema", ({ - enumerable: true, - get: function () { - return _index6.lexicographicSortSchema; - } -})); -Object.defineProperty(exports, "locatedError", ({ - enumerable: true, - get: function () { - return _index5.locatedError; - } -})); -Object.defineProperty(exports, "parse", ({ - enumerable: true, - get: function () { - return _index2.parse; - } -})); -Object.defineProperty(exports, "parseConstValue", ({ - enumerable: true, - get: function () { - return _index2.parseConstValue; - } -})); -Object.defineProperty(exports, "parseType", ({ - enumerable: true, - get: function () { - return _index2.parseType; - } -})); -Object.defineProperty(exports, "parseValue", ({ - enumerable: true, - get: function () { - return _index2.parseValue; - } -})); -Object.defineProperty(exports, "print", ({ - enumerable: true, - get: function () { - return _index2.print; - } -})); -Object.defineProperty(exports, "printError", ({ - enumerable: true, - get: function () { - return _index5.printError; - } -})); -Object.defineProperty(exports, "printIntrospectionSchema", ({ - enumerable: true, - get: function () { - return _index6.printIntrospectionSchema; - } -})); -Object.defineProperty(exports, "printLocation", ({ - enumerable: true, - get: function () { - return _index2.printLocation; - } -})); -Object.defineProperty(exports, "printSchema", ({ - enumerable: true, - get: function () { - return _index6.printSchema; - } -})); -Object.defineProperty(exports, "printSourceLocation", ({ - enumerable: true, - get: function () { - return _index2.printSourceLocation; - } -})); -Object.defineProperty(exports, "printType", ({ - enumerable: true, - get: function () { - return _index6.printType; - } -})); -Object.defineProperty(exports, "recommendedRules", ({ - enumerable: true, - get: function () { - return _index4.recommendedRules; - } -})); -Object.defineProperty(exports, "resolveObjMapThunk", ({ - enumerable: true, - get: function () { - return _index.resolveObjMapThunk; - } -})); -Object.defineProperty(exports, "resolveReadonlyArrayThunk", ({ - enumerable: true, - get: function () { - return _index.resolveReadonlyArrayThunk; - } -})); -Object.defineProperty(exports, "responsePathAsArray", ({ - enumerable: true, - get: function () { - return _index3.responsePathAsArray; - } -})); -Object.defineProperty(exports, "separateOperations", ({ - enumerable: true, - get: function () { - return _index6.separateOperations; - } -})); -Object.defineProperty(exports, "specifiedDirectives", ({ - enumerable: true, - get: function () { - return _index.specifiedDirectives; - } -})); -Object.defineProperty(exports, "specifiedRules", ({ - enumerable: true, - get: function () { - return _index4.specifiedRules; - } -})); -Object.defineProperty(exports, "specifiedScalarTypes", ({ - enumerable: true, - get: function () { - return _index.specifiedScalarTypes; - } -})); -Object.defineProperty(exports, "stripIgnoredCharacters", ({ - enumerable: true, - get: function () { - return _index6.stripIgnoredCharacters; - } -})); -Object.defineProperty(exports, "subscribe", ({ - enumerable: true, - get: function () { - return _index3.subscribe; - } -})); -Object.defineProperty(exports, "syntaxError", ({ - enumerable: true, - get: function () { - return _index5.syntaxError; - } -})); -Object.defineProperty(exports, "typeFromAST", ({ - enumerable: true, - get: function () { - return _index6.typeFromAST; - } -})); -Object.defineProperty(exports, "validate", ({ - enumerable: true, - get: function () { - return _index4.validate; - } -})); -Object.defineProperty(exports, "validateSchema", ({ - enumerable: true, - get: function () { - return _index.validateSchema; - } -})); -Object.defineProperty(exports, "valueFromAST", ({ - enumerable: true, - get: function () { - return _index6.valueFromAST; - } -})); -Object.defineProperty(exports, "valueFromASTUntyped", ({ - enumerable: true, - get: function () { - return _index6.valueFromASTUntyped; - } -})); -Object.defineProperty(exports, "version", ({ - enumerable: true, - get: function () { - return _version.version; - } -})); -Object.defineProperty(exports, "versionInfo", ({ - enumerable: true, - get: function () { - return _version.versionInfo; - } -})); -Object.defineProperty(exports, "visit", ({ - enumerable: true, - get: function () { - return _index2.visit; - } -})); -Object.defineProperty(exports, "visitInParallel", ({ - enumerable: true, - get: function () { - return _index2.visitInParallel; - } -})); -Object.defineProperty(exports, "visitWithTypeInfo", ({ - enumerable: true, - get: function () { - return _index6.visitWithTypeInfo; - } -})); -var _version = __webpack_require__(/*! ./version.mjs */ "../../../node_modules/graphql/version.mjs"); -var _graphql = __webpack_require__(/*! ./graphql.mjs */ "../../../node_modules/graphql/graphql.mjs"); -var _index = __webpack_require__(/*! ./type/index.mjs */ "../../../node_modules/graphql/type/index.mjs"); -var _index2 = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/index.mjs"); -var _index3 = __webpack_require__(/*! ./execution/index.mjs */ "../../../node_modules/graphql/execution/index.mjs"); -var _index4 = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/index.mjs"); -var _index5 = __webpack_require__(/*! ./error/index.mjs */ "../../../node_modules/graphql/error/index.mjs"); -var _index6 = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/index.mjs"); - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/Path.mjs": -/*!******************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/Path.mjs ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.addPath = addPath; -exports.pathToArray = pathToArray; -/** - * Given a Path and a key, return a new Path containing the new key. - */ -function addPath(prev, key, typename) { - return { - prev, - key, - typename + VisualElementDragControls.prototype.start = function (originEvent, _a) { + var _this = this; + var _b = _a === void 0 ? {} : _a, + _c = _b.snapToCursor, + snapToCursor = _c === void 0 ? false : _c; + /** + * Don't start dragging if this component is exiting + */ + if (this.visualElement.isPresent === false) return; + var onSessionStart = function (event) { + // Stop any animations on both axis values immediately. This allows the user to throw and catch + // the component. + _this.stopAnimation(); + if (snapToCursor) { + _this.snapToCursor(extractEventInfo(event, "page").point); + } + }; + var onStart = function (event, info) { + var _a; + // Attempt to grab the global drag gesture lock - maybe make this part of PanSession + var _b = _this.getProps(), + drag = _b.drag, + dragPropagation = _b.dragPropagation, + onDragStart = _b.onDragStart; + if (drag && !dragPropagation) { + if (_this.openGlobalLock) _this.openGlobalLock(); + _this.openGlobalLock = getGlobalLock(drag); + // If we don 't have the lock, don't start dragging + if (!_this.openGlobalLock) return; + } + _this.isDragging = true; + _this.currentDirection = null; + _this.resolveConstraints(); + if (_this.visualElement.projection) { + _this.visualElement.projection.isAnimationBlocked = true; + _this.visualElement.projection.target = undefined; + } + /** + * Record gesture origin + */ + eachAxis(function (axis) { + var _a, _b; + var current = _this.getAxisMotionValue(axis).get() || 0; + /** + * If the MotionValue is a percentage value convert to px + */ + if (styleValueTypes.percent.test(current)) { + var measuredAxis = (_b = (_a = _this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.actual[axis]; + if (measuredAxis) { + var length_1 = calcLength(measuredAxis); + current = length_1 * (parseFloat(current) / 100); + } + } + _this.originPoint[axis] = current; + }); + // Fire onDragStart event + onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(event, info); + (_a = _this.visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Drag, true); + }; + var onMove = function (event, info) { + // latestPointerEvent = event + var _a = _this.getProps(), + dragPropagation = _a.dragPropagation, + dragDirectionLock = _a.dragDirectionLock, + onDirectionLock = _a.onDirectionLock, + onDrag = _a.onDrag; + // If we didn't successfully receive the gesture lock, early return. + if (!dragPropagation && !_this.openGlobalLock) return; + var offset = info.offset; + // Attempt to detect drag direction if directionLock is true + if (dragDirectionLock && _this.currentDirection === null) { + _this.currentDirection = getCurrentDirection(offset); + // If we've successfully set a direction, notify listener + if (_this.currentDirection !== null) { + onDirectionLock === null || onDirectionLock === void 0 ? void 0 : onDirectionLock(_this.currentDirection); + } + return; + } + // Update each point with the latest position + _this.updateAxis("x", info.point, offset); + _this.updateAxis("y", info.point, offset); + /** + * Ideally we would leave the renderer to fire naturally at the end of + * this frame but if the element is about to change layout as the result + * of a re-render we want to ensure the browser can read the latest + * bounding box to ensure the pointer and element don't fall out of sync. + */ + _this.visualElement.syncRender(); + /** + * This must fire after the syncRender call as it might trigger a state + * change which itself might trigger a layout update. + */ + onDrag === null || onDrag === void 0 ? void 0 : onDrag(event, info); + }; + var onSessionEnd = function (event, info) { + return _this.stop(event, info); + }; + this.panSession = new PanSession(originEvent, { + onSessionStart: onSessionStart, + onStart: onStart, + onMove: onMove, + onSessionEnd: onSessionEnd + }, { + transformPagePoint: this.visualElement.getTransformPagePoint() + }); }; -} -/** - * Given a Path, return an Array of the path keys. - */ - -function pathToArray(path) { - const flattened = []; - let curr = path; - while (curr) { - flattened.push(curr.key); - curr = curr.prev; - } - return flattened.reverse(); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/devAssert.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/devAssert.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.devAssert = devAssert; -function devAssert(condition, message) { - const booleanCondition = Boolean(condition); - if (!booleanCondition) { - throw new Error(message); - } -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/didYouMean.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/didYouMean.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.didYouMean = didYouMean; -const MAX_SUGGESTIONS = 5; -/** - * Given [ A, B, C ] return ' Did you mean A, B, or C?'. - */ - -function didYouMean(firstArg, secondArg) { - const [subMessage, suggestionsArg] = secondArg ? [firstArg, secondArg] : [undefined, firstArg]; - let message = ' Did you mean '; - if (subMessage) { - message += subMessage + ' '; - } - const suggestions = suggestionsArg.map(x => `"${x}"`); - switch (suggestions.length) { - case 0: - return ''; - case 1: - return message + suggestions[0] + '?'; - case 2: - return message + suggestions[0] + ' or ' + suggestions[1] + '?'; - } - const selected = suggestions.slice(0, MAX_SUGGESTIONS); - const lastItem = selected.pop(); - return message + selected.join(', ') + ', or ' + lastItem + '?'; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/groupBy.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/groupBy.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.groupBy = groupBy; -/** - * Groups array items into a Map, given a function to produce grouping key. - */ -function groupBy(list, keyFn) { - const result = new Map(); - for (const item of list) { - const key = keyFn(item); - const group = result.get(key); - if (group === undefined) { - result.set(key, [item]); - } else { - group.push(item); + VisualElementDragControls.prototype.stop = function (event, info) { + var isDragging = this.isDragging; + this.cancel(); + if (!isDragging) return; + var velocity = info.velocity; + this.startAnimation(velocity); + var onDragEnd = this.getProps().onDragEnd; + onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(event, info); + }; + VisualElementDragControls.prototype.cancel = function () { + var _a, _b; + this.isDragging = false; + if (this.visualElement.projection) { + this.visualElement.projection.isAnimationBlocked = false; } - } - return result; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/identityFunc.mjs": -/*!**************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/identityFunc.mjs ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.identityFunc = identityFunc; -/** - * Returns the first argument it receives. - */ -function identityFunc(x) { - return x; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/inspect.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/inspect.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.inspect = inspect; -const MAX_ARRAY_LENGTH = 10; -const MAX_RECURSIVE_DEPTH = 2; -/** - * Used to print values in error messages. - */ - -function inspect(value) { - return formatValue(value, []); -} -function formatValue(value, seenValues) { - switch (typeof value) { - case 'string': - return JSON.stringify(value); - case 'function': - return value.name ? `[function ${value.name}]` : '[function]'; - case 'object': - return formatObjectValue(value, seenValues); - default: - return String(value); - } -} -function formatObjectValue(value, previouslySeenValues) { - if (value === null) { - return 'null'; - } - if (previouslySeenValues.includes(value)) { - return '[Circular]'; - } - const seenValues = [...previouslySeenValues, value]; - if (isJSONable(value)) { - const jsonValue = value.toJSON(); // check for infinite recursion - - if (jsonValue !== value) { - return typeof jsonValue === 'string' ? jsonValue : formatValue(jsonValue, seenValues); + (_a = this.panSession) === null || _a === void 0 ? void 0 : _a.end(); + this.panSession = undefined; + var dragPropagation = this.getProps().dragPropagation; + if (!dragPropagation && this.openGlobalLock) { + this.openGlobalLock(); + this.openGlobalLock = null; } - } else if (Array.isArray(value)) { - return formatArray(value, seenValues); - } - return formatObject(value, seenValues); -} -function isJSONable(value) { - return typeof value.toJSON === 'function'; -} -function formatObject(object, seenValues) { - const entries = Object.entries(object); - if (entries.length === 0) { - return '{}'; - } - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[' + getObjectTag(object) + ']'; - } - const properties = entries.map(([key, value]) => key + ': ' + formatValue(value, seenValues)); - return '{ ' + properties.join(', ') + ' }'; -} -function formatArray(array, seenValues) { - if (array.length === 0) { - return '[]'; - } - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[Array]'; - } - const len = Math.min(MAX_ARRAY_LENGTH, array.length); - const remaining = array.length - len; - const items = []; - for (let i = 0; i < len; ++i) { - items.push(formatValue(array[i], seenValues)); - } - if (remaining === 1) { - items.push('... 1 more item'); - } else if (remaining > 1) { - items.push(`... ${remaining} more items`); - } - return '[' + items.join(', ') + ']'; -} -function getObjectTag(object) { - const tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, ''); - if (tag === 'Object' && typeof object.constructor === 'function') { - const name = object.constructor.name; - if (typeof name === 'string' && name !== '') { - return name; + (_b = this.visualElement.animationState) === null || _b === void 0 ? void 0 : _b.setActive(exports.AnimationType.Drag, false); + }; + VisualElementDragControls.prototype.updateAxis = function (axis, _point, offset) { + var drag = this.getProps().drag; + // If we're not dragging this axis, do an early return. + if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return; + var axisValue = this.getAxisMotionValue(axis); + var next = this.originPoint[axis] + offset[axis]; + // Apply constraints + if (this.constraints && this.constraints[axis]) { + next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); } - } - return tag; + axisValue.set(next); + }; + VisualElementDragControls.prototype.resolveConstraints = function () { + var _this = this; + var _a = this.getProps(), + dragConstraints = _a.dragConstraints, + dragElastic = _a.dragElastic; + var layout = (this.visualElement.projection || {}).layout; + var prevConstraints = this.constraints; + if (dragConstraints && isRefObject(dragConstraints)) { + if (!this.constraints) { + this.constraints = this.resolveRefConstraints(); + } + } else { + if (dragConstraints && layout) { + this.constraints = calcRelativeConstraints(layout.actual, dragConstraints); + } else { + this.constraints = false; + } + } + this.elastic = resolveDragElastic(dragElastic); + /** + * If we're outputting to external MotionValues, we want to rebase the measured constraints + * from viewport-relative to component-relative. + */ + if (prevConstraints !== this.constraints && layout && this.constraints && !this.hasMutatedConstraints) { + eachAxis(function (axis) { + if (_this.getAxisMotionValue(axis)) { + _this.constraints[axis] = rebaseAxisConstraints(layout.actual[axis], _this.constraints[axis]); + } + }); + } + }; + VisualElementDragControls.prototype.resolveRefConstraints = function () { + var _a = this.getProps(), + constraints = _a.dragConstraints, + onMeasureDragConstraints = _a.onMeasureDragConstraints; + if (!constraints || !isRefObject(constraints)) return false; + var constraintsElement = constraints.current; + heyListen.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."); + var projection = this.visualElement.projection; + // TODO + if (!projection || !projection.layout) return false; + var constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); + var measuredConstraints = calcViewportConstraints(projection.layout.actual, constraintsBox); + /** + * If there's an onMeasureDragConstraints listener we call it and + * if different constraints are returned, set constraints to that + */ + if (onMeasureDragConstraints) { + var userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); + this.hasMutatedConstraints = !!userConstraints; + if (userConstraints) { + measuredConstraints = convertBoundingBoxToBox(userConstraints); + } + } + return measuredConstraints; + }; + VisualElementDragControls.prototype.startAnimation = function (velocity) { + var _this = this; + var _a = this.getProps(), + drag = _a.drag, + dragMomentum = _a.dragMomentum, + dragElastic = _a.dragElastic, + dragTransition = _a.dragTransition, + dragSnapToOrigin = _a.dragSnapToOrigin, + onDragTransitionEnd = _a.onDragTransitionEnd; + var constraints = this.constraints || {}; + var momentumAnimations = eachAxis(function (axis) { + var _a; + if (!shouldDrag(axis, drag, _this.currentDirection)) { + return; + } + var transition = (_a = constraints === null || constraints === void 0 ? void 0 : constraints[axis]) !== null && _a !== void 0 ? _a : {}; + if (dragSnapToOrigin) transition = { + min: 0, + max: 0 + }; + /** + * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame + * of spring animations so we should look into adding a disable spring option to `inertia`. + * We could do something here where we affect the `bounceStiffness` and `bounceDamping` + * using the value of `dragElastic`. + */ + var bounceStiffness = dragElastic ? 200 : 1000000; + var bounceDamping = dragElastic ? 40 : 10000000; + var inertia = tslib.__assign(tslib.__assign({ + type: "inertia", + velocity: dragMomentum ? velocity[axis] : 0, + bounceStiffness: bounceStiffness, + bounceDamping: bounceDamping, + timeConstant: 750, + restDelta: 1, + restSpeed: 10 + }, dragTransition), transition); + // If we're not animating on an externally-provided `MotionValue` we can use the + // component's animation controls which will handle interactions with whileHover (etc), + // otherwise we just have to animate the `MotionValue` itself. + return _this.startAxisValueAnimation(axis, inertia); + }); + // Run all animations and then resolve the new drag constraints. + return Promise.all(momentumAnimations).then(onDragTransitionEnd); + }; + VisualElementDragControls.prototype.startAxisValueAnimation = function (axis, transition) { + var axisValue = this.getAxisMotionValue(axis); + return startAnimation(axis, axisValue, 0, transition); + }; + VisualElementDragControls.prototype.stopAnimation = function () { + var _this = this; + eachAxis(function (axis) { + return _this.getAxisMotionValue(axis).stop(); + }); + }; + /** + * Drag works differently depending on which props are provided. + * + * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. + * - Otherwise, we apply the delta to the x/y motion values. + */ + VisualElementDragControls.prototype.getAxisMotionValue = function (axis) { + var _a, _b; + var dragKey = "_drag" + axis.toUpperCase(); + var externalMotionValue = this.visualElement.getProps()[dragKey]; + return externalMotionValue ? externalMotionValue : this.visualElement.getValue(axis, (_b = (_a = this.visualElement.getProps().initial) === null || _a === void 0 ? void 0 : _a[axis]) !== null && _b !== void 0 ? _b : 0); + }; + VisualElementDragControls.prototype.snapToCursor = function (point) { + var _this = this; + eachAxis(function (axis) { + var drag = _this.getProps().drag; + // If we're not dragging this axis, do an early return. + if (!shouldDrag(axis, drag, _this.currentDirection)) return; + var projection = _this.visualElement.projection; + var axisValue = _this.getAxisMotionValue(axis); + if (projection && projection.layout) { + var _a = projection.layout.actual[axis], + min = _a.min, + max = _a.max; + axisValue.set(point[axis] - popmotion.mix(min, max, 0.5)); + } + }); + }; + /** + * When the viewport resizes we want to check if the measured constraints + * have changed and, if so, reposition the element within those new constraints + * relative to where it was before the resize. + */ + VisualElementDragControls.prototype.scalePositionWithinConstraints = function () { + var _this = this; + var _a; + var _b = this.getProps(), + drag = _b.drag, + dragConstraints = _b.dragConstraints; + var projection = this.visualElement.projection; + if (!isRefObject(dragConstraints) || !projection || !this.constraints) return; + /** + * Stop current animations as there can be visual glitching if we try to do + * this mid-animation + */ + this.stopAnimation(); + /** + * Record the relative position of the dragged element relative to the + * constraints box and save as a progress value. + */ + var boxProgress = { + x: 0, + y: 0 + }; + eachAxis(function (axis) { + var axisValue = _this.getAxisMotionValue(axis); + if (axisValue) { + var latest = axisValue.get(); + boxProgress[axis] = calcOrigin({ + min: latest, + max: latest + }, _this.constraints[axis]); + } + }); + /** + * Update the layout of this element and resolve the latest drag constraints + */ + var transformTemplate = this.visualElement.getProps().transformTemplate; + this.visualElement.getInstance().style.transform = transformTemplate ? transformTemplate({}, "") : "none"; + (_a = projection.root) === null || _a === void 0 ? void 0 : _a.updateScroll(); + projection.updateLayout(); + this.resolveConstraints(); + /** + * For each axis, calculate the current progress of the layout axis + * within the new constraints. + */ + eachAxis(function (axis) { + if (!shouldDrag(axis, drag, null)) return; + /** + * Calculate a new transform based on the previous box progress + */ + var axisValue = _this.getAxisMotionValue(axis); + var _a = _this.constraints[axis], + min = _a.min, + max = _a.max; + axisValue.set(popmotion.mix(min, max, boxProgress[axis])); + }); + }; + VisualElementDragControls.prototype.addListeners = function () { + var _this = this; + var _a; + elementDragControls.set(this.visualElement, this); + var element = this.visualElement.getInstance(); + /** + * Attach a pointerdown event listener on this DOM element to initiate drag tracking. + */ + var stopPointerListener = addPointerEvent(element, "pointerdown", function (event) { + var _a = _this.getProps(), + drag = _a.drag, + _b = _a.dragListener, + dragListener = _b === void 0 ? true : _b; + drag && dragListener && _this.start(event); + }); + var measureDragConstraints = function () { + var dragConstraints = _this.getProps().dragConstraints; + if (isRefObject(dragConstraints)) { + _this.constraints = _this.resolveRefConstraints(); + } + }; + var projection = this.visualElement.projection; + var stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); + if (projection && !projection.layout) { + (_a = projection.root) === null || _a === void 0 ? void 0 : _a.updateScroll(); + projection.updateLayout(); + } + measureDragConstraints(); + /** + * Attach a window resize listener to scale the draggable target within its defined + * constraints as the window resizes. + */ + var stopResizeListener = addDomEvent(window, "resize", function () { + return _this.scalePositionWithinConstraints(); + }); + /** + * If the element's layout changes, calculate the delta and apply that to + * the drag gesture's origin point. + */ + projection.addEventListener("didUpdate", function (_a) { + var delta = _a.delta, + hasLayoutChanged = _a.hasLayoutChanged; + if (_this.isDragging && hasLayoutChanged) { + eachAxis(function (axis) { + var motionValue = _this.getAxisMotionValue(axis); + if (!motionValue) return; + _this.originPoint[axis] += delta[axis].translate; + motionValue.set(motionValue.get() + delta[axis].translate); + }); + _this.visualElement.syncRender(); + } + }); + return function () { + stopResizeListener(); + stopPointerListener(); + stopMeasureLayoutListener(); + }; + }; + VisualElementDragControls.prototype.getProps = function () { + var props = this.visualElement.getProps(); + var _a = props.drag, + drag = _a === void 0 ? false : _a, + _b = props.dragDirectionLock, + dragDirectionLock = _b === void 0 ? false : _b, + _c = props.dragPropagation, + dragPropagation = _c === void 0 ? false : _c, + _d = props.dragConstraints, + dragConstraints = _d === void 0 ? false : _d, + _e = props.dragElastic, + dragElastic = _e === void 0 ? defaultElastic : _e, + _f = props.dragMomentum, + dragMomentum = _f === void 0 ? true : _f; + return tslib.__assign(tslib.__assign({}, props), { + drag: drag, + dragDirectionLock: dragDirectionLock, + dragPropagation: dragPropagation, + dragConstraints: dragConstraints, + dragElastic: dragElastic, + dragMomentum: dragMomentum + }); + }; + return VisualElementDragControls; +}(); +function shouldDrag(direction, drag, currentDirection) { + return (drag === true || drag === direction) && (currentDirection === null || currentDirection === direction); } - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/instanceOf.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/instanceOf.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.instanceOf = void 0; -var _inspect = __webpack_require__(/*! ./inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* c8 ignore next 3 */ - -const isProduction = globalThis.process && -// eslint-disable-next-line no-undef -"development" === 'production'; /** - * A replacement for instanceof which includes an error warning when multi-realm - * constructors are detected. - * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production - * See: https://webpack.js.org/guides/production/ + * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower + * than the provided threshold, return `null`. + * + * @param offset - The x/y offset from origin. + * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. */ - -const instanceOf = exports.instanceOf = /* c8 ignore next 6 */ -// FIXME: https://github.com/graphql/graphql-js/issues/2317 -isProduction ? function instanceOf(value, constructor) { - return value instanceof constructor; -} : function instanceOf(value, constructor) { - if (value instanceof constructor) { - return true; - } - if (typeof value === 'object' && value !== null) { - var _value$constructor; - - // Prefer Symbol.toStringTag since it is immune to minification. - const className = constructor.prototype[Symbol.toStringTag]; - const valueClassName = - // We still need to support constructor's name to detect conflicts with older versions of this library. - Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009 - ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name; - if (className === valueClassName) { - const stringifiedValue = (0, _inspect.inspect)(value); - throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm. - -Ensure that there is only one instance of "graphql" in the node_modules -directory. If different versions of "graphql" are the dependencies of other -relied on modules, use "resolutions" to ensure only one version is installed. - -https://yarnpkg.com/en/docs/selective-version-resolutions - -Duplicate "graphql" modules cannot be used at the same time since different -versions may have different capabilities and behavior. The data from one -version used in the function from another could produce confusing and -spurious results.`); - } +function getCurrentDirection(offset, lockThreshold) { + if (lockThreshold === void 0) { + lockThreshold = 10; } - return false; -}; - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/invariant.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/invariant.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.invariant = invariant; -function invariant(condition, message) { - const booleanCondition = Boolean(condition); - if (!booleanCondition) { - throw new Error(message != null ? message : 'Unexpected invariant triggered.'); + var direction = null; + if (Math.abs(offset.y) > lockThreshold) { + direction = "y"; + } else if (Math.abs(offset.x) > lockThreshold) { + direction = "x"; } + return direction; } -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/isAsyncIterable.mjs": -/*!*****************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/isAsyncIterable.mjs ***! - \*****************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isAsyncIterable = isAsyncIterable; /** - * Returns true if the provided object implements the AsyncIterator protocol via - * implementing a `Symbol.asyncIterator` method. + * A hook that allows an element to be dragged. + * + * @internal */ -function isAsyncIterable(maybeAsyncIterable) { - return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[Symbol.asyncIterator]) === 'function'; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/isIterableObject.mjs": -/*!******************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/isIterableObject.mjs ***! - \******************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isIterableObject = isIterableObject; -/** - * Returns true if the provided object is an Object (i.e. not a string literal) - * and implements the Iterator protocol. - * - * This may be used in place of [Array.isArray()][isArray] to determine if - * an object should be iterated-over e.g. Array, Map, Set, Int8Array, - * TypedArray, etc. but excludes string literals. - * - * @example - * ```ts - * isIterableObject([ 1, 2, 3 ]) // true - * isIterableObject(new Map()) // true - * isIterableObject('ABC') // false - * isIterableObject({ key: 'value' }) // false - * isIterableObject({ length: 1, 0: 'Alpha' }) // false - * ``` - */ -function isIterableObject(maybeIterable) { - return typeof maybeIterable === 'object' && typeof (maybeIterable === null || maybeIterable === void 0 ? void 0 : maybeIterable[Symbol.iterator]) === 'function'; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/isObjectLike.mjs": -/*!**************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/isObjectLike.mjs ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isObjectLike = isObjectLike; -/** - * Return true if `value` is object-like. A value is object-like if it's not - * `null` and has a `typeof` result of "object". - */ -function isObjectLike(value) { - return typeof value == 'object' && value !== null; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/isPromise.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/isPromise.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isPromise = isPromise; -/** - * Returns true if the value acts like a Promise, i.e. has a "then" function, - * otherwise returns false. - */ -function isPromise(value) { - return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function'; +function useDrag(props) { + var groupDragControls = props.dragControls, + visualElement = props.visualElement; + var dragControls = useConstant(function () { + return new VisualElementDragControls(visualElement); + }); + // If we've been provided a DragControls for manual control over the drag gesture, + // subscribe this component to it on mount. + React.useEffect(function () { + return groupDragControls && groupDragControls.subscribe(dragControls); + }, [dragControls, groupDragControls]); + // Apply the event listeners to the element + React.useEffect(function () { + return dragControls.addListeners(); + }, [dragControls]); } -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/keyMap.mjs": -/*!********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/keyMap.mjs ***! - \********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.keyMap = keyMap; /** - * Creates a keyed JS object from an array, given a function to produce the keys - * for each value in the array. - * - * This provides a convenient lookup for the array items if the key function - * produces unique results. - * ```ts - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] - * - * const entriesByName = keyMap( - * phoneBook, - * entry => entry.name - * ) - * - * // { - * // Jon: { name: 'Jon', num: '555-1234' }, - * // Jenny: { name: 'Jenny', num: '867-5309' } - * // } * - * const jennyEntry = entriesByName['Jenny'] + * @param handlers - + * @param ref - * - * // { name: 'Jenny', num: '857-6309' } - * ``` - */ -function keyMap(list, keyFn) { - const result = Object.create(null); - for (const item of list) { - result[keyFn(item)] = item; - } - return result; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/keyValMap.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/keyValMap.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.keyValMap = keyValMap; -/** - * Creates a keyed JS object from an array, given a function to produce the keys - * and a function to produce the values from each item in the array. - * ```ts - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] + * @privateRemarks + * Currently this sets new pan gesture functions every render. The memo route has been explored + * in the past but ultimately we're still creating new functions every render. An optimisation + * to explore is creating the pan gestures and loading them into a `ref`. * - * // { Jon: '555-1234', Jenny: '867-5309' } - * const phonesByName = keyValMap( - * phoneBook, - * entry => entry.name, - * entry => entry.num - * ) - * ``` - */ -function keyValMap(list, keyFn, valFn) { - const result = Object.create(null); - for (const item of list) { - result[keyFn(item)] = valFn(item); - } - return result; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/mapValue.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/mapValue.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.mapValue = mapValue; -/** - * Creates an object map with the same keys as `map` and values generated by - * running each value of `map` thru `fn`. - */ -function mapValue(map, fn) { - const result = Object.create(null); - for (const key of Object.keys(map)) { - result[key] = fn(map[key], key); - } - return result; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/memoize3.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/memoize3.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.memoize3 = memoize3; -/** - * Memoizes the provided three-argument function. + * @internal */ -function memoize3(fn) { - let cache0; - return function memoized(a1, a2, a3) { - if (cache0 === undefined) { - cache0 = new WeakMap(); - } - let cache1 = cache0.get(a1); - if (cache1 === undefined) { - cache1 = new WeakMap(); - cache0.set(a1, cache1); +function usePanGesture(_a) { + var onPan = _a.onPan, + onPanStart = _a.onPanStart, + onPanEnd = _a.onPanEnd, + onPanSessionStart = _a.onPanSessionStart, + visualElement = _a.visualElement; + var hasPanEvents = onPan || onPanStart || onPanEnd || onPanSessionStart; + var panSession = React.useRef(null); + var transformPagePoint = React.useContext(MotionConfigContext).transformPagePoint; + var handlers = { + onSessionStart: onPanSessionStart, + onStart: onPanStart, + onMove: onPan, + onEnd: function (event, info) { + panSession.current = null; + onPanEnd && onPanEnd(event, info); } - let cache2 = cache1.get(a2); - if (cache2 === undefined) { - cache2 = new WeakMap(); - cache1.set(a2, cache2); + }; + React.useEffect(function () { + if (panSession.current !== null) { + panSession.current.updateHandlers(handlers); } - let fnResult = cache2.get(a3); - if (fnResult === undefined) { - fnResult = fn(a1, a2, a3); - cache2.set(a3, fnResult); + }); + function onPointerDown(event) { + panSession.current = new PanSession(event, handlers, { + transformPagePoint: transformPagePoint + }); + } + usePointerEvent(visualElement, "pointerdown", hasPanEvents && onPointerDown); + useUnmountEffect(function () { + return panSession.current && panSession.current.end(); + }); +} +var drag = { + pan: makeRenderlessComponent(usePanGesture), + drag: makeRenderlessComponent(useDrag) +}; +var names = ["LayoutMeasure", "BeforeLayoutMeasure", "LayoutUpdate", "ViewportBoxUpdate", "Update", "Render", "AnimationComplete", "LayoutAnimationComplete", "AnimationStart", "LayoutAnimationStart", "SetAxisTarget", "Unmount"]; +function createLifecycles() { + var managers = names.map(function () { + return new SubscriptionManager(); + }); + var propSubscriptions = {}; + var lifecycles = { + clearAllListeners: function () { + return managers.forEach(function (manager) { + return manager.clear(); + }); + }, + updatePropListeners: function (props) { + names.forEach(function (name) { + var _a; + var on = "on" + name; + var propListener = props[on]; + // Unsubscribe existing subscription + (_a = propSubscriptions[name]) === null || _a === void 0 ? void 0 : _a.call(propSubscriptions); + // Add new subscription + if (propListener) { + propSubscriptions[name] = lifecycles[on](propListener); + } + }); } - return fnResult; }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/naturalCompare.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/naturalCompare.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.naturalCompare = naturalCompare; -/** - * Returns a number indicating whether a reference string comes before, or after, - * or is the same as the given string in natural sort order. - * - * See: https://en.wikipedia.org/wiki/Natural_sort_order - * - */ -function naturalCompare(aStr, bStr) { - let aIndex = 0; - let bIndex = 0; - while (aIndex < aStr.length && bIndex < bStr.length) { - let aChar = aStr.charCodeAt(aIndex); - let bChar = bStr.charCodeAt(bIndex); - if (isDigit(aChar) && isDigit(bChar)) { - let aNum = 0; - do { - ++aIndex; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIndex); - } while (isDigit(aChar) && aNum > 0); - let bNum = 0; - do { - ++bIndex; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIndex); - } while (isDigit(bChar) && bNum > 0); - if (aNum < bNum) { - return -1; - } - if (aNum > bNum) { - return 1; + managers.forEach(function (manager, i) { + lifecycles["on" + names[i]] = function (handler) { + return manager.add(handler); + }; + lifecycles["notify" + names[i]] = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; } - } else { - if (aChar < bChar) { - return -1; + return manager.notify.apply(manager, tslib.__spreadArray([], tslib.__read(args), false)); + }; + }); + return lifecycles; +} +function updateMotionValuesFromProps(element, next, prev) { + var _a; + for (var key in next) { + var nextValue = next[key]; + var prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + /** + * Check the version of the incoming motion value with this version + * and warn against mismatches. + */ + if (true) { + warnOnce(nextValue.version === "6.5.1", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.5.1 may not work as expected.")); } - if (aChar > bChar) { - return 1; + } else if (isMotionValue(prevValue)) { + /** + * If we're swapping to a new motion value, create a new motion value + * from that + */ + element.addValue(key, motionValue(nextValue)); + } else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + var existingValue = element.getValue(key); + // TODO: Only update values that aren't being animated or even looked at + !existingValue.hasAnimated && existingValue.set(nextValue); + } else { + element.addValue(key, motionValue((_a = element.getStaticValue(key)) !== null && _a !== void 0 ? _a : nextValue)); } - ++aIndex; - ++bIndex; } } - return aStr.length - bStr.length; -} -const DIGIT_0 = 48; -const DIGIT_9 = 57; -function isDigit(code) { - return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/printPathArray.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/printPathArray.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.printPathArray = printPathArray; -/** - * Build a string describing the path. - */ -function printPathArray(path) { - return path.map(key => typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key).join(''); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/promiseForObject.mjs": -/*!******************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/promiseForObject.mjs ***! - \******************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.promiseForObject = promiseForObject; -/** - * This function transforms a JS object `ObjMap>` into - * a `Promise>` - * - * This is akin to bluebird's `Promise.props`, but implemented only using - * `Promise.all` so it will work with any implementation of ES6 promises. - */ -function promiseForObject(object) { - return Promise.all(Object.values(object)).then(resolvedValues => { - const resolvedObject = Object.create(null); - for (const [i, key] of Object.keys(object).entries()) { - resolvedObject[key] = resolvedValues[i]; - } - return resolvedObject; - }); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/promiseReduce.mjs": -/*!***************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/promiseReduce.mjs ***! - \***************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.promiseReduce = promiseReduce; -var _isPromise = __webpack_require__(/*! ./isPromise.mjs */ "../../../node_modules/graphql/jsutils/isPromise.mjs"); -/** - * Similar to Array.prototype.reduce(), however the reducing callback may return - * a Promise, in which case reduction will continue after each promise resolves. - * - * If the callback does not return a Promise, then this function will also not - * return a Promise. - */ -function promiseReduce(values, callbackFn, initialValue) { - let accumulator = initialValue; - for (const value of values) { - accumulator = (0, _isPromise.isPromise)(accumulator) ? accumulator.then(resolved => callbackFn(resolved, value)) : callbackFn(accumulator, value); + // Handle removed values + for (var key in prev) { + if (next[key] === undefined) element.removeValue(key); } - return accumulator; + return next; } - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/suggestionList.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/suggestionList.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.suggestionList = suggestionList; -var _naturalCompare = __webpack_require__(/*! ./naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); -/** - * Given an invalid input string and a list of valid options, returns a filtered - * list of valid options sorted based on their similarity with the input. - */ - -function suggestionList(input, options) { - const optionsByDistance = Object.create(null); - const lexicalDistance = new LexicalDistance(input); - const threshold = Math.floor(input.length * 0.4) + 1; - for (const option of options) { - const distance = lexicalDistance.measure(option, threshold); - if (distance !== undefined) { - optionsByDistance[option] = distance; +var visualElement = function (_a) { + var _b = _a.treeType, + treeType = _b === void 0 ? "" : _b, + build = _a.build, + getBaseTarget = _a.getBaseTarget, + makeTargetAnimatable = _a.makeTargetAnimatable, + measureViewportBox = _a.measureViewportBox, + renderInstance = _a.render, + readValueFromInstance = _a.readValueFromInstance, + removeValueFromRenderState = _a.removeValueFromRenderState, + sortNodePosition = _a.sortNodePosition, + scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps; + return function (_a, options) { + var parent = _a.parent, + props = _a.props, + presenceId = _a.presenceId, + blockInitialAnimation = _a.blockInitialAnimation, + visualState = _a.visualState, + shouldReduceMotion = _a.shouldReduceMotion; + if (options === void 0) { + options = {}; } - } - return Object.keys(optionsByDistance).sort((a, b) => { - const distanceDiff = optionsByDistance[a] - optionsByDistance[b]; - return distanceDiff !== 0 ? distanceDiff : (0, _naturalCompare.naturalCompare)(a, b); - }); -} -/** - * Computes the lexical distance between strings A and B. - * - * The "distance" between two strings is given by counting the minimum number - * of edits needed to transform string A into string B. An edit can be an - * insertion, deletion, or substitution of a single character, or a swap of two - * adjacent characters. - * - * Includes a custom alteration from Damerau-Levenshtein to treat case changes - * as a single edit which helps identify mis-cased values with an edit distance - * of 1. - * - * This distance can be useful for detecting typos in input or sorting - */ - -class LexicalDistance { - constructor(input) { - this._input = input; - this._inputLowerCase = input.toLowerCase(); - this._inputArray = stringToArray(this._inputLowerCase); - this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)]; - } - measure(option, threshold) { - if (this._input === option) { - return 0; + var isMounted = false; + var latestValues = visualState.latestValues, + renderState = visualState.renderState; + /** + * The instance of the render-specific node that will be hydrated by the + * exposed React ref. So for example, this visual element can host a + * HTMLElement, plain object, or Three.js object. The functions provided + * in VisualElementConfig allow us to interface with this instance. + */ + var instance; + /** + * Manages the subscriptions for a visual element's lifecycle, for instance + * onRender + */ + var lifecycles = createLifecycles(); + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + var values = new Map(); + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + var valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + var prevMotionValues = {}; + /** + * When values are removed from all animation props we need to search + * for a fallback value to animate to. These values are tracked in baseTarget. + */ + var baseTarget = tslib.__assign({}, latestValues); + // Internal methods ======================== + /** + * On mount, this will be hydrated with a callback to disconnect + * this visual element from its parent on unmount. + */ + var removeFromVariantTree; + /** + * Render the element with the latest styles outside of the React + * render lifecycle + */ + function render() { + if (!instance || !isMounted) return; + triggerBuild(); + renderInstance(instance, renderState, props.style, element.projection); } - const optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit - - if (this._inputLowerCase === optionLowerCase) { - return 1; + function triggerBuild() { + build(element, renderState, latestValues, options, props); } - let a = stringToArray(optionLowerCase); - let b = this._inputArray; - if (a.length < b.length) { - const tmp = a; - a = b; - b = tmp; + function update() { + lifecycles.notifyUpdate(latestValues); } - const aLength = a.length; - const bLength = b.length; - if (aLength - bLength > threshold) { - return undefined; + /** + * + */ + function bindToMotionValue(key, value) { + var removeOnChange = value.onChange(function (latestValue) { + latestValues[key] = latestValue; + props.onUpdate && sync__default["default"].update(update, false, true); + }); + var removeOnRenderRequest = value.onRenderRequest(element.scheduleRender); + valueSubscriptions.set(key, function () { + removeOnChange(); + removeOnRenderRequest(); + }); } - const rows = this._rows; - for (let j = 0; j <= bLength; j++) { - rows[0][j] = j; + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't neccessarily a breaking change, + * more a reflection of the test. + */ + var initialMotionValues = scrapeMotionValuesFromProps(props); + for (var key in initialMotionValues) { + var value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key], false); + } } - for (let i = 1; i <= aLength; i++) { - const upRow = rows[(i - 1) % 3]; - const currentRow = rows[i % 3]; - let smallestCell = currentRow[0] = i; - for (let j = 1; j <= bLength; j++) { - const cost = a[i - 1] === b[j - 1] ? 0 : 1; - let currentCell = Math.min(upRow[j] + 1, - // delete - currentRow[j - 1] + 1, - // insert - upRow[j - 1] + cost // substitute - ); - if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { - // transposition - const doubleDiagonalCell = rows[(i - 2) % 3][j - 2]; - currentCell = Math.min(currentCell, doubleDiagonalCell + 1); + /** + * Determine what role this visual element should take in the variant tree. + */ + var isControllingVariants = checkIfControllingVariants(props); + var isVariantNode = checkIfVariantNode(props); + var element = tslib.__assign(tslib.__assign({ + treeType: treeType, + /** + * This is a mirror of the internal instance prop, which keeps + * VisualElement type-compatible with React's RefObject. + */ + current: null, + /** + * The depth of this visual element within the visual element tree. + */ + depth: parent ? parent.depth + 1 : 0, + parent: parent, + children: new Set(), + /** + * + */ + presenceId: presenceId, + shouldReduceMotion: shouldReduceMotion, + /** + * If this component is part of the variant tree, it should track + * any children that are also part of the tree. This is essentially + * a shadow tree to simplify logic around how to stagger over children. + */ + variantChildren: isVariantNode ? new Set() : undefined, + /** + * Whether this instance is visible. This can be changed imperatively + * by the projection tree, is analogous to CSS's visibility in that + * hidden elements should take up layout, and needs enacting by the configured + * render function. + */ + isVisible: undefined, + /** + * Normally, if a component is controlled by a parent's variants, it can + * rely on that ancestor to trigger animations further down the tree. + * However, if a component is created after its parent is mounted, the parent + * won't trigger that mount animation so the child needs to. + * + * TODO: This might be better replaced with a method isParentMounted + */ + manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()), + /** + * This can be set by AnimatePresence to force components that mount + * at the same time as it to mount as if they have initial={false} set. + */ + blockInitialAnimation: blockInitialAnimation, + /** + * Determine whether this component has mounted yet. This is mostly used + * by variant children to determine whether they need to trigger their + * own animations on mount. + */ + isMounted: function () { + return Boolean(instance); + }, + mount: function (newInstance) { + isMounted = true; + instance = element.current = newInstance; + if (element.projection) { + element.projection.mount(newInstance); } - if (currentCell < smallestCell) { - smallestCell = currentCell; + if (isVariantNode && parent && !isControllingVariants) { + removeFromVariantTree = parent === null || parent === void 0 ? void 0 : parent.addVariantChild(element); } - currentRow[j] = currentCell; - } // Early exit, since distance can't go smaller than smallest element of the previous row. - - if (smallestCell > threshold) { - return undefined; + values.forEach(function (value, key) { + return bindToMotionValue(key, value); + }); + parent === null || parent === void 0 ? void 0 : parent.children.add(element); + element.setProps(props); + }, + /** + * + */ + unmount: function () { + var _a; + (_a = element.projection) === null || _a === void 0 ? void 0 : _a.unmount(); + sync.cancelSync.update(update); + sync.cancelSync.render(render); + valueSubscriptions.forEach(function (remove) { + return remove(); + }); + removeFromVariantTree === null || removeFromVariantTree === void 0 ? void 0 : removeFromVariantTree(); + parent === null || parent === void 0 ? void 0 : parent.children.delete(element); + lifecycles.clearAllListeners(); + instance = undefined; + isMounted = false; + }, + /** + * Add a child visual element to our set of children. + */ + addVariantChild: function (child) { + var _a; + var closestVariantNode = element.getClosestVariantNode(); + if (closestVariantNode) { + (_a = closestVariantNode.variantChildren) === null || _a === void 0 ? void 0 : _a.add(child); + return function () { + return closestVariantNode.variantChildren.delete(child); + }; + } + }, + sortNodePosition: function (other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!sortNodePosition || treeType !== other.treeType) return 0; + return sortNodePosition(element.getInstance(), other.getInstance()); + }, + /** + * Returns the closest variant node in the tree starting from + * this visual element. + */ + getClosestVariantNode: function () { + return isVariantNode ? element : parent === null || parent === void 0 ? void 0 : parent.getClosestVariantNode(); + }, + /** + * Expose the latest layoutId prop. + */ + getLayoutId: function () { + return props.layoutId; + }, + /** + * Returns the current instance. + */ + getInstance: function () { + return instance; + }, + /** + * Get/set the latest static values. + */ + getStaticValue: function (key) { + return latestValues[key]; + }, + setStaticValue: function (key, value) { + return latestValues[key] = value; + }, + /** + * Returns the latest motion value state. Currently only used to take + * a snapshot of the visual element - perhaps this can return the whole + * visual state + */ + getLatestValues: function () { + return latestValues; + }, + /** + * Set the visiblity of the visual element. If it's changed, schedule + * a render to reflect these changes. + */ + setVisibility: function (visibility) { + if (element.isVisible === visibility) return; + element.isVisible = visibility; + element.scheduleRender(); + }, + /** + * Make a target animatable by Popmotion. For instance, if we're + * trying to animate width from 100px to 100vw we need to measure 100vw + * in pixels to determine what we really need to animate to. This is also + * pluggable to support Framer's custom value types like Color, + * and CSS variables. + */ + makeTargetAnimatable: function (target, canMutate) { + if (canMutate === void 0) { + canMutate = true; + } + return makeTargetAnimatable(element, target, props, canMutate); + }, + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox: function () { + return measureViewportBox(instance, props); + }, + // Motion values ======================== + /** + * Add a motion value and bind it to this visual element. + */ + addValue: function (key, value) { + // Remove existing value if it exists + if (element.hasValue(key)) element.removeValue(key); + values.set(key, value); + latestValues[key] = value.get(); + bindToMotionValue(key, value); + }, + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue: function (key) { + var _a; + values.delete(key); + (_a = valueSubscriptions.get(key)) === null || _a === void 0 ? void 0 : _a(); + valueSubscriptions.delete(key); + delete latestValues[key]; + removeValueFromRenderState(key, renderState); + }, + /** + * Check whether we have a motion value for this key + */ + hasValue: function (key) { + return values.has(key); + }, + /** + * Get a motion value for this key. If called with a default + * value, we'll create one if none exists. + */ + getValue: function (key, defaultValue) { + var value = values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue); + element.addValue(key, value); + } + return value; + }, + /** + * Iterate over our motion values. + */ + forEachValue: function (callback) { + return values.forEach(callback); + }, + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue: function (key) { + var _a; + return (_a = latestValues[key]) !== null && _a !== void 0 ? _a : readValueFromInstance(instance, key, options); + }, + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget: function (key, value) { + baseTarget[key] = value; + }, + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget: function (key) { + if (getBaseTarget) { + var target = getBaseTarget(props, key); + if (target !== undefined && !isMotionValue(target)) return target; + } + return baseTarget[key]; } - } - const distance = rows[aLength % 3][bLength]; - return distance <= threshold ? distance : undefined; - } -} -function stringToArray(str) { - const strLength = str.length; - const array = new Array(strLength); - for (let i = 0; i < strLength; ++i) { - array[i] = str.charCodeAt(i); - } - return array; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/toError.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/toError.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.toError = toError; -var _inspect = __webpack_require__(/*! ./inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/** - * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. - */ - -function toError(thrownValue) { - return thrownValue instanceof Error ? thrownValue : new NonErrorThrown(thrownValue); -} -class NonErrorThrown extends Error { - constructor(thrownValue) { - super('Unexpected error value: ' + (0, _inspect.inspect)(thrownValue)); - this.name = 'NonErrorThrown'; - this.thrownValue = thrownValue; - } -} - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/toObjMap.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/toObjMap.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.toObjMap = toObjMap; -function toObjMap(obj) { - if (obj == null) { - return Object.create(null); - } - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - const map = Object.create(null); - for (const [key, value] of Object.entries(obj)) { - map[key] = value; - } - return map; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/language/ast.mjs": -/*!******************************************************!*\ - !*** ../../../node_modules/graphql/language/ast.mjs ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.Token = exports.QueryDocumentKeys = exports.OperationTypeNode = exports.Location = void 0; -exports.isNode = isNode; + }, lifecycles), { + /** + * Build the renderer state based on the latest visual state. + */ + build: function () { + triggerBuild(); + return renderState; + }, + /** + * Schedule a render on the next animation frame. + */ + scheduleRender: function () { + sync__default["default"].render(render, false, true); + }, + /** + * Synchronously fire render. It's prefered that we batch renders but + * in many circumstances, like layout measurement, we need to run this + * synchronously. However in those instances other measures should be taken + * to batch reads/writes. + */ + syncRender: render, + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + setProps: function (newProps) { + if (newProps.transformTemplate || props.transformTemplate) { + element.scheduleRender(); + } + props = newProps; + lifecycles.updatePropListeners(newProps); + prevMotionValues = updateMotionValuesFromProps(element, scrapeMotionValuesFromProps(props), prevMotionValues); + }, + getProps: function () { + return props; + }, + // Variants ============================== + /** + * Returns the variant definition with a given name. + */ + getVariant: function (name) { + var _a; + return (_a = props.variants) === null || _a === void 0 ? void 0 : _a[name]; + }, + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition: function () { + return props.transition; + }, + getTransformPagePoint: function () { + return props.transformPagePoint; + }, + /** + * Used by child variant nodes to get the closest ancestor variant props. + */ + getVariantContext: function (startAtParent) { + if (startAtParent === void 0) { + startAtParent = false; + } + if (startAtParent) return parent === null || parent === void 0 ? void 0 : parent.getVariantContext(); + if (!isControllingVariants) { + var context_1 = (parent === null || parent === void 0 ? void 0 : parent.getVariantContext()) || {}; + if (props.initial !== undefined) { + context_1.initial = props.initial; + } + return context_1; + } + var context = {}; + for (var i = 0; i < numVariantProps; i++) { + var name_1 = variantProps[i]; + var prop = props[name_1]; + if (isVariantLabel(prop) || prop === false) { + context[name_1] = prop; + } + } + return context; + } + }); + return element; + }; +}; +var variantProps = tslib.__spreadArray(["initial"], tslib.__read(variantPriorityOrder), false); +var numVariantProps = variantProps.length; +function isCSSVariable(value) { + return typeof value === "string" && value.startsWith("var(--"); +} /** - * Contains a range of UTF-8 character offsets and token references that - * identify the region of the source from which the AST derived. + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current */ -class Location { - /** - * The character offset at which this Node begins. - */ - - /** - * The character offset at which this Node ends. - */ - - /** - * The Token at which this Node begins. - */ - - /** - * The Token at which this Node ends. - */ - - /** - * The Source document the AST represents. - */ - constructor(startToken, endToken, source) { - this.start = startToken.start; - this.end = endToken.end; - this.startToken = startToken; - this.endToken = endToken; - this.source = source; - } - get [Symbol.toStringTag]() { - return 'Location'; +var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/; +function parseCSSVariable(current) { + var match = cssVariableRegex.exec(current); + if (!match) return [,]; + var _a = tslib.__read(match, 3), + token = _a[1], + fallback = _a[2]; + return [token, fallback]; +} +var maxDepth = 4; +function getVariableValue(current, element, depth) { + if (depth === void 0) { + depth = 1; } - toJSON() { - return { - start: this.start, - end: this.end - }; + heyListen.invariant(depth <= maxDepth, "Max CSS variable fallback depth detected in property \"".concat(current, "\". This may indicate a circular fallback dependency.")); + var _a = tslib.__read(parseCSSVariable(current), 2), + token = _a[0], + fallback = _a[1]; + // No CSS variable detected + if (!token) return; + // Attempt to read this CSS variable off the element + var resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + return resolved.trim(); + } else if (isCSSVariable(fallback)) { + // The fallback might itself be a CSS variable, in which case we attempt to resolve it too. + return getVariableValue(fallback, element, depth + 1); + } else { + return fallback; } } /** - * Represents a range of characters represented by a lexical token - * within a Source. + * Resolve CSS variables from + * + * @internal */ -exports.Location = Location; -class Token { - /** - * The kind of Token. - */ - - /** - * The character offset at which this Node begins. - */ - - /** - * The character offset at which this Node ends. - */ - - /** - * The 1-indexed line number on which this Token appears. - */ - - /** - * The 1-indexed column number at which this Token begins. - */ - - /** - * For non-punctuation tokens, represents the interpreted value of the token. - * - * Note: is undefined for punctuation tokens, but typed as string for - * convenience in the parser. - */ - +function resolveCSSVariables(visualElement, _a, transitionEnd) { + var _b; + var target = tslib.__rest(_a, []); + var element = visualElement.getInstance(); + if (!(element instanceof Element)) return { + target: target, + transitionEnd: transitionEnd + }; + // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd` + // only if they change but I think this reads clearer and this isn't a performance-critical path. + if (transitionEnd) { + transitionEnd = tslib.__assign({}, transitionEnd); + } + // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved + visualElement.forEachValue(function (value) { + var current = value.get(); + if (!isCSSVariable(current)) return; + var resolved = getVariableValue(current, element); + if (resolved) value.set(resolved); + }); + // Cycle through every target property and resolve CSS variables. Currently + // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)` + for (var key in target) { + var current = target[key]; + if (!isCSSVariable(current)) continue; + var resolved = getVariableValue(current, element); + if (!resolved) continue; + // Clone target if it hasn't already been + target[key] = resolved; + // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved + // CSS variable. This will ensure that after the animation the component will reflect + // changes in the value of the CSS variable. + if (transitionEnd) (_b = transitionEnd[key]) !== null && _b !== void 0 ? _b : transitionEnd[key] = current; + } + return { + target: target, + transitionEnd: transitionEnd + }; +} +var positionalKeys = new Set(["width", "height", "top", "left", "right", "bottom", "x", "y"]); +var isPositionalKey = function (key) { + return positionalKeys.has(key); +}; +var hasPositionalKey = function (target) { + return Object.keys(target).some(isPositionalKey); +}; +var setAndResetVelocity = function (value, to) { + // Looks odd but setting it twice doesn't render, it'll just + // set both prev and current to the latest value + value.set(to, false); + value.set(to); +}; +var isNumOrPxType = function (v) { + return v === styleValueTypes.number || v === styleValueTypes.px; +}; +var BoundingBoxDimension; +(function (BoundingBoxDimension) { + BoundingBoxDimension["width"] = "width"; + BoundingBoxDimension["height"] = "height"; + BoundingBoxDimension["left"] = "left"; + BoundingBoxDimension["right"] = "right"; + BoundingBoxDimension["top"] = "top"; + BoundingBoxDimension["bottom"] = "bottom"; +})(BoundingBoxDimension || (BoundingBoxDimension = {})); +var getPosFromMatrix = function (matrix, pos) { + return parseFloat(matrix.split(", ")[pos]); +}; +var getTranslateFromMatrix = function (pos2, pos3) { + return function (_bbox, _a) { + var transform = _a.transform; + if (transform === "none" || !transform) return 0; + var matrix3d = transform.match(/^matrix3d\((.+)\)$/); + if (matrix3d) { + return getPosFromMatrix(matrix3d[1], pos3); + } else { + var matrix = transform.match(/^matrix\((.+)\)$/); + if (matrix) { + return getPosFromMatrix(matrix[1], pos2); + } else { + return 0; + } + } + }; +}; +var transformKeys = new Set(["x", "y", "z"]); +var nonTranslationalTransformKeys = transformProps.filter(function (key) { + return !transformKeys.has(key); +}); +function removeNonTranslationalTransform(visualElement) { + var removedTransforms = []; + nonTranslationalTransformKeys.forEach(function (key) { + var value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + // Apply changes to element before measurement + if (removedTransforms.length) visualElement.syncRender(); + return removedTransforms; +} +var positionalValues = { + // Dimensions + width: function (_a, _b) { + var x = _a.x; + var _c = _b.paddingLeft, + paddingLeft = _c === void 0 ? "0" : _c, + _d = _b.paddingRight, + paddingRight = _d === void 0 ? "0" : _d; + return x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight); + }, + height: function (_a, _b) { + var y = _a.y; + var _c = _b.paddingTop, + paddingTop = _c === void 0 ? "0" : _c, + _d = _b.paddingBottom, + paddingBottom = _d === void 0 ? "0" : _d; + return y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom); + }, + top: function (_bbox, _a) { + var top = _a.top; + return parseFloat(top); + }, + left: function (_bbox, _a) { + var left = _a.left; + return parseFloat(left); + }, + bottom: function (_a, _b) { + var y = _a.y; + var top = _b.top; + return parseFloat(top) + (y.max - y.min); + }, + right: function (_a, _b) { + var x = _a.x; + var left = _b.left; + return parseFloat(left) + (x.max - x.min); + }, + // Transform + x: getTranslateFromMatrix(4, 13), + y: getTranslateFromMatrix(5, 14) +}; +var convertChangedValueTypes = function (target, visualElement, changedKeys) { + var originBbox = visualElement.measureViewportBox(); + var element = visualElement.getInstance(); + var elementComputedStyle = getComputedStyle(element); + var display = elementComputedStyle.display; + var origin = {}; + // If the element is currently set to display: "none", make it visible before + // measuring the target bounding box + if (display === "none") { + visualElement.setStaticValue("display", target.display || "block"); + } /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. + * Record origins before we render and update styles */ - constructor(kind, start, end, line, column, value) { - this.kind = kind; - this.start = start; - this.end = end; - this.line = line; - this.column = column; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - - this.value = value; - this.prev = null; - this.next = null; + changedKeys.forEach(function (key) { + origin[key] = positionalValues[key](originBbox, elementComputedStyle); + }); + // Apply the latest values (as set in checkAndConvertChangedValueTypes) + visualElement.syncRender(); + var targetBbox = visualElement.measureViewportBox(); + changedKeys.forEach(function (key) { + // Restore styles to their **calculated computed style**, not their actual + // originally set style. This allows us to animate between equivalent pixel units. + var value = visualElement.getValue(key); + setAndResetVelocity(value, origin[key]); + target[key] = positionalValues[key](targetBbox, elementComputedStyle); + }); + return target; +}; +var checkAndConvertChangedValueTypes = function (visualElement, target, origin, transitionEnd) { + if (origin === void 0) { + origin = {}; } - get [Symbol.toStringTag]() { - return 'Token'; + if (transitionEnd === void 0) { + transitionEnd = {}; } - toJSON() { + target = tslib.__assign({}, target); + transitionEnd = tslib.__assign({}, transitionEnd); + var targetPositionalKeys = Object.keys(target).filter(isPositionalKey); + // We want to remove any transform values that could affect the element's bounding box before + // it's measured. We'll reapply these later. + var removedTransformValues = []; + var hasAttemptedToRemoveTransformValues = false; + var changedValueTypeKeys = []; + targetPositionalKeys.forEach(function (key) { + var value = visualElement.getValue(key); + if (!visualElement.hasValue(key)) return; + var from = origin[key]; + var fromType = findDimensionValueType(from); + var to = target[key]; + var toType; + // TODO: The current implementation of this basically throws an error + // if you try and do value conversion via keyframes. There's probably + // a way of doing this but the performance implications would need greater scrutiny, + // as it'd be doing multiple resize-remeasure operations. + if (isKeyframesTarget(to)) { + var numKeyframes = to.length; + var fromIndex = to[0] === null ? 1 : 0; + from = to[fromIndex]; + fromType = findDimensionValueType(from); + for (var i = fromIndex; i < numKeyframes; i++) { + if (!toType) { + toType = findDimensionValueType(to[i]); + heyListen.invariant(toType === fromType || isNumOrPxType(fromType) && isNumOrPxType(toType), "Keyframes must be of the same dimension as the current value"); + } else { + heyListen.invariant(findDimensionValueType(to[i]) === toType, "All keyframes must be of the same type"); + } + } + } else { + toType = findDimensionValueType(to); + } + if (fromType !== toType) { + // If they're both just number or px, convert them both to numbers rather than + // relying on resize/remeasure to convert (which is wasteful in this situation) + if (isNumOrPxType(fromType) && isNumOrPxType(toType)) { + var current = value.get(); + if (typeof current === "string") { + value.set(parseFloat(current)); + } + if (typeof to === "string") { + target[key] = parseFloat(to); + } else if (Array.isArray(to) && toType === styleValueTypes.px) { + target[key] = to.map(parseFloat); + } + } else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) && (toType === null || toType === void 0 ? void 0 : toType.transform) && (from === 0 || to === 0)) { + // If one or the other value is 0, it's safe to coerce it to the + // type of the other without measurement + if (from === 0) { + value.set(toType.transform(from)); + } else { + target[key] = fromType.transform(to); + } + } else { + // If we're going to do value conversion via DOM measurements, we first + // need to remove non-positional transform values that could affect the bbox measurements. + if (!hasAttemptedToRemoveTransformValues) { + removedTransformValues = removeNonTranslationalTransform(visualElement); + hasAttemptedToRemoveTransformValues = true; + } + changedValueTypeKeys.push(key); + transitionEnd[key] = transitionEnd[key] !== undefined ? transitionEnd[key] : target[key]; + setAndResetVelocity(value, to); + } + } + }); + if (changedValueTypeKeys.length) { + var scrollY_1 = changedValueTypeKeys.indexOf("height") >= 0 ? window.pageYOffset : null; + var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys); + // If we removed transform values, reapply them before the next render + if (removedTransformValues.length) { + removedTransformValues.forEach(function (_a) { + var _b = tslib.__read(_a, 2), + key = _b[0], + value = _b[1]; + visualElement.getValue(key).set(value); + }); + } + // Reapply original values + visualElement.syncRender(); + // Restore scroll position + if (scrollY_1 !== null) window.scrollTo({ + top: scrollY_1 + }); return { - kind: this.kind, - value: this.value, - line: this.line, - column: this.column + target: convertedTarget, + transitionEnd: transitionEnd + }; + } else { + return { + target: target, + transitionEnd: transitionEnd }; } -} +}; /** - * The list of all possible AST node types. + * Convert value types for x/y/width/height/top/left/bottom/right + * + * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'` + * + * @internal */ +function unitConversion(visualElement, target, origin, transitionEnd) { + return hasPositionalKey(target) ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd) : { + target: target, + transitionEnd: transitionEnd + }; +} /** - * @internal + * Parse a DOM variant to make it animatable. This involves resolving CSS variables + * and ensuring animations like "20%" => "calc(50vw)" are performed in pixels. */ -exports.Token = Token; -const QueryDocumentKeys = exports.QueryDocumentKeys = { - Name: [], - Document: ['definitions'], - OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'], - VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], - Variable: ['name'], - SelectionSet: ['selections'], - Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], - Argument: ['name', 'value'], - FragmentSpread: ['name', 'directives'], - InlineFragment: ['typeCondition', 'directives', 'selectionSet'], - FragmentDefinition: ['name', - // Note: fragment variable definitions are deprecated and will removed in v17.0.0 - 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'], - IntValue: [], - FloatValue: [], - StringValue: [], - BooleanValue: [], - NullValue: [], - EnumValue: [], - ListValue: ['values'], - ObjectValue: ['fields'], - ObjectField: ['name', 'value'], - Directive: ['name', 'arguments'], - NamedType: ['name'], - ListType: ['type'], - NonNullType: ['type'], - SchemaDefinition: ['description', 'directives', 'operationTypes'], - OperationTypeDefinition: ['type'], - ScalarTypeDefinition: ['description', 'name', 'directives'], - ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], - FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], - InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'], - InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], - UnionTypeDefinition: ['description', 'name', 'directives', 'types'], - EnumTypeDefinition: ['description', 'name', 'directives', 'values'], - EnumValueDefinition: ['description', 'name', 'directives'], - InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], - DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], - SchemaExtension: ['directives', 'operationTypes'], - ScalarTypeExtension: ['name', 'directives'], - ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], - InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'], - UnionTypeExtension: ['name', 'directives', 'types'], - EnumTypeExtension: ['name', 'directives', 'values'], - InputObjectTypeExtension: ['name', 'directives', 'fields'] +var parseDomVariant = function (visualElement, target, origin, transitionEnd) { + var resolved = resolveCSSVariables(visualElement, target, transitionEnd); + target = resolved.target; + transitionEnd = resolved.transitionEnd; + return unitConversion(visualElement, target, origin, transitionEnd); }; -const kindValues = new Set(Object.keys(QueryDocumentKeys)); -/** - * @internal - */ - -function isNode(maybeNode) { - const maybeKind = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind; - return typeof maybeKind === 'string' && kindValues.has(maybeKind); +function getComputedStyle$1(element) { + return window.getComputedStyle(element); } -/** Name */ - -var OperationTypeNode; -(function (OperationTypeNode) { - OperationTypeNode['QUERY'] = 'query'; - OperationTypeNode['MUTATION'] = 'mutation'; - OperationTypeNode['SUBSCRIPTION'] = 'subscription'; -})(OperationTypeNode || (exports.OperationTypeNode = OperationTypeNode = {})); - -/***/ }), - -/***/ "../../../node_modules/graphql/language/blockString.mjs": -/*!**************************************************************!*\ - !*** ../../../node_modules/graphql/language/blockString.mjs ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.dedentBlockStringLines = dedentBlockStringLines; -exports.isPrintableAsBlockString = isPrintableAsBlockString; -exports.printBlockString = printBlockString; -var _characterClasses = __webpack_require__(/*! ./characterClasses.mjs */ "../../../node_modules/graphql/language/characterClasses.mjs"); -/** - * Produces the value of a block string from its parsed raw value, similar to - * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. - * - * This implements the GraphQL spec's BlockStringValue() static algorithm. - * - * @internal - */ - -function dedentBlockStringLines(lines) { - var _firstNonEmptyLine2; - let commonIndent = Number.MAX_SAFE_INTEGER; - let firstNonEmptyLine = null; - let lastNonEmptyLine = -1; - for (let i = 0; i < lines.length; ++i) { - var _firstNonEmptyLine; - const line = lines[i]; - const indent = leadingWhitespace(line); - if (indent === line.length) { - continue; // skip empty lines +var htmlConfig = { + treeType: "dom", + readValueFromInstance: function (domElement, key) { + if (isTransformProp(key)) { + var defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } else { + var computedStyle = getComputedStyle$1(domElement); + return (isCSSVariable$1(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0; } - firstNonEmptyLine = (_firstNonEmptyLine = firstNonEmptyLine) !== null && _firstNonEmptyLine !== void 0 ? _firstNonEmptyLine : i; - lastNonEmptyLine = i; - if (i !== 0 && indent < commonIndent) { - commonIndent = indent; + }, + sortNodePosition: function (a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + }, + getBaseTarget: function (props, key) { + var _a; + return (_a = props.style) === null || _a === void 0 ? void 0 : _a[key]; + }, + measureViewportBox: function (element, _a) { + var transformPagePoint = _a.transformPagePoint; + return measureViewportBox(element, transformPagePoint); + }, + /** + * Reset the transform on the current Element. This is called as part + * of a batched process across the entire layout tree. To remove this write + * cycle it'd be interesting to see if it's possible to "undo" all the current + * layout transforms up the tree in the same way this.getBoundingBoxWithoutTransforms + * works + */ + resetTransform: function (element, domElement, props) { + var transformTemplate = props.transformTemplate; + domElement.style.transform = transformTemplate ? transformTemplate({}, "") : "none"; + // Ensure that whatever happens next, we restore our transform on the next frame + element.scheduleRender(); + }, + restoreTransform: function (instance, mutableState) { + instance.style.transform = mutableState.style.transform; + }, + removeValueFromRenderState: function (key, _a) { + var vars = _a.vars, + style = _a.style; + delete vars[key]; + delete style[key]; + }, + /** + * Ensure that HTML and Framer-specific value types like `px`->`%` and `Color` + * can be animated by Motion. + */ + makeTargetAnimatable: function (element, _a, _b, isMounted) { + var transformValues = _b.transformValues; + if (isMounted === void 0) { + isMounted = true; } - } - return lines // Remove common indentation from all lines but first. - .map((line, i) => i === 0 ? line : line.slice(commonIndent)) // Remove leading and trailing blank lines. - .slice((_firstNonEmptyLine2 = firstNonEmptyLine) !== null && _firstNonEmptyLine2 !== void 0 ? _firstNonEmptyLine2 : 0, lastNonEmptyLine + 1); -} -function leadingWhitespace(str) { - let i = 0; - while (i < str.length && (0, _characterClasses.isWhiteSpace)(str.charCodeAt(i))) { - ++i; - } - return i; + var transition = _a.transition, + transitionEnd = _a.transitionEnd, + target = tslib.__rest(_a, ["transition", "transitionEnd"]); + var origin = getOrigin(target, transition || {}, element); + /** + * If Framer has provided a function to convert `Color` etc value types, convert them + */ + if (transformValues) { + if (transitionEnd) transitionEnd = transformValues(transitionEnd); + if (target) target = transformValues(target); + if (origin) origin = transformValues(origin); + } + if (isMounted) { + checkTargetForNewValues(element, target, origin); + var parsed = parseDomVariant(element, target, origin, transitionEnd); + transitionEnd = parsed.transitionEnd; + target = parsed.target; + } + return tslib.__assign({ + transition: transition, + transitionEnd: transitionEnd + }, target); + }, + scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1, + build: function (element, renderState, latestValues, options, props) { + if (element.isVisible !== undefined) { + renderState.style.visibility = element.isVisible ? "visible" : "hidden"; + } + buildHTMLStyles(renderState, latestValues, options, props.transformTemplate); + }, + render: renderHTML +}; +var htmlVisualElement = visualElement(htmlConfig); +var svgVisualElement = visualElement(tslib.__assign(tslib.__assign({}, htmlConfig), { + getBaseTarget: function (props, key) { + return props[key]; + }, + readValueFromInstance: function (domElement, key) { + var _a; + if (isTransformProp(key)) { + return ((_a = getDefaultValueType(key)) === null || _a === void 0 ? void 0 : _a.default) || 0; + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return domElement.getAttribute(key); + }, + scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, + build: function (_element, renderState, latestValues, options, props) { + buildSVGAttrs(renderState, latestValues, options, props.transformTemplate); + }, + render: renderSVG +})); +var createDomVisualElement = function (Component, options) { + return isSVGComponent(Component) ? svgVisualElement(options, { + enableHardwareAcceleration: false + }) : htmlVisualElement(options, { + enableHardwareAcceleration: true + }); +}; +function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) return 0; + return pixels / (axis.max - axis.min) * 100; } /** - * @internal + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. */ - -function isPrintableAsBlockString(value) { - if (value === '') { - return true; // empty string is printable - } - let isEmptyLine = true; - let hasIndent = false; - let hasCommonIndent = true; - let seenNonEmptyLine = false; - for (let i = 0; i < value.length; ++i) { - switch (value.codePointAt(i)) { - case 0x0000: - case 0x0001: - case 0x0002: - case 0x0003: - case 0x0004: - case 0x0005: - case 0x0006: - case 0x0007: - case 0x0008: - case 0x000b: - case 0x000c: - case 0x000e: - case 0x000f: - return false; - // Has non-printable characters - - case 0x000d: - // \r - return false; - // Has \r or \r\n which will be replaced as \n - - case 10: - // \n - if (isEmptyLine && !seenNonEmptyLine) { - return false; // Has leading new line - } - seenNonEmptyLine = true; - isEmptyLine = true; - hasIndent = false; - break; - case 9: // \t - - case 32: - // - hasIndent || (hasIndent = isEmptyLine); - break; - default: - hasCommonIndent && (hasCommonIndent = hasIndent); - isEmptyLine = false; +var correctBorderRadius = { + correct: function (latest, node) { + if (!node.target) return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (styleValueTypes.px.test(latest)) { + latest = parseFloat(latest); + } else { + return latest; + } } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + var x = pixelsToPercent(latest, node.target.x); + var y = pixelsToPercent(latest, node.target.y); + return "".concat(x, "% ").concat(y, "%"); } - if (isEmptyLine) { - return false; // Has trailing empty lines +}; +var varToken = "_$css"; +var correctBoxShadow = { + correct: function (latest, _a) { + var treeScale = _a.treeScale, + projectionDelta = _a.projectionDelta; + var original = latest; + /** + * We need to first strip and store CSS variables from the string. + */ + var containsCSSVariables = latest.includes("var("); + var cssVariables = []; + if (containsCSSVariables) { + latest = latest.replace(cssVariableRegex, function (match) { + cssVariables.push(match); + return varToken; + }); + } + var shadow = styleValueTypes.complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) return original; + var template = styleValueTypes.complex.createTransformer(latest); + var offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + var xScale = projectionDelta.x.scale * treeScale.x; + var yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + var averageScale = popmotion.mix(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") shadow[3 + offset] /= averageScale; + var output = template(shadow); + if (containsCSSVariables) { + var i_1 = 0; + output = output.replace(varToken, function () { + var cssVariable = cssVariables[i_1]; + i_1++; + return cssVariable; + }); + } + return output; } - if (hasCommonIndent && seenNonEmptyLine) { - return false; // Has internal indent +}; +var MeasureLayoutWithContext = /** @class */function (_super) { + tslib.__extends(MeasureLayoutWithContext, _super); + function MeasureLayoutWithContext() { + return _super !== null && _super.apply(this, arguments) || this; } - return true; + /** + * This only mounts projection nodes for components that + * need measuring, we might want to do it for all components + * in order to incorporate transforms + */ + MeasureLayoutWithContext.prototype.componentDidMount = function () { + var _this = this; + var _a = this.props, + visualElement = _a.visualElement, + layoutGroup = _a.layoutGroup, + switchLayoutGroup = _a.switchLayoutGroup, + layoutId = _a.layoutId; + var projection = visualElement.projection; + addScaleCorrector(defaultScaleCorrectors); + if (projection) { + if (layoutGroup === null || layoutGroup === void 0 ? void 0 : layoutGroup.group) layoutGroup.group.add(projection); + if ((switchLayoutGroup === null || switchLayoutGroup === void 0 ? void 0 : switchLayoutGroup.register) && layoutId) { + switchLayoutGroup.register(projection); + } + projection.root.didUpdate(); + projection.addEventListener("animationComplete", function () { + _this.safeToRemove(); + }); + projection.setOptions(tslib.__assign(tslib.__assign({}, projection.options), { + onExitComplete: function () { + return _this.safeToRemove(); + } + })); + } + globalProjectionState.hasEverUpdated = true; + }; + MeasureLayoutWithContext.prototype.getSnapshotBeforeUpdate = function (prevProps) { + var _this = this; + var _a = this.props, + layoutDependency = _a.layoutDependency, + visualElement = _a.visualElement, + drag = _a.drag, + isPresent = _a.isPresent; + var projection = visualElement.projection; + if (!projection) return null; + /** + * TODO: We use this data in relegate to determine whether to + * promote a previous element. There's no guarantee its presence data + * will have updated by this point - if a bug like this arises it will + * have to be that we markForRelegation and then find a new lead some other way, + * perhaps in didUpdate + */ + projection.isPresent = isPresent; + if (drag || prevProps.layoutDependency !== layoutDependency || layoutDependency === undefined) { + projection.willUpdate(); + } else { + this.safeToRemove(); + } + if (prevProps.isPresent !== isPresent) { + if (isPresent) { + projection.promote(); + } else if (!projection.relegate()) { + /** + * If there's another stack member taking over from this one, + * it's in charge of the exit animation and therefore should + * be in charge of the safe to remove. Otherwise we call it here. + */ + sync__default["default"].postRender(function () { + var _a; + if (!((_a = projection.getStack()) === null || _a === void 0 ? void 0 : _a.members.length)) { + _this.safeToRemove(); + } + }); + } + } + return null; + }; + MeasureLayoutWithContext.prototype.componentDidUpdate = function () { + var projection = this.props.visualElement.projection; + if (projection) { + projection.root.didUpdate(); + if (!projection.currentAnimation && projection.isLead()) { + this.safeToRemove(); + } + } + }; + MeasureLayoutWithContext.prototype.componentWillUnmount = function () { + var _a = this.props, + visualElement = _a.visualElement, + layoutGroup = _a.layoutGroup, + promoteContext = _a.switchLayoutGroup; + var projection = visualElement.projection; + if (projection) { + projection.scheduleCheckAfterUnmount(); + if (layoutGroup === null || layoutGroup === void 0 ? void 0 : layoutGroup.group) layoutGroup.group.remove(projection); + if (promoteContext === null || promoteContext === void 0 ? void 0 : promoteContext.deregister) promoteContext.deregister(projection); + } + }; + MeasureLayoutWithContext.prototype.safeToRemove = function () { + var safeToRemove = this.props.safeToRemove; + safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove(); + }; + MeasureLayoutWithContext.prototype.render = function () { + return null; + }; + return MeasureLayoutWithContext; +}(React__default["default"].Component); +function MeasureLayout(props) { + var _a = tslib.__read(usePresence(), 2), + isPresent = _a[0], + safeToRemove = _a[1]; + var layoutGroup = React.useContext(LayoutGroupContext); + return React__default["default"].createElement(MeasureLayoutWithContext, tslib.__assign({}, props, { + layoutGroup: layoutGroup, + switchLayoutGroup: React.useContext(SwitchLayoutGroupContext), + isPresent: isPresent, + safeToRemove: safeToRemove + })); } +var defaultScaleCorrectors = { + borderRadius: tslib.__assign(tslib.__assign({}, correctBorderRadius), { + applyTo: ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomLeftRadius", "borderBottomRightRadius"] + }), + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow +}; +var layoutFeatures = { + measureLayout: MeasureLayout +}; + /** - * Print a block string in the indented block form by adding a leading and - * trailing blank line. However, if a block string starts with whitespace and is - * a single-line, adding a leading blank line would strip that whitespace. + * Animate a single value or a `MotionValue`. * - * @internal - */ - -function printBlockString(value, options) { - const escapedValue = value.replace(/"""/g, '\\"""'); // Expand a block string's raw value into independent lines. - - const lines = escapedValue.split(/\r\n|[\n\r]/g); - const isSingleLine = lines.length === 1; // If common indentation is found we can fix some of those cases by adding leading new line - - const forceLeadingNewLine = lines.length > 1 && lines.slice(1).every(line => line.length === 0 || (0, _characterClasses.isWhiteSpace)(line.charCodeAt(0))); // Trailing triple quotes just looks confusing but doesn't force trailing new line - - const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""'); // Trailing quote (single or double) or slash forces trailing new line - - const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes; - const hasTrailingSlash = value.endsWith('\\'); - const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash; - const printAsMultipleLines = !(options !== null && options !== void 0 && options.minimize) && ( - // add leading and trailing new lines only if it improves readability - !isSingleLine || value.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes); - let result = ''; // Format a multi-line block quote to account for leading space. - - const skipLeadingNewLine = isSingleLine && (0, _characterClasses.isWhiteSpace)(value.charCodeAt(0)); - if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) { - result += '\n'; + * The first argument is either a `MotionValue` to animate, or an initial animation value. + * + * The second is either a value to animate to, or an array of keyframes to animate through. + * + * The third argument can be either tween or spring options, and optional lifecycle methods: `onUpdate`, `onPlay`, `onComplete`, `onRepeat` and `onStop`. + * + * Returns `AnimationPlaybackControls`, currently just a `stop` method. + * + * ```javascript + * const x = useMotionValue(0) + * + * useEffect(() => { + * const controls = animate(x, 100, { + * type: "spring", + * stiffness: 2000, + * onComplete: v => {} + * }) + * + * return controls.stop + * }) + * ``` + * + * @public + */ +function animate(from, to, transition) { + if (transition === void 0) { + transition = {}; } - result += escapedValue; - if (printAsMultipleLines || forceTrailingNewline) { - result += '\n'; + var value = isMotionValue(from) ? from : motionValue(from); + startAnimation("", value, to, transition); + return { + stop: function () { + return value.stop(); + }, + isAnimating: function () { + return value.isAnimating(); + } + }; +} +var borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; +var numBorders = borders.length; +var asNumber = function (value) { + return typeof value === "string" ? parseFloat(value) : value; +}; +var isPx = function (value) { + return typeof value === "number" || styleValueTypes.px.test(value); +}; +function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + var _a, _b, _c, _d; + if (shouldCrossfadeOpacity) { + target.opacity = popmotion.mix(0, + // (follow?.opacity as number) ?? 0, + // TODO Reinstate this if only child + (_a = lead.opacity) !== null && _a !== void 0 ? _a : 1, easeCrossfadeIn(progress)); + target.opacityExit = popmotion.mix((_b = follow.opacity) !== null && _b !== void 0 ? _b : 1, 0, easeCrossfadeOut(progress)); + } else if (isOnlyMember) { + target.opacity = popmotion.mix((_c = follow.opacity) !== null && _c !== void 0 ? _c : 1, (_d = lead.opacity) !== null && _d !== void 0 ? _d : 1, progress); + } + /** + * Mix border radius + */ + for (var i = 0; i < numBorders; i++) { + var borderLabel = "border".concat(borders[i], "Radius"); + var followRadius = getRadius(follow, borderLabel); + var leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + var canMix = followRadius === 0 || leadRadius === 0 || isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(popmotion.mix(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (styleValueTypes.percent.test(leadRadius) || styleValueTypes.percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = popmotion.mix(follow.rotate || 0, lead.rotate || 0, progress); } - return '"""' + result + '"""'; +} +function getRadius(values, radiusName) { + var _a; + return (_a = values[radiusName]) !== null && _a !== void 0 ? _a : values.borderRadius; +} +// /** +// * We only want to mix the background color if there's a follow element +// * that we're not crossfading opacity between. For instance with switch +// * AnimateSharedLayout animations, this helps the illusion of a continuous +// * element being animated but also cuts down on the number of paints triggered +// * for elements where opacity is doing that work for us. +// */ +// if ( +// !hasFollowElement && +// latestLeadValues.backgroundColor && +// latestFollowValues.backgroundColor +// ) { +// /** +// * This isn't ideal performance-wise as mixColor is creating a new function every frame. +// * We could probably create a mixer that runs at the start of the animation but +// * the idea behind the crossfader is that it runs dynamically between two potentially +// * changing targets (ie opacity or borderRadius may be animating independently via variants) +// */ +// leadState.backgroundColor = followState.backgroundColor = mixColor( +// latestFollowValues.backgroundColor as string, +// latestLeadValues.backgroundColor as string +// )(p) +// } +var easeCrossfadeIn = compress(0, 0.5, popmotion.circOut); +var easeCrossfadeOut = compress(0.5, 0.95, popmotion.linear); +function compress(min, max, easing) { + return function (p) { + // Could replace ifs with clamp + if (p < min) return 0; + if (p > max) return 1; + return easing(popmotion.progress(min, max, p)); + }; } -/***/ }), - -/***/ "../../../node_modules/graphql/language/characterClasses.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/language/characterClasses.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isDigit = isDigit; -exports.isLetter = isLetter; -exports.isNameContinue = isNameContinue; -exports.isNameStart = isNameStart; -exports.isWhiteSpace = isWhiteSpace; /** - * ``` - * WhiteSpace :: - * - "Horizontal Tab (U+0009)" - * - "Space (U+0020)" - * ``` - * @internal + * Reset an axis to the provided origin box. + * + * This is a mutative operation. */ -function isWhiteSpace(code) { - return code === 0x0009 || code === 0x0020; +function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; } /** - * ``` - * Digit :: one of - * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` - * ``` - * @internal + * Reset a box to the provided origin box. + * + * This is a mutative operation. */ - -function isDigit(code) { - return code >= 0x0030 && code <= 0x0039; +function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); } + /** - * ``` - * Letter :: one of - * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` - * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` - * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` - * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` - * ``` - * @internal + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse */ - -function isLetter(code) { - return code >= 0x0061 && code <= 0x007a || - // A-Z - code >= 0x0041 && code <= 0x005a // a-z - ; +function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; } /** - * ``` - * NameStart :: - * - Letter - * - `_` - * ``` - * @internal + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse */ - -function isNameStart(code) { - return isLetter(code) || code === 0x005f; +function removeAxisDelta(axis, translate, scale, origin, boxScale, originAxis, sourceAxis) { + if (translate === void 0) { + translate = 0; + } + if (scale === void 0) { + scale = 1; + } + if (origin === void 0) { + origin = 0.5; + } + if (originAxis === void 0) { + originAxis = axis; + } + if (sourceAxis === void 0) { + sourceAxis = axis; + } + if (styleValueTypes.percent.test(translate)) { + translate = parseFloat(translate); + var relativeProgress = popmotion.mix(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") return; + var originPoint = popmotion.mix(originAxis.min, originAxis.max, origin); + if (axis === originAxis) originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); } /** - * ``` - * NameContinue :: - * - Letter - * - Digit - * - `_` - * ``` - * @internal + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta */ - -function isNameContinue(code) { - return isLetter(code) || isDigit(code) || code === 0x005f; +function removeAxisTransforms(axis, transforms, _a, origin, sourceAxis) { + var _b = tslib.__read(_a, 3), + key = _b[0], + scaleKey = _b[1], + originKey = _b[2]; + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); } - -/***/ }), - -/***/ "../../../node_modules/graphql/language/directiveLocation.mjs": -/*!********************************************************************!*\ - !*** ../../../node_modules/graphql/language/directiveLocation.mjs ***! - \********************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.DirectiveLocation = void 0; /** - * The set of allowed directive location values. + * The names of the motion values we want to apply as translation, scale and origin. */ -var DirectiveLocation; -(function (DirectiveLocation) { - DirectiveLocation['QUERY'] = 'QUERY'; - DirectiveLocation['MUTATION'] = 'MUTATION'; - DirectiveLocation['SUBSCRIPTION'] = 'SUBSCRIPTION'; - DirectiveLocation['FIELD'] = 'FIELD'; - DirectiveLocation['FRAGMENT_DEFINITION'] = 'FRAGMENT_DEFINITION'; - DirectiveLocation['FRAGMENT_SPREAD'] = 'FRAGMENT_SPREAD'; - DirectiveLocation['INLINE_FRAGMENT'] = 'INLINE_FRAGMENT'; - DirectiveLocation['VARIABLE_DEFINITION'] = 'VARIABLE_DEFINITION'; - DirectiveLocation['SCHEMA'] = 'SCHEMA'; - DirectiveLocation['SCALAR'] = 'SCALAR'; - DirectiveLocation['OBJECT'] = 'OBJECT'; - DirectiveLocation['FIELD_DEFINITION'] = 'FIELD_DEFINITION'; - DirectiveLocation['ARGUMENT_DEFINITION'] = 'ARGUMENT_DEFINITION'; - DirectiveLocation['INTERFACE'] = 'INTERFACE'; - DirectiveLocation['UNION'] = 'UNION'; - DirectiveLocation['ENUM'] = 'ENUM'; - DirectiveLocation['ENUM_VALUE'] = 'ENUM_VALUE'; - DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT'; - DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION'; -})(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {})); - +var xKeys = ["x", "scaleX", "originX"]; +var yKeys = ["y", "scaleY", "originY"]; /** - * The enum type representing the directive location values. - * - * @deprecated Please use `DirectiveLocation`. Will be remove in v17. + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta */ - -/***/ }), - -/***/ "../../../node_modules/graphql/language/index.mjs": -/*!********************************************************!*\ - !*** ../../../node_modules/graphql/language/index.mjs ***! - \********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "BREAK", ({ - enumerable: true, - get: function () { - return _visitor.BREAK; - } -})); -Object.defineProperty(exports, "DirectiveLocation", ({ - enumerable: true, - get: function () { - return _directiveLocation.DirectiveLocation; - } -})); -Object.defineProperty(exports, "Kind", ({ - enumerable: true, - get: function () { - return _kinds.Kind; - } -})); -Object.defineProperty(exports, "Lexer", ({ - enumerable: true, - get: function () { - return _lexer.Lexer; +function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox === null || originBox === void 0 ? void 0 : originBox.x, sourceBox === null || sourceBox === void 0 ? void 0 : sourceBox.x); + removeAxisTransforms(box.y, transforms, yKeys, originBox === null || originBox === void 0 ? void 0 : originBox.y, sourceBox === null || sourceBox === void 0 ? void 0 : sourceBox.y); +} +function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; +} +function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); +} +function boxEquals(a, b) { + return a.x.min === b.x.min && a.x.max === b.x.max && a.y.min === b.y.min && a.y.max === b.y.max; +} +var NodeStack = /** @class */function () { + function NodeStack() { + this.members = []; } -})); -Object.defineProperty(exports, "Location", ({ - enumerable: true, - get: function () { - return _ast.Location; + NodeStack.prototype.add = function (node) { + addUniqueItem(this.members, node); + node.scheduleRender(); + }; + NodeStack.prototype.remove = function (node) { + removeItem(this.members, node); + if (node === this.prevLead) { + this.prevLead = undefined; + } + if (node === this.lead) { + var prevLead = this.members[this.members.length - 1]; + if (prevLead) { + this.promote(prevLead); + } + } + }; + NodeStack.prototype.relegate = function (node) { + var indexOfNode = this.members.findIndex(function (member) { + return node === member; + }); + if (indexOfNode === 0) return false; + /** + * Find the next projection node that is present + */ + var prevLead; + for (var i = indexOfNode; i >= 0; i--) { + var member = this.members[i]; + if (member.isPresent !== false) { + prevLead = member; + break; + } + } + if (prevLead) { + this.promote(prevLead); + return true; + } else { + return false; + } + }; + NodeStack.prototype.promote = function (node, preserveFollowOpacity) { + var _a; + var prevLead = this.lead; + if (node === prevLead) return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.instance && prevLead.scheduleRender(); + node.scheduleRender(); + node.resumeFrom = prevLead; + if (preserveFollowOpacity) { + node.resumeFrom.preserveOpacity = true; + } + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = prevLead.animationValues || prevLead.latestValues; + node.snapshot.isShared = true; + } + if ((_a = node.root) === null || _a === void 0 ? void 0 : _a.isUpdating) { + node.isLayoutDirty = true; + } + var crossfade = node.options.crossfade; + if (crossfade === false) { + prevLead.hide(); + } + /** + * TODO: + * - Test border radius when previous node was deleted + * - boxShadow mixing + * - Shared between element A in scrolled container and element B (scroll stays the same or changes) + * - Shared between element A in transformed container and element B (transform stays the same or changes) + * - Shared between element A in scrolled page and element B (scroll stays the same or changes) + * --- + * - Crossfade opacity of root nodes + * - layoutId changes after animation + * - layoutId changes mid animation + */ + } + }; + NodeStack.prototype.exitAnimationComplete = function () { + this.members.forEach(function (node) { + var _a, _b, _c, _d, _e; + (_b = (_a = node.options).onExitComplete) === null || _b === void 0 ? void 0 : _b.call(_a); + (_e = (_c = node.resumingFrom) === null || _c === void 0 ? void 0 : (_d = _c.options).onExitComplete) === null || _e === void 0 ? void 0 : _e.call(_d); + }); + }; + NodeStack.prototype.scheduleRender = function () { + this.members.forEach(function (node) { + node.instance && node.scheduleRender(false); + }); + }; + /** + * Clear any leads that have been removed this render to prevent them from being + * used in future animations and to prevent memory leaks + */ + NodeStack.prototype.removeLeadSnapshot = function () { + if (this.lead && this.lead.snapshot) { + this.lead.snapshot = undefined; + } + }; + return NodeStack; +}(); +var identityProjection = "translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"; +function buildProjectionTransform(delta, treeScale, latestTransform) { + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + var xTranslate = delta.x.translate / treeScale.x; + var yTranslate = delta.y.translate / treeScale.y; + var transform = "translate3d(".concat(xTranslate, "px, ").concat(yTranslate, "px, 0) "); + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + transform += "scale(".concat(1 / treeScale.x, ", ").concat(1 / treeScale.y, ") "); + if (latestTransform) { + var rotate = latestTransform.rotate, + rotateX = latestTransform.rotateX, + rotateY = latestTransform.rotateY; + if (rotate) transform += "rotate(".concat(rotate, "deg) "); + if (rotateX) transform += "rotateX(".concat(rotateX, "deg) "); + if (rotateY) transform += "rotateY(".concat(rotateY, "deg) "); } -})); -Object.defineProperty(exports, "OperationTypeNode", ({ - enumerable: true, - get: function () { - return _ast.OperationTypeNode; + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + var elementScaleX = delta.x.scale * treeScale.x; + var elementScaleY = delta.y.scale * treeScale.y; + transform += "scale(".concat(elementScaleX, ", ").concat(elementScaleY, ")"); + return transform === identityProjection ? "none" : transform; +} +var compareByDepth = function (a, b) { + return a.depth - b.depth; +}; +var FlatTree = /** @class */function () { + function FlatTree() { + this.children = []; + this.isDirty = false; } -})); -Object.defineProperty(exports, "Source", ({ - enumerable: true, - get: function () { - return _source.Source; - } -})); -Object.defineProperty(exports, "Token", ({ - enumerable: true, - get: function () { - return _ast.Token; - } -})); -Object.defineProperty(exports, "TokenKind", ({ - enumerable: true, - get: function () { - return _tokenKind.TokenKind; - } -})); -Object.defineProperty(exports, "getEnterLeaveForKind", ({ - enumerable: true, - get: function () { - return _visitor.getEnterLeaveForKind; - } -})); -Object.defineProperty(exports, "getLocation", ({ - enumerable: true, - get: function () { - return _location.getLocation; - } -})); -Object.defineProperty(exports, "getVisitFn", ({ - enumerable: true, - get: function () { - return _visitor.getVisitFn; - } -})); -Object.defineProperty(exports, "isConstValueNode", ({ - enumerable: true, - get: function () { - return _predicates.isConstValueNode; - } -})); -Object.defineProperty(exports, "isDefinitionNode", ({ - enumerable: true, - get: function () { - return _predicates.isDefinitionNode; - } -})); -Object.defineProperty(exports, "isExecutableDefinitionNode", ({ - enumerable: true, - get: function () { - return _predicates.isExecutableDefinitionNode; - } -})); -Object.defineProperty(exports, "isSelectionNode", ({ - enumerable: true, - get: function () { - return _predicates.isSelectionNode; - } -})); -Object.defineProperty(exports, "isTypeDefinitionNode", ({ - enumerable: true, - get: function () { - return _predicates.isTypeDefinitionNode; - } -})); -Object.defineProperty(exports, "isTypeExtensionNode", ({ - enumerable: true, - get: function () { - return _predicates.isTypeExtensionNode; - } -})); -Object.defineProperty(exports, "isTypeNode", ({ - enumerable: true, - get: function () { - return _predicates.isTypeNode; - } -})); -Object.defineProperty(exports, "isTypeSystemDefinitionNode", ({ - enumerable: true, - get: function () { - return _predicates.isTypeSystemDefinitionNode; - } -})); -Object.defineProperty(exports, "isTypeSystemExtensionNode", ({ - enumerable: true, - get: function () { - return _predicates.isTypeSystemExtensionNode; - } -})); -Object.defineProperty(exports, "isValueNode", ({ - enumerable: true, - get: function () { - return _predicates.isValueNode; - } -})); -Object.defineProperty(exports, "parse", ({ - enumerable: true, - get: function () { - return _parser.parse; - } -})); -Object.defineProperty(exports, "parseConstValue", ({ - enumerable: true, - get: function () { - return _parser.parseConstValue; - } -})); -Object.defineProperty(exports, "parseType", ({ - enumerable: true, - get: function () { - return _parser.parseType; - } -})); -Object.defineProperty(exports, "parseValue", ({ - enumerable: true, - get: function () { - return _parser.parseValue; - } -})); -Object.defineProperty(exports, "print", ({ - enumerable: true, - get: function () { - return _printer.print; - } -})); -Object.defineProperty(exports, "printLocation", ({ - enumerable: true, - get: function () { - return _printLocation.printLocation; - } -})); -Object.defineProperty(exports, "printSourceLocation", ({ - enumerable: true, - get: function () { - return _printLocation.printSourceLocation; - } -})); -Object.defineProperty(exports, "visit", ({ - enumerable: true, - get: function () { - return _visitor.visit; - } -})); -Object.defineProperty(exports, "visitInParallel", ({ - enumerable: true, - get: function () { - return _visitor.visitInParallel; - } -})); -var _source = __webpack_require__(/*! ./source.mjs */ "../../../node_modules/graphql/language/source.mjs"); -var _location = __webpack_require__(/*! ./location.mjs */ "../../../node_modules/graphql/language/location.mjs"); -var _printLocation = __webpack_require__(/*! ./printLocation.mjs */ "../../../node_modules/graphql/language/printLocation.mjs"); -var _kinds = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _tokenKind = __webpack_require__(/*! ./tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); -var _lexer = __webpack_require__(/*! ./lexer.mjs */ "../../../node_modules/graphql/language/lexer.mjs"); -var _parser = __webpack_require__(/*! ./parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); -var _printer = __webpack_require__(/*! ./printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _visitor = __webpack_require__(/*! ./visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); -var _ast = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -var _predicates = __webpack_require__(/*! ./predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -var _directiveLocation = __webpack_require__(/*! ./directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); - -/***/ }), - -/***/ "../../../node_modules/graphql/language/kinds.mjs": -/*!********************************************************!*\ - !*** ../../../node_modules/graphql/language/kinds.mjs ***! - \********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.Kind = void 0; -/** - * The set of allowed kind values for AST nodes. - */ -var Kind; -(function (Kind) { - Kind['NAME'] = 'Name'; - Kind['DOCUMENT'] = 'Document'; - Kind['OPERATION_DEFINITION'] = 'OperationDefinition'; - Kind['VARIABLE_DEFINITION'] = 'VariableDefinition'; - Kind['SELECTION_SET'] = 'SelectionSet'; - Kind['FIELD'] = 'Field'; - Kind['ARGUMENT'] = 'Argument'; - Kind['FRAGMENT_SPREAD'] = 'FragmentSpread'; - Kind['INLINE_FRAGMENT'] = 'InlineFragment'; - Kind['FRAGMENT_DEFINITION'] = 'FragmentDefinition'; - Kind['VARIABLE'] = 'Variable'; - Kind['INT'] = 'IntValue'; - Kind['FLOAT'] = 'FloatValue'; - Kind['STRING'] = 'StringValue'; - Kind['BOOLEAN'] = 'BooleanValue'; - Kind['NULL'] = 'NullValue'; - Kind['ENUM'] = 'EnumValue'; - Kind['LIST'] = 'ListValue'; - Kind['OBJECT'] = 'ObjectValue'; - Kind['OBJECT_FIELD'] = 'ObjectField'; - Kind['DIRECTIVE'] = 'Directive'; - Kind['NAMED_TYPE'] = 'NamedType'; - Kind['LIST_TYPE'] = 'ListType'; - Kind['NON_NULL_TYPE'] = 'NonNullType'; - Kind['SCHEMA_DEFINITION'] = 'SchemaDefinition'; - Kind['OPERATION_TYPE_DEFINITION'] = 'OperationTypeDefinition'; - Kind['SCALAR_TYPE_DEFINITION'] = 'ScalarTypeDefinition'; - Kind['OBJECT_TYPE_DEFINITION'] = 'ObjectTypeDefinition'; - Kind['FIELD_DEFINITION'] = 'FieldDefinition'; - Kind['INPUT_VALUE_DEFINITION'] = 'InputValueDefinition'; - Kind['INTERFACE_TYPE_DEFINITION'] = 'InterfaceTypeDefinition'; - Kind['UNION_TYPE_DEFINITION'] = 'UnionTypeDefinition'; - Kind['ENUM_TYPE_DEFINITION'] = 'EnumTypeDefinition'; - Kind['ENUM_VALUE_DEFINITION'] = 'EnumValueDefinition'; - Kind['INPUT_OBJECT_TYPE_DEFINITION'] = 'InputObjectTypeDefinition'; - Kind['DIRECTIVE_DEFINITION'] = 'DirectiveDefinition'; - Kind['SCHEMA_EXTENSION'] = 'SchemaExtension'; - Kind['SCALAR_TYPE_EXTENSION'] = 'ScalarTypeExtension'; - Kind['OBJECT_TYPE_EXTENSION'] = 'ObjectTypeExtension'; - Kind['INTERFACE_TYPE_EXTENSION'] = 'InterfaceTypeExtension'; - Kind['UNION_TYPE_EXTENSION'] = 'UnionTypeExtension'; - Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension'; - Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension'; -})(Kind || (exports.Kind = Kind = {})); - -/** - * The enum type representing the possible kind values of AST nodes. - * - * @deprecated Please use `Kind`. Will be remove in v17. - */ - -/***/ }), - -/***/ "../../../node_modules/graphql/language/lexer.mjs": -/*!********************************************************!*\ - !*** ../../../node_modules/graphql/language/lexer.mjs ***! - \********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - + FlatTree.prototype.add = function (child) { + addUniqueItem(this.children, child); + this.isDirty = true; + }; + FlatTree.prototype.remove = function (child) { + removeItem(this.children, child); + this.isDirty = true; + }; + FlatTree.prototype.forEach = function (callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + }; + return FlatTree; +}(); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.Lexer = void 0; -exports.isPunctuatorTokenKind = isPunctuatorTokenKind; -var _syntaxError = __webpack_require__(/*! ../error/syntaxError.mjs */ "../../../node_modules/graphql/error/syntaxError.mjs"); -var _ast = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -var _blockString = __webpack_require__(/*! ./blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); -var _characterClasses = __webpack_require__(/*! ./characterClasses.mjs */ "../../../node_modules/graphql/language/characterClasses.mjs"); -var _tokenKind = __webpack_require__(/*! ./tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); /** - * Given a Source object, creates a Lexer for that source. - * A Lexer is a stateful stream generator in that every time - * it is advanced, it returns the next token in the Source. Assuming the - * source lexes, the final Token emitted by the lexer will be of kind - * EOF, after which the lexer will repeatedly return the same EOF token - * whenever called. + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations */ - -class Lexer { - /** - * The previously focused non-ignored token. - */ - - /** - * The currently focused non-ignored token. - */ - - /** - * The (1-indexed) line containing the current token. - */ - - /** - * The character offset at which the current line begins. - */ - constructor(source) { - const startOfFileToken = new _ast.Token(_tokenKind.TokenKind.SOF, 0, 0, 0, 0); - this.source = source; - this.lastToken = startOfFileToken; - this.token = startOfFileToken; - this.line = 1; - this.lineStart = 0; - } - get [Symbol.toStringTag]() { - return 'Lexer'; - } - /** - * Advances the token stream to the next non-ignored token. - */ - - advance() { - this.lastToken = this.token; - const token = this.token = this.lookahead(); - return token; - } - /** - * Looks ahead and returns the next non-ignored token, but does not change - * the state of Lexer. - */ - - lookahead() { - let token = this.token; - if (token.kind !== _tokenKind.TokenKind.EOF) { - do { - if (token.next) { - token = token.next; - } else { - // Read the next token and form a link in the token linked-list. - const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing. - - token.next = nextToken; // @ts-expect-error prev is only mutable during parsing. - - nextToken.prev = token; - token = nextToken; +var animationTarget = 1000; +function createProjectionNode(_a) { + var attachResizeListener = _a.attachResizeListener, + defaultParent = _a.defaultParent, + measureScroll = _a.measureScroll, + checkIsScrollRoot = _a.checkIsScrollRoot, + resetTransform = _a.resetTransform; + return /** @class */function () { + function ProjectionNode(id, latestValues, parent) { + var _this = this; + if (latestValues === void 0) { + latestValues = {}; + } + if (parent === void 0) { + parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent(); + } + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to actually + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { + x: 1, + y: 1 + }; + /** + * + */ + this.eventHandlers = new Map(); + // Note: Currently only running on root node + this.potentialNodes = new Map(); + this.checkUpdateFailed = function () { + if (_this.isUpdating) { + _this.isUpdating = false; + _this.clearAllSnapshots(); } - } while (token.kind === _tokenKind.TokenKind.COMMENT); + }; + this.updateProjection = function () { + _this.nodes.forEach(resolveTargetDelta); + _this.nodes.forEach(calcProjection); + }; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.id = id; + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(parent.path), false), [parent], false) : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + id && this.root.registerPotentialNode(id, this); + for (var i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) this.nodes = new FlatTree(); } - return token; - } -} -/** - * @internal - */ -exports.Lexer = Lexer; -function isPunctuatorTokenKind(kind) { - return kind === _tokenKind.TokenKind.BANG || kind === _tokenKind.TokenKind.DOLLAR || kind === _tokenKind.TokenKind.AMP || kind === _tokenKind.TokenKind.PAREN_L || kind === _tokenKind.TokenKind.PAREN_R || kind === _tokenKind.TokenKind.SPREAD || kind === _tokenKind.TokenKind.COLON || kind === _tokenKind.TokenKind.EQUALS || kind === _tokenKind.TokenKind.AT || kind === _tokenKind.TokenKind.BRACKET_L || kind === _tokenKind.TokenKind.BRACKET_R || kind === _tokenKind.TokenKind.BRACE_L || kind === _tokenKind.TokenKind.PIPE || kind === _tokenKind.TokenKind.BRACE_R; -} -/** - * A Unicode scalar value is any Unicode code point except surrogate code - * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and - * 0xE000 to 0x10FFFF. - * - * SourceCharacter :: - * - "Any Unicode scalar value" - */ - -function isUnicodeScalarValue(code) { - return code >= 0x0000 && code <= 0xd7ff || code >= 0xe000 && code <= 0x10ffff; -} -/** - * The GraphQL specification defines source text as a sequence of unicode scalar - * values (which Unicode defines to exclude surrogate code points). However - * JavaScript defines strings as a sequence of UTF-16 code units which may - * include surrogates. A surrogate pair is a valid source character as it - * encodes a supplementary code point (above U+FFFF), but unpaired surrogate - * code points are not valid source characters. - */ - -function isSupplementaryCodePoint(body, location) { - return isLeadingSurrogate(body.charCodeAt(location)) && isTrailingSurrogate(body.charCodeAt(location + 1)); -} -function isLeadingSurrogate(code) { - return code >= 0xd800 && code <= 0xdbff; -} -function isTrailingSurrogate(code) { - return code >= 0xdc00 && code <= 0xdfff; -} -/** - * Prints the code point (or end of file reference) at a given location in a - * source for use in error messages. - * - * Printable ASCII is printed quoted, while other points are printed in Unicode - * code point form (ie. U+1234). - */ - -function printCodePointAt(lexer, location) { - const code = lexer.source.body.codePointAt(location); - if (code === undefined) { - return _tokenKind.TokenKind.EOF; - } else if (code >= 0x0020 && code <= 0x007e) { - // Printable ASCII - const char = String.fromCodePoint(code); - return char === '"' ? "'\"'" : `"${char}"`; - } // Unicode code point - - return 'U+' + code.toString(16).toUpperCase().padStart(4, '0'); -} -/** - * Create a token with line and column location information. - */ - -function createToken(lexer, kind, start, end, value) { - const line = lexer.line; - const col = 1 + start - lexer.lineStart; - return new _ast.Token(kind, start, end, line, col, value); -} -/** - * Gets the next token from the source starting at the given position. - * - * This skips over whitespace until it finds the next lexable token, then lexes - * punctuators immediately or calls the appropriate helper function for more - * complicated tokens. - */ - -function readNextToken(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let position = start; - while (position < bodyLength) { - const code = body.charCodeAt(position); // SourceCharacter - - switch (code) { - // Ignored :: - // - UnicodeBOM - // - WhiteSpace - // - LineTerminator - // - Comment - // - Comma - // - // UnicodeBOM :: "Byte Order Mark (U+FEFF)" - // - // WhiteSpace :: - // - "Horizontal Tab (U+0009)" - // - "Space (U+0020)" - // - // Comma :: , - case 0xfeff: // - - case 0x0009: // \t - - case 0x0020: // - - case 0x002c: - // , - ++position; - continue; - // LineTerminator :: - // - "New Line (U+000A)" - // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"] - // - "Carriage Return (U+000D)" "New Line (U+000A)" - - case 0x000a: - // \n - ++position; - ++lexer.line; - lexer.lineStart = position; - continue; - case 0x000d: - // \r - if (body.charCodeAt(position + 1) === 0x000a) { - position += 2; - } else { - ++position; - } - ++lexer.line; - lexer.lineStart = position; - continue; - // Comment - - case 0x0023: - // # - return readComment(lexer, position); - // Token :: - // - Punctuator - // - Name - // - IntValue - // - FloatValue - // - StringValue - // - // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | } - - case 0x0021: - // ! - return createToken(lexer, _tokenKind.TokenKind.BANG, position, position + 1); - case 0x0024: - // $ - return createToken(lexer, _tokenKind.TokenKind.DOLLAR, position, position + 1); - case 0x0026: - // & - return createToken(lexer, _tokenKind.TokenKind.AMP, position, position + 1); - case 0x0028: - // ( - return createToken(lexer, _tokenKind.TokenKind.PAREN_L, position, position + 1); - case 0x0029: - // ) - return createToken(lexer, _tokenKind.TokenKind.PAREN_R, position, position + 1); - case 0x002e: - // . - if (body.charCodeAt(position + 1) === 0x002e && body.charCodeAt(position + 2) === 0x002e) { - return createToken(lexer, _tokenKind.TokenKind.SPREAD, position, position + 3); - } - break; - case 0x003a: - // : - return createToken(lexer, _tokenKind.TokenKind.COLON, position, position + 1); - case 0x003d: - // = - return createToken(lexer, _tokenKind.TokenKind.EQUALS, position, position + 1); - case 0x0040: - // @ - return createToken(lexer, _tokenKind.TokenKind.AT, position, position + 1); - case 0x005b: - // [ - return createToken(lexer, _tokenKind.TokenKind.BRACKET_L, position, position + 1); - case 0x005d: - // ] - return createToken(lexer, _tokenKind.TokenKind.BRACKET_R, position, position + 1); - case 0x007b: - // { - return createToken(lexer, _tokenKind.TokenKind.BRACE_L, position, position + 1); - case 0x007c: - // | - return createToken(lexer, _tokenKind.TokenKind.PIPE, position, position + 1); - case 0x007d: - // } - return createToken(lexer, _tokenKind.TokenKind.BRACE_R, position, position + 1); - // StringValue - - case 0x0022: - // " - if (body.charCodeAt(position + 1) === 0x0022 && body.charCodeAt(position + 2) === 0x0022) { - return readBlockString(lexer, position); - } - return readString(lexer, position); - } // IntValue | FloatValue (Digit | -) - - if ((0, _characterClasses.isDigit)(code) || code === 0x002d) { - return readNumber(lexer, position, code); - } // Name - - if ((0, _characterClasses.isNameStart)(code)) { - return readName(lexer, position); - } - throw (0, _syntaxError.syntaxError)(lexer.source, position, code === 0x0027 ? 'Unexpected single quote character (\'), did you mean to use a double quote (")?' : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position) ? `Unexpected character: ${printCodePointAt(lexer, position)}.` : `Invalid character: ${printCodePointAt(lexer, position)}.`); - } - return createToken(lexer, _tokenKind.TokenKind.EOF, bodyLength, bodyLength); -} -/** - * Reads a comment token from the source file. - * - * ``` - * Comment :: # CommentChar* [lookahead != CommentChar] - * - * CommentChar :: SourceCharacter but not LineTerminator - * ``` - */ - -function readComment(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let position = start + 1; - while (position < bodyLength) { - const code = body.charCodeAt(position); // LineTerminator (\n | \r) - - if (code === 0x000a || code === 0x000d) { - break; - } // SourceCharacter - - if (isUnicodeScalarValue(code)) { - ++position; - } else if (isSupplementaryCodePoint(body, position)) { - position += 2; - } else { - break; - } - } - return createToken(lexer, _tokenKind.TokenKind.COMMENT, start, position, body.slice(start + 1, position)); -} -/** - * Reads a number token from the source file, either a FloatValue or an IntValue - * depending on whether a FractionalPart or ExponentPart is encountered. - * - * ``` - * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}] - * - * IntegerPart :: - * - NegativeSign? 0 - * - NegativeSign? NonZeroDigit Digit* - * - * NegativeSign :: - - * - * NonZeroDigit :: Digit but not `0` - * - * FloatValue :: - * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}] - * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}] - * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}] - * - * FractionalPart :: . Digit+ - * - * ExponentPart :: ExponentIndicator Sign? Digit+ - * - * ExponentIndicator :: one of `e` `E` - * - * Sign :: one of + - - * ``` - */ - -function readNumber(lexer, start, firstCode) { - const body = lexer.source.body; - let position = start; - let code = firstCode; - let isFloat = false; // NegativeSign (-) - - if (code === 0x002d) { - code = body.charCodeAt(++position); - } // Zero (0) - - if (code === 0x0030) { - code = body.charCodeAt(++position); - if ((0, _characterClasses.isDigit)(code)) { - throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid number, unexpected digit after 0: ${printCodePointAt(lexer, position)}.`); - } - } else { - position = readDigits(lexer, position, code); - code = body.charCodeAt(position); - } // Full stop (.) - - if (code === 0x002e) { - isFloat = true; - code = body.charCodeAt(++position); - position = readDigits(lexer, position, code); - code = body.charCodeAt(position); - } // E e - - if (code === 0x0045 || code === 0x0065) { - isFloat = true; - code = body.charCodeAt(++position); // + - - - if (code === 0x002b || code === 0x002d) { - code = body.charCodeAt(++position); - } - position = readDigits(lexer, position, code); - code = body.charCodeAt(position); - } // Numbers cannot be followed by . or NameStart - - if (code === 0x002e || (0, _characterClasses.isNameStart)(code)) { - throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid number, expected digit but got: ${printCodePointAt(lexer, position)}.`); - } - return createToken(lexer, isFloat ? _tokenKind.TokenKind.FLOAT : _tokenKind.TokenKind.INT, start, position, body.slice(start, position)); -} -/** - * Returns the new position in the source after reading one or more digits. - */ - -function readDigits(lexer, start, firstCode) { - if (!(0, _characterClasses.isDigit)(firstCode)) { - throw (0, _syntaxError.syntaxError)(lexer.source, start, `Invalid number, expected digit but got: ${printCodePointAt(lexer, start)}.`); - } - const body = lexer.source.body; - let position = start + 1; // +1 to skip first firstCode - - while ((0, _characterClasses.isDigit)(body.charCodeAt(position))) { - ++position; - } - return position; -} -/** - * Reads a single-quote string token from the source file. - * - * ``` - * StringValue :: - * - `""` [lookahead != `"`] - * - `"` StringCharacter+ `"` - * - * StringCharacter :: - * - SourceCharacter but not `"` or `\` or LineTerminator - * - `\u` EscapedUnicode - * - `\` EscapedCharacter - * - * EscapedUnicode :: - * - `{` HexDigit+ `}` - * - HexDigit HexDigit HexDigit HexDigit - * - * EscapedCharacter :: one of `"` `\` `/` `b` `f` `n` `r` `t` - * ``` - */ - -function readString(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let position = start + 1; - let chunkStart = position; - let value = ''; - while (position < bodyLength) { - const code = body.charCodeAt(position); // Closing Quote (") - - if (code === 0x0022) { - value += body.slice(chunkStart, position); - return createToken(lexer, _tokenKind.TokenKind.STRING, start, position + 1, value); - } // Escape Sequence (\) - - if (code === 0x005c) { - value += body.slice(chunkStart, position); - const escape = body.charCodeAt(position + 1) === 0x0075 // u - ? body.charCodeAt(position + 2) === 0x007b // { - ? readEscapedUnicodeVariableWidth(lexer, position) : readEscapedUnicodeFixedWidth(lexer, position) : readEscapedCharacter(lexer, position); - value += escape.value; - position += escape.size; - chunkStart = position; - continue; - } // LineTerminator (\n | \r) - - if (code === 0x000a || code === 0x000d) { - break; - } // SourceCharacter - - if (isUnicodeScalarValue(code)) { - ++position; - } else if (isSupplementaryCodePoint(body, position)) { - position += 2; - } else { - throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`); - } - } - throw (0, _syntaxError.syntaxError)(lexer.source, position, 'Unterminated string.'); -} // The string value and lexed size of an escape sequence. - -function readEscapedUnicodeVariableWidth(lexer, position) { - const body = lexer.source.body; - let point = 0; - let size = 3; // Cannot be larger than 12 chars (\u{00000000}). - - while (size < 12) { - const code = body.charCodeAt(position + size++); // Closing Brace (}) - - if (code === 0x007d) { - // Must be at least 5 chars (\u{0}) and encode a Unicode scalar value. - if (size < 5 || !isUnicodeScalarValue(point)) { - break; + ProjectionNode.prototype.addEventListener = function (name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new SubscriptionManager()); } - return { - value: String.fromCodePoint(point), - size - }; - } // Append this hex digit to the code point. - - point = point << 4 | readHexDigit(code); - if (point < 0) { - break; - } - } - throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + size)}".`); -} -function readEscapedUnicodeFixedWidth(lexer, position) { - const body = lexer.source.body; - const code = read16BitHexCode(body, position + 2); - if (isUnicodeScalarValue(code)) { - return { - value: String.fromCodePoint(code), - size: 6 + return this.eventHandlers.get(name).add(handler); }; - } // GraphQL allows JSON-style surrogate pair escape sequences, but only when - // a valid pair is formed. - - if (isLeadingSurrogate(code)) { - // \u - if (body.charCodeAt(position + 6) === 0x005c && body.charCodeAt(position + 7) === 0x0075) { - const trailingCode = read16BitHexCode(body, position + 8); - if (isTrailingSurrogate(trailingCode)) { - // JavaScript defines strings as a sequence of UTF-16 code units and - // encodes Unicode code points above U+FFFF using a surrogate pair of - // code units. Since this is a surrogate pair escape sequence, just - // include both codes into the JavaScript string value. Had JavaScript - // not been internally based on UTF-16, then this surrogate pair would - // be decoded to retrieve the supplementary code point. - return { - value: String.fromCodePoint(code, trailingCode), - size: 12 + ProjectionNode.prototype.notifyListeners = function (name) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + var subscriptionManager = this.eventHandlers.get(name); + subscriptionManager === null || subscriptionManager === void 0 ? void 0 : subscriptionManager.notify.apply(subscriptionManager, tslib.__spreadArray([], tslib.__read(args), false)); + }; + ProjectionNode.prototype.hasListeners = function (name) { + return this.eventHandlers.has(name); + }; + ProjectionNode.prototype.registerPotentialNode = function (id, node) { + this.potentialNodes.set(id, node); + }; + /** + * Lifecycles + */ + ProjectionNode.prototype.mount = function (instance, isLayoutDirty) { + var _this = this; + var _a; + if (isLayoutDirty === void 0) { + isLayoutDirty = false; + } + if (this.instance) return; + this.isSVG = instance instanceof SVGElement && instance.tagName !== "svg"; + this.instance = instance; + var _b = this.options, + layoutId = _b.layoutId, + layout = _b.layout, + visualElement = _b.visualElement; + if (visualElement && !visualElement.getInstance()) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + (_a = this.parent) === null || _a === void 0 ? void 0 : _a.children.add(this); + this.id && this.root.potentialNodes.delete(this.id); + if (isLayoutDirty && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + var unblockTimeout_1; + var resizeUnblockUpdate_1 = function () { + return _this.root.updateBlockedByResize = false; }; + attachResizeListener(instance, function () { + _this.root.updateBlockedByResize = true; + clearTimeout(unblockTimeout_1); + unblockTimeout_1 = window.setTimeout(resizeUnblockUpdate_1, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + _this.nodes.forEach(finishAnimation); + } + }); } - } - } - throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".`); -} -/** - * Reads four hexadecimal characters and returns the positive integer that 16bit - * hexadecimal string represents. For example, "000f" will return 15, and "dead" - * will return 57005. - * - * Returns a negative number if any char was not a valid hexadecimal digit. - */ - -function read16BitHexCode(body, position) { - // readHexDigit() returns -1 on error. ORing a negative value with any other - // value always produces a negative value. - return readHexDigit(body.charCodeAt(position)) << 12 | readHexDigit(body.charCodeAt(position + 1)) << 8 | readHexDigit(body.charCodeAt(position + 2)) << 4 | readHexDigit(body.charCodeAt(position + 3)); -} -/** - * Reads a hexadecimal character and returns its positive integer value (0-15). - * - * '0' becomes 0, '9' becomes 9 - * 'A' becomes 10, 'F' becomes 15 - * 'a' becomes 10, 'f' becomes 15 - * - * Returns -1 if the provided character code was not a valid hexadecimal digit. - * - * HexDigit :: one of - * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` - * - `A` `B` `C` `D` `E` `F` - * - `a` `b` `c` `d` `e` `f` - */ - -function readHexDigit(code) { - return code >= 0x0030 && code <= 0x0039 // 0-9 - ? code - 0x0030 : code >= 0x0041 && code <= 0x0046 // A-F - ? code - 0x0037 : code >= 0x0061 && code <= 0x0066 // a-f - ? code - 0x0057 : -1; -} -/** - * | Escaped Character | Code Point | Character Name | - * | ----------------- | ---------- | ---------------------------- | - * | `"` | U+0022 | double quote | - * | `\` | U+005C | reverse solidus (back slash) | - * | `/` | U+002F | solidus (forward slash) | - * | `b` | U+0008 | backspace | - * | `f` | U+000C | form feed | - * | `n` | U+000A | line feed (new line) | - * | `r` | U+000D | carriage return | - * | `t` | U+0009 | horizontal tab | - */ - -function readEscapedCharacter(lexer, position) { - const body = lexer.source.body; - const code = body.charCodeAt(position + 1); - switch (code) { - case 0x0022: - // " - return { - value: '\u0022', - size: 2 - }; - case 0x005c: - // \ - return { - value: '\u005c', - size: 2 - }; - case 0x002f: - // / - return { - value: '\u002f', - size: 2 - }; - case 0x0062: - // b - return { - value: '\u0008', - size: 2 - }; - case 0x0066: - // f - return { - value: '\u000c', - size: 2 - }; - case 0x006e: - // n - return { - value: '\u000a', - size: 2 - }; - case 0x0072: - // r - return { - value: '\u000d', - size: 2 - }; - case 0x0074: - // t - return { - value: '\u0009', - size: 2 - }; - } - throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid character escape sequence: "${body.slice(position, position + 2)}".`); -} -/** - * Reads a block string token from the source file. - * - * ``` - * StringValue :: - * - `"""` BlockStringCharacter* `"""` - * - * BlockStringCharacter :: - * - SourceCharacter but not `"""` or `\"""` - * - `\"""` - * ``` - */ - -function readBlockString(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let lineStart = lexer.lineStart; - let position = start + 3; - let chunkStart = position; - let currentLine = ''; - const blockLines = []; - while (position < bodyLength) { - const code = body.charCodeAt(position); // Closing Triple-Quote (""") - - if (code === 0x0022 && body.charCodeAt(position + 1) === 0x0022 && body.charCodeAt(position + 2) === 0x0022) { - currentLine += body.slice(chunkStart, position); - blockLines.push(currentLine); - const token = createToken(lexer, _tokenKind.TokenKind.BLOCK_STRING, start, position + 3, - // Return a string of the lines joined with U+000A. - (0, _blockString.dedentBlockStringLines)(blockLines).join('\n')); - lexer.line += blockLines.length - 1; - lexer.lineStart = lineStart; - return token; - } // Escaped Triple-Quote (\""") - - if (code === 0x005c && body.charCodeAt(position + 1) === 0x0022 && body.charCodeAt(position + 2) === 0x0022 && body.charCodeAt(position + 3) === 0x0022) { - currentLine += body.slice(chunkStart, position); - chunkStart = position + 1; // skip only slash - - position += 4; - continue; - } // LineTerminator - - if (code === 0x000a || code === 0x000d) { - currentLine += body.slice(chunkStart, position); - blockLines.push(currentLine); - if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) { - position += 2; - } else { - ++position; + if (layoutId) { + this.root.registerSharedNode(layoutId, this); } - currentLine = ''; - chunkStart = position; - lineStart = position; - continue; - } // SourceCharacter - - if (isUnicodeScalarValue(code)) { - ++position; - } else if (isSupplementaryCodePoint(body, position)) { - position += 2; - } else { - throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`); - } - } - throw (0, _syntaxError.syntaxError)(lexer.source, position, 'Unterminated string.'); -} -/** - * Reads an alphanumeric + underscore name from the source. - * - * ``` - * Name :: - * - NameStart NameContinue* [lookahead != NameContinue] - * ``` - */ - -function readName(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let position = start + 1; - while (position < bodyLength) { - const code = body.charCodeAt(position); - if ((0, _characterClasses.isNameContinue)(code)) { - ++position; - } else { - break; - } - } - return createToken(lexer, _tokenKind.TokenKind.NAME, start, position, body.slice(start, position)); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/language/location.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/language/location.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.getLocation = getLocation; -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -const LineRegExp = /\r\n|[\n\r]/g; -/** - * Represents a location in a Source. - */ - -/** - * Takes a Source and a UTF-8 character offset, and returns the corresponding - * line and column as a SourceLocation. - */ -function getLocation(source, position) { - let lastLineStart = 0; - let line = 1; - for (const match of source.body.matchAll(LineRegExp)) { - typeof match.index === 'number' || (0, _invariant.invariant)(false); - if (match.index >= position) { - break; - } - lastLineStart = match.index + match[0].length; - line += 1; - } - return { - line, - column: position + 1 - lastLineStart - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/language/parser.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/language/parser.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.Parser = void 0; -exports.parse = parse; -exports.parseConstValue = parseConstValue; -exports.parseType = parseType; -exports.parseValue = parseValue; -var _syntaxError = __webpack_require__(/*! ../error/syntaxError.mjs */ "../../../node_modules/graphql/error/syntaxError.mjs"); -var _ast = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -var _directiveLocation = __webpack_require__(/*! ./directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); -var _kinds = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _lexer = __webpack_require__(/*! ./lexer.mjs */ "../../../node_modules/graphql/language/lexer.mjs"); -var _source = __webpack_require__(/*! ./source.mjs */ "../../../node_modules/graphql/language/source.mjs"); -var _tokenKind = __webpack_require__(/*! ./tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); -/** - * Configuration options to control parser behavior - */ - -/** - * Given a GraphQL source, parses it into a Document. - * Throws GraphQLError if a syntax error is encountered. - */ -function parse(source, options) { - const parser = new Parser(source, options); - return parser.parseDocument(); -} -/** - * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for - * that value. - * Throws GraphQLError if a syntax error is encountered. - * - * This is useful within tools that operate upon GraphQL Values directly and - * in isolation of complete GraphQL documents. - * - * Consider providing the results to the utility function: valueFromAST(). - */ - -function parseValue(source, options) { - const parser = new Parser(source, options); - parser.expectToken(_tokenKind.TokenKind.SOF); - const value = parser.parseValueLiteral(false); - parser.expectToken(_tokenKind.TokenKind.EOF); - return value; -} -/** - * Similar to parseValue(), but raises a parse error if it encounters a - * variable. The return type will be a constant value. - */ - -function parseConstValue(source, options) { - const parser = new Parser(source, options); - parser.expectToken(_tokenKind.TokenKind.SOF); - const value = parser.parseConstValueLiteral(); - parser.expectToken(_tokenKind.TokenKind.EOF); - return value; -} -/** - * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for - * that type. - * Throws GraphQLError if a syntax error is encountered. - * - * This is useful within tools that operate upon GraphQL Types directly and - * in isolation of complete GraphQL documents. - * - * Consider providing the results to the utility function: typeFromAST(). - */ - -function parseType(source, options) { - const parser = new Parser(source, options); - parser.expectToken(_tokenKind.TokenKind.SOF); - const type = parser.parseTypeReference(); - parser.expectToken(_tokenKind.TokenKind.EOF); - return type; -} -/** - * This class is exported only to assist people in implementing their own parsers - * without duplicating too much code and should be used only as last resort for cases - * such as experimental syntax or if certain features could not be contributed upstream. - * - * It is still part of the internal API and is versioned, so any changes to it are never - * considered breaking changes. If you still need to support multiple versions of the - * library, please use the `versionInfo` variable for version detection. - * - * @internal - */ - -class Parser { - constructor(source, options = {}) { - const sourceObj = (0, _source.isSource)(source) ? source : new _source.Source(source); - this._lexer = new _lexer.Lexer(sourceObj); - this._options = options; - this._tokenCounter = 0; - } - /** - * Converts a name lex token into a name parse node. - */ - - parseName() { - const token = this.expectToken(_tokenKind.TokenKind.NAME); - return this.node(token, { - kind: _kinds.Kind.NAME, - value: token.value - }); - } // Implements the parsing rules in the Document section. - - /** - * Document : Definition+ - */ - - parseDocument() { - return this.node(this._lexer.token, { - kind: _kinds.Kind.DOCUMENT, - definitions: this.many(_tokenKind.TokenKind.SOF, this.parseDefinition, _tokenKind.TokenKind.EOF) - }); - } - /** - * Definition : - * - ExecutableDefinition - * - TypeSystemDefinition - * - TypeSystemExtension - * - * ExecutableDefinition : - * - OperationDefinition - * - FragmentDefinition - * - * TypeSystemDefinition : - * - SchemaDefinition - * - TypeDefinition - * - DirectiveDefinition - * - * TypeDefinition : - * - ScalarTypeDefinition - * - ObjectTypeDefinition - * - InterfaceTypeDefinition - * - UnionTypeDefinition - * - EnumTypeDefinition - * - InputObjectTypeDefinition - */ - - parseDefinition() { - if (this.peek(_tokenKind.TokenKind.BRACE_L)) { - return this.parseOperationDefinition(); - } // Many definitions begin with a description and require a lookahead. - - const hasDescription = this.peekDescription(); - const keywordToken = hasDescription ? this._lexer.lookahead() : this._lexer.token; - if (keywordToken.kind === _tokenKind.TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaDefinition(); - case 'scalar': - return this.parseScalarTypeDefinition(); - case 'type': - return this.parseObjectTypeDefinition(); - case 'interface': - return this.parseInterfaceTypeDefinition(); - case 'union': - return this.parseUnionTypeDefinition(); - case 'enum': - return this.parseEnumTypeDefinition(); - case 'input': - return this.parseInputObjectTypeDefinition(); - case 'directive': - return this.parseDirectiveDefinition(); + // Only register the handler if it requires layout animation + if (this.options.animate !== false && visualElement && (layoutId || layout)) { + this.addEventListener("didUpdate", function (_a) { + var _b, _c, _d, _e, _f; + var delta = _a.delta, + hasLayoutChanged = _a.hasLayoutChanged, + hasRelativeTargetChanged = _a.hasRelativeTargetChanged, + newLayout = _a.layout; + if (_this.isTreeAnimationBlocked()) { + _this.target = undefined; + _this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + var layoutTransition = (_c = (_b = _this.options.transition) !== null && _b !== void 0 ? _b : visualElement.getDefaultTransition()) !== null && _c !== void 0 ? _c : defaultLayoutTransition; + var _g = visualElement.getProps(), + onLayoutAnimationStart = _g.onLayoutAnimationStart, + onLayoutAnimationComplete = _g.onLayoutAnimationComplete; + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + var targetChanged = !_this.targetLayout || !boxEquals(_this.targetLayout, newLayout) || hasRelativeTargetChanged; + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + var hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged; + if (((_d = _this.resumeFrom) === null || _d === void 0 ? void 0 : _d.instance) || hasOnlyRelativeTargetChanged || hasLayoutChanged && (targetChanged || !_this.currentAnimation)) { + if (_this.resumeFrom) { + _this.resumingFrom = _this.resumeFrom; + _this.resumingFrom.resumingFrom = undefined; + } + _this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); + var animationOptions = tslib.__assign(tslib.__assign({}, getValueTransition(layoutTransition, "layout")), { + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete + }); + if (visualElement.shouldReduceMotion) { + animationOptions.delay = 0; + animationOptions.type = false; + } + _this.startAnimation(animationOptions); + } else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never commited to screen and look like a jumpy box. + */ + if (!hasLayoutChanged && _this.animationProgress === 0) { + _this.finishAnimation(); + } + _this.isLead() && ((_f = (_e = _this.options).onExitComplete) === null || _f === void 0 ? void 0 : _f.call(_e)); + } + _this.targetLayout = newLayout; + }); } - if (hasDescription) { - throw (0, _syntaxError.syntaxError)(this._lexer.source, this._lexer.token.start, 'Unexpected description, descriptions are supported only on type definitions.'); + }; + ProjectionNode.prototype.unmount = function () { + var _a, _b; + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.remove(this); + (_b = this.parent) === null || _b === void 0 ? void 0 : _b.children.delete(this); + this.instance = undefined; + sync.cancelSync.preRender(this.updateProjection); + }; + // only on the root + ProjectionNode.prototype.blockUpdate = function () { + this.updateManuallyBlocked = true; + }; + ProjectionNode.prototype.unblockUpdate = function () { + this.updateManuallyBlocked = false; + }; + ProjectionNode.prototype.isUpdateBlocked = function () { + return this.updateManuallyBlocked || this.updateBlockedByResize; + }; + ProjectionNode.prototype.isTreeAnimationBlocked = function () { + var _a; + return this.isAnimationBlocked || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isTreeAnimationBlocked()) || false; + }; + // Note: currently only running on root node + ProjectionNode.prototype.startUpdate = function () { + var _a; + if (this.isUpdateBlocked()) return; + this.isUpdating = true; + (_a = this.nodes) === null || _a === void 0 ? void 0 : _a.forEach(resetRotation); + }; + ProjectionNode.prototype.willUpdate = function (shouldNotifyListeners) { + var _a, _b, _c; + if (shouldNotifyListeners === void 0) { + shouldNotifyListeners = true; } - switch (keywordToken.value) { - case 'query': - case 'mutation': - case 'subscription': - return this.parseOperationDefinition(); - case 'fragment': - return this.parseFragmentDefinition(); - case 'extend': - return this.parseTypeSystemExtension(); + if (this.root.isUpdateBlocked()) { + (_b = (_a = this.options).onExitComplete) === null || _b === void 0 ? void 0 : _b.call(_a); + return; } - } - throw this.unexpected(keywordToken); - } // Implements the parsing rules in the Operations section. - - /** - * OperationDefinition : - * - SelectionSet - * - OperationType Name? VariableDefinitions? Directives? SelectionSet - */ - - parseOperationDefinition() { - const start = this._lexer.token; - if (this.peek(_tokenKind.TokenKind.BRACE_L)) { - return this.node(start, { - kind: _kinds.Kind.OPERATION_DEFINITION, - operation: _ast.OperationTypeNode.QUERY, - name: undefined, - variableDefinitions: [], - directives: [], - selectionSet: this.parseSelectionSet() - }); - } - const operation = this.parseOperationType(); - let name; - if (this.peek(_tokenKind.TokenKind.NAME)) { - name = this.parseName(); - } - return this.node(start, { - kind: _kinds.Kind.OPERATION_DEFINITION, - operation, - name, - variableDefinitions: this.parseVariableDefinitions(), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet() - }); - } - /** - * OperationType : one of query mutation subscription - */ - - parseOperationType() { - const operationToken = this.expectToken(_tokenKind.TokenKind.NAME); - switch (operationToken.value) { - case 'query': - return _ast.OperationTypeNode.QUERY; - case 'mutation': - return _ast.OperationTypeNode.MUTATION; - case 'subscription': - return _ast.OperationTypeNode.SUBSCRIPTION; - } - throw this.unexpected(operationToken); - } - /** - * VariableDefinitions : ( VariableDefinition+ ) - */ - - parseVariableDefinitions() { - return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseVariableDefinition, _tokenKind.TokenKind.PAREN_R); - } - /** - * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? - */ - - parseVariableDefinition() { - return this.node(this._lexer.token, { - kind: _kinds.Kind.VARIABLE_DEFINITION, - variable: this.parseVariable(), - type: (this.expectToken(_tokenKind.TokenKind.COLON), this.parseTypeReference()), - defaultValue: this.expectOptionalToken(_tokenKind.TokenKind.EQUALS) ? this.parseConstValueLiteral() : undefined, - directives: this.parseConstDirectives() - }); - } - /** - * Variable : $ Name - */ - - parseVariable() { - const start = this._lexer.token; - this.expectToken(_tokenKind.TokenKind.DOLLAR); - return this.node(start, { - kind: _kinds.Kind.VARIABLE, - name: this.parseName() - }); - } - /** - * ``` - * SelectionSet : { Selection+ } - * ``` - */ - - parseSelectionSet() { - return this.node(this._lexer.token, { - kind: _kinds.Kind.SELECTION_SET, - selections: this.many(_tokenKind.TokenKind.BRACE_L, this.parseSelection, _tokenKind.TokenKind.BRACE_R) - }); - } - /** - * Selection : - * - Field - * - FragmentSpread - * - InlineFragment - */ - - parseSelection() { - return this.peek(_tokenKind.TokenKind.SPREAD) ? this.parseFragment() : this.parseField(); - } - /** - * Field : Alias? Name Arguments? Directives? SelectionSet? - * - * Alias : Name : - */ - - parseField() { - const start = this._lexer.token; - const nameOrAlias = this.parseName(); - let alias; - let name; - if (this.expectOptionalToken(_tokenKind.TokenKind.COLON)) { - alias = nameOrAlias; - name = this.parseName(); - } else { - name = nameOrAlias; - } - return this.node(start, { - kind: _kinds.Kind.FIELD, - alias, - name, - arguments: this.parseArguments(false), - directives: this.parseDirectives(false), - selectionSet: this.peek(_tokenKind.TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined - }); - } - /** - * Arguments[Const] : ( Argument[?Const]+ ) - */ - - parseArguments(isConst) { - const item = isConst ? this.parseConstArgument : this.parseArgument; - return this.optionalMany(_tokenKind.TokenKind.PAREN_L, item, _tokenKind.TokenKind.PAREN_R); - } - /** - * Argument[Const] : Name : Value[?Const] - */ - - parseArgument(isConst = false) { - const start = this._lexer.token; - const name = this.parseName(); - this.expectToken(_tokenKind.TokenKind.COLON); - return this.node(start, { - kind: _kinds.Kind.ARGUMENT, - name, - value: this.parseValueLiteral(isConst) - }); - } - parseConstArgument() { - return this.parseArgument(true); - } // Implements the parsing rules in the Fragments section. - - /** - * Corresponds to both FragmentSpread and InlineFragment in the spec. - * - * FragmentSpread : ... FragmentName Directives? - * - * InlineFragment : ... TypeCondition? Directives? SelectionSet - */ - - parseFragment() { - const start = this._lexer.token; - this.expectToken(_tokenKind.TokenKind.SPREAD); - const hasTypeCondition = this.expectOptionalKeyword('on'); - if (!hasTypeCondition && this.peek(_tokenKind.TokenKind.NAME)) { - return this.node(start, { - kind: _kinds.Kind.FRAGMENT_SPREAD, - name: this.parseFragmentName(), - directives: this.parseDirectives(false) - }); - } - return this.node(start, { - kind: _kinds.Kind.INLINE_FRAGMENT, - typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet() - }); - } - /** - * FragmentDefinition : - * - fragment FragmentName on TypeCondition Directives? SelectionSet - * - * TypeCondition : NamedType - */ - - parseFragmentDefinition() { - const start = this._lexer.token; - this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes - // the grammar of FragmentDefinition: - // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet - - if (this._options.allowLegacyFragmentVariables === true) { - return this.node(start, { - kind: _kinds.Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - variableDefinitions: this.parseVariableDefinitions(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet() + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) return; + this.isLayoutDirty = true; + for (var i = 0; i < this.path.length; i++) { + var node = this.path[i]; + node.shouldResetTransform = true; + /** + * TODO: Check we haven't updated the scroll + * since the last didUpdate + */ + node.updateScroll(); + } + var _d = this.options, + layoutId = _d.layoutId, + layout = _d.layout; + if (layoutId === undefined && !layout) return; + var transformTemplate = (_c = this.options.visualElement) === null || _c === void 0 ? void 0 : _c.getProps().transformTemplate; + this.prevTransformTemplateValue = transformTemplate === null || transformTemplate === void 0 ? void 0 : transformTemplate(this.latestValues, ""); + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + }; + // Note: Currently only running on root node + ProjectionNode.prototype.didUpdate = function () { + var updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + this.unblockUpdate(); + this.clearAllSnapshots(); + this.nodes.forEach(clearMeasurements); + return; + } + if (!this.isUpdating) return; + this.isUpdating = false; + /** + * Search for and mount newly-added projection elements. + * + * TODO: Every time a new component is rendered we could search up the tree for + * the closest mounted node and query from there rather than document. + */ + if (this.potentialNodes.size) { + this.potentialNodes.forEach(mountNodeEarly); + this.potentialNodes.clear(); + } + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + this.clearAllSnapshots(); + // Flush any scheduled updates + sync.flushSync.update(); + sync.flushSync.preRender(); + sync.flushSync.render(); + }; + ProjectionNode.prototype.clearAllSnapshots = function () { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + }; + ProjectionNode.prototype.scheduleUpdateProjection = function () { + sync__default["default"].preRender(this.updateProjection, false, true); + }; + ProjectionNode.prototype.scheduleCheckAfterUnmount = function () { + var _this = this; + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + sync__default["default"].postRender(function () { + if (_this.isLayoutDirty) { + _this.root.didUpdate(); + } else { + _this.root.checkUpdateFailed(); + } }); - } - return this.node(start, { - kind: _kinds.Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet() - }); - } - /** - * FragmentName : Name but not `on` - */ - - parseFragmentName() { - if (this._lexer.token.value === 'on') { - throw this.unexpected(); - } - return this.parseName(); - } // Implements the parsing rules in the Values section. - - /** - * Value[Const] : - * - [~Const] Variable - * - IntValue - * - FloatValue - * - StringValue - * - BooleanValue - * - NullValue - * - EnumValue - * - ListValue[?Const] - * - ObjectValue[?Const] - * - * BooleanValue : one of `true` `false` - * - * NullValue : `null` - * - * EnumValue : Name but not `true`, `false` or `null` - */ - - parseValueLiteral(isConst) { - const token = this._lexer.token; - switch (token.kind) { - case _tokenKind.TokenKind.BRACKET_L: - return this.parseList(isConst); - case _tokenKind.TokenKind.BRACE_L: - return this.parseObject(isConst); - case _tokenKind.TokenKind.INT: - this.advanceLexer(); - return this.node(token, { - kind: _kinds.Kind.INT, - value: token.value - }); - case _tokenKind.TokenKind.FLOAT: - this.advanceLexer(); - return this.node(token, { - kind: _kinds.Kind.FLOAT, - value: token.value - }); - case _tokenKind.TokenKind.STRING: - case _tokenKind.TokenKind.BLOCK_STRING: - return this.parseStringLiteral(); - case _tokenKind.TokenKind.NAME: - this.advanceLexer(); - switch (token.value) { - case 'true': - return this.node(token, { - kind: _kinds.Kind.BOOLEAN, - value: true - }); - case 'false': - return this.node(token, { - kind: _kinds.Kind.BOOLEAN, - value: false - }); - case 'null': - return this.node(token, { - kind: _kinds.Kind.NULL - }); - default: - return this.node(token, { - kind: _kinds.Kind.ENUM, - value: token.value - }); + }; + /** + * Update measurements + */ + ProjectionNode.prototype.updateSnapshot = function () { + if (this.snapshot || !this.instance) return; + var measured = this.measure(); + var layout = this.removeTransform(this.removeElementScroll(measured)); + roundBox(layout); + this.snapshot = { + measured: measured, + layout: layout, + latestValues: {} + }; + }; + ProjectionNode.prototype.updateLayout = function () { + var _a; + if (!this.instance) return; + // TODO: Incorporate into a forwarded scroll offset + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (var i = 0; i < this.path.length; i++) { + var node = this.path[i]; + node.updateScroll(); } - case _tokenKind.TokenKind.DOLLAR: - if (isConst) { - this.expectToken(_tokenKind.TokenKind.DOLLAR); - if (this._lexer.token.kind === _tokenKind.TokenKind.NAME) { - const varName = this._lexer.token.value; - throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Unexpected variable "$${varName}" in constant value.`); - } else { - throw this.unexpected(token); + } + var measured = this.measure(); + roundBox(measured); + var prevLayout = this.layout; + this.layout = { + measured: measured, + actual: this.removeElementScroll(measured) + }; + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.actual); + (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.notifyLayoutMeasure(this.layout.actual, prevLayout === null || prevLayout === void 0 ? void 0 : prevLayout.actual); + }; + ProjectionNode.prototype.updateScroll = function () { + if (this.options.layoutScroll && this.instance) { + this.isScrollRoot = checkIsScrollRoot(this.instance); + this.scroll = measureScroll(this.instance); + } + }; + ProjectionNode.prototype.resetTransform = function () { + var _a; + if (!resetTransform) return; + var isResetRequested = this.isLayoutDirty || this.shouldResetTransform; + var hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + var transformTemplate = (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.getProps().transformTemplate; + var transformTemplateValue = transformTemplate === null || transformTemplate === void 0 ? void 0 : transformTemplate(this.latestValues, ""); + var transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && (hasProjection || hasTransform(this.latestValues) || transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + }; + ProjectionNode.prototype.measure = function () { + var visualElement = this.options.visualElement; + if (!visualElement) return createBox(); + var box = visualElement.measureViewportBox(); + // Remove viewport scroll to give page-relative coordinates + var scroll = this.root.scroll; + if (scroll) { + translateAxis(box.x, scroll.x); + translateAxis(box.y, scroll.y); + } + return box; + }; + ProjectionNode.prototype.removeElementScroll = function (box) { + var boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (var i = 0; i < this.path.length; i++) { + var node = this.path[i]; + var scroll_1 = node.scroll, + options = node.options, + isScrollRoot = node.isScrollRoot; + if (node !== this.root && scroll_1 && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (isScrollRoot) { + copyBoxInto(boxWithoutScroll, box); + var rootScroll = this.root.scroll; + /** + * Undo the application of page scroll that was originally added + * to the measured bounding box. + */ + if (rootScroll) { + translateAxis(boxWithoutScroll.x, -rootScroll.x); + translateAxis(boxWithoutScroll.y, -rootScroll.y); + } } + translateAxis(boxWithoutScroll.x, scroll_1.x); + translateAxis(boxWithoutScroll.y, scroll_1.y); } - return this.parseVariable(); - default: - throw this.unexpected(); - } - } - parseConstValueLiteral() { - return this.parseValueLiteral(true); - } - parseStringLiteral() { - const token = this._lexer.token; - this.advanceLexer(); - return this.node(token, { - kind: _kinds.Kind.STRING, - value: token.value, - block: token.kind === _tokenKind.TokenKind.BLOCK_STRING - }); - } - /** - * ListValue[Const] : - * - [ ] - * - [ Value[?Const]+ ] - */ - - parseList(isConst) { - const item = () => this.parseValueLiteral(isConst); - return this.node(this._lexer.token, { - kind: _kinds.Kind.LIST, - values: this.any(_tokenKind.TokenKind.BRACKET_L, item, _tokenKind.TokenKind.BRACKET_R) - }); - } - /** - * ``` - * ObjectValue[Const] : - * - { } - * - { ObjectField[?Const]+ } - * ``` - */ - - parseObject(isConst) { - const item = () => this.parseObjectField(isConst); - return this.node(this._lexer.token, { - kind: _kinds.Kind.OBJECT, - fields: this.any(_tokenKind.TokenKind.BRACE_L, item, _tokenKind.TokenKind.BRACE_R) - }); - } - /** - * ObjectField[Const] : Name : Value[?Const] - */ - - parseObjectField(isConst) { - const start = this._lexer.token; - const name = this.parseName(); - this.expectToken(_tokenKind.TokenKind.COLON); - return this.node(start, { - kind: _kinds.Kind.OBJECT_FIELD, - name, - value: this.parseValueLiteral(isConst) - }); - } // Implements the parsing rules in the Directives section. - - /** - * Directives[Const] : Directive[?Const]+ - */ - - parseDirectives(isConst) { - const directives = []; - while (this.peek(_tokenKind.TokenKind.AT)) { - directives.push(this.parseDirective(isConst)); - } - return directives; - } - parseConstDirectives() { - return this.parseDirectives(true); - } - /** - * ``` - * Directive[Const] : @ Name Arguments[?Const]? - * ``` - */ - - parseDirective(isConst) { - const start = this._lexer.token; - this.expectToken(_tokenKind.TokenKind.AT); - return this.node(start, { - kind: _kinds.Kind.DIRECTIVE, - name: this.parseName(), - arguments: this.parseArguments(isConst) - }); - } // Implements the parsing rules in the Types section. - - /** - * Type : - * - NamedType - * - ListType - * - NonNullType - */ - - parseTypeReference() { - const start = this._lexer.token; - let type; - if (this.expectOptionalToken(_tokenKind.TokenKind.BRACKET_L)) { - const innerType = this.parseTypeReference(); - this.expectToken(_tokenKind.TokenKind.BRACKET_R); - type = this.node(start, { - kind: _kinds.Kind.LIST_TYPE, - type: innerType - }); - } else { - type = this.parseNamedType(); - } - if (this.expectOptionalToken(_tokenKind.TokenKind.BANG)) { - return this.node(start, { - kind: _kinds.Kind.NON_NULL_TYPE, - type + } + return boxWithoutScroll; + }; + ProjectionNode.prototype.applyTransform = function (box, transformOnly) { + if (transformOnly === void 0) { + transformOnly = false; + } + var withTransforms = createBox(); + copyBoxInto(withTransforms, box); + for (var i = 0; i < this.path.length; i++) { + var node = this.path[i]; + if (!transformOnly && node.options.layoutScroll && node.scroll && node !== node.root) { + transformBox(withTransforms, { + x: -node.scroll.x, + y: -node.scroll.y + }); + } + if (!hasTransform(node.latestValues)) continue; + transformBox(withTransforms, node.latestValues); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues); + } + return withTransforms; + }; + ProjectionNode.prototype.removeTransform = function (box) { + var _a; + var boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (var i = 0; i < this.path.length; i++) { + var node = this.path[i]; + if (!node.instance) continue; + if (!hasTransform(node.latestValues)) continue; + hasScale(node.latestValues) && node.updateSnapshot(); + var sourceBox = createBox(); + var nodeBox = node.measure(); + copyBoxInto(sourceBox, nodeBox); + removeBoxTransforms(boxWithoutTransform, node.latestValues, (_a = node.snapshot) === null || _a === void 0 ? void 0 : _a.layout, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + }; + /** + * + */ + ProjectionNode.prototype.setTargetDelta = function (delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + }; + ProjectionNode.prototype.setOptions = function (options) { + var _a; + this.options = tslib.__assign(tslib.__assign(tslib.__assign({}, this.options), options), { + crossfade: (_a = options.crossfade) !== null && _a !== void 0 ? _a : true }); - } - return type; - } - /** - * NamedType : Name - */ - - parseNamedType() { - return this.node(this._lexer.token, { - kind: _kinds.Kind.NAMED_TYPE, - name: this.parseName() - }); - } // Implements the parsing rules in the Type Definition section. - - peekDescription() { - return this.peek(_tokenKind.TokenKind.STRING) || this.peek(_tokenKind.TokenKind.BLOCK_STRING); - } - /** - * Description : StringValue - */ - - parseDescription() { - if (this.peekDescription()) { - return this.parseStringLiteral(); - } - } - /** - * ``` - * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } - * ``` - */ - - parseSchemaDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('schema'); - const directives = this.parseConstDirectives(); - const operationTypes = this.many(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); - return this.node(start, { - kind: _kinds.Kind.SCHEMA_DEFINITION, - description, - directives, - operationTypes - }); - } - /** - * OperationTypeDefinition : OperationType : NamedType - */ - - parseOperationTypeDefinition() { - const start = this._lexer.token; - const operation = this.parseOperationType(); - this.expectToken(_tokenKind.TokenKind.COLON); - const type = this.parseNamedType(); - return this.node(start, { - kind: _kinds.Kind.OPERATION_TYPE_DEFINITION, - operation, - type - }); - } - /** - * ScalarTypeDefinition : Description? scalar Name Directives[Const]? - */ - - parseScalarTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('scalar'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: _kinds.Kind.SCALAR_TYPE_DEFINITION, - description, - name, - directives - }); - } - /** - * ObjectTypeDefinition : - * Description? - * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? - */ - - parseObjectTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('type'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseConstDirectives(); - const fields = this.parseFieldsDefinition(); - return this.node(start, { - kind: _kinds.Kind.OBJECT_TYPE_DEFINITION, - description, - name, - interfaces, - directives, - fields - }); - } - /** - * ImplementsInterfaces : - * - implements `&`? NamedType - * - ImplementsInterfaces & NamedType - */ - - parseImplementsInterfaces() { - return this.expectOptionalKeyword('implements') ? this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType) : []; - } - /** - * ``` - * FieldsDefinition : { FieldDefinition+ } - * ``` - */ - - parseFieldsDefinition() { - return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseFieldDefinition, _tokenKind.TokenKind.BRACE_R); - } - /** - * FieldDefinition : - * - Description? Name ArgumentsDefinition? : Type Directives[Const]? - */ - - parseFieldDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - const name = this.parseName(); - const args = this.parseArgumentDefs(); - this.expectToken(_tokenKind.TokenKind.COLON); - const type = this.parseTypeReference(); - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: _kinds.Kind.FIELD_DEFINITION, - description, - name, - arguments: args, - type, - directives - }); - } - /** - * ArgumentsDefinition : ( InputValueDefinition+ ) - */ - - parseArgumentDefs() { - return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseInputValueDef, _tokenKind.TokenKind.PAREN_R); - } - /** - * InputValueDefinition : - * - Description? Name : Type DefaultValue? Directives[Const]? - */ - - parseInputValueDef() { - const start = this._lexer.token; - const description = this.parseDescription(); - const name = this.parseName(); - this.expectToken(_tokenKind.TokenKind.COLON); - const type = this.parseTypeReference(); - let defaultValue; - if (this.expectOptionalToken(_tokenKind.TokenKind.EQUALS)) { - defaultValue = this.parseConstValueLiteral(); - } - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: _kinds.Kind.INPUT_VALUE_DEFINITION, - description, - name, - type, - defaultValue, - directives - }); - } - /** - * InterfaceTypeDefinition : - * - Description? interface Name Directives[Const]? FieldsDefinition? - */ - - parseInterfaceTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('interface'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseConstDirectives(); - const fields = this.parseFieldsDefinition(); - return this.node(start, { - kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION, - description, - name, - interfaces, - directives, - fields - }); - } - /** - * UnionTypeDefinition : - * - Description? union Name Directives[Const]? UnionMemberTypes? - */ - - parseUnionTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('union'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const types = this.parseUnionMemberTypes(); - return this.node(start, { - kind: _kinds.Kind.UNION_TYPE_DEFINITION, - description, - name, - directives, - types - }); - } - /** - * UnionMemberTypes : - * - = `|`? NamedType - * - UnionMemberTypes | NamedType - */ - - parseUnionMemberTypes() { - return this.expectOptionalToken(_tokenKind.TokenKind.EQUALS) ? this.delimitedMany(_tokenKind.TokenKind.PIPE, this.parseNamedType) : []; - } - /** - * EnumTypeDefinition : - * - Description? enum Name Directives[Const]? EnumValuesDefinition? - */ - - parseEnumTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('enum'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const values = this.parseEnumValuesDefinition(); - return this.node(start, { - kind: _kinds.Kind.ENUM_TYPE_DEFINITION, - description, - name, - directives, - values - }); - } - /** - * ``` - * EnumValuesDefinition : { EnumValueDefinition+ } - * ``` - */ - - parseEnumValuesDefinition() { - return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseEnumValueDefinition, _tokenKind.TokenKind.BRACE_R); - } - /** - * EnumValueDefinition : Description? EnumValue Directives[Const]? - */ - - parseEnumValueDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - const name = this.parseEnumValueName(); - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: _kinds.Kind.ENUM_VALUE_DEFINITION, - description, - name, - directives - }); - } - /** - * EnumValue : Name but not `true`, `false` or `null` - */ - - parseEnumValueName() { - if (this._lexer.token.value === 'true' || this._lexer.token.value === 'false' || this._lexer.token.value === 'null') { - throw (0, _syntaxError.syntaxError)(this._lexer.source, this._lexer.token.start, `${getTokenDesc(this._lexer.token)} is reserved and cannot be used for an enum value.`); - } - return this.parseName(); - } - /** - * InputObjectTypeDefinition : - * - Description? input Name Directives[Const]? InputFieldsDefinition? - */ - - parseInputObjectTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('input'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const fields = this.parseInputFieldsDefinition(); - return this.node(start, { - kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION, - description, - name, - directives, - fields - }); - } - /** - * ``` - * InputFieldsDefinition : { InputValueDefinition+ } - * ``` - */ - - parseInputFieldsDefinition() { - return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseInputValueDef, _tokenKind.TokenKind.BRACE_R); - } - /** - * TypeSystemExtension : - * - SchemaExtension - * - TypeExtension - * - * TypeExtension : - * - ScalarTypeExtension - * - ObjectTypeExtension - * - InterfaceTypeExtension - * - UnionTypeExtension - * - EnumTypeExtension - * - InputObjectTypeDefinition - */ - - parseTypeSystemExtension() { - const keywordToken = this._lexer.lookahead(); - if (keywordToken.kind === _tokenKind.TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaExtension(); - case 'scalar': - return this.parseScalarTypeExtension(); - case 'type': - return this.parseObjectTypeExtension(); - case 'interface': - return this.parseInterfaceTypeExtension(); - case 'union': - return this.parseUnionTypeExtension(); - case 'enum': - return this.parseEnumTypeExtension(); - case 'input': - return this.parseInputObjectTypeExtension(); + }; + ProjectionNode.prototype.clearMeasurements = function () { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + }; + /** + * Frame calculations + */ + ProjectionNode.prototype.resolveTargetDelta = function () { + var _a; + var _b = this.options, + layout = _b.layout, + layoutId = _b.layoutId; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) return; + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + // TODO If this is unsuccessful this currently happens every frame + if (!this.targetDelta && !this.relativeTarget) { + // TODO: This is a semi-repetition of further down this function, make DRY + this.relativeParent = this.getClosestProjectingParent(); + if (this.relativeParent && this.relativeParent.layout) { + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, this.layout.actual, this.relativeParent.layout.actual); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } } - } - throw this.unexpected(keywordToken); - } - /** - * ``` - * SchemaExtension : - * - extend schema Directives[Const]? { OperationTypeDefinition+ } - * - extend schema Directives[Const] - * ``` - */ - - parseSchemaExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('schema'); - const directives = this.parseConstDirectives(); - const operationTypes = this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); - if (directives.length === 0 && operationTypes.length === 0) { - throw this.unexpected(); - } - return this.node(start, { - kind: _kinds.Kind.SCHEMA_EXTENSION, - directives, - operationTypes - }); - } - /** - * ScalarTypeExtension : - * - extend scalar Name Directives[Const] - */ - - parseScalarTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('scalar'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - if (directives.length === 0) { - throw this.unexpected(); - } - return this.node(start, { - kind: _kinds.Kind.SCALAR_TYPE_EXTENSION, - name, - directives - }); - } - /** - * ObjectTypeExtension : - * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend type Name ImplementsInterfaces? Directives[Const] - * - extend type Name ImplementsInterfaces - */ - - parseObjectTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('type'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseConstDirectives(); - const fields = this.parseFieldsDefinition(); - if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - return this.node(start, { - kind: _kinds.Kind.OBJECT_TYPE_EXTENSION, - name, - interfaces, - directives, - fields + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && this.relativeTargetOrigin && ((_a = this.relativeParent) === null || _a === void 0 ? void 0 : _a.target)) { + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + // TODO: This is creating a new object every frame + this.target = this.applyTransform(this.layout.actual); + } else { + copyBoxInto(this.target, this.layout.actual); + } + applyBoxDelta(this.target, this.targetDelta); + } else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.actual); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + this.relativeParent = this.getClosestProjectingParent(); + if (this.relativeParent && Boolean(this.relativeParent.resumingFrom) === Boolean(this.resumingFrom) && !this.relativeParent.options.layoutScroll && this.relativeParent.target) { + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, this.target, this.relativeParent.target); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + } + }; + ProjectionNode.prototype.getClosestProjectingParent = function () { + if (!this.parent || hasTransform(this.parent.latestValues)) return undefined; + if ((this.parent.relativeTarget || this.parent.targetDelta) && this.parent.layout) { + return this.parent; + } else { + return this.parent.getClosestProjectingParent(); + } + }; + ProjectionNode.prototype.calcProjection = function () { + var _a; + var _b = this.options, + layout = _b.layout, + layoutId = _b.layoutId; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean(((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isTreeAnimating) || this.currentAnimation || this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) return; + var lead = this.getLead(); + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.actual); + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, Boolean(this.resumingFrom) || this !== lead); + var target = lead.target; + if (!target) return; + if (!this.projectionDelta) { + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + var prevTreeScaleX = this.treeScale.x; + var prevTreeScaleY = this.treeScale.y; + var prevProjectionTransform = this.projectionTransform; + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale); + if (this.projectionTransform !== prevProjectionTransform || this.treeScale.x !== prevTreeScaleX || this.treeScale.y !== prevTreeScaleY) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + }; + ProjectionNode.prototype.hide = function () { + this.isVisible = false; + // TODO: Schedule render + }; + ProjectionNode.prototype.show = function () { + this.isVisible = true; + // TODO: Schedule render + }; + ProjectionNode.prototype.scheduleRender = function (notifyAll) { + var _a, _b, _c; + if (notifyAll === void 0) { + notifyAll = true; + } + (_b = (_a = this.options).scheduleRender) === null || _b === void 0 ? void 0 : _b.call(_a); + notifyAll && ((_c = this.getStack()) === null || _c === void 0 ? void 0 : _c.scheduleRender()); + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + }; + ProjectionNode.prototype.setAnimationOrigin = function (delta, hasOnlyRelativeTargetChanged) { + var _this = this; + var _a; + if (hasOnlyRelativeTargetChanged === void 0) { + hasOnlyRelativeTargetChanged = false; + } + var snapshot = this.snapshot; + var snapshotLatestValues = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.latestValues) || {}; + var mixedValues = tslib.__assign({}, this.latestValues); + var targetDelta = createDelta(); + this.relativeTarget = this.relativeTargetOrigin = undefined; + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + var relativeLayout = createBox(); + var isSharedLayoutAnimation = snapshot === null || snapshot === void 0 ? void 0 : snapshot.isShared; + var isOnlyMember = (((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.members.length) || 0) <= 1; + var shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && !isOnlyMember && this.options.crossfade === true && !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + this.mixTargetDelta = function (latest) { + var _a; + var progress = latest / 1000; + mixAxisDelta(targetDelta.x, delta.x, progress); + mixAxisDelta(targetDelta.y, delta.y, progress); + _this.setTargetDelta(targetDelta); + if (_this.relativeTarget && _this.relativeTargetOrigin && _this.layout && ((_a = _this.relativeParent) === null || _a === void 0 ? void 0 : _a.layout)) { + calcRelativePosition(relativeLayout, _this.layout.actual, _this.relativeParent.layout.actual); + mixBox(_this.relativeTarget, _this.relativeTargetOrigin, relativeLayout, progress); + } + if (isSharedLayoutAnimation) { + _this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, _this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + _this.root.scheduleUpdateProjection(); + _this.scheduleRender(); + _this.animationProgress = progress; + }; + this.mixTargetDelta(0); + }; + ProjectionNode.prototype.startAnimation = function (options) { + var _this = this; + var _a, _b; + this.notifyListeners("animationStart"); + (_a = this.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); + if (this.resumingFrom) { + (_b = this.resumingFrom.currentAnimation) === null || _b === void 0 ? void 0 : _b.stop(); + } + if (this.pendingAnimation) { + sync.cancelSync.update(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = sync__default["default"].update(function () { + globalProjectionState.hasAnimatedSinceResize = true; + _this.currentAnimation = animate(0, animationTarget, tslib.__assign(tslib.__assign({}, options), { + onUpdate: function (latest) { + var _a; + _this.mixTargetDelta(latest); + (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, latest); + }, + onComplete: function () { + var _a; + (_a = options.onComplete) === null || _a === void 0 ? void 0 : _a.call(options); + _this.completeAnimation(); + } + })); + if (_this.resumingFrom) { + _this.resumingFrom.currentAnimation = _this.currentAnimation; + } + _this.pendingAnimation = undefined; + }); + }; + ProjectionNode.prototype.completeAnimation = function () { + var _a; + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.exitAnimationComplete(); + this.resumingFrom = this.currentAnimation = this.animationValues = undefined; + this.notifyListeners("animationComplete"); + }; + ProjectionNode.prototype.finishAnimation = function () { + var _a; + if (this.currentAnimation) { + (_a = this.mixTargetDelta) === null || _a === void 0 ? void 0 : _a.call(this, animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + }; + ProjectionNode.prototype.applyTransformsToTarget = function () { + var _a = this.getLead(), + targetWithTransforms = _a.targetWithTransforms, + target = _a.target, + layout = _a.layout, + latestValues = _a.latestValues; + if (!targetWithTransforms || !target || !layout) return; + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its actual layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + }; + ProjectionNode.prototype.registerSharedNode = function (layoutId, node) { + var _a, _b, _c; + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + var stack = this.sharedNodes.get(layoutId); + stack.add(node); + node.promote({ + transition: (_a = node.options.initialPromotionConfig) === null || _a === void 0 ? void 0 : _a.transition, + preserveFollowOpacity: (_c = (_b = node.options.initialPromotionConfig) === null || _b === void 0 ? void 0 : _b.shouldPreserveFollowOpacity) === null || _c === void 0 ? void 0 : _c.call(_b, node) + }); + }; + ProjectionNode.prototype.isLead = function () { + var stack = this.getStack(); + return stack ? stack.lead === this : true; + }; + ProjectionNode.prototype.getLead = function () { + var _a; + var layoutId = this.options.layoutId; + return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this; + }; + ProjectionNode.prototype.getPrevLead = function () { + var _a; + var layoutId = this.options.layoutId; + return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined; + }; + ProjectionNode.prototype.getStack = function () { + var layoutId = this.options.layoutId; + if (layoutId) return this.root.sharedNodes.get(layoutId); + }; + ProjectionNode.prototype.promote = function (_a) { + var _b = _a === void 0 ? {} : _a, + needsReset = _b.needsReset, + transition = _b.transition, + preserveFollowOpacity = _b.preserveFollowOpacity; + var stack = this.getStack(); + if (stack) stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) this.setOptions({ + transition: transition + }); + }; + ProjectionNode.prototype.relegate = function () { + var stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } else { + return false; + } + }; + ProjectionNode.prototype.resetRotation = function () { + var visualElement = this.options.visualElement; + if (!visualElement) return; + // If there's no detected rotation values, we can early return without a forced render. + var hasRotate = false; + // Keep a record of all the values we've reset + var resetValues = {}; + // Check the rotate value of all axes and reset to 0 + for (var i = 0; i < transformAxes.length; i++) { + var axis = transformAxes[i]; + var key = "rotate" + axis; + // If this rotation doesn't exist as a motion value, then we don't + // need to reset it + if (!visualElement.getStaticValue(key)) { + continue; + } + hasRotate = true; + // Record the rotation and then temporarily set it to 0 + resetValues[key] = visualElement.getStaticValue(key); + visualElement.setStaticValue(key, 0); + } + // If there's no rotation values, we don't need to do any more. + if (!hasRotate) return; + // Force a render of this element to apply the transform with all rotations + // set to 0. + visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender(); + // Put back all the values we reset + for (var key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + }; + ProjectionNode.prototype.getProjectionStyles = function (styleProp) { + var _a, _b, _c, _d, _e, _f; + if (styleProp === void 0) { + styleProp = {}; + } + // TODO: Return lifecycle-persistent object + var styles = {}; + if (!this.instance || this.isSVG) return styles; + if (!this.isVisible) { + return { + visibility: "hidden" + }; + } else { + styles.visibility = ""; + } + var transformTemplate = (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.getProps().transformTemplate; + if (this.needsReset) { + this.needsReset = false; + styles.opacity = ""; + styles.pointerEvents = resolveMotionValue(styleProp.pointerEvents) || ""; + styles.transform = transformTemplate ? transformTemplate(this.latestValues, "") : "none"; + return styles; + } + var lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + var emptyStyles = {}; + if (this.options.layoutId) { + emptyStyles.opacity = (_b = this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1; + emptyStyles.pointerEvents = resolveMotionValue(styleProp.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + emptyStyles.transform = transformTemplate ? transformTemplate({}, "") : "none"; + this.hasProjected = false; + } + return emptyStyles; + } + var valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + styles.transform = transformTemplate(valuesToRender, styles.transform); + } + var _g = this.projectionDelta, + x = _g.x, + y = _g.y; + styles.transformOrigin = "".concat(x.origin * 100, "% ").concat(y.origin * 100, "% 0"); + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + styles.opacity = lead === this ? (_d = (_c = valuesToRender.opacity) !== null && _c !== void 0 ? _c : this.latestValues.opacity) !== null && _d !== void 0 ? _d : 1 : this.preserveOpacity ? this.latestValues.opacity : valuesToRender.opacityExit; + } else { + /** + * Or we're not animating at all, set the lead component to its actual + * opacity and other components to hidden. + */ + styles.opacity = lead === this ? (_e = valuesToRender.opacity) !== null && _e !== void 0 ? _e : "" : (_f = valuesToRender.opacityExit) !== null && _f !== void 0 ? _f : 0; + } + /** + * Apply scale correction + */ + for (var key in scaleCorrectors) { + if (valuesToRender[key] === undefined) continue; + var _h = scaleCorrectors[key], + correct = _h.correct, + applyTo = _h.applyTo; + var corrected = correct(valuesToRender[key], lead); + if (applyTo) { + var num = applyTo.length; + for (var i = 0; i < num; i++) { + styles[applyTo[i]] = corrected; + } + } else { + styles[key] = corrected; + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + styles.pointerEvents = lead === this ? resolveMotionValue(styleProp.pointerEvents) || "" : "none"; + } + return styles; + }; + ProjectionNode.prototype.clearSnapshot = function () { + this.resumeFrom = this.snapshot = undefined; + }; + // Only run on root + ProjectionNode.prototype.resetTree = function () { + this.root.nodes.forEach(function (node) { + var _a; + return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); + }); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + }; + return ProjectionNode; + }(); +} +function updateLayout(node) { + node.updateLayout(); +} +function notifyLayoutUpdate(node) { + var _a, _b, _c, _d; + var snapshot = (_b = (_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) !== null && _b !== void 0 ? _b : node.snapshot; + if (node.isLead() && node.layout && snapshot && node.hasListeners("didUpdate")) { + var _e = node.layout, + layout_1 = _e.actual, + measuredLayout = _e.measured; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (node.options.animationType === "size") { + eachAxis(function (axis) { + var axisSnapshot = snapshot.isShared ? snapshot.measured[axis] : snapshot.layout[axis]; + var length = calcLength(axisSnapshot); + axisSnapshot.min = layout_1[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } else if (node.options.animationType === "position") { + eachAxis(function (axis) { + var axisSnapshot = snapshot.isShared ? snapshot.measured[axis] : snapshot.layout[axis]; + var length = calcLength(layout_1[axis]); + axisSnapshot.max = axisSnapshot.min + length; + }); + } + var layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout_1, snapshot.layout); + var visualDelta = createDelta(); + if (snapshot.isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measured); + } else { + calcBoxDelta(visualDelta, layout_1, snapshot.layout); + } + var hasLayoutChanged = !isDeltaZero(layoutDelta); + var hasRelativeTargetChanged = false; + if (!node.resumeFrom) { + node.relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (node.relativeParent && !node.relativeParent.resumeFrom) { + var _f = node.relativeParent, + parentSnapshot = _f.snapshot, + parentLayout = _f.layout; + if (parentSnapshot && parentLayout) { + var relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layout, parentSnapshot.layout); + var relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout_1, parentLayout.actual); + if (!boxEquals(relativeSnapshot, relativeLayout)) { + hasRelativeTargetChanged = true; + } + } + } + } + node.notifyListeners("didUpdate", { + layout: layout_1, + snapshot: snapshot, + delta: visualDelta, + layoutDelta: layoutDelta, + hasLayoutChanged: hasLayoutChanged, + hasRelativeTargetChanged: hasRelativeTargetChanged }); + } else if (node.isLead()) { + (_d = (_c = node.options).onExitComplete) === null || _d === void 0 ? void 0 : _d.call(_c); } /** - * InterfaceTypeExtension : - * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend interface Name ImplementsInterfaces? Directives[Const] - * - extend interface Name ImplementsInterfaces + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all */ - - parseInterfaceTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('interface'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseConstDirectives(); - const fields = this.parseFieldsDefinition(); - if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - return this.node(start, { - kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION, - name, - interfaces, - directives, - fields - }); - } - /** - * UnionTypeExtension : - * - extend union Name Directives[Const]? UnionMemberTypes - * - extend union Name Directives[Const] - */ - - parseUnionTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('union'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const types = this.parseUnionMemberTypes(); - if (directives.length === 0 && types.length === 0) { - throw this.unexpected(); - } - return this.node(start, { - kind: _kinds.Kind.UNION_TYPE_EXTENSION, - name, - directives, - types - }); - } - /** - * EnumTypeExtension : - * - extend enum Name Directives[Const]? EnumValuesDefinition - * - extend enum Name Directives[Const] - */ - - parseEnumTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('enum'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const values = this.parseEnumValuesDefinition(); - if (directives.length === 0 && values.length === 0) { - throw this.unexpected(); - } - return this.node(start, { - kind: _kinds.Kind.ENUM_TYPE_EXTENSION, - name, - directives, - values - }); - } - /** - * InputObjectTypeExtension : - * - extend input Name Directives[Const]? InputFieldsDefinition - * - extend input Name Directives[Const] - */ - - parseInputObjectTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('input'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const fields = this.parseInputFieldsDefinition(); - if (directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - return this.node(start, { - kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION, - name, - directives, - fields - }); - } - /** - * ``` - * DirectiveDefinition : - * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations - * ``` - */ - - parseDirectiveDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('directive'); - this.expectToken(_tokenKind.TokenKind.AT); - const name = this.parseName(); - const args = this.parseArgumentDefs(); - const repeatable = this.expectOptionalKeyword('repeatable'); - this.expectKeyword('on'); - const locations = this.parseDirectiveLocations(); - return this.node(start, { - kind: _kinds.Kind.DIRECTIVE_DEFINITION, - description, - name, - arguments: args, - repeatable, - locations - }); - } - /** - * DirectiveLocations : - * - `|`? DirectiveLocation - * - DirectiveLocations | DirectiveLocation - */ - - parseDirectiveLocations() { - return this.delimitedMany(_tokenKind.TokenKind.PIPE, this.parseDirectiveLocation); - } - /* - * DirectiveLocation : - * - ExecutableDirectiveLocation - * - TypeSystemDirectiveLocation - * - * ExecutableDirectiveLocation : one of - * `QUERY` - * `MUTATION` - * `SUBSCRIPTION` - * `FIELD` - * `FRAGMENT_DEFINITION` - * `FRAGMENT_SPREAD` - * `INLINE_FRAGMENT` - * - * TypeSystemDirectiveLocation : one of - * `SCHEMA` - * `SCALAR` - * `OBJECT` - * `FIELD_DEFINITION` - * `ARGUMENT_DEFINITION` - * `INTERFACE` - * `UNION` - * `ENUM` - * `ENUM_VALUE` - * `INPUT_OBJECT` - * `INPUT_FIELD_DEFINITION` - */ - - parseDirectiveLocation() { - const start = this._lexer.token; - const name = this.parseName(); - if (Object.prototype.hasOwnProperty.call(_directiveLocation.DirectiveLocation, name.value)) { - return name; - } - throw this.unexpected(start); - } // Core parsing utility functions - - /** - * Returns a node that, if configured to do so, sets a "loc" field as a - * location object, used to identify the place in the source that created a - * given parsed object. - */ - - node(startToken, node) { - if (this._options.noLocation !== true) { - node.loc = new _ast.Location(startToken, this._lexer.lastToken, this._lexer.source); - } - return node; - } - /** - * Determines if the next token is of a given kind - */ - - peek(kind) { - return this._lexer.token.kind === kind; - } - /** - * If the next token is of the given kind, return that token after advancing the lexer. - * Otherwise, do not change the parser state and throw an error. - */ - - expectToken(kind) { - const token = this._lexer.token; - if (token.kind === kind) { - this.advanceLexer(); - return token; - } - throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`); - } - /** - * If the next token is of the given kind, return "true" after advancing the lexer. - * Otherwise, do not change the parser state and return "false". - */ - - expectOptionalToken(kind) { - const token = this._lexer.token; - if (token.kind === kind) { - this.advanceLexer(); - return true; - } - return false; - } - /** - * If the next token is a given keyword, advance the lexer. - * Otherwise, do not change the parser state and throw an error. - */ - - expectKeyword(value) { - const token = this._lexer.token; - if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { - this.advanceLexer(); - } else { - throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Expected "${value}", found ${getTokenDesc(token)}.`); - } - } - /** - * If the next token is a given keyword, return "true" after advancing the lexer. - * Otherwise, do not change the parser state and return "false". - */ - - expectOptionalKeyword(value) { - const token = this._lexer.token; - if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { - this.advanceLexer(); - return true; - } - return false; - } - /** - * Helper function for creating an error when an unexpected lexed token is encountered. - */ - - unexpected(atToken) { - const token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token; - return (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Unexpected ${getTokenDesc(token)}.`); - } - /** - * Returns a possibly empty list of parse nodes, determined by the parseFn. - * This list begins with a lex token of openKind and ends with a lex token of closeKind. - * Advances the parser to the next lex token after the closing token. - */ - - any(openKind, parseFn, closeKind) { - this.expectToken(openKind); - const nodes = []; - while (!this.expectOptionalToken(closeKind)) { - nodes.push(parseFn.call(this)); - } - return nodes; - } - /** - * Returns a list of parse nodes, determined by the parseFn. - * It can be empty only if open token is missing otherwise it will always return non-empty list - * that begins with a lex token of openKind and ends with a lex token of closeKind. - * Advances the parser to the next lex token after the closing token. - */ - - optionalMany(openKind, parseFn, closeKind) { - if (this.expectOptionalToken(openKind)) { - const nodes = []; - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - return nodes; - } - return []; - } - /** - * Returns a non-empty list of parse nodes, determined by the parseFn. - * This list begins with a lex token of openKind and ends with a lex token of closeKind. - * Advances the parser to the next lex token after the closing token. - */ - - many(openKind, parseFn, closeKind) { - this.expectToken(openKind); - const nodes = []; - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - return nodes; - } - /** - * Returns a non-empty list of parse nodes, determined by the parseFn. - * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. - * Advances the parser to the next lex token after last item in the list. - */ - - delimitedMany(delimiterKind, parseFn) { - this.expectOptionalToken(delimiterKind); - const nodes = []; - do { - nodes.push(parseFn.call(this)); - } while (this.expectOptionalToken(delimiterKind)); - return nodes; - } - advanceLexer() { - const { - maxTokens - } = this._options; - const token = this._lexer.advance(); - if (maxTokens !== undefined && token.kind !== _tokenKind.TokenKind.EOF) { - ++this._tokenCounter; - if (this._tokenCounter > maxTokens) { - throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Document contains more that ${maxTokens} tokens. Parsing aborted.`); - } - } + node.options.transition = undefined; +} +function clearSnapshot(node) { + node.clearSnapshot(); +} +function clearMeasurements(node) { + node.clearMeasurements(); +} +function resetTransformStyle(node) { + var visualElement = node.options.visualElement; + if (visualElement === null || visualElement === void 0 ? void 0 : visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notifyBeforeLayoutMeasure(); } + node.resetTransform(); } -/** - * A helper function to describe a token as a string for debugging. - */ -exports.Parser = Parser; -function getTokenDesc(token) { - const value = token.value; - return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : ''); +function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; } -/** - * A helper function to describe a token kind as a string for debugging. - */ - -function getTokenKindDesc(kind) { - return (0, _lexer.isPunctuatorTokenKind)(kind) ? `"${kind}"` : kind; +function resolveTargetDelta(node) { + node.resolveTargetDelta(); } - -/***/ }), - -/***/ "../../../node_modules/graphql/language/predicates.mjs": -/*!*************************************************************!*\ - !*** ../../../node_modules/graphql/language/predicates.mjs ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isConstValueNode = isConstValueNode; -exports.isDefinitionNode = isDefinitionNode; -exports.isExecutableDefinitionNode = isExecutableDefinitionNode; -exports.isSelectionNode = isSelectionNode; -exports.isTypeDefinitionNode = isTypeDefinitionNode; -exports.isTypeExtensionNode = isTypeExtensionNode; -exports.isTypeNode = isTypeNode; -exports.isTypeSystemDefinitionNode = isTypeSystemDefinitionNode; -exports.isTypeSystemExtensionNode = isTypeSystemExtensionNode; -exports.isValueNode = isValueNode; -var _kinds = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -function isDefinitionNode(node) { - return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node); +function calcProjection(node) { + node.calcProjection(); } -function isExecutableDefinitionNode(node) { - return node.kind === _kinds.Kind.OPERATION_DEFINITION || node.kind === _kinds.Kind.FRAGMENT_DEFINITION; +function resetRotation(node) { + node.resetRotation(); } -function isSelectionNode(node) { - return node.kind === _kinds.Kind.FIELD || node.kind === _kinds.Kind.FRAGMENT_SPREAD || node.kind === _kinds.Kind.INLINE_FRAGMENT; +function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); } -function isValueNode(node) { - return node.kind === _kinds.Kind.VARIABLE || node.kind === _kinds.Kind.INT || node.kind === _kinds.Kind.FLOAT || node.kind === _kinds.Kind.STRING || node.kind === _kinds.Kind.BOOLEAN || node.kind === _kinds.Kind.NULL || node.kind === _kinds.Kind.ENUM || node.kind === _kinds.Kind.LIST || node.kind === _kinds.Kind.OBJECT; +function mixAxisDelta(output, delta, p) { + output.translate = popmotion.mix(delta.translate, 0, p); + output.scale = popmotion.mix(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; } -function isConstValueNode(node) { - return isValueNode(node) && (node.kind === _kinds.Kind.LIST ? node.values.some(isConstValueNode) : node.kind === _kinds.Kind.OBJECT ? node.fields.some(field => isConstValueNode(field.value)) : node.kind !== _kinds.Kind.VARIABLE); +function mixAxis(output, from, to, p) { + output.min = popmotion.mix(from.min, to.min, p); + output.max = popmotion.mix(from.max, to.max, p); } -function isTypeNode(node) { - return node.kind === _kinds.Kind.NAMED_TYPE || node.kind === _kinds.Kind.LIST_TYPE || node.kind === _kinds.Kind.NON_NULL_TYPE; +function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); } -function isTypeSystemDefinitionNode(node) { - return node.kind === _kinds.Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === _kinds.Kind.DIRECTIVE_DEFINITION; +function hasOpacityCrossfade(node) { + return node.animationValues && node.animationValues.opacityExit !== undefined; } -function isTypeDefinitionNode(node) { - return node.kind === _kinds.Kind.SCALAR_TYPE_DEFINITION || node.kind === _kinds.Kind.OBJECT_TYPE_DEFINITION || node.kind === _kinds.Kind.INTERFACE_TYPE_DEFINITION || node.kind === _kinds.Kind.UNION_TYPE_DEFINITION || node.kind === _kinds.Kind.ENUM_TYPE_DEFINITION || node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION; +var defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1] +}; +function mountNodeEarly(node, id) { + /** + * Rather than searching the DOM from document we can search the + * path for the deepest mounted ancestor and search from there + */ + var searchNode = node.root; + for (var i = node.path.length - 1; i >= 0; i--) { + if (Boolean(node.path[i].instance)) { + searchNode = node.path[i]; + break; + } + } + var searchElement = searchNode && searchNode !== node.root ? searchNode.instance : document; + var element = searchElement.querySelector("[data-projection-id=\"".concat(id, "\"]")); + if (element) node.mount(element, true); } -function isTypeSystemExtensionNode(node) { - return node.kind === _kinds.Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node); +function roundAxis(axis) { + axis.min = Math.round(axis.min); + axis.max = Math.round(axis.max); } -function isTypeExtensionNode(node) { - return node.kind === _kinds.Kind.SCALAR_TYPE_EXTENSION || node.kind === _kinds.Kind.OBJECT_TYPE_EXTENSION || node.kind === _kinds.Kind.INTERFACE_TYPE_EXTENSION || node.kind === _kinds.Kind.UNION_TYPE_EXTENSION || node.kind === _kinds.Kind.ENUM_TYPE_EXTENSION || node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION; +function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); } - -/***/ }), - -/***/ "../../../node_modules/graphql/language/printLocation.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/language/printLocation.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.printLocation = printLocation; -exports.printSourceLocation = printSourceLocation; -var _location = __webpack_require__(/*! ./location.mjs */ "../../../node_modules/graphql/language/location.mjs"); +var DocumentProjectionNode = createProjectionNode({ + attachResizeListener: function (ref, notify) { + return addDomEvent(ref, "resize", notify); + }, + measureScroll: function () { + return { + x: document.documentElement.scrollLeft || document.body.scrollLeft, + y: document.documentElement.scrollTop || document.body.scrollTop + }; + }, + checkIsScrollRoot: function () { + return true; + } +}); +var rootProjectionNode = { + current: undefined +}; +var HTMLProjectionNode = createProjectionNode({ + measureScroll: function (instance) { + return { + x: instance.scrollLeft, + y: instance.scrollTop + }; + }, + defaultParent: function () { + if (!rootProjectionNode.current) { + var documentNode = new DocumentProjectionNode(0, {}); + documentNode.mount(window); + documentNode.setOptions({ + layoutScroll: true + }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: function (instance, value) { + instance.style.transform = value !== null && value !== void 0 ? value : "none"; + }, + checkIsScrollRoot: function (instance) { + return Boolean(window.getComputedStyle(instance).position === "fixed"); + } +}); +var featureBundle = tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({}, animations), gestureAnimations), drag), layoutFeatures); /** - * Render a helpful description of the location in the GraphQL Source document. + * HTML & SVG components, optimised for use with gestures and animation. These can be used as + * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported. + * + * @public */ -function printLocation(location) { - return printSourceLocation(location.source, (0, _location.getLocation)(location.source, location.start)); -} +var motion = /*@__PURE__*/createMotionProxy(function (Component, config) { + return createDomMotionConfig(Component, config, featureBundle, createDomVisualElement, HTMLProjectionNode); +}); /** - * Render a helpful description of the location in the GraphQL Source document. + * Create a DOM `motion` component with the provided string. This is primarily intended + * as a full alternative to `motion` for consumers who have to support environments that don't + * support `Proxy`. + * + * ```javascript + * import { createDomMotionComponent } from "framer-motion" + * + * const motion = { + * div: createDomMotionComponent('div') + * } + * ``` + * + * @public */ +function createDomMotionComponent(key) { + return createMotionComponent(createDomMotionConfig(key, { + forwardMotionProps: false + }, featureBundle, createDomVisualElement, HTMLProjectionNode)); +} -function printSourceLocation(source, sourceLocation) { - const firstLineColumnOffset = source.locationOffset.column - 1; - const body = ''.padStart(firstLineColumnOffset) + source.body; - const lineIndex = sourceLocation.line - 1; - const lineOffset = source.locationOffset.line - 1; - const lineNum = sourceLocation.line + lineOffset; - const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; - const columnNum = sourceLocation.column + columnOffset; - const locationStr = `${source.name}:${lineNum}:${columnNum}\n`; - const lines = body.split(/\r\n|[\n\r]/g); - const locationLine = lines[lineIndex]; // Special case for minified documents - - if (locationLine.length > 120) { - const subLineIndex = Math.floor(columnNum / 80); - const subLineColumnNum = columnNum % 80; - const subLines = []; - for (let i = 0; i < locationLine.length; i += 80) { - subLines.push(locationLine.slice(i, i + 80)); - } - return locationStr + printPrefixedLines([[`${lineNum} |`, subLines[0]], ...subLines.slice(1, subLineIndex + 1).map(subLine => ['|', subLine]), ['|', '^'.padStart(subLineColumnNum)], ['|', subLines[subLineIndex + 1]]]); - } - return locationStr + printPrefixedLines([ - // Lines specified like this: ["prefix", "string"], - [`${lineNum - 1} |`, lines[lineIndex - 1]], [`${lineNum} |`, locationLine], ['|', '^'.padStart(columnNum)], [`${lineNum + 1} |`, lines[lineIndex + 1]]]); +/** + * @public + */ +var m = createMotionProxy(createDomMotionConfig); +function useIsMounted() { + var isMounted = React.useRef(false); + useIsomorphicLayoutEffect(function () { + isMounted.current = true; + return function () { + isMounted.current = false; + }; + }, []); + return isMounted; } -function printPrefixedLines(lines) { - const existingLines = lines.filter(([_, line]) => line !== undefined); - const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length)); - return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : '')).join('\n'); +function useForceUpdate() { + var isMounted = useIsMounted(); + var _a = tslib.__read(React.useState(0), 2), + forcedRenderCount = _a[0], + setForcedRenderCount = _a[1]; + var forceRender = React.useCallback(function () { + isMounted.current && setForcedRenderCount(forcedRenderCount + 1); + }, [forcedRenderCount]); + /** + * Defer this to the end of the next animation frame in case there are multiple + * synchronous calls. + */ + var deferredForceRender = React.useCallback(function () { + return sync__default["default"].postRender(forceRender); + }, [forceRender]); + return [deferredForceRender, forcedRenderCount]; +} +var PresenceChild = function (_a) { + var children = _a.children, + initial = _a.initial, + isPresent = _a.isPresent, + onExitComplete = _a.onExitComplete, + custom = _a.custom, + presenceAffectsLayout = _a.presenceAffectsLayout; + var presenceChildren = useConstant(newChildrenMap); + var id = useId(); + var context = React.useMemo(function () { + return { + id: id, + initial: initial, + isPresent: isPresent, + custom: custom, + onExitComplete: function (childId) { + var e_1, _a; + presenceChildren.set(childId, true); + try { + for (var _b = tslib.__values(presenceChildren.values()), _c = _b.next(); !_c.done; _c = _b.next()) { + var isComplete = _c.value; + if (!isComplete) return; // can stop searching when any is incomplete + } + } catch (e_1_1) { + e_1 = { + error: e_1_1 + }; + } finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } finally { + if (e_1) throw e_1.error; + } + } + onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(); + }, + register: function (childId) { + presenceChildren.set(childId, false); + return function () { + return presenceChildren.delete(childId); + }; + } + }; + }, + /** + * If the presence of a child affects the layout of the components around it, + * we want to make a new context value to ensure they get re-rendered + * so they can detect that layout change. + */ + presenceAffectsLayout ? undefined : [isPresent]); + React.useMemo(function () { + presenceChildren.forEach(function (_, key) { + return presenceChildren.set(key, false); + }); + }, [isPresent]); + /** + * If there's no `motion` components to fire exit animations, we want to remove this + * component immediately. + */ + React__namespace.useEffect(function () { + !isPresent && !presenceChildren.size && (onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete()); + }, [isPresent]); + return React__namespace.createElement(PresenceContext.Provider, { + value: context + }, children); +}; +function newChildrenMap() { + return new Map(); +} +var getChildKey = function (child) { + return child.key || ""; +}; +function updateChildLookup(children, allChildren) { + children.forEach(function (child) { + var key = getChildKey(child); + allChildren.set(key, child); + }); +} +function onlyElements(children) { + var filtered = []; + // We use forEach here instead of map as map mutates the component key by preprending `.$` + React.Children.forEach(children, function (child) { + if (React.isValidElement(child)) filtered.push(child); + }); + return filtered; } - -/***/ }), - -/***/ "../../../node_modules/graphql/language/printString.mjs": -/*!**************************************************************!*\ - !*** ../../../node_modules/graphql/language/printString.mjs ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.printString = printString; /** - * Prints a string as a GraphQL StringValue literal. Replaces control characters - * and excluded characters (" U+0022 and \\ U+005C) with escape sequences. + * `AnimatePresence` enables the animation of components that have been removed from the tree. + * + * When adding/removing more than a single child, every child **must** be given a unique `key` prop. + * + * Any `motion` components that have an `exit` property defined will animate out when removed from + * the tree. + * + * ```jsx + * import { motion, AnimatePresence } from 'framer-motion' + * + * export const Items = ({ items }) => ( + * + * {items.map(item => ( + * + * ))} + * + * ) + * ``` + * + * You can sequence exit animations throughout a tree using variants. + * + * If a child contains multiple `motion` components with `exit` props, it will only unmount the child + * once all `motion` components have finished animating out. Likewise, any components using + * `usePresence` all need to call `safeToRemove`. + * + * @public */ -function printString(str) { - return `"${str.replace(escapedRegExp, escapedReplacer)}"`; -} // eslint-disable-next-line no-control-regex - -const escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g; -function escapedReplacer(str) { - return escapeSequences[str.charCodeAt(0)]; -} // prettier-ignore - -const escapeSequences = ['\\u0000', '\\u0001', '\\u0002', '\\u0003', '\\u0004', '\\u0005', '\\u0006', '\\u0007', '\\b', '\\t', '\\n', '\\u000B', '\\f', '\\r', '\\u000E', '\\u000F', '\\u0010', '\\u0011', '\\u0012', '\\u0013', '\\u0014', '\\u0015', '\\u0016', '\\u0017', '\\u0018', '\\u0019', '\\u001A', '\\u001B', '\\u001C', '\\u001D', '\\u001E', '\\u001F', '', '', '\\"', '', '', '', '', '', '', '', '', '', '', '', '', '', -// 2F -'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', -// 3F -'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', -// 4F -'', '', '', '', '', '', '', '', '', '', '', '', '\\\\', '', '', '', -// 5F -'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', -// 6F -'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '\\u007F', '\\u0080', '\\u0081', '\\u0082', '\\u0083', '\\u0084', '\\u0085', '\\u0086', '\\u0087', '\\u0088', '\\u0089', '\\u008A', '\\u008B', '\\u008C', '\\u008D', '\\u008E', '\\u008F', '\\u0090', '\\u0091', '\\u0092', '\\u0093', '\\u0094', '\\u0095', '\\u0096', '\\u0097', '\\u0098', '\\u0099', '\\u009A', '\\u009B', '\\u009C', '\\u009D', '\\u009E', '\\u009F']; - -/***/ }), - -/***/ "../../../node_modules/graphql/language/printer.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/language/printer.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - +var AnimatePresence = function (_a) { + var children = _a.children, + custom = _a.custom, + _b = _a.initial, + initial = _b === void 0 ? true : _b, + onExitComplete = _a.onExitComplete, + exitBeforeEnter = _a.exitBeforeEnter, + _c = _a.presenceAffectsLayout, + presenceAffectsLayout = _c === void 0 ? true : _c; + // We want to force a re-render once all exiting animations have finished. We + // either use a local forceRender function, or one from a parent context if it exists. + var _d = tslib.__read(useForceUpdate(), 1), + forceRender = _d[0]; + var forceRenderLayoutGroup = React.useContext(LayoutGroupContext).forceRender; + if (forceRenderLayoutGroup) forceRender = forceRenderLayoutGroup; + var isMounted = useIsMounted(); + // Filter out any children that aren't ReactElements. We can only track ReactElements with a props.key + var filteredChildren = onlyElements(children); + var childrenToRender = filteredChildren; + var exiting = new Set(); + // Keep a living record of the children we're actually rendering so we + // can diff to figure out which are entering and exiting + var presentChildren = React.useRef(childrenToRender); + // A lookup table to quickly reference components by key + var allChildren = React.useRef(new Map()).current; + // If this is the initial component render, just deal with logic surrounding whether + // we play onMount animations or not. + var isInitialRender = React.useRef(true); + useIsomorphicLayoutEffect(function () { + isInitialRender.current = false; + updateChildLookup(filteredChildren, allChildren); + presentChildren.current = childrenToRender; + }); + useUnmountEffect(function () { + isInitialRender.current = true; + allChildren.clear(); + exiting.clear(); + }); + if (isInitialRender.current) { + return React__namespace.createElement(React__namespace.Fragment, null, childrenToRender.map(function (child) { + return React__namespace.createElement(PresenceChild, { + key: getChildKey(child), + isPresent: true, + initial: initial ? undefined : false, + presenceAffectsLayout: presenceAffectsLayout + }, child); + })); + } + // If this is a subsequent render, deal with entering and exiting children + childrenToRender = tslib.__spreadArray([], tslib.__read(childrenToRender), false); + // Diff the keys of the currently-present and target children to update our + // exiting list. + var presentKeys = presentChildren.current.map(getChildKey); + var targetKeys = filteredChildren.map(getChildKey); + // Diff the present children with our target children and mark those that are exiting + var numPresent = presentKeys.length; + for (var i = 0; i < numPresent; i++) { + var key = presentKeys[i]; + if (targetKeys.indexOf(key) === -1) { + exiting.add(key); + } + } + // If we currently have exiting children, and we're deferring rendering incoming children + // until after all current children have exiting, empty the childrenToRender array + if (exitBeforeEnter && exiting.size) { + childrenToRender = []; + } + // Loop through all currently exiting components and clone them to overwrite `animate` + // with any `exit` prop they might have defined. + exiting.forEach(function (key) { + // If this component is actually entering again, early return + if (targetKeys.indexOf(key) !== -1) return; + var child = allChildren.get(key); + if (!child) return; + var insertionIndex = presentKeys.indexOf(key); + var onExit = function () { + allChildren.delete(key); + exiting.delete(key); + // Remove this child from the present children + var removeIndex = presentChildren.current.findIndex(function (presentChild) { + return presentChild.key === key; + }); + presentChildren.current.splice(removeIndex, 1); + // Defer re-rendering until all exiting children have indeed left + if (!exiting.size) { + presentChildren.current = filteredChildren; + if (isMounted.current === false) return; + forceRender(); + onExitComplete && onExitComplete(); + } + }; + childrenToRender.splice(insertionIndex, 0, React__namespace.createElement(PresenceChild, { + key: getChildKey(child), + isPresent: false, + onExitComplete: onExit, + custom: custom, + presenceAffectsLayout: presenceAffectsLayout + }, child)); + }); + // Add `MotionContext` even to children that don't need it to ensure we're rendering + // the same tree between renders + childrenToRender = childrenToRender.map(function (child) { + var key = child.key; + return exiting.has(key) ? child : React__namespace.createElement(PresenceChild, { + key: getChildKey(child), + isPresent: true, + presenceAffectsLayout: presenceAffectsLayout + }, child); + }); + if (env !== "production" && exitBeforeEnter && childrenToRender.length > 1) { + console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."); + } + return React__namespace.createElement(React__namespace.Fragment, null, exiting.size ? childrenToRender : childrenToRender.map(function (child) { + return React.cloneElement(child); + })); +}; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.print = print; -var _blockString = __webpack_require__(/*! ./blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); -var _printString = __webpack_require__(/*! ./printString.mjs */ "../../../node_modules/graphql/language/printString.mjs"); -var _visitor = __webpack_require__(/*! ./visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); /** - * Converts an AST into a string, using one set of reasonable - * formatting rules. + * @deprecated */ +var DeprecatedLayoutGroupContext = React.createContext(null); +var notify = function (node) { + return !node.isLayoutDirty && node.willUpdate(false); +}; +function nodeGroup() { + var nodes = new Set(); + var subscriptions = new WeakMap(); + var dirtyAll = function () { + return nodes.forEach(notify); + }; + return { + add: function (node) { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: function (node) { + var _a; + nodes.delete(node); + (_a = subscriptions.get(node)) === null || _a === void 0 ? void 0 : _a(); + subscriptions.delete(node); + dirtyAll(); + }, + dirty: dirtyAll + }; +} +var shouldInheritGroup = function (inherit) { + return inherit === true; +}; +var shouldInheritId = function (inherit) { + return shouldInheritGroup(inherit === true) || inherit === "id"; +}; +var LayoutGroup = function (_a) { + var _b, _c; + var children = _a.children, + id = _a.id, + inheritId = _a.inheritId, + _d = _a.inherit, + inherit = _d === void 0 ? true : _d; + // Maintain backwards-compatibility with inheritId until 7.0 + if (inheritId !== undefined) inherit = inheritId; + var layoutGroupContext = React.useContext(LayoutGroupContext); + var deprecatedLayoutGroupContext = React.useContext(DeprecatedLayoutGroupContext); + var _e = tslib.__read(useForceUpdate(), 2), + forceRender = _e[0], + key = _e[1]; + var context = React.useRef(null); + var upstreamId = (_b = layoutGroupContext.id) !== null && _b !== void 0 ? _b : deprecatedLayoutGroupContext; + if (context.current === null) { + if (shouldInheritId(inherit) && upstreamId) { + id = id ? upstreamId + "-" + id : upstreamId; + } + context.current = { + id: id, + group: shouldInheritGroup(inherit) ? (_c = layoutGroupContext === null || layoutGroupContext === void 0 ? void 0 : layoutGroupContext.group) !== null && _c !== void 0 ? _c : nodeGroup() : nodeGroup() + }; + } + var memoizedContext = React.useMemo(function () { + return tslib.__assign(tslib.__assign({}, context.current), { + forceRender: forceRender + }); + }, [key]); + return React__namespace.createElement(LayoutGroupContext.Provider, { + value: memoizedContext + }, children); +}; +var id = 0; +var AnimateSharedLayout = function (_a) { + var children = _a.children; + React__namespace.useEffect(function () { + heyListen.warning(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); + }, []); + return React__namespace.createElement(LayoutGroup, { + id: useConstant(function () { + return "asl-".concat(id++); + }) + }, children); +}; -function print(ast) { - return (0, _visitor.visit)(ast, printDocASTReducer); +/** + * `MotionConfig` is used to set configuration options for all children `motion` components. + * + * ```jsx + * import { motion, MotionConfig } from "framer-motion" + * + * export function App() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ +function MotionConfig(_a) { + var children = _a.children, + isValidProp = _a.isValidProp, + config = tslib.__rest(_a, ["children", "isValidProp"]); + isValidProp && loadExternalIsValidProp(isValidProp); + /** + * Inherit props from any parent MotionConfig components + */ + config = tslib.__assign(tslib.__assign({}, React.useContext(MotionConfigContext)), config); + /** + * Don't allow isStatic to change between renders as it affects how many hooks + * motion components fire. + */ + config.isStatic = useConstant(function () { + return config.isStatic; + }); + /** + * Creating a new config context object will re-render every `motion` component + * every time it renders. So we only want to create a new one sparingly. + */ + var context = React.useMemo(function () { + return config; + }, [JSON.stringify(config.transition), config.transformPagePoint, config.reducedMotion]); + return React__namespace.createElement(MotionConfigContext.Provider, { + value: context + }, children); } -const MAX_LINE_LENGTH = 80; -const printDocASTReducer = { - Name: { - leave: node => node.value - }, - Variable: { - leave: node => '$' + node.name - }, - // Document - Document: { - leave: node => join(node.definitions, '\n\n') - }, - OperationDefinition: { - leave(node) { - const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); - const prefix = join([node.operation, join([node.name, varDefs]), join(node.directives, ' ')], ' '); // Anonymous queries with no directives or variable definitions can use - // the query short form. - return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet; - } - }, - VariableDefinition: { - leave: ({ - variable, - type, - defaultValue, - directives - }) => variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' ')) - }, - SelectionSet: { - leave: ({ - selections - }) => block(selections) - }, - Field: { - leave({ - alias, - name, - arguments: args, - directives, - selectionSet - }) { - const prefix = wrap('', alias, ': ') + name; - let argsLine = prefix + wrap('(', join(args, ', '), ')'); - if (argsLine.length > MAX_LINE_LENGTH) { - argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); - } - return join([argsLine, join(directives, ' '), selectionSet], ' '); - } - }, - Argument: { - leave: ({ - name, - value - }) => name + ': ' + value - }, - // Fragments - FragmentSpread: { - leave: ({ - name, - directives - }) => '...' + name + wrap(' ', join(directives, ' ')) - }, - InlineFragment: { - leave: ({ - typeCondition, - directives, - selectionSet - }) => join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ') - }, - FragmentDefinition: { - leave: ({ - name, - typeCondition, - variableDefinitions, - directives, - selectionSet - } // Note: fragment variable definitions are experimental and may be changed - ) => - // or removed in the future. - `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` + `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` + selectionSet - }, - // Value - IntValue: { - leave: ({ - value - }) => value - }, - FloatValue: { - leave: ({ - value - }) => value - }, - StringValue: { - leave: ({ - value, - block: isBlockString - }) => isBlockString ? (0, _blockString.printBlockString)(value) : (0, _printString.printString)(value) - }, - BooleanValue: { - leave: ({ - value - }) => value ? 'true' : 'false' - }, - NullValue: { - leave: () => 'null' - }, - EnumValue: { - leave: ({ - value - }) => value - }, - ListValue: { - leave: ({ - values - }) => '[' + join(values, ', ') + ']' - }, - ObjectValue: { - leave: ({ - fields - }) => '{' + join(fields, ', ') + '}' - }, - ObjectField: { - leave: ({ - name, - value - }) => name + ': ' + value - }, - // Directive - Directive: { - leave: ({ - name, - arguments: args - }) => '@' + name + wrap('(', join(args, ', '), ')') - }, - // Type - NamedType: { - leave: ({ - name - }) => name - }, - ListType: { - leave: ({ - type - }) => '[' + type + ']' - }, - NonNullType: { - leave: ({ - type - }) => type + '!' - }, - // Type System Definitions - SchemaDefinition: { - leave: ({ - description, - directives, - operationTypes - }) => wrap('', description, '\n') + join(['schema', join(directives, ' '), block(operationTypes)], ' ') - }, - OperationTypeDefinition: { - leave: ({ - operation, - type - }) => operation + ': ' + type - }, - ScalarTypeDefinition: { - leave: ({ - description, - name, - directives - }) => wrap('', description, '\n') + join(['scalar', name, join(directives, ' ')], ' ') - }, - ObjectTypeDefinition: { - leave: ({ - description, - name, - interfaces, - directives, - fields - }) => wrap('', description, '\n') + join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ') - }, - FieldDefinition: { - leave: ({ - description, - name, - arguments: args, - type, - directives - }) => wrap('', description, '\n') + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' ')) - }, - InputValueDefinition: { - leave: ({ - description, - name, - type, - defaultValue, - directives - }) => wrap('', description, '\n') + join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ') - }, - InterfaceTypeDefinition: { - leave: ({ - description, - name, - interfaces, - directives, - fields - }) => wrap('', description, '\n') + join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ') - }, - UnionTypeDefinition: { - leave: ({ - description, - name, - directives, - types - }) => wrap('', description, '\n') + join(['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' ') - }, - EnumTypeDefinition: { - leave: ({ - description, - name, - directives, - values - }) => wrap('', description, '\n') + join(['enum', name, join(directives, ' '), block(values)], ' ') - }, - EnumValueDefinition: { - leave: ({ - description, - name, - directives - }) => wrap('', description, '\n') + join([name, join(directives, ' ')], ' ') - }, - InputObjectTypeDefinition: { - leave: ({ - description, - name, - directives, - fields - }) => wrap('', description, '\n') + join(['input', name, join(directives, ' '), block(fields)], ' ') - }, - DirectiveDefinition: { - leave: ({ - description, - name, - arguments: args, - repeatable, - locations - }) => wrap('', description, '\n') + 'directive @' + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | ') - }, - SchemaExtension: { - leave: ({ - directives, - operationTypes - }) => join(['extend schema', join(directives, ' '), block(operationTypes)], ' ') - }, - ScalarTypeExtension: { - leave: ({ - name, - directives - }) => join(['extend scalar', name, join(directives, ' ')], ' ') - }, - ObjectTypeExtension: { - leave: ({ - name, - interfaces, - directives, - fields - }) => join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ') - }, - InterfaceTypeExtension: { - leave: ({ - name, - interfaces, - directives, - fields - }) => join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ') - }, - UnionTypeExtension: { - leave: ({ - name, - directives, - types - }) => join(['extend union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' ') - }, - EnumTypeExtension: { - leave: ({ - name, - directives, - values - }) => join(['extend enum', name, join(directives, ' '), block(values)], ' ') - }, - InputObjectTypeExtension: { - leave: ({ - name, - directives, - fields - }) => join(['extend input', name, join(directives, ' '), block(fields)], ' ') - } -}; /** - * Given maybeArray, print an empty string if it is null or empty, otherwise - * print all items together separated by separator if provided + * Used in conjunction with the `m` component to reduce bundle size. + * + * `m` is a version of the `motion` component that only loads functionality + * critical for the initial render. + * + * `LazyMotion` can then be used to either synchronously or asynchronously + * load animation and gesture support. + * + * ```jsx + * // Synchronous loading + * import { LazyMotion, m, domAnimations } from "framer-motion" + * + * function App() { + * return ( + * + * + * + * ) + * } + * + * // Asynchronous loading + * import { LazyMotion, m } from "framer-motion" + * + * function App() { + * return ( + * import('./path/to/domAnimations')}> + * + * + * ) + * } + * ``` + * + * @public */ - -function join(maybeArray, separator = '') { - var _maybeArray$filter$jo; - return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(x => x).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : ''; +function LazyMotion(_a) { + var children = _a.children, + features = _a.features, + _b = _a.strict, + strict = _b === void 0 ? false : _b; + var _c = tslib.__read(React.useState(!isLazyBundle(features)), 2), + setIsLoaded = _c[1]; + var loadedRenderer = React.useRef(undefined); + /** + * If this is a synchronous load, load features immediately + */ + if (!isLazyBundle(features)) { + var renderer = features.renderer, + loadedFeatures = tslib.__rest(features, ["renderer"]); + loadedRenderer.current = renderer; + loadFeatures(loadedFeatures); + } + React.useEffect(function () { + if (isLazyBundle(features)) { + features().then(function (_a) { + var renderer = _a.renderer, + loadedFeatures = tslib.__rest(_a, ["renderer"]); + loadFeatures(loadedFeatures); + loadedRenderer.current = renderer; + setIsLoaded(true); + }); + } + }, []); + return React__namespace.createElement(LazyContext.Provider, { + value: { + renderer: loadedRenderer.current, + strict: strict + } + }, children); } -/** - * Given array, print each item on its own line, wrapped in an indented `{ }` block. - */ - -function block(array) { - return wrap('{\n', indent(join(array, '\n')), '\n}'); +function isLazyBundle(features) { + return typeof features === "function"; } -/** - * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string. - */ - -function wrap(start, maybeString, end = '') { - return maybeString != null && maybeString !== '' ? start + maybeString + end : ''; +var ReorderContext = React.createContext(null); +function checkReorder(order, value, offset, velocity) { + if (!velocity) return order; + var index = order.findIndex(function (item) { + return item.value === value; + }); + if (index === -1) return order; + var nextOffset = velocity > 0 ? 1 : -1; + var nextItem = order[index + nextOffset]; + if (!nextItem) return order; + var item = order[index]; + var nextLayout = nextItem.layout; + var nextItemCenter = popmotion.mix(nextLayout.min, nextLayout.max, 0.5); + if (nextOffset === 1 && item.layout.max + offset > nextItemCenter || nextOffset === -1 && item.layout.min + offset < nextItemCenter) { + return moveItem(order, index, index + nextOffset); + } + return order; } -function indent(str) { - return wrap(' ', str.replace(/\n/g, '\n ')); +function ReorderGroup(_a, externalRef) { + var children = _a.children, + _b = _a.as, + as = _b === void 0 ? "ul" : _b, + _c = _a.axis, + axis = _c === void 0 ? "y" : _c, + onReorder = _a.onReorder, + values = _a.values, + props = tslib.__rest(_a, ["children", "as", "axis", "onReorder", "values"]); + var Component = useConstant(function () { + return motion(as); + }); + var order = []; + var isReordering = React.useRef(false); + heyListen.invariant(Boolean(values), "Reorder.Group must be provided a values prop"); + var context = { + axis: axis, + registerItem: function (value, layout) { + /** + * Ensure entries can't add themselves more than once + */ + if (layout && order.findIndex(function (entry) { + return value === entry.value; + }) === -1) { + order.push({ + value: value, + layout: layout[axis] + }); + order.sort(compareMin); + } + }, + updateOrder: function (id, offset, velocity) { + if (isReordering.current) return; + var newOrder = checkReorder(order, id, offset, velocity); + if (order !== newOrder) { + isReordering.current = true; + onReorder(newOrder.map(getValue).filter(function (value) { + return values.indexOf(value) !== -1; + })); + } + } + }; + React.useEffect(function () { + isReordering.current = false; + }); + return React__namespace.createElement(Component, tslib.__assign({}, props, { + ref: externalRef + }), React__namespace.createElement(ReorderContext.Provider, { + value: context + }, children)); } -function hasMultilineItems(maybeArray) { - var _maybeArray$some; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some(str => str.includes('\n'))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false; +var Group = React.forwardRef(ReorderGroup); +function getValue(item) { + return item.value; +} +function compareMin(a, b) { + return a.layout.min - b.layout.min; } -/***/ }), - -/***/ "../../../node_modules/graphql/language/source.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/language/source.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.Source = void 0; -exports.isSource = isSource; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _instanceOf = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); /** - * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are - * optional, but they are useful for clients who store GraphQL documents in source files. - * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might - * be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`. - * The `line` and `column` properties in `locationOffset` are 1-indexed. + * Creates a `MotionValue` to track the state and velocity of a value. + * + * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. + * + * ```jsx + * export const MyComponent = () => { + * const scale = useMotionValue(1) + * + * return + * } + * ``` + * + * @param initial - The initial state. + * + * @public */ -class Source { - constructor(body, name = 'GraphQL request', locationOffset = { - line: 1, - column: 1 - }) { - typeof body === 'string' || (0, _devAssert.devAssert)(false, `Body must be a string. Received: ${(0, _inspect.inspect)(body)}.`); - this.body = body; - this.name = name; - this.locationOffset = locationOffset; - this.locationOffset.line > 0 || (0, _devAssert.devAssert)(false, 'line in locationOffset is 1-indexed and must be positive.'); - this.locationOffset.column > 0 || (0, _devAssert.devAssert)(false, 'column in locationOffset is 1-indexed and must be positive.'); +function useMotionValue(initial) { + var value = useConstant(function () { + return motionValue(initial); + }); + /** + * If this motion value is being used in static mode, like on + * the Framer canvas, force components to rerender when the motion + * value is updated. + */ + var isStatic = React.useContext(MotionConfigContext).isStatic; + if (isStatic) { + var _a = tslib.__read(React.useState(initial), 2), + setLatest_1 = _a[1]; + React.useEffect(function () { + return value.onChange(setLatest_1); + }, []); } - get [Symbol.toStringTag]() { - return 'Source'; + return value; +} +var isCustomValueType = function (v) { + return typeof v === "object" && v.mix; +}; +var getMixer = function (v) { + return isCustomValueType(v) ? v.mix : undefined; +}; +function transform() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; } + var useImmediate = !Array.isArray(args[0]); + var argOffset = useImmediate ? 0 : -1; + var inputValue = args[0 + argOffset]; + var inputRange = args[1 + argOffset]; + var outputRange = args[2 + argOffset]; + var options = args[3 + argOffset]; + var interpolator = popmotion.interpolate(inputRange, outputRange, tslib.__assign({ + mixer: getMixer(outputRange[0]) + }, options)); + return useImmediate ? interpolator(inputValue) : interpolator; } -/** - * Test if the given value is a Source object. - * - * @internal - */ -exports.Source = Source; -function isSource(source) { - return (0, _instanceOf.instanceOf)(source, Source); +function useOnChange(value, callback) { + useIsomorphicLayoutEffect(function () { + if (isMotionValue(value)) return value.onChange(callback); + }, [callback]); } - -/***/ }), - -/***/ "../../../node_modules/graphql/language/tokenKind.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/language/tokenKind.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.TokenKind = void 0; -/** - * An exported enum describing the different kinds of tokens that the - * lexer emits. - */ -var TokenKind; -(function (TokenKind) { - TokenKind['SOF'] = ''; - TokenKind['EOF'] = ''; - TokenKind['BANG'] = '!'; - TokenKind['DOLLAR'] = '$'; - TokenKind['AMP'] = '&'; - TokenKind['PAREN_L'] = '('; - TokenKind['PAREN_R'] = ')'; - TokenKind['SPREAD'] = '...'; - TokenKind['COLON'] = ':'; - TokenKind['EQUALS'] = '='; - TokenKind['AT'] = '@'; - TokenKind['BRACKET_L'] = '['; - TokenKind['BRACKET_R'] = ']'; - TokenKind['BRACE_L'] = '{'; - TokenKind['PIPE'] = '|'; - TokenKind['BRACE_R'] = '}'; - TokenKind['NAME'] = 'Name'; - TokenKind['INT'] = 'Int'; - TokenKind['FLOAT'] = 'Float'; - TokenKind['STRING'] = 'String'; - TokenKind['BLOCK_STRING'] = 'BlockString'; - TokenKind['COMMENT'] = 'Comment'; -})(TokenKind || (exports.TokenKind = TokenKind = {})); +function useMultiOnChange(values, handler) { + useIsomorphicLayoutEffect(function () { + var subscriptions = values.map(function (value) { + return value.onChange(handler); + }); + return function () { + return subscriptions.forEach(function (unsubscribe) { + return unsubscribe(); + }); + }; + }); +} +function useCombineMotionValues(values, combineValues) { + /** + * Initialise the returned motion value. This remains the same between renders. + */ + var value = useMotionValue(combineValues()); + /** + * Create a function that will update the template motion value with the latest values. + * This is pre-bound so whenever a motion value updates it can schedule its + * execution in Framesync. If it's already been scheduled it won't be fired twice + * in a single frame. + */ + var updateValue = function () { + return value.set(combineValues()); + }; + /** + * Synchronously update the motion value with the latest values during the render. + * This ensures that within a React render, the styles applied to the DOM are up-to-date. + */ + updateValue(); + /** + * Subscribe to all motion values found within the template. Whenever any of them change, + * schedule an update. + */ + useMultiOnChange(values, function () { + return sync__default["default"].update(updateValue, false, true); + }); + return value; +} +function useTransform(input, inputRangeOrTransformer, outputRange, options) { + var transformer = typeof inputRangeOrTransformer === "function" ? inputRangeOrTransformer : transform(inputRangeOrTransformer, outputRange, options); + return Array.isArray(input) ? useListTransform(input, transformer) : useListTransform([input], function (_a) { + var _b = tslib.__read(_a, 1), + latest = _b[0]; + return transformer(latest); + }); +} +function useListTransform(values, transformer) { + var latest = useConstant(function () { + return []; + }); + return useCombineMotionValues(values, function () { + latest.length = 0; + var numValues = values.length; + for (var i = 0; i < numValues; i++) { + latest[i] = values[i].get(); + } + return transformer(latest); + }); +} +function useDefaultMotionValue(value, defaultValue) { + if (defaultValue === void 0) { + defaultValue = 0; + } + return isMotionValue(value) ? value : useMotionValue(defaultValue); +} +function ReorderItem(_a, externalRef) { + var children = _a.children, + style = _a.style, + value = _a.value, + _b = _a.as, + as = _b === void 0 ? "li" : _b, + onDrag = _a.onDrag, + _c = _a.layout, + layout = _c === void 0 ? true : _c, + props = tslib.__rest(_a, ["children", "style", "value", "as", "onDrag", "layout"]); + var Component = useConstant(function () { + return motion(as); + }); + var context = React.useContext(ReorderContext); + var point = { + x: useDefaultMotionValue(style === null || style === void 0 ? void 0 : style.x), + y: useDefaultMotionValue(style === null || style === void 0 ? void 0 : style.y) + }; + var zIndex = useTransform([point.x, point.y], function (_a) { + var _b = tslib.__read(_a, 2), + latestX = _b[0], + latestY = _b[1]; + return latestX || latestY ? 1 : "unset"; + }); + var measuredLayout = React.useRef(null); + heyListen.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group"); + var _d = context, + axis = _d.axis, + registerItem = _d.registerItem, + updateOrder = _d.updateOrder; + React.useEffect(function () { + registerItem(value, measuredLayout.current); + }, [context]); + return React__namespace.createElement(Component, tslib.__assign({ + drag: axis + }, props, { + dragSnapToOrigin: true, + style: tslib.__assign(tslib.__assign({}, style), { + x: point.x, + y: point.y, + zIndex: zIndex + }), + layout: layout, + onDrag: function (event, gesturePoint) { + var velocity = gesturePoint.velocity; + velocity[axis] && updateOrder(value, point[axis].get(), velocity[axis]); + onDrag === null || onDrag === void 0 ? void 0 : onDrag(event, gesturePoint); + }, + onLayoutMeasure: function (measured) { + measuredLayout.current = measured; + }, + ref: externalRef + }), children); +} +var Item = React.forwardRef(ReorderItem); +var Reorder = { + Group: Group, + Item: Item +}; /** - * The enum type representing the token kinds values. - * - * @deprecated Please use `TokenKind`. Will be remove in v17. + * @public */ +var domAnimation = tslib.__assign(tslib.__assign({ + renderer: createDomVisualElement +}, animations), gestureAnimations); -/***/ }), - -/***/ "../../../node_modules/graphql/language/visitor.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/language/visitor.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.BREAK = void 0; -exports.getEnterLeaveForKind = getEnterLeaveForKind; -exports.getVisitFn = getVisitFn; -exports.visit = visit; -exports.visitInParallel = visitInParallel; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _ast = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -var _kinds = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); /** - * A visitor is provided to visit, it contains the collection of - * relevant functions to be called during the visitor's traversal. + * @public */ +var domMax = tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({}, domAnimation), drag), layoutFeatures), { + projectionNodeConstructor: HTMLProjectionNode +}); -const BREAK = exports.BREAK = Object.freeze({}); /** - * visit() will walk through an AST using a depth-first traversal, calling - * the visitor's enter function at each node in the traversal, and calling the - * leave function after visiting that node and all of its child nodes. + * Combine multiple motion values into a new one using a string template literal. * - * By returning different values from the enter and leave functions, the - * behavior of the visitor can be altered, including skipping over a sub-tree of - * the AST (by returning false), editing the AST by returning a value or null - * to remove the value, or to stop the whole traversal by returning BREAK. + * ```jsx + * import { + * motion, + * useSpring, + * useMotionValue, + * useMotionTemplate + * } from "framer-motion" * - * When using visit() to edit an AST, the original AST will not be modified, and - * a new version of the AST with the changes applied will be returned from the - * visit function. + * function Component() { + * const shadowX = useSpring(0) + * const shadowY = useMotionValue(0) + * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` * - * ```ts - * const editedAST = visit(ast, { - * enter(node, key, parent, path, ancestors) { - * // @return - * // undefined: no action - * // false: skip visiting this node - * // visitor.BREAK: stop visiting altogether - * // null: delete this node - * // any value: replace this node with the returned value - * }, - * leave(node, key, parent, path, ancestors) { - * // @return - * // undefined: no action - * // false: no action - * // visitor.BREAK: stop visiting altogether - * // null: delete this node - * // any value: replace this node with the returned value - * } - * }); + * return + * } * ``` * - * Alternatively to providing enter() and leave() functions, a visitor can - * instead provide functions named the same as the kinds of AST nodes, or - * enter/leave visitors at a named key, leading to three permutations of the - * visitor API: - * - * 1) Named visitors triggered when entering a node of a specific kind. + * @public + */ +function useMotionTemplate(fragments) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + /** + * Create a function that will build a string from the latest motion values. + */ + var numFragments = fragments.length; + function buildValue() { + var output = ""; + for (var i = 0; i < numFragments; i++) { + output += fragments[i]; + var value = values[i]; + if (value) output += values[i].get(); + } + return output; + } + return useCombineMotionValues(values, buildValue); +} + +/** + * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state. * - * ```ts - * visit(ast, { - * Kind(node) { - * // enter the "Kind" node - * } - * }) - * ``` + * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber + * to another `MotionValue`. * - * 2) Named visitors that trigger upon entering and leaving a node of a specific kind. + * @remarks * - * ```ts - * visit(ast, { - * Kind: { - * enter(node) { - * // enter the "Kind" node - * } - * leave(node) { - * // leave the "Kind" node - * } - * } - * }) + * ```jsx + * const x = useSpring(0, { stiffness: 300 }) + * const y = useSpring(x, { damping: 10 }) * ``` * - * 3) Generic visitors that trigger upon entering and leaving any node. + * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value. + * @param springConfig - Configuration options for the spring. + * @returns `MotionValue` * - * ```ts - * visit(ast, { - * enter(node) { - * // enter any node - * }, - * leave(node) { - * // leave any node - * } - * }) - * ``` + * @public */ - -function visit(root, visitor, visitorKeys = _ast.QueryDocumentKeys) { - const enterLeaveMap = new Map(); - for (const kind of Object.values(_kinds.Kind)) { - enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind)); +function useSpring(source, config) { + if (config === void 0) { + config = {}; } - /* eslint-disable no-undef-init */ - - let stack = undefined; - let inArray = Array.isArray(root); - let keys = [root]; - let index = -1; - let edits = []; - let node = root; - let key = undefined; - let parent = undefined; - const path = []; - const ancestors = []; - /* eslint-enable no-undef-init */ - - do { - index++; - const isLeaving = index === keys.length; - const isEdited = isLeaving && edits.length !== 0; - if (isLeaving) { - key = ancestors.length === 0 ? undefined : path[path.length - 1]; - node = parent; - parent = ancestors.pop(); - if (isEdited) { - if (inArray) { - node = node.slice(); - let editOffset = 0; - for (const [editKey, editValue] of edits) { - const arrayKey = editKey - editOffset; - if (editValue === null) { - node.splice(arrayKey, 1); - editOffset++; - } else { - node[arrayKey] = editValue; - } - } - } else { - node = Object.defineProperties({}, Object.getOwnPropertyDescriptors(node)); - for (const [editKey, editValue] of edits) { - node[editKey] = editValue; - } - } - } - index = stack.index; - keys = stack.keys; - edits = stack.edits; - inArray = stack.inArray; - stack = stack.prev; - } else if (parent) { - key = inArray ? index : keys[index]; - node = parent[key]; - if (node === null || node === undefined) { - continue; - } - path.push(key); - } - let result; - if (!Array.isArray(node)) { - var _enterLeaveMap$get, _enterLeaveMap$get2; - (0, _ast.isNode)(node) || (0, _devAssert.devAssert)(false, `Invalid AST Node: ${(0, _inspect.inspect)(node)}.`); - const visitFn = isLeaving ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get === void 0 ? void 0 : _enterLeaveMap$get.leave : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get2 === void 0 ? void 0 : _enterLeaveMap$get2.enter; - result = visitFn === null || visitFn === void 0 ? void 0 : visitFn.call(visitor, node, key, parent, path, ancestors); - if (result === BREAK) { - break; - } - if (result === false) { - if (!isLeaving) { - path.pop(); - continue; - } - } else if (result !== undefined) { - edits.push([key, result]); - if (!isLeaving) { - if ((0, _ast.isNode)(result)) { - node = result; - } else { - path.pop(); - continue; - } - } - } - } - if (result === undefined && isEdited) { - edits.push([key, node]); - } - if (isLeaving) { - path.pop(); - } else { - var _node$kind; - stack = { - inArray, - index, - keys, - edits, - prev: stack - }; - inArray = Array.isArray(node); - keys = inArray ? node : (_node$kind = visitorKeys[node.kind]) !== null && _node$kind !== void 0 ? _node$kind : []; - index = -1; - edits = []; - if (parent) { - ancestors.push(parent); + var isStatic = React.useContext(MotionConfigContext).isStatic; + var activeSpringAnimation = React.useRef(null); + var value = useMotionValue(isMotionValue(source) ? source.get() : source); + React.useMemo(function () { + return value.attach(function (v, set) { + /** + * A more hollistic approach to this might be to use isStatic to fix VisualElement animations + * at that level, but this will work for now + */ + if (isStatic) return set(v); + if (activeSpringAnimation.current) { + activeSpringAnimation.current.stop(); } - parent = node; - } - } while (stack !== undefined); - if (edits.length !== 0) { - // New root - return edits[edits.length - 1][1]; - } - return root; + activeSpringAnimation.current = popmotion.animate(tslib.__assign(tslib.__assign({ + from: value.get(), + to: v, + velocity: value.getVelocity() + }, config), { + onUpdate: set + })); + return value.get(); + }); + }, [JSON.stringify(config)]); + useOnChange(source, function (v) { + return value.set(parseFloat(v)); + }); + return value; } + /** - * Creates a new visitor instance which delegates to many visitors to run in - * parallel. Each visitor will be visited for each node before moving on. + * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. * - * If a prior visitor edits a node, no following visitors will see that node. + * ```javascript + * const x = useMotionValue(0) + * const xVelocity = useVelocity(x) + * const xAcceleration = useVelocity(xVelocity) + * ``` + * + * @public */ - -function visitInParallel(visitors) { - const skipping = new Array(visitors.length).fill(null); - const mergedVisitor = Object.create(null); - for (const kind of Object.values(_kinds.Kind)) { - let hasVisitor = false; - const enterList = new Array(visitors.length).fill(undefined); - const leaveList = new Array(visitors.length).fill(undefined); - for (let i = 0; i < visitors.length; ++i) { - const { - enter, - leave - } = getEnterLeaveForKind(visitors[i], kind); - hasVisitor || (hasVisitor = enter != null || leave != null); - enterList[i] = enter; - leaveList[i] = leave; - } - if (!hasVisitor) { - continue; - } - const mergedEnterLeave = { - enter(...args) { - const node = args[0]; - for (let i = 0; i < visitors.length; i++) { - if (skipping[i] === null) { - var _enterList$i; - const result = (_enterList$i = enterList[i]) === null || _enterList$i === void 0 ? void 0 : _enterList$i.apply(visitors[i], args); - if (result === false) { - skipping[i] = node; - } else if (result === BREAK) { - skipping[i] = BREAK; - } else if (result !== undefined) { - return result; - } - } - } - }, - leave(...args) { - const node = args[0]; - for (let i = 0; i < visitors.length; i++) { - if (skipping[i] === null) { - var _leaveList$i; - const result = (_leaveList$i = leaveList[i]) === null || _leaveList$i === void 0 ? void 0 : _leaveList$i.apply(visitors[i], args); - if (result === BREAK) { - skipping[i] = BREAK; - } else if (result !== undefined && result !== false) { - return result; - } - } else if (skipping[i] === node) { - skipping[i] = null; - } - } - } - }; - mergedVisitor[kind] = mergedEnterLeave; - } - return mergedVisitor; +function useVelocity(value) { + var velocity = useMotionValue(value.getVelocity()); + React.useEffect(function () { + return value.velocityUpdateSubscribers.add(function (newVelocity) { + velocity.set(newVelocity); + }); + }, [value]); + return velocity; } -/** - * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind. - */ - -function getEnterLeaveForKind(visitor, kind) { - const kindVisitor = visitor[kind]; - if (typeof kindVisitor === 'object') { - // { Kind: { enter() {}, leave() {} } } - return kindVisitor; - } else if (typeof kindVisitor === 'function') { - // { Kind() {} } - return { - enter: kindVisitor, - leave: undefined - }; - } // { enter() {}, leave() {} } - +var createScrollMotionValues = function () { return { - enter: visitor.enter, - leave: visitor.leave + scrollX: motionValue(0), + scrollY: motionValue(0), + scrollXProgress: motionValue(0), + scrollYProgress: motionValue(0) }; -} -/** - * Given a visitor instance, if it is leaving or not, and a node kind, return - * the function the visitor runtime should call. - * - * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17 - */ - -/* c8 ignore next 8 */ - -function getVisitFn(visitor, kind, isLeaving) { - const { - enter, - leave - } = getEnterLeaveForKind(visitor, kind); - return isLeaving ? leave : enter; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/type/assertName.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/type/assertName.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.assertEnumValueName = assertEnumValueName; -exports.assertName = assertName; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _characterClasses = __webpack_require__(/*! ../language/characterClasses.mjs */ "../../../node_modules/graphql/language/characterClasses.mjs"); -/** - * Upholds the spec rules about naming. - */ - -function assertName(name) { - name != null || (0, _devAssert.devAssert)(false, 'Must provide name.'); - typeof name === 'string' || (0, _devAssert.devAssert)(false, 'Expected name to be a string.'); - if (name.length === 0) { - throw new _GraphQLError.GraphQLError('Expected name to be a non-empty string.'); - } - for (let i = 1; i < name.length; ++i) { - if (!(0, _characterClasses.isNameContinue)(name.charCodeAt(i))) { - throw new _GraphQLError.GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${name}" does not.`); - } - } - if (!(0, _characterClasses.isNameStart)(name.charCodeAt(0))) { - throw new _GraphQLError.GraphQLError(`Names must start with [_a-zA-Z] but "${name}" does not.`); - } - return name; -} -/** - * Upholds the spec rules about naming enum values. - * - * @internal - */ - -function assertEnumValueName(name) { - if (name === 'true' || name === 'false' || name === 'null') { - throw new _GraphQLError.GraphQLError(`Enum values cannot be named: ${name}`); - } - return assertName(name); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/type/definition.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/type/definition.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.GraphQLUnionType = exports.GraphQLScalarType = exports.GraphQLObjectType = exports.GraphQLNonNull = exports.GraphQLList = exports.GraphQLInterfaceType = exports.GraphQLInputObjectType = exports.GraphQLEnumType = void 0; -exports.argsToArgsConfig = argsToArgsConfig; -exports.assertAbstractType = assertAbstractType; -exports.assertCompositeType = assertCompositeType; -exports.assertEnumType = assertEnumType; -exports.assertInputObjectType = assertInputObjectType; -exports.assertInputType = assertInputType; -exports.assertInterfaceType = assertInterfaceType; -exports.assertLeafType = assertLeafType; -exports.assertListType = assertListType; -exports.assertNamedType = assertNamedType; -exports.assertNonNullType = assertNonNullType; -exports.assertNullableType = assertNullableType; -exports.assertObjectType = assertObjectType; -exports.assertOutputType = assertOutputType; -exports.assertScalarType = assertScalarType; -exports.assertType = assertType; -exports.assertUnionType = assertUnionType; -exports.assertWrappingType = assertWrappingType; -exports.defineArguments = defineArguments; -exports.getNamedType = getNamedType; -exports.getNullableType = getNullableType; -exports.isAbstractType = isAbstractType; -exports.isCompositeType = isCompositeType; -exports.isEnumType = isEnumType; -exports.isInputObjectType = isInputObjectType; -exports.isInputType = isInputType; -exports.isInterfaceType = isInterfaceType; -exports.isLeafType = isLeafType; -exports.isListType = isListType; -exports.isNamedType = isNamedType; -exports.isNonNullType = isNonNullType; -exports.isNullableType = isNullableType; -exports.isObjectType = isObjectType; -exports.isOutputType = isOutputType; -exports.isRequiredArgument = isRequiredArgument; -exports.isRequiredInputField = isRequiredInputField; -exports.isScalarType = isScalarType; -exports.isType = isType; -exports.isUnionType = isUnionType; -exports.isWrappingType = isWrappingType; -exports.resolveObjMapThunk = resolveObjMapThunk; -exports.resolveReadonlyArrayThunk = resolveReadonlyArrayThunk; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _didYouMean = __webpack_require__(/*! ../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -var _identityFunc = __webpack_require__(/*! ../jsutils/identityFunc.mjs */ "../../../node_modules/graphql/jsutils/identityFunc.mjs"); -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _instanceOf = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); -var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -var _keyMap = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -var _keyValMap = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); -var _mapValue = __webpack_require__(/*! ../jsutils/mapValue.mjs */ "../../../node_modules/graphql/jsutils/mapValue.mjs"); -var _suggestionList = __webpack_require__(/*! ../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -var _toObjMap = __webpack_require__(/*! ../jsutils/toObjMap.mjs */ "../../../node_modules/graphql/jsutils/toObjMap.mjs"); -var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _valueFromASTUntyped = __webpack_require__(/*! ../utilities/valueFromASTUntyped.mjs */ "../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs"); -var _assertName = __webpack_require__(/*! ./assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); -function isType(type) { - return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type); -} -function assertType(type) { - if (!isType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL type.`); - } - return type; -} -/** - * There are predicates for each kind of GraphQL type. - */ - -function isScalarType(type) { - return (0, _instanceOf.instanceOf)(type, GraphQLScalarType); -} -function assertScalarType(type) { - if (!isScalarType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Scalar type.`); - } - return type; -} -function isObjectType(type) { - return (0, _instanceOf.instanceOf)(type, GraphQLObjectType); -} -function assertObjectType(type) { - if (!isObjectType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Object type.`); - } - return type; -} -function isInterfaceType(type) { - return (0, _instanceOf.instanceOf)(type, GraphQLInterfaceType); -} -function assertInterfaceType(type) { - if (!isInterfaceType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Interface type.`); - } - return type; -} -function isUnionType(type) { - return (0, _instanceOf.instanceOf)(type, GraphQLUnionType); -} -function assertUnionType(type) { - if (!isUnionType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Union type.`); - } - return type; -} -function isEnumType(type) { - return (0, _instanceOf.instanceOf)(type, GraphQLEnumType); -} -function assertEnumType(type) { - if (!isEnumType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Enum type.`); - } - return type; -} -function isInputObjectType(type) { - return (0, _instanceOf.instanceOf)(type, GraphQLInputObjectType); -} -function assertInputObjectType(type) { - if (!isInputObjectType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Input Object type.`); +}; +function useScroll(_a) { + if (_a === void 0) { + _a = {}; } - return type; + var container = _a.container, + target = _a.target, + options = tslib.__rest(_a, ["container", "target"]); + var values = useConstant(createScrollMotionValues); + useIsomorphicLayoutEffect(function () { + return dom.scroll(function (_a) { + var x = _a.x, + y = _a.y; + values.scrollX.set(x.current); + values.scrollXProgress.set(x.progress); + values.scrollY.set(y.current); + values.scrollYProgress.set(y.progress); + }, tslib.__assign(tslib.__assign({}, options), { + container: (container === null || container === void 0 ? void 0 : container.current) || undefined, + target: (target === null || target === void 0 ? void 0 : target.current) || undefined + })); + }, []); + return values; } -function isListType(type) { - return (0, _instanceOf.instanceOf)(type, GraphQLList); +function useElementScroll(ref) { + warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); + return useScroll({ + container: ref + }); } -function assertListType(type) { - if (!isListType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL List type.`); - } - return type; +function useViewportScroll() { + warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); + return useScroll(); } -function isNonNullType(type) { - return (0, _instanceOf.instanceOf)(type, GraphQLNonNull); +var getCurrentTime = typeof performance !== "undefined" ? function () { + return performance.now(); +} : function () { + return Date.now(); +}; +function useAnimationFrame(callback) { + var initialTimestamp = useConstant(getCurrentTime); + var isStatic = React.useContext(MotionConfigContext).isStatic; + React.useEffect(function () { + if (isStatic) return; + var provideTimeSinceStart = function (_a) { + var timestamp = _a.timestamp; + callback(timestamp - initialTimestamp); + }; + sync__default["default"].update(provideTimeSinceStart, true); + return function () { + return sync.cancelSync.update(provideTimeSinceStart); + }; + }, [callback]); } -function assertNonNullType(type) { - if (!isNonNullType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Non-Null type.`); - } - return type; +function useTime() { + var time = useMotionValue(0); + useAnimationFrame(function (t) { + return time.set(t); + }); + return time; } -/** - * These types may be used as input types for arguments and directives. - */ -function isInputType(type) { - return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType); -} -function assertInputType(type) { - if (!isInputType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL input type.`); - } - return type; -} /** - * These types may be used as output types as the result of fields. + * @public */ - -function isOutputType(type) { - return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType); -} -function assertOutputType(type) { - if (!isOutputType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL output type.`); - } - return type; +function animationControls() { + /** + * Track whether the host component has mounted. + */ + var hasMounted = false; + /** + * Pending animations that are started before a component is mounted. + * TODO: Remove this as animations should only run in effects + */ + var pendingAnimations = []; + /** + * A collection of linked component animation controls. + */ + var subscribers = new Set(); + var controls = { + subscribe: function (visualElement) { + subscribers.add(visualElement); + return function () { + return void subscribers.delete(visualElement); + }; + }, + start: function (definition, transitionOverride) { + /** + * TODO: We only perform this hasMounted check because in Framer we used to + * encourage the ability to start an animation within the render phase. This + * isn't behaviour concurrent-safe so when we make Framer concurrent-safe + * we can ditch this. + */ + if (hasMounted) { + var animations_1 = []; + subscribers.forEach(function (visualElement) { + animations_1.push(animateVisualElement(visualElement, definition, { + transitionOverride: transitionOverride + })); + }); + return Promise.all(animations_1); + } else { + return new Promise(function (resolve) { + pendingAnimations.push({ + animation: [definition, transitionOverride], + resolve: resolve + }); + }); + } + }, + set: function (definition) { + heyListen.invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); + return subscribers.forEach(function (visualElement) { + setValues(visualElement, definition); + }); + }, + stop: function () { + subscribers.forEach(function (visualElement) { + stopAnimation(visualElement); + }); + }, + mount: function () { + hasMounted = true; + pendingAnimations.forEach(function (_a) { + var animation = _a.animation, + resolve = _a.resolve; + controls.start.apply(controls, tslib.__spreadArray([], tslib.__read(animation), false)).then(resolve); + }); + return function () { + hasMounted = false; + controls.stop(); + }; + } + }; + return controls; } -/** - * These types may describe types which may be leaf values. - */ -function isLeafType(type) { - return isScalarType(type) || isEnumType(type); -} -function assertLeafType(type) { - if (!isLeafType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL leaf type.`); - } - return type; -} /** - * These types may describe the parent context of a selection set. + * Creates `AnimationControls`, which can be used to manually start, stop + * and sequence animations on one or more components. + * + * The returned `AnimationControls` should be passed to the `animate` property + * of the components you want to animate. + * + * These components can then be animated with the `start` method. + * + * ```jsx + * import * as React from 'react' + * import { motion, useAnimation } from 'framer-motion' + * + * export function MyComponent(props) { + * const controls = useAnimation() + * + * controls.start({ + * x: 100, + * transition: { duration: 0.5 }, + * }) + * + * return + * } + * ``` + * + * @returns Animation controller with `start` and `stop` methods + * + * @public */ - -function isCompositeType(type) { - return isObjectType(type) || isInterfaceType(type) || isUnionType(type); -} -function assertCompositeType(type) { - if (!isCompositeType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL composite type.`); - } - return type; +function useAnimationControls() { + var controls = useConstant(animationControls); + React.useEffect(controls.mount, []); + return controls; } -/** - * These types may describe the parent context of a selection set. - */ +var useAnimation = useAnimationControls; -function isAbstractType(type) { - return isInterfaceType(type) || isUnionType(type); -} -function assertAbstractType(type) { - if (!isAbstractType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL abstract type.`); - } - return type; -} /** - * List Type Wrapper + * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. * - * A list is a wrapping type which points to another type. - * Lists are often created within the context of defining the fields of - * an object type. + * An index value can be passed to the returned `cycle` function to cycle to a specific index. * - * Example: + * ```jsx + * import * as React from "react" + * import { motion, useCycle } from "framer-motion" * - * ```ts - * const PersonType = new GraphQLObjectType({ - * name: 'Person', - * fields: () => ({ - * parents: { type: new GraphQLList(PersonType) }, - * children: { type: new GraphQLList(PersonType) }, - * }) - * }) + * export const MyComponent = () => { + * const [x, cycleX] = useCycle(0, 50, 100) + * + * return ( + * cycleX()} + * /> + * ) + * } * ``` + * + * @param items - items to cycle through + * @returns [currentState, cycleState] + * + * @public */ - -class GraphQLList { - constructor(ofType) { - isType(ofType) || (0, _devAssert.devAssert)(false, `Expected ${(0, _inspect.inspect)(ofType)} to be a GraphQL type.`); - this.ofType = ofType; - } - get [Symbol.toStringTag]() { - return 'GraphQLList'; - } - toString() { - return '[' + String(this.ofType) + ']'; - } - toJSON() { - return this.toString(); +function useCycle() { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; } + var index = React.useRef(0); + var _a = tslib.__read(React.useState(items[index.current]), 2), + item = _a[0], + setItem = _a[1]; + var runCycle = React.useCallback(function (next) { + index.current = typeof next !== "number" ? popmotion.wrap(0, items.length, index.current + 1) : next; + setItem(items[index.current]); + }, tslib.__spreadArray([items.length], tslib.__read(items), false)); + return [item, runCycle]; +} +function useInView(ref, _a) { + var _b = _a === void 0 ? {} : _a, + root = _b.root, + margin = _b.margin, + amount = _b.amount, + _c = _b.once, + once = _c === void 0 ? false : _c; + var _d = tslib.__read(React.useState(false), 2), + isInView = _d[0], + setInView = _d[1]; + React.useEffect(function () { + var _a; + if (!ref.current || once && isInView) return; + var onEnter = function () { + setInView(true); + return once ? undefined : function () { + return setInView(false); + }; + }; + var options = { + root: (_a = root === null || root === void 0 ? void 0 : root.current) !== null && _a !== void 0 ? _a : undefined, + margin: margin, + amount: amount === "some" ? "any" : amount + }; + return dom.inView(ref.current, onEnter, options); + }, [root, ref, margin, once]); + return isInView; } + /** - * Non-Null Type Wrapper + * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. * - * A non-null is a wrapping type which points to another type. - * Non-null types enforce that their values are never null and can ensure - * an error is raised if this ever occurs during a request. It is useful for - * fields which you can make a strong guarantee on non-nullability, for example - * usually the id field of a database row will never be null. + * ```jsx + * const dragControls = useDragControls() * - * Example: + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } * - * ```ts - * const RowType = new GraphQLObjectType({ - * name: 'Row', - * fields: () => ({ - * id: { type: new GraphQLNonNull(GraphQLString) }, - * }) - * }) + * return ( + * <> + *
+ * + * + * ) * ``` - * Note: the enforcement of non-nullability occurs within the executor. - */ -exports.GraphQLList = GraphQLList; -class GraphQLNonNull { - constructor(ofType) { - isNullableType(ofType) || (0, _devAssert.devAssert)(false, `Expected ${(0, _inspect.inspect)(ofType)} to be a GraphQL nullable type.`); - this.ofType = ofType; - } - get [Symbol.toStringTag]() { - return 'GraphQLNonNull'; - } - toString() { - return String(this.ofType) + '!'; - } - toJSON() { - return this.toString(); - } -} -/** - * These types wrap and modify other types + * + * @public */ -exports.GraphQLNonNull = GraphQLNonNull; -function isWrappingType(type) { - return isListType(type) || isNonNullType(type); -} -function assertWrappingType(type) { - if (!isWrappingType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL wrapping type.`); +var DragControls = /** @class */function () { + function DragControls() { + this.componentControls = new Set(); } - return type; -} + /** + * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. + * + * @internal + */ + DragControls.prototype.subscribe = function (controls) { + var _this = this; + this.componentControls.add(controls); + return function () { + return _this.componentControls.delete(controls); + }; + }; + /** + * Start a drag gesture on every `motion` component that has this set of drag controls + * passed into it via the `dragControls` prop. + * + * ```jsx + * dragControls.start(e, { + * snapToCursor: true + * }) + * ``` + * + * @param event - PointerEvent + * @param options - Options + * + * @public + */ + DragControls.prototype.start = function (event, options) { + this.componentControls.forEach(function (controls) { + controls.start(event.nativeEvent || event, options); + }); + }; + return DragControls; +}(); +var createDragControls = function () { + return new DragControls(); +}; /** - * These types can all accept null as a value. + * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop + * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate that dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public */ - -function isNullableType(type) { - return isType(type) && !isNonNullType(type); +function useDragControls() { + return useConstant(createDragControls); } -function assertNullableType(type) { - if (!isNullableType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL nullable type.`); - } - return type; +function useInstantLayoutTransition() { + return startTransition; } -function getNullableType(type) { - if (type) { - return isNonNullType(type) ? type.ofType : type; - } +function startTransition(cb) { + if (!rootProjectionNode.current) return; + rootProjectionNode.current.isUpdating = false; + rootProjectionNode.current.blockUpdate(); + cb === null || cb === void 0 ? void 0 : cb(); } -/** - * These named types do not include modifiers like List or NonNull. - */ - -function isNamedType(type) { - return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type); +function useInstantTransition() { + var _a = tslib.__read(useForceUpdate(), 2), + forceUpdate = _a[0], + forcedRenderCount = _a[1]; + var startInstantLayoutTransition = useInstantLayoutTransition(); + React.useEffect(function () { + /** + * Unblock after two animation frames, otherwise this will unblock too soon. + */ + sync__default["default"].postRender(function () { + return sync__default["default"].postRender(function () { + return instantAnimationState.current = false; + }); + }); + }, [forcedRenderCount]); + return function (callback) { + startInstantLayoutTransition(function () { + instantAnimationState.current = true; + forceUpdate(); + callback(); + }); + }; } -function assertNamedType(type) { - if (!isNamedType(type)) { - throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL named type.`); - } - return type; +function useResetProjection() { + var reset = React__namespace.useCallback(function () { + var root = rootProjectionNode.current; + if (!root) return; + root.resetTree(); + }, []); + return reset; } -function getNamedType(type) { - if (type) { - let unwrappedType = type; - while (isWrappingType(unwrappedType)) { - unwrappedType = unwrappedType.ofType; - } - return unwrappedType; +var createObject = function () { + return {}; +}; +var stateVisualElement = visualElement({ + build: function () {}, + measureViewportBox: createBox, + resetTransform: function () {}, + restoreTransform: function () {}, + removeValueFromRenderState: function () {}, + render: function () {}, + scrapeMotionValuesFromProps: createObject, + readValueFromInstance: function (_state, key, options) { + return options.initialState[key] || 0; + }, + makeTargetAnimatable: function (element, _a) { + var transition = _a.transition, + transitionEnd = _a.transitionEnd, + target = tslib.__rest(_a, ["transition", "transitionEnd"]); + var origin = getOrigin(target, transition || {}, element); + checkTargetForNewValues(element, target, origin); + return tslib.__assign({ + transition: transition, + transitionEnd: transitionEnd + }, target); } -} -/** - * Used while defining GraphQL types to allow for circular references in - * otherwise immutable type definitions. - */ - -function resolveReadonlyArrayThunk(thunk) { - return typeof thunk === 'function' ? thunk() : thunk; -} -function resolveObjMapThunk(thunk) { - return typeof thunk === 'function' ? thunk() : thunk; -} -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ - +}); +var useVisualState = makeUseVisualState({ + scrapeMotionValuesFromProps: createObject, + createRenderState: createObject +}); /** - * Scalar Type Definition - * - * The leaf values of any request and input values to arguments are - * Scalars (or Enums) and are defined with a name and a series of functions - * used to parse input from ast or variables and to ensure validity. - * - * If a type's serialize function returns `null` or does not return a value - * (i.e. it returns `undefined`) then an error will be raised and a `null` - * value will be returned in the response. It is always better to validate - * - * Example: - * - * ```ts - * const OddType = new GraphQLScalarType({ - * name: 'Odd', - * serialize(value) { - * if (!Number.isFinite(value)) { - * throw new Error( - * `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`, - * ); - * } - * - * if (value % 2 === 0) { - * throw new Error(`Scalar "Odd" cannot represent "${value}" since it is even.`); - * } - * return value; - * } - * }); - * ``` + * This is not an officially supported API and may be removed + * on any version. */ -class GraphQLScalarType { - constructor(config) { - var _config$parseValue, _config$serialize, _config$parseLiteral, _config$extensionASTN; - const parseValue = (_config$parseValue = config.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.identityFunc; - this.name = (0, _assertName.assertName)(config.name); - this.description = config.description; - this.specifiedByURL = config.specifiedByURL; - this.serialize = (_config$serialize = config.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.identityFunc; - this.parseValue = parseValue; - this.parseLiteral = (_config$parseLiteral = config.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : (node, variables) => parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node, variables)); - this.extensions = (0, _toObjMap.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN = config.extensionASTNodes) !== null && _config$extensionASTN !== void 0 ? _config$extensionASTN : []; - config.specifiedByURL == null || typeof config.specifiedByURL === 'string' || (0, _devAssert.devAssert)(false, `${this.name} must provide "specifiedByURL" as a string, ` + `but got: ${(0, _inspect.inspect)(config.specifiedByURL)}.`); - config.serialize == null || typeof config.serialize === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`); - if (config.parseLiteral) { - typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide both "parseValue" and "parseLiteral" functions.`); - } - } - get [Symbol.toStringTag]() { - return 'GraphQLScalarType'; - } - toConfig() { - return { - name: this.name, - description: this.description, - specifiedByURL: this.specifiedByURL, - serialize: this.serialize, - parseValue: this.parseValue, - parseLiteral: this.parseLiteral, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes +function useAnimatedState(initialState) { + var _a = tslib.__read(React.useState(initialState), 2), + animationState = _a[0], + setAnimationState = _a[1]; + var visualState = useVisualState({}, false); + var element = useConstant(function () { + return stateVisualElement({ + props: {}, + visualState: visualState + }, { + initialState: initialState + }); + }); + React.useEffect(function () { + element.mount({}); + return element.unmount; + }, [element]); + React.useEffect(function () { + element.setProps({ + onUpdate: function (v) { + setAnimationState(tslib.__assign({}, v)); + } + }); + }, [setAnimationState, element]); + var startAnimation = useConstant(function () { + return function (animationDefinition) { + return animateVisualElement(element, animationDefinition); }; - } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } + }); + return [animationState, startAnimation]; } +// Keep things reasonable and avoid scale: Infinity. In practise we might need +// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] +// to simply hide content at unreasonable scales. +var maxScale = 100000; +var invertScale = function (scale) { + return scale > 0.001 ? 1 / scale : maxScale; +}; +var hasWarned = false; /** - * Object Type Definition + * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse + * of their respective parent scales. * - * Almost all of the GraphQL types you define will be object types. Object types - * have a name, but most importantly describe their fields. + * This is useful for undoing the distortion of content when scaling a parent component. * - * Example: + * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. + * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output + * of those instead. * - * ```ts - * const AddressType = new GraphQLObjectType({ - * name: 'Address', - * fields: { - * street: { type: GraphQLString }, - * number: { type: GraphQLInt }, - * formatted: { - * type: GraphQLString, - * resolve(obj) { - * return obj.number + ' ' + obj.street - * } - * } - * } - * }); + * ```jsx + * const MyComponent = () => { + * const { scaleX, scaleY } = useInvertedScale() + * return + * } * ``` * - * When two types need to refer to each other, or a type needs to refer to - * itself in a field, you can use a function expression (aka a closure or a - * thunk) to supply the fields lazily. - * - * Example: - * - * ```ts - * const PersonType = new GraphQLObjectType({ - * name: 'Person', - * fields: () => ({ - * name: { type: GraphQLString }, - * bestFriend: { type: PersonType }, - * }) - * }); - * ``` + * @deprecated */ -exports.GraphQLScalarType = GraphQLScalarType; -class GraphQLObjectType { - constructor(config) { - var _config$extensionASTN2; - this.name = (0, _assertName.assertName)(config.name); - this.description = config.description; - this.isTypeOf = config.isTypeOf; - this.extensions = (0, _toObjMap.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN2 = config.extensionASTNodes) !== null && _config$extensionASTN2 !== void 0 ? _config$extensionASTN2 : []; - this._fields = () => defineFieldMap(config); - this._interfaces = () => defineInterfaces(config); - config.isTypeOf == null || typeof config.isTypeOf === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide "isTypeOf" as a function, ` + `but got: ${(0, _inspect.inspect)(config.isTypeOf)}.`); - } - get [Symbol.toStringTag]() { - return 'GraphQLObjectType'; - } - getFields() { - if (typeof this._fields === 'function') { - this._fields = this._fields(); - } - return this._fields; - } - getInterfaces() { - if (typeof this._interfaces === 'function') { - this._interfaces = this._interfaces(); - } - return this._interfaces; +function useInvertedScale(scale) { + var parentScaleX = useMotionValue(1); + var parentScaleY = useMotionValue(1); + var visualElement = useVisualElementContext(); + heyListen.invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); + heyListen.warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); + hasWarned = true; + if (scale) { + parentScaleX = scale.scaleX || parentScaleX; + parentScaleY = scale.scaleY || parentScaleY; + } else if (visualElement) { + parentScaleX = visualElement.getValue("scaleX", 1); + parentScaleY = visualElement.getValue("scaleY", 1); } - toConfig() { - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - isTypeOf: this.isTypeOf, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes - }; + var scaleX = useTransform(parentScaleX, invertScale); + var scaleY = useTransform(parentScaleY, invertScale); + return { + scaleX: scaleX, + scaleY: scaleY + }; +} +exports.AnimatePresence = AnimatePresence; +exports.AnimateSharedLayout = AnimateSharedLayout; +exports.DeprecatedLayoutGroupContext = DeprecatedLayoutGroupContext; +exports.DragControls = DragControls; +exports.FlatTree = FlatTree; +exports.LayoutGroup = LayoutGroup; +exports.LayoutGroupContext = LayoutGroupContext; +exports.LazyMotion = LazyMotion; +exports.MotionConfig = MotionConfig; +exports.MotionConfigContext = MotionConfigContext; +exports.MotionContext = MotionContext; +exports.MotionValue = MotionValue; +exports.PresenceContext = PresenceContext; +exports.Reorder = Reorder; +exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext; +exports.addPointerEvent = addPointerEvent; +exports.addScaleCorrector = addScaleCorrector; +exports.animate = animate; +exports.animateVisualElement = animateVisualElement; +exports.animationControls = animationControls; +exports.animations = animations; +exports.calcLength = calcLength; +exports.checkTargetForNewValues = checkTargetForNewValues; +exports.createBox = createBox; +exports.createDomMotionComponent = createDomMotionComponent; +exports.createMotionComponent = createMotionComponent; +exports.domAnimation = domAnimation; +exports.domMax = domMax; +exports.filterProps = filterProps; +exports.isBrowser = isBrowser; +exports.isDragActive = isDragActive; +exports.isMotionValue = isMotionValue; +exports.isValidMotionProp = isValidMotionProp; +exports.m = m; +exports.makeUseVisualState = makeUseVisualState; +exports.motion = motion; +exports.motionValue = motionValue; +exports.resolveMotionValue = resolveMotionValue; +exports.transform = transform; +exports.useAnimation = useAnimation; +exports.useAnimationControls = useAnimationControls; +exports.useAnimationFrame = useAnimationFrame; +exports.useCycle = useCycle; +exports.useDeprecatedAnimatedState = useAnimatedState; +exports.useDeprecatedInvertedScale = useInvertedScale; +exports.useDomEvent = useDomEvent; +exports.useDragControls = useDragControls; +exports.useElementScroll = useElementScroll; +exports.useForceUpdate = useForceUpdate; +exports.useInView = useInView; +exports.useInstantLayoutTransition = useInstantLayoutTransition; +exports.useInstantTransition = useInstantTransition; +exports.useIsPresent = useIsPresent; +exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect; +exports.useMotionTemplate = useMotionTemplate; +exports.useMotionValue = useMotionValue; +exports.usePresence = usePresence; +exports.useReducedMotion = useReducedMotion; +exports.useReducedMotionConfig = useReducedMotionConfig; +exports.useResetProjection = useResetProjection; +exports.useScroll = useScroll; +exports.useSpring = useSpring; +exports.useTime = useTime; +exports.useTransform = useTransform; +exports.useUnmountEffect = useUnmountEffect; +exports.useVelocity = useVelocity; +exports.useViewportScroll = useViewportScroll; +exports.useVisualElementContext = useVisualElementContext; +exports.visualElement = visualElement; +exports.wrapHandler = wrapHandler; + +/***/ }), + +/***/ "../../../node_modules/framesync/dist/framesync.cjs.js": +/*!*************************************************************!*\ + !*** ../../../node_modules/framesync/dist/framesync.cjs.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +const defaultTimestep = 1 / 60 * 1000; +const getCurrentTime = typeof performance !== "undefined" ? () => performance.now() : () => Date.now(); +const onNextFrame = typeof window !== "undefined" ? callback => window.requestAnimationFrame(callback) : callback => setTimeout(() => callback(getCurrentTime()), defaultTimestep); +function createRenderStep(runNextFrame) { + let toRun = []; + let toRunNextFrame = []; + let numToRun = 0; + let isProcessing = false; + let flushNextFrame = false; + const toKeepAlive = new WeakSet(); + const step = { + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const buffer = addToCurrentFrame ? toRun : toRunNextFrame; + if (keepAlive) toKeepAlive.add(callback); + if (buffer.indexOf(callback) === -1) { + buffer.push(callback); + if (addToCurrentFrame && isProcessing) numToRun = toRun.length; + } + return callback; + }, + cancel: callback => { + const index = toRunNextFrame.indexOf(callback); + if (index !== -1) toRunNextFrame.splice(index, 1); + toKeepAlive.delete(callback); + }, + process: frameData => { + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + [toRun, toRunNextFrame] = [toRunNextFrame, toRun]; + toRunNextFrame.length = 0; + numToRun = toRun.length; + if (numToRun) { + for (let i = 0; i < numToRun; i++) { + const callback = toRun[i]; + callback(frameData); + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + } + } + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + } + }; + return step; +} +const maxElapsed = 40; +let useDefaultElapsed = true; +let runNextFrame = false; +let isProcessing = false; +const frame = { + delta: 0, + timestamp: 0 +}; +const stepsOrder = ["read", "update", "preRender", "render", "postRender"]; +const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(() => runNextFrame = true); + return acc; +}, {}); +const sync = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) startLoop(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; +}, {}); +const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = steps[key].cancel; + return acc; +}, {}); +const flushSync = stepsOrder.reduce((acc, key) => { + acc[key] = () => steps[key].process(frame); + return acc; +}, {}); +const processStep = stepId => steps[stepId].process(frame); +const processFrame = timestamp => { + runNextFrame = false; + frame.delta = useDefaultElapsed ? defaultTimestep : Math.max(Math.min(timestamp - frame.timestamp, maxElapsed), 1); + frame.timestamp = timestamp; + isProcessing = true; + stepsOrder.forEach(processStep); + isProcessing = false; + if (runNextFrame) { + useDefaultElapsed = false; + onNextFrame(processFrame); } - toString() { - return this.name; +}; +const startLoop = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!isProcessing) onNextFrame(processFrame); +}; +const getFrameData = () => frame; +exports.cancelSync = cancelSync; +exports["default"] = sync; +exports.flushSync = flushSync; +exports.getFrameData = getFrameData; + +/***/ }), + +/***/ "../../../node_modules/get-nonce/dist/es2015/index.js": +/*!************************************************************!*\ + !*** ../../../node_modules/get-nonce/dist/es2015/index.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.setNonce = exports.getNonce = void 0; +var currentNonce; +var setNonce = function (nonce) { + currentNonce = nonce; +}; +exports.setNonce = setNonce; +var getNonce = function () { + if (currentNonce) { + return currentNonce; } - toJSON() { - return this.toString(); + if (true) { + return __webpack_require__.nc; } -} -exports.GraphQLObjectType = GraphQLObjectType; -function defineInterfaces(config) { - var _config$interfaces; - const interfaces = resolveReadonlyArrayThunk((_config$interfaces = config.interfaces) !== null && _config$interfaces !== void 0 ? _config$interfaces : []); - Array.isArray(interfaces) || (0, _devAssert.devAssert)(false, `${config.name} interfaces must be an Array or a function which returns an Array.`); - return interfaces; -} -function defineFieldMap(config) { - const fieldMap = resolveObjMapThunk(config.fields); - isPlainObj(fieldMap) || (0, _devAssert.devAssert)(false, `${config.name} fields must be an object with field names as keys or a function which returns such an object.`); - return (0, _mapValue.mapValue)(fieldMap, (fieldConfig, fieldName) => { - var _fieldConfig$args; - isPlainObj(fieldConfig) || (0, _devAssert.devAssert)(false, `${config.name}.${fieldName} field config must be an object.`); - fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function' || (0, _devAssert.devAssert)(false, `${config.name}.${fieldName} field resolver must be a function if ` + `provided, but got: ${(0, _inspect.inspect)(fieldConfig.resolve)}.`); - const argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {}; - isPlainObj(argsConfig) || (0, _devAssert.devAssert)(false, `${config.name}.${fieldName} args must be an object with argument names as keys.`); - return { - name: (0, _assertName.assertName)(fieldName), - description: fieldConfig.description, - type: fieldConfig.type, - args: defineArguments(argsConfig), - resolve: fieldConfig.resolve, - subscribe: fieldConfig.subscribe, - deprecationReason: fieldConfig.deprecationReason, - extensions: (0, _toObjMap.toObjMap)(fieldConfig.extensions), - astNode: fieldConfig.astNode - }; - }); -} -function defineArguments(config) { - return Object.entries(config).map(([argName, argConfig]) => ({ - name: (0, _assertName.assertName)(argName), - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: (0, _toObjMap.toObjMap)(argConfig.extensions), - astNode: argConfig.astNode - })); -} -function isPlainObj(obj) { - return (0, _isObjectLike.isObjectLike)(obj) && !Array.isArray(obj); -} -function fieldsToFieldsConfig(fields) { - return (0, _mapValue.mapValue)(fields, field => ({ - description: field.description, - type: field.type, - args: argsToArgsConfig(field.args), - resolve: field.resolve, - subscribe: field.subscribe, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode - })); -} -/** - * @internal - */ + return undefined; +}; +exports.getNonce = getNonce; -function argsToArgsConfig(args) { - return (0, _keyValMap.keyValMap)(args, arg => arg.name, arg => ({ - description: arg.description, - type: arg.type, - defaultValue: arg.defaultValue, - deprecationReason: arg.deprecationReason, - extensions: arg.extensions, - astNode: arg.astNode - })); -} -function isRequiredArgument(arg) { - return isNonNullType(arg.type) && arg.defaultValue === undefined; -} +/***/ }), -/** - * Interface Type Definition - * - * When a field can return one of a heterogeneous set of types, a Interface type - * is used to describe what types are possible, what fields are in common across - * all types, as well as a function to determine which type is actually used - * when the field is resolved. - * - * Example: +/***/ "../../../node_modules/get-value/index.js": +/*!************************************************!*\ + !*** ../../../node_modules/get-value/index.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +/*! + * get-value * - * ```ts - * const EntityType = new GraphQLInterfaceType({ - * name: 'Entity', - * fields: { - * name: { type: GraphQLString } - * } - * }); - * ``` + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. */ -class GraphQLInterfaceType { - constructor(config) { - var _config$extensionASTN3; - this.name = (0, _assertName.assertName)(config.name); - this.description = config.description; - this.resolveType = config.resolveType; - this.extensions = (0, _toObjMap.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN3 = config.extensionASTNodes) !== null && _config$extensionASTN3 !== void 0 ? _config$extensionASTN3 : []; - this._fields = defineFieldMap.bind(undefined, config); - this._interfaces = defineInterfaces.bind(undefined, config); - config.resolveType == null || typeof config.resolveType === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide "resolveType" as a function, ` + `but got: ${(0, _inspect.inspect)(config.resolveType)}.`); + +const isObject = __webpack_require__(/*! isobject */ "../../../node_modules/isobject/index.js"); +module.exports = function (target, path, options) { + if (!isObject(options)) { + options = { + default: options + }; } - get [Symbol.toStringTag]() { - return 'GraphQLInterfaceType'; + if (!isValidObject(target)) { + return typeof options.default !== 'undefined' ? options.default : target; } - getFields() { - if (typeof this._fields === 'function') { - this._fields = this._fields(); - } - return this._fields; + if (typeof path === 'number') { + path = String(path); } - getInterfaces() { - if (typeof this._interfaces === 'function') { - this._interfaces = this._interfaces(); + const isArray = Array.isArray(path); + const isString = typeof path === 'string'; + const splitChar = options.separator || '.'; + const joinChar = options.joinChar || (typeof splitChar === 'string' ? splitChar : '.'); + if (!isString && !isArray) { + return target; + } + if (isString && path in target) { + return isValid(path, target, options) ? target[path] : options.default; + } + let segs = isArray ? path : split(path, splitChar, options); + let len = segs.length; + let idx = 0; + do { + let prop = segs[idx]; + if (typeof prop === 'number') { + prop = String(prop); } - return this._interfaces; + while (prop && prop.slice(-1) === '\\') { + prop = join([prop.slice(0, -1), segs[++idx] || ''], joinChar, options); + } + if (prop in target) { + if (!isValid(prop, target, options)) { + return options.default; + } + target = target[prop]; + } else { + let hasProp = false; + let n = idx + 1; + while (n < len) { + prop = join([prop, segs[n++]], joinChar, options); + if (hasProp = prop in target) { + if (!isValid(prop, target, options)) { + return options.default; + } + target = target[prop]; + idx = n - 1; + break; + } + } + if (!hasProp) { + return options.default; + } + } + } while (++idx < len && isValidObject(target)); + if (idx === len) { + return target; } - toConfig() { - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes - }; + return options.default; +}; +function join(segs, joinChar, options) { + if (typeof options.join === 'function') { + return options.join(segs); } - toString() { - return this.name; + return segs[0] + joinChar + segs[1]; +} +function split(path, splitChar, options) { + if (typeof options.split === 'function') { + return options.split(path); } - toJSON() { - return this.toString(); + return path.split(splitChar); +} +function isValid(key, target, options) { + if (typeof options.isValid === 'function') { + return options.isValid(key, target); } + return true; +} +function isValidObject(val) { + return isObject(val) || Array.isArray(val) || typeof val === 'function'; } +/***/ }), + +/***/ "../../../node_modules/graphql-ws/lib/client.mjs": +/*!*******************************************************!*\ + !*** ../../../node_modules/graphql-ws/lib/client.mjs ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = { + createClient: true +}; +exports.createClient = createClient; +var _common = __webpack_require__(/*! ./common.mjs */ "../../../node_modules/graphql-ws/lib/common.mjs"); +Object.keys(_common).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _common[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _common[key]; + } + }); +}); +var _utils = __webpack_require__(/*! ./utils.mjs */ "../../../node_modules/graphql-ws/lib/utils.mjs"); /** - * Union Type Definition - * - * When a field can return one of a heterogeneous set of types, a Union type - * is used to describe what types are possible as well as providing a function - * to determine which type is actually used when the field is resolved. * - * Example: + * client * - * ```ts - * const PetType = new GraphQLUnionType({ - * name: 'Pet', - * types: [ DogType, CatType ], - * resolveType(value) { - * if (value instanceof Dog) { - * return DogType; - * } - * if (value instanceof Cat) { - * return CatType; - * } - * } - * }); - * ``` */ -exports.GraphQLInterfaceType = GraphQLInterfaceType; -class GraphQLUnionType { - constructor(config) { - var _config$extensionASTN4; - this.name = (0, _assertName.assertName)(config.name); - this.description = config.description; - this.resolveType = config.resolveType; - this.extensions = (0, _toObjMap.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN4 = config.extensionASTNodes) !== null && _config$extensionASTN4 !== void 0 ? _config$extensionASTN4 : []; - this._types = defineTypes.bind(undefined, config); - config.resolveType == null || typeof config.resolveType === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide "resolveType" as a function, ` + `but got: ${(0, _inspect.inspect)(config.resolveType)}.`); - } - get [Symbol.toStringTag]() { - return 'GraphQLUnionType'; +var __await = void 0 && (void 0).__await || function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +}; +var __asyncGenerator = void 0 && (void 0).__asyncGenerator || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), + i, + q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function (v) { + return new Promise(function (a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - getTypes() { - if (typeof this._types === 'function') { - this._types = this._types(); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - return this._types; } - toConfig() { - return { - name: this.name, - description: this.description, - types: this.getTypes(), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes - }; + function step(r) { + r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - toString() { - return this.name; + function fulfill(value) { + resume("next", value); } - toJSON() { - return this.toString(); + function reject(value) { + resume("throw", value); } -} -exports.GraphQLUnionType = GraphQLUnionType; -function defineTypes(config) { - const types = resolveReadonlyArrayThunk(config.types); - Array.isArray(types) || (0, _devAssert.devAssert)(false, `Must provide Array of types or a function which returns such an array for Union ${config.name}.`); - return types; -} + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + } +}; + +/** This file is the entry point for browsers, re-export common elements. */ /** - * Enum Type Definition - * - * Some leaf values of requests and input values are Enums. GraphQL serializes - * Enum values as strings, however internally Enums can be represented by any - * kind of type, often integers. - * - * Example: - * - * ```ts - * const RGBType = new GraphQLEnumType({ - * name: 'RGB', - * values: { - * RED: { value: 0 }, - * GREEN: { value: 1 }, - * BLUE: { value: 2 } - * } - * }); - * ``` + * Creates a disposable GraphQL over WebSocket client. * - * Note: If a value is not provided in a definition, the name of the enum value - * will be used as its internal value. + * @category Client */ -class GraphQLEnumType { - /* */ - constructor(config) { - var _config$extensionASTN5; - this.name = (0, _assertName.assertName)(config.name); - this.description = config.description; - this.extensions = (0, _toObjMap.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN5 = config.extensionASTNodes) !== null && _config$extensionASTN5 !== void 0 ? _config$extensionASTN5 : []; - this._values = typeof config.values === 'function' ? config.values : defineEnumValues(this.name, config.values); - this._valueLookup = null; - this._nameLookup = null; - } - get [Symbol.toStringTag]() { - return 'GraphQLEnumType'; - } - getValues() { - if (typeof this._values === 'function') { - this._values = defineEnumValues(this.name, this._values()); - } - return this._values; - } - getValue(name) { - if (this._nameLookup === null) { - this._nameLookup = (0, _keyMap.keyMap)(this.getValues(), value => value.name); - } - return this._nameLookup[name]; - } - serialize(outputValue) { - if (this._valueLookup === null) { - this._valueLookup = new Map(this.getValues().map(enumValue => [enumValue.value, enumValue])); - } - const enumValue = this._valueLookup.get(outputValue); - if (enumValue === undefined) { - throw new _GraphQLError.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0, _inspect.inspect)(outputValue)}`); - } - return enumValue.name; - } - parseValue(inputValue) /* T */ - { - if (typeof inputValue !== 'string') { - const valueStr = (0, _inspect.inspect)(inputValue); - throw new _GraphQLError.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${valueStr}.` + didYouMeanEnumValue(this, valueStr)); - } - const enumValue = this.getValue(inputValue); - if (enumValue == null) { - throw new _GraphQLError.GraphQLError(`Value "${inputValue}" does not exist in "${this.name}" enum.` + didYouMeanEnumValue(this, inputValue)); - } - return enumValue.value; - } - parseLiteral(valueNode, _variables) /* T */ - { - // Note: variables will be resolved to a value before calling this function. - if (valueNode.kind !== _kinds.Kind.ENUM) { - const valueStr = (0, _printer.print)(valueNode); - throw new _GraphQLError.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${valueStr}.` + didYouMeanEnumValue(this, valueStr), { - nodes: valueNode - }); - } - const enumValue = this.getValue(valueNode.value); - if (enumValue == null) { - const valueStr = (0, _printer.print)(valueNode); - throw new _GraphQLError.GraphQLError(`Value "${valueStr}" does not exist in "${this.name}" enum.` + didYouMeanEnumValue(this, valueStr), { - nodes: valueNode +function createClient(options) { + const { + url, + connectionParams, + lazy = true, + onNonLazyError = console.error, + lazyCloseTimeout: lazyCloseTimeoutMs = 0, + keepAlive = 0, + disablePong, + connectionAckWaitTimeout = 0, + retryAttempts = 5, + retryWait = async function randomisedExponentialBackoff(retries) { + let retryDelay = 1000; // start with 1s delay + for (let i = 0; i < retries; i++) { + retryDelay *= 2; + } + await new Promise(resolve => setTimeout(resolve, retryDelay + + // add random timeout from 300ms to 3s + Math.floor(Math.random() * (3000 - 300) + 300))); + }, + shouldRetry = isLikeCloseEvent, + isFatalConnectionProblem, + on, + webSocketImpl, + /** + * Generates a v4 UUID to be used as the ID using `Math` + * as the random number generator. Supply your own generator + * in case you need more uniqueness. + * + * Reference: https://gist.github.com/jed/982883 + */ + generateID = function generateUUID() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { + const r = Math.random() * 16 | 0, + v = c == 'x' ? r : r & 0x3 | 0x8; + return v.toString(16); }); + }, + jsonMessageReplacer: replacer, + jsonMessageReviver: reviver + } = options; + let ws; + if (webSocketImpl) { + if (!isWebSocket(webSocketImpl)) { + throw new Error('Invalid WebSocket implementation provided'); } - return enumValue.value; + ws = webSocketImpl; + } else if (typeof WebSocket !== 'undefined') { + ws = WebSocket; + } else if (typeof __webpack_require__.g !== 'undefined') { + ws = __webpack_require__.g.WebSocket || + // @ts-expect-error: Support more browsers + __webpack_require__.g.MozWebSocket; + } else if (typeof window !== 'undefined') { + ws = window.WebSocket || + // @ts-expect-error: Support more browsers + window.MozWebSocket; } - toConfig() { - const values = (0, _keyValMap.keyValMap)(this.getValues(), value => value.name, value => ({ - description: value.description, - value: value.value, - deprecationReason: value.deprecationReason, - extensions: value.extensions, - astNode: value.astNode - })); - return { - name: this.name, - description: this.description, - values, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes + if (!ws) throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`"); + const WebSocketImpl = ws; + // websocket status emitter, subscriptions are handled differently + const emitter = (() => { + const message = (() => { + const listeners = {}; + return { + on(id, listener) { + listeners[id] = listener; + return () => { + delete listeners[id]; + }; + }, + emit(message) { + var _a; + if ('id' in message) (_a = listeners[message.id]) === null || _a === void 0 ? void 0 : _a.call(listeners, message); + } + }; + })(); + const listeners = { + connecting: (on === null || on === void 0 ? void 0 : on.connecting) ? [on.connecting] : [], + opened: (on === null || on === void 0 ? void 0 : on.opened) ? [on.opened] : [], + connected: (on === null || on === void 0 ? void 0 : on.connected) ? [on.connected] : [], + ping: (on === null || on === void 0 ? void 0 : on.ping) ? [on.ping] : [], + pong: (on === null || on === void 0 ? void 0 : on.pong) ? [on.pong] : [], + message: (on === null || on === void 0 ? void 0 : on.message) ? [message.emit, on.message] : [message.emit], + closed: (on === null || on === void 0 ? void 0 : on.closed) ? [on.closed] : [], + error: (on === null || on === void 0 ? void 0 : on.error) ? [on.error] : [] }; - } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } -} -exports.GraphQLEnumType = GraphQLEnumType; -function didYouMeanEnumValue(enumType, unknownValueStr) { - const allNames = enumType.getValues().map(value => value.name); - const suggestedValues = (0, _suggestionList.suggestionList)(unknownValueStr, allNames); - return (0, _didYouMean.didYouMean)('the enum value', suggestedValues); -} -function defineEnumValues(typeName, valueMap) { - isPlainObj(valueMap) || (0, _devAssert.devAssert)(false, `${typeName} values must be an object with value names as keys.`); - return Object.entries(valueMap).map(([valueName, valueConfig]) => { - isPlainObj(valueConfig) || (0, _devAssert.devAssert)(false, `${typeName}.${valueName} must refer to an object with a "value" key ` + `representing an internal value but got: ${(0, _inspect.inspect)(valueConfig)}.`); return { - name: (0, _assertName.assertEnumValueName)(valueName), - description: valueConfig.description, - value: valueConfig.value !== undefined ? valueConfig.value : valueName, - deprecationReason: valueConfig.deprecationReason, - extensions: (0, _toObjMap.toObjMap)(valueConfig.extensions), - astNode: valueConfig.astNode + onMessage: message.on, + on(event, listener) { + const l = listeners[event]; + l.push(listener); + return () => { + l.splice(l.indexOf(listener), 1); + }; + }, + emit(event, ...args) { + // we copy the listeners so that unlistens dont "pull the rug under our feet" + for (const listener of [...listeners[event]]) { + // @ts-expect-error: The args should fit + listener(...args); + } + } }; - }); -} - -/** - * Input Object Type Definition - * - * An input object defines a structured collection of fields which may be - * supplied to a field argument. - * - * Using `NonNull` will ensure that a value must be provided by the query - * - * Example: - * - * ```ts - * const GeoPoint = new GraphQLInputObjectType({ - * name: 'GeoPoint', - * fields: { - * lat: { type: new GraphQLNonNull(GraphQLFloat) }, - * lon: { type: new GraphQLNonNull(GraphQLFloat) }, - * alt: { type: GraphQLFloat, defaultValue: 0 }, - * } - * }); - * ``` - */ -class GraphQLInputObjectType { - constructor(config) { - var _config$extensionASTN6, _config$isOneOf; - this.name = (0, _assertName.assertName)(config.name); - this.description = config.description; - this.extensions = (0, _toObjMap.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN6 = config.extensionASTNodes) !== null && _config$extensionASTN6 !== void 0 ? _config$extensionASTN6 : []; - this.isOneOf = (_config$isOneOf = config.isOneOf) !== null && _config$isOneOf !== void 0 ? _config$isOneOf : false; - this._fields = defineInputFieldMap.bind(undefined, config); - } - get [Symbol.toStringTag]() { - return 'GraphQLInputObjectType'; - } - getFields() { - if (typeof this._fields === 'function') { - this._fields = this._fields(); - } - return this._fields; + })(); + // invokes the callback either when an error or closed event is emitted, + // first one that gets called prevails, other emissions are ignored + function errorOrClosed(cb) { + const listening = [ + // errors are fatal and more critical than close events, throw them first + emitter.on('error', err => { + listening.forEach(unlisten => unlisten()); + cb(err); + }), + // closes can be graceful and not fatal, throw them second (if error didnt throw) + emitter.on('closed', event => { + listening.forEach(unlisten => unlisten()); + cb(event); + })]; } - toConfig() { - const fields = (0, _mapValue.mapValue)(this.getFields(), field => ({ - description: field.description, - type: field.type, - defaultValue: field.defaultValue, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode - })); - return { - name: this.name, - description: this.description, - fields, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes, - isOneOf: this.isOneOf + let connecting, + locks = 0, + lazyCloseTimeout, + retrying = false, + retries = 0, + disposed = false; + async function connect() { + // clear the lazy close timeout immediatelly so that close gets debounced + // see: https://github.com/enisdenjo/graphql-ws/issues/388 + clearTimeout(lazyCloseTimeout); + const [socket, throwOnClose] = await (connecting !== null && connecting !== void 0 ? connecting : connecting = new Promise((connected, denied) => (async () => { + if (retrying) { + await retryWait(retries); + // subscriptions might complete while waiting for retry + if (!locks) { + connecting = undefined; + return denied({ + code: 1000, + reason: 'All Subscriptions Gone' + }); + } + retries++; + } + emitter.emit('connecting'); + const socket = new WebSocketImpl(typeof url === 'function' ? await url() : url, _common.GRAPHQL_TRANSPORT_WS_PROTOCOL); + let connectionAckTimeout, queuedPing; + function enqueuePing() { + if (isFinite(keepAlive) && keepAlive > 0) { + clearTimeout(queuedPing); // in case where a pong was received before a ping (this is valid behaviour) + queuedPing = setTimeout(() => { + if (socket.readyState === WebSocketImpl.OPEN) { + socket.send((0, _common.stringifyMessage)({ + type: _common.MessageType.Ping + })); + emitter.emit('ping', false, undefined); + } + }, keepAlive); + } + } + errorOrClosed(errOrEvent => { + connecting = undefined; + clearTimeout(connectionAckTimeout); + clearTimeout(queuedPing); + denied(errOrEvent); + if (isLikeCloseEvent(errOrEvent) && errOrEvent.code === 4499) { + socket.close(4499, 'Terminated'); // close event is artificial and emitted manually, see `Client.terminate()` below + socket.onerror = null; + socket.onclose = null; + } + }); + socket.onerror = err => emitter.emit('error', err); + socket.onclose = event => emitter.emit('closed', event); + socket.onopen = async () => { + try { + emitter.emit('opened', socket); + const payload = typeof connectionParams === 'function' ? await connectionParams() : connectionParams; + // connectionParams might take too long causing the server to kick off the client + // the necessary error/close event is already reported - simply stop execution + if (socket.readyState !== WebSocketImpl.OPEN) return; + socket.send((0, _common.stringifyMessage)(payload ? { + type: _common.MessageType.ConnectionInit, + payload + } : { + type: _common.MessageType.ConnectionInit + // payload is completely absent if not provided + }, replacer)); + if (isFinite(connectionAckWaitTimeout) && connectionAckWaitTimeout > 0) { + connectionAckTimeout = setTimeout(() => { + socket.close(_common.CloseCode.ConnectionAcknowledgementTimeout, 'Connection acknowledgement timeout'); + }, connectionAckWaitTimeout); + } + enqueuePing(); // enqueue ping (noop if disabled) + } catch (err) { + emitter.emit('error', err); + socket.close(_common.CloseCode.InternalClientError, (0, _utils.limitCloseReason)(err instanceof Error ? err.message : new Error(err).message, 'Internal client error')); + } + }; + let acknowledged = false; + socket.onmessage = ({ + data + }) => { + try { + const message = (0, _common.parseMessage)(data, reviver); + emitter.emit('message', message); + if (message.type === 'ping' || message.type === 'pong') { + emitter.emit(message.type, true, message.payload); // received + if (message.type === 'pong') { + enqueuePing(); // enqueue next ping (noop if disabled) + } else if (!disablePong) { + // respond with pong on ping + socket.send((0, _common.stringifyMessage)(message.payload ? { + type: _common.MessageType.Pong, + payload: message.payload + } : { + type: _common.MessageType.Pong + // payload is completely absent if not provided + })); + emitter.emit('pong', false, message.payload); + } + return; // ping and pongs can be received whenever + } + if (acknowledged) return; // already connected and acknowledged + if (message.type !== _common.MessageType.ConnectionAck) throw new Error(`First message cannot be of type ${message.type}`); + clearTimeout(connectionAckTimeout); + acknowledged = true; + emitter.emit('connected', socket, message.payload); // connected = socket opened + acknowledged + retrying = false; // future lazy connects are not retries + retries = 0; // reset the retries on connect + connected([socket, new Promise((_, reject) => errorOrClosed(reject))]); + } catch (err) { + socket.onmessage = null; // stop reading messages as soon as reading breaks once + emitter.emit('error', err); + socket.close(_common.CloseCode.BadResponse, (0, _utils.limitCloseReason)(err instanceof Error ? err.message : new Error(err).message, 'Bad response')); + } + }; + })())); + // if the provided socket is in a closing state, wait for the throw on close + if (socket.readyState === WebSocketImpl.CLOSING) await throwOnClose; + let release = () => { + // releases this connection }; + const released = new Promise(resolve => release = resolve); + return [socket, release, Promise.race([ + // wait for + released.then(() => { + if (!locks) { + // and if no more locks are present, complete the connection + const complete = () => socket.close(1000, 'Normal Closure'); + if (isFinite(lazyCloseTimeoutMs) && lazyCloseTimeoutMs > 0) { + // if the keepalive is set, allow for the specified calmdown time and + // then complete if the socket is still open. + lazyCloseTimeout = setTimeout(() => { + if (socket.readyState === WebSocketImpl.OPEN) complete(); + }, lazyCloseTimeoutMs); + } else { + // otherwise complete immediately + complete(); + } + } + }), + // or + throwOnClose])]; } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } + /** + * Checks the `connect` problem and evaluates if the client should retry. + */ + function shouldRetryConnectOrThrow(errOrCloseEvent) { + // some close codes are worth reporting immediately + if (isLikeCloseEvent(errOrCloseEvent) && (isFatalInternalCloseCode(errOrCloseEvent.code) || [_common.CloseCode.InternalServerError, _common.CloseCode.InternalClientError, _common.CloseCode.BadRequest, _common.CloseCode.BadResponse, _common.CloseCode.Unauthorized, + // CloseCode.Forbidden, might grant access out after retry + _common.CloseCode.SubprotocolNotAcceptable, + // CloseCode.ConnectionInitialisationTimeout, might not time out after retry + // CloseCode.ConnectionAcknowledgementTimeout, might not time out after retry + _common.CloseCode.SubscriberAlreadyExists, _common.CloseCode.TooManyInitialisationRequests + // 4499, // Terminated, probably because the socket froze, we want to retry + ].includes(errOrCloseEvent.code))) throw errOrCloseEvent; + // client was disposed, no retries should proceed regardless + if (disposed) return false; + // normal closure (possibly all subscriptions have completed) + // if no locks were acquired in the meantime, shouldnt try again + if (isLikeCloseEvent(errOrCloseEvent) && errOrCloseEvent.code === 1000) return locks > 0; + // retries are not allowed or we tried to many times, report error + if (!retryAttempts || retries >= retryAttempts) throw errOrCloseEvent; + // throw non-retryable connection problems + if (!shouldRetry(errOrCloseEvent)) throw errOrCloseEvent; + // @deprecated throw fatal connection problems immediately + if (isFatalConnectionProblem === null || isFatalConnectionProblem === void 0 ? void 0 : isFatalConnectionProblem(errOrCloseEvent)) throw errOrCloseEvent; + // looks good, start retrying + return retrying = true; + } + // in non-lazy (hot?) mode always hold one connection lock to persist the socket + if (!lazy) { + (async () => { + locks++; + for (;;) { + try { + const [,, throwOnClose] = await connect(); + await throwOnClose; // will always throw because releaser is not used + } catch (errOrCloseEvent) { + try { + if (!shouldRetryConnectOrThrow(errOrCloseEvent)) return; + } catch (errOrCloseEvent) { + // report thrown error, no further retries + return onNonLazyError === null || onNonLazyError === void 0 ? void 0 : onNonLazyError(errOrCloseEvent); + } + } + } + })(); + } + return { + on: emitter.on, + subscribe(payload, sink) { + const id = generateID(payload); + let done = false, + errored = false, + releaser = () => { + // for handling completions before connect + locks--; + done = true; + }; + (async () => { + locks++; + for (;;) { + try { + const [socket, release, waitForReleaseOrThrowOnClose] = await connect(); + // if done while waiting for connect, release the connection lock right away + if (done) return release(); + const unlisten = emitter.onMessage(id, message => { + switch (message.type) { + case _common.MessageType.Next: + { + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- payload will fit type + sink.next(message.payload); + return; + } + case _common.MessageType.Error: + { + errored = true, done = true; + sink.error(message.payload); + releaser(); + return; + } + case _common.MessageType.Complete: + { + done = true; + releaser(); // release completes the sink + return; + } + } + }); + socket.send((0, _common.stringifyMessage)({ + id, + type: _common.MessageType.Subscribe, + payload + }, replacer)); + releaser = () => { + if (!done && socket.readyState === WebSocketImpl.OPEN) + // if not completed already and socket is open, send complete message to server on release + socket.send((0, _common.stringifyMessage)({ + id, + type: _common.MessageType.Complete + }, replacer)); + locks--; + done = true; + release(); + }; + // either the releaser will be called, connection completed and + // the promise resolved or the socket closed and the promise rejected. + // whatever happens though, we want to stop listening for messages + await waitForReleaseOrThrowOnClose.finally(unlisten); + return; // completed, shouldnt try again + } catch (errOrCloseEvent) { + if (!shouldRetryConnectOrThrow(errOrCloseEvent)) return; + } + } + })().then(() => { + // delivering either an error or a complete terminates the sequence + if (!errored) sink.complete(); + }) // resolves on release or normal closure + .catch(err => { + sink.error(err); + }); // rejects on close events and errors + return () => { + // dispose only of active subscriptions + if (!done) releaser(); + }; + }, + iterate(request) { + const pending = []; + const deferred = { + done: false, + error: null, + resolve: () => { + // noop + } + }; + const dispose = this.subscribe(request, { + next(val) { + pending.push(val); + deferred.resolve(); + }, + error(err) { + deferred.done = true; + deferred.error = err; + deferred.resolve(); + }, + complete() { + deferred.done = true; + deferred.resolve(); + } + }); + const iterator = function iterator() { + return __asyncGenerator(this, arguments, function* iterator_1() { + for (;;) { + if (!pending.length) { + // only wait if there are no pending messages available + yield __await(new Promise(resolve => deferred.resolve = resolve)); + } + // first flush + while (pending.length) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + yield yield __await(pending.shift()); + } + // then error + if (deferred.error) { + throw deferred.error; + } + // or complete + if (deferred.done) { + return yield __await(void 0); + } + } + }); + }(); + iterator.throw = async err => { + if (!deferred.done) { + deferred.done = true; + deferred.error = err; + deferred.resolve(); + } + return { + done: true, + value: undefined + }; + }; + iterator.return = async () => { + dispose(); + return { + done: true, + value: undefined + }; + }; + return iterator; + }, + async dispose() { + disposed = true; + if (connecting) { + // if there is a connection, close it + const [socket] = await connecting; + socket.close(1000, 'Normal Closure'); + } + }, + terminate() { + if (connecting) { + // only if there is a connection + emitter.emit('closed', { + code: 4499, + reason: 'Terminated', + wasClean: false + }); + } + } + }; } -exports.GraphQLInputObjectType = GraphQLInputObjectType; -function defineInputFieldMap(config) { - const fieldMap = resolveObjMapThunk(config.fields); - isPlainObj(fieldMap) || (0, _devAssert.devAssert)(false, `${config.name} fields must be an object with field names as keys or a function which returns such an object.`); - return (0, _mapValue.mapValue)(fieldMap, (fieldConfig, fieldName) => { - !('resolve' in fieldConfig) || (0, _devAssert.devAssert)(false, `${config.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`); - return { - name: (0, _assertName.assertName)(fieldName), - description: fieldConfig.description, - type: fieldConfig.type, - defaultValue: fieldConfig.defaultValue, - deprecationReason: fieldConfig.deprecationReason, - extensions: (0, _toObjMap.toObjMap)(fieldConfig.extensions), - astNode: fieldConfig.astNode - }; - }); +function isLikeCloseEvent(val) { + return (0, _utils.isObject)(val) && 'code' in val && 'reason' in val; } -function isRequiredInputField(field) { - return isNonNullType(field.type) && field.defaultValue === undefined; +function isFatalInternalCloseCode(code) { + if ([1000, 1001, 1006, 1005, 1012, 1013, 1013 // Bad Gateway + ].includes(code)) return false; + // all other internal errors are fatal + return code >= 1000 && code <= 1999; +} +function isWebSocket(val) { + return typeof val === 'function' && 'constructor' in val && 'CLOSED' in val && 'CLOSING' in val && 'CONNECTING' in val && 'OPEN' in val; } /***/ }), -/***/ "../../../node_modules/graphql/type/directives.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/type/directives.mjs ***! - \*********************************************************/ +/***/ "../../../node_modules/graphql-ws/lib/common.mjs": +/*!*******************************************************!*\ + !*** ../../../node_modules/graphql-ws/lib/common.mjs ***! + \*******************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GraphQLSpecifiedByDirective = exports.GraphQLSkipDirective = exports.GraphQLOneOfDirective = exports.GraphQLIncludeDirective = exports.GraphQLDirective = exports.GraphQLDeprecatedDirective = exports.DEFAULT_DEPRECATION_REASON = void 0; -exports.assertDirective = assertDirective; -exports.isDirective = isDirective; -exports.isSpecifiedDirective = isSpecifiedDirective; -exports.specifiedDirectives = void 0; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _instanceOf = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); -var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -var _toObjMap = __webpack_require__(/*! ../jsutils/toObjMap.mjs */ "../../../node_modules/graphql/jsutils/toObjMap.mjs"); -var _directiveLocation = __webpack_require__(/*! ../language/directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); -var _assertName = __webpack_require__(/*! ./assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); -var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _scalars = __webpack_require__(/*! ./scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); +exports.MessageType = exports.GRAPHQL_TRANSPORT_WS_PROTOCOL = exports.DEPRECATED_GRAPHQL_WS_PROTOCOL = exports.CloseCode = void 0; +exports.isMessage = isMessage; +exports.parseMessage = parseMessage; +exports.stringifyMessage = stringifyMessage; +exports.validateMessage = validateMessage; +var _utils = __webpack_require__(/*! ./utils.mjs */ "../../../node_modules/graphql-ws/lib/utils.mjs"); /** - * Test if the given value is a GraphQL directive. + * + * common + * */ -function isDirective(directive) { - return (0, _instanceOf.instanceOf)(directive, GraphQLDirective); -} -function assertDirective(directive) { - if (!isDirective(directive)) { - throw new Error(`Expected ${(0, _inspect.inspect)(directive)} to be a GraphQL directive.`); - } - return directive; -} /** - * Custom extensions + * The WebSocket sub-protocol used for the [GraphQL over WebSocket Protocol](https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverWebSocket.md). * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. + * @category Common */ - +const GRAPHQL_TRANSPORT_WS_PROTOCOL = exports.GRAPHQL_TRANSPORT_WS_PROTOCOL = 'graphql-transport-ws'; /** - * Directives are used by the GraphQL runtime as a way of modifying execution - * behavior. Type system creators will usually not create these directly. + * The deprecated subprotocol used by [subscriptions-transport-ws](https://github.com/apollographql/subscriptions-transport-ws). + * + * @private */ -class GraphQLDirective { - constructor(config) { - var _config$isRepeatable, _config$args; - this.name = (0, _assertName.assertName)(config.name); - this.description = config.description; - this.locations = config.locations; - this.isRepeatable = (_config$isRepeatable = config.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false; - this.extensions = (0, _toObjMap.toObjMap)(config.extensions); - this.astNode = config.astNode; - Array.isArray(config.locations) || (0, _devAssert.devAssert)(false, `@${config.name} locations must be an Array.`); - const args = (_config$args = config.args) !== null && _config$args !== void 0 ? _config$args : {}; - (0, _isObjectLike.isObjectLike)(args) && !Array.isArray(args) || (0, _devAssert.devAssert)(false, `@${config.name} args must be an object with argument names as keys.`); - this.args = (0, _definition.defineArguments)(args); - } - get [Symbol.toStringTag]() { - return 'GraphQLDirective'; +const DEPRECATED_GRAPHQL_WS_PROTOCOL = exports.DEPRECATED_GRAPHQL_WS_PROTOCOL = 'graphql-ws'; +/** + * `graphql-ws` expected and standard close codes of the [GraphQL over WebSocket Protocol](https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverWebSocket.md). + * + * @category Common + */ +var CloseCode; +(function (CloseCode) { + CloseCode[CloseCode["InternalServerError"] = 4500] = "InternalServerError"; + CloseCode[CloseCode["InternalClientError"] = 4005] = "InternalClientError"; + CloseCode[CloseCode["BadRequest"] = 4400] = "BadRequest"; + CloseCode[CloseCode["BadResponse"] = 4004] = "BadResponse"; + /** Tried subscribing before connect ack */ + CloseCode[CloseCode["Unauthorized"] = 4401] = "Unauthorized"; + CloseCode[CloseCode["Forbidden"] = 4403] = "Forbidden"; + CloseCode[CloseCode["SubprotocolNotAcceptable"] = 4406] = "SubprotocolNotAcceptable"; + CloseCode[CloseCode["ConnectionInitialisationTimeout"] = 4408] = "ConnectionInitialisationTimeout"; + CloseCode[CloseCode["ConnectionAcknowledgementTimeout"] = 4504] = "ConnectionAcknowledgementTimeout"; + /** Subscriber distinction is very important */ + CloseCode[CloseCode["SubscriberAlreadyExists"] = 4409] = "SubscriberAlreadyExists"; + CloseCode[CloseCode["TooManyInitialisationRequests"] = 4429] = "TooManyInitialisationRequests"; +})(CloseCode || (exports.CloseCode = CloseCode = {})); +/** + * Types of messages allowed to be sent by the client/server over the WS protocol. + * + * @category Common + */ +var MessageType; +(function (MessageType) { + MessageType["ConnectionInit"] = "connection_init"; + MessageType["ConnectionAck"] = "connection_ack"; + MessageType["Ping"] = "ping"; + MessageType["Pong"] = "pong"; + MessageType["Subscribe"] = "subscribe"; + MessageType["Next"] = "next"; + MessageType["Error"] = "error"; + MessageType["Complete"] = "complete"; +})(MessageType || (exports.MessageType = MessageType = {})); +/** + * Validates the message against the GraphQL over WebSocket Protocol. + * + * Invalid messages will throw descriptive errors. + * + * @category Common + */ +function validateMessage(val) { + if (!(0, _utils.isObject)(val)) { + throw new Error(`Message is expected to be an object, but got ${(0, _utils.extendedTypeof)(val)}`); } - toConfig() { - return { - name: this.name, - description: this.description, - locations: this.locations, - args: (0, _definition.argsToArgsConfig)(this.args), - isRepeatable: this.isRepeatable, - extensions: this.extensions, - astNode: this.astNode - }; + if (!val.type) { + throw new Error(`Message is missing the 'type' property`); } - toString() { - return '@' + this.name; + if (typeof val.type !== 'string') { + throw new Error(`Message is expects the 'type' property to be a string, but got ${(0, _utils.extendedTypeof)(val.type)}`); } - toJSON() { - return this.toString(); + switch (val.type) { + case MessageType.ConnectionInit: + case MessageType.ConnectionAck: + case MessageType.Ping: + case MessageType.Pong: + { + if (val.payload != null && !(0, _utils.isObject)(val.payload)) { + throw new Error(`"${val.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${val.payload}"`); + } + break; + } + case MessageType.Subscribe: + { + if (typeof val.id !== 'string') { + throw new Error(`"${val.type}" message expects the 'id' property to be a string, but got ${(0, _utils.extendedTypeof)(val.id)}`); + } + if (!val.id) { + throw new Error(`"${val.type}" message requires a non-empty 'id' property`); + } + if (!(0, _utils.isObject)(val.payload)) { + throw new Error(`"${val.type}" message expects the 'payload' property to be an object, but got ${(0, _utils.extendedTypeof)(val.payload)}`); + } + if (typeof val.payload.query !== 'string') { + throw new Error(`"${val.type}" message payload expects the 'query' property to be a string, but got ${(0, _utils.extendedTypeof)(val.payload.query)}`); + } + if (val.payload.variables != null && !(0, _utils.isObject)(val.payload.variables)) { + throw new Error(`"${val.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${(0, _utils.extendedTypeof)(val.payload.variables)}`); + } + if (val.payload.operationName != null && (0, _utils.extendedTypeof)(val.payload.operationName) !== 'string') { + throw new Error(`"${val.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${(0, _utils.extendedTypeof)(val.payload.operationName)}`); + } + if (val.payload.extensions != null && !(0, _utils.isObject)(val.payload.extensions)) { + throw new Error(`"${val.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${(0, _utils.extendedTypeof)(val.payload.extensions)}`); + } + break; + } + case MessageType.Next: + { + if (typeof val.id !== 'string') { + throw new Error(`"${val.type}" message expects the 'id' property to be a string, but got ${(0, _utils.extendedTypeof)(val.id)}`); + } + if (!val.id) { + throw new Error(`"${val.type}" message requires a non-empty 'id' property`); + } + if (!(0, _utils.isObject)(val.payload)) { + throw new Error(`"${val.type}" message expects the 'payload' property to be an object, but got ${(0, _utils.extendedTypeof)(val.payload)}`); + } + break; + } + case MessageType.Error: + { + if (typeof val.id !== 'string') { + throw new Error(`"${val.type}" message expects the 'id' property to be a string, but got ${(0, _utils.extendedTypeof)(val.id)}`); + } + if (!val.id) { + throw new Error(`"${val.type}" message requires a non-empty 'id' property`); + } + if (!(0, _utils.areGraphQLErrors)(val.payload)) { + throw new Error(`"${val.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(val.payload)}`); + } + break; + } + case MessageType.Complete: + { + if (typeof val.id !== 'string') { + throw new Error(`"${val.type}" message expects the 'id' property to be a string, but got ${(0, _utils.extendedTypeof)(val.id)}`); + } + if (!val.id) { + throw new Error(`"${val.type}" message requires a non-empty 'id' property`); + } + break; + } + default: + throw new Error(`Invalid message 'type' property "${val.type}"`); } + return val; } - /** - * Used to conditionally include fields or fragments. + * Checks if the provided value is a valid GraphQL over WebSocket message. + * + * @deprecated Use `validateMessage` instead. + * + * @category Common */ -exports.GraphQLDirective = GraphQLDirective; -const GraphQLIncludeDirective = exports.GraphQLIncludeDirective = new GraphQLDirective({ - name: 'include', - description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', - locations: [_directiveLocation.DirectiveLocation.FIELD, _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, _directiveLocation.DirectiveLocation.INLINE_FRAGMENT], - args: { - if: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - description: 'Included when true.' - } +function isMessage(val) { + try { + validateMessage(val); + return true; + } catch (_a) { + return false; } -}); +} /** - * Used to conditionally skip (exclude) fields or fragments. + * Parses the raw websocket message data to a valid message. + * + * @category Common */ - -const GraphQLSkipDirective = exports.GraphQLSkipDirective = new GraphQLDirective({ - name: 'skip', - description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', - locations: [_directiveLocation.DirectiveLocation.FIELD, _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, _directiveLocation.DirectiveLocation.INLINE_FRAGMENT], - args: { - if: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - description: 'Skipped when true.' - } - } -}); +function parseMessage(data, reviver) { + return validateMessage(typeof data === 'string' ? JSON.parse(data, reviver) : data); +} /** - * Constant string used for default reason for a deprecation. + * Stringifies a valid message ready to be sent through the socket. + * + * @category Common */ +function stringifyMessage(msg, replacer) { + validateMessage(msg); + return JSON.stringify(msg, replacer); +} -const DEFAULT_DEPRECATION_REASON = exports.DEFAULT_DEPRECATION_REASON = 'No longer supported'; -/** - * Used to declare element of a GraphQL schema as deprecated. - */ +/***/ }), -const GraphQLDeprecatedDirective = exports.GraphQLDeprecatedDirective = new GraphQLDirective({ - name: 'deprecated', - description: 'Marks an element of a GraphQL schema as no longer supported.', - locations: [_directiveLocation.DirectiveLocation.FIELD_DEFINITION, _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION, _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION, _directiveLocation.DirectiveLocation.ENUM_VALUE], - args: { - reason: { - type: _scalars.GraphQLString, - description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', - defaultValue: DEFAULT_DEPRECATION_REASON - } +/***/ "../../../node_modules/graphql-ws/lib/index.js": +/*!*****************************************************!*\ + !*** ../../../node_modules/graphql-ws/lib/index.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function () { + return m[k]; + } + }; } + Object.defineProperty(o, k2, desc); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; }); +var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +__exportStar(__webpack_require__(/*! ./client */ "../../../node_modules/graphql-ws/lib/client.mjs"), exports); +__exportStar(__webpack_require__(/*! ./server */ "../../../node_modules/graphql-ws/lib/server.mjs"), exports); +__exportStar(__webpack_require__(/*! ./common */ "../../../node_modules/graphql-ws/lib/common.mjs"), exports); + +/***/ }), + +/***/ "../../../node_modules/graphql-ws/lib/server.mjs": +/*!*******************************************************!*\ + !*** ../../../node_modules/graphql-ws/lib/server.mjs ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.handleProtocols = handleProtocols; +exports.makeServer = makeServer; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _common = __webpack_require__(/*! ./common.mjs */ "../../../node_modules/graphql-ws/lib/common.mjs"); +var _utils = __webpack_require__(/*! ./utils.mjs */ "../../../node_modules/graphql-ws/lib/utils.mjs"); /** - * Used to provide a URL for specifying the behavior of custom scalar definitions. + * + * server + * */ - -const GraphQLSpecifiedByDirective = exports.GraphQLSpecifiedByDirective = new GraphQLDirective({ - name: 'specifiedBy', - description: 'Exposes a URL that specifies the behavior of this scalar.', - locations: [_directiveLocation.DirectiveLocation.SCALAR], - args: { - url: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - description: 'The URL that specifies the behavior of this scalar.' - } +var __asyncValues = void 0 && (void 0).__asyncValues || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], + i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { + return this; + }, i); + function verb(n) { + i[n] = o[n] && function (v) { + return new Promise(function (resolve, reject) { + v = o[n](v), settle(resolve, reject, v.done, v.value); + }); + }; } -}); + function settle(resolve, reject, d, v) { + Promise.resolve(v).then(function (v) { + resolve({ + value: v, + done: d + }); + }, reject); + } +}; /** - * Used to indicate an Input Object is a OneOf Input Object. + * Makes a Protocol complient WebSocket GraphQL server. The server + * is actually an API which is to be used with your favourite WebSocket + * server library! + * + * Read more about the [GraphQL over WebSocket Protocol](https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverWebSocket.md). + * + * @category Server */ - -const GraphQLOneOfDirective = exports.GraphQLOneOfDirective = new GraphQLDirective({ - name: 'oneOf', - description: 'Indicates exactly one field must be supplied and this field must not be `null`.', - locations: [_directiveLocation.DirectiveLocation.INPUT_OBJECT], - args: {} -}); +function makeServer(options) { + const { + schema, + context, + roots, + validate, + execute, + subscribe, + connectionInitWaitTimeout = 3000, + // 3 seconds + onConnect, + onDisconnect, + onClose, + onSubscribe, + onOperation, + onNext, + onError, + onComplete, + jsonMessageReviver: reviver, + jsonMessageReplacer: replacer + } = options; + return { + opened(socket, extra) { + const ctx = { + connectionInitReceived: false, + acknowledged: false, + subscriptions: {}, + extra + }; + if (socket.protocol !== _common.GRAPHQL_TRANSPORT_WS_PROTOCOL) { + socket.close(_common.CloseCode.SubprotocolNotAcceptable, 'Subprotocol not acceptable'); + return async (code, reason) => { + /* nothing was set up, just notify the closure */ + await (onClose === null || onClose === void 0 ? void 0 : onClose(ctx, code, reason)); + }; + } + // kick the client off (close socket) if the connection has + // not been initialised after the specified wait timeout + const connectionInitWait = connectionInitWaitTimeout > 0 && isFinite(connectionInitWaitTimeout) ? setTimeout(() => { + if (!ctx.connectionInitReceived) socket.close(_common.CloseCode.ConnectionInitialisationTimeout, 'Connection initialisation timeout'); + }, connectionInitWaitTimeout) : null; + socket.onMessage(async function onMessage(data) { + var _a, e_1, _b, _c; + var _d; + let message; + try { + message = (0, _common.parseMessage)(data, reviver); + } catch (err) { + return socket.close(_common.CloseCode.BadRequest, 'Invalid message received'); + } + switch (message.type) { + case _common.MessageType.ConnectionInit: + { + if (ctx.connectionInitReceived) return socket.close(_common.CloseCode.TooManyInitialisationRequests, 'Too many initialisation requests'); + // @ts-expect-error: I can write + ctx.connectionInitReceived = true; + if ((0, _utils.isObject)(message.payload)) + // @ts-expect-error: I can write + ctx.connectionParams = message.payload; + const permittedOrPayload = await (onConnect === null || onConnect === void 0 ? void 0 : onConnect(ctx)); + if (permittedOrPayload === false) return socket.close(_common.CloseCode.Forbidden, 'Forbidden'); + await socket.send((0, _common.stringifyMessage)((0, _utils.isObject)(permittedOrPayload) ? { + type: _common.MessageType.ConnectionAck, + payload: permittedOrPayload + } : { + type: _common.MessageType.ConnectionAck + // payload is completely absent if not provided + }, replacer)); + // @ts-expect-error: I can write + ctx.acknowledged = true; + return; + } + case _common.MessageType.Ping: + { + if (socket.onPing) + // if the onPing listener is registered, automatic pong is disabled + return await socket.onPing(message.payload); + await socket.send((0, _common.stringifyMessage)(message.payload ? { + type: _common.MessageType.Pong, + payload: message.payload + } : { + type: _common.MessageType.Pong + // payload is completely absent if not provided + })); + return; + } + case _common.MessageType.Pong: + return await ((_d = socket.onPong) === null || _d === void 0 ? void 0 : _d.call(socket, message.payload)); + case _common.MessageType.Subscribe: + { + if (!ctx.acknowledged) return socket.close(_common.CloseCode.Unauthorized, 'Unauthorized'); + const { + id, + payload + } = message; + if (id in ctx.subscriptions) return socket.close(_common.CloseCode.SubscriberAlreadyExists, `Subscriber for ${id} already exists`); + // if this turns out to be a streaming operation, the subscription value + // will change to an `AsyncIterable`, otherwise it will stay as is + ctx.subscriptions[id] = null; + const emit = { + next: async (result, args) => { + let nextMessage = { + id, + type: _common.MessageType.Next, + payload: result + }; + const maybeResult = await (onNext === null || onNext === void 0 ? void 0 : onNext(ctx, nextMessage, args, result)); + if (maybeResult) nextMessage = Object.assign(Object.assign({}, nextMessage), { + payload: maybeResult + }); + await socket.send((0, _common.stringifyMessage)(nextMessage, replacer)); + }, + error: async errors => { + let errorMessage = { + id, + type: _common.MessageType.Error, + payload: errors + }; + const maybeErrors = await (onError === null || onError === void 0 ? void 0 : onError(ctx, errorMessage, errors)); + if (maybeErrors) errorMessage = Object.assign(Object.assign({}, errorMessage), { + payload: maybeErrors + }); + await socket.send((0, _common.stringifyMessage)(errorMessage, replacer)); + }, + complete: async notifyClient => { + const completeMessage = { + id, + type: _common.MessageType.Complete + }; + await (onComplete === null || onComplete === void 0 ? void 0 : onComplete(ctx, completeMessage)); + if (notifyClient) await socket.send((0, _common.stringifyMessage)(completeMessage, replacer)); + } + }; + try { + let execArgs; + const maybeExecArgsOrErrors = await (onSubscribe === null || onSubscribe === void 0 ? void 0 : onSubscribe(ctx, message)); + if (maybeExecArgsOrErrors) { + if ((0, _utils.areGraphQLErrors)(maybeExecArgsOrErrors)) return await emit.error(maybeExecArgsOrErrors);else if (Array.isArray(maybeExecArgsOrErrors)) throw new Error('Invalid return value from onSubscribe hook, expected an array of GraphQLError objects'); + // not errors, is exec args + execArgs = maybeExecArgsOrErrors; + } else { + // you either provide a schema dynamically through + // `onSubscribe` or you set one up during the server setup + if (!schema) throw new Error('The GraphQL schema is not provided'); + const args = { + operationName: payload.operationName, + document: (0, _graphql.parse)(payload.query), + variableValues: payload.variables + }; + execArgs = Object.assign(Object.assign({}, args), { + schema: typeof schema === 'function' ? await schema(ctx, message, args) : schema + }); + const validationErrors = (validate !== null && validate !== void 0 ? validate : _graphql.validate)(execArgs.schema, execArgs.document); + if (validationErrors.length > 0) return await emit.error(validationErrors); + } + const operationAST = (0, _graphql.getOperationAST)(execArgs.document, execArgs.operationName); + if (!operationAST) return await emit.error([new _graphql.GraphQLError('Unable to identify operation')]); + // if `onSubscribe` didnt specify a rootValue, inject one + if (!('rootValue' in execArgs)) execArgs.rootValue = roots === null || roots === void 0 ? void 0 : roots[operationAST.operation]; + // if `onSubscribe` didn't specify a context, inject one + if (!('contextValue' in execArgs)) execArgs.contextValue = typeof context === 'function' ? await context(ctx, message, execArgs) : context; + // the execution arguments have been prepared + // perform the operation and act accordingly + let operationResult; + if (operationAST.operation === 'subscription') operationResult = await (subscribe !== null && subscribe !== void 0 ? subscribe : _graphql.subscribe)(execArgs); + // operation === 'query' || 'mutation' + else operationResult = await (execute !== null && execute !== void 0 ? execute : _graphql.execute)(execArgs); + const maybeResult = await (onOperation === null || onOperation === void 0 ? void 0 : onOperation(ctx, message, execArgs, operationResult)); + if (maybeResult) operationResult = maybeResult; + if ((0, _utils.isAsyncIterable)(operationResult)) { + /** multiple emitted results */ + if (!(id in ctx.subscriptions)) { + // subscription was completed/canceled before the operation settled + if ((0, _utils.isAsyncGenerator)(operationResult)) operationResult.return(undefined); + } else { + ctx.subscriptions[id] = operationResult; + try { + for (var _e = true, operationResult_1 = __asyncValues(operationResult), operationResult_1_1; operationResult_1_1 = await operationResult_1.next(), _a = operationResult_1_1.done, !_a; _e = true) { + _c = operationResult_1_1.value; + _e = false; + const result = _c; + await emit.next(result, execArgs); + } + } catch (e_1_1) { + e_1 = { + error: e_1_1 + }; + } finally { + try { + if (!_e && !_a && (_b = operationResult_1.return)) await _b.call(operationResult_1); + } finally { + if (e_1) throw e_1.error; + } + } + } + } else { + /** single emitted result */ + // if the client completed the subscription before the single result + // became available, he effectively canceled it and no data should be sent + if (id in ctx.subscriptions) await emit.next(operationResult, execArgs); + } + // lack of subscription at this point indicates that the client + // completed the subscription, he doesnt need to be reminded + await emit.complete(id in ctx.subscriptions); + } finally { + // whatever happens to the subscription, we finally want to get rid of the reservation + delete ctx.subscriptions[id]; + } + return; + } + case _common.MessageType.Complete: + { + const subscription = ctx.subscriptions[message.id]; + delete ctx.subscriptions[message.id]; // deleting the subscription means no further activity should take place + if ((0, _utils.isAsyncGenerator)(subscription)) await subscription.return(undefined); + return; + } + default: + throw new Error(`Unexpected message of type ${message.type} received`); + } + }); + // wait for close, cleanup and the disconnect callback + return async (code, reason) => { + if (connectionInitWait) clearTimeout(connectionInitWait); + for (const sub of Object.values(ctx.subscriptions)) { + if ((0, _utils.isAsyncGenerator)(sub)) await sub.return(undefined); + } + if (ctx.acknowledged) await (onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect(ctx, code, reason)); + await (onClose === null || onClose === void 0 ? void 0 : onClose(ctx, code, reason)); + }; + } + }; +} /** - * The full list of specified directives. + * Helper utility for choosing the "graphql-transport-ws" subprotocol from + * a set of WebSocket subprotocols. + * + * Accepts a set of already extracted WebSocket subprotocols or the raw + * Sec-WebSocket-Protocol header value. In either case, if the right + * protocol appears, it will be returned. + * + * By specification, the server should not provide a value with Sec-WebSocket-Protocol + * if it does not agree with client's subprotocols. The client has a responsibility + * to handle the connection afterwards. + * + * @category Server */ - -const specifiedDirectives = exports.specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLOneOfDirective]); -function isSpecifiedDirective(directive) { - return specifiedDirectives.some(({ - name - }) => name === directive.name); +function handleProtocols(protocols) { + switch (true) { + case protocols instanceof Set && protocols.has(_common.GRAPHQL_TRANSPORT_WS_PROTOCOL): + case Array.isArray(protocols) && protocols.includes(_common.GRAPHQL_TRANSPORT_WS_PROTOCOL): + case typeof protocols === 'string' && protocols.split(',').map(p => p.trim()).includes(_common.GRAPHQL_TRANSPORT_WS_PROTOCOL): + return _common.GRAPHQL_TRANSPORT_WS_PROTOCOL; + default: + return false; + } } /***/ }), -/***/ "../../../node_modules/graphql/type/index.mjs": -/*!****************************************************!*\ - !*** ../../../node_modules/graphql/type/index.mjs ***! - \****************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql-ws/lib/utils.mjs": +/*!******************************************************!*\ + !*** ../../../node_modules/graphql-ws/lib/utils.mjs ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -Object.defineProperty(exports, "DEFAULT_DEPRECATION_REASON", ({ - enumerable: true, - get: function () { - return _directives.DEFAULT_DEPRECATION_REASON; - } -})); -Object.defineProperty(exports, "GRAPHQL_MAX_INT", ({ - enumerable: true, - get: function () { - return _scalars.GRAPHQL_MAX_INT; - } -})); -Object.defineProperty(exports, "GRAPHQL_MIN_INT", ({ - enumerable: true, - get: function () { - return _scalars.GRAPHQL_MIN_INT; - } -})); -Object.defineProperty(exports, "GraphQLBoolean", ({ - enumerable: true, - get: function () { - return _scalars.GraphQLBoolean; - } -})); -Object.defineProperty(exports, "GraphQLDeprecatedDirective", ({ - enumerable: true, - get: function () { - return _directives.GraphQLDeprecatedDirective; - } -})); -Object.defineProperty(exports, "GraphQLDirective", ({ - enumerable: true, - get: function () { - return _directives.GraphQLDirective; - } -})); -Object.defineProperty(exports, "GraphQLEnumType", ({ - enumerable: true, - get: function () { - return _definition.GraphQLEnumType; - } -})); -Object.defineProperty(exports, "GraphQLFloat", ({ - enumerable: true, - get: function () { - return _scalars.GraphQLFloat; +exports.areGraphQLErrors = areGraphQLErrors; +exports.extendedTypeof = extendedTypeof; +exports.isAsyncGenerator = isAsyncGenerator; +exports.isAsyncIterable = isAsyncIterable; +exports.isObject = isObject; +exports.limitCloseReason = limitCloseReason; +/** @private */ +function extendedTypeof(val) { + if (val === null) { + return 'null'; } -})); -Object.defineProperty(exports, "GraphQLID", ({ - enumerable: true, - get: function () { - return _scalars.GraphQLID; + if (Array.isArray(val)) { + return 'array'; } + return typeof val; +} +/** @private */ +function isObject(val) { + return extendedTypeof(val) === 'object'; +} +/** @private */ +function isAsyncIterable(val) { + return typeof Object(val)[Symbol.asyncIterator] === 'function'; +} +/** @private */ +function isAsyncGenerator(val) { + return isObject(val) && typeof Object(val)[Symbol.asyncIterator] === 'function' && typeof val.return === 'function' + // for lazy ones, we only need the return anyway + // typeof val.throw === 'function' && + // typeof val.next === 'function' + ; +} +/** @private */ +function areGraphQLErrors(obj) { + return Array.isArray(obj) && + // must be at least one error + obj.length > 0 && + // error has at least a message + obj.every(ob => 'message' in ob); +} +/** + * Limits the WebSocket close event reason to not exceed a length of one frame. + * Reference: https://datatracker.ietf.org/doc/html/rfc6455#section-5.2. + * + * @private + */ +function limitCloseReason(reason, whenTooLong) { + return reason.length < 124 ? reason : whenTooLong; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/error/GraphQLError.mjs": +/*!************************************************************!*\ + !*** ../../../node_modules/graphql/error/GraphQLError.mjs ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "GraphQLIncludeDirective", ({ - enumerable: true, - get: function () { - return _directives.GraphQLIncludeDirective; +exports.GraphQLError = void 0; +exports.formatError = formatError; +exports.printError = printError; +var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _location = __webpack_require__(/*! ../language/location.mjs */ "../../../node_modules/graphql/language/location.mjs"); +var _printLocation = __webpack_require__(/*! ../language/printLocation.mjs */ "../../../node_modules/graphql/language/printLocation.mjs"); +function toNormalizedOptions(args) { + const firstArg = args[0]; + if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) { + return { + nodes: firstArg, + source: args[1], + positions: args[2], + path: args[3], + originalError: args[4], + extensions: args[5] + }; } -})); -Object.defineProperty(exports, "GraphQLInputObjectType", ({ - enumerable: true, - get: function () { - return _definition.GraphQLInputObjectType; - } -})); -Object.defineProperty(exports, "GraphQLInt", ({ - enumerable: true, - get: function () { - return _scalars.GraphQLInt; - } -})); -Object.defineProperty(exports, "GraphQLInterfaceType", ({ - enumerable: true, - get: function () { - return _definition.GraphQLInterfaceType; - } -})); -Object.defineProperty(exports, "GraphQLList", ({ - enumerable: true, - get: function () { - return _definition.GraphQLList; + return firstArg; +} +/** + * A GraphQLError describes an Error found during the parse, validate, or + * execute phases of performing a GraphQL operation. In addition to a message + * and stack trace, it also includes information about the locations in a + * GraphQL document and/or execution result that correspond to the Error. + */ + +class GraphQLError extends Error { + /** + * An array of `{ line, column }` locations within the source GraphQL document + * which correspond to this error. + * + * Errors during validation often contain multiple locations, for example to + * point out two things with the same name. Errors during execution include a + * single location, the field which produced the error. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + + /** + * An array describing the JSON-path into the execution response which + * corresponds to this error. Only included for errors during execution. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + + /** + * An array of GraphQL AST Nodes corresponding to this error. + */ + + /** + * The source GraphQL document for the first location of this error. + * + * Note that if this Error represents more than one node, the source may not + * represent nodes after the first node. + */ + + /** + * An array of character offsets within the source GraphQL document + * which correspond to this error. + */ + + /** + * The original error thrown from a field resolver during execution. + */ + + /** + * Extension fields to add to the formatted error. + */ + + /** + * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead. + */ + constructor(message, ...rawArgs) { + var _this$nodes, _nodeLocations$, _ref; + const { + nodes, + source, + positions, + path, + originalError, + extensions + } = toNormalizedOptions(rawArgs); + super(message); + this.name = 'GraphQLError'; + this.path = path !== null && path !== void 0 ? path : undefined; + this.originalError = originalError !== null && originalError !== void 0 ? originalError : undefined; // Compute list of blame nodes. + + this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined); + const nodeLocations = undefinedIfEmpty((_this$nodes = this.nodes) === null || _this$nodes === void 0 ? void 0 : _this$nodes.map(node => node.loc).filter(loc => loc != null)); // Compute locations in the source for the given nodes/positions. + + this.source = source !== null && source !== void 0 ? source : nodeLocations === null || nodeLocations === void 0 ? void 0 : (_nodeLocations$ = nodeLocations[0]) === null || _nodeLocations$ === void 0 ? void 0 : _nodeLocations$.source; + this.positions = positions !== null && positions !== void 0 ? positions : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map(loc => loc.start); + this.locations = positions && source ? positions.map(pos => (0, _location.getLocation)(source, pos)) : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map(loc => (0, _location.getLocation)(loc.source, loc.start)); + const originalExtensions = (0, _isObjectLike.isObjectLike)(originalError === null || originalError === void 0 ? void 0 : originalError.extensions) ? originalError === null || originalError === void 0 ? void 0 : originalError.extensions : undefined; + this.extensions = (_ref = extensions !== null && extensions !== void 0 ? extensions : originalExtensions) !== null && _ref !== void 0 ? _ref : Object.create(null); // Only properties prescribed by the spec should be enumerable. + // Keep the rest as non-enumerable. + + Object.defineProperties(this, { + message: { + writable: true, + enumerable: true + }, + name: { + enumerable: false + }, + nodes: { + enumerable: false + }, + source: { + enumerable: false + }, + positions: { + enumerable: false + }, + originalError: { + enumerable: false + } + }); // Include (non-enumerable) stack trace. + + /* c8 ignore start */ + // FIXME: https://github.com/graphql/graphql-js/issues/2317 + + if (originalError !== null && originalError !== void 0 && originalError.stack) { + Object.defineProperty(this, 'stack', { + value: originalError.stack, + writable: true, + configurable: true + }); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, GraphQLError); + } else { + Object.defineProperty(this, 'stack', { + value: Error().stack, + writable: true, + configurable: true + }); + } + /* c8 ignore stop */ } -})); -Object.defineProperty(exports, "GraphQLNonNull", ({ - enumerable: true, - get: function () { - return _definition.GraphQLNonNull; + get [Symbol.toStringTag]() { + return 'GraphQLError'; } -})); -Object.defineProperty(exports, "GraphQLObjectType", ({ - enumerable: true, - get: function () { - return _definition.GraphQLObjectType; + toString() { + let output = this.message; + if (this.nodes) { + for (const node of this.nodes) { + if (node.loc) { + output += '\n\n' + (0, _printLocation.printLocation)(node.loc); + } + } + } else if (this.source && this.locations) { + for (const location of this.locations) { + output += '\n\n' + (0, _printLocation.printSourceLocation)(this.source, location); + } + } + return output; } -})); -Object.defineProperty(exports, "GraphQLOneOfDirective", ({ - enumerable: true, - get: function () { - return _directives.GraphQLOneOfDirective; + toJSON() { + const formattedError = { + message: this.message + }; + if (this.locations != null) { + formattedError.locations = this.locations; + } + if (this.path != null) { + formattedError.path = this.path; + } + if (this.extensions != null && Object.keys(this.extensions).length > 0) { + formattedError.extensions = this.extensions; + } + return formattedError; } +} +exports.GraphQLError = GraphQLError; +function undefinedIfEmpty(array) { + return array === undefined || array.length === 0 ? undefined : array; +} +/** + * See: https://spec.graphql.org/draft/#sec-Errors + */ + +/** + * Prints a GraphQLError to a string, representing useful location information + * about the error's position in the source. + * + * @deprecated Please use `error.toString` instead. Will be removed in v17 + */ +function printError(error) { + return error.toString(); +} +/** + * Given a GraphQLError, format it according to the rules described by the + * Response Format, Errors section of the GraphQL Specification. + * + * @deprecated Please use `error.toJSON` instead. Will be removed in v17 + */ + +function formatError(error) { + return error.toJSON(); +} + +/***/ }), + +/***/ "../../../node_modules/graphql/error/index.mjs": +/*!*****************************************************!*\ + !*** ../../../node_modules/graphql/error/index.mjs ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "GraphQLScalarType", ({ +Object.defineProperty(exports, "GraphQLError", ({ enumerable: true, get: function () { - return _definition.GraphQLScalarType; + return _GraphQLError.GraphQLError; } })); -Object.defineProperty(exports, "GraphQLSchema", ({ +Object.defineProperty(exports, "formatError", ({ enumerable: true, get: function () { - return _schema.GraphQLSchema; + return _GraphQLError.formatError; } })); -Object.defineProperty(exports, "GraphQLSkipDirective", ({ +Object.defineProperty(exports, "locatedError", ({ enumerable: true, get: function () { - return _directives.GraphQLSkipDirective; + return _locatedError.locatedError; } })); -Object.defineProperty(exports, "GraphQLSpecifiedByDirective", ({ +Object.defineProperty(exports, "printError", ({ enumerable: true, get: function () { - return _directives.GraphQLSpecifiedByDirective; + return _GraphQLError.printError; } })); -Object.defineProperty(exports, "GraphQLString", ({ +Object.defineProperty(exports, "syntaxError", ({ enumerable: true, get: function () { - return _scalars.GraphQLString; + return _syntaxError.syntaxError; } })); -Object.defineProperty(exports, "GraphQLUnionType", ({ - enumerable: true, - get: function () { - return _definition.GraphQLUnionType; - } +var _GraphQLError = __webpack_require__(/*! ./GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _syntaxError = __webpack_require__(/*! ./syntaxError.mjs */ "../../../node_modules/graphql/error/syntaxError.mjs"); +var _locatedError = __webpack_require__(/*! ./locatedError.mjs */ "../../../node_modules/graphql/error/locatedError.mjs"); + +/***/ }), + +/***/ "../../../node_modules/graphql/error/locatedError.mjs": +/*!************************************************************!*\ + !*** ../../../node_modules/graphql/error/locatedError.mjs ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "SchemaMetaFieldDef", ({ - enumerable: true, - get: function () { - return _introspection.SchemaMetaFieldDef; +exports.locatedError = locatedError; +var _toError = __webpack_require__(/*! ../jsutils/toError.mjs */ "../../../node_modules/graphql/jsutils/toError.mjs"); +var _GraphQLError = __webpack_require__(/*! ./GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Given an arbitrary value, presumably thrown while attempting to execute a + * GraphQL operation, produce a new GraphQLError aware of the location in the + * document responsible for the original Error. + */ + +function locatedError(rawOriginalError, nodes, path) { + var _nodes; + const originalError = (0, _toError.toError)(rawOriginalError); // Note: this uses a brand-check to support GraphQL errors originating from other contexts. + + if (isLocatedGraphQLError(originalError)) { + return originalError; } + return new _GraphQLError.GraphQLError(originalError.message, { + nodes: (_nodes = originalError.nodes) !== null && _nodes !== void 0 ? _nodes : nodes, + source: originalError.source, + positions: originalError.positions, + path, + originalError + }); +} +function isLocatedGraphQLError(error) { + return Array.isArray(error.path); +} + +/***/ }), + +/***/ "../../../node_modules/graphql/error/syntaxError.mjs": +/*!***********************************************************!*\ + !*** ../../../node_modules/graphql/error/syntaxError.mjs ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "TypeKind", ({ - enumerable: true, - get: function () { - return _introspection.TypeKind; - } +exports.syntaxError = syntaxError; +var _GraphQLError = __webpack_require__(/*! ./GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Produces a GraphQLError representing a syntax error, containing useful + * descriptive information about the syntax error's position in the source. + */ + +function syntaxError(source, position, description) { + return new _GraphQLError.GraphQLError(`Syntax Error: ${description}`, { + source, + positions: [position] + }); +} + +/***/ }), + +/***/ "../../../node_modules/graphql/execution/collectFields.mjs": +/*!*****************************************************************!*\ + !*** ../../../node_modules/graphql/execution/collectFields.mjs ***! + \*****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "TypeMetaFieldDef", ({ - enumerable: true, - get: function () { - return _introspection.TypeMetaFieldDef; +exports.collectFields = collectFields; +exports.collectSubfields = collectSubfields; +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +var _typeFromAST = __webpack_require__(/*! ../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); +var _values = __webpack_require__(/*! ./values.mjs */ "../../../node_modules/graphql/execution/values.mjs"); +/** + * Given a selectionSet, collects all of the fields and returns them. + * + * CollectFields requires the "runtime type" of an object. For a field that + * returns an Interface or Union type, the "runtime type" will be the actual + * object type returned by that field. + * + * @internal + */ + +function collectFields(schema, fragments, variableValues, runtimeType, selectionSet) { + const fields = new Map(); + collectFieldsImpl(schema, fragments, variableValues, runtimeType, selectionSet, fields, new Set()); + return fields; +} +/** + * Given an array of field nodes, collects all of the subfields of the passed + * in fields, and returns them at the end. + * + * CollectSubFields requires the "return type" of an object. For a field that + * returns an Interface or Union type, the "return type" will be the actual + * object type returned by that field. + * + * @internal + */ + +function collectSubfields(schema, fragments, variableValues, returnType, fieldNodes) { + const subFieldNodes = new Map(); + const visitedFragmentNames = new Set(); + for (const node of fieldNodes) { + if (node.selectionSet) { + collectFieldsImpl(schema, fragments, variableValues, returnType, node.selectionSet, subFieldNodes, visitedFragmentNames); + } } -})); -Object.defineProperty(exports, "TypeNameMetaFieldDef", ({ - enumerable: true, - get: function () { - return _introspection.TypeNameMetaFieldDef; + return subFieldNodes; +} +function collectFieldsImpl(schema, fragments, variableValues, runtimeType, selectionSet, fields, visitedFragmentNames) { + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case _kinds.Kind.FIELD: + { + if (!shouldIncludeNode(variableValues, selection)) { + continue; + } + const name = getFieldEntryKey(selection); + const fieldList = fields.get(name); + if (fieldList !== undefined) { + fieldList.push(selection); + } else { + fields.set(name, [selection]); + } + break; + } + case _kinds.Kind.INLINE_FRAGMENT: + { + if (!shouldIncludeNode(variableValues, selection) || !doesFragmentConditionMatch(schema, selection, runtimeType)) { + continue; + } + collectFieldsImpl(schema, fragments, variableValues, runtimeType, selection.selectionSet, fields, visitedFragmentNames); + break; + } + case _kinds.Kind.FRAGMENT_SPREAD: + { + const fragName = selection.name.value; + if (visitedFragmentNames.has(fragName) || !shouldIncludeNode(variableValues, selection)) { + continue; + } + visitedFragmentNames.add(fragName); + const fragment = fragments[fragName]; + if (!fragment || !doesFragmentConditionMatch(schema, fragment, runtimeType)) { + continue; + } + collectFieldsImpl(schema, fragments, variableValues, runtimeType, fragment.selectionSet, fields, visitedFragmentNames); + break; + } + } } -})); -Object.defineProperty(exports, "__Directive", ({ - enumerable: true, - get: function () { - return _introspection.__Directive; +} +/** + * Determines if a field should be included based on the `@include` and `@skip` + * directives, where `@skip` has higher precedence than `@include`. + */ + +function shouldIncludeNode(variableValues, node) { + const skip = (0, _values.getDirectiveValues)(_directives.GraphQLSkipDirective, node, variableValues); + if ((skip === null || skip === void 0 ? void 0 : skip.if) === true) { + return false; } -})); -Object.defineProperty(exports, "__DirectiveLocation", ({ - enumerable: true, - get: function () { - return _introspection.__DirectiveLocation; + const include = (0, _values.getDirectiveValues)(_directives.GraphQLIncludeDirective, node, variableValues); + if ((include === null || include === void 0 ? void 0 : include.if) === false) { + return false; } -})); -Object.defineProperty(exports, "__EnumValue", ({ - enumerable: true, - get: function () { - return _introspection.__EnumValue; + return true; +} +/** + * Determines if a fragment is applicable to the given type. + */ + +function doesFragmentConditionMatch(schema, fragment, type) { + const typeConditionNode = fragment.typeCondition; + if (!typeConditionNode) { + return true; } -})); -Object.defineProperty(exports, "__Field", ({ - enumerable: true, - get: function () { - return _introspection.__Field; + const conditionalType = (0, _typeFromAST.typeFromAST)(schema, typeConditionNode); + if (conditionalType === type) { + return true; } -})); -Object.defineProperty(exports, "__InputValue", ({ - enumerable: true, - get: function () { - return _introspection.__InputValue; + if ((0, _definition.isAbstractType)(conditionalType)) { + return schema.isSubType(conditionalType, type); } + return false; +} +/** + * Implements the logic to compute the key of a given field's entry + */ + +function getFieldEntryKey(node) { + return node.alias ? node.alias.value : node.name.value; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/execution/execute.mjs": +/*!***********************************************************!*\ + !*** ../../../node_modules/graphql/execution/execute.mjs ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "__Schema", ({ - enumerable: true, - get: function () { - return _introspection.__Schema; - } -})); -Object.defineProperty(exports, "__Type", ({ - enumerable: true, - get: function () { - return _introspection.__Type; - } -})); -Object.defineProperty(exports, "__TypeKind", ({ - enumerable: true, - get: function () { - return _introspection.__TypeKind; - } -})); -Object.defineProperty(exports, "assertAbstractType", ({ - enumerable: true, - get: function () { - return _definition.assertAbstractType; - } -})); -Object.defineProperty(exports, "assertCompositeType", ({ - enumerable: true, - get: function () { - return _definition.assertCompositeType; - } -})); -Object.defineProperty(exports, "assertDirective", ({ - enumerable: true, - get: function () { - return _directives.assertDirective; +exports.assertValidExecutionArguments = assertValidExecutionArguments; +exports.buildExecutionContext = buildExecutionContext; +exports.buildResolveInfo = buildResolveInfo; +exports.defaultTypeResolver = exports.defaultFieldResolver = void 0; +exports.execute = execute; +exports.executeSync = executeSync; +exports.getFieldDef = getFieldDef; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _isIterableObject = __webpack_require__(/*! ../jsutils/isIterableObject.mjs */ "../../../node_modules/graphql/jsutils/isIterableObject.mjs"); +var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _isPromise = __webpack_require__(/*! ../jsutils/isPromise.mjs */ "../../../node_modules/graphql/jsutils/isPromise.mjs"); +var _memoize = __webpack_require__(/*! ../jsutils/memoize3.mjs */ "../../../node_modules/graphql/jsutils/memoize3.mjs"); +var _Path = __webpack_require__(/*! ../jsutils/Path.mjs */ "../../../node_modules/graphql/jsutils/Path.mjs"); +var _promiseForObject = __webpack_require__(/*! ../jsutils/promiseForObject.mjs */ "../../../node_modules/graphql/jsutils/promiseForObject.mjs"); +var _promiseReduce = __webpack_require__(/*! ../jsutils/promiseReduce.mjs */ "../../../node_modules/graphql/jsutils/promiseReduce.mjs"); +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _locatedError = __webpack_require__(/*! ../error/locatedError.mjs */ "../../../node_modules/graphql/error/locatedError.mjs"); +var _ast = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +var _validate = __webpack_require__(/*! ../type/validate.mjs */ "../../../node_modules/graphql/type/validate.mjs"); +var _collectFields = __webpack_require__(/*! ./collectFields.mjs */ "../../../node_modules/graphql/execution/collectFields.mjs"); +var _values = __webpack_require__(/*! ./values.mjs */ "../../../node_modules/graphql/execution/values.mjs"); +/** + * A memoized collection of relevant subfields with regard to the return + * type. Memoizing ensures the subfields are not repeatedly calculated, which + * saves overhead when resolving lists of values. + */ + +const collectSubfields = (0, _memoize.memoize3)((exeContext, returnType, fieldNodes) => (0, _collectFields.collectSubfields)(exeContext.schema, exeContext.fragments, exeContext.variableValues, returnType, fieldNodes)); +/** + * Terminology + * + * "Definitions" are the generic name for top-level statements in the document. + * Examples of this include: + * 1) Operations (such as a query) + * 2) Fragments + * + * "Operations" are a generic name for requests in the document. + * Examples of this include: + * 1) query, + * 2) mutation + * + * "Selections" are the definitions that can appear legally and at + * single level of the query. These include: + * 1) field references e.g `a` + * 2) fragment "spreads" e.g. `...c` + * 3) inline fragment "spreads" e.g. `...on Type { a }` + */ + +/** + * Data that must be available at all points during query execution. + * + * Namely, schema of the type system that is currently executing, + * and the fragments defined in the query document + */ + +/** + * Implements the "Executing requests" section of the GraphQL specification. + * + * Returns either a synchronous ExecutionResult (if all encountered resolvers + * are synchronous), or a Promise of an ExecutionResult that will eventually be + * resolved and never rejected. + * + * If the arguments to this function do not result in a legal execution context, + * a GraphQLError will be thrown immediately explaining the invalid input. + */ +function execute(args) { + // Temporary for v15 to v16 migration. Remove in v17 + arguments.length < 2 || (0, _devAssert.devAssert)(false, 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.'); + const { + schema, + document, + variableValues, + rootValue + } = args; // If arguments are missing or incorrect, throw an error. + + assertValidExecutionArguments(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments, + // a "Response" with only errors is returned. + + const exeContext = buildExecutionContext(args); // Return early errors if execution context failed. + + if (!('schema' in exeContext)) { + return { + errors: exeContext + }; + } // Return a Promise that will eventually resolve to the data described by + // The "Response" section of the GraphQL specification. + // + // If errors are encountered while executing a GraphQL field, only that + // field and its descendants will be omitted, and sibling fields will still + // be executed. An execution which encounters errors will still result in a + // resolved Promise. + // + // Errors from sub-fields of a NonNull type may propagate to the top level, + // at which point we still log the error and null the parent field, which + // in this case is the entire response. + + try { + const { + operation + } = exeContext; + const result = executeOperation(exeContext, operation, rootValue); + if ((0, _isPromise.isPromise)(result)) { + return result.then(data => buildResponse(data, exeContext.errors), error => { + exeContext.errors.push(error); + return buildResponse(null, exeContext.errors); + }); + } + return buildResponse(result, exeContext.errors); + } catch (error) { + exeContext.errors.push(error); + return buildResponse(null, exeContext.errors); } -})); -Object.defineProperty(exports, "assertEnumType", ({ - enumerable: true, - get: function () { - return _definition.assertEnumType; +} +/** + * Also implements the "Executing requests" section of the GraphQL specification. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + */ + +function executeSync(args) { + const result = execute(args); // Assert that the execution was synchronous. + + if ((0, _isPromise.isPromise)(result)) { + throw new Error('GraphQL execution failed to complete synchronously.'); } -})); -Object.defineProperty(exports, "assertEnumValueName", ({ - enumerable: true, - get: function () { - return _assertName.assertEnumValueName; + return result; +} +/** + * Given a completed execution context and data, build the `{ errors, data }` + * response defined by the "Response" section of the GraphQL specification. + */ + +function buildResponse(data, errors) { + return errors.length === 0 ? { + data + } : { + errors, + data + }; +} +/** + * Essential assertions before executing to provide developer feedback for + * improper use of the GraphQL library. + * + * @internal + */ + +function assertValidExecutionArguments(schema, document, rawVariableValues) { + document || (0, _devAssert.devAssert)(false, 'Must provide document.'); // If the schema used for execution is invalid, throw an error. + + (0, _validate.assertValidSchema)(schema); // Variables, if provided, must be an object. + + rawVariableValues == null || (0, _isObjectLike.isObjectLike)(rawVariableValues) || (0, _devAssert.devAssert)(false, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.'); +} +/** + * Constructs a ExecutionContext object from the arguments passed to + * execute, which we will pass throughout the other execution methods. + * + * Throws a GraphQLError if a valid execution context cannot be created. + * + * @internal + */ + +function buildExecutionContext(args) { + var _definition$name, _operation$variableDe; + const { + schema, + document, + rootValue, + contextValue, + variableValues: rawVariableValues, + operationName, + fieldResolver, + typeResolver, + subscribeFieldResolver + } = args; + let operation; + const fragments = Object.create(null); + for (const definition of document.definitions) { + switch (definition.kind) { + case _kinds.Kind.OPERATION_DEFINITION: + if (operationName == null) { + if (operation !== undefined) { + return [new _GraphQLError.GraphQLError('Must provide operation name if query contains multiple operations.')]; + } + operation = definition; + } else if (((_definition$name = definition.name) === null || _definition$name === void 0 ? void 0 : _definition$name.value) === operationName) { + operation = definition; + } + break; + case _kinds.Kind.FRAGMENT_DEFINITION: + fragments[definition.name.value] = definition; + break; + default: // ignore non-executable definitions + } } -})); -Object.defineProperty(exports, "assertInputObjectType", ({ - enumerable: true, - get: function () { - return _definition.assertInputObjectType; + if (!operation) { + if (operationName != null) { + return [new _GraphQLError.GraphQLError(`Unknown operation named "${operationName}".`)]; + } + return [new _GraphQLError.GraphQLError('Must provide an operation.')]; + } // FIXME: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + + const variableDefinitions = (_operation$variableDe = operation.variableDefinitions) !== null && _operation$variableDe !== void 0 ? _operation$variableDe : []; + const coercedVariableValues = (0, _values.getVariableValues)(schema, variableDefinitions, rawVariableValues !== null && rawVariableValues !== void 0 ? rawVariableValues : {}, { + maxErrors: 50 + }); + if (coercedVariableValues.errors) { + return coercedVariableValues.errors; } -})); -Object.defineProperty(exports, "assertInputType", ({ - enumerable: true, - get: function () { - return _definition.assertInputType; + return { + schema, + fragments, + rootValue, + contextValue, + operation, + variableValues: coercedVariableValues.coerced, + fieldResolver: fieldResolver !== null && fieldResolver !== void 0 ? fieldResolver : defaultFieldResolver, + typeResolver: typeResolver !== null && typeResolver !== void 0 ? typeResolver : defaultTypeResolver, + subscribeFieldResolver: subscribeFieldResolver !== null && subscribeFieldResolver !== void 0 ? subscribeFieldResolver : defaultFieldResolver, + errors: [] + }; +} +/** + * Implements the "Executing operations" section of the spec. + */ + +function executeOperation(exeContext, operation, rootValue) { + const rootType = exeContext.schema.getRootType(operation.operation); + if (rootType == null) { + throw new _GraphQLError.GraphQLError(`Schema is not configured to execute ${operation.operation} operation.`, { + nodes: operation + }); } -})); -Object.defineProperty(exports, "assertInterfaceType", ({ - enumerable: true, - get: function () { - return _definition.assertInterfaceType; + const rootFields = (0, _collectFields.collectFields)(exeContext.schema, exeContext.fragments, exeContext.variableValues, rootType, operation.selectionSet); + const path = undefined; + switch (operation.operation) { + case _ast.OperationTypeNode.QUERY: + return executeFields(exeContext, rootType, rootValue, path, rootFields); + case _ast.OperationTypeNode.MUTATION: + return executeFieldsSerially(exeContext, rootType, rootValue, path, rootFields); + case _ast.OperationTypeNode.SUBSCRIPTION: + // TODO: deprecate `subscribe` and move all logic here + // Temporary solution until we finish merging execute and subscribe together + return executeFields(exeContext, rootType, rootValue, path, rootFields); } -})); -Object.defineProperty(exports, "assertLeafType", ({ - enumerable: true, - get: function () { - return _definition.assertLeafType; +} +/** + * Implements the "Executing selection sets" section of the spec + * for fields that must be executed serially. + */ + +function executeFieldsSerially(exeContext, parentType, sourceValue, path, fields) { + return (0, _promiseReduce.promiseReduce)(fields.entries(), (results, [responseName, fieldNodes]) => { + const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name); + const result = executeField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); + if (result === undefined) { + return results; + } + if ((0, _isPromise.isPromise)(result)) { + return result.then(resolvedResult => { + results[responseName] = resolvedResult; + return results; + }); + } + results[responseName] = result; + return results; + }, Object.create(null)); +} +/** + * Implements the "Executing selection sets" section of the spec + * for fields that may be executed in parallel. + */ + +function executeFields(exeContext, parentType, sourceValue, path, fields) { + const results = Object.create(null); + let containsPromise = false; + try { + for (const [responseName, fieldNodes] of fields.entries()) { + const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name); + const result = executeField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); + if (result !== undefined) { + results[responseName] = result; + if ((0, _isPromise.isPromise)(result)) { + containsPromise = true; + } + } + } + } catch (error) { + if (containsPromise) { + // Ensure that any promises returned by other fields are handled, as they may also reject. + return (0, _promiseForObject.promiseForObject)(results).finally(() => { + throw error; + }); + } + throw error; + } // If there are no promises, we can just return the object + + if (!containsPromise) { + return results; + } // Otherwise, results is a map from field name to the result of resolving that + // field, which is possibly a promise. Return a promise that will return this + // same map, but with any promises replaced with the values they resolved to. + + return (0, _promiseForObject.promiseForObject)(results); +} +/** + * Implements the "Executing fields" section of the spec + * In particular, this function figures out the value that the field returns by + * calling its resolve function, then calls completeValue to complete promises, + * serialize scalars, or execute the sub-selection-set for objects. + */ + +function executeField(exeContext, parentType, source, fieldNodes, path) { + var _fieldDef$resolve; + const fieldDef = getFieldDef(exeContext.schema, parentType, fieldNodes[0]); + if (!fieldDef) { + return; } -})); -Object.defineProperty(exports, "assertListType", ({ - enumerable: true, - get: function () { - return _definition.assertListType; + const returnType = fieldDef.type; + const resolveFn = (_fieldDef$resolve = fieldDef.resolve) !== null && _fieldDef$resolve !== void 0 ? _fieldDef$resolve : exeContext.fieldResolver; + const info = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path); // Get the resolve function, regardless of if its result is normal or abrupt (error). + + try { + // Build a JS object of arguments from the field.arguments AST, using the + // variables scope to fulfill any variable references. + // TODO: find a way to memoize, in case this field is within a List type. + const args = (0, _values.getArgumentValues)(fieldDef, fieldNodes[0], exeContext.variableValues); // The resolve function's optional third argument is a context value that + // is provided to every resolve function within an execution. It is commonly + // used to represent an authenticated user, or request-specific caches. + + const contextValue = exeContext.contextValue; + const result = resolveFn(source, args, contextValue, info); + let completed; + if ((0, _isPromise.isPromise)(result)) { + completed = result.then(resolved => completeValue(exeContext, returnType, fieldNodes, info, path, resolved)); + } else { + completed = completeValue(exeContext, returnType, fieldNodes, info, path, result); + } + if ((0, _isPromise.isPromise)(completed)) { + // Note: we don't rely on a `catch` method, but we do expect "thenable" + // to take a second callback for the error case. + return completed.then(undefined, rawError => { + const error = (0, _locatedError.locatedError)(rawError, fieldNodes, (0, _Path.pathToArray)(path)); + return handleFieldError(error, returnType, exeContext); + }); + } + return completed; + } catch (rawError) { + const error = (0, _locatedError.locatedError)(rawError, fieldNodes, (0, _Path.pathToArray)(path)); + return handleFieldError(error, returnType, exeContext); } -})); -Object.defineProperty(exports, "assertName", ({ - enumerable: true, - get: function () { - return _assertName.assertName; +} +/** + * @internal + */ + +function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path) { + // The resolve function's optional fourth argument is a collection of + // information about the current execution state. + return { + fieldName: fieldDef.name, + fieldNodes, + returnType: fieldDef.type, + parentType, + path, + schema: exeContext.schema, + fragments: exeContext.fragments, + rootValue: exeContext.rootValue, + operation: exeContext.operation, + variableValues: exeContext.variableValues + }; +} +function handleFieldError(error, returnType, exeContext) { + // If the field type is non-nullable, then it is resolved without any + // protection from errors, however it still properly locates the error. + if ((0, _definition.isNonNullType)(returnType)) { + throw error; + } // Otherwise, error protection is applied, logging the error and resolving + // a null value for this field if one is encountered. + + exeContext.errors.push(error); + return null; +} +/** + * Implements the instructions for completeValue as defined in the + * "Value Completion" section of the spec. + * + * If the field type is Non-Null, then this recursively completes the value + * for the inner type. It throws a field error if that completion returns null, + * as per the "Nullability" section of the spec. + * + * If the field type is a List, then this recursively completes the value + * for the inner type on each item in the list. + * + * If the field type is a Scalar or Enum, ensures the completed value is a legal + * value of the type by calling the `serialize` method of GraphQL type + * definition. + * + * If the field is an abstract type, determine the runtime type of the value + * and then complete based on that type + * + * Otherwise, the field type expects a sub-selection set, and will complete the + * value by executing all sub-selections. + */ + +function completeValue(exeContext, returnType, fieldNodes, info, path, result) { + // If result is an Error, throw a located error. + if (result instanceof Error) { + throw result; + } // If field type is NonNull, complete for inner type, and throw field error + // if result is null. + + if ((0, _definition.isNonNullType)(returnType)) { + const completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result); + if (completed === null) { + throw new Error(`Cannot return null for non-nullable field ${info.parentType.name}.${info.fieldName}.`); + } + return completed; + } // If result value is null or undefined then return null. + + if (result == null) { + return null; + } // If field type is List, complete each item in the list with the inner type + + if ((0, _definition.isListType)(returnType)) { + return completeListValue(exeContext, returnType, fieldNodes, info, path, result); + } // If field type is a leaf type, Scalar or Enum, serialize to a valid value, + // returning null if serialization is not possible. + + if ((0, _definition.isLeafType)(returnType)) { + return completeLeafValue(returnType, result); + } // If field type is an abstract type, Interface or Union, determine the + // runtime Object type and complete for that type. + + if ((0, _definition.isAbstractType)(returnType)) { + return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result); + } // If field type is Object, execute and complete all sub-selections. + + if ((0, _definition.isObjectType)(returnType)) { + return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result); } -})); -Object.defineProperty(exports, "assertNamedType", ({ - enumerable: true, - get: function () { - return _definition.assertNamedType; - } -})); -Object.defineProperty(exports, "assertNonNullType", ({ - enumerable: true, - get: function () { - return _definition.assertNonNullType; - } -})); -Object.defineProperty(exports, "assertNullableType", ({ - enumerable: true, - get: function () { - return _definition.assertNullableType; - } -})); -Object.defineProperty(exports, "assertObjectType", ({ - enumerable: true, - get: function () { - return _definition.assertObjectType; - } -})); -Object.defineProperty(exports, "assertOutputType", ({ - enumerable: true, - get: function () { - return _definition.assertOutputType; - } -})); -Object.defineProperty(exports, "assertScalarType", ({ - enumerable: true, - get: function () { - return _definition.assertScalarType; - } -})); -Object.defineProperty(exports, "assertSchema", ({ - enumerable: true, - get: function () { - return _schema.assertSchema; - } -})); -Object.defineProperty(exports, "assertType", ({ - enumerable: true, - get: function () { - return _definition.assertType; - } -})); -Object.defineProperty(exports, "assertUnionType", ({ - enumerable: true, - get: function () { - return _definition.assertUnionType; - } -})); -Object.defineProperty(exports, "assertValidSchema", ({ - enumerable: true, - get: function () { - return _validate.assertValidSchema; - } -})); -Object.defineProperty(exports, "assertWrappingType", ({ - enumerable: true, - get: function () { - return _definition.assertWrappingType; - } -})); -Object.defineProperty(exports, "getNamedType", ({ - enumerable: true, - get: function () { - return _definition.getNamedType; - } -})); -Object.defineProperty(exports, "getNullableType", ({ - enumerable: true, - get: function () { - return _definition.getNullableType; - } -})); -Object.defineProperty(exports, "introspectionTypes", ({ - enumerable: true, - get: function () { - return _introspection.introspectionTypes; - } -})); -Object.defineProperty(exports, "isAbstractType", ({ - enumerable: true, - get: function () { - return _definition.isAbstractType; - } -})); -Object.defineProperty(exports, "isCompositeType", ({ - enumerable: true, - get: function () { - return _definition.isCompositeType; - } -})); -Object.defineProperty(exports, "isDirective", ({ - enumerable: true, - get: function () { - return _directives.isDirective; - } -})); -Object.defineProperty(exports, "isEnumType", ({ - enumerable: true, - get: function () { - return _definition.isEnumType; - } -})); -Object.defineProperty(exports, "isInputObjectType", ({ - enumerable: true, - get: function () { - return _definition.isInputObjectType; - } -})); -Object.defineProperty(exports, "isInputType", ({ - enumerable: true, - get: function () { - return _definition.isInputType; - } -})); -Object.defineProperty(exports, "isInterfaceType", ({ - enumerable: true, - get: function () { - return _definition.isInterfaceType; - } -})); -Object.defineProperty(exports, "isIntrospectionType", ({ - enumerable: true, - get: function () { - return _introspection.isIntrospectionType; + /* c8 ignore next 6 */ + // Not reachable, all possible output types have been considered. + + false || (0, _invariant.invariant)(false, 'Cannot complete value of unexpected output type: ' + (0, _inspect.inspect)(returnType)); +} +/** + * Complete a list value by completing each item in the list with the + * inner type + */ + +function completeListValue(exeContext, returnType, fieldNodes, info, path, result) { + if (!(0, _isIterableObject.isIterableObject)(result)) { + throw new _GraphQLError.GraphQLError(`Expected Iterable, but did not find one for field "${info.parentType.name}.${info.fieldName}".`); + } // This is specified as a simple map, however we're optimizing the path + // where the list contains no Promises by avoiding creating another Promise. + + const itemType = returnType.ofType; + let containsPromise = false; + const completedResults = Array.from(result, (item, index) => { + // No need to modify the info object containing the path, + // since from here on it is not ever accessed by resolver functions. + const itemPath = (0, _Path.addPath)(path, index, undefined); + try { + let completedItem; + if ((0, _isPromise.isPromise)(item)) { + completedItem = item.then(resolved => completeValue(exeContext, itemType, fieldNodes, info, itemPath, resolved)); + } else { + completedItem = completeValue(exeContext, itemType, fieldNodes, info, itemPath, item); + } + if ((0, _isPromise.isPromise)(completedItem)) { + containsPromise = true; // Note: we don't rely on a `catch` method, but we do expect "thenable" + // to take a second callback for the error case. + + return completedItem.then(undefined, rawError => { + const error = (0, _locatedError.locatedError)(rawError, fieldNodes, (0, _Path.pathToArray)(itemPath)); + return handleFieldError(error, itemType, exeContext); + }); + } + return completedItem; + } catch (rawError) { + const error = (0, _locatedError.locatedError)(rawError, fieldNodes, (0, _Path.pathToArray)(itemPath)); + return handleFieldError(error, itemType, exeContext); + } + }); + return containsPromise ? Promise.all(completedResults) : completedResults; +} +/** + * Complete a Scalar or Enum by serializing to a valid value, returning + * null if serialization is not possible. + */ + +function completeLeafValue(returnType, result) { + const serializedResult = returnType.serialize(result); + if (serializedResult == null) { + throw new Error(`Expected \`${(0, _inspect.inspect)(returnType)}.serialize(${(0, _inspect.inspect)(result)})\` to ` + `return non-nullable value, returned: ${(0, _inspect.inspect)(serializedResult)}`); } -})); -Object.defineProperty(exports, "isLeafType", ({ - enumerable: true, - get: function () { - return _definition.isLeafType; + return serializedResult; +} +/** + * Complete a value of an abstract type by determining the runtime object type + * of that value, then complete the value for that type. + */ + +function completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result) { + var _returnType$resolveTy; + const resolveTypeFn = (_returnType$resolveTy = returnType.resolveType) !== null && _returnType$resolveTy !== void 0 ? _returnType$resolveTy : exeContext.typeResolver; + const contextValue = exeContext.contextValue; + const runtimeType = resolveTypeFn(result, contextValue, info, returnType); + if ((0, _isPromise.isPromise)(runtimeType)) { + return runtimeType.then(resolvedRuntimeType => completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result)); } -})); -Object.defineProperty(exports, "isListType", ({ - enumerable: true, - get: function () { - return _definition.isListType; + return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result); +} +function ensureValidRuntimeType(runtimeTypeName, exeContext, returnType, fieldNodes, info, result) { + if (runtimeTypeName == null) { + throw new _GraphQLError.GraphQLError(`Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}". Either the "${returnType.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, fieldNodes); + } // releases before 16.0.0 supported returning `GraphQLObjectType` from `resolveType` + // TODO: remove in 17.0.0 release + + if ((0, _definition.isObjectType)(runtimeTypeName)) { + throw new _GraphQLError.GraphQLError('Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.'); } -})); -Object.defineProperty(exports, "isNamedType", ({ - enumerable: true, - get: function () { - return _definition.isNamedType; + if (typeof runtimeTypeName !== 'string') { + throw new _GraphQLError.GraphQLError(`Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}" with ` + `value ${(0, _inspect.inspect)(result)}, received "${(0, _inspect.inspect)(runtimeTypeName)}".`); } -})); -Object.defineProperty(exports, "isNonNullType", ({ - enumerable: true, - get: function () { - return _definition.isNonNullType; + const runtimeType = exeContext.schema.getType(runtimeTypeName); + if (runtimeType == null) { + throw new _GraphQLError.GraphQLError(`Abstract type "${returnType.name}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, { + nodes: fieldNodes + }); } -})); -Object.defineProperty(exports, "isNullableType", ({ - enumerable: true, - get: function () { - return _definition.isNullableType; + if (!(0, _definition.isObjectType)(runtimeType)) { + throw new _GraphQLError.GraphQLError(`Abstract type "${returnType.name}" was resolved to a non-object type "${runtimeTypeName}".`, { + nodes: fieldNodes + }); } -})); -Object.defineProperty(exports, "isObjectType", ({ - enumerable: true, - get: function () { - return _definition.isObjectType; + if (!exeContext.schema.isSubType(returnType, runtimeType)) { + throw new _GraphQLError.GraphQLError(`Runtime Object type "${runtimeType.name}" is not a possible type for "${returnType.name}".`, { + nodes: fieldNodes + }); } -})); -Object.defineProperty(exports, "isOutputType", ({ - enumerable: true, - get: function () { - return _definition.isOutputType; + return runtimeType; +} +/** + * Complete an Object value by executing all sub-selections. + */ + +function completeObjectValue(exeContext, returnType, fieldNodes, info, path, result) { + // Collect sub-fields to execute to complete this value. + const subFieldNodes = collectSubfields(exeContext, returnType, fieldNodes); // If there is an isTypeOf predicate function, call it with the + // current result. If isTypeOf returns false, then raise an error rather + // than continuing execution. + + if (returnType.isTypeOf) { + const isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info); + if ((0, _isPromise.isPromise)(isTypeOf)) { + return isTypeOf.then(resolvedIsTypeOf => { + if (!resolvedIsTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } + return executeFields(exeContext, returnType, result, path, subFieldNodes); + }); + } + if (!isTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } } -})); -Object.defineProperty(exports, "isRequiredArgument", ({ - enumerable: true, - get: function () { - return _definition.isRequiredArgument; + return executeFields(exeContext, returnType, result, path, subFieldNodes); +} +function invalidReturnTypeError(returnType, result, fieldNodes) { + return new _GraphQLError.GraphQLError(`Expected value of type "${returnType.name}" but got: ${(0, _inspect.inspect)(result)}.`, { + nodes: fieldNodes + }); +} +/** + * If a resolveType function is not given, then a default resolve behavior is + * used which attempts two strategies: + * + * First, See if the provided value has a `__typename` field defined, if so, use + * that value as name of the resolved type. + * + * Otherwise, test each possible type for the abstract type by calling + * isTypeOf for the object being coerced, returning the first type that matches. + */ + +const defaultTypeResolver = function (value, contextValue, info, abstractType) { + // First, look for `__typename`. + if ((0, _isObjectLike.isObjectLike)(value) && typeof value.__typename === 'string') { + return value.__typename; + } // Otherwise, test each possible type. + + const possibleTypes = info.schema.getPossibleTypes(abstractType); + const promisedIsTypeOfResults = []; + for (let i = 0; i < possibleTypes.length; i++) { + const type = possibleTypes[i]; + if (type.isTypeOf) { + const isTypeOfResult = type.isTypeOf(value, contextValue, info); + if ((0, _isPromise.isPromise)(isTypeOfResult)) { + promisedIsTypeOfResults[i] = isTypeOfResult; + } else if (isTypeOfResult) { + return type.name; + } + } } -})); -Object.defineProperty(exports, "isRequiredInputField", ({ - enumerable: true, - get: function () { - return _definition.isRequiredInputField; + if (promisedIsTypeOfResults.length) { + return Promise.all(promisedIsTypeOfResults).then(isTypeOfResults => { + for (let i = 0; i < isTypeOfResults.length; i++) { + if (isTypeOfResults[i]) { + return possibleTypes[i].name; + } + } + }); } -})); -Object.defineProperty(exports, "isScalarType", ({ - enumerable: true, - get: function () { - return _definition.isScalarType; +}; +/** + * If a resolve function is not given, then a default resolve behavior is used + * which takes the property of the source object of the same name as the field + * and returns it as the result, or if it's a function, returns the result + * of calling that function while passing along args and context value. + */ +exports.defaultTypeResolver = defaultTypeResolver; +const defaultFieldResolver = function (source, args, contextValue, info) { + // ensure source is a value for which property access is acceptable. + if ((0, _isObjectLike.isObjectLike)(source) || typeof source === 'function') { + const property = source[info.fieldName]; + if (typeof property === 'function') { + return source[info.fieldName](args, contextValue, info); + } + return property; } -})); -Object.defineProperty(exports, "isSchema", ({ - enumerable: true, - get: function () { - return _schema.isSchema; +}; +/** + * This method looks up the field on the given type definition. + * It has special casing for the three introspection fields, + * __schema, __type and __typename. __typename is special because + * it can always be queried as a field, even in situations where no + * other fields are allowed, like on a Union. __schema and __type + * could get automatically added to the query type, but that would + * require mutating type definitions, which would cause issues. + * + * @internal + */ +exports.defaultFieldResolver = defaultFieldResolver; +function getFieldDef(schema, parentType, fieldNode) { + const fieldName = fieldNode.name.value; + if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { + return _introspection.SchemaMetaFieldDef; + } else if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) { + return _introspection.TypeMetaFieldDef; + } else if (fieldName === _introspection.TypeNameMetaFieldDef.name) { + return _introspection.TypeNameMetaFieldDef; } + return parentType.getFields()[fieldName]; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/execution/index.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/execution/index.mjs ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "isSpecifiedDirective", ({ +Object.defineProperty(exports, "createSourceEventStream", ({ enumerable: true, get: function () { - return _directives.isSpecifiedDirective; + return _subscribe.createSourceEventStream; } })); -Object.defineProperty(exports, "isSpecifiedScalarType", ({ +Object.defineProperty(exports, "defaultFieldResolver", ({ enumerable: true, get: function () { - return _scalars.isSpecifiedScalarType; + return _execute.defaultFieldResolver; } })); -Object.defineProperty(exports, "isType", ({ +Object.defineProperty(exports, "defaultTypeResolver", ({ enumerable: true, get: function () { - return _definition.isType; + return _execute.defaultTypeResolver; } })); -Object.defineProperty(exports, "isUnionType", ({ +Object.defineProperty(exports, "execute", ({ enumerable: true, get: function () { - return _definition.isUnionType; + return _execute.execute; } })); -Object.defineProperty(exports, "isWrappingType", ({ +Object.defineProperty(exports, "executeSync", ({ enumerable: true, get: function () { - return _definition.isWrappingType; + return _execute.executeSync; } })); -Object.defineProperty(exports, "resolveObjMapThunk", ({ +Object.defineProperty(exports, "getArgumentValues", ({ enumerable: true, get: function () { - return _definition.resolveObjMapThunk; + return _values.getArgumentValues; } })); -Object.defineProperty(exports, "resolveReadonlyArrayThunk", ({ +Object.defineProperty(exports, "getDirectiveValues", ({ enumerable: true, get: function () { - return _definition.resolveReadonlyArrayThunk; + return _values.getDirectiveValues; } })); -Object.defineProperty(exports, "specifiedDirectives", ({ +Object.defineProperty(exports, "getVariableValues", ({ enumerable: true, get: function () { - return _directives.specifiedDirectives; + return _values.getVariableValues; } })); -Object.defineProperty(exports, "specifiedScalarTypes", ({ +Object.defineProperty(exports, "responsePathAsArray", ({ enumerable: true, get: function () { - return _scalars.specifiedScalarTypes; + return _Path.pathToArray; } })); -Object.defineProperty(exports, "validateSchema", ({ +Object.defineProperty(exports, "subscribe", ({ enumerable: true, get: function () { - return _validate.validateSchema; + return _subscribe.subscribe; } })); -var _schema = __webpack_require__(/*! ./schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); -var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _directives = __webpack_require__(/*! ./directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -var _scalars = __webpack_require__(/*! ./scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -var _introspection = __webpack_require__(/*! ./introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -var _validate = __webpack_require__(/*! ./validate.mjs */ "../../../node_modules/graphql/type/validate.mjs"); -var _assertName = __webpack_require__(/*! ./assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); +var _Path = __webpack_require__(/*! ../jsutils/Path.mjs */ "../../../node_modules/graphql/jsutils/Path.mjs"); +var _execute = __webpack_require__(/*! ./execute.mjs */ "../../../node_modules/graphql/execution/execute.mjs"); +var _subscribe = __webpack_require__(/*! ./subscribe.mjs */ "../../../node_modules/graphql/execution/subscribe.mjs"); +var _values = __webpack_require__(/*! ./values.mjs */ "../../../node_modules/graphql/execution/values.mjs"); /***/ }), -/***/ "../../../node_modules/graphql/type/introspection.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/type/introspection.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/execution/mapAsyncIterator.mjs": +/*!********************************************************************!*\ + !*** ../../../node_modules/graphql/execution/mapAsyncIterator.mjs ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.introspectionTypes = exports.__TypeKind = exports.__Type = exports.__Schema = exports.__InputValue = exports.__Field = exports.__EnumValue = exports.__DirectiveLocation = exports.__Directive = exports.TypeNameMetaFieldDef = exports.TypeMetaFieldDef = exports.TypeKind = exports.SchemaMetaFieldDef = void 0; -exports.isIntrospectionType = isIntrospectionType; -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _directiveLocation = __webpack_require__(/*! ../language/directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); -var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _astFromValue = __webpack_require__(/*! ../utilities/astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); -var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _scalars = __webpack_require__(/*! ./scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -const __Schema = exports.__Schema = new _definition.GraphQLObjectType({ - name: '__Schema', - description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', - fields: () => ({ - description: { - type: _scalars.GraphQLString, - resolve: schema => schema.description - }, - types: { - description: 'A list of all types supported by this server.', - type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type))), - resolve(schema) { - return Object.values(schema.getTypeMap()); +exports.mapAsyncIterator = mapAsyncIterator; +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + */ +function mapAsyncIterator(iterable, callback) { + const iterator = iterable[Symbol.asyncIterator](); + async function mapResult(result) { + if (result.done) { + return result; + } + try { + return { + value: await callback(result.value), + done: false + }; + } catch (error) { + /* c8 ignore start */ + // FIXME: add test case + if (typeof iterator.return === 'function') { + try { + await iterator.return(); + } catch (_e) { + /* ignore error */ + } } - }, - queryType: { - description: 'The type that query operations will be rooted at.', - type: new _definition.GraphQLNonNull(__Type), - resolve: schema => schema.getQueryType() - }, - mutationType: { - description: 'If this server supports mutation, the type that mutation operations will be rooted at.', - type: __Type, - resolve: schema => schema.getMutationType() - }, - subscriptionType: { - description: 'If this server support subscription, the type that subscription operations will be rooted at.', - type: __Type, - resolve: schema => schema.getSubscriptionType() - }, - directives: { - description: 'A list of all directives supported by this server.', - type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Directive))), - resolve: schema => schema.getDirectives() - } - }) -}); -const __Directive = exports.__Directive = new _definition.GraphQLObjectType({ - name: '__Directive', - description: "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - fields: () => ({ - name: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - resolve: directive => directive.name - }, - description: { - type: _scalars.GraphQLString, - resolve: directive => directive.description - }, - isRepeatable: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - resolve: directive => directive.isRepeatable - }, - locations: { - type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__DirectiveLocation))), - resolve: directive => directive.locations - }, - args: { - type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))), - args: { - includeDeprecated: { - type: _scalars.GraphQLBoolean, - defaultValue: false - } - }, - resolve(field, { - includeDeprecated - }) { - return includeDeprecated ? field.args : field.args.filter(arg => arg.deprecationReason == null); - } - } - }) -}); -const __DirectiveLocation = exports.__DirectiveLocation = new _definition.GraphQLEnumType({ - name: '__DirectiveLocation', - description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', - values: { - QUERY: { - value: _directiveLocation.DirectiveLocation.QUERY, - description: 'Location adjacent to a query operation.' - }, - MUTATION: { - value: _directiveLocation.DirectiveLocation.MUTATION, - description: 'Location adjacent to a mutation operation.' - }, - SUBSCRIPTION: { - value: _directiveLocation.DirectiveLocation.SUBSCRIPTION, - description: 'Location adjacent to a subscription operation.' - }, - FIELD: { - value: _directiveLocation.DirectiveLocation.FIELD, - description: 'Location adjacent to a field.' - }, - FRAGMENT_DEFINITION: { - value: _directiveLocation.DirectiveLocation.FRAGMENT_DEFINITION, - description: 'Location adjacent to a fragment definition.' - }, - FRAGMENT_SPREAD: { - value: _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, - description: 'Location adjacent to a fragment spread.' - }, - INLINE_FRAGMENT: { - value: _directiveLocation.DirectiveLocation.INLINE_FRAGMENT, - description: 'Location adjacent to an inline fragment.' - }, - VARIABLE_DEFINITION: { - value: _directiveLocation.DirectiveLocation.VARIABLE_DEFINITION, - description: 'Location adjacent to a variable definition.' - }, - SCHEMA: { - value: _directiveLocation.DirectiveLocation.SCHEMA, - description: 'Location adjacent to a schema definition.' - }, - SCALAR: { - value: _directiveLocation.DirectiveLocation.SCALAR, - description: 'Location adjacent to a scalar definition.' - }, - OBJECT: { - value: _directiveLocation.DirectiveLocation.OBJECT, - description: 'Location adjacent to an object type definition.' - }, - FIELD_DEFINITION: { - value: _directiveLocation.DirectiveLocation.FIELD_DEFINITION, - description: 'Location adjacent to a field definition.' - }, - ARGUMENT_DEFINITION: { - value: _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION, - description: 'Location adjacent to an argument definition.' - }, - INTERFACE: { - value: _directiveLocation.DirectiveLocation.INTERFACE, - description: 'Location adjacent to an interface definition.' - }, - UNION: { - value: _directiveLocation.DirectiveLocation.UNION, - description: 'Location adjacent to a union definition.' - }, - ENUM: { - value: _directiveLocation.DirectiveLocation.ENUM, - description: 'Location adjacent to an enum definition.' - }, - ENUM_VALUE: { - value: _directiveLocation.DirectiveLocation.ENUM_VALUE, - description: 'Location adjacent to an enum value definition.' - }, - INPUT_OBJECT: { - value: _directiveLocation.DirectiveLocation.INPUT_OBJECT, - description: 'Location adjacent to an input object type definition.' - }, - INPUT_FIELD_DEFINITION: { - value: _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION, - description: 'Location adjacent to an input object field definition.' + throw error; + /* c8 ignore stop */ } } -}); -const __Type = exports.__Type = new _definition.GraphQLObjectType({ - name: '__Type', - description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', - fields: () => ({ - kind: { - type: new _definition.GraphQLNonNull(__TypeKind), - resolve(type) { - if ((0, _definition.isScalarType)(type)) { - return TypeKind.SCALAR; - } - if ((0, _definition.isObjectType)(type)) { - return TypeKind.OBJECT; - } - if ((0, _definition.isInterfaceType)(type)) { - return TypeKind.INTERFACE; - } - if ((0, _definition.isUnionType)(type)) { - return TypeKind.UNION; - } - if ((0, _definition.isEnumType)(type)) { - return TypeKind.ENUM; - } - if ((0, _definition.isInputObjectType)(type)) { - return TypeKind.INPUT_OBJECT; - } - if ((0, _definition.isListType)(type)) { - return TypeKind.LIST; - } - if ((0, _definition.isNonNullType)(type)) { - return TypeKind.NON_NULL; - } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered) - - false || (0, _invariant.invariant)(false, `Unexpected type: "${(0, _inspect.inspect)(type)}".`); - } - }, - name: { - type: _scalars.GraphQLString, - resolve: type => 'name' in type ? type.name : undefined - }, - description: { - type: _scalars.GraphQLString, - resolve: (type // FIXME: add test case - ) => /* c8 ignore next */ - 'description' in type ? type.description : undefined - }, - specifiedByURL: { - type: _scalars.GraphQLString, - resolve: obj => 'specifiedByURL' in obj ? obj.specifiedByURL : undefined - }, - fields: { - type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Field)), - args: { - includeDeprecated: { - type: _scalars.GraphQLBoolean, - defaultValue: false - } - }, - resolve(type, { - includeDeprecated - }) { - if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { - const fields = Object.values(type.getFields()); - return includeDeprecated ? fields : fields.filter(field => field.deprecationReason == null); - } - } - }, - interfaces: { - type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)), - resolve(type) { - if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { - return type.getInterfaces(); - } - } - }, - possibleTypes: { - type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)), - resolve(type, _args, _context, { - schema - }) { - if ((0, _definition.isAbstractType)(type)) { - return schema.getPossibleTypes(type); - } - } - }, - enumValues: { - type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__EnumValue)), - args: { - includeDeprecated: { - type: _scalars.GraphQLBoolean, - defaultValue: false - } - }, - resolve(type, { - includeDeprecated - }) { - if ((0, _definition.isEnumType)(type)) { - const values = type.getValues(); - return includeDeprecated ? values : values.filter(field => field.deprecationReason == null); - } - } - }, - inputFields: { - type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue)), - args: { - includeDeprecated: { - type: _scalars.GraphQLBoolean, - defaultValue: false - } - }, - resolve(type, { - includeDeprecated - }) { - if ((0, _definition.isInputObjectType)(type)) { - const values = Object.values(type.getFields()); - return includeDeprecated ? values : values.filter(field => field.deprecationReason == null); - } - } - }, - ofType: { - type: __Type, - resolve: type => 'ofType' in type ? type.ofType : undefined - }, - isOneOf: { - type: _scalars.GraphQLBoolean, - resolve: type => { - if ((0, _definition.isInputObjectType)(type)) { - return type.isOneOf; - } - } - } - }) -}); -const __Field = exports.__Field = new _definition.GraphQLObjectType({ - name: '__Field', - description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', - fields: () => ({ - name: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - resolve: field => field.name - }, - description: { - type: _scalars.GraphQLString, - resolve: field => field.description - }, - args: { - type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))), - args: { - includeDeprecated: { - type: _scalars.GraphQLBoolean, - defaultValue: false - } - }, - resolve(field, { - includeDeprecated - }) { - return includeDeprecated ? field.args : field.args.filter(arg => arg.deprecationReason == null); - } - }, - type: { - type: new _definition.GraphQLNonNull(__Type), - resolve: field => field.type - }, - isDeprecated: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - resolve: field => field.deprecationReason != null - }, - deprecationReason: { - type: _scalars.GraphQLString, - resolve: field => field.deprecationReason - } - }) -}); -const __InputValue = exports.__InputValue = new _definition.GraphQLObjectType({ - name: '__InputValue', - description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', - fields: () => ({ - name: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - resolve: inputValue => inputValue.name - }, - description: { - type: _scalars.GraphQLString, - resolve: inputValue => inputValue.description + return { + async next() { + return mapResult(await iterator.next()); }, - type: { - type: new _definition.GraphQLNonNull(__Type), - resolve: inputValue => inputValue.type + async return() { + // If iterator.return() does not exist, then type R must be undefined. + return typeof iterator.return === 'function' ? mapResult(await iterator.return()) : { + value: undefined, + done: true + }; }, - defaultValue: { - type: _scalars.GraphQLString, - description: 'A GraphQL-formatted string representing the default value for this input value.', - resolve(inputValue) { - const { - type, - defaultValue - } = inputValue; - const valueAST = (0, _astFromValue.astFromValue)(defaultValue, type); - return valueAST ? (0, _printer.print)(valueAST) : null; + async throw(error) { + if (typeof iterator.throw === 'function') { + return mapResult(await iterator.throw(error)); } + throw error; }, - isDeprecated: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - resolve: field => field.deprecationReason != null - }, - deprecationReason: { - type: _scalars.GraphQLString, - resolve: obj => obj.deprecationReason - } - }) -}); -const __EnumValue = exports.__EnumValue = new _definition.GraphQLObjectType({ - name: '__EnumValue', - description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', - fields: () => ({ - name: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - resolve: enumValue => enumValue.name - }, - description: { - type: _scalars.GraphQLString, - resolve: enumValue => enumValue.description - }, - isDeprecated: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - resolve: enumValue => enumValue.deprecationReason != null - }, - deprecationReason: { - type: _scalars.GraphQLString, - resolve: enumValue => enumValue.deprecationReason - } - }) -}); -var TypeKind; -(function (TypeKind) { - TypeKind['SCALAR'] = 'SCALAR'; - TypeKind['OBJECT'] = 'OBJECT'; - TypeKind['INTERFACE'] = 'INTERFACE'; - TypeKind['UNION'] = 'UNION'; - TypeKind['ENUM'] = 'ENUM'; - TypeKind['INPUT_OBJECT'] = 'INPUT_OBJECT'; - TypeKind['LIST'] = 'LIST'; - TypeKind['NON_NULL'] = 'NON_NULL'; -})(TypeKind || (exports.TypeKind = TypeKind = {})); -const __TypeKind = exports.__TypeKind = new _definition.GraphQLEnumType({ - name: '__TypeKind', - description: 'An enum describing what kind of type a given `__Type` is.', - values: { - SCALAR: { - value: TypeKind.SCALAR, - description: 'Indicates this type is a scalar.' - }, - OBJECT: { - value: TypeKind.OBJECT, - description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.' - }, - INTERFACE: { - value: TypeKind.INTERFACE, - description: 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.' - }, - UNION: { - value: TypeKind.UNION, - description: 'Indicates this type is a union. `possibleTypes` is a valid field.' - }, - ENUM: { - value: TypeKind.ENUM, - description: 'Indicates this type is an enum. `enumValues` is a valid field.' - }, - INPUT_OBJECT: { - value: TypeKind.INPUT_OBJECT, - description: 'Indicates this type is an input object. `inputFields` is a valid field.' - }, - LIST: { - value: TypeKind.LIST, - description: 'Indicates this type is a list. `ofType` is a valid field.' - }, - NON_NULL: { - value: TypeKind.NON_NULL, - description: 'Indicates this type is a non-null. `ofType` is a valid field.' + [Symbol.asyncIterator]() { + return this; } - } -}); -/** - * Note that these are GraphQLField and not GraphQLFieldConfig, - * so the format for args is different. - */ - -const SchemaMetaFieldDef = exports.SchemaMetaFieldDef = { - name: '__schema', - type: new _definition.GraphQLNonNull(__Schema), - description: 'Access the current type schema of this server.', - args: [], - resolve: (_source, _args, _context, { - schema - }) => schema, - deprecationReason: undefined, - extensions: Object.create(null), - astNode: undefined -}; -const TypeMetaFieldDef = exports.TypeMetaFieldDef = { - name: '__type', - type: __Type, - description: 'Request the type information of a single type.', - args: [{ - name: 'name', - description: undefined, - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - defaultValue: undefined, - deprecationReason: undefined, - extensions: Object.create(null), - astNode: undefined - }], - resolve: (_source, { - name - }, _context, { - schema - }) => schema.getType(name), - deprecationReason: undefined, - extensions: Object.create(null), - astNode: undefined -}; -const TypeNameMetaFieldDef = exports.TypeNameMetaFieldDef = { - name: '__typename', - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - description: 'The name of the current Object type at runtime.', - args: [], - resolve: (_source, _args, _context, { - parentType - }) => parentType.name, - deprecationReason: undefined, - extensions: Object.create(null), - astNode: undefined -}; -const introspectionTypes = exports.introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]); -function isIntrospectionType(type) { - return introspectionTypes.some(({ - name - }) => type.name === name); + }; } /***/ }), -/***/ "../../../node_modules/graphql/type/scalars.mjs": -/*!******************************************************!*\ - !*** ../../../node_modules/graphql/type/scalars.mjs ***! - \******************************************************/ +/***/ "../../../node_modules/graphql/execution/subscribe.mjs": +/*!*************************************************************!*\ + !*** ../../../node_modules/graphql/execution/subscribe.mjs ***! + \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GraphQLString = exports.GraphQLInt = exports.GraphQLID = exports.GraphQLFloat = exports.GraphQLBoolean = exports.GRAPHQL_MIN_INT = exports.GRAPHQL_MAX_INT = void 0; -exports.isSpecifiedScalarType = isSpecifiedScalarType; -exports.specifiedScalarTypes = void 0; +exports.createSourceEventStream = createSourceEventStream; +exports.subscribe = subscribe; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _isAsyncIterable = __webpack_require__(/*! ../jsutils/isAsyncIterable.mjs */ "../../../node_modules/graphql/jsutils/isAsyncIterable.mjs"); +var _Path = __webpack_require__(/*! ../jsutils/Path.mjs */ "../../../node_modules/graphql/jsutils/Path.mjs"); var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/** - * Maximum possible Int value as per GraphQL Spec (32-bit signed integer). - * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1 - * */ - -const GRAPHQL_MAX_INT = exports.GRAPHQL_MAX_INT = 2147483647; +var _locatedError = __webpack_require__(/*! ../error/locatedError.mjs */ "../../../node_modules/graphql/error/locatedError.mjs"); +var _collectFields = __webpack_require__(/*! ./collectFields.mjs */ "../../../node_modules/graphql/execution/collectFields.mjs"); +var _execute = __webpack_require__(/*! ./execute.mjs */ "../../../node_modules/graphql/execution/execute.mjs"); +var _mapAsyncIterator = __webpack_require__(/*! ./mapAsyncIterator.mjs */ "../../../node_modules/graphql/execution/mapAsyncIterator.mjs"); +var _values = __webpack_require__(/*! ./values.mjs */ "../../../node_modules/graphql/execution/values.mjs"); /** - * Minimum possible Int value as per GraphQL Spec (32-bit signed integer). - * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1) - * */ + * Implements the "Subscribe" algorithm described in the GraphQL specification. + * + * Returns a Promise which resolves to either an AsyncIterator (if successful) + * or an ExecutionResult (error). The promise will be rejected if the schema or + * other arguments to this function are invalid, or if the resolved event stream + * is not an async iterable. + * + * If the client-provided arguments to this function do not result in a + * compliant subscription, a GraphQL Response (ExecutionResult) with + * descriptive errors and no data will be returned. + * + * If the source stream could not be created due to faulty subscription + * resolver logic or underlying systems, the promise will resolve to a single + * ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the promise resolves to an AsyncIterator, which + * yields a stream of ExecutionResults representing the response stream. + * + * Accepts either an object with named arguments, or individual arguments. + */ -const GRAPHQL_MIN_INT = exports.GRAPHQL_MIN_INT = -2147483648; -const GraphQLInt = exports.GraphQLInt = new _definition.GraphQLScalarType({ - name: 'Int', - description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - let num = coercedValue; - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - if (typeof num !== 'number' || !Number.isInteger(num)) { - throw new _GraphQLError.GraphQLError(`Int cannot represent non-integer value: ${(0, _inspect.inspect)(coercedValue)}`); - } - if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { - throw new _GraphQLError.GraphQLError('Int cannot represent non 32-bit signed integer value: ' + (0, _inspect.inspect)(coercedValue)); - } - return num; - }, - parseValue(inputValue) { - if (typeof inputValue !== 'number' || !Number.isInteger(inputValue)) { - throw new _GraphQLError.GraphQLError(`Int cannot represent non-integer value: ${(0, _inspect.inspect)(inputValue)}`); - } - if (inputValue > GRAPHQL_MAX_INT || inputValue < GRAPHQL_MIN_INT) { - throw new _GraphQLError.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${inputValue}`); - } - return inputValue; - }, - parseLiteral(valueNode) { - if (valueNode.kind !== _kinds.Kind.INT) { - throw new _GraphQLError.GraphQLError(`Int cannot represent non-integer value: ${(0, _printer.print)(valueNode)}`, { - nodes: valueNode - }); - } - const num = parseInt(valueNode.value, 10); - if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { - throw new _GraphQLError.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, { - nodes: valueNode - }); - } - return num; +async function subscribe(args) { + // Temporary for v15 to v16 migration. Remove in v17 + arguments.length < 2 || (0, _devAssert.devAssert)(false, 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.'); + const resultOrStream = await createSourceEventStream(args); + if (!(0, _isAsyncIterable.isAsyncIterable)(resultOrStream)) { + return resultOrStream; + } // For each payload yielded from a subscription, map it over the normal + // GraphQL `execute` function, with `payload` as the rootValue. + // This implements the "MapSourceToResponseEvent" algorithm described in + // the GraphQL specification. The `execute` function provides the + // "ExecuteSubscriptionEvent" algorithm, as it is nearly identical to the + // "ExecuteQuery" algorithm, for which `execute` is also used. + + const mapSourceToResponse = payload => (0, _execute.execute)({ + ...args, + rootValue: payload + }); // Map every source value to a ExecutionResult value as described above. + + return (0, _mapAsyncIterator.mapAsyncIterator)(resultOrStream, mapSourceToResponse); +} +function toNormalizedArgs(args) { + const firstArg = args[0]; + if (firstArg && 'document' in firstArg) { + return firstArg; } -}); -const GraphQLFloat = exports.GraphQLFloat = new _definition.GraphQLScalarType({ - name: 'Float', - description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - let num = coercedValue; - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - if (typeof num !== 'number' || !Number.isFinite(num)) { - throw new _GraphQLError.GraphQLError(`Float cannot represent non numeric value: ${(0, _inspect.inspect)(coercedValue)}`); - } - return num; - }, - parseValue(inputValue) { - if (typeof inputValue !== 'number' || !Number.isFinite(inputValue)) { - throw new _GraphQLError.GraphQLError(`Float cannot represent non numeric value: ${(0, _inspect.inspect)(inputValue)}`); - } - return inputValue; - }, - parseLiteral(valueNode) { - if (valueNode.kind !== _kinds.Kind.FLOAT && valueNode.kind !== _kinds.Kind.INT) { - throw new _GraphQLError.GraphQLError(`Float cannot represent non numeric value: ${(0, _printer.print)(valueNode)}`, valueNode); - } - return parseFloat(valueNode.value); + return { + schema: firstArg, + // FIXME: when underlying TS bug fixed, see https://github.com/microsoft/TypeScript/issues/31613 + document: args[1], + rootValue: args[2], + contextValue: args[3], + variableValues: args[4], + operationName: args[5], + subscribeFieldResolver: args[6] + }; +} +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream. + * + * Returns a Promise which resolves to either an AsyncIterable (if successful) + * or an ExecutionResult (error). The promise will be rejected if the schema or + * other arguments to this function are invalid, or if the resolved event stream + * is not an async iterable. + * + * If the client-provided arguments to this function do not result in a + * compliant subscription, a GraphQL Response (ExecutionResult) with + * descriptive errors and no data will be returned. + * + * If the the source stream could not be created due to faulty subscription + * resolver logic or underlying systems, the promise will resolve to a single + * ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the promise resolves to the AsyncIterable for the + * event stream returned by the resolver. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + */ + +async function createSourceEventStream(...rawArgs) { + const args = toNormalizedArgs(rawArgs); + const { + schema, + document, + variableValues + } = args; // If arguments are missing or incorrectly typed, this is an internal + // developer mistake which should throw an early error. + + (0, _execute.assertValidExecutionArguments)(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments, + // a "Response" with only errors is returned. + + const exeContext = (0, _execute.buildExecutionContext)(args); // Return early errors if execution context failed. + + if (!('schema' in exeContext)) { + return { + errors: exeContext + }; } -}); -const GraphQLString = exports.GraphQLString = new _definition.GraphQLScalarType({ - name: 'String', - description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); // Serialize string, boolean and number values to a string, but do not - // attempt to coerce object, function, symbol, or other types as strings. + try { + const eventStream = await executeSubscription(exeContext); // Assert field returned an event stream, otherwise yield an error. - if (typeof coercedValue === 'string') { - return coercedValue; - } - if (typeof coercedValue === 'boolean') { - return coercedValue ? 'true' : 'false'; - } - if (typeof coercedValue === 'number' && Number.isFinite(coercedValue)) { - return coercedValue.toString(); - } - throw new _GraphQLError.GraphQLError(`String cannot represent value: ${(0, _inspect.inspect)(outputValue)}`); - }, - parseValue(inputValue) { - if (typeof inputValue !== 'string') { - throw new _GraphQLError.GraphQLError(`String cannot represent a non string value: ${(0, _inspect.inspect)(inputValue)}`); + if (!(0, _isAsyncIterable.isAsyncIterable)(eventStream)) { + throw new Error('Subscription field must return Async Iterable. ' + `Received: ${(0, _inspect.inspect)(eventStream)}.`); } - return inputValue; - }, - parseLiteral(valueNode) { - if (valueNode.kind !== _kinds.Kind.STRING) { - throw new _GraphQLError.GraphQLError(`String cannot represent a non string value: ${(0, _printer.print)(valueNode)}`, { - nodes: valueNode - }); + return eventStream; + } catch (error) { + // If it GraphQLError, report it as an ExecutionResult, containing only errors and no data. + // Otherwise treat the error as a system-class error and re-throw it. + if (error instanceof _GraphQLError.GraphQLError) { + return { + errors: [error] + }; } - return valueNode.value; + throw error; } -}); -const GraphQLBoolean = exports.GraphQLBoolean = new _definition.GraphQLScalarType({ - name: 'Boolean', - description: 'The `Boolean` scalar type represents `true` or `false`.', - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - if (typeof coercedValue === 'boolean') { - return coercedValue; - } - if (Number.isFinite(coercedValue)) { - return coercedValue !== 0; - } - throw new _GraphQLError.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, _inspect.inspect)(coercedValue)}`); - }, - parseValue(inputValue) { - if (typeof inputValue !== 'boolean') { - throw new _GraphQLError.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, _inspect.inspect)(inputValue)}`); - } - return inputValue; - }, - parseLiteral(valueNode) { - if (valueNode.kind !== _kinds.Kind.BOOLEAN) { - throw new _GraphQLError.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, _printer.print)(valueNode)}`, { - nodes: valueNode - }); - } - return valueNode.value; +} +async function executeSubscription(exeContext) { + const { + schema, + fragments, + operation, + variableValues, + rootValue + } = exeContext; + const rootType = schema.getSubscriptionType(); + if (rootType == null) { + throw new _GraphQLError.GraphQLError('Schema is not configured to execute subscription operation.', { + nodes: operation + }); } -}); -const GraphQLID = exports.GraphQLID = new _definition.GraphQLScalarType({ - name: 'ID', - description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - if (typeof coercedValue === 'string') { - return coercedValue; - } - if (Number.isInteger(coercedValue)) { - return String(coercedValue); - } - throw new _GraphQLError.GraphQLError(`ID cannot represent value: ${(0, _inspect.inspect)(outputValue)}`); - }, - parseValue(inputValue) { - if (typeof inputValue === 'string') { - return inputValue; - } - if (typeof inputValue === 'number' && Number.isInteger(inputValue)) { - return inputValue.toString(); - } - throw new _GraphQLError.GraphQLError(`ID cannot represent value: ${(0, _inspect.inspect)(inputValue)}`); - }, - parseLiteral(valueNode) { - if (valueNode.kind !== _kinds.Kind.STRING && valueNode.kind !== _kinds.Kind.INT) { - throw new _GraphQLError.GraphQLError('ID cannot represent a non-string and non-integer value: ' + (0, _printer.print)(valueNode), { - nodes: valueNode - }); - } - return valueNode.value; + const rootFields = (0, _collectFields.collectFields)(schema, fragments, variableValues, rootType, operation.selectionSet); + const [responseName, fieldNodes] = [...rootFields.entries()][0]; + const fieldDef = (0, _execute.getFieldDef)(schema, rootType, fieldNodes[0]); + if (!fieldDef) { + const fieldName = fieldNodes[0].name.value; + throw new _GraphQLError.GraphQLError(`The subscription field "${fieldName}" is not defined.`, { + nodes: fieldNodes + }); } -}); -const specifiedScalarTypes = exports.specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]); -function isSpecifiedScalarType(type) { - return specifiedScalarTypes.some(({ - name - }) => type.name === name); -} // Support serializing objects with custom valueOf() or toJSON() functions - -// a common way to represent a complex value which can be represented as -// a string (ex: MongoDB id objects). + const path = (0, _Path.addPath)(undefined, responseName, rootType.name); + const info = (0, _execute.buildResolveInfo)(exeContext, fieldDef, fieldNodes, rootType, path); + try { + var _fieldDef$subscribe; -function serializeObject(outputValue) { - if ((0, _isObjectLike.isObjectLike)(outputValue)) { - if (typeof outputValue.valueOf === 'function') { - const valueOfResult = outputValue.valueOf(); - if (!(0, _isObjectLike.isObjectLike)(valueOfResult)) { - return valueOfResult; - } - } - if (typeof outputValue.toJSON === 'function') { - return outputValue.toJSON(); + // Implements the "ResolveFieldEventStream" algorithm from GraphQL specification. + // It differs from "ResolveFieldValue" due to providing a different `resolveFn`. + // Build a JS object of arguments from the field.arguments AST, using the + // variables scope to fulfill any variable references. + const args = (0, _values.getArgumentValues)(fieldDef, fieldNodes[0], variableValues); // The resolve function's optional third argument is a context value that + // is provided to every resolve function within an execution. It is commonly + // used to represent an authenticated user, or request-specific caches. + + const contextValue = exeContext.contextValue; // Call the `subscribe()` resolver or the default resolver to produce an + // AsyncIterable yielding raw payloads. + + const resolveFn = (_fieldDef$subscribe = fieldDef.subscribe) !== null && _fieldDef$subscribe !== void 0 ? _fieldDef$subscribe : exeContext.subscribeFieldResolver; + const eventStream = await resolveFn(rootValue, args, contextValue, info); + if (eventStream instanceof Error) { + throw eventStream; } + return eventStream; + } catch (error) { + throw (0, _locatedError.locatedError)(error, fieldNodes, (0, _Path.pathToArray)(path)); } - return outputValue; } /***/ }), -/***/ "../../../node_modules/graphql/type/schema.mjs": -/*!*****************************************************!*\ - !*** ../../../node_modules/graphql/type/schema.mjs ***! - \*****************************************************/ +/***/ "../../../node_modules/graphql/execution/values.mjs": +/*!**********************************************************!*\ + !*** ../../../node_modules/graphql/execution/values.mjs ***! + \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GraphQLSchema = void 0; -exports.assertSchema = assertSchema; -exports.isSchema = isSchema; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +exports.getArgumentValues = getArgumentValues; +exports.getDirectiveValues = getDirectiveValues; +exports.getVariableValues = getVariableValues; var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _instanceOf = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); -var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -var _toObjMap = __webpack_require__(/*! ../jsutils/toObjMap.mjs */ "../../../node_modules/graphql/jsutils/toObjMap.mjs"); -var _ast = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _directives = __webpack_require__(/*! ./directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -var _introspection = __webpack_require__(/*! ./introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +var _keyMap = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); +var _printPathArray = __webpack_require__(/*! ../jsutils/printPathArray.mjs */ "../../../node_modules/graphql/jsutils/printPathArray.mjs"); +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _coerceInputValue = __webpack_require__(/*! ../utilities/coerceInputValue.mjs */ "../../../node_modules/graphql/utilities/coerceInputValue.mjs"); +var _typeFromAST = __webpack_require__(/*! ../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); +var _valueFromAST = __webpack_require__(/*! ../utilities/valueFromAST.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); /** - * Test if the given value is a GraphQL schema. + * Prepares an object map of variableValues of the correct type based on the + * provided variable definitions and arbitrary input. If the input cannot be + * parsed to match the variable definitions, a GraphQLError will be thrown. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ - -function isSchema(schema) { - return (0, _instanceOf.instanceOf)(schema, GraphQLSchema); +function getVariableValues(schema, varDefNodes, inputs, options) { + const errors = []; + const maxErrors = options === null || options === void 0 ? void 0 : options.maxErrors; + try { + const coerced = coerceVariableValues(schema, varDefNodes, inputs, error => { + if (maxErrors != null && errors.length >= maxErrors) { + throw new _GraphQLError.GraphQLError('Too many errors processing variables, error limit reached. Execution aborted.'); + } + errors.push(error); + }); + if (errors.length === 0) { + return { + coerced + }; + } + } catch (error) { + errors.push(error); + } + return { + errors + }; } -function assertSchema(schema) { - if (!isSchema(schema)) { - throw new Error(`Expected ${(0, _inspect.inspect)(schema)} to be a GraphQL schema.`); +function coerceVariableValues(schema, varDefNodes, inputs, onError) { + const coercedValues = {}; + for (const varDefNode of varDefNodes) { + const varName = varDefNode.variable.name.value; + const varType = (0, _typeFromAST.typeFromAST)(schema, varDefNode.type); + if (!(0, _definition.isInputType)(varType)) { + // Must use input types for variables. This should be caught during + // validation, however is checked again here for safety. + const varTypeStr = (0, _printer.print)(varDefNode.type); + onError(new _GraphQLError.GraphQLError(`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`, { + nodes: varDefNode.type + })); + continue; + } + if (!hasOwnProperty(inputs, varName)) { + if (varDefNode.defaultValue) { + coercedValues[varName] = (0, _valueFromAST.valueFromAST)(varDefNode.defaultValue, varType); + } else if ((0, _definition.isNonNullType)(varType)) { + const varTypeStr = (0, _inspect.inspect)(varType); + onError(new _GraphQLError.GraphQLError(`Variable "$${varName}" of required type "${varTypeStr}" was not provided.`, { + nodes: varDefNode + })); + } + continue; + } + const value = inputs[varName]; + if (value === null && (0, _definition.isNonNullType)(varType)) { + const varTypeStr = (0, _inspect.inspect)(varType); + onError(new _GraphQLError.GraphQLError(`Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`, { + nodes: varDefNode + })); + continue; + } + coercedValues[varName] = (0, _coerceInputValue.coerceInputValue)(value, varType, (path, invalidValue, error) => { + let prefix = `Variable "$${varName}" got invalid value ` + (0, _inspect.inspect)(invalidValue); + if (path.length > 0) { + prefix += ` at "${varName}${(0, _printPathArray.printPathArray)(path)}"`; + } + onError(new _GraphQLError.GraphQLError(prefix + '; ' + error.message, { + nodes: varDefNode, + originalError: error + })); + }); } - return schema; + return coercedValues; } /** - * Custom extensions + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ -/** - * Schema Definition - * - * A Schema is created by supplying the root types of each type of operation, - * query and mutation (optional). A schema definition is then supplied to the - * validator and executor. - * - * Example: - * - * ```ts - * const MyAppSchema = new GraphQLSchema({ - * query: MyAppQueryRootType, - * mutation: MyAppMutationRootType, - * }) - * ``` - * - * Note: When the schema is constructed, by default only the types that are - * reachable by traversing the root types are included, other types must be - * explicitly referenced. - * - * Example: - * - * ```ts - * const characterInterface = new GraphQLInterfaceType({ - * name: 'Character', - * ... - * }); - * - * const humanType = new GraphQLObjectType({ - * name: 'Human', - * interfaces: [characterInterface], - * ... - * }); - * - * const droidType = new GraphQLObjectType({ - * name: 'Droid', - * interfaces: [characterInterface], - * ... - * }); - * - * const schema = new GraphQLSchema({ - * query: new GraphQLObjectType({ - * name: 'Query', - * fields: { - * hero: { type: characterInterface, ... }, - * } - * }), - * ... - * // Since this schema references only the `Character` interface it's - * // necessary to explicitly list the types that implement it if - * // you want them to be included in the final schema. - * types: [humanType, droidType], - * }) - * ``` - * - * Note: If an array of `directives` are provided to GraphQLSchema, that will be - * the exact list of directives represented and allowed. If `directives` is not - * provided then a default set of the specified directives (e.g. `@include` and - * `@skip`) will be used. If you wish to provide *additional* directives to these - * specified directives, you must explicitly declare them. Example: - * - * ```ts - * const MyAppSchema = new GraphQLSchema({ - * ... - * directives: specifiedDirectives.concat([ myCustomDirective ]), - * }) - * ``` - */ -class GraphQLSchema { - // Used as a cache for validateSchema(). - constructor(config) { - var _config$extensionASTN, _config$directives; - - // If this schema was built from a source known to be valid, then it may be - // marked with assumeValid to avoid an additional type system validation. - this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors. - - (0, _isObjectLike.isObjectLike)(config) || (0, _devAssert.devAssert)(false, 'Must provide configuration object.'); - !config.types || Array.isArray(config.types) || (0, _devAssert.devAssert)(false, `"types" must be Array if provided but got: ${(0, _inspect.inspect)(config.types)}.`); - !config.directives || Array.isArray(config.directives) || (0, _devAssert.devAssert)(false, '"directives" must be Array if provided but got: ' + `${(0, _inspect.inspect)(config.directives)}.`); - this.description = config.description; - this.extensions = (0, _toObjMap.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN = config.extensionASTNodes) !== null && _config$extensionASTN !== void 0 ? _config$extensionASTN : []; - this._queryType = config.query; - this._mutationType = config.mutation; - this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default. +function getArgumentValues(def, node, variableValues) { + var _node$arguments; + const coercedValues = {}; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives; // To preserve order of user-provided types, we add first to add them to - // the set of "collected" types, so `collectReferencedTypes` ignore them. + /* c8 ignore next */ - const allReferencedTypes = new Set(config.types); - if (config.types != null) { - for (const type of config.types) { - // When we ready to process this type, we remove it from "collected" types - // and then add it together with all dependent types in the correct position. - allReferencedTypes.delete(type); - collectReferencedTypes(type, allReferencedTypes); + const argumentNodes = (_node$arguments = node.arguments) !== null && _node$arguments !== void 0 ? _node$arguments : []; + const argNodeMap = (0, _keyMap.keyMap)(argumentNodes, arg => arg.name.value); + for (const argDef of def.args) { + const name = argDef.name; + const argType = argDef.type; + const argumentNode = argNodeMap[name]; + if (!argumentNode) { + if (argDef.defaultValue !== undefined) { + coercedValues[name] = argDef.defaultValue; + } else if ((0, _definition.isNonNullType)(argType)) { + throw new _GraphQLError.GraphQLError(`Argument "${name}" of required type "${(0, _inspect.inspect)(argType)}" ` + 'was not provided.', { + nodes: node + }); } + continue; } - if (this._queryType != null) { - collectReferencedTypes(this._queryType, allReferencedTypes); - } - if (this._mutationType != null) { - collectReferencedTypes(this._mutationType, allReferencedTypes); - } - if (this._subscriptionType != null) { - collectReferencedTypes(this._subscriptionType, allReferencedTypes); - } - for (const directive of this._directives) { - // Directives are not validated until validateSchema() is called. - if ((0, _directives.isDirective)(directive)) { - for (const arg of directive.args) { - collectReferencedTypes(arg.type, allReferencedTypes); + const valueNode = argumentNode.value; + let isNull = valueNode.kind === _kinds.Kind.NULL; + if (valueNode.kind === _kinds.Kind.VARIABLE) { + const variableName = valueNode.name.value; + if (variableValues == null || !hasOwnProperty(variableValues, variableName)) { + if (argDef.defaultValue !== undefined) { + coercedValues[name] = argDef.defaultValue; + } else if ((0, _definition.isNonNullType)(argType)) { + throw new _GraphQLError.GraphQLError(`Argument "${name}" of required type "${(0, _inspect.inspect)(argType)}" ` + `was provided the variable "$${variableName}" which was not provided a runtime value.`, { + nodes: valueNode + }); } - } - } - collectReferencedTypes(_introspection.__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema. - - this._typeMap = Object.create(null); - this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name. - - this._implementationsMap = Object.create(null); - for (const namedType of allReferencedTypes) { - if (namedType == null) { continue; } - const typeName = namedType.name; - typeName || (0, _devAssert.devAssert)(false, 'One of the provided types for building the Schema is missing a name.'); - if (this._typeMap[typeName] !== undefined) { - throw new Error(`Schema must contain uniquely named types but contains multiple types named "${typeName}".`); - } - this._typeMap[typeName] = namedType; - if ((0, _definition.isInterfaceType)(namedType)) { - // Store implementations by interface. - for (const iface of namedType.getInterfaces()) { - if ((0, _definition.isInterfaceType)(iface)) { - let implementations = this._implementationsMap[iface.name]; - if (implementations === undefined) { - implementations = this._implementationsMap[iface.name] = { - objects: [], - interfaces: [] - }; - } - implementations.interfaces.push(namedType); - } - } - } else if ((0, _definition.isObjectType)(namedType)) { - // Store implementations by objects. - for (const iface of namedType.getInterfaces()) { - if ((0, _definition.isInterfaceType)(iface)) { - let implementations = this._implementationsMap[iface.name]; - if (implementations === undefined) { - implementations = this._implementationsMap[iface.name] = { - objects: [], - interfaces: [] - }; - } - implementations.objects.push(namedType); - } - } - } + isNull = variableValues[variableName] == null; } - } - get [Symbol.toStringTag]() { - return 'GraphQLSchema'; - } - getQueryType() { - return this._queryType; - } - getMutationType() { - return this._mutationType; - } - getSubscriptionType() { - return this._subscriptionType; - } - getRootType(operation) { - switch (operation) { - case _ast.OperationTypeNode.QUERY: - return this.getQueryType(); - case _ast.OperationTypeNode.MUTATION: - return this.getMutationType(); - case _ast.OperationTypeNode.SUBSCRIPTION: - return this.getSubscriptionType(); + if (isNull && (0, _definition.isNonNullType)(argType)) { + throw new _GraphQLError.GraphQLError(`Argument "${name}" of non-null type "${(0, _inspect.inspect)(argType)}" ` + 'must not be null.', { + nodes: valueNode + }); } - } - getTypeMap() { - return this._typeMap; - } - getType(name) { - return this.getTypeMap()[name]; - } - getPossibleTypes(abstractType) { - return (0, _definition.isUnionType)(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects; - } - getImplementations(interfaceType) { - const implementations = this._implementationsMap[interfaceType.name]; - return implementations !== null && implementations !== void 0 ? implementations : { - objects: [], - interfaces: [] - }; - } - isSubType(abstractType, maybeSubType) { - let map = this._subTypeMap[abstractType.name]; - if (map === undefined) { - map = Object.create(null); - if ((0, _definition.isUnionType)(abstractType)) { - for (const type of abstractType.getTypes()) { - map[type.name] = true; - } - } else { - const implementations = this.getImplementations(abstractType); - for (const type of implementations.objects) { - map[type.name] = true; - } - for (const type of implementations.interfaces) { - map[type.name] = true; - } - } - this._subTypeMap[abstractType.name] = map; + const coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues); + if (coercedValue === undefined) { + // Note: ValuesOfCorrectTypeRule validation should catch this before + // execution. This is a runtime check to ensure execution does not + // continue with an invalid argument value. + throw new _GraphQLError.GraphQLError(`Argument "${name}" has invalid value ${(0, _printer.print)(valueNode)}.`, { + nodes: valueNode + }); } - return map[maybeSubType.name] !== undefined; - } - getDirectives() { - return this._directives; - } - getDirective(name) { - return this.getDirectives().find(directive => directive.name === name); - } - toConfig() { - return { - description: this.description, - query: this.getQueryType(), - mutation: this.getMutationType(), - subscription: this.getSubscriptionType(), - types: Object.values(this.getTypeMap()), - directives: this.getDirectives(), - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes, - assumeValid: this.__validationErrors !== undefined - }; + coercedValues[name] = coercedValue; } + return coercedValues; } -exports.GraphQLSchema = GraphQLSchema; -function collectReferencedTypes(type, typeSet) { - const namedType = (0, _definition.getNamedType)(type); - if (!typeSet.has(namedType)) { - typeSet.add(namedType); - if ((0, _definition.isUnionType)(namedType)) { - for (const memberType of namedType.getTypes()) { - collectReferencedTypes(memberType, typeSet); - } - } else if ((0, _definition.isObjectType)(namedType) || (0, _definition.isInterfaceType)(namedType)) { - for (const interfaceType of namedType.getInterfaces()) { - collectReferencedTypes(interfaceType, typeSet); - } - for (const field of Object.values(namedType.getFields())) { - collectReferencedTypes(field.type, typeSet); - for (const arg of field.args) { - collectReferencedTypes(arg.type, typeSet); - } - } - } else if ((0, _definition.isInputObjectType)(namedType)) { - for (const field of Object.values(namedType.getFields())) { - collectReferencedTypes(field.type, typeSet); - } - } +/** + * Prepares an object map of argument values given a directive definition + * and a AST node which may contain directives. Optionally also accepts a map + * of variable values. + * + * If the directive does not exist on the node, returns undefined. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ + +function getDirectiveValues(directiveDef, node, variableValues) { + var _node$directives; + const directiveNode = (_node$directives = node.directives) === null || _node$directives === void 0 ? void 0 : _node$directives.find(directive => directive.name.value === directiveDef.name); + if (directiveNode) { + return getArgumentValues(directiveDef, directiveNode, variableValues); } - return typeSet; +} +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); } /***/ }), -/***/ "../../../node_modules/graphql/type/validate.mjs": -/*!*******************************************************!*\ - !*** ../../../node_modules/graphql/type/validate.mjs ***! - \*******************************************************/ +/***/ "../../../node_modules/graphql/graphql.mjs": +/*!*************************************************!*\ + !*** ../../../node_modules/graphql/graphql.mjs ***! + \*************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.assertValidSchema = assertValidSchema; -exports.validateSchema = validateSchema; -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _ast = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -var _typeComparators = __webpack_require__(/*! ../utilities/typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); -var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _directives = __webpack_require__(/*! ./directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -var _introspection = __webpack_require__(/*! ./introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -var _schema = __webpack_require__(/*! ./schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); +exports.graphql = graphql; +exports.graphqlSync = graphqlSync; +var _devAssert = __webpack_require__(/*! ./jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _isPromise = __webpack_require__(/*! ./jsutils/isPromise.mjs */ "../../../node_modules/graphql/jsutils/isPromise.mjs"); +var _parser = __webpack_require__(/*! ./language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); +var _validate = __webpack_require__(/*! ./type/validate.mjs */ "../../../node_modules/graphql/type/validate.mjs"); +var _validate2 = __webpack_require__(/*! ./validation/validate.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); +var _execute = __webpack_require__(/*! ./execution/execute.mjs */ "../../../node_modules/graphql/execution/execute.mjs"); /** - * Implements the "Type Validation" sub-sections of the specification's - * "Type System" section. + * This is the primary entry point function for fulfilling GraphQL operations + * by parsing, validating, and executing a GraphQL document along side a + * GraphQL schema. * - * Validation runs synchronously, returning an array of encountered errors, or - * an empty array if no errors were encountered and the Schema is valid. + * More sophisticated GraphQL servers, such as those which persist queries, + * may wish to separate the validation and execution phases to a static time + * tooling step, and a server runtime step. + * + * Accepts either an object with named arguments, or individual arguments: + * + * schema: + * The GraphQL type system to use when validating and executing a query. + * source: + * A GraphQL language formatted string representing the requested operation. + * rootValue: + * The value provided as the first argument to resolver functions on the top + * level type (e.g. the query object type). + * contextValue: + * The context value is provided as an argument to resolver functions after + * field arguments. It is used to pass shared information useful at any point + * during executing this query, for example the currently logged in user and + * connections to databases or other services. + * variableValues: + * A mapping of variable name to runtime value to use for all variables + * defined in the requestString. + * operationName: + * The name of the operation to use if requestString contains multiple + * possible operations. Can be omitted if requestString contains only + * one operation. + * fieldResolver: + * A resolver function to use when one is not provided by the schema. + * If not provided, the default field resolver is used (which looks for a + * value or method on the source value with the field's name). + * typeResolver: + * A type resolver function to use when none is provided by the schema. + * If not provided, the default type resolver is used (which looks for a + * `__typename` field or alternatively calls the `isTypeOf` method). */ -function validateSchema(schema) { - // First check to ensure the provided value is in fact a GraphQLSchema. - (0, _schema.assertSchema)(schema); // If this Schema has already been validated, return the previous results. - - if (schema.__validationErrors) { - return schema.__validationErrors; - } // Validate the schema, producing a list of errors. - - const context = new SchemaValidationContext(schema); - validateRootTypes(context); - validateDirectives(context); - validateTypes(context); // Persist the results of validation before returning to ensure validation - // does not run multiple times for this schema. - - const errors = context.getErrors(); - schema.__validationErrors = errors; - return errors; +function graphql(args) { + // Always return a Promise for a consistent API. + return new Promise(resolve => resolve(graphqlImpl(args))); } /** - * Utility function which asserts a schema is valid by throwing an error if - * it is invalid. + * The graphqlSync function also fulfills GraphQL operations by parsing, + * validating, and executing a GraphQL document along side a GraphQL schema. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. */ -function assertValidSchema(schema) { - const errors = validateSchema(schema); - if (errors.length !== 0) { - throw new Error(errors.map(error => error.message).join('\n\n')); +function graphqlSync(args) { + const result = graphqlImpl(args); // Assert that the execution was synchronous. + + if ((0, _isPromise.isPromise)(result)) { + throw new Error('GraphQL execution failed to complete synchronously.'); } + return result; } -class SchemaValidationContext { - constructor(schema) { - this._errors = []; - this.schema = schema; +function graphqlImpl(args) { + // Temporary for v15 to v16 migration. Remove in v17 + arguments.length < 2 || (0, _devAssert.devAssert)(false, 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.'); + const { + schema, + source, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver + } = args; // Validate Schema + + const schemaValidationErrors = (0, _validate.validateSchema)(schema); + if (schemaValidationErrors.length > 0) { + return { + errors: schemaValidationErrors + }; + } // Parse + + let document; + try { + document = (0, _parser.parse)(source); + } catch (syntaxError) { + return { + errors: [syntaxError] + }; + } // Validate + + const validationErrors = (0, _validate2.validate)(schema, document); + if (validationErrors.length > 0) { + return { + errors: validationErrors + }; + } // Execute + + return (0, _execute.execute)({ + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver + }); +} + +/***/ }), + +/***/ "../../../node_modules/graphql/index.mjs": +/*!***********************************************!*\ + !*** ../../../node_modules/graphql/index.mjs ***! + \***********************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "BREAK", ({ + enumerable: true, + get: function () { + return _index2.BREAK; } - reportError(message, nodes) { - const _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes; - this._errors.push(new _GraphQLError.GraphQLError(message, { - nodes: _nodes - })); +})); +Object.defineProperty(exports, "BreakingChangeType", ({ + enumerable: true, + get: function () { + return _index6.BreakingChangeType; } - getErrors() { - return this._errors; +})); +Object.defineProperty(exports, "DEFAULT_DEPRECATION_REASON", ({ + enumerable: true, + get: function () { + return _index.DEFAULT_DEPRECATION_REASON; } -} -function validateRootTypes(context) { - const schema = context.schema; - const queryType = schema.getQueryType(); - if (!queryType) { - context.reportError('Query root type must be provided.', schema.astNode); - } else if (!(0, _definition.isObjectType)(queryType)) { - var _getOperationTypeNode; - context.reportError(`Query root type must be Object type, it cannot be ${(0, _inspect.inspect)(queryType)}.`, (_getOperationTypeNode = getOperationTypeNode(schema, _ast.OperationTypeNode.QUERY)) !== null && _getOperationTypeNode !== void 0 ? _getOperationTypeNode : queryType.astNode); +})); +Object.defineProperty(exports, "DangerousChangeType", ({ + enumerable: true, + get: function () { + return _index6.DangerousChangeType; } - const mutationType = schema.getMutationType(); - if (mutationType && !(0, _definition.isObjectType)(mutationType)) { - var _getOperationTypeNode2; - context.reportError('Mutation root type must be Object type if provided, it cannot be ' + `${(0, _inspect.inspect)(mutationType)}.`, (_getOperationTypeNode2 = getOperationTypeNode(schema, _ast.OperationTypeNode.MUTATION)) !== null && _getOperationTypeNode2 !== void 0 ? _getOperationTypeNode2 : mutationType.astNode); +})); +Object.defineProperty(exports, "DirectiveLocation", ({ + enumerable: true, + get: function () { + return _index2.DirectiveLocation; } - const subscriptionType = schema.getSubscriptionType(); - if (subscriptionType && !(0, _definition.isObjectType)(subscriptionType)) { - var _getOperationTypeNode3; - context.reportError('Subscription root type must be Object type if provided, it cannot be ' + `${(0, _inspect.inspect)(subscriptionType)}.`, (_getOperationTypeNode3 = getOperationTypeNode(schema, _ast.OperationTypeNode.SUBSCRIPTION)) !== null && _getOperationTypeNode3 !== void 0 ? _getOperationTypeNode3 : subscriptionType.astNode); +})); +Object.defineProperty(exports, "ExecutableDefinitionsRule", ({ + enumerable: true, + get: function () { + return _index4.ExecutableDefinitionsRule; } -} -function getOperationTypeNode(schema, operation) { - var _flatMap$find; - return (_flatMap$find = [schema.astNode, ...schema.extensionASTNodes].flatMap( - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - schemaNode => { - var _schemaNode$operation; - return /* c8 ignore next */( - (_schemaNode$operation = schemaNode === null || schemaNode === void 0 ? void 0 : schemaNode.operationTypes) !== null && _schemaNode$operation !== void 0 ? _schemaNode$operation : [] - ); - }).find(operationNode => operationNode.operation === operation)) === null || _flatMap$find === void 0 ? void 0 : _flatMap$find.type; -} -function validateDirectives(context) { - for (const directive of context.schema.getDirectives()) { - // Ensure all directives are in fact GraphQL directives. - if (!(0, _directives.isDirective)(directive)) { - context.reportError(`Expected directive but got: ${(0, _inspect.inspect)(directive)}.`, directive === null || directive === void 0 ? void 0 : directive.astNode); - continue; - } // Ensure they are named correctly. - - validateName(context, directive); // TODO: Ensure proper locations. - // Ensure the arguments are valid. - - for (const arg of directive.args) { - // Ensure they are named correctly. - validateName(context, arg); // Ensure the type is an input type. - - if (!(0, _definition.isInputType)(arg.type)) { - context.reportError(`The type of @${directive.name}(${arg.name}:) must be Input Type ` + `but got: ${(0, _inspect.inspect)(arg.type)}.`, arg.astNode); - } - if ((0, _definition.isRequiredArgument)(arg) && arg.deprecationReason != null) { - var _arg$astNode; - context.reportError(`Required argument @${directive.name}(${arg.name}:) cannot be deprecated.`, [getDeprecatedDirectiveNode(arg.astNode), (_arg$astNode = arg.astNode) === null || _arg$astNode === void 0 ? void 0 : _arg$astNode.type]); - } - } +})); +Object.defineProperty(exports, "FieldsOnCorrectTypeRule", ({ + enumerable: true, + get: function () { + return _index4.FieldsOnCorrectTypeRule; } -} -function validateName(context, node) { - // Ensure names are valid, however introspection types opt out. - if (node.name.startsWith('__')) { - context.reportError(`Name "${node.name}" must not begin with "__", which is reserved by GraphQL introspection.`, node.astNode); +})); +Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", ({ + enumerable: true, + get: function () { + return _index4.FragmentsOnCompositeTypesRule; } -} -function validateTypes(context) { - const validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context); - const typeMap = context.schema.getTypeMap(); - for (const type of Object.values(typeMap)) { - // Ensure all provided types are in fact GraphQL type. - if (!(0, _definition.isNamedType)(type)) { - context.reportError(`Expected GraphQL named type but got: ${(0, _inspect.inspect)(type)}.`, type.astNode); - continue; - } // Ensure it is named correctly (excluding introspection types). - - if (!(0, _introspection.isIntrospectionType)(type)) { - validateName(context, type); - } - if ((0, _definition.isObjectType)(type)) { - // Ensure fields are valid - validateFields(context, type); // Ensure objects implement the interfaces they claim to. - - validateInterfaces(context, type); - } else if ((0, _definition.isInterfaceType)(type)) { - // Ensure fields are valid. - validateFields(context, type); // Ensure interfaces implement the interfaces they claim to. - - validateInterfaces(context, type); - } else if ((0, _definition.isUnionType)(type)) { - // Ensure Unions include valid member types. - validateUnionMembers(context, type); - } else if ((0, _definition.isEnumType)(type)) { - // Ensure Enums have valid values. - validateEnumValues(context, type); - } else if ((0, _definition.isInputObjectType)(type)) { - // Ensure Input Object fields are valid. - validateInputFields(context, type); // Ensure Input Objects do not contain non-nullable circular references - - validateInputObjectCircularRefs(type); - } +})); +Object.defineProperty(exports, "GRAPHQL_MAX_INT", ({ + enumerable: true, + get: function () { + return _index.GRAPHQL_MAX_INT; } -} -function validateFields(context, type) { - const fields = Object.values(type.getFields()); // Objects and Interfaces both must define one or more fields. - - if (fields.length === 0) { - context.reportError(`Type ${type.name} must define one or more fields.`, [type.astNode, ...type.extensionASTNodes]); +})); +Object.defineProperty(exports, "GRAPHQL_MIN_INT", ({ + enumerable: true, + get: function () { + return _index.GRAPHQL_MIN_INT; } - for (const field of fields) { - // Ensure they are named correctly. - validateName(context, field); // Ensure the type is an output type - - if (!(0, _definition.isOutputType)(field.type)) { - var _field$astNode; - context.reportError(`The type of ${type.name}.${field.name} must be Output Type ` + `but got: ${(0, _inspect.inspect)(field.type)}.`, (_field$astNode = field.astNode) === null || _field$astNode === void 0 ? void 0 : _field$astNode.type); - } // Ensure the arguments are valid - - for (const arg of field.args) { - const argName = arg.name; // Ensure they are named correctly. - - validateName(context, arg); // Ensure the type is an input type - - if (!(0, _definition.isInputType)(arg.type)) { - var _arg$astNode2; - context.reportError(`The type of ${type.name}.${field.name}(${argName}:) must be Input ` + `Type but got: ${(0, _inspect.inspect)(arg.type)}.`, (_arg$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0 ? void 0 : _arg$astNode2.type); - } - if ((0, _definition.isRequiredArgument)(arg) && arg.deprecationReason != null) { - var _arg$astNode3; - context.reportError(`Required argument ${type.name}.${field.name}(${argName}:) cannot be deprecated.`, [getDeprecatedDirectiveNode(arg.astNode), (_arg$astNode3 = arg.astNode) === null || _arg$astNode3 === void 0 ? void 0 : _arg$astNode3.type]); - } - } +})); +Object.defineProperty(exports, "GraphQLBoolean", ({ + enumerable: true, + get: function () { + return _index.GraphQLBoolean; } -} -function validateInterfaces(context, type) { - const ifaceTypeNames = Object.create(null); - for (const iface of type.getInterfaces()) { - if (!(0, _definition.isInterfaceType)(iface)) { - context.reportError(`Type ${(0, _inspect.inspect)(type)} must only implement Interface types, ` + `it cannot implement ${(0, _inspect.inspect)(iface)}.`, getAllImplementsInterfaceNodes(type, iface)); - continue; - } - if (type === iface) { - context.reportError(`Type ${type.name} cannot implement itself because it would create a circular reference.`, getAllImplementsInterfaceNodes(type, iface)); - continue; - } - if (ifaceTypeNames[iface.name]) { - context.reportError(`Type ${type.name} can only implement ${iface.name} once.`, getAllImplementsInterfaceNodes(type, iface)); - continue; - } - ifaceTypeNames[iface.name] = true; - validateTypeImplementsAncestors(context, type, iface); - validateTypeImplementsInterface(context, type, iface); +})); +Object.defineProperty(exports, "GraphQLDeprecatedDirective", ({ + enumerable: true, + get: function () { + return _index.GraphQLDeprecatedDirective; } -} -function validateTypeImplementsInterface(context, type, iface) { - const typeFieldMap = type.getFields(); // Assert each interface field is implemented. - - for (const ifaceField of Object.values(iface.getFields())) { - const fieldName = ifaceField.name; - const typeField = typeFieldMap[fieldName]; // Assert interface field exists on type. - - if (!typeField) { - context.reportError(`Interface field ${iface.name}.${fieldName} expected but ${type.name} does not provide it.`, [ifaceField.astNode, type.astNode, ...type.extensionASTNodes]); - continue; - } // Assert interface field type is satisfied by type field type, by being - // a valid subtype. (covariant) - - if (!(0, _typeComparators.isTypeSubTypeOf)(context.schema, typeField.type, ifaceField.type)) { - var _ifaceField$astNode, _typeField$astNode; - context.reportError(`Interface field ${iface.name}.${fieldName} expects type ` + `${(0, _inspect.inspect)(ifaceField.type)} but ${type.name}.${fieldName} ` + `is type ${(0, _inspect.inspect)(typeField.type)}.`, [(_ifaceField$astNode = ifaceField.astNode) === null || _ifaceField$astNode === void 0 ? void 0 : _ifaceField$astNode.type, (_typeField$astNode = typeField.astNode) === null || _typeField$astNode === void 0 ? void 0 : _typeField$astNode.type]); - } // Assert each interface field arg is implemented. - - for (const ifaceArg of ifaceField.args) { - const argName = ifaceArg.name; - const typeArg = typeField.args.find(arg => arg.name === argName); // Assert interface field arg exists on object field. - - if (!typeArg) { - context.reportError(`Interface field argument ${iface.name}.${fieldName}(${argName}:) expected but ${type.name}.${fieldName} does not provide it.`, [ifaceArg.astNode, typeField.astNode]); - continue; - } // Assert interface field arg type matches object field arg type. - // (invariant) - // TODO: change to contravariant? - - if (!(0, _typeComparators.isEqualType)(ifaceArg.type, typeArg.type)) { - var _ifaceArg$astNode, _typeArg$astNode; - context.reportError(`Interface field argument ${iface.name}.${fieldName}(${argName}:) ` + `expects type ${(0, _inspect.inspect)(ifaceArg.type)} but ` + `${type.name}.${fieldName}(${argName}:) is type ` + `${(0, _inspect.inspect)(typeArg.type)}.`, [(_ifaceArg$astNode = ifaceArg.astNode) === null || _ifaceArg$astNode === void 0 ? void 0 : _ifaceArg$astNode.type, (_typeArg$astNode = typeArg.astNode) === null || _typeArg$astNode === void 0 ? void 0 : _typeArg$astNode.type]); - } // TODO: validate default values? - } // Assert additional arguments must not be required. - - for (const typeArg of typeField.args) { - const argName = typeArg.name; - const ifaceArg = ifaceField.args.find(arg => arg.name === argName); - if (!ifaceArg && (0, _definition.isRequiredArgument)(typeArg)) { - context.reportError(`Object field ${type.name}.${fieldName} includes required argument ${argName} that is missing from the Interface field ${iface.name}.${fieldName}.`, [typeArg.astNode, ifaceField.astNode]); - } - } +})); +Object.defineProperty(exports, "GraphQLDirective", ({ + enumerable: true, + get: function () { + return _index.GraphQLDirective; } -} -function validateTypeImplementsAncestors(context, type, iface) { - const ifaceInterfaces = type.getInterfaces(); - for (const transitive of iface.getInterfaces()) { - if (!ifaceInterfaces.includes(transitive)) { - context.reportError(transitive === type ? `Type ${type.name} cannot implement ${iface.name} because it would create a circular reference.` : `Type ${type.name} must implement ${transitive.name} because it is implemented by ${iface.name}.`, [...getAllImplementsInterfaceNodes(iface, transitive), ...getAllImplementsInterfaceNodes(type, iface)]); - } +})); +Object.defineProperty(exports, "GraphQLEnumType", ({ + enumerable: true, + get: function () { + return _index.GraphQLEnumType; } -} -function validateUnionMembers(context, union) { - const memberTypes = union.getTypes(); - if (memberTypes.length === 0) { - context.reportError(`Union type ${union.name} must define one or more member types.`, [union.astNode, ...union.extensionASTNodes]); +})); +Object.defineProperty(exports, "GraphQLError", ({ + enumerable: true, + get: function () { + return _index5.GraphQLError; } - const includedTypeNames = Object.create(null); - for (const memberType of memberTypes) { - if (includedTypeNames[memberType.name]) { - context.reportError(`Union type ${union.name} can only include type ${memberType.name} once.`, getUnionMemberTypeNodes(union, memberType.name)); - continue; - } - includedTypeNames[memberType.name] = true; - if (!(0, _definition.isObjectType)(memberType)) { - context.reportError(`Union type ${union.name} can only include Object types, ` + `it cannot include ${(0, _inspect.inspect)(memberType)}.`, getUnionMemberTypeNodes(union, String(memberType))); - } +})); +Object.defineProperty(exports, "GraphQLFloat", ({ + enumerable: true, + get: function () { + return _index.GraphQLFloat; } -} -function validateEnumValues(context, enumType) { - const enumValues = enumType.getValues(); - if (enumValues.length === 0) { - context.reportError(`Enum type ${enumType.name} must define one or more values.`, [enumType.astNode, ...enumType.extensionASTNodes]); +})); +Object.defineProperty(exports, "GraphQLID", ({ + enumerable: true, + get: function () { + return _index.GraphQLID; } - for (const enumValue of enumValues) { - // Ensure valid name. - validateName(context, enumValue); +})); +Object.defineProperty(exports, "GraphQLIncludeDirective", ({ + enumerable: true, + get: function () { + return _index.GraphQLIncludeDirective; } -} -function validateInputFields(context, inputObj) { - const fields = Object.values(inputObj.getFields()); - if (fields.length === 0) { - context.reportError(`Input Object type ${inputObj.name} must define one or more fields.`, [inputObj.astNode, ...inputObj.extensionASTNodes]); - } // Ensure the arguments are valid - - for (const field of fields) { - // Ensure they are named correctly. - validateName(context, field); // Ensure the type is an input type - - if (!(0, _definition.isInputType)(field.type)) { - var _field$astNode2; - context.reportError(`The type of ${inputObj.name}.${field.name} must be Input Type ` + `but got: ${(0, _inspect.inspect)(field.type)}.`, (_field$astNode2 = field.astNode) === null || _field$astNode2 === void 0 ? void 0 : _field$astNode2.type); - } - if ((0, _definition.isRequiredInputField)(field) && field.deprecationReason != null) { - var _field$astNode3; - context.reportError(`Required input field ${inputObj.name}.${field.name} cannot be deprecated.`, [getDeprecatedDirectiveNode(field.astNode), (_field$astNode3 = field.astNode) === null || _field$astNode3 === void 0 ? void 0 : _field$astNode3.type]); - } - if (inputObj.isOneOf) { - validateOneOfInputObjectField(inputObj, field, context); - } +})); +Object.defineProperty(exports, "GraphQLInputObjectType", ({ + enumerable: true, + get: function () { + return _index.GraphQLInputObjectType; } -} -function validateOneOfInputObjectField(type, field, context) { - if ((0, _definition.isNonNullType)(field.type)) { - var _field$astNode4; - context.reportError(`OneOf input field ${type.name}.${field.name} must be nullable.`, (_field$astNode4 = field.astNode) === null || _field$astNode4 === void 0 ? void 0 : _field$astNode4.type); +})); +Object.defineProperty(exports, "GraphQLInt", ({ + enumerable: true, + get: function () { + return _index.GraphQLInt; } - if (field.defaultValue !== undefined) { - context.reportError(`OneOf input field ${type.name}.${field.name} cannot have a default value.`, field.astNode); +})); +Object.defineProperty(exports, "GraphQLInterfaceType", ({ + enumerable: true, + get: function () { + return _index.GraphQLInterfaceType; } -} -function createInputObjectCircularRefsValidator(context) { - // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'. - // Tracks already visited types to maintain O(N) and to ensure that cycles - // are not redundantly reported. - const visitedTypes = Object.create(null); // Array of types nodes used to produce meaningful errors - - const fieldPath = []; // Position in the type path - - const fieldPathIndexByTypeName = Object.create(null); - return detectCycleRecursive; // This does a straight-forward DFS to find cycles. - // It does not terminate when a cycle was found but continues to explore - // the graph to find all possible cycles. - - function detectCycleRecursive(inputObj) { - if (visitedTypes[inputObj.name]) { - return; - } - visitedTypes[inputObj.name] = true; - fieldPathIndexByTypeName[inputObj.name] = fieldPath.length; - const fields = Object.values(inputObj.getFields()); - for (const field of fields) { - if ((0, _definition.isNonNullType)(field.type) && (0, _definition.isInputObjectType)(field.type.ofType)) { - const fieldType = field.type.ofType; - const cycleIndex = fieldPathIndexByTypeName[fieldType.name]; - fieldPath.push(field); - if (cycleIndex === undefined) { - detectCycleRecursive(fieldType); - } else { - const cyclePath = fieldPath.slice(cycleIndex); - const pathStr = cyclePath.map(fieldObj => fieldObj.name).join('.'); - context.reportError(`Cannot reference Input Object "${fieldType.name}" within itself through a series of non-null fields: "${pathStr}".`, cyclePath.map(fieldObj => fieldObj.astNode)); - } - fieldPath.pop(); - } - } - fieldPathIndexByTypeName[inputObj.name] = undefined; +})); +Object.defineProperty(exports, "GraphQLList", ({ + enumerable: true, + get: function () { + return _index.GraphQLList; } -} -function getAllImplementsInterfaceNodes(type, iface) { - const { - astNode, - extensionASTNodes - } = type; - const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - return nodes.flatMap(typeNode => { - var _typeNode$interfaces; - return /* c8 ignore next */( - (_typeNode$interfaces = typeNode.interfaces) !== null && _typeNode$interfaces !== void 0 ? _typeNode$interfaces : [] - ); - }).filter(ifaceNode => ifaceNode.name.value === iface.name); -} -function getUnionMemberTypeNodes(union, typeName) { - const { - astNode, - extensionASTNodes - } = union; - const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - return nodes.flatMap(unionNode => { - var _unionNode$types; - return /* c8 ignore next */( - (_unionNode$types = unionNode.types) !== null && _unionNode$types !== void 0 ? _unionNode$types : [] - ); - }).filter(typeNode => typeNode.name.value === typeName); -} -function getDeprecatedDirectiveNode(definitionNode) { - var _definitionNode$direc; - return definitionNode === null || definitionNode === void 0 ? void 0 : (_definitionNode$direc = definitionNode.directives) === null || _definitionNode$direc === void 0 ? void 0 : _definitionNode$direc.find(node => node.name.value === _directives.GraphQLDeprecatedDirective.name); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/TypeInfo.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/TypeInfo.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.TypeInfo = void 0; -exports.visitWithTypeInfo = visitWithTypeInfo; -var _ast = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _visitor = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -var _typeFromAST = __webpack_require__(/*! ./typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); -/** - * TypeInfo is a utility class which, given a GraphQL schema, can keep track - * of the current field and type definitions at any point in a GraphQL document - * AST during a recursive descent by calling `enter(node)` and `leave(node)`. - */ - -class TypeInfo { - constructor(schema, - /** - * Initial type may be provided in rare cases to facilitate traversals - * beginning somewhere other than documents. - */ - initialType, /** @deprecated will be removed in 17.0.0 */ - getFieldDefFn) { - this._schema = schema; - this._typeStack = []; - this._parentTypeStack = []; - this._inputTypeStack = []; - this._fieldDefStack = []; - this._defaultValueStack = []; - this._directive = null; - this._argument = null; - this._enumValue = null; - this._getFieldDef = getFieldDefFn !== null && getFieldDefFn !== void 0 ? getFieldDefFn : getFieldDef; - if (initialType) { - if ((0, _definition.isInputType)(initialType)) { - this._inputTypeStack.push(initialType); - } - if ((0, _definition.isCompositeType)(initialType)) { - this._parentTypeStack.push(initialType); - } - if ((0, _definition.isOutputType)(initialType)) { - this._typeStack.push(initialType); - } - } +Object.defineProperty(exports, "GraphQLNonNull", ({ + enumerable: true, + get: function () { + return _index.GraphQLNonNull; } - get [Symbol.toStringTag]() { - return 'TypeInfo'; +})); +Object.defineProperty(exports, "GraphQLObjectType", ({ + enumerable: true, + get: function () { + return _index.GraphQLObjectType; } - getType() { - if (this._typeStack.length > 0) { - return this._typeStack[this._typeStack.length - 1]; - } +})); +Object.defineProperty(exports, "GraphQLOneOfDirective", ({ + enumerable: true, + get: function () { + return _index.GraphQLOneOfDirective; } - getParentType() { - if (this._parentTypeStack.length > 0) { - return this._parentTypeStack[this._parentTypeStack.length - 1]; - } +})); +Object.defineProperty(exports, "GraphQLScalarType", ({ + enumerable: true, + get: function () { + return _index.GraphQLScalarType; } - getInputType() { - if (this._inputTypeStack.length > 0) { - return this._inputTypeStack[this._inputTypeStack.length - 1]; - } +})); +Object.defineProperty(exports, "GraphQLSchema", ({ + enumerable: true, + get: function () { + return _index.GraphQLSchema; } - getParentInputType() { - if (this._inputTypeStack.length > 1) { - return this._inputTypeStack[this._inputTypeStack.length - 2]; - } +})); +Object.defineProperty(exports, "GraphQLSkipDirective", ({ + enumerable: true, + get: function () { + return _index.GraphQLSkipDirective; } - getFieldDef() { - if (this._fieldDefStack.length > 0) { - return this._fieldDefStack[this._fieldDefStack.length - 1]; - } +})); +Object.defineProperty(exports, "GraphQLSpecifiedByDirective", ({ + enumerable: true, + get: function () { + return _index.GraphQLSpecifiedByDirective; } - getDefaultValue() { - if (this._defaultValueStack.length > 0) { - return this._defaultValueStack[this._defaultValueStack.length - 1]; - } +})); +Object.defineProperty(exports, "GraphQLString", ({ + enumerable: true, + get: function () { + return _index.GraphQLString; } - getDirective() { - return this._directive; +})); +Object.defineProperty(exports, "GraphQLUnionType", ({ + enumerable: true, + get: function () { + return _index.GraphQLUnionType; } - getArgument() { - return this._argument; +})); +Object.defineProperty(exports, "Kind", ({ + enumerable: true, + get: function () { + return _index2.Kind; } - getEnumValue() { - return this._enumValue; +})); +Object.defineProperty(exports, "KnownArgumentNamesRule", ({ + enumerable: true, + get: function () { + return _index4.KnownArgumentNamesRule; } - enter(node) { - const schema = this._schema; // Note: many of the types below are explicitly typed as "unknown" to drop - // any assumptions of a valid schema to ensure runtime types are properly - // checked before continuing since TypeInfo is used as part of validation - // which occurs before guarantees of schema and document validity. - - switch (node.kind) { - case _kinds.Kind.SELECTION_SET: - { - const namedType = (0, _definition.getNamedType)(this.getType()); - this._parentTypeStack.push((0, _definition.isCompositeType)(namedType) ? namedType : undefined); - break; - } - case _kinds.Kind.FIELD: - { - const parentType = this.getParentType(); - let fieldDef; - let fieldType; - if (parentType) { - fieldDef = this._getFieldDef(schema, parentType, node); - if (fieldDef) { - fieldType = fieldDef.type; - } - } - this._fieldDefStack.push(fieldDef); - this._typeStack.push((0, _definition.isOutputType)(fieldType) ? fieldType : undefined); - break; - } - case _kinds.Kind.DIRECTIVE: - this._directive = schema.getDirective(node.name.value); - break; - case _kinds.Kind.OPERATION_DEFINITION: - { - const rootType = schema.getRootType(node.operation); - this._typeStack.push((0, _definition.isObjectType)(rootType) ? rootType : undefined); - break; - } - case _kinds.Kind.INLINE_FRAGMENT: - case _kinds.Kind.FRAGMENT_DEFINITION: - { - const typeConditionAST = node.typeCondition; - const outputType = typeConditionAST ? (0, _typeFromAST.typeFromAST)(schema, typeConditionAST) : (0, _definition.getNamedType)(this.getType()); - this._typeStack.push((0, _definition.isOutputType)(outputType) ? outputType : undefined); - break; - } - case _kinds.Kind.VARIABLE_DEFINITION: - { - const inputType = (0, _typeFromAST.typeFromAST)(schema, node.type); - this._inputTypeStack.push((0, _definition.isInputType)(inputType) ? inputType : undefined); - break; - } - case _kinds.Kind.ARGUMENT: - { - var _this$getDirective; - let argDef; - let argType; - const fieldOrDirective = (_this$getDirective = this.getDirective()) !== null && _this$getDirective !== void 0 ? _this$getDirective : this.getFieldDef(); - if (fieldOrDirective) { - argDef = fieldOrDirective.args.find(arg => arg.name === node.name.value); - if (argDef) { - argType = argDef.type; - } - } - this._argument = argDef; - this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined); - this._inputTypeStack.push((0, _definition.isInputType)(argType) ? argType : undefined); - break; - } - case _kinds.Kind.LIST: - { - const listType = (0, _definition.getNullableType)(this.getInputType()); - const itemType = (0, _definition.isListType)(listType) ? listType.ofType : listType; // List positions never have a default value. - - this._defaultValueStack.push(undefined); - this._inputTypeStack.push((0, _definition.isInputType)(itemType) ? itemType : undefined); - break; - } - case _kinds.Kind.OBJECT_FIELD: - { - const objectType = (0, _definition.getNamedType)(this.getInputType()); - let inputFieldType; - let inputField; - if ((0, _definition.isInputObjectType)(objectType)) { - inputField = objectType.getFields()[node.name.value]; - if (inputField) { - inputFieldType = inputField.type; - } - } - this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined); - this._inputTypeStack.push((0, _definition.isInputType)(inputFieldType) ? inputFieldType : undefined); - break; - } - case _kinds.Kind.ENUM: - { - const enumType = (0, _definition.getNamedType)(this.getInputType()); - let enumValue; - if ((0, _definition.isEnumType)(enumType)) { - enumValue = enumType.getValue(node.value); - } - this._enumValue = enumValue; - break; - } - default: // Ignore other nodes - } +})); +Object.defineProperty(exports, "KnownDirectivesRule", ({ + enumerable: true, + get: function () { + return _index4.KnownDirectivesRule; } - leave(node) { - switch (node.kind) { - case _kinds.Kind.SELECTION_SET: - this._parentTypeStack.pop(); - break; - case _kinds.Kind.FIELD: - this._fieldDefStack.pop(); - this._typeStack.pop(); - break; - case _kinds.Kind.DIRECTIVE: - this._directive = null; - break; - case _kinds.Kind.OPERATION_DEFINITION: - case _kinds.Kind.INLINE_FRAGMENT: - case _kinds.Kind.FRAGMENT_DEFINITION: - this._typeStack.pop(); - break; - case _kinds.Kind.VARIABLE_DEFINITION: - this._inputTypeStack.pop(); - break; - case _kinds.Kind.ARGUMENT: - this._argument = null; - this._defaultValueStack.pop(); - this._inputTypeStack.pop(); - break; - case _kinds.Kind.LIST: - case _kinds.Kind.OBJECT_FIELD: - this._defaultValueStack.pop(); - this._inputTypeStack.pop(); - break; - case _kinds.Kind.ENUM: - this._enumValue = null; - break; - default: // Ignore other nodes - } +})); +Object.defineProperty(exports, "KnownFragmentNamesRule", ({ + enumerable: true, + get: function () { + return _index4.KnownFragmentNamesRule; } -} - -/** - * Not exactly the same as the executor's definition of getFieldDef, in this - * statically evaluated environment we do not always have an Object type, - * and need to handle Interface and Union types. - */ -exports.TypeInfo = TypeInfo; -function getFieldDef(schema, parentType, fieldNode) { - const name = fieldNode.name.value; - if (name === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { - return _introspection.SchemaMetaFieldDef; +})); +Object.defineProperty(exports, "KnownTypeNamesRule", ({ + enumerable: true, + get: function () { + return _index4.KnownTypeNamesRule; } - if (name === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) { - return _introspection.TypeMetaFieldDef; +})); +Object.defineProperty(exports, "Lexer", ({ + enumerable: true, + get: function () { + return _index2.Lexer; } - if (name === _introspection.TypeNameMetaFieldDef.name && (0, _definition.isCompositeType)(parentType)) { - return _introspection.TypeNameMetaFieldDef; +})); +Object.defineProperty(exports, "Location", ({ + enumerable: true, + get: function () { + return _index2.Location; } - if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) { - return parentType.getFields()[name]; +})); +Object.defineProperty(exports, "LoneAnonymousOperationRule", ({ + enumerable: true, + get: function () { + return _index4.LoneAnonymousOperationRule; } -} -/** - * Creates a new visitor instance which maintains a provided TypeInfo instance - * along with visiting visitor. - */ - -function visitWithTypeInfo(typeInfo, visitor) { - return { - enter(...args) { - const node = args[0]; - typeInfo.enter(node); - const fn = (0, _visitor.getEnterLeaveForKind)(visitor, node.kind).enter; - if (fn) { - const result = fn.apply(visitor, args); - if (result !== undefined) { - typeInfo.leave(node); - if ((0, _ast.isNode)(result)) { - typeInfo.enter(result); - } - } - return result; - } - }, - leave(...args) { - const node = args[0]; - const fn = (0, _visitor.getEnterLeaveForKind)(visitor, node.kind).leave; - let result; - if (fn) { - result = fn.apply(visitor, args); - } - typeInfo.leave(node); - return result; - } - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/assertValidName.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/assertValidName.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.assertValidName = assertValidName; -exports.isValidNameError = isValidNameError; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _assertName = __webpack_require__(/*! ../type/assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); -/* c8 ignore start */ - -/** - * Upholds the spec rules about naming. - * @deprecated Please use `assertName` instead. Will be removed in v17 - */ - -function assertValidName(name) { - const error = isValidNameError(name); - if (error) { - throw error; +Object.defineProperty(exports, "LoneSchemaDefinitionRule", ({ + enumerable: true, + get: function () { + return _index4.LoneSchemaDefinitionRule; } - return name; -} -/** - * Returns an Error if a name is invalid. - * @deprecated Please use `assertName` instead. Will be removed in v17 - */ - -function isValidNameError(name) { - typeof name === 'string' || (0, _devAssert.devAssert)(false, 'Expected name to be a string.'); - if (name.startsWith('__')) { - return new _GraphQLError.GraphQLError(`Name "${name}" must not begin with "__", which is reserved by GraphQL introspection.`); +})); +Object.defineProperty(exports, "MaxIntrospectionDepthRule", ({ + enumerable: true, + get: function () { + return _index4.MaxIntrospectionDepthRule; } - try { - (0, _assertName.assertName)(name); - } catch (error) { - return error; +})); +Object.defineProperty(exports, "NoDeprecatedCustomRule", ({ + enumerable: true, + get: function () { + return _index4.NoDeprecatedCustomRule; } -} -/* c8 ignore stop */ - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/astFromValue.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/astFromValue.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.astFromValue = astFromValue; -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _isIterableObject = __webpack_require__(/*! ../jsutils/isIterableObject.mjs */ "../../../node_modules/graphql/jsutils/isIterableObject.mjs"); -var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -/** - * Produces a GraphQL Value AST given a JavaScript object. - * Function will match JavaScript/JSON values to GraphQL AST schema format - * by using suggested GraphQLInputType. For example: - * - * astFromValue("value", GraphQLString) - * - * A GraphQL type must be provided, which will be used to interpret different - * JavaScript values. - * - * | JSON Value | GraphQL Value | - * | ------------- | -------------------- | - * | Object | Input Object | - * | Array | List | - * | Boolean | Boolean | - * | String | String / Enum Value | - * | Number | Int / Float | - * | Unknown | Enum Value | - * | null | NullValue | - * - */ - -function astFromValue(value, type) { - if ((0, _definition.isNonNullType)(type)) { - const astValue = astFromValue(value, type.ofType); - if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) { - return null; - } - return astValue; - } // only explicit null, not undefined, NaN - - if (value === null) { - return { - kind: _kinds.Kind.NULL - }; - } // undefined - - if (value === undefined) { - return null; - } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but - // the value is not an array, convert the value using the list's item type. - - if ((0, _definition.isListType)(type)) { - const itemType = type.ofType; - if ((0, _isIterableObject.isIterableObject)(value)) { - const valuesNodes = []; - for (const item of value) { - const itemNode = astFromValue(item, itemType); - if (itemNode != null) { - valuesNodes.push(itemNode); - } - } - return { - kind: _kinds.Kind.LIST, - values: valuesNodes - }; - } - return astFromValue(value, itemType); - } // Populate the fields of the input object by creating ASTs from each value - // in the JavaScript object according to the fields in the input type. - - if ((0, _definition.isInputObjectType)(type)) { - if (!(0, _isObjectLike.isObjectLike)(value)) { - return null; - } - const fieldNodes = []; - for (const field of Object.values(type.getFields())) { - const fieldValue = astFromValue(value[field.name], field.type); - if (fieldValue) { - fieldNodes.push({ - kind: _kinds.Kind.OBJECT_FIELD, - name: { - kind: _kinds.Kind.NAME, - value: field.name - }, - value: fieldValue - }); - } - } - return { - kind: _kinds.Kind.OBJECT, - fields: fieldNodes - }; +Object.defineProperty(exports, "NoFragmentCyclesRule", ({ + enumerable: true, + get: function () { + return _index4.NoFragmentCyclesRule; } - if ((0, _definition.isLeafType)(type)) { - // Since value is an internally represented value, it must be serialized - // to an externally represented value before converting into an AST. - const serialized = type.serialize(value); - if (serialized == null) { - return null; - } // Others serialize based on their corresponding JavaScript scalar types. - - if (typeof serialized === 'boolean') { - return { - kind: _kinds.Kind.BOOLEAN, - value: serialized - }; - } // JavaScript numbers can be Int or Float values. - - if (typeof serialized === 'number' && Number.isFinite(serialized)) { - const stringNum = String(serialized); - return integerStringRegExp.test(stringNum) ? { - kind: _kinds.Kind.INT, - value: stringNum - } : { - kind: _kinds.Kind.FLOAT, - value: stringNum - }; - } - if (typeof serialized === 'string') { - // Enum types use Enum literals. - if ((0, _definition.isEnumType)(type)) { - return { - kind: _kinds.Kind.ENUM, - value: serialized - }; - } // ID types can use Int literals. - - if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) { - return { - kind: _kinds.Kind.INT, - value: serialized - }; - } - return { - kind: _kinds.Kind.STRING, - value: serialized - }; - } - throw new TypeError(`Cannot convert value to AST: ${(0, _inspect.inspect)(serialized)}.`); +})); +Object.defineProperty(exports, "NoSchemaIntrospectionCustomRule", ({ + enumerable: true, + get: function () { + return _index4.NoSchemaIntrospectionCustomRule; } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0, _invariant.invariant)(false, 'Unexpected input type: ' + (0, _inspect.inspect)(type)); -} -/** - * IntValue: - * - NegativeSign? 0 - * - NegativeSign? NonZeroDigit ( Digit+ )? - */ - -const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/buildASTSchema.mjs": -/*!******************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/buildASTSchema.mjs ***! - \******************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.buildASTSchema = buildASTSchema; -exports.buildSchema = buildSchema; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _parser = __webpack_require__(/*! ../language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); -var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -var _schema = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); -var _validate = __webpack_require__(/*! ../validation/validate.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); -var _extendSchema = __webpack_require__(/*! ./extendSchema.mjs */ "../../../node_modules/graphql/utilities/extendSchema.mjs"); -/** - * This takes the ast of a schema document produced by the parse function in - * src/language/parser.js. - * - * If no schema definition is provided, then it will look for types named Query, - * Mutation and Subscription. - * - * Given that AST it constructs a GraphQLSchema. The resulting schema - * has no resolve methods, so execution will use default resolvers. - */ -function buildASTSchema(documentAST, options) { - documentAST != null && documentAST.kind === _kinds.Kind.DOCUMENT || (0, _devAssert.devAssert)(false, 'Must provide valid Document AST.'); - if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) { - (0, _validate.assertValidSDL)(documentAST); +Object.defineProperty(exports, "NoUndefinedVariablesRule", ({ + enumerable: true, + get: function () { + return _index4.NoUndefinedVariablesRule; } - const emptySchemaConfig = { - description: undefined, - types: [], - directives: [], - extensions: Object.create(null), - extensionASTNodes: [], - assumeValid: false - }; - const config = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options); - if (config.astNode == null) { - for (const type of config.types) { - switch (type.name) { - // Note: While this could make early assertions to get the correctly - // typed values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - case 'Query': - // @ts-expect-error validated in `validateSchema` - config.query = type; - break; - case 'Mutation': - // @ts-expect-error validated in `validateSchema` - config.mutation = type; - break; - case 'Subscription': - // @ts-expect-error validated in `validateSchema` - config.subscription = type; - break; - } - } +})); +Object.defineProperty(exports, "NoUnusedFragmentsRule", ({ + enumerable: true, + get: function () { + return _index4.NoUnusedFragmentsRule; } - const directives = [...config.directives, - // If specified directives were not explicitly declared, add them. - ..._directives.specifiedDirectives.filter(stdDirective => config.directives.every(directive => directive.name !== stdDirective.name))]; - return new _schema.GraphQLSchema({ - ...config, - directives - }); -} -/** - * A helper function to build a GraphQLSchema directly from a source - * document. - */ - -function buildSchema(source, options) { - const document = (0, _parser.parse)(source, { - noLocation: options === null || options === void 0 ? void 0 : options.noLocation, - allowLegacyFragmentVariables: options === null || options === void 0 ? void 0 : options.allowLegacyFragmentVariables - }); - return buildASTSchema(document, { - assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL, - assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid - }); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/buildClientSchema.mjs": -/*!*********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/buildClientSchema.mjs ***! - \*********************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.buildClientSchema = buildClientSchema; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -var _keyValMap = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); -var _parser = __webpack_require__(/*! ../language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -var _schema = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); -var _valueFromAST = __webpack_require__(/*! ./valueFromAST.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); -/** - * Build a GraphQLSchema for use by client tools. - * - * Given the result of a client running the introspection query, creates and - * returns a GraphQLSchema instance which can be then used with all graphql-js - * tools, but cannot be used to execute a query, as introspection does not - * represent the "resolver", "parse" or "serialize" functions or any other - * server-internal mechanisms. - * - * This function expects a complete introspection result. Don't forget to check - * the "errors" field of a server response before calling this function. - */ - -function buildClientSchema(introspection, options) { - (0, _isObjectLike.isObjectLike)(introspection) && (0, _isObjectLike.isObjectLike)(introspection.__schema) || (0, _devAssert.devAssert)(false, `Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0, _inspect.inspect)(introspection)}.`); // Get the schema from the introspection result. - - const schemaIntrospection = introspection.__schema; // Iterate through all types, getting the type definition for each. - - const typeMap = (0, _keyValMap.keyValMap)(schemaIntrospection.types, typeIntrospection => typeIntrospection.name, typeIntrospection => buildType(typeIntrospection)); // Include standard types only if they are used. - - for (const stdType of [..._scalars.specifiedScalarTypes, ..._introspection.introspectionTypes]) { - if (typeMap[stdType.name]) { - typeMap[stdType.name] = stdType; - } - } // Get the root Query, Mutation, and Subscription types. - - const queryType = schemaIntrospection.queryType ? getObjectType(schemaIntrospection.queryType) : null; - const mutationType = schemaIntrospection.mutationType ? getObjectType(schemaIntrospection.mutationType) : null; - const subscriptionType = schemaIntrospection.subscriptionType ? getObjectType(schemaIntrospection.subscriptionType) : null; // Get the directives supported by Introspection, assuming empty-set if - // directives were not queried for. - - const directives = schemaIntrospection.directives ? schemaIntrospection.directives.map(buildDirective) : []; // Then produce and return a Schema with these types. - - return new _schema.GraphQLSchema({ - description: schemaIntrospection.description, - query: queryType, - mutation: mutationType, - subscription: subscriptionType, - types: Object.values(typeMap), - directives, - assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid - }); // Given a type reference in introspection, return the GraphQLType instance. - // preferring cached instances before building new instances. - - function getType(typeRef) { - if (typeRef.kind === _introspection.TypeKind.LIST) { - const itemRef = typeRef.ofType; - if (!itemRef) { - throw new Error('Decorated type deeper than introspection query.'); - } - return new _definition.GraphQLList(getType(itemRef)); - } - if (typeRef.kind === _introspection.TypeKind.NON_NULL) { - const nullableRef = typeRef.ofType; - if (!nullableRef) { - throw new Error('Decorated type deeper than introspection query.'); - } - const nullableType = getType(nullableRef); - return new _definition.GraphQLNonNull((0, _definition.assertNullableType)(nullableType)); - } - return getNamedType(typeRef); +Object.defineProperty(exports, "NoUnusedVariablesRule", ({ + enumerable: true, + get: function () { + return _index4.NoUnusedVariablesRule; } - function getNamedType(typeRef) { - const typeName = typeRef.name; - if (!typeName) { - throw new Error(`Unknown type reference: ${(0, _inspect.inspect)(typeRef)}.`); - } - const type = typeMap[typeName]; - if (!type) { - throw new Error(`Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`); - } - return type; +})); +Object.defineProperty(exports, "OperationTypeNode", ({ + enumerable: true, + get: function () { + return _index2.OperationTypeNode; } - function getObjectType(typeRef) { - return (0, _definition.assertObjectType)(getNamedType(typeRef)); +})); +Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", ({ + enumerable: true, + get: function () { + return _index4.OverlappingFieldsCanBeMergedRule; } - function getInterfaceType(typeRef) { - return (0, _definition.assertInterfaceType)(getNamedType(typeRef)); - } // Given a type's introspection result, construct the correct - // GraphQLType instance. - - function buildType(type) { - // eslint-disable-next-line @typescript-eslint/prefer-optional-chain - if (type != null && type.name != null && type.kind != null) { - // FIXME: Properly type IntrospectionType, it's a breaking change so fix in v17 - // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check - switch (type.kind) { - case _introspection.TypeKind.SCALAR: - return buildScalarDef(type); - case _introspection.TypeKind.OBJECT: - return buildObjectDef(type); - case _introspection.TypeKind.INTERFACE: - return buildInterfaceDef(type); - case _introspection.TypeKind.UNION: - return buildUnionDef(type); - case _introspection.TypeKind.ENUM: - return buildEnumDef(type); - case _introspection.TypeKind.INPUT_OBJECT: - return buildInputObjectDef(type); - } - } - const typeStr = (0, _inspect.inspect)(type); - throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${typeStr}.`); +})); +Object.defineProperty(exports, "PossibleFragmentSpreadsRule", ({ + enumerable: true, + get: function () { + return _index4.PossibleFragmentSpreadsRule; } - function buildScalarDef(scalarIntrospection) { - return new _definition.GraphQLScalarType({ - name: scalarIntrospection.name, - description: scalarIntrospection.description, - specifiedByURL: scalarIntrospection.specifiedByURL - }); +})); +Object.defineProperty(exports, "PossibleTypeExtensionsRule", ({ + enumerable: true, + get: function () { + return _index4.PossibleTypeExtensionsRule; } - function buildImplementationsList(implementingIntrospection) { - // TODO: Temporary workaround until GraphQL ecosystem will fully support - // 'interfaces' on interface types. - if (implementingIntrospection.interfaces === null && implementingIntrospection.kind === _introspection.TypeKind.INTERFACE) { - return []; - } - if (!implementingIntrospection.interfaces) { - const implementingIntrospectionStr = (0, _inspect.inspect)(implementingIntrospection); - throw new Error(`Introspection result missing interfaces: ${implementingIntrospectionStr}.`); - } - return implementingIntrospection.interfaces.map(getInterfaceType); +})); +Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", ({ + enumerable: true, + get: function () { + return _index4.ProvidedRequiredArgumentsRule; } - function buildObjectDef(objectIntrospection) { - return new _definition.GraphQLObjectType({ - name: objectIntrospection.name, - description: objectIntrospection.description, - interfaces: () => buildImplementationsList(objectIntrospection), - fields: () => buildFieldDefMap(objectIntrospection) - }); +})); +Object.defineProperty(exports, "ScalarLeafsRule", ({ + enumerable: true, + get: function () { + return _index4.ScalarLeafsRule; } - function buildInterfaceDef(interfaceIntrospection) { - return new _definition.GraphQLInterfaceType({ - name: interfaceIntrospection.name, - description: interfaceIntrospection.description, - interfaces: () => buildImplementationsList(interfaceIntrospection), - fields: () => buildFieldDefMap(interfaceIntrospection) - }); +})); +Object.defineProperty(exports, "SchemaMetaFieldDef", ({ + enumerable: true, + get: function () { + return _index.SchemaMetaFieldDef; } - function buildUnionDef(unionIntrospection) { - if (!unionIntrospection.possibleTypes) { - const unionIntrospectionStr = (0, _inspect.inspect)(unionIntrospection); - throw new Error(`Introspection result missing possibleTypes: ${unionIntrospectionStr}.`); - } - return new _definition.GraphQLUnionType({ - name: unionIntrospection.name, - description: unionIntrospection.description, - types: () => unionIntrospection.possibleTypes.map(getObjectType) - }); +})); +Object.defineProperty(exports, "SingleFieldSubscriptionsRule", ({ + enumerable: true, + get: function () { + return _index4.SingleFieldSubscriptionsRule; } - function buildEnumDef(enumIntrospection) { - if (!enumIntrospection.enumValues) { - const enumIntrospectionStr = (0, _inspect.inspect)(enumIntrospection); - throw new Error(`Introspection result missing enumValues: ${enumIntrospectionStr}.`); - } - return new _definition.GraphQLEnumType({ - name: enumIntrospection.name, - description: enumIntrospection.description, - values: (0, _keyValMap.keyValMap)(enumIntrospection.enumValues, valueIntrospection => valueIntrospection.name, valueIntrospection => ({ - description: valueIntrospection.description, - deprecationReason: valueIntrospection.deprecationReason - })) - }); +})); +Object.defineProperty(exports, "Source", ({ + enumerable: true, + get: function () { + return _index2.Source; } - function buildInputObjectDef(inputObjectIntrospection) { - if (!inputObjectIntrospection.inputFields) { - const inputObjectIntrospectionStr = (0, _inspect.inspect)(inputObjectIntrospection); - throw new Error(`Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`); - } - return new _definition.GraphQLInputObjectType({ - name: inputObjectIntrospection.name, - description: inputObjectIntrospection.description, - fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields), - isOneOf: inputObjectIntrospection.isOneOf - }); +})); +Object.defineProperty(exports, "Token", ({ + enumerable: true, + get: function () { + return _index2.Token; } - function buildFieldDefMap(typeIntrospection) { - if (!typeIntrospection.fields) { - throw new Error(`Introspection result missing fields: ${(0, _inspect.inspect)(typeIntrospection)}.`); - } - return (0, _keyValMap.keyValMap)(typeIntrospection.fields, fieldIntrospection => fieldIntrospection.name, buildField); +})); +Object.defineProperty(exports, "TokenKind", ({ + enumerable: true, + get: function () { + return _index2.TokenKind; } - function buildField(fieldIntrospection) { - const type = getType(fieldIntrospection.type); - if (!(0, _definition.isOutputType)(type)) { - const typeStr = (0, _inspect.inspect)(type); - throw new Error(`Introspection must provide output type for fields, but received: ${typeStr}.`); - } - if (!fieldIntrospection.args) { - const fieldIntrospectionStr = (0, _inspect.inspect)(fieldIntrospection); - throw new Error(`Introspection result missing field args: ${fieldIntrospectionStr}.`); - } - return { - description: fieldIntrospection.description, - deprecationReason: fieldIntrospection.deprecationReason, - type, - args: buildInputValueDefMap(fieldIntrospection.args) - }; +})); +Object.defineProperty(exports, "TypeInfo", ({ + enumerable: true, + get: function () { + return _index6.TypeInfo; } - function buildInputValueDefMap(inputValueIntrospections) { - return (0, _keyValMap.keyValMap)(inputValueIntrospections, inputValue => inputValue.name, buildInputValue); +})); +Object.defineProperty(exports, "TypeKind", ({ + enumerable: true, + get: function () { + return _index.TypeKind; } - function buildInputValue(inputValueIntrospection) { - const type = getType(inputValueIntrospection.type); - if (!(0, _definition.isInputType)(type)) { - const typeStr = (0, _inspect.inspect)(type); - throw new Error(`Introspection must provide input type for arguments, but received: ${typeStr}.`); - } - const defaultValue = inputValueIntrospection.defaultValue != null ? (0, _valueFromAST.valueFromAST)((0, _parser.parseValue)(inputValueIntrospection.defaultValue), type) : undefined; - return { - description: inputValueIntrospection.description, - type, - defaultValue, - deprecationReason: inputValueIntrospection.deprecationReason - }; +})); +Object.defineProperty(exports, "TypeMetaFieldDef", ({ + enumerable: true, + get: function () { + return _index.TypeMetaFieldDef; } - function buildDirective(directiveIntrospection) { - if (!directiveIntrospection.args) { - const directiveIntrospectionStr = (0, _inspect.inspect)(directiveIntrospection); - throw new Error(`Introspection result missing directive args: ${directiveIntrospectionStr}.`); - } - if (!directiveIntrospection.locations) { - const directiveIntrospectionStr = (0, _inspect.inspect)(directiveIntrospection); - throw new Error(`Introspection result missing directive locations: ${directiveIntrospectionStr}.`); - } - return new _directives.GraphQLDirective({ - name: directiveIntrospection.name, - description: directiveIntrospection.description, - isRepeatable: directiveIntrospection.isRepeatable, - locations: directiveIntrospection.locations.slice(), - args: buildInputValueDefMap(directiveIntrospection.args) - }); +})); +Object.defineProperty(exports, "TypeNameMetaFieldDef", ({ + enumerable: true, + get: function () { + return _index.TypeNameMetaFieldDef; } -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/coerceInputValue.mjs": -/*!********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/coerceInputValue.mjs ***! - \********************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.coerceInputValue = coerceInputValue; -var _didYouMean = __webpack_require__(/*! ../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _isIterableObject = __webpack_require__(/*! ../jsutils/isIterableObject.mjs */ "../../../node_modules/graphql/jsutils/isIterableObject.mjs"); -var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -var _Path = __webpack_require__(/*! ../jsutils/Path.mjs */ "../../../node_modules/graphql/jsutils/Path.mjs"); -var _printPathArray = __webpack_require__(/*! ../jsutils/printPathArray.mjs */ "../../../node_modules/graphql/jsutils/printPathArray.mjs"); -var _suggestionList = __webpack_require__(/*! ../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/** - * Coerces a JavaScript value given a GraphQL Input Type. - */ -function coerceInputValue(inputValue, type, onError = defaultOnError) { - return coerceInputValueImpl(inputValue, type, onError, undefined); -} -function defaultOnError(path, invalidValue, error) { - let errorPrefix = 'Invalid value ' + (0, _inspect.inspect)(invalidValue); - if (path.length > 0) { - errorPrefix += ` at "value${(0, _printPathArray.printPathArray)(path)}"`; +Object.defineProperty(exports, "UniqueArgumentDefinitionNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueArgumentDefinitionNamesRule; } - error.message = errorPrefix + ': ' + error.message; - throw error; -} -function coerceInputValueImpl(inputValue, type, onError, path) { - if ((0, _definition.isNonNullType)(type)) { - if (inputValue != null) { - return coerceInputValueImpl(inputValue, type.ofType, onError, path); - } - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Expected non-nullable type "${(0, _inspect.inspect)(type)}" not to be null.`)); - return; +})); +Object.defineProperty(exports, "UniqueArgumentNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueArgumentNamesRule; } - if (inputValue == null) { - // Explicitly return the value null. - return null; +})); +Object.defineProperty(exports, "UniqueDirectiveNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueDirectiveNamesRule; } - if ((0, _definition.isListType)(type)) { - const itemType = type.ofType; - if ((0, _isIterableObject.isIterableObject)(inputValue)) { - return Array.from(inputValue, (itemValue, index) => { - const itemPath = (0, _Path.addPath)(path, index, undefined); - return coerceInputValueImpl(itemValue, itemType, onError, itemPath); - }); - } // Lists accept a non-list value as a list of one. - - return [coerceInputValueImpl(inputValue, itemType, onError, path)]; +})); +Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueDirectivesPerLocationRule; } - if ((0, _definition.isInputObjectType)(type)) { - if (!(0, _isObjectLike.isObjectLike)(inputValue)) { - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Expected type "${type.name}" to be an object.`)); - return; - } - const coercedValue = {}; - const fieldDefs = type.getFields(); - for (const field of Object.values(fieldDefs)) { - const fieldValue = inputValue[field.name]; - if (fieldValue === undefined) { - if (field.defaultValue !== undefined) { - coercedValue[field.name] = field.defaultValue; - } else if ((0, _definition.isNonNullType)(field.type)) { - const typeStr = (0, _inspect.inspect)(field.type); - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Field "${field.name}" of required type "${typeStr}" was not provided.`)); - } - continue; - } - coercedValue[field.name] = coerceInputValueImpl(fieldValue, field.type, onError, (0, _Path.addPath)(path, field.name, type.name)); - } // Ensure every provided field is defined. - - for (const fieldName of Object.keys(inputValue)) { - if (!fieldDefs[fieldName]) { - const suggestions = (0, _suggestionList.suggestionList)(fieldName, Object.keys(type.getFields())); - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Field "${fieldName}" is not defined by type "${type.name}".` + (0, _didYouMean.didYouMean)(suggestions))); - } - } - if (type.isOneOf) { - const keys = Object.keys(coercedValue); - if (keys.length !== 1) { - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Exactly one key must be specified for OneOf type "${type.name}".`)); - } - const key = keys[0]; - const value = coercedValue[key]; - if (value === null) { - onError((0, _Path.pathToArray)(path).concat(key), value, new _GraphQLError.GraphQLError(`Field "${key}" must be non-null.`)); - } - } - return coercedValue; +})); +Object.defineProperty(exports, "UniqueEnumValueNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueEnumValueNamesRule; } - if ((0, _definition.isLeafType)(type)) { - let parseResult; // Scalars and Enums determine if a input value is valid via parseValue(), - // which can throw to indicate failure. If it throws, maintain a reference - // to the original error. - - try { - parseResult = type.parseValue(inputValue); - } catch (error) { - if (error instanceof _GraphQLError.GraphQLError) { - onError((0, _Path.pathToArray)(path), inputValue, error); - } else { - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Expected type "${type.name}". ` + error.message, { - originalError: error - })); - } - return; - } - if (parseResult === undefined) { - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Expected type "${type.name}".`)); - } - return parseResult; +})); +Object.defineProperty(exports, "UniqueFieldDefinitionNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueFieldDefinitionNamesRule; } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0, _invariant.invariant)(false, 'Unexpected input type: ' + (0, _inspect.inspect)(type)); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/concatAST.mjs": -/*!*************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/concatAST.mjs ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.concatAST = concatAST; -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/** - * Provided a collection of ASTs, presumably each from different files, - * concatenate the ASTs together into batched AST, useful for validating many - * GraphQL source files which together represent one conceptual application. - */ - -function concatAST(documents) { - const definitions = []; - for (const doc of documents) { - definitions.push(...doc.definitions); +Object.defineProperty(exports, "UniqueFragmentNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueFragmentNamesRule; } - return { - kind: _kinds.Kind.DOCUMENT, - definitions - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/extendSchema.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/extendSchema.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.extendSchema = extendSchema; -exports.extendSchemaImpl = extendSchemaImpl; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _keyMap = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -var _mapValue = __webpack_require__(/*! ../jsutils/mapValue.mjs */ "../../../node_modules/graphql/jsutils/mapValue.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _predicates = __webpack_require__(/*! ../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -var _schema = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); -var _validate = __webpack_require__(/*! ../validation/validate.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); -var _values = __webpack_require__(/*! ../execution/values.mjs */ "../../../node_modules/graphql/execution/values.mjs"); -var _valueFromAST = __webpack_require__(/*! ./valueFromAST.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); -/** - * Produces a new schema given an existing schema and a document which may - * contain GraphQL type extensions and definitions. The original schema will - * remain unaltered. - * - * Because a schema represents a graph of references, a schema cannot be - * extended without effectively making an entire copy. We do not know until it's - * too late if subgraphs remain unchanged. - * - * This algorithm copies the provided schema, applying extensions while - * producing the copy. The original schema remains unaltered. - */ -function extendSchema(schema, documentAST, options) { - (0, _schema.assertSchema)(schema); - documentAST != null && documentAST.kind === _kinds.Kind.DOCUMENT || (0, _devAssert.devAssert)(false, 'Must provide valid Document AST.'); - if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) { - (0, _validate.assertValidSDLExtension)(documentAST, schema); +Object.defineProperty(exports, "UniqueInputFieldNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueInputFieldNamesRule; } - const schemaConfig = schema.toConfig(); - const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options); - return schemaConfig === extendedConfig ? schema : new _schema.GraphQLSchema(extendedConfig); -} -/** - * @internal - */ - -function extendSchemaImpl(schemaConfig, documentAST, options) { - var _schemaDef, _schemaDef$descriptio, _schemaDef2, _options$assumeValid; - - // Collect the type definitions and extensions found in the document. - const typeDefs = []; - const typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can - // have the same name. For example, a type named "skip". - - const directiveDefs = []; - let schemaDef; // Schema extensions are collected which may add additional operation types. - - const schemaExtensions = []; - for (const def of documentAST.definitions) { - if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) { - schemaDef = def; - } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) { - schemaExtensions.push(def); - } else if ((0, _predicates.isTypeDefinitionNode)(def)) { - typeDefs.push(def); - } else if ((0, _predicates.isTypeExtensionNode)(def)) { - const extendedTypeName = def.name.value; - const existingTypeExtensions = typeExtensionsMap[extendedTypeName]; - typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def]; - } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { - directiveDefs.push(def); - } - } // If this document contains no new types, extensions, or directives then - // return the same unmodified GraphQLSchema instance. - - if (Object.keys(typeExtensionsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExtensions.length === 0 && schemaDef == null) { - return schemaConfig; +})); +Object.defineProperty(exports, "UniqueOperationNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueOperationNamesRule; } - const typeMap = Object.create(null); - for (const existingType of schemaConfig.types) { - typeMap[existingType.name] = extendNamedType(existingType); +})); +Object.defineProperty(exports, "UniqueOperationTypesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueOperationTypesRule; } - for (const typeNode of typeDefs) { - var _stdTypeMap$name; - const name = typeNode.name.value; - typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode); +})); +Object.defineProperty(exports, "UniqueTypeNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueTypeNamesRule; } - const operationTypes = { - // Get the extended root operation types. - query: schemaConfig.query && replaceNamedType(schemaConfig.query), - mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation), - subscription: schemaConfig.subscription && replaceNamedType(schemaConfig.subscription), - // Then, incorporate schema definition and all schema extensions. - ...(schemaDef && getOperationTypes([schemaDef])), - ...getOperationTypes(schemaExtensions) - }; // Then produce and return a Schema config with these types. - - return { - description: (_schemaDef = schemaDef) === null || _schemaDef === void 0 ? void 0 : (_schemaDef$descriptio = _schemaDef.description) === null || _schemaDef$descriptio === void 0 ? void 0 : _schemaDef$descriptio.value, - ...operationTypes, - types: Object.values(typeMap), - directives: [...schemaConfig.directives.map(replaceDirective), ...directiveDefs.map(buildDirective)], - extensions: Object.create(null), - astNode: (_schemaDef2 = schemaDef) !== null && _schemaDef2 !== void 0 ? _schemaDef2 : schemaConfig.astNode, - extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions), - assumeValid: (_options$assumeValid = options === null || options === void 0 ? void 0 : options.assumeValid) !== null && _options$assumeValid !== void 0 ? _options$assumeValid : false - }; // Below are functions used for producing this schema that have closed over - // this scope and have access to the schema, cache, and newly defined types. - - function replaceType(type) { - if ((0, _definition.isListType)(type)) { - // @ts-expect-error - return new _definition.GraphQLList(replaceType(type.ofType)); - } - if ((0, _definition.isNonNullType)(type)) { - // @ts-expect-error - return new _definition.GraphQLNonNull(replaceType(type.ofType)); - } // @ts-expect-error FIXME - - return replaceNamedType(type); +})); +Object.defineProperty(exports, "UniqueVariableNamesRule", ({ + enumerable: true, + get: function () { + return _index4.UniqueVariableNamesRule; } - function replaceNamedType(type) { - // Note: While this could make early assertions to get the correctly - // typed values, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - return typeMap[type.name]; +})); +Object.defineProperty(exports, "ValidationContext", ({ + enumerable: true, + get: function () { + return _index4.ValidationContext; } - function replaceDirective(directive) { - const config = directive.toConfig(); - return new _directives.GraphQLDirective({ - ...config, - args: (0, _mapValue.mapValue)(config.args, extendArg) - }); +})); +Object.defineProperty(exports, "ValuesOfCorrectTypeRule", ({ + enumerable: true, + get: function () { + return _index4.ValuesOfCorrectTypeRule; } - function extendNamedType(type) { - if ((0, _introspection.isIntrospectionType)(type) || (0, _scalars.isSpecifiedScalarType)(type)) { - // Builtin types are not extended. - return type; - } - if ((0, _definition.isScalarType)(type)) { - return extendScalarType(type); - } - if ((0, _definition.isObjectType)(type)) { - return extendObjectType(type); - } - if ((0, _definition.isInterfaceType)(type)) { - return extendInterfaceType(type); - } - if ((0, _definition.isUnionType)(type)) { - return extendUnionType(type); - } - if ((0, _definition.isEnumType)(type)) { - return extendEnumType(type); - } - if ((0, _definition.isInputObjectType)(type)) { - return extendInputObjectType(type); - } - /* c8 ignore next 3 */ - // Not reachable, all possible type definition nodes have been considered. - - false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); +})); +Object.defineProperty(exports, "VariablesAreInputTypesRule", ({ + enumerable: true, + get: function () { + return _index4.VariablesAreInputTypesRule; } - function extendInputObjectType(type) { - var _typeExtensionsMap$co; - const config = type.toConfig(); - const extensions = (_typeExtensionsMap$co = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : []; - return new _definition.GraphQLInputObjectType({ - ...config, - fields: () => ({ - ...(0, _mapValue.mapValue)(config.fields, field => ({ - ...field, - type: replaceType(field.type) - })), - ...buildInputFieldMap(extensions) - }), - extensionASTNodes: config.extensionASTNodes.concat(extensions) - }); +})); +Object.defineProperty(exports, "VariablesInAllowedPositionRule", ({ + enumerable: true, + get: function () { + return _index4.VariablesInAllowedPositionRule; } - function extendEnumType(type) { - var _typeExtensionsMap$ty; - const config = type.toConfig(); - const extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : []; - return new _definition.GraphQLEnumType({ - ...config, - values: { - ...config.values, - ...buildEnumValueMap(extensions) - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - }); +})); +Object.defineProperty(exports, "__Directive", ({ + enumerable: true, + get: function () { + return _index.__Directive; } - function extendScalarType(type) { - var _typeExtensionsMap$co2; - const config = type.toConfig(); - const extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : []; - let specifiedByURL = config.specifiedByURL; - for (const extensionNode of extensions) { - var _getSpecifiedByURL; - specifiedByURL = (_getSpecifiedByURL = getSpecifiedByURL(extensionNode)) !== null && _getSpecifiedByURL !== void 0 ? _getSpecifiedByURL : specifiedByURL; - } - return new _definition.GraphQLScalarType({ - ...config, - specifiedByURL, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - }); +})); +Object.defineProperty(exports, "__DirectiveLocation", ({ + enumerable: true, + get: function () { + return _index.__DirectiveLocation; } - function extendObjectType(type) { - var _typeExtensionsMap$co3; - const config = type.toConfig(); - const extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : []; - return new _definition.GraphQLObjectType({ - ...config, - interfaces: () => [...type.getInterfaces().map(replaceNamedType), ...buildInterfaces(extensions)], - fields: () => ({ - ...(0, _mapValue.mapValue)(config.fields, extendField), - ...buildFieldMap(extensions) - }), - extensionASTNodes: config.extensionASTNodes.concat(extensions) - }); +})); +Object.defineProperty(exports, "__EnumValue", ({ + enumerable: true, + get: function () { + return _index.__EnumValue; } - function extendInterfaceType(type) { - var _typeExtensionsMap$co4; - const config = type.toConfig(); - const extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : []; - return new _definition.GraphQLInterfaceType({ - ...config, - interfaces: () => [...type.getInterfaces().map(replaceNamedType), ...buildInterfaces(extensions)], - fields: () => ({ - ...(0, _mapValue.mapValue)(config.fields, extendField), - ...buildFieldMap(extensions) - }), - extensionASTNodes: config.extensionASTNodes.concat(extensions) - }); +})); +Object.defineProperty(exports, "__Field", ({ + enumerable: true, + get: function () { + return _index.__Field; } - function extendUnionType(type) { - var _typeExtensionsMap$co5; - const config = type.toConfig(); - const extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : []; - return new _definition.GraphQLUnionType({ - ...config, - types: () => [...type.getTypes().map(replaceNamedType), ...buildUnionTypes(extensions)], - extensionASTNodes: config.extensionASTNodes.concat(extensions) - }); +})); +Object.defineProperty(exports, "__InputValue", ({ + enumerable: true, + get: function () { + return _index.__InputValue; } - function extendField(field) { - return { - ...field, - type: replaceType(field.type), - args: field.args && (0, _mapValue.mapValue)(field.args, extendArg) - }; +})); +Object.defineProperty(exports, "__Schema", ({ + enumerable: true, + get: function () { + return _index.__Schema; } - function extendArg(arg) { - return { - ...arg, - type: replaceType(arg.type) - }; +})); +Object.defineProperty(exports, "__Type", ({ + enumerable: true, + get: function () { + return _index.__Type; } - function getOperationTypes(nodes) { - const opTypes = {}; - for (const node of nodes) { - var _node$operationTypes; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const operationTypesNodes = /* c8 ignore next */ - (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : []; - for (const operationType of operationTypesNodes) { - // Note: While this could make early assertions to get the correctly - // typed values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - // @ts-expect-error - opTypes[operationType.operation] = getNamedType(operationType.type); - } - } - return opTypes; +})); +Object.defineProperty(exports, "__TypeKind", ({ + enumerable: true, + get: function () { + return _index.__TypeKind; } - function getNamedType(node) { - var _stdTypeMap$name2; - const name = node.name.value; - const type = (_stdTypeMap$name2 = stdTypeMap[name]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name]; - if (type === undefined) { - throw new Error(`Unknown type: "${name}".`); - } - return type; +})); +Object.defineProperty(exports, "assertAbstractType", ({ + enumerable: true, + get: function () { + return _index.assertAbstractType; } - function getWrappedType(node) { - if (node.kind === _kinds.Kind.LIST_TYPE) { - return new _definition.GraphQLList(getWrappedType(node.type)); - } - if (node.kind === _kinds.Kind.NON_NULL_TYPE) { - return new _definition.GraphQLNonNull(getWrappedType(node.type)); - } - return getNamedType(node); +})); +Object.defineProperty(exports, "assertCompositeType", ({ + enumerable: true, + get: function () { + return _index.assertCompositeType; } - function buildDirective(node) { - var _node$description; - return new _directives.GraphQLDirective({ - name: node.name.value, - description: (_node$description = node.description) === null || _node$description === void 0 ? void 0 : _node$description.value, - // @ts-expect-error - locations: node.locations.map(({ - value - }) => value), - isRepeatable: node.repeatable, - args: buildArgumentMap(node.arguments), - astNode: node - }); +})); +Object.defineProperty(exports, "assertDirective", ({ + enumerable: true, + get: function () { + return _index.assertDirective; } - function buildFieldMap(nodes) { - const fieldConfigMap = Object.create(null); - for (const node of nodes) { - var _node$fields; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const nodeFields = /* c8 ignore next */ - (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : []; - for (const field of nodeFields) { - var _field$description; - fieldConfigMap[field.name.value] = { - // Note: While this could make assertions to get the correctly typed - // value, that would throw immediately while type system validation - // with validateSchema() will produce more actionable results. - type: getWrappedType(field.type), - description: (_field$description = field.description) === null || _field$description === void 0 ? void 0 : _field$description.value, - args: buildArgumentMap(field.arguments), - deprecationReason: getDeprecationReason(field), - astNode: field - }; - } - } - return fieldConfigMap; +})); +Object.defineProperty(exports, "assertEnumType", ({ + enumerable: true, + get: function () { + return _index.assertEnumType; } - function buildArgumentMap(args) { - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const argsNodes = /* c8 ignore next */ - args !== null && args !== void 0 ? args : []; - const argConfigMap = Object.create(null); - for (const arg of argsNodes) { - var _arg$description; - - // Note: While this could make assertions to get the correctly typed - // value, that would throw immediately while type system validation - // with validateSchema() will produce more actionable results. - const type = getWrappedType(arg.type); - argConfigMap[arg.name.value] = { - type, - description: (_arg$description = arg.description) === null || _arg$description === void 0 ? void 0 : _arg$description.value, - defaultValue: (0, _valueFromAST.valueFromAST)(arg.defaultValue, type), - deprecationReason: getDeprecationReason(arg), - astNode: arg - }; - } - return argConfigMap; +})); +Object.defineProperty(exports, "assertEnumValueName", ({ + enumerable: true, + get: function () { + return _index.assertEnumValueName; } - function buildInputFieldMap(nodes) { - const inputFieldMap = Object.create(null); - for (const node of nodes) { - var _node$fields2; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const fieldsNodes = /* c8 ignore next */ - (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0 ? _node$fields2 : []; - for (const field of fieldsNodes) { - var _field$description2; - - // Note: While this could make assertions to get the correctly typed - // value, that would throw immediately while type system validation - // with validateSchema() will produce more actionable results. - const type = getWrappedType(field.type); - inputFieldMap[field.name.value] = { - type, - description: (_field$description2 = field.description) === null || _field$description2 === void 0 ? void 0 : _field$description2.value, - defaultValue: (0, _valueFromAST.valueFromAST)(field.defaultValue, type), - deprecationReason: getDeprecationReason(field), - astNode: field - }; - } - } - return inputFieldMap; +})); +Object.defineProperty(exports, "assertInputObjectType", ({ + enumerable: true, + get: function () { + return _index.assertInputObjectType; } - function buildEnumValueMap(nodes) { - const enumValueMap = Object.create(null); - for (const node of nodes) { - var _node$values; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const valuesNodes = /* c8 ignore next */ - (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : []; - for (const value of valuesNodes) { - var _value$description; - enumValueMap[value.name.value] = { - description: (_value$description = value.description) === null || _value$description === void 0 ? void 0 : _value$description.value, - deprecationReason: getDeprecationReason(value), - astNode: value - }; - } - } - return enumValueMap; +})); +Object.defineProperty(exports, "assertInputType", ({ + enumerable: true, + get: function () { + return _index.assertInputType; } - function buildInterfaces(nodes) { - // Note: While this could make assertions to get the correctly typed - // values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - // @ts-expect-error - return nodes.flatMap( - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - node => { - var _node$interfaces$map, _node$interfaces; - return /* c8 ignore next */( - (_node$interfaces$map = (_node$interfaces = node.interfaces) === null || _node$interfaces === void 0 ? void 0 : _node$interfaces.map(getNamedType)) !== null && _node$interfaces$map !== void 0 ? _node$interfaces$map : [] - ); - }); +})); +Object.defineProperty(exports, "assertInterfaceType", ({ + enumerable: true, + get: function () { + return _index.assertInterfaceType; } - function buildUnionTypes(nodes) { - // Note: While this could make assertions to get the correctly typed - // values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - // @ts-expect-error - return nodes.flatMap( - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - node => { - var _node$types$map, _node$types; - return /* c8 ignore next */( - (_node$types$map = (_node$types = node.types) === null || _node$types === void 0 ? void 0 : _node$types.map(getNamedType)) !== null && _node$types$map !== void 0 ? _node$types$map : [] - ); - }); +})); +Object.defineProperty(exports, "assertLeafType", ({ + enumerable: true, + get: function () { + return _index.assertLeafType; } - function buildType(astNode) { - var _typeExtensionsMap$na; - const name = astNode.name.value; - const extensionASTNodes = (_typeExtensionsMap$na = typeExtensionsMap[name]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : []; - switch (astNode.kind) { - case _kinds.Kind.OBJECT_TYPE_DEFINITION: - { - var _astNode$description; - const allNodes = [astNode, ...extensionASTNodes]; - return new _definition.GraphQLObjectType({ - name, - description: (_astNode$description = astNode.description) === null || _astNode$description === void 0 ? void 0 : _astNode$description.value, - interfaces: () => buildInterfaces(allNodes), - fields: () => buildFieldMap(allNodes), - astNode, - extensionASTNodes - }); - } - case _kinds.Kind.INTERFACE_TYPE_DEFINITION: - { - var _astNode$description2; - const allNodes = [astNode, ...extensionASTNodes]; - return new _definition.GraphQLInterfaceType({ - name, - description: (_astNode$description2 = astNode.description) === null || _astNode$description2 === void 0 ? void 0 : _astNode$description2.value, - interfaces: () => buildInterfaces(allNodes), - fields: () => buildFieldMap(allNodes), - astNode, - extensionASTNodes - }); - } - case _kinds.Kind.ENUM_TYPE_DEFINITION: - { - var _astNode$description3; - const allNodes = [astNode, ...extensionASTNodes]; - return new _definition.GraphQLEnumType({ - name, - description: (_astNode$description3 = astNode.description) === null || _astNode$description3 === void 0 ? void 0 : _astNode$description3.value, - values: buildEnumValueMap(allNodes), - astNode, - extensionASTNodes - }); - } - case _kinds.Kind.UNION_TYPE_DEFINITION: - { - var _astNode$description4; - const allNodes = [astNode, ...extensionASTNodes]; - return new _definition.GraphQLUnionType({ - name, - description: (_astNode$description4 = astNode.description) === null || _astNode$description4 === void 0 ? void 0 : _astNode$description4.value, - types: () => buildUnionTypes(allNodes), - astNode, - extensionASTNodes - }); - } - case _kinds.Kind.SCALAR_TYPE_DEFINITION: - { - var _astNode$description5; - return new _definition.GraphQLScalarType({ - name, - description: (_astNode$description5 = astNode.description) === null || _astNode$description5 === void 0 ? void 0 : _astNode$description5.value, - specifiedByURL: getSpecifiedByURL(astNode), - astNode, - extensionASTNodes - }); - } - case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION: - { - var _astNode$description6; - const allNodes = [astNode, ...extensionASTNodes]; - return new _definition.GraphQLInputObjectType({ - name, - description: (_astNode$description6 = astNode.description) === null || _astNode$description6 === void 0 ? void 0 : _astNode$description6.value, - fields: () => buildInputFieldMap(allNodes), - astNode, - extensionASTNodes, - isOneOf: isOneOf(astNode) - }); - } - } +})); +Object.defineProperty(exports, "assertListType", ({ + enumerable: true, + get: function () { + return _index.assertListType; } -} -const stdTypeMap = (0, _keyMap.keyMap)([..._scalars.specifiedScalarTypes, ..._introspection.introspectionTypes], type => type.name); -/** - * Given a field or enum value node, returns the string value for the - * deprecation reason. - */ - -function getDeprecationReason(node) { - const deprecated = (0, _values.getDirectiveValues)(_directives.GraphQLDeprecatedDirective, node); // @ts-expect-error validated by `getDirectiveValues` - - return deprecated === null || deprecated === void 0 ? void 0 : deprecated.reason; -} -/** - * Given a scalar node, returns the string value for the specifiedByURL. - */ - -function getSpecifiedByURL(node) { - const specifiedBy = (0, _values.getDirectiveValues)(_directives.GraphQLSpecifiedByDirective, node); // @ts-expect-error validated by `getDirectiveValues` - - return specifiedBy === null || specifiedBy === void 0 ? void 0 : specifiedBy.url; -} -/** - * Given an input object node, returns if the node should be OneOf. - */ - -function isOneOf(node) { - return Boolean((0, _values.getDirectiveValues)(_directives.GraphQLOneOfDirective, node)); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/findBreakingChanges.mjs": -/*!***********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/findBreakingChanges.mjs ***! - \***********************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.DangerousChangeType = exports.BreakingChangeType = void 0; -exports.findBreakingChanges = findBreakingChanges; -exports.findDangerousChanges = findDangerousChanges; -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _keyMap = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -var _astFromValue = __webpack_require__(/*! ./astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); -var _sortValueNode = __webpack_require__(/*! ./sortValueNode.mjs */ "../../../node_modules/graphql/utilities/sortValueNode.mjs"); -var BreakingChangeType; -(function (BreakingChangeType) { - BreakingChangeType['TYPE_REMOVED'] = 'TYPE_REMOVED'; - BreakingChangeType['TYPE_CHANGED_KIND'] = 'TYPE_CHANGED_KIND'; - BreakingChangeType['TYPE_REMOVED_FROM_UNION'] = 'TYPE_REMOVED_FROM_UNION'; - BreakingChangeType['VALUE_REMOVED_FROM_ENUM'] = 'VALUE_REMOVED_FROM_ENUM'; - BreakingChangeType['REQUIRED_INPUT_FIELD_ADDED'] = 'REQUIRED_INPUT_FIELD_ADDED'; - BreakingChangeType['IMPLEMENTED_INTERFACE_REMOVED'] = 'IMPLEMENTED_INTERFACE_REMOVED'; - BreakingChangeType['FIELD_REMOVED'] = 'FIELD_REMOVED'; - BreakingChangeType['FIELD_CHANGED_KIND'] = 'FIELD_CHANGED_KIND'; - BreakingChangeType['REQUIRED_ARG_ADDED'] = 'REQUIRED_ARG_ADDED'; - BreakingChangeType['ARG_REMOVED'] = 'ARG_REMOVED'; - BreakingChangeType['ARG_CHANGED_KIND'] = 'ARG_CHANGED_KIND'; - BreakingChangeType['DIRECTIVE_REMOVED'] = 'DIRECTIVE_REMOVED'; - BreakingChangeType['DIRECTIVE_ARG_REMOVED'] = 'DIRECTIVE_ARG_REMOVED'; - BreakingChangeType['REQUIRED_DIRECTIVE_ARG_ADDED'] = 'REQUIRED_DIRECTIVE_ARG_ADDED'; - BreakingChangeType['DIRECTIVE_REPEATABLE_REMOVED'] = 'DIRECTIVE_REPEATABLE_REMOVED'; - BreakingChangeType['DIRECTIVE_LOCATION_REMOVED'] = 'DIRECTIVE_LOCATION_REMOVED'; -})(BreakingChangeType || (exports.BreakingChangeType = BreakingChangeType = {})); -var DangerousChangeType; -(function (DangerousChangeType) { - DangerousChangeType['VALUE_ADDED_TO_ENUM'] = 'VALUE_ADDED_TO_ENUM'; - DangerousChangeType['TYPE_ADDED_TO_UNION'] = 'TYPE_ADDED_TO_UNION'; - DangerousChangeType['OPTIONAL_INPUT_FIELD_ADDED'] = 'OPTIONAL_INPUT_FIELD_ADDED'; - DangerousChangeType['OPTIONAL_ARG_ADDED'] = 'OPTIONAL_ARG_ADDED'; - DangerousChangeType['IMPLEMENTED_INTERFACE_ADDED'] = 'IMPLEMENTED_INTERFACE_ADDED'; - DangerousChangeType['ARG_DEFAULT_VALUE_CHANGE'] = 'ARG_DEFAULT_VALUE_CHANGE'; -})(DangerousChangeType || (exports.DangerousChangeType = DangerousChangeType = {})); -/** - * Given two schemas, returns an Array containing descriptions of all the types - * of breaking changes covered by the other functions down below. - */ -function findBreakingChanges(oldSchema, newSchema) { - // @ts-expect-error - return findSchemaChanges(oldSchema, newSchema).filter(change => change.type in BreakingChangeType); -} -/** - * Given two schemas, returns an Array containing descriptions of all the types - * of potentially dangerous changes covered by the other functions down below. - */ - -function findDangerousChanges(oldSchema, newSchema) { - // @ts-expect-error - return findSchemaChanges(oldSchema, newSchema).filter(change => change.type in DangerousChangeType); -} -function findSchemaChanges(oldSchema, newSchema) { - return [...findTypeChanges(oldSchema, newSchema), ...findDirectiveChanges(oldSchema, newSchema)]; -} -function findDirectiveChanges(oldSchema, newSchema) { - const schemaChanges = []; - const directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives()); - for (const oldDirective of directivesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_REMOVED, - description: `${oldDirective.name} was removed.` - }); +Object.defineProperty(exports, "assertName", ({ + enumerable: true, + get: function () { + return _index.assertName; } - for (const [oldDirective, newDirective] of directivesDiff.persisted) { - const argsDiff = diff(oldDirective.args, newDirective.args); - for (const newArg of argsDiff.added) { - if ((0, _definition.isRequiredArgument)(newArg)) { - schemaChanges.push({ - type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, - description: `A required arg ${newArg.name} on directive ${oldDirective.name} was added.` - }); - } - } - for (const oldArg of argsDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, - description: `${oldArg.name} was removed from ${oldDirective.name}.` - }); - } - if (oldDirective.isRepeatable && !newDirective.isRepeatable) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, - description: `Repeatable flag was removed from ${oldDirective.name}.` - }); - } - for (const location of oldDirective.locations) { - if (!newDirective.locations.includes(location)) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, - description: `${location} was removed from ${oldDirective.name}.` - }); - } - } +})); +Object.defineProperty(exports, "assertNamedType", ({ + enumerable: true, + get: function () { + return _index.assertNamedType; } - return schemaChanges; -} -function findTypeChanges(oldSchema, newSchema) { - const schemaChanges = []; - const typesDiff = diff(Object.values(oldSchema.getTypeMap()), Object.values(newSchema.getTypeMap())); - for (const oldType of typesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.TYPE_REMOVED, - description: (0, _scalars.isSpecifiedScalarType)(oldType) ? `Standard scalar ${oldType.name} was removed because it is not referenced anymore.` : `${oldType.name} was removed.` - }); +})); +Object.defineProperty(exports, "assertNonNullType", ({ + enumerable: true, + get: function () { + return _index.assertNonNullType; } - for (const [oldType, newType] of typesDiff.persisted) { - if ((0, _definition.isEnumType)(oldType) && (0, _definition.isEnumType)(newType)) { - schemaChanges.push(...findEnumTypeChanges(oldType, newType)); - } else if ((0, _definition.isUnionType)(oldType) && (0, _definition.isUnionType)(newType)) { - schemaChanges.push(...findUnionTypeChanges(oldType, newType)); - } else if ((0, _definition.isInputObjectType)(oldType) && (0, _definition.isInputObjectType)(newType)) { - schemaChanges.push(...findInputObjectTypeChanges(oldType, newType)); - } else if ((0, _definition.isObjectType)(oldType) && (0, _definition.isObjectType)(newType)) { - schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType)); - } else if ((0, _definition.isInterfaceType)(oldType) && (0, _definition.isInterfaceType)(newType)) { - schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType)); - } else if (oldType.constructor !== newType.constructor) { - schemaChanges.push({ - type: BreakingChangeType.TYPE_CHANGED_KIND, - description: `${oldType.name} changed from ` + `${typeKindName(oldType)} to ${typeKindName(newType)}.` - }); - } +})); +Object.defineProperty(exports, "assertNullableType", ({ + enumerable: true, + get: function () { + return _index.assertNullableType; } - return schemaChanges; -} -function findInputObjectTypeChanges(oldType, newType) { - const schemaChanges = []; - const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields())); - for (const newField of fieldsDiff.added) { - if ((0, _definition.isRequiredInputField)(newField)) { - schemaChanges.push({ - type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, - description: `A required field ${newField.name} on input type ${oldType.name} was added.` - }); - } else { - schemaChanges.push({ - type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, - description: `An optional field ${newField.name} on input type ${oldType.name} was added.` - }); - } +})); +Object.defineProperty(exports, "assertObjectType", ({ + enumerable: true, + get: function () { + return _index.assertObjectType; } - for (const oldField of fieldsDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.FIELD_REMOVED, - description: `${oldType.name}.${oldField.name} was removed.` - }); +})); +Object.defineProperty(exports, "assertOutputType", ({ + enumerable: true, + get: function () { + return _index.assertOutputType; } - for (const [oldField, newField] of fieldsDiff.persisted) { - const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldField.type, newField.type); - if (!isSafe) { - schemaChanges.push({ - type: BreakingChangeType.FIELD_CHANGED_KIND, - description: `${oldType.name}.${oldField.name} changed type from ` + `${String(oldField.type)} to ${String(newField.type)}.` - }); - } +})); +Object.defineProperty(exports, "assertScalarType", ({ + enumerable: true, + get: function () { + return _index.assertScalarType; } - return schemaChanges; -} -function findUnionTypeChanges(oldType, newType) { - const schemaChanges = []; - const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); - for (const newPossibleType of possibleTypesDiff.added) { - schemaChanges.push({ - type: DangerousChangeType.TYPE_ADDED_TO_UNION, - description: `${newPossibleType.name} was added to union type ${oldType.name}.` - }); +})); +Object.defineProperty(exports, "assertSchema", ({ + enumerable: true, + get: function () { + return _index.assertSchema; } - for (const oldPossibleType of possibleTypesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, - description: `${oldPossibleType.name} was removed from union type ${oldType.name}.` - }); +})); +Object.defineProperty(exports, "assertType", ({ + enumerable: true, + get: function () { + return _index.assertType; } - return schemaChanges; -} -function findEnumTypeChanges(oldType, newType) { - const schemaChanges = []; - const valuesDiff = diff(oldType.getValues(), newType.getValues()); - for (const newValue of valuesDiff.added) { - schemaChanges.push({ - type: DangerousChangeType.VALUE_ADDED_TO_ENUM, - description: `${newValue.name} was added to enum type ${oldType.name}.` - }); +})); +Object.defineProperty(exports, "assertUnionType", ({ + enumerable: true, + get: function () { + return _index.assertUnionType; } - for (const oldValue of valuesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, - description: `${oldValue.name} was removed from enum type ${oldType.name}.` - }); +})); +Object.defineProperty(exports, "assertValidName", ({ + enumerable: true, + get: function () { + return _index6.assertValidName; } - return schemaChanges; -} -function findImplementedInterfacesChanges(oldType, newType) { - const schemaChanges = []; - const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); - for (const newInterface of interfacesDiff.added) { - schemaChanges.push({ - type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, - description: `${newInterface.name} added to interfaces implemented by ${oldType.name}.` - }); +})); +Object.defineProperty(exports, "assertValidSchema", ({ + enumerable: true, + get: function () { + return _index.assertValidSchema; } - for (const oldInterface of interfacesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, - description: `${oldType.name} no longer implements interface ${oldInterface.name}.` - }); +})); +Object.defineProperty(exports, "assertWrappingType", ({ + enumerable: true, + get: function () { + return _index.assertWrappingType; } - return schemaChanges; -} -function findFieldChanges(oldType, newType) { - const schemaChanges = []; - const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields())); - for (const oldField of fieldsDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.FIELD_REMOVED, - description: `${oldType.name}.${oldField.name} was removed.` - }); +})); +Object.defineProperty(exports, "astFromValue", ({ + enumerable: true, + get: function () { + return _index6.astFromValue; } - for (const [oldField, newField] of fieldsDiff.persisted) { - schemaChanges.push(...findArgChanges(oldType, oldField, newField)); - const isSafe = isChangeSafeForObjectOrInterfaceField(oldField.type, newField.type); - if (!isSafe) { - schemaChanges.push({ - type: BreakingChangeType.FIELD_CHANGED_KIND, - description: `${oldType.name}.${oldField.name} changed type from ` + `${String(oldField.type)} to ${String(newField.type)}.` - }); - } +})); +Object.defineProperty(exports, "buildASTSchema", ({ + enumerable: true, + get: function () { + return _index6.buildASTSchema; } - return schemaChanges; -} -function findArgChanges(oldType, oldField, newField) { - const schemaChanges = []; - const argsDiff = diff(oldField.args, newField.args); - for (const oldArg of argsDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.ARG_REMOVED, - description: `${oldType.name}.${oldField.name} arg ${oldArg.name} was removed.` - }); +})); +Object.defineProperty(exports, "buildClientSchema", ({ + enumerable: true, + get: function () { + return _index6.buildClientSchema; } - for (const [oldArg, newArg] of argsDiff.persisted) { - const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldArg.type, newArg.type); - if (!isSafe) { - schemaChanges.push({ - type: BreakingChangeType.ARG_CHANGED_KIND, - description: `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed type from ` + `${String(oldArg.type)} to ${String(newArg.type)}.` - }); - } else if (oldArg.defaultValue !== undefined) { - if (newArg.defaultValue === undefined) { - schemaChanges.push({ - type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, - description: `${oldType.name}.${oldField.name} arg ${oldArg.name} defaultValue was removed.` - }); - } else { - // Since we looking only for client's observable changes we should - // compare default values in the same representation as they are - // represented inside introspection. - const oldValueStr = stringifyValue(oldArg.defaultValue, oldArg.type); - const newValueStr = stringifyValue(newArg.defaultValue, newArg.type); - if (oldValueStr !== newValueStr) { - schemaChanges.push({ - type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, - description: `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed defaultValue from ${oldValueStr} to ${newValueStr}.` - }); - } - } - } - } - for (const newArg of argsDiff.added) { - if ((0, _definition.isRequiredArgument)(newArg)) { - schemaChanges.push({ - type: BreakingChangeType.REQUIRED_ARG_ADDED, - description: `A required arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.` - }); - } else { - schemaChanges.push({ - type: DangerousChangeType.OPTIONAL_ARG_ADDED, - description: `An optional arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.` - }); - } - } - return schemaChanges; -} -function isChangeSafeForObjectOrInterfaceField(oldType, newType) { - if ((0, _definition.isListType)(oldType)) { - return ( - // if they're both lists, make sure the underlying types are compatible - (0, _definition.isListType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) || - // moving from nullable to non-null of the same underlying type is safe - (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) - ); - } - if ((0, _definition.isNonNullType)(oldType)) { - // if they're both non-null, make sure the underlying types are compatible - return (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType); - } - return ( - // if they're both named types, see if their names are equivalent - (0, _definition.isNamedType)(newType) && oldType.name === newType.name || - // moving from nullable to non-null of the same underlying type is safe - (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) - ); -} -function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) { - if ((0, _definition.isListType)(oldType)) { - // if they're both lists, make sure the underlying types are compatible - return (0, _definition.isListType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType); - } - if ((0, _definition.isNonNullType)(oldType)) { - return ( - // if they're both non-null, make sure the underlying types are - // compatible - (0, _definition.isNonNullType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) || - // moving from non-null to nullable of the same underlying type is safe - !(0, _definition.isNonNullType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType) - ); - } // if they're both named types, see if their names are equivalent - - return (0, _definition.isNamedType)(newType) && oldType.name === newType.name; -} -function typeKindName(type) { - if ((0, _definition.isScalarType)(type)) { - return 'a Scalar type'; - } - if ((0, _definition.isObjectType)(type)) { - return 'an Object type'; - } - if ((0, _definition.isInterfaceType)(type)) { - return 'an Interface type'; - } - if ((0, _definition.isUnionType)(type)) { - return 'a Union type'; - } - if ((0, _definition.isEnumType)(type)) { - return 'an Enum type'; - } - if ((0, _definition.isInputObjectType)(type)) { - return 'an Input type'; - } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); -} -function stringifyValue(value, type) { - const ast = (0, _astFromValue.astFromValue)(value, type); - ast != null || (0, _invariant.invariant)(false); - return (0, _printer.print)((0, _sortValueNode.sortValueNode)(ast)); -} -function diff(oldArray, newArray) { - const added = []; - const removed = []; - const persisted = []; - const oldMap = (0, _keyMap.keyMap)(oldArray, ({ - name - }) => name); - const newMap = (0, _keyMap.keyMap)(newArray, ({ - name - }) => name); - for (const oldItem of oldArray) { - const newItem = newMap[oldItem.name]; - if (newItem === undefined) { - removed.push(oldItem); - } else { - persisted.push([oldItem, newItem]); - } - } - for (const newItem of newArray) { - if (oldMap[newItem.name] === undefined) { - added.push(newItem); - } - } - return { - added, - persisted, - removed - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs": -/*!*************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs ***! - \*************************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.getIntrospectionQuery = getIntrospectionQuery; -/** - * Produce the GraphQL query recommended for a full schema introspection. - * Accepts optional IntrospectionOptions. - */ -function getIntrospectionQuery(options) { - const optionsWithDefault = { - descriptions: true, - specifiedByUrl: false, - directiveIsRepeatable: false, - schemaDescription: false, - inputValueDeprecation: false, - oneOf: false, - ...options - }; - const descriptions = optionsWithDefault.descriptions ? 'description' : ''; - const specifiedByUrl = optionsWithDefault.specifiedByUrl ? 'specifiedByURL' : ''; - const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable ? 'isRepeatable' : ''; - const schemaDescription = optionsWithDefault.schemaDescription ? descriptions : ''; - function inputDeprecation(str) { - return optionsWithDefault.inputValueDeprecation ? str : ''; +Object.defineProperty(exports, "buildSchema", ({ + enumerable: true, + get: function () { + return _index6.buildSchema; } - const oneOf = optionsWithDefault.oneOf ? 'isOneOf' : ''; - return ` - query IntrospectionQuery { - __schema { - ${schemaDescription} - queryType { name } - mutationType { name } - subscriptionType { name } - types { - ...FullType - } - directives { - name - ${descriptions} - ${directiveIsRepeatable} - locations - args${inputDeprecation('(includeDeprecated: true)')} { - ...InputValue - } - } - } - } - - fragment FullType on __Type { - kind - name - ${descriptions} - ${specifiedByUrl} - ${oneOf} - fields(includeDeprecated: true) { - name - ${descriptions} - args${inputDeprecation('(includeDeprecated: true)')} { - ...InputValue - } - type { - ...TypeRef - } - isDeprecated - deprecationReason - } - inputFields${inputDeprecation('(includeDeprecated: true)')} { - ...InputValue - } - interfaces { - ...TypeRef - } - enumValues(includeDeprecated: true) { - name - ${descriptions} - isDeprecated - deprecationReason - } - possibleTypes { - ...TypeRef - } - } - - fragment InputValue on __InputValue { - name - ${descriptions} - type { ...TypeRef } - defaultValue - ${inputDeprecation('isDeprecated')} - ${inputDeprecation('deprecationReason')} - } - - fragment TypeRef on __Type { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - } - } - } - } - } - } - `; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/getOperationAST.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/getOperationAST.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.getOperationAST = getOperationAST; -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/** - * Returns an operation AST given a document AST and optionally an operation - * name. If a name is not provided, an operation is only returned if only one is - * provided in the document. - */ - -function getOperationAST(documentAST, operationName) { - let operation = null; - for (const definition of documentAST.definitions) { - if (definition.kind === _kinds.Kind.OPERATION_DEFINITION) { - var _definition$name; - if (operationName == null) { - // If no operation name was provided, only return an Operation if there - // is one defined in the document. Upon encountering the second, return - // null. - if (operation) { - return null; - } - operation = definition; - } else if (((_definition$name = definition.name) === null || _definition$name === void 0 ? void 0 : _definition$name.value) === operationName) { - return definition; - } - } +Object.defineProperty(exports, "coerceInputValue", ({ + enumerable: true, + get: function () { + return _index6.coerceInputValue; } - return operation; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/getOperationRootType.mjs": -/*!************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/getOperationRootType.mjs ***! - \************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.getOperationRootType = getOperationRootType; -var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/** - * Extracts the root type of the operation from the schema. - * - * @deprecated Please use `GraphQLSchema.getRootType` instead. Will be removed in v17 - */ -function getOperationRootType(schema, operation) { - if (operation.operation === 'query') { - const queryType = schema.getQueryType(); - if (!queryType) { - throw new _GraphQLError.GraphQLError('Schema does not define the required query root type.', { - nodes: operation - }); - } - return queryType; +Object.defineProperty(exports, "concatAST", ({ + enumerable: true, + get: function () { + return _index6.concatAST; } - if (operation.operation === 'mutation') { - const mutationType = schema.getMutationType(); - if (!mutationType) { - throw new _GraphQLError.GraphQLError('Schema is not configured for mutations.', { - nodes: operation - }); - } - return mutationType; +})); +Object.defineProperty(exports, "createSourceEventStream", ({ + enumerable: true, + get: function () { + return _index3.createSourceEventStream; } - if (operation.operation === 'subscription') { - const subscriptionType = schema.getSubscriptionType(); - if (!subscriptionType) { - throw new _GraphQLError.GraphQLError('Schema is not configured for subscriptions.', { - nodes: operation - }); - } - return subscriptionType; +})); +Object.defineProperty(exports, "defaultFieldResolver", ({ + enumerable: true, + get: function () { + return _index3.defaultFieldResolver; } - throw new _GraphQLError.GraphQLError('Can only have query, mutation and subscription operations.', { - nodes: operation - }); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/index.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/utilities/index.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -Object.defineProperty(exports, "BreakingChangeType", ({ +Object.defineProperty(exports, "defaultTypeResolver", ({ enumerable: true, get: function () { - return _findBreakingChanges.BreakingChangeType; + return _index3.defaultTypeResolver; } })); -Object.defineProperty(exports, "DangerousChangeType", ({ +Object.defineProperty(exports, "doTypesOverlap", ({ enumerable: true, get: function () { - return _findBreakingChanges.DangerousChangeType; + return _index6.doTypesOverlap; } })); -Object.defineProperty(exports, "TypeInfo", ({ +Object.defineProperty(exports, "execute", ({ enumerable: true, get: function () { - return _TypeInfo.TypeInfo; + return _index3.execute; } })); -Object.defineProperty(exports, "assertValidName", ({ +Object.defineProperty(exports, "executeSync", ({ enumerable: true, get: function () { - return _assertValidName.assertValidName; + return _index3.executeSync; } })); -Object.defineProperty(exports, "astFromValue", ({ +Object.defineProperty(exports, "extendSchema", ({ enumerable: true, get: function () { - return _astFromValue.astFromValue; + return _index6.extendSchema; } })); -Object.defineProperty(exports, "buildASTSchema", ({ +Object.defineProperty(exports, "findBreakingChanges", ({ enumerable: true, get: function () { - return _buildASTSchema.buildASTSchema; + return _index6.findBreakingChanges; } })); -Object.defineProperty(exports, "buildClientSchema", ({ +Object.defineProperty(exports, "findDangerousChanges", ({ enumerable: true, get: function () { - return _buildClientSchema.buildClientSchema; + return _index6.findDangerousChanges; } })); -Object.defineProperty(exports, "buildSchema", ({ +Object.defineProperty(exports, "formatError", ({ enumerable: true, get: function () { - return _buildASTSchema.buildSchema; + return _index5.formatError; } })); -Object.defineProperty(exports, "coerceInputValue", ({ +Object.defineProperty(exports, "getArgumentValues", ({ enumerable: true, get: function () { - return _coerceInputValue.coerceInputValue; + return _index3.getArgumentValues; } })); -Object.defineProperty(exports, "concatAST", ({ +Object.defineProperty(exports, "getDirectiveValues", ({ enumerable: true, get: function () { - return _concatAST.concatAST; + return _index3.getDirectiveValues; } })); -Object.defineProperty(exports, "doTypesOverlap", ({ +Object.defineProperty(exports, "getEnterLeaveForKind", ({ enumerable: true, get: function () { - return _typeComparators.doTypesOverlap; + return _index2.getEnterLeaveForKind; } })); -Object.defineProperty(exports, "extendSchema", ({ +Object.defineProperty(exports, "getIntrospectionQuery", ({ enumerable: true, get: function () { - return _extendSchema.extendSchema; + return _index6.getIntrospectionQuery; } })); -Object.defineProperty(exports, "findBreakingChanges", ({ +Object.defineProperty(exports, "getLocation", ({ enumerable: true, get: function () { - return _findBreakingChanges.findBreakingChanges; + return _index2.getLocation; } })); -Object.defineProperty(exports, "findDangerousChanges", ({ +Object.defineProperty(exports, "getNamedType", ({ enumerable: true, get: function () { - return _findBreakingChanges.findDangerousChanges; + return _index.getNamedType; } })); -Object.defineProperty(exports, "getIntrospectionQuery", ({ +Object.defineProperty(exports, "getNullableType", ({ enumerable: true, get: function () { - return _getIntrospectionQuery.getIntrospectionQuery; + return _index.getNullableType; } })); Object.defineProperty(exports, "getOperationAST", ({ enumerable: true, get: function () { - return _getOperationAST.getOperationAST; + return _index6.getOperationAST; } })); Object.defineProperty(exports, "getOperationRootType", ({ enumerable: true, get: function () { - return _getOperationRootType.getOperationRootType; + return _index6.getOperationRootType; } })); -Object.defineProperty(exports, "introspectionFromSchema", ({ +Object.defineProperty(exports, "getVariableValues", ({ enumerable: true, get: function () { - return _introspectionFromSchema.introspectionFromSchema; + return _index3.getVariableValues; } })); -Object.defineProperty(exports, "isEqualType", ({ +Object.defineProperty(exports, "getVisitFn", ({ enumerable: true, get: function () { - return _typeComparators.isEqualType; + return _index2.getVisitFn; } })); -Object.defineProperty(exports, "isTypeSubTypeOf", ({ +Object.defineProperty(exports, "graphql", ({ enumerable: true, get: function () { - return _typeComparators.isTypeSubTypeOf; + return _graphql.graphql; } })); -Object.defineProperty(exports, "isValidNameError", ({ +Object.defineProperty(exports, "graphqlSync", ({ enumerable: true, get: function () { - return _assertValidName.isValidNameError; + return _graphql.graphqlSync; } })); -Object.defineProperty(exports, "lexicographicSortSchema", ({ +Object.defineProperty(exports, "introspectionFromSchema", ({ enumerable: true, get: function () { - return _lexicographicSortSchema.lexicographicSortSchema; + return _index6.introspectionFromSchema; } })); -Object.defineProperty(exports, "printIntrospectionSchema", ({ +Object.defineProperty(exports, "introspectionTypes", ({ enumerable: true, get: function () { - return _printSchema.printIntrospectionSchema; + return _index.introspectionTypes; } })); -Object.defineProperty(exports, "printSchema", ({ +Object.defineProperty(exports, "isAbstractType", ({ enumerable: true, get: function () { - return _printSchema.printSchema; + return _index.isAbstractType; } })); -Object.defineProperty(exports, "printType", ({ +Object.defineProperty(exports, "isCompositeType", ({ enumerable: true, get: function () { - return _printSchema.printType; + return _index.isCompositeType; } })); -Object.defineProperty(exports, "separateOperations", ({ +Object.defineProperty(exports, "isConstValueNode", ({ enumerable: true, get: function () { - return _separateOperations.separateOperations; + return _index2.isConstValueNode; } })); -Object.defineProperty(exports, "stripIgnoredCharacters", ({ +Object.defineProperty(exports, "isDefinitionNode", ({ enumerable: true, get: function () { - return _stripIgnoredCharacters.stripIgnoredCharacters; + return _index2.isDefinitionNode; } })); -Object.defineProperty(exports, "typeFromAST", ({ +Object.defineProperty(exports, "isDirective", ({ enumerable: true, get: function () { - return _typeFromAST.typeFromAST; + return _index.isDirective; } })); -Object.defineProperty(exports, "valueFromAST", ({ +Object.defineProperty(exports, "isEnumType", ({ enumerable: true, get: function () { - return _valueFromAST.valueFromAST; + return _index.isEnumType; } })); -Object.defineProperty(exports, "valueFromASTUntyped", ({ +Object.defineProperty(exports, "isEqualType", ({ enumerable: true, get: function () { - return _valueFromASTUntyped.valueFromASTUntyped; + return _index6.isEqualType; } })); -Object.defineProperty(exports, "visitWithTypeInfo", ({ +Object.defineProperty(exports, "isExecutableDefinitionNode", ({ enumerable: true, get: function () { - return _TypeInfo.visitWithTypeInfo; + return _index2.isExecutableDefinitionNode; } })); -var _getIntrospectionQuery = __webpack_require__(/*! ./getIntrospectionQuery.mjs */ "../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs"); -var _getOperationAST = __webpack_require__(/*! ./getOperationAST.mjs */ "../../../node_modules/graphql/utilities/getOperationAST.mjs"); -var _getOperationRootType = __webpack_require__(/*! ./getOperationRootType.mjs */ "../../../node_modules/graphql/utilities/getOperationRootType.mjs"); -var _introspectionFromSchema = __webpack_require__(/*! ./introspectionFromSchema.mjs */ "../../../node_modules/graphql/utilities/introspectionFromSchema.mjs"); -var _buildClientSchema = __webpack_require__(/*! ./buildClientSchema.mjs */ "../../../node_modules/graphql/utilities/buildClientSchema.mjs"); -var _buildASTSchema = __webpack_require__(/*! ./buildASTSchema.mjs */ "../../../node_modules/graphql/utilities/buildASTSchema.mjs"); -var _extendSchema = __webpack_require__(/*! ./extendSchema.mjs */ "../../../node_modules/graphql/utilities/extendSchema.mjs"); -var _lexicographicSortSchema = __webpack_require__(/*! ./lexicographicSortSchema.mjs */ "../../../node_modules/graphql/utilities/lexicographicSortSchema.mjs"); -var _printSchema = __webpack_require__(/*! ./printSchema.mjs */ "../../../node_modules/graphql/utilities/printSchema.mjs"); -var _typeFromAST = __webpack_require__(/*! ./typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); -var _valueFromAST = __webpack_require__(/*! ./valueFromAST.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); -var _valueFromASTUntyped = __webpack_require__(/*! ./valueFromASTUntyped.mjs */ "../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs"); -var _astFromValue = __webpack_require__(/*! ./astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); -var _TypeInfo = __webpack_require__(/*! ./TypeInfo.mjs */ "../../../node_modules/graphql/utilities/TypeInfo.mjs"); -var _coerceInputValue = __webpack_require__(/*! ./coerceInputValue.mjs */ "../../../node_modules/graphql/utilities/coerceInputValue.mjs"); -var _concatAST = __webpack_require__(/*! ./concatAST.mjs */ "../../../node_modules/graphql/utilities/concatAST.mjs"); -var _separateOperations = __webpack_require__(/*! ./separateOperations.mjs */ "../../../node_modules/graphql/utilities/separateOperations.mjs"); -var _stripIgnoredCharacters = __webpack_require__(/*! ./stripIgnoredCharacters.mjs */ "../../../node_modules/graphql/utilities/stripIgnoredCharacters.mjs"); -var _typeComparators = __webpack_require__(/*! ./typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); -var _assertValidName = __webpack_require__(/*! ./assertValidName.mjs */ "../../../node_modules/graphql/utilities/assertValidName.mjs"); -var _findBreakingChanges = __webpack_require__(/*! ./findBreakingChanges.mjs */ "../../../node_modules/graphql/utilities/findBreakingChanges.mjs"); - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/introspectionFromSchema.mjs": -/*!***************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/introspectionFromSchema.mjs ***! - \***************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true +Object.defineProperty(exports, "isInputObjectType", ({ + enumerable: true, + get: function () { + return _index.isInputObjectType; + } })); -exports.introspectionFromSchema = introspectionFromSchema; -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _parser = __webpack_require__(/*! ../language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); -var _execute = __webpack_require__(/*! ../execution/execute.mjs */ "../../../node_modules/graphql/execution/execute.mjs"); -var _getIntrospectionQuery = __webpack_require__(/*! ./getIntrospectionQuery.mjs */ "../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs"); -/** - * Build an IntrospectionQuery from a GraphQLSchema - * - * IntrospectionQuery is useful for utilities that care about type and field - * relationships, but do not need to traverse through those relationships. - * - * This is the inverse of buildClientSchema. The primary use case is outside - * of the server context, for instance when doing schema comparisons. - */ - -function introspectionFromSchema(schema, options) { - const optionsWithDefaults = { - specifiedByUrl: true, - directiveIsRepeatable: true, - schemaDescription: true, - inputValueDeprecation: true, - oneOf: true, - ...options - }; - const document = (0, _parser.parse)((0, _getIntrospectionQuery.getIntrospectionQuery)(optionsWithDefaults)); - const result = (0, _execute.executeSync)({ - schema, - document - }); - !result.errors && result.data || (0, _invariant.invariant)(false); - return result.data; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/lexicographicSortSchema.mjs": -/*!***************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/lexicographicSortSchema.mjs ***! - \***************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true +Object.defineProperty(exports, "isInputType", ({ + enumerable: true, + get: function () { + return _index.isInputType; + } })); -exports.lexicographicSortSchema = lexicographicSortSchema; -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _keyValMap = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); -var _naturalCompare = __webpack_require__(/*! ../jsutils/naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -var _schema = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); -/** - * Sort GraphQLSchema. - * - * This function returns a sorted copy of the given GraphQLSchema. - */ - -function lexicographicSortSchema(schema) { - const schemaConfig = schema.toConfig(); - const typeMap = (0, _keyValMap.keyValMap)(sortByName(schemaConfig.types), type => type.name, sortNamedType); - return new _schema.GraphQLSchema({ - ...schemaConfig, - types: Object.values(typeMap), - directives: sortByName(schemaConfig.directives).map(sortDirective), - query: replaceMaybeType(schemaConfig.query), - mutation: replaceMaybeType(schemaConfig.mutation), - subscription: replaceMaybeType(schemaConfig.subscription) - }); - function replaceType(type) { - if ((0, _definition.isListType)(type)) { - // @ts-expect-error - return new _definition.GraphQLList(replaceType(type.ofType)); - } else if ((0, _definition.isNonNullType)(type)) { - // @ts-expect-error - return new _definition.GraphQLNonNull(replaceType(type.ofType)); - } // @ts-expect-error FIXME: TS Conversion - - return replaceNamedType(type); +Object.defineProperty(exports, "isInterfaceType", ({ + enumerable: true, + get: function () { + return _index.isInterfaceType; } - function replaceNamedType(type) { - return typeMap[type.name]; +})); +Object.defineProperty(exports, "isIntrospectionType", ({ + enumerable: true, + get: function () { + return _index.isIntrospectionType; } - function replaceMaybeType(maybeType) { - return maybeType && replaceNamedType(maybeType); +})); +Object.defineProperty(exports, "isLeafType", ({ + enumerable: true, + get: function () { + return _index.isLeafType; } - function sortDirective(directive) { - const config = directive.toConfig(); - return new _directives.GraphQLDirective({ - ...config, - locations: sortBy(config.locations, x => x), - args: sortArgs(config.args) - }); +})); +Object.defineProperty(exports, "isListType", ({ + enumerable: true, + get: function () { + return _index.isListType; } - function sortArgs(args) { - return sortObjMap(args, arg => ({ - ...arg, - type: replaceType(arg.type) - })); +})); +Object.defineProperty(exports, "isNamedType", ({ + enumerable: true, + get: function () { + return _index.isNamedType; } - function sortFields(fieldsMap) { - return sortObjMap(fieldsMap, field => ({ - ...field, - type: replaceType(field.type), - args: field.args && sortArgs(field.args) - })); +})); +Object.defineProperty(exports, "isNonNullType", ({ + enumerable: true, + get: function () { + return _index.isNonNullType; } - function sortInputFields(fieldsMap) { - return sortObjMap(fieldsMap, field => ({ - ...field, - type: replaceType(field.type) - })); +})); +Object.defineProperty(exports, "isNullableType", ({ + enumerable: true, + get: function () { + return _index.isNullableType; } - function sortTypes(array) { - return sortByName(array).map(replaceNamedType); +})); +Object.defineProperty(exports, "isObjectType", ({ + enumerable: true, + get: function () { + return _index.isObjectType; } - function sortNamedType(type) { - if ((0, _definition.isScalarType)(type) || (0, _introspection.isIntrospectionType)(type)) { - return type; - } - if ((0, _definition.isObjectType)(type)) { - const config = type.toConfig(); - return new _definition.GraphQLObjectType({ - ...config, - interfaces: () => sortTypes(config.interfaces), - fields: () => sortFields(config.fields) - }); - } - if ((0, _definition.isInterfaceType)(type)) { - const config = type.toConfig(); - return new _definition.GraphQLInterfaceType({ - ...config, - interfaces: () => sortTypes(config.interfaces), - fields: () => sortFields(config.fields) - }); - } - if ((0, _definition.isUnionType)(type)) { - const config = type.toConfig(); - return new _definition.GraphQLUnionType({ - ...config, - types: () => sortTypes(config.types) - }); - } - if ((0, _definition.isEnumType)(type)) { - const config = type.toConfig(); - return new _definition.GraphQLEnumType({ - ...config, - values: sortObjMap(config.values, value => value) - }); - } - if ((0, _definition.isInputObjectType)(type)) { - const config = type.toConfig(); - return new _definition.GraphQLInputObjectType({ - ...config, - fields: () => sortInputFields(config.fields) - }); - } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); +})); +Object.defineProperty(exports, "isOutputType", ({ + enumerable: true, + get: function () { + return _index.isOutputType; } -} -function sortObjMap(map, sortValueFn) { - const sortedMap = Object.create(null); - for (const key of Object.keys(map).sort(_naturalCompare.naturalCompare)) { - sortedMap[key] = sortValueFn(map[key]); +})); +Object.defineProperty(exports, "isRequiredArgument", ({ + enumerable: true, + get: function () { + return _index.isRequiredArgument; } - return sortedMap; -} -function sortByName(array) { - return sortBy(array, obj => obj.name); -} -function sortBy(array, mapToKey) { - return array.slice().sort((obj1, obj2) => { - const key1 = mapToKey(obj1); - const key2 = mapToKey(obj2); - return (0, _naturalCompare.naturalCompare)(key1, key2); - }); -} - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/printSchema.mjs": -/*!***************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/printSchema.mjs ***! - \***************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true })); -exports.printIntrospectionSchema = printIntrospectionSchema; -exports.printSchema = printSchema; -exports.printType = printType; -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _blockString = __webpack_require__(/*! ../language/blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -var _astFromValue = __webpack_require__(/*! ./astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); -function printSchema(schema) { - return printFilteredSchema(schema, n => !(0, _directives.isSpecifiedDirective)(n), isDefinedType); -} -function printIntrospectionSchema(schema) { - return printFilteredSchema(schema, _directives.isSpecifiedDirective, _introspection.isIntrospectionType); -} -function isDefinedType(type) { - return !(0, _scalars.isSpecifiedScalarType)(type) && !(0, _introspection.isIntrospectionType)(type); -} -function printFilteredSchema(schema, directiveFilter, typeFilter) { - const directives = schema.getDirectives().filter(directiveFilter); - const types = Object.values(schema.getTypeMap()).filter(typeFilter); - return [printSchemaDefinition(schema), ...directives.map(directive => printDirective(directive)), ...types.map(type => printType(type))].filter(Boolean).join('\n\n'); -} -function printSchemaDefinition(schema) { - if (schema.description == null && isSchemaOfCommonNames(schema)) { - return; +Object.defineProperty(exports, "isRequiredInputField", ({ + enumerable: true, + get: function () { + return _index.isRequiredInputField; } - const operationTypes = []; - const queryType = schema.getQueryType(); - if (queryType) { - operationTypes.push(` query: ${queryType.name}`); +})); +Object.defineProperty(exports, "isScalarType", ({ + enumerable: true, + get: function () { + return _index.isScalarType; } - const mutationType = schema.getMutationType(); - if (mutationType) { - operationTypes.push(` mutation: ${mutationType.name}`); +})); +Object.defineProperty(exports, "isSchema", ({ + enumerable: true, + get: function () { + return _index.isSchema; } - const subscriptionType = schema.getSubscriptionType(); - if (subscriptionType) { - operationTypes.push(` subscription: ${subscriptionType.name}`); +})); +Object.defineProperty(exports, "isSelectionNode", ({ + enumerable: true, + get: function () { + return _index2.isSelectionNode; } - return printDescription(schema) + `schema {\n${operationTypes.join('\n')}\n}`; -} -/** - * GraphQL schema define root types for each type of operation. These types are - * the same as any other type and can be named in any manner, however there is - * a common naming convention: - * - * ```graphql - * schema { - * query: Query - * mutation: Mutation - * subscription: Subscription - * } - * ``` - * - * When using this naming convention, the schema description can be omitted. - */ - -function isSchemaOfCommonNames(schema) { - const queryType = schema.getQueryType(); - if (queryType && queryType.name !== 'Query') { - return false; +})); +Object.defineProperty(exports, "isSpecifiedDirective", ({ + enumerable: true, + get: function () { + return _index.isSpecifiedDirective; } - const mutationType = schema.getMutationType(); - if (mutationType && mutationType.name !== 'Mutation') { - return false; +})); +Object.defineProperty(exports, "isSpecifiedScalarType", ({ + enumerable: true, + get: function () { + return _index.isSpecifiedScalarType; } - const subscriptionType = schema.getSubscriptionType(); - if (subscriptionType && subscriptionType.name !== 'Subscription') { - return false; +})); +Object.defineProperty(exports, "isType", ({ + enumerable: true, + get: function () { + return _index.isType; } - return true; -} -function printType(type) { - if ((0, _definition.isScalarType)(type)) { - return printScalar(type); +})); +Object.defineProperty(exports, "isTypeDefinitionNode", ({ + enumerable: true, + get: function () { + return _index2.isTypeDefinitionNode; } - if ((0, _definition.isObjectType)(type)) { - return printObject(type); +})); +Object.defineProperty(exports, "isTypeExtensionNode", ({ + enumerable: true, + get: function () { + return _index2.isTypeExtensionNode; } - if ((0, _definition.isInterfaceType)(type)) { - return printInterface(type); +})); +Object.defineProperty(exports, "isTypeNode", ({ + enumerable: true, + get: function () { + return _index2.isTypeNode; } - if ((0, _definition.isUnionType)(type)) { - return printUnion(type); +})); +Object.defineProperty(exports, "isTypeSubTypeOf", ({ + enumerable: true, + get: function () { + return _index6.isTypeSubTypeOf; } - if ((0, _definition.isEnumType)(type)) { - return printEnum(type); +})); +Object.defineProperty(exports, "isTypeSystemDefinitionNode", ({ + enumerable: true, + get: function () { + return _index2.isTypeSystemDefinitionNode; } - if ((0, _definition.isInputObjectType)(type)) { - return printInputObject(type); +})); +Object.defineProperty(exports, "isTypeSystemExtensionNode", ({ + enumerable: true, + get: function () { + return _index2.isTypeSystemExtensionNode; } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); -} -function printScalar(type) { - return printDescription(type) + `scalar ${type.name}` + printSpecifiedByURL(type); -} -function printImplementedInterfaces(type) { - const interfaces = type.getInterfaces(); - return interfaces.length ? ' implements ' + interfaces.map(i => i.name).join(' & ') : ''; -} -function printObject(type) { - return printDescription(type) + `type ${type.name}` + printImplementedInterfaces(type) + printFields(type); -} -function printInterface(type) { - return printDescription(type) + `interface ${type.name}` + printImplementedInterfaces(type) + printFields(type); -} -function printUnion(type) { - const types = type.getTypes(); - const possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; - return printDescription(type) + 'union ' + type.name + possibleTypes; -} -function printEnum(type) { - const values = type.getValues().map((value, i) => printDescription(value, ' ', !i) + ' ' + value.name + printDeprecated(value.deprecationReason)); - return printDescription(type) + `enum ${type.name}` + printBlock(values); -} -function printInputObject(type) { - const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f)); - return printDescription(type) + `input ${type.name}` + (type.isOneOf ? ' @oneOf' : '') + printBlock(fields); -} -function printFields(type) { - const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, ' ', !i) + ' ' + f.name + printArgs(f.args, ' ') + ': ' + String(f.type) + printDeprecated(f.deprecationReason)); - return printBlock(fields); -} -function printBlock(items) { - return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; -} -function printArgs(args, indentation = '') { - if (args.length === 0) { - return ''; - } // If every arg does not have a description, print them on one line. - - if (args.every(arg => !arg.description)) { - return '(' + args.map(printInputValue).join(', ') + ')'; +})); +Object.defineProperty(exports, "isUnionType", ({ + enumerable: true, + get: function () { + return _index.isUnionType; } - return '(\n' + args.map((arg, i) => printDescription(arg, ' ' + indentation, !i) + ' ' + indentation + printInputValue(arg)).join('\n') + '\n' + indentation + ')'; -} -function printInputValue(arg) { - const defaultAST = (0, _astFromValue.astFromValue)(arg.defaultValue, arg.type); - let argDecl = arg.name + ': ' + String(arg.type); - if (defaultAST) { - argDecl += ` = ${(0, _printer.print)(defaultAST)}`; +})); +Object.defineProperty(exports, "isValidNameError", ({ + enumerable: true, + get: function () { + return _index6.isValidNameError; } - return argDecl + printDeprecated(arg.deprecationReason); -} -function printDirective(directive) { - return printDescription(directive) + 'directive @' + directive.name + printArgs(directive.args) + (directive.isRepeatable ? ' repeatable' : '') + ' on ' + directive.locations.join(' | '); -} -function printDeprecated(reason) { - if (reason == null) { - return ''; +})); +Object.defineProperty(exports, "isValueNode", ({ + enumerable: true, + get: function () { + return _index2.isValueNode; } - if (reason !== _directives.DEFAULT_DEPRECATION_REASON) { - const astValue = (0, _printer.print)({ - kind: _kinds.Kind.STRING, - value: reason - }); - return ` @deprecated(reason: ${astValue})`; +})); +Object.defineProperty(exports, "isWrappingType", ({ + enumerable: true, + get: function () { + return _index.isWrappingType; } - return ' @deprecated'; -} -function printSpecifiedByURL(scalar) { - if (scalar.specifiedByURL == null) { - return ''; +})); +Object.defineProperty(exports, "lexicographicSortSchema", ({ + enumerable: true, + get: function () { + return _index6.lexicographicSortSchema; } - const astValue = (0, _printer.print)({ - kind: _kinds.Kind.STRING, - value: scalar.specifiedByURL - }); - return ` @specifiedBy(url: ${astValue})`; -} -function printDescription(def, indentation = '', firstInBlock = true) { - const { - description - } = def; - if (description == null) { - return ''; +})); +Object.defineProperty(exports, "locatedError", ({ + enumerable: true, + get: function () { + return _index5.locatedError; } - const blockString = (0, _printer.print)({ - kind: _kinds.Kind.STRING, - value: description, - block: (0, _blockString.isPrintableAsBlockString)(description) - }); - const prefix = indentation && !firstInBlock ? '\n' + indentation : indentation; - return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; -} +})); +Object.defineProperty(exports, "parse", ({ + enumerable: true, + get: function () { + return _index2.parse; + } +})); +Object.defineProperty(exports, "parseConstValue", ({ + enumerable: true, + get: function () { + return _index2.parseConstValue; + } +})); +Object.defineProperty(exports, "parseType", ({ + enumerable: true, + get: function () { + return _index2.parseType; + } +})); +Object.defineProperty(exports, "parseValue", ({ + enumerable: true, + get: function () { + return _index2.parseValue; + } +})); +Object.defineProperty(exports, "print", ({ + enumerable: true, + get: function () { + return _index2.print; + } +})); +Object.defineProperty(exports, "printError", ({ + enumerable: true, + get: function () { + return _index5.printError; + } +})); +Object.defineProperty(exports, "printIntrospectionSchema", ({ + enumerable: true, + get: function () { + return _index6.printIntrospectionSchema; + } +})); +Object.defineProperty(exports, "printLocation", ({ + enumerable: true, + get: function () { + return _index2.printLocation; + } +})); +Object.defineProperty(exports, "printSchema", ({ + enumerable: true, + get: function () { + return _index6.printSchema; + } +})); +Object.defineProperty(exports, "printSourceLocation", ({ + enumerable: true, + get: function () { + return _index2.printSourceLocation; + } +})); +Object.defineProperty(exports, "printType", ({ + enumerable: true, + get: function () { + return _index6.printType; + } +})); +Object.defineProperty(exports, "recommendedRules", ({ + enumerable: true, + get: function () { + return _index4.recommendedRules; + } +})); +Object.defineProperty(exports, "resolveObjMapThunk", ({ + enumerable: true, + get: function () { + return _index.resolveObjMapThunk; + } +})); +Object.defineProperty(exports, "resolveReadonlyArrayThunk", ({ + enumerable: true, + get: function () { + return _index.resolveReadonlyArrayThunk; + } +})); +Object.defineProperty(exports, "responsePathAsArray", ({ + enumerable: true, + get: function () { + return _index3.responsePathAsArray; + } +})); +Object.defineProperty(exports, "separateOperations", ({ + enumerable: true, + get: function () { + return _index6.separateOperations; + } +})); +Object.defineProperty(exports, "specifiedDirectives", ({ + enumerable: true, + get: function () { + return _index.specifiedDirectives; + } +})); +Object.defineProperty(exports, "specifiedRules", ({ + enumerable: true, + get: function () { + return _index4.specifiedRules; + } +})); +Object.defineProperty(exports, "specifiedScalarTypes", ({ + enumerable: true, + get: function () { + return _index.specifiedScalarTypes; + } +})); +Object.defineProperty(exports, "stripIgnoredCharacters", ({ + enumerable: true, + get: function () { + return _index6.stripIgnoredCharacters; + } +})); +Object.defineProperty(exports, "subscribe", ({ + enumerable: true, + get: function () { + return _index3.subscribe; + } +})); +Object.defineProperty(exports, "syntaxError", ({ + enumerable: true, + get: function () { + return _index5.syntaxError; + } +})); +Object.defineProperty(exports, "typeFromAST", ({ + enumerable: true, + get: function () { + return _index6.typeFromAST; + } +})); +Object.defineProperty(exports, "validate", ({ + enumerable: true, + get: function () { + return _index4.validate; + } +})); +Object.defineProperty(exports, "validateSchema", ({ + enumerable: true, + get: function () { + return _index.validateSchema; + } +})); +Object.defineProperty(exports, "valueFromAST", ({ + enumerable: true, + get: function () { + return _index6.valueFromAST; + } +})); +Object.defineProperty(exports, "valueFromASTUntyped", ({ + enumerable: true, + get: function () { + return _index6.valueFromASTUntyped; + } +})); +Object.defineProperty(exports, "version", ({ + enumerable: true, + get: function () { + return _version.version; + } +})); +Object.defineProperty(exports, "versionInfo", ({ + enumerable: true, + get: function () { + return _version.versionInfo; + } +})); +Object.defineProperty(exports, "visit", ({ + enumerable: true, + get: function () { + return _index2.visit; + } +})); +Object.defineProperty(exports, "visitInParallel", ({ + enumerable: true, + get: function () { + return _index2.visitInParallel; + } +})); +Object.defineProperty(exports, "visitWithTypeInfo", ({ + enumerable: true, + get: function () { + return _index6.visitWithTypeInfo; + } +})); +var _version = __webpack_require__(/*! ./version.mjs */ "../../../node_modules/graphql/version.mjs"); +var _graphql = __webpack_require__(/*! ./graphql.mjs */ "../../../node_modules/graphql/graphql.mjs"); +var _index = __webpack_require__(/*! ./type/index.mjs */ "../../../node_modules/graphql/type/index.mjs"); +var _index2 = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/index.mjs"); +var _index3 = __webpack_require__(/*! ./execution/index.mjs */ "../../../node_modules/graphql/execution/index.mjs"); +var _index4 = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/index.mjs"); +var _index5 = __webpack_require__(/*! ./error/index.mjs */ "../../../node_modules/graphql/error/index.mjs"); +var _index6 = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/index.mjs"); /***/ }), -/***/ "../../../node_modules/graphql/utilities/separateOperations.mjs": -/*!**********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/separateOperations.mjs ***! - \**********************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/jsutils/Path.mjs": +/*!******************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/Path.mjs ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.separateOperations = separateOperations; -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _visitor = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); +exports.addPath = addPath; +exports.pathToArray = pathToArray; /** - * separateOperations accepts a single AST document which may contain many - * operations and fragments and returns a collection of AST documents each of - * which contains a single operation as well the fragment definitions it - * refers to. + * Given a Path and a key, return a new Path containing the new key. */ - -function separateOperations(documentAST) { - const operations = []; - const depGraph = Object.create(null); // Populate metadata and build a dependency graph. - - for (const definitionNode of documentAST.definitions) { - switch (definitionNode.kind) { - case _kinds.Kind.OPERATION_DEFINITION: - operations.push(definitionNode); - break; - case _kinds.Kind.FRAGMENT_DEFINITION: - depGraph[definitionNode.name.value] = collectDependencies(definitionNode.selectionSet); - break; - default: // ignore non-executable definitions - } - } // For each operation, produce a new synthesized AST which includes only what - // is necessary for completing that operation. - - const separatedDocumentASTs = Object.create(null); - for (const operation of operations) { - const dependencies = new Set(); - for (const fragmentName of collectDependencies(operation.selectionSet)) { - collectTransitiveDependencies(dependencies, depGraph, fragmentName); - } // Provides the empty string for anonymous operations. - - const operationName = operation.name ? operation.name.value : ''; // The list of definition nodes to be included for this operation, sorted - // to retain the same order as the original document. - - separatedDocumentASTs[operationName] = { - kind: _kinds.Kind.DOCUMENT, - definitions: documentAST.definitions.filter(node => node === operation || node.kind === _kinds.Kind.FRAGMENT_DEFINITION && dependencies.has(node.name.value)) - }; - } - return separatedDocumentASTs; +function addPath(prev, key, typename) { + return { + prev, + key, + typename + }; } +/** + * Given a Path, return an Array of the path keys. + */ -// From a dependency graph, collects a list of transitive dependencies by -// recursing through a dependency graph. -function collectTransitiveDependencies(collected, depGraph, fromName) { - if (!collected.has(fromName)) { - collected.add(fromName); - const immediateDeps = depGraph[fromName]; - if (immediateDeps !== undefined) { - for (const toName of immediateDeps) { - collectTransitiveDependencies(collected, depGraph, toName); - } - } +function pathToArray(path) { + const flattened = []; + let curr = path; + while (curr) { + flattened.push(curr.key); + curr = curr.prev; } -} -function collectDependencies(selectionSet) { - const dependencies = []; - (0, _visitor.visit)(selectionSet, { - FragmentSpread(node) { - dependencies.push(node.name.value); - } - }); - return dependencies; + return flattened.reverse(); } /***/ }), -/***/ "../../../node_modules/graphql/utilities/sortValueNode.mjs": -/*!*****************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/sortValueNode.mjs ***! - \*****************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/jsutils/devAssert.mjs": +/*!***********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/devAssert.mjs ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sortValueNode = sortValueNode; -var _naturalCompare = __webpack_require__(/*! ../jsutils/naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/** - * Sort ValueNode. - * - * This function returns a sorted copy of the given ValueNode. - * - * @internal - */ - -function sortValueNode(valueNode) { - switch (valueNode.kind) { - case _kinds.Kind.OBJECT: - return { - ...valueNode, - fields: sortFields(valueNode.fields) - }; - case _kinds.Kind.LIST: - return { - ...valueNode, - values: valueNode.values.map(sortValueNode) - }; - case _kinds.Kind.INT: - case _kinds.Kind.FLOAT: - case _kinds.Kind.STRING: - case _kinds.Kind.BOOLEAN: - case _kinds.Kind.NULL: - case _kinds.Kind.ENUM: - case _kinds.Kind.VARIABLE: - return valueNode; +exports.devAssert = devAssert; +function devAssert(condition, message) { + const booleanCondition = Boolean(condition); + if (!booleanCondition) { + throw new Error(message); } } -function sortFields(fields) { - return fields.map(fieldNode => ({ - ...fieldNode, - value: sortValueNode(fieldNode.value) - })).sort((fieldA, fieldB) => (0, _naturalCompare.naturalCompare)(fieldA.name.value, fieldB.name.value)); -} /***/ }), -/***/ "../../../node_modules/graphql/utilities/stripIgnoredCharacters.mjs": -/*!**************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/stripIgnoredCharacters.mjs ***! - \**************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/jsutils/didYouMean.mjs": +/*!************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/didYouMean.mjs ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.stripIgnoredCharacters = stripIgnoredCharacters; -var _blockString = __webpack_require__(/*! ../language/blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); -var _lexer = __webpack_require__(/*! ../language/lexer.mjs */ "../../../node_modules/graphql/language/lexer.mjs"); -var _source = __webpack_require__(/*! ../language/source.mjs */ "../../../node_modules/graphql/language/source.mjs"); -var _tokenKind = __webpack_require__(/*! ../language/tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); +exports.didYouMean = didYouMean; +const MAX_SUGGESTIONS = 5; /** - * Strips characters that are not significant to the validity or execution - * of a GraphQL document: - * - UnicodeBOM - * - WhiteSpace - * - LineTerminator - * - Comment - * - Comma - * - BlockString indentation - * - * Note: It is required to have a delimiter character between neighboring - * non-punctuator tokens and this function always uses single space as delimiter. - * - * It is guaranteed that both input and output documents if parsed would result - * in the exact same AST except for nodes location. - * - * Warning: It is guaranteed that this function will always produce stable results. - * However, it's not guaranteed that it will stay the same between different - * releases due to bugfixes or changes in the GraphQL specification. - * - * Query example: - * - * ```graphql - * query SomeQuery($foo: String!, $bar: String) { - * someField(foo: $foo, bar: $bar) { - * a - * b { - * c - * d - * } - * } - * } - * ``` - * - * Becomes: - * - * ```graphql - * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} - * ``` - * - * SDL example: - * - * ```graphql - * """ - * Type description - * """ - * type Foo { - * """ - * Field description - * """ - * bar: String - * } - * ``` - * - * Becomes: - * - * ```graphql - * """Type description""" type Foo{"""Field description""" bar:String} - * ``` + * Given [ A, B, C ] return ' Did you mean A, B, or C?'. */ -function stripIgnoredCharacters(source) { - const sourceObj = (0, _source.isSource)(source) ? source : new _source.Source(source); - const body = sourceObj.body; - const lexer = new _lexer.Lexer(sourceObj); - let strippedBody = ''; - let wasLastAddedTokenNonPunctuator = false; - while (lexer.advance().kind !== _tokenKind.TokenKind.EOF) { - const currentToken = lexer.token; - const tokenKind = currentToken.kind; - /** - * Every two non-punctuator tokens should have space between them. - * Also prevent case of non-punctuator token following by spread resulting - * in invalid token (e.g. `1...` is invalid Float token). - */ - - const isNonPunctuator = !(0, _lexer.isPunctuatorTokenKind)(currentToken.kind); - if (wasLastAddedTokenNonPunctuator) { - if (isNonPunctuator || currentToken.kind === _tokenKind.TokenKind.SPREAD) { - strippedBody += ' '; - } - } - const tokenBody = body.slice(currentToken.start, currentToken.end); - if (tokenKind === _tokenKind.TokenKind.BLOCK_STRING) { - strippedBody += (0, _blockString.printBlockString)(currentToken.value, { - minimize: true - }); - } else { - strippedBody += tokenBody; - } - wasLastAddedTokenNonPunctuator = isNonPunctuator; +function didYouMean(firstArg, secondArg) { + const [subMessage, suggestionsArg] = secondArg ? [firstArg, secondArg] : [undefined, firstArg]; + let message = ' Did you mean '; + if (subMessage) { + message += subMessage + ' '; } - return strippedBody; + const suggestions = suggestionsArg.map(x => `"${x}"`); + switch (suggestions.length) { + case 0: + return ''; + case 1: + return message + suggestions[0] + '?'; + case 2: + return message + suggestions[0] + ' or ' + suggestions[1] + '?'; + } + const selected = suggestions.slice(0, MAX_SUGGESTIONS); + const lastItem = selected.pop(); + return message + selected.join(', ') + ', or ' + lastItem + '?'; } /***/ }), -/***/ "../../../node_modules/graphql/utilities/typeComparators.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/typeComparators.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/jsutils/groupBy.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/groupBy.mjs ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.doTypesOverlap = doTypesOverlap; -exports.isEqualType = isEqualType; -exports.isTypeSubTypeOf = isTypeSubTypeOf; -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +exports.groupBy = groupBy; /** - * Provided two types, return true if the types are equal (invariant). + * Groups array items into a Map, given a function to produce grouping key. */ -function isEqualType(typeA, typeB) { - // Equivalent types are equal. - if (typeA === typeB) { - return true; - } // If either type is non-null, the other must also be non-null. - - if ((0, _definition.isNonNullType)(typeA) && (0, _definition.isNonNullType)(typeB)) { - return isEqualType(typeA.ofType, typeB.ofType); - } // If either type is a list, the other must also be a list. +function groupBy(list, keyFn) { + const result = new Map(); + for (const item of list) { + const key = keyFn(item); + const group = result.get(key); + if (group === undefined) { + result.set(key, [item]); + } else { + group.push(item); + } + } + return result; +} - if ((0, _definition.isListType)(typeA) && (0, _definition.isListType)(typeB)) { - return isEqualType(typeA.ofType, typeB.ofType); - } // Otherwise the types are not equal. +/***/ }), - return false; +/***/ "../../../node_modules/graphql/jsutils/identityFunc.mjs": +/*!**************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/identityFunc.mjs ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.identityFunc = identityFunc; +/** + * Returns the first argument it receives. + */ +function identityFunc(x) { + return x; } + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/inspect.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/inspect.mjs ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.inspect = inspect; +const MAX_ARRAY_LENGTH = 10; +const MAX_RECURSIVE_DEPTH = 2; /** - * Provided a type and a super type, return true if the first type is either - * equal or a subset of the second super type (covariant). + * Used to print values in error messages. */ -function isTypeSubTypeOf(schema, maybeSubType, superType) { - // Equivalent type is a valid subtype - if (maybeSubType === superType) { - return true; - } // If superType is non-null, maybeSubType must also be non-null. +function inspect(value) { + return formatValue(value, []); +} +function formatValue(value, seenValues) { + switch (typeof value) { + case 'string': + return JSON.stringify(value); + case 'function': + return value.name ? `[function ${value.name}]` : '[function]'; + case 'object': + return formatObjectValue(value, seenValues); + default: + return String(value); + } +} +function formatObjectValue(value, previouslySeenValues) { + if (value === null) { + return 'null'; + } + if (previouslySeenValues.includes(value)) { + return '[Circular]'; + } + const seenValues = [...previouslySeenValues, value]; + if (isJSONable(value)) { + const jsonValue = value.toJSON(); // check for infinite recursion - if ((0, _definition.isNonNullType)(superType)) { - if ((0, _definition.isNonNullType)(maybeSubType)) { - return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + if (jsonValue !== value) { + return typeof jsonValue === 'string' ? jsonValue : formatValue(jsonValue, seenValues); } - return false; + } else if (Array.isArray(value)) { + return formatArray(value, seenValues); } - if ((0, _definition.isNonNullType)(maybeSubType)) { - // If superType is nullable, maybeSubType may be non-null or nullable. - return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); - } // If superType type is a list, maybeSubType type must also be a list. - - if ((0, _definition.isListType)(superType)) { - if ((0, _definition.isListType)(maybeSubType)) { - return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + return formatObject(value, seenValues); +} +function isJSONable(value) { + return typeof value.toJSON === 'function'; +} +function formatObject(object, seenValues) { + const entries = Object.entries(object); + if (entries.length === 0) { + return '{}'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[' + getObjectTag(object) + ']'; + } + const properties = entries.map(([key, value]) => key + ': ' + formatValue(value, seenValues)); + return '{ ' + properties.join(', ') + ' }'; +} +function formatArray(array, seenValues) { + if (array.length === 0) { + return '[]'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[Array]'; + } + const len = Math.min(MAX_ARRAY_LENGTH, array.length); + const remaining = array.length - len; + const items = []; + for (let i = 0; i < len; ++i) { + items.push(formatValue(array[i], seenValues)); + } + if (remaining === 1) { + items.push('... 1 more item'); + } else if (remaining > 1) { + items.push(`... ${remaining} more items`); + } + return '[' + items.join(', ') + ']'; +} +function getObjectTag(object) { + const tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, ''); + if (tag === 'Object' && typeof object.constructor === 'function') { + const name = object.constructor.name; + if (typeof name === 'string' && name !== '') { + return name; } - return false; } - if ((0, _definition.isListType)(maybeSubType)) { - // If superType is not a list, maybeSubType must also be not a list. - return false; - } // If superType type is an abstract type, check if it is super type of maybeSubType. - // Otherwise, the child type is not a valid subtype of the parent type. - - return (0, _definition.isAbstractType)(superType) && ((0, _definition.isInterfaceType)(maybeSubType) || (0, _definition.isObjectType)(maybeSubType)) && schema.isSubType(superType, maybeSubType); + return tag; } + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/instanceOf.mjs": +/*!************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/instanceOf.mjs ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.instanceOf = void 0; +var _inspect = __webpack_require__(/*! ./inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +/* c8 ignore next 3 */ + +const isProduction = globalThis.process && +// eslint-disable-next-line no-undef +"development" === 'production'; /** - * Provided two composite types, determine if they "overlap". Two composite - * types overlap when the Sets of possible concrete types for each intersect. - * - * This is often used to determine if a fragment of a given type could possibly - * be visited in a context of another type. - * - * This function is commutative. + * A replacement for instanceof which includes an error warning when multi-realm + * constructors are detected. + * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production + * See: https://webpack.js.org/guides/production/ */ -function doTypesOverlap(schema, typeA, typeB) { - // Equivalent types overlap - if (typeA === typeB) { +const instanceOf = exports.instanceOf = /* c8 ignore next 6 */ +// FIXME: https://github.com/graphql/graphql-js/issues/2317 +isProduction ? function instanceOf(value, constructor) { + return value instanceof constructor; +} : function instanceOf(value, constructor) { + if (value instanceof constructor) { return true; } - if ((0, _definition.isAbstractType)(typeA)) { - if ((0, _definition.isAbstractType)(typeB)) { - // If both types are abstract, then determine if there is any intersection - // between possible concrete types of each. - return schema.getPossibleTypes(typeA).some(type => schema.isSubType(typeB, type)); - } // Determine if the latter type is a possible concrete type of the former. + if (typeof value === 'object' && value !== null) { + var _value$constructor; - return schema.isSubType(typeA, typeB); - } - if ((0, _definition.isAbstractType)(typeB)) { - // Determine if the former type is a possible concrete type of the latter. - return schema.isSubType(typeB, typeA); - } // Otherwise the types do not overlap. + // Prefer Symbol.toStringTag since it is immune to minification. + const className = constructor.prototype[Symbol.toStringTag]; + const valueClassName = + // We still need to support constructor's name to detect conflicts with older versions of this library. + Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009 + ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name; + if (className === valueClassName) { + const stringifiedValue = (0, _inspect.inspect)(value); + throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`); + } + } return false; -} +}; /***/ }), -/***/ "../../../node_modules/graphql/utilities/typeFromAST.mjs": -/*!***************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/typeFromAST.mjs ***! - \***************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/jsutils/invariant.mjs": +/*!***********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/invariant.mjs ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.typeFromAST = typeFromAST; -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -function typeFromAST(schema, typeNode) { - switch (typeNode.kind) { - case _kinds.Kind.LIST_TYPE: - { - const innerType = typeFromAST(schema, typeNode.type); - return innerType && new _definition.GraphQLList(innerType); - } - case _kinds.Kind.NON_NULL_TYPE: - { - const innerType = typeFromAST(schema, typeNode.type); - return innerType && new _definition.GraphQLNonNull(innerType); - } - case _kinds.Kind.NAMED_TYPE: - return schema.getType(typeNode.name.value); +exports.invariant = invariant; +function invariant(condition, message) { + const booleanCondition = Boolean(condition); + if (!booleanCondition) { + throw new Error(message != null ? message : 'Unexpected invariant triggered.'); } } /***/ }), -/***/ "../../../node_modules/graphql/utilities/valueFromAST.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/valueFromAST.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/jsutils/isAsyncIterable.mjs": +/*!*****************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/isAsyncIterable.mjs ***! + \*****************************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.valueFromAST = valueFromAST; -var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _keyMap = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +exports.isAsyncIterable = isAsyncIterable; /** - * Produces a JavaScript value given a GraphQL Value AST. - * - * A GraphQL type must be provided, which will be used to interpret different - * GraphQL Value literals. - * - * Returns `undefined` when the value could not be validly coerced according to - * the provided type. - * - * | GraphQL Value | JSON Value | - * | -------------------- | ------------- | - * | Input Object | Object | - * | List | Array | - * | Boolean | Boolean | - * | String | String | - * | Int / Float | Number | - * | Enum Value | Unknown | - * | NullValue | null | - * + * Returns true if the provided object implements the AsyncIterator protocol via + * implementing a `Symbol.asyncIterator` method. */ - -function valueFromAST(valueNode, type, variables) { - if (!valueNode) { - // When there is no node, then there is also no value. - // Importantly, this is different from returning the value null. - return; - } - if (valueNode.kind === _kinds.Kind.VARIABLE) { - const variableName = valueNode.name.value; - if (variables == null || variables[variableName] === undefined) { - // No valid return value. - return; - } - const variableValue = variables[variableName]; - if (variableValue === null && (0, _definition.isNonNullType)(type)) { - return; // Invalid: intentionally return no value. - } // Note: This does no further checking that this variable is correct. - // This assumes that this query has been validated and the variable - // usage here is of the correct type. - - return variableValue; - } - if ((0, _definition.isNonNullType)(type)) { - if (valueNode.kind === _kinds.Kind.NULL) { - return; // Invalid: intentionally return no value. - } - return valueFromAST(valueNode, type.ofType, variables); - } - if (valueNode.kind === _kinds.Kind.NULL) { - // This is explicitly returning the value null. - return null; - } - if ((0, _definition.isListType)(type)) { - const itemType = type.ofType; - if (valueNode.kind === _kinds.Kind.LIST) { - const coercedValues = []; - for (const itemNode of valueNode.values) { - if (isMissingVariable(itemNode, variables)) { - // If an array contains a missing variable, it is either coerced to - // null or if the item type is non-null, it considered invalid. - if ((0, _definition.isNonNullType)(itemType)) { - return; // Invalid: intentionally return no value. - } - coercedValues.push(null); - } else { - const itemValue = valueFromAST(itemNode, itemType, variables); - if (itemValue === undefined) { - return; // Invalid: intentionally return no value. - } - coercedValues.push(itemValue); - } - } - return coercedValues; - } - const coercedValue = valueFromAST(valueNode, itemType, variables); - if (coercedValue === undefined) { - return; // Invalid: intentionally return no value. - } - return [coercedValue]; - } - if ((0, _definition.isInputObjectType)(type)) { - if (valueNode.kind !== _kinds.Kind.OBJECT) { - return; // Invalid: intentionally return no value. - } - const coercedObj = Object.create(null); - const fieldNodes = (0, _keyMap.keyMap)(valueNode.fields, field => field.name.value); - for (const field of Object.values(type.getFields())) { - const fieldNode = fieldNodes[field.name]; - if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { - if (field.defaultValue !== undefined) { - coercedObj[field.name] = field.defaultValue; - } else if ((0, _definition.isNonNullType)(field.type)) { - return; // Invalid: intentionally return no value. - } - continue; - } - const fieldValue = valueFromAST(fieldNode.value, field.type, variables); - if (fieldValue === undefined) { - return; // Invalid: intentionally return no value. - } - coercedObj[field.name] = fieldValue; - } - if (type.isOneOf) { - const keys = Object.keys(coercedObj); - if (keys.length !== 1) { - return; // Invalid: not exactly one key, intentionally return no value. - } - if (coercedObj[keys[0]] === null) { - return; // Invalid: value not non-null, intentionally return no value. - } - } - return coercedObj; - } - if ((0, _definition.isLeafType)(type)) { - // Scalars and Enums fulfill parsing a literal value via parseLiteral(). - // Invalid values represent a failure to parse correctly, in which case - // no value is returned. - let result; - try { - result = type.parseLiteral(valueNode, variables); - } catch (_error) { - return; // Invalid: intentionally return no value. - } - if (result === undefined) { - return; // Invalid: intentionally return no value. - } - return result; - } - /* c8 ignore next 3 */ - // Not reachable, all possible input types have been considered. - - false || (0, _invariant.invariant)(false, 'Unexpected input type: ' + (0, _inspect.inspect)(type)); -} // Returns true if the provided valueNode is a variable which is not defined -// in the set of variables. - -function isMissingVariable(valueNode, variables) { - return valueNode.kind === _kinds.Kind.VARIABLE && (variables == null || variables[valueNode.name.value] === undefined); +function isAsyncIterable(maybeAsyncIterable) { + return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[Symbol.asyncIterator]) === 'function'; } /***/ }), -/***/ "../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs": -/*!***********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs ***! - \***********************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/jsutils/isIterableObject.mjs": +/*!******************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/isIterableObject.mjs ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.valueFromASTUntyped = valueFromASTUntyped; -var _keyValMap = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +exports.isIterableObject = isIterableObject; /** - * Produces a JavaScript value given a GraphQL Value AST. - * - * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value - * will reflect the provided GraphQL value AST. + * Returns true if the provided object is an Object (i.e. not a string literal) + * and implements the Iterator protocol. * - * | GraphQL Value | JavaScript Value | - * | -------------------- | ---------------- | - * | Input Object | Object | - * | List | Array | - * | Boolean | Boolean | - * | String / Enum | String | - * | Int / Float | Number | - * | Null | null | + * This may be used in place of [Array.isArray()][isArray] to determine if + * an object should be iterated-over e.g. Array, Map, Set, Int8Array, + * TypedArray, etc. but excludes string literals. * + * @example + * ```ts + * isIterableObject([ 1, 2, 3 ]) // true + * isIterableObject(new Map()) // true + * isIterableObject('ABC') // false + * isIterableObject({ key: 'value' }) // false + * isIterableObject({ length: 1, 0: 'Alpha' }) // false + * ``` */ - -function valueFromASTUntyped(valueNode, variables) { - switch (valueNode.kind) { - case _kinds.Kind.NULL: - return null; - case _kinds.Kind.INT: - return parseInt(valueNode.value, 10); - case _kinds.Kind.FLOAT: - return parseFloat(valueNode.value); - case _kinds.Kind.STRING: - case _kinds.Kind.ENUM: - case _kinds.Kind.BOOLEAN: - return valueNode.value; - case _kinds.Kind.LIST: - return valueNode.values.map(node => valueFromASTUntyped(node, variables)); - case _kinds.Kind.OBJECT: - return (0, _keyValMap.keyValMap)(valueNode.fields, field => field.name.value, field => valueFromASTUntyped(field.value, variables)); - case _kinds.Kind.VARIABLE: - return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value]; - } +function isIterableObject(maybeIterable) { + return typeof maybeIterable === 'object' && typeof (maybeIterable === null || maybeIterable === void 0 ? void 0 : maybeIterable[Symbol.iterator]) === 'function'; } /***/ }), -/***/ "../../../node_modules/graphql/validation/ValidationContext.mjs": -/*!**********************************************************************!*\ - !*** ../../../node_modules/graphql/validation/ValidationContext.mjs ***! - \**********************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/jsutils/isObjectLike.mjs": +/*!**************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/isObjectLike.mjs ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ValidationContext = exports.SDLValidationContext = exports.ASTValidationContext = void 0; -var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _visitor = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); -var _TypeInfo = __webpack_require__(/*! ../utilities/TypeInfo.mjs */ "../../../node_modules/graphql/utilities/TypeInfo.mjs"); +exports.isObjectLike = isObjectLike; /** - * An instance of this class is passed as the "this" context to all validators, - * allowing access to commonly useful contextual information from within a - * validation rule. + * Return true if `value` is object-like. A value is object-like if it's not + * `null` and has a `typeof` result of "object". */ -class ASTValidationContext { - constructor(ast, onError) { - this._ast = ast; - this._fragments = undefined; - this._fragmentSpreads = new Map(); - this._recursivelyReferencedFragments = new Map(); - this._onError = onError; - } - get [Symbol.toStringTag]() { - return 'ASTValidationContext'; - } - reportError(error) { - this._onError(error); - } - getDocument() { - return this._ast; - } - getFragment(name) { - let fragments; - if (this._fragments) { - fragments = this._fragments; - } else { - fragments = Object.create(null); - for (const defNode of this.getDocument().definitions) { - if (defNode.kind === _kinds.Kind.FRAGMENT_DEFINITION) { - fragments[defNode.name.value] = defNode; - } - } - this._fragments = fragments; - } - return fragments[name]; - } - getFragmentSpreads(node) { - let spreads = this._fragmentSpreads.get(node); - if (!spreads) { - spreads = []; - const setsToVisit = [node]; - let set; - while (set = setsToVisit.pop()) { - for (const selection of set.selections) { - if (selection.kind === _kinds.Kind.FRAGMENT_SPREAD) { - spreads.push(selection); - } else if (selection.selectionSet) { - setsToVisit.push(selection.selectionSet); - } - } - } - this._fragmentSpreads.set(node, spreads); - } - return spreads; - } - getRecursivelyReferencedFragments(operation) { - let fragments = this._recursivelyReferencedFragments.get(operation); - if (!fragments) { - fragments = []; - const collectedNames = Object.create(null); - const nodesToVisit = [operation.selectionSet]; - let node; - while (node = nodesToVisit.pop()) { - for (const spread of this.getFragmentSpreads(node)) { - const fragName = spread.name.value; - if (collectedNames[fragName] !== true) { - collectedNames[fragName] = true; - const fragment = this.getFragment(fragName); - if (fragment) { - fragments.push(fragment); - nodesToVisit.push(fragment.selectionSet); - } - } - } - } - this._recursivelyReferencedFragments.set(operation, fragments); - } - return fragments; - } +function isObjectLike(value) { + return typeof value == 'object' && value !== null; } -exports.ASTValidationContext = ASTValidationContext; -class SDLValidationContext extends ASTValidationContext { - constructor(ast, schema, onError) { - super(ast, onError); - this._schema = schema; - } - get [Symbol.toStringTag]() { - return 'SDLValidationContext'; - } - getSchema() { - return this._schema; - } + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/isPromise.mjs": +/*!***********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/isPromise.mjs ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isPromise = isPromise; +/** + * Returns true if the value acts like a Promise, i.e. has a "then" function, + * otherwise returns false. + */ +function isPromise(value) { + return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function'; } -exports.SDLValidationContext = SDLValidationContext; -class ValidationContext extends ASTValidationContext { - constructor(schema, ast, typeInfo, onError) { - super(ast, onError); - this._schema = schema; - this._typeInfo = typeInfo; - this._variableUsages = new Map(); - this._recursiveVariableUsages = new Map(); - } - get [Symbol.toStringTag]() { - return 'ValidationContext'; - } - getSchema() { - return this._schema; - } - getVariableUsages(node) { - let usages = this._variableUsages.get(node); - if (!usages) { - const newUsages = []; - const typeInfo = new _TypeInfo.TypeInfo(this._schema); - (0, _visitor.visit)(node, (0, _TypeInfo.visitWithTypeInfo)(typeInfo, { - VariableDefinition: () => false, - Variable(variable) { - newUsages.push({ - node: variable, - type: typeInfo.getInputType(), - defaultValue: typeInfo.getDefaultValue() - }); - } - })); - usages = newUsages; - this._variableUsages.set(node, usages); - } - return usages; - } - getRecursiveVariableUsages(operation) { - let usages = this._recursiveVariableUsages.get(operation); - if (!usages) { - usages = this.getVariableUsages(operation); - for (const frag of this.getRecursivelyReferencedFragments(operation)) { - usages = usages.concat(this.getVariableUsages(frag)); - } - this._recursiveVariableUsages.set(operation, usages); - } - return usages; - } - getType() { - return this._typeInfo.getType(); - } - getParentType() { - return this._typeInfo.getParentType(); - } - getInputType() { - return this._typeInfo.getInputType(); - } - getParentInputType() { - return this._typeInfo.getParentInputType(); - } - getFieldDef() { - return this._typeInfo.getFieldDef(); - } - getDirective() { - return this._typeInfo.getDirective(); - } - getArgument() { - return this._typeInfo.getArgument(); + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/keyMap.mjs": +/*!********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/keyMap.mjs ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.keyMap = keyMap; +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * for each value in the array. + * + * This provides a convenient lookup for the array items if the key function + * produces unique results. + * ```ts + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * const entriesByName = keyMap( + * phoneBook, + * entry => entry.name + * ) + * + * // { + * // Jon: { name: 'Jon', num: '555-1234' }, + * // Jenny: { name: 'Jenny', num: '867-5309' } + * // } + * + * const jennyEntry = entriesByName['Jenny'] + * + * // { name: 'Jenny', num: '857-6309' } + * ``` + */ +function keyMap(list, keyFn) { + const result = Object.create(null); + for (const item of list) { + result[keyFn(item)] = item; } - getEnumValue() { - return this._typeInfo.getEnumValue(); + return result; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/keyValMap.mjs": +/*!***********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/keyValMap.mjs ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.keyValMap = keyValMap; +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * and a function to produce the values from each item in the array. + * ```ts + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * // { Jon: '555-1234', Jenny: '867-5309' } + * const phonesByName = keyValMap( + * phoneBook, + * entry => entry.name, + * entry => entry.num + * ) + * ``` + */ +function keyValMap(list, keyFn, valFn) { + const result = Object.create(null); + for (const item of list) { + result[keyFn(item)] = valFn(item); } + return result; } -exports.ValidationContext = ValidationContext; /***/ }), -/***/ "../../../node_modules/graphql/validation/index.mjs": +/***/ "../../../node_modules/graphql/jsutils/mapValue.mjs": /*!**********************************************************!*\ - !*** ../../../node_modules/graphql/validation/index.mjs ***! + !*** ../../../node_modules/graphql/jsutils/mapValue.mjs ***! \**********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -Object.defineProperty(exports, "ExecutableDefinitionsRule", ({ - enumerable: true, - get: function () { - return _ExecutableDefinitionsRule.ExecutableDefinitionsRule; +exports.mapValue = mapValue; +/** + * Creates an object map with the same keys as `map` and values generated by + * running each value of `map` thru `fn`. + */ +function mapValue(map, fn) { + const result = Object.create(null); + for (const key of Object.keys(map)) { + result[key] = fn(map[key], key); } + return result; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/memoize3.mjs": +/*!**********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/memoize3.mjs ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "FieldsOnCorrectTypeRule", ({ - enumerable: true, - get: function () { - return _FieldsOnCorrectTypeRule.FieldsOnCorrectTypeRule; - } +exports.memoize3 = memoize3; +/** + * Memoizes the provided three-argument function. + */ +function memoize3(fn) { + let cache0; + return function memoized(a1, a2, a3) { + if (cache0 === undefined) { + cache0 = new WeakMap(); + } + let cache1 = cache0.get(a1); + if (cache1 === undefined) { + cache1 = new WeakMap(); + cache0.set(a1, cache1); + } + let cache2 = cache1.get(a2); + if (cache2 === undefined) { + cache2 = new WeakMap(); + cache1.set(a2, cache2); + } + let fnResult = cache2.get(a3); + if (fnResult === undefined) { + fnResult = fn(a1, a2, a3); + cache2.set(a3, fnResult); + } + return fnResult; + }; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/naturalCompare.mjs": +/*!****************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/naturalCompare.mjs ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", ({ - enumerable: true, - get: function () { - return _FragmentsOnCompositeTypesRule.FragmentsOnCompositeTypesRule; +exports.naturalCompare = naturalCompare; +/** + * Returns a number indicating whether a reference string comes before, or after, + * or is the same as the given string in natural sort order. + * + * See: https://en.wikipedia.org/wiki/Natural_sort_order + * + */ +function naturalCompare(aStr, bStr) { + let aIndex = 0; + let bIndex = 0; + while (aIndex < aStr.length && bIndex < bStr.length) { + let aChar = aStr.charCodeAt(aIndex); + let bChar = bStr.charCodeAt(bIndex); + if (isDigit(aChar) && isDigit(bChar)) { + let aNum = 0; + do { + ++aIndex; + aNum = aNum * 10 + aChar - DIGIT_0; + aChar = aStr.charCodeAt(aIndex); + } while (isDigit(aChar) && aNum > 0); + let bNum = 0; + do { + ++bIndex; + bNum = bNum * 10 + bChar - DIGIT_0; + bChar = bStr.charCodeAt(bIndex); + } while (isDigit(bChar) && bNum > 0); + if (aNum < bNum) { + return -1; + } + if (aNum > bNum) { + return 1; + } + } else { + if (aChar < bChar) { + return -1; + } + if (aChar > bChar) { + return 1; + } + ++aIndex; + ++bIndex; + } } + return aStr.length - bStr.length; +} +const DIGIT_0 = 48; +const DIGIT_9 = 57; +function isDigit(code) { + return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/printPathArray.mjs": +/*!****************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/printPathArray.mjs ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "KnownArgumentNamesRule", ({ - enumerable: true, - get: function () { - return _KnownArgumentNamesRule.KnownArgumentNamesRule; - } +exports.printPathArray = printPathArray; +/** + * Build a string describing the path. + */ +function printPathArray(path) { + return path.map(key => typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key).join(''); +} + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/promiseForObject.mjs": +/*!******************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/promiseForObject.mjs ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "KnownDirectivesRule", ({ - enumerable: true, - get: function () { - return _KnownDirectivesRule.KnownDirectivesRule; - } +exports.promiseForObject = promiseForObject; +/** + * This function transforms a JS object `ObjMap>` into + * a `Promise>` + * + * This is akin to bluebird's `Promise.props`, but implemented only using + * `Promise.all` so it will work with any implementation of ES6 promises. + */ +function promiseForObject(object) { + return Promise.all(Object.values(object)).then(resolvedValues => { + const resolvedObject = Object.create(null); + for (const [i, key] of Object.keys(object).entries()) { + resolvedObject[key] = resolvedValues[i]; + } + return resolvedObject; + }); +} + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/promiseReduce.mjs": +/*!***************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/promiseReduce.mjs ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "KnownFragmentNamesRule", ({ - enumerable: true, - get: function () { - return _KnownFragmentNamesRule.KnownFragmentNamesRule; +exports.promiseReduce = promiseReduce; +var _isPromise = __webpack_require__(/*! ./isPromise.mjs */ "../../../node_modules/graphql/jsutils/isPromise.mjs"); +/** + * Similar to Array.prototype.reduce(), however the reducing callback may return + * a Promise, in which case reduction will continue after each promise resolves. + * + * If the callback does not return a Promise, then this function will also not + * return a Promise. + */ +function promiseReduce(values, callbackFn, initialValue) { + let accumulator = initialValue; + for (const value of values) { + accumulator = (0, _isPromise.isPromise)(accumulator) ? accumulator.then(resolved => callbackFn(resolved, value)) : callbackFn(accumulator, value); } + return accumulator; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/jsutils/suggestionList.mjs": +/*!****************************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/suggestionList.mjs ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -Object.defineProperty(exports, "KnownTypeNamesRule", ({ - enumerable: true, - get: function () { - return _KnownTypeNamesRule.KnownTypeNamesRule; +exports.suggestionList = suggestionList; +var _naturalCompare = __webpack_require__(/*! ./naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); +/** + * Given an invalid input string and a list of valid options, returns a filtered + * list of valid options sorted based on their similarity with the input. + */ + +function suggestionList(input, options) { + const optionsByDistance = Object.create(null); + const lexicalDistance = new LexicalDistance(input); + const threshold = Math.floor(input.length * 0.4) + 1; + for (const option of options) { + const distance = lexicalDistance.measure(option, threshold); + if (distance !== undefined) { + optionsByDistance[option] = distance; + } } -})); -Object.defineProperty(exports, "LoneAnonymousOperationRule", ({ - enumerable: true, - get: function () { - return _LoneAnonymousOperationRule.LoneAnonymousOperationRule; - } -})); -Object.defineProperty(exports, "LoneSchemaDefinitionRule", ({ - enumerable: true, - get: function () { - return _LoneSchemaDefinitionRule.LoneSchemaDefinitionRule; - } -})); -Object.defineProperty(exports, "MaxIntrospectionDepthRule", ({ - enumerable: true, - get: function () { - return _MaxIntrospectionDepthRule.MaxIntrospectionDepthRule; - } -})); -Object.defineProperty(exports, "NoDeprecatedCustomRule", ({ - enumerable: true, - get: function () { - return _NoDeprecatedCustomRule.NoDeprecatedCustomRule; - } -})); -Object.defineProperty(exports, "NoFragmentCyclesRule", ({ - enumerable: true, - get: function () { - return _NoFragmentCyclesRule.NoFragmentCyclesRule; - } -})); -Object.defineProperty(exports, "NoSchemaIntrospectionCustomRule", ({ - enumerable: true, - get: function () { - return _NoSchemaIntrospectionCustomRule.NoSchemaIntrospectionCustomRule; - } -})); -Object.defineProperty(exports, "NoUndefinedVariablesRule", ({ - enumerable: true, - get: function () { - return _NoUndefinedVariablesRule.NoUndefinedVariablesRule; - } -})); -Object.defineProperty(exports, "NoUnusedFragmentsRule", ({ - enumerable: true, - get: function () { - return _NoUnusedFragmentsRule.NoUnusedFragmentsRule; - } -})); -Object.defineProperty(exports, "NoUnusedVariablesRule", ({ - enumerable: true, - get: function () { - return _NoUnusedVariablesRule.NoUnusedVariablesRule; - } -})); -Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", ({ - enumerable: true, - get: function () { - return _OverlappingFieldsCanBeMergedRule.OverlappingFieldsCanBeMergedRule; - } -})); -Object.defineProperty(exports, "PossibleFragmentSpreadsRule", ({ - enumerable: true, - get: function () { - return _PossibleFragmentSpreadsRule.PossibleFragmentSpreadsRule; - } -})); -Object.defineProperty(exports, "PossibleTypeExtensionsRule", ({ - enumerable: true, - get: function () { - return _PossibleTypeExtensionsRule.PossibleTypeExtensionsRule; - } -})); -Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", ({ - enumerable: true, - get: function () { - return _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsRule; - } -})); -Object.defineProperty(exports, "ScalarLeafsRule", ({ - enumerable: true, - get: function () { - return _ScalarLeafsRule.ScalarLeafsRule; - } -})); -Object.defineProperty(exports, "SingleFieldSubscriptionsRule", ({ - enumerable: true, - get: function () { - return _SingleFieldSubscriptionsRule.SingleFieldSubscriptionsRule; - } -})); -Object.defineProperty(exports, "UniqueArgumentDefinitionNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueArgumentDefinitionNamesRule.UniqueArgumentDefinitionNamesRule; - } -})); -Object.defineProperty(exports, "UniqueArgumentNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueArgumentNamesRule.UniqueArgumentNamesRule; - } -})); -Object.defineProperty(exports, "UniqueDirectiveNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueDirectiveNamesRule.UniqueDirectiveNamesRule; - } -})); -Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", ({ - enumerable: true, - get: function () { - return _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule; - } -})); -Object.defineProperty(exports, "UniqueEnumValueNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueEnumValueNamesRule.UniqueEnumValueNamesRule; - } -})); -Object.defineProperty(exports, "UniqueFieldDefinitionNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueFieldDefinitionNamesRule.UniqueFieldDefinitionNamesRule; - } -})); -Object.defineProperty(exports, "UniqueFragmentNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueFragmentNamesRule.UniqueFragmentNamesRule; - } -})); -Object.defineProperty(exports, "UniqueInputFieldNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule; - } -})); -Object.defineProperty(exports, "UniqueOperationNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueOperationNamesRule.UniqueOperationNamesRule; - } -})); -Object.defineProperty(exports, "UniqueOperationTypesRule", ({ - enumerable: true, - get: function () { - return _UniqueOperationTypesRule.UniqueOperationTypesRule; - } -})); -Object.defineProperty(exports, "UniqueTypeNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueTypeNamesRule.UniqueTypeNamesRule; - } -})); -Object.defineProperty(exports, "UniqueVariableNamesRule", ({ - enumerable: true, - get: function () { - return _UniqueVariableNamesRule.UniqueVariableNamesRule; - } -})); -Object.defineProperty(exports, "ValidationContext", ({ - enumerable: true, - get: function () { - return _ValidationContext.ValidationContext; - } -})); -Object.defineProperty(exports, "ValuesOfCorrectTypeRule", ({ - enumerable: true, - get: function () { - return _ValuesOfCorrectTypeRule.ValuesOfCorrectTypeRule; - } -})); -Object.defineProperty(exports, "VariablesAreInputTypesRule", ({ - enumerable: true, - get: function () { - return _VariablesAreInputTypesRule.VariablesAreInputTypesRule; - } -})); -Object.defineProperty(exports, "VariablesInAllowedPositionRule", ({ - enumerable: true, - get: function () { - return _VariablesInAllowedPositionRule.VariablesInAllowedPositionRule; - } -})); -Object.defineProperty(exports, "recommendedRules", ({ - enumerable: true, - get: function () { - return _specifiedRules.recommendedRules; - } -})); -Object.defineProperty(exports, "specifiedRules", ({ - enumerable: true, - get: function () { - return _specifiedRules.specifiedRules; - } -})); -Object.defineProperty(exports, "validate", ({ - enumerable: true, - get: function () { - return _validate.validate; - } -})); -var _validate = __webpack_require__(/*! ./validate.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); -var _ValidationContext = __webpack_require__(/*! ./ValidationContext.mjs */ "../../../node_modules/graphql/validation/ValidationContext.mjs"); -var _specifiedRules = __webpack_require__(/*! ./specifiedRules.mjs */ "../../../node_modules/graphql/validation/specifiedRules.mjs"); -var _ExecutableDefinitionsRule = __webpack_require__(/*! ./rules/ExecutableDefinitionsRule.mjs */ "../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs"); -var _FieldsOnCorrectTypeRule = __webpack_require__(/*! ./rules/FieldsOnCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs"); -var _FragmentsOnCompositeTypesRule = __webpack_require__(/*! ./rules/FragmentsOnCompositeTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs"); -var _KnownArgumentNamesRule = __webpack_require__(/*! ./rules/KnownArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs"); -var _KnownDirectivesRule = __webpack_require__(/*! ./rules/KnownDirectivesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs"); -var _KnownFragmentNamesRule = __webpack_require__(/*! ./rules/KnownFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs"); -var _KnownTypeNamesRule = __webpack_require__(/*! ./rules/KnownTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs"); -var _LoneAnonymousOperationRule = __webpack_require__(/*! ./rules/LoneAnonymousOperationRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs"); -var _NoFragmentCyclesRule = __webpack_require__(/*! ./rules/NoFragmentCyclesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs"); -var _NoUndefinedVariablesRule = __webpack_require__(/*! ./rules/NoUndefinedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs"); -var _NoUnusedFragmentsRule = __webpack_require__(/*! ./rules/NoUnusedFragmentsRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs"); -var _NoUnusedVariablesRule = __webpack_require__(/*! ./rules/NoUnusedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs"); -var _OverlappingFieldsCanBeMergedRule = __webpack_require__(/*! ./rules/OverlappingFieldsCanBeMergedRule.mjs */ "../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs"); -var _PossibleFragmentSpreadsRule = __webpack_require__(/*! ./rules/PossibleFragmentSpreadsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs"); -var _ProvidedRequiredArgumentsRule = __webpack_require__(/*! ./rules/ProvidedRequiredArgumentsRule.mjs */ "../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs"); -var _ScalarLeafsRule = __webpack_require__(/*! ./rules/ScalarLeafsRule.mjs */ "../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs"); -var _SingleFieldSubscriptionsRule = __webpack_require__(/*! ./rules/SingleFieldSubscriptionsRule.mjs */ "../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs"); -var _UniqueArgumentNamesRule = __webpack_require__(/*! ./rules/UniqueArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs"); -var _UniqueDirectivesPerLocationRule = __webpack_require__(/*! ./rules/UniqueDirectivesPerLocationRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs"); -var _UniqueFragmentNamesRule = __webpack_require__(/*! ./rules/UniqueFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs"); -var _UniqueInputFieldNamesRule = __webpack_require__(/*! ./rules/UniqueInputFieldNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs"); -var _UniqueOperationNamesRule = __webpack_require__(/*! ./rules/UniqueOperationNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs"); -var _UniqueVariableNamesRule = __webpack_require__(/*! ./rules/UniqueVariableNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs"); -var _ValuesOfCorrectTypeRule = __webpack_require__(/*! ./rules/ValuesOfCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs"); -var _VariablesAreInputTypesRule = __webpack_require__(/*! ./rules/VariablesAreInputTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs"); -var _VariablesInAllowedPositionRule = __webpack_require__(/*! ./rules/VariablesInAllowedPositionRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs"); -var _MaxIntrospectionDepthRule = __webpack_require__(/*! ./rules/MaxIntrospectionDepthRule.mjs */ "../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs"); -var _LoneSchemaDefinitionRule = __webpack_require__(/*! ./rules/LoneSchemaDefinitionRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs"); -var _UniqueOperationTypesRule = __webpack_require__(/*! ./rules/UniqueOperationTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs"); -var _UniqueTypeNamesRule = __webpack_require__(/*! ./rules/UniqueTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs"); -var _UniqueEnumValueNamesRule = __webpack_require__(/*! ./rules/UniqueEnumValueNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs"); -var _UniqueFieldDefinitionNamesRule = __webpack_require__(/*! ./rules/UniqueFieldDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs"); -var _UniqueArgumentDefinitionNamesRule = __webpack_require__(/*! ./rules/UniqueArgumentDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs"); -var _UniqueDirectiveNamesRule = __webpack_require__(/*! ./rules/UniqueDirectiveNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs"); -var _PossibleTypeExtensionsRule = __webpack_require__(/*! ./rules/PossibleTypeExtensionsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs"); -var _NoDeprecatedCustomRule = __webpack_require__(/*! ./rules/custom/NoDeprecatedCustomRule.mjs */ "../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs"); -var _NoSchemaIntrospectionCustomRule = __webpack_require__(/*! ./rules/custom/NoSchemaIntrospectionCustomRule.mjs */ "../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs"); - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs": -/*!************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs ***! - \************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.ExecutableDefinitionsRule = ExecutableDefinitionsRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _predicates = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); + return Object.keys(optionsByDistance).sort((a, b) => { + const distanceDiff = optionsByDistance[a] - optionsByDistance[b]; + return distanceDiff !== 0 ? distanceDiff : (0, _naturalCompare.naturalCompare)(a, b); + }); +} /** - * Executable definitions + * Computes the lexical distance between strings A and B. * - * A GraphQL document is only valid for execution if all definitions are either - * operation or fragment definitions. + * The "distance" between two strings is given by counting the minimum number + * of edits needed to transform string A into string B. An edit can be an + * insertion, deletion, or substitution of a single character, or a swap of two + * adjacent characters. * - * See https://spec.graphql.org/draft/#sec-Executable-Definitions + * Includes a custom alteration from Damerau-Levenshtein to treat case changes + * as a single edit which helps identify mis-cased values with an edit distance + * of 1. + * + * This distance can be useful for detecting typos in input or sorting */ -function ExecutableDefinitionsRule(context) { - return { - Document(node) { - for (const definition of node.definitions) { - if (!(0, _predicates.isExecutableDefinitionNode)(definition)) { - const defName = definition.kind === _kinds.Kind.SCHEMA_DEFINITION || definition.kind === _kinds.Kind.SCHEMA_EXTENSION ? 'schema' : '"' + definition.name.value + '"'; - context.reportError(new _GraphQLError.GraphQLError(`The ${defName} definition is not executable.`, { - nodes: definition - })); + +class LexicalDistance { + constructor(input) { + this._input = input; + this._inputLowerCase = input.toLowerCase(); + this._inputArray = stringToArray(this._inputLowerCase); + this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)]; + } + measure(option, threshold) { + if (this._input === option) { + return 0; + } + const optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit + + if (this._inputLowerCase === optionLowerCase) { + return 1; + } + let a = stringToArray(optionLowerCase); + let b = this._inputArray; + if (a.length < b.length) { + const tmp = a; + a = b; + b = tmp; + } + const aLength = a.length; + const bLength = b.length; + if (aLength - bLength > threshold) { + return undefined; + } + const rows = this._rows; + for (let j = 0; j <= bLength; j++) { + rows[0][j] = j; + } + for (let i = 1; i <= aLength; i++) { + const upRow = rows[(i - 1) % 3]; + const currentRow = rows[i % 3]; + let smallestCell = currentRow[0] = i; + for (let j = 1; j <= bLength; j++) { + const cost = a[i - 1] === b[j - 1] ? 0 : 1; + let currentCell = Math.min(upRow[j] + 1, + // delete + currentRow[j - 1] + 1, + // insert + upRow[j - 1] + cost // substitute + ); + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + // transposition + const doubleDiagonalCell = rows[(i - 2) % 3][j - 2]; + currentCell = Math.min(currentCell, doubleDiagonalCell + 1); } + if (currentCell < smallestCell) { + smallestCell = currentCell; + } + currentRow[j] = currentCell; + } // Early exit, since distance can't go smaller than smallest element of the previous row. + + if (smallestCell > threshold) { + return undefined; } - return false; } - }; + const distance = rows[aLength % 3][bLength]; + return distance <= threshold ? distance : undefined; + } +} +function stringToArray(str) { + const strLength = str.length; + const array = new Array(strLength); + for (let i = 0; i < strLength; ++i) { + array[i] = str.charCodeAt(i); + } + return array; } /***/ }), -/***/ "../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs ***! - \**********************************************************************************/ +/***/ "../../../node_modules/graphql/jsutils/toError.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/toError.mjs ***! + \*********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldsOnCorrectTypeRule = FieldsOnCorrectTypeRule; -var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -var _naturalCompare = __webpack_require__(/*! ../../jsutils/naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); -var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +exports.toError = toError; +var _inspect = __webpack_require__(/*! ./inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); /** - * Fields on correct type - * - * A GraphQL document is only valid if all fields selected are defined by the - * parent type, or are an allowed meta field such as __typename. - * - * See https://spec.graphql.org/draft/#sec-Field-Selections + * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. */ -function FieldsOnCorrectTypeRule(context) { - return { - Field(node) { - const type = context.getParentType(); - if (type) { - const fieldDef = context.getFieldDef(); - if (!fieldDef) { - // This field doesn't exist, lets look for suggestions. - const schema = context.getSchema(); - const fieldName = node.name.value; // First determine if there are any suggested types to condition on. - - let suggestion = (0, _didYouMean.didYouMean)('to use an inline fragment on', getSuggestedTypeNames(schema, type, fieldName)); // If there are no suggested types, then perhaps this was a typo? - - if (suggestion === '') { - suggestion = (0, _didYouMean.didYouMean)(getSuggestedFieldNames(type, fieldName)); - } // Report an error, including helpful suggestions. - context.reportError(new _GraphQLError.GraphQLError(`Cannot query field "${fieldName}" on type "${type.name}".` + suggestion, { - nodes: node - })); - } - } - } - }; +function toError(thrownValue) { + return thrownValue instanceof Error ? thrownValue : new NonErrorThrown(thrownValue); } -/** - * Go through all of the implementations of type, as well as the interfaces that - * they implement. If any of those types include the provided field, suggest them, - * sorted by how often the type is referenced. - */ - -function getSuggestedTypeNames(schema, type, fieldName) { - if (!(0, _definition.isAbstractType)(type)) { - // Must be an Object type, which does not have possible fields. - return []; +class NonErrorThrown extends Error { + constructor(thrownValue) { + super('Unexpected error value: ' + (0, _inspect.inspect)(thrownValue)); + this.name = 'NonErrorThrown'; + this.thrownValue = thrownValue; } - const suggestedTypes = new Set(); - const usageCount = Object.create(null); - for (const possibleType of schema.getPossibleTypes(type)) { - if (!possibleType.getFields()[fieldName]) { - continue; - } // This object type defines this field. +} - suggestedTypes.add(possibleType); - usageCount[possibleType.name] = 1; - for (const possibleInterface of possibleType.getInterfaces()) { - var _usageCount$possibleI; - if (!possibleInterface.getFields()[fieldName]) { - continue; - } // This interface type defines this field. +/***/ }), - suggestedTypes.add(possibleInterface); - usageCount[possibleInterface.name] = ((_usageCount$possibleI = usageCount[possibleInterface.name]) !== null && _usageCount$possibleI !== void 0 ? _usageCount$possibleI : 0) + 1; - } - } - return [...suggestedTypes].sort((typeA, typeB) => { - // Suggest both interface and object types based on how common they are. - const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; - if (usageCountDiff !== 0) { - return usageCountDiff; - } // Suggest super types first followed by subtypes +/***/ "../../../node_modules/graphql/jsutils/toObjMap.mjs": +/*!**********************************************************!*\ + !*** ../../../node_modules/graphql/jsutils/toObjMap.mjs ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports) { - if ((0, _definition.isInterfaceType)(typeA) && schema.isSubType(typeA, typeB)) { - return -1; - } - if ((0, _definition.isInterfaceType)(typeB) && schema.isSubType(typeB, typeA)) { - return 1; - } - return (0, _naturalCompare.naturalCompare)(typeA.name, typeB.name); - }).map(x => x.name); -} -/** - * For the field name provided, determine if there are any similar field names - * that may be the result of a typo. - */ +"use strict"; -function getSuggestedFieldNames(type, fieldName) { - if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { - const possibleFieldNames = Object.keys(type.getFields()); - return (0, _suggestionList.suggestionList)(fieldName, possibleFieldNames); - } // Otherwise, must be a Union type, which does not define fields. - return []; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.toObjMap = toObjMap; +function toObjMap(obj) { + if (obj == null) { + return Object.create(null); + } + if (Object.getPrototypeOf(obj) === null) { + return obj; + } + const map = Object.create(null); + for (const [key, value] of Object.entries(obj)) { + map[key] = value; + } + return map; } /***/ }), -/***/ "../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs": -/*!****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs ***! - \****************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/language/ast.mjs": +/*!******************************************************!*\ + !*** ../../../node_modules/graphql/language/ast.mjs ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FragmentsOnCompositeTypesRule = FragmentsOnCompositeTypesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); +exports.Token = exports.QueryDocumentKeys = exports.OperationTypeNode = exports.Location = void 0; +exports.isNode = isNode; /** - * Fragments on composite type - * - * Fragments use a type condition to determine if they apply, since fragments - * can only be spread into a composite type (object, interface, or union), the - * type condition must also be a composite type. - * - * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types + * Contains a range of UTF-8 character offsets and token references that + * identify the region of the source from which the AST derived. */ -function FragmentsOnCompositeTypesRule(context) { - return { - InlineFragment(node) { - const typeCondition = node.typeCondition; - if (typeCondition) { - const type = (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition); - if (type && !(0, _definition.isCompositeType)(type)) { - const typeStr = (0, _printer.print)(typeCondition); - context.reportError(new _GraphQLError.GraphQLError(`Fragment cannot condition on non composite type "${typeStr}".`, { - nodes: typeCondition - })); - } - } - }, - FragmentDefinition(node) { - const type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.typeCondition); - if (type && !(0, _definition.isCompositeType)(type)) { - const typeStr = (0, _printer.print)(node.typeCondition); - context.reportError(new _GraphQLError.GraphQLError(`Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`, { - nodes: node.typeCondition - })); - } - } - }; +class Location { + /** + * The character offset at which this Node begins. + */ + + /** + * The character offset at which this Node ends. + */ + + /** + * The Token at which this Node begins. + */ + + /** + * The Token at which this Node ends. + */ + + /** + * The Source document the AST represents. + */ + constructor(startToken, endToken, source) { + this.start = startToken.start; + this.end = endToken.end; + this.startToken = startToken; + this.endToken = endToken; + this.source = source; + } + get [Symbol.toStringTag]() { + return 'Location'; + } + toJSON() { + return { + start: this.start, + end: this.end + }; + } } +/** + * Represents a range of characters represented by a lexical token + * within a Source. + */ +exports.Location = Location; +class Token { + /** + * The kind of Token. + */ -/***/ }), + /** + * The character offset at which this Node begins. + */ -/***/ "../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs": -/*!*********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs ***! - \*********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + /** + * The character offset at which this Node ends. + */ + /** + * The 1-indexed line number on which this Token appears. + */ + /** + * The 1-indexed column number at which this Token begins. + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.KnownArgumentNamesOnDirectivesRule = KnownArgumentNamesOnDirectivesRule; -exports.KnownArgumentNamesRule = KnownArgumentNamesRule; -var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _directives = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); + /** + * For non-punctuation tokens, represents the interpreted value of the token. + * + * Note: is undefined for punctuation tokens, but typed as string for + * convenience in the parser. + */ + + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + */ + constructor(kind, start, end, line, column, value) { + this.kind = kind; + this.start = start; + this.end = end; + this.line = line; + this.column = column; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + + this.value = value; + this.prev = null; + this.next = null; + } + get [Symbol.toStringTag]() { + return 'Token'; + } + toJSON() { + return { + kind: this.kind, + value: this.value, + line: this.line, + column: this.column + }; + } +} /** - * Known argument names - * - * A GraphQL field is only valid if all supplied arguments are defined by - * that field. - * - * See https://spec.graphql.org/draft/#sec-Argument-Names - * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations + * The list of all possible AST node types. */ -function KnownArgumentNamesRule(context) { - return { - // eslint-disable-next-line new-cap - ...KnownArgumentNamesOnDirectivesRule(context), - Argument(argNode) { - const argDef = context.getArgument(); - const fieldDef = context.getFieldDef(); - const parentType = context.getParentType(); - if (!argDef && fieldDef && parentType) { - const argName = argNode.name.value; - const knownArgsNames = fieldDef.args.map(arg => arg.name); - const suggestions = (0, _suggestionList.suggestionList)(argName, knownArgsNames); - context.reportError(new _GraphQLError.GraphQLError(`Unknown argument "${argName}" on field "${parentType.name}.${fieldDef.name}".` + (0, _didYouMean.didYouMean)(suggestions), { - nodes: argNode - })); - } - } - }; -} + +/** + * @internal + */ +exports.Token = Token; +const QueryDocumentKeys = exports.QueryDocumentKeys = { + Name: [], + Document: ['definitions'], + OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'], + VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], + Variable: ['name'], + SelectionSet: ['selections'], + Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], + Argument: ['name', 'value'], + FragmentSpread: ['name', 'directives'], + InlineFragment: ['typeCondition', 'directives', 'selectionSet'], + FragmentDefinition: ['name', + // Note: fragment variable definitions are deprecated and will removed in v17.0.0 + 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'], + IntValue: [], + FloatValue: [], + StringValue: [], + BooleanValue: [], + NullValue: [], + EnumValue: [], + ListValue: ['values'], + ObjectValue: ['fields'], + ObjectField: ['name', 'value'], + Directive: ['name', 'arguments'], + NamedType: ['name'], + ListType: ['type'], + NonNullType: ['type'], + SchemaDefinition: ['description', 'directives', 'operationTypes'], + OperationTypeDefinition: ['type'], + ScalarTypeDefinition: ['description', 'name', 'directives'], + ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], + FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], + InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'], + InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], + UnionTypeDefinition: ['description', 'name', 'directives', 'types'], + EnumTypeDefinition: ['description', 'name', 'directives', 'values'], + EnumValueDefinition: ['description', 'name', 'directives'], + InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], + DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], + SchemaExtension: ['directives', 'operationTypes'], + ScalarTypeExtension: ['name', 'directives'], + ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + UnionTypeExtension: ['name', 'directives', 'types'], + EnumTypeExtension: ['name', 'directives', 'values'], + InputObjectTypeExtension: ['name', 'directives', 'fields'] +}; +const kindValues = new Set(Object.keys(QueryDocumentKeys)); /** * @internal */ -function KnownArgumentNamesOnDirectivesRule(context) { - const directiveArgs = Object.create(null); - const schema = context.getSchema(); - const definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; - for (const directive of definedDirectives) { - directiveArgs[directive.name] = directive.args.map(arg => arg.name); - } - const astDefinitions = context.getDocument().definitions; - for (const def of astDefinitions) { - if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const argsNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : []; - directiveArgs[def.name.value] = argsNodes.map(arg => arg.name.value); - } - } - return { - Directive(directiveNode) { - const directiveName = directiveNode.name.value; - const knownArgs = directiveArgs[directiveName]; - if (directiveNode.arguments && knownArgs) { - for (const argNode of directiveNode.arguments) { - const argName = argNode.name.value; - if (!knownArgs.includes(argName)) { - const suggestions = (0, _suggestionList.suggestionList)(argName, knownArgs); - context.reportError(new _GraphQLError.GraphQLError(`Unknown argument "${argName}" on directive "@${directiveName}".` + (0, _didYouMean.didYouMean)(suggestions), { - nodes: argNode - })); - } - } - } - return false; - } - }; +function isNode(maybeNode) { + const maybeKind = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind; + return typeof maybeKind === 'string' && kindValues.has(maybeKind); } +/** Name */ + +var OperationTypeNode; +(function (OperationTypeNode) { + OperationTypeNode['QUERY'] = 'query'; + OperationTypeNode['MUTATION'] = 'mutation'; + OperationTypeNode['SUBSCRIPTION'] = 'subscription'; +})(OperationTypeNode || (exports.OperationTypeNode = OperationTypeNode = {})); /***/ }), -/***/ "../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs": -/*!******************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs ***! - \******************************************************************************/ +/***/ "../../../node_modules/graphql/language/blockString.mjs": +/*!**************************************************************!*\ + !*** ../../../node_modules/graphql/language/blockString.mjs ***! + \**************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.KnownDirectivesRule = KnownDirectivesRule; -var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _ast = __webpack_require__(/*! ../../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -var _directiveLocation = __webpack_require__(/*! ../../language/directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _directives = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +exports.dedentBlockStringLines = dedentBlockStringLines; +exports.isPrintableAsBlockString = isPrintableAsBlockString; +exports.printBlockString = printBlockString; +var _characterClasses = __webpack_require__(/*! ./characterClasses.mjs */ "../../../node_modules/graphql/language/characterClasses.mjs"); /** - * Known directives + * Produces the value of a block string from its parsed raw value, similar to + * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. * - * A GraphQL document is only valid if all `@directives` are known by the - * schema and legally positioned. + * This implements the GraphQL spec's BlockStringValue() static algorithm. * - * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined + * @internal */ -function KnownDirectivesRule(context) { - const locationsMap = Object.create(null); - const schema = context.getSchema(); - const definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; - for (const directive of definedDirectives) { - locationsMap[directive.name] = directive.locations; - } - const astDefinitions = context.getDocument().definitions; - for (const def of astDefinitions) { - if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { - locationsMap[def.name.value] = def.locations.map(name => name.value); + +function dedentBlockStringLines(lines) { + var _firstNonEmptyLine2; + let commonIndent = Number.MAX_SAFE_INTEGER; + let firstNonEmptyLine = null; + let lastNonEmptyLine = -1; + for (let i = 0; i < lines.length; ++i) { + var _firstNonEmptyLine; + const line = lines[i]; + const indent = leadingWhitespace(line); + if (indent === line.length) { + continue; // skip empty lines } - } - return { - Directive(node, _key, _parent, _path, ancestors) { - const name = node.name.value; - const locations = locationsMap[name]; - if (!locations) { - context.reportError(new _GraphQLError.GraphQLError(`Unknown directive "@${name}".`, { - nodes: node - })); - return; - } - const candidateLocation = getDirectiveLocationForASTPath(ancestors); - if (candidateLocation && !locations.includes(candidateLocation)) { - context.reportError(new _GraphQLError.GraphQLError(`Directive "@${name}" may not be used on ${candidateLocation}.`, { - nodes: node - })); - } + firstNonEmptyLine = (_firstNonEmptyLine = firstNonEmptyLine) !== null && _firstNonEmptyLine !== void 0 ? _firstNonEmptyLine : i; + lastNonEmptyLine = i; + if (i !== 0 && indent < commonIndent) { + commonIndent = indent; } - }; -} -function getDirectiveLocationForASTPath(ancestors) { - const appliedTo = ancestors[ancestors.length - 1]; - 'kind' in appliedTo || (0, _invariant.invariant)(false); - switch (appliedTo.kind) { - case _kinds.Kind.OPERATION_DEFINITION: - return getDirectiveLocationForOperation(appliedTo.operation); - case _kinds.Kind.FIELD: - return _directiveLocation.DirectiveLocation.FIELD; - case _kinds.Kind.FRAGMENT_SPREAD: - return _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD; - case _kinds.Kind.INLINE_FRAGMENT: - return _directiveLocation.DirectiveLocation.INLINE_FRAGMENT; - case _kinds.Kind.FRAGMENT_DEFINITION: - return _directiveLocation.DirectiveLocation.FRAGMENT_DEFINITION; - case _kinds.Kind.VARIABLE_DEFINITION: - return _directiveLocation.DirectiveLocation.VARIABLE_DEFINITION; - case _kinds.Kind.SCHEMA_DEFINITION: - case _kinds.Kind.SCHEMA_EXTENSION: - return _directiveLocation.DirectiveLocation.SCHEMA; - case _kinds.Kind.SCALAR_TYPE_DEFINITION: - case _kinds.Kind.SCALAR_TYPE_EXTENSION: - return _directiveLocation.DirectiveLocation.SCALAR; - case _kinds.Kind.OBJECT_TYPE_DEFINITION: - case _kinds.Kind.OBJECT_TYPE_EXTENSION: - return _directiveLocation.DirectiveLocation.OBJECT; - case _kinds.Kind.FIELD_DEFINITION: - return _directiveLocation.DirectiveLocation.FIELD_DEFINITION; - case _kinds.Kind.INTERFACE_TYPE_DEFINITION: - case _kinds.Kind.INTERFACE_TYPE_EXTENSION: - return _directiveLocation.DirectiveLocation.INTERFACE; - case _kinds.Kind.UNION_TYPE_DEFINITION: - case _kinds.Kind.UNION_TYPE_EXTENSION: - return _directiveLocation.DirectiveLocation.UNION; - case _kinds.Kind.ENUM_TYPE_DEFINITION: - case _kinds.Kind.ENUM_TYPE_EXTENSION: - return _directiveLocation.DirectiveLocation.ENUM; - case _kinds.Kind.ENUM_VALUE_DEFINITION: - return _directiveLocation.DirectiveLocation.ENUM_VALUE; - case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION: - case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION: - return _directiveLocation.DirectiveLocation.INPUT_OBJECT; - case _kinds.Kind.INPUT_VALUE_DEFINITION: - { - const parentNode = ancestors[ancestors.length - 3]; - 'kind' in parentNode || (0, _invariant.invariant)(false); - return parentNode.kind === _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION ? _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION : _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION; - } - // Not reachable, all possible types have been considered. - - /* c8 ignore next */ - - default: - false || (0, _invariant.invariant)(false, 'Unexpected kind: ' + (0, _inspect.inspect)(appliedTo.kind)); } + return lines // Remove common indentation from all lines but first. + .map((line, i) => i === 0 ? line : line.slice(commonIndent)) // Remove leading and trailing blank lines. + .slice((_firstNonEmptyLine2 = firstNonEmptyLine) !== null && _firstNonEmptyLine2 !== void 0 ? _firstNonEmptyLine2 : 0, lastNonEmptyLine + 1); } -function getDirectiveLocationForOperation(operation) { - switch (operation) { - case _ast.OperationTypeNode.QUERY: - return _directiveLocation.DirectiveLocation.QUERY; - case _ast.OperationTypeNode.MUTATION: - return _directiveLocation.DirectiveLocation.MUTATION; - case _ast.OperationTypeNode.SUBSCRIPTION: - return _directiveLocation.DirectiveLocation.SUBSCRIPTION; +function leadingWhitespace(str) { + let i = 0; + while (i < str.length && (0, _characterClasses.isWhiteSpace)(str.charCodeAt(i))) { + ++i; } + return i; } +/** + * @internal + */ -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs": -/*!*********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs ***! - \*********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +function isPrintableAsBlockString(value) { + if (value === '') { + return true; // empty string is printable + } + let isEmptyLine = true; + let hasIndent = false; + let hasCommonIndent = true; + let seenNonEmptyLine = false; + for (let i = 0; i < value.length; ++i) { + switch (value.codePointAt(i)) { + case 0x0000: + case 0x0001: + case 0x0002: + case 0x0003: + case 0x0004: + case 0x0005: + case 0x0006: + case 0x0007: + case 0x0008: + case 0x000b: + case 0x000c: + case 0x000e: + case 0x000f: + return false; + // Has non-printable characters + case 0x000d: + // \r + return false; + // Has \r or \r\n which will be replaced as \n + case 10: + // \n + if (isEmptyLine && !seenNonEmptyLine) { + return false; // Has leading new line + } + seenNonEmptyLine = true; + isEmptyLine = true; + hasIndent = false; + break; + case 9: // \t -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.KnownFragmentNamesRule = KnownFragmentNamesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); + case 32: + // + hasIndent || (hasIndent = isEmptyLine); + break; + default: + hasCommonIndent && (hasCommonIndent = hasIndent); + isEmptyLine = false; + } + } + if (isEmptyLine) { + return false; // Has trailing empty lines + } + if (hasCommonIndent && seenNonEmptyLine) { + return false; // Has internal indent + } + return true; +} /** - * Known fragment names - * - * A GraphQL document is only valid if all `...Fragment` fragment spreads refer - * to fragments defined in the same document. + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. * - * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined + * @internal */ -function KnownFragmentNamesRule(context) { - return { - FragmentSpread(node) { - const fragmentName = node.name.value; - const fragment = context.getFragment(fragmentName); - if (!fragment) { - context.reportError(new _GraphQLError.GraphQLError(`Unknown fragment "${fragmentName}".`, { - nodes: node.name - })); - } - } - }; -} -/***/ }), +function printBlockString(value, options) { + const escapedValue = value.replace(/"""/g, '\\"""'); // Expand a block string's raw value into independent lines. -/***/ "../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs": -/*!*****************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs ***! - \*****************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + const lines = escapedValue.split(/\r\n|[\n\r]/g); + const isSingleLine = lines.length === 1; // If common indentation is found we can fix some of those cases by adding leading new line + const forceLeadingNewLine = lines.length > 1 && lines.slice(1).every(line => line.length === 0 || (0, _characterClasses.isWhiteSpace)(line.charCodeAt(0))); // Trailing triple quotes just looks confusing but doesn't force trailing new line + const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""'); // Trailing quote (single or double) or slash forces trailing new line -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.KnownTypeNamesRule = KnownTypeNamesRule; -var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _predicates = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -var _introspection = __webpack_require__(/*! ../../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -var _scalars = __webpack_require__(/*! ../../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -/** - * Known type names - * - * A GraphQL document is only valid if referenced types (specifically - * variable definitions and fragment conditions) are defined by the type schema. - * - * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence - */ -function KnownTypeNamesRule(context) { - const schema = context.getSchema(); - const existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); - const definedTypes = Object.create(null); - for (const def of context.getDocument().definitions) { - if ((0, _predicates.isTypeDefinitionNode)(def)) { - definedTypes[def.name.value] = true; - } + const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes; + const hasTrailingSlash = value.endsWith('\\'); + const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash; + const printAsMultipleLines = !(options !== null && options !== void 0 && options.minimize) && ( + // add leading and trailing new lines only if it improves readability + !isSingleLine || value.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes); + let result = ''; // Format a multi-line block quote to account for leading space. + + const skipLeadingNewLine = isSingleLine && (0, _characterClasses.isWhiteSpace)(value.charCodeAt(0)); + if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) { + result += '\n'; } - const typeNames = [...Object.keys(existingTypesMap), ...Object.keys(definedTypes)]; - return { - NamedType(node, _1, parent, _2, ancestors) { - const typeName = node.name.value; - if (!existingTypesMap[typeName] && !definedTypes[typeName]) { - var _ancestors$; - const definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent; - const isSDL = definitionNode != null && isSDLNode(definitionNode); - if (isSDL && standardTypeNames.includes(typeName)) { - return; - } - const suggestedTypes = (0, _suggestionList.suggestionList)(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames); - context.reportError(new _GraphQLError.GraphQLError(`Unknown type "${typeName}".` + (0, _didYouMean.didYouMean)(suggestedTypes), { - nodes: node - })); - } - } - }; -} -const standardTypeNames = [..._scalars.specifiedScalarTypes, ..._introspection.introspectionTypes].map(type => type.name); -function isSDLNode(value) { - return 'kind' in value && ((0, _predicates.isTypeSystemDefinitionNode)(value) || (0, _predicates.isTypeSystemExtensionNode)(value)); + result += escapedValue; + if (printAsMultipleLines || forceTrailingNewline) { + result += '\n'; + } + return '"""' + result + '"""'; } /***/ }), -/***/ "../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs": -/*!*************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs ***! - \*************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/language/characterClasses.mjs": +/*!*******************************************************************!*\ + !*** ../../../node_modules/graphql/language/characterClasses.mjs ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LoneAnonymousOperationRule = LoneAnonymousOperationRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +exports.isDigit = isDigit; +exports.isLetter = isLetter; +exports.isNameContinue = isNameContinue; +exports.isNameStart = isNameStart; +exports.isWhiteSpace = isWhiteSpace; /** - * Lone anonymous operation - * - * A GraphQL document is only valid if when it contains an anonymous operation - * (the query short-hand) that it contains only that one operation definition. - * - * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation + * ``` + * WhiteSpace :: + * - "Horizontal Tab (U+0009)" + * - "Space (U+0020)" + * ``` + * @internal */ -function LoneAnonymousOperationRule(context) { - let operationCount = 0; - return { - Document(node) { - operationCount = node.definitions.filter(definition => definition.kind === _kinds.Kind.OPERATION_DEFINITION).length; - }, - OperationDefinition(node) { - if (!node.name && operationCount > 1) { - context.reportError(new _GraphQLError.GraphQLError('This anonymous operation must be the only defined operation.', { - nodes: node - })); - } - } - }; +function isWhiteSpace(code) { + return code === 0x0009 || code === 0x0020; } - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.LoneSchemaDefinitionRule = LoneSchemaDefinitionRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); /** - * Lone Schema definition - * - * A GraphQL document is only valid if it contains only one schema definition. + * ``` + * Digit :: one of + * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + * ``` + * @internal */ -function LoneSchemaDefinitionRule(context) { - var _ref, _ref2, _oldSchema$astNode; - const oldSchema = context.getSchema(); - const alreadyDefined = (_ref = (_ref2 = (_oldSchema$astNode = oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.astNode) !== null && _oldSchema$astNode !== void 0 ? _oldSchema$astNode : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getQueryType()) !== null && _ref2 !== void 0 ? _ref2 : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getMutationType()) !== null && _ref !== void 0 ? _ref : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getSubscriptionType(); - let schemaDefinitionsCount = 0; - return { - SchemaDefinition(node) { - if (alreadyDefined) { - context.reportError(new _GraphQLError.GraphQLError('Cannot define a new schema within a schema extension.', { - nodes: node - })); - return; - } - if (schemaDefinitionsCount > 0) { - context.reportError(new _GraphQLError.GraphQLError('Must provide only one schema definition.', { - nodes: node - })); - } - ++schemaDefinitionsCount; - } - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs": -/*!************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs ***! - \************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.MaxIntrospectionDepthRule = MaxIntrospectionDepthRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -const MAX_LISTS_DEPTH = 3; -function MaxIntrospectionDepthRule(context) { - /** - * Counts the depth of list fields in "__Type" recursively and - * returns `true` if the limit has been reached. - */ - function checkDepth(node, visitedFragments = Object.create(null), depth = 0) { - if (node.kind === _kinds.Kind.FRAGMENT_SPREAD) { - const fragmentName = node.name.value; - if (visitedFragments[fragmentName] === true) { - // Fragment cycles are handled by `NoFragmentCyclesRule`. - return false; - } - const fragment = context.getFragment(fragmentName); - if (!fragment) { - // Missing fragments checks are handled by `KnownFragmentNamesRule`. - return false; - } // Rather than following an immutable programming pattern which has - // significant memory and garbage collection overhead, we've opted to - // take a mutable approach for efficiency's sake. Importantly visiting a - // fragment twice is fine, so long as you don't do one visit inside the - // other. - - try { - visitedFragments[fragmentName] = true; - return checkDepth(fragment, visitedFragments, depth); - } finally { - visitedFragments[fragmentName] = undefined; - } - } - if (node.kind === _kinds.Kind.FIELD && ( - // check all introspection lists - node.name.value === 'fields' || node.name.value === 'interfaces' || node.name.value === 'possibleTypes' || node.name.value === 'inputFields')) { - // eslint-disable-next-line no-param-reassign - depth++; - if (depth >= MAX_LISTS_DEPTH) { - return true; - } - } // handles fields and inline fragments - if ('selectionSet' in node && node.selectionSet) { - for (const child of node.selectionSet.selections) { - if (checkDepth(child, visitedFragments, depth)) { - return true; - } - } - } - return false; - } - return { - Field(node) { - if (node.name.value === '__schema' || node.name.value === '__type') { - if (checkDepth(node)) { - context.reportError(new _GraphQLError.GraphQLError('Maximum introspection depth exceeded', { - nodes: [node] - })); - return false; - } - } - } - }; +function isDigit(code) { + return code >= 0x0030 && code <= 0x0039; } - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs": -/*!*******************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs ***! - \*******************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.NoFragmentCyclesRule = NoFragmentCyclesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); /** - * No fragment cycles - * - * The graph of fragment spreads must not form any cycles including spreading itself. - * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data. - * - * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles + * ``` + * Letter :: one of + * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` + * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` + * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` + * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` + * ``` + * @internal */ -function NoFragmentCyclesRule(context) { - // Tracks already visited fragments to maintain O(N) and to ensure that cycles - // are not redundantly reported. - const visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors - const spreadPath = []; // Position in the spread path +function isLetter(code) { + return code >= 0x0061 && code <= 0x007a || + // A-Z + code >= 0x0041 && code <= 0x005a // a-z + ; +} +/** + * ``` + * NameStart :: + * - Letter + * - `_` + * ``` + * @internal + */ - const spreadPathIndexByName = Object.create(null); - return { - OperationDefinition: () => false, - FragmentDefinition(node) { - detectCycleRecursive(node); - return false; - } - }; // This does a straight-forward DFS to find cycles. - // It does not terminate when a cycle was found but continues to explore - // the graph to find all possible cycles. +function isNameStart(code) { + return isLetter(code) || code === 0x005f; +} +/** + * ``` + * NameContinue :: + * - Letter + * - Digit + * - `_` + * ``` + * @internal + */ - function detectCycleRecursive(fragment) { - if (visitedFrags[fragment.name.value]) { - return; - } - const fragmentName = fragment.name.value; - visitedFrags[fragmentName] = true; - const spreadNodes = context.getFragmentSpreads(fragment.selectionSet); - if (spreadNodes.length === 0) { - return; - } - spreadPathIndexByName[fragmentName] = spreadPath.length; - for (const spreadNode of spreadNodes) { - const spreadName = spreadNode.name.value; - const cycleIndex = spreadPathIndexByName[spreadName]; - spreadPath.push(spreadNode); - if (cycleIndex === undefined) { - const spreadFragment = context.getFragment(spreadName); - if (spreadFragment) { - detectCycleRecursive(spreadFragment); - } - } else { - const cyclePath = spreadPath.slice(cycleIndex); - const viaPath = cyclePath.slice(0, -1).map(s => '"' + s.name.value + '"').join(', '); - context.reportError(new _GraphQLError.GraphQLError(`Cannot spread fragment "${spreadName}" within itself` + (viaPath !== '' ? ` via ${viaPath}.` : '.'), { - nodes: cyclePath - })); - } - spreadPath.pop(); - } - spreadPathIndexByName[fragmentName] = undefined; - } +function isNameContinue(code) { + return isLetter(code) || isDigit(code) || code === 0x005f; } /***/ }), -/***/ "../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/language/directiveLocation.mjs": +/*!********************************************************************!*\ + !*** ../../../node_modules/graphql/language/directiveLocation.mjs ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoUndefinedVariablesRule = NoUndefinedVariablesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +exports.DirectiveLocation = void 0; /** - * No undefined variables - * - * A GraphQL operation is only valid if all variables encountered, both directly - * and via fragment spreads, are defined by that operation. - * - * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined + * The set of allowed directive location values. */ -function NoUndefinedVariablesRule(context) { - let variableNameDefined = Object.create(null); - return { - OperationDefinition: { - enter() { - variableNameDefined = Object.create(null); - }, - leave(operation) { - const usages = context.getRecursiveVariableUsages(operation); - for (const { - node - } of usages) { - const varName = node.name.value; - if (variableNameDefined[varName] !== true) { - context.reportError(new _GraphQLError.GraphQLError(operation.name ? `Variable "$${varName}" is not defined by operation "${operation.name.value}".` : `Variable "$${varName}" is not defined.`, { - nodes: [node, operation] - })); - } - } - } - }, - VariableDefinition(node) { - variableNameDefined[node.variable.name.value] = true; - } - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs": -/*!********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs ***! - \********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - +var DirectiveLocation; +(function (DirectiveLocation) { + DirectiveLocation['QUERY'] = 'QUERY'; + DirectiveLocation['MUTATION'] = 'MUTATION'; + DirectiveLocation['SUBSCRIPTION'] = 'SUBSCRIPTION'; + DirectiveLocation['FIELD'] = 'FIELD'; + DirectiveLocation['FRAGMENT_DEFINITION'] = 'FRAGMENT_DEFINITION'; + DirectiveLocation['FRAGMENT_SPREAD'] = 'FRAGMENT_SPREAD'; + DirectiveLocation['INLINE_FRAGMENT'] = 'INLINE_FRAGMENT'; + DirectiveLocation['VARIABLE_DEFINITION'] = 'VARIABLE_DEFINITION'; + DirectiveLocation['SCHEMA'] = 'SCHEMA'; + DirectiveLocation['SCALAR'] = 'SCALAR'; + DirectiveLocation['OBJECT'] = 'OBJECT'; + DirectiveLocation['FIELD_DEFINITION'] = 'FIELD_DEFINITION'; + DirectiveLocation['ARGUMENT_DEFINITION'] = 'ARGUMENT_DEFINITION'; + DirectiveLocation['INTERFACE'] = 'INTERFACE'; + DirectiveLocation['UNION'] = 'UNION'; + DirectiveLocation['ENUM'] = 'ENUM'; + DirectiveLocation['ENUM_VALUE'] = 'ENUM_VALUE'; + DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT'; + DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION'; +})(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {})); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.NoUnusedFragmentsRule = NoUnusedFragmentsRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); /** - * No unused fragments - * - * A GraphQL document is only valid if all fragment definitions are spread - * within operations, or spread within other fragments spread within operations. + * The enum type representing the directive location values. * - * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used + * @deprecated Please use `DirectiveLocation`. Will be remove in v17. */ -function NoUnusedFragmentsRule(context) { - const operationDefs = []; - const fragmentDefs = []; - return { - OperationDefinition(node) { - operationDefs.push(node); - return false; - }, - FragmentDefinition(node) { - fragmentDefs.push(node); - return false; - }, - Document: { - leave() { - const fragmentNameUsed = Object.create(null); - for (const operation of operationDefs) { - for (const fragment of context.getRecursivelyReferencedFragments(operation)) { - fragmentNameUsed[fragment.name.value] = true; - } - } - for (const fragmentDef of fragmentDefs) { - const fragName = fragmentDef.name.value; - if (fragmentNameUsed[fragName] !== true) { - context.reportError(new _GraphQLError.GraphQLError(`Fragment "${fragName}" is never used.`, { - nodes: fragmentDef - })); - } - } - } - } - }; -} /***/ }), -/***/ "../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs": -/*!********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs ***! - \********************************************************************************/ +/***/ "../../../node_modules/graphql/language/index.mjs": +/*!********************************************************!*\ + !*** ../../../node_modules/graphql/language/index.mjs ***! + \********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoUnusedVariablesRule = NoUnusedVariablesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/** - * No unused variables - * - * A GraphQL operation is only valid if all variables defined by an operation - * are used, either directly or within a spread fragment. - * - * See https://spec.graphql.org/draft/#sec-All-Variables-Used - */ -function NoUnusedVariablesRule(context) { - let variableDefs = []; - return { - OperationDefinition: { - enter() { - variableDefs = []; - }, - leave(operation) { - const variableNameUsed = Object.create(null); - const usages = context.getRecursiveVariableUsages(operation); - for (const { - node - } of usages) { - variableNameUsed[node.name.value] = true; - } - for (const variableDef of variableDefs) { - const variableName = variableDef.variable.name.value; - if (variableNameUsed[variableName] !== true) { - context.reportError(new _GraphQLError.GraphQLError(operation.name ? `Variable "$${variableName}" is never used in operation "${operation.name.value}".` : `Variable "$${variableName}" is never used.`, { - nodes: variableDef - })); - } - } - } - }, - VariableDefinition(def) { - variableDefs.push(def); - } - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs": -/*!*******************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs ***! - \*******************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +Object.defineProperty(exports, "BREAK", ({ + enumerable: true, + get: function () { + return _visitor.BREAK; + } +})); +Object.defineProperty(exports, "DirectiveLocation", ({ + enumerable: true, + get: function () { + return _directiveLocation.DirectiveLocation; + } +})); +Object.defineProperty(exports, "Kind", ({ + enumerable: true, + get: function () { + return _kinds.Kind; + } +})); +Object.defineProperty(exports, "Lexer", ({ + enumerable: true, + get: function () { + return _lexer.Lexer; + } +})); +Object.defineProperty(exports, "Location", ({ + enumerable: true, + get: function () { + return _ast.Location; + } +})); +Object.defineProperty(exports, "OperationTypeNode", ({ + enumerable: true, + get: function () { + return _ast.OperationTypeNode; + } +})); +Object.defineProperty(exports, "Source", ({ + enumerable: true, + get: function () { + return _source.Source; + } +})); +Object.defineProperty(exports, "Token", ({ + enumerable: true, + get: function () { + return _ast.Token; + } +})); +Object.defineProperty(exports, "TokenKind", ({ + enumerable: true, + get: function () { + return _tokenKind.TokenKind; + } +})); +Object.defineProperty(exports, "getEnterLeaveForKind", ({ + enumerable: true, + get: function () { + return _visitor.getEnterLeaveForKind; + } +})); +Object.defineProperty(exports, "getLocation", ({ + enumerable: true, + get: function () { + return _location.getLocation; + } +})); +Object.defineProperty(exports, "getVisitFn", ({ + enumerable: true, + get: function () { + return _visitor.getVisitFn; + } +})); +Object.defineProperty(exports, "isConstValueNode", ({ + enumerable: true, + get: function () { + return _predicates.isConstValueNode; + } +})); +Object.defineProperty(exports, "isDefinitionNode", ({ + enumerable: true, + get: function () { + return _predicates.isDefinitionNode; + } +})); +Object.defineProperty(exports, "isExecutableDefinitionNode", ({ + enumerable: true, + get: function () { + return _predicates.isExecutableDefinitionNode; + } +})); +Object.defineProperty(exports, "isSelectionNode", ({ + enumerable: true, + get: function () { + return _predicates.isSelectionNode; + } +})); +Object.defineProperty(exports, "isTypeDefinitionNode", ({ + enumerable: true, + get: function () { + return _predicates.isTypeDefinitionNode; + } +})); +Object.defineProperty(exports, "isTypeExtensionNode", ({ + enumerable: true, + get: function () { + return _predicates.isTypeExtensionNode; + } +})); +Object.defineProperty(exports, "isTypeNode", ({ + enumerable: true, + get: function () { + return _predicates.isTypeNode; + } +})); +Object.defineProperty(exports, "isTypeSystemDefinitionNode", ({ + enumerable: true, + get: function () { + return _predicates.isTypeSystemDefinitionNode; + } +})); +Object.defineProperty(exports, "isTypeSystemExtensionNode", ({ + enumerable: true, + get: function () { + return _predicates.isTypeSystemExtensionNode; + } +})); +Object.defineProperty(exports, "isValueNode", ({ + enumerable: true, + get: function () { + return _predicates.isValueNode; + } +})); +Object.defineProperty(exports, "parse", ({ + enumerable: true, + get: function () { + return _parser.parse; + } +})); +Object.defineProperty(exports, "parseConstValue", ({ + enumerable: true, + get: function () { + return _parser.parseConstValue; + } +})); +Object.defineProperty(exports, "parseType", ({ + enumerable: true, + get: function () { + return _parser.parseType; + } +})); +Object.defineProperty(exports, "parseValue", ({ + enumerable: true, + get: function () { + return _parser.parseValue; + } +})); +Object.defineProperty(exports, "print", ({ + enumerable: true, + get: function () { + return _printer.print; + } +})); +Object.defineProperty(exports, "printLocation", ({ + enumerable: true, + get: function () { + return _printLocation.printLocation; + } +})); +Object.defineProperty(exports, "printSourceLocation", ({ + enumerable: true, + get: function () { + return _printLocation.printSourceLocation; + } +})); +Object.defineProperty(exports, "visit", ({ + enumerable: true, + get: function () { + return _visitor.visit; + } +})); +Object.defineProperty(exports, "visitInParallel", ({ + enumerable: true, + get: function () { + return _visitor.visitInParallel; + } +})); +var _source = __webpack_require__(/*! ./source.mjs */ "../../../node_modules/graphql/language/source.mjs"); +var _location = __webpack_require__(/*! ./location.mjs */ "../../../node_modules/graphql/language/location.mjs"); +var _printLocation = __webpack_require__(/*! ./printLocation.mjs */ "../../../node_modules/graphql/language/printLocation.mjs"); +var _kinds = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _tokenKind = __webpack_require__(/*! ./tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); +var _lexer = __webpack_require__(/*! ./lexer.mjs */ "../../../node_modules/graphql/language/lexer.mjs"); +var _parser = __webpack_require__(/*! ./parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); +var _printer = __webpack_require__(/*! ./printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _visitor = __webpack_require__(/*! ./visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); +var _ast = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); +var _predicates = __webpack_require__(/*! ./predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); +var _directiveLocation = __webpack_require__(/*! ./directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); + +/***/ }), + +/***/ "../../../node_modules/graphql/language/kinds.mjs": +/*!********************************************************!*\ + !*** ../../../node_modules/graphql/language/kinds.mjs ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OverlappingFieldsCanBeMergedRule = OverlappingFieldsCanBeMergedRule; -var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _sortValueNode = __webpack_require__(/*! ../../utilities/sortValueNode.mjs */ "../../../node_modules/graphql/utilities/sortValueNode.mjs"); -var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); -function reasonMessage(reason) { - if (Array.isArray(reason)) { - return reason.map(([responseName, subReason]) => `subfields "${responseName}" conflict because ` + reasonMessage(subReason)).join(' and '); - } - return reason; -} +exports.Kind = void 0; /** - * Overlapping fields can be merged - * - * A selection set is only valid if all fields (including spreading any - * fragments) either correspond to distinct response names or can be merged - * without ambiguity. - * - * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging + * The set of allowed kind values for AST nodes. */ - -function OverlappingFieldsCanBeMergedRule(context) { - // A memoization for when two fragments are compared "between" each other for - // conflicts. Two fragments may be compared many times, so memoizing this can - // dramatically improve the performance of this validator. - const comparedFragmentPairs = new PairSet(); // A cache for the "field map" and list of fragment names found in any given - // selection set. Selection sets may be asked for this information multiple - // times, so this improves the performance of this validator. - - const cachedFieldsAndFragmentNames = new Map(); - return { - SelectionSet(selectionSet) { - const conflicts = findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, context.getParentType(), selectionSet); - for (const [[responseName, reason], fields1, fields2] of conflicts) { - const reasonMsg = reasonMessage(reason); - context.reportError(new _GraphQLError.GraphQLError(`Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`, { - nodes: fields1.concat(fields2) - })); - } - } - }; -} +var Kind; +(function (Kind) { + Kind['NAME'] = 'Name'; + Kind['DOCUMENT'] = 'Document'; + Kind['OPERATION_DEFINITION'] = 'OperationDefinition'; + Kind['VARIABLE_DEFINITION'] = 'VariableDefinition'; + Kind['SELECTION_SET'] = 'SelectionSet'; + Kind['FIELD'] = 'Field'; + Kind['ARGUMENT'] = 'Argument'; + Kind['FRAGMENT_SPREAD'] = 'FragmentSpread'; + Kind['INLINE_FRAGMENT'] = 'InlineFragment'; + Kind['FRAGMENT_DEFINITION'] = 'FragmentDefinition'; + Kind['VARIABLE'] = 'Variable'; + Kind['INT'] = 'IntValue'; + Kind['FLOAT'] = 'FloatValue'; + Kind['STRING'] = 'StringValue'; + Kind['BOOLEAN'] = 'BooleanValue'; + Kind['NULL'] = 'NullValue'; + Kind['ENUM'] = 'EnumValue'; + Kind['LIST'] = 'ListValue'; + Kind['OBJECT'] = 'ObjectValue'; + Kind['OBJECT_FIELD'] = 'ObjectField'; + Kind['DIRECTIVE'] = 'Directive'; + Kind['NAMED_TYPE'] = 'NamedType'; + Kind['LIST_TYPE'] = 'ListType'; + Kind['NON_NULL_TYPE'] = 'NonNullType'; + Kind['SCHEMA_DEFINITION'] = 'SchemaDefinition'; + Kind['OPERATION_TYPE_DEFINITION'] = 'OperationTypeDefinition'; + Kind['SCALAR_TYPE_DEFINITION'] = 'ScalarTypeDefinition'; + Kind['OBJECT_TYPE_DEFINITION'] = 'ObjectTypeDefinition'; + Kind['FIELD_DEFINITION'] = 'FieldDefinition'; + Kind['INPUT_VALUE_DEFINITION'] = 'InputValueDefinition'; + Kind['INTERFACE_TYPE_DEFINITION'] = 'InterfaceTypeDefinition'; + Kind['UNION_TYPE_DEFINITION'] = 'UnionTypeDefinition'; + Kind['ENUM_TYPE_DEFINITION'] = 'EnumTypeDefinition'; + Kind['ENUM_VALUE_DEFINITION'] = 'EnumValueDefinition'; + Kind['INPUT_OBJECT_TYPE_DEFINITION'] = 'InputObjectTypeDefinition'; + Kind['DIRECTIVE_DEFINITION'] = 'DirectiveDefinition'; + Kind['SCHEMA_EXTENSION'] = 'SchemaExtension'; + Kind['SCALAR_TYPE_EXTENSION'] = 'ScalarTypeExtension'; + Kind['OBJECT_TYPE_EXTENSION'] = 'ObjectTypeExtension'; + Kind['INTERFACE_TYPE_EXTENSION'] = 'InterfaceTypeExtension'; + Kind['UNION_TYPE_EXTENSION'] = 'UnionTypeExtension'; + Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension'; + Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension'; +})(Kind || (exports.Kind = Kind = {})); /** - * Algorithm: - * - * Conflicts occur when two fields exist in a query which will produce the same - * response name, but represent differing values, thus creating a conflict. - * The algorithm below finds all conflicts via making a series of comparisons - * between fields. In order to compare as few fields as possible, this makes - * a series of comparisons "within" sets of fields and "between" sets of fields. - * - * Given any selection set, a collection produces both a set of fields by - * also including all inline fragments, as well as a list of fragments - * referenced by fragment spreads. - * - * A) Each selection set represented in the document first compares "within" its - * collected set of fields, finding any conflicts between every pair of - * overlapping fields. - * Note: This is the *only time* that a the fields "within" a set are compared - * to each other. After this only fields "between" sets are compared. - * - * B) Also, if any fragment is referenced in a selection set, then a - * comparison is made "between" the original set of fields and the - * referenced fragment. - * - * C) Also, if multiple fragments are referenced, then comparisons - * are made "between" each referenced fragment. - * - * D) When comparing "between" a set of fields and a referenced fragment, first - * a comparison is made between each field in the original set of fields and - * each field in the the referenced set of fields. - * - * E) Also, if any fragment is referenced in the referenced selection set, - * then a comparison is made "between" the original set of fields and the - * referenced fragment (recursively referring to step D). - * - * F) When comparing "between" two fragments, first a comparison is made between - * each field in the first referenced set of fields and each field in the the - * second referenced set of fields. - * - * G) Also, any fragments referenced by the first must be compared to the - * second, and any fragments referenced by the second must be compared to the - * first (recursively referring to step F). - * - * H) When comparing two fields, if both have selection sets, then a comparison - * is made "between" both selection sets, first comparing the set of fields in - * the first selection set with the set of fields in the second. - * - * I) Also, if any fragment is referenced in either selection set, then a - * comparison is made "between" the other set of fields and the - * referenced fragment. - * - * J) Also, if two fragments are referenced in both selection sets, then a - * comparison is made "between" the two fragments. + * The enum type representing the possible kind values of AST nodes. * + * @deprecated Please use `Kind`. Will be remove in v17. */ -// Find all conflicts found "within" a selection set, including those found -// via spreading in fragments. Called when visiting each SelectionSet in the -// GraphQL Document. -function findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentType, selectionSet) { - const conflicts = []; - const [fieldMap, fragmentNames] = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet); // (A) Find find all conflicts "within" the fields of this selection set. - // Note: this is the *only place* `collectConflictsWithin` is called. - collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap); - if (fragmentNames.length !== 0) { - // (B) Then collect conflicts between these fields and those represented by - // each spread fragment name found. - for (let i = 0; i < fragmentNames.length; i++) { - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, fieldMap, fragmentNames[i]); // (C) Then compare this fragment with all other fragments found in this - // selection set to collect conflicts between fragments spread together. - // This compares each item in the list of fragment names to every other - // item in that same list (except for itself). +/***/ }), - for (let j = i + 1; j < fragmentNames.length; j++) { - collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, fragmentNames[i], fragmentNames[j]); - } - } - } - return conflicts; -} // Collect all conflicts found between a set of fields and a fragment reference -// including via spreading in any nested fragments. +/***/ "../../../node_modules/graphql/language/lexer.mjs": +/*!********************************************************!*\ + !*** ../../../node_modules/graphql/language/lexer.mjs ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -function collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentName) { - const fragment = context.getFragment(fragmentName); - if (!fragment) { - return; - } - const [fieldMap2, referencedFragmentNames] = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment); // Do not compare a fragment's fieldMap to itself. +"use strict"; - if (fieldMap === fieldMap2) { - return; - } // (D) First collect any conflicts between the provided collection of fields - // and the collection of fields represented by the given fragment. - collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fieldMap2); // (E) Then collect any conflicts between the provided collection of fields - // and any fragment names found in the given fragment. +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Lexer = void 0; +exports.isPunctuatorTokenKind = isPunctuatorTokenKind; +var _syntaxError = __webpack_require__(/*! ../error/syntaxError.mjs */ "../../../node_modules/graphql/error/syntaxError.mjs"); +var _ast = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); +var _blockString = __webpack_require__(/*! ./blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); +var _characterClasses = __webpack_require__(/*! ./characterClasses.mjs */ "../../../node_modules/graphql/language/characterClasses.mjs"); +var _tokenKind = __webpack_require__(/*! ./tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); +/** + * Given a Source object, creates a Lexer for that source. + * A Lexer is a stateful stream generator in that every time + * it is advanced, it returns the next token in the Source. Assuming the + * source lexes, the final Token emitted by the lexer will be of kind + * EOF, after which the lexer will repeatedly return the same EOF token + * whenever called. + */ - for (const referencedFragmentName of referencedFragmentNames) { - // Memoize so two fragments are not compared for conflicts more than once. - if (comparedFragmentPairs.has(referencedFragmentName, fragmentName, areMutuallyExclusive)) { - continue; - } - comparedFragmentPairs.add(referencedFragmentName, fragmentName, areMutuallyExclusive); - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, referencedFragmentName); - } -} // Collect all conflicts found between two fragments, including via spreading in -// any nested fragments. +class Lexer { + /** + * The previously focused non-ignored token. + */ -function collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentName2) { - // No need to compare a fragment to itself. - if (fragmentName1 === fragmentName2) { - return; - } // Memoize so two fragments are not compared for conflicts more than once. + /** + * The currently focused non-ignored token. + */ - if (comparedFragmentPairs.has(fragmentName1, fragmentName2, areMutuallyExclusive)) { - return; + /** + * The (1-indexed) line containing the current token. + */ + + /** + * The character offset at which the current line begins. + */ + constructor(source) { + const startOfFileToken = new _ast.Token(_tokenKind.TokenKind.SOF, 0, 0, 0, 0); + this.source = source; + this.lastToken = startOfFileToken; + this.token = startOfFileToken; + this.line = 1; + this.lineStart = 0; } - comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive); - const fragment1 = context.getFragment(fragmentName1); - const fragment2 = context.getFragment(fragmentName2); - if (!fragment1 || !fragment2) { - return; + get [Symbol.toStringTag]() { + return 'Lexer'; } - const [fieldMap1, referencedFragmentNames1] = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment1); - const [fieldMap2, referencedFragmentNames2] = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment2); // (F) First, collect all conflicts between these two collections of fields - // (not including any nested fragments). - - collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (G) Then collect conflicts between the first fragment and any nested - // fragments spread in the second fragment. - - for (const referencedFragmentName2 of referencedFragmentNames2) { - collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, referencedFragmentName2); - } // (G) Then collect conflicts between the second fragment and any nested - // fragments spread in the first fragment. + /** + * Advances the token stream to the next non-ignored token. + */ - for (const referencedFragmentName1 of referencedFragmentNames1) { - collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, referencedFragmentName1, fragmentName2); + advance() { + this.lastToken = this.token; + const token = this.token = this.lookahead(); + return token; } -} // Find all conflicts found between two selection sets, including those found -// via spreading in fragments. Called when determining if conflicts exist -// between the sub-fields of two overlapping fields. - -function findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, parentType1, selectionSet1, parentType2, selectionSet2) { - const conflicts = []; - const [fieldMap1, fragmentNames1] = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType1, selectionSet1); - const [fieldMap2, fragmentNames2] = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType2, selectionSet2); // (H) First, collect all conflicts between these two collections of field. + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the state of Lexer. + */ - collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (I) Then collect conflicts between the first collection of fields and - // those referenced by each fragment name associated with the second. + lookahead() { + let token = this.token; + if (token.kind !== _tokenKind.TokenKind.EOF) { + do { + if (token.next) { + token = token.next; + } else { + // Read the next token and form a link in the token linked-list. + const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing. - for (const fragmentName2 of fragmentNames2) { - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentName2); - } // (I) Then collect conflicts between the second collection of fields and - // those referenced by each fragment name associated with the first. + token.next = nextToken; // @ts-expect-error prev is only mutable during parsing. - for (const fragmentName1 of fragmentNames1) { - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap2, fragmentName1); - } // (J) Also collect conflicts between any fragment names by the first and - // fragment names by the second. This compares each item in the first set of - // names to each item in the second set of names. - - for (const fragmentName1 of fragmentNames1) { - for (const fragmentName2 of fragmentNames2) { - collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentName2); - } - } - return conflicts; -} // Collect all Conflicts "within" one collection of fields. - -function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap) { - // A field map is a keyed collection, where each key represents a response - // name and the value at that key is a list of all fields which provide that - // response name. For every response name, if there are multiple fields, they - // must be compared to find a potential conflict. - for (const [responseName, fields] of Object.entries(fieldMap)) { - // This compares every field in the list to every other field in this list - // (except to itself). If the list only has one item, nothing needs to - // be compared. - if (fields.length > 1) { - for (let i = 0; i < fields.length; i++) { - for (let j = i + 1; j < fields.length; j++) { - const conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, - // within one collection is never mutually exclusive - responseName, fields[i], fields[j]); - if (conflict) { - conflicts.push(conflict); - } - } - } - } - } -} // Collect all Conflicts between two collections of fields. This is similar to, -// but different from the `collectConflictsWithin` function above. This check -// assumes that `collectConflictsWithin` has already been called on each -// provided collection of fields. This is true because this validator traverses -// each individual selection set. - -function collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, fieldMap1, fieldMap2) { - // A field map is a keyed collection, where each key represents a response - // name and the value at that key is a list of all fields which provide that - // response name. For any response name which appears in both provided field - // maps, each field from the first field map must be compared to every field - // in the second field map to find potential conflicts. - for (const [responseName, fields1] of Object.entries(fieldMap1)) { - const fields2 = fieldMap2[responseName]; - if (fields2) { - for (const field1 of fields1) { - for (const field2 of fields2) { - const conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, field2); - if (conflict) { - conflicts.push(conflict); - } + nextToken.prev = token; + token = nextToken; } - } + } while (token.kind === _tokenKind.TokenKind.COMMENT); } + return token; } -} // Determines if there is a conflict between two particular fields, including -// comparing their sub-fields. - -function findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, field2) { - const [parentType1, node1, def1] = field1; - const [parentType2, node2, def2] = field2; // If it is known that two fields could not possibly apply at the same - // time, due to the parent types, then it is safe to permit them to diverge - // in aliased field or arguments used as they will not present any ambiguity - // by differing. - // It is known that two parent types could never overlap if they are - // different Object types. Interface or Union types might overlap - if not - // in the current state of the schema, then perhaps in some future version, - // thus may not safely diverge. +} +/** + * @internal + */ +exports.Lexer = Lexer; +function isPunctuatorTokenKind(kind) { + return kind === _tokenKind.TokenKind.BANG || kind === _tokenKind.TokenKind.DOLLAR || kind === _tokenKind.TokenKind.AMP || kind === _tokenKind.TokenKind.PAREN_L || kind === _tokenKind.TokenKind.PAREN_R || kind === _tokenKind.TokenKind.SPREAD || kind === _tokenKind.TokenKind.COLON || kind === _tokenKind.TokenKind.EQUALS || kind === _tokenKind.TokenKind.AT || kind === _tokenKind.TokenKind.BRACKET_L || kind === _tokenKind.TokenKind.BRACKET_R || kind === _tokenKind.TokenKind.BRACE_L || kind === _tokenKind.TokenKind.PIPE || kind === _tokenKind.TokenKind.BRACE_R; +} +/** + * A Unicode scalar value is any Unicode code point except surrogate code + * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and + * 0xE000 to 0x10FFFF. + * + * SourceCharacter :: + * - "Any Unicode scalar value" + */ - const areMutuallyExclusive = parentFieldsAreMutuallyExclusive || parentType1 !== parentType2 && (0, _definition.isObjectType)(parentType1) && (0, _definition.isObjectType)(parentType2); - if (!areMutuallyExclusive) { - // Two aliases must refer to the same field. - const name1 = node1.name.value; - const name2 = node2.name.value; - if (name1 !== name2) { - return [[responseName, `"${name1}" and "${name2}" are different fields`], [node1], [node2]]; - } // Two field calls must have the same arguments. +function isUnicodeScalarValue(code) { + return code >= 0x0000 && code <= 0xd7ff || code >= 0xe000 && code <= 0x10ffff; +} +/** + * The GraphQL specification defines source text as a sequence of unicode scalar + * values (which Unicode defines to exclude surrogate code points). However + * JavaScript defines strings as a sequence of UTF-16 code units which may + * include surrogates. A surrogate pair is a valid source character as it + * encodes a supplementary code point (above U+FFFF), but unpaired surrogate + * code points are not valid source characters. + */ - if (!sameArguments(node1, node2)) { - return [[responseName, 'they have differing arguments'], [node1], [node2]]; - } - } // The return type for each field. +function isSupplementaryCodePoint(body, location) { + return isLeadingSurrogate(body.charCodeAt(location)) && isTrailingSurrogate(body.charCodeAt(location + 1)); +} +function isLeadingSurrogate(code) { + return code >= 0xd800 && code <= 0xdbff; +} +function isTrailingSurrogate(code) { + return code >= 0xdc00 && code <= 0xdfff; +} +/** + * Prints the code point (or end of file reference) at a given location in a + * source for use in error messages. + * + * Printable ASCII is printed quoted, while other points are printed in Unicode + * code point form (ie. U+1234). + */ - const type1 = def1 === null || def1 === void 0 ? void 0 : def1.type; - const type2 = def2 === null || def2 === void 0 ? void 0 : def2.type; - if (type1 && type2 && doTypesConflict(type1, type2)) { - return [[responseName, `they return conflicting types "${(0, _inspect.inspect)(type1)}" and "${(0, _inspect.inspect)(type2)}"`], [node1], [node2]]; - } // Collect and compare sub-fields. Use the same "visited fragment names" list - // for both collections so fields in a fragment reference are never - // compared to themselves. +function printCodePointAt(lexer, location) { + const code = lexer.source.body.codePointAt(location); + if (code === undefined) { + return _tokenKind.TokenKind.EOF; + } else if (code >= 0x0020 && code <= 0x007e) { + // Printable ASCII + const char = String.fromCodePoint(code); + return char === '"' ? "'\"'" : `"${char}"`; + } // Unicode code point - const selectionSet1 = node1.selectionSet; - const selectionSet2 = node2.selectionSet; - if (selectionSet1 && selectionSet2) { - const conflicts = findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, (0, _definition.getNamedType)(type1), selectionSet1, (0, _definition.getNamedType)(type2), selectionSet2); - return subfieldConflicts(conflicts, responseName, node1, node2); - } + return 'U+' + code.toString(16).toUpperCase().padStart(4, '0'); } -function sameArguments(node1, node2) { - const args1 = node1.arguments; - const args2 = node2.arguments; - if (args1 === undefined || args1.length === 0) { - return args2 === undefined || args2.length === 0; - } - if (args2 === undefined || args2.length === 0) { - return false; - } - /* c8 ignore next */ +/** + * Create a token with line and column location information. + */ - if (args1.length !== args2.length) { - /* c8 ignore next */ - return false; - /* c8 ignore next */ - } - const values2 = new Map(args2.map(({ - name, - value - }) => [name.value, value])); - return args1.every(arg1 => { - const value1 = arg1.value; - const value2 = values2.get(arg1.name.value); - if (value2 === undefined) { - return false; - } - return stringifyValue(value1) === stringifyValue(value2); - }); +function createToken(lexer, kind, start, end, value) { + const line = lexer.line; + const col = 1 + start - lexer.lineStart; + return new _ast.Token(kind, start, end, line, col, value); } -function stringifyValue(value) { - return (0, _printer.print)((0, _sortValueNode.sortValueNode)(value)); -} // Two types conflict if both types could not apply to a value simultaneously. -// Composite types are ignored as their individual field types will be compared -// later recursively. However List and Non-Null types must match. +/** + * Gets the next token from the source starting at the given position. + * + * This skips over whitespace until it finds the next lexable token, then lexes + * punctuators immediately or calls the appropriate helper function for more + * complicated tokens. + */ -function doTypesConflict(type1, type2) { - if ((0, _definition.isListType)(type1)) { - return (0, _definition.isListType)(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; - } - if ((0, _definition.isListType)(type2)) { - return true; - } - if ((0, _definition.isNonNullType)(type1)) { - return (0, _definition.isNonNullType)(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; - } - if ((0, _definition.isNonNullType)(type2)) { - return true; - } - if ((0, _definition.isLeafType)(type1) || (0, _definition.isLeafType)(type2)) { - return type1 !== type2; - } - return false; -} // Given a selection set, return the collection of fields (a mapping of response -// name to field nodes and definitions) as well as a list of fragment names -// referenced via fragment spreads. +function readNextToken(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start; + while (position < bodyLength) { + const code = body.charCodeAt(position); // SourceCharacter -function getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet) { - const cached = cachedFieldsAndFragmentNames.get(selectionSet); - if (cached) { - return cached; - } - const nodeAndDefs = Object.create(null); - const fragmentNames = Object.create(null); - _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames); - const result = [nodeAndDefs, Object.keys(fragmentNames)]; - cachedFieldsAndFragmentNames.set(selectionSet, result); - return result; -} // Given a reference to a fragment, return the represented collection of fields -// as well as a list of nested fragment names referenced via fragment spreads. + switch (code) { + // Ignored :: + // - UnicodeBOM + // - WhiteSpace + // - LineTerminator + // - Comment + // - Comma + // + // UnicodeBOM :: "Byte Order Mark (U+FEFF)" + // + // WhiteSpace :: + // - "Horizontal Tab (U+0009)" + // - "Space (U+0020)" + // + // Comma :: , + case 0xfeff: // -function getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment) { - // Short-circuit building a type from the node if possible. - const cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet); - if (cached) { - return cached; - } - const fragmentType = (0, _typeFromAST.typeFromAST)(context.getSchema(), fragment.typeCondition); - return getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragmentType, fragment.selectionSet); -} -function _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames) { - for (const selection of selectionSet.selections) { - switch (selection.kind) { - case _kinds.Kind.FIELD: - { - const fieldName = selection.name.value; - let fieldDef; - if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) { - fieldDef = parentType.getFields()[fieldName]; - } - const responseName = selection.alias ? selection.alias.value : fieldName; - if (!nodeAndDefs[responseName]) { - nodeAndDefs[responseName] = []; - } - nodeAndDefs[responseName].push([parentType, selection, fieldDef]); - break; + case 0x0009: // \t + + case 0x0020: // + + case 0x002c: + // , + ++position; + continue; + // LineTerminator :: + // - "New Line (U+000A)" + // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"] + // - "Carriage Return (U+000D)" "New Line (U+000A)" + + case 0x000a: + // \n + ++position; + ++lexer.line; + lexer.lineStart = position; + continue; + case 0x000d: + // \r + if (body.charCodeAt(position + 1) === 0x000a) { + position += 2; + } else { + ++position; + } + ++lexer.line; + lexer.lineStart = position; + continue; + // Comment + + case 0x0023: + // # + return readComment(lexer, position); + // Token :: + // - Punctuator + // - Name + // - IntValue + // - FloatValue + // - StringValue + // + // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | } + + case 0x0021: + // ! + return createToken(lexer, _tokenKind.TokenKind.BANG, position, position + 1); + case 0x0024: + // $ + return createToken(lexer, _tokenKind.TokenKind.DOLLAR, position, position + 1); + case 0x0026: + // & + return createToken(lexer, _tokenKind.TokenKind.AMP, position, position + 1); + case 0x0028: + // ( + return createToken(lexer, _tokenKind.TokenKind.PAREN_L, position, position + 1); + case 0x0029: + // ) + return createToken(lexer, _tokenKind.TokenKind.PAREN_R, position, position + 1); + case 0x002e: + // . + if (body.charCodeAt(position + 1) === 0x002e && body.charCodeAt(position + 2) === 0x002e) { + return createToken(lexer, _tokenKind.TokenKind.SPREAD, position, position + 3); } - case _kinds.Kind.FRAGMENT_SPREAD: - fragmentNames[selection.name.value] = true; break; - case _kinds.Kind.INLINE_FRAGMENT: - { - const typeCondition = selection.typeCondition; - const inlineFragmentType = typeCondition ? (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition) : parentType; - _collectFieldsAndFragmentNames(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentNames); - break; + case 0x003a: + // : + return createToken(lexer, _tokenKind.TokenKind.COLON, position, position + 1); + case 0x003d: + // = + return createToken(lexer, _tokenKind.TokenKind.EQUALS, position, position + 1); + case 0x0040: + // @ + return createToken(lexer, _tokenKind.TokenKind.AT, position, position + 1); + case 0x005b: + // [ + return createToken(lexer, _tokenKind.TokenKind.BRACKET_L, position, position + 1); + case 0x005d: + // ] + return createToken(lexer, _tokenKind.TokenKind.BRACKET_R, position, position + 1); + case 0x007b: + // { + return createToken(lexer, _tokenKind.TokenKind.BRACE_L, position, position + 1); + case 0x007c: + // | + return createToken(lexer, _tokenKind.TokenKind.PIPE, position, position + 1); + case 0x007d: + // } + return createToken(lexer, _tokenKind.TokenKind.BRACE_R, position, position + 1); + // StringValue + + case 0x0022: + // " + if (body.charCodeAt(position + 1) === 0x0022 && body.charCodeAt(position + 2) === 0x0022) { + return readBlockString(lexer, position); } - } - } -} // Given a series of Conflicts which occurred between two sub-fields, generate -// a single Conflict. + return readString(lexer, position); + } // IntValue | FloatValue (Digit | -) -function subfieldConflicts(conflicts, responseName, node1, node2) { - if (conflicts.length > 0) { - return [[responseName, conflicts.map(([reason]) => reason)], [node1, ...conflicts.map(([, fields1]) => fields1).flat()], [node2, ...conflicts.map(([,, fields2]) => fields2).flat()]]; + if ((0, _characterClasses.isDigit)(code) || code === 0x002d) { + return readNumber(lexer, position, code); + } // Name + + if ((0, _characterClasses.isNameStart)(code)) { + return readName(lexer, position); + } + throw (0, _syntaxError.syntaxError)(lexer.source, position, code === 0x0027 ? 'Unexpected single quote character (\'), did you mean to use a double quote (")?' : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position) ? `Unexpected character: ${printCodePointAt(lexer, position)}.` : `Invalid character: ${printCodePointAt(lexer, position)}.`); } + return createToken(lexer, _tokenKind.TokenKind.EOF, bodyLength, bodyLength); } /** - * A way to keep track of pairs of things when the ordering of the pair does not matter. + * Reads a comment token from the source file. + * + * ``` + * Comment :: # CommentChar* [lookahead != CommentChar] + * + * CommentChar :: SourceCharacter but not LineTerminator + * ``` */ -class PairSet { - constructor() { - this._data = new Map(); - } - has(a, b, areMutuallyExclusive) { - var _this$_data$get; - const [key1, key2] = a < b ? [a, b] : [b, a]; - const result = (_this$_data$get = this._data.get(key1)) === null || _this$_data$get === void 0 ? void 0 : _this$_data$get.get(key2); - if (result === undefined) { - return false; - } // areMutuallyExclusive being false is a superset of being true, hence if - // we want to know if this PairSet "has" these two with no exclusivity, - // we have to ensure it was added as such. +function readComment(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + while (position < bodyLength) { + const code = body.charCodeAt(position); // LineTerminator (\n | \r) - return areMutuallyExclusive ? true : areMutuallyExclusive === result; - } - add(a, b, areMutuallyExclusive) { - const [key1, key2] = a < b ? [a, b] : [b, a]; - const map = this._data.get(key1); - if (map === undefined) { - this._data.set(key1, new Map([[key2, areMutuallyExclusive]])); + if (code === 0x000a || code === 0x000d) { + break; + } // SourceCharacter + + if (isUnicodeScalarValue(code)) { + ++position; + } else if (isSupplementaryCodePoint(body, position)) { + position += 2; } else { - map.set(key2, areMutuallyExclusive); + break; } } + return createToken(lexer, _tokenKind.TokenKind.COMMENT, start, position, body.slice(start + 1, position)); } +/** + * Reads a number token from the source file, either a FloatValue or an IntValue + * depending on whether a FractionalPart or ExponentPart is encountered. + * + * ``` + * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}] + * + * IntegerPart :: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit Digit* + * + * NegativeSign :: - + * + * NonZeroDigit :: Digit but not `0` + * + * FloatValue :: + * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}] + * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}] + * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}] + * + * FractionalPart :: . Digit+ + * + * ExponentPart :: ExponentIndicator Sign? Digit+ + * + * ExponentIndicator :: one of `e` `E` + * + * Sign :: one of + - + * ``` + */ -/***/ }), +function readNumber(lexer, start, firstCode) { + const body = lexer.source.body; + let position = start; + let code = firstCode; + let isFloat = false; // NegativeSign (-) -/***/ "../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs": -/*!**************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs ***! - \**************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + if (code === 0x002d) { + code = body.charCodeAt(++position); + } // Zero (0) + if (code === 0x0030) { + code = body.charCodeAt(++position); + if ((0, _characterClasses.isDigit)(code)) { + throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid number, unexpected digit after 0: ${printCodePointAt(lexer, position)}.`); + } + } else { + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } // Full stop (.) + if (code === 0x002e) { + isFloat = true; + code = body.charCodeAt(++position); + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } // E e -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PossibleFragmentSpreadsRule = PossibleFragmentSpreadsRule; -var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _typeComparators = __webpack_require__(/*! ../../utilities/typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); -var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); -/** - * Possible fragment spread - * - * A fragment spread is only valid if the type condition could ever possibly - * be true: if there is a non-empty intersection of the possible parent types, - * and possible types which pass the type condition. - */ -function PossibleFragmentSpreadsRule(context) { - return { - InlineFragment(node) { - const fragType = context.getType(); - const parentType = context.getParentType(); - if ((0, _definition.isCompositeType)(fragType) && (0, _definition.isCompositeType)(parentType) && !(0, _typeComparators.doTypesOverlap)(context.getSchema(), fragType, parentType)) { - const parentTypeStr = (0, _inspect.inspect)(parentType); - const fragTypeStr = (0, _inspect.inspect)(fragType); - context.reportError(new _GraphQLError.GraphQLError(`Fragment cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { - nodes: node - })); - } - }, - FragmentSpread(node) { - const fragName = node.name.value; - const fragType = getFragmentType(context, fragName); - const parentType = context.getParentType(); - if (fragType && parentType && !(0, _typeComparators.doTypesOverlap)(context.getSchema(), fragType, parentType)) { - const parentTypeStr = (0, _inspect.inspect)(parentType); - const fragTypeStr = (0, _inspect.inspect)(fragType); - context.reportError(new _GraphQLError.GraphQLError(`Fragment "${fragName}" cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { - nodes: node - })); - } + if (code === 0x0045 || code === 0x0065) { + isFloat = true; + code = body.charCodeAt(++position); // + - + + if (code === 0x002b || code === 0x002d) { + code = body.charCodeAt(++position); } - }; + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } // Numbers cannot be followed by . or NameStart + + if (code === 0x002e || (0, _characterClasses.isNameStart)(code)) { + throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid number, expected digit but got: ${printCodePointAt(lexer, position)}.`); + } + return createToken(lexer, isFloat ? _tokenKind.TokenKind.FLOAT : _tokenKind.TokenKind.INT, start, position, body.slice(start, position)); } -function getFragmentType(context, name) { - const frag = context.getFragment(name); - if (frag) { - const type = (0, _typeFromAST.typeFromAST)(context.getSchema(), frag.typeCondition); - if ((0, _definition.isCompositeType)(type)) { - return type; - } +/** + * Returns the new position in the source after reading one or more digits. + */ + +function readDigits(lexer, start, firstCode) { + if (!(0, _characterClasses.isDigit)(firstCode)) { + throw (0, _syntaxError.syntaxError)(lexer.source, start, `Invalid number, expected digit but got: ${printCodePointAt(lexer, start)}.`); + } + const body = lexer.source.body; + let position = start + 1; // +1 to skip first firstCode + + while ((0, _characterClasses.isDigit)(body.charCodeAt(position))) { + ++position; } + return position; } +/** + * Reads a single-quote string token from the source file. + * + * ``` + * StringValue :: + * - `""` [lookahead != `"`] + * - `"` StringCharacter+ `"` + * + * StringCharacter :: + * - SourceCharacter but not `"` or `\` or LineTerminator + * - `\u` EscapedUnicode + * - `\` EscapedCharacter + * + * EscapedUnicode :: + * - `{` HexDigit+ `}` + * - HexDigit HexDigit HexDigit HexDigit + * + * EscapedCharacter :: one of `"` `\` `/` `b` `f` `n` `r` `t` + * ``` + */ -/***/ }), +function readString(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + let chunkStart = position; + let value = ''; + while (position < bodyLength) { + const code = body.charCodeAt(position); // Closing Quote (") -/***/ "../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs": -/*!*************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs ***! - \*************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + if (code === 0x0022) { + value += body.slice(chunkStart, position); + return createToken(lexer, _tokenKind.TokenKind.STRING, start, position + 1, value); + } // Escape Sequence (\) + if (code === 0x005c) { + value += body.slice(chunkStart, position); + const escape = body.charCodeAt(position + 1) === 0x0075 // u + ? body.charCodeAt(position + 2) === 0x007b // { + ? readEscapedUnicodeVariableWidth(lexer, position) : readEscapedUnicodeFixedWidth(lexer, position) : readEscapedCharacter(lexer, position); + value += escape.value; + position += escape.size; + chunkStart = position; + continue; + } // LineTerminator (\n | \r) + if (code === 0x000a || code === 0x000d) { + break; + } // SourceCharacter -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.PossibleTypeExtensionsRule = PossibleTypeExtensionsRule; -var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _invariant = __webpack_require__(/*! ../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _predicates = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/** - * Possible type extension - * - * A type extension is only valid if the type is defined and has the same kind. - */ -function PossibleTypeExtensionsRule(context) { - const schema = context.getSchema(); - const definedTypes = Object.create(null); - for (const def of context.getDocument().definitions) { - if ((0, _predicates.isTypeDefinitionNode)(def)) { - definedTypes[def.name.value] = def; + if (isUnicodeScalarValue(code)) { + ++position; + } else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } else { + throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`); } } - return { - ScalarTypeExtension: checkExtension, - ObjectTypeExtension: checkExtension, - InterfaceTypeExtension: checkExtension, - UnionTypeExtension: checkExtension, - EnumTypeExtension: checkExtension, - InputObjectTypeExtension: checkExtension - }; - function checkExtension(node) { - const typeName = node.name.value; - const defNode = definedTypes[typeName]; - const existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName); - let expectedKind; - if (defNode) { - expectedKind = defKindToExtKind[defNode.kind]; - } else if (existingType) { - expectedKind = typeToExtKind(existingType); - } - if (expectedKind) { - if (expectedKind !== node.kind) { - const kindStr = extensionKindToTypeName(node.kind); - context.reportError(new _GraphQLError.GraphQLError(`Cannot extend non-${kindStr} type "${typeName}".`, { - nodes: defNode ? [defNode, node] : node - })); + throw (0, _syntaxError.syntaxError)(lexer.source, position, 'Unterminated string.'); +} // The string value and lexed size of an escape sequence. + +function readEscapedUnicodeVariableWidth(lexer, position) { + const body = lexer.source.body; + let point = 0; + let size = 3; // Cannot be larger than 12 chars (\u{00000000}). + + while (size < 12) { + const code = body.charCodeAt(position + size++); // Closing Brace (}) + + if (code === 0x007d) { + // Must be at least 5 chars (\u{0}) and encode a Unicode scalar value. + if (size < 5 || !isUnicodeScalarValue(point)) { + break; } - } else { - const allTypeNames = Object.keys({ - ...definedTypes, - ...(schema === null || schema === void 0 ? void 0 : schema.getTypeMap()) - }); - const suggestedTypes = (0, _suggestionList.suggestionList)(typeName, allTypeNames); - context.reportError(new _GraphQLError.GraphQLError(`Cannot extend type "${typeName}" because it is not defined.` + (0, _didYouMean.didYouMean)(suggestedTypes), { - nodes: node.name - })); + return { + value: String.fromCodePoint(point), + size + }; + } // Append this hex digit to the code point. + + point = point << 4 | readHexDigit(code); + if (point < 0) { + break; } } + throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + size)}".`); } -const defKindToExtKind = { - [_kinds.Kind.SCALAR_TYPE_DEFINITION]: _kinds.Kind.SCALAR_TYPE_EXTENSION, - [_kinds.Kind.OBJECT_TYPE_DEFINITION]: _kinds.Kind.OBJECT_TYPE_EXTENSION, - [_kinds.Kind.INTERFACE_TYPE_DEFINITION]: _kinds.Kind.INTERFACE_TYPE_EXTENSION, - [_kinds.Kind.UNION_TYPE_DEFINITION]: _kinds.Kind.UNION_TYPE_EXTENSION, - [_kinds.Kind.ENUM_TYPE_DEFINITION]: _kinds.Kind.ENUM_TYPE_EXTENSION, - [_kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION]: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION -}; -function typeToExtKind(type) { - if ((0, _definition.isScalarType)(type)) { - return _kinds.Kind.SCALAR_TYPE_EXTENSION; - } - if ((0, _definition.isObjectType)(type)) { - return _kinds.Kind.OBJECT_TYPE_EXTENSION; - } - if ((0, _definition.isInterfaceType)(type)) { - return _kinds.Kind.INTERFACE_TYPE_EXTENSION; - } - if ((0, _definition.isUnionType)(type)) { - return _kinds.Kind.UNION_TYPE_EXTENSION; - } - if ((0, _definition.isEnumType)(type)) { - return _kinds.Kind.ENUM_TYPE_EXTENSION; - } - if ((0, _definition.isInputObjectType)(type)) { - return _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION; +function readEscapedUnicodeFixedWidth(lexer, position) { + const body = lexer.source.body; + const code = read16BitHexCode(body, position + 2); + if (isUnicodeScalarValue(code)) { + return { + value: String.fromCodePoint(code), + size: 6 + }; + } // GraphQL allows JSON-style surrogate pair escape sequences, but only when + // a valid pair is formed. + + if (isLeadingSurrogate(code)) { + // \u + if (body.charCodeAt(position + 6) === 0x005c && body.charCodeAt(position + 7) === 0x0075) { + const trailingCode = read16BitHexCode(body, position + 8); + if (isTrailingSurrogate(trailingCode)) { + // JavaScript defines strings as a sequence of UTF-16 code units and + // encodes Unicode code points above U+FFFF using a surrogate pair of + // code units. Since this is a surrogate pair escape sequence, just + // include both codes into the JavaScript string value. Had JavaScript + // not been internally based on UTF-16, then this surrogate pair would + // be decoded to retrieve the supplementary code point. + return { + value: String.fromCodePoint(code, trailingCode), + size: 12 + }; + } + } } - /* c8 ignore next 3 */ - // Not reachable. All possible types have been considered + throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".`); +} +/** + * Reads four hexadecimal characters and returns the positive integer that 16bit + * hexadecimal string represents. For example, "000f" will return 15, and "dead" + * will return 57005. + * + * Returns a negative number if any char was not a valid hexadecimal digit. + */ - false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); +function read16BitHexCode(body, position) { + // readHexDigit() returns -1 on error. ORing a negative value with any other + // value always produces a negative value. + return readHexDigit(body.charCodeAt(position)) << 12 | readHexDigit(body.charCodeAt(position + 1)) << 8 | readHexDigit(body.charCodeAt(position + 2)) << 4 | readHexDigit(body.charCodeAt(position + 3)); } -function extensionKindToTypeName(kind) { - switch (kind) { - case _kinds.Kind.SCALAR_TYPE_EXTENSION: - return 'scalar'; - case _kinds.Kind.OBJECT_TYPE_EXTENSION: - return 'object'; - case _kinds.Kind.INTERFACE_TYPE_EXTENSION: - return 'interface'; - case _kinds.Kind.UNION_TYPE_EXTENSION: - return 'union'; - case _kinds.Kind.ENUM_TYPE_EXTENSION: - return 'enum'; - case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION: - return 'input object'; - // Not reachable. All possible types have been considered +/** + * Reads a hexadecimal character and returns its positive integer value (0-15). + * + * '0' becomes 0, '9' becomes 9 + * 'A' becomes 10, 'F' becomes 15 + * 'a' becomes 10, 'f' becomes 15 + * + * Returns -1 if the provided character code was not a valid hexadecimal digit. + * + * HexDigit :: one of + * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + * - `A` `B` `C` `D` `E` `F` + * - `a` `b` `c` `d` `e` `f` + */ - /* c8 ignore next */ +function readHexDigit(code) { + return code >= 0x0030 && code <= 0x0039 // 0-9 + ? code - 0x0030 : code >= 0x0041 && code <= 0x0046 // A-F + ? code - 0x0037 : code >= 0x0061 && code <= 0x0066 // a-f + ? code - 0x0057 : -1; +} +/** + * | Escaped Character | Code Point | Character Name | + * | ----------------- | ---------- | ---------------------------- | + * | `"` | U+0022 | double quote | + * | `\` | U+005C | reverse solidus (back slash) | + * | `/` | U+002F | solidus (forward slash) | + * | `b` | U+0008 | backspace | + * | `f` | U+000C | form feed | + * | `n` | U+000A | line feed (new line) | + * | `r` | U+000D | carriage return | + * | `t` | U+0009 | horizontal tab | + */ - default: - false || (0, _invariant.invariant)(false, 'Unexpected kind: ' + (0, _inspect.inspect)(kind)); +function readEscapedCharacter(lexer, position) { + const body = lexer.source.body; + const code = body.charCodeAt(position + 1); + switch (code) { + case 0x0022: + // " + return { + value: '\u0022', + size: 2 + }; + case 0x005c: + // \ + return { + value: '\u005c', + size: 2 + }; + case 0x002f: + // / + return { + value: '\u002f', + size: 2 + }; + case 0x0062: + // b + return { + value: '\u0008', + size: 2 + }; + case 0x0066: + // f + return { + value: '\u000c', + size: 2 + }; + case 0x006e: + // n + return { + value: '\u000a', + size: 2 + }; + case 0x0072: + // r + return { + value: '\u000d', + size: 2 + }; + case 0x0074: + // t + return { + value: '\u0009', + size: 2 + }; } + throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid character escape sequence: "${body.slice(position, position + 2)}".`); } +/** + * Reads a block string token from the source file. + * + * ``` + * StringValue :: + * - `"""` BlockStringCharacter* `"""` + * + * BlockStringCharacter :: + * - SourceCharacter but not `"""` or `\"""` + * - `\"""` + * ``` + */ -/***/ }), +function readBlockString(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let lineStart = lexer.lineStart; + let position = start + 3; + let chunkStart = position; + let currentLine = ''; + const blockLines = []; + while (position < bodyLength) { + const code = body.charCodeAt(position); // Closing Triple-Quote (""") -/***/ "../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs": -/*!****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs ***! - \****************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + if (code === 0x0022 && body.charCodeAt(position + 1) === 0x0022 && body.charCodeAt(position + 2) === 0x0022) { + currentLine += body.slice(chunkStart, position); + blockLines.push(currentLine); + const token = createToken(lexer, _tokenKind.TokenKind.BLOCK_STRING, start, position + 3, + // Return a string of the lines joined with U+000A. + (0, _blockString.dedentBlockStringLines)(blockLines).join('\n')); + lexer.line += blockLines.length - 1; + lexer.lineStart = lineStart; + return token; + } // Escaped Triple-Quote (\""") + if (code === 0x005c && body.charCodeAt(position + 1) === 0x0022 && body.charCodeAt(position + 2) === 0x0022 && body.charCodeAt(position + 3) === 0x0022) { + currentLine += body.slice(chunkStart, position); + chunkStart = position + 1; // skip only slash + position += 4; + continue; + } // LineTerminator -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.ProvidedRequiredArgumentsOnDirectivesRule = ProvidedRequiredArgumentsOnDirectivesRule; -exports.ProvidedRequiredArgumentsRule = ProvidedRequiredArgumentsRule; -var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _keyMap = __webpack_require__(/*! ../../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _directives = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/** - * Provided required arguments - * - * A field or directive is only valid if all required (non-null without a - * default value) field arguments have been provided. - */ -function ProvidedRequiredArgumentsRule(context) { - return { - // eslint-disable-next-line new-cap - ...ProvidedRequiredArgumentsOnDirectivesRule(context), - Field: { - // Validate on leave to allow for deeper errors to appear first. - leave(fieldNode) { - var _fieldNode$arguments; - const fieldDef = context.getFieldDef(); - if (!fieldDef) { - return false; - } - const providedArgs = new Set( - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - /* c8 ignore next */ - (_fieldNode$arguments = fieldNode.arguments) === null || _fieldNode$arguments === void 0 ? void 0 : _fieldNode$arguments.map(arg => arg.name.value)); - for (const argDef of fieldDef.args) { - if (!providedArgs.has(argDef.name) && (0, _definition.isRequiredArgument)(argDef)) { - const argTypeStr = (0, _inspect.inspect)(argDef.type); - context.reportError(new _GraphQLError.GraphQLError(`Field "${fieldDef.name}" argument "${argDef.name}" of type "${argTypeStr}" is required, but it was not provided.`, { - nodes: fieldNode - })); - } - } + if (code === 0x000a || code === 0x000d) { + currentLine += body.slice(chunkStart, position); + blockLines.push(currentLine); + if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) { + position += 2; + } else { + ++position; } + currentLine = ''; + chunkStart = position; + lineStart = position; + continue; + } // SourceCharacter + + if (isUnicodeScalarValue(code)) { + ++position; + } else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } else { + throw (0, _syntaxError.syntaxError)(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`); } - }; + } + throw (0, _syntaxError.syntaxError)(lexer.source, position, 'Unterminated string.'); } /** - * @internal + * Reads an alphanumeric + underscore name from the source. + * + * ``` + * Name :: + * - NameStart NameContinue* [lookahead != NameContinue] + * ``` */ -function ProvidedRequiredArgumentsOnDirectivesRule(context) { - var _schema$getDirectives; - const requiredArgsMap = Object.create(null); - const schema = context.getSchema(); - const definedDirectives = (_schema$getDirectives = schema === null || schema === void 0 ? void 0 : schema.getDirectives()) !== null && _schema$getDirectives !== void 0 ? _schema$getDirectives : _directives.specifiedDirectives; - for (const directive of definedDirectives) { - requiredArgsMap[directive.name] = (0, _keyMap.keyMap)(directive.args.filter(_definition.isRequiredArgument), arg => arg.name); +function readName(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + while (position < bodyLength) { + const code = body.charCodeAt(position); + if ((0, _characterClasses.isNameContinue)(code)) { + ++position; + } else { + break; + } } - const astDefinitions = context.getDocument().definitions; - for (const def of astDefinitions) { - if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; + return createToken(lexer, _tokenKind.TokenKind.NAME, start, position, body.slice(start, position)); +} - // FIXME: https://github.com/graphql/graphql-js/issues/2203 +/***/ }), - /* c8 ignore next */ - const argNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : []; - requiredArgsMap[def.name.value] = (0, _keyMap.keyMap)(argNodes.filter(isRequiredArgumentNode), arg => arg.name.value); - } - } - return { - Directive: { - // Validate on leave to allow for deeper errors to appear first. - leave(directiveNode) { - const directiveName = directiveNode.name.value; - const requiredArgs = requiredArgsMap[directiveName]; - if (requiredArgs) { - var _directiveNode$argume; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const argNodes = (_directiveNode$argume = directiveNode.arguments) !== null && _directiveNode$argume !== void 0 ? _directiveNode$argume : []; - const argNodeMap = new Set(argNodes.map(arg => arg.name.value)); - for (const [argName, argDef] of Object.entries(requiredArgs)) { - if (!argNodeMap.has(argName)) { - const argType = (0, _definition.isType)(argDef.type) ? (0, _inspect.inspect)(argDef.type) : (0, _printer.print)(argDef.type); - context.reportError(new _GraphQLError.GraphQLError(`Directive "@${directiveName}" argument "${argName}" of type "${argType}" is required, but it was not provided.`, { - nodes: directiveNode - })); - } - } - } - } - } - }; -} -function isRequiredArgumentNode(arg) { - return arg.type.kind === _kinds.Kind.NON_NULL_TYPE && arg.defaultValue == null; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs": -/*!**************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs ***! - \**************************************************************************/ +/***/ "../../../node_modules/graphql/language/location.mjs": +/*!***********************************************************!*\ + !*** ../../../node_modules/graphql/language/location.mjs ***! + \***********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ScalarLeafsRule = ScalarLeafsRule; -var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +exports.getLocation = getLocation; +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +const LineRegExp = /\r\n|[\n\r]/g; /** - * Scalar leafs - * - * A GraphQL document is valid only if all leaf fields (fields without - * sub selections) are of scalar or enum types. + * Represents a location in a Source. */ -function ScalarLeafsRule(context) { - return { - Field(node) { - const type = context.getType(); - const selectionSet = node.selectionSet; - if (type) { - if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type))) { - if (selectionSet) { - const fieldName = node.name.value; - const typeStr = (0, _inspect.inspect)(type); - context.reportError(new _GraphQLError.GraphQLError(`Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`, { - nodes: selectionSet - })); - } - } else if (!selectionSet) { - const fieldName = node.name.value; - const typeStr = (0, _inspect.inspect)(type); - context.reportError(new _GraphQLError.GraphQLError(`Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`, { - nodes: node - })); - } - } + +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + */ +function getLocation(source, position) { + let lastLineStart = 0; + let line = 1; + for (const match of source.body.matchAll(LineRegExp)) { + typeof match.index === 'number' || (0, _invariant.invariant)(false); + if (match.index >= position) { + break; } + lastLineStart = match.index + match[0].length; + line += 1; + } + return { + line, + column: position + 1 - lastLineStart }; } /***/ }), -/***/ "../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs": -/*!***************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs ***! - \***************************************************************************************/ +/***/ "../../../node_modules/graphql/language/parser.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/language/parser.mjs ***! + \*********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SingleFieldSubscriptionsRule = SingleFieldSubscriptionsRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _collectFields = __webpack_require__(/*! ../../execution/collectFields.mjs */ "../../../node_modules/graphql/execution/collectFields.mjs"); +exports.Parser = void 0; +exports.parse = parse; +exports.parseConstValue = parseConstValue; +exports.parseType = parseType; +exports.parseValue = parseValue; +var _syntaxError = __webpack_require__(/*! ../error/syntaxError.mjs */ "../../../node_modules/graphql/error/syntaxError.mjs"); +var _ast = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); +var _directiveLocation = __webpack_require__(/*! ./directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); +var _kinds = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _lexer = __webpack_require__(/*! ./lexer.mjs */ "../../../node_modules/graphql/language/lexer.mjs"); +var _source = __webpack_require__(/*! ./source.mjs */ "../../../node_modules/graphql/language/source.mjs"); +var _tokenKind = __webpack_require__(/*! ./tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); /** - * Subscriptions must only include a non-introspection field. + * Configuration options to control parser behavior + */ + +/** + * Given a GraphQL source, parses it into a Document. + * Throws GraphQLError if a syntax error is encountered. + */ +function parse(source, options) { + const parser = new Parser(source, options); + return parser.parseDocument(); +} +/** + * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for + * that value. + * Throws GraphQLError if a syntax error is encountered. * - * A GraphQL subscription is valid only if it contains a single root field and - * that root field is not an introspection field. + * This is useful within tools that operate upon GraphQL Values directly and + * in isolation of complete GraphQL documents. * - * See https://spec.graphql.org/draft/#sec-Single-root-field + * Consider providing the results to the utility function: valueFromAST(). */ -function SingleFieldSubscriptionsRule(context) { - return { - OperationDefinition(node) { - if (node.operation === 'subscription') { - const schema = context.getSchema(); - const subscriptionType = schema.getSubscriptionType(); - if (subscriptionType) { - const operationName = node.name ? node.name.value : null; - const variableValues = Object.create(null); - const document = context.getDocument(); - const fragments = Object.create(null); - for (const definition of document.definitions) { - if (definition.kind === _kinds.Kind.FRAGMENT_DEFINITION) { - fragments[definition.name.value] = definition; - } - } - const fields = (0, _collectFields.collectFields)(schema, fragments, variableValues, subscriptionType, node.selectionSet); - if (fields.size > 1) { - const fieldSelectionLists = [...fields.values()]; - const extraFieldSelectionLists = fieldSelectionLists.slice(1); - const extraFieldSelections = extraFieldSelectionLists.flat(); - context.reportError(new _GraphQLError.GraphQLError(operationName != null ? `Subscription "${operationName}" must select only one top level field.` : 'Anonymous Subscription must select only one top level field.', { - nodes: extraFieldSelections - })); - } - for (const fieldNodes of fields.values()) { - const field = fieldNodes[0]; - const fieldName = field.name.value; - if (fieldName.startsWith('__')) { - context.reportError(new _GraphQLError.GraphQLError(operationName != null ? `Subscription "${operationName}" must not select an introspection top level field.` : 'Anonymous Subscription must not select an introspection top level field.', { - nodes: fieldNodes - })); - } - } - } - } - } - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs": -/*!********************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs ***! - \********************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - +function parseValue(source, options) { + const parser = new Parser(source, options); + parser.expectToken(_tokenKind.TokenKind.SOF); + const value = parser.parseValueLiteral(false); + parser.expectToken(_tokenKind.TokenKind.EOF); + return value; +} +/** + * Similar to parseValue(), but raises a parse error if it encounters a + * variable. The return type will be a constant value. + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueArgumentDefinitionNamesRule = UniqueArgumentDefinitionNamesRule; -var _groupBy = __webpack_require__(/*! ../../jsutils/groupBy.mjs */ "../../../node_modules/graphql/jsutils/groupBy.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +function parseConstValue(source, options) { + const parser = new Parser(source, options); + parser.expectToken(_tokenKind.TokenKind.SOF); + const value = parser.parseConstValueLiteral(); + parser.expectToken(_tokenKind.TokenKind.EOF); + return value; +} /** - * Unique argument definition names + * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for + * that type. + * Throws GraphQLError if a syntax error is encountered. * - * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments. - * A GraphQL Directive is only valid if all its arguments are uniquely named. + * This is useful within tools that operate upon GraphQL Types directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: typeFromAST(). */ -function UniqueArgumentDefinitionNamesRule(context) { - return { - DirectiveDefinition(directiveNode) { - var _directiveNode$argume; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const argumentNodes = (_directiveNode$argume = directiveNode.arguments) !== null && _directiveNode$argume !== void 0 ? _directiveNode$argume : []; - return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes); - }, - InterfaceTypeDefinition: checkArgUniquenessPerField, - InterfaceTypeExtension: checkArgUniquenessPerField, - ObjectTypeDefinition: checkArgUniquenessPerField, - ObjectTypeExtension: checkArgUniquenessPerField - }; - function checkArgUniquenessPerField(typeNode) { - var _typeNode$fields; - const typeName = typeNode.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - - const fieldNodes = (_typeNode$fields = typeNode.fields) !== null && _typeNode$fields !== void 0 ? _typeNode$fields : []; - for (const fieldDef of fieldNodes) { - var _fieldDef$arguments; - const fieldName = fieldDef.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const argumentNodes = (_fieldDef$arguments = fieldDef.arguments) !== null && _fieldDef$arguments !== void 0 ? _fieldDef$arguments : []; - checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes); - } - return false; - } - function checkArgUniqueness(parentName, argumentNodes) { - const seenArgs = (0, _groupBy.groupBy)(argumentNodes, arg => arg.name.value); - for (const [argName, argNodes] of seenArgs) { - if (argNodes.length > 1) { - context.reportError(new _GraphQLError.GraphQLError(`Argument "${parentName}(${argName}:)" can only be defined once.`, { - nodes: argNodes.map(node => node.name) - })); - } - } - return false; - } +function parseType(source, options) { + const parser = new Parser(source, options); + parser.expectToken(_tokenKind.TokenKind.SOF); + const type = parser.parseTypeReference(); + parser.expectToken(_tokenKind.TokenKind.EOF); + return type; } - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs ***! - \**********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueArgumentNamesRule = UniqueArgumentNamesRule; -var _groupBy = __webpack_require__(/*! ../../jsutils/groupBy.mjs */ "../../../node_modules/graphql/jsutils/groupBy.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); /** - * Unique argument names + * This class is exported only to assist people in implementing their own parsers + * without duplicating too much code and should be used only as last resort for cases + * such as experimental syntax or if certain features could not be contributed upstream. * - * A GraphQL field or directive is only valid if all supplied arguments are - * uniquely named. + * It is still part of the internal API and is versioned, so any changes to it are never + * considered breaking changes. If you still need to support multiple versions of the + * library, please use the `versionInfo` variable for version detection. * - * See https://spec.graphql.org/draft/#sec-Argument-Names + * @internal */ -function UniqueArgumentNamesRule(context) { - return { - Field: checkArgUniqueness, - Directive: checkArgUniqueness - }; - function checkArgUniqueness(parentNode) { - var _parentNode$arguments; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - /* c8 ignore next */ - const argumentNodes = (_parentNode$arguments = parentNode.arguments) !== null && _parentNode$arguments !== void 0 ? _parentNode$arguments : []; - const seenArgs = (0, _groupBy.groupBy)(argumentNodes, arg => arg.name.value); - for (const [argName, argNodes] of seenArgs) { - if (argNodes.length > 1) { - context.reportError(new _GraphQLError.GraphQLError(`There can be only one argument named "${argName}".`, { - nodes: argNodes.map(node => node.name) - })); - } - } +class Parser { + constructor(source, options = {}) { + const sourceObj = (0, _source.isSource)(source) ? source : new _source.Source(source); + this._lexer = new _lexer.Lexer(sourceObj); + this._options = options; + this._tokenCounter = 0; } -} + /** + * Converts a name lex token into a name parse node. + */ -/***/ }), + parseName() { + const token = this.expectToken(_tokenKind.TokenKind.NAME); + return this.node(token, { + kind: _kinds.Kind.NAME, + value: token.value + }); + } // Implements the parsing rules in the Document section. -/***/ "../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + /** + * Document : Definition+ + */ + parseDocument() { + return this.node(this._lexer.token, { + kind: _kinds.Kind.DOCUMENT, + definitions: this.many(_tokenKind.TokenKind.SOF, this.parseDefinition, _tokenKind.TokenKind.EOF) + }); + } + /** + * Definition : + * - ExecutableDefinition + * - TypeSystemDefinition + * - TypeSystemExtension + * + * ExecutableDefinition : + * - OperationDefinition + * - FragmentDefinition + * + * TypeSystemDefinition : + * - SchemaDefinition + * - TypeDefinition + * - DirectiveDefinition + * + * TypeDefinition : + * - ScalarTypeDefinition + * - ObjectTypeDefinition + * - InterfaceTypeDefinition + * - UnionTypeDefinition + * - EnumTypeDefinition + * - InputObjectTypeDefinition + */ + parseDefinition() { + if (this.peek(_tokenKind.TokenKind.BRACE_L)) { + return this.parseOperationDefinition(); + } // Many definitions begin with a description and require a lookahead. -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueDirectiveNamesRule = UniqueDirectiveNamesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/** - * Unique directive names - * - * A GraphQL document is only valid if all defined directives have unique names. - */ -function UniqueDirectiveNamesRule(context) { - const knownDirectiveNames = Object.create(null); - const schema = context.getSchema(); - return { - DirectiveDefinition(node) { - const directiveName = node.name.value; - if (schema !== null && schema !== void 0 && schema.getDirective(directiveName)) { - context.reportError(new _GraphQLError.GraphQLError(`Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`, { - nodes: node.name - })); - return; + const hasDescription = this.peekDescription(); + const keywordToken = hasDescription ? this._lexer.lookahead() : this._lexer.token; + if (keywordToken.kind === _tokenKind.TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return this.parseSchemaDefinition(); + case 'scalar': + return this.parseScalarTypeDefinition(); + case 'type': + return this.parseObjectTypeDefinition(); + case 'interface': + return this.parseInterfaceTypeDefinition(); + case 'union': + return this.parseUnionTypeDefinition(); + case 'enum': + return this.parseEnumTypeDefinition(); + case 'input': + return this.parseInputObjectTypeDefinition(); + case 'directive': + return this.parseDirectiveDefinition(); } - if (knownDirectiveNames[directiveName]) { - context.reportError(new _GraphQLError.GraphQLError(`There can be only one directive named "@${directiveName}".`, { - nodes: [knownDirectiveNames[directiveName], node.name] - })); - } else { - knownDirectiveNames[directiveName] = node.name; + if (hasDescription) { + throw (0, _syntaxError.syntaxError)(this._lexer.source, this._lexer.token.start, 'Unexpected description, descriptions are supported only on type definitions.'); + } + switch (keywordToken.value) { + case 'query': + case 'mutation': + case 'subscription': + return this.parseOperationDefinition(); + case 'fragment': + return this.parseFragmentDefinition(); + case 'extend': + return this.parseTypeSystemExtension(); } - return false; } - }; -} + throw this.unexpected(keywordToken); + } // Implements the parsing rules in the Operations section. -/***/ }), + /** + * OperationDefinition : + * - SelectionSet + * - OperationType Name? VariableDefinitions? Directives? SelectionSet + */ -/***/ "../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs": -/*!******************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs ***! - \******************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + parseOperationDefinition() { + const start = this._lexer.token; + if (this.peek(_tokenKind.TokenKind.BRACE_L)) { + return this.node(start, { + kind: _kinds.Kind.OPERATION_DEFINITION, + operation: _ast.OperationTypeNode.QUERY, + name: undefined, + variableDefinitions: [], + directives: [], + selectionSet: this.parseSelectionSet() + }); + } + const operation = this.parseOperationType(); + let name; + if (this.peek(_tokenKind.TokenKind.NAME)) { + name = this.parseName(); + } + return this.node(start, { + kind: _kinds.Kind.OPERATION_DEFINITION, + operation, + name, + variableDefinitions: this.parseVariableDefinitions(), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet() + }); + } + /** + * OperationType : one of query mutation subscription + */ + parseOperationType() { + const operationToken = this.expectToken(_tokenKind.TokenKind.NAME); + switch (operationToken.value) { + case 'query': + return _ast.OperationTypeNode.QUERY; + case 'mutation': + return _ast.OperationTypeNode.MUTATION; + case 'subscription': + return _ast.OperationTypeNode.SUBSCRIPTION; + } + throw this.unexpected(operationToken); + } + /** + * VariableDefinitions : ( VariableDefinition+ ) + */ + parseVariableDefinitions() { + return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseVariableDefinition, _tokenKind.TokenKind.PAREN_R); + } + /** + * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueDirectivesPerLocationRule = UniqueDirectivesPerLocationRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _predicates = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -var _directives = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/** - * Unique directive names per location - * - * A GraphQL document is only valid if all non-repeatable directives at - * a given location are uniquely named. - * - * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location - */ -function UniqueDirectivesPerLocationRule(context) { - const uniqueDirectiveMap = Object.create(null); - const schema = context.getSchema(); - const definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; - for (const directive of definedDirectives) { - uniqueDirectiveMap[directive.name] = !directive.isRepeatable; + parseVariableDefinition() { + return this.node(this._lexer.token, { + kind: _kinds.Kind.VARIABLE_DEFINITION, + variable: this.parseVariable(), + type: (this.expectToken(_tokenKind.TokenKind.COLON), this.parseTypeReference()), + defaultValue: this.expectOptionalToken(_tokenKind.TokenKind.EQUALS) ? this.parseConstValueLiteral() : undefined, + directives: this.parseConstDirectives() + }); } - const astDefinitions = context.getDocument().definitions; - for (const def of astDefinitions) { - if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { - uniqueDirectiveMap[def.name.value] = !def.repeatable; - } + /** + * Variable : $ Name + */ + + parseVariable() { + const start = this._lexer.token; + this.expectToken(_tokenKind.TokenKind.DOLLAR); + return this.node(start, { + kind: _kinds.Kind.VARIABLE, + name: this.parseName() + }); } - const schemaDirectives = Object.create(null); - const typeDirectivesMap = Object.create(null); - return { - // Many different AST nodes may contain directives. Rather than listing - // them all, just listen for entering any node, and check to see if it - // defines any directives. - enter(node) { - if (!('directives' in node) || !node.directives) { - return; - } - let seenDirectives; - if (node.kind === _kinds.Kind.SCHEMA_DEFINITION || node.kind === _kinds.Kind.SCHEMA_EXTENSION) { - seenDirectives = schemaDirectives; - } else if ((0, _predicates.isTypeDefinitionNode)(node) || (0, _predicates.isTypeExtensionNode)(node)) { - const typeName = node.name.value; - seenDirectives = typeDirectivesMap[typeName]; - if (seenDirectives === undefined) { - typeDirectivesMap[typeName] = seenDirectives = Object.create(null); - } - } else { - seenDirectives = Object.create(null); - } - for (const directive of node.directives) { - const directiveName = directive.name.value; - if (uniqueDirectiveMap[directiveName]) { - if (seenDirectives[directiveName]) { - context.reportError(new _GraphQLError.GraphQLError(`The directive "@${directiveName}" can only be used once at this location.`, { - nodes: [seenDirectives[directiveName], directive] - })); - } else { - seenDirectives[directiveName] = directive; - } - } - } - } - }; -} + /** + * ``` + * SelectionSet : { Selection+ } + * ``` + */ -/***/ }), + parseSelectionSet() { + return this.node(this._lexer.token, { + kind: _kinds.Kind.SELECTION_SET, + selections: this.many(_tokenKind.TokenKind.BRACE_L, this.parseSelection, _tokenKind.TokenKind.BRACE_R) + }); + } + /** + * Selection : + * - Field + * - FragmentSpread + * - InlineFragment + */ -/***/ "../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + parseSelection() { + return this.peek(_tokenKind.TokenKind.SPREAD) ? this.parseFragment() : this.parseField(); + } + /** + * Field : Alias? Name Arguments? Directives? SelectionSet? + * + * Alias : Name : + */ + parseField() { + const start = this._lexer.token; + const nameOrAlias = this.parseName(); + let alias; + let name; + if (this.expectOptionalToken(_tokenKind.TokenKind.COLON)) { + alias = nameOrAlias; + name = this.parseName(); + } else { + name = nameOrAlias; + } + return this.node(start, { + kind: _kinds.Kind.FIELD, + alias, + name, + arguments: this.parseArguments(false), + directives: this.parseDirectives(false), + selectionSet: this.peek(_tokenKind.TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined + }); + } + /** + * Arguments[Const] : ( Argument[?Const]+ ) + */ + parseArguments(isConst) { + const item = isConst ? this.parseConstArgument : this.parseArgument; + return this.optionalMany(_tokenKind.TokenKind.PAREN_L, item, _tokenKind.TokenKind.PAREN_R); + } + /** + * Argument[Const] : Name : Value[?Const] + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueEnumValueNamesRule = UniqueEnumValueNamesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/** - * Unique enum value names - * - * A GraphQL enum type is only valid if all its values are uniquely named. - */ -function UniqueEnumValueNamesRule(context) { - const schema = context.getSchema(); - const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); - const knownValueNames = Object.create(null); - return { - EnumTypeDefinition: checkValueUniqueness, - EnumTypeExtension: checkValueUniqueness - }; - function checkValueUniqueness(node) { - var _node$values; - const typeName = node.name.value; - if (!knownValueNames[typeName]) { - knownValueNames[typeName] = Object.create(null); - } // FIXME: https://github.com/graphql/graphql-js/issues/2203 + parseArgument(isConst = false) { + const start = this._lexer.token; + const name = this.parseName(); + this.expectToken(_tokenKind.TokenKind.COLON); + return this.node(start, { + kind: _kinds.Kind.ARGUMENT, + name, + value: this.parseValueLiteral(isConst) + }); + } + parseConstArgument() { + return this.parseArgument(true); + } // Implements the parsing rules in the Fragments section. - /* c8 ignore next */ + /** + * Corresponds to both FragmentSpread and InlineFragment in the spec. + * + * FragmentSpread : ... FragmentName Directives? + * + * InlineFragment : ... TypeCondition? Directives? SelectionSet + */ - const valueNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : []; - const valueNames = knownValueNames[typeName]; - for (const valueDef of valueNodes) { - const valueName = valueDef.name.value; - const existingType = existingTypeMap[typeName]; - if ((0, _definition.isEnumType)(existingType) && existingType.getValue(valueName)) { - context.reportError(new _GraphQLError.GraphQLError(`Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`, { - nodes: valueDef.name - })); - } else if (valueNames[valueName]) { - context.reportError(new _GraphQLError.GraphQLError(`Enum value "${typeName}.${valueName}" can only be defined once.`, { - nodes: [valueNames[valueName], valueDef.name] - })); - } else { - valueNames[valueName] = valueDef.name; - } + parseFragment() { + const start = this._lexer.token; + this.expectToken(_tokenKind.TokenKind.SPREAD); + const hasTypeCondition = this.expectOptionalKeyword('on'); + if (!hasTypeCondition && this.peek(_tokenKind.TokenKind.NAME)) { + return this.node(start, { + kind: _kinds.Kind.FRAGMENT_SPREAD, + name: this.parseFragmentName(), + directives: this.parseDirectives(false) + }); } - return false; + return this.node(start, { + kind: _kinds.Kind.INLINE_FRAGMENT, + typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet() + }); } -} - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs": -/*!*****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs ***! - \*****************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + /** + * FragmentDefinition : + * - fragment FragmentName on TypeCondition Directives? SelectionSet + * + * TypeCondition : NamedType + */ + parseFragmentDefinition() { + const start = this._lexer.token; + this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes + // the grammar of FragmentDefinition: + // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet + if (this._options.allowLegacyFragmentVariables === true) { + return this.node(start, { + kind: _kinds.Kind.FRAGMENT_DEFINITION, + name: this.parseFragmentName(), + variableDefinitions: this.parseVariableDefinitions(), + typeCondition: (this.expectKeyword('on'), this.parseNamedType()), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet() + }); + } + return this.node(start, { + kind: _kinds.Kind.FRAGMENT_DEFINITION, + name: this.parseFragmentName(), + typeCondition: (this.expectKeyword('on'), this.parseNamedType()), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet() + }); + } + /** + * FragmentName : Name but not `on` + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueFieldDefinitionNamesRule = UniqueFieldDefinitionNamesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/** - * Unique field definition names - * - * A GraphQL complex type is only valid if all its fields are uniquely named. - */ -function UniqueFieldDefinitionNamesRule(context) { - const schema = context.getSchema(); - const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); - const knownFieldNames = Object.create(null); - return { - InputObjectTypeDefinition: checkFieldUniqueness, - InputObjectTypeExtension: checkFieldUniqueness, - InterfaceTypeDefinition: checkFieldUniqueness, - InterfaceTypeExtension: checkFieldUniqueness, - ObjectTypeDefinition: checkFieldUniqueness, - ObjectTypeExtension: checkFieldUniqueness - }; - function checkFieldUniqueness(node) { - var _node$fields; - const typeName = node.name.value; - if (!knownFieldNames[typeName]) { - knownFieldNames[typeName] = Object.create(null); - } // FIXME: https://github.com/graphql/graphql-js/issues/2203 + parseFragmentName() { + if (this._lexer.token.value === 'on') { + throw this.unexpected(); + } + return this.parseName(); + } // Implements the parsing rules in the Values section. - /* c8 ignore next */ + /** + * Value[Const] : + * - [~Const] Variable + * - IntValue + * - FloatValue + * - StringValue + * - BooleanValue + * - NullValue + * - EnumValue + * - ListValue[?Const] + * - ObjectValue[?Const] + * + * BooleanValue : one of `true` `false` + * + * NullValue : `null` + * + * EnumValue : Name but not `true`, `false` or `null` + */ - const fieldNodes = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : []; - const fieldNames = knownFieldNames[typeName]; - for (const fieldDef of fieldNodes) { - const fieldName = fieldDef.name.value; - if (hasField(existingTypeMap[typeName], fieldName)) { - context.reportError(new _GraphQLError.GraphQLError(`Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`, { - nodes: fieldDef.name - })); - } else if (fieldNames[fieldName]) { - context.reportError(new _GraphQLError.GraphQLError(`Field "${typeName}.${fieldName}" can only be defined once.`, { - nodes: [fieldNames[fieldName], fieldDef.name] - })); - } else { - fieldNames[fieldName] = fieldDef.name; - } + parseValueLiteral(isConst) { + const token = this._lexer.token; + switch (token.kind) { + case _tokenKind.TokenKind.BRACKET_L: + return this.parseList(isConst); + case _tokenKind.TokenKind.BRACE_L: + return this.parseObject(isConst); + case _tokenKind.TokenKind.INT: + this.advanceLexer(); + return this.node(token, { + kind: _kinds.Kind.INT, + value: token.value + }); + case _tokenKind.TokenKind.FLOAT: + this.advanceLexer(); + return this.node(token, { + kind: _kinds.Kind.FLOAT, + value: token.value + }); + case _tokenKind.TokenKind.STRING: + case _tokenKind.TokenKind.BLOCK_STRING: + return this.parseStringLiteral(); + case _tokenKind.TokenKind.NAME: + this.advanceLexer(); + switch (token.value) { + case 'true': + return this.node(token, { + kind: _kinds.Kind.BOOLEAN, + value: true + }); + case 'false': + return this.node(token, { + kind: _kinds.Kind.BOOLEAN, + value: false + }); + case 'null': + return this.node(token, { + kind: _kinds.Kind.NULL + }); + default: + return this.node(token, { + kind: _kinds.Kind.ENUM, + value: token.value + }); + } + case _tokenKind.TokenKind.DOLLAR: + if (isConst) { + this.expectToken(_tokenKind.TokenKind.DOLLAR); + if (this._lexer.token.kind === _tokenKind.TokenKind.NAME) { + const varName = this._lexer.token.value; + throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Unexpected variable "$${varName}" in constant value.`); + } else { + throw this.unexpected(token); + } + } + return this.parseVariable(); + default: + throw this.unexpected(); } - return false; } -} -function hasField(type, fieldName) { - if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type) || (0, _definition.isInputObjectType)(type)) { - return type.getFields()[fieldName] != null; + parseConstValueLiteral() { + return this.parseValueLiteral(true); } - return false; -} + parseStringLiteral() { + const token = this._lexer.token; + this.advanceLexer(); + return this.node(token, { + kind: _kinds.Kind.STRING, + value: token.value, + block: token.kind === _tokenKind.TokenKind.BLOCK_STRING + }); + } + /** + * ListValue[Const] : + * - [ ] + * - [ Value[?Const]+ ] + */ -/***/ }), + parseList(isConst) { + const item = () => this.parseValueLiteral(isConst); + return this.node(this._lexer.token, { + kind: _kinds.Kind.LIST, + values: this.any(_tokenKind.TokenKind.BRACKET_L, item, _tokenKind.TokenKind.BRACKET_R) + }); + } + /** + * ``` + * ObjectValue[Const] : + * - { } + * - { ObjectField[?Const]+ } + * ``` + */ -/***/ "../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs ***! - \**********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + parseObject(isConst) { + const item = () => this.parseObjectField(isConst); + return this.node(this._lexer.token, { + kind: _kinds.Kind.OBJECT, + fields: this.any(_tokenKind.TokenKind.BRACE_L, item, _tokenKind.TokenKind.BRACE_R) + }); + } + /** + * ObjectField[Const] : Name : Value[?Const] + */ + parseObjectField(isConst) { + const start = this._lexer.token; + const name = this.parseName(); + this.expectToken(_tokenKind.TokenKind.COLON); + return this.node(start, { + kind: _kinds.Kind.OBJECT_FIELD, + name, + value: this.parseValueLiteral(isConst) + }); + } // Implements the parsing rules in the Directives section. + /** + * Directives[Const] : Directive[?Const]+ + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueFragmentNamesRule = UniqueFragmentNamesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/** - * Unique fragment names - * - * A GraphQL document is only valid if all defined fragments have unique names. - * - * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness - */ -function UniqueFragmentNamesRule(context) { - const knownFragmentNames = Object.create(null); - return { - OperationDefinition: () => false, - FragmentDefinition(node) { - const fragmentName = node.name.value; - if (knownFragmentNames[fragmentName]) { - context.reportError(new _GraphQLError.GraphQLError(`There can be only one fragment named "${fragmentName}".`, { - nodes: [knownFragmentNames[fragmentName], node.name] - })); - } else { - knownFragmentNames[fragmentName] = node.name; - } - return false; + parseDirectives(isConst) { + const directives = []; + while (this.peek(_tokenKind.TokenKind.AT)) { + directives.push(this.parseDirective(isConst)); } - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs": -/*!************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs ***! - \************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueInputFieldNamesRule = UniqueInputFieldNamesRule; -var _invariant = __webpack_require__(/*! ../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/** - * Unique input field names - * - * A GraphQL input object value is only valid if all supplied fields are - * uniquely named. - * - * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness - */ -function UniqueInputFieldNamesRule(context) { - const knownNameStack = []; - let knownNames = Object.create(null); - return { - ObjectValue: { - enter() { - knownNameStack.push(knownNames); - knownNames = Object.create(null); - }, - leave() { - const prevKnownNames = knownNameStack.pop(); - prevKnownNames || (0, _invariant.invariant)(false); - knownNames = prevKnownNames; - } - }, - ObjectField(node) { - const fieldName = node.name.value; - if (knownNames[fieldName]) { - context.reportError(new _GraphQLError.GraphQLError(`There can be only one input field named "${fieldName}".`, { - nodes: [knownNames[fieldName], node.name] - })); - } else { - knownNames[fieldName] = node.name; - } - } - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + return directives; + } + parseConstDirectives() { + return this.parseDirectives(true); + } + /** + * ``` + * Directive[Const] : @ Name Arguments[?Const]? + * ``` + */ + parseDirective(isConst) { + const start = this._lexer.token; + this.expectToken(_tokenKind.TokenKind.AT); + return this.node(start, { + kind: _kinds.Kind.DIRECTIVE, + name: this.parseName(), + arguments: this.parseArguments(isConst) + }); + } // Implements the parsing rules in the Types section. + /** + * Type : + * - NamedType + * - ListType + * - NonNullType + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueOperationNamesRule = UniqueOperationNamesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/** - * Unique operation names - * - * A GraphQL document is only valid if all defined operations have unique names. - * - * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness - */ -function UniqueOperationNamesRule(context) { - const knownOperationNames = Object.create(null); - return { - OperationDefinition(node) { - const operationName = node.name; - if (operationName) { - if (knownOperationNames[operationName.value]) { - context.reportError(new _GraphQLError.GraphQLError(`There can be only one operation named "${operationName.value}".`, { - nodes: [knownOperationNames[operationName.value], operationName] - })); - } else { - knownOperationNames[operationName.value] = operationName; - } - } - return false; - }, - FragmentDefinition: () => false - }; -} + parseTypeReference() { + const start = this._lexer.token; + let type; + if (this.expectOptionalToken(_tokenKind.TokenKind.BRACKET_L)) { + const innerType = this.parseTypeReference(); + this.expectToken(_tokenKind.TokenKind.BRACKET_R); + type = this.node(start, { + kind: _kinds.Kind.LIST_TYPE, + type: innerType + }); + } else { + type = this.parseNamedType(); + } + if (this.expectOptionalToken(_tokenKind.TokenKind.BANG)) { + return this.node(start, { + kind: _kinds.Kind.NON_NULL_TYPE, + type + }); + } + return type; + } + /** + * NamedType : Name + */ -/***/ }), + parseNamedType() { + return this.node(this._lexer.token, { + kind: _kinds.Kind.NAMED_TYPE, + name: this.parseName() + }); + } // Implements the parsing rules in the Type Definition section. -/***/ "../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + peekDescription() { + return this.peek(_tokenKind.TokenKind.STRING) || this.peek(_tokenKind.TokenKind.BLOCK_STRING); + } + /** + * Description : StringValue + */ + parseDescription() { + if (this.peekDescription()) { + return this.parseStringLiteral(); + } + } + /** + * ``` + * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } + * ``` + */ + parseSchemaDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('schema'); + const directives = this.parseConstDirectives(); + const operationTypes = this.many(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); + return this.node(start, { + kind: _kinds.Kind.SCHEMA_DEFINITION, + description, + directives, + operationTypes + }); + } + /** + * OperationTypeDefinition : OperationType : NamedType + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueOperationTypesRule = UniqueOperationTypesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/** - * Unique operation types - * - * A GraphQL document is only valid if it has only one type per operation. - */ -function UniqueOperationTypesRule(context) { - const schema = context.getSchema(); - const definedOperationTypes = Object.create(null); - const existingOperationTypes = schema ? { - query: schema.getQueryType(), - mutation: schema.getMutationType(), - subscription: schema.getSubscriptionType() - } : {}; - return { - SchemaDefinition: checkOperationTypes, - SchemaExtension: checkOperationTypes - }; - function checkOperationTypes(node) { - var _node$operationTypes; + parseOperationTypeDefinition() { + const start = this._lexer.token; + const operation = this.parseOperationType(); + this.expectToken(_tokenKind.TokenKind.COLON); + const type = this.parseNamedType(); + return this.node(start, { + kind: _kinds.Kind.OPERATION_TYPE_DEFINITION, + operation, + type + }); + } + /** + * ScalarTypeDefinition : Description? scalar Name Directives[Const]? + */ - // See: https://github.com/graphql/graphql-js/issues/2203 + parseScalarTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('scalar'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: _kinds.Kind.SCALAR_TYPE_DEFINITION, + description, + name, + directives + }); + } + /** + * ObjectTypeDefinition : + * Description? + * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? + */ - /* c8 ignore next */ - const operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : []; - for (const operationType of operationTypesNodes) { - const operation = operationType.operation; - const alreadyDefinedOperationType = definedOperationTypes[operation]; - if (existingOperationTypes[operation]) { - context.reportError(new _GraphQLError.GraphQLError(`Type for ${operation} already defined in the schema. It cannot be redefined.`, { - nodes: operationType - })); - } else if (alreadyDefinedOperationType) { - context.reportError(new _GraphQLError.GraphQLError(`There can be only one ${operation} type in schema.`, { - nodes: [alreadyDefinedOperationType, operationType] - })); - } else { - definedOperationTypes[operation] = operationType; - } - } - return false; + parseObjectTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('type'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + return this.node(start, { + kind: _kinds.Kind.OBJECT_TYPE_DEFINITION, + description, + name, + interfaces, + directives, + fields + }); } -} + /** + * ImplementsInterfaces : + * - implements `&`? NamedType + * - ImplementsInterfaces & NamedType + */ -/***/ }), + parseImplementsInterfaces() { + return this.expectOptionalKeyword('implements') ? this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType) : []; + } + /** + * ``` + * FieldsDefinition : { FieldDefinition+ } + * ``` + */ -/***/ "../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs": -/*!******************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs ***! - \******************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + parseFieldsDefinition() { + return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseFieldDefinition, _tokenKind.TokenKind.BRACE_R); + } + /** + * FieldDefinition : + * - Description? Name ArgumentsDefinition? : Type Directives[Const]? + */ + parseFieldDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseName(); + const args = this.parseArgumentDefs(); + this.expectToken(_tokenKind.TokenKind.COLON); + const type = this.parseTypeReference(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: _kinds.Kind.FIELD_DEFINITION, + description, + name, + arguments: args, + type, + directives + }); + } + /** + * ArgumentsDefinition : ( InputValueDefinition+ ) + */ + parseArgumentDefs() { + return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseInputValueDef, _tokenKind.TokenKind.PAREN_R); + } + /** + * InputValueDefinition : + * - Description? Name : Type DefaultValue? Directives[Const]? + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueTypeNamesRule = UniqueTypeNamesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/** - * Unique type names - * - * A GraphQL document is only valid if all defined types have unique names. - */ -function UniqueTypeNamesRule(context) { - const knownTypeNames = Object.create(null); - const schema = context.getSchema(); - return { - ScalarTypeDefinition: checkTypeName, - ObjectTypeDefinition: checkTypeName, - InterfaceTypeDefinition: checkTypeName, - UnionTypeDefinition: checkTypeName, - EnumTypeDefinition: checkTypeName, - InputObjectTypeDefinition: checkTypeName - }; - function checkTypeName(node) { - const typeName = node.name.value; - if (schema !== null && schema !== void 0 && schema.getType(typeName)) { - context.reportError(new _GraphQLError.GraphQLError(`Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`, { - nodes: node.name - })); - return; - } - if (knownTypeNames[typeName]) { - context.reportError(new _GraphQLError.GraphQLError(`There can be only one type named "${typeName}".`, { - nodes: [knownTypeNames[typeName], node.name] - })); - } else { - knownTypeNames[typeName] = node.name; + parseInputValueDef() { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseName(); + this.expectToken(_tokenKind.TokenKind.COLON); + const type = this.parseTypeReference(); + let defaultValue; + if (this.expectOptionalToken(_tokenKind.TokenKind.EQUALS)) { + defaultValue = this.parseConstValueLiteral(); } - return false; + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: _kinds.Kind.INPUT_VALUE_DEFINITION, + description, + name, + type, + defaultValue, + directives + }); } -} + /** + * InterfaceTypeDefinition : + * - Description? interface Name Directives[Const]? FieldsDefinition? + */ -/***/ }), + parseInterfaceTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('interface'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + return this.node(start, { + kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION, + description, + name, + interfaces, + directives, + fields + }); + } + /** + * UnionTypeDefinition : + * - Description? union Name Directives[Const]? UnionMemberTypes? + */ -/***/ "../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs ***! - \**********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + parseUnionTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('union'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const types = this.parseUnionMemberTypes(); + return this.node(start, { + kind: _kinds.Kind.UNION_TYPE_DEFINITION, + description, + name, + directives, + types + }); + } + /** + * UnionMemberTypes : + * - = `|`? NamedType + * - UnionMemberTypes | NamedType + */ + parseUnionMemberTypes() { + return this.expectOptionalToken(_tokenKind.TokenKind.EQUALS) ? this.delimitedMany(_tokenKind.TokenKind.PIPE, this.parseNamedType) : []; + } + /** + * EnumTypeDefinition : + * - Description? enum Name Directives[Const]? EnumValuesDefinition? + */ + parseEnumTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('enum'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const values = this.parseEnumValuesDefinition(); + return this.node(start, { + kind: _kinds.Kind.ENUM_TYPE_DEFINITION, + description, + name, + directives, + values + }); + } + /** + * ``` + * EnumValuesDefinition : { EnumValueDefinition+ } + * ``` + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.UniqueVariableNamesRule = UniqueVariableNamesRule; -var _groupBy = __webpack_require__(/*! ../../jsutils/groupBy.mjs */ "../../../node_modules/graphql/jsutils/groupBy.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/** - * Unique variable names - * - * A GraphQL operation is only valid if all its variables are uniquely named. - */ -function UniqueVariableNamesRule(context) { - return { - OperationDefinition(operationNode) { - var _operationNode$variab; + parseEnumValuesDefinition() { + return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseEnumValueDefinition, _tokenKind.TokenKind.BRACE_R); + } + /** + * EnumValueDefinition : Description? EnumValue Directives[Const]? + */ - // See: https://github.com/graphql/graphql-js/issues/2203 + parseEnumValueDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseEnumValueName(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: _kinds.Kind.ENUM_VALUE_DEFINITION, + description, + name, + directives + }); + } + /** + * EnumValue : Name but not `true`, `false` or `null` + */ - /* c8 ignore next */ - const variableDefinitions = (_operationNode$variab = operationNode.variableDefinitions) !== null && _operationNode$variab !== void 0 ? _operationNode$variab : []; - const seenVariableDefinitions = (0, _groupBy.groupBy)(variableDefinitions, node => node.variable.name.value); - for (const [variableName, variableNodes] of seenVariableDefinitions) { - if (variableNodes.length > 1) { - context.reportError(new _GraphQLError.GraphQLError(`There can be only one variable named "$${variableName}".`, { - nodes: variableNodes.map(node => node.variable.name) - })); - } - } + parseEnumValueName() { + if (this._lexer.token.value === 'true' || this._lexer.token.value === 'false' || this._lexer.token.value === 'null') { + throw (0, _syntaxError.syntaxError)(this._lexer.source, this._lexer.token.start, `${getTokenDesc(this._lexer.token)} is reserved and cannot be used for an enum value.`); } - }; -} - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs ***! - \**********************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + return this.parseName(); + } + /** + * InputObjectTypeDefinition : + * - Description? input Name Directives[Const]? InputFieldsDefinition? + */ + parseInputObjectTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('input'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const fields = this.parseInputFieldsDefinition(); + return this.node(start, { + kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION, + description, + name, + directives, + fields + }); + } + /** + * ``` + * InputFieldsDefinition : { InputValueDefinition+ } + * ``` + */ + parseInputFieldsDefinition() { + return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseInputValueDef, _tokenKind.TokenKind.BRACE_R); + } + /** + * TypeSystemExtension : + * - SchemaExtension + * - TypeExtension + * + * TypeExtension : + * - ScalarTypeExtension + * - ObjectTypeExtension + * - InterfaceTypeExtension + * - UnionTypeExtension + * - EnumTypeExtension + * - InputObjectTypeDefinition + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.ValuesOfCorrectTypeRule = ValuesOfCorrectTypeRule; -var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _keyMap = __webpack_require__(/*! ../../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/** - * Value literals of correct type - * - * A GraphQL document is only valid if all value literals are of the type - * expected at their position. - * - * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type - */ -function ValuesOfCorrectTypeRule(context) { - let variableDefinitions = {}; - return { - OperationDefinition: { - enter() { - variableDefinitions = {}; - } - }, - VariableDefinition(definition) { - variableDefinitions[definition.variable.name.value] = definition; - }, - ListValue(node) { - // Note: TypeInfo will traverse into a list's item type, so look to the - // parent input type to check if it is a list. - const type = (0, _definition.getNullableType)(context.getParentInputType()); - if (!(0, _definition.isListType)(type)) { - isValidValueNode(context, node); - return false; // Don't traverse further. + parseTypeSystemExtension() { + const keywordToken = this._lexer.lookahead(); + if (keywordToken.kind === _tokenKind.TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return this.parseSchemaExtension(); + case 'scalar': + return this.parseScalarTypeExtension(); + case 'type': + return this.parseObjectTypeExtension(); + case 'interface': + return this.parseInterfaceTypeExtension(); + case 'union': + return this.parseUnionTypeExtension(); + case 'enum': + return this.parseEnumTypeExtension(); + case 'input': + return this.parseInputObjectTypeExtension(); } - }, - ObjectValue(node) { - const type = (0, _definition.getNamedType)(context.getInputType()); - if (!(0, _definition.isInputObjectType)(type)) { - isValidValueNode(context, node); - return false; // Don't traverse further. - } // Ensure every required field exists. + } + throw this.unexpected(keywordToken); + } + /** + * ``` + * SchemaExtension : + * - extend schema Directives[Const]? { OperationTypeDefinition+ } + * - extend schema Directives[Const] + * ``` + */ - const fieldNodeMap = (0, _keyMap.keyMap)(node.fields, field => field.name.value); - for (const fieldDef of Object.values(type.getFields())) { - const fieldNode = fieldNodeMap[fieldDef.name]; - if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) { - const typeStr = (0, _inspect.inspect)(fieldDef.type); - context.reportError(new _GraphQLError.GraphQLError(`Field "${type.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.`, { - nodes: node - })); - } - } - if (type.isOneOf) { - validateOneOfInputObject(context, node, type, fieldNodeMap, variableDefinitions); - } - }, - ObjectField(node) { - const parentType = (0, _definition.getNamedType)(context.getParentInputType()); - const fieldType = context.getInputType(); - if (!fieldType && (0, _definition.isInputObjectType)(parentType)) { - const suggestions = (0, _suggestionList.suggestionList)(node.name.value, Object.keys(parentType.getFields())); - context.reportError(new _GraphQLError.GraphQLError(`Field "${node.name.value}" is not defined by type "${parentType.name}".` + (0, _didYouMean.didYouMean)(suggestions), { - nodes: node - })); - } - }, - NullValue(node) { - const type = context.getInputType(); - if ((0, _definition.isNonNullType)(type)) { - context.reportError(new _GraphQLError.GraphQLError(`Expected value of type "${(0, _inspect.inspect)(type)}", found ${(0, _printer.print)(node)}.`, { - nodes: node - })); - } - }, - EnumValue: node => isValidValueNode(context, node), - IntValue: node => isValidValueNode(context, node), - FloatValue: node => isValidValueNode(context, node), - StringValue: node => isValidValueNode(context, node), - BooleanValue: node => isValidValueNode(context, node) - }; -} -/** - * Any value literal may be a valid representation of a Scalar, depending on - * that scalar type. - */ + parseSchemaExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('schema'); + const directives = this.parseConstDirectives(); + const operationTypes = this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); + if (directives.length === 0 && operationTypes.length === 0) { + throw this.unexpected(); + } + return this.node(start, { + kind: _kinds.Kind.SCHEMA_EXTENSION, + directives, + operationTypes + }); + } + /** + * ScalarTypeExtension : + * - extend scalar Name Directives[Const] + */ -function isValidValueNode(context, node) { - // Report any error at the full type expected by the location. - const locationType = context.getInputType(); - if (!locationType) { - return; + parseScalarTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('scalar'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + if (directives.length === 0) { + throw this.unexpected(); + } + return this.node(start, { + kind: _kinds.Kind.SCALAR_TYPE_EXTENSION, + name, + directives + }); } - const type = (0, _definition.getNamedType)(locationType); - if (!(0, _definition.isLeafType)(type)) { - const typeStr = (0, _inspect.inspect)(locationType); - context.reportError(new _GraphQLError.GraphQLError(`Expected value of type "${typeStr}", found ${(0, _printer.print)(node)}.`, { - nodes: node - })); - return; - } // Scalars and Enums determine if a literal value is valid via parseLiteral(), - // which may throw or return an invalid value to indicate failure. + /** + * ObjectTypeExtension : + * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend type Name ImplementsInterfaces? Directives[Const] + * - extend type Name ImplementsInterfaces + */ - try { - const parseResult = type.parseLiteral(node, undefined - /* variables */); - if (parseResult === undefined) { - const typeStr = (0, _inspect.inspect)(locationType); - context.reportError(new _GraphQLError.GraphQLError(`Expected value of type "${typeStr}", found ${(0, _printer.print)(node)}.`, { - nodes: node - })); + parseObjectTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('type'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { + throw this.unexpected(); } - } catch (error) { - const typeStr = (0, _inspect.inspect)(locationType); - if (error instanceof _GraphQLError.GraphQLError) { - context.reportError(error); - } else { - context.reportError(new _GraphQLError.GraphQLError(`Expected value of type "${typeStr}", found ${(0, _printer.print)(node)}; ` + error.message, { - nodes: node, - originalError: error - })); + return this.node(start, { + kind: _kinds.Kind.OBJECT_TYPE_EXTENSION, + name, + interfaces, + directives, + fields + }); + } + /** + * InterfaceTypeExtension : + * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend interface Name ImplementsInterfaces? Directives[Const] + * - extend interface Name ImplementsInterfaces + */ + + parseInterfaceTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('interface'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { + throw this.unexpected(); } + return this.node(start, { + kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION, + name, + interfaces, + directives, + fields + }); } -} -function validateOneOfInputObject(context, node, type, fieldNodeMap, variableDefinitions) { - var _fieldNodeMap$keys$; - const keys = Object.keys(fieldNodeMap); - const isNotExactlyOneField = keys.length !== 1; - if (isNotExactlyOneField) { - context.reportError(new _GraphQLError.GraphQLError(`OneOf Input Object "${type.name}" must specify exactly one key.`, { - nodes: [node] - })); - return; + /** + * UnionTypeExtension : + * - extend union Name Directives[Const]? UnionMemberTypes + * - extend union Name Directives[Const] + */ + + parseUnionTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('union'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const types = this.parseUnionMemberTypes(); + if (directives.length === 0 && types.length === 0) { + throw this.unexpected(); + } + return this.node(start, { + kind: _kinds.Kind.UNION_TYPE_EXTENSION, + name, + directives, + types + }); } - const value = (_fieldNodeMap$keys$ = fieldNodeMap[keys[0]]) === null || _fieldNodeMap$keys$ === void 0 ? void 0 : _fieldNodeMap$keys$.value; - const isNullLiteral = !value || value.kind === _kinds.Kind.NULL; - const isVariable = (value === null || value === void 0 ? void 0 : value.kind) === _kinds.Kind.VARIABLE; - if (isNullLiteral) { - context.reportError(new _GraphQLError.GraphQLError(`Field "${type.name}.${keys[0]}" must be non-null.`, { - nodes: [node] - })); - return; + /** + * EnumTypeExtension : + * - extend enum Name Directives[Const]? EnumValuesDefinition + * - extend enum Name Directives[Const] + */ + + parseEnumTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('enum'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const values = this.parseEnumValuesDefinition(); + if (directives.length === 0 && values.length === 0) { + throw this.unexpected(); + } + return this.node(start, { + kind: _kinds.Kind.ENUM_TYPE_EXTENSION, + name, + directives, + values + }); } - if (isVariable) { - const variableName = value.name.value; - const definition = variableDefinitions[variableName]; - const isNullableVariable = definition.type.kind !== _kinds.Kind.NON_NULL_TYPE; - if (isNullableVariable) { - context.reportError(new _GraphQLError.GraphQLError(`Variable "${variableName}" must be non-nullable to be used for OneOf Input Object "${type.name}".`, { - nodes: [node] - })); + /** + * InputObjectTypeExtension : + * - extend input Name Directives[Const]? InputFieldsDefinition + * - extend input Name Directives[Const] + */ + + parseInputObjectTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('input'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const fields = this.parseInputFieldsDefinition(); + if (directives.length === 0 && fields.length === 0) { + throw this.unexpected(); } + return this.node(start, { + kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION, + name, + directives, + fields + }); } -} + /** + * ``` + * DirectiveDefinition : + * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations + * ``` + */ -/***/ }), + parseDirectiveDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('directive'); + this.expectToken(_tokenKind.TokenKind.AT); + const name = this.parseName(); + const args = this.parseArgumentDefs(); + const repeatable = this.expectOptionalKeyword('repeatable'); + this.expectKeyword('on'); + const locations = this.parseDirectiveLocations(); + return this.node(start, { + kind: _kinds.Kind.DIRECTIVE_DEFINITION, + description, + name, + arguments: args, + repeatable, + locations + }); + } + /** + * DirectiveLocations : + * - `|`? DirectiveLocation + * - DirectiveLocations | DirectiveLocation + */ -/***/ "../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs": -/*!*************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs ***! - \*************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + parseDirectiveLocations() { + return this.delimitedMany(_tokenKind.TokenKind.PIPE, this.parseDirectiveLocation); + } + /* + * DirectiveLocation : + * - ExecutableDirectiveLocation + * - TypeSystemDirectiveLocation + * + * ExecutableDirectiveLocation : one of + * `QUERY` + * `MUTATION` + * `SUBSCRIPTION` + * `FIELD` + * `FRAGMENT_DEFINITION` + * `FRAGMENT_SPREAD` + * `INLINE_FRAGMENT` + * + * TypeSystemDirectiveLocation : one of + * `SCHEMA` + * `SCALAR` + * `OBJECT` + * `FIELD_DEFINITION` + * `ARGUMENT_DEFINITION` + * `INTERFACE` + * `UNION` + * `ENUM` + * `ENUM_VALUE` + * `INPUT_OBJECT` + * `INPUT_FIELD_DEFINITION` + */ + parseDirectiveLocation() { + const start = this._lexer.token; + const name = this.parseName(); + if (Object.prototype.hasOwnProperty.call(_directiveLocation.DirectiveLocation, name.value)) { + return name; + } + throw this.unexpected(start); + } // Core parsing utility functions + /** + * Returns a node that, if configured to do so, sets a "loc" field as a + * location object, used to identify the place in the source that created a + * given parsed object. + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.VariablesAreInputTypesRule = VariablesAreInputTypesRule; -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); -/** - * Variables are input types - * - * A GraphQL operation is only valid if all the variables it defines are of - * input types (scalar, enum, or input object). - * - * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types - */ -function VariablesAreInputTypesRule(context) { - return { - VariableDefinition(node) { - const type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type); - if (type !== undefined && !(0, _definition.isInputType)(type)) { - const variableName = node.variable.name.value; - const typeName = (0, _printer.print)(node.type); - context.reportError(new _GraphQLError.GraphQLError(`Variable "$${variableName}" cannot be non-input type "${typeName}".`, { - nodes: node.type - })); - } + node(startToken, node) { + if (this._options.noLocation !== true) { + node.loc = new _ast.Location(startToken, this._lexer.lastToken, this._lexer.source); } - }; -} + return node; + } + /** + * Determines if the next token is of a given kind + */ -/***/ }), + peek(kind) { + return this._lexer.token.kind === kind; + } + /** + * If the next token is of the given kind, return that token after advancing the lexer. + * Otherwise, do not change the parser state and throw an error. + */ -/***/ "../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs": -/*!*****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs ***! - \*****************************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + expectToken(kind) { + const token = this._lexer.token; + if (token.kind === kind) { + this.advanceLexer(); + return token; + } + throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`); + } + /** + * If the next token is of the given kind, return "true" after advancing the lexer. + * Otherwise, do not change the parser state and return "false". + */ + expectOptionalToken(kind) { + const token = this._lexer.token; + if (token.kind === kind) { + this.advanceLexer(); + return true; + } + return false; + } + /** + * If the next token is a given keyword, advance the lexer. + * Otherwise, do not change the parser state and throw an error. + */ + expectKeyword(value) { + const token = this._lexer.token; + if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { + this.advanceLexer(); + } else { + throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Expected "${value}", found ${getTokenDesc(token)}.`); + } + } + /** + * If the next token is a given keyword, return "true" after advancing the lexer. + * Otherwise, do not change the parser state and return "false". + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.VariablesInAllowedPositionRule = VariablesInAllowedPositionRule; -var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _typeComparators = __webpack_require__(/*! ../../utilities/typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); -var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); -/** - * Variables in allowed position - * - * Variable usages must be compatible with the arguments they are passed to. - * - * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed - */ -function VariablesInAllowedPositionRule(context) { - let varDefMap = Object.create(null); - return { - OperationDefinition: { - enter() { - varDefMap = Object.create(null); - }, - leave(operation) { - const usages = context.getRecursiveVariableUsages(operation); - for (const { - node, - type, - defaultValue - } of usages) { - const varName = node.name.value; - const varDef = varDefMap[varName]; - if (varDef && type) { - // A var type is allowed if it is the same or more strict (e.g. is - // a subtype of) than the expected type. It can be more strict if - // the variable type is non-null when the expected type is nullable. - // If both are list types, the variable item type can be more strict - // than the expected item type (contravariant). - const schema = context.getSchema(); - const varType = (0, _typeFromAST.typeFromAST)(schema, varDef.type); - if (varType && !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) { - const varTypeStr = (0, _inspect.inspect)(varType); - const typeStr = (0, _inspect.inspect)(type); - context.reportError(new _GraphQLError.GraphQLError(`Variable "$${varName}" of type "${varTypeStr}" used in position expecting type "${typeStr}".`, { - nodes: [varDef, node] - })); - } - } - } + expectOptionalKeyword(value) { + const token = this._lexer.token; + if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { + this.advanceLexer(); + return true; + } + return false; + } + /** + * Helper function for creating an error when an unexpected lexed token is encountered. + */ + + unexpected(atToken) { + const token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token; + return (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Unexpected ${getTokenDesc(token)}.`); + } + /** + * Returns a possibly empty list of parse nodes, determined by the parseFn. + * This list begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + */ + + any(openKind, parseFn, closeKind) { + this.expectToken(openKind); + const nodes = []; + while (!this.expectOptionalToken(closeKind)) { + nodes.push(parseFn.call(this)); + } + return nodes; + } + /** + * Returns a list of parse nodes, determined by the parseFn. + * It can be empty only if open token is missing otherwise it will always return non-empty list + * that begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + */ + + optionalMany(openKind, parseFn, closeKind) { + if (this.expectOptionalToken(openKind)) { + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (!this.expectOptionalToken(closeKind)); + return nodes; + } + return []; + } + /** + * Returns a non-empty list of parse nodes, determined by the parseFn. + * This list begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + */ + + many(openKind, parseFn, closeKind) { + this.expectToken(openKind); + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (!this.expectOptionalToken(closeKind)); + return nodes; + } + /** + * Returns a non-empty list of parse nodes, determined by the parseFn. + * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. + * Advances the parser to the next lex token after last item in the list. + */ + + delimitedMany(delimiterKind, parseFn) { + this.expectOptionalToken(delimiterKind); + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (this.expectOptionalToken(delimiterKind)); + return nodes; + } + advanceLexer() { + const { + maxTokens + } = this._options; + const token = this._lexer.advance(); + if (maxTokens !== undefined && token.kind !== _tokenKind.TokenKind.EOF) { + ++this._tokenCounter; + if (this._tokenCounter > maxTokens) { + throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Document contains more that ${maxTokens} tokens. Parsing aborted.`); } - }, - VariableDefinition(node) { - varDefMap[node.variable.name.value] = node; } - }; + } } /** - * Returns true if the variable is allowed in the location it was found, - * which includes considering if default values exist for either the variable - * or the location at which it is located. + * A helper function to describe a token as a string for debugging. + */ +exports.Parser = Parser; +function getTokenDesc(token) { + const value = token.value; + return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : ''); +} +/** + * A helper function to describe a token kind as a string for debugging. */ -function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) { - if ((0, _definition.isNonNullType)(locationType) && !(0, _definition.isNonNullType)(varType)) { - const hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== _kinds.Kind.NULL; - const hasLocationDefaultValue = locationDefaultValue !== undefined; - if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { - return false; - } - const nullableLocationType = locationType.ofType; - return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, nullableLocationType); - } - return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, locationType); +function getTokenKindDesc(kind) { + return (0, _lexer.isPunctuatorTokenKind)(kind) ? `"${kind}"` : kind; } /***/ }), -/***/ "../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs": -/*!****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs ***! - \****************************************************************************************/ +/***/ "../../../node_modules/graphql/language/predicates.mjs": +/*!*************************************************************!*\ + !*** ../../../node_modules/graphql/language/predicates.mjs ***! + \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoDeprecatedCustomRule = NoDeprecatedCustomRule; -var _invariant = __webpack_require__(/*! ../../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -var _GraphQLError = __webpack_require__(/*! ../../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _definition = __webpack_require__(/*! ../../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/** - * No deprecated - * - * A GraphQL document is only valid if all selected fields and all used enum values have not been - * deprecated. - * - * Note: This rule is optional and is not part of the Validation section of the GraphQL - * Specification. The main purpose of this rule is detection of deprecated usages and not - * necessarily to forbid their use when querying a service. - */ -function NoDeprecatedCustomRule(context) { - return { - Field(node) { - const fieldDef = context.getFieldDef(); - const deprecationReason = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.deprecationReason; - if (fieldDef && deprecationReason != null) { - const parentType = context.getParentType(); - parentType != null || (0, _invariant.invariant)(false); - context.reportError(new _GraphQLError.GraphQLError(`The field ${parentType.name}.${fieldDef.name} is deprecated. ${deprecationReason}`, { - nodes: node - })); - } - }, - Argument(node) { - const argDef = context.getArgument(); - const deprecationReason = argDef === null || argDef === void 0 ? void 0 : argDef.deprecationReason; - if (argDef && deprecationReason != null) { - const directiveDef = context.getDirective(); - if (directiveDef != null) { - context.reportError(new _GraphQLError.GraphQLError(`Directive "@${directiveDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, { - nodes: node - })); - } else { - const parentType = context.getParentType(); - const fieldDef = context.getFieldDef(); - parentType != null && fieldDef != null || (0, _invariant.invariant)(false); - context.reportError(new _GraphQLError.GraphQLError(`Field "${parentType.name}.${fieldDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, { - nodes: node - })); - } - } - }, - ObjectField(node) { - const inputObjectDef = (0, _definition.getNamedType)(context.getParentInputType()); - if ((0, _definition.isInputObjectType)(inputObjectDef)) { - const inputFieldDef = inputObjectDef.getFields()[node.name.value]; - const deprecationReason = inputFieldDef === null || inputFieldDef === void 0 ? void 0 : inputFieldDef.deprecationReason; - if (deprecationReason != null) { - context.reportError(new _GraphQLError.GraphQLError(`The input field ${inputObjectDef.name}.${inputFieldDef.name} is deprecated. ${deprecationReason}`, { - nodes: node - })); - } - } - }, - EnumValue(node) { - const enumValueDef = context.getEnumValue(); - const deprecationReason = enumValueDef === null || enumValueDef === void 0 ? void 0 : enumValueDef.deprecationReason; - if (enumValueDef && deprecationReason != null) { - const enumTypeDef = (0, _definition.getNamedType)(context.getInputType()); - enumTypeDef != null || (0, _invariant.invariant)(false); - context.reportError(new _GraphQLError.GraphQLError(`The enum value "${enumTypeDef.name}.${enumValueDef.name}" is deprecated. ${deprecationReason}`, { - nodes: node - })); - } - } - }; +exports.isConstValueNode = isConstValueNode; +exports.isDefinitionNode = isDefinitionNode; +exports.isExecutableDefinitionNode = isExecutableDefinitionNode; +exports.isSelectionNode = isSelectionNode; +exports.isTypeDefinitionNode = isTypeDefinitionNode; +exports.isTypeExtensionNode = isTypeExtensionNode; +exports.isTypeNode = isTypeNode; +exports.isTypeSystemDefinitionNode = isTypeSystemDefinitionNode; +exports.isTypeSystemExtensionNode = isTypeSystemExtensionNode; +exports.isValueNode = isValueNode; +var _kinds = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +function isDefinitionNode(node) { + return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node); +} +function isExecutableDefinitionNode(node) { + return node.kind === _kinds.Kind.OPERATION_DEFINITION || node.kind === _kinds.Kind.FRAGMENT_DEFINITION; +} +function isSelectionNode(node) { + return node.kind === _kinds.Kind.FIELD || node.kind === _kinds.Kind.FRAGMENT_SPREAD || node.kind === _kinds.Kind.INLINE_FRAGMENT; +} +function isValueNode(node) { + return node.kind === _kinds.Kind.VARIABLE || node.kind === _kinds.Kind.INT || node.kind === _kinds.Kind.FLOAT || node.kind === _kinds.Kind.STRING || node.kind === _kinds.Kind.BOOLEAN || node.kind === _kinds.Kind.NULL || node.kind === _kinds.Kind.ENUM || node.kind === _kinds.Kind.LIST || node.kind === _kinds.Kind.OBJECT; +} +function isConstValueNode(node) { + return isValueNode(node) && (node.kind === _kinds.Kind.LIST ? node.values.some(isConstValueNode) : node.kind === _kinds.Kind.OBJECT ? node.fields.some(field => isConstValueNode(field.value)) : node.kind !== _kinds.Kind.VARIABLE); +} +function isTypeNode(node) { + return node.kind === _kinds.Kind.NAMED_TYPE || node.kind === _kinds.Kind.LIST_TYPE || node.kind === _kinds.Kind.NON_NULL_TYPE; +} +function isTypeSystemDefinitionNode(node) { + return node.kind === _kinds.Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === _kinds.Kind.DIRECTIVE_DEFINITION; +} +function isTypeDefinitionNode(node) { + return node.kind === _kinds.Kind.SCALAR_TYPE_DEFINITION || node.kind === _kinds.Kind.OBJECT_TYPE_DEFINITION || node.kind === _kinds.Kind.INTERFACE_TYPE_DEFINITION || node.kind === _kinds.Kind.UNION_TYPE_DEFINITION || node.kind === _kinds.Kind.ENUM_TYPE_DEFINITION || node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION; +} +function isTypeSystemExtensionNode(node) { + return node.kind === _kinds.Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node); +} +function isTypeExtensionNode(node) { + return node.kind === _kinds.Kind.SCALAR_TYPE_EXTENSION || node.kind === _kinds.Kind.OBJECT_TYPE_EXTENSION || node.kind === _kinds.Kind.INTERFACE_TYPE_EXTENSION || node.kind === _kinds.Kind.UNION_TYPE_EXTENSION || node.kind === _kinds.Kind.ENUM_TYPE_EXTENSION || node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION; } /***/ }), -/***/ "../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs": -/*!*************************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs ***! - \*************************************************************************************************/ +/***/ "../../../node_modules/graphql/language/printLocation.mjs": +/*!****************************************************************!*\ + !*** ../../../node_modules/graphql/language/printLocation.mjs ***! + \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoSchemaIntrospectionCustomRule = NoSchemaIntrospectionCustomRule; -var _GraphQLError = __webpack_require__(/*! ../../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _definition = __webpack_require__(/*! ../../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -var _introspection = __webpack_require__(/*! ../../../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +exports.printLocation = printLocation; +exports.printSourceLocation = printSourceLocation; +var _location = __webpack_require__(/*! ./location.mjs */ "../../../node_modules/graphql/language/location.mjs"); /** - * Prohibit introspection queries - * - * A GraphQL document is only valid if all fields selected are not fields that - * return an introspection type. - * - * Note: This rule is optional and is not part of the Validation section of the - * GraphQL Specification. This rule effectively disables introspection, which - * does not reflect best practices and should only be done if absolutely necessary. + * Render a helpful description of the location in the GraphQL Source document. */ -function NoSchemaIntrospectionCustomRule(context) { - return { - Field(node) { - const type = (0, _definition.getNamedType)(context.getType()); - if (type && (0, _introspection.isIntrospectionType)(type)) { - context.reportError(new _GraphQLError.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`, { - nodes: node - })); - } +function printLocation(location) { + return printSourceLocation(location.source, (0, _location.getLocation)(location.source, location.start)); +} +/** + * Render a helpful description of the location in the GraphQL Source document. + */ + +function printSourceLocation(source, sourceLocation) { + const firstLineColumnOffset = source.locationOffset.column - 1; + const body = ''.padStart(firstLineColumnOffset) + source.body; + const lineIndex = sourceLocation.line - 1; + const lineOffset = source.locationOffset.line - 1; + const lineNum = sourceLocation.line + lineOffset; + const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; + const columnNum = sourceLocation.column + columnOffset; + const locationStr = `${source.name}:${lineNum}:${columnNum}\n`; + const lines = body.split(/\r\n|[\n\r]/g); + const locationLine = lines[lineIndex]; // Special case for minified documents + + if (locationLine.length > 120) { + const subLineIndex = Math.floor(columnNum / 80); + const subLineColumnNum = columnNum % 80; + const subLines = []; + for (let i = 0; i < locationLine.length; i += 80) { + subLines.push(locationLine.slice(i, i + 80)); } - }; + return locationStr + printPrefixedLines([[`${lineNum} |`, subLines[0]], ...subLines.slice(1, subLineIndex + 1).map(subLine => ['|', subLine]), ['|', '^'.padStart(subLineColumnNum)], ['|', subLines[subLineIndex + 1]]]); + } + return locationStr + printPrefixedLines([ + // Lines specified like this: ["prefix", "string"], + [`${lineNum - 1} |`, lines[lineIndex - 1]], [`${lineNum} |`, locationLine], ['|', '^'.padStart(columnNum)], [`${lineNum + 1} |`, lines[lineIndex + 1]]]); +} +function printPrefixedLines(lines) { + const existingLines = lines.filter(([_, line]) => line !== undefined); + const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length)); + return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : '')).join('\n'); } /***/ }), -/***/ "../../../node_modules/graphql/validation/specifiedRules.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/validation/specifiedRules.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/language/printString.mjs": +/*!**************************************************************!*\ + !*** ../../../node_modules/graphql/language/printString.mjs ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.specifiedSDLRules = exports.specifiedRules = exports.recommendedRules = void 0; -var _ExecutableDefinitionsRule = __webpack_require__(/*! ./rules/ExecutableDefinitionsRule.mjs */ "../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs"); -var _FieldsOnCorrectTypeRule = __webpack_require__(/*! ./rules/FieldsOnCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs"); -var _FragmentsOnCompositeTypesRule = __webpack_require__(/*! ./rules/FragmentsOnCompositeTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs"); -var _KnownArgumentNamesRule = __webpack_require__(/*! ./rules/KnownArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs"); -var _KnownDirectivesRule = __webpack_require__(/*! ./rules/KnownDirectivesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs"); -var _KnownFragmentNamesRule = __webpack_require__(/*! ./rules/KnownFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs"); -var _KnownTypeNamesRule = __webpack_require__(/*! ./rules/KnownTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs"); -var _LoneAnonymousOperationRule = __webpack_require__(/*! ./rules/LoneAnonymousOperationRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs"); -var _LoneSchemaDefinitionRule = __webpack_require__(/*! ./rules/LoneSchemaDefinitionRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs"); -var _MaxIntrospectionDepthRule = __webpack_require__(/*! ./rules/MaxIntrospectionDepthRule.mjs */ "../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs"); -var _NoFragmentCyclesRule = __webpack_require__(/*! ./rules/NoFragmentCyclesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs"); -var _NoUndefinedVariablesRule = __webpack_require__(/*! ./rules/NoUndefinedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs"); -var _NoUnusedFragmentsRule = __webpack_require__(/*! ./rules/NoUnusedFragmentsRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs"); -var _NoUnusedVariablesRule = __webpack_require__(/*! ./rules/NoUnusedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs"); -var _OverlappingFieldsCanBeMergedRule = __webpack_require__(/*! ./rules/OverlappingFieldsCanBeMergedRule.mjs */ "../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs"); -var _PossibleFragmentSpreadsRule = __webpack_require__(/*! ./rules/PossibleFragmentSpreadsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs"); -var _PossibleTypeExtensionsRule = __webpack_require__(/*! ./rules/PossibleTypeExtensionsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs"); -var _ProvidedRequiredArgumentsRule = __webpack_require__(/*! ./rules/ProvidedRequiredArgumentsRule.mjs */ "../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs"); -var _ScalarLeafsRule = __webpack_require__(/*! ./rules/ScalarLeafsRule.mjs */ "../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs"); -var _SingleFieldSubscriptionsRule = __webpack_require__(/*! ./rules/SingleFieldSubscriptionsRule.mjs */ "../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs"); -var _UniqueArgumentDefinitionNamesRule = __webpack_require__(/*! ./rules/UniqueArgumentDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs"); -var _UniqueArgumentNamesRule = __webpack_require__(/*! ./rules/UniqueArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs"); -var _UniqueDirectiveNamesRule = __webpack_require__(/*! ./rules/UniqueDirectiveNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs"); -var _UniqueDirectivesPerLocationRule = __webpack_require__(/*! ./rules/UniqueDirectivesPerLocationRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs"); -var _UniqueEnumValueNamesRule = __webpack_require__(/*! ./rules/UniqueEnumValueNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs"); -var _UniqueFieldDefinitionNamesRule = __webpack_require__(/*! ./rules/UniqueFieldDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs"); -var _UniqueFragmentNamesRule = __webpack_require__(/*! ./rules/UniqueFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs"); -var _UniqueInputFieldNamesRule = __webpack_require__(/*! ./rules/UniqueInputFieldNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs"); -var _UniqueOperationNamesRule = __webpack_require__(/*! ./rules/UniqueOperationNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs"); -var _UniqueOperationTypesRule = __webpack_require__(/*! ./rules/UniqueOperationTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs"); -var _UniqueTypeNamesRule = __webpack_require__(/*! ./rules/UniqueTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs"); -var _UniqueVariableNamesRule = __webpack_require__(/*! ./rules/UniqueVariableNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs"); -var _ValuesOfCorrectTypeRule = __webpack_require__(/*! ./rules/ValuesOfCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs"); -var _VariablesAreInputTypesRule = __webpack_require__(/*! ./rules/VariablesAreInputTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs"); -var _VariablesInAllowedPositionRule = __webpack_require__(/*! ./rules/VariablesInAllowedPositionRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs"); -// Spec Section: "Executable Definitions" -// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" - -// Spec Section: "Fragments on Composite Types" - -// Spec Section: "Argument Names" - -// Spec Section: "Directives Are Defined" - -// Spec Section: "Fragment spread target defined" - -// Spec Section: "Fragment Spread Type Existence" - -// Spec Section: "Lone Anonymous Operation" - -// SDL-specific validation rules - -// TODO: Spec Section - -// Spec Section: "Fragments must not form cycles" - -// Spec Section: "All Variable Used Defined" - -// Spec Section: "Fragments must be used" - -// Spec Section: "All Variables Used" - -// Spec Section: "Field Selection Merging" - -// Spec Section: "Fragment spread is possible" - -// Spec Section: "Argument Optionality" - -// Spec Section: "Leaf Field Selections" - -// Spec Section: "Subscriptions with Single Root Field" - -// Spec Section: "Argument Uniqueness" - -// Spec Section: "Directives Are Unique Per Location" - -// Spec Section: "Fragment Name Uniqueness" - -// Spec Section: "Input Object Field Uniqueness" - -// Spec Section: "Operation Name Uniqueness" - -// Spec Section: "Variable Uniqueness" - -// Spec Section: "Value Type Correctness" - -// Spec Section: "Variables are Input Types" - -// Spec Section: "All Variable Usages Are Allowed" - -/** - * Technically these aren't part of the spec but they are strongly encouraged - * validation rules. - */ -const recommendedRules = exports.recommendedRules = Object.freeze([_MaxIntrospectionDepthRule.MaxIntrospectionDepthRule]); +exports.printString = printString; /** - * This set includes all validation rules defined by the GraphQL spec. - * - * The order of the rules in this list has been adjusted to lead to the - * most clear output when encountering multiple validation errors. + * Prints a string as a GraphQL StringValue literal. Replaces control characters + * and excluded characters (" U+0022 and \\ U+005C) with escape sequences. */ +function printString(str) { + return `"${str.replace(escapedRegExp, escapedReplacer)}"`; +} // eslint-disable-next-line no-control-regex -const specifiedRules = exports.specifiedRules = Object.freeze([_ExecutableDefinitionsRule.ExecutableDefinitionsRule, _UniqueOperationNamesRule.UniqueOperationNamesRule, _LoneAnonymousOperationRule.LoneAnonymousOperationRule, _SingleFieldSubscriptionsRule.SingleFieldSubscriptionsRule, _KnownTypeNamesRule.KnownTypeNamesRule, _FragmentsOnCompositeTypesRule.FragmentsOnCompositeTypesRule, _VariablesAreInputTypesRule.VariablesAreInputTypesRule, _ScalarLeafsRule.ScalarLeafsRule, _FieldsOnCorrectTypeRule.FieldsOnCorrectTypeRule, _UniqueFragmentNamesRule.UniqueFragmentNamesRule, _KnownFragmentNamesRule.KnownFragmentNamesRule, _NoUnusedFragmentsRule.NoUnusedFragmentsRule, _PossibleFragmentSpreadsRule.PossibleFragmentSpreadsRule, _NoFragmentCyclesRule.NoFragmentCyclesRule, _UniqueVariableNamesRule.UniqueVariableNamesRule, _NoUndefinedVariablesRule.NoUndefinedVariablesRule, _NoUnusedVariablesRule.NoUnusedVariablesRule, _KnownDirectivesRule.KnownDirectivesRule, _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule, _KnownArgumentNamesRule.KnownArgumentNamesRule, _UniqueArgumentNamesRule.UniqueArgumentNamesRule, _ValuesOfCorrectTypeRule.ValuesOfCorrectTypeRule, _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsRule, _VariablesInAllowedPositionRule.VariablesInAllowedPositionRule, _OverlappingFieldsCanBeMergedRule.OverlappingFieldsCanBeMergedRule, _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule, ...recommendedRules]); -/** - * @internal - */ +const escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g; +function escapedReplacer(str) { + return escapeSequences[str.charCodeAt(0)]; +} // prettier-ignore -const specifiedSDLRules = exports.specifiedSDLRules = Object.freeze([_LoneSchemaDefinitionRule.LoneSchemaDefinitionRule, _UniqueOperationTypesRule.UniqueOperationTypesRule, _UniqueTypeNamesRule.UniqueTypeNamesRule, _UniqueEnumValueNamesRule.UniqueEnumValueNamesRule, _UniqueFieldDefinitionNamesRule.UniqueFieldDefinitionNamesRule, _UniqueArgumentDefinitionNamesRule.UniqueArgumentDefinitionNamesRule, _UniqueDirectiveNamesRule.UniqueDirectiveNamesRule, _KnownTypeNamesRule.KnownTypeNamesRule, _KnownDirectivesRule.KnownDirectivesRule, _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule, _PossibleTypeExtensionsRule.PossibleTypeExtensionsRule, _KnownArgumentNamesRule.KnownArgumentNamesOnDirectivesRule, _UniqueArgumentNamesRule.UniqueArgumentNamesRule, _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule, _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsOnDirectivesRule]); +const escapeSequences = ['\\u0000', '\\u0001', '\\u0002', '\\u0003', '\\u0004', '\\u0005', '\\u0006', '\\u0007', '\\b', '\\t', '\\n', '\\u000B', '\\f', '\\r', '\\u000E', '\\u000F', '\\u0010', '\\u0011', '\\u0012', '\\u0013', '\\u0014', '\\u0015', '\\u0016', '\\u0017', '\\u0018', '\\u0019', '\\u001A', '\\u001B', '\\u001C', '\\u001D', '\\u001E', '\\u001F', '', '', '\\"', '', '', '', '', '', '', '', '', '', '', '', '', '', +// 2F +'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', +// 3F +'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', +// 4F +'', '', '', '', '', '', '', '', '', '', '', '', '\\\\', '', '', '', +// 5F +'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', +// 6F +'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '\\u007F', '\\u0080', '\\u0081', '\\u0082', '\\u0083', '\\u0084', '\\u0085', '\\u0086', '\\u0087', '\\u0088', '\\u0089', '\\u008A', '\\u008B', '\\u008C', '\\u008D', '\\u008E', '\\u008F', '\\u0090', '\\u0091', '\\u0092', '\\u0093', '\\u0094', '\\u0095', '\\u0096', '\\u0097', '\\u0098', '\\u0099', '\\u009A', '\\u009B', '\\u009C', '\\u009D', '\\u009E', '\\u009F']; /***/ }), -/***/ "../../../node_modules/graphql/validation/validate.mjs": -/*!*************************************************************!*\ - !*** ../../../node_modules/graphql/validation/validate.mjs ***! - \*************************************************************/ +/***/ "../../../node_modules/graphql/language/printer.mjs": +/*!**********************************************************!*\ + !*** ../../../node_modules/graphql/language/printer.mjs ***! + \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.assertValidSDL = assertValidSDL; -exports.assertValidSDLExtension = assertValidSDLExtension; -exports.validate = validate; -exports.validateSDL = validateSDL; -var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -var _visitor = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); -var _validate = __webpack_require__(/*! ../type/validate.mjs */ "../../../node_modules/graphql/type/validate.mjs"); -var _TypeInfo = __webpack_require__(/*! ../utilities/TypeInfo.mjs */ "../../../node_modules/graphql/utilities/TypeInfo.mjs"); -var _specifiedRules = __webpack_require__(/*! ./specifiedRules.mjs */ "../../../node_modules/graphql/validation/specifiedRules.mjs"); -var _ValidationContext = __webpack_require__(/*! ./ValidationContext.mjs */ "../../../node_modules/graphql/validation/ValidationContext.mjs"); +exports.print = print; +var _blockString = __webpack_require__(/*! ./blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); +var _printString = __webpack_require__(/*! ./printString.mjs */ "../../../node_modules/graphql/language/printString.mjs"); +var _visitor = __webpack_require__(/*! ./visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); /** - * Implements the "Validation" section of the spec. - * - * Validation runs synchronously, returning an array of encountered errors, or - * an empty array if no errors were encountered and the document is valid. - * - * A list of specific validation rules may be provided. If not provided, the - * default list of rules defined by the GraphQL specification will be used. - * - * Each validation rules is a function which returns a visitor - * (see the language/visitor API). Visitor methods are expected to return - * GraphQLErrors, or Arrays of GraphQLErrors when invalid. - * - * Validate will stop validation after a `maxErrors` limit has been reached. - * Attackers can send pathologically invalid queries to induce a DoS attack, - * so by default `maxErrors` set to 100 errors. - * - * Optionally a custom TypeInfo instance may be provided. If not provided, one - * will be created from the provided schema. + * Converts an AST into a string, using one set of reasonable + * formatting rules. */ -function validate(schema, documentAST, rules = _specifiedRules.specifiedRules, options, /** @deprecated will be removed in 17.0.0 */ -typeInfo = new _TypeInfo.TypeInfo(schema)) { - var _options$maxErrors; - const maxErrors = (_options$maxErrors = options === null || options === void 0 ? void 0 : options.maxErrors) !== null && _options$maxErrors !== void 0 ? _options$maxErrors : 100; - documentAST || (0, _devAssert.devAssert)(false, 'Must provide document.'); // If the schema used for validation is invalid, throw an error. - - (0, _validate.assertValidSchema)(schema); - const abortObj = Object.freeze({}); - const errors = []; - const context = new _ValidationContext.ValidationContext(schema, documentAST, typeInfo, error => { - if (errors.length >= maxErrors) { - errors.push(new _GraphQLError.GraphQLError('Too many validation errors, error limit reached. Validation aborted.')); // eslint-disable-next-line @typescript-eslint/no-throw-literal +function print(ast) { + return (0, _visitor.visit)(ast, printDocASTReducer); +} +const MAX_LINE_LENGTH = 80; +const printDocASTReducer = { + Name: { + leave: node => node.value + }, + Variable: { + leave: node => '$' + node.name + }, + // Document + Document: { + leave: node => join(node.definitions, '\n\n') + }, + OperationDefinition: { + leave(node) { + const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); + const prefix = join([node.operation, join([node.name, varDefs]), join(node.directives, ' ')], ' '); // Anonymous queries with no directives or variable definitions can use + // the query short form. - throw abortObj; + return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet; } - errors.push(error); - }); // This uses a specialized visitor which runs multiple visitors in parallel, - // while maintaining the visitor skip and break API. - - const visitor = (0, _visitor.visitInParallel)(rules.map(rule => rule(context))); // Visit the whole document with each instance of all provided rules. - - try { - (0, _visitor.visit)(documentAST, (0, _TypeInfo.visitWithTypeInfo)(typeInfo, visitor)); - } catch (e) { - if (e !== abortObj) { - throw e; + }, + VariableDefinition: { + leave: ({ + variable, + type, + defaultValue, + directives + }) => variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' ')) + }, + SelectionSet: { + leave: ({ + selections + }) => block(selections) + }, + Field: { + leave({ + alias, + name, + arguments: args, + directives, + selectionSet + }) { + const prefix = wrap('', alias, ': ') + name; + let argsLine = prefix + wrap('(', join(args, ', '), ')'); + if (argsLine.length > MAX_LINE_LENGTH) { + argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); + } + return join([argsLine, join(directives, ' '), selectionSet], ' '); } + }, + Argument: { + leave: ({ + name, + value + }) => name + ': ' + value + }, + // Fragments + FragmentSpread: { + leave: ({ + name, + directives + }) => '...' + name + wrap(' ', join(directives, ' ')) + }, + InlineFragment: { + leave: ({ + typeCondition, + directives, + selectionSet + }) => join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ') + }, + FragmentDefinition: { + leave: ({ + name, + typeCondition, + variableDefinitions, + directives, + selectionSet + } // Note: fragment variable definitions are experimental and may be changed + ) => + // or removed in the future. + `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` + `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` + selectionSet + }, + // Value + IntValue: { + leave: ({ + value + }) => value + }, + FloatValue: { + leave: ({ + value + }) => value + }, + StringValue: { + leave: ({ + value, + block: isBlockString + }) => isBlockString ? (0, _blockString.printBlockString)(value) : (0, _printString.printString)(value) + }, + BooleanValue: { + leave: ({ + value + }) => value ? 'true' : 'false' + }, + NullValue: { + leave: () => 'null' + }, + EnumValue: { + leave: ({ + value + }) => value + }, + ListValue: { + leave: ({ + values + }) => '[' + join(values, ', ') + ']' + }, + ObjectValue: { + leave: ({ + fields + }) => '{' + join(fields, ', ') + '}' + }, + ObjectField: { + leave: ({ + name, + value + }) => name + ': ' + value + }, + // Directive + Directive: { + leave: ({ + name, + arguments: args + }) => '@' + name + wrap('(', join(args, ', '), ')') + }, + // Type + NamedType: { + leave: ({ + name + }) => name + }, + ListType: { + leave: ({ + type + }) => '[' + type + ']' + }, + NonNullType: { + leave: ({ + type + }) => type + '!' + }, + // Type System Definitions + SchemaDefinition: { + leave: ({ + description, + directives, + operationTypes + }) => wrap('', description, '\n') + join(['schema', join(directives, ' '), block(operationTypes)], ' ') + }, + OperationTypeDefinition: { + leave: ({ + operation, + type + }) => operation + ': ' + type + }, + ScalarTypeDefinition: { + leave: ({ + description, + name, + directives + }) => wrap('', description, '\n') + join(['scalar', name, join(directives, ' ')], ' ') + }, + ObjectTypeDefinition: { + leave: ({ + description, + name, + interfaces, + directives, + fields + }) => wrap('', description, '\n') + join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ') + }, + FieldDefinition: { + leave: ({ + description, + name, + arguments: args, + type, + directives + }) => wrap('', description, '\n') + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' ')) + }, + InputValueDefinition: { + leave: ({ + description, + name, + type, + defaultValue, + directives + }) => wrap('', description, '\n') + join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ') + }, + InterfaceTypeDefinition: { + leave: ({ + description, + name, + interfaces, + directives, + fields + }) => wrap('', description, '\n') + join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ') + }, + UnionTypeDefinition: { + leave: ({ + description, + name, + directives, + types + }) => wrap('', description, '\n') + join(['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' ') + }, + EnumTypeDefinition: { + leave: ({ + description, + name, + directives, + values + }) => wrap('', description, '\n') + join(['enum', name, join(directives, ' '), block(values)], ' ') + }, + EnumValueDefinition: { + leave: ({ + description, + name, + directives + }) => wrap('', description, '\n') + join([name, join(directives, ' ')], ' ') + }, + InputObjectTypeDefinition: { + leave: ({ + description, + name, + directives, + fields + }) => wrap('', description, '\n') + join(['input', name, join(directives, ' '), block(fields)], ' ') + }, + DirectiveDefinition: { + leave: ({ + description, + name, + arguments: args, + repeatable, + locations + }) => wrap('', description, '\n') + 'directive @' + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | ') + }, + SchemaExtension: { + leave: ({ + directives, + operationTypes + }) => join(['extend schema', join(directives, ' '), block(operationTypes)], ' ') + }, + ScalarTypeExtension: { + leave: ({ + name, + directives + }) => join(['extend scalar', name, join(directives, ' ')], ' ') + }, + ObjectTypeExtension: { + leave: ({ + name, + interfaces, + directives, + fields + }) => join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ') + }, + InterfaceTypeExtension: { + leave: ({ + name, + interfaces, + directives, + fields + }) => join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ') + }, + UnionTypeExtension: { + leave: ({ + name, + directives, + types + }) => join(['extend union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' ') + }, + EnumTypeExtension: { + leave: ({ + name, + directives, + values + }) => join(['extend enum', name, join(directives, ' '), block(values)], ' ') + }, + InputObjectTypeExtension: { + leave: ({ + name, + directives, + fields + }) => join(['extend input', name, join(directives, ' '), block(fields)], ' ') } - return errors; -} +}; /** - * @internal + * Given maybeArray, print an empty string if it is null or empty, otherwise + * print all items together separated by separator if provided */ -function validateSDL(documentAST, schemaToExtend, rules = _specifiedRules.specifiedSDLRules) { - const errors = []; - const context = new _ValidationContext.SDLValidationContext(documentAST, schemaToExtend, error => { - errors.push(error); - }); - const visitors = rules.map(rule => rule(context)); - (0, _visitor.visit)(documentAST, (0, _visitor.visitInParallel)(visitors)); - return errors; +function join(maybeArray, separator = '') { + var _maybeArray$filter$jo; + return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(x => x).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : ''; } /** - * Utility function which asserts a SDL document is valid by throwing an error - * if it is invalid. - * - * @internal + * Given array, print each item on its own line, wrapped in an indented `{ }` block. */ -function assertValidSDL(documentAST) { - const errors = validateSDL(documentAST); - if (errors.length !== 0) { - throw new Error(errors.map(error => error.message).join('\n\n')); - } +function block(array) { + return wrap('{\n', indent(join(array, '\n')), '\n}'); } /** - * Utility function which asserts a SDL document is valid by throwing an error - * if it is invalid. - * - * @internal + * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string. */ -function assertValidSDLExtension(documentAST, schema) { - const errors = validateSDL(documentAST, schema); - if (errors.length !== 0) { - throw new Error(errors.map(error => error.message).join('\n\n')); - } +function wrap(start, maybeString, end = '') { + return maybeString != null && maybeString !== '' ? start + maybeString + end : ''; +} +function indent(str) { + return wrap(' ', str.replace(/\n/g, '\n ')); +} +function hasMultilineItems(maybeArray) { + var _maybeArray$some; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some(str => str.includes('\n'))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false; } /***/ }), -/***/ "../../../node_modules/graphql/version.mjs": -/*!*************************************************!*\ - !*** ../../../node_modules/graphql/version.mjs ***! - \*************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/graphql/language/source.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/language/source.mjs ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.versionInfo = exports.version = void 0; -// Note: This file is autogenerated using "resources/gen-version.js" script and -// automatically updated by "npm version" command. - +exports.Source = void 0; +exports.isSource = isSource; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _instanceOf = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); /** - * A string containing the version of the GraphQL.js library + * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are + * optional, but they are useful for clients who store GraphQL documents in source files. + * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might + * be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`. + * The `line` and `column` properties in `locationOffset` are 1-indexed. */ -const version = exports.version = '16.9.0'; +class Source { + constructor(body, name = 'GraphQL request', locationOffset = { + line: 1, + column: 1 + }) { + typeof body === 'string' || (0, _devAssert.devAssert)(false, `Body must be a string. Received: ${(0, _inspect.inspect)(body)}.`); + this.body = body; + this.name = name; + this.locationOffset = locationOffset; + this.locationOffset.line > 0 || (0, _devAssert.devAssert)(false, 'line in locationOffset is 1-indexed and must be positive.'); + this.locationOffset.column > 0 || (0, _devAssert.devAssert)(false, 'column in locationOffset is 1-indexed and must be positive.'); + } + get [Symbol.toStringTag]() { + return 'Source'; + } +} /** - * An object containing the components of the GraphQL.js version string + * Test if the given value is a Source object. + * + * @internal */ - -const versionInfo = exports.versionInfo = Object.freeze({ - major: 16, - minor: 9, - patch: 0, - preReleaseTag: null -}); +exports.Source = Source; +function isSource(source) { + return (0, _instanceOf.instanceOf)(source, Source); +} /***/ }), -/***/ "../../../node_modules/hey-listen/dist/hey-listen.es.js": -/*!**************************************************************!*\ - !*** ../../../node_modules/hey-listen/dist/hey-listen.es.js ***! - \**************************************************************/ +/***/ "../../../node_modules/graphql/language/tokenKind.mjs": +/*!************************************************************!*\ + !*** ../../../node_modules/graphql/language/tokenKind.mjs ***! + \************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.warning = exports.invariant = void 0; -var warning = function () {}; -exports.warning = warning; -var invariant = function () {}; -exports.invariant = invariant; -if (true) { - exports.warning = warning = function (check, message) { - if (!check && typeof console !== 'undefined') { - console.warn(message); - } - }; - exports.invariant = invariant = function (check, message) { - if (!check) { - throw new Error(message); - } - }; -} +exports.TokenKind = void 0; +/** + * An exported enum describing the different kinds of tokens that the + * lexer emits. + */ +var TokenKind; +(function (TokenKind) { + TokenKind['SOF'] = ''; + TokenKind['EOF'] = ''; + TokenKind['BANG'] = '!'; + TokenKind['DOLLAR'] = '$'; + TokenKind['AMP'] = '&'; + TokenKind['PAREN_L'] = '('; + TokenKind['PAREN_R'] = ')'; + TokenKind['SPREAD'] = '...'; + TokenKind['COLON'] = ':'; + TokenKind['EQUALS'] = '='; + TokenKind['AT'] = '@'; + TokenKind['BRACKET_L'] = '['; + TokenKind['BRACKET_R'] = ']'; + TokenKind['BRACE_L'] = '{'; + TokenKind['PIPE'] = '|'; + TokenKind['BRACE_R'] = '}'; + TokenKind['NAME'] = 'Name'; + TokenKind['INT'] = 'Int'; + TokenKind['FLOAT'] = 'Float'; + TokenKind['STRING'] = 'String'; + TokenKind['BLOCK_STRING'] = 'BlockString'; + TokenKind['COMMENT'] = 'Comment'; +})(TokenKind || (exports.TokenKind = TokenKind = {})); -/***/ }), +/** + * The enum type representing the token kinds values. + * + * @deprecated Please use `TokenKind`. Will be remove in v17. + */ -/***/ "../../../node_modules/is-plain-object/index.js": -/*!******************************************************!*\ - !*** ../../../node_modules/is-plain-object/index.js ***! - \******************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ +/***/ }), +/***/ "../../../node_modules/graphql/language/visitor.mjs": +/*!**********************************************************!*\ + !*** ../../../node_modules/graphql/language/visitor.mjs ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; -var isObject = __webpack_require__(/*! isobject */ "../../../node_modules/isobject/index.js"); -function isObjectObject(o) { - return isObject(o) === true && Object.prototype.toString.call(o) === '[object Object]'; -} -module.exports = function isPlainObject(o) { - var ctor, prot; - if (isObjectObject(o) === false) return false; - // If has modified constructor - ctor = o.constructor; - if (typeof ctor !== 'function') return false; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.BREAK = void 0; +exports.getEnterLeaveForKind = getEnterLeaveForKind; +exports.getVisitFn = getVisitFn; +exports.visit = visit; +exports.visitInParallel = visitInParallel; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _ast = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); +var _kinds = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +/** + * A visitor is provided to visit, it contains the collection of + * relevant functions to be called during the visitor's traversal. + */ - // If has modified prototype - prot = ctor.prototype; - if (isObjectObject(prot) === false) return false; +const BREAK = exports.BREAK = Object.freeze({}); +/** + * visit() will walk through an AST using a depth-first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * + * ```ts + * const editedAST = visit(ast, { + * enter(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: skip visiting this node + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * }, + * leave(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: no action + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * } + * }); + * ``` + * + * Alternatively to providing enter() and leave() functions, a visitor can + * instead provide functions named the same as the kinds of AST nodes, or + * enter/leave visitors at a named key, leading to three permutations of the + * visitor API: + * + * 1) Named visitors triggered when entering a node of a specific kind. + * + * ```ts + * visit(ast, { + * Kind(node) { + * // enter the "Kind" node + * } + * }) + * ``` + * + * 2) Named visitors that trigger upon entering and leaving a node of a specific kind. + * + * ```ts + * visit(ast, { + * Kind: { + * enter(node) { + * // enter the "Kind" node + * } + * leave(node) { + * // leave the "Kind" node + * } + * } + * }) + * ``` + * + * 3) Generic visitors that trigger upon entering and leaving any node. + * + * ```ts + * visit(ast, { + * enter(node) { + * // enter any node + * }, + * leave(node) { + * // leave any node + * } + * }) + * ``` + */ - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; +function visit(root, visitor, visitorKeys = _ast.QueryDocumentKeys) { + const enterLeaveMap = new Map(); + for (const kind of Object.values(_kinds.Kind)) { + enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind)); } + /* eslint-disable no-undef-init */ - // Most likely a plain Object - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/is-primitive/index.js": -/*!***************************************************!*\ - !*** ../../../node_modules/is-primitive/index.js ***! - \***************************************************/ -/***/ (function(module) { + let stack = undefined; + let inArray = Array.isArray(root); + let keys = [root]; + let index = -1; + let edits = []; + let node = root; + let key = undefined; + let parent = undefined; + const path = []; + const ancestors = []; + /* eslint-enable no-undef-init */ -/*! - * is-primitive + do { + index++; + const isLeaving = index === keys.length; + const isEdited = isLeaving && edits.length !== 0; + if (isLeaving) { + key = ancestors.length === 0 ? undefined : path[path.length - 1]; + node = parent; + parent = ancestors.pop(); + if (isEdited) { + if (inArray) { + node = node.slice(); + let editOffset = 0; + for (const [editKey, editValue] of edits) { + const arrayKey = editKey - editOffset; + if (editValue === null) { + node.splice(arrayKey, 1); + editOffset++; + } else { + node[arrayKey] = editValue; + } + } + } else { + node = Object.defineProperties({}, Object.getOwnPropertyDescriptors(node)); + for (const [editKey, editValue] of edits) { + node[editKey] = editValue; + } + } + } + index = stack.index; + keys = stack.keys; + edits = stack.edits; + inArray = stack.inArray; + stack = stack.prev; + } else if (parent) { + key = inArray ? index : keys[index]; + node = parent[key]; + if (node === null || node === undefined) { + continue; + } + path.push(key); + } + let result; + if (!Array.isArray(node)) { + var _enterLeaveMap$get, _enterLeaveMap$get2; + (0, _ast.isNode)(node) || (0, _devAssert.devAssert)(false, `Invalid AST Node: ${(0, _inspect.inspect)(node)}.`); + const visitFn = isLeaving ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get === void 0 ? void 0 : _enterLeaveMap$get.leave : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get2 === void 0 ? void 0 : _enterLeaveMap$get2.enter; + result = visitFn === null || visitFn === void 0 ? void 0 : visitFn.call(visitor, node, key, parent, path, ancestors); + if (result === BREAK) { + break; + } + if (result === false) { + if (!isLeaving) { + path.pop(); + continue; + } + } else if (result !== undefined) { + edits.push([key, result]); + if (!isLeaving) { + if ((0, _ast.isNode)(result)) { + node = result; + } else { + path.pop(); + continue; + } + } + } + } + if (result === undefined && isEdited) { + edits.push([key, node]); + } + if (isLeaving) { + path.pop(); + } else { + var _node$kind; + stack = { + inArray, + index, + keys, + edits, + prev: stack + }; + inArray = Array.isArray(node); + keys = inArray ? node : (_node$kind = visitorKeys[node.kind]) !== null && _node$kind !== void 0 ? _node$kind : []; + index = -1; + edits = []; + if (parent) { + ancestors.push(parent); + } + parent = node; + } + } while (stack !== undefined); + if (edits.length !== 0) { + // New root + return edits[edits.length - 1][1]; + } + return root; +} +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. + * If a prior visitor edits a node, no following visitors will see that node. */ - - -module.exports = function isPrimitive(val) { - if (typeof val === 'object') { - return val === null; +function visitInParallel(visitors) { + const skipping = new Array(visitors.length).fill(null); + const mergedVisitor = Object.create(null); + for (const kind of Object.values(_kinds.Kind)) { + let hasVisitor = false; + const enterList = new Array(visitors.length).fill(undefined); + const leaveList = new Array(visitors.length).fill(undefined); + for (let i = 0; i < visitors.length; ++i) { + const { + enter, + leave + } = getEnterLeaveForKind(visitors[i], kind); + hasVisitor || (hasVisitor = enter != null || leave != null); + enterList[i] = enter; + leaveList[i] = leave; + } + if (!hasVisitor) { + continue; + } + const mergedEnterLeave = { + enter(...args) { + const node = args[0]; + for (let i = 0; i < visitors.length; i++) { + if (skipping[i] === null) { + var _enterList$i; + const result = (_enterList$i = enterList[i]) === null || _enterList$i === void 0 ? void 0 : _enterList$i.apply(visitors[i], args); + if (result === false) { + skipping[i] = node; + } else if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined) { + return result; + } + } + } + }, + leave(...args) { + const node = args[0]; + for (let i = 0; i < visitors.length; i++) { + if (skipping[i] === null) { + var _leaveList$i; + const result = (_leaveList$i = leaveList[i]) === null || _leaveList$i === void 0 ? void 0 : _leaveList$i.apply(visitors[i], args); + if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined && result !== false) { + return result; + } + } else if (skipping[i] === node) { + skipping[i] = null; + } + } + } + }; + mergedVisitor[kind] = mergedEnterLeave; } - return typeof val !== 'function'; -}; - -/***/ }), - -/***/ "../../../node_modules/isarray/index.js": -/*!**********************************************!*\ - !*** ../../../node_modules/isarray/index.js ***! - \**********************************************/ -/***/ (function(module) { - - - -var toString = {}.toString; -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - -/***/ }), + return mergedVisitor; +} +/** + * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind. + */ -/***/ "../../../node_modules/isobject/index.js": -/*!***********************************************!*\ - !*** ../../../node_modules/isobject/index.js ***! - \***********************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +function getEnterLeaveForKind(visitor, kind) { + const kindVisitor = visitor[kind]; + if (typeof kindVisitor === 'object') { + // { Kind: { enter() {}, leave() {} } } + return kindVisitor; + } else if (typeof kindVisitor === 'function') { + // { Kind() {} } + return { + enter: kindVisitor, + leave: undefined + }; + } // { enter() {}, leave() {} } -/*! - * isobject + return { + enter: visitor.enter, + leave: visitor.leave + }; +} +/** + * Given a visitor instance, if it is leaving or not, and a node kind, return + * the function the visitor runtime should call. * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. + * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17 */ +/* c8 ignore next 8 */ - -var isArray = __webpack_require__(/*! isarray */ "../../../node_modules/isarray/index.js"); -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && isArray(val) === false; -}; +function getVisitFn(visitor, kind, isLeaving) { + const { + enter, + leave + } = getEnterLeaveForKind(visitor, kind); + return isLeaving ? leave : enter; +} /***/ }), -/***/ "../../../node_modules/linkify-it/build/index.cjs.js": -/*!***********************************************************!*\ - !*** ../../../node_modules/linkify-it/build/index.cjs.js ***! - \***********************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - - -var uc_micro = __webpack_require__(/*! uc.micro */ "../../../node_modules/uc.micro/build/index.cjs.js"); -function reFactory(opts) { - const re = {}; - opts = opts || {}; - re.src_Any = uc_micro.Any.source; - re.src_Cc = uc_micro.Cc.source; - re.src_Z = uc_micro.Z.source; - re.src_P = uc_micro.P.source; - - // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation) - re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|'); +/***/ "../../../node_modules/graphql/type/assertName.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/type/assertName.mjs ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // \p{\Z\Cc} (white spaces + control) - re.src_ZCc = [re.src_Z, re.src_Cc].join('|'); +"use strict"; - // Experimental. List of chars, completely prohibited in links - // because can separate it from other part of text - const text_separators = '[><\uff5c]'; - // All possible word characters (everything without punctuation, spaces & controls) - // Defined via punctuation & spaces to save space - // Should be something like \p{\L\N\S\M} (\w but without `_`) - re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'; - // The same as abothe but without [0-9] - // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')'; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.assertEnumValueName = assertEnumValueName; +exports.assertName = assertName; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _characterClasses = __webpack_require__(/*! ../language/characterClasses.mjs */ "../../../node_modules/graphql/language/characterClasses.mjs"); +/** + * Upholds the spec rules about naming. + */ - re.src_ip4 = '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; +function assertName(name) { + name != null || (0, _devAssert.devAssert)(false, 'Must provide name.'); + typeof name === 'string' || (0, _devAssert.devAssert)(false, 'Expected name to be a string.'); + if (name.length === 0) { + throw new _GraphQLError.GraphQLError('Expected name to be a non-empty string.'); + } + for (let i = 1; i < name.length; ++i) { + if (!(0, _characterClasses.isNameContinue)(name.charCodeAt(i))) { + throw new _GraphQLError.GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${name}" does not.`); + } + } + if (!(0, _characterClasses.isNameStart)(name.charCodeAt(0))) { + throw new _GraphQLError.GraphQLError(`Names must start with [_a-zA-Z] but "${name}" does not.`); + } + return name; +} +/** + * Upholds the spec rules about naming enum values. + * + * @internal + */ - // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch. - re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?'; - re.src_port = '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'; - re.src_host_terminator = '(?=$|' + text_separators + '|' + re.src_ZPCc + ')' + '(?!' + (opts['---'] ? '-(?!--)|' : '-|') + '_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; - re.src_path = '(?:' + '[/?#]' + '(?:' + '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-;]).|' + '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + - // allow `I'm_king` if no pair found - "\\'(?=" + re.src_pseudo_letter + '|[-])|' + - // google has many dots in "google search" links (#66, #81). - // github has ... in commit range links, - // Restrict to - // - english - // - percent-encoded - // - parts of file path - // - params separator - // until more examples found. - '\\.{2,}[a-zA-Z0-9%/&]|' + '\\.(?!' + re.src_ZCc + '|[.]|$)|' + (opts['---'] ? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate - : '\\-+|') + - // allow `,,,` in paths - ',(?!' + re.src_ZCc + '|$)|' + - // allow `;` if not followed by space-like char - ';(?!' + re.src_ZCc + '|$)|' + - // allow `!!!` in paths, but not at the end - '\\!+(?!' + re.src_ZCc + '|[!]|$)|' + '\\?(?!' + re.src_ZCc + '|[?]|$)' + ')+' + '|\\/' + ')?'; +function assertEnumValueName(name) { + if (name === 'true' || name === 'false' || name === 'null') { + throw new _GraphQLError.GraphQLError(`Enum values cannot be named: ${name}`); + } + return assertName(name); +} - // Allow anything in markdown spec, forbid quote (") at the first position - // because emails enclosed in quotes are far more common - re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; - re.src_xn = 'xn--[a-z0-9\\-]{1,59}'; +/***/ }), - // More to read about domain names - // http://serverfault.com/questions/638260/ +/***/ "../../../node_modules/graphql/type/definition.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/type/definition.mjs ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - re.src_domain_root = - // Allow letters & digits (http://test1) - '(?:' + re.src_xn + '|' + re.src_pseudo_letter + '{1,63}' + ')'; - re.src_domain = '(?:' + re.src_xn + '|' + '(?:' + re.src_pseudo_letter + ')' + '|' + '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' + ')'; - re.src_host = '(?:' + - // Don't need IP check, because digits are already allowed in normal domain names - // src_ip4 + - // '|' + - '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain /* _root */ + ')' + ')'; - re.tpl_host_fuzzy = '(?:' + re.src_ip4 + '|' + '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' + ')'; - re.tpl_host_no_ip_fuzzy = '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))'; - re.src_host_strict = re.src_host + re.src_host_terminator; - re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator; - re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator; - re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator; - re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator; +"use strict"; - // - // Main rules - // - // Rude test fuzzy links by host, for quick deny - re.tpl_host_fuzzy_test = 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'; - re.tpl_email_fuzzy = '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' + '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; - re.tpl_link_fuzzy = - // Fuzzy link can't be prepended with .:/\- and non punctuation. - // but can start with > (markdown blockquote) - '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; - re.tpl_link_no_ip_fuzzy = - // Fuzzy link can't be prepended with .:/\- and non punctuation. - // but can start with > (markdown blockquote) - '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; - return re; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GraphQLUnionType = exports.GraphQLScalarType = exports.GraphQLObjectType = exports.GraphQLNonNull = exports.GraphQLList = exports.GraphQLInterfaceType = exports.GraphQLInputObjectType = exports.GraphQLEnumType = void 0; +exports.argsToArgsConfig = argsToArgsConfig; +exports.assertAbstractType = assertAbstractType; +exports.assertCompositeType = assertCompositeType; +exports.assertEnumType = assertEnumType; +exports.assertInputObjectType = assertInputObjectType; +exports.assertInputType = assertInputType; +exports.assertInterfaceType = assertInterfaceType; +exports.assertLeafType = assertLeafType; +exports.assertListType = assertListType; +exports.assertNamedType = assertNamedType; +exports.assertNonNullType = assertNonNullType; +exports.assertNullableType = assertNullableType; +exports.assertObjectType = assertObjectType; +exports.assertOutputType = assertOutputType; +exports.assertScalarType = assertScalarType; +exports.assertType = assertType; +exports.assertUnionType = assertUnionType; +exports.assertWrappingType = assertWrappingType; +exports.defineArguments = defineArguments; +exports.getNamedType = getNamedType; +exports.getNullableType = getNullableType; +exports.isAbstractType = isAbstractType; +exports.isCompositeType = isCompositeType; +exports.isEnumType = isEnumType; +exports.isInputObjectType = isInputObjectType; +exports.isInputType = isInputType; +exports.isInterfaceType = isInterfaceType; +exports.isLeafType = isLeafType; +exports.isListType = isListType; +exports.isNamedType = isNamedType; +exports.isNonNullType = isNonNullType; +exports.isNullableType = isNullableType; +exports.isObjectType = isObjectType; +exports.isOutputType = isOutputType; +exports.isRequiredArgument = isRequiredArgument; +exports.isRequiredInputField = isRequiredInputField; +exports.isScalarType = isScalarType; +exports.isType = isType; +exports.isUnionType = isUnionType; +exports.isWrappingType = isWrappingType; +exports.resolveObjMapThunk = resolveObjMapThunk; +exports.resolveReadonlyArrayThunk = resolveReadonlyArrayThunk; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _didYouMean = __webpack_require__(/*! ../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); +var _identityFunc = __webpack_require__(/*! ../jsutils/identityFunc.mjs */ "../../../node_modules/graphql/jsutils/identityFunc.mjs"); +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _instanceOf = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); +var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _keyMap = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); +var _keyValMap = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); +var _mapValue = __webpack_require__(/*! ../jsutils/mapValue.mjs */ "../../../node_modules/graphql/jsutils/mapValue.mjs"); +var _suggestionList = __webpack_require__(/*! ../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); +var _toObjMap = __webpack_require__(/*! ../jsutils/toObjMap.mjs */ "../../../node_modules/graphql/jsutils/toObjMap.mjs"); +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _valueFromASTUntyped = __webpack_require__(/*! ../utilities/valueFromASTUntyped.mjs */ "../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs"); +var _assertName = __webpack_require__(/*! ./assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); +function isType(type) { + return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type); } +function assertType(type) { + if (!isType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL type.`); + } + return type; +} +/** + * There are predicates for each kind of GraphQL type. + */ -// -// Helpers -// - -// Merge objects -// -function assign(obj /* from1, from2, from3, ... */) { - const sources = Array.prototype.slice.call(arguments, 1); - sources.forEach(function (source) { - if (!source) { - return; - } - Object.keys(source).forEach(function (key) { - obj[key] = source[key]; - }); - }); - return obj; +function isScalarType(type) { + return (0, _instanceOf.instanceOf)(type, GraphQLScalarType); } -function _class(obj) { - return Object.prototype.toString.call(obj); +function assertScalarType(type) { + if (!isScalarType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Scalar type.`); + } + return type; } -function isString(obj) { - return _class(obj) === '[object String]'; +function isObjectType(type) { + return (0, _instanceOf.instanceOf)(type, GraphQLObjectType); } -function isObject(obj) { - return _class(obj) === '[object Object]'; +function assertObjectType(type) { + if (!isObjectType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Object type.`); + } + return type; } -function isRegExp(obj) { - return _class(obj) === '[object RegExp]'; +function isInterfaceType(type) { + return (0, _instanceOf.instanceOf)(type, GraphQLInterfaceType); } -function isFunction(obj) { - return _class(obj) === '[object Function]'; +function assertInterfaceType(type) { + if (!isInterfaceType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Interface type.`); + } + return type; } -function escapeRE(str) { - return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); +function isUnionType(type) { + return (0, _instanceOf.instanceOf)(type, GraphQLUnionType); } - -// - -const defaultOptions = { - fuzzyLink: true, - fuzzyEmail: true, - fuzzyIP: false -}; -function isOptionsObj(obj) { - return Object.keys(obj || {}).reduce(function (acc, k) { - /* eslint-disable-next-line no-prototype-builtins */ - return acc || defaultOptions.hasOwnProperty(k); - }, false); +function assertUnionType(type) { + if (!isUnionType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Union type.`); + } + return type; } -const defaultSchemas = { - 'http:': { - validate: function (text, pos, self) { - const tail = text.slice(pos); - if (!self.re.http) { - // compile lazily, because "host"-containing variables can change on tlds update. - self.re.http = new RegExp('^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'); - } - if (self.re.http.test(tail)) { - return tail.match(self.re.http)[0].length; - } - return 0; - } - }, - 'https:': 'http:', - 'ftp:': 'http:', - '//': { - validate: function (text, pos, self) { - const tail = text.slice(pos); - if (!self.re.no_http) { - // compile lazily, because "host"-containing variables can change on tlds update. - self.re.no_http = new RegExp('^' + self.re.src_auth + - // Don't allow single-level domains, because of false positives like '//test' - // with code comments - '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' + self.re.src_port + self.re.src_host_terminator + self.re.src_path, 'i'); - } - if (self.re.no_http.test(tail)) { - // should not be `://` & `///`, that protects from errors in protocol name - if (pos >= 3 && text[pos - 3] === ':') { - return 0; - } - if (pos >= 3 && text[pos - 3] === '/') { - return 0; - } - return tail.match(self.re.no_http)[0].length; - } - return 0; - } - }, - 'mailto:': { - validate: function (text, pos, self) { - const tail = text.slice(pos); - if (!self.re.mailto) { - self.re.mailto = new RegExp('^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'); - } - if (self.re.mailto.test(tail)) { - return tail.match(self.re.mailto)[0].length; - } - return 0; - } +function isEnumType(type) { + return (0, _instanceOf.instanceOf)(type, GraphQLEnumType); +} +function assertEnumType(type) { + if (!isEnumType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Enum type.`); } -}; - -// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js) -/* eslint-disable-next-line max-len */ -const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'; - -// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead -const tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|'); -function resetScanCache(self) { - self.__index__ = -1; - self.__text_cache__ = ''; + return type; } -function createValidator(re) { - return function (text, pos) { - const tail = text.slice(pos); - if (re.test(tail)) { - return tail.match(re)[0].length; - } - return 0; - }; +function isInputObjectType(type) { + return (0, _instanceOf.instanceOf)(type, GraphQLInputObjectType); } -function createNormalizer() { - return function (match, self) { - self.normalize(match); - }; +function assertInputObjectType(type) { + if (!isInputObjectType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Input Object type.`); + } + return type; } - -// Schemas compiler. Build regexps. -// -function compile(self) { - // Load & clone RE patterns. - const re = self.re = reFactory(self.__opts__); - - // Define dynamic patterns - const tlds = self.__tlds__.slice(); - self.onCompile(); - if (!self.__tlds_replaced__) { - tlds.push(tlds_2ch_src_re); +function isListType(type) { + return (0, _instanceOf.instanceOf)(type, GraphQLList); +} +function assertListType(type) { + if (!isListType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL List type.`); } - tlds.push(re.src_xn); - re.src_tlds = tlds.join('|'); - function untpl(tpl) { - return tpl.replace('%TLDS%', re.src_tlds); + return type; +} +function isNonNullType(type) { + return (0, _instanceOf.instanceOf)(type, GraphQLNonNull); +} +function assertNonNullType(type) { + if (!isNonNullType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL Non-Null type.`); } - re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i'); - re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i'); - re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i'); - re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i'); - - // - // Compile each schema - // - - const aliases = []; - self.__compiled__ = {}; // Reset compiled data + return type; +} +/** + * These types may be used as input types for arguments and directives. + */ - function schemaError(name, val) { - throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); +function isInputType(type) { + return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType); +} +function assertInputType(type) { + if (!isInputType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL input type.`); } - Object.keys(self.__schemas__).forEach(function (name) { - const val = self.__schemas__[name]; - - // skip disabled methods - if (val === null) { - return; - } - const compiled = { - validate: null, - link: null - }; - self.__compiled__[name] = compiled; - if (isObject(val)) { - if (isRegExp(val.validate)) { - compiled.validate = createValidator(val.validate); - } else if (isFunction(val.validate)) { - compiled.validate = val.validate; - } else { - schemaError(name, val); - } - if (isFunction(val.normalize)) { - compiled.normalize = val.normalize; - } else if (!val.normalize) { - compiled.normalize = createNormalizer(); - } else { - schemaError(name, val); - } - return; - } - if (isString(val)) { - aliases.push(name); - return; - } - schemaError(name, val); - }); - - // - // Compile postponed aliases - // - - aliases.forEach(function (alias) { - if (!self.__compiled__[self.__schemas__[alias]]) { - // Silently fail on missed schemas to avoid errons on disable. - // schemaError(alias, self.__schemas__[alias]); - return; - } - self.__compiled__[alias].validate = self.__compiled__[self.__schemas__[alias]].validate; - self.__compiled__[alias].normalize = self.__compiled__[self.__schemas__[alias]].normalize; - }); - - // - // Fake record for guessed links - // - self.__compiled__[''] = { - validate: null, - normalize: createNormalizer() - }; - - // - // Build schema condition - // - const slist = Object.keys(self.__compiled__).filter(function (name) { - // Filter disabled & fake schemas - return name.length > 0 && self.__compiled__[name]; - }).map(escapeRE).join('|'); - // (?!_) cause 1.5x slowdown - self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); - self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); - self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i'); - self.re.pretest = RegExp('(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', 'i'); - - // - // Cleanup - // - - resetScanCache(self); + return type; } +/** + * These types may be used as output types as the result of fields. + */ +function isOutputType(type) { + return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType); +} +function assertOutputType(type) { + if (!isOutputType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL output type.`); + } + return type; +} /** - * class Match - * - * Match result. Single element of array, returned by [[LinkifyIt#match]] - **/ -function Match(self, shift) { - const start = self.__index__; - const end = self.__last_index__; - const text = self.__text_cache__.slice(start, end); + * These types may describe types which may be leaf values. + */ - /** - * Match#schema -> String - * - * Prefix (protocol) for matched string. - **/ - this.schema = self.__schema__.toLowerCase(); - /** - * Match#index -> Number - * - * First position of matched string. - **/ - this.index = start + shift; - /** - * Match#lastIndex -> Number - * - * Next position after matched string. - **/ - this.lastIndex = end + shift; - /** - * Match#raw -> String - * - * Matched string. - **/ - this.raw = text; - /** - * Match#text -> String - * - * Notmalized text of matched string. - **/ - this.text = text; - /** - * Match#url -> String - * - * Normalized url of matched string. - **/ - this.url = text; +function isLeafType(type) { + return isScalarType(type) || isEnumType(type); } -function createMatch(self, shift) { - const match = new Match(self, shift); - self.__compiled__[match.schema].normalize(match, self); - return match; +function assertLeafType(type) { + if (!isLeafType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL leaf type.`); + } + return type; } +/** + * These types may describe the parent context of a selection set. + */ +function isCompositeType(type) { + return isObjectType(type) || isInterfaceType(type) || isUnionType(type); +} +function assertCompositeType(type) { + if (!isCompositeType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL composite type.`); + } + return type; +} /** - * class LinkifyIt - **/ + * These types may describe the parent context of a selection set. + */ +function isAbstractType(type) { + return isInterfaceType(type) || isUnionType(type); +} +function assertAbstractType(type) { + if (!isAbstractType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL abstract type.`); + } + return type; +} /** - * new LinkifyIt(schemas, options) - * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) - * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } + * List Type Wrapper * - * Creates new linkifier instance with optional additional schemas. - * Can be called without `new` keyword for convenience. + * A list is a wrapping type which points to another type. + * Lists are often created within the context of defining the fields of + * an object type. * - * By default understands: + * Example: * - * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links - * - "fuzzy" links and emails (example.com, foo@bar.com). + * ```ts + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: new GraphQLList(PersonType) }, + * children: { type: new GraphQLList(PersonType) }, + * }) + * }) + * ``` + */ + +class GraphQLList { + constructor(ofType) { + isType(ofType) || (0, _devAssert.devAssert)(false, `Expected ${(0, _inspect.inspect)(ofType)} to be a GraphQL type.`); + this.ofType = ofType; + } + get [Symbol.toStringTag]() { + return 'GraphQLList'; + } + toString() { + return '[' + String(this.ofType) + ']'; + } + toJSON() { + return this.toString(); + } +} +/** + * Non-Null Type Wrapper * - * `schemas` is an object, where each key/value describes protocol/rule: + * A non-null is a wrapping type which points to another type. + * Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. * - * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` - * for example). `linkify-it` makes shure that prefix is not preceeded with - * alphanumeric char and symbols. Only whitespaces and punctuation allowed. - * - __value__ - rule to check tail after link prefix - * - _String_ - just alias to existing rule - * - _Object_ - * - _validate_ - validator function (should return matched length on success), - * or `RegExp`. - * - _normalize_ - optional function to normalize text & url of matched result - * (for example, for @twitter mentions). - * - * `options`: - * - * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`. - * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts - * like version numbers. Default `false`. - * - __fuzzyEmail__ - recognize emails without `mailto:` prefix. + * Example: * - **/ -function LinkifyIt(schemas, options) { - if (!(this instanceof LinkifyIt)) { - return new LinkifyIt(schemas, options); + * ```ts + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: new GraphQLNonNull(GraphQLString) }, + * }) + * }) + * ``` + * Note: the enforcement of non-nullability occurs within the executor. + */ +exports.GraphQLList = GraphQLList; +class GraphQLNonNull { + constructor(ofType) { + isNullableType(ofType) || (0, _devAssert.devAssert)(false, `Expected ${(0, _inspect.inspect)(ofType)} to be a GraphQL nullable type.`); + this.ofType = ofType; } - if (!options) { - if (isOptionsObj(schemas)) { - options = schemas; - schemas = {}; - } + get [Symbol.toStringTag]() { + return 'GraphQLNonNull'; + } + toString() { + return String(this.ofType) + '!'; + } + toJSON() { + return this.toString(); } - this.__opts__ = assign({}, defaultOptions, options); - - // Cache last tested result. Used to skip repeating steps on next `match` call. - this.__index__ = -1; - this.__last_index__ = -1; // Next scan position - this.__schema__ = ''; - this.__text_cache__ = ''; - this.__schemas__ = assign({}, defaultSchemas, schemas); - this.__compiled__ = {}; - this.__tlds__ = tlds_default; - this.__tlds_replaced__ = false; - this.re = {}; - compile(this); } - -/** chainable - * LinkifyIt#add(schema, definition) - * - schema (String): rule name (fixed pattern prefix) - * - definition (String|RegExp|Object): schema definition - * - * Add new rule definition. See constructor description for details. - **/ -LinkifyIt.prototype.add = function add(schema, definition) { - this.__schemas__[schema] = definition; - compile(this); - return this; -}; - -/** chainable - * LinkifyIt#set(options) - * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } - * - * Set recognition options for links without schema. - **/ -LinkifyIt.prototype.set = function set(options) { - this.__opts__ = assign(this.__opts__, options); - return this; -}; - /** - * LinkifyIt#test(text) -> Boolean - * - * Searches linkifiable pattern and returns `true` on success or `false` on fail. - **/ -LinkifyIt.prototype.test = function test(text) { - // Reset scan cache - this.__text_cache__ = text; - this.__index__ = -1; - if (!text.length) { - return false; + * These types wrap and modify other types + */ +exports.GraphQLNonNull = GraphQLNonNull; +function isWrappingType(type) { + return isListType(type) || isNonNullType(type); +} +function assertWrappingType(type) { + if (!isWrappingType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL wrapping type.`); } - let m, ml, me, len, shift, next, re, tld_pos, at_pos; + return type; +} +/** + * These types can all accept null as a value. + */ - // try to scan for link with schema - that's the most simple rule - if (this.re.schema_test.test(text)) { - re = this.re.schema_search; - re.lastIndex = 0; - while ((m = re.exec(text)) !== null) { - len = this.testSchemaAt(text, m[2], re.lastIndex); - if (len) { - this.__schema__ = m[2]; - this.__index__ = m.index + m[1].length; - this.__last_index__ = m.index + m[0].length + len; - break; - } - } +function isNullableType(type) { + return isType(type) && !isNonNullType(type); +} +function assertNullableType(type) { + if (!isNullableType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL nullable type.`); } - if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { - // guess schemaless links - tld_pos = text.search(this.re.host_fuzzy_test); - if (tld_pos >= 0) { - // if tld is located after found link - no need to check fuzzy pattern - if (this.__index__ < 0 || tld_pos < this.__index__) { - if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { - shift = ml.index + ml[1].length; - if (this.__index__ < 0 || shift < this.__index__) { - this.__schema__ = ''; - this.__index__ = shift; - this.__last_index__ = ml.index + ml[0].length; - } - } - } - } + return type; +} +function getNullableType(type) { + if (type) { + return isNonNullType(type) ? type.ofType : type; } - if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { - // guess schemaless emails - at_pos = text.indexOf('@'); - if (at_pos >= 0) { - // We can't skip this check, because this cases are possible: - // 192.168.1.1@gmail.com, my.in@example.com - if ((me = text.match(this.re.email_fuzzy)) !== null) { - shift = me.index + me[1].length; - next = me.index + me[0].length; - if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) { - this.__schema__ = 'mailto:'; - this.__index__ = shift; - this.__last_index__ = next; - } - } +} +/** + * These named types do not include modifiers like List or NonNull. + */ + +function isNamedType(type) { + return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type); +} +function assertNamedType(type) { + if (!isNamedType(type)) { + throw new Error(`Expected ${(0, _inspect.inspect)(type)} to be a GraphQL named type.`); + } + return type; +} +function getNamedType(type) { + if (type) { + let unwrappedType = type; + while (isWrappingType(unwrappedType)) { + unwrappedType = unwrappedType.ofType; } + return unwrappedType; } - return this.__index__ >= 0; -}; - +} /** - * LinkifyIt#pretest(text) -> Boolean - * - * Very quick check, that can give false positives. Returns true if link MAY BE - * can exists. Can be used for speed optimization, when you need to check that - * link NOT exists. - **/ -LinkifyIt.prototype.pretest = function pretest(text) { - return this.re.pretest.test(text); -}; + * Used while defining GraphQL types to allow for circular references in + * otherwise immutable type definitions. + */ +function resolveReadonlyArrayThunk(thunk) { + return typeof thunk === 'function' ? thunk() : thunk; +} +function resolveObjMapThunk(thunk) { + return typeof thunk === 'function' ? thunk() : thunk; +} /** - * LinkifyIt#testSchemaAt(text, name, position) -> Number - * - text (String): text to scan - * - name (String): rule (schema) name - * - position (Number): text offset to check from + * Custom extensions * - * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly - * at given position. Returns length of found pattern (0 on fail). - **/ -LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) { - // If not supported schema check requested - terminate - if (!this.__compiled__[schema.toLowerCase()]) { - return 0; - } - return this.__compiled__[schema.toLowerCase()].validate(text, pos, this); -}; + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ /** - * LinkifyIt#match(text) -> Array|null + * Scalar Type Definition * - * Returns array of found link descriptions or `null` on fail. We strongly - * recommend to use [[LinkifyIt#test]] first, for best speed. + * The leaf values of any request and input values to arguments are + * Scalars (or Enums) and are defined with a name and a series of functions + * used to parse input from ast or variables and to ensure validity. * - * ##### Result match description + * If a type's serialize function returns `null` or does not return a value + * (i.e. it returns `undefined`) then an error will be raised and a `null` + * value will be returned in the response. It is always better to validate * - * - __schema__ - link schema, can be empty for fuzzy links, or `//` for - * protocol-neutral links. - * - __index__ - offset of matched text - * - __lastIndex__ - index of next char after mathch end - * - __raw__ - matched text - * - __text__ - normalized text - * - __url__ - link, generated from matched text - **/ -LinkifyIt.prototype.match = function match(text) { - const result = []; - let shift = 0; - - // Try to take previous element from cache, if .test() called before - if (this.__index__ >= 0 && this.__text_cache__ === text) { - result.push(createMatch(this, shift)); - shift = this.__last_index__; + * Example: + * + * ```ts + * const OddType = new GraphQLScalarType({ + * name: 'Odd', + * serialize(value) { + * if (!Number.isFinite(value)) { + * throw new Error( + * `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`, + * ); + * } + * + * if (value % 2 === 0) { + * throw new Error(`Scalar "Odd" cannot represent "${value}" since it is even.`); + * } + * return value; + * } + * }); + * ``` + */ +class GraphQLScalarType { + constructor(config) { + var _config$parseValue, _config$serialize, _config$parseLiteral, _config$extensionASTN; + const parseValue = (_config$parseValue = config.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.identityFunc; + this.name = (0, _assertName.assertName)(config.name); + this.description = config.description; + this.specifiedByURL = config.specifiedByURL; + this.serialize = (_config$serialize = config.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.identityFunc; + this.parseValue = parseValue; + this.parseLiteral = (_config$parseLiteral = config.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : (node, variables) => parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node, variables)); + this.extensions = (0, _toObjMap.toObjMap)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = (_config$extensionASTN = config.extensionASTNodes) !== null && _config$extensionASTN !== void 0 ? _config$extensionASTN : []; + config.specifiedByURL == null || typeof config.specifiedByURL === 'string' || (0, _devAssert.devAssert)(false, `${this.name} must provide "specifiedByURL" as a string, ` + `but got: ${(0, _inspect.inspect)(config.specifiedByURL)}.`); + config.serialize == null || typeof config.serialize === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`); + if (config.parseLiteral) { + typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide both "parseValue" and "parseLiteral" functions.`); + } } - - // Cut head if cache was used - let tail = shift ? text.slice(shift) : text; - - // Scan string until end reached - while (this.test(tail)) { - result.push(createMatch(this, shift)); - tail = tail.slice(this.__last_index__); - shift += this.__last_index__; + get [Symbol.toStringTag]() { + return 'GraphQLScalarType'; } - if (result.length) { - return result; + toConfig() { + return { + name: this.name, + description: this.description, + specifiedByURL: this.specifiedByURL, + serialize: this.serialize, + parseValue: this.parseValue, + parseLiteral: this.parseLiteral, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes + }; } - return null; -}; + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} /** - * LinkifyIt#matchAtStart(text) -> Match|null + * Object Type Definition * - * Returns fully-formed (not fuzzy) link if it starts at the beginning - * of the string, and null otherwise. - **/ -LinkifyIt.prototype.matchAtStart = function matchAtStart(text) { - // Reset scan cache - this.__text_cache__ = text; - this.__index__ = -1; - if (!text.length) return null; - const m = this.re.schema_at_start.exec(text); - if (!m) return null; - const len = this.testSchemaAt(text, m[2], m[0].length); - if (!len) return null; - this.__schema__ = m[2]; - this.__index__ = m.index + m[1].length; - this.__last_index__ = m.index + m[0].length + len; - return createMatch(this, 0); -}; - -/** chainable - * LinkifyIt#tlds(list [, keepOld]) -> this - * - list (Array): list of tlds - * - keepOld (Boolean): merge with current list if `true` (`false` by default) + * Almost all of the GraphQL types you define will be object types. Object types + * have a name, but most importantly describe their fields. * - * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) - * to avoid false positives. By default this algorythm used: + * Example: * - * - hostname with any 2-letter root zones are ok. - * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф - * are ok. - * - encoded (`xn--...`) root zones are ok. + * ```ts + * const AddressType = new GraphQLObjectType({ + * name: 'Address', + * fields: { + * street: { type: GraphQLString }, + * number: { type: GraphQLInt }, + * formatted: { + * type: GraphQLString, + * resolve(obj) { + * return obj.number + ' ' + obj.street + * } + * } + * } + * }); + * ``` * - * If list is replaced, then exact match for 2-chars root zones will be checked. - **/ -LinkifyIt.prototype.tlds = function tlds(list, keepOld) { - list = Array.isArray(list) ? list : [list]; - if (!keepOld) { - this.__tlds__ = list.slice(); - this.__tlds_replaced__ = true; - compile(this); - return this; - } - this.__tlds__ = this.__tlds__.concat(list).sort().filter(function (el, idx, arr) { - return el !== arr[idx - 1]; - }).reverse(); - compile(this); - return this; -}; - -/** - * LinkifyIt#normalize(match) + * When two types need to refer to each other, or a type needs to refer to + * itself in a field, you can use a function expression (aka a closure or a + * thunk) to supply the fields lazily. * - * Default normalizer (if schema does not define it's own). - **/ -LinkifyIt.prototype.normalize = function normalize(match) { - // Do minimal possible changes by default. Need to collect feedback prior - // to move forward https://github.com/markdown-it/linkify-it/issues/1 - - if (!match.schema) { - match.url = 'http://' + match.url; - } - if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { - match.url = 'mailto:' + match.url; - } -}; - -/** - * LinkifyIt#onCompile() + * Example: * - * Override to modify basic RegExp-s. - **/ -LinkifyIt.prototype.onCompile = function onCompile() {}; -module.exports = LinkifyIt; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/dist/index.cjs.js": -/*!***********************************************************!*\ - !*** ../../../node_modules/markdown-it/dist/index.cjs.js ***! - \***********************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - - -var mdurl = __webpack_require__(/*! mdurl */ "../../../node_modules/mdurl/build/index.cjs.js"); -var ucmicro = __webpack_require__(/*! uc.micro */ "../../../node_modules/uc.micro/build/index.cjs.js"); -var entities = __webpack_require__(/*! entities */ "../../../node_modules/entities/lib/index.js"); -var LinkifyIt = __webpack_require__(/*! linkify-it */ "../../../node_modules/linkify-it/build/index.cjs.js"); -var punycode = __webpack_require__(/*! punycode.js */ "../../../node_modules/punycode.js/punycode.es6.js"); -function _interopNamespaceDefault(e) { - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); + * ```ts + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * name: { type: GraphQLString }, + * bestFriend: { type: PersonType }, + * }) + * }); + * ``` + */ +exports.GraphQLScalarType = GraphQLScalarType; +class GraphQLObjectType { + constructor(config) { + var _config$extensionASTN2; + this.name = (0, _assertName.assertName)(config.name); + this.description = config.description; + this.isTypeOf = config.isTypeOf; + this.extensions = (0, _toObjMap.toObjMap)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = (_config$extensionASTN2 = config.extensionASTNodes) !== null && _config$extensionASTN2 !== void 0 ? _config$extensionASTN2 : []; + this._fields = () => defineFieldMap(config); + this._interfaces = () => defineInterfaces(config); + config.isTypeOf == null || typeof config.isTypeOf === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide "isTypeOf" as a function, ` + `but got: ${(0, _inspect.inspect)(config.isTypeOf)}.`); } - n.default = e; - return Object.freeze(n); -} -var mdurl__namespace = /*#__PURE__*/_interopNamespaceDefault(mdurl); -var ucmicro__namespace = /*#__PURE__*/_interopNamespaceDefault(ucmicro); - -// Utilities -// - -function _class(obj) { - return Object.prototype.toString.call(obj); -} -function isString(obj) { - return _class(obj) === '[object String]'; -} -const _hasOwnProperty = Object.prototype.hasOwnProperty; -function has(object, key) { - return _hasOwnProperty.call(object, key); -} - -// Merge objects -// -function assign(obj /* from1, from2, from3, ... */) { - const sources = Array.prototype.slice.call(arguments, 1); - sources.forEach(function (source) { - if (!source) { - return; + get [Symbol.toStringTag]() { + return 'GraphQLObjectType'; + } + getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); } - if (typeof source !== 'object') { - throw new TypeError(source + 'must be object'); + return this._fields; + } + getInterfaces() { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); } - Object.keys(source).forEach(function (key) { - obj[key] = source[key]; - }); + return this._interfaces; + } + toConfig() { + return { + name: this.name, + description: this.description, + interfaces: this.getInterfaces(), + fields: fieldsToFieldsConfig(this.getFields()), + isTypeOf: this.isTypeOf, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLObjectType = GraphQLObjectType; +function defineInterfaces(config) { + var _config$interfaces; + const interfaces = resolveReadonlyArrayThunk((_config$interfaces = config.interfaces) !== null && _config$interfaces !== void 0 ? _config$interfaces : []); + Array.isArray(interfaces) || (0, _devAssert.devAssert)(false, `${config.name} interfaces must be an Array or a function which returns an Array.`); + return interfaces; +} +function defineFieldMap(config) { + const fieldMap = resolveObjMapThunk(config.fields); + isPlainObj(fieldMap) || (0, _devAssert.devAssert)(false, `${config.name} fields must be an object with field names as keys or a function which returns such an object.`); + return (0, _mapValue.mapValue)(fieldMap, (fieldConfig, fieldName) => { + var _fieldConfig$args; + isPlainObj(fieldConfig) || (0, _devAssert.devAssert)(false, `${config.name}.${fieldName} field config must be an object.`); + fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function' || (0, _devAssert.devAssert)(false, `${config.name}.${fieldName} field resolver must be a function if ` + `provided, but got: ${(0, _inspect.inspect)(fieldConfig.resolve)}.`); + const argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {}; + isPlainObj(argsConfig) || (0, _devAssert.devAssert)(false, `${config.name}.${fieldName} args must be an object with argument names as keys.`); + return { + name: (0, _assertName.assertName)(fieldName), + description: fieldConfig.description, + type: fieldConfig.type, + args: defineArguments(argsConfig), + resolve: fieldConfig.resolve, + subscribe: fieldConfig.subscribe, + deprecationReason: fieldConfig.deprecationReason, + extensions: (0, _toObjMap.toObjMap)(fieldConfig.extensions), + astNode: fieldConfig.astNode + }; }); - return obj; } +function defineArguments(config) { + return Object.entries(config).map(([argName, argConfig]) => ({ + name: (0, _assertName.assertName)(argName), + description: argConfig.description, + type: argConfig.type, + defaultValue: argConfig.defaultValue, + deprecationReason: argConfig.deprecationReason, + extensions: (0, _toObjMap.toObjMap)(argConfig.extensions), + astNode: argConfig.astNode + })); +} +function isPlainObj(obj) { + return (0, _isObjectLike.isObjectLike)(obj) && !Array.isArray(obj); +} +function fieldsToFieldsConfig(fields) { + return (0, _mapValue.mapValue)(fields, field => ({ + description: field.description, + type: field.type, + args: argsToArgsConfig(field.args), + resolve: field.resolve, + subscribe: field.subscribe, + deprecationReason: field.deprecationReason, + extensions: field.extensions, + astNode: field.astNode + })); +} +/** + * @internal + */ -// Remove element from array and put another array at those position. -// Useful for some operations with tokens -function arrayReplaceAt(src, pos, newElements) { - return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); +function argsToArgsConfig(args) { + return (0, _keyValMap.keyValMap)(args, arg => arg.name, arg => ({ + description: arg.description, + type: arg.type, + defaultValue: arg.defaultValue, + deprecationReason: arg.deprecationReason, + extensions: arg.extensions, + astNode: arg.astNode + })); } -function isValidEntityCode(c) { - /* eslint no-bitwise:0 */ - // broken sequence - if (c >= 0xD800 && c <= 0xDFFF) { - return false; - } - // never used - if (c >= 0xFDD0 && c <= 0xFDEF) { - return false; +function isRequiredArgument(arg) { + return isNonNullType(arg.type) && arg.defaultValue === undefined; +} + +/** + * Interface Type Definition + * + * When a field can return one of a heterogeneous set of types, a Interface type + * is used to describe what types are possible, what fields are in common across + * all types, as well as a function to determine which type is actually used + * when the field is resolved. + * + * Example: + * + * ```ts + * const EntityType = new GraphQLInterfaceType({ + * name: 'Entity', + * fields: { + * name: { type: GraphQLString } + * } + * }); + * ``` + */ +class GraphQLInterfaceType { + constructor(config) { + var _config$extensionASTN3; + this.name = (0, _assertName.assertName)(config.name); + this.description = config.description; + this.resolveType = config.resolveType; + this.extensions = (0, _toObjMap.toObjMap)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = (_config$extensionASTN3 = config.extensionASTNodes) !== null && _config$extensionASTN3 !== void 0 ? _config$extensionASTN3 : []; + this._fields = defineFieldMap.bind(undefined, config); + this._interfaces = defineInterfaces.bind(undefined, config); + config.resolveType == null || typeof config.resolveType === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide "resolveType" as a function, ` + `but got: ${(0, _inspect.inspect)(config.resolveType)}.`); } - if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { - return false; + get [Symbol.toStringTag]() { + return 'GraphQLInterfaceType'; } - // control codes - if (c >= 0x00 && c <= 0x08) { - return false; + getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; } - if (c === 0x0B) { - return false; + getInterfaces() { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + return this._interfaces; } - if (c >= 0x0E && c <= 0x1F) { - return false; + toConfig() { + return { + name: this.name, + description: this.description, + interfaces: this.getInterfaces(), + fields: fieldsToFieldsConfig(this.getFields()), + resolveType: this.resolveType, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes + }; } - if (c >= 0x7F && c <= 0x9F) { - return false; + toString() { + return this.name; } - // out of range - if (c > 0x10FFFF) { - return false; + toJSON() { + return this.toString(); } - return true; } -function fromCodePoint(c) { - /* eslint no-bitwise:0 */ - if (c > 0xffff) { - c -= 0x10000; - const surrogate1 = 0xd800 + (c >> 10); - const surrogate2 = 0xdc00 + (c & 0x3ff); - return String.fromCharCode(surrogate1, surrogate2); + +/** + * Union Type Definition + * + * When a field can return one of a heterogeneous set of types, a Union type + * is used to describe what types are possible as well as providing a function + * to determine which type is actually used when the field is resolved. + * + * Example: + * + * ```ts + * const PetType = new GraphQLUnionType({ + * name: 'Pet', + * types: [ DogType, CatType ], + * resolveType(value) { + * if (value instanceof Dog) { + * return DogType; + * } + * if (value instanceof Cat) { + * return CatType; + * } + * } + * }); + * ``` + */ +exports.GraphQLInterfaceType = GraphQLInterfaceType; +class GraphQLUnionType { + constructor(config) { + var _config$extensionASTN4; + this.name = (0, _assertName.assertName)(config.name); + this.description = config.description; + this.resolveType = config.resolveType; + this.extensions = (0, _toObjMap.toObjMap)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = (_config$extensionASTN4 = config.extensionASTNodes) !== null && _config$extensionASTN4 !== void 0 ? _config$extensionASTN4 : []; + this._types = defineTypes.bind(undefined, config); + config.resolveType == null || typeof config.resolveType === 'function' || (0, _devAssert.devAssert)(false, `${this.name} must provide "resolveType" as a function, ` + `but got: ${(0, _inspect.inspect)(config.resolveType)}.`); } - return String.fromCharCode(c); -} -const UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g; -const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; -const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi'); -const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i; -function replaceEntityPattern(match, name) { - if (name.charCodeAt(0) === 0x23 /* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { - const code = name[1].toLowerCase() === 'x' ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10); - if (isValidEntityCode(code)) { - return fromCodePoint(code); + get [Symbol.toStringTag]() { + return 'GraphQLUnionType'; + } + getTypes() { + if (typeof this._types === 'function') { + this._types = this._types(); } - return match; + return this._types; } - const decoded = entities.decodeHTML(match); - if (decoded !== match) { - return decoded; + toConfig() { + return { + name: this.name, + description: this.description, + types: this.getTypes(), + resolveType: this.resolveType, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); } - return match; +} +exports.GraphQLUnionType = GraphQLUnionType; +function defineTypes(config) { + const types = resolveReadonlyArrayThunk(config.types); + Array.isArray(types) || (0, _devAssert.devAssert)(false, `Must provide Array of types or a function which returns such an array for Union ${config.name}.`); + return types; } -/* function replaceEntities(str) { - if (str.indexOf('&') < 0) { return str; } - - return str.replace(ENTITY_RE, replaceEntityPattern); -} */ - -function unescapeMd(str) { - if (str.indexOf('\\') < 0) { - return str; +/** + * Enum Type Definition + * + * Some leaf values of requests and input values are Enums. GraphQL serializes + * Enum values as strings, however internally Enums can be represented by any + * kind of type, often integers. + * + * Example: + * + * ```ts + * const RGBType = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 } + * } + * }); + * ``` + * + * Note: If a value is not provided in a definition, the name of the enum value + * will be used as its internal value. + */ +class GraphQLEnumType { + /* */ + constructor(config) { + var _config$extensionASTN5; + this.name = (0, _assertName.assertName)(config.name); + this.description = config.description; + this.extensions = (0, _toObjMap.toObjMap)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = (_config$extensionASTN5 = config.extensionASTNodes) !== null && _config$extensionASTN5 !== void 0 ? _config$extensionASTN5 : []; + this._values = typeof config.values === 'function' ? config.values : defineEnumValues(this.name, config.values); + this._valueLookup = null; + this._nameLookup = null; } - return str.replace(UNESCAPE_MD_RE, '$1'); -} -function unescapeAll(str) { - if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { - return str; + get [Symbol.toStringTag]() { + return 'GraphQLEnumType'; } - return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) { - if (escaped) { - return escaped; + getValues() { + if (typeof this._values === 'function') { + this._values = defineEnumValues(this.name, this._values()); } - return replaceEntityPattern(match, entity); - }); -} -const HTML_ESCAPE_TEST_RE = /[&<>"]/; -const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; -const HTML_REPLACEMENTS = { - '&': '&', - '<': '<', - '>': '>', - '"': '"' -}; -function replaceUnsafeChar(ch) { - return HTML_REPLACEMENTS[ch]; -} -function escapeHtml(str) { - if (HTML_ESCAPE_TEST_RE.test(str)) { - return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); + return this._values; } - return str; -} -const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; -function escapeRE(str) { - return str.replace(REGEXP_ESCAPE_RE, '\\$&'); -} -function isSpace(code) { - switch (code) { - case 0x09: - case 0x20: - return true; + getValue(name) { + if (this._nameLookup === null) { + this._nameLookup = (0, _keyMap.keyMap)(this.getValues(), value => value.name); + } + return this._nameLookup[name]; } - return false; -} - -// Zs (unicode class) || [\t\f\v\r\n] -function isWhiteSpace(code) { - if (code >= 0x2000 && code <= 0x200A) { - return true; + serialize(outputValue) { + if (this._valueLookup === null) { + this._valueLookup = new Map(this.getValues().map(enumValue => [enumValue.value, enumValue])); + } + const enumValue = this._valueLookup.get(outputValue); + if (enumValue === undefined) { + throw new _GraphQLError.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0, _inspect.inspect)(outputValue)}`); + } + return enumValue.name; } - switch (code) { - case 0x09: // \t - case 0x0A: // \n - case 0x0B: // \v - case 0x0C: // \f - case 0x0D: // \r - case 0x20: - case 0xA0: - case 0x1680: - case 0x202F: - case 0x205F: - case 0x3000: - return true; + parseValue(inputValue) /* T */ + { + if (typeof inputValue !== 'string') { + const valueStr = (0, _inspect.inspect)(inputValue); + throw new _GraphQLError.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${valueStr}.` + didYouMeanEnumValue(this, valueStr)); + } + const enumValue = this.getValue(inputValue); + if (enumValue == null) { + throw new _GraphQLError.GraphQLError(`Value "${inputValue}" does not exist in "${this.name}" enum.` + didYouMeanEnumValue(this, inputValue)); + } + return enumValue.value; + } + parseLiteral(valueNode, _variables) /* T */ + { + // Note: variables will be resolved to a value before calling this function. + if (valueNode.kind !== _kinds.Kind.ENUM) { + const valueStr = (0, _printer.print)(valueNode); + throw new _GraphQLError.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${valueStr}.` + didYouMeanEnumValue(this, valueStr), { + nodes: valueNode + }); + } + const enumValue = this.getValue(valueNode.value); + if (enumValue == null) { + const valueStr = (0, _printer.print)(valueNode); + throw new _GraphQLError.GraphQLError(`Value "${valueStr}" does not exist in "${this.name}" enum.` + didYouMeanEnumValue(this, valueStr), { + nodes: valueNode + }); + } + return enumValue.value; + } + toConfig() { + const values = (0, _keyValMap.keyValMap)(this.getValues(), value => value.name, value => ({ + description: value.description, + value: value.value, + deprecationReason: value.deprecationReason, + extensions: value.extensions, + astNode: value.astNode + })); + return { + name: this.name, + description: this.description, + values, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); } - return false; } - -/* eslint-disable max-len */ - -// Currently without astral characters support. -function isPunctChar(ch) { - return ucmicro__namespace.P.test(ch) || ucmicro__namespace.S.test(ch); +exports.GraphQLEnumType = GraphQLEnumType; +function didYouMeanEnumValue(enumType, unknownValueStr) { + const allNames = enumType.getValues().map(value => value.name); + const suggestedValues = (0, _suggestionList.suggestionList)(unknownValueStr, allNames); + return (0, _didYouMean.didYouMean)('the enum value', suggestedValues); } - -// Markdown ASCII punctuation characters. -// -// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ -// http://spec.commonmark.org/0.15/#ascii-punctuation-character -// -// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. -// -function isMdAsciiPunct(ch) { - switch (ch) { - case 0x21 /* ! */: - case 0x22 /* " */: - case 0x23 /* # */: - case 0x24 /* $ */: - case 0x25 /* % */: - case 0x26 /* & */: - case 0x27 /* ' */: - case 0x28 /* ( */: - case 0x29 /* ) */: - case 0x2A /* * */: - case 0x2B /* + */: - case 0x2C /* , */: - case 0x2D /* - */: - case 0x2E /* . */: - case 0x2F /* / */: - case 0x3A /* : */: - case 0x3B /* ; */: - case 0x3C /* < */: - case 0x3D /* = */: - case 0x3E /* > */: - case 0x3F /* ? */: - case 0x40 /* @ */: - case 0x5B /* [ */: - case 0x5C /* \ */: - case 0x5D /* ] */: - case 0x5E /* ^ */: - case 0x5F /* _ */: - case 0x60 /* ` */: - case 0x7B /* { */: - case 0x7C /* | */: - case 0x7D /* } */: - case 0x7E /* ~ */: - return true; - default: - return false; - } +function defineEnumValues(typeName, valueMap) { + isPlainObj(valueMap) || (0, _devAssert.devAssert)(false, `${typeName} values must be an object with value names as keys.`); + return Object.entries(valueMap).map(([valueName, valueConfig]) => { + isPlainObj(valueConfig) || (0, _devAssert.devAssert)(false, `${typeName}.${valueName} must refer to an object with a "value" key ` + `representing an internal value but got: ${(0, _inspect.inspect)(valueConfig)}.`); + return { + name: (0, _assertName.assertEnumValueName)(valueName), + description: valueConfig.description, + value: valueConfig.value !== undefined ? valueConfig.value : valueName, + deprecationReason: valueConfig.deprecationReason, + extensions: (0, _toObjMap.toObjMap)(valueConfig.extensions), + astNode: valueConfig.astNode + }; + }); } -// Hepler to unify [reference labels]. -// -function normalizeReference(str) { - // Trim and collapse whitespace - // - str = str.trim().replace(/\s+/g, ' '); - - // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug - // fixed in v12 (couldn't find any details). - // - // So treat this one as a special case - // (remove this when node v10 is no longer supported). - // - if ('ẞ'.toLowerCase() === 'Ṿ') { - str = str.replace(/ẞ/g, 'ß'); +/** + * Input Object Type Definition + * + * An input object defines a structured collection of fields which may be + * supplied to a field argument. + * + * Using `NonNull` will ensure that a value must be provided by the query + * + * Example: + * + * ```ts + * const GeoPoint = new GraphQLInputObjectType({ + * name: 'GeoPoint', + * fields: { + * lat: { type: new GraphQLNonNull(GraphQLFloat) }, + * lon: { type: new GraphQLNonNull(GraphQLFloat) }, + * alt: { type: GraphQLFloat, defaultValue: 0 }, + * } + * }); + * ``` + */ +class GraphQLInputObjectType { + constructor(config) { + var _config$extensionASTN6, _config$isOneOf; + this.name = (0, _assertName.assertName)(config.name); + this.description = config.description; + this.extensions = (0, _toObjMap.toObjMap)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = (_config$extensionASTN6 = config.extensionASTNodes) !== null && _config$extensionASTN6 !== void 0 ? _config$extensionASTN6 : []; + this.isOneOf = (_config$isOneOf = config.isOneOf) !== null && _config$isOneOf !== void 0 ? _config$isOneOf : false; + this._fields = defineInputFieldMap.bind(undefined, config); } - - // .toLowerCase().toUpperCase() should get rid of all differences - // between letter variants. - // - // Simple .toLowerCase() doesn't normalize 125 code points correctly, - // and .toUpperCase doesn't normalize 6 of them (list of exceptions: - // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently - // uppercased versions). - // - // Here's an example showing how it happens. Lets take greek letter omega: - // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ) - // - // Unicode entries: - // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8; - // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 - // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 - // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8; - // - // Case-insensitive comparison should treat all of them as equivalent. - // - // But .toLowerCase() doesn't change ϑ (it's already lowercase), - // and .toUpperCase() doesn't change ϴ (already uppercase). - // - // Applying first lower then upper case normalizes any character: - // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398' - // - // Note: this is equivalent to unicode case folding; unicode normalization - // is a different step that is not required here. - // - // Final result should be uppercased, because it's later stored in an object - // (this avoid a conflict with Object.prototype members, - // most notably, `__proto__`) - // - return str.toLowerCase().toUpperCase(); -} - -// Re-export libraries commonly used in both markdown-it and its plugins, -// so plugins won't have to depend on them explicitly, which reduces their -// bundled size (e.g. a browser build). -// -const lib = { - mdurl: mdurl__namespace, - ucmicro: ucmicro__namespace -}; -var utils = /*#__PURE__*/Object.freeze({ - __proto__: null, - arrayReplaceAt: arrayReplaceAt, - assign: assign, - escapeHtml: escapeHtml, - escapeRE: escapeRE, - fromCodePoint: fromCodePoint, - has: has, - isMdAsciiPunct: isMdAsciiPunct, - isPunctChar: isPunctChar, - isSpace: isSpace, - isString: isString, - isValidEntityCode: isValidEntityCode, - isWhiteSpace: isWhiteSpace, - lib: lib, - normalizeReference: normalizeReference, - unescapeAll: unescapeAll, - unescapeMd: unescapeMd -}); - -// Parse link label -// -// this function assumes that first character ("[") already matches; -// returns the end of the label -// - -function parseLinkLabel(state, start, disableNested) { - let level, found, marker, prevPos; - const max = state.posMax; - const oldPos = state.pos; - state.pos = start + 1; - level = 1; - while (state.pos < max) { - marker = state.src.charCodeAt(state.pos); - if (marker === 0x5D /* ] */) { - level--; - if (level === 0) { - found = true; - break; - } - } - prevPos = state.pos; - state.md.inline.skipToken(state); - if (marker === 0x5B /* [ */) { - if (prevPos === state.pos - 1) { - // increase level if we find text `[`, which is not a part of any token - level++; - } else if (disableNested) { - state.pos = oldPos; - return -1; - } + get [Symbol.toStringTag]() { + return 'GraphQLInputObjectType'; + } + getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); } + return this._fields; } - let labelEnd = -1; - if (found) { - labelEnd = state.pos; + toConfig() { + const fields = (0, _mapValue.mapValue)(this.getFields(), field => ({ + description: field.description, + type: field.type, + defaultValue: field.defaultValue, + deprecationReason: field.deprecationReason, + extensions: field.extensions, + astNode: field.astNode + })); + return { + name: this.name, + description: this.description, + fields, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + isOneOf: this.isOneOf + }; } - - // restore old state - state.pos = oldPos; - return labelEnd; + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLInputObjectType = GraphQLInputObjectType; +function defineInputFieldMap(config) { + const fieldMap = resolveObjMapThunk(config.fields); + isPlainObj(fieldMap) || (0, _devAssert.devAssert)(false, `${config.name} fields must be an object with field names as keys or a function which returns such an object.`); + return (0, _mapValue.mapValue)(fieldMap, (fieldConfig, fieldName) => { + !('resolve' in fieldConfig) || (0, _devAssert.devAssert)(false, `${config.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`); + return { + name: (0, _assertName.assertName)(fieldName), + description: fieldConfig.description, + type: fieldConfig.type, + defaultValue: fieldConfig.defaultValue, + deprecationReason: fieldConfig.deprecationReason, + extensions: (0, _toObjMap.toObjMap)(fieldConfig.extensions), + astNode: fieldConfig.astNode + }; + }); +} +function isRequiredInputField(field) { + return isNonNullType(field.type) && field.defaultValue === undefined; } -// Parse link destination -// +/***/ }), -function parseLinkDestination(str, start, max) { - let code; - let pos = start; - const result = { - ok: false, - pos: 0, - str: '' - }; - if (str.charCodeAt(pos) === 0x3C /* < */) { - pos++; - while (pos < max) { - code = str.charCodeAt(pos); - if (code === 0x0A /* \n */) { - return result; - } - if (code === 0x3C /* < */) { - return result; - } - if (code === 0x3E /* > */) { - result.pos = pos + 1; - result.str = unescapeAll(str.slice(start + 1, pos)); - result.ok = true; - return result; - } - if (code === 0x5C /* \ */ && pos + 1 < max) { - pos += 2; - continue; - } - pos++; - } +/***/ "../../../node_modules/graphql/type/directives.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/type/directives.mjs ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // no closing '>' - return result; - } +"use strict"; - // this should be ... } else { ... branch - let level = 0; - while (pos < max) { - code = str.charCodeAt(pos); - if (code === 0x20) { - break; - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GraphQLSpecifiedByDirective = exports.GraphQLSkipDirective = exports.GraphQLOneOfDirective = exports.GraphQLIncludeDirective = exports.GraphQLDirective = exports.GraphQLDeprecatedDirective = exports.DEFAULT_DEPRECATION_REASON = void 0; +exports.assertDirective = assertDirective; +exports.isDirective = isDirective; +exports.isSpecifiedDirective = isSpecifiedDirective; +exports.specifiedDirectives = void 0; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _instanceOf = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); +var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _toObjMap = __webpack_require__(/*! ../jsutils/toObjMap.mjs */ "../../../node_modules/graphql/jsutils/toObjMap.mjs"); +var _directiveLocation = __webpack_require__(/*! ../language/directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); +var _assertName = __webpack_require__(/*! ./assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); +var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _scalars = __webpack_require__(/*! ./scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); +/** + * Test if the given value is a GraphQL directive. + */ - // ascii control characters - if (code < 0x20 || code === 0x7F) { - break; - } - if (code === 0x5C /* \ */ && pos + 1 < max) { - if (str.charCodeAt(pos + 1) === 0x20) { - break; - } - pos += 2; - continue; - } - if (code === 0x28 /* ( */) { - level++; - if (level > 32) { - return result; - } - } - if (code === 0x29 /* ) */) { - if (level === 0) { - break; - } - level--; - } - pos++; +function isDirective(directive) { + return (0, _instanceOf.instanceOf)(directive, GraphQLDirective); +} +function assertDirective(directive) { + if (!isDirective(directive)) { + throw new Error(`Expected ${(0, _inspect.inspect)(directive)} to be a GraphQL directive.`); } - if (start === pos) { - return result; + return directive; +} +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ + +/** + * Directives are used by the GraphQL runtime as a way of modifying execution + * behavior. Type system creators will usually not create these directly. + */ +class GraphQLDirective { + constructor(config) { + var _config$isRepeatable, _config$args; + this.name = (0, _assertName.assertName)(config.name); + this.description = config.description; + this.locations = config.locations; + this.isRepeatable = (_config$isRepeatable = config.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false; + this.extensions = (0, _toObjMap.toObjMap)(config.extensions); + this.astNode = config.astNode; + Array.isArray(config.locations) || (0, _devAssert.devAssert)(false, `@${config.name} locations must be an Array.`); + const args = (_config$args = config.args) !== null && _config$args !== void 0 ? _config$args : {}; + (0, _isObjectLike.isObjectLike)(args) && !Array.isArray(args) || (0, _devAssert.devAssert)(false, `@${config.name} args must be an object with argument names as keys.`); + this.args = (0, _definition.defineArguments)(args); } - if (level !== 0) { - return result; + get [Symbol.toStringTag]() { + return 'GraphQLDirective'; + } + toConfig() { + return { + name: this.name, + description: this.description, + locations: this.locations, + args: (0, _definition.argsToArgsConfig)(this.args), + isRepeatable: this.isRepeatable, + extensions: this.extensions, + astNode: this.astNode + }; + } + toString() { + return '@' + this.name; + } + toJSON() { + return this.toString(); } - result.str = unescapeAll(str.slice(start, pos)); - result.pos = pos; - result.ok = true; - return result; } -// Parse link title -// - -// Parse link title within `str` in [start, max] range, -// or continue previous parsing if `prev_state` is defined (equal to result of last execution). -// -function parseLinkTitle(str, start, max, prev_state) { - let code; - let pos = start; - const state = { - // if `true`, this is a valid link title - ok: false, - // if `true`, this link can be continued on the next line - can_continue: false, - // if `ok`, it's the position of the first character after the closing marker - pos: 0, - // if `ok`, it's the unescaped title - str: '', - // expected closing marker character code - marker: 0 - }; - if (prev_state) { - // this is a continuation of a previous parseLinkTitle call on the next line, - // used in reference links only - state.str = prev_state.str; - state.marker = prev_state.marker; - } else { - if (pos >= max) { - return state; +/** + * Used to conditionally include fields or fragments. + */ +exports.GraphQLDirective = GraphQLDirective; +const GraphQLIncludeDirective = exports.GraphQLIncludeDirective = new GraphQLDirective({ + name: 'include', + description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', + locations: [_directiveLocation.DirectiveLocation.FIELD, _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, _directiveLocation.DirectiveLocation.INLINE_FRAGMENT], + args: { + if: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), + description: 'Included when true.' } - let marker = str.charCodeAt(pos); - if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { - return state; + } +}); +/** + * Used to conditionally skip (exclude) fields or fragments. + */ + +const GraphQLSkipDirective = exports.GraphQLSkipDirective = new GraphQLDirective({ + name: 'skip', + description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', + locations: [_directiveLocation.DirectiveLocation.FIELD, _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, _directiveLocation.DirectiveLocation.INLINE_FRAGMENT], + args: { + if: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), + description: 'Skipped when true.' } - start++; - pos++; + } +}); +/** + * Constant string used for default reason for a deprecation. + */ - // if opening marker is "(", switch it to closing marker ")" - if (marker === 0x28) { - marker = 0x29; +const DEFAULT_DEPRECATION_REASON = exports.DEFAULT_DEPRECATION_REASON = 'No longer supported'; +/** + * Used to declare element of a GraphQL schema as deprecated. + */ + +const GraphQLDeprecatedDirective = exports.GraphQLDeprecatedDirective = new GraphQLDirective({ + name: 'deprecated', + description: 'Marks an element of a GraphQL schema as no longer supported.', + locations: [_directiveLocation.DirectiveLocation.FIELD_DEFINITION, _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION, _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION, _directiveLocation.DirectiveLocation.ENUM_VALUE], + args: { + reason: { + type: _scalars.GraphQLString, + description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', + defaultValue: DEFAULT_DEPRECATION_REASON } - state.marker = marker; } - while (pos < max) { - code = str.charCodeAt(pos); - if (code === state.marker) { - state.pos = pos + 1; - state.str += unescapeAll(str.slice(start, pos)); - state.ok = true; - return state; - } else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) { - return state; - } else if (code === 0x5C /* \ */ && pos + 1 < max) { - pos++; +}); +/** + * Used to provide a URL for specifying the behavior of custom scalar definitions. + */ + +const GraphQLSpecifiedByDirective = exports.GraphQLSpecifiedByDirective = new GraphQLDirective({ + name: 'specifiedBy', + description: 'Exposes a URL that specifies the behavior of this scalar.', + locations: [_directiveLocation.DirectiveLocation.SCALAR], + args: { + url: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLString), + description: 'The URL that specifies the behavior of this scalar.' } - pos++; } +}); +/** + * Used to indicate an Input Object is a OneOf Input Object. + */ - // no closing marker found, but this link title may continue on the next line (for references) - state.can_continue = true; - state.str += unescapeAll(str.slice(start, pos)); - return state; +const GraphQLOneOfDirective = exports.GraphQLOneOfDirective = new GraphQLDirective({ + name: 'oneOf', + description: 'Indicates exactly one field must be supplied and this field must not be `null`.', + locations: [_directiveLocation.DirectiveLocation.INPUT_OBJECT], + args: {} +}); +/** + * The full list of specified directives. + */ + +const specifiedDirectives = exports.specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLOneOfDirective]); +function isSpecifiedDirective(directive) { + return specifiedDirectives.some(({ + name + }) => name === directive.name); } -// Just a shortcut for bulk export +/***/ }), -var helpers = /*#__PURE__*/Object.freeze({ - __proto__: null, - parseLinkDestination: parseLinkDestination, - parseLinkLabel: parseLinkLabel, - parseLinkTitle: parseLinkTitle -}); +/***/ "../../../node_modules/graphql/type/index.mjs": +/*!****************************************************!*\ + !*** ../../../node_modules/graphql/type/index.mjs ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -/** - * class Renderer - * - * Generates HTML from parsed token stream. Each instance has independent - * copy of rules. Those can be rewritten with ease. Also, you can add new - * rules if you create plugin and adds new token types. - **/ +"use strict"; -const default_rules = {}; -default_rules.code_inline = function (tokens, idx, options, env, slf) { - const token = tokens[idx]; - return '' + escapeHtml(token.content) + ''; -}; -default_rules.code_block = function (tokens, idx, options, env, slf) { - const token = tokens[idx]; - return '' + escapeHtml(tokens[idx].content) + '\n'; -}; -default_rules.fence = function (tokens, idx, options, env, slf) { - const token = tokens[idx]; - const info = token.info ? unescapeAll(token.info).trim() : ''; - let langName = ''; - let langAttrs = ''; - if (info) { - const arr = info.split(/(\s+)/g); - langName = arr[0]; - langAttrs = arr.slice(2).join(''); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "DEFAULT_DEPRECATION_REASON", ({ + enumerable: true, + get: function () { + return _directives.DEFAULT_DEPRECATION_REASON; } - let highlighted; - if (options.highlight) { - highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content); - } else { - highlighted = escapeHtml(token.content); +})); +Object.defineProperty(exports, "GRAPHQL_MAX_INT", ({ + enumerable: true, + get: function () { + return _scalars.GRAPHQL_MAX_INT; } - if (highlighted.indexOf('${highlighted}\n`; +})); +Object.defineProperty(exports, "GraphQLBoolean", ({ + enumerable: true, + get: function () { + return _scalars.GraphQLBoolean; } - return `
${highlighted}
\n`; -}; -default_rules.image = function (tokens, idx, options, env, slf) { - const token = tokens[idx]; - - // "alt" attr MUST be set, even if empty. Because it's mandatory and - // should be placed on proper position for tests. - // - // Replace content with actual value - - token.attrs[token.attrIndex('alt')][1] = slf.renderInlineAsText(token.children, options, env); - return slf.renderToken(tokens, idx, options); -}; -default_rules.hardbreak = function (tokens, idx, options /*, env */) { - return options.xhtmlOut ? '
\n' : '
\n'; -}; -default_rules.softbreak = function (tokens, idx, options /*, env */) { - return options.breaks ? options.xhtmlOut ? '
\n' : '
\n' : '\n'; -}; -default_rules.text = function (tokens, idx /*, options, env */) { - return escapeHtml(tokens[idx].content); -}; -default_rules.html_block = function (tokens, idx /*, options, env */) { - return tokens[idx].content; -}; -default_rules.html_inline = function (tokens, idx /*, options, env */) { - return tokens[idx].content; -}; - -/** - * new Renderer() - * - * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults. - **/ -function Renderer() { - /** - * Renderer#rules -> Object - * - * Contains render rules for tokens. Can be updated and extended. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.renderer.rules.strong_open = function () { return ''; }; - * md.renderer.rules.strong_close = function () { return ''; }; - * - * var result = md.renderInline(...); - * ``` - * - * Each rule is called as independent static function with fixed signature: - * - * ```javascript - * function my_token_render(tokens, idx, options, env, renderer) { - * // ... - * return renderedHTML; - * } - * ``` - * - * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs) - * for more details and examples. - **/ - this.rules = assign({}, default_rules); -} - -/** - * Renderer.renderAttrs(token) -> String - * - * Render token attributes to string. - **/ -Renderer.prototype.renderAttrs = function renderAttrs(token) { - let i, l, result; - if (!token.attrs) { - return ''; +})); +Object.defineProperty(exports, "GraphQLDeprecatedDirective", ({ + enumerable: true, + get: function () { + return _directives.GraphQLDeprecatedDirective; } - result = ''; - for (i = 0, l = token.attrs.length; i < l; i++) { - result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"'; +})); +Object.defineProperty(exports, "GraphQLDirective", ({ + enumerable: true, + get: function () { + return _directives.GraphQLDirective; } - return result; -}; - -/** - * Renderer.renderToken(tokens, idx, options) -> String - * - tokens (Array): list of tokens - * - idx (Numbed): token index to render - * - options (Object): params of parser instance - * - * Default token renderer. Can be overriden by custom function - * in [[Renderer#rules]]. - **/ -Renderer.prototype.renderToken = function renderToken(tokens, idx, options) { - const token = tokens[idx]; - let result = ''; - - // Tight list paragraphs - if (token.hidden) { - return ''; +})); +Object.defineProperty(exports, "GraphQLEnumType", ({ + enumerable: true, + get: function () { + return _definition.GraphQLEnumType; } - - // Insert a newline between hidden paragraph and subsequent opening - // block-level tag. - // - // For example, here we should insert a newline before blockquote: - // - a - // > - // - if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) { - result += '\n'; +})); +Object.defineProperty(exports, "GraphQLFloat", ({ + enumerable: true, + get: function () { + return _scalars.GraphQLFloat; } - - // Add token name, e.g. ``. - // - needLf = false; - } - } - } +})); +Object.defineProperty(exports, "GraphQLIncludeDirective", ({ + enumerable: true, + get: function () { + return _directives.GraphQLIncludeDirective; } - result += needLf ? '>\n' : '>'; - return result; -}; - -/** - * Renderer.renderInline(tokens, options, env) -> String - * - tokens (Array): list on block tokens to render - * - options (Object): params of parser instance - * - env (Object): additional data from parsed input (references, for example) - * - * The same as [[Renderer.render]], but for single token of `inline` type. - **/ -Renderer.prototype.renderInline = function (tokens, options, env) { - let result = ''; - const rules = this.rules; - for (let i = 0, len = tokens.length; i < len; i++) { - const type = tokens[i].type; - if (typeof rules[type] !== 'undefined') { - result += rules[type](tokens, i, options, env, this); - } else { - result += this.renderToken(tokens, i, options); - } +})); +Object.defineProperty(exports, "GraphQLInputObjectType", ({ + enumerable: true, + get: function () { + return _definition.GraphQLInputObjectType; } - return result; -}; - -/** internal - * Renderer.renderInlineAsText(tokens, options, env) -> String - * - tokens (Array): list on block tokens to render - * - options (Object): params of parser instance - * - env (Object): additional data from parsed input (references, for example) - * - * Special kludge for image `alt` attributes to conform CommonMark spec. - * Don't try to use it! Spec requires to show `alt` content with stripped markup, - * instead of simple escaping. - **/ -Renderer.prototype.renderInlineAsText = function (tokens, options, env) { - let result = ''; - for (let i = 0, len = tokens.length; i < len; i++) { - switch (tokens[i].type) { - case 'text': - result += tokens[i].content; - break; - case 'image': - result += this.renderInlineAsText(tokens[i].children, options, env); - break; - case 'html_inline': - case 'html_block': - result += tokens[i].content; - break; - case 'softbreak': - case 'hardbreak': - result += '\n'; - break; - // all other tokens are skipped - } +})); +Object.defineProperty(exports, "GraphQLInt", ({ + enumerable: true, + get: function () { + return _scalars.GraphQLInt; } - return result; -}; - -/** - * Renderer.render(tokens, options, env) -> String - * - tokens (Array): list on block tokens to render - * - options (Object): params of parser instance - * - env (Object): additional data from parsed input (references, for example) - * - * Takes token stream and generates HTML. Probably, you will never need to call - * this method directly. - **/ -Renderer.prototype.render = function (tokens, options, env) { - let result = ''; - const rules = this.rules; - for (let i = 0, len = tokens.length; i < len; i++) { - const type = tokens[i].type; - if (type === 'inline') { - result += this.renderInline(tokens[i].children, options, env); - } else if (typeof rules[type] !== 'undefined') { - result += rules[type](tokens, i, options, env, this); - } else { - result += this.renderToken(tokens, i, options, env); - } +})); +Object.defineProperty(exports, "GraphQLInterfaceType", ({ + enumerable: true, + get: function () { + return _definition.GraphQLInterfaceType; } - return result; -}; - -/** - * class Ruler - * - * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and - * [[MarkdownIt#inline]] to manage sequences of functions (rules): - * - * - keep rules in defined order - * - assign the name to each rule - * - enable/disable rules - * - add/replace rules - * - allow assign rules to additional named chains (in the same) - * - cacheing lists of active rules - * - * You will not need use this class directly until write plugins. For simple - * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and - * [[MarkdownIt.use]]. - **/ - -/** - * new Ruler() - **/ -function Ruler() { - // List of added rules. Each element is: - // - // { - // name: XXX, - // enabled: Boolean, - // fn: Function(), - // alt: [ name2, name3 ] - // } - // - this.__rules__ = []; - - // Cached rule chains. - // - // First level - chain name, '' for default. - // Second level - diginal anchor for fast filtering by charcodes. - // - this.__cache__ = null; -} - -// Helper methods, should not be used directly - -// Find rule index by name -// -Ruler.prototype.__find__ = function (name) { - for (let i = 0; i < this.__rules__.length; i++) { - if (this.__rules__[i].name === name) { - return i; - } +})); +Object.defineProperty(exports, "GraphQLList", ({ + enumerable: true, + get: function () { + return _definition.GraphQLList; } - return -1; -}; - -// Build rules lookup cache -// -Ruler.prototype.__compile__ = function () { - const self = this; - const chains = ['']; - - // collect unique names - self.__rules__.forEach(function (rule) { - if (!rule.enabled) { - return; - } - rule.alt.forEach(function (altName) { - if (chains.indexOf(altName) < 0) { - chains.push(altName); - } - }); - }); - self.__cache__ = {}; - chains.forEach(function (chain) { - self.__cache__[chain] = []; - self.__rules__.forEach(function (rule) { - if (!rule.enabled) { - return; - } - if (chain && rule.alt.indexOf(chain) < 0) { - return; - } - self.__cache__[chain].push(rule.fn); - }); - }); -}; - -/** - * Ruler.at(name, fn [, options]) - * - name (String): rule name to replace. - * - fn (Function): new rule function. - * - options (Object): new rule options (not mandatory). - * - * Replace rule by name with new function & options. Throws error if name not - * found. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * Replace existing typographer replacement rule with new one: - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.core.ruler.at('replacements', function replace(state) { - * //... - * }); - * ``` - **/ -Ruler.prototype.at = function (name, fn, options) { - const index = this.__find__(name); - const opt = options || {}; - if (index === -1) { - throw new Error('Parser rule not found: ' + name); +})); +Object.defineProperty(exports, "GraphQLNonNull", ({ + enumerable: true, + get: function () { + return _definition.GraphQLNonNull; } - this.__rules__[index].fn = fn; - this.__rules__[index].alt = opt.alt || []; - this.__cache__ = null; -}; - -/** - * Ruler.before(beforeName, ruleName, fn [, options]) - * - beforeName (String): new rule will be added before this one. - * - ruleName (String): name of added rule. - * - fn (Function): rule function. - * - options (Object): rule options (not mandatory). - * - * Add new rule to chain before one with given name. See also - * [[Ruler.after]], [[Ruler.push]]. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.block.ruler.before('paragraph', 'my_rule', function replace(state) { - * //... - * }); - * ``` - **/ -Ruler.prototype.before = function (beforeName, ruleName, fn, options) { - const index = this.__find__(beforeName); - const opt = options || {}; - if (index === -1) { - throw new Error('Parser rule not found: ' + beforeName); +})); +Object.defineProperty(exports, "GraphQLObjectType", ({ + enumerable: true, + get: function () { + return _definition.GraphQLObjectType; } - this.__rules__.splice(index, 0, { - name: ruleName, - enabled: true, - fn, - alt: opt.alt || [] - }); - this.__cache__ = null; -}; - -/** - * Ruler.after(afterName, ruleName, fn [, options]) - * - afterName (String): new rule will be added after this one. - * - ruleName (String): name of added rule. - * - fn (Function): rule function. - * - options (Object): rule options (not mandatory). - * - * Add new rule to chain after one with given name. See also - * [[Ruler.before]], [[Ruler.push]]. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.inline.ruler.after('text', 'my_rule', function replace(state) { - * //... - * }); - * ``` - **/ -Ruler.prototype.after = function (afterName, ruleName, fn, options) { - const index = this.__find__(afterName); - const opt = options || {}; - if (index === -1) { - throw new Error('Parser rule not found: ' + afterName); +})); +Object.defineProperty(exports, "GraphQLOneOfDirective", ({ + enumerable: true, + get: function () { + return _directives.GraphQLOneOfDirective; } - this.__rules__.splice(index + 1, 0, { - name: ruleName, - enabled: true, - fn, - alt: opt.alt || [] - }); - this.__cache__ = null; -}; - -/** - * Ruler.push(ruleName, fn [, options]) - * - ruleName (String): name of added rule. - * - fn (Function): rule function. - * - options (Object): rule options (not mandatory). - * - * Push new rule to the end of chain. See also - * [[Ruler.before]], [[Ruler.after]]. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.core.ruler.push('my_rule', function replace(state) { - * //... - * }); - * ``` - **/ -Ruler.prototype.push = function (ruleName, fn, options) { - const opt = options || {}; - this.__rules__.push({ - name: ruleName, - enabled: true, - fn, - alt: opt.alt || [] - }); - this.__cache__ = null; -}; - -/** - * Ruler.enable(list [, ignoreInvalid]) -> Array - * - list (String|Array): list of rule names to enable. - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * Enable rules with given names. If any rule name not found - throw Error. - * Errors can be disabled by second param. - * - * Returns list of found rule names (if no exception happened). - * - * See also [[Ruler.disable]], [[Ruler.enableOnly]]. - **/ -Ruler.prototype.enable = function (list, ignoreInvalid) { - if (!Array.isArray(list)) { - list = [list]; +})); +Object.defineProperty(exports, "GraphQLScalarType", ({ + enumerable: true, + get: function () { + return _definition.GraphQLScalarType; } - const result = []; - - // Search by name and enable - list.forEach(function (name) { - const idx = this.__find__(name); - if (idx < 0) { - if (ignoreInvalid) { - return; - } - throw new Error('Rules manager: invalid rule name ' + name); - } - this.__rules__[idx].enabled = true; - result.push(name); - }, this); - this.__cache__ = null; - return result; -}; - -/** - * Ruler.enableOnly(list [, ignoreInvalid]) - * - list (String|Array): list of rule names to enable (whitelist). - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * Enable rules with given names, and disable everything else. If any rule name - * not found - throw Error. Errors can be disabled by second param. - * - * See also [[Ruler.disable]], [[Ruler.enable]]. - **/ -Ruler.prototype.enableOnly = function (list, ignoreInvalid) { - if (!Array.isArray(list)) { - list = [list]; +})); +Object.defineProperty(exports, "GraphQLSchema", ({ + enumerable: true, + get: function () { + return _schema.GraphQLSchema; } - this.__rules__.forEach(function (rule) { - rule.enabled = false; - }); - this.enable(list, ignoreInvalid); -}; - -/** - * Ruler.disable(list [, ignoreInvalid]) -> Array - * - list (String|Array): list of rule names to disable. - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * Disable rules with given names. If any rule name not found - throw Error. - * Errors can be disabled by second param. - * - * Returns list of found rule names (if no exception happened). - * - * See also [[Ruler.enable]], [[Ruler.enableOnly]]. - **/ -Ruler.prototype.disable = function (list, ignoreInvalid) { - if (!Array.isArray(list)) { - list = [list]; +})); +Object.defineProperty(exports, "GraphQLSkipDirective", ({ + enumerable: true, + get: function () { + return _directives.GraphQLSkipDirective; } - const result = []; - - // Search by name and disable - list.forEach(function (name) { - const idx = this.__find__(name); - if (idx < 0) { - if (ignoreInvalid) { - return; - } - throw new Error('Rules manager: invalid rule name ' + name); - } - this.__rules__[idx].enabled = false; - result.push(name); - }, this); - this.__cache__ = null; - return result; -}; - -/** - * Ruler.getRules(chainName) -> Array - * - * Return array of active functions (rules) for given chain name. It analyzes - * rules configuration, compiles caches if not exists and returns result. - * - * Default chain name is `''` (empty string). It can't be skipped. That's - * done intentionally, to keep signature monomorphic for high speed. - **/ -Ruler.prototype.getRules = function (chainName) { - if (this.__cache__ === null) { - this.__compile__(); +})); +Object.defineProperty(exports, "GraphQLSpecifiedByDirective", ({ + enumerable: true, + get: function () { + return _directives.GraphQLSpecifiedByDirective; } - - // Chain can be empty, if rules disabled. But we still have to return Array. - return this.__cache__[chainName] || []; -}; - -// Token class - -/** - * class Token - **/ - -/** - * new Token(type, tag, nesting) - * - * Create new token and fill passed properties. - **/ -function Token(type, tag, nesting) { - /** - * Token#type -> String - * - * Type of the token (string, e.g. "paragraph_open") - **/ - this.type = type; - - /** - * Token#tag -> String - * - * html tag name, e.g. "p" - **/ - this.tag = tag; - - /** - * Token#attrs -> Array - * - * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` - **/ - this.attrs = null; - - /** - * Token#map -> Array - * - * Source map info. Format: `[ line_begin, line_end ]` - **/ - this.map = null; - - /** - * Token#nesting -> Number - * - * Level change (number in {-1, 0, 1} set), where: - * - * - `1` means the tag is opening - * - `0` means the tag is self-closing - * - `-1` means the tag is closing - **/ - this.nesting = nesting; - - /** - * Token#level -> Number - * - * nesting level, the same as `state.level` - **/ - this.level = 0; - - /** - * Token#children -> Array - * - * An array of child nodes (inline and img tokens) - **/ - this.children = null; - - /** - * Token#content -> String - * - * In a case of self-closing tag (code, html, fence, etc.), - * it has contents of this tag. - **/ - this.content = ''; - - /** - * Token#markup -> String - * - * '*' or '_' for emphasis, fence string for fence, etc. - **/ - this.markup = ''; - - /** - * Token#info -> String - * - * Additional information: - * - * - Info string for "fence" tokens - * - The value "auto" for autolink "link_open" and "link_close" tokens - * - The string value of the item marker for ordered-list "list_item_open" tokens - **/ - this.info = ''; - - /** - * Token#meta -> Object - * - * A place for plugins to store an arbitrary data - **/ - this.meta = null; - - /** - * Token#block -> Boolean - * - * True for block-level tokens, false for inline tokens. - * Used in renderer to calculate line breaks - **/ - this.block = false; - - /** - * Token#hidden -> Boolean - * - * If it's true, ignore this element when rendering. Used for tight lists - * to hide paragraphs. - **/ - this.hidden = false; -} - -/** - * Token.attrIndex(name) -> Number - * - * Search attribute index by name. - **/ -Token.prototype.attrIndex = function attrIndex(name) { - if (!this.attrs) { - return -1; +})); +Object.defineProperty(exports, "GraphQLString", ({ + enumerable: true, + get: function () { + return _scalars.GraphQLString; } - const attrs = this.attrs; - for (let i = 0, len = attrs.length; i < len; i++) { - if (attrs[i][0] === name) { - return i; - } +})); +Object.defineProperty(exports, "GraphQLUnionType", ({ + enumerable: true, + get: function () { + return _definition.GraphQLUnionType; } - return -1; -}; - -/** - * Token.attrPush(attrData) - * - * Add `[ name, value ]` attribute to list. Init attrs if necessary - **/ -Token.prototype.attrPush = function attrPush(attrData) { - if (this.attrs) { - this.attrs.push(attrData); - } else { - this.attrs = [attrData]; +})); +Object.defineProperty(exports, "SchemaMetaFieldDef", ({ + enumerable: true, + get: function () { + return _introspection.SchemaMetaFieldDef; } -}; - -/** - * Token.attrSet(name, value) - * - * Set `name` attribute to `value`. Override old value if exists. - **/ -Token.prototype.attrSet = function attrSet(name, value) { - const idx = this.attrIndex(name); - const attrData = [name, value]; - if (idx < 0) { - this.attrPush(attrData); - } else { - this.attrs[idx] = attrData; +})); +Object.defineProperty(exports, "TypeKind", ({ + enumerable: true, + get: function () { + return _introspection.TypeKind; } -}; - -/** - * Token.attrGet(name) - * - * Get the value of attribute `name`, or null if it does not exist. - **/ -Token.prototype.attrGet = function attrGet(name) { - const idx = this.attrIndex(name); - let value = null; - if (idx >= 0) { - value = this.attrs[idx][1]; +})); +Object.defineProperty(exports, "TypeMetaFieldDef", ({ + enumerable: true, + get: function () { + return _introspection.TypeMetaFieldDef; } - return value; -}; - -/** - * Token.attrJoin(name, value) - * - * Join value to existing attribute via space. Or create new attribute if not - * exists. Useful to operate with token classes. - **/ -Token.prototype.attrJoin = function attrJoin(name, value) { - const idx = this.attrIndex(name); - if (idx < 0) { - this.attrPush([name, value]); - } else { - this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value; +})); +Object.defineProperty(exports, "TypeNameMetaFieldDef", ({ + enumerable: true, + get: function () { + return _introspection.TypeNameMetaFieldDef; } -}; - -// Core state object -// - -function StateCore(src, md, env) { - this.src = src; - this.env = env; - this.tokens = []; - this.inlineMode = false; - this.md = md; // link to parser instance -} - -// re-export Token class to use in core rules -StateCore.prototype.Token = Token; - -// Normalize input string - -// https://spec.commonmark.org/0.29/#line-ending -const NEWLINES_RE = /\r\n?|\n/g; -const NULL_RE = /\0/g; -function normalize(state) { - let str; - - // Normalize newlines - str = state.src.replace(NEWLINES_RE, '\n'); - - // Replace NULL characters - str = str.replace(NULL_RE, '\uFFFD'); - state.src = str; -} -function block(state) { - let token; - if (state.inlineMode) { - token = new state.Token('inline', '', 0); - token.content = state.src; - token.map = [0, 1]; - token.children = []; - state.tokens.push(token); - } else { - state.md.block.parse(state.src, state.md, state.env, state.tokens); +})); +Object.defineProperty(exports, "__Directive", ({ + enumerable: true, + get: function () { + return _introspection.__Directive; } -} -function inline(state) { - const tokens = state.tokens; - - // Parse inlines - for (let i = 0, l = tokens.length; i < l; i++) { - const tok = tokens[i]; - if (tok.type === 'inline') { - state.md.inline.parse(tok.content, state.md, state.env, tok.children); - } +})); +Object.defineProperty(exports, "__DirectiveLocation", ({ + enumerable: true, + get: function () { + return _introspection.__DirectiveLocation; } -} - -// Replace link-like texts with link nodes. -// -// Currently restricted by `md.validateLink()` to http/https/ftp -// - -function isLinkOpen$1(str) { - return /^\s]/i.test(str); -} -function isLinkClose$1(str) { - return /^<\/a\s*>/i.test(str); -} -function linkify$1(state) { - const blockTokens = state.tokens; - if (!state.md.options.linkify) { - return; +})); +Object.defineProperty(exports, "__EnumValue", ({ + enumerable: true, + get: function () { + return _introspection.__EnumValue; } - for (let j = 0, l = blockTokens.length; j < l; j++) { - if (blockTokens[j].type !== 'inline' || !state.md.linkify.pretest(blockTokens[j].content)) { - continue; - } - let tokens = blockTokens[j].children; - let htmlLinkLevel = 0; - - // We scan from the end, to keep position when new tags added. - // Use reversed logic in links start/end match - for (let i = tokens.length - 1; i >= 0; i--) { - const currentToken = tokens[i]; - - // Skip content of markdown links - if (currentToken.type === 'link_close') { - i--; - while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') { - i--; - } - continue; - } - - // Skip content of html tag links - if (currentToken.type === 'html_inline') { - if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) { - htmlLinkLevel--; - } - if (isLinkClose$1(currentToken.content)) { - htmlLinkLevel++; - } - } - if (htmlLinkLevel > 0) { - continue; - } - if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) { - const text = currentToken.content; - let links = state.md.linkify.match(text); - - // Now split string to nodes - const nodes = []; - let level = currentToken.level; - let lastPos = 0; - - // forbid escape sequence at the start of the string, - // this avoids http\://example.com/ from being linkified as - // http://example.com/ - if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === 'text_special') { - links = links.slice(1); - } - for (let ln = 0; ln < links.length; ln++) { - const url = links[ln].url; - const fullUrl = state.md.normalizeLink(url); - if (!state.md.validateLink(fullUrl)) { - continue; - } - let urlText = links[ln].text; - - // Linkifier might send raw hostnames like "example.com", where url - // starts with domain name. So we prepend http:// in those cases, - // and remove it afterwards. - // - if (!links[ln].schema) { - urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, ''); - } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) { - urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, ''); - } else { - urlText = state.md.normalizeLinkText(urlText); - } - const pos = links[ln].index; - if (pos > lastPos) { - const token = new state.Token('text', '', 0); - token.content = text.slice(lastPos, pos); - token.level = level; - nodes.push(token); - } - const token_o = new state.Token('link_open', 'a', 1); - token_o.attrs = [['href', fullUrl]]; - token_o.level = level++; - token_o.markup = 'linkify'; - token_o.info = 'auto'; - nodes.push(token_o); - const token_t = new state.Token('text', '', 0); - token_t.content = urlText; - token_t.level = level; - nodes.push(token_t); - const token_c = new state.Token('link_close', 'a', -1); - token_c.level = --level; - token_c.markup = 'linkify'; - token_c.info = 'auto'; - nodes.push(token_c); - lastPos = links[ln].lastIndex; - } - if (lastPos < text.length) { - const token = new state.Token('text', '', 0); - token.content = text.slice(lastPos); - token.level = level; - nodes.push(token); - } - - // replace current node - blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes); - } - } +})); +Object.defineProperty(exports, "__Field", ({ + enumerable: true, + get: function () { + return _introspection.__Field; } -} - -// Simple typographic replacements -// -// (c) (C) → © -// (tm) (TM) → ™ -// (r) (R) → ® -// +- → ± -// ... → … (also ?.... → ?.., !.... → !..) -// ???????? → ???, !!!!! → !!!, `,,` → `,` -// -- → –, --- → — -// - -// TODO: -// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾ -// - multiplications 2 x 4 -> 2 × 4 - -const RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/; - -// Workaround for phantomjs - need regex without /g flag, -// or root check will fail every second time -const SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i; -const SCOPED_ABBR_RE = /\((c|tm|r)\)/ig; -const SCOPED_ABBR = { - c: '©', - r: '®', - tm: '™' -}; -function replaceFn(match, name) { - return SCOPED_ABBR[name.toLowerCase()]; -} -function replace_scoped(inlineTokens) { - let inside_autolink = 0; - for (let i = inlineTokens.length - 1; i >= 0; i--) { - const token = inlineTokens[i]; - if (token.type === 'text' && !inside_autolink) { - token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn); - } - if (token.type === 'link_open' && token.info === 'auto') { - inside_autolink--; - } - if (token.type === 'link_close' && token.info === 'auto') { - inside_autolink++; - } +})); +Object.defineProperty(exports, "__InputValue", ({ + enumerable: true, + get: function () { + return _introspection.__InputValue; } -} -function replace_rare(inlineTokens) { - let inside_autolink = 0; - for (let i = inlineTokens.length - 1; i >= 0; i--) { - const token = inlineTokens[i]; - if (token.type === 'text' && !inside_autolink) { - if (RARE_RE.test(token.content)) { - token.content = token.content.replace(/\+-/g, '±') - // .., ..., ....... -> … - // but ?..... & !..... -> ?.. & !.. - .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..').replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',') - // em-dash - .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\u2014') - // en-dash - .replace(/(^|\s)--(?=\s|$)/mg, '$1\u2013').replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, '$1\u2013'); - } - } - if (token.type === 'link_open' && token.info === 'auto') { - inside_autolink--; - } - if (token.type === 'link_close' && token.info === 'auto') { - inside_autolink++; - } +})); +Object.defineProperty(exports, "__Schema", ({ + enumerable: true, + get: function () { + return _introspection.__Schema; } -} -function replace(state) { - let blkIdx; - if (!state.md.options.typographer) { - return; +})); +Object.defineProperty(exports, "__Type", ({ + enumerable: true, + get: function () { + return _introspection.__Type; } - for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { - if (state.tokens[blkIdx].type !== 'inline') { - continue; - } - if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) { - replace_scoped(state.tokens[blkIdx].children); - } - if (RARE_RE.test(state.tokens[blkIdx].content)) { - replace_rare(state.tokens[blkIdx].children); - } +})); +Object.defineProperty(exports, "__TypeKind", ({ + enumerable: true, + get: function () { + return _introspection.__TypeKind; } -} - -// Convert straight quotation marks to typographic ones -// - -const QUOTE_TEST_RE = /['"]/; -const QUOTE_RE = /['"]/g; -const APOSTROPHE = '\u2019'; /* ’ */ - -function replaceAt(str, index, ch) { - return str.slice(0, index) + ch + str.slice(index + 1); -} -function process_inlines(tokens, state) { - let j; - const stack = []; - for (let i = 0; i < tokens.length; i++) { - const token = tokens[i]; - const thisLevel = tokens[i].level; - for (j = stack.length - 1; j >= 0; j--) { - if (stack[j].level <= thisLevel) { - break; - } - } - stack.length = j + 1; - if (token.type !== 'text') { - continue; - } - let text = token.content; - let pos = 0; - let max = text.length; - - /* eslint no-labels:0,block-scoped-var:0 */ - OUTER: while (pos < max) { - QUOTE_RE.lastIndex = pos; - const t = QUOTE_RE.exec(text); - if (!t) { - break; - } - let canOpen = true; - let canClose = true; - pos = t.index + 1; - const isSingle = t[0] === "'"; - - // Find previous character, - // default to space if it's the beginning of the line - // - let lastChar = 0x20; - if (t.index - 1 >= 0) { - lastChar = text.charCodeAt(t.index - 1); - } else { - for (j = i - 1; j >= 0; j--) { - if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20 - if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' - - lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1); - break; - } - } - - // Find next character, - // default to space if it's the end of the line - // - let nextChar = 0x20; - if (pos < max) { - nextChar = text.charCodeAt(pos); - } else { - for (j = i + 1; j < tokens.length; j++) { - if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20 - if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' - - nextChar = tokens[j].content.charCodeAt(0); - break; - } - } - const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); - const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); - const isLastWhiteSpace = isWhiteSpace(lastChar); - const isNextWhiteSpace = isWhiteSpace(nextChar); - if (isNextWhiteSpace) { - canOpen = false; - } else if (isNextPunctChar) { - if (!(isLastWhiteSpace || isLastPunctChar)) { - canOpen = false; - } - } - if (isLastWhiteSpace) { - canClose = false; - } else if (isLastPunctChar) { - if (!(isNextWhiteSpace || isNextPunctChar)) { - canClose = false; - } - } - if (nextChar === 0x22 /* " */ && t[0] === '"') { - if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) { - // special case: 1"" - count first quote as an inch - canClose = canOpen = false; - } - } - if (canOpen && canClose) { - // Replace quotes in the middle of punctuation sequence, but not - // in the middle of the words, i.e.: - // - // 1. foo " bar " baz - not replaced - // 2. foo-"-bar-"-baz - replaced - // 3. foo"bar"baz - not replaced - // - canOpen = isLastPunctChar; - canClose = isNextPunctChar; - } - if (!canOpen && !canClose) { - // middle of word - if (isSingle) { - token.content = replaceAt(token.content, t.index, APOSTROPHE); - } - continue; - } - if (canClose) { - // this could be a closing quote, rewind the stack to get a match - for (j = stack.length - 1; j >= 0; j--) { - let item = stack[j]; - if (stack[j].level < thisLevel) { - break; - } - if (item.single === isSingle && stack[j].level === thisLevel) { - item = stack[j]; - let openQuote; - let closeQuote; - if (isSingle) { - openQuote = state.md.options.quotes[2]; - closeQuote = state.md.options.quotes[3]; - } else { - openQuote = state.md.options.quotes[0]; - closeQuote = state.md.options.quotes[1]; - } - - // replace token.content *before* tokens[item.token].content, - // because, if they are pointing at the same token, replaceAt - // could mess up indices when quote length != 1 - token.content = replaceAt(token.content, t.index, closeQuote); - tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote); - pos += closeQuote.length - 1; - if (item.token === i) { - pos += openQuote.length - 1; - } - text = token.content; - max = text.length; - stack.length = j; - continue OUTER; - } - } - } - if (canOpen) { - stack.push({ - token: i, - pos: t.index, - single: isSingle, - level: thisLevel - }); - } else if (canClose && isSingle) { - token.content = replaceAt(token.content, t.index, APOSTROPHE); - } - } +})); +Object.defineProperty(exports, "assertAbstractType", ({ + enumerable: true, + get: function () { + return _definition.assertAbstractType; } -} -function smartquotes(state) { - /* eslint max-depth:0 */ - if (!state.md.options.typographer) { - return; +})); +Object.defineProperty(exports, "assertCompositeType", ({ + enumerable: true, + get: function () { + return _definition.assertCompositeType; } - for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { - if (state.tokens[blkIdx].type !== 'inline' || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) { - continue; - } - process_inlines(state.tokens[blkIdx].children, state); +})); +Object.defineProperty(exports, "assertDirective", ({ + enumerable: true, + get: function () { + return _directives.assertDirective; } -} - -// Join raw text tokens with the rest of the text -// -// This is set as a separate rule to provide an opportunity for plugins -// to run text replacements after text join, but before escape join. -// -// For example, `\:)` shouldn't be replaced with an emoji. -// - -function text_join(state) { - let curr, last; - const blockTokens = state.tokens; - const l = blockTokens.length; - for (let j = 0; j < l; j++) { - if (blockTokens[j].type !== 'inline') continue; - const tokens = blockTokens[j].children; - const max = tokens.length; - for (curr = 0; curr < max; curr++) { - if (tokens[curr].type === 'text_special') { - tokens[curr].type = 'text'; - } - } - for (curr = last = 0; curr < max; curr++) { - if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { - // collapse two adjacent text nodes - tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; - } else { - if (curr !== last) { - tokens[last] = tokens[curr]; - } - last++; - } - } - if (curr !== last) { - tokens.length = last; - } +})); +Object.defineProperty(exports, "assertEnumType", ({ + enumerable: true, + get: function () { + return _definition.assertEnumType; } -} - -/** internal - * class Core - * - * Top-level rules executor. Glues block/inline parsers and does intermediate - * transformations. - **/ - -const _rules$2 = [['normalize', normalize], ['block', block], ['inline', inline], ['linkify', linkify$1], ['replacements', replace], ['smartquotes', smartquotes], -// `text_join` finds `text_special` tokens (for escape sequences) -// and joins them with the rest of the text -['text_join', text_join]]; - -/** - * new Core() - **/ -function Core() { - /** - * Core#ruler -> Ruler - * - * [[Ruler]] instance. Keep configuration of core rules. - **/ - this.ruler = new Ruler(); - for (let i = 0; i < _rules$2.length; i++) { - this.ruler.push(_rules$2[i][0], _rules$2[i][1]); +})); +Object.defineProperty(exports, "assertEnumValueName", ({ + enumerable: true, + get: function () { + return _assertName.assertEnumValueName; } -} - -/** - * Core.process(state) - * - * Executes core chain rules. - **/ -Core.prototype.process = function (state) { - const rules = this.ruler.getRules(''); - for (let i = 0, l = rules.length; i < l; i++) { - rules[i](state); +})); +Object.defineProperty(exports, "assertInputObjectType", ({ + enumerable: true, + get: function () { + return _definition.assertInputObjectType; } -}; -Core.prototype.State = StateCore; - -// Parser state class - -function StateBlock(src, md, env, tokens) { - this.src = src; - - // link to parser instance - this.md = md; - this.env = env; - - // - // Internal state vartiables - // - - this.tokens = tokens; - this.bMarks = []; // line begin offsets for fast jumps - this.eMarks = []; // line end offsets for fast jumps - this.tShift = []; // offsets of the first non-space characters (tabs not expanded) - this.sCount = []; // indents for each line (tabs expanded) - - // An amount of virtual spaces (tabs expanded) between beginning - // of each line (bMarks) and real beginning of that line. - // - // It exists only as a hack because blockquotes override bMarks - // losing information in the process. - // - // It's used only when expanding tabs, you can think about it as - // an initial tab length, e.g. bsCount=21 applied to string `\t123` - // means first tab should be expanded to 4-21%4 === 3 spaces. - // - this.bsCount = []; - - // block parser variables - - // required block content indent (for example, if we are - // inside a list, it would be positioned after list marker) - this.blkIndent = 0; - this.line = 0; // line index in src - this.lineMax = 0; // lines count - this.tight = false; // loose/tight mode for lists - this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any) - this.listIndent = -1; // indent of the current list block (-1 if there isn't any) - - // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' - // used in lists to determine if they interrupt a paragraph - this.parentType = 'root'; - this.level = 0; - - // Create caches - // Generate markers. - const s = this.src; - for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) { - const ch = s.charCodeAt(pos); - if (!indent_found) { - if (isSpace(ch)) { - indent++; - if (ch === 0x09) { - offset += 4 - offset % 4; - } else { - offset++; - } - continue; - } else { - indent_found = true; - } - } - if (ch === 0x0A || pos === len - 1) { - if (ch !== 0x0A) { - pos++; - } - this.bMarks.push(start); - this.eMarks.push(pos); - this.tShift.push(indent); - this.sCount.push(offset); - this.bsCount.push(0); - indent_found = false; - indent = 0; - offset = 0; - start = pos + 1; - } +})); +Object.defineProperty(exports, "assertInputType", ({ + enumerable: true, + get: function () { + return _definition.assertInputType; } - - // Push fake entry to simplify cache bounds checks - this.bMarks.push(s.length); - this.eMarks.push(s.length); - this.tShift.push(0); - this.sCount.push(0); - this.bsCount.push(0); - this.lineMax = this.bMarks.length - 1; // don't count last fake line -} - -// Push new token to "stream". -// -StateBlock.prototype.push = function (type, tag, nesting) { - const token = new Token(type, tag, nesting); - token.block = true; - if (nesting < 0) this.level--; // closing tag - token.level = this.level; - if (nesting > 0) this.level++; // opening tag - - this.tokens.push(token); - return token; -}; -StateBlock.prototype.isEmpty = function isEmpty(line) { - return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]; -}; -StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) { - for (let max = this.lineMax; from < max; from++) { - if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { - break; - } +})); +Object.defineProperty(exports, "assertInterfaceType", ({ + enumerable: true, + get: function () { + return _definition.assertInterfaceType; } - return from; -}; - -// Skip spaces from given position. -StateBlock.prototype.skipSpaces = function skipSpaces(pos) { - for (let max = this.src.length; pos < max; pos++) { - const ch = this.src.charCodeAt(pos); - if (!isSpace(ch)) { - break; - } +})); +Object.defineProperty(exports, "assertLeafType", ({ + enumerable: true, + get: function () { + return _definition.assertLeafType; } - return pos; -}; - -// Skip spaces from given position in reverse. -StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) { - if (pos <= min) { - return pos; +})); +Object.defineProperty(exports, "assertListType", ({ + enumerable: true, + get: function () { + return _definition.assertListType; } - while (pos > min) { - if (!isSpace(this.src.charCodeAt(--pos))) { - return pos + 1; - } +})); +Object.defineProperty(exports, "assertName", ({ + enumerable: true, + get: function () { + return _assertName.assertName; } - return pos; -}; - -// Skip char codes from given position -StateBlock.prototype.skipChars = function skipChars(pos, code) { - for (let max = this.src.length; pos < max; pos++) { - if (this.src.charCodeAt(pos) !== code) { - break; - } +})); +Object.defineProperty(exports, "assertNamedType", ({ + enumerable: true, + get: function () { + return _definition.assertNamedType; } - return pos; -}; - -// Skip char codes reverse from given position - 1 -StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) { - if (pos <= min) { - return pos; +})); +Object.defineProperty(exports, "assertNonNullType", ({ + enumerable: true, + get: function () { + return _definition.assertNonNullType; } - while (pos > min) { - if (code !== this.src.charCodeAt(--pos)) { - return pos + 1; - } +})); +Object.defineProperty(exports, "assertNullableType", ({ + enumerable: true, + get: function () { + return _definition.assertNullableType; } - return pos; -}; - -// cut lines range from source. -StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) { - if (begin >= end) { - return ''; +})); +Object.defineProperty(exports, "assertObjectType", ({ + enumerable: true, + get: function () { + return _definition.assertObjectType; } - const queue = new Array(end - begin); - for (let i = 0, line = begin; line < end; line++, i++) { - let lineIndent = 0; - const lineStart = this.bMarks[line]; - let first = lineStart; - let last; - if (line + 1 < end || keepLastLF) { - // No need for bounds check because we have fake entry on tail. - last = this.eMarks[line] + 1; - } else { - last = this.eMarks[line]; - } - while (first < last && lineIndent < indent) { - const ch = this.src.charCodeAt(first); - if (isSpace(ch)) { - if (ch === 0x09) { - lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4; - } else { - lineIndent++; - } - } else if (first - lineStart < this.tShift[line]) { - // patched tShift masked characters to look like spaces (blockquotes, list markers) - lineIndent++; - } else { - break; - } - first++; - } - if (lineIndent > indent) { - // partially expanding tabs in code blocks, e.g '\t\tfoobar' - // with indent=2 becomes ' \tfoobar' - queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last); - } else { - queue[i] = this.src.slice(first, last); - } +})); +Object.defineProperty(exports, "assertOutputType", ({ + enumerable: true, + get: function () { + return _definition.assertOutputType; } - return queue.join(''); -}; - -// re-export Token class to use in block rules -StateBlock.prototype.Token = Token; - -// GFM table, https://github.github.com/gfm/#tables-extension- - -// Limit the amount of empty autocompleted cells in a table, -// see https://github.com/markdown-it/markdown-it/issues/1000, -// -// Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k. -// We set it to 65k, which can expand user input by a factor of x370 -// (256x256 square is 1.8kB expanded into 650kB). -const MAX_AUTOCOMPLETED_CELLS = 0x10000; -function getLine(state, line) { - const pos = state.bMarks[line] + state.tShift[line]; - const max = state.eMarks[line]; - return state.src.slice(pos, max); -} -function escapedSplit(str) { - const result = []; - const max = str.length; - let pos = 0; - let ch = str.charCodeAt(pos); - let isEscaped = false; - let lastPos = 0; - let current = ''; - while (pos < max) { - if (ch === 0x7c /* | */) { - if (!isEscaped) { - // pipe separating cells, '|' - result.push(current + str.substring(lastPos, pos)); - current = ''; - lastPos = pos + 1; - } else { - // escaped pipe, '\|' - current += str.substring(lastPos, pos - 1); - lastPos = pos; - } - } - isEscaped = ch === 0x5c /* \ */; - pos++; - ch = str.charCodeAt(pos); +})); +Object.defineProperty(exports, "assertScalarType", ({ + enumerable: true, + get: function () { + return _definition.assertScalarType; } - result.push(current + str.substring(lastPos)); - return result; -} -function table(state, startLine, endLine, silent) { - // should have at least two lines - if (startLine + 2 > endLine) { - return false; +})); +Object.defineProperty(exports, "assertSchema", ({ + enumerable: true, + get: function () { + return _schema.assertSchema; } - let nextLine = startLine + 1; - if (state.sCount[nextLine] < state.blkIndent) { - return false; +})); +Object.defineProperty(exports, "assertType", ({ + enumerable: true, + get: function () { + return _definition.assertType; } - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[nextLine] - state.blkIndent >= 4) { - return false; +})); +Object.defineProperty(exports, "assertUnionType", ({ + enumerable: true, + get: function () { + return _definition.assertUnionType; } - - // first character of the second line should be '|', '-', ':', - // and no other characters are allowed but spaces; - // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp - - let pos = state.bMarks[nextLine] + state.tShift[nextLine]; - if (pos >= state.eMarks[nextLine]) { - return false; +})); +Object.defineProperty(exports, "assertValidSchema", ({ + enumerable: true, + get: function () { + return _validate.assertValidSchema; } - const firstCh = state.src.charCodeAt(pos++); - if (firstCh !== 0x7C /* | */ && firstCh !== 0x2D /* - */ && firstCh !== 0x3A /* : */) { - return false; +})); +Object.defineProperty(exports, "assertWrappingType", ({ + enumerable: true, + get: function () { + return _definition.assertWrappingType; } - if (pos >= state.eMarks[nextLine]) { - return false; +})); +Object.defineProperty(exports, "getNamedType", ({ + enumerable: true, + get: function () { + return _definition.getNamedType; } - const secondCh = state.src.charCodeAt(pos++); - if (secondCh !== 0x7C /* | */ && secondCh !== 0x2D /* - */ && secondCh !== 0x3A /* : */ && !isSpace(secondCh)) { - return false; +})); +Object.defineProperty(exports, "getNullableType", ({ + enumerable: true, + get: function () { + return _definition.getNullableType; } - - // if first character is '-', then second character must not be a space - // (due to parsing ambiguity with list) - if (firstCh === 0x2D /* - */ && isSpace(secondCh)) { - return false; +})); +Object.defineProperty(exports, "introspectionTypes", ({ + enumerable: true, + get: function () { + return _introspection.introspectionTypes; } - while (pos < state.eMarks[nextLine]) { - const ch = state.src.charCodeAt(pos); - if (ch !== 0x7C /* | */ && ch !== 0x2D /* - */ && ch !== 0x3A /* : */ && !isSpace(ch)) { - return false; - } - pos++; +})); +Object.defineProperty(exports, "isAbstractType", ({ + enumerable: true, + get: function () { + return _definition.isAbstractType; } - let lineText = getLine(state, startLine + 1); - let columns = lineText.split('|'); - const aligns = []; - for (let i = 0; i < columns.length; i++) { - const t = columns[i].trim(); - if (!t) { - // allow empty columns before and after table, but not in between columns; - // e.g. allow ` |---| `, disallow ` ---||--- ` - if (i === 0 || i === columns.length - 1) { - continue; - } else { - return false; - } - } - if (!/^:?-+:?$/.test(t)) { - return false; - } - if (t.charCodeAt(t.length - 1) === 0x3A /* : */) { - aligns.push(t.charCodeAt(0) === 0x3A /* : */ ? 'center' : 'right'); - } else if (t.charCodeAt(0) === 0x3A /* : */) { - aligns.push('left'); - } else { - aligns.push(''); - } +})); +Object.defineProperty(exports, "isCompositeType", ({ + enumerable: true, + get: function () { + return _definition.isCompositeType; } - lineText = getLine(state, startLine).trim(); - if (lineText.indexOf('|') === -1) { - return false; +})); +Object.defineProperty(exports, "isDirective", ({ + enumerable: true, + get: function () { + return _directives.isDirective; } - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; +})); +Object.defineProperty(exports, "isEnumType", ({ + enumerable: true, + get: function () { + return _definition.isEnumType; } - columns = escapedSplit(lineText); - if (columns.length && columns[0] === '') columns.shift(); - if (columns.length && columns[columns.length - 1] === '') columns.pop(); - - // header row will define an amount of columns in the entire table, - // and align row should be exactly the same (the rest of the rows can differ) - const columnCount = columns.length; - if (columnCount === 0 || columnCount !== aligns.length) { - return false; +})); +Object.defineProperty(exports, "isInputObjectType", ({ + enumerable: true, + get: function () { + return _definition.isInputObjectType; } - if (silent) { - return true; +})); +Object.defineProperty(exports, "isInputType", ({ + enumerable: true, + get: function () { + return _definition.isInputType; } - const oldParentType = state.parentType; - state.parentType = 'table'; - - // use 'blockquote' lists for termination because it's - // the most similar to tables - const terminatorRules = state.md.block.ruler.getRules('blockquote'); - const token_to = state.push('table_open', 'table', 1); - const tableLines = [startLine, 0]; - token_to.map = tableLines; - const token_tho = state.push('thead_open', 'thead', 1); - token_tho.map = [startLine, startLine + 1]; - const token_htro = state.push('tr_open', 'tr', 1); - token_htro.map = [startLine, startLine + 1]; - for (let i = 0; i < columns.length; i++) { - const token_ho = state.push('th_open', 'th', 1); - if (aligns[i]) { - token_ho.attrs = [['style', 'text-align:' + aligns[i]]]; - } - const token_il = state.push('inline', '', 0); - token_il.content = columns[i].trim(); - token_il.children = []; - state.push('th_close', 'th', -1); +})); +Object.defineProperty(exports, "isInterfaceType", ({ + enumerable: true, + get: function () { + return _definition.isInterfaceType; } - state.push('tr_close', 'tr', -1); - state.push('thead_close', 'thead', -1); - let tbodyLines; - let autocompletedCells = 0; - for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { - if (state.sCount[nextLine] < state.blkIndent) { - break; - } - let terminate = false; - for (let i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - lineText = getLine(state, nextLine).trim(); - if (!lineText) { - break; - } - if (state.sCount[nextLine] - state.blkIndent >= 4) { - break; - } - columns = escapedSplit(lineText); - if (columns.length && columns[0] === '') columns.shift(); - if (columns.length && columns[columns.length - 1] === '') columns.pop(); - - // note: autocomplete count can be negative if user specifies more columns than header, - // but that does not affect intended use (which is limiting expansion) - autocompletedCells += columnCount - columns.length; - if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) { - break; - } - if (nextLine === startLine + 2) { - const token_tbo = state.push('tbody_open', 'tbody', 1); - token_tbo.map = tbodyLines = [startLine + 2, 0]; - } - const token_tro = state.push('tr_open', 'tr', 1); - token_tro.map = [nextLine, nextLine + 1]; - for (let i = 0; i < columnCount; i++) { - const token_tdo = state.push('td_open', 'td', 1); - if (aligns[i]) { - token_tdo.attrs = [['style', 'text-align:' + aligns[i]]]; - } - const token_il = state.push('inline', '', 0); - token_il.content = columns[i] ? columns[i].trim() : ''; - token_il.children = []; - state.push('td_close', 'td', -1); - } - state.push('tr_close', 'tr', -1); +})); +Object.defineProperty(exports, "isIntrospectionType", ({ + enumerable: true, + get: function () { + return _introspection.isIntrospectionType; } - if (tbodyLines) { - state.push('tbody_close', 'tbody', -1); - tbodyLines[1] = nextLine; +})); +Object.defineProperty(exports, "isLeafType", ({ + enumerable: true, + get: function () { + return _definition.isLeafType; } - state.push('table_close', 'table', -1); - tableLines[1] = nextLine; - state.parentType = oldParentType; - state.line = nextLine; - return true; -} - -// Code block (4 spaces padded) - -function code(state, startLine, endLine /*, silent */) { - if (state.sCount[startLine] - state.blkIndent < 4) { - return false; +})); +Object.defineProperty(exports, "isListType", ({ + enumerable: true, + get: function () { + return _definition.isListType; } - let nextLine = startLine + 1; - let last = nextLine; - while (nextLine < endLine) { - if (state.isEmpty(nextLine)) { - nextLine++; - continue; - } - if (state.sCount[nextLine] - state.blkIndent >= 4) { - nextLine++; - last = nextLine; - continue; - } - break; +})); +Object.defineProperty(exports, "isNamedType", ({ + enumerable: true, + get: function () { + return _definition.isNamedType; } - state.line = last; - const token = state.push('code_block', 'code', 0); - token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n'; - token.map = [startLine, state.line]; - return true; -} - -// fences (``` lang, ~~~ lang) - -function fence(state, startLine, endLine, silent) { - let pos = state.bMarks[startLine] + state.tShift[startLine]; - let max = state.eMarks[startLine]; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - if (pos + 3 > max) { - return false; +})); +Object.defineProperty(exports, "isNonNullType", ({ + enumerable: true, + get: function () { + return _definition.isNonNullType; } - const marker = state.src.charCodeAt(pos); - if (marker !== 0x7E /* ~ */ && marker !== 0x60 /* ` */) { - return false; +})); +Object.defineProperty(exports, "isNullableType", ({ + enumerable: true, + get: function () { + return _definition.isNullableType; } - - // scan marker length - let mem = pos; - pos = state.skipChars(pos, marker); - let len = pos - mem; - if (len < 3) { - return false; +})); +Object.defineProperty(exports, "isObjectType", ({ + enumerable: true, + get: function () { + return _definition.isObjectType; } - const markup = state.src.slice(mem, pos); - const params = state.src.slice(pos, max); - if (marker === 0x60 /* ` */) { - if (params.indexOf(String.fromCharCode(marker)) >= 0) { - return false; - } +})); +Object.defineProperty(exports, "isOutputType", ({ + enumerable: true, + get: function () { + return _definition.isOutputType; } - - // Since start is found, we can report success here in validation mode - if (silent) { - return true; +})); +Object.defineProperty(exports, "isRequiredArgument", ({ + enumerable: true, + get: function () { + return _definition.isRequiredArgument; } - - // search end of block - let nextLine = startLine; - let haveEndMarker = false; - for (;;) { - nextLine++; - if (nextLine >= endLine) { - // unclosed block should be autoclosed by end of document. - // also block seems to be autoclosed by end of parent - break; - } - pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]; - max = state.eMarks[nextLine]; - if (pos < max && state.sCount[nextLine] < state.blkIndent) { - // non-empty line with negative indent should stop the list: - // - ``` - // test - break; - } - if (state.src.charCodeAt(pos) !== marker) { - continue; - } - if (state.sCount[nextLine] - state.blkIndent >= 4) { - // closing fence should be indented less than 4 spaces - continue; - } - pos = state.skipChars(pos, marker); - - // closing code fence must be at least as long as the opening one - if (pos - mem < len) { - continue; - } - - // make sure tail has spaces only - pos = state.skipSpaces(pos); - if (pos < max) { - continue; - } - haveEndMarker = true; - // found! - break; +})); +Object.defineProperty(exports, "isRequiredInputField", ({ + enumerable: true, + get: function () { + return _definition.isRequiredInputField; } - - // If a fence has heading spaces, they should be removed from its inner block - len = state.sCount[startLine]; - state.line = nextLine + (haveEndMarker ? 1 : 0); - const token = state.push('fence', 'code', 0); - token.info = params; - token.content = state.getLines(startLine + 1, nextLine, len, true); - token.markup = markup; - token.map = [startLine, state.line]; - return true; -} - -// Block quotes - -function blockquote(state, startLine, endLine, silent) { - let pos = state.bMarks[startLine] + state.tShift[startLine]; - let max = state.eMarks[startLine]; - const oldLineMax = state.lineMax; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; +})); +Object.defineProperty(exports, "isScalarType", ({ + enumerable: true, + get: function () { + return _definition.isScalarType; } - - // check the block quote marker - if (state.src.charCodeAt(pos) !== 0x3E /* > */) { - return false; +})); +Object.defineProperty(exports, "isSchema", ({ + enumerable: true, + get: function () { + return _schema.isSchema; } - - // we know that it's going to be a valid blockquote, - // so no point trying to find the end of it in silent mode - if (silent) { - return true; +})); +Object.defineProperty(exports, "isSpecifiedDirective", ({ + enumerable: true, + get: function () { + return _directives.isSpecifiedDirective; } - const oldBMarks = []; - const oldBSCount = []; - const oldSCount = []; - const oldTShift = []; - const terminatorRules = state.md.block.ruler.getRules('blockquote'); - const oldParentType = state.parentType; - state.parentType = 'blockquote'; - let lastLineEmpty = false; - let nextLine; - - // Search the end of the block - // - // Block ends with either: - // 1. an empty line outside: - // ``` - // > test - // - // ``` - // 2. an empty line inside: - // ``` - // > - // test - // ``` - // 3. another tag: - // ``` - // > test - // - - - - // ``` - for (nextLine = startLine; nextLine < endLine; nextLine++) { - // check if it's outdented, i.e. it's inside list item and indented - // less than said list item: - // - // ``` - // 1. anything - // > current blockquote - // 2. checking this line - // ``` - const isOutdented = state.sCount[nextLine] < state.blkIndent; - pos = state.bMarks[nextLine] + state.tShift[nextLine]; - max = state.eMarks[nextLine]; - if (pos >= max) { - // Case 1: line is not inside the blockquote, and this line is empty. - break; - } - if (state.src.charCodeAt(pos++) === 0x3E /* > */ && !isOutdented) { - // This line is inside the blockquote. - - // set offset past spaces and ">" - let initial = state.sCount[nextLine] + 1; - let spaceAfterMarker; - let adjustTab; - - // skip one optional space after '>' - if (state.src.charCodeAt(pos) === 0x20 /* space */) { - // ' > test ' - // ^ -- position start of line here: - pos++; - initial++; - adjustTab = false; - spaceAfterMarker = true; - } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { - spaceAfterMarker = true; - if ((state.bsCount[nextLine] + initial) % 4 === 3) { - // ' >\t test ' - // ^ -- position start of line here (tab has width===1) - pos++; - initial++; - adjustTab = false; - } else { - // ' >\t test ' - // ^ -- position start of line here + shift bsCount slightly - // to make extra space appear - adjustTab = true; - } - } else { - spaceAfterMarker = false; - } - let offset = initial; - oldBMarks.push(state.bMarks[nextLine]); - state.bMarks[nextLine] = pos; - while (pos < max) { - const ch = state.src.charCodeAt(pos); - if (isSpace(ch)) { - if (ch === 0x09) { - offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4; - } else { - offset++; - } - } else { - break; - } - pos++; - } - lastLineEmpty = pos >= max; - oldBSCount.push(state.bsCount[nextLine]); - state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0); - oldSCount.push(state.sCount[nextLine]); - state.sCount[nextLine] = offset - initial; - oldTShift.push(state.tShift[nextLine]); - state.tShift[nextLine] = pos - state.bMarks[nextLine]; - continue; - } - - // Case 2: line is not inside the blockquote, and the last line was empty. - if (lastLineEmpty) { - break; - } - - // Case 3: another tag found. - let terminate = false; - for (let i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - // Quirk to enforce "hard termination mode" for paragraphs; - // normally if you call `tokenize(state, startLine, nextLine)`, - // paragraphs will look below nextLine for paragraph continuation, - // but if blockquote is terminated by another tag, they shouldn't - state.lineMax = nextLine; - if (state.blkIndent !== 0) { - // state.blkIndent was non-zero, we now set it to zero, - // so we need to re-calculate all offsets to appear as - // if indent wasn't changed - oldBMarks.push(state.bMarks[nextLine]); - oldBSCount.push(state.bsCount[nextLine]); - oldTShift.push(state.tShift[nextLine]); - oldSCount.push(state.sCount[nextLine]); - state.sCount[nextLine] -= state.blkIndent; - } - break; - } - oldBMarks.push(state.bMarks[nextLine]); - oldBSCount.push(state.bsCount[nextLine]); - oldTShift.push(state.tShift[nextLine]); - oldSCount.push(state.sCount[nextLine]); - - // A negative indentation means that this is a paragraph continuation - // - state.sCount[nextLine] = -1; +})); +Object.defineProperty(exports, "isSpecifiedScalarType", ({ + enumerable: true, + get: function () { + return _scalars.isSpecifiedScalarType; } - const oldIndent = state.blkIndent; - state.blkIndent = 0; - const token_o = state.push('blockquote_open', 'blockquote', 1); - token_o.markup = '>'; - const lines = [startLine, 0]; - token_o.map = lines; - state.md.block.tokenize(state, startLine, nextLine); - const token_c = state.push('blockquote_close', 'blockquote', -1); - token_c.markup = '>'; - state.lineMax = oldLineMax; - state.parentType = oldParentType; - lines[1] = state.line; - - // Restore original tShift; this might not be necessary since the parser - // has already been here, but just to make sure we can do that. - for (let i = 0; i < oldTShift.length; i++) { - state.bMarks[i + startLine] = oldBMarks[i]; - state.tShift[i + startLine] = oldTShift[i]; - state.sCount[i + startLine] = oldSCount[i]; - state.bsCount[i + startLine] = oldBSCount[i]; +})); +Object.defineProperty(exports, "isType", ({ + enumerable: true, + get: function () { + return _definition.isType; } - state.blkIndent = oldIndent; - return true; -} - -// Horizontal rule - -function hr(state, startLine, endLine, silent) { - const max = state.eMarks[startLine]; - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; +})); +Object.defineProperty(exports, "isUnionType", ({ + enumerable: true, + get: function () { + return _definition.isUnionType; } - let pos = state.bMarks[startLine] + state.tShift[startLine]; - const marker = state.src.charCodeAt(pos++); - - // Check hr marker - if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x5F /* _ */) { - return false; +})); +Object.defineProperty(exports, "isWrappingType", ({ + enumerable: true, + get: function () { + return _definition.isWrappingType; } - - // markers can be mixed with spaces, but there should be at least 3 of them - - let cnt = 1; - while (pos < max) { - const ch = state.src.charCodeAt(pos++); - if (ch !== marker && !isSpace(ch)) { - return false; - } - if (ch === marker) { - cnt++; - } +})); +Object.defineProperty(exports, "resolveObjMapThunk", ({ + enumerable: true, + get: function () { + return _definition.resolveObjMapThunk; } - if (cnt < 3) { - return false; +})); +Object.defineProperty(exports, "resolveReadonlyArrayThunk", ({ + enumerable: true, + get: function () { + return _definition.resolveReadonlyArrayThunk; } - if (silent) { - return true; +})); +Object.defineProperty(exports, "specifiedDirectives", ({ + enumerable: true, + get: function () { + return _directives.specifiedDirectives; } - state.line = startLine + 1; - const token = state.push('hr', 'hr', 0); - token.map = [startLine, state.line]; - token.markup = Array(cnt + 1).join(String.fromCharCode(marker)); - return true; -} - -// Lists - -// Search `[-+*][\n ]`, returns next pos after marker on success -// or -1 on fail. -function skipBulletListMarker(state, startLine) { - const max = state.eMarks[startLine]; - let pos = state.bMarks[startLine] + state.tShift[startLine]; - const marker = state.src.charCodeAt(pos++); - // Check bullet - if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x2B /* + */) { - return -1; +})); +Object.defineProperty(exports, "specifiedScalarTypes", ({ + enumerable: true, + get: function () { + return _scalars.specifiedScalarTypes; } - if (pos < max) { - const ch = state.src.charCodeAt(pos); - if (!isSpace(ch)) { - // " -test " - is not a list item - return -1; - } +})); +Object.defineProperty(exports, "validateSchema", ({ + enumerable: true, + get: function () { + return _validate.validateSchema; } - return pos; -} - -// Search `\d+[.)][\n ]`, returns next pos after marker on success -// or -1 on fail. -function skipOrderedListMarker(state, startLine) { - const start = state.bMarks[startLine] + state.tShift[startLine]; - const max = state.eMarks[startLine]; - let pos = start; +})); +var _schema = __webpack_require__(/*! ./schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); +var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _directives = __webpack_require__(/*! ./directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +var _scalars = __webpack_require__(/*! ./scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); +var _introspection = __webpack_require__(/*! ./introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +var _validate = __webpack_require__(/*! ./validate.mjs */ "../../../node_modules/graphql/type/validate.mjs"); +var _assertName = __webpack_require__(/*! ./assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); - // List marker should have at least 2 chars (digit + dot) - if (pos + 1 >= max) { - return -1; - } - let ch = state.src.charCodeAt(pos++); - if (ch < 0x30 /* 0 */ || ch > 0x39 /* 9 */) { - return -1; - } - for (;;) { - // EOL -> fail - if (pos >= max) { - return -1; - } - ch = state.src.charCodeAt(pos++); - if (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) { - // List marker should have no more than 9 digits - // (prevents integer overflow in browsers) - if (pos - start >= 10) { - return -1; - } - continue; - } +/***/ }), - // found valid marker - if (ch === 0x29 /* ) */ || ch === 0x2e /* . */) { - break; - } - return -1; - } - if (pos < max) { - ch = state.src.charCodeAt(pos); - if (!isSpace(ch)) { - // " 1.test " - is not a list item - return -1; - } - } - return pos; -} -function markTightParagraphs(state, idx) { - const level = state.level + 2; - for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) { - if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') { - state.tokens[i + 2].hidden = true; - state.tokens[i].hidden = true; - i += 2; - } - } -} -function list(state, startLine, endLine, silent) { - let max, pos, start, token; - let nextLine = startLine; - let tight = true; +/***/ "../../../node_modules/graphql/type/introspection.mjs": +/*!************************************************************!*\ + !*** ../../../node_modules/graphql/type/introspection.mjs ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[nextLine] - state.blkIndent >= 4) { - return false; - } +"use strict"; - // Special case: - // - item 1 - // - item 2 - // - item 3 - // - item 4 - // - this one is a paragraph continuation - if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) { - return false; - } - let isTerminatingParagraph = false; - // limit conditions when list can interrupt - // a paragraph (validation mode only) - if (silent && state.parentType === 'paragraph') { - // Next list item should still terminate previous list item; - // - // This code can fail if plugins use blkIndent as well as lists, - // but I hope the spec gets fixed long before that happens. - // - if (state.sCount[nextLine] >= state.blkIndent) { - isTerminatingParagraph = true; - } - } - - // Detect list type and position after marker - let isOrdered; - let markerValue; - let posAfterMarker; - if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) { - isOrdered = true; - start = state.bMarks[nextLine] + state.tShift[nextLine]; - markerValue = Number(state.src.slice(start, posAfterMarker - 1)); - - // If we're starting a new ordered list right after - // a paragraph, it should start with 1. - if (isTerminatingParagraph && markerValue !== 1) return false; - } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) { - isOrdered = false; - } else { - return false; - } - - // If we're starting a new unordered list right after - // a paragraph, first line should not be empty. - if (isTerminatingParagraph) { - if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false; - } - - // For validation mode we can terminate immediately - if (silent) { - return true; - } - - // We should terminate list on style change. Remember first one to compare. - const markerCharCode = state.src.charCodeAt(posAfterMarker - 1); - - // Start list - const listTokIdx = state.tokens.length; - if (isOrdered) { - token = state.push('ordered_list_open', 'ol', 1); - if (markerValue !== 1) { - token.attrs = [['start', markerValue]]; - } - } else { - token = state.push('bullet_list_open', 'ul', 1); - } - const listLines = [nextLine, 0]; - token.map = listLines; - token.markup = String.fromCharCode(markerCharCode); - - // - // Iterate list items - // - - let prevEmptyEnd = false; - const terminatorRules = state.md.block.ruler.getRules('list'); - const oldParentType = state.parentType; - state.parentType = 'list'; - while (nextLine < endLine) { - pos = posAfterMarker; - max = state.eMarks[nextLine]; - const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]); - let offset = initial; - while (pos < max) { - const ch = state.src.charCodeAt(pos); - if (ch === 0x09) { - offset += 4 - (offset + state.bsCount[nextLine]) % 4; - } else if (ch === 0x20) { - offset++; - } else { - break; - } - pos++; - } - const contentStart = pos; - let indentAfterMarker; - if (contentStart >= max) { - // trimming space in "- \n 3" case, indent is 1 here - indentAfterMarker = 1; - } else { - indentAfterMarker = offset - initial; - } - - // If we have more than 4 spaces, the indent is 1 - // (the rest is just indented code block) - if (indentAfterMarker > 4) { - indentAfterMarker = 1; - } - - // " - test" - // ^^^^^ - calculating total length of this thing - const indent = initial + indentAfterMarker; - - // Run subparser & write tokens - token = state.push('list_item_open', 'li', 1); - token.markup = String.fromCharCode(markerCharCode); - const itemLines = [nextLine, 0]; - token.map = itemLines; - if (isOrdered) { - token.info = state.src.slice(start, posAfterMarker - 1); - } - - // change current state, then restore it after parser subcall - const oldTight = state.tight; - const oldTShift = state.tShift[nextLine]; - const oldSCount = state.sCount[nextLine]; - - // - example list - // ^ listIndent position will be here - // ^ blkIndent position will be here - // - const oldListIndent = state.listIndent; - state.listIndent = state.blkIndent; - state.blkIndent = indent; - state.tight = true; - state.tShift[nextLine] = contentStart - state.bMarks[nextLine]; - state.sCount[nextLine] = offset; - if (contentStart >= max && state.isEmpty(nextLine + 1)) { - // workaround for this case - // (list item is empty, list terminates before "foo"): - // ~~~~~~~~ - // - - // - // foo - // ~~~~~~~~ - state.line = Math.min(state.line + 2, endLine); - } else { - state.md.block.tokenize(state, nextLine, endLine, true); - } - - // If any of list item is tight, mark list as tight - if (!state.tight || prevEmptyEnd) { - tight = false; - } - // Item become loose if finish with empty line, - // but we should filter last element, because it means list finish - prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1); - state.blkIndent = state.listIndent; - state.listIndent = oldListIndent; - state.tShift[nextLine] = oldTShift; - state.sCount[nextLine] = oldSCount; - state.tight = oldTight; - token = state.push('list_item_close', 'li', -1); - token.markup = String.fromCharCode(markerCharCode); - nextLine = state.line; - itemLines[1] = nextLine; - if (nextLine >= endLine) { - break; - } - - // - // Try to check if list is terminated or continued. - // - if (state.sCount[nextLine] < state.blkIndent) { - break; - } - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[nextLine] - state.blkIndent >= 4) { - break; - } - - // fail if terminating block found - let terminate = false; - for (let i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.introspectionTypes = exports.__TypeKind = exports.__Type = exports.__Schema = exports.__InputValue = exports.__Field = exports.__EnumValue = exports.__DirectiveLocation = exports.__Directive = exports.TypeNameMetaFieldDef = exports.TypeMetaFieldDef = exports.TypeKind = exports.SchemaMetaFieldDef = void 0; +exports.isIntrospectionType = isIntrospectionType; +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _directiveLocation = __webpack_require__(/*! ../language/directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); +var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _astFromValue = __webpack_require__(/*! ../utilities/astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); +var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _scalars = __webpack_require__(/*! ./scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); +const __Schema = exports.__Schema = new _definition.GraphQLObjectType({ + name: '__Schema', + description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + fields: () => ({ + description: { + type: _scalars.GraphQLString, + resolve: schema => schema.description + }, + types: { + description: 'A list of all types supported by this server.', + type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type))), + resolve(schema) { + return Object.values(schema.getTypeMap()); } + }, + queryType: { + description: 'The type that query operations will be rooted at.', + type: new _definition.GraphQLNonNull(__Type), + resolve: schema => schema.getQueryType() + }, + mutationType: { + description: 'If this server supports mutation, the type that mutation operations will be rooted at.', + type: __Type, + resolve: schema => schema.getMutationType() + }, + subscriptionType: { + description: 'If this server support subscription, the type that subscription operations will be rooted at.', + type: __Type, + resolve: schema => schema.getSubscriptionType() + }, + directives: { + description: 'A list of all directives supported by this server.', + type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Directive))), + resolve: schema => schema.getDirectives() } - if (terminate) { - break; - } - - // fail if list has another type - if (isOrdered) { - posAfterMarker = skipOrderedListMarker(state, nextLine); - if (posAfterMarker < 0) { - break; - } - start = state.bMarks[nextLine] + state.tShift[nextLine]; - } else { - posAfterMarker = skipBulletListMarker(state, nextLine); - if (posAfterMarker < 0) { - break; + }) +}); +const __Directive = exports.__Directive = new _definition.GraphQLObjectType({ + name: '__Directive', + description: "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + fields: () => ({ + name: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLString), + resolve: directive => directive.name + }, + description: { + type: _scalars.GraphQLString, + resolve: directive => directive.description + }, + isRepeatable: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), + resolve: directive => directive.isRepeatable + }, + locations: { + type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__DirectiveLocation))), + resolve: directive => directive.locations + }, + args: { + type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))), + args: { + includeDeprecated: { + type: _scalars.GraphQLBoolean, + defaultValue: false + } + }, + resolve(field, { + includeDeprecated + }) { + return includeDeprecated ? field.args : field.args.filter(arg => arg.deprecationReason == null); } } - if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { - break; + }) +}); +const __DirectiveLocation = exports.__DirectiveLocation = new _definition.GraphQLEnumType({ + name: '__DirectiveLocation', + description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + values: { + QUERY: { + value: _directiveLocation.DirectiveLocation.QUERY, + description: 'Location adjacent to a query operation.' + }, + MUTATION: { + value: _directiveLocation.DirectiveLocation.MUTATION, + description: 'Location adjacent to a mutation operation.' + }, + SUBSCRIPTION: { + value: _directiveLocation.DirectiveLocation.SUBSCRIPTION, + description: 'Location adjacent to a subscription operation.' + }, + FIELD: { + value: _directiveLocation.DirectiveLocation.FIELD, + description: 'Location adjacent to a field.' + }, + FRAGMENT_DEFINITION: { + value: _directiveLocation.DirectiveLocation.FRAGMENT_DEFINITION, + description: 'Location adjacent to a fragment definition.' + }, + FRAGMENT_SPREAD: { + value: _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, + description: 'Location adjacent to a fragment spread.' + }, + INLINE_FRAGMENT: { + value: _directiveLocation.DirectiveLocation.INLINE_FRAGMENT, + description: 'Location adjacent to an inline fragment.' + }, + VARIABLE_DEFINITION: { + value: _directiveLocation.DirectiveLocation.VARIABLE_DEFINITION, + description: 'Location adjacent to a variable definition.' + }, + SCHEMA: { + value: _directiveLocation.DirectiveLocation.SCHEMA, + description: 'Location adjacent to a schema definition.' + }, + SCALAR: { + value: _directiveLocation.DirectiveLocation.SCALAR, + description: 'Location adjacent to a scalar definition.' + }, + OBJECT: { + value: _directiveLocation.DirectiveLocation.OBJECT, + description: 'Location adjacent to an object type definition.' + }, + FIELD_DEFINITION: { + value: _directiveLocation.DirectiveLocation.FIELD_DEFINITION, + description: 'Location adjacent to a field definition.' + }, + ARGUMENT_DEFINITION: { + value: _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION, + description: 'Location adjacent to an argument definition.' + }, + INTERFACE: { + value: _directiveLocation.DirectiveLocation.INTERFACE, + description: 'Location adjacent to an interface definition.' + }, + UNION: { + value: _directiveLocation.DirectiveLocation.UNION, + description: 'Location adjacent to a union definition.' + }, + ENUM: { + value: _directiveLocation.DirectiveLocation.ENUM, + description: 'Location adjacent to an enum definition.' + }, + ENUM_VALUE: { + value: _directiveLocation.DirectiveLocation.ENUM_VALUE, + description: 'Location adjacent to an enum value definition.' + }, + INPUT_OBJECT: { + value: _directiveLocation.DirectiveLocation.INPUT_OBJECT, + description: 'Location adjacent to an input object type definition.' + }, + INPUT_FIELD_DEFINITION: { + value: _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION, + description: 'Location adjacent to an input object field definition.' } } - - // Finalize list - if (isOrdered) { - token = state.push('ordered_list_close', 'ol', -1); - } else { - token = state.push('bullet_list_close', 'ul', -1); - } - token.markup = String.fromCharCode(markerCharCode); - listLines[1] = nextLine; - state.line = nextLine; - state.parentType = oldParentType; - - // mark paragraphs tight if needed - if (tight) { - markTightParagraphs(state, listTokIdx); - } - return true; -} -function reference(state, startLine, _endLine, silent) { - let pos = state.bMarks[startLine] + state.tShift[startLine]; - let max = state.eMarks[startLine]; - let nextLine = startLine + 1; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - if (state.src.charCodeAt(pos) !== 0x5B /* [ */) { - return false; - } - function getNextLine(nextLine) { - const endLine = state.lineMax; - if (nextLine >= endLine || state.isEmpty(nextLine)) { - // empty line or end of input - return null; - } - let isContinuation = false; - - // this would be a code block normally, but after paragraph - // it's considered a lazy continuation regardless of what's there - if (state.sCount[nextLine] - state.blkIndent > 3) { - isContinuation = true; - } - - // quirk for blockquotes, this line should already be checked by that rule - if (state.sCount[nextLine] < 0) { - isContinuation = true; - } - if (!isContinuation) { - const terminatorRules = state.md.block.ruler.getRules('reference'); - const oldParentType = state.parentType; - state.parentType = 'reference'; - - // Some tags can terminate paragraph without empty line. - let terminate = false; - for (let i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; +}); +const __Type = exports.__Type = new _definition.GraphQLObjectType({ + name: '__Type', + description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + fields: () => ({ + kind: { + type: new _definition.GraphQLNonNull(__TypeKind), + resolve(type) { + if ((0, _definition.isScalarType)(type)) { + return TypeKind.SCALAR; } - } - state.parentType = oldParentType; - if (terminate) { - // terminated by another block - return null; - } - } - const pos = state.bMarks[nextLine] + state.tShift[nextLine]; - const max = state.eMarks[nextLine]; + if ((0, _definition.isObjectType)(type)) { + return TypeKind.OBJECT; + } + if ((0, _definition.isInterfaceType)(type)) { + return TypeKind.INTERFACE; + } + if ((0, _definition.isUnionType)(type)) { + return TypeKind.UNION; + } + if ((0, _definition.isEnumType)(type)) { + return TypeKind.ENUM; + } + if ((0, _definition.isInputObjectType)(type)) { + return TypeKind.INPUT_OBJECT; + } + if ((0, _definition.isListType)(type)) { + return TypeKind.LIST; + } + if ((0, _definition.isNonNullType)(type)) { + return TypeKind.NON_NULL; + } + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered) - // max + 1 explicitly includes the newline - return state.src.slice(pos, max + 1); - } - let str = state.src.slice(pos, max + 1); - max = str.length; - let labelEnd = -1; - for (pos = 1; pos < max; pos++) { - const ch = str.charCodeAt(pos); - if (ch === 0x5B /* [ */) { - return false; - } else if (ch === 0x5D /* ] */) { - labelEnd = pos; - break; - } else if (ch === 0x0A /* \n */) { - const lineContent = getNextLine(nextLine); - if (lineContent !== null) { - str += lineContent; - max = str.length; - nextLine++; + false || (0, _invariant.invariant)(false, `Unexpected type: "${(0, _inspect.inspect)(type)}".`); } - } else if (ch === 0x5C /* \ */) { - pos++; - if (pos < max && str.charCodeAt(pos) === 0x0A) { - const lineContent = getNextLine(nextLine); - if (lineContent !== null) { - str += lineContent; - max = str.length; - nextLine++; + }, + name: { + type: _scalars.GraphQLString, + resolve: type => 'name' in type ? type.name : undefined + }, + description: { + type: _scalars.GraphQLString, + resolve: (type // FIXME: add test case + ) => /* c8 ignore next */ + 'description' in type ? type.description : undefined + }, + specifiedByURL: { + type: _scalars.GraphQLString, + resolve: obj => 'specifiedByURL' in obj ? obj.specifiedByURL : undefined + }, + fields: { + type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Field)), + args: { + includeDeprecated: { + type: _scalars.GraphQLBoolean, + defaultValue: false + } + }, + resolve(type, { + includeDeprecated + }) { + if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { + const fields = Object.values(type.getFields()); + return includeDeprecated ? fields : fields.filter(field => field.deprecationReason == null); } } - } - } - if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A /* : */) { - return false; - } - - // [label]: destination 'title' - // ^^^ skip optional whitespace here - for (pos = labelEnd + 2; pos < max; pos++) { - const ch = str.charCodeAt(pos); - if (ch === 0x0A) { - const lineContent = getNextLine(nextLine); - if (lineContent !== null) { - str += lineContent; - max = str.length; - nextLine++; + }, + interfaces: { + type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)), + resolve(type) { + if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { + return type.getInterfaces(); + } } - } else if (isSpace(ch)) ;else { - break; - } - } - - // [label]: destination 'title' - // ^^^^^^^^^^^ parse this - const destRes = state.md.helpers.parseLinkDestination(str, pos, max); - if (!destRes.ok) { - return false; - } - const href = state.md.normalizeLink(destRes.str); - if (!state.md.validateLink(href)) { - return false; - } - pos = destRes.pos; - - // save cursor state, we could require to rollback later - const destEndPos = pos; - const destEndLineNo = nextLine; - - // [label]: destination 'title' - // ^^^ skipping those spaces - const start = pos; - for (; pos < max; pos++) { - const ch = str.charCodeAt(pos); - if (ch === 0x0A) { - const lineContent = getNextLine(nextLine); - if (lineContent !== null) { - str += lineContent; - max = str.length; - nextLine++; + }, + possibleTypes: { + type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)), + resolve(type, _args, _context, { + schema + }) { + if ((0, _definition.isAbstractType)(type)) { + return schema.getPossibleTypes(type); + } + } + }, + enumValues: { + type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__EnumValue)), + args: { + includeDeprecated: { + type: _scalars.GraphQLBoolean, + defaultValue: false + } + }, + resolve(type, { + includeDeprecated + }) { + if ((0, _definition.isEnumType)(type)) { + const values = type.getValues(); + return includeDeprecated ? values : values.filter(field => field.deprecationReason == null); + } + } + }, + inputFields: { + type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue)), + args: { + includeDeprecated: { + type: _scalars.GraphQLBoolean, + defaultValue: false + } + }, + resolve(type, { + includeDeprecated + }) { + if ((0, _definition.isInputObjectType)(type)) { + const values = Object.values(type.getFields()); + return includeDeprecated ? values : values.filter(field => field.deprecationReason == null); + } + } + }, + ofType: { + type: __Type, + resolve: type => 'ofType' in type ? type.ofType : undefined + }, + isOneOf: { + type: _scalars.GraphQLBoolean, + resolve: type => { + if ((0, _definition.isInputObjectType)(type)) { + return type.isOneOf; + } } - } else if (isSpace(ch)) ;else { - break; - } - } - - // [label]: destination 'title' - // ^^^^^^^ parse this - let titleRes = state.md.helpers.parseLinkTitle(str, pos, max); - while (titleRes.can_continue) { - const lineContent = getNextLine(nextLine); - if (lineContent === null) break; - str += lineContent; - pos = max; - max = str.length; - nextLine++; - titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes); - } - let title; - if (pos < max && start !== pos && titleRes.ok) { - title = titleRes.str; - pos = titleRes.pos; - } else { - title = ''; - pos = destEndPos; - nextLine = destEndLineNo; - } - - // skip trailing spaces until the rest of the line - while (pos < max) { - const ch = str.charCodeAt(pos); - if (!isSpace(ch)) { - break; } - pos++; - } - if (pos < max && str.charCodeAt(pos) !== 0x0A) { - if (title) { - // garbage at the end of the line after title, - // but it could still be a valid reference if we roll back - title = ''; - pos = destEndPos; - nextLine = destEndLineNo; - while (pos < max) { - const ch = str.charCodeAt(pos); - if (!isSpace(ch)) { - break; + }) +}); +const __Field = exports.__Field = new _definition.GraphQLObjectType({ + name: '__Field', + description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + fields: () => ({ + name: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLString), + resolve: field => field.name + }, + description: { + type: _scalars.GraphQLString, + resolve: field => field.description + }, + args: { + type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))), + args: { + includeDeprecated: { + type: _scalars.GraphQLBoolean, + defaultValue: false } - pos++; + }, + resolve(field, { + includeDeprecated + }) { + return includeDeprecated ? field.args : field.args.filter(arg => arg.deprecationReason == null); } + }, + type: { + type: new _definition.GraphQLNonNull(__Type), + resolve: field => field.type + }, + isDeprecated: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), + resolve: field => field.deprecationReason != null + }, + deprecationReason: { + type: _scalars.GraphQLString, + resolve: field => field.deprecationReason + } + }) +}); +const __InputValue = exports.__InputValue = new _definition.GraphQLObjectType({ + name: '__InputValue', + description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + fields: () => ({ + name: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLString), + resolve: inputValue => inputValue.name + }, + description: { + type: _scalars.GraphQLString, + resolve: inputValue => inputValue.description + }, + type: { + type: new _definition.GraphQLNonNull(__Type), + resolve: inputValue => inputValue.type + }, + defaultValue: { + type: _scalars.GraphQLString, + description: 'A GraphQL-formatted string representing the default value for this input value.', + resolve(inputValue) { + const { + type, + defaultValue + } = inputValue; + const valueAST = (0, _astFromValue.astFromValue)(defaultValue, type); + return valueAST ? (0, _printer.print)(valueAST) : null; + } + }, + isDeprecated: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), + resolve: field => field.deprecationReason != null + }, + deprecationReason: { + type: _scalars.GraphQLString, + resolve: obj => obj.deprecationReason + } + }) +}); +const __EnumValue = exports.__EnumValue = new _definition.GraphQLObjectType({ + name: '__EnumValue', + description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + fields: () => ({ + name: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLString), + resolve: enumValue => enumValue.name + }, + description: { + type: _scalars.GraphQLString, + resolve: enumValue => enumValue.description + }, + isDeprecated: { + type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), + resolve: enumValue => enumValue.deprecationReason != null + }, + deprecationReason: { + type: _scalars.GraphQLString, + resolve: enumValue => enumValue.deprecationReason + } + }) +}); +var TypeKind; +(function (TypeKind) { + TypeKind['SCALAR'] = 'SCALAR'; + TypeKind['OBJECT'] = 'OBJECT'; + TypeKind['INTERFACE'] = 'INTERFACE'; + TypeKind['UNION'] = 'UNION'; + TypeKind['ENUM'] = 'ENUM'; + TypeKind['INPUT_OBJECT'] = 'INPUT_OBJECT'; + TypeKind['LIST'] = 'LIST'; + TypeKind['NON_NULL'] = 'NON_NULL'; +})(TypeKind || (exports.TypeKind = TypeKind = {})); +const __TypeKind = exports.__TypeKind = new _definition.GraphQLEnumType({ + name: '__TypeKind', + description: 'An enum describing what kind of type a given `__Type` is.', + values: { + SCALAR: { + value: TypeKind.SCALAR, + description: 'Indicates this type is a scalar.' + }, + OBJECT: { + value: TypeKind.OBJECT, + description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.' + }, + INTERFACE: { + value: TypeKind.INTERFACE, + description: 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.' + }, + UNION: { + value: TypeKind.UNION, + description: 'Indicates this type is a union. `possibleTypes` is a valid field.' + }, + ENUM: { + value: TypeKind.ENUM, + description: 'Indicates this type is an enum. `enumValues` is a valid field.' + }, + INPUT_OBJECT: { + value: TypeKind.INPUT_OBJECT, + description: 'Indicates this type is an input object. `inputFields` is a valid field.' + }, + LIST: { + value: TypeKind.LIST, + description: 'Indicates this type is a list. `ofType` is a valid field.' + }, + NON_NULL: { + value: TypeKind.NON_NULL, + description: 'Indicates this type is a non-null. `ofType` is a valid field.' } } - if (pos < max && str.charCodeAt(pos) !== 0x0A) { - // garbage at the end of the line - return false; - } - const label = normalizeReference(str.slice(1, labelEnd)); - if (!label) { - // CommonMark 0.20 disallows empty labels - return false; - } +}); +/** + * Note that these are GraphQLField and not GraphQLFieldConfig, + * so the format for args is different. + */ - // Reference can not terminate anything. This check is for safety only. - /* istanbul ignore if */ - if (silent) { - return true; - } - if (typeof state.env.references === 'undefined') { - state.env.references = {}; - } - if (typeof state.env.references[label] === 'undefined') { - state.env.references[label] = { - title, - href - }; - } - state.line = nextLine; - return true; +const SchemaMetaFieldDef = exports.SchemaMetaFieldDef = { + name: '__schema', + type: new _definition.GraphQLNonNull(__Schema), + description: 'Access the current type schema of this server.', + args: [], + resolve: (_source, _args, _context, { + schema + }) => schema, + deprecationReason: undefined, + extensions: Object.create(null), + astNode: undefined +}; +const TypeMetaFieldDef = exports.TypeMetaFieldDef = { + name: '__type', + type: __Type, + description: 'Request the type information of a single type.', + args: [{ + name: 'name', + description: undefined, + type: new _definition.GraphQLNonNull(_scalars.GraphQLString), + defaultValue: undefined, + deprecationReason: undefined, + extensions: Object.create(null), + astNode: undefined + }], + resolve: (_source, { + name + }, _context, { + schema + }) => schema.getType(name), + deprecationReason: undefined, + extensions: Object.create(null), + astNode: undefined +}; +const TypeNameMetaFieldDef = exports.TypeNameMetaFieldDef = { + name: '__typename', + type: new _definition.GraphQLNonNull(_scalars.GraphQLString), + description: 'The name of the current Object type at runtime.', + args: [], + resolve: (_source, _args, _context, { + parentType + }) => parentType.name, + deprecationReason: undefined, + extensions: Object.create(null), + astNode: undefined +}; +const introspectionTypes = exports.introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]); +function isIntrospectionType(type) { + return introspectionTypes.some(({ + name + }) => type.name === name); } -// List of valid html blocks names, according to commonmark spec -// https://spec.commonmark.org/0.30/#html-blocks +/***/ }), -var block_names = ['address', 'article', 'aside', 'base', 'basefont', 'blockquote', 'body', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dialog', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'iframe', 'legend', 'li', 'link', 'main', 'menu', 'menuitem', 'nav', 'noframes', 'ol', 'optgroup', 'option', 'p', 'param', 'search', 'section', 'summary', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul']; +/***/ "../../../node_modules/graphql/type/scalars.mjs": +/*!******************************************************!*\ + !*** ../../../node_modules/graphql/type/scalars.mjs ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -// Regexps to match html elements +"use strict"; -const attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; -const unquoted = '[^"\'=<>`\\x00-\\x20]+'; -const single_quoted = "'[^']*'"; -const double_quoted = '"[^"]*"'; -const attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; -const attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; -const open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; -const close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; -const comment = ''; -const processing = '<[?][\\s\\S]*?[?]>'; -const declaration = ']*>'; -const cdata = ''; -const HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + '|' + processing + '|' + declaration + '|' + cdata + ')'); -const HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); -// HTML block +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GraphQLString = exports.GraphQLInt = exports.GraphQLID = exports.GraphQLFloat = exports.GraphQLBoolean = exports.GRAPHQL_MIN_INT = exports.GRAPHQL_MAX_INT = void 0; +exports.isSpecifiedScalarType = isSpecifiedScalarType; +exports.specifiedScalarTypes = void 0; +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +/** + * Maximum possible Int value as per GraphQL Spec (32-bit signed integer). + * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1 + * */ -// An array of opening and corresponding closing sequences for html tags, -// last argument defines whether it can terminate a paragraph or not -// -const HTML_SEQUENCES = [[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true], [/^/, true], [/^<\?/, /\?>/, true], [/^/, true], [/^/, true], [new RegExp('^|$))', 'i'), /^$/, true], [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false]]; -function html_block(state, startLine, endLine, silent) { - let pos = state.bMarks[startLine] + state.tShift[startLine]; - let max = state.eMarks[startLine]; +const GRAPHQL_MAX_INT = exports.GRAPHQL_MAX_INT = 2147483647; +/** + * Minimum possible Int value as per GraphQL Spec (32-bit signed integer). + * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1) + * */ - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - if (!state.md.options.html) { - return false; - } - if (state.src.charCodeAt(pos) !== 0x3C /* < */) { - return false; - } - let lineText = state.src.slice(pos, max); - let i = 0; - for (; i < HTML_SEQUENCES.length; i++) { - if (HTML_SEQUENCES[i][0].test(lineText)) { - break; +const GRAPHQL_MIN_INT = exports.GRAPHQL_MIN_INT = -2147483648; +const GraphQLInt = exports.GraphQLInt = new _definition.GraphQLScalarType({ + name: 'Int', + description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); + if (typeof coercedValue === 'boolean') { + return coercedValue ? 1 : 0; } - } - if (i === HTML_SEQUENCES.length) { - return false; - } - if (silent) { - // true if this sequence can be a terminator, false otherwise - return HTML_SEQUENCES[i][2]; - } - let nextLine = startLine + 1; - - // If we are here - we detected HTML block. - // Let's roll down till block end. - if (!HTML_SEQUENCES[i][1].test(lineText)) { - for (; nextLine < endLine; nextLine++) { - if (state.sCount[nextLine] < state.blkIndent) { - break; - } - pos = state.bMarks[nextLine] + state.tShift[nextLine]; - max = state.eMarks[nextLine]; - lineText = state.src.slice(pos, max); - if (HTML_SEQUENCES[i][1].test(lineText)) { - if (lineText.length !== 0) { - nextLine++; - } - break; - } + let num = coercedValue; + if (typeof coercedValue === 'string' && coercedValue !== '') { + num = Number(coercedValue); + } + if (typeof num !== 'number' || !Number.isInteger(num)) { + throw new _GraphQLError.GraphQLError(`Int cannot represent non-integer value: ${(0, _inspect.inspect)(coercedValue)}`); + } + if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { + throw new _GraphQLError.GraphQLError('Int cannot represent non 32-bit signed integer value: ' + (0, _inspect.inspect)(coercedValue)); + } + return num; + }, + parseValue(inputValue) { + if (typeof inputValue !== 'number' || !Number.isInteger(inputValue)) { + throw new _GraphQLError.GraphQLError(`Int cannot represent non-integer value: ${(0, _inspect.inspect)(inputValue)}`); + } + if (inputValue > GRAPHQL_MAX_INT || inputValue < GRAPHQL_MIN_INT) { + throw new _GraphQLError.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${inputValue}`); } + return inputValue; + }, + parseLiteral(valueNode) { + if (valueNode.kind !== _kinds.Kind.INT) { + throw new _GraphQLError.GraphQLError(`Int cannot represent non-integer value: ${(0, _printer.print)(valueNode)}`, { + nodes: valueNode + }); + } + const num = parseInt(valueNode.value, 10); + if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { + throw new _GraphQLError.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, { + nodes: valueNode + }); + } + return num; } - state.line = nextLine; - const token = state.push('html_block', '', 0); - token.map = [startLine, nextLine]; - token.content = state.getLines(startLine, nextLine, state.blkIndent, true); - return true; -} - -// heading (#, ##, ...) - -function heading(state, startLine, endLine, silent) { - let pos = state.bMarks[startLine] + state.tShift[startLine]; - let max = state.eMarks[startLine]; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - let ch = state.src.charCodeAt(pos); - if (ch !== 0x23 /* # */ || pos >= max) { - return false; - } - - // count heading level - let level = 1; - ch = state.src.charCodeAt(++pos); - while (ch === 0x23 /* # */ && pos < max && level <= 6) { - level++; - ch = state.src.charCodeAt(++pos); - } - if (level > 6 || pos < max && !isSpace(ch)) { - return false; - } - if (silent) { - return true; +}); +const GraphQLFloat = exports.GraphQLFloat = new _definition.GraphQLScalarType({ + name: 'Float', + description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); + if (typeof coercedValue === 'boolean') { + return coercedValue ? 1 : 0; + } + let num = coercedValue; + if (typeof coercedValue === 'string' && coercedValue !== '') { + num = Number(coercedValue); + } + if (typeof num !== 'number' || !Number.isFinite(num)) { + throw new _GraphQLError.GraphQLError(`Float cannot represent non numeric value: ${(0, _inspect.inspect)(coercedValue)}`); + } + return num; + }, + parseValue(inputValue) { + if (typeof inputValue !== 'number' || !Number.isFinite(inputValue)) { + throw new _GraphQLError.GraphQLError(`Float cannot represent non numeric value: ${(0, _inspect.inspect)(inputValue)}`); + } + return inputValue; + }, + parseLiteral(valueNode) { + if (valueNode.kind !== _kinds.Kind.FLOAT && valueNode.kind !== _kinds.Kind.INT) { + throw new _GraphQLError.GraphQLError(`Float cannot represent non numeric value: ${(0, _printer.print)(valueNode)}`, valueNode); + } + return parseFloat(valueNode.value); } +}); +const GraphQLString = exports.GraphQLString = new _definition.GraphQLScalarType({ + name: 'String', + description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); // Serialize string, boolean and number values to a string, but do not + // attempt to coerce object, function, symbol, or other types as strings. - // Let's cut tails like ' ### ' from the end of string - - max = state.skipSpacesBack(max, pos); - const tmp = state.skipCharsBack(max, 0x23, pos); // # - if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) { - max = tmp; + if (typeof coercedValue === 'string') { + return coercedValue; + } + if (typeof coercedValue === 'boolean') { + return coercedValue ? 'true' : 'false'; + } + if (typeof coercedValue === 'number' && Number.isFinite(coercedValue)) { + return coercedValue.toString(); + } + throw new _GraphQLError.GraphQLError(`String cannot represent value: ${(0, _inspect.inspect)(outputValue)}`); + }, + parseValue(inputValue) { + if (typeof inputValue !== 'string') { + throw new _GraphQLError.GraphQLError(`String cannot represent a non string value: ${(0, _inspect.inspect)(inputValue)}`); + } + return inputValue; + }, + parseLiteral(valueNode) { + if (valueNode.kind !== _kinds.Kind.STRING) { + throw new _GraphQLError.GraphQLError(`String cannot represent a non string value: ${(0, _printer.print)(valueNode)}`, { + nodes: valueNode + }); + } + return valueNode.value; } - state.line = startLine + 1; - const token_o = state.push('heading_open', 'h' + String(level), 1); - token_o.markup = '########'.slice(0, level); - token_o.map = [startLine, state.line]; - const token_i = state.push('inline', '', 0); - token_i.content = state.src.slice(pos, max).trim(); - token_i.map = [startLine, state.line]; - token_i.children = []; - const token_c = state.push('heading_close', 'h' + String(level), -1); - token_c.markup = '########'.slice(0, level); - return true; -} - -// lheading (---, ===) - -function lheading(state, startLine, endLine /*, silent */) { - const terminatorRules = state.md.block.ruler.getRules('paragraph'); - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; +}); +const GraphQLBoolean = exports.GraphQLBoolean = new _definition.GraphQLScalarType({ + name: 'Boolean', + description: 'The `Boolean` scalar type represents `true` or `false`.', + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); + if (typeof coercedValue === 'boolean') { + return coercedValue; + } + if (Number.isFinite(coercedValue)) { + return coercedValue !== 0; + } + throw new _GraphQLError.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, _inspect.inspect)(coercedValue)}`); + }, + parseValue(inputValue) { + if (typeof inputValue !== 'boolean') { + throw new _GraphQLError.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, _inspect.inspect)(inputValue)}`); + } + return inputValue; + }, + parseLiteral(valueNode) { + if (valueNode.kind !== _kinds.Kind.BOOLEAN) { + throw new _GraphQLError.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, _printer.print)(valueNode)}`, { + nodes: valueNode + }); + } + return valueNode.value; } - const oldParentType = state.parentType; - state.parentType = 'paragraph'; // use paragraph to match terminatorRules - - // jump line-by-line until empty one or EOF - let level = 0; - let marker; - let nextLine = startLine + 1; - for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { - // this would be a code block normally, but after paragraph - // it's considered a lazy continuation regardless of what's there - if (state.sCount[nextLine] - state.blkIndent > 3) { - continue; +}); +const GraphQLID = exports.GraphQLID = new _definition.GraphQLScalarType({ + name: 'ID', + description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + serialize(outputValue) { + const coercedValue = serializeObject(outputValue); + if (typeof coercedValue === 'string') { + return coercedValue; } - - // - // Check for underline in setext header - // - if (state.sCount[nextLine] >= state.blkIndent) { - let pos = state.bMarks[nextLine] + state.tShift[nextLine]; - const max = state.eMarks[nextLine]; - if (pos < max) { - marker = state.src.charCodeAt(pos); - if (marker === 0x2D /* - */ || marker === 0x3D /* = */) { - pos = state.skipChars(pos, marker); - pos = state.skipSpaces(pos); - if (pos >= max) { - level = marker === 0x3D /* = */ ? 1 : 2; - break; - } - } - } + if (Number.isInteger(coercedValue)) { + return String(coercedValue); } - - // quirk for blockquotes, this line should already be checked by that rule - if (state.sCount[nextLine] < 0) { - continue; + throw new _GraphQLError.GraphQLError(`ID cannot represent value: ${(0, _inspect.inspect)(outputValue)}`); + }, + parseValue(inputValue) { + if (typeof inputValue === 'string') { + return inputValue; + } + if (typeof inputValue === 'number' && Number.isInteger(inputValue)) { + return inputValue.toString(); + } + throw new _GraphQLError.GraphQLError(`ID cannot represent value: ${(0, _inspect.inspect)(inputValue)}`); + }, + parseLiteral(valueNode) { + if (valueNode.kind !== _kinds.Kind.STRING && valueNode.kind !== _kinds.Kind.INT) { + throw new _GraphQLError.GraphQLError('ID cannot represent a non-string and non-integer value: ' + (0, _printer.print)(valueNode), { + nodes: valueNode + }); } + return valueNode.value; + } +}); +const specifiedScalarTypes = exports.specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]); +function isSpecifiedScalarType(type) { + return specifiedScalarTypes.some(({ + name + }) => type.name === name); +} // Support serializing objects with custom valueOf() or toJSON() functions - +// a common way to represent a complex value which can be represented as +// a string (ex: MongoDB id objects). - // Some tags can terminate paragraph without empty line. - let terminate = false; - for (let i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; +function serializeObject(outputValue) { + if ((0, _isObjectLike.isObjectLike)(outputValue)) { + if (typeof outputValue.valueOf === 'function') { + const valueOfResult = outputValue.valueOf(); + if (!(0, _isObjectLike.isObjectLike)(valueOfResult)) { + return valueOfResult; } } - if (terminate) { - break; + if (typeof outputValue.toJSON === 'function') { + return outputValue.toJSON(); } } - if (!level) { - // Didn't find valid underline - return false; - } - const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); - state.line = nextLine + 1; - const token_o = state.push('heading_open', 'h' + String(level), 1); - token_o.markup = String.fromCharCode(marker); - token_o.map = [startLine, state.line]; - const token_i = state.push('inline', '', 0); - token_i.content = content; - token_i.map = [startLine, state.line - 1]; - token_i.children = []; - const token_c = state.push('heading_close', 'h' + String(level), -1); - token_c.markup = String.fromCharCode(marker); - state.parentType = oldParentType; - return true; + return outputValue; } -// Paragraph +/***/ }), -function paragraph(state, startLine, endLine) { - const terminatorRules = state.md.block.ruler.getRules('paragraph'); - const oldParentType = state.parentType; - let nextLine = startLine + 1; - state.parentType = 'paragraph'; +/***/ "../../../node_modules/graphql/type/schema.mjs": +/*!*****************************************************!*\ + !*** ../../../node_modules/graphql/type/schema.mjs ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // jump line-by-line until empty one or EOF - for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { - // this would be a code block normally, but after paragraph - // it's considered a lazy continuation regardless of what's there - if (state.sCount[nextLine] - state.blkIndent > 3) { - continue; - } +"use strict"; - // quirk for blockquotes, this line should already be checked by that rule - if (state.sCount[nextLine] < 0) { - continue; - } - // Some tags can terminate paragraph without empty line. - let terminate = false; - for (let i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GraphQLSchema = void 0; +exports.assertSchema = assertSchema; +exports.isSchema = isSchema; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _instanceOf = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); +var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _toObjMap = __webpack_require__(/*! ../jsutils/toObjMap.mjs */ "../../../node_modules/graphql/jsutils/toObjMap.mjs"); +var _ast = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); +var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _directives = __webpack_require__(/*! ./directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +var _introspection = __webpack_require__(/*! ./introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +/** + * Test if the given value is a GraphQL schema. + */ + +function isSchema(schema) { + return (0, _instanceOf.instanceOf)(schema, GraphQLSchema); +} +function assertSchema(schema) { + if (!isSchema(schema)) { + throw new Error(`Expected ${(0, _inspect.inspect)(schema)} to be a GraphQL schema.`); } - const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); - state.line = nextLine; - const token_o = state.push('paragraph_open', 'p', 1); - token_o.map = [startLine, state.line]; - const token_i = state.push('inline', '', 0); - token_i.content = content; - token_i.map = [startLine, state.line]; - token_i.children = []; - state.push('paragraph_close', 'p', -1); - state.parentType = oldParentType; - return true; + return schema; } +/** + * Custom extensions + * + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ -/** internal - * class ParserBlock +/** + * Schema Definition * - * Block-level tokenizer. - **/ + * A Schema is created by supplying the root types of each type of operation, + * query and mutation (optional). A schema definition is then supplied to the + * validator and executor. + * + * Example: + * + * ```ts + * const MyAppSchema = new GraphQLSchema({ + * query: MyAppQueryRootType, + * mutation: MyAppMutationRootType, + * }) + * ``` + * + * Note: When the schema is constructed, by default only the types that are + * reachable by traversing the root types are included, other types must be + * explicitly referenced. + * + * Example: + * + * ```ts + * const characterInterface = new GraphQLInterfaceType({ + * name: 'Character', + * ... + * }); + * + * const humanType = new GraphQLObjectType({ + * name: 'Human', + * interfaces: [characterInterface], + * ... + * }); + * + * const droidType = new GraphQLObjectType({ + * name: 'Droid', + * interfaces: [characterInterface], + * ... + * }); + * + * const schema = new GraphQLSchema({ + * query: new GraphQLObjectType({ + * name: 'Query', + * fields: { + * hero: { type: characterInterface, ... }, + * } + * }), + * ... + * // Since this schema references only the `Character` interface it's + * // necessary to explicitly list the types that implement it if + * // you want them to be included in the final schema. + * types: [humanType, droidType], + * }) + * ``` + * + * Note: If an array of `directives` are provided to GraphQLSchema, that will be + * the exact list of directives represented and allowed. If `directives` is not + * provided then a default set of the specified directives (e.g. `@include` and + * `@skip`) will be used. If you wish to provide *additional* directives to these + * specified directives, you must explicitly declare them. Example: + * + * ```ts + * const MyAppSchema = new GraphQLSchema({ + * ... + * directives: specifiedDirectives.concat([ myCustomDirective ]), + * }) + * ``` + */ +class GraphQLSchema { + // Used as a cache for validateSchema(). + constructor(config) { + var _config$extensionASTN, _config$directives; -const _rules$1 = [ -// First 2 params - rule name & source. Secondary array - list of rules, -// which can be terminated by this one. -['table', table, ['paragraph', 'reference']], ['code', code], ['fence', fence, ['paragraph', 'reference', 'blockquote', 'list']], ['blockquote', blockquote, ['paragraph', 'reference', 'blockquote', 'list']], ['hr', hr, ['paragraph', 'reference', 'blockquote', 'list']], ['list', list, ['paragraph', 'reference', 'blockquote']], ['reference', reference], ['html_block', html_block, ['paragraph', 'reference', 'blockquote']], ['heading', heading, ['paragraph', 'reference', 'blockquote']], ['lheading', lheading], ['paragraph', paragraph]]; + // If this schema was built from a source known to be valid, then it may be + // marked with assumeValid to avoid an additional type system validation. + this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors. -/** - * new ParserBlock() - **/ -function ParserBlock() { - /** - * ParserBlock#ruler -> Ruler - * - * [[Ruler]] instance. Keep configuration of block rules. - **/ - this.ruler = new Ruler(); - for (let i = 0; i < _rules$1.length; i++) { - this.ruler.push(_rules$1[i][0], _rules$1[i][1], { - alt: (_rules$1[i][2] || []).slice() - }); - } -} + (0, _isObjectLike.isObjectLike)(config) || (0, _devAssert.devAssert)(false, 'Must provide configuration object.'); + !config.types || Array.isArray(config.types) || (0, _devAssert.devAssert)(false, `"types" must be Array if provided but got: ${(0, _inspect.inspect)(config.types)}.`); + !config.directives || Array.isArray(config.directives) || (0, _devAssert.devAssert)(false, '"directives" must be Array if provided but got: ' + `${(0, _inspect.inspect)(config.directives)}.`); + this.description = config.description; + this.extensions = (0, _toObjMap.toObjMap)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = (_config$extensionASTN = config.extensionASTNodes) !== null && _config$extensionASTN !== void 0 ? _config$extensionASTN : []; + this._queryType = config.query; + this._mutationType = config.mutation; + this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default. -// Generate tokens for input range -// -ParserBlock.prototype.tokenize = function (state, startLine, endLine) { - const rules = this.ruler.getRules(''); - const len = rules.length; - const maxNesting = state.md.options.maxNesting; - let line = startLine; - let hasEmptyLines = false; - while (line < endLine) { - state.line = line = state.skipEmptyLines(line); - if (line >= endLine) { - break; - } + this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives; // To preserve order of user-provided types, we add first to add them to + // the set of "collected" types, so `collectReferencedTypes` ignore them. - // Termination condition for nested calls. - // Nested calls currently used for blockquotes & lists - if (state.sCount[line] < state.blkIndent) { - break; + const allReferencedTypes = new Set(config.types); + if (config.types != null) { + for (const type of config.types) { + // When we ready to process this type, we remove it from "collected" types + // and then add it together with all dependent types in the correct position. + allReferencedTypes.delete(type); + collectReferencedTypes(type, allReferencedTypes); + } } - - // If nesting level exceeded - skip tail to the end. That's not ordinary - // situation and we should not care about content. - if (state.level >= maxNesting) { - state.line = endLine; - break; + if (this._queryType != null) { + collectReferencedTypes(this._queryType, allReferencedTypes); } - - // Try all possible rules. - // On success, rule should: - // - // - update `state.line` - // - update `state.tokens` - // - return true - const prevLine = state.line; - let ok = false; - for (let i = 0; i < len; i++) { - ok = rules[i](state, line, endLine, false); - if (ok) { - if (prevLine >= state.line) { - throw new Error("block rule didn't increment state.line"); + if (this._mutationType != null) { + collectReferencedTypes(this._mutationType, allReferencedTypes); + } + if (this._subscriptionType != null) { + collectReferencedTypes(this._subscriptionType, allReferencedTypes); + } + for (const directive of this._directives) { + // Directives are not validated until validateSchema() is called. + if ((0, _directives.isDirective)(directive)) { + for (const arg of directive.args) { + collectReferencedTypes(arg.type, allReferencedTypes); } - break; } } + collectReferencedTypes(_introspection.__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema. - // this can only happen if user disables paragraph rule - if (!ok) throw new Error('none of the block rules matched'); - - // set state.tight if we had an empty line before current tag - // i.e. latest empty line should not count - state.tight = !hasEmptyLines; + this._typeMap = Object.create(null); + this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name. - // paragraph might "eat" one newline after it in nested lists - if (state.isEmpty(state.line - 1)) { - hasEmptyLines = true; + this._implementationsMap = Object.create(null); + for (const namedType of allReferencedTypes) { + if (namedType == null) { + continue; + } + const typeName = namedType.name; + typeName || (0, _devAssert.devAssert)(false, 'One of the provided types for building the Schema is missing a name.'); + if (this._typeMap[typeName] !== undefined) { + throw new Error(`Schema must contain uniquely named types but contains multiple types named "${typeName}".`); + } + this._typeMap[typeName] = namedType; + if ((0, _definition.isInterfaceType)(namedType)) { + // Store implementations by interface. + for (const iface of namedType.getInterfaces()) { + if ((0, _definition.isInterfaceType)(iface)) { + let implementations = this._implementationsMap[iface.name]; + if (implementations === undefined) { + implementations = this._implementationsMap[iface.name] = { + objects: [], + interfaces: [] + }; + } + implementations.interfaces.push(namedType); + } + } + } else if ((0, _definition.isObjectType)(namedType)) { + // Store implementations by objects. + for (const iface of namedType.getInterfaces()) { + if ((0, _definition.isInterfaceType)(iface)) { + let implementations = this._implementationsMap[iface.name]; + if (implementations === undefined) { + implementations = this._implementationsMap[iface.name] = { + objects: [], + interfaces: [] + }; + } + implementations.objects.push(namedType); + } + } + } } - line = state.line; - if (line < endLine && state.isEmpty(line)) { - hasEmptyLines = true; - line++; - state.line = line; + } + get [Symbol.toStringTag]() { + return 'GraphQLSchema'; + } + getQueryType() { + return this._queryType; + } + getMutationType() { + return this._mutationType; + } + getSubscriptionType() { + return this._subscriptionType; + } + getRootType(operation) { + switch (operation) { + case _ast.OperationTypeNode.QUERY: + return this.getQueryType(); + case _ast.OperationTypeNode.MUTATION: + return this.getMutationType(); + case _ast.OperationTypeNode.SUBSCRIPTION: + return this.getSubscriptionType(); } } -}; - -/** - * ParserBlock.parse(str, md, env, outTokens) - * - * Process input string and push block tokens into `outTokens` - **/ -ParserBlock.prototype.parse = function (src, md, env, outTokens) { - if (!src) { - return; + getTypeMap() { + return this._typeMap; } - const state = new this.State(src, md, env, outTokens); - this.tokenize(state, state.line, state.lineMax); -}; -ParserBlock.prototype.State = StateBlock; + getType(name) { + return this.getTypeMap()[name]; + } + getPossibleTypes(abstractType) { + return (0, _definition.isUnionType)(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects; + } + getImplementations(interfaceType) { + const implementations = this._implementationsMap[interfaceType.name]; + return implementations !== null && implementations !== void 0 ? implementations : { + objects: [], + interfaces: [] + }; + } + isSubType(abstractType, maybeSubType) { + let map = this._subTypeMap[abstractType.name]; + if (map === undefined) { + map = Object.create(null); + if ((0, _definition.isUnionType)(abstractType)) { + for (const type of abstractType.getTypes()) { + map[type.name] = true; + } + } else { + const implementations = this.getImplementations(abstractType); + for (const type of implementations.objects) { + map[type.name] = true; + } + for (const type of implementations.interfaces) { + map[type.name] = true; + } + } + this._subTypeMap[abstractType.name] = map; + } + return map[maybeSubType.name] !== undefined; + } + getDirectives() { + return this._directives; + } + getDirective(name) { + return this.getDirectives().find(directive => directive.name === name); + } + toConfig() { + return { + description: this.description, + query: this.getQueryType(), + mutation: this.getMutationType(), + subscription: this.getSubscriptionType(), + types: Object.values(this.getTypeMap()), + directives: this.getDirectives(), + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + assumeValid: this.__validationErrors !== undefined + }; + } +} +exports.GraphQLSchema = GraphQLSchema; +function collectReferencedTypes(type, typeSet) { + const namedType = (0, _definition.getNamedType)(type); + if (!typeSet.has(namedType)) { + typeSet.add(namedType); + if ((0, _definition.isUnionType)(namedType)) { + for (const memberType of namedType.getTypes()) { + collectReferencedTypes(memberType, typeSet); + } + } else if ((0, _definition.isObjectType)(namedType) || (0, _definition.isInterfaceType)(namedType)) { + for (const interfaceType of namedType.getInterfaces()) { + collectReferencedTypes(interfaceType, typeSet); + } + for (const field of Object.values(namedType.getFields())) { + collectReferencedTypes(field.type, typeSet); + for (const arg of field.args) { + collectReferencedTypes(arg.type, typeSet); + } + } + } else if ((0, _definition.isInputObjectType)(namedType)) { + for (const field of Object.values(namedType.getFields())) { + collectReferencedTypes(field.type, typeSet); + } + } + } + return typeSet; +} -// Inline parser state +/***/ }), -function StateInline(src, md, env, outTokens) { - this.src = src; - this.env = env; - this.md = md; - this.tokens = outTokens; - this.tokens_meta = Array(outTokens.length); - this.pos = 0; - this.posMax = this.src.length; - this.level = 0; - this.pending = ''; - this.pendingLevel = 0; +/***/ "../../../node_modules/graphql/type/validate.mjs": +/*!*******************************************************!*\ + !*** ../../../node_modules/graphql/type/validate.mjs ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // Stores { start: end } pairs. Useful for backtrack - // optimization of pairs parse (emphasis, strikes). - this.cache = {}; +"use strict"; - // List of emphasis-like delimiters for current tag - this.delimiters = []; - // Stack of delimiter lists for upper level tags - this._prev_delimiters = []; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.assertValidSchema = assertValidSchema; +exports.validateSchema = validateSchema; +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _ast = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); +var _typeComparators = __webpack_require__(/*! ../utilities/typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); +var _definition = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _directives = __webpack_require__(/*! ./directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +var _introspection = __webpack_require__(/*! ./introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +var _schema = __webpack_require__(/*! ./schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + */ - // backtick length => last seen position - this.backticks = {}; - this.backticksScanned = false; +function validateSchema(schema) { + // First check to ensure the provided value is in fact a GraphQLSchema. + (0, _schema.assertSchema)(schema); // If this Schema has already been validated, return the previous results. - // Counter used to disable inline linkify-it execution - // inside and markdown links - this.linkLevel = 0; -} + if (schema.__validationErrors) { + return schema.__validationErrors; + } // Validate the schema, producing a list of errors. -// Flush pending text -// -StateInline.prototype.pushPending = function () { - const token = new Token('text', '', 0); - token.content = this.pending; - token.level = this.pendingLevel; - this.tokens.push(token); - this.pending = ''; - return token; -}; + const context = new SchemaValidationContext(schema); + validateRootTypes(context); + validateDirectives(context); + validateTypes(context); // Persist the results of validation before returning to ensure validation + // does not run multiple times for this schema. -// Push new token to "stream". -// If pending text exists - flush it as text token -// -StateInline.prototype.push = function (type, tag, nesting) { - if (this.pending) { - this.pushPending(); + const errors = context.getErrors(); + schema.__validationErrors = errors; + return errors; +} +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + */ + +function assertValidSchema(schema) { + const errors = validateSchema(schema); + if (errors.length !== 0) { + throw new Error(errors.map(error => error.message).join('\n\n')); } - const token = new Token(type, tag, nesting); - let token_meta = null; - if (nesting < 0) { - // closing tag - this.level--; - this.delimiters = this._prev_delimiters.pop(); +} +class SchemaValidationContext { + constructor(schema) { + this._errors = []; + this.schema = schema; } - token.level = this.level; - if (nesting > 0) { - // opening tag - this.level++; - this._prev_delimiters.push(this.delimiters); - this.delimiters = []; - token_meta = { - delimiters: this.delimiters - }; + reportError(message, nodes) { + const _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes; + this._errors.push(new _GraphQLError.GraphQLError(message, { + nodes: _nodes + })); } - this.pendingLevel = this.level; - this.tokens.push(token); - this.tokens_meta.push(token_meta); - return token; -}; - -// Scan a sequence of emphasis-like markers, and determine whether -// it can start an emphasis sequence or end an emphasis sequence. -// -// - start - position to scan from (it should point at a valid marker); -// - canSplitWord - determine if these markers can be found inside a word -// -StateInline.prototype.scanDelims = function (start, canSplitWord) { - const max = this.posMax; - const marker = this.src.charCodeAt(start); - - // treat beginning of the line as a whitespace - const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20; - let pos = start; - while (pos < max && this.src.charCodeAt(pos) === marker) { - pos++; + getErrors() { + return this._errors; } - const count = pos - start; - - // treat end of the line as a whitespace - const nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20; - const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); - const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); - const isLastWhiteSpace = isWhiteSpace(lastChar); - const isNextWhiteSpace = isWhiteSpace(nextChar); - const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar); - const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar); - const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar); - const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar); - return { - can_open, - can_close, - length: count - }; -}; - -// re-export Token class to use in block rules -StateInline.prototype.Token = Token; - -// Skip text characters for text token, place those to pending buffer -// and increment current pos +} +function validateRootTypes(context) { + const schema = context.schema; + const queryType = schema.getQueryType(); + if (!queryType) { + context.reportError('Query root type must be provided.', schema.astNode); + } else if (!(0, _definition.isObjectType)(queryType)) { + var _getOperationTypeNode; + context.reportError(`Query root type must be Object type, it cannot be ${(0, _inspect.inspect)(queryType)}.`, (_getOperationTypeNode = getOperationTypeNode(schema, _ast.OperationTypeNode.QUERY)) !== null && _getOperationTypeNode !== void 0 ? _getOperationTypeNode : queryType.astNode); + } + const mutationType = schema.getMutationType(); + if (mutationType && !(0, _definition.isObjectType)(mutationType)) { + var _getOperationTypeNode2; + context.reportError('Mutation root type must be Object type if provided, it cannot be ' + `${(0, _inspect.inspect)(mutationType)}.`, (_getOperationTypeNode2 = getOperationTypeNode(schema, _ast.OperationTypeNode.MUTATION)) !== null && _getOperationTypeNode2 !== void 0 ? _getOperationTypeNode2 : mutationType.astNode); + } + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType && !(0, _definition.isObjectType)(subscriptionType)) { + var _getOperationTypeNode3; + context.reportError('Subscription root type must be Object type if provided, it cannot be ' + `${(0, _inspect.inspect)(subscriptionType)}.`, (_getOperationTypeNode3 = getOperationTypeNode(schema, _ast.OperationTypeNode.SUBSCRIPTION)) !== null && _getOperationTypeNode3 !== void 0 ? _getOperationTypeNode3 : subscriptionType.astNode); + } +} +function getOperationTypeNode(schema, operation) { + var _flatMap$find; + return (_flatMap$find = [schema.astNode, ...schema.extensionASTNodes].flatMap( + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + schemaNode => { + var _schemaNode$operation; + return /* c8 ignore next */( + (_schemaNode$operation = schemaNode === null || schemaNode === void 0 ? void 0 : schemaNode.operationTypes) !== null && _schemaNode$operation !== void 0 ? _schemaNode$operation : [] + ); + }).find(operationNode => operationNode.operation === operation)) === null || _flatMap$find === void 0 ? void 0 : _flatMap$find.type; +} +function validateDirectives(context) { + for (const directive of context.schema.getDirectives()) { + // Ensure all directives are in fact GraphQL directives. + if (!(0, _directives.isDirective)(directive)) { + context.reportError(`Expected directive but got: ${(0, _inspect.inspect)(directive)}.`, directive === null || directive === void 0 ? void 0 : directive.astNode); + continue; + } // Ensure they are named correctly. -// Rule to skip pure text -// '{}$%@~+=:' reserved for extentions + validateName(context, directive); // TODO: Ensure proper locations. + // Ensure the arguments are valid. -// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ + for (const arg of directive.args) { + // Ensure they are named correctly. + validateName(context, arg); // Ensure the type is an input type. -// !!!! Don't confuse with "Markdown ASCII Punctuation" chars -// http://spec.commonmark.org/0.15/#ascii-punctuation-character -function isTerminatorChar(ch) { - switch (ch) { - case 0x0A /* \n */: - case 0x21 /* ! */: - case 0x23 /* # */: - case 0x24 /* $ */: - case 0x25 /* % */: - case 0x26 /* & */: - case 0x2A /* * */: - case 0x2B /* + */: - case 0x2D /* - */: - case 0x3A /* : */: - case 0x3C /* < */: - case 0x3D /* = */: - case 0x3E /* > */: - case 0x40 /* @ */: - case 0x5B /* [ */: - case 0x5C /* \ */: - case 0x5D /* ] */: - case 0x5E /* ^ */: - case 0x5F /* _ */: - case 0x60 /* ` */: - case 0x7B /* { */: - case 0x7D /* } */: - case 0x7E /* ~ */: - return true; - default: - return false; + if (!(0, _definition.isInputType)(arg.type)) { + context.reportError(`The type of @${directive.name}(${arg.name}:) must be Input Type ` + `but got: ${(0, _inspect.inspect)(arg.type)}.`, arg.astNode); + } + if ((0, _definition.isRequiredArgument)(arg) && arg.deprecationReason != null) { + var _arg$astNode; + context.reportError(`Required argument @${directive.name}(${arg.name}:) cannot be deprecated.`, [getDeprecatedDirectiveNode(arg.astNode), (_arg$astNode = arg.astNode) === null || _arg$astNode === void 0 ? void 0 : _arg$astNode.type]); + } + } } } -function text(state, silent) { - let pos = state.pos; - while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) { - pos++; - } - if (pos === state.pos) { - return false; - } - if (!silent) { - state.pending += state.src.slice(state.pos, pos); +function validateName(context, node) { + // Ensure names are valid, however introspection types opt out. + if (node.name.startsWith('__')) { + context.reportError(`Name "${node.name}" must not begin with "__", which is reserved by GraphQL introspection.`, node.astNode); } - state.pos = pos; - return true; } +function validateTypes(context) { + const validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context); + const typeMap = context.schema.getTypeMap(); + for (const type of Object.values(typeMap)) { + // Ensure all provided types are in fact GraphQL type. + if (!(0, _definition.isNamedType)(type)) { + context.reportError(`Expected GraphQL named type but got: ${(0, _inspect.inspect)(type)}.`, type.astNode); + continue; + } // Ensure it is named correctly (excluding introspection types). -// Alternative implementation, for memory. -// -// It costs 10% of performance, but allows extend terminators list, if place it -// to `ParserInline` property. Probably, will switch to it sometime, such -// flexibility required. - -/* -var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/; + if (!(0, _introspection.isIntrospectionType)(type)) { + validateName(context, type); + } + if ((0, _definition.isObjectType)(type)) { + // Ensure fields are valid + validateFields(context, type); // Ensure objects implement the interfaces they claim to. -module.exports = function text(state, silent) { - var pos = state.pos, - idx = state.src.slice(pos).search(TERMINATOR_RE); + validateInterfaces(context, type); + } else if ((0, _definition.isInterfaceType)(type)) { + // Ensure fields are valid. + validateFields(context, type); // Ensure interfaces implement the interfaces they claim to. - // first char is terminator -> empty text - if (idx === 0) { return false; } + validateInterfaces(context, type); + } else if ((0, _definition.isUnionType)(type)) { + // Ensure Unions include valid member types. + validateUnionMembers(context, type); + } else if ((0, _definition.isEnumType)(type)) { + // Ensure Enums have valid values. + validateEnumValues(context, type); + } else if ((0, _definition.isInputObjectType)(type)) { + // Ensure Input Object fields are valid. + validateInputFields(context, type); // Ensure Input Objects do not contain non-nullable circular references - // no terminator -> text till end of string - if (idx < 0) { - if (!silent) { state.pending += state.src.slice(pos); } - state.pos = state.src.length; - return true; + validateInputObjectCircularRefs(type); + } } +} +function validateFields(context, type) { + const fields = Object.values(type.getFields()); // Objects and Interfaces both must define one or more fields. - if (!silent) { state.pending += state.src.slice(pos, pos + idx); } + if (fields.length === 0) { + context.reportError(`Type ${type.name} must define one or more fields.`, [type.astNode, ...type.extensionASTNodes]); + } + for (const field of fields) { + // Ensure they are named correctly. + validateName(context, field); // Ensure the type is an output type - state.pos += idx; + if (!(0, _definition.isOutputType)(field.type)) { + var _field$astNode; + context.reportError(`The type of ${type.name}.${field.name} must be Output Type ` + `but got: ${(0, _inspect.inspect)(field.type)}.`, (_field$astNode = field.astNode) === null || _field$astNode === void 0 ? void 0 : _field$astNode.type); + } // Ensure the arguments are valid - return true; -}; */ + for (const arg of field.args) { + const argName = arg.name; // Ensure they are named correctly. -// Process links like https://example.org/ + validateName(context, arg); // Ensure the type is an input type -// RFC3986: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) -const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i; -function linkify(state, silent) { - if (!state.md.options.linkify) return false; - if (state.linkLevel > 0) return false; - const pos = state.pos; - const max = state.posMax; - if (pos + 3 > max) return false; - if (state.src.charCodeAt(pos) !== 0x3A /* : */) return false; - if (state.src.charCodeAt(pos + 1) !== 0x2F /* / */) return false; - if (state.src.charCodeAt(pos + 2) !== 0x2F /* / */) return false; - const match = state.pending.match(SCHEME_RE); - if (!match) return false; - const proto = match[1]; - const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length)); - if (!link) return false; - let url = link.url; - - // invalid link, but still detected by linkify somehow; - // need to check to prevent infinite loop below - if (url.length <= proto.length) return false; - - // disallow '*' at the end of the link (conflicts with emphasis) - url = url.replace(/\*+$/, ''); - const fullUrl = state.md.normalizeLink(url); - if (!state.md.validateLink(fullUrl)) return false; - if (!silent) { - state.pending = state.pending.slice(0, -proto.length); - const token_o = state.push('link_open', 'a', 1); - token_o.attrs = [['href', fullUrl]]; - token_o.markup = 'linkify'; - token_o.info = 'auto'; - const token_t = state.push('text', '', 0); - token_t.content = state.md.normalizeLinkText(url); - const token_c = state.push('link_close', 'a', -1); - token_c.markup = 'linkify'; - token_c.info = 'auto'; + if (!(0, _definition.isInputType)(arg.type)) { + var _arg$astNode2; + context.reportError(`The type of ${type.name}.${field.name}(${argName}:) must be Input ` + `Type but got: ${(0, _inspect.inspect)(arg.type)}.`, (_arg$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0 ? void 0 : _arg$astNode2.type); + } + if ((0, _definition.isRequiredArgument)(arg) && arg.deprecationReason != null) { + var _arg$astNode3; + context.reportError(`Required argument ${type.name}.${field.name}(${argName}:) cannot be deprecated.`, [getDeprecatedDirectiveNode(arg.astNode), (_arg$astNode3 = arg.astNode) === null || _arg$astNode3 === void 0 ? void 0 : _arg$astNode3.type]); + } + } + } +} +function validateInterfaces(context, type) { + const ifaceTypeNames = Object.create(null); + for (const iface of type.getInterfaces()) { + if (!(0, _definition.isInterfaceType)(iface)) { + context.reportError(`Type ${(0, _inspect.inspect)(type)} must only implement Interface types, ` + `it cannot implement ${(0, _inspect.inspect)(iface)}.`, getAllImplementsInterfaceNodes(type, iface)); + continue; + } + if (type === iface) { + context.reportError(`Type ${type.name} cannot implement itself because it would create a circular reference.`, getAllImplementsInterfaceNodes(type, iface)); + continue; + } + if (ifaceTypeNames[iface.name]) { + context.reportError(`Type ${type.name} can only implement ${iface.name} once.`, getAllImplementsInterfaceNodes(type, iface)); + continue; + } + ifaceTypeNames[iface.name] = true; + validateTypeImplementsAncestors(context, type, iface); + validateTypeImplementsInterface(context, type, iface); } - state.pos += url.length - proto.length; - return true; } +function validateTypeImplementsInterface(context, type, iface) { + const typeFieldMap = type.getFields(); // Assert each interface field is implemented. -// Proceess '\n' + for (const ifaceField of Object.values(iface.getFields())) { + const fieldName = ifaceField.name; + const typeField = typeFieldMap[fieldName]; // Assert interface field exists on type. -function newline(state, silent) { - let pos = state.pos; - if (state.src.charCodeAt(pos) !== 0x0A /* \n */) { - return false; - } - const pmax = state.pending.length - 1; - const max = state.posMax; + if (!typeField) { + context.reportError(`Interface field ${iface.name}.${fieldName} expected but ${type.name} does not provide it.`, [ifaceField.astNode, type.astNode, ...type.extensionASTNodes]); + continue; + } // Assert interface field type is satisfied by type field type, by being + // a valid subtype. (covariant) - // ' \n' -> hardbreak - // Lookup in pending chars is bad practice! Don't copy to other rules! - // Pending string is stored in concat mode, indexed lookups will cause - // convertion to flat mode. - if (!silent) { - if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) { - if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) { - // Find whitespaces tail of pending chars. - let ws = pmax - 1; - while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws--; - state.pending = state.pending.slice(0, ws); - state.push('hardbreak', 'br', 0); - } else { - state.pending = state.pending.slice(0, -1); - state.push('softbreak', 'br', 0); - } - } else { - state.push('softbreak', 'br', 0); - } - } - pos++; + if (!(0, _typeComparators.isTypeSubTypeOf)(context.schema, typeField.type, ifaceField.type)) { + var _ifaceField$astNode, _typeField$astNode; + context.reportError(`Interface field ${iface.name}.${fieldName} expects type ` + `${(0, _inspect.inspect)(ifaceField.type)} but ${type.name}.${fieldName} ` + `is type ${(0, _inspect.inspect)(typeField.type)}.`, [(_ifaceField$astNode = ifaceField.astNode) === null || _ifaceField$astNode === void 0 ? void 0 : _ifaceField$astNode.type, (_typeField$astNode = typeField.astNode) === null || _typeField$astNode === void 0 ? void 0 : _typeField$astNode.type]); + } // Assert each interface field arg is implemented. - // skip heading spaces for next line - while (pos < max && isSpace(state.src.charCodeAt(pos))) { - pos++; - } - state.pos = pos; - return true; -} + for (const ifaceArg of ifaceField.args) { + const argName = ifaceArg.name; + const typeArg = typeField.args.find(arg => arg.name === argName); // Assert interface field arg exists on object field. -// Process escaped chars and hardbreaks + if (!typeArg) { + context.reportError(`Interface field argument ${iface.name}.${fieldName}(${argName}:) expected but ${type.name}.${fieldName} does not provide it.`, [ifaceArg.astNode, typeField.astNode]); + continue; + } // Assert interface field arg type matches object field arg type. + // (invariant) + // TODO: change to contravariant? -const ESCAPED = []; -for (let i = 0; i < 256; i++) { - ESCAPED.push(0); -} -'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'.split('').forEach(function (ch) { - ESCAPED[ch.charCodeAt(0)] = 1; -}); -function escape(state, silent) { - let pos = state.pos; - const max = state.posMax; - if (state.src.charCodeAt(pos) !== 0x5C /* \ */) return false; - pos++; + if (!(0, _typeComparators.isEqualType)(ifaceArg.type, typeArg.type)) { + var _ifaceArg$astNode, _typeArg$astNode; + context.reportError(`Interface field argument ${iface.name}.${fieldName}(${argName}:) ` + `expects type ${(0, _inspect.inspect)(ifaceArg.type)} but ` + `${type.name}.${fieldName}(${argName}:) is type ` + `${(0, _inspect.inspect)(typeArg.type)}.`, [(_ifaceArg$astNode = ifaceArg.astNode) === null || _ifaceArg$astNode === void 0 ? void 0 : _ifaceArg$astNode.type, (_typeArg$astNode = typeArg.astNode) === null || _typeArg$astNode === void 0 ? void 0 : _typeArg$astNode.type]); + } // TODO: validate default values? + } // Assert additional arguments must not be required. - // '\' at the end of the inline block - if (pos >= max) return false; - let ch1 = state.src.charCodeAt(pos); - if (ch1 === 0x0A) { - if (!silent) { - state.push('hardbreak', 'br', 0); - } - pos++; - // skip leading whitespaces from next line - while (pos < max) { - ch1 = state.src.charCodeAt(pos); - if (!isSpace(ch1)) break; - pos++; + for (const typeArg of typeField.args) { + const argName = typeArg.name; + const ifaceArg = ifaceField.args.find(arg => arg.name === argName); + if (!ifaceArg && (0, _definition.isRequiredArgument)(typeArg)) { + context.reportError(`Object field ${type.name}.${fieldName} includes required argument ${argName} that is missing from the Interface field ${iface.name}.${fieldName}.`, [typeArg.astNode, ifaceField.astNode]); + } } - state.pos = pos; - return true; } - let escapedStr = state.src[pos]; - if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) { - const ch2 = state.src.charCodeAt(pos + 1); - if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { - escapedStr += state.src[pos + 1]; - pos++; +} +function validateTypeImplementsAncestors(context, type, iface) { + const ifaceInterfaces = type.getInterfaces(); + for (const transitive of iface.getInterfaces()) { + if (!ifaceInterfaces.includes(transitive)) { + context.reportError(transitive === type ? `Type ${type.name} cannot implement ${iface.name} because it would create a circular reference.` : `Type ${type.name} must implement ${transitive.name} because it is implemented by ${iface.name}.`, [...getAllImplementsInterfaceNodes(iface, transitive), ...getAllImplementsInterfaceNodes(type, iface)]); } } - const origStr = '\\' + escapedStr; - if (!silent) { - const token = state.push('text_special', '', 0); - if (ch1 < 256 && ESCAPED[ch1] !== 0) { - token.content = escapedStr; - } else { - token.content = origStr; +} +function validateUnionMembers(context, union) { + const memberTypes = union.getTypes(); + if (memberTypes.length === 0) { + context.reportError(`Union type ${union.name} must define one or more member types.`, [union.astNode, ...union.extensionASTNodes]); + } + const includedTypeNames = Object.create(null); + for (const memberType of memberTypes) { + if (includedTypeNames[memberType.name]) { + context.reportError(`Union type ${union.name} can only include type ${memberType.name} once.`, getUnionMemberTypeNodes(union, memberType.name)); + continue; + } + includedTypeNames[memberType.name] = true; + if (!(0, _definition.isObjectType)(memberType)) { + context.reportError(`Union type ${union.name} can only include Object types, ` + `it cannot include ${(0, _inspect.inspect)(memberType)}.`, getUnionMemberTypeNodes(union, String(memberType))); } - token.markup = origStr; - token.info = 'escape'; } - state.pos = pos + 1; - return true; } +function validateEnumValues(context, enumType) { + const enumValues = enumType.getValues(); + if (enumValues.length === 0) { + context.reportError(`Enum type ${enumType.name} must define one or more values.`, [enumType.astNode, ...enumType.extensionASTNodes]); + } + for (const enumValue of enumValues) { + // Ensure valid name. + validateName(context, enumValue); + } +} +function validateInputFields(context, inputObj) { + const fields = Object.values(inputObj.getFields()); + if (fields.length === 0) { + context.reportError(`Input Object type ${inputObj.name} must define one or more fields.`, [inputObj.astNode, ...inputObj.extensionASTNodes]); + } // Ensure the arguments are valid -// Parse backticks + for (const field of fields) { + // Ensure they are named correctly. + validateName(context, field); // Ensure the type is an input type -function backtick(state, silent) { - let pos = state.pos; - const ch = state.src.charCodeAt(pos); - if (ch !== 0x60 /* ` */) { - return false; + if (!(0, _definition.isInputType)(field.type)) { + var _field$astNode2; + context.reportError(`The type of ${inputObj.name}.${field.name} must be Input Type ` + `but got: ${(0, _inspect.inspect)(field.type)}.`, (_field$astNode2 = field.astNode) === null || _field$astNode2 === void 0 ? void 0 : _field$astNode2.type); + } + if ((0, _definition.isRequiredInputField)(field) && field.deprecationReason != null) { + var _field$astNode3; + context.reportError(`Required input field ${inputObj.name}.${field.name} cannot be deprecated.`, [getDeprecatedDirectiveNode(field.astNode), (_field$astNode3 = field.astNode) === null || _field$astNode3 === void 0 ? void 0 : _field$astNode3.type]); + } + if (inputObj.isOneOf) { + validateOneOfInputObjectField(inputObj, field, context); + } } - const start = pos; - pos++; - const max = state.posMax; - - // scan marker length - while (pos < max && state.src.charCodeAt(pos) === 0x60 /* ` */) { - pos++; +} +function validateOneOfInputObjectField(type, field, context) { + if ((0, _definition.isNonNullType)(field.type)) { + var _field$astNode4; + context.reportError(`OneOf input field ${type.name}.${field.name} must be nullable.`, (_field$astNode4 = field.astNode) === null || _field$astNode4 === void 0 ? void 0 : _field$astNode4.type); } - const marker = state.src.slice(start, pos); - const openerLength = marker.length; - if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) { - if (!silent) state.pending += marker; - state.pos += openerLength; - return true; + if (field.defaultValue !== undefined) { + context.reportError(`OneOf input field ${type.name}.${field.name} cannot have a default value.`, field.astNode); } - let matchEnd = pos; - let matchStart; +} +function createInputObjectCircularRefsValidator(context) { + // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'. + // Tracks already visited types to maintain O(N) and to ensure that cycles + // are not redundantly reported. + const visitedTypes = Object.create(null); // Array of types nodes used to produce meaningful errors - // Nothing found in the cache, scan until the end of the line (or until marker is found) - while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) { - matchEnd = matchStart + 1; + const fieldPath = []; // Position in the type path - // scan marker length - while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60 /* ` */) { - matchEnd++; + const fieldPathIndexByTypeName = Object.create(null); + return detectCycleRecursive; // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + + function detectCycleRecursive(inputObj) { + if (visitedTypes[inputObj.name]) { + return; } - const closerLength = matchEnd - matchStart; - if (closerLength === openerLength) { - // Found matching closer length. - if (!silent) { - const token = state.push('code_inline', 'code', 0); - token.markup = marker; - token.content = state.src.slice(pos, matchStart).replace(/\n/g, ' ').replace(/^ (.+) $/, '$1'); + visitedTypes[inputObj.name] = true; + fieldPathIndexByTypeName[inputObj.name] = fieldPath.length; + const fields = Object.values(inputObj.getFields()); + for (const field of fields) { + if ((0, _definition.isNonNullType)(field.type) && (0, _definition.isInputObjectType)(field.type.ofType)) { + const fieldType = field.type.ofType; + const cycleIndex = fieldPathIndexByTypeName[fieldType.name]; + fieldPath.push(field); + if (cycleIndex === undefined) { + detectCycleRecursive(fieldType); + } else { + const cyclePath = fieldPath.slice(cycleIndex); + const pathStr = cyclePath.map(fieldObj => fieldObj.name).join('.'); + context.reportError(`Cannot reference Input Object "${fieldType.name}" within itself through a series of non-null fields: "${pathStr}".`, cyclePath.map(fieldObj => fieldObj.astNode)); + } + fieldPath.pop(); } - state.pos = matchEnd; - return true; } - - // Some different length found, put it in cache as upper limit of where closer can be found - state.backticks[closerLength] = matchStart; + fieldPathIndexByTypeName[inputObj.name] = undefined; } +} +function getAllImplementsInterfaceNodes(type, iface) { + const { + astNode, + extensionASTNodes + } = type; + const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - // Scanned through the end, didn't find anything - state.backticksScanned = true; - if (!silent) state.pending += marker; - state.pos += openerLength; - return true; + return nodes.flatMap(typeNode => { + var _typeNode$interfaces; + return /* c8 ignore next */( + (_typeNode$interfaces = typeNode.interfaces) !== null && _typeNode$interfaces !== void 0 ? _typeNode$interfaces : [] + ); + }).filter(ifaceNode => ifaceNode.name.value === iface.name); +} +function getUnionMemberTypeNodes(union, typeName) { + const { + astNode, + extensionASTNodes + } = union; + const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; // FIXME: https://github.com/graphql/graphql-js/issues/2203 + + return nodes.flatMap(unionNode => { + var _unionNode$types; + return /* c8 ignore next */( + (_unionNode$types = unionNode.types) !== null && _unionNode$types !== void 0 ? _unionNode$types : [] + ); + }).filter(typeNode => typeNode.name.value === typeName); +} +function getDeprecatedDirectiveNode(definitionNode) { + var _definitionNode$direc; + return definitionNode === null || definitionNode === void 0 ? void 0 : (_definitionNode$direc = definitionNode.directives) === null || _definitionNode$direc === void 0 ? void 0 : _definitionNode$direc.find(node => node.name.value === _directives.GraphQLDeprecatedDirective.name); } -// ~~strike through~~ -// +/***/ }), -// Insert each marker as a separate text token, and add it to delimiter list -// -function strikethrough_tokenize(state, silent) { - const start = state.pos; - const marker = state.src.charCodeAt(start); - if (silent) { - return false; - } - if (marker !== 0x7E /* ~ */) { - return false; - } - const scanned = state.scanDelims(state.pos, true); - let len = scanned.length; - const ch = String.fromCharCode(marker); - if (len < 2) { - return false; - } - let token; - if (len % 2) { - token = state.push('text', '', 0); - token.content = ch; - len--; +/***/ "../../../node_modules/graphql/utilities/TypeInfo.mjs": +/*!************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/TypeInfo.mjs ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.TypeInfo = void 0; +exports.visitWithTypeInfo = visitWithTypeInfo; +var _ast = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _visitor = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +var _typeFromAST = __webpack_require__(/*! ./typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); +/** + * TypeInfo is a utility class which, given a GraphQL schema, can keep track + * of the current field and type definitions at any point in a GraphQL document + * AST during a recursive descent by calling `enter(node)` and `leave(node)`. + */ + +class TypeInfo { + constructor(schema, + /** + * Initial type may be provided in rare cases to facilitate traversals + * beginning somewhere other than documents. + */ + initialType, /** @deprecated will be removed in 17.0.0 */ + getFieldDefFn) { + this._schema = schema; + this._typeStack = []; + this._parentTypeStack = []; + this._inputTypeStack = []; + this._fieldDefStack = []; + this._defaultValueStack = []; + this._directive = null; + this._argument = null; + this._enumValue = null; + this._getFieldDef = getFieldDefFn !== null && getFieldDefFn !== void 0 ? getFieldDefFn : getFieldDef; + if (initialType) { + if ((0, _definition.isInputType)(initialType)) { + this._inputTypeStack.push(initialType); + } + if ((0, _definition.isCompositeType)(initialType)) { + this._parentTypeStack.push(initialType); + } + if ((0, _definition.isOutputType)(initialType)) { + this._typeStack.push(initialType); + } + } } - for (let i = 0; i < len; i += 2) { - token = state.push('text', '', 0); - token.content = ch + ch; - state.delimiters.push({ - marker, - length: 0, - // disable "rule of 3" length checks meant for emphasis - token: state.tokens.length - 1, - end: -1, - open: scanned.can_open, - close: scanned.can_close - }); + get [Symbol.toStringTag]() { + return 'TypeInfo'; } - state.pos += scanned.length; - return true; -} -function postProcess$1(state, delimiters) { - let token; - const loneMarkers = []; - const max = delimiters.length; - for (let i = 0; i < max; i++) { - const startDelim = delimiters[i]; - if (startDelim.marker !== 0x7E /* ~ */) { - continue; + getType() { + if (this._typeStack.length > 0) { + return this._typeStack[this._typeStack.length - 1]; } - if (startDelim.end === -1) { - continue; + } + getParentType() { + if (this._parentTypeStack.length > 0) { + return this._parentTypeStack[this._parentTypeStack.length - 1]; } - const endDelim = delimiters[startDelim.end]; - token = state.tokens[startDelim.token]; - token.type = 's_open'; - token.tag = 's'; - token.nesting = 1; - token.markup = '~~'; - token.content = ''; - token = state.tokens[endDelim.token]; - token.type = 's_close'; - token.tag = 's'; - token.nesting = -1; - token.markup = '~~'; - token.content = ''; - if (state.tokens[endDelim.token - 1].type === 'text' && state.tokens[endDelim.token - 1].content === '~') { - loneMarkers.push(endDelim.token - 1); + } + getInputType() { + if (this._inputTypeStack.length > 0) { + return this._inputTypeStack[this._inputTypeStack.length - 1]; } } - - // If a marker sequence has an odd number of characters, it's splitted - // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the - // start of the sequence. - // - // So, we have to move all those markers after subsequent s_close tags. - // - while (loneMarkers.length) { - const i = loneMarkers.pop(); - let j = i + 1; - while (j < state.tokens.length && state.tokens[j].type === 's_close') { - j++; + getParentInputType() { + if (this._inputTypeStack.length > 1) { + return this._inputTypeStack[this._inputTypeStack.length - 2]; } - j--; - if (i !== j) { - token = state.tokens[j]; - state.tokens[j] = state.tokens[i]; - state.tokens[i] = token; + } + getFieldDef() { + if (this._fieldDefStack.length > 0) { + return this._fieldDefStack[this._fieldDefStack.length - 1]; } } -} - -// Walk through delimiter list and replace text tokens with tags -// -function strikethrough_postProcess(state) { - const tokens_meta = state.tokens_meta; - const max = state.tokens_meta.length; - postProcess$1(state, state.delimiters); - for (let curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - postProcess$1(state, tokens_meta[curr].delimiters); + getDefaultValue() { + if (this._defaultValueStack.length > 0) { + return this._defaultValueStack[this._defaultValueStack.length - 1]; } } -} -var r_strikethrough = { - tokenize: strikethrough_tokenize, - postProcess: strikethrough_postProcess -}; - -// Process *this* and _that_ -// - -// Insert each marker as a separate text token, and add it to delimiter list -// -function emphasis_tokenize(state, silent) { - const start = state.pos; - const marker = state.src.charCodeAt(start); - if (silent) { - return false; + getDirective() { + return this._directive; } - if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { - return false; + getArgument() { + return this._argument; } - const scanned = state.scanDelims(state.pos, marker === 0x2A); - for (let i = 0; i < scanned.length; i++) { - const token = state.push('text', '', 0); - token.content = String.fromCharCode(marker); - state.delimiters.push({ - // Char code of the starting marker (number). - // - marker, - // Total length of these series of delimiters. - // - length: scanned.length, - // A position of the token this delimiter corresponds to. - // - token: state.tokens.length - 1, - // If this delimiter is matched as a valid opener, `end` will be - // equal to its position, otherwise it's `-1`. - // - end: -1, - // Boolean flags that determine if this delimiter could open or close - // an emphasis. - // - open: scanned.can_open, - close: scanned.can_close - }); + getEnumValue() { + return this._enumValue; } - state.pos += scanned.length; - return true; -} -function postProcess(state, delimiters) { - const max = delimiters.length; - for (let i = max - 1; i >= 0; i--) { - const startDelim = delimiters[i]; - if (startDelim.marker !== 0x5F /* _ */ && startDelim.marker !== 0x2A /* * */) { - continue; - } + enter(node) { + const schema = this._schema; // Note: many of the types below are explicitly typed as "unknown" to drop + // any assumptions of a valid schema to ensure runtime types are properly + // checked before continuing since TypeInfo is used as part of validation + // which occurs before guarantees of schema and document validity. - // Process only opening markers - if (startDelim.end === -1) { - continue; - } - const endDelim = delimiters[startDelim.end]; + switch (node.kind) { + case _kinds.Kind.SELECTION_SET: + { + const namedType = (0, _definition.getNamedType)(this.getType()); + this._parentTypeStack.push((0, _definition.isCompositeType)(namedType) ? namedType : undefined); + break; + } + case _kinds.Kind.FIELD: + { + const parentType = this.getParentType(); + let fieldDef; + let fieldType; + if (parentType) { + fieldDef = this._getFieldDef(schema, parentType, node); + if (fieldDef) { + fieldType = fieldDef.type; + } + } + this._fieldDefStack.push(fieldDef); + this._typeStack.push((0, _definition.isOutputType)(fieldType) ? fieldType : undefined); + break; + } + case _kinds.Kind.DIRECTIVE: + this._directive = schema.getDirective(node.name.value); + break; + case _kinds.Kind.OPERATION_DEFINITION: + { + const rootType = schema.getRootType(node.operation); + this._typeStack.push((0, _definition.isObjectType)(rootType) ? rootType : undefined); + break; + } + case _kinds.Kind.INLINE_FRAGMENT: + case _kinds.Kind.FRAGMENT_DEFINITION: + { + const typeConditionAST = node.typeCondition; + const outputType = typeConditionAST ? (0, _typeFromAST.typeFromAST)(schema, typeConditionAST) : (0, _definition.getNamedType)(this.getType()); + this._typeStack.push((0, _definition.isOutputType)(outputType) ? outputType : undefined); + break; + } + case _kinds.Kind.VARIABLE_DEFINITION: + { + const inputType = (0, _typeFromAST.typeFromAST)(schema, node.type); + this._inputTypeStack.push((0, _definition.isInputType)(inputType) ? inputType : undefined); + break; + } + case _kinds.Kind.ARGUMENT: + { + var _this$getDirective; + let argDef; + let argType; + const fieldOrDirective = (_this$getDirective = this.getDirective()) !== null && _this$getDirective !== void 0 ? _this$getDirective : this.getFieldDef(); + if (fieldOrDirective) { + argDef = fieldOrDirective.args.find(arg => arg.name === node.name.value); + if (argDef) { + argType = argDef.type; + } + } + this._argument = argDef; + this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined); + this._inputTypeStack.push((0, _definition.isInputType)(argType) ? argType : undefined); + break; + } + case _kinds.Kind.LIST: + { + const listType = (0, _definition.getNullableType)(this.getInputType()); + const itemType = (0, _definition.isListType)(listType) ? listType.ofType : listType; // List positions never have a default value. - // If the previous delimiter has the same marker and is adjacent to this one, - // merge those into one strong delimiter. - // - // `whatever` -> `whatever` - // - const isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && - // check that first two markers match and adjacent - delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 && - // check that last two markers are adjacent (we can safely assume they match) - delimiters[startDelim.end + 1].token === endDelim.token + 1; - const ch = String.fromCharCode(startDelim.marker); - const token_o = state.tokens[startDelim.token]; - token_o.type = isStrong ? 'strong_open' : 'em_open'; - token_o.tag = isStrong ? 'strong' : 'em'; - token_o.nesting = 1; - token_o.markup = isStrong ? ch + ch : ch; - token_o.content = ''; - const token_c = state.tokens[endDelim.token]; - token_c.type = isStrong ? 'strong_close' : 'em_close'; - token_c.tag = isStrong ? 'strong' : 'em'; - token_c.nesting = -1; - token_c.markup = isStrong ? ch + ch : ch; - token_c.content = ''; - if (isStrong) { - state.tokens[delimiters[i - 1].token].content = ''; - state.tokens[delimiters[startDelim.end + 1].token].content = ''; - i--; + this._defaultValueStack.push(undefined); + this._inputTypeStack.push((0, _definition.isInputType)(itemType) ? itemType : undefined); + break; + } + case _kinds.Kind.OBJECT_FIELD: + { + const objectType = (0, _definition.getNamedType)(this.getInputType()); + let inputFieldType; + let inputField; + if ((0, _definition.isInputObjectType)(objectType)) { + inputField = objectType.getFields()[node.name.value]; + if (inputField) { + inputFieldType = inputField.type; + } + } + this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined); + this._inputTypeStack.push((0, _definition.isInputType)(inputFieldType) ? inputFieldType : undefined); + break; + } + case _kinds.Kind.ENUM: + { + const enumType = (0, _definition.getNamedType)(this.getInputType()); + let enumValue; + if ((0, _definition.isEnumType)(enumType)) { + enumValue = enumType.getValue(node.value); + } + this._enumValue = enumValue; + break; + } + default: // Ignore other nodes } } -} - -// Walk through delimiter list and replace text tokens with tags -// -function emphasis_post_process(state) { - const tokens_meta = state.tokens_meta; - const max = state.tokens_meta.length; - postProcess(state, state.delimiters); - for (let curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - postProcess(state, tokens_meta[curr].delimiters); + leave(node) { + switch (node.kind) { + case _kinds.Kind.SELECTION_SET: + this._parentTypeStack.pop(); + break; + case _kinds.Kind.FIELD: + this._fieldDefStack.pop(); + this._typeStack.pop(); + break; + case _kinds.Kind.DIRECTIVE: + this._directive = null; + break; + case _kinds.Kind.OPERATION_DEFINITION: + case _kinds.Kind.INLINE_FRAGMENT: + case _kinds.Kind.FRAGMENT_DEFINITION: + this._typeStack.pop(); + break; + case _kinds.Kind.VARIABLE_DEFINITION: + this._inputTypeStack.pop(); + break; + case _kinds.Kind.ARGUMENT: + this._argument = null; + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case _kinds.Kind.LIST: + case _kinds.Kind.OBJECT_FIELD: + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case _kinds.Kind.ENUM: + this._enumValue = null; + break; + default: // Ignore other nodes } } } -var r_emphasis = { - tokenize: emphasis_tokenize, - postProcess: emphasis_post_process -}; - -// Process [link]( "stuff") -function link(state, silent) { - let code, label, res, ref; - let href = ''; - let title = ''; - let start = state.pos; - let parseReference = true; - if (state.src.charCodeAt(state.pos) !== 0x5B /* [ */) { - return false; +/** + * Not exactly the same as the executor's definition of getFieldDef, in this + * statically evaluated environment we do not always have an Object type, + * and need to handle Interface and Union types. + */ +exports.TypeInfo = TypeInfo; +function getFieldDef(schema, parentType, fieldNode) { + const name = fieldNode.name.value; + if (name === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { + return _introspection.SchemaMetaFieldDef; } - const oldPos = state.pos; - const max = state.posMax; - const labelStart = state.pos + 1; - const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true); - - // parser failed to find ']', so it's not a valid link - if (labelEnd < 0) { - return false; + if (name === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) { + return _introspection.TypeMetaFieldDef; } - let pos = labelEnd + 1; - if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { - // - // Inline link - // - - // might have found a valid shortcut link, disable reference parsing - parseReference = false; + if (name === _introspection.TypeNameMetaFieldDef.name && (0, _definition.isCompositeType)(parentType)) { + return _introspection.TypeNameMetaFieldDef; + } + if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) { + return parentType.getFields()[name]; + } +} +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + */ - // [link]( "title" ) - // ^^ skipping these spaces - pos++; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; +function visitWithTypeInfo(typeInfo, visitor) { + return { + enter(...args) { + const node = args[0]; + typeInfo.enter(node); + const fn = (0, _visitor.getEnterLeaveForKind)(visitor, node.kind).enter; + if (fn) { + const result = fn.apply(visitor, args); + if (result !== undefined) { + typeInfo.leave(node); + if ((0, _ast.isNode)(result)) { + typeInfo.enter(result); + } + } + return result; } + }, + leave(...args) { + const node = args[0]; + const fn = (0, _visitor.getEnterLeaveForKind)(visitor, node.kind).leave; + let result; + if (fn) { + result = fn.apply(visitor, args); + } + typeInfo.leave(node); + return result; } - if (pos >= max) { - return false; - } + }; +} - // [link]( "title" ) - // ^^^^^^ parsing link destination - start = pos; - res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); - if (res.ok) { - href = state.md.normalizeLink(res.str); - if (state.md.validateLink(href)) { - pos = res.pos; - } else { - href = ''; - } +/***/ }), - // [link]( "title" ) - // ^^ skipping these spaces - start = pos; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } +/***/ "../../../node_modules/graphql/utilities/assertValidName.mjs": +/*!*******************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/assertValidName.mjs ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // [link]( "title" ) - // ^^^^^^^ parsing link title - res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; +"use strict"; - // [link]( "title" ) - // ^^ skipping these spaces - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } - } - } - if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { - // parsing a valid shortcut link failed, fallback to reference - parseReference = true; - } - pos++; - } - if (parseReference) { - // - // Link reference - // - if (typeof state.env.references === 'undefined') { - return false; - } - if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { - start = pos + 1; - pos = state.md.helpers.parseLinkLabel(state, pos); - if (pos >= 0) { - label = state.src.slice(start, pos++); - } else { - pos = labelEnd + 1; - } - } else { - pos = labelEnd + 1; - } - // covers label === '' and label === undefined - // (collapsed reference link and shortcut reference link respectively) - if (!label) { - label = state.src.slice(labelStart, labelEnd); - } - ref = state.env.references[normalizeReference(label)]; - if (!ref) { - state.pos = oldPos; - return false; - } - href = ref.href; - title = ref.title; - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.assertValidName = assertValidName; +exports.isValidNameError = isValidNameError; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _assertName = __webpack_require__(/*! ../type/assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); +/* c8 ignore start */ - // - // We found the end of the link, and know for a fact it's a valid link; - // so all that's left to do is to call tokenizer. - // - if (!silent) { - state.pos = labelStart; - state.posMax = labelEnd; - const token_o = state.push('link_open', 'a', 1); - const attrs = [['href', href]]; - token_o.attrs = attrs; - if (title) { - attrs.push(['title', title]); - } - state.linkLevel++; - state.md.inline.tokenize(state); - state.linkLevel--; - state.push('link_close', 'a', -1); +/** + * Upholds the spec rules about naming. + * @deprecated Please use `assertName` instead. Will be removed in v17 + */ + +function assertValidName(name) { + const error = isValidNameError(name); + if (error) { + throw error; } - state.pos = pos; - state.posMax = max; - return true; + return name; } +/** + * Returns an Error if a name is invalid. + * @deprecated Please use `assertName` instead. Will be removed in v17 + */ -// Process ![image]( "title") - -function image(state, silent) { - let code, content, label, pos, ref, res, title, start; - let href = ''; - const oldPos = state.pos; - const max = state.posMax; - if (state.src.charCodeAt(state.pos) !== 0x21 /* ! */) { - return false; +function isValidNameError(name) { + typeof name === 'string' || (0, _devAssert.devAssert)(false, 'Expected name to be a string.'); + if (name.startsWith('__')) { + return new _GraphQLError.GraphQLError(`Name "${name}" must not begin with "__", which is reserved by GraphQL introspection.`); } - if (state.src.charCodeAt(state.pos + 1) !== 0x5B /* [ */) { - return false; + try { + (0, _assertName.assertName)(name); + } catch (error) { + return error; } - const labelStart = state.pos + 2; - const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false); +} +/* c8 ignore stop */ - // parser failed to find ']', so it's not a valid link - if (labelEnd < 0) { - return false; - } - pos = labelEnd + 1; - if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { - // - // Inline link - // +/***/ }), - // [link]( "title" ) - // ^^ skipping these spaces - pos++; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } - if (pos >= max) { - return false; - } +/***/ "../../../node_modules/graphql/utilities/astFromValue.mjs": +/*!****************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/astFromValue.mjs ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // [link]( "title" ) - // ^^^^^^ parsing link destination - start = pos; - res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); - if (res.ok) { - href = state.md.normalizeLink(res.str); - if (state.md.validateLink(href)) { - pos = res.pos; - } else { - href = ''; - } - } +"use strict"; - // [link]( "title" ) - // ^^ skipping these spaces - start = pos; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } - // [link]( "title" ) - // ^^^^^^^ parsing link title - res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.astFromValue = astFromValue; +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _isIterableObject = __webpack_require__(/*! ../jsutils/isIterableObject.mjs */ "../../../node_modules/graphql/jsutils/isIterableObject.mjs"); +var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using suggested GraphQLInputType. For example: + * + * astFromValue("value", GraphQLString) + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | Unknown | Enum Value | + * | null | NullValue | + * + */ - // [link]( "title" ) - // ^^ skipping these spaces - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; +function astFromValue(value, type) { + if ((0, _definition.isNonNullType)(type)) { + const astValue = astFromValue(value, type.ofType); + if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) { + return null; + } + return astValue; + } // only explicit null, not undefined, NaN + + if (value === null) { + return { + kind: _kinds.Kind.NULL + }; + } // undefined + + if (value === undefined) { + return null; + } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + + if ((0, _definition.isListType)(type)) { + const itemType = type.ofType; + if ((0, _isIterableObject.isIterableObject)(value)) { + const valuesNodes = []; + for (const item of value) { + const itemNode = astFromValue(item, itemType); + if (itemNode != null) { + valuesNodes.push(itemNode); } } - } else { - title = ''; - } - if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { - state.pos = oldPos; - return false; + return { + kind: _kinds.Kind.LIST, + values: valuesNodes + }; } - pos++; - } else { - // - // Link reference - // - if (typeof state.env.references === 'undefined') { - return false; + return astFromValue(value, itemType); + } // Populate the fields of the input object by creating ASTs from each value + // in the JavaScript object according to the fields in the input type. + + if ((0, _definition.isInputObjectType)(type)) { + if (!(0, _isObjectLike.isObjectLike)(value)) { + return null; } - if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { - start = pos + 1; - pos = state.md.helpers.parseLinkLabel(state, pos); - if (pos >= 0) { - label = state.src.slice(start, pos++); - } else { - pos = labelEnd + 1; + const fieldNodes = []; + for (const field of Object.values(type.getFields())) { + const fieldValue = astFromValue(value[field.name], field.type); + if (fieldValue) { + fieldNodes.push({ + kind: _kinds.Kind.OBJECT_FIELD, + name: { + kind: _kinds.Kind.NAME, + value: field.name + }, + value: fieldValue + }); } - } else { - pos = labelEnd + 1; } + return { + kind: _kinds.Kind.OBJECT, + fields: fieldNodes + }; + } + if ((0, _definition.isLeafType)(type)) { + // Since value is an internally represented value, it must be serialized + // to an externally represented value before converting into an AST. + const serialized = type.serialize(value); + if (serialized == null) { + return null; + } // Others serialize based on their corresponding JavaScript scalar types. - // covers label === '' and label === undefined - // (collapsed reference link and shortcut reference link respectively) - if (!label) { - label = state.src.slice(labelStart, labelEnd); - } - ref = state.env.references[normalizeReference(label)]; - if (!ref) { - state.pos = oldPos; - return false; + if (typeof serialized === 'boolean') { + return { + kind: _kinds.Kind.BOOLEAN, + value: serialized + }; + } // JavaScript numbers can be Int or Float values. + + if (typeof serialized === 'number' && Number.isFinite(serialized)) { + const stringNum = String(serialized); + return integerStringRegExp.test(stringNum) ? { + kind: _kinds.Kind.INT, + value: stringNum + } : { + kind: _kinds.Kind.FLOAT, + value: stringNum + }; } - href = ref.href; - title = ref.title; - } + if (typeof serialized === 'string') { + // Enum types use Enum literals. + if ((0, _definition.isEnumType)(type)) { + return { + kind: _kinds.Kind.ENUM, + value: serialized + }; + } // ID types can use Int literals. - // - // We found the end of the link, and know for a fact it's a valid link; - // so all that's left to do is to call tokenizer. - // - if (!silent) { - content = state.src.slice(labelStart, labelEnd); - const tokens = []; - state.md.inline.parse(content, state.md, state.env, tokens); - const token = state.push('image', 'img', 0); - const attrs = [['src', href], ['alt', '']]; - token.attrs = attrs; - token.children = tokens; - token.content = content; - if (title) { - attrs.push(['title', title]); + if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) { + return { + kind: _kinds.Kind.INT, + value: serialized + }; + } + return { + kind: _kinds.Kind.STRING, + value: serialized + }; } + throw new TypeError(`Cannot convert value to AST: ${(0, _inspect.inspect)(serialized)}.`); } - state.pos = pos; - state.posMax = max; - return true; + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. + + false || (0, _invariant.invariant)(false, 'Unexpected input type: ' + (0, _inspect.inspect)(type)); } +/** + * IntValue: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit ( Digit+ )? + */ -// Process autolinks '' +const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; -/* eslint max-len:0 */ -const EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/; -/* eslint-disable-next-line no-control-regex */ -const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/; -function autolink(state, silent) { - let pos = state.pos; - if (state.src.charCodeAt(pos) !== 0x3C /* < */) { - return false; - } - const start = state.pos; - const max = state.posMax; - for (;;) { - if (++pos >= max) return false; - const ch = state.src.charCodeAt(pos); - if (ch === 0x3C /* < */) return false; - if (ch === 0x3E /* > */) break; - } - const url = state.src.slice(start + 1, pos); - if (AUTOLINK_RE.test(url)) { - const fullUrl = state.md.normalizeLink(url); - if (!state.md.validateLink(fullUrl)) { - return false; - } - if (!silent) { - const token_o = state.push('link_open', 'a', 1); - token_o.attrs = [['href', fullUrl]]; - token_o.markup = 'autolink'; - token_o.info = 'auto'; - const token_t = state.push('text', '', 0); - token_t.content = state.md.normalizeLinkText(url); - const token_c = state.push('link_close', 'a', -1); - token_c.markup = 'autolink'; - token_c.info = 'auto'; - } - state.pos += url.length + 2; - return true; +/***/ }), + +/***/ "../../../node_modules/graphql/utilities/buildASTSchema.mjs": +/*!******************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/buildASTSchema.mjs ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.buildASTSchema = buildASTSchema; +exports.buildSchema = buildSchema; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _parser = __webpack_require__(/*! ../language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); +var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +var _schema = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); +var _validate = __webpack_require__(/*! ../validation/validate.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); +var _extendSchema = __webpack_require__(/*! ./extendSchema.mjs */ "../../../node_modules/graphql/utilities/extendSchema.mjs"); +/** + * This takes the ast of a schema document produced by the parse function in + * src/language/parser.js. + * + * If no schema definition is provided, then it will look for types named Query, + * Mutation and Subscription. + * + * Given that AST it constructs a GraphQLSchema. The resulting schema + * has no resolve methods, so execution will use default resolvers. + */ +function buildASTSchema(documentAST, options) { + documentAST != null && documentAST.kind === _kinds.Kind.DOCUMENT || (0, _devAssert.devAssert)(false, 'Must provide valid Document AST.'); + if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) { + (0, _validate.assertValidSDL)(documentAST); } - if (EMAIL_RE.test(url)) { - const fullUrl = state.md.normalizeLink('mailto:' + url); - if (!state.md.validateLink(fullUrl)) { - return false; - } - if (!silent) { - const token_o = state.push('link_open', 'a', 1); - token_o.attrs = [['href', fullUrl]]; - token_o.markup = 'autolink'; - token_o.info = 'auto'; - const token_t = state.push('text', '', 0); - token_t.content = state.md.normalizeLinkText(url); - const token_c = state.push('link_close', 'a', -1); - token_c.markup = 'autolink'; - token_c.info = 'auto'; + const emptySchemaConfig = { + description: undefined, + types: [], + directives: [], + extensions: Object.create(null), + extensionASTNodes: [], + assumeValid: false + }; + const config = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options); + if (config.astNode == null) { + for (const type of config.types) { + switch (type.name) { + // Note: While this could make early assertions to get the correctly + // typed values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + case 'Query': + // @ts-expect-error validated in `validateSchema` + config.query = type; + break; + case 'Mutation': + // @ts-expect-error validated in `validateSchema` + config.mutation = type; + break; + case 'Subscription': + // @ts-expect-error validated in `validateSchema` + config.subscription = type; + break; + } } - state.pos += url.length + 2; - return true; } - return false; + const directives = [...config.directives, + // If specified directives were not explicitly declared, add them. + ..._directives.specifiedDirectives.filter(stdDirective => config.directives.every(directive => directive.name !== stdDirective.name))]; + return new _schema.GraphQLSchema({ + ...config, + directives + }); } +/** + * A helper function to build a GraphQLSchema directly from a source + * document. + */ -// Process html tags - -function isLinkOpen(str) { - return /^\s]/i.test(str); -} -function isLinkClose(str) { - return /^<\/a\s*>/i.test(str); -} -function isLetter(ch) { - /* eslint no-bitwise:0 */ - const lc = ch | 0x20; // to lower case - return lc >= 0x61 /* a */ && lc <= 0x7a /* z */; +function buildSchema(source, options) { + const document = (0, _parser.parse)(source, { + noLocation: options === null || options === void 0 ? void 0 : options.noLocation, + allowLegacyFragmentVariables: options === null || options === void 0 ? void 0 : options.allowLegacyFragmentVariables + }); + return buildASTSchema(document, { + assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL, + assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid + }); } -function html_inline(state, silent) { - if (!state.md.options.html) { - return false; - } - // Check start - const max = state.posMax; - const pos = state.pos; - if (state.src.charCodeAt(pos) !== 0x3C /* < */ || pos + 2 >= max) { - return false; - } +/***/ }), - // Quick fail on second char - const ch = state.src.charCodeAt(pos + 1); - if (ch !== 0x21 /* ! */ && ch !== 0x3F /* ? */ && ch !== 0x2F /* / */ && !isLetter(ch)) { - return false; - } - const match = state.src.slice(pos).match(HTML_TAG_RE); - if (!match) { - return false; - } - if (!silent) { - const token = state.push('html_inline', '', 0); - token.content = match[0]; - if (isLinkOpen(token.content)) state.linkLevel++; - if (isLinkClose(token.content)) state.linkLevel--; - } - state.pos += match[0].length; - return true; -} +/***/ "../../../node_modules/graphql/utilities/buildClientSchema.mjs": +/*!*********************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/buildClientSchema.mjs ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -// Process html entity - {, ¯, ", ... +"use strict"; -const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i; -const NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i; -function entity(state, silent) { - const pos = state.pos; - const max = state.posMax; - if (state.src.charCodeAt(pos) !== 0x26 /* & */) return false; - if (pos + 1 >= max) return false; - const ch = state.src.charCodeAt(pos + 1); - if (ch === 0x23 /* # */) { - const match = state.src.slice(pos).match(DIGITAL_RE); - if (match) { - if (!silent) { - const code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10); - const token = state.push('text_special', '', 0); - token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD); - token.markup = match[0]; - token.info = 'entity'; - } - state.pos += match[0].length; - return true; - } - } else { - const match = state.src.slice(pos).match(NAMED_RE); - if (match) { - const decoded = entities.decodeHTML(match[0]); - if (decoded !== match[0]) { - if (!silent) { - const token = state.push('text_special', '', 0); - token.content = decoded; - token.markup = match[0]; - token.info = 'entity'; - } - state.pos += match[0].length; - return true; - } - } - } - return false; -} -// For each opening emphasis-like marker find a matching closing one -// +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.buildClientSchema = buildClientSchema; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _keyValMap = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); +var _parser = __webpack_require__(/*! ../language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); +var _schema = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); +var _valueFromAST = __webpack_require__(/*! ./valueFromAST.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); +/** + * Build a GraphQLSchema for use by client tools. + * + * Given the result of a client running the introspection query, creates and + * returns a GraphQLSchema instance which can be then used with all graphql-js + * tools, but cannot be used to execute a query, as introspection does not + * represent the "resolver", "parse" or "serialize" functions or any other + * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. + */ -function processDelimiters(delimiters) { - const openersBottom = {}; - const max = delimiters.length; - if (!max) return; +function buildClientSchema(introspection, options) { + (0, _isObjectLike.isObjectLike)(introspection) && (0, _isObjectLike.isObjectLike)(introspection.__schema) || (0, _devAssert.devAssert)(false, `Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0, _inspect.inspect)(introspection)}.`); // Get the schema from the introspection result. - // headerIdx is the first delimiter of the current (where closer is) delimiter run - let headerIdx = 0; - let lastTokenIdx = -2; // needs any value lower than -1 - const jumps = []; - for (let closerIdx = 0; closerIdx < max; closerIdx++) { - const closer = delimiters[closerIdx]; - jumps.push(0); + const schemaIntrospection = introspection.__schema; // Iterate through all types, getting the type definition for each. - // markers belong to same delimiter run if: - // - they have adjacent tokens - // - AND markers are the same - // - if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) { - headerIdx = closerIdx; + const typeMap = (0, _keyValMap.keyValMap)(schemaIntrospection.types, typeIntrospection => typeIntrospection.name, typeIntrospection => buildType(typeIntrospection)); // Include standard types only if they are used. + + for (const stdType of [..._scalars.specifiedScalarTypes, ..._introspection.introspectionTypes]) { + if (typeMap[stdType.name]) { + typeMap[stdType.name] = stdType; } - lastTokenIdx = closer.token; + } // Get the root Query, Mutation, and Subscription types. - // Length is only used for emphasis-specific "rule of 3", - // if it's not defined (in strikethrough or 3rd party plugins), - // we can default it to 0 to disable those checks. - // - closer.length = closer.length || 0; - if (!closer.close) continue; + const queryType = schemaIntrospection.queryType ? getObjectType(schemaIntrospection.queryType) : null; + const mutationType = schemaIntrospection.mutationType ? getObjectType(schemaIntrospection.mutationType) : null; + const subscriptionType = schemaIntrospection.subscriptionType ? getObjectType(schemaIntrospection.subscriptionType) : null; // Get the directives supported by Introspection, assuming empty-set if + // directives were not queried for. - // Previously calculated lower bounds (previous fails) - // for each marker, each delimiter length modulo 3, - // and for whether this closer can be an opener; - // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460 - /* eslint-disable-next-line no-prototype-builtins */ - if (!openersBottom.hasOwnProperty(closer.marker)) { - openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]; - } - const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3]; - let openerIdx = headerIdx - jumps[headerIdx] - 1; - let newMinOpenerIdx = openerIdx; - for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) { - const opener = delimiters[openerIdx]; - if (opener.marker !== closer.marker) continue; - if (opener.open && opener.end < 0) { - let isOddMatch = false; + const directives = schemaIntrospection.directives ? schemaIntrospection.directives.map(buildDirective) : []; // Then produce and return a Schema with these types. - // from spec: - // - // If one of the delimiters can both open and close emphasis, then the - // sum of the lengths of the delimiter runs containing the opening and - // closing delimiters must not be a multiple of 3 unless both lengths - // are multiples of 3. - // - if (opener.close || closer.open) { - if ((opener.length + closer.length) % 3 === 0) { - if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { - isOddMatch = true; - } - } - } - if (!isOddMatch) { - // If previous delimiter cannot be an opener, we can safely skip - // the entire sequence in future checks. This is required to make - // sure algorithm has linear complexity (see *_*_*_*_*_... case). - // - const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0; - jumps[closerIdx] = closerIdx - openerIdx + lastJump; - jumps[openerIdx] = lastJump; - closer.open = false; - opener.end = closerIdx; - opener.close = false; - newMinOpenerIdx = -1; - // treat next token as start of run, - // it optimizes skips in **<...>**a**<...>** pathological case - lastTokenIdx = -2; - break; - } + return new _schema.GraphQLSchema({ + description: schemaIntrospection.description, + query: queryType, + mutation: mutationType, + subscription: subscriptionType, + types: Object.values(typeMap), + directives, + assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid + }); // Given a type reference in introspection, return the GraphQLType instance. + // preferring cached instances before building new instances. + + function getType(typeRef) { + if (typeRef.kind === _introspection.TypeKind.LIST) { + const itemRef = typeRef.ofType; + if (!itemRef) { + throw new Error('Decorated type deeper than introspection query.'); } + return new _definition.GraphQLList(getType(itemRef)); } - if (newMinOpenerIdx !== -1) { - // If match for this delimiter run failed, we want to set lower bound for - // future lookups. This is required to make sure algorithm has linear - // complexity. - // - // See details here: - // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442 - // - openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx; + if (typeRef.kind === _introspection.TypeKind.NON_NULL) { + const nullableRef = typeRef.ofType; + if (!nullableRef) { + throw new Error('Decorated type deeper than introspection query.'); + } + const nullableType = getType(nullableRef); + return new _definition.GraphQLNonNull((0, _definition.assertNullableType)(nullableType)); } + return getNamedType(typeRef); } -} -function link_pairs(state) { - const tokens_meta = state.tokens_meta; - const max = state.tokens_meta.length; - processDelimiters(state.delimiters); - for (let curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - processDelimiters(tokens_meta[curr].delimiters); + function getNamedType(typeRef) { + const typeName = typeRef.name; + if (!typeName) { + throw new Error(`Unknown type reference: ${(0, _inspect.inspect)(typeRef)}.`); + } + const type = typeMap[typeName]; + if (!type) { + throw new Error(`Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`); } + return type; } -} - -// Clean up tokens after emphasis and strikethrough postprocessing: -// merge adjacent text nodes into one and re-calculate all token levels -// -// This is necessary because initially emphasis delimiter markers (*, _, ~) -// are treated as their own separate text tokens. Then emphasis rule either -// leaves them as text (needed to merge with adjacent text) or turns them -// into opening/closing tags (which messes up levels inside). -// - -function fragments_join(state) { - let curr, last; - let level = 0; - const tokens = state.tokens; - const max = state.tokens.length; - for (curr = last = 0; curr < max; curr++) { - // re-calculate levels after emphasis/strikethrough turns some text nodes - // into opening/closing tags - if (tokens[curr].nesting < 0) level--; // closing tag - tokens[curr].level = level; - if (tokens[curr].nesting > 0) level++; // opening tag + function getObjectType(typeRef) { + return (0, _definition.assertObjectType)(getNamedType(typeRef)); + } + function getInterfaceType(typeRef) { + return (0, _definition.assertInterfaceType)(getNamedType(typeRef)); + } // Given a type's introspection result, construct the correct + // GraphQLType instance. - if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { - // collapse two adjacent text nodes - tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; - } else { - if (curr !== last) { - tokens[last] = tokens[curr]; + function buildType(type) { + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain + if (type != null && type.name != null && type.kind != null) { + // FIXME: Properly type IntrospectionType, it's a breaking change so fix in v17 + // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check + switch (type.kind) { + case _introspection.TypeKind.SCALAR: + return buildScalarDef(type); + case _introspection.TypeKind.OBJECT: + return buildObjectDef(type); + case _introspection.TypeKind.INTERFACE: + return buildInterfaceDef(type); + case _introspection.TypeKind.UNION: + return buildUnionDef(type); + case _introspection.TypeKind.ENUM: + return buildEnumDef(type); + case _introspection.TypeKind.INPUT_OBJECT: + return buildInputObjectDef(type); } - last++; } + const typeStr = (0, _inspect.inspect)(type); + throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${typeStr}.`); } - if (curr !== last) { - tokens.length = last; + function buildScalarDef(scalarIntrospection) { + return new _definition.GraphQLScalarType({ + name: scalarIntrospection.name, + description: scalarIntrospection.description, + specifiedByURL: scalarIntrospection.specifiedByURL + }); + } + function buildImplementationsList(implementingIntrospection) { + // TODO: Temporary workaround until GraphQL ecosystem will fully support + // 'interfaces' on interface types. + if (implementingIntrospection.interfaces === null && implementingIntrospection.kind === _introspection.TypeKind.INTERFACE) { + return []; + } + if (!implementingIntrospection.interfaces) { + const implementingIntrospectionStr = (0, _inspect.inspect)(implementingIntrospection); + throw new Error(`Introspection result missing interfaces: ${implementingIntrospectionStr}.`); + } + return implementingIntrospection.interfaces.map(getInterfaceType); + } + function buildObjectDef(objectIntrospection) { + return new _definition.GraphQLObjectType({ + name: objectIntrospection.name, + description: objectIntrospection.description, + interfaces: () => buildImplementationsList(objectIntrospection), + fields: () => buildFieldDefMap(objectIntrospection) + }); + } + function buildInterfaceDef(interfaceIntrospection) { + return new _definition.GraphQLInterfaceType({ + name: interfaceIntrospection.name, + description: interfaceIntrospection.description, + interfaces: () => buildImplementationsList(interfaceIntrospection), + fields: () => buildFieldDefMap(interfaceIntrospection) + }); + } + function buildUnionDef(unionIntrospection) { + if (!unionIntrospection.possibleTypes) { + const unionIntrospectionStr = (0, _inspect.inspect)(unionIntrospection); + throw new Error(`Introspection result missing possibleTypes: ${unionIntrospectionStr}.`); + } + return new _definition.GraphQLUnionType({ + name: unionIntrospection.name, + description: unionIntrospection.description, + types: () => unionIntrospection.possibleTypes.map(getObjectType) + }); + } + function buildEnumDef(enumIntrospection) { + if (!enumIntrospection.enumValues) { + const enumIntrospectionStr = (0, _inspect.inspect)(enumIntrospection); + throw new Error(`Introspection result missing enumValues: ${enumIntrospectionStr}.`); + } + return new _definition.GraphQLEnumType({ + name: enumIntrospection.name, + description: enumIntrospection.description, + values: (0, _keyValMap.keyValMap)(enumIntrospection.enumValues, valueIntrospection => valueIntrospection.name, valueIntrospection => ({ + description: valueIntrospection.description, + deprecationReason: valueIntrospection.deprecationReason + })) + }); + } + function buildInputObjectDef(inputObjectIntrospection) { + if (!inputObjectIntrospection.inputFields) { + const inputObjectIntrospectionStr = (0, _inspect.inspect)(inputObjectIntrospection); + throw new Error(`Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`); + } + return new _definition.GraphQLInputObjectType({ + name: inputObjectIntrospection.name, + description: inputObjectIntrospection.description, + fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields), + isOneOf: inputObjectIntrospection.isOneOf + }); + } + function buildFieldDefMap(typeIntrospection) { + if (!typeIntrospection.fields) { + throw new Error(`Introspection result missing fields: ${(0, _inspect.inspect)(typeIntrospection)}.`); + } + return (0, _keyValMap.keyValMap)(typeIntrospection.fields, fieldIntrospection => fieldIntrospection.name, buildField); + } + function buildField(fieldIntrospection) { + const type = getType(fieldIntrospection.type); + if (!(0, _definition.isOutputType)(type)) { + const typeStr = (0, _inspect.inspect)(type); + throw new Error(`Introspection must provide output type for fields, but received: ${typeStr}.`); + } + if (!fieldIntrospection.args) { + const fieldIntrospectionStr = (0, _inspect.inspect)(fieldIntrospection); + throw new Error(`Introspection result missing field args: ${fieldIntrospectionStr}.`); + } + return { + description: fieldIntrospection.description, + deprecationReason: fieldIntrospection.deprecationReason, + type, + args: buildInputValueDefMap(fieldIntrospection.args) + }; + } + function buildInputValueDefMap(inputValueIntrospections) { + return (0, _keyValMap.keyValMap)(inputValueIntrospections, inputValue => inputValue.name, buildInputValue); + } + function buildInputValue(inputValueIntrospection) { + const type = getType(inputValueIntrospection.type); + if (!(0, _definition.isInputType)(type)) { + const typeStr = (0, _inspect.inspect)(type); + throw new Error(`Introspection must provide input type for arguments, but received: ${typeStr}.`); + } + const defaultValue = inputValueIntrospection.defaultValue != null ? (0, _valueFromAST.valueFromAST)((0, _parser.parseValue)(inputValueIntrospection.defaultValue), type) : undefined; + return { + description: inputValueIntrospection.description, + type, + defaultValue, + deprecationReason: inputValueIntrospection.deprecationReason + }; + } + function buildDirective(directiveIntrospection) { + if (!directiveIntrospection.args) { + const directiveIntrospectionStr = (0, _inspect.inspect)(directiveIntrospection); + throw new Error(`Introspection result missing directive args: ${directiveIntrospectionStr}.`); + } + if (!directiveIntrospection.locations) { + const directiveIntrospectionStr = (0, _inspect.inspect)(directiveIntrospection); + throw new Error(`Introspection result missing directive locations: ${directiveIntrospectionStr}.`); + } + return new _directives.GraphQLDirective({ + name: directiveIntrospection.name, + description: directiveIntrospection.description, + isRepeatable: directiveIntrospection.isRepeatable, + locations: directiveIntrospection.locations.slice(), + args: buildInputValueDefMap(directiveIntrospection.args) + }); } } -/** internal - * class ParserInline - * - * Tokenizes paragraph content. - **/ +/***/ }), -// Parser rules +/***/ "../../../node_modules/graphql/utilities/coerceInputValue.mjs": +/*!********************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/coerceInputValue.mjs ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -const _rules = [['text', text], ['linkify', linkify], ['newline', newline], ['escape', escape], ['backticks', backtick], ['strikethrough', r_strikethrough.tokenize], ['emphasis', r_emphasis.tokenize], ['link', link], ['image', image], ['autolink', autolink], ['html_inline', html_inline], ['entity', entity]]; +"use strict"; -// `rule2` ruleset was created specifically for emphasis/strikethrough -// post-processing and may be changed in the future. -// -// Don't use this for anything except pairs (plugins working with `balance_pairs`). -// -const _rules2 = [['balance_pairs', link_pairs], ['strikethrough', r_strikethrough.postProcess], ['emphasis', r_emphasis.postProcess], -// rules for pairs separate '**' into its own text tokens, which may be left unused, -// rule below merges unused segments back with the rest of the text -['fragments_join', fragments_join]]; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.coerceInputValue = coerceInputValue; +var _didYouMean = __webpack_require__(/*! ../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _isIterableObject = __webpack_require__(/*! ../jsutils/isIterableObject.mjs */ "../../../node_modules/graphql/jsutils/isIterableObject.mjs"); +var _isObjectLike = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); +var _Path = __webpack_require__(/*! ../jsutils/Path.mjs */ "../../../node_modules/graphql/jsutils/Path.mjs"); +var _printPathArray = __webpack_require__(/*! ../jsutils/printPathArray.mjs */ "../../../node_modules/graphql/jsutils/printPathArray.mjs"); +var _suggestionList = __webpack_require__(/*! ../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); /** - * new ParserInline() - **/ -function ParserInline() { - /** - * ParserInline#ruler -> Ruler - * - * [[Ruler]] instance. Keep configuration of inline rules. - **/ - this.ruler = new Ruler(); - for (let i = 0; i < _rules.length; i++) { - this.ruler.push(_rules[i][0], _rules[i][1]); - } - - /** - * ParserInline#ruler2 -> Ruler - * - * [[Ruler]] instance. Second ruler used for post-processing - * (e.g. in emphasis-like rules). - **/ - this.ruler2 = new Ruler(); - for (let i = 0; i < _rules2.length; i++) { - this.ruler2.push(_rules2[i][0], _rules2[i][1]); - } + * Coerces a JavaScript value given a GraphQL Input Type. + */ +function coerceInputValue(inputValue, type, onError = defaultOnError) { + return coerceInputValueImpl(inputValue, type, onError, undefined); } - -// Skip single token by running all rules in validation mode; -// returns `true` if any rule reported success -// -ParserInline.prototype.skipToken = function (state) { - const pos = state.pos; - const rules = this.ruler.getRules(''); - const len = rules.length; - const maxNesting = state.md.options.maxNesting; - const cache = state.cache; - if (typeof cache[pos] !== 'undefined') { - state.pos = cache[pos]; - return; +function defaultOnError(path, invalidValue, error) { + let errorPrefix = 'Invalid value ' + (0, _inspect.inspect)(invalidValue); + if (path.length > 0) { + errorPrefix += ` at "value${(0, _printPathArray.printPathArray)(path)}"`; } - let ok = false; - if (state.level < maxNesting) { - for (let i = 0; i < len; i++) { - // Increment state.level and decrement it later to limit recursion. - // It's harmless to do here, because no tokens are created. But ideally, - // we'd need a separate private state variable for this purpose. - // - state.level++; - ok = rules[i](state, true); - state.level--; - if (ok) { - if (pos >= state.pos) { - throw new Error("inline rule didn't increment state.pos"); - } - break; - } + error.message = errorPrefix + ': ' + error.message; + throw error; +} +function coerceInputValueImpl(inputValue, type, onError, path) { + if ((0, _definition.isNonNullType)(type)) { + if (inputValue != null) { + return coerceInputValueImpl(inputValue, type.ofType, onError, path); } - } else { - // Too much nesting, just skip until the end of the paragraph. - // - // NOTE: this will cause links to behave incorrectly in the following case, - // when an amount of `[` is exactly equal to `maxNesting + 1`: - // - // [[[[[[[[[[[[[[[[[[[[[foo]() - // - // TODO: remove this workaround when CM standard will allow nested links - // (we can replace it by preventing links from being parsed in - // validation mode) - // - state.pos = state.posMax; + onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Expected non-nullable type "${(0, _inspect.inspect)(type)}" not to be null.`)); + return; } - if (!ok) { - state.pos++; + if (inputValue == null) { + // Explicitly return the value null. + return null; } - cache[pos] = state.pos; -}; + if ((0, _definition.isListType)(type)) { + const itemType = type.ofType; + if ((0, _isIterableObject.isIterableObject)(inputValue)) { + return Array.from(inputValue, (itemValue, index) => { + const itemPath = (0, _Path.addPath)(path, index, undefined); + return coerceInputValueImpl(itemValue, itemType, onError, itemPath); + }); + } // Lists accept a non-list value as a list of one. -// Generate tokens for input range -// -ParserInline.prototype.tokenize = function (state) { - const rules = this.ruler.getRules(''); - const len = rules.length; - const end = state.posMax; - const maxNesting = state.md.options.maxNesting; - while (state.pos < end) { - // Try all possible rules. - // On success, rule should: - // - // - update `state.pos` - // - update `state.tokens` - // - return true - const prevPos = state.pos; - let ok = false; - if (state.level < maxNesting) { - for (let i = 0; i < len; i++) { - ok = rules[i](state, false); - if (ok) { - if (prevPos >= state.pos) { - throw new Error("inline rule didn't increment state.pos"); - } - break; + return [coerceInputValueImpl(inputValue, itemType, onError, path)]; + } + if ((0, _definition.isInputObjectType)(type)) { + if (!(0, _isObjectLike.isObjectLike)(inputValue)) { + onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Expected type "${type.name}" to be an object.`)); + return; + } + const coercedValue = {}; + const fieldDefs = type.getFields(); + for (const field of Object.values(fieldDefs)) { + const fieldValue = inputValue[field.name]; + if (fieldValue === undefined) { + if (field.defaultValue !== undefined) { + coercedValue[field.name] = field.defaultValue; + } else if ((0, _definition.isNonNullType)(field.type)) { + const typeStr = (0, _inspect.inspect)(field.type); + onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Field "${field.name}" of required type "${typeStr}" was not provided.`)); } + continue; + } + coercedValue[field.name] = coerceInputValueImpl(fieldValue, field.type, onError, (0, _Path.addPath)(path, field.name, type.name)); + } // Ensure every provided field is defined. + + for (const fieldName of Object.keys(inputValue)) { + if (!fieldDefs[fieldName]) { + const suggestions = (0, _suggestionList.suggestionList)(fieldName, Object.keys(type.getFields())); + onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Field "${fieldName}" is not defined by type "${type.name}".` + (0, _didYouMean.didYouMean)(suggestions))); } } - if (ok) { - if (state.pos >= end) { - break; + if (type.isOneOf) { + const keys = Object.keys(coercedValue); + if (keys.length !== 1) { + onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Exactly one key must be specified for OneOf type "${type.name}".`)); + } + const key = keys[0]; + const value = coercedValue[key]; + if (value === null) { + onError((0, _Path.pathToArray)(path).concat(key), value, new _GraphQLError.GraphQLError(`Field "${key}" must be non-null.`)); } - continue; } - state.pending += state.src[state.pos++]; - } - if (state.pending) { - state.pushPending(); + return coercedValue; } -}; + if ((0, _definition.isLeafType)(type)) { + let parseResult; // Scalars and Enums determine if a input value is valid via parseValue(), + // which can throw to indicate failure. If it throws, maintain a reference + // to the original error. -/** - * ParserInline.parse(str, md, env, outTokens) - * - * Process input string and push inline tokens into `outTokens` - **/ -ParserInline.prototype.parse = function (str, md, env, outTokens) { - const state = new this.State(str, md, env, outTokens); - this.tokenize(state); - const rules = this.ruler2.getRules(''); - const len = rules.length; - for (let i = 0; i < len; i++) { - rules[i](state); + try { + parseResult = type.parseValue(inputValue); + } catch (error) { + if (error instanceof _GraphQLError.GraphQLError) { + onError((0, _Path.pathToArray)(path), inputValue, error); + } else { + onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Expected type "${type.name}". ` + error.message, { + originalError: error + })); + } + return; + } + if (parseResult === undefined) { + onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError(`Expected type "${type.name}".`)); + } + return parseResult; } -}; -ParserInline.prototype.State = StateInline; + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. -// markdown-it default options + false || (0, _invariant.invariant)(false, 'Unexpected input type: ' + (0, _inspect.inspect)(type)); +} -var cfg_default = { - options: { - // Enable HTML tags in source - html: false, - // Use '/' to close single tags (
) - xhtmlOut: false, - // Convert '\n' in paragraphs into
- breaks: false, - // CSS language prefix for fenced blocks - langPrefix: 'language-', - // autoconvert URL-like texts to links - linkify: false, - // Enable some language-neutral replacements + quotes beautification - typographer: false, - // Double + single quotes replacement pairs, when typographer enabled, - // and smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). - quotes: '\u201c\u201d\u2018\u2019', - /* “”‘’ */ +/***/ }), - // Highlighter function. Should return escaped HTML, - // or '' if the source string is not changed and should be escaped externaly. - // If result starts with ) - xhtmlOut: false, - // Convert '\n' in paragraphs into
- breaks: false, - // CSS language prefix for fenced blocks - langPrefix: 'language-', - // autoconvert URL-like texts to links - linkify: false, - // Enable some language-neutral replacements + quotes beautification - typographer: false, - // Double + single quotes replacement pairs, when typographer enabled, - // and smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). - quotes: '\u201c\u201d\u2018\u2019', - /* “”‘’ */ - // Highlighter function. Should return escaped HTML, - // or '' if the source string is not changed and should be escaped externaly. - // If result starts with ) - xhtmlOut: true, - // Convert '\n' in paragraphs into
- breaks: false, - // CSS language prefix for fenced blocks - langPrefix: 'language-', - // autoconvert URL-like texts to links - linkify: false, - // Enable some language-neutral replacements + quotes beautification - typographer: false, - // Double + single quotes replacement pairs, when typographer enabled, - // and smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). - quotes: '\u201c\u201d\u2018\u2019', - /* “”‘’ */ +/***/ "../../../node_modules/graphql/utilities/extendSchema.mjs": +/*!****************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/extendSchema.mjs ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // Highlighter function. Should return escaped HTML, - // or '' if the source string is not changed and should be escaped externaly. - // If result starts with = 0) { - try { - parsed.hostname = punycode.toASCII(parsed.hostname); - } catch (er) {/**/} + const schemaExtensions = []; + for (const def of documentAST.definitions) { + if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) { + schemaDef = def; + } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) { + schemaExtensions.push(def); + } else if ((0, _predicates.isTypeDefinitionNode)(def)) { + typeDefs.push(def); + } else if ((0, _predicates.isTypeExtensionNode)(def)) { + const extendedTypeName = def.name.value; + const existingTypeExtensions = typeExtensionsMap[extendedTypeName]; + typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def]; + } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + directiveDefs.push(def); } + } // If this document contains no new types, extensions, or directives then + // return the same unmodified GraphQLSchema instance. + + if (Object.keys(typeExtensionsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExtensions.length === 0 && schemaDef == null) { + return schemaConfig; } - return mdurl__namespace.encode(mdurl__namespace.format(parsed)); -} -function normalizeLinkText(url) { - const parsed = mdurl__namespace.parse(url, true); - if (parsed.hostname) { - // Encode hostnames in urls like: - // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` - // - // We don't encode unknown schemas, because it's likely that we encode - // something we shouldn't (e.g. `skype:name` treated as `skype:host`) - // - if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { - try { - parsed.hostname = punycode.toUnicode(parsed.hostname); - } catch (er) {/**/} - } + const typeMap = Object.create(null); + for (const existingType of schemaConfig.types) { + typeMap[existingType.name] = extendNamedType(existingType); + } + for (const typeNode of typeDefs) { + var _stdTypeMap$name; + const name = typeNode.name.value; + typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode); } + const operationTypes = { + // Get the extended root operation types. + query: schemaConfig.query && replaceNamedType(schemaConfig.query), + mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation), + subscription: schemaConfig.subscription && replaceNamedType(schemaConfig.subscription), + // Then, incorporate schema definition and all schema extensions. + ...(schemaDef && getOperationTypes([schemaDef])), + ...getOperationTypes(schemaExtensions) + }; // Then produce and return a Schema config with these types. - // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720 - return mdurl__namespace.decode(mdurl__namespace.format(parsed), mdurl__namespace.decode.defaultChars + '%'); -} + return { + description: (_schemaDef = schemaDef) === null || _schemaDef === void 0 ? void 0 : (_schemaDef$descriptio = _schemaDef.description) === null || _schemaDef$descriptio === void 0 ? void 0 : _schemaDef$descriptio.value, + ...operationTypes, + types: Object.values(typeMap), + directives: [...schemaConfig.directives.map(replaceDirective), ...directiveDefs.map(buildDirective)], + extensions: Object.create(null), + astNode: (_schemaDef2 = schemaDef) !== null && _schemaDef2 !== void 0 ? _schemaDef2 : schemaConfig.astNode, + extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions), + assumeValid: (_options$assumeValid = options === null || options === void 0 ? void 0 : options.assumeValid) !== null && _options$assumeValid !== void 0 ? _options$assumeValid : false + }; // Below are functions used for producing this schema that have closed over + // this scope and have access to the schema, cache, and newly defined types. -/** - * class MarkdownIt - * - * Main parser/renderer class. - * - * ##### Usage - * - * ```javascript - * // node.js, "classic" way: - * var MarkdownIt = require('markdown-it'), - * md = new MarkdownIt(); - * var result = md.render('# markdown-it rulezz!'); - * - * // node.js, the same, but with sugar: - * var md = require('markdown-it')(); - * var result = md.render('# markdown-it rulezz!'); - * - * // browser without AMD, added to "window" on script load - * // Note, there are no dash. - * var md = window.markdownit(); - * var result = md.render('# markdown-it rulezz!'); - * ``` - * - * Single line rendering, without paragraph wrap: - * - * ```javascript - * var md = require('markdown-it')(); - * var result = md.renderInline('__markdown-it__ rulezz!'); - * ``` - **/ + function replaceType(type) { + if ((0, _definition.isListType)(type)) { + // @ts-expect-error + return new _definition.GraphQLList(replaceType(type.ofType)); + } + if ((0, _definition.isNonNullType)(type)) { + // @ts-expect-error + return new _definition.GraphQLNonNull(replaceType(type.ofType)); + } // @ts-expect-error FIXME -/** - * new MarkdownIt([presetName, options]) - * - presetName (String): optional, `commonmark` / `zero` - * - options (Object) - * - * Creates parser instanse with given config. Can be called without `new`. - * - * ##### presetName - * - * MarkdownIt provides named presets as a convenience to quickly - * enable/disable active syntax rules and options for common use cases. - * - * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.mjs) - - * configures parser to strict [CommonMark](http://commonmark.org/) mode. - * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.mjs) - - * similar to GFM, used when no preset name given. Enables all available rules, - * but still without html, typographer & autolinker. - * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.mjs) - - * all rules disabled. Useful to quickly setup your config via `.enable()`. - * For example, when you need only `bold` and `italic` markup and nothing else. - * - * ##### options: - * - * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful! - * That's not safe! You may need external sanitizer to protect output from XSS. - * It's better to extend features via plugins, instead of enabling HTML. - * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags - * (`
`). This is needed only for full CommonMark compatibility. In real - * world you will need HTML output. - * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `
`. - * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks. - * Can be useful for external highlighters. - * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links. - * - __typographer__ - `false`. Set `true` to enable [some language-neutral - * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs) + - * quotes beautification (smartquotes). - * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement - * pairs, when typographer enabled and smartquotes on. For example, you can - * use `'«»„“'` for Russian, `'„“‚‘'` for German, and - * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp). - * - __highlight__ - `null`. Highlighter function for fenced code blocks. - * Highlighter `function (str, lang)` should return escaped HTML. It can also - * return empty string if the source was not changed and should be escaped - * externaly. If result starts with ` or ``): - * - * ```javascript - * var hljs = require('highlight.js') // https://highlightjs.org/ - * - * // Actual default values - * var md = require('markdown-it')({ - * highlight: function (str, lang) { - * if (lang && hljs.getLanguage(lang)) { - * try { - * return '
' +
- *                hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
- *                '
'; - * } catch (__) {} - * } - * - * return '
' + md.utils.escapeHtml(str) + '
'; - * } - * }); - * ``` - * - **/ -function MarkdownIt(presetName, options) { - if (!(this instanceof MarkdownIt)) { - return new MarkdownIt(presetName, options); + return replaceNamedType(type); } - if (!options) { - if (!isString(presetName)) { - options = presetName || {}; - presetName = 'default'; - } + function replaceNamedType(type) { + // Note: While this could make early assertions to get the correctly + // typed values, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + return typeMap[type.name]; } + function replaceDirective(directive) { + const config = directive.toConfig(); + return new _directives.GraphQLDirective({ + ...config, + args: (0, _mapValue.mapValue)(config.args, extendArg) + }); + } + function extendNamedType(type) { + if ((0, _introspection.isIntrospectionType)(type) || (0, _scalars.isSpecifiedScalarType)(type)) { + // Builtin types are not extended. + return type; + } + if ((0, _definition.isScalarType)(type)) { + return extendScalarType(type); + } + if ((0, _definition.isObjectType)(type)) { + return extendObjectType(type); + } + if ((0, _definition.isInterfaceType)(type)) { + return extendInterfaceType(type); + } + if ((0, _definition.isUnionType)(type)) { + return extendUnionType(type); + } + if ((0, _definition.isEnumType)(type)) { + return extendEnumType(type); + } + if ((0, _definition.isInputObjectType)(type)) { + return extendInputObjectType(type); + } + /* c8 ignore next 3 */ + // Not reachable, all possible type definition nodes have been considered. - /** - * MarkdownIt#inline -> ParserInline - * - * Instance of [[ParserInline]]. You may need it to add new rules when - * writing plugins. For simple rules control use [[MarkdownIt.disable]] and - * [[MarkdownIt.enable]]. - **/ - this.inline = new ParserInline(); - - /** - * MarkdownIt#block -> ParserBlock - * - * Instance of [[ParserBlock]]. You may need it to add new rules when - * writing plugins. For simple rules control use [[MarkdownIt.disable]] and - * [[MarkdownIt.enable]]. - **/ - this.block = new ParserBlock(); - - /** - * MarkdownIt#core -> Core - * - * Instance of [[Core]] chain executor. You may need it to add new rules when - * writing plugins. For simple rules control use [[MarkdownIt.disable]] and - * [[MarkdownIt.enable]]. - **/ - this.core = new Core(); - - /** - * MarkdownIt#renderer -> Renderer - * - * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering - * rules for new token types, generated by plugins. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * function myToken(tokens, idx, options, env, self) { - * //... - * return result; - * }; - * - * md.renderer.rules['my_token'] = myToken - * ``` - * - * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs). - **/ - this.renderer = new Renderer(); - - /** - * MarkdownIt#linkify -> LinkifyIt - * - * [linkify-it](https://github.com/markdown-it/linkify-it) instance. - * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs) - * rule. - **/ - this.linkify = new LinkifyIt(); - - /** - * MarkdownIt#validateLink(url) -> Boolean - * - * Link validation function. CommonMark allows too much in links. By default - * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas - * except some embedded image types. - * - * You can change this behaviour: - * - * ```javascript - * var md = require('markdown-it')(); - * // enable everything - * md.validateLink = function () { return true; } - * ``` - **/ - this.validateLink = validateLink; - - /** - * MarkdownIt#normalizeLink(url) -> String - * - * Function used to encode link url to a machine-readable format, - * which includes url-encoding, punycode, etc. - **/ - this.normalizeLink = normalizeLink; - - /** - * MarkdownIt#normalizeLinkText(url) -> String - * - * Function used to decode link url to a human-readable format` - **/ - this.normalizeLinkText = normalizeLinkText; - - // Expose utils & helpers for easy acces from plugins - - /** - * MarkdownIt#utils -> utils - * - * Assorted utility functions, useful to write plugins. See details - * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.mjs). - **/ - this.utils = utils; - - /** - * MarkdownIt#helpers -> helpers - * - * Link components parser functions, useful to write plugins. See details - * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers). - **/ - this.helpers = assign({}, helpers); - this.options = {}; - this.configure(presetName); - if (options) { - this.set(options); + false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); } -} - -/** chainable - * MarkdownIt.set(options) - * - * Set parser options (in the same format as in constructor). Probably, you - * will never need it, but you can change options after constructor call. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')() - * .set({ html: true, breaks: true }) - * .set({ typographer, true }); - * ``` - * - * __Note:__ To achieve the best possible performance, don't modify a - * `markdown-it` instance options on the fly. If you need multiple configurations - * it's best to create multiple instances and initialize each with separate - * config. - **/ -MarkdownIt.prototype.set = function (options) { - assign(this.options, options); - return this; -}; - -/** chainable, internal - * MarkdownIt.configure(presets) - * - * Batch load of all options and compenent settings. This is internal method, - * and you probably will not need it. But if you will - see available presets - * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets) - * - * We strongly recommend to use presets instead of direct config loads. That - * will give better compatibility with next versions. - **/ -MarkdownIt.prototype.configure = function (presets) { - const self = this; - if (isString(presets)) { - const presetName = presets; - presets = config[presetName]; - if (!presets) { - throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); + function extendInputObjectType(type) { + var _typeExtensionsMap$co; + const config = type.toConfig(); + const extensions = (_typeExtensionsMap$co = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : []; + return new _definition.GraphQLInputObjectType({ + ...config, + fields: () => ({ + ...(0, _mapValue.mapValue)(config.fields, field => ({ + ...field, + type: replaceType(field.type) + })), + ...buildInputFieldMap(extensions) + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions) + }); + } + function extendEnumType(type) { + var _typeExtensionsMap$ty; + const config = type.toConfig(); + const extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : []; + return new _definition.GraphQLEnumType({ + ...config, + values: { + ...config.values, + ...buildEnumValueMap(extensions) + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + }); + } + function extendScalarType(type) { + var _typeExtensionsMap$co2; + const config = type.toConfig(); + const extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : []; + let specifiedByURL = config.specifiedByURL; + for (const extensionNode of extensions) { + var _getSpecifiedByURL; + specifiedByURL = (_getSpecifiedByURL = getSpecifiedByURL(extensionNode)) !== null && _getSpecifiedByURL !== void 0 ? _getSpecifiedByURL : specifiedByURL; } + return new _definition.GraphQLScalarType({ + ...config, + specifiedByURL, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + }); } - if (!presets) { - throw new Error('Wrong `markdown-it` preset, can\'t be empty'); + function extendObjectType(type) { + var _typeExtensionsMap$co3; + const config = type.toConfig(); + const extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : []; + return new _definition.GraphQLObjectType({ + ...config, + interfaces: () => [...type.getInterfaces().map(replaceNamedType), ...buildInterfaces(extensions)], + fields: () => ({ + ...(0, _mapValue.mapValue)(config.fields, extendField), + ...buildFieldMap(extensions) + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions) + }); } - if (presets.options) { - self.set(presets.options); + function extendInterfaceType(type) { + var _typeExtensionsMap$co4; + const config = type.toConfig(); + const extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : []; + return new _definition.GraphQLInterfaceType({ + ...config, + interfaces: () => [...type.getInterfaces().map(replaceNamedType), ...buildInterfaces(extensions)], + fields: () => ({ + ...(0, _mapValue.mapValue)(config.fields, extendField), + ...buildFieldMap(extensions) + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions) + }); } - if (presets.components) { - Object.keys(presets.components).forEach(function (name) { - if (presets.components[name].rules) { - self[name].ruler.enableOnly(presets.components[name].rules); - } - if (presets.components[name].rules2) { - self[name].ruler2.enableOnly(presets.components[name].rules2); - } + function extendUnionType(type) { + var _typeExtensionsMap$co5; + const config = type.toConfig(); + const extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : []; + return new _definition.GraphQLUnionType({ + ...config, + types: () => [...type.getTypes().map(replaceNamedType), ...buildUnionTypes(extensions)], + extensionASTNodes: config.extensionASTNodes.concat(extensions) }); } - return this; -}; - -/** chainable - * MarkdownIt.enable(list, ignoreInvalid) - * - list (String|Array): rule name or list of rule names to enable - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * Enable list or rules. It will automatically find appropriate components, - * containing rules with given names. If rule not found, and `ignoreInvalid` - * not set - throws exception. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')() - * .enable(['sub', 'sup']) - * .disable('smartquotes'); - * ``` - **/ -MarkdownIt.prototype.enable = function (list, ignoreInvalid) { - let result = []; - if (!Array.isArray(list)) { - list = [list]; + function extendField(field) { + return { + ...field, + type: replaceType(field.type), + args: field.args && (0, _mapValue.mapValue)(field.args, extendArg) + }; } - ['core', 'block', 'inline'].forEach(function (chain) { - result = result.concat(this[chain].ruler.enable(list, true)); - }, this); - result = result.concat(this.inline.ruler2.enable(list, true)); - const missed = list.filter(function (name) { - return result.indexOf(name) < 0; - }); - if (missed.length && !ignoreInvalid) { - throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed); + function extendArg(arg) { + return { + ...arg, + type: replaceType(arg.type) + }; } - return this; -}; + function getOperationTypes(nodes) { + const opTypes = {}; + for (const node of nodes) { + var _node$operationTypes; -/** chainable - * MarkdownIt.disable(list, ignoreInvalid) - * - list (String|Array): rule name or list of rule names to disable. - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * The same as [[MarkdownIt.enable]], but turn specified rules off. - **/ -MarkdownIt.prototype.disable = function (list, ignoreInvalid) { - let result = []; - if (!Array.isArray(list)) { - list = [list]; + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const operationTypesNodes = /* c8 ignore next */ + (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : []; + for (const operationType of operationTypesNodes) { + // Note: While this could make early assertions to get the correctly + // typed values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + // @ts-expect-error + opTypes[operationType.operation] = getNamedType(operationType.type); + } + } + return opTypes; } - ['core', 'block', 'inline'].forEach(function (chain) { - result = result.concat(this[chain].ruler.disable(list, true)); - }, this); - result = result.concat(this.inline.ruler2.disable(list, true)); - const missed = list.filter(function (name) { - return result.indexOf(name) < 0; - }); - if (missed.length && !ignoreInvalid) { - throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed); + function getNamedType(node) { + var _stdTypeMap$name2; + const name = node.name.value; + const type = (_stdTypeMap$name2 = stdTypeMap[name]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name]; + if (type === undefined) { + throw new Error(`Unknown type: "${name}".`); + } + return type; } - return this; -}; - -/** chainable - * MarkdownIt.use(plugin, params) - * - * Load specified plugin with given params into current parser instance. - * It's just a sugar to call `plugin(md, params)` with curring. - * - * ##### Example - * - * ```javascript - * var iterator = require('markdown-it-for-inline'); - * var md = require('markdown-it')() - * .use(iterator, 'foo_replace', 'text', function (tokens, idx) { - * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); - * }); - * ``` - **/ -MarkdownIt.prototype.use = function (plugin /*, params, ... */) { - const args = [this].concat(Array.prototype.slice.call(arguments, 1)); - plugin.apply(plugin, args); - return this; -}; - -/** internal - * MarkdownIt.parse(src, env) -> Array - * - src (String): source string - * - env (Object): environment sandbox - * - * Parse input string and return list of block tokens (special token type - * "inline" will contain list of inline tokens). You should not call this - * method directly, until you write custom renderer (for example, to produce - * AST). - * - * `env` is used to pass data between "distributed" rules and return additional - * metadata like reference info, needed for the renderer. It also can be used to - * inject data in specific cases. Usually, you will be ok to pass `{}`, - * and then pass updated object to renderer. - **/ -MarkdownIt.prototype.parse = function (src, env) { - if (typeof src !== 'string') { - throw new Error('Input data should be a String'); + function getWrappedType(node) { + if (node.kind === _kinds.Kind.LIST_TYPE) { + return new _definition.GraphQLList(getWrappedType(node.type)); + } + if (node.kind === _kinds.Kind.NON_NULL_TYPE) { + return new _definition.GraphQLNonNull(getWrappedType(node.type)); + } + return getNamedType(node); } - const state = new this.core.State(src, this, env); - this.core.process(state); - return state.tokens; -}; - -/** - * MarkdownIt.render(src [, env]) -> String - * - src (String): source string - * - env (Object): environment sandbox - * - * Render markdown string into html. It does all magic for you :). - * - * `env` can be used to inject additional metadata (`{}` by default). - * But you will not need it with high probability. See also comment - * in [[MarkdownIt.parse]]. - **/ -MarkdownIt.prototype.render = function (src, env) { - env = env || {}; - return this.renderer.render(this.parse(src, env), this.options, env); -}; - -/** internal - * MarkdownIt.parseInline(src, env) -> Array - * - src (String): source string - * - env (Object): environment sandbox - * - * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the - * block tokens list with the single `inline` element, containing parsed inline - * tokens in `children` property. Also updates `env` object. - **/ -MarkdownIt.prototype.parseInline = function (src, env) { - const state = new this.core.State(src, this, env); - state.inlineMode = true; - this.core.process(state); - return state.tokens; -}; - -/** - * MarkdownIt.renderInline(src [, env]) -> String - * - src (String): source string - * - env (Object): environment sandbox - * - * Similar to [[MarkdownIt.render]] but for single paragraph content. Result - * will NOT be wrapped into `

` tags. - **/ -MarkdownIt.prototype.renderInline = function (src, env) { - env = env || {}; - return this.renderer.render(this.parseInline(src, env), this.options, env); -}; -module.exports = MarkdownIt; + function buildDirective(node) { + var _node$description; + return new _directives.GraphQLDirective({ + name: node.name.value, + description: (_node$description = node.description) === null || _node$description === void 0 ? void 0 : _node$description.value, + // @ts-expect-error + locations: node.locations.map(({ + value + }) => value), + isRepeatable: node.repeatable, + args: buildArgumentMap(node.arguments), + astNode: node + }); + } + function buildFieldMap(nodes) { + const fieldConfigMap = Object.create(null); + for (const node of nodes) { + var _node$fields; -/***/ }), + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const nodeFields = /* c8 ignore next */ + (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : []; + for (const field of nodeFields) { + var _field$description; + fieldConfigMap[field.name.value] = { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + type: getWrappedType(field.type), + description: (_field$description = field.description) === null || _field$description === void 0 ? void 0 : _field$description.value, + args: buildArgumentMap(field.arguments), + deprecationReason: getDeprecationReason(field), + astNode: field + }; + } + } + return fieldConfigMap; + } + function buildArgumentMap(args) { + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const argsNodes = /* c8 ignore next */ + args !== null && args !== void 0 ? args : []; + const argConfigMap = Object.create(null); + for (const arg of argsNodes) { + var _arg$description; -/***/ "../../../node_modules/mdurl/build/index.cjs.js": -/*!******************************************************!*\ - !*** ../../../node_modules/mdurl/build/index.cjs.js ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, exports) { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + const type = getWrappedType(arg.type); + argConfigMap[arg.name.value] = { + type, + description: (_arg$description = arg.description) === null || _arg$description === void 0 ? void 0 : _arg$description.value, + defaultValue: (0, _valueFromAST.valueFromAST)(arg.defaultValue, type), + deprecationReason: getDeprecationReason(arg), + astNode: arg + }; + } + return argConfigMap; + } + function buildInputFieldMap(nodes) { + const inputFieldMap = Object.create(null); + for (const node of nodes) { + var _node$fields2; + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const fieldsNodes = /* c8 ignore next */ + (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0 ? _node$fields2 : []; + for (const field of fieldsNodes) { + var _field$description2; + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + const type = getWrappedType(field.type); + inputFieldMap[field.name.value] = { + type, + description: (_field$description2 = field.description) === null || _field$description2 === void 0 ? void 0 : _field$description2.value, + defaultValue: (0, _valueFromAST.valueFromAST)(field.defaultValue, type), + deprecationReason: getDeprecationReason(field), + astNode: field + }; + } + } + return inputFieldMap; + } + function buildEnumValueMap(nodes) { + const enumValueMap = Object.create(null); + for (const node of nodes) { + var _node$values; -/* eslint-disable no-bitwise */ -const decodeCache = {}; -function getDecodeCache(exclude) { - let cache = decodeCache[exclude]; - if (cache) { - return cache; - } - cache = decodeCache[exclude] = []; - for (let i = 0; i < 128; i++) { - const ch = String.fromCharCode(i); - cache.push(ch); + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + const valuesNodes = /* c8 ignore next */ + (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : []; + for (const value of valuesNodes) { + var _value$description; + enumValueMap[value.name.value] = { + description: (_value$description = value.description) === null || _value$description === void 0 ? void 0 : _value$description.value, + deprecationReason: getDeprecationReason(value), + astNode: value + }; + } + } + return enumValueMap; } - for (let i = 0; i < exclude.length; i++) { - const ch = exclude.charCodeAt(i); - cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2); + function buildInterfaces(nodes) { + // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + // @ts-expect-error + return nodes.flatMap( + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + node => { + var _node$interfaces$map, _node$interfaces; + return /* c8 ignore next */( + (_node$interfaces$map = (_node$interfaces = node.interfaces) === null || _node$interfaces === void 0 ? void 0 : _node$interfaces.map(getNamedType)) !== null && _node$interfaces$map !== void 0 ? _node$interfaces$map : [] + ); + }); } - return cache; -} - -// Decode percent-encoded string. -// -function decode(string, exclude) { - if (typeof exclude !== 'string') { - exclude = decode.defaultChars; + function buildUnionTypes(nodes) { + // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + // @ts-expect-error + return nodes.flatMap( + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + node => { + var _node$types$map, _node$types; + return /* c8 ignore next */( + (_node$types$map = (_node$types = node.types) === null || _node$types === void 0 ? void 0 : _node$types.map(getNamedType)) !== null && _node$types$map !== void 0 ? _node$types$map : [] + ); + }); } - const cache = getDecodeCache(exclude); - return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) { - let result = ''; - for (let i = 0, l = seq.length; i < l; i += 3) { - const b1 = parseInt(seq.slice(i + 1, i + 3), 16); - if (b1 < 0x80) { - result += cache[b1]; - continue; - } - if ((b1 & 0xE0) === 0xC0 && i + 3 < l) { - // 110xxxxx 10xxxxxx - const b2 = parseInt(seq.slice(i + 4, i + 6), 16); - if ((b2 & 0xC0) === 0x80) { - const chr = b1 << 6 & 0x7C0 | b2 & 0x3F; - if (chr < 0x80) { - result += '\ufffd\ufffd'; - } else { - result += String.fromCharCode(chr); - } - i += 3; - continue; + function buildType(astNode) { + var _typeExtensionsMap$na; + const name = astNode.name.value; + const extensionASTNodes = (_typeExtensionsMap$na = typeExtensionsMap[name]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : []; + switch (astNode.kind) { + case _kinds.Kind.OBJECT_TYPE_DEFINITION: + { + var _astNode$description; + const allNodes = [astNode, ...extensionASTNodes]; + return new _definition.GraphQLObjectType({ + name, + description: (_astNode$description = astNode.description) === null || _astNode$description === void 0 ? void 0 : _astNode$description.value, + interfaces: () => buildInterfaces(allNodes), + fields: () => buildFieldMap(allNodes), + astNode, + extensionASTNodes + }); } - } - if ((b1 & 0xF0) === 0xE0 && i + 6 < l) { - // 1110xxxx 10xxxxxx 10xxxxxx - const b2 = parseInt(seq.slice(i + 4, i + 6), 16); - const b3 = parseInt(seq.slice(i + 7, i + 9), 16); - if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) { - const chr = b1 << 12 & 0xF000 | b2 << 6 & 0xFC0 | b3 & 0x3F; - if (chr < 0x800 || chr >= 0xD800 && chr <= 0xDFFF) { - result += '\ufffd\ufffd\ufffd'; - } else { - result += String.fromCharCode(chr); - } - i += 6; - continue; + case _kinds.Kind.INTERFACE_TYPE_DEFINITION: + { + var _astNode$description2; + const allNodes = [astNode, ...extensionASTNodes]; + return new _definition.GraphQLInterfaceType({ + name, + description: (_astNode$description2 = astNode.description) === null || _astNode$description2 === void 0 ? void 0 : _astNode$description2.value, + interfaces: () => buildInterfaces(allNodes), + fields: () => buildFieldMap(allNodes), + astNode, + extensionASTNodes + }); } - } - if ((b1 & 0xF8) === 0xF0 && i + 9 < l) { - // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx - const b2 = parseInt(seq.slice(i + 4, i + 6), 16); - const b3 = parseInt(seq.slice(i + 7, i + 9), 16); - const b4 = parseInt(seq.slice(i + 10, i + 12), 16); - if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) { - let chr = b1 << 18 & 0x1C0000 | b2 << 12 & 0x3F000 | b3 << 6 & 0xFC0 | b4 & 0x3F; - if (chr < 0x10000 || chr > 0x10FFFF) { - result += '\ufffd\ufffd\ufffd\ufffd'; - } else { - chr -= 0x10000; - result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF)); - } - i += 9; - continue; + case _kinds.Kind.ENUM_TYPE_DEFINITION: + { + var _astNode$description3; + const allNodes = [astNode, ...extensionASTNodes]; + return new _definition.GraphQLEnumType({ + name, + description: (_astNode$description3 = astNode.description) === null || _astNode$description3 === void 0 ? void 0 : _astNode$description3.value, + values: buildEnumValueMap(allNodes), + astNode, + extensionASTNodes + }); } - } - result += '\ufffd'; - } - return result; - }); -} -decode.defaultChars = ';/?:@&=+$,#'; -decode.componentChars = ''; -const encodeCache = {}; - -// Create a lookup array where anything but characters in `chars` string -// and alphanumeric chars is percent-encoded. -// -function getEncodeCache(exclude) { - let cache = encodeCache[exclude]; - if (cache) { - return cache; - } - cache = encodeCache[exclude] = []; - for (let i = 0; i < 128; i++) { - const ch = String.fromCharCode(i); - if (/^[0-9a-z]$/i.test(ch)) { - // always allow unencoded alphanumeric characters - cache.push(ch); - } else { - cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2)); - } - } - for (let i = 0; i < exclude.length; i++) { - cache[exclude.charCodeAt(i)] = exclude[i]; - } - return cache; -} - -// Encode unsafe characters with percent-encoding, skipping already -// encoded sequences. -// -// - string - string to encode -// - exclude - list of characters to ignore (in addition to a-zA-Z0-9) -// - keepEscaped - don't encode '%' in a correct escape sequence (default: true) -// -function encode(string, exclude, keepEscaped) { - if (typeof exclude !== 'string') { - // encode(string, keepEscaped) - keepEscaped = exclude; - exclude = encode.defaultChars; - } - if (typeof keepEscaped === 'undefined') { - keepEscaped = true; - } - const cache = getEncodeCache(exclude); - let result = ''; - for (let i = 0, l = string.length; i < l; i++) { - const code = string.charCodeAt(i); - if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) { - if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { - result += string.slice(i, i + 3); - i += 2; - continue; - } - } - if (code < 128) { - result += cache[code]; - continue; - } - if (code >= 0xD800 && code <= 0xDFFF) { - if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) { - const nextCode = string.charCodeAt(i + 1); - if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { - result += encodeURIComponent(string[i] + string[i + 1]); - i++; - continue; + case _kinds.Kind.UNION_TYPE_DEFINITION: + { + var _astNode$description4; + const allNodes = [astNode, ...extensionASTNodes]; + return new _definition.GraphQLUnionType({ + name, + description: (_astNode$description4 = astNode.description) === null || _astNode$description4 === void 0 ? void 0 : _astNode$description4.value, + types: () => buildUnionTypes(allNodes), + astNode, + extensionASTNodes + }); + } + case _kinds.Kind.SCALAR_TYPE_DEFINITION: + { + var _astNode$description5; + return new _definition.GraphQLScalarType({ + name, + description: (_astNode$description5 = astNode.description) === null || _astNode$description5 === void 0 ? void 0 : _astNode$description5.value, + specifiedByURL: getSpecifiedByURL(astNode), + astNode, + extensionASTNodes + }); + } + case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION: + { + var _astNode$description6; + const allNodes = [astNode, ...extensionASTNodes]; + return new _definition.GraphQLInputObjectType({ + name, + description: (_astNode$description6 = astNode.description) === null || _astNode$description6 === void 0 ? void 0 : _astNode$description6.value, + fields: () => buildInputFieldMap(allNodes), + astNode, + extensionASTNodes, + isOneOf: isOneOf(astNode) + }); } - } - result += '%EF%BF%BD'; - continue; } - result += encodeURIComponent(string[i]); - } - return result; -} -encode.defaultChars = ";/?:@&=+$,-_.!~*'()#"; -encode.componentChars = "-_.!~*'()"; -function format(url) { - let result = ''; - result += url.protocol || ''; - result += url.slashes ? '//' : ''; - result += url.auth ? url.auth + '@' : ''; - if (url.hostname && url.hostname.indexOf(':') !== -1) { - // ipv6 address - result += '[' + url.hostname + ']'; - } else { - result += url.hostname || ''; } - result += url.port ? ':' + url.port : ''; - result += url.pathname || ''; - result += url.search || ''; - result += url.hash || ''; - return result; } +const stdTypeMap = (0, _keyMap.keyMap)([..._scalars.specifiedScalarTypes, ..._introspection.introspectionTypes], type => type.name); +/** + * Given a field or enum value node, returns the string value for the + * deprecation reason. + */ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +function getDeprecationReason(node) { + const deprecated = (0, _values.getDirectiveValues)(_directives.GraphQLDeprecatedDirective, node); // @ts-expect-error validated by `getDirectiveValues` -// -// Changes from joyent/node: -// -// 1. No leading slash in paths, -// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/` -// -// 2. Backslashes are not replaced with slashes, -// so `http:\\example.org\` is treated like a relative path -// -// 3. Trailing colon is treated like a part of the path, -// i.e. in `http://example.org:foo` pathname is `:foo` -// -// 4. Nothing is URL-encoded in the resulting object, -// (in joyent/node some chars in auth and paths are encoded) -// -// 5. `url.parse()` does not have `parseQueryString` argument -// -// 6. Removed extraneous result properties: `host`, `path`, `query`, etc., -// which can be constructed using other parts of the url. -// + return deprecated === null || deprecated === void 0 ? void 0 : deprecated.reason; +} +/** + * Given a scalar node, returns the string value for the specifiedByURL. + */ -function Url() { - this.protocol = null; - this.slashes = null; - this.auth = null; - this.port = null; - this.hostname = null; - this.hash = null; - this.search = null; - this.pathname = null; +function getSpecifiedByURL(node) { + const specifiedBy = (0, _values.getDirectiveValues)(_directives.GraphQLSpecifiedByDirective, node); // @ts-expect-error validated by `getDirectiveValues` + + return specifiedBy === null || specifiedBy === void 0 ? void 0 : specifiedBy.url; } +/** + * Given an input object node, returns if the node should be OneOf. + */ -// Reference: RFC 3986, RFC 1808, RFC 2396 +function isOneOf(node) { + return Boolean((0, _values.getDirectiveValues)(_directives.GraphQLOneOfDirective, node)); +} -// define these here so at least they only have to be -// compiled once on the first module load. -const protocolPattern = /^([a-z0-9.+-]+:)/i; -const portPattern = /:[0-9]*$/; +/***/ }), -// Special case for a simple path URL -/* eslint-disable-next-line no-useless-escape */ -const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/; +/***/ "../../../node_modules/graphql/utilities/findBreakingChanges.mjs": +/*!***********************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/findBreakingChanges.mjs ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -// RFC 2396: characters reserved for delimiting URLs. -// We actually just auto-escape these. -const delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t']; +"use strict"; -// RFC 2396: characters not allowed for various reasons. -const unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims); -// Allowed by RFCs, but cause of XSS attacks. Always escape these. -const autoEscape = ['\''].concat(unwise); -// Characters that are never ever allowed in a hostname. -// Note that any invalid chars are also handled, but these -// are the ones that are *expected* to be seen, so we fast-path -// them. -const nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape); -const hostEndingChars = ['/', '?', '#']; -const hostnameMaxLen = 255; -const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/; -const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/; -// protocols that can allow "unsafe" and "unwise" chars. -// protocols that never have a hostname. -const hostlessProtocol = { - javascript: true, - 'javascript:': true -}; -// protocols that always contain a // bit. -const slashedProtocol = { - http: true, - https: true, - ftp: true, - gopher: true, - file: true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true -}; -function urlParse(url, slashesDenoteHost) { - if (url && url instanceof Url) return url; - const u = new Url(); - u.parse(url, slashesDenoteHost); - return u; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.DangerousChangeType = exports.BreakingChangeType = void 0; +exports.findBreakingChanges = findBreakingChanges; +exports.findDangerousChanges = findDangerousChanges; +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _keyMap = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); +var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); +var _astFromValue = __webpack_require__(/*! ./astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); +var _sortValueNode = __webpack_require__(/*! ./sortValueNode.mjs */ "../../../node_modules/graphql/utilities/sortValueNode.mjs"); +var BreakingChangeType; +(function (BreakingChangeType) { + BreakingChangeType['TYPE_REMOVED'] = 'TYPE_REMOVED'; + BreakingChangeType['TYPE_CHANGED_KIND'] = 'TYPE_CHANGED_KIND'; + BreakingChangeType['TYPE_REMOVED_FROM_UNION'] = 'TYPE_REMOVED_FROM_UNION'; + BreakingChangeType['VALUE_REMOVED_FROM_ENUM'] = 'VALUE_REMOVED_FROM_ENUM'; + BreakingChangeType['REQUIRED_INPUT_FIELD_ADDED'] = 'REQUIRED_INPUT_FIELD_ADDED'; + BreakingChangeType['IMPLEMENTED_INTERFACE_REMOVED'] = 'IMPLEMENTED_INTERFACE_REMOVED'; + BreakingChangeType['FIELD_REMOVED'] = 'FIELD_REMOVED'; + BreakingChangeType['FIELD_CHANGED_KIND'] = 'FIELD_CHANGED_KIND'; + BreakingChangeType['REQUIRED_ARG_ADDED'] = 'REQUIRED_ARG_ADDED'; + BreakingChangeType['ARG_REMOVED'] = 'ARG_REMOVED'; + BreakingChangeType['ARG_CHANGED_KIND'] = 'ARG_CHANGED_KIND'; + BreakingChangeType['DIRECTIVE_REMOVED'] = 'DIRECTIVE_REMOVED'; + BreakingChangeType['DIRECTIVE_ARG_REMOVED'] = 'DIRECTIVE_ARG_REMOVED'; + BreakingChangeType['REQUIRED_DIRECTIVE_ARG_ADDED'] = 'REQUIRED_DIRECTIVE_ARG_ADDED'; + BreakingChangeType['DIRECTIVE_REPEATABLE_REMOVED'] = 'DIRECTIVE_REPEATABLE_REMOVED'; + BreakingChangeType['DIRECTIVE_LOCATION_REMOVED'] = 'DIRECTIVE_LOCATION_REMOVED'; +})(BreakingChangeType || (exports.BreakingChangeType = BreakingChangeType = {})); +var DangerousChangeType; +(function (DangerousChangeType) { + DangerousChangeType['VALUE_ADDED_TO_ENUM'] = 'VALUE_ADDED_TO_ENUM'; + DangerousChangeType['TYPE_ADDED_TO_UNION'] = 'TYPE_ADDED_TO_UNION'; + DangerousChangeType['OPTIONAL_INPUT_FIELD_ADDED'] = 'OPTIONAL_INPUT_FIELD_ADDED'; + DangerousChangeType['OPTIONAL_ARG_ADDED'] = 'OPTIONAL_ARG_ADDED'; + DangerousChangeType['IMPLEMENTED_INTERFACE_ADDED'] = 'IMPLEMENTED_INTERFACE_ADDED'; + DangerousChangeType['ARG_DEFAULT_VALUE_CHANGE'] = 'ARG_DEFAULT_VALUE_CHANGE'; +})(DangerousChangeType || (exports.DangerousChangeType = DangerousChangeType = {})); +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of breaking changes covered by the other functions down below. + */ +function findBreakingChanges(oldSchema, newSchema) { + // @ts-expect-error + return findSchemaChanges(oldSchema, newSchema).filter(change => change.type in BreakingChangeType); } -Url.prototype.parse = function (url, slashesDenoteHost) { - let lowerProto, hec, slashes; - let rest = url; +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + */ - // trim before proceeding. - // This is to support parse stuff like " http://foo.com \n" - rest = rest.trim(); - if (!slashesDenoteHost && url.split('#').length === 1) { - // Try fast path regexp - const simplePath = simplePathPattern.exec(rest); - if (simplePath) { - this.pathname = simplePath[1]; - if (simplePath[2]) { - this.search = simplePath[2]; +function findDangerousChanges(oldSchema, newSchema) { + // @ts-expect-error + return findSchemaChanges(oldSchema, newSchema).filter(change => change.type in DangerousChangeType); +} +function findSchemaChanges(oldSchema, newSchema) { + return [...findTypeChanges(oldSchema, newSchema), ...findDirectiveChanges(oldSchema, newSchema)]; +} +function findDirectiveChanges(oldSchema, newSchema) { + const schemaChanges = []; + const directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives()); + for (const oldDirective of directivesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_REMOVED, + description: `${oldDirective.name} was removed.` + }); + } + for (const [oldDirective, newDirective] of directivesDiff.persisted) { + const argsDiff = diff(oldDirective.args, newDirective.args); + for (const newArg of argsDiff.added) { + if ((0, _definition.isRequiredArgument)(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, + description: `A required arg ${newArg.name} on directive ${oldDirective.name} was added.` + }); } - return this; } - } - let proto = protocolPattern.exec(rest); - if (proto) { - proto = proto[0]; - lowerProto = proto.toLowerCase(); - this.protocol = proto; - rest = rest.substr(proto.length); - } - - // figure out if it's got a host - // user@server is *always* interpreted as a hostname, and url - // resolution will treat //foo/bar as host=foo,path=bar because that's - // how the browser resolves relative URLs. - /* eslint-disable-next-line no-useless-escape */ - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { - slashes = rest.substr(0, 2) === '//'; - if (slashes && !(proto && hostlessProtocol[proto])) { - rest = rest.substr(2); - this.slashes = true; + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, + description: `${oldArg.name} was removed from ${oldDirective.name}.` + }); } - } - if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) { - // there's a hostname. - // the first instance of /, ?, ;, or # ends the host. - // - // If there is an @ in the hostname, then non-host chars *are* allowed - // to the left of the last @ sign, unless some host-ending character - // comes *before* the @-sign. - // URLs are obnoxious. - // - // ex: - // http://a@b@c/ => user:a@b host:c - // http://a@b?@c => user:a host:c path:/?@c - - // v0.12 TODO(isaacs): This is not quite how Chrome does things. - // Review our test case against browsers more comprehensively. - - // find the first instance of any hostEndingChars - let hostEnd = -1; - for (let i = 0; i < hostEndingChars.length; i++) { - hec = rest.indexOf(hostEndingChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { - hostEnd = hec; - } + if (oldDirective.isRepeatable && !newDirective.isRepeatable) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, + description: `Repeatable flag was removed from ${oldDirective.name}.` + }); } - - // at this point, either we have an explicit point where the - // auth portion cannot go past, or the last @ char is the decider. - let auth, atSign; - if (hostEnd === -1) { - // atSign can be anywhere. - atSign = rest.lastIndexOf('@'); - } else { - // atSign must be in auth portion. - // http://a@b/c@d => host:b auth:a path:/c@d - atSign = rest.lastIndexOf('@', hostEnd); + for (const location of oldDirective.locations) { + if (!newDirective.locations.includes(location)) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, + description: `${location} was removed from ${oldDirective.name}.` + }); + } } - - // Now we have a portion which is definitely the auth. - // Pull that off. - if (atSign !== -1) { - auth = rest.slice(0, atSign); - rest = rest.slice(atSign + 1); - this.auth = auth; + } + return schemaChanges; +} +function findTypeChanges(oldSchema, newSchema) { + const schemaChanges = []; + const typesDiff = diff(Object.values(oldSchema.getTypeMap()), Object.values(newSchema.getTypeMap())); + for (const oldType of typesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED, + description: (0, _scalars.isSpecifiedScalarType)(oldType) ? `Standard scalar ${oldType.name} was removed because it is not referenced anymore.` : `${oldType.name} was removed.` + }); + } + for (const [oldType, newType] of typesDiff.persisted) { + if ((0, _definition.isEnumType)(oldType) && (0, _definition.isEnumType)(newType)) { + schemaChanges.push(...findEnumTypeChanges(oldType, newType)); + } else if ((0, _definition.isUnionType)(oldType) && (0, _definition.isUnionType)(newType)) { + schemaChanges.push(...findUnionTypeChanges(oldType, newType)); + } else if ((0, _definition.isInputObjectType)(oldType) && (0, _definition.isInputObjectType)(newType)) { + schemaChanges.push(...findInputObjectTypeChanges(oldType, newType)); + } else if ((0, _definition.isObjectType)(oldType) && (0, _definition.isObjectType)(newType)) { + schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType)); + } else if ((0, _definition.isInterfaceType)(oldType) && (0, _definition.isInterfaceType)(newType)) { + schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType)); + } else if (oldType.constructor !== newType.constructor) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: `${oldType.name} changed from ` + `${typeKindName(oldType)} to ${typeKindName(newType)}.` + }); } - - // the host is the remaining to the left of the first non-host char - hostEnd = -1; - for (let i = 0; i < nonHostChars.length; i++) { - hec = rest.indexOf(nonHostChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { - hostEnd = hec; - } + } + return schemaChanges; +} +function findInputObjectTypeChanges(oldType, newType) { + const schemaChanges = []; + const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields())); + for (const newField of fieldsDiff.added) { + if ((0, _definition.isRequiredInputField)(newField)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, + description: `A required field ${newField.name} on input type ${oldType.name} was added.` + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, + description: `An optional field ${newField.name} on input type ${oldType.name} was added.` + }); } - // if we still have not hit it, then the entire thing is a host. - if (hostEnd === -1) { - hostEnd = rest.length; + } + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: `${oldType.name}.${oldField.name} was removed.` + }); + } + for (const [oldField, newField] of fieldsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldField.type, newField.type); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: `${oldType.name}.${oldField.name} changed type from ` + `${String(oldField.type)} to ${String(newField.type)}.` + }); } - if (rest[hostEnd - 1] === ':') { - hostEnd--; + } + return schemaChanges; +} +function findUnionTypeChanges(oldType, newType) { + const schemaChanges = []; + const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); + for (const newPossibleType of possibleTypesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.TYPE_ADDED_TO_UNION, + description: `${newPossibleType.name} was added to union type ${oldType.name}.` + }); + } + for (const oldPossibleType of possibleTypesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, + description: `${oldPossibleType.name} was removed from union type ${oldType.name}.` + }); + } + return schemaChanges; +} +function findEnumTypeChanges(oldType, newType) { + const schemaChanges = []; + const valuesDiff = diff(oldType.getValues(), newType.getValues()); + for (const newValue of valuesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.VALUE_ADDED_TO_ENUM, + description: `${newValue.name} was added to enum type ${oldType.name}.` + }); + } + for (const oldValue of valuesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, + description: `${oldValue.name} was removed from enum type ${oldType.name}.` + }); + } + return schemaChanges; +} +function findImplementedInterfacesChanges(oldType, newType) { + const schemaChanges = []; + const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); + for (const newInterface of interfacesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, + description: `${newInterface.name} added to interfaces implemented by ${oldType.name}.` + }); + } + for (const oldInterface of interfacesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, + description: `${oldType.name} no longer implements interface ${oldInterface.name}.` + }); + } + return schemaChanges; +} +function findFieldChanges(oldType, newType) { + const schemaChanges = []; + const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields())); + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: `${oldType.name}.${oldField.name} was removed.` + }); + } + for (const [oldField, newField] of fieldsDiff.persisted) { + schemaChanges.push(...findArgChanges(oldType, oldField, newField)); + const isSafe = isChangeSafeForObjectOrInterfaceField(oldField.type, newField.type); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: `${oldType.name}.${oldField.name} changed type from ` + `${String(oldField.type)} to ${String(newField.type)}.` + }); } - const host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); - - // pull out port. - this.parseHost(host); - - // we've indicated that there is a hostname, - // so even if it's empty, it has to be present. - this.hostname = this.hostname || ''; - - // if hostname begins with [ and ends with ] - // assume that it's an IPv6 address. - const ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; - - // validate a little. - if (!ipv6Hostname) { - const hostparts = this.hostname.split(/\./); - for (let i = 0, l = hostparts.length; i < l; i++) { - const part = hostparts[i]; - if (!part) { - continue; - } - if (!part.match(hostnamePartPattern)) { - let newpart = ''; - for (let j = 0, k = part.length; j < k; j++) { - if (part.charCodeAt(j) > 127) { - // we replace non-ASCII char with a temporary placeholder - // we need this to make sure size of hostname is not - // broken by replacing non-ASCII by nothing - newpart += 'x'; - } else { - newpart += part[j]; - } - } - // we test again with ASCII char only - if (!newpart.match(hostnamePartPattern)) { - const validParts = hostparts.slice(0, i); - const notHost = hostparts.slice(i + 1); - const bit = part.match(hostnamePartStart); - if (bit) { - validParts.push(bit[1]); - notHost.unshift(bit[2]); - } - if (notHost.length) { - rest = notHost.join('.') + rest; - } - this.hostname = validParts.join('.'); - break; - } + } + return schemaChanges; +} +function findArgChanges(oldType, oldField, newField) { + const schemaChanges = []; + const argsDiff = diff(oldField.args, newField.args); + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.ARG_REMOVED, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} was removed.` + }); + } + for (const [oldArg, newArg] of argsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldArg.type, newArg.type); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.ARG_CHANGED_KIND, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed type from ` + `${String(oldArg.type)} to ${String(newArg.type)}.` + }); + } else if (oldArg.defaultValue !== undefined) { + if (newArg.defaultValue === undefined) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} defaultValue was removed.` + }); + } else { + // Since we looking only for client's observable changes we should + // compare default values in the same representation as they are + // represented inside introspection. + const oldValueStr = stringifyValue(oldArg.defaultValue, oldArg.type); + const newValueStr = stringifyValue(newArg.defaultValue, newArg.type); + if (oldValueStr !== newValueStr) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed defaultValue from ${oldValueStr} to ${newValueStr}.` + }); } } } - if (this.hostname.length > hostnameMaxLen) { - this.hostname = ''; - } - - // strip [ and ] from the hostname - // the host field still retains them, though - if (ipv6Hostname) { - this.hostname = this.hostname.substr(1, this.hostname.length - 2); + } + for (const newArg of argsDiff.added) { + if ((0, _definition.isRequiredArgument)(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_ARG_ADDED, + description: `A required arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.` + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_ARG_ADDED, + description: `An optional arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.` + }); } } + return schemaChanges; +} +function isChangeSafeForObjectOrInterfaceField(oldType, newType) { + if ((0, _definition.isListType)(oldType)) { + return ( + // if they're both lists, make sure the underlying types are compatible + (0, _definition.isListType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) || + // moving from nullable to non-null of the same underlying type is safe + (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) + ); + } + if ((0, _definition.isNonNullType)(oldType)) { + // if they're both non-null, make sure the underlying types are compatible + return (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType); + } + return ( + // if they're both named types, see if their names are equivalent + (0, _definition.isNamedType)(newType) && oldType.name === newType.name || + // moving from nullable to non-null of the same underlying type is safe + (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) + ); +} +function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) { + if ((0, _definition.isListType)(oldType)) { + // if they're both lists, make sure the underlying types are compatible + return (0, _definition.isListType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType); + } + if ((0, _definition.isNonNullType)(oldType)) { + return ( + // if they're both non-null, make sure the underlying types are + // compatible + (0, _definition.isNonNullType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) || + // moving from non-null to nullable of the same underlying type is safe + !(0, _definition.isNonNullType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType) + ); + } // if they're both named types, see if their names are equivalent - // chop off from the tail first. - const hash = rest.indexOf('#'); - if (hash !== -1) { - // got a fragment string. - this.hash = rest.substr(hash); - rest = rest.slice(0, hash); + return (0, _definition.isNamedType)(newType) && oldType.name === newType.name; +} +function typeKindName(type) { + if ((0, _definition.isScalarType)(type)) { + return 'a Scalar type'; } - const qm = rest.indexOf('?'); - if (qm !== -1) { - this.search = rest.substr(qm); - rest = rest.slice(0, qm); + if ((0, _definition.isObjectType)(type)) { + return 'an Object type'; } - if (rest) { - this.pathname = rest; + if ((0, _definition.isInterfaceType)(type)) { + return 'an Interface type'; } - if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { - this.pathname = ''; + if ((0, _definition.isUnionType)(type)) { + return 'a Union type'; } - return this; -}; -Url.prototype.parseHost = function (host) { - let port = portPattern.exec(host); - if (port) { - port = port[0]; - if (port !== ':') { - this.port = port.substr(1); - } - host = host.substr(0, host.length - port.length); + if ((0, _definition.isEnumType)(type)) { + return 'an Enum type'; } - if (host) { - this.hostname = host; + if ((0, _definition.isInputObjectType)(type)) { + return 'an Input type'; } -}; -exports.decode = decode; -exports.encode = encode; -exports.format = format; -exports.parse = urlParse; - -/***/ }), - -/***/ "../../../node_modules/meros/browser/index.js": -/*!****************************************************!*\ - !*** ../../../node_modules/meros/browser/index.js ***! - \****************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. -var e = new TextDecoder(); -async function t(t, n) { - if (!t.ok || !t.body || t.bodyUsed) return t; - let i = t.headers.get("content-type"); - if (!i || !~i.indexOf("multipart/")) return t; - let l = i.indexOf("boundary="), - r = "-"; - if (~l) { - let e = l + 9, - t = i.indexOf(";", e); - r = i.slice(e, t > -1 ? t : void 0).trim().replace(/"/g, ""); + false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); +} +function stringifyValue(value, type) { + const ast = (0, _astFromValue.astFromValue)(value, type); + ast != null || (0, _invariant.invariant)(false); + return (0, _printer.print)((0, _sortValueNode.sortValueNode)(ast)); +} +function diff(oldArray, newArray) { + const added = []; + const removed = []; + const persisted = []; + const oldMap = (0, _keyMap.keyMap)(oldArray, ({ + name + }) => name); + const newMap = (0, _keyMap.keyMap)(newArray, ({ + name + }) => name); + for (const oldItem of oldArray) { + const newItem = newMap[oldItem.name]; + if (newItem === undefined) { + removed.push(oldItem); + } else { + persisted.push([oldItem, newItem]); + } } - return async function* (t, n, i) { - let l, - r, - d, - o = t.getReader(), - a = !i || !i.multiple, - f = n.length, - s = "", - c = []; - try { - let t; - e: for (; !(t = await o.read()).done;) { - let i = e.decode(t.value); - l = s.length, s += i; - let o = i.indexOf(n); - for (~o ? l += o : l = s.indexOf(n), c = []; ~l;) { - let e = s.slice(0, l), - t = s.slice(l + f); - if (r) { - let n = e.indexOf("\r\n\r\n") + 4, - i = e.lastIndexOf("\r\n", n), - l = !1, - r = e.slice(n, i > -1 ? void 0 : i), - o = String(e.slice(0, n)).trim().split("\r\n"), - f = {}, - s = o.length; - for (; d = o[--s]; d = d.split(": "), f[d.shift().toLowerCase()] = d.join(": ")); - if (d = f["content-type"], d && ~d.indexOf("application/json")) try { - r = JSON.parse(r), l = !0; - } catch (e) {} - if (d = { - headers: f, - body: r, - json: l - }, a ? yield d : c.push(d), "--" === t.slice(0, 2)) break e; - } else n = "\r\n" + n, r = f += 2; - s = t, l = s.indexOf(n); - } - c.length && (yield c); - } - } finally { - c.length && (yield c), await o.cancel(); + for (const newItem of newArray) { + if (oldMap[newItem.name] === undefined) { + added.push(newItem); } - }(t.body, `--${r}`, n); + } + return { + added, + persisted, + removed + }; } -exports.meros = t; /***/ }), -/***/ "../../../node_modules/nullthrows/nullthrows.js": -/*!******************************************************!*\ - !*** ../../../node_modules/nullthrows/nullthrows.js ***! - \******************************************************/ -/***/ (function(module) { +/***/ "../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs": +/*!*************************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs ***! + \*************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; -function nullthrows(x, message) { - if (x != null) { - return x; - } - var error = new Error(message !== undefined ? message : 'Got unexpected ' + x); - error.framesToPop = 1; // Skip nullthrows's own stack frame. - throw error; -} -module.exports = nullthrows; -module.exports["default"] = nullthrows; -Object.defineProperty(module.exports, "__esModule", ({ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getIntrospectionQuery = getIntrospectionQuery; +/** + * Produce the GraphQL query recommended for a full schema introspection. + * Accepts optional IntrospectionOptions. + */ +function getIntrospectionQuery(options) { + const optionsWithDefault = { + descriptions: true, + specifiedByUrl: false, + directiveIsRepeatable: false, + schemaDescription: false, + inputValueDeprecation: false, + oneOf: false, + ...options + }; + const descriptions = optionsWithDefault.descriptions ? 'description' : ''; + const specifiedByUrl = optionsWithDefault.specifiedByUrl ? 'specifiedByURL' : ''; + const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable ? 'isRepeatable' : ''; + const schemaDescription = optionsWithDefault.schemaDescription ? descriptions : ''; + function inputDeprecation(str) { + return optionsWithDefault.inputValueDeprecation ? str : ''; + } + const oneOf = optionsWithDefault.oneOf ? 'isOneOf' : ''; + return ` + query IntrospectionQuery { + __schema { + ${schemaDescription} + queryType { name } + mutationType { name } + subscriptionType { name } + types { + ...FullType + } + directives { + name + ${descriptions} + ${directiveIsRepeatable} + locations + args${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + } + } + } + + fragment FullType on __Type { + kind + name + ${descriptions} + ${specifiedByUrl} + ${oneOf} + fields(includeDeprecated: true) { + name + ${descriptions} + args${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + ${descriptions} + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + + fragment InputValue on __InputValue { + name + ${descriptions} + type { ...TypeRef } + defaultValue + ${inputDeprecation('isDeprecated')} + ${inputDeprecation('deprecationReason')} + } + + fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + } + } + } + } + } + } + `; +} /***/ }), -/***/ "../../../node_modules/popmotion/dist/popmotion.cjs.js": -/*!*************************************************************!*\ - !*** ../../../node_modules/popmotion/dist/popmotion.cjs.js ***! - \*************************************************************/ +/***/ "../../../node_modules/graphql/utilities/getOperationAST.mjs": +/*!*******************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/getOperationAST.mjs ***! + \*******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -var tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); -var heyListen = __webpack_require__(/*! hey-listen */ "../../../node_modules/hey-listen/dist/hey-listen.es.js"); -var styleValueTypes = __webpack_require__(/*! style-value-types */ "../../../node_modules/style-value-types/dist/valueTypes.cjs.js"); -var sync = __webpack_require__(/*! framesync */ "../../../node_modules/framesync/dist/framesync.cjs.js"); -function _interopDefaultLegacy(e) { - return e && typeof e === 'object' && 'default' in e ? e : { - 'default': e - }; -} -var sync__default = /*#__PURE__*/_interopDefaultLegacy(sync); -const clamp = (min, max, v) => Math.min(Math.max(v, min), max); -const safeMin = 0.001; -const minDuration = 0.01; -const maxDuration = 10.0; -const minDamping = 0.05; -const maxDamping = 1; -function findSpring({ - duration = 800, - bounce = 0.25, - velocity = 0, - mass = 1 -}) { - let envelope; - let derivative; - heyListen.warning(duration <= maxDuration * 1000, "Spring duration must be 10 seconds or less"); - let dampingRatio = 1 - bounce; - dampingRatio = clamp(minDamping, maxDamping, dampingRatio); - duration = clamp(minDuration, maxDuration, duration / 1000); - if (dampingRatio < 1) { - envelope = undampedFreq => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const a = exponentialDecay - velocity; - const b = calcAngularFreq(undampedFreq, dampingRatio); - const c = Math.exp(-delta); - return safeMin - a / b * c; - }; - derivative = undampedFreq => { - const exponentialDecay = undampedFreq * dampingRatio; - const delta = exponentialDecay * duration; - const d = delta * velocity + velocity; - const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; - const f = Math.exp(-delta); - const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); - const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; - return factor * ((d - e) * f) / g; - }; - } else { - envelope = undampedFreq => { - const a = Math.exp(-undampedFreq * duration); - const b = (undampedFreq - velocity) * duration + 1; - return -safeMin + a * b; - }; - derivative = undampedFreq => { - const a = Math.exp(-undampedFreq * duration); - const b = (velocity - undampedFreq) * (duration * duration); - return a * b; - }; - } - const initialGuess = 5 / duration; - const undampedFreq = approximateRoot(envelope, derivative, initialGuess); - duration = duration * 1000; - if (isNaN(undampedFreq)) { - return { - stiffness: 100, - damping: 10, - duration - }; - } else { - const stiffness = Math.pow(undampedFreq, 2) * mass; - return { - stiffness, - damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), - duration - }; - } -} -const rootIterations = 12; -function approximateRoot(envelope, derivative, initialGuess) { - let result = initialGuess; - for (let i = 1; i < rootIterations; i++) { - result = result - envelope(result) / derivative(result); - } - return result; -} -function calcAngularFreq(undampedFreq, dampingRatio) { - return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); -} -const durationKeys = ["duration", "bounce"]; -const physicsKeys = ["stiffness", "damping", "mass"]; -function isSpringType(options, keys) { - return keys.some(key => options[key] !== undefined); -} -function getSpringOptions(options) { - let springOptions = Object.assign({ - velocity: 0.0, - stiffness: 100, - damping: 10, - mass: 1.0, - isResolvedFromDuration: false - }, options); - if (!isSpringType(options, physicsKeys) && isSpringType(options, durationKeys)) { - const derived = findSpring(options); - springOptions = Object.assign(Object.assign(Object.assign({}, springOptions), derived), { - velocity: 0.0, - mass: 1.0 - }); - springOptions.isResolvedFromDuration = true; +exports.getOperationAST = getOperationAST; +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +/** + * Returns an operation AST given a document AST and optionally an operation + * name. If a name is not provided, an operation is only returned if only one is + * provided in the document. + */ + +function getOperationAST(documentAST, operationName) { + let operation = null; + for (const definition of documentAST.definitions) { + if (definition.kind === _kinds.Kind.OPERATION_DEFINITION) { + var _definition$name; + if (operationName == null) { + // If no operation name was provided, only return an Operation if there + // is one defined in the document. Upon encountering the second, return + // null. + if (operation) { + return null; + } + operation = definition; + } else if (((_definition$name = definition.name) === null || _definition$name === void 0 ? void 0 : _definition$name.value) === operationName) { + return definition; + } + } } - return springOptions; + return operation; } -function spring(_a) { - var { - from = 0.0, - to = 1.0, - restSpeed = 2, - restDelta - } = _a, - options = tslib.__rest(_a, ["from", "to", "restSpeed", "restDelta"]); - const state = { - done: false, - value: from - }; - let { - stiffness, - damping, - mass, - velocity, - duration, - isResolvedFromDuration - } = getSpringOptions(options); - let resolveSpring = zero; - let resolveVelocity = zero; - function createSpring() { - const initialVelocity = velocity ? -(velocity / 1000) : 0.0; - const initialDelta = to - from; - const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); - const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000; - if (restDelta === undefined) { - restDelta = Math.min(Math.abs(to - from) / 100, 0.4); + +/***/ }), + +/***/ "../../../node_modules/graphql/utilities/getOperationRootType.mjs": +/*!************************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/getOperationRootType.mjs ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getOperationRootType = getOperationRootType; +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Extracts the root type of the operation from the schema. + * + * @deprecated Please use `GraphQLSchema.getRootType` instead. Will be removed in v17 + */ +function getOperationRootType(schema, operation) { + if (operation.operation === 'query') { + const queryType = schema.getQueryType(); + if (!queryType) { + throw new _GraphQLError.GraphQLError('Schema does not define the required query root type.', { + nodes: operation + }); } - if (dampingRatio < 1) { - const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); - resolveSpring = t => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return to - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq * Math.sin(angularFreq * t) + initialDelta * Math.cos(angularFreq * t)); - }; - resolveVelocity = t => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - return dampingRatio * undampedAngularFreq * envelope * (Math.sin(angularFreq * t) * (initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq + initialDelta * Math.cos(angularFreq * t)) - envelope * (Math.cos(angularFreq * t) * (initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) - angularFreq * initialDelta * Math.sin(angularFreq * t)); - }; - } else if (dampingRatio === 1) { - resolveSpring = t => to - Math.exp(-undampedAngularFreq * t) * (initialDelta + (initialVelocity + undampedAngularFreq * initialDelta) * t); - } else { - const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); - resolveSpring = t => { - const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); - const freqForT = Math.min(dampedAngularFreq * t, 300); - return to - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) * Math.sinh(freqForT) + dampedAngularFreq * initialDelta * Math.cosh(freqForT)) / dampedAngularFreq; - }; + return queryType; + } + if (operation.operation === 'mutation') { + const mutationType = schema.getMutationType(); + if (!mutationType) { + throw new _GraphQLError.GraphQLError('Schema is not configured for mutations.', { + nodes: operation + }); } + return mutationType; } - createSpring(); - return { - next: t => { - const current = resolveSpring(t); - if (!isResolvedFromDuration) { - const currentVelocity = resolveVelocity(t) * 1000; - const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; - const isBelowDisplacementThreshold = Math.abs(to - current) <= restDelta; - state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold; - } else { - state.done = t >= duration; - } - state.value = state.done ? to : current; - return state; - }, - flipTarget: () => { - velocity = -velocity; - [from, to] = [to, from]; - createSpring(); + if (operation.operation === 'subscription') { + const subscriptionType = schema.getSubscriptionType(); + if (!subscriptionType) { + throw new _GraphQLError.GraphQLError('Schema is not configured for subscriptions.', { + nodes: operation + }); } - }; -} -spring.needsInterpolation = (a, b) => typeof a === "string" || typeof b === "string"; -const zero = _t => 0; -const progress = (from, to, value) => { - const toFromDifference = to - from; - return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; -}; -const mix = (from, to, progress) => -progress * from + progress * to + from; -function hueToRgb(p, q, t) { - if (t < 0) t += 1; - if (t > 1) t -= 1; - if (t < 1 / 6) return p + (q - p) * 6 * t; - if (t < 1 / 2) return q; - if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; - return p; -} -function hslaToRgba({ - hue, - saturation, - lightness, - alpha -}) { - hue /= 360; - saturation /= 100; - lightness /= 100; - let red = 0; - let green = 0; - let blue = 0; - if (!saturation) { - red = green = blue = lightness; - } else { - const q = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation; - const p = 2 * lightness - q; - red = hueToRgb(p, q, hue + 1 / 3); - green = hueToRgb(p, q, hue); - blue = hueToRgb(p, q, hue - 1 / 3); + return subscriptionType; } - return { - red: Math.round(red * 255), - green: Math.round(green * 255), - blue: Math.round(blue * 255), - alpha - }; + throw new _GraphQLError.GraphQLError('Can only have query, mutation and subscription operations.', { + nodes: operation + }); } -const mixLinearColor = (from, to, v) => { - const fromExpo = from * from; - const toExpo = to * to; - return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo)); -}; -const colorTypes = [styleValueTypes.hex, styleValueTypes.rgba, styleValueTypes.hsla]; -const getColorType = v => colorTypes.find(type => type.test(v)); -const notAnimatable = color => `'${color}' is not an animatable color. Use the equivalent color code instead.`; -const mixColor = (from, to) => { - let fromColorType = getColorType(from); - let toColorType = getColorType(to); - heyListen.invariant(!!fromColorType, notAnimatable(from)); - heyListen.invariant(!!toColorType, notAnimatable(to)); - let fromColor = fromColorType.parse(from); - let toColor = toColorType.parse(to); - if (fromColorType === styleValueTypes.hsla) { - fromColor = hslaToRgba(fromColor); - fromColorType = styleValueTypes.rgba; + +/***/ }), + +/***/ "../../../node_modules/graphql/utilities/index.mjs": +/*!*********************************************************!*\ + !*** ../../../node_modules/graphql/utilities/index.mjs ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "BreakingChangeType", ({ + enumerable: true, + get: function () { + return _findBreakingChanges.BreakingChangeType; } - if (toColorType === styleValueTypes.hsla) { - toColor = hslaToRgba(toColor); - toColorType = styleValueTypes.rgba; +})); +Object.defineProperty(exports, "DangerousChangeType", ({ + enumerable: true, + get: function () { + return _findBreakingChanges.DangerousChangeType; } - const blended = Object.assign({}, fromColor); - return v => { - for (const key in blended) { - if (key !== "alpha") { - blended[key] = mixLinearColor(fromColor[key], toColor[key], v); - } - } - blended.alpha = mix(fromColor.alpha, toColor.alpha, v); - return fromColorType.transform(blended); - }; -}; -const zeroPoint = { - x: 0, - y: 0, - z: 0 -}; -const isNum = v => typeof v === 'number'; -const combineFunctions = (a, b) => v => b(a(v)); -const pipe = (...transformers) => transformers.reduce(combineFunctions); -function getMixer(origin, target) { - if (isNum(origin)) { - return v => mix(origin, target, v); - } else if (styleValueTypes.color.test(origin)) { - return mixColor(origin, target); - } else { - return mixComplex(origin, target); +})); +Object.defineProperty(exports, "TypeInfo", ({ + enumerable: true, + get: function () { + return _TypeInfo.TypeInfo; } -} -const mixArray = (from, to) => { - const output = [...from]; - const numValues = output.length; - const blendValue = from.map((fromThis, i) => getMixer(fromThis, to[i])); - return v => { - for (let i = 0; i < numValues; i++) { - output[i] = blendValue[i](v); - } - return output; - }; -}; -const mixObject = (origin, target) => { - const output = Object.assign(Object.assign({}, origin), target); - const blendValue = {}; - for (const key in output) { - if (origin[key] !== undefined && target[key] !== undefined) { - blendValue[key] = getMixer(origin[key], target[key]); - } +})); +Object.defineProperty(exports, "assertValidName", ({ + enumerable: true, + get: function () { + return _assertValidName.assertValidName; } - return v => { - for (const key in blendValue) { - output[key] = blendValue[key](v); - } - return output; - }; -}; -function analyse(value) { - const parsed = styleValueTypes.complex.parse(value); - const numValues = parsed.length; - let numNumbers = 0; - let numRGB = 0; - let numHSL = 0; - for (let i = 0; i < numValues; i++) { - if (numNumbers || typeof parsed[i] === "number") { - numNumbers++; - } else { - if (parsed[i].hue !== undefined) { - numHSL++; - } else { - numRGB++; - } - } +})); +Object.defineProperty(exports, "astFromValue", ({ + enumerable: true, + get: function () { + return _astFromValue.astFromValue; } - return { - parsed, - numNumbers, - numRGB, - numHSL - }; -} -const mixComplex = (origin, target) => { - const template = styleValueTypes.complex.createTransformer(target); - const originStats = analyse(origin); - const targetStats = analyse(target); - const canInterpolate = originStats.numHSL === targetStats.numHSL && originStats.numRGB === targetStats.numRGB && originStats.numNumbers >= targetStats.numNumbers; - if (canInterpolate) { - return pipe(mixArray(originStats.parsed, targetStats.parsed), template); - } else { - heyListen.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`); - return p => `${p > 0 ? target : origin}`; +})); +Object.defineProperty(exports, "buildASTSchema", ({ + enumerable: true, + get: function () { + return _buildASTSchema.buildASTSchema; } -}; -const mixNumber = (from, to) => p => mix(from, to, p); -function detectMixerFactory(v) { - if (typeof v === 'number') { - return mixNumber; - } else if (typeof v === 'string') { - if (styleValueTypes.color.test(v)) { - return mixColor; - } else { - return mixComplex; - } - } else if (Array.isArray(v)) { - return mixArray; - } else if (typeof v === 'object') { - return mixObject; +})); +Object.defineProperty(exports, "buildClientSchema", ({ + enumerable: true, + get: function () { + return _buildClientSchema.buildClientSchema; } -} -function createMixers(output, ease, customMixer) { - const mixers = []; - const mixerFactory = customMixer || detectMixerFactory(output[0]); - const numMixers = output.length - 1; - for (let i = 0; i < numMixers; i++) { - let mixer = mixerFactory(output[i], output[i + 1]); - if (ease) { - const easingFunction = Array.isArray(ease) ? ease[i] : ease; - mixer = pipe(easingFunction, mixer); - } - mixers.push(mixer); +})); +Object.defineProperty(exports, "buildSchema", ({ + enumerable: true, + get: function () { + return _buildASTSchema.buildSchema; } - return mixers; -} -function fastInterpolate([from, to], [mixer]) { - return v => mixer(progress(from, to, v)); -} -function slowInterpolate(input, mixers) { - const inputLength = input.length; - const lastInputIndex = inputLength - 1; - return v => { - let mixerIndex = 0; - let foundMixerIndex = false; - if (v <= input[0]) { - foundMixerIndex = true; - } else if (v >= input[lastInputIndex]) { - mixerIndex = lastInputIndex - 1; - foundMixerIndex = true; - } - if (!foundMixerIndex) { - let i = 1; - for (; i < inputLength; i++) { - if (input[i] > v || i === lastInputIndex) { - break; - } - } - mixerIndex = i - 1; - } - const progressInRange = progress(input[mixerIndex], input[mixerIndex + 1], v); - return mixers[mixerIndex](progressInRange); - }; -} -function interpolate(input, output, { - clamp: isClamp = true, - ease, - mixer -} = {}) { - const inputLength = input.length; - heyListen.invariant(inputLength === output.length, 'Both input and output ranges must be the same length'); - heyListen.invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.'); - if (input[0] > input[inputLength - 1]) { - input = [].concat(input); - output = [].concat(output); - input.reverse(); - output.reverse(); +})); +Object.defineProperty(exports, "coerceInputValue", ({ + enumerable: true, + get: function () { + return _coerceInputValue.coerceInputValue; } - const mixers = createMixers(output, ease, mixer); - const interpolator = inputLength === 2 ? fastInterpolate(input, mixers) : slowInterpolate(input, mixers); - return isClamp ? v => interpolator(clamp(input[0], input[inputLength - 1], v)) : interpolator; -} -const reverseEasing = easing => p => 1 - easing(1 - p); -const mirrorEasing = easing => p => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; -const createExpoIn = power => p => Math.pow(p, power); -const createBackIn = power => p => p * p * ((power + 1) * p - power); -const createAnticipate = power => { - const backEasing = createBackIn(power); - return p => (p *= 2) < 1 ? 0.5 * backEasing(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); -}; -const DEFAULT_OVERSHOOT_STRENGTH = 1.525; -const BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0; -const BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0; -const BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0; -const linear = p => p; -const easeIn = createExpoIn(2); -const easeOut = reverseEasing(easeIn); -const easeInOut = mirrorEasing(easeIn); -const circIn = p => 1 - Math.sin(Math.acos(p)); -const circOut = reverseEasing(circIn); -const circInOut = mirrorEasing(circOut); -const backIn = createBackIn(DEFAULT_OVERSHOOT_STRENGTH); -const backOut = reverseEasing(backIn); -const backInOut = mirrorEasing(backIn); -const anticipate = createAnticipate(DEFAULT_OVERSHOOT_STRENGTH); -const ca = 4356.0 / 361.0; -const cb = 35442.0 / 1805.0; -const cc = 16061.0 / 1805.0; -const bounceOut = p => { - if (p === 1 || p === 0) return p; - const p2 = p * p; - return p < BOUNCE_FIRST_THRESHOLD ? 7.5625 * p2 : p < BOUNCE_SECOND_THRESHOLD ? 9.075 * p2 - 9.9 * p + 3.4 : p < BOUNCE_THIRD_THRESHOLD ? ca * p2 - cb * p + cc : 10.8 * p * p - 20.52 * p + 10.72; -}; -const bounceIn = reverseEasing(bounceOut); -const bounceInOut = p => p < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0)) : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5; -function defaultEasing(values, easing) { - return values.map(() => easing || easeInOut).splice(0, values.length - 1); -} -function defaultOffset(values) { - const numValues = values.length; - return values.map((_value, i) => i !== 0 ? i / (numValues - 1) : 0); -} -function convertOffsetToTimes(offset, duration) { - return offset.map(o => o * duration); -} -function keyframes({ - from = 0, - to = 1, - ease, - offset, - duration = 300 -}) { - const state = { - done: false, - value: from - }; - const values = Array.isArray(to) ? to : [from, to]; - const times = convertOffsetToTimes(offset && offset.length === values.length ? offset : defaultOffset(values), duration); - function createInterpolator() { - return interpolate(times, values, { - ease: Array.isArray(ease) ? ease : defaultEasing(values, ease) - }); +})); +Object.defineProperty(exports, "concatAST", ({ + enumerable: true, + get: function () { + return _concatAST.concatAST; } - let interpolator = createInterpolator(); - return { - next: t => { - state.value = interpolator(t); - state.done = t >= duration; - return state; - }, - flipTarget: () => { - values.reverse(); - interpolator = createInterpolator(); - } - }; -} -function decay({ - velocity = 0, - from = 0, - power = 0.8, - timeConstant = 350, - restDelta = 0.5, - modifyTarget -}) { - const state = { - done: false, - value: from - }; - let amplitude = power * velocity; - const ideal = from + amplitude; - const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); - if (target !== ideal) amplitude = target - from; - return { - next: t => { - const delta = -amplitude * Math.exp(-t / timeConstant); - state.done = !(delta > restDelta || delta < -restDelta); - state.value = state.done ? target : target + delta; - return state; - }, - flipTarget: () => {} - }; -} -const types = { - keyframes, - spring, - decay -}; -function detectAnimationFromOptions(config) { - if (Array.isArray(config.to)) { - return keyframes; - } else if (types[config.type]) { - return types[config.type]; +})); +Object.defineProperty(exports, "doTypesOverlap", ({ + enumerable: true, + get: function () { + return _typeComparators.doTypesOverlap; } - const keys = new Set(Object.keys(config)); - if (keys.has("ease") || keys.has("duration") && !keys.has("dampingRatio")) { - return keyframes; - } else if (keys.has("dampingRatio") || keys.has("stiffness") || keys.has("mass") || keys.has("damping") || keys.has("restSpeed") || keys.has("restDelta")) { - return spring; +})); +Object.defineProperty(exports, "extendSchema", ({ + enumerable: true, + get: function () { + return _extendSchema.extendSchema; } - return keyframes; -} -function loopElapsed(elapsed, duration, delay = 0) { - return elapsed - duration - delay; -} -function reverseElapsed(elapsed, duration, delay = 0, isForwardPlayback = true) { - return isForwardPlayback ? loopElapsed(duration + -elapsed, duration, delay) : duration - (elapsed - duration) + delay; -} -function hasRepeatDelayElapsed(elapsed, duration, delay, isForwardPlayback) { - return isForwardPlayback ? elapsed >= duration + delay : elapsed <= -delay; -} -const framesync = update => { - const passTimestamp = ({ - delta - }) => update(delta); - return { - start: () => sync__default["default"].update(passTimestamp, true), - stop: () => sync.cancelSync.update(passTimestamp) - }; -}; -function animate(_a) { - var _b, _c; - var { - from, - autoplay = true, - driver = framesync, - elapsed = 0, - repeat: repeatMax = 0, - repeatType = "loop", - repeatDelay = 0, - onPlay, - onStop, - onComplete, - onRepeat, - onUpdate - } = _a, - options = tslib.__rest(_a, ["from", "autoplay", "driver", "elapsed", "repeat", "repeatType", "repeatDelay", "onPlay", "onStop", "onComplete", "onRepeat", "onUpdate"]); - let { - to - } = options; - let driverControls; - let repeatCount = 0; - let computedDuration = options.duration; - let latest; - let isComplete = false; - let isForwardPlayback = true; - let interpolateFromNumber; - const animator = detectAnimationFromOptions(options); - if ((_c = (_b = animator).needsInterpolation) === null || _c === void 0 ? void 0 : _c.call(_b, from, to)) { - interpolateFromNumber = interpolate([0, 100], [from, to], { - clamp: false - }); - from = 0; - to = 100; +})); +Object.defineProperty(exports, "findBreakingChanges", ({ + enumerable: true, + get: function () { + return _findBreakingChanges.findBreakingChanges; } - const animation = animator(Object.assign(Object.assign({}, options), { - from, - to - })); - function repeat() { - repeatCount++; - if (repeatType === "reverse") { - isForwardPlayback = repeatCount % 2 === 0; - elapsed = reverseElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback); - } else { - elapsed = loopElapsed(elapsed, computedDuration, repeatDelay); - if (repeatType === "mirror") animation.flipTarget(); - } - isComplete = false; - onRepeat && onRepeat(); +})); +Object.defineProperty(exports, "findDangerousChanges", ({ + enumerable: true, + get: function () { + return _findBreakingChanges.findDangerousChanges; } - function complete() { - driverControls.stop(); - onComplete && onComplete(); +})); +Object.defineProperty(exports, "getIntrospectionQuery", ({ + enumerable: true, + get: function () { + return _getIntrospectionQuery.getIntrospectionQuery; } - function update(delta) { - if (!isForwardPlayback) delta = -delta; - elapsed += delta; - if (!isComplete) { - const state = animation.next(Math.max(0, elapsed)); - latest = state.value; - if (interpolateFromNumber) latest = interpolateFromNumber(latest); - isComplete = isForwardPlayback ? state.done : elapsed <= 0; - } - onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(latest); - if (isComplete) { - if (repeatCount === 0) computedDuration !== null && computedDuration !== void 0 ? computedDuration : computedDuration = elapsed; - if (repeatCount < repeatMax) { - hasRepeatDelayElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback) && repeat(); - } else { - complete(); - } - } +})); +Object.defineProperty(exports, "getOperationAST", ({ + enumerable: true, + get: function () { + return _getOperationAST.getOperationAST; } - function play() { - onPlay === null || onPlay === void 0 ? void 0 : onPlay(); - driverControls = driver(update); - driverControls.start(); +})); +Object.defineProperty(exports, "getOperationRootType", ({ + enumerable: true, + get: function () { + return _getOperationRootType.getOperationRootType; } - autoplay && play(); - return { - stop: () => { - onStop === null || onStop === void 0 ? void 0 : onStop(); - driverControls.stop(); - } - }; -} -function velocityPerSecond(velocity, frameDuration) { - return frameDuration ? velocity * (1000 / frameDuration) : 0; -} -function inertia({ - from = 0, - velocity = 0, - min, - max, - power = 0.8, - timeConstant = 750, - bounceStiffness = 500, - bounceDamping = 10, - restDelta = 1, - modifyTarget, - driver, - onUpdate, - onComplete, - onStop -}) { - let currentAnimation; - function isOutOfBounds(v) { - return min !== undefined && v < min || max !== undefined && v > max; +})); +Object.defineProperty(exports, "introspectionFromSchema", ({ + enumerable: true, + get: function () { + return _introspectionFromSchema.introspectionFromSchema; } - function boundaryNearest(v) { - if (min === undefined) return max; - if (max === undefined) return min; - return Math.abs(min - v) < Math.abs(max - v) ? min : max; +})); +Object.defineProperty(exports, "isEqualType", ({ + enumerable: true, + get: function () { + return _typeComparators.isEqualType; } - function startAnimation(options) { - currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(); - currentAnimation = animate(Object.assign(Object.assign({}, options), { - driver, - onUpdate: v => { - var _a; - onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(v); - (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, v); - }, - onComplete, - onStop - })); +})); +Object.defineProperty(exports, "isTypeSubTypeOf", ({ + enumerable: true, + get: function () { + return _typeComparators.isTypeSubTypeOf; } - function startSpring(options) { - startAnimation(Object.assign({ - type: "spring", - stiffness: bounceStiffness, - damping: bounceDamping, - restDelta - }, options)); +})); +Object.defineProperty(exports, "isValidNameError", ({ + enumerable: true, + get: function () { + return _assertValidName.isValidNameError; } - if (isOutOfBounds(from)) { - startSpring({ - from, - velocity, - to: boundaryNearest(from) - }); - } else { - let target = power * velocity + from; - if (typeof modifyTarget !== "undefined") target = modifyTarget(target); - const boundary = boundaryNearest(target); - const heading = boundary === min ? -1 : 1; - let prev; - let current; - const checkBoundary = v => { - prev = current; - current = v; - velocity = velocityPerSecond(v - prev, sync.getFrameData().delta); - if (heading === 1 && v > boundary || heading === -1 && v < boundary) { - startSpring({ - from: v, - to: boundary, - velocity - }); - } - }; - startAnimation({ - type: "decay", - from, - velocity, - timeConstant, - power, - restDelta, - modifyTarget, - onUpdate: isOutOfBounds(target) ? checkBoundary : undefined - }); +})); +Object.defineProperty(exports, "lexicographicSortSchema", ({ + enumerable: true, + get: function () { + return _lexicographicSortSchema.lexicographicSortSchema; } - return { - stop: () => currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop() - }; -} -const radiansToDegrees = radians => radians * 180 / Math.PI; -const angle = (a, b = zeroPoint) => radiansToDegrees(Math.atan2(b.y - a.y, b.x - a.x)); -const applyOffset = (from, to) => { - let hasReceivedFrom = true; - if (to === undefined) { - to = from; - hasReceivedFrom = false; +})); +Object.defineProperty(exports, "printIntrospectionSchema", ({ + enumerable: true, + get: function () { + return _printSchema.printIntrospectionSchema; } - return v => { - if (hasReceivedFrom) { - return v - from + to; - } else { - from = v; - hasReceivedFrom = true; - return to; - } - }; -}; -const identity = v => v; -const createAttractor = (alterDisplacement = identity) => (constant, origin, v) => { - const displacement = origin - v; - const springModifiedDisplacement = -(0 - constant + 1) * (0 - alterDisplacement(Math.abs(displacement))); - return displacement <= 0 ? origin + springModifiedDisplacement : origin - springModifiedDisplacement; -}; -const attract = createAttractor(); -const attractExpo = createAttractor(Math.sqrt); -const degreesToRadians = degrees => degrees * Math.PI / 180; -const isPoint = point => point.hasOwnProperty('x') && point.hasOwnProperty('y'); -const isPoint3D = point => isPoint(point) && point.hasOwnProperty('z'); -const distance1D = (a, b) => Math.abs(a - b); -function distance(a, b) { - if (isNum(a) && isNum(b)) { - return distance1D(a, b); - } else if (isPoint(a) && isPoint(b)) { - const xDelta = distance1D(a.x, b.x); - const yDelta = distance1D(a.y, b.y); - const zDelta = isPoint3D(a) && isPoint3D(b) ? distance1D(a.z, b.z) : 0; - return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2)); +})); +Object.defineProperty(exports, "printSchema", ({ + enumerable: true, + get: function () { + return _printSchema.printSchema; } -} -const pointFromVector = (origin, angle, distance) => { - angle = degreesToRadians(angle); - return { - x: distance * Math.cos(angle) + origin.x, - y: distance * Math.sin(angle) + origin.y - }; -}; -const toDecimal = (num, precision = 2) => { - precision = Math.pow(10, precision); - return Math.round(num * precision) / precision; -}; -const smoothFrame = (prevValue, nextValue, duration, smoothing = 0) => toDecimal(prevValue + duration * (nextValue - prevValue) / Math.max(smoothing, duration)); -const smooth = (strength = 50) => { - let previousValue = 0; - let lastUpdated = 0; - return v => { - const currentFramestamp = sync.getFrameData().timestamp; - const timeDelta = currentFramestamp !== lastUpdated ? currentFramestamp - lastUpdated : 0; - const newValue = timeDelta ? smoothFrame(previousValue, v, timeDelta, strength) : previousValue; - lastUpdated = currentFramestamp; - previousValue = newValue; - return newValue; - }; -}; -const snap = points => { - if (typeof points === 'number') { - return v => Math.round(v / points) * points; - } else { - let i = 0; - const numPoints = points.length; - return v => { - let lastDistance = Math.abs(points[0] - v); - for (i = 1; i < numPoints; i++) { - const point = points[i]; - const distance = Math.abs(point - v); - if (distance === 0) return point; - if (distance > lastDistance) return points[i - 1]; - if (i === numPoints - 1) return point; - lastDistance = distance; - } - }; +})); +Object.defineProperty(exports, "printType", ({ + enumerable: true, + get: function () { + return _printSchema.printType; } -}; -function velocityPerFrame(xps, frameDuration) { - return xps / (1000 / frameDuration); -} -const wrap = (min, max, v) => { - const rangeSize = max - min; - return ((v - min) % rangeSize + rangeSize) % rangeSize + min; -}; -const a = (a1, a2) => 1.0 - 3.0 * a2 + 3.0 * a1; -const b = (a1, a2) => 3.0 * a2 - 6.0 * a1; -const c = a1 => 3.0 * a1; -const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t; -const getSlope = (t, a1, a2) => 3.0 * a(a1, a2) * t * t + 2.0 * b(a1, a2) * t + c(a1); -const subdivisionPrecision = 0.0000001; -const subdivisionMaxIterations = 10; -function binarySubdivide(aX, aA, aB, mX1, mX2) { - let currentX; - let currentT; - let i = 0; - do { - currentT = aA + (aB - aA) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0.0) { - aB = currentT; - } else { - aA = currentT; - } - } while (Math.abs(currentX) > subdivisionPrecision && ++i < subdivisionMaxIterations); - return currentT; -} -const newtonIterations = 8; -const newtonMinSlope = 0.001; -function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { - for (let i = 0; i < newtonIterations; ++i) { - const currentSlope = getSlope(aGuessT, mX1, mX2); - if (currentSlope === 0.0) { - return aGuessT; - } - const currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; +})); +Object.defineProperty(exports, "separateOperations", ({ + enumerable: true, + get: function () { + return _separateOperations.separateOperations; } - return aGuessT; -} -const kSplineTableSize = 11; -const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); -function cubicBezier(mX1, mY1, mX2, mY2) { - if (mX1 === mY1 && mX2 === mY2) return linear; - const sampleValues = new Float32Array(kSplineTableSize); - for (let i = 0; i < kSplineTableSize; ++i) { - sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); +})); +Object.defineProperty(exports, "stripIgnoredCharacters", ({ + enumerable: true, + get: function () { + return _stripIgnoredCharacters.stripIgnoredCharacters; } - function getTForX(aX) { - let intervalStart = 0.0; - let currentSample = 1; - const lastSample = kSplineTableSize - 1; - for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { - intervalStart += kSampleStepSize; - } - --currentSample; - const dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); - const guessForT = intervalStart + dist * kSampleStepSize; - const initialSlope = getSlope(guessForT, mX1, mX2); - if (initialSlope >= newtonMinSlope) { - return newtonRaphsonIterate(aX, guessForT, mX1, mX2); - } else if (initialSlope === 0.0) { - return guessForT; - } else { - return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); - } +})); +Object.defineProperty(exports, "typeFromAST", ({ + enumerable: true, + get: function () { + return _typeFromAST.typeFromAST; } - return t => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); -} -const steps = (steps, direction = 'end') => progress => { - progress = direction === 'end' ? Math.min(progress, 0.999) : Math.max(progress, 0.001); - const expanded = progress * steps; - const rounded = direction === 'end' ? Math.floor(expanded) : Math.ceil(expanded); - return clamp(0, 1, rounded / steps); -}; -exports.angle = angle; -exports.animate = animate; -exports.anticipate = anticipate; -exports.applyOffset = applyOffset; -exports.attract = attract; -exports.attractExpo = attractExpo; -exports.backIn = backIn; -exports.backInOut = backInOut; -exports.backOut = backOut; -exports.bounceIn = bounceIn; -exports.bounceInOut = bounceInOut; -exports.bounceOut = bounceOut; -exports.circIn = circIn; -exports.circInOut = circInOut; -exports.circOut = circOut; -exports.clamp = clamp; -exports.createAnticipate = createAnticipate; -exports.createAttractor = createAttractor; -exports.createBackIn = createBackIn; -exports.createExpoIn = createExpoIn; -exports.cubicBezier = cubicBezier; -exports.decay = decay; -exports.degreesToRadians = degreesToRadians; -exports.distance = distance; -exports.easeIn = easeIn; -exports.easeInOut = easeInOut; -exports.easeOut = easeOut; -exports.inertia = inertia; -exports.interpolate = interpolate; -exports.isPoint = isPoint; -exports.isPoint3D = isPoint3D; -exports.keyframes = keyframes; -exports.linear = linear; -exports.mirrorEasing = mirrorEasing; -exports.mix = mix; -exports.mixColor = mixColor; -exports.mixComplex = mixComplex; -exports.pipe = pipe; -exports.pointFromVector = pointFromVector; -exports.progress = progress; -exports.radiansToDegrees = radiansToDegrees; -exports.reverseEasing = reverseEasing; -exports.smooth = smooth; -exports.smoothFrame = smoothFrame; -exports.snap = snap; -exports.spring = spring; -exports.steps = steps; -exports.toDecimal = toDecimal; -exports.velocityPerFrame = velocityPerFrame; -exports.velocityPerSecond = velocityPerSecond; -exports.wrap = wrap; +})); +Object.defineProperty(exports, "valueFromAST", ({ + enumerable: true, + get: function () { + return _valueFromAST.valueFromAST; + } +})); +Object.defineProperty(exports, "valueFromASTUntyped", ({ + enumerable: true, + get: function () { + return _valueFromASTUntyped.valueFromASTUntyped; + } +})); +Object.defineProperty(exports, "visitWithTypeInfo", ({ + enumerable: true, + get: function () { + return _TypeInfo.visitWithTypeInfo; + } +})); +var _getIntrospectionQuery = __webpack_require__(/*! ./getIntrospectionQuery.mjs */ "../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs"); +var _getOperationAST = __webpack_require__(/*! ./getOperationAST.mjs */ "../../../node_modules/graphql/utilities/getOperationAST.mjs"); +var _getOperationRootType = __webpack_require__(/*! ./getOperationRootType.mjs */ "../../../node_modules/graphql/utilities/getOperationRootType.mjs"); +var _introspectionFromSchema = __webpack_require__(/*! ./introspectionFromSchema.mjs */ "../../../node_modules/graphql/utilities/introspectionFromSchema.mjs"); +var _buildClientSchema = __webpack_require__(/*! ./buildClientSchema.mjs */ "../../../node_modules/graphql/utilities/buildClientSchema.mjs"); +var _buildASTSchema = __webpack_require__(/*! ./buildASTSchema.mjs */ "../../../node_modules/graphql/utilities/buildASTSchema.mjs"); +var _extendSchema = __webpack_require__(/*! ./extendSchema.mjs */ "../../../node_modules/graphql/utilities/extendSchema.mjs"); +var _lexicographicSortSchema = __webpack_require__(/*! ./lexicographicSortSchema.mjs */ "../../../node_modules/graphql/utilities/lexicographicSortSchema.mjs"); +var _printSchema = __webpack_require__(/*! ./printSchema.mjs */ "../../../node_modules/graphql/utilities/printSchema.mjs"); +var _typeFromAST = __webpack_require__(/*! ./typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); +var _valueFromAST = __webpack_require__(/*! ./valueFromAST.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); +var _valueFromASTUntyped = __webpack_require__(/*! ./valueFromASTUntyped.mjs */ "../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs"); +var _astFromValue = __webpack_require__(/*! ./astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); +var _TypeInfo = __webpack_require__(/*! ./TypeInfo.mjs */ "../../../node_modules/graphql/utilities/TypeInfo.mjs"); +var _coerceInputValue = __webpack_require__(/*! ./coerceInputValue.mjs */ "../../../node_modules/graphql/utilities/coerceInputValue.mjs"); +var _concatAST = __webpack_require__(/*! ./concatAST.mjs */ "../../../node_modules/graphql/utilities/concatAST.mjs"); +var _separateOperations = __webpack_require__(/*! ./separateOperations.mjs */ "../../../node_modules/graphql/utilities/separateOperations.mjs"); +var _stripIgnoredCharacters = __webpack_require__(/*! ./stripIgnoredCharacters.mjs */ "../../../node_modules/graphql/utilities/stripIgnoredCharacters.mjs"); +var _typeComparators = __webpack_require__(/*! ./typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); +var _assertValidName = __webpack_require__(/*! ./assertValidName.mjs */ "../../../node_modules/graphql/utilities/assertValidName.mjs"); +var _findBreakingChanges = __webpack_require__(/*! ./findBreakingChanges.mjs */ "../../../node_modules/graphql/utilities/findBreakingChanges.mjs"); /***/ }), -/***/ "../../../node_modules/punycode.js/punycode.es6.js": -/*!*********************************************************!*\ - !*** ../../../node_modules/punycode.js/punycode.es6.js ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/graphql/utilities/introspectionFromSchema.mjs": +/*!***************************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/introspectionFromSchema.mjs ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; -/** Highest positive signed 32-bit float value */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUnicode = exports.toASCII = exports.encode = exports["default"] = exports.decode = void 0; -exports.ucs2decode = ucs2decode; -exports.ucs2encode = void 0; -const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 +exports.introspectionFromSchema = introspectionFromSchema; +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _parser = __webpack_require__(/*! ../language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); +var _execute = __webpack_require__(/*! ../execution/execute.mjs */ "../../../node_modules/graphql/execution/execute.mjs"); +var _getIntrospectionQuery = __webpack_require__(/*! ./getIntrospectionQuery.mjs */ "../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs"); +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + */ -/** Bootstring parameters */ -const base = 36; -const tMin = 1; -const tMax = 26; -const skew = 38; -const damp = 700; -const initialBias = 72; -const initialN = 128; // 0x80 -const delimiter = '-'; // '\x2D' +function introspectionFromSchema(schema, options) { + const optionsWithDefaults = { + specifiedByUrl: true, + directiveIsRepeatable: true, + schemaDescription: true, + inputValueDeprecation: true, + oneOf: true, + ...options + }; + const document = (0, _parser.parse)((0, _getIntrospectionQuery.getIntrospectionQuery)(optionsWithDefaults)); + const result = (0, _execute.executeSync)({ + schema, + document + }); + !result.errors && result.data || (0, _invariant.invariant)(false); + return result.data; +} -/** Regular expressions */ -const regexPunycode = /^xn--/; -const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. -const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators +/***/ }), -/** Error messages */ -const errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; +/***/ "../../../node_modules/graphql/utilities/lexicographicSortSchema.mjs": +/*!***************************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/lexicographicSortSchema.mjs ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -/** Convenience shortcuts */ -const baseMinusTMin = base - tMin; -const floor = Math.floor; -const stringFromCharCode = String.fromCharCode; +"use strict"; -/*--------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.lexicographicSortSchema = lexicographicSortSchema; +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _keyValMap = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); +var _naturalCompare = __webpack_require__(/*! ../jsutils/naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +var _schema = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); /** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. + * Sort GraphQLSchema. + * + * This function returns a sorted copy of the given GraphQLSchema. */ -function error(type) { - throw new RangeError(errors[type]); -} -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, callback) { - const result = []; - let length = array.length; - while (length--) { - result[length] = callback(array[length]); - } - return result; -} +function lexicographicSortSchema(schema) { + const schemaConfig = schema.toConfig(); + const typeMap = (0, _keyValMap.keyValMap)(sortByName(schemaConfig.types), type => type.name, sortNamedType); + return new _schema.GraphQLSchema({ + ...schemaConfig, + types: Object.values(typeMap), + directives: sortByName(schemaConfig.directives).map(sortDirective), + query: replaceMaybeType(schemaConfig.query), + mutation: replaceMaybeType(schemaConfig.mutation), + subscription: replaceMaybeType(schemaConfig.subscription) + }); + function replaceType(type) { + if ((0, _definition.isListType)(type)) { + // @ts-expect-error + return new _definition.GraphQLList(replaceType(type.ofType)); + } else if ((0, _definition.isNonNullType)(type)) { + // @ts-expect-error + return new _definition.GraphQLNonNull(replaceType(type.ofType)); + } // @ts-expect-error FIXME: TS Conversion -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {String} A new string of characters returned by the callback - * function. - */ -function mapDomain(domain, callback) { - const parts = domain.split('@'); - let result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - domain = parts[1]; + return replaceNamedType(type); } - // Avoid `split(regex)` for IE8 compatibility. See #17. - domain = domain.replace(regexSeparators, '\x2E'); - const labels = domain.split('.'); - const encoded = map(labels, callback).join('.'); - return result + encoded; -} - -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - const output = []; - let counter = 0; - const length = string.length; - while (counter < length) { - const value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - const extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { - // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } + function replaceNamedType(type) { + return typeMap[type.name]; } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -const ucs2encode = codePoints => String.fromCodePoint(...codePoints); - -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -exports.ucs2encode = ucs2encode; -const basicToDigit = function (codePoint) { - if (codePoint >= 0x30 && codePoint < 0x3A) { - return 26 + (codePoint - 0x30); + function replaceMaybeType(maybeType) { + return maybeType && replaceNamedType(maybeType); } - if (codePoint >= 0x41 && codePoint < 0x5B) { - return codePoint - 0x41; + function sortDirective(directive) { + const config = directive.toConfig(); + return new _directives.GraphQLDirective({ + ...config, + locations: sortBy(config.locations, x => x), + args: sortArgs(config.args) + }); } - if (codePoint >= 0x61 && codePoint < 0x7B) { - return codePoint - 0x61; + function sortArgs(args) { + return sortObjMap(args, arg => ({ + ...arg, + type: replaceType(arg.type) + })); } - return base; -}; - -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -const digitToBasic = function (digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; - -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -const adapt = function (delta, numPoints, firstTime) { - let k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for /* no initialization */ - (; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); + function sortFields(fieldsMap) { + return sortObjMap(fieldsMap, field => ({ + ...field, + type: replaceType(field.type), + args: field.args && sortArgs(field.args) + })); } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; - -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -const decode = function (input) { - // Don't use UCS-2. - const output = []; - const inputLength = input.length; - let i = 0; - let n = initialN; - let bias = initialBias; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - let basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; + function sortInputFields(fieldsMap) { + return sortObjMap(fieldsMap, field => ({ + ...field, + type: replaceType(field.type) + })); } - for (let j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); + function sortTypes(array) { + return sortByName(array).map(replaceNamedType); } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for /* no final expression */ - (let index = basic > 0 ? basic + 1 : 0; index < inputLength;) { - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - const oldi = i; - for /* no condition */ - (let w = 1, k = base;; k += base) { - if (index >= inputLength) { - error('invalid-input'); - } - const digit = basicToDigit(input.charCodeAt(index++)); - if (digit >= base) { - error('invalid-input'); - } - if (digit > floor((maxInt - i) / w)) { - error('overflow'); - } - i += digit * w; - const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - if (digit < t) { - break; - } - const baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - w *= baseMinusT; + function sortNamedType(type) { + if ((0, _definition.isScalarType)(type) || (0, _introspection.isIntrospectionType)(type)) { + return type; } - const out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); + if ((0, _definition.isObjectType)(type)) { + const config = type.toConfig(); + return new _definition.GraphQLObjectType({ + ...config, + interfaces: () => sortTypes(config.interfaces), + fields: () => sortFields(config.fields) + }); } - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); - } - return String.fromCodePoint(...output); -}; - -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -exports.decode = decode; -const encode = function (input) { - const output = []; - - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - - // Cache the length. - const inputLength = input.length; - - // Initialize the state. - let n = initialN; - let delta = 0; - let bias = initialBias; - - // Handle the basic code points. - for (const currentValue of input) { - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); + if ((0, _definition.isInterfaceType)(type)) { + const config = type.toConfig(); + return new _definition.GraphQLInterfaceType({ + ...config, + interfaces: () => sortTypes(config.interfaces), + fields: () => sortFields(config.fields) + }); } - } - const basicLength = output.length; - let handledCPCount = basicLength; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - // All non-basic code points < n have been handled already. Find the next - // larger one: - let m = maxInt; - for (const currentValue of input) { - if (currentValue >= n && currentValue < m) { - m = currentValue; - } + if ((0, _definition.isUnionType)(type)) { + const config = type.toConfig(); + return new _definition.GraphQLUnionType({ + ...config, + types: () => sortTypes(config.types) + }); } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - const handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); + if ((0, _definition.isEnumType)(type)) { + const config = type.toConfig(); + return new _definition.GraphQLEnumType({ + ...config, + values: sortObjMap(config.values, value => value) + }); } - delta += (m - n) * handledCPCountPlusOne; - n = m; - for (const currentValue of input) { - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - if (currentValue === n) { - // Represent delta as a generalized variable-length integer. - let q = delta; - for /* no condition */ - (let k = base;; k += base) { - const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - if (q < t) { - break; - } - const qMinusT = q - t; - const baseMinusT = base - t; - output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); - q = floor(qMinusT / baseMinusT); - } - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); - delta = 0; - ++handledCPCount; - } + if ((0, _definition.isInputObjectType)(type)) { + const config = type.toConfig(); + return new _definition.GraphQLInputObjectType({ + ...config, + fields: () => sortInputFields(config.fields) + }); } - ++delta; - ++n; - } - return output.join(''); -}; - -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -exports.encode = encode; -const toUnicode = function (input) { - return mapDomain(input, function (string) { - return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; - }); -}; + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -exports.toUnicode = toUnicode; -const toASCII = function (input) { - return mapDomain(input, function (string) { - return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); + } +} +function sortObjMap(map, sortValueFn) { + const sortedMap = Object.create(null); + for (const key of Object.keys(map).sort(_naturalCompare.naturalCompare)) { + sortedMap[key] = sortValueFn(map[key]); + } + return sortedMap; +} +function sortByName(array) { + return sortBy(array, obj => obj.name); +} +function sortBy(array, mapToKey) { + return array.slice().sort((obj1, obj2) => { + const key1 = mapToKey(obj1); + const key2 = mapToKey(obj2); + return (0, _naturalCompare.naturalCompare)(key1, key2); }); -}; - -/*--------------------------------------------------------------------------*/ - -/** Define the public API */ -exports.toASCII = toASCII; -const punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.3.1', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; -var _default = exports["default"] = punycode; +} /***/ }), -/***/ "../../../node_modules/react-remove-scroll-bar/dist/es2015/component.js": -/*!******************************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll-bar/dist/es2015/component.js ***! - \******************************************************************************/ +/***/ "../../../node_modules/graphql/utilities/printSchema.mjs": +/*!***************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/printSchema.mjs ***! + \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RemoveScrollBar = void 0; -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); -var _reactStyleSingleton = __webpack_require__(/*! react-style-singleton */ "../../../node_modules/react-style-singleton/dist/es2015/index.js"); -var _constants = __webpack_require__(/*! ./constants */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js"); -var _utils = __webpack_require__(/*! ./utils */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js"); -function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } -var Style = (0, _reactStyleSingleton.styleSingleton)(); -// important tip - once we measure scrollBar width and remove them -// we could not repeat this operation -// thus we are using style-singleton - only the first "yet correct" style will be applied. -var getStyles = function (_a, allowRelative, gapMode, important) { - var left = _a.left, - top = _a.top, - right = _a.right, - gap = _a.gap; - if (gapMode === void 0) { - gapMode = 'margin'; +exports.printIntrospectionSchema = printIntrospectionSchema; +exports.printSchema = printSchema; +exports.printType = printType; +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _blockString = __webpack_require__(/*! ../language/blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _printer = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _directives = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +var _introspection = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); +var _astFromValue = __webpack_require__(/*! ./astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); +function printSchema(schema) { + return printFilteredSchema(schema, n => !(0, _directives.isSpecifiedDirective)(n), isDefinedType); +} +function printIntrospectionSchema(schema) { + return printFilteredSchema(schema, _directives.isSpecifiedDirective, _introspection.isIntrospectionType); +} +function isDefinedType(type) { + return !(0, _scalars.isSpecifiedScalarType)(type) && !(0, _introspection.isIntrospectionType)(type); +} +function printFilteredSchema(schema, directiveFilter, typeFilter) { + const directives = schema.getDirectives().filter(directiveFilter); + const types = Object.values(schema.getTypeMap()).filter(typeFilter); + return [printSchemaDefinition(schema), ...directives.map(directive => printDirective(directive)), ...types.map(type => printType(type))].filter(Boolean).join('\n\n'); +} +function printSchemaDefinition(schema) { + if (schema.description == null && isSchemaOfCommonNames(schema)) { + return; } - return "\n .".concat(_constants.noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([allowRelative && "position: relative ".concat(important, ";"), gapMode === 'margin' && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "), gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";")].filter(Boolean).join(''), "\n }\n \n .").concat(_constants.zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(_constants.fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(_constants.zeroRightClassName, " .").concat(_constants.zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(_constants.fullWidthClassName, " .").concat(_constants.fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body {\n ").concat(_constants.removedBarSizeVariable, ": ").concat(gap, "px;\n }\n"); -}; -/** - * Removes page scrollbar and blocks page scroll when mounted - */ -var RemoveScrollBar = function (props) { - var noRelative = props.noRelative, - noImportant = props.noImportant, - _a = props.gapMode, - gapMode = _a === void 0 ? 'margin' : _a; - var gap = React.useMemo(function () { - return (0, _utils.getGapWidth)(gapMode); - }, [gapMode]); - return /*#__PURE__*/React.createElement(Style, { - styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') - }); -}; -exports.RemoveScrollBar = RemoveScrollBar; - -/***/ }), - -/***/ "../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js": -/*!******************************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js ***! - \******************************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.zeroRightClassName = exports.removedBarSizeVariable = exports.noScrollbarsClassName = exports.fullWidthClassName = void 0; -var zeroRightClassName = exports.zeroRightClassName = 'right-scroll-bar-position'; -var fullWidthClassName = exports.fullWidthClassName = 'width-before-scroll-bar'; -var noScrollbarsClassName = exports.noScrollbarsClassName = 'with-scroll-bars-hidden'; + const operationTypes = []; + const queryType = schema.getQueryType(); + if (queryType) { + operationTypes.push(` query: ${queryType.name}`); + } + const mutationType = schema.getMutationType(); + if (mutationType) { + operationTypes.push(` mutation: ${mutationType.name}`); + } + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType) { + operationTypes.push(` subscription: ${subscriptionType.name}`); + } + return printDescription(schema) + `schema {\n${operationTypes.join('\n')}\n}`; +} /** - * Name of a CSS variable containing the amount of "hidden" scrollbar - * ! might be undefined ! use will fallback! + * GraphQL schema define root types for each type of operation. These types are + * the same as any other type and can be named in any manner, however there is + * a common naming convention: + * + * ```graphql + * schema { + * query: Query + * mutation: Mutation + * subscription: Subscription + * } + * ``` + * + * When using this naming convention, the schema description can be omitted. */ -var removedBarSizeVariable = exports.removedBarSizeVariable = '--removed-body-scroll-bar-size'; - -/***/ }), - -/***/ "../../../node_modules/react-remove-scroll-bar/dist/es2015/index.js": -/*!**************************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll-bar/dist/es2015/index.js ***! - \**************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "RemoveScrollBar", ({ - enumerable: true, - get: function () { - return _component.RemoveScrollBar; - } -})); -Object.defineProperty(exports, "fullWidthClassName", ({ - enumerable: true, - get: function () { - return _constants.fullWidthClassName; +function isSchemaOfCommonNames(schema) { + const queryType = schema.getQueryType(); + if (queryType && queryType.name !== 'Query') { + return false; } -})); -Object.defineProperty(exports, "getGapWidth", ({ - enumerable: true, - get: function () { - return _utils.getGapWidth; + const mutationType = schema.getMutationType(); + if (mutationType && mutationType.name !== 'Mutation') { + return false; } -})); -Object.defineProperty(exports, "noScrollbarsClassName", ({ - enumerable: true, - get: function () { - return _constants.noScrollbarsClassName; + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType && subscriptionType.name !== 'Subscription') { + return false; } -})); -Object.defineProperty(exports, "removedBarSizeVariable", ({ - enumerable: true, - get: function () { - return _constants.removedBarSizeVariable; + return true; +} +function printType(type) { + if ((0, _definition.isScalarType)(type)) { + return printScalar(type); } -})); -Object.defineProperty(exports, "zeroRightClassName", ({ - enumerable: true, - get: function () { - return _constants.zeroRightClassName; + if ((0, _definition.isObjectType)(type)) { + return printObject(type); } -})); -var _component = __webpack_require__(/*! ./component */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/component.js"); -var _constants = __webpack_require__(/*! ./constants */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js"); -var _utils = __webpack_require__(/*! ./utils */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js"); - -/***/ }), - -/***/ "../../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js": -/*!**************************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js ***! - \**************************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - + if ((0, _definition.isInterfaceType)(type)) { + return printInterface(type); + } + if ((0, _definition.isUnionType)(type)) { + return printUnion(type); + } + if ((0, _definition.isEnumType)(type)) { + return printEnum(type); + } + if ((0, _definition.isInputObjectType)(type)) { + return printInputObject(type); + } + /* c8 ignore next 3 */ + // Not reachable, all possible types have been considered. + false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); +} +function printScalar(type) { + return printDescription(type) + `scalar ${type.name}` + printSpecifiedByURL(type); +} +function printImplementedInterfaces(type) { + const interfaces = type.getInterfaces(); + return interfaces.length ? ' implements ' + interfaces.map(i => i.name).join(' & ') : ''; +} +function printObject(type) { + return printDescription(type) + `type ${type.name}` + printImplementedInterfaces(type) + printFields(type); +} +function printInterface(type) { + return printDescription(type) + `interface ${type.name}` + printImplementedInterfaces(type) + printFields(type); +} +function printUnion(type) { + const types = type.getTypes(); + const possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; + return printDescription(type) + 'union ' + type.name + possibleTypes; +} +function printEnum(type) { + const values = type.getValues().map((value, i) => printDescription(value, ' ', !i) + ' ' + value.name + printDeprecated(value.deprecationReason)); + return printDescription(type) + `enum ${type.name}` + printBlock(values); +} +function printInputObject(type) { + const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f)); + return printDescription(type) + `input ${type.name}` + (type.isOneOf ? ' @oneOf' : '') + printBlock(fields); +} +function printFields(type) { + const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, ' ', !i) + ' ' + f.name + printArgs(f.args, ' ') + ': ' + String(f.type) + printDeprecated(f.deprecationReason)); + return printBlock(fields); +} +function printBlock(items) { + return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; +} +function printArgs(args, indentation = '') { + if (args.length === 0) { + return ''; + } // If every arg does not have a description, print them on one line. -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.zeroGap = exports.getGapWidth = void 0; -var zeroGap = exports.zeroGap = { - left: 0, - top: 0, - right: 0, - gap: 0 -}; -var parse = function (x) { - return parseInt(x || '', 10) || 0; -}; -var getOffset = function (gapMode) { - var cs = window.getComputedStyle(document.body); - if (true) { - if (cs.overflowY === 'hidden') { - console.error('react-remove-scroll-bar: cannot calculate scrollbar size because it is removed (overflow:hidden on body'); - } + if (args.every(arg => !arg.description)) { + return '(' + args.map(printInputValue).join(', ') + ')'; } - var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft']; - var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop']; - var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight']; - return [parse(left), parse(top), parse(right)]; -}; -var getGapWidth = function (gapMode) { - if (gapMode === void 0) { - gapMode = 'margin'; + return '(\n' + args.map((arg, i) => printDescription(arg, ' ' + indentation, !i) + ' ' + indentation + printInputValue(arg)).join('\n') + '\n' + indentation + ')'; +} +function printInputValue(arg) { + const defaultAST = (0, _astFromValue.astFromValue)(arg.defaultValue, arg.type); + let argDecl = arg.name + ': ' + String(arg.type); + if (defaultAST) { + argDecl += ` = ${(0, _printer.print)(defaultAST)}`; } - if (typeof window === 'undefined') { - return zeroGap; + return argDecl + printDeprecated(arg.deprecationReason); +} +function printDirective(directive) { + return printDescription(directive) + 'directive @' + directive.name + printArgs(directive.args) + (directive.isRepeatable ? ' repeatable' : '') + ' on ' + directive.locations.join(' | '); +} +function printDeprecated(reason) { + if (reason == null) { + return ''; } - var offsets = getOffset(gapMode); - var documentWidth = document.documentElement.clientWidth; - var windowWidth = window.innerWidth; - return { - left: offsets[0], - top: offsets[1], - right: offsets[2], - gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]) - }; -}; -exports.getGapWidth = getGapWidth; + if (reason !== _directives.DEFAULT_DEPRECATION_REASON) { + const astValue = (0, _printer.print)({ + kind: _kinds.Kind.STRING, + value: reason + }); + return ` @deprecated(reason: ${astValue})`; + } + return ' @deprecated'; +} +function printSpecifiedByURL(scalar) { + if (scalar.specifiedByURL == null) { + return ''; + } + const astValue = (0, _printer.print)({ + kind: _kinds.Kind.STRING, + value: scalar.specifiedByURL + }); + return ` @specifiedBy(url: ${astValue})`; +} +function printDescription(def, indentation = '', firstInBlock = true) { + const { + description + } = def; + if (description == null) { + return ''; + } + const blockString = (0, _printer.print)({ + kind: _kinds.Kind.STRING, + value: description, + block: (0, _blockString.isPrintableAsBlockString)(description) + }); + const prefix = indentation && !firstInBlock ? '\n' + indentation : indentation; + return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; +} /***/ }), -/***/ "../../../node_modules/react-remove-scroll/dist/es2015/Combination.js": -/*!****************************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll/dist/es2015/Combination.js ***! - \****************************************************************************/ +/***/ "../../../node_modules/graphql/utilities/separateOperations.mjs": +/*!**********************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/separateOperations.mjs ***! + \**********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports["default"] = void 0; -var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); -var _UI = __webpack_require__(/*! ./UI */ "../../../node_modules/react-remove-scroll/dist/es2015/UI.js"); -var _sidecar = _interopRequireDefault(__webpack_require__(/*! ./sidecar */ "../../../node_modules/react-remove-scroll/dist/es2015/sidecar.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } -var ReactRemoveScroll = /*#__PURE__*/React.forwardRef(function (props, ref) { - return /*#__PURE__*/React.createElement(_UI.RemoveScroll, (0, _tslib.__assign)({}, props, { - ref: ref, - sideCar: _sidecar.default - })); -}); -ReactRemoveScroll.classNames = _UI.RemoveScroll.classNames; -var _default = exports["default"] = ReactRemoveScroll; +exports.separateOperations = separateOperations; +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _visitor = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + */ + +function separateOperations(documentAST) { + const operations = []; + const depGraph = Object.create(null); // Populate metadata and build a dependency graph. + + for (const definitionNode of documentAST.definitions) { + switch (definitionNode.kind) { + case _kinds.Kind.OPERATION_DEFINITION: + operations.push(definitionNode); + break; + case _kinds.Kind.FRAGMENT_DEFINITION: + depGraph[definitionNode.name.value] = collectDependencies(definitionNode.selectionSet); + break; + default: // ignore non-executable definitions + } + } // For each operation, produce a new synthesized AST which includes only what + // is necessary for completing that operation. + + const separatedDocumentASTs = Object.create(null); + for (const operation of operations) { + const dependencies = new Set(); + for (const fragmentName of collectDependencies(operation.selectionSet)) { + collectTransitiveDependencies(dependencies, depGraph, fragmentName); + } // Provides the empty string for anonymous operations. + + const operationName = operation.name ? operation.name.value : ''; // The list of definition nodes to be included for this operation, sorted + // to retain the same order as the original document. + + separatedDocumentASTs[operationName] = { + kind: _kinds.Kind.DOCUMENT, + definitions: documentAST.definitions.filter(node => node === operation || node.kind === _kinds.Kind.FRAGMENT_DEFINITION && dependencies.has(node.name.value)) + }; + } + return separatedDocumentASTs; +} + +// From a dependency graph, collects a list of transitive dependencies by +// recursing through a dependency graph. +function collectTransitiveDependencies(collected, depGraph, fromName) { + if (!collected.has(fromName)) { + collected.add(fromName); + const immediateDeps = depGraph[fromName]; + if (immediateDeps !== undefined) { + for (const toName of immediateDeps) { + collectTransitiveDependencies(collected, depGraph, toName); + } + } + } +} +function collectDependencies(selectionSet) { + const dependencies = []; + (0, _visitor.visit)(selectionSet, { + FragmentSpread(node) { + dependencies.push(node.name.value); + } + }); + return dependencies; +} /***/ }), -/***/ "../../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js": -/*!***************************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js ***! - \***************************************************************************/ +/***/ "../../../node_modules/graphql/utilities/sortValueNode.mjs": +/*!*****************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/sortValueNode.mjs ***! + \*****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RemoveScrollSideCar = RemoveScrollSideCar; -exports.getTouchXY = exports.getDeltaXY = void 0; -var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); -var _reactRemoveScrollBar = __webpack_require__(/*! react-remove-scroll-bar */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/index.js"); -var _reactStyleSingleton = __webpack_require__(/*! react-style-singleton */ "../../../node_modules/react-style-singleton/dist/es2015/index.js"); -var _aggresiveCapture = __webpack_require__(/*! ./aggresiveCapture */ "../../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js"); -var _handleScroll = __webpack_require__(/*! ./handleScroll */ "../../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js"); -function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } -var getTouchXY = function (event) { - return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; -}; -exports.getTouchXY = getTouchXY; -var getDeltaXY = function (event) { - return [event.deltaX, event.deltaY]; -}; -exports.getDeltaXY = getDeltaXY; -var extractRef = function (ref) { - return ref && 'current' in ref ? ref.current : ref; -}; -var deltaCompare = function (x, y) { - return x[0] === y[0] && x[1] === y[1]; -}; -var generateStyle = function (id) { - return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); -}; -var idCounter = 0; -var lockStack = []; -function RemoveScrollSideCar(props) { - var shouldPreventQueue = React.useRef([]); - var touchStartRef = React.useRef([0, 0]); - var activeAxis = React.useRef(); - var id = React.useState(idCounter++)[0]; - var Style = React.useState(function () { - return (0, _reactStyleSingleton.styleSingleton)(); - })[0]; - var lastProps = React.useRef(props); - React.useEffect(function () { - lastProps.current = props; - }, [props]); - React.useEffect(function () { - if (props.inert) { - document.body.classList.add("block-interactivity-".concat(id)); - var allow_1 = (0, _tslib.__spreadArray)([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean); - allow_1.forEach(function (el) { - return el.classList.add("allow-interactivity-".concat(id)); - }); - return function () { - document.body.classList.remove("block-interactivity-".concat(id)); - allow_1.forEach(function (el) { - return el.classList.remove("allow-interactivity-".concat(id)); - }); +exports.sortValueNode = sortValueNode; +var _naturalCompare = __webpack_require__(/*! ../jsutils/naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +/** + * Sort ValueNode. + * + * This function returns a sorted copy of the given ValueNode. + * + * @internal + */ + +function sortValueNode(valueNode) { + switch (valueNode.kind) { + case _kinds.Kind.OBJECT: + return { + ...valueNode, + fields: sortFields(valueNode.fields) }; - } - return; - }, [props.inert, props.lockRef.current, props.shards]); - var shouldCancelEvent = React.useCallback(function (event, parent) { - if ('touches' in event && event.touches.length === 2) { - return !lastProps.current.allowPinchZoom; - } - var touch = getTouchXY(event); - var touchStart = touchStartRef.current; - var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0]; - var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1]; - var currentAxis; - var target = event.target; - var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v'; - // allow horizontal touch move on Range inputs. They will not cause any scroll - if ('touches' in event && moveDirection === 'h' && target.type === 'range') { - return false; - } - var canBeScrolledInMainDirection = (0, _handleScroll.locationCouldBeScrolled)(moveDirection, target); - if (!canBeScrolledInMainDirection) { - return true; - } - if (canBeScrolledInMainDirection) { - currentAxis = moveDirection; - } else { - currentAxis = moveDirection === 'v' ? 'h' : 'v'; - canBeScrolledInMainDirection = (0, _handleScroll.locationCouldBeScrolled)(moveDirection, target); - // other axis might be not scrollable - } - if (!canBeScrolledInMainDirection) { - return false; - } - if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) { - activeAxis.current = currentAxis; - } - if (!currentAxis) { - return true; - } - var cancelingAxis = activeAxis.current || currentAxis; - return (0, _handleScroll.handleScroll)(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true); - }, []); - var shouldPrevent = React.useCallback(function (_event) { - var event = _event; - if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) { - // not the last active - return; - } - var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event); - var sourceEvent = shouldPreventQueue.current.filter(function (e) { - return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); - })[0]; - // self event, and should be canceled - if (sourceEvent && sourceEvent.should) { - if (event.cancelable) { - event.preventDefault(); - } - return; - } - // outside or shard event - if (!sourceEvent) { - var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function (node) { - return node.contains(event.target); - }); - var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; - if (shouldStop) { - if (event.cancelable) { - event.preventDefault(); - } - } - } - }, []); - var shouldCancel = React.useCallback(function (name, delta, target, should) { - var event = { - name: name, - delta: delta, - target: target, - should: should - }; - shouldPreventQueue.current.push(event); - setTimeout(function () { - shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { - return e !== event; - }); - }, 1); - }, []); - var scrollTouchStart = React.useCallback(function (event) { - touchStartRef.current = getTouchXY(event); - activeAxis.current = undefined; - }, []); - var scrollWheel = React.useCallback(function (event) { - shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); - }, []); - var scrollTouchMove = React.useCallback(function (event) { - shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); - }, []); - React.useEffect(function () { - lockStack.push(Style); - props.setCallbacks({ - onScrollCapture: scrollWheel, - onWheelCapture: scrollWheel, - onTouchMoveCapture: scrollTouchMove - }); - document.addEventListener('wheel', shouldPrevent, _aggresiveCapture.nonPassive); - document.addEventListener('touchmove', shouldPrevent, _aggresiveCapture.nonPassive); - document.addEventListener('touchstart', scrollTouchStart, _aggresiveCapture.nonPassive); - return function () { - lockStack = lockStack.filter(function (inst) { - return inst !== Style; - }); - document.removeEventListener('wheel', shouldPrevent, _aggresiveCapture.nonPassive); - document.removeEventListener('touchmove', shouldPrevent, _aggresiveCapture.nonPassive); - document.removeEventListener('touchstart', scrollTouchStart, _aggresiveCapture.nonPassive); - }; - }, []); - var removeScrollBar = props.removeScrollBar, - inert = props.inert; - return /*#__PURE__*/React.createElement(React.Fragment, null, inert ? /*#__PURE__*/React.createElement(Style, { - styles: generateStyle(id) - }) : null, removeScrollBar ? /*#__PURE__*/React.createElement(_reactRemoveScrollBar.RemoveScrollBar, { - gapMode: "margin" - }) : null); + case _kinds.Kind.LIST: + return { + ...valueNode, + values: valueNode.values.map(sortValueNode) + }; + case _kinds.Kind.INT: + case _kinds.Kind.FLOAT: + case _kinds.Kind.STRING: + case _kinds.Kind.BOOLEAN: + case _kinds.Kind.NULL: + case _kinds.Kind.ENUM: + case _kinds.Kind.VARIABLE: + return valueNode; + } +} +function sortFields(fields) { + return fields.map(fieldNode => ({ + ...fieldNode, + value: sortValueNode(fieldNode.value) + })).sort((fieldA, fieldB) => (0, _naturalCompare.naturalCompare)(fieldA.name.value, fieldB.name.value)); } /***/ }), -/***/ "../../../node_modules/react-remove-scroll/dist/es2015/UI.js": -/*!*******************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll/dist/es2015/UI.js ***! - \*******************************************************************/ +/***/ "../../../node_modules/graphql/utilities/stripIgnoredCharacters.mjs": +/*!**************************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/stripIgnoredCharacters.mjs ***! + \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RemoveScroll = void 0; -var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); -var _constants = __webpack_require__(/*! react-remove-scroll-bar/constants */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js"); -var _useCallbackRef = __webpack_require__(/*! use-callback-ref */ "../../../node_modules/use-callback-ref/dist/es2015/index.js"); -var _medium = __webpack_require__(/*! ./medium */ "../../../node_modules/react-remove-scroll/dist/es2015/medium.js"); -function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } -var nothing = function () { - return; -}; +exports.stripIgnoredCharacters = stripIgnoredCharacters; +var _blockString = __webpack_require__(/*! ../language/blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); +var _lexer = __webpack_require__(/*! ../language/lexer.mjs */ "../../../node_modules/graphql/language/lexer.mjs"); +var _source = __webpack_require__(/*! ../language/source.mjs */ "../../../node_modules/graphql/language/source.mjs"); +var _tokenKind = __webpack_require__(/*! ../language/tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); /** - * Removes scrollbar from the page and contain the scroll within the Lock - */ -var RemoveScroll = exports.RemoveScroll = /*#__PURE__*/React.forwardRef(function (props, parentRef) { - var ref = React.useRef(null); - var _a = React.useState({ - onScrollCapture: nothing, - onWheelCapture: nothing, - onTouchMoveCapture: nothing - }), - callbacks = _a[0], - setCallbacks = _a[1]; - var forwardProps = props.forwardProps, - children = props.children, - className = props.className, - removeScrollBar = props.removeScrollBar, - enabled = props.enabled, - shards = props.shards, - sideCar = props.sideCar, - noIsolation = props.noIsolation, - inert = props.inert, - allowPinchZoom = props.allowPinchZoom, - _b = props.as, - Container = _b === void 0 ? 'div' : _b, - rest = (0, _tslib.__rest)(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]); - var SideCar = sideCar; - var containerRef = (0, _useCallbackRef.useMergeRefs)([ref, parentRef]); - var containerProps = (0, _tslib.__assign)((0, _tslib.__assign)({}, rest), callbacks); - return /*#__PURE__*/React.createElement(React.Fragment, null, enabled && ( /*#__PURE__*/React.createElement(SideCar, { - sideCar: _medium.effectCar, - removeScrollBar: removeScrollBar, - shards: shards, - noIsolation: noIsolation, - inert: inert, - setCallbacks: setCallbacks, - allowPinchZoom: !!allowPinchZoom, - lockRef: ref - })), forwardProps ? ( /*#__PURE__*/React.cloneElement(React.Children.only(children), (0, _tslib.__assign)((0, _tslib.__assign)({}, containerProps), { - ref: containerRef - }))) : ( /*#__PURE__*/React.createElement(Container, (0, _tslib.__assign)({}, containerProps, { - className: className, - ref: containerRef - }), children))); -}); -RemoveScroll.defaultProps = { - enabled: true, - removeScrollBar: true, - inert: false -}; -RemoveScroll.classNames = { - fullWidth: _constants.fullWidthClassName, - zeroRight: _constants.zeroRightClassName -}; - -/***/ }), - -/***/ "../../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js": -/*!*********************************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js ***! - \*********************************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.nonPassive = void 0; -var passiveSupported = false; -if (typeof window !== 'undefined') { - try { - var options = Object.defineProperty({}, 'passive', { - get: function () { - passiveSupported = true; - return true; - } - }); - // @ts-ignore - window.addEventListener('test', options, options); - // @ts-ignore - window.removeEventListener('test', options, options); - } catch (err) { - passiveSupported = false; - } -} -var nonPassive = exports.nonPassive = passiveSupported ? { - passive: false -} : false; - -/***/ }), - -/***/ "../../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js": -/*!*****************************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js ***! - \*****************************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - + * Strips characters that are not significant to the validity or execution + * of a GraphQL document: + * - UnicodeBOM + * - WhiteSpace + * - LineTerminator + * - Comment + * - Comma + * - BlockString indentation + * + * Note: It is required to have a delimiter character between neighboring + * non-punctuator tokens and this function always uses single space as delimiter. + * + * It is guaranteed that both input and output documents if parsed would result + * in the exact same AST except for nodes location. + * + * Warning: It is guaranteed that this function will always produce stable results. + * However, it's not guaranteed that it will stay the same between different + * releases due to bugfixes or changes in the GraphQL specification. + * + * Query example: + * + * ```graphql + * query SomeQuery($foo: String!, $bar: String) { + * someField(foo: $foo, bar: $bar) { + * a + * b { + * c + * d + * } + * } + * } + * ``` + * + * Becomes: + * + * ```graphql + * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} + * ``` + * + * SDL example: + * + * ```graphql + * """ + * Type description + * """ + * type Foo { + * """ + * Field description + * """ + * bar: String + * } + * ``` + * + * Becomes: + * + * ```graphql + * """Type description""" type Foo{"""Field description""" bar:String} + * ``` + */ +function stripIgnoredCharacters(source) { + const sourceObj = (0, _source.isSource)(source) ? source : new _source.Source(source); + const body = sourceObj.body; + const lexer = new _lexer.Lexer(sourceObj); + let strippedBody = ''; + let wasLastAddedTokenNonPunctuator = false; + while (lexer.advance().kind !== _tokenKind.TokenKind.EOF) { + const currentToken = lexer.token; + const tokenKind = currentToken.kind; + /** + * Every two non-punctuator tokens should have space between them. + * Also prevent case of non-punctuator token following by spread resulting + * in invalid token (e.g. `1...` is invalid Float token). + */ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.locationCouldBeScrolled = exports.handleScroll = void 0; -var alwaysContainsScroll = function (node) { - // textarea will always _contain_ scroll inside self. It only can be hidden - return node.tagName === 'TEXTAREA'; -}; -var elementCanBeScrolled = function (node, overflow) { - var styles = window.getComputedStyle(node); - return ( - // not-not-scrollable - styles[overflow] !== 'hidden' && - // contains scroll inside self - !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible') - ); -}; -var elementCouldBeVScrolled = function (node) { - return elementCanBeScrolled(node, 'overflowY'); -}; -var elementCouldBeHScrolled = function (node) { - return elementCanBeScrolled(node, 'overflowX'); -}; -var locationCouldBeScrolled = function (axis, node) { - var current = node; - do { - // Skip over shadow root - if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) { - current = current.host; - } - var isScrollable = elementCouldBeScrolled(axis, current); - if (isScrollable) { - var _a = getScrollVariables(axis, current), - s = _a[1], - d = _a[2]; - if (s > d) { - return true; + const isNonPunctuator = !(0, _lexer.isPunctuatorTokenKind)(currentToken.kind); + if (wasLastAddedTokenNonPunctuator) { + if (isNonPunctuator || currentToken.kind === _tokenKind.TokenKind.SPREAD) { + strippedBody += ' '; } } - current = current.parentNode; - } while (current && current !== document.body); - return false; -}; -exports.locationCouldBeScrolled = locationCouldBeScrolled; -var getVScrollVariables = function (_a) { - var scrollTop = _a.scrollTop, - scrollHeight = _a.scrollHeight, - clientHeight = _a.clientHeight; - return [scrollTop, scrollHeight, clientHeight]; -}; -var getHScrollVariables = function (_a) { - var scrollLeft = _a.scrollLeft, - scrollWidth = _a.scrollWidth, - clientWidth = _a.clientWidth; - return [scrollLeft, scrollWidth, clientWidth]; -}; -var elementCouldBeScrolled = function (axis, node) { - return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node); -}; -var getScrollVariables = function (axis, node) { - return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node); -}; -var getDirectionFactor = function (axis, direction) { - /** - * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position, - * and then increasingly negative as you scroll towards the end of the content. - * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft - */ - return axis === 'h' && direction === 'rtl' ? -1 : 1; -}; -var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) { - var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); - var delta = directionFactor * sourceDelta; - // find scrollable target - var target = event.target; - var targetInLock = endTarget.contains(target); - var shouldCancelScroll = false; - var isDeltaPositive = delta > 0; - var availableScroll = 0; - var availableScrollTop = 0; - do { - var _a = getScrollVariables(axis, target), - position = _a[0], - scroll_1 = _a[1], - capacity = _a[2]; - var elementScroll = scroll_1 - capacity - directionFactor * position; - if (position || elementScroll) { - if (elementCouldBeScrolled(axis, target)) { - availableScroll += elementScroll; - availableScrollTop += position; - } + const tokenBody = body.slice(currentToken.start, currentToken.end); + if (tokenKind === _tokenKind.TokenKind.BLOCK_STRING) { + strippedBody += (0, _blockString.printBlockString)(currentToken.value, { + minimize: true + }); + } else { + strippedBody += tokenBody; } - target = target.parentNode; - } while ( - // portaled content - !targetInLock && target !== document.body || - // self content - targetInLock && (endTarget.contains(target) || endTarget === target)); - if (isDeltaPositive && (noOverscroll && availableScroll === 0 || !noOverscroll && delta > availableScroll)) { - shouldCancelScroll = true; - } else if (!isDeltaPositive && (noOverscroll && availableScrollTop === 0 || !noOverscroll && -delta > availableScrollTop)) { - shouldCancelScroll = true; + wasLastAddedTokenNonPunctuator = isNonPunctuator; } - return shouldCancelScroll; -}; -exports.handleScroll = handleScroll; + return strippedBody; +} /***/ }), -/***/ "../../../node_modules/react-remove-scroll/dist/es2015/index.js": -/*!**********************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll/dist/es2015/index.js ***! - \**********************************************************************/ +/***/ "../../../node_modules/graphql/utilities/typeComparators.mjs": +/*!*******************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/typeComparators.mjs ***! + \*******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -Object.defineProperty(exports, "RemoveScroll", ({ - enumerable: true, - get: function () { - return _Combination.default; - } -})); -var _Combination = _interopRequireDefault(__webpack_require__(/*! ./Combination */ "../../../node_modules/react-remove-scroll/dist/es2015/Combination.js")); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.doTypesOverlap = doTypesOverlap; +exports.isEqualType = isEqualType; +exports.isTypeSubTypeOf = isTypeSubTypeOf; +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +/** + * Provided two types, return true if the types are equal (invariant). + */ +function isEqualType(typeA, typeB) { + // Equivalent types are equal. + if (typeA === typeB) { + return true; + } // If either type is non-null, the other must also be non-null. -/***/ }), + if ((0, _definition.isNonNullType)(typeA) && (0, _definition.isNonNullType)(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } // If either type is a list, the other must also be a list. -/***/ "../../../node_modules/react-remove-scroll/dist/es2015/medium.js": -/*!***********************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll/dist/es2015/medium.js ***! - \***********************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + if ((0, _definition.isListType)(typeA) && (0, _definition.isListType)(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } // Otherwise the types are not equal. + return false; +} +/** + * Provided a type and a super type, return true if the first type is either + * equal or a subset of the second super type (covariant). + */ +function isTypeSubTypeOf(schema, maybeSubType, superType) { + // Equivalent type is a valid subtype + if (maybeSubType === superType) { + return true; + } // If superType is non-null, maybeSubType must also be non-null. -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.effectCar = void 0; -var _useSidecar = __webpack_require__(/*! use-sidecar */ "../../../node_modules/use-sidecar/dist/es2015/index.js"); -var effectCar = exports.effectCar = (0, _useSidecar.createSidecarMedium)(); + if ((0, _definition.isNonNullType)(superType)) { + if ((0, _definition.isNonNullType)(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if ((0, _definition.isNonNullType)(maybeSubType)) { + // If superType is nullable, maybeSubType may be non-null or nullable. + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); + } // If superType type is a list, maybeSubType type must also be a list. -/***/ }), + if ((0, _definition.isListType)(superType)) { + if ((0, _definition.isListType)(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if ((0, _definition.isListType)(maybeSubType)) { + // If superType is not a list, maybeSubType must also be not a list. + return false; + } // If superType type is an abstract type, check if it is super type of maybeSubType. + // Otherwise, the child type is not a valid subtype of the parent type. -/***/ "../../../node_modules/react-remove-scroll/dist/es2015/sidecar.js": -/*!************************************************************************!*\ - !*** ../../../node_modules/react-remove-scroll/dist/es2015/sidecar.js ***! - \************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + return (0, _definition.isAbstractType)(superType) && ((0, _definition.isInterfaceType)(maybeSubType) || (0, _definition.isObjectType)(maybeSubType)) && schema.isSubType(superType, maybeSubType); +} +/** + * Provided two composite types, determine if they "overlap". Two composite + * types overlap when the Sets of possible concrete types for each intersect. + * + * This is often used to determine if a fragment of a given type could possibly + * be visited in a context of another type. + * + * This function is commutative. + */ +function doTypesOverlap(schema, typeA, typeB) { + // Equivalent types overlap + if (typeA === typeB) { + return true; + } + if ((0, _definition.isAbstractType)(typeA)) { + if ((0, _definition.isAbstractType)(typeB)) { + // If both types are abstract, then determine if there is any intersection + // between possible concrete types of each. + return schema.getPossibleTypes(typeA).some(type => schema.isSubType(typeB, type)); + } // Determine if the latter type is a possible concrete type of the former. + return schema.isSubType(typeA, typeB); + } + if ((0, _definition.isAbstractType)(typeB)) { + // Determine if the former type is a possible concrete type of the latter. + return schema.isSubType(typeB, typeA); + } // Otherwise the types do not overlap. -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _useSidecar = __webpack_require__(/*! use-sidecar */ "../../../node_modules/use-sidecar/dist/es2015/index.js"); -var _SideEffect = __webpack_require__(/*! ./SideEffect */ "../../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js"); -var _medium = __webpack_require__(/*! ./medium */ "../../../node_modules/react-remove-scroll/dist/es2015/medium.js"); -var _default = exports["default"] = (0, _useSidecar.exportSidecar)(_medium.effectCar, _SideEffect.RemoveScrollSideCar); + return false; +} /***/ }), -/***/ "../../../node_modules/react-style-singleton/dist/es2015/component.js": -/*!****************************************************************************!*\ - !*** ../../../node_modules/react-style-singleton/dist/es2015/component.js ***! - \****************************************************************************/ +/***/ "../../../node_modules/graphql/utilities/typeFromAST.mjs": +/*!***************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/typeFromAST.mjs ***! + \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.styleSingleton = void 0; -var _hook = __webpack_require__(/*! ./hook */ "../../../node_modules/react-style-singleton/dist/es2015/hook.js"); -/** - * create a Component to add styles on demand - * - styles are added when first instance is mounted - * - styles are removed when the last instance is unmounted - * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior - */ -var styleSingleton = function () { - var useStyle = (0, _hook.styleHookSingleton)(); - var Sheet = function (_a) { - var styles = _a.styles, - dynamic = _a.dynamic; - useStyle(styles, dynamic); - return null; - }; - return Sheet; -}; -exports.styleSingleton = styleSingleton; +exports.typeFromAST = typeFromAST; +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +function typeFromAST(schema, typeNode) { + switch (typeNode.kind) { + case _kinds.Kind.LIST_TYPE: + { + const innerType = typeFromAST(schema, typeNode.type); + return innerType && new _definition.GraphQLList(innerType); + } + case _kinds.Kind.NON_NULL_TYPE: + { + const innerType = typeFromAST(schema, typeNode.type); + return innerType && new _definition.GraphQLNonNull(innerType); + } + case _kinds.Kind.NAMED_TYPE: + return schema.getType(typeNode.name.value); + } +} /***/ }), -/***/ "../../../node_modules/react-style-singleton/dist/es2015/hook.js": -/*!***********************************************************************!*\ - !*** ../../../node_modules/react-style-singleton/dist/es2015/hook.js ***! - \***********************************************************************/ +/***/ "../../../node_modules/graphql/utilities/valueFromAST.mjs": +/*!****************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/valueFromAST.mjs ***! + \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.styleHookSingleton = void 0; -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); -var _singleton = __webpack_require__(/*! ./singleton */ "../../../node_modules/react-style-singleton/dist/es2015/singleton.js"); -function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +exports.valueFromAST = valueFromAST; +var _inspect = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _keyMap = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); /** - * creates a hook to control style singleton - * @see {@link styleSingleton} for a safer component version - * @example - * ```tsx - * const useStyle = styleHookSingleton(); - * /// - * useStyle('body { overflow: hidden}'); + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Unknown | + * | NullValue | null | + * */ -var styleHookSingleton = function () { - var sheet = (0, _singleton.stylesheetSingleton)(); - return function (styles, isDynamic) { - React.useEffect(function () { - sheet.add(styles); - return function () { - sheet.remove(); - }; - }, [styles && isDynamic]); - }; -}; -exports.styleHookSingleton = styleHookSingleton; - -/***/ }), - -/***/ "../../../node_modules/react-style-singleton/dist/es2015/index.js": -/*!************************************************************************!*\ - !*** ../../../node_modules/react-style-singleton/dist/es2015/index.js ***! - \************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "styleHookSingleton", ({ - enumerable: true, - get: function () { - return _hook.styleHookSingleton; +function valueFromAST(valueNode, type, variables) { + if (!valueNode) { + // When there is no node, then there is also no value. + // Importantly, this is different from returning the value null. + return; } -})); -Object.defineProperty(exports, "styleSingleton", ({ - enumerable: true, - get: function () { - return _component.styleSingleton; + if (valueNode.kind === _kinds.Kind.VARIABLE) { + const variableName = valueNode.name.value; + if (variables == null || variables[variableName] === undefined) { + // No valid return value. + return; + } + const variableValue = variables[variableName]; + if (variableValue === null && (0, _definition.isNonNullType)(type)) { + return; // Invalid: intentionally return no value. + } // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + + return variableValue; } -})); -Object.defineProperty(exports, "stylesheetSingleton", ({ - enumerable: true, - get: function () { - return _singleton.stylesheetSingleton; + if ((0, _definition.isNonNullType)(type)) { + if (valueNode.kind === _kinds.Kind.NULL) { + return; // Invalid: intentionally return no value. + } + return valueFromAST(valueNode, type.ofType, variables); } -})); -var _component = __webpack_require__(/*! ./component */ "../../../node_modules/react-style-singleton/dist/es2015/component.js"); -var _singleton = __webpack_require__(/*! ./singleton */ "../../../node_modules/react-style-singleton/dist/es2015/singleton.js"); -var _hook = __webpack_require__(/*! ./hook */ "../../../node_modules/react-style-singleton/dist/es2015/hook.js"); - -/***/ }), - -/***/ "../../../node_modules/react-style-singleton/dist/es2015/singleton.js": -/*!****************************************************************************!*\ - !*** ../../../node_modules/react-style-singleton/dist/es2015/singleton.js ***! - \****************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.stylesheetSingleton = void 0; -var _getNonce = __webpack_require__(/*! get-nonce */ "../../../node_modules/get-nonce/dist/es2015/index.js"); -function makeStyleTag() { - if (!document) return null; - var tag = document.createElement('style'); - tag.type = 'text/css'; - var nonce = (0, _getNonce.getNonce)(); - if (nonce) { - tag.setAttribute('nonce', nonce); + if (valueNode.kind === _kinds.Kind.NULL) { + // This is explicitly returning the value null. + return null; } - return tag; -} -function injectStyles(tag, css) { - // @ts-ignore - if (tag.styleSheet) { - // @ts-ignore - tag.styleSheet.cssText = css; - } else { - tag.appendChild(document.createTextNode(css)); + if ((0, _definition.isListType)(type)) { + const itemType = type.ofType; + if (valueNode.kind === _kinds.Kind.LIST) { + const coercedValues = []; + for (const itemNode of valueNode.values) { + if (isMissingVariable(itemNode, variables)) { + // If an array contains a missing variable, it is either coerced to + // null or if the item type is non-null, it considered invalid. + if ((0, _definition.isNonNullType)(itemType)) { + return; // Invalid: intentionally return no value. + } + coercedValues.push(null); + } else { + const itemValue = valueFromAST(itemNode, itemType, variables); + if (itemValue === undefined) { + return; // Invalid: intentionally return no value. + } + coercedValues.push(itemValue); + } + } + return coercedValues; + } + const coercedValue = valueFromAST(valueNode, itemType, variables); + if (coercedValue === undefined) { + return; // Invalid: intentionally return no value. + } + return [coercedValue]; } -} -function insertStyleTag(tag) { - var head = document.head || document.getElementsByTagName('head')[0]; - head.appendChild(tag); -} -var stylesheetSingleton = function () { - var counter = 0; - var stylesheet = null; - return { - add: function (style) { - if (counter == 0) { - if (stylesheet = makeStyleTag()) { - injectStyles(stylesheet, style); - insertStyleTag(stylesheet); + if ((0, _definition.isInputObjectType)(type)) { + if (valueNode.kind !== _kinds.Kind.OBJECT) { + return; // Invalid: intentionally return no value. + } + const coercedObj = Object.create(null); + const fieldNodes = (0, _keyMap.keyMap)(valueNode.fields, field => field.name.value); + for (const field of Object.values(type.getFields())) { + const fieldNode = fieldNodes[field.name]; + if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { + if (field.defaultValue !== undefined) { + coercedObj[field.name] = field.defaultValue; + } else if ((0, _definition.isNonNullType)(field.type)) { + return; // Invalid: intentionally return no value. } + continue; } - counter++; - }, - remove: function () { - counter--; - if (!counter && stylesheet) { - stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); - stylesheet = null; + const fieldValue = valueFromAST(fieldNode.value, field.type, variables); + if (fieldValue === undefined) { + return; // Invalid: intentionally return no value. } + coercedObj[field.name] = fieldValue; } - }; -}; -exports.stylesheetSingleton = stylesheetSingleton; + if (type.isOneOf) { + const keys = Object.keys(coercedObj); + if (keys.length !== 1) { + return; // Invalid: not exactly one key, intentionally return no value. + } + if (coercedObj[keys[0]] === null) { + return; // Invalid: value not non-null, intentionally return no value. + } + } + return coercedObj; + } + if ((0, _definition.isLeafType)(type)) { + // Scalars and Enums fulfill parsing a literal value via parseLiteral(). + // Invalid values represent a failure to parse correctly, in which case + // no value is returned. + let result; + try { + result = type.parseLiteral(valueNode, variables); + } catch (_error) { + return; // Invalid: intentionally return no value. + } + if (result === undefined) { + return; // Invalid: intentionally return no value. + } + return result; + } + /* c8 ignore next 3 */ + // Not reachable, all possible input types have been considered. + + false || (0, _invariant.invariant)(false, 'Unexpected input type: ' + (0, _inspect.inspect)(type)); +} // Returns true if the provided valueNode is a variable which is not defined +// in the set of variables. + +function isMissingVariable(valueNode, variables) { + return valueNode.kind === _kinds.Kind.VARIABLE && (variables == null || variables[valueNode.name.value] === undefined); +} /***/ }), -/***/ "../../../node_modules/react/cjs/react-jsx-runtime.development.js": -/*!************************************************************************!*\ - !*** ../../../node_modules/react/cjs/react-jsx-runtime.development.js ***! - \************************************************************************/ +/***/ "../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs": +/*!***********************************************************************!*\ + !*** ../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs ***! + \***********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.valueFromASTUntyped = valueFromASTUntyped; +var _keyValMap = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); /** - * @license React - * react-jsx-runtime.development.js + * Produces a JavaScript value given a GraphQL Value AST. * - * Copyright (c) Facebook, Inc. and its affiliates. + * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. */ +function valueFromASTUntyped(valueNode, variables) { + switch (valueNode.kind) { + case _kinds.Kind.NULL: + return null; + case _kinds.Kind.INT: + return parseInt(valueNode.value, 10); + case _kinds.Kind.FLOAT: + return parseFloat(valueNode.value); + case _kinds.Kind.STRING: + case _kinds.Kind.ENUM: + case _kinds.Kind.BOOLEAN: + return valueNode.value; + case _kinds.Kind.LIST: + return valueNode.values.map(node => valueFromASTUntyped(node, variables)); + case _kinds.Kind.OBJECT: + return (0, _keyValMap.keyValMap)(valueNode.fields, field => field.name.value, field => valueFromASTUntyped(field.value, variables)); + case _kinds.Kind.VARIABLE: + return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value]; + } +} +/***/ }), -if (true) { - (function () { - 'use strict'; +/***/ "../../../node_modules/graphql/validation/ValidationContext.mjs": +/*!**********************************************************************!*\ + !*** ../../../node_modules/graphql/validation/ValidationContext.mjs ***! + \**********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - var React = __webpack_require__(/*! react */ "react"); +"use strict"; - // ATTENTION - // When adding new symbols to this file, - // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' - // The Symbol used to tag the ReactElement-like types. - var REACT_ELEMENT_TYPE = Symbol.for('react.element'); - var REACT_PORTAL_TYPE = Symbol.for('react.portal'); - var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); - var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); - var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); - var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); - var REACT_CONTEXT_TYPE = Symbol.for('react.context'); - var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); - var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); - var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); - var REACT_MEMO_TYPE = Symbol.for('react.memo'); - var REACT_LAZY_TYPE = Symbol.for('react.lazy'); - var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); - var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; - function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ValidationContext = exports.SDLValidationContext = exports.ASTValidationContext = void 0; +var _kinds = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _visitor = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); +var _TypeInfo = __webpack_require__(/*! ../utilities/TypeInfo.mjs */ "../../../node_modules/graphql/utilities/TypeInfo.mjs"); +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + */ +class ASTValidationContext { + constructor(ast, onError) { + this._ast = ast; + this._fragments = undefined; + this._fragmentSpreads = new Map(); + this._recursivelyReferencedFragments = new Map(); + this._onError = onError; + } + get [Symbol.toStringTag]() { + return 'ASTValidationContext'; + } + reportError(error) { + this._onError(error); + } + getDocument() { + return this._ast; + } + getFragment(name) { + let fragments; + if (this._fragments) { + fragments = this._fragments; + } else { + fragments = Object.create(null); + for (const defNode of this.getDocument().definitions) { + if (defNode.kind === _kinds.Kind.FRAGMENT_DEFINITION) { + fragments[defNode.name.value] = defNode; + } } - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - if (typeof maybeIterator === 'function') { - return maybeIterator; + this._fragments = fragments; + } + return fragments[name]; + } + getFragmentSpreads(node) { + let spreads = this._fragmentSpreads.get(node); + if (!spreads) { + spreads = []; + const setsToVisit = [node]; + let set; + while (set = setsToVisit.pop()) { + for (const selection of set.selections) { + if (selection.kind === _kinds.Kind.FRAGMENT_SPREAD) { + spreads.push(selection); + } else if (selection.selectionSet) { + setsToVisit.push(selection.selectionSet); + } + } } - return null; + this._fragmentSpreads.set(node, spreads); } - var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - function error(format) { - { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; + return spreads; + } + getRecursivelyReferencedFragments(operation) { + let fragments = this._recursivelyReferencedFragments.get(operation); + if (!fragments) { + fragments = []; + const collectedNames = Object.create(null); + const nodesToVisit = [operation.selectionSet]; + let node; + while (node = nodesToVisit.pop()) { + for (const spread of this.getFragmentSpreads(node)) { + const fragName = spread.name.value; + if (collectedNames[fragName] !== true) { + collectedNames[fragName] = true; + const fragment = this.getFragment(fragName); + if (fragment) { + fragments.push(fragment); + nodesToVisit.push(fragment.selectionSet); + } } - printWarning('error', format, args); } } + this._recursivelyReferencedFragments.set(operation, fragments); } - function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } // eslint-disable-next-line react-internal/safe-string-coercion - - var argsWithFormat = args.map(function (item) { - return String(item); - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); + return fragments; + } +} +exports.ASTValidationContext = ASTValidationContext; +class SDLValidationContext extends ASTValidationContext { + constructor(ast, schema, onError) { + super(ast, onError); + this._schema = schema; + } + get [Symbol.toStringTag]() { + return 'SDLValidationContext'; + } + getSchema() { + return this._schema; + } +} +exports.SDLValidationContext = SDLValidationContext; +class ValidationContext extends ASTValidationContext { + constructor(schema, ast, typeInfo, onError) { + super(ast, onError); + this._schema = schema; + this._typeInfo = typeInfo; + this._variableUsages = new Map(); + this._recursiveVariableUsages = new Map(); + } + get [Symbol.toStringTag]() { + return 'ValidationContext'; + } + getSchema() { + return this._schema; + } + getVariableUsages(node) { + let usages = this._variableUsages.get(node); + if (!usages) { + const newUsages = []; + const typeInfo = new _TypeInfo.TypeInfo(this._schema); + (0, _visitor.visit)(node, (0, _TypeInfo.visitWithTypeInfo)(typeInfo, { + VariableDefinition: () => false, + Variable(variable) { + newUsages.push({ + node: variable, + type: typeInfo.getInputType(), + defaultValue: typeInfo.getDefaultValue() + }); + } + })); + usages = newUsages; + this._variableUsages.set(node, usages); + } + return usages; + } + getRecursiveVariableUsages(operation) { + let usages = this._recursiveVariableUsages.get(operation); + if (!usages) { + usages = this.getVariableUsages(operation); + for (const frag of this.getRecursivelyReferencedFragments(operation)) { + usages = usages.concat(this.getVariableUsages(frag)); } + this._recursiveVariableUsages.set(operation, usages); } + return usages; + } + getType() { + return this._typeInfo.getType(); + } + getParentType() { + return this._typeInfo.getParentType(); + } + getInputType() { + return this._typeInfo.getInputType(); + } + getParentInputType() { + return this._typeInfo.getParentInputType(); + } + getFieldDef() { + return this._typeInfo.getFieldDef(); + } + getDirective() { + return this._typeInfo.getDirective(); + } + getArgument() { + return this._typeInfo.getArgument(); + } + getEnumValue() { + return this._typeInfo.getEnumValue(); + } +} +exports.ValidationContext = ValidationContext; - // ----------------------------------------------------------------------------- - - var enableScopeAPI = false; // Experimental Create Event Handle API. - var enableCacheElement = false; - var enableTransitionTracing = false; // No known bugs, but needs performance testing +/***/ }), - var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber - // stuff. Intended to enable React core members to more easily debug scheduling - // issues in DEV builds. +/***/ "../../../node_modules/graphql/validation/index.mjs": +/*!**********************************************************!*\ + !*** ../../../node_modules/graphql/validation/index.mjs ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - var enableDebugTracing = false; // Track which Fiber(s) schedule render work. +"use strict"; - var REACT_MODULE_REFERENCE; - { - REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); - } - function isValidElementType(type) { - if (typeof type === 'string' || typeof type === 'function') { - return true; - } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). - if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { - return true; - } - if (typeof type === 'object' && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || - // This needs to include all possible module reference object - // types supported by any Flight configuration anywhere since - // we don't know which Flight build this will end up being used - // with. - type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { - return true; - } - } - return false; - } - function getWrappedName(outerType, innerType, wrapperName) { - var displayName = outerType.displayName; - if (displayName) { - return displayName; - } - var functionName = innerType.displayName || innerType.name || ''; - return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; - } // Keep in sync with react-reconciler/getComponentNameFromFiber +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "ExecutableDefinitionsRule", ({ + enumerable: true, + get: function () { + return _ExecutableDefinitionsRule.ExecutableDefinitionsRule; + } +})); +Object.defineProperty(exports, "FieldsOnCorrectTypeRule", ({ + enumerable: true, + get: function () { + return _FieldsOnCorrectTypeRule.FieldsOnCorrectTypeRule; + } +})); +Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", ({ + enumerable: true, + get: function () { + return _FragmentsOnCompositeTypesRule.FragmentsOnCompositeTypesRule; + } +})); +Object.defineProperty(exports, "KnownArgumentNamesRule", ({ + enumerable: true, + get: function () { + return _KnownArgumentNamesRule.KnownArgumentNamesRule; + } +})); +Object.defineProperty(exports, "KnownDirectivesRule", ({ + enumerable: true, + get: function () { + return _KnownDirectivesRule.KnownDirectivesRule; + } +})); +Object.defineProperty(exports, "KnownFragmentNamesRule", ({ + enumerable: true, + get: function () { + return _KnownFragmentNamesRule.KnownFragmentNamesRule; + } +})); +Object.defineProperty(exports, "KnownTypeNamesRule", ({ + enumerable: true, + get: function () { + return _KnownTypeNamesRule.KnownTypeNamesRule; + } +})); +Object.defineProperty(exports, "LoneAnonymousOperationRule", ({ + enumerable: true, + get: function () { + return _LoneAnonymousOperationRule.LoneAnonymousOperationRule; + } +})); +Object.defineProperty(exports, "LoneSchemaDefinitionRule", ({ + enumerable: true, + get: function () { + return _LoneSchemaDefinitionRule.LoneSchemaDefinitionRule; + } +})); +Object.defineProperty(exports, "MaxIntrospectionDepthRule", ({ + enumerable: true, + get: function () { + return _MaxIntrospectionDepthRule.MaxIntrospectionDepthRule; + } +})); +Object.defineProperty(exports, "NoDeprecatedCustomRule", ({ + enumerable: true, + get: function () { + return _NoDeprecatedCustomRule.NoDeprecatedCustomRule; + } +})); +Object.defineProperty(exports, "NoFragmentCyclesRule", ({ + enumerable: true, + get: function () { + return _NoFragmentCyclesRule.NoFragmentCyclesRule; + } +})); +Object.defineProperty(exports, "NoSchemaIntrospectionCustomRule", ({ + enumerable: true, + get: function () { + return _NoSchemaIntrospectionCustomRule.NoSchemaIntrospectionCustomRule; + } +})); +Object.defineProperty(exports, "NoUndefinedVariablesRule", ({ + enumerable: true, + get: function () { + return _NoUndefinedVariablesRule.NoUndefinedVariablesRule; + } +})); +Object.defineProperty(exports, "NoUnusedFragmentsRule", ({ + enumerable: true, + get: function () { + return _NoUnusedFragmentsRule.NoUnusedFragmentsRule; + } +})); +Object.defineProperty(exports, "NoUnusedVariablesRule", ({ + enumerable: true, + get: function () { + return _NoUnusedVariablesRule.NoUnusedVariablesRule; + } +})); +Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", ({ + enumerable: true, + get: function () { + return _OverlappingFieldsCanBeMergedRule.OverlappingFieldsCanBeMergedRule; + } +})); +Object.defineProperty(exports, "PossibleFragmentSpreadsRule", ({ + enumerable: true, + get: function () { + return _PossibleFragmentSpreadsRule.PossibleFragmentSpreadsRule; + } +})); +Object.defineProperty(exports, "PossibleTypeExtensionsRule", ({ + enumerable: true, + get: function () { + return _PossibleTypeExtensionsRule.PossibleTypeExtensionsRule; + } +})); +Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", ({ + enumerable: true, + get: function () { + return _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsRule; + } +})); +Object.defineProperty(exports, "ScalarLeafsRule", ({ + enumerable: true, + get: function () { + return _ScalarLeafsRule.ScalarLeafsRule; + } +})); +Object.defineProperty(exports, "SingleFieldSubscriptionsRule", ({ + enumerable: true, + get: function () { + return _SingleFieldSubscriptionsRule.SingleFieldSubscriptionsRule; + } +})); +Object.defineProperty(exports, "UniqueArgumentDefinitionNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueArgumentDefinitionNamesRule.UniqueArgumentDefinitionNamesRule; + } +})); +Object.defineProperty(exports, "UniqueArgumentNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueArgumentNamesRule.UniqueArgumentNamesRule; + } +})); +Object.defineProperty(exports, "UniqueDirectiveNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueDirectiveNamesRule.UniqueDirectiveNamesRule; + } +})); +Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", ({ + enumerable: true, + get: function () { + return _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule; + } +})); +Object.defineProperty(exports, "UniqueEnumValueNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueEnumValueNamesRule.UniqueEnumValueNamesRule; + } +})); +Object.defineProperty(exports, "UniqueFieldDefinitionNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueFieldDefinitionNamesRule.UniqueFieldDefinitionNamesRule; + } +})); +Object.defineProperty(exports, "UniqueFragmentNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueFragmentNamesRule.UniqueFragmentNamesRule; + } +})); +Object.defineProperty(exports, "UniqueInputFieldNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule; + } +})); +Object.defineProperty(exports, "UniqueOperationNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueOperationNamesRule.UniqueOperationNamesRule; + } +})); +Object.defineProperty(exports, "UniqueOperationTypesRule", ({ + enumerable: true, + get: function () { + return _UniqueOperationTypesRule.UniqueOperationTypesRule; + } +})); +Object.defineProperty(exports, "UniqueTypeNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueTypeNamesRule.UniqueTypeNamesRule; + } +})); +Object.defineProperty(exports, "UniqueVariableNamesRule", ({ + enumerable: true, + get: function () { + return _UniqueVariableNamesRule.UniqueVariableNamesRule; + } +})); +Object.defineProperty(exports, "ValidationContext", ({ + enumerable: true, + get: function () { + return _ValidationContext.ValidationContext; + } +})); +Object.defineProperty(exports, "ValuesOfCorrectTypeRule", ({ + enumerable: true, + get: function () { + return _ValuesOfCorrectTypeRule.ValuesOfCorrectTypeRule; + } +})); +Object.defineProperty(exports, "VariablesAreInputTypesRule", ({ + enumerable: true, + get: function () { + return _VariablesAreInputTypesRule.VariablesAreInputTypesRule; + } +})); +Object.defineProperty(exports, "VariablesInAllowedPositionRule", ({ + enumerable: true, + get: function () { + return _VariablesInAllowedPositionRule.VariablesInAllowedPositionRule; + } +})); +Object.defineProperty(exports, "recommendedRules", ({ + enumerable: true, + get: function () { + return _specifiedRules.recommendedRules; + } +})); +Object.defineProperty(exports, "specifiedRules", ({ + enumerable: true, + get: function () { + return _specifiedRules.specifiedRules; + } +})); +Object.defineProperty(exports, "validate", ({ + enumerable: true, + get: function () { + return _validate.validate; + } +})); +var _validate = __webpack_require__(/*! ./validate.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); +var _ValidationContext = __webpack_require__(/*! ./ValidationContext.mjs */ "../../../node_modules/graphql/validation/ValidationContext.mjs"); +var _specifiedRules = __webpack_require__(/*! ./specifiedRules.mjs */ "../../../node_modules/graphql/validation/specifiedRules.mjs"); +var _ExecutableDefinitionsRule = __webpack_require__(/*! ./rules/ExecutableDefinitionsRule.mjs */ "../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs"); +var _FieldsOnCorrectTypeRule = __webpack_require__(/*! ./rules/FieldsOnCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs"); +var _FragmentsOnCompositeTypesRule = __webpack_require__(/*! ./rules/FragmentsOnCompositeTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs"); +var _KnownArgumentNamesRule = __webpack_require__(/*! ./rules/KnownArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs"); +var _KnownDirectivesRule = __webpack_require__(/*! ./rules/KnownDirectivesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs"); +var _KnownFragmentNamesRule = __webpack_require__(/*! ./rules/KnownFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs"); +var _KnownTypeNamesRule = __webpack_require__(/*! ./rules/KnownTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs"); +var _LoneAnonymousOperationRule = __webpack_require__(/*! ./rules/LoneAnonymousOperationRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs"); +var _NoFragmentCyclesRule = __webpack_require__(/*! ./rules/NoFragmentCyclesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs"); +var _NoUndefinedVariablesRule = __webpack_require__(/*! ./rules/NoUndefinedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs"); +var _NoUnusedFragmentsRule = __webpack_require__(/*! ./rules/NoUnusedFragmentsRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs"); +var _NoUnusedVariablesRule = __webpack_require__(/*! ./rules/NoUnusedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs"); +var _OverlappingFieldsCanBeMergedRule = __webpack_require__(/*! ./rules/OverlappingFieldsCanBeMergedRule.mjs */ "../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs"); +var _PossibleFragmentSpreadsRule = __webpack_require__(/*! ./rules/PossibleFragmentSpreadsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs"); +var _ProvidedRequiredArgumentsRule = __webpack_require__(/*! ./rules/ProvidedRequiredArgumentsRule.mjs */ "../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs"); +var _ScalarLeafsRule = __webpack_require__(/*! ./rules/ScalarLeafsRule.mjs */ "../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs"); +var _SingleFieldSubscriptionsRule = __webpack_require__(/*! ./rules/SingleFieldSubscriptionsRule.mjs */ "../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs"); +var _UniqueArgumentNamesRule = __webpack_require__(/*! ./rules/UniqueArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs"); +var _UniqueDirectivesPerLocationRule = __webpack_require__(/*! ./rules/UniqueDirectivesPerLocationRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs"); +var _UniqueFragmentNamesRule = __webpack_require__(/*! ./rules/UniqueFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs"); +var _UniqueInputFieldNamesRule = __webpack_require__(/*! ./rules/UniqueInputFieldNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs"); +var _UniqueOperationNamesRule = __webpack_require__(/*! ./rules/UniqueOperationNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs"); +var _UniqueVariableNamesRule = __webpack_require__(/*! ./rules/UniqueVariableNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs"); +var _ValuesOfCorrectTypeRule = __webpack_require__(/*! ./rules/ValuesOfCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs"); +var _VariablesAreInputTypesRule = __webpack_require__(/*! ./rules/VariablesAreInputTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs"); +var _VariablesInAllowedPositionRule = __webpack_require__(/*! ./rules/VariablesInAllowedPositionRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs"); +var _MaxIntrospectionDepthRule = __webpack_require__(/*! ./rules/MaxIntrospectionDepthRule.mjs */ "../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs"); +var _LoneSchemaDefinitionRule = __webpack_require__(/*! ./rules/LoneSchemaDefinitionRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs"); +var _UniqueOperationTypesRule = __webpack_require__(/*! ./rules/UniqueOperationTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs"); +var _UniqueTypeNamesRule = __webpack_require__(/*! ./rules/UniqueTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs"); +var _UniqueEnumValueNamesRule = __webpack_require__(/*! ./rules/UniqueEnumValueNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs"); +var _UniqueFieldDefinitionNamesRule = __webpack_require__(/*! ./rules/UniqueFieldDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs"); +var _UniqueArgumentDefinitionNamesRule = __webpack_require__(/*! ./rules/UniqueArgumentDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs"); +var _UniqueDirectiveNamesRule = __webpack_require__(/*! ./rules/UniqueDirectiveNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs"); +var _PossibleTypeExtensionsRule = __webpack_require__(/*! ./rules/PossibleTypeExtensionsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs"); +var _NoDeprecatedCustomRule = __webpack_require__(/*! ./rules/custom/NoDeprecatedCustomRule.mjs */ "../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs"); +var _NoSchemaIntrospectionCustomRule = __webpack_require__(/*! ./rules/custom/NoSchemaIntrospectionCustomRule.mjs */ "../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs"); - function getContextName(type) { - return type.displayName || 'Context'; - } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. +/***/ }), - function getComponentNameFromType(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - { - if (typeof type.tag === 'number') { - error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - if (typeof type === 'string') { - return type; - } - switch (type) { - case REACT_FRAGMENT_TYPE: - return 'Fragment'; - case REACT_PORTAL_TYPE: - return 'Portal'; - case REACT_PROFILER_TYPE: - return 'Profiler'; - case REACT_STRICT_MODE_TYPE: - return 'StrictMode'; - case REACT_SUSPENSE_TYPE: - return 'Suspense'; - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - var context = type; - return getContextName(context) + '.Consumer'; - case REACT_PROVIDER_TYPE: - var provider = type; - return getContextName(provider._context) + '.Provider'; - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - case REACT_MEMO_TYPE: - var outerName = type.displayName || null; - if (outerName !== null) { - return outerName; - } - return getComponentNameFromType(type.type) || 'Memo'; - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - return getComponentNameFromType(init(payload)); - } catch (x) { - return null; - } - } +/***/ "../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs": +/*!************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs ***! + \************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // eslint-disable-next-line no-fallthrough +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ExecutableDefinitionsRule = ExecutableDefinitionsRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _predicates = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + * + * See https://spec.graphql.org/draft/#sec-Executable-Definitions + */ +function ExecutableDefinitionsRule(context) { + return { + Document(node) { + for (const definition of node.definitions) { + if (!(0, _predicates.isExecutableDefinitionNode)(definition)) { + const defName = definition.kind === _kinds.Kind.SCHEMA_DEFINITION || definition.kind === _kinds.Kind.SCHEMA_EXTENSION ? 'schema' : '"' + definition.name.value + '"'; + context.reportError(new _GraphQLError.GraphQLError(`The ${defName} definition is not executable.`, { + nodes: definition + })); } } - return null; + return false; } - var assign = Object.assign; + }; +} - // Helpers to patch console.logs to avoid logging during side-effect free - // replaying on render function. This currently only patches the object - // lazily which won't cover if the log function was extracted eagerly. - // We could also eagerly patch the method. - var disabledDepth = 0; - var prevLog; - var prevInfo; - var prevWarn; - var prevError; - var prevGroup; - var prevGroupCollapsed; - var prevGroupEnd; - function disabledLog() {} - disabledLog.__reactDisabledLog = true; - function disableLogs() { - { - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 +/***/ }), - var props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. +/***/ "../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs": +/*!**********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs ***! + \**********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - /* eslint-enable react-internal/no-production-logging */ +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.FieldsOnCorrectTypeRule = FieldsOnCorrectTypeRule; +var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); +var _naturalCompare = __webpack_require__(/*! ../../jsutils/naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); +var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +/** + * Fields on correct type + * + * A GraphQL document is only valid if all fields selected are defined by the + * parent type, or are an allowed meta field such as __typename. + * + * See https://spec.graphql.org/draft/#sec-Field-Selections + */ +function FieldsOnCorrectTypeRule(context) { + return { + Field(node) { + const type = context.getParentType(); + if (type) { + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + // This field doesn't exist, lets look for suggestions. + const schema = context.getSchema(); + const fieldName = node.name.value; // First determine if there are any suggested types to condition on. + + let suggestion = (0, _didYouMean.didYouMean)('to use an inline fragment on', getSuggestedTypeNames(schema, type, fieldName)); // If there are no suggested types, then perhaps this was a typo? + + if (suggestion === '') { + suggestion = (0, _didYouMean.didYouMean)(getSuggestedFieldNames(type, fieldName)); + } // Report an error, including helpful suggestions. + + context.reportError(new _GraphQLError.GraphQLError(`Cannot query field "${fieldName}" on type "${type.name}".` + suggestion, { + nodes: node + })); } - disabledDepth++; } } - function reenableLogs() { - { - disabledDepth--; - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - var props = { - configurable: true, - enumerable: true, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. + }; +} +/** + * Go through all of the implementations of type, as well as the interfaces that + * they implement. If any of those types include the provided field, suggest them, + * sorted by how often the type is referenced. + */ - Object.defineProperties(console, { - log: assign({}, props, { - value: prevLog - }), - info: assign({}, props, { - value: prevInfo - }), - warn: assign({}, props, { - value: prevWarn - }), - error: assign({}, props, { - value: prevError - }), - group: assign({}, props, { - value: prevGroup - }), - groupCollapsed: assign({}, props, { - value: prevGroupCollapsed - }), - groupEnd: assign({}, props, { - value: prevGroupEnd - }) - }); - /* eslint-enable react-internal/no-production-logging */ - } - if (disabledDepth < 0) { - error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); - } - } +function getSuggestedTypeNames(schema, type, fieldName) { + if (!(0, _definition.isAbstractType)(type)) { + // Must be an Object type, which does not have possible fields. + return []; + } + const suggestedTypes = new Set(); + const usageCount = Object.create(null); + for (const possibleType of schema.getPossibleTypes(type)) { + if (!possibleType.getFields()[fieldName]) { + continue; + } // This object type defines this field. + + suggestedTypes.add(possibleType); + usageCount[possibleType.name] = 1; + for (const possibleInterface of possibleType.getInterfaces()) { + var _usageCount$possibleI; + if (!possibleInterface.getFields()[fieldName]) { + continue; + } // This interface type defines this field. + + suggestedTypes.add(possibleInterface); + usageCount[possibleInterface.name] = ((_usageCount$possibleI = usageCount[possibleInterface.name]) !== null && _usageCount$possibleI !== void 0 ? _usageCount$possibleI : 0) + 1; } - var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, source, ownerFn) { - { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ''; - } - } // We use the prefix to ensure our stacks line up with native stack frames. + } + return [...suggestedTypes].sort((typeA, typeB) => { + // Suggest both interface and object types based on how common they are. + const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; + if (usageCountDiff !== 0) { + return usageCountDiff; + } // Suggest super types first followed by subtypes - return '\n' + prefix + name; - } + if ((0, _definition.isInterfaceType)(typeA) && schema.isSubType(typeA, typeB)) { + return -1; } - var reentry = false; - var componentFrameCache; - { - var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap(); + if ((0, _definition.isInterfaceType)(typeB) && schema.isSubType(typeB, typeA)) { + return 1; } - function describeNativeComponentFrame(fn, construct) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ''; - } - { - var frame = componentFrameCache.get(fn); - if (frame !== undefined) { - return frame; - } - } - var control; - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + return (0, _naturalCompare.naturalCompare)(typeA.name, typeB.name); + }).map(x => x.name); +} +/** + * For the field name provided, determine if there are any similar field names + * that may be the result of a typo. + */ - Error.prepareStackTrace = undefined; - var previousDispatcher; - { - previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function - // for warnings. +function getSuggestedFieldNames(type, fieldName) { + if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { + const possibleFieldNames = Object.keys(type.getFields()); + return (0, _suggestionList.suggestionList)(fieldName, possibleFieldNames); + } // Otherwise, must be a Union type, which does not define fields. - ReactCurrentDispatcher.current = null; - disableLogs(); - } - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - var Fake = function () { - throw Error(); - }; // $FlowFixMe + return []; +} - Object.defineProperty(Fake.prototype, 'props', { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - if (typeof Reflect === 'object' && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - fn(); - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === 'string') { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - var sampleLines = sample.stack.split('\n'); - var controlLines = control.stack.split('\n'); - var s = sampleLines.length - 1; - var c = controlLines.length - 1; - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. +/***/ }), - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "" - // but we have a user-provided "displayName" - // splice it in to make the stack more readable. +/***/ "../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs": +/*!****************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs ***! + \****************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - if (fn.displayName && _frame.includes('')) { - _frame = _frame.replace('', fn.displayName); - } - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, _frame); - } - } // Return the line we found. +"use strict"; - return _frame; - } - } while (s >= 1 && c >= 0); - } - break; - } - } - } - } finally { - reentry = false; - { - ReactCurrentDispatcher.current = previousDispatcher; - reenableLogs(); - } - Error.prepareStackTrace = previousPrepareStackTrace; - } // Fallback to just using the name if we couldn't make it throw. - var name = fn ? fn.displayName || fn.name : ''; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; - { - if (typeof fn === 'function') { - componentFrameCache.set(fn, syntheticFrame); - } - } - return syntheticFrame; - } - function describeFunctionComponentFrame(fn, source, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } - } - function shouldConstruct(Component) { - var prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); - } - function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - if (type == null) { - return ''; - } - if (typeof type === 'function') { - { - return describeNativeComponentFrame(type, shouldConstruct(type)); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.FragmentsOnCompositeTypesRule = FragmentsOnCompositeTypesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); +/** + * Fragments on composite type + * + * Fragments use a type condition to determine if they apply, since fragments + * can only be spread into a composite type (object, interface, or union), the + * type condition must also be a composite type. + * + * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types + */ +function FragmentsOnCompositeTypesRule(context) { + return { + InlineFragment(node) { + const typeCondition = node.typeCondition; + if (typeCondition) { + const type = (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition); + if (type && !(0, _definition.isCompositeType)(type)) { + const typeStr = (0, _printer.print)(typeCondition); + context.reportError(new _GraphQLError.GraphQLError(`Fragment cannot condition on non composite type "${typeStr}".`, { + nodes: typeCondition + })); } } - if (typeof type === 'string') { - return describeBuiltInComponentFrame(type); - } - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame('Suspense'); - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame('SuspenseList'); - } - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeFunctionComponentFrame(type.render); - case REACT_MEMO_TYPE: - // Memo may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - case REACT_LAZY_TYPE: - { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - try { - // Lazy may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x) {} - } - } + }, + FragmentDefinition(node) { + const type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.typeCondition); + if (type && !(0, _definition.isCompositeType)(type)) { + const typeStr = (0, _printer.print)(node.typeCondition); + context.reportError(new _GraphQLError.GraphQLError(`Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`, { + nodes: node.typeCondition + })); } - return ''; } - var hasOwnProperty = Object.prototype.hasOwnProperty; - var loggedTypeFailures = {}; - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - function setCurrentlyValidatingElement(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame.setExtraStackFrame(stack); - } else { - ReactDebugCurrentFrame.setExtraStackFrame(null); - } + }; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs": +/*!*********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs ***! + \*********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.KnownArgumentNamesOnDirectivesRule = KnownArgumentNamesOnDirectivesRule; +exports.KnownArgumentNamesRule = KnownArgumentNamesRule; +var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); +var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _directives = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +/** + * Known argument names + * + * A GraphQL field is only valid if all supplied arguments are defined by + * that field. + * + * See https://spec.graphql.org/draft/#sec-Argument-Names + * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations + */ +function KnownArgumentNamesRule(context) { + return { + // eslint-disable-next-line new-cap + ...KnownArgumentNamesOnDirectivesRule(context), + Argument(argNode) { + const argDef = context.getArgument(); + const fieldDef = context.getFieldDef(); + const parentType = context.getParentType(); + if (!argDef && fieldDef && parentType) { + const argName = argNode.name.value; + const knownArgsNames = fieldDef.args.map(arg => arg.name); + const suggestions = (0, _suggestionList.suggestionList)(argName, knownArgsNames); + context.reportError(new _GraphQLError.GraphQLError(`Unknown argument "${argName}" on field "${parentType.name}.${fieldDef.name}".` + (0, _didYouMean.didYouMean)(suggestions), { + nodes: argNode + })); } } - function checkPropTypes(typeSpecs, values, location, componentName, element) { - { - // $FlowFixMe This is okay but Flow doesn't know it. - var has = Function.call.bind(hasOwnProperty); - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. + }; +} +/** + * @internal + */ - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - if (typeof typeSpecs[typeSpecName] !== 'function') { - // eslint-disable-next-line react-internal/prod-error-codes - var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); - err.name = 'Invariant Violation'; - throw err; - } - error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); - } catch (ex) { - error$1 = ex; - } - if (error$1 && !(error$1 instanceof Error)) { - setCurrentlyValidatingElement(element); - error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); - setCurrentlyValidatingElement(null); - } - if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error$1.message] = true; - setCurrentlyValidatingElement(element); - error('Failed %s type: %s', location, error$1.message); - setCurrentlyValidatingElement(null); - } +function KnownArgumentNamesOnDirectivesRule(context) { + const directiveArgs = Object.create(null); + const schema = context.getSchema(); + const definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; + for (const directive of definedDirectives) { + directiveArgs[directive.name] = directive.args.map(arg => arg.name); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + var _def$arguments; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + const argsNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : []; + directiveArgs[def.name.value] = argsNodes.map(arg => arg.name.value); + } + } + return { + Directive(directiveNode) { + const directiveName = directiveNode.name.value; + const knownArgs = directiveArgs[directiveName]; + if (directiveNode.arguments && knownArgs) { + for (const argNode of directiveNode.arguments) { + const argName = argNode.name.value; + if (!knownArgs.includes(argName)) { + const suggestions = (0, _suggestionList.suggestionList)(argName, knownArgs); + context.reportError(new _GraphQLError.GraphQLError(`Unknown argument "${argName}" on directive "@${directiveName}".` + (0, _didYouMean.didYouMean)(suggestions), { + nodes: argNode + })); } } } + return false; } - var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + }; +} - function isArray(a) { - return isArrayImpl(a); - } +/***/ }), - /* - * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol - * and Temporal.* types. See https://github.com/facebook/react/pull/22064. - * - * The functions in this module will throw an easier-to-understand, - * easier-to-debug exception with a clear errors message message explaining the - * problem. (Instead of a confusing exception thrown inside the implementation - * of the `value` object). - */ - // $FlowFixMe only called in DEV, so void return is not possible. - function typeName(value) { - { - // toStringTag is needed for namespaced types like Temporal.Instant - var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; - var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; - return type; - } - } // $FlowFixMe only called in DEV, so void return is not possible. +/***/ "../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs": +/*!******************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs ***! + \******************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - function willCoercionThrow(value) { - { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.KnownDirectivesRule = KnownDirectivesRule; +var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _ast = __webpack_require__(/*! ../../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); +var _directiveLocation = __webpack_require__(/*! ../../language/directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _directives = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); +/** + * Known directives + * + * A GraphQL document is only valid if all `@directives` are known by the + * schema and legally positioned. + * + * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined + */ +function KnownDirectivesRule(context) { + const locationsMap = Object.create(null); + const schema = context.getSchema(); + const definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; + for (const directive of definedDirectives) { + locationsMap[directive.name] = directive.locations; + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + locationsMap[def.name.value] = def.locations.map(name => name.value); + } + } + return { + Directive(node, _key, _parent, _path, ancestors) { + const name = node.name.value; + const locations = locationsMap[name]; + if (!locations) { + context.reportError(new _GraphQLError.GraphQLError(`Unknown directive "@${name}".`, { + nodes: node + })); + return; + } + const candidateLocation = getDirectiveLocationForASTPath(ancestors); + if (candidateLocation && !locations.includes(candidateLocation)) { + context.reportError(new _GraphQLError.GraphQLError(`Directive "@${name}" may not be used on ${candidateLocation}.`, { + nodes: node + })); } } - function testStringCoercion(value) { - // If you ended up here by following an exception call stack, here's what's - // happened: you supplied an object or symbol value to React (as a prop, key, - // DOM attribute, CSS property, string ref, etc.) and when React tried to - // coerce it to a string using `'' + value`, an exception was thrown. - // - // The most common types that will cause this exception are `Symbol` instances - // and Temporal objects like `Temporal.Instant`. But any object that has a - // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this - // exception. (Library authors do this to prevent users from using built-in - // numeric operators like `+` or comparison operators like `>=` because custom - // methods are needed to perform accurate arithmetic or comparison.) - // - // To fix the problem, coerce this object or symbol value to a string before - // passing it to React. The most reliable way is usually `String(value)`. - // - // To find which value is throwing, check the browser or debugger console. - // Before this exception was thrown, there should be `console.error` output - // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the - // problem and how that type was used: key, atrribute, input value prop, etc. - // In most cases, this console output also shows the component and its - // ancestor components where the exception happened. - // - // eslint-disable-next-line react-internal/safe-string-coercion - return '' + value; - } - function checkKeyStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } - } - var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; - var specialPropKeyWarningShown; - var specialPropRefWarningShown; - var didWarnAboutStringRefs; - { - didWarnAboutStringRefs = {}; - } - function hasValidRef(config) { - { - if (hasOwnProperty.call(config, 'ref')) { - var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; - if (getter && getter.isReactWarning) { - return false; - } - } - } - return config.ref !== undefined; - } - function hasValidKey(config) { - { - if (hasOwnProperty.call(config, 'key')) { - var getter = Object.getOwnPropertyDescriptor(config, 'key').get; - if (getter && getter.isReactWarning) { - return false; - } - } - } - return config.key !== undefined; - } - function warnIfStringRefCannotBeAutoConverted(config, self) { - { - if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { - var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); - if (!didWarnAboutStringRefs[componentName]) { - error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref); - didWarnAboutStringRefs[componentName] = true; - } - } - } - } - function defineKeyPropWarningGetter(props, displayName) { - { - var warnAboutAccessingKey = function () { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - }; - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, 'key', { - get: warnAboutAccessingKey, - configurable: true - }); - } - } - function defineRefPropWarningGetter(props, displayName) { + }; +} +function getDirectiveLocationForASTPath(ancestors) { + const appliedTo = ancestors[ancestors.length - 1]; + 'kind' in appliedTo || (0, _invariant.invariant)(false); + switch (appliedTo.kind) { + case _kinds.Kind.OPERATION_DEFINITION: + return getDirectiveLocationForOperation(appliedTo.operation); + case _kinds.Kind.FIELD: + return _directiveLocation.DirectiveLocation.FIELD; + case _kinds.Kind.FRAGMENT_SPREAD: + return _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD; + case _kinds.Kind.INLINE_FRAGMENT: + return _directiveLocation.DirectiveLocation.INLINE_FRAGMENT; + case _kinds.Kind.FRAGMENT_DEFINITION: + return _directiveLocation.DirectiveLocation.FRAGMENT_DEFINITION; + case _kinds.Kind.VARIABLE_DEFINITION: + return _directiveLocation.DirectiveLocation.VARIABLE_DEFINITION; + case _kinds.Kind.SCHEMA_DEFINITION: + case _kinds.Kind.SCHEMA_EXTENSION: + return _directiveLocation.DirectiveLocation.SCHEMA; + case _kinds.Kind.SCALAR_TYPE_DEFINITION: + case _kinds.Kind.SCALAR_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.SCALAR; + case _kinds.Kind.OBJECT_TYPE_DEFINITION: + case _kinds.Kind.OBJECT_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.OBJECT; + case _kinds.Kind.FIELD_DEFINITION: + return _directiveLocation.DirectiveLocation.FIELD_DEFINITION; + case _kinds.Kind.INTERFACE_TYPE_DEFINITION: + case _kinds.Kind.INTERFACE_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.INTERFACE; + case _kinds.Kind.UNION_TYPE_DEFINITION: + case _kinds.Kind.UNION_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.UNION; + case _kinds.Kind.ENUM_TYPE_DEFINITION: + case _kinds.Kind.ENUM_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.ENUM; + case _kinds.Kind.ENUM_VALUE_DEFINITION: + return _directiveLocation.DirectiveLocation.ENUM_VALUE; + case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION: + case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.INPUT_OBJECT; + case _kinds.Kind.INPUT_VALUE_DEFINITION: { - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); - } - }; - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); + const parentNode = ancestors[ancestors.length - 3]; + 'kind' in parentNode || (0, _invariant.invariant)(false); + return parentNode.kind === _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION ? _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION : _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION; } - } - /** - * Factory method to create a new React element. This no longer adheres to - * the class pattern, so do not use new to call it. Also, instanceof check - * will not work. Instead test $$typeof field against Symbol.for('react.element') to check - * if something is a React Element. - * - * @param {*} type - * @param {*} props - * @param {*} key - * @param {string|object} ref - * @param {*} owner - * @param {*} self A *temporary* helper to detect places where `this` is - * different from the `owner` when React.createElement is called, so that we - * can warn. We want to get rid of owner and replace string `ref`s with arrow - * functions, and as long as `this` and owner are the same, there will be no - * change in behavior. - * @param {*} source An annotation object (added by a transpiler or otherwise) - * indicating filename, line number, and/or other information. - * @internal - */ + // Not reachable, all possible types have been considered. - var ReactElement = function (type, key, ref, self, source, owner, props) { - var element = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - // Record the component responsible for creating this element. - _owner: owner - }; - { - // The validation flag is currently mutative. We put it on - // an external backing store so that we can freeze the whole object. - // This can be replaced with a WeakMap once they are implemented in - // commonly used development environments. - element._store = {}; // To make comparing ReactElements easier for testing purposes, we make - // the validation flag non-enumerable (where possible, which should - // include every environment we run tests in), so the test framework - // ignores it. + /* c8 ignore next */ - Object.defineProperty(element._store, 'validated', { - configurable: false, - enumerable: false, - writable: true, - value: false - }); // self and source are DEV only properties. + default: + false || (0, _invariant.invariant)(false, 'Unexpected kind: ' + (0, _inspect.inspect)(appliedTo.kind)); + } +} +function getDirectiveLocationForOperation(operation) { + switch (operation) { + case _ast.OperationTypeNode.QUERY: + return _directiveLocation.DirectiveLocation.QUERY; + case _ast.OperationTypeNode.MUTATION: + return _directiveLocation.DirectiveLocation.MUTATION; + case _ast.OperationTypeNode.SUBSCRIPTION: + return _directiveLocation.DirectiveLocation.SUBSCRIPTION; + } +} - Object.defineProperty(element, '_self', { - configurable: false, - enumerable: false, - writable: false, - value: self - }); // Two elements created in two different places should be considered - // equal for testing purposes and therefore we hide it from enumeration. +/***/ }), - Object.defineProperty(element, '_source', { - configurable: false, - enumerable: false, - writable: false, - value: source - }); - if (Object.freeze) { - Object.freeze(element.props); - Object.freeze(element); - } +/***/ "../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs": +/*!*********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs ***! + \*********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.KnownFragmentNamesRule = KnownFragmentNamesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Known fragment names + * + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer + * to fragments defined in the same document. + * + * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined + */ +function KnownFragmentNamesRule(context) { + return { + FragmentSpread(node) { + const fragmentName = node.name.value; + const fragment = context.getFragment(fragmentName); + if (!fragment) { + context.reportError(new _GraphQLError.GraphQLError(`Unknown fragment "${fragmentName}".`, { + nodes: node.name + })); } - return element; - }; - /** - * https://github.com/reactjs/rfcs/pull/107 - * @param {*} type - * @param {object} props - * @param {string} key - */ + } + }; +} - function jsxDEV(type, config, maybeKey, source, self) { - { - var propName; // Reserved names are extracted +/***/ }), - var props = {}; - var key = null; - var ref = null; // Currently, key can be spread in as a prop. This causes a potential - // issue if key is also explicitly declared (ie.

- // or
). We want to deprecate key spread, - // but as an intermediary step, we will use jsxDEV for everything except - //
, because we aren't currently able to tell if - // key is explicitly declared to be undefined or not. +/***/ "../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - if (maybeKey !== undefined) { - { - checkKeyStringCoercion(maybeKey); - } - key = '' + maybeKey; - } - if (hasValidKey(config)) { - { - checkKeyStringCoercion(config.key); - } - key = '' + config.key; - } - if (hasValidRef(config)) { - ref = config.ref; - warnIfStringRefCannotBeAutoConverted(config, self); - } // Remaining properties are added to a new props object +"use strict"; - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; - } - } // Resolve default props - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - for (propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; - } - } - } - if (key || ref) { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - if (ref) { - defineRefPropWarningGetter(props, displayName); - } - } - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.KnownTypeNamesRule = KnownTypeNamesRule; +var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); +var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _predicates = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); +var _introspection = __webpack_require__(/*! ../../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); +var _scalars = __webpack_require__(/*! ../../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); +/** + * Known type names + * + * A GraphQL document is only valid if referenced types (specifically + * variable definitions and fragment conditions) are defined by the type schema. + * + * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence + */ +function KnownTypeNamesRule(context) { + const schema = context.getSchema(); + const existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); + const definedTypes = Object.create(null); + for (const def of context.getDocument().definitions) { + if ((0, _predicates.isTypeDefinitionNode)(def)) { + definedTypes[def.name.value] = true; } - var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; - var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; - function setCurrentlyValidatingElement$1(element) { - { - if (element) { - var owner = element._owner; - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); - ReactDebugCurrentFrame$1.setExtraStackFrame(stack); - } else { - ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + const typeNames = [...Object.keys(existingTypesMap), ...Object.keys(definedTypes)]; + return { + NamedType(node, _1, parent, _2, ancestors) { + const typeName = node.name.value; + if (!existingTypesMap[typeName] && !definedTypes[typeName]) { + var _ancestors$; + const definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent; + const isSDL = definitionNode != null && isSDLNode(definitionNode); + if (isSDL && standardTypeNames.includes(typeName)) { + return; } + const suggestedTypes = (0, _suggestionList.suggestionList)(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames); + context.reportError(new _GraphQLError.GraphQLError(`Unknown type "${typeName}".` + (0, _didYouMean.didYouMean)(suggestedTypes), { + nodes: node + })); } } - var propTypesMisspellWarningShown; - { - propTypesMisspellWarningShown = false; - } - /** - * Verifies the object is a ReactElement. - * See https://reactjs.org/docs/react-api.html#isvalidelement - * @param {?object} object - * @return {boolean} True if `object` is a ReactElement. - * @final - */ + }; +} +const standardTypeNames = [..._scalars.specifiedScalarTypes, ..._introspection.introspectionTypes].map(type => type.name); +function isSDLNode(value) { + return 'kind' in value && ((0, _predicates.isTypeSystemDefinitionNode)(value) || (0, _predicates.isTypeSystemExtensionNode)(value)); +} - function isValidElement(object) { - { - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +/***/ }), + +/***/ "../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs": +/*!*************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs ***! + \*************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.LoneAnonymousOperationRule = LoneAnonymousOperationRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +/** + * Lone anonymous operation + * + * A GraphQL document is only valid if when it contains an anonymous operation + * (the query short-hand) that it contains only that one operation definition. + * + * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation + */ +function LoneAnonymousOperationRule(context) { + let operationCount = 0; + return { + Document(node) { + operationCount = node.definitions.filter(definition => definition.kind === _kinds.Kind.OPERATION_DEFINITION).length; + }, + OperationDefinition(node) { + if (!node.name && operationCount > 1) { + context.reportError(new _GraphQLError.GraphQLError('This anonymous operation must be the only defined operation.', { + nodes: node + })); } } - function getDeclarationErrorAddendum() { - { - if (ReactCurrentOwner$1.current) { - var name = getComponentNameFromType(ReactCurrentOwner$1.current.type); - if (name) { - return '\n\nCheck the render method of `' + name + '`.'; - } - } - return ''; + }; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs": +/*!***********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs ***! + \***********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.LoneSchemaDefinitionRule = LoneSchemaDefinitionRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Lone Schema definition + * + * A GraphQL document is only valid if it contains only one schema definition. + */ +function LoneSchemaDefinitionRule(context) { + var _ref, _ref2, _oldSchema$astNode; + const oldSchema = context.getSchema(); + const alreadyDefined = (_ref = (_ref2 = (_oldSchema$astNode = oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.astNode) !== null && _oldSchema$astNode !== void 0 ? _oldSchema$astNode : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getQueryType()) !== null && _ref2 !== void 0 ? _ref2 : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getMutationType()) !== null && _ref !== void 0 ? _ref : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getSubscriptionType(); + let schemaDefinitionsCount = 0; + return { + SchemaDefinition(node) { + if (alreadyDefined) { + context.reportError(new _GraphQLError.GraphQLError('Cannot define a new schema within a schema extension.', { + nodes: node + })); + return; } - } - function getSourceInfoErrorAddendum(source) { - { - if (source !== undefined) { - var fileName = source.fileName.replace(/^.*[\\\/]/, ''); - var lineNumber = source.lineNumber; - return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; - } - return ''; + if (schemaDefinitionsCount > 0) { + context.reportError(new _GraphQLError.GraphQLError('Must provide only one schema definition.', { + nodes: node + })); } + ++schemaDefinitionsCount; } - /** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ + }; +} - var ownerHasKeyUseWarning = {}; - function getCurrentComponentErrorInfo(parentType) { - { - var info = getDeclarationErrorAddendum(); - if (!info) { - var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; - if (parentName) { - info = "\n\nCheck the top-level render call using <" + parentName + ">."; - } - } - return info; - } - } - /** - * Warn if the element doesn't have an explicit key assigned to it. - * This element is in an array. The array could grow and shrink or be - * reordered. All children that haven't already been validated are required to - * have a "key" property assigned to it. Error statuses are cached so a warning - * will only be shown once. - * - * @internal - * @param {ReactElement} element Element that requires a key. - * @param {*} parentType element's parent's type. - */ +/***/ }), - function validateExplicitKey(element, parentType) { - { - if (!element._store || element._store.validated || element.key != null) { - return; - } - element._store.validated = true; - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { - return; - } - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a - // property, it may be the creator of the child that's responsible for - // assigning it a key. +/***/ "../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs": +/*!************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs ***! + \************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - var childOwner = ''; - if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { - // Give the component that originally created this child. - childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; - } - setCurrentlyValidatingElement$1(element); - error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); - setCurrentlyValidatingElement$1(null); +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.MaxIntrospectionDepthRule = MaxIntrospectionDepthRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +const MAX_LISTS_DEPTH = 3; +function MaxIntrospectionDepthRule(context) { + /** + * Counts the depth of list fields in "__Type" recursively and + * returns `true` if the limit has been reached. + */ + function checkDepth(node, visitedFragments = Object.create(null), depth = 0) { + if (node.kind === _kinds.Kind.FRAGMENT_SPREAD) { + const fragmentName = node.name.value; + if (visitedFragments[fragmentName] === true) { + // Fragment cycles are handled by `NoFragmentCyclesRule`. + return false; + } + const fragment = context.getFragment(fragmentName); + if (!fragment) { + // Missing fragments checks are handled by `KnownFragmentNamesRule`. + return false; + } // Rather than following an immutable programming pattern which has + // significant memory and garbage collection overhead, we've opted to + // take a mutable approach for efficiency's sake. Importantly visiting a + // fragment twice is fine, so long as you don't do one visit inside the + // other. + + try { + visitedFragments[fragmentName] = true; + return checkDepth(fragment, visitedFragments, depth); + } finally { + visitedFragments[fragmentName] = undefined; } } - /** - * Ensure that every element either is passed in a static location, in an - * array with an explicit keys property defined, or in an object literal - * with valid key property. - * - * @internal - * @param {ReactNode} node Statically passed child of any type. - * @param {*} parentType node's parent's type. - */ + if (node.kind === _kinds.Kind.FIELD && ( + // check all introspection lists + node.name.value === 'fields' || node.name.value === 'interfaces' || node.name.value === 'possibleTypes' || node.name.value === 'inputFields')) { + // eslint-disable-next-line no-param-reassign + depth++; + if (depth >= MAX_LISTS_DEPTH) { + return true; + } + } // handles fields and inline fragments - function validateChildKeys(node, parentType) { - { - if (typeof node !== 'object') { - return; + if ('selectionSet' in node && node.selectionSet) { + for (const child of node.selectionSet.selections) { + if (checkDepth(child, visitedFragments, depth)) { + return true; } - if (isArray(node)) { - for (var i = 0; i < node.length; i++) { - var child = node[i]; - if (isValidElement(child)) { - validateExplicitKey(child, parentType); - } - } - } else if (isValidElement(node)) { - // This element was passed in a valid location. - if (node._store) { - node._store.validated = true; - } - } else if (node) { - var iteratorFn = getIteratorFn(node); - if (typeof iteratorFn === 'function') { - // Entry iterators used to provide implicit keys, - // but now we print a separate warning for them later. - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - while (!(step = iterator.next()).done) { - if (isValidElement(step.value)) { - validateExplicitKey(step.value, parentType); - } - } - } - } + } + } + return false; + } + return { + Field(node) { + if (node.name.value === '__schema' || node.name.value === '__type') { + if (checkDepth(node)) { + context.reportError(new _GraphQLError.GraphQLError('Maximum introspection depth exceeded', { + nodes: [node] + })); + return false; } } } - /** - * Given an element, validate that its props follow the propTypes definition, - * provided by the type. - * - * @param {ReactElement} element - */ + }; +} - function validatePropTypes(element) { - { - var type = element.type; - if (type === null || type === undefined || typeof type === 'string') { - return; - } - var propTypes; - if (typeof type === 'function') { - propTypes = type.propTypes; - } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || - // Note: Memo only checks outer props here. - // Inner props are checked in the reconciler. - type.$$typeof === REACT_MEMO_TYPE)) { - propTypes = type.propTypes; - } else { - return; - } - if (propTypes) { - // Intentionally inside to avoid triggering lazy initializers: - var name = getComponentNameFromType(type); - checkPropTypes(propTypes, element.props, 'prop', name, element); - } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { - propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: +/***/ }), - var _name = getComponentNameFromType(type); - error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); - } - if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { - error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); +/***/ "../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs": +/*!*******************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs ***! + \*******************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NoFragmentCyclesRule = NoFragmentCyclesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * No fragment cycles + * + * The graph of fragment spreads must not form any cycles including spreading itself. + * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data. + * + * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles + */ +function NoFragmentCyclesRule(context) { + // Tracks already visited fragments to maintain O(N) and to ensure that cycles + // are not redundantly reported. + const visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors + + const spreadPath = []; // Position in the spread path + + const spreadPathIndexByName = Object.create(null); + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + detectCycleRecursive(node); + return false; + } + }; // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + + function detectCycleRecursive(fragment) { + if (visitedFrags[fragment.name.value]) { + return; + } + const fragmentName = fragment.name.value; + visitedFrags[fragmentName] = true; + const spreadNodes = context.getFragmentSpreads(fragment.selectionSet); + if (spreadNodes.length === 0) { + return; + } + spreadPathIndexByName[fragmentName] = spreadPath.length; + for (const spreadNode of spreadNodes) { + const spreadName = spreadNode.name.value; + const cycleIndex = spreadPathIndexByName[spreadName]; + spreadPath.push(spreadNode); + if (cycleIndex === undefined) { + const spreadFragment = context.getFragment(spreadName); + if (spreadFragment) { + detectCycleRecursive(spreadFragment); } + } else { + const cyclePath = spreadPath.slice(cycleIndex); + const viaPath = cyclePath.slice(0, -1).map(s => '"' + s.name.value + '"').join(', '); + context.reportError(new _GraphQLError.GraphQLError(`Cannot spread fragment "${spreadName}" within itself` + (viaPath !== '' ? ` via ${viaPath}.` : '.'), { + nodes: cyclePath + })); } + spreadPath.pop(); } - /** - * Given a fragment, validate that it can only be provided with fragment props - * @param {ReactElement} fragment - */ + spreadPathIndexByName[fragmentName] = undefined; + } +} - function validateFragmentProps(fragment) { - { - var keys = Object.keys(fragment.props); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key !== 'children' && key !== 'key') { - setCurrentlyValidatingElement$1(fragment); - error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); - setCurrentlyValidatingElement$1(null); - break; +/***/ }), + +/***/ "../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs": +/*!***********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs ***! + \***********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NoUndefinedVariablesRule = NoUndefinedVariablesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * No undefined variables + * + * A GraphQL operation is only valid if all variables encountered, both directly + * and via fragment spreads, are defined by that operation. + * + * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined + */ +function NoUndefinedVariablesRule(context) { + let variableNameDefined = Object.create(null); + return { + OperationDefinition: { + enter() { + variableNameDefined = Object.create(null); + }, + leave(operation) { + const usages = context.getRecursiveVariableUsages(operation); + for (const { + node + } of usages) { + const varName = node.name.value; + if (variableNameDefined[varName] !== true) { + context.reportError(new _GraphQLError.GraphQLError(operation.name ? `Variable "$${varName}" is not defined by operation "${operation.name.value}".` : `Variable "$${varName}" is not defined.`, { + nodes: [node, operation] + })); } } - if (fragment.ref !== null) { - setCurrentlyValidatingElement$1(fragment); - error('Invalid attribute `ref` supplied to `React.Fragment`.'); - setCurrentlyValidatingElement$1(null); - } } + }, + VariableDefinition(node) { + variableNameDefined[node.variable.name.value] = true; } - function jsxWithValidation(type, props, key, isStaticChildren, source, self) { - { - var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to - // succeed and there will likely be errors in render. + }; +} - if (!validType) { - var info = ''; - if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; - } - var sourceInfo = getSourceInfoErrorAddendum(source); - if (sourceInfo) { - info += sourceInfo; - } else { - info += getDeclarationErrorAddendum(); - } - var typeString; - if (type === null) { - typeString = 'null'; - } else if (isArray(type)) { - typeString = 'array'; - } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />"; - info = ' Did you accidentally export a JSX literal instead of a component?'; - } else { - typeString = typeof type; - } - error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); - } - var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. - // TODO: Drop this when these are no longer allowed as the type argument. +/***/ }), - if (element == null) { - return element; - } // Skip key warning if the type isn't valid since our key validation logic - // doesn't expect a non-string/function type and can throw confusing errors. - // We don't want exception behavior to differ between dev and prod. - // (Rendering will throw with a helpful message and as soon as the type is - // fixed, the key warnings will appear.) +/***/ "../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs": +/*!********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - if (validType) { - var children = props.children; - if (children !== undefined) { - if (isStaticChildren) { - if (isArray(children)) { - for (var i = 0; i < children.length; i++) { - validateChildKeys(children[i], type); - } - if (Object.freeze) { - Object.freeze(children); - } - } else { - error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); - } - } else { - validateChildKeys(children, type); - } +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NoUnusedFragmentsRule = NoUnusedFragmentsRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * No unused fragments + * + * A GraphQL document is only valid if all fragment definitions are spread + * within operations, or spread within other fragments spread within operations. + * + * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used + */ +function NoUnusedFragmentsRule(context) { + const operationDefs = []; + const fragmentDefs = []; + return { + OperationDefinition(node) { + operationDefs.push(node); + return false; + }, + FragmentDefinition(node) { + fragmentDefs.push(node); + return false; + }, + Document: { + leave() { + const fragmentNameUsed = Object.create(null); + for (const operation of operationDefs) { + for (const fragment of context.getRecursivelyReferencedFragments(operation)) { + fragmentNameUsed[fragment.name.value] = true; } } - if (type === REACT_FRAGMENT_TYPE) { - validateFragmentProps(element); - } else { - validatePropTypes(element); + for (const fragmentDef of fragmentDefs) { + const fragName = fragmentDef.name.value; + if (fragmentNameUsed[fragName] !== true) { + context.reportError(new _GraphQLError.GraphQLError(`Fragment "${fragName}" is never used.`, { + nodes: fragmentDef + })); + } } - return element; - } - } // These two functions exist to still get child warnings in dev - // even with the prod transform. This means that jsxDEV is purely - // opt-in behavior for better messages but that we won't stop - // giving you warnings if you use production apis. - - function jsxWithValidationStatic(type, props, key) { - { - return jsxWithValidation(type, props, key, true); - } - } - function jsxWithValidationDynamic(type, props, key) { - { - return jsxWithValidation(type, props, key, false); } } - var jsx = jsxWithValidationDynamic; // we may want to special case jsxs internally to take advantage of static children. - // for now we can ship identical prod functions - - var jsxs = jsxWithValidationStatic; - exports.Fragment = REACT_FRAGMENT_TYPE; - exports.jsx = jsx; - exports.jsxs = jsxs; - })(); + }; } /***/ }), -/***/ "../../../node_modules/react/jsx-runtime.js": -/*!**************************************************!*\ - !*** ../../../node_modules/react/jsx-runtime.js ***! - \**************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ "../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs": +/*!********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; -if (false) {} else { - module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "../../../node_modules/react/cjs/react-jsx-runtime.development.js"); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NoUnusedVariablesRule = NoUnusedVariablesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * No unused variables + * + * A GraphQL operation is only valid if all variables defined by an operation + * are used, either directly or within a spread fragment. + * + * See https://spec.graphql.org/draft/#sec-All-Variables-Used + */ +function NoUnusedVariablesRule(context) { + let variableDefs = []; + return { + OperationDefinition: { + enter() { + variableDefs = []; + }, + leave(operation) { + const variableNameUsed = Object.create(null); + const usages = context.getRecursiveVariableUsages(operation); + for (const { + node + } of usages) { + variableNameUsed[node.name.value] = true; + } + for (const variableDef of variableDefs) { + const variableName = variableDef.variable.name.value; + if (variableNameUsed[variableName] !== true) { + context.reportError(new _GraphQLError.GraphQLError(operation.name ? `Variable "$${variableName}" is never used in operation "${operation.name.value}".` : `Variable "$${variableName}" is never used.`, { + nodes: variableDef + })); + } + } + } + }, + VariableDefinition(def) { + variableDefs.push(def); + } + }; } /***/ }), -/***/ "../../../node_modules/set-value/index.js": -/*!************************************************!*\ - !*** ../../../node_modules/set-value/index.js ***! - \************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -/*! - * set-value - * - * Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert). - * Released under the MIT License. - */ +/***/ "../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs": +/*!*******************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs ***! + \*******************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; -const { - deleteProperty -} = Reflect; -const isPrimitive = __webpack_require__(/*! is-primitive */ "../../../node_modules/is-primitive/index.js"); -const isPlainObject = __webpack_require__(/*! is-plain-object */ "../../../node_modules/is-plain-object/index.js"); -const isObject = value => { - return typeof value === 'object' && value !== null || typeof value === 'function'; -}; -const isUnsafeKey = key => { - return key === '__proto__' || key === 'constructor' || key === 'prototype'; -}; -const validateKey = key => { - if (!isPrimitive(key)) { - throw new TypeError('Object keys must be strings or symbols'); - } - if (isUnsafeKey(key)) { - throw new Error(`Cannot set unsafe key: "${key}"`); - } -}; -const toStringKey = input => { - return Array.isArray(input) ? input.flat().map(String).join(',') : input; -}; -const createMemoKey = (input, options) => { - if (typeof input !== 'string' || !options) return input; - let key = input + ';'; - if (options.arrays !== undefined) key += `arrays=${options.arrays};`; - if (options.separator !== undefined) key += `separator=${options.separator};`; - if (options.split !== undefined) key += `split=${options.split};`; - if (options.merge !== undefined) key += `merge=${options.merge};`; - if (options.preservePaths !== undefined) key += `preservePaths=${options.preservePaths};`; - return key; -}; -const memoize = (input, options, fn) => { - const key = toStringKey(options ? createMemoKey(input, options) : input); - validateKey(key); - const value = setValue.cache.get(key) || fn(); - setValue.cache.set(key, value); - return value; -}; -const splitString = (input, options = {}) => { - const sep = options.separator || '.'; - const preserve = sep === '/' ? false : options.preservePaths; - if (typeof input === 'string' && preserve !== false && /\//.test(input)) { - return [input]; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.OverlappingFieldsCanBeMergedRule = OverlappingFieldsCanBeMergedRule; +var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _sortValueNode = __webpack_require__(/*! ../../utilities/sortValueNode.mjs */ "../../../node_modules/graphql/utilities/sortValueNode.mjs"); +var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); +function reasonMessage(reason) { + if (Array.isArray(reason)) { + return reason.map(([responseName, subReason]) => `subfields "${responseName}" conflict because ` + reasonMessage(subReason)).join(' and '); } - const parts = []; - let part = ''; - const push = part => { - let number; - if (part.trim() !== '' && Number.isInteger(number = Number(part))) { - parts.push(number); - } else { - parts.push(part); + return reason; +} +/** + * Overlapping fields can be merged + * + * A selection set is only valid if all fields (including spreading any + * fragments) either correspond to distinct response names or can be merged + * without ambiguity. + * + * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging + */ + +function OverlappingFieldsCanBeMergedRule(context) { + // A memoization for when two fragments are compared "between" each other for + // conflicts. Two fragments may be compared many times, so memoizing this can + // dramatically improve the performance of this validator. + const comparedFragmentPairs = new PairSet(); // A cache for the "field map" and list of fragment names found in any given + // selection set. Selection sets may be asked for this information multiple + // times, so this improves the performance of this validator. + + const cachedFieldsAndFragmentNames = new Map(); + return { + SelectionSet(selectionSet) { + const conflicts = findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, context.getParentType(), selectionSet); + for (const [[responseName, reason], fields1, fields2] of conflicts) { + const reasonMsg = reasonMessage(reason); + context.reportError(new _GraphQLError.GraphQLError(`Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`, { + nodes: fields1.concat(fields2) + })); + } } }; - for (let i = 0; i < input.length; i++) { - const value = input[i]; - if (value === '\\') { - part += input[++i]; - continue; +} + +/** + * Algorithm: + * + * Conflicts occur when two fields exist in a query which will produce the same + * response name, but represent differing values, thus creating a conflict. + * The algorithm below finds all conflicts via making a series of comparisons + * between fields. In order to compare as few fields as possible, this makes + * a series of comparisons "within" sets of fields and "between" sets of fields. + * + * Given any selection set, a collection produces both a set of fields by + * also including all inline fragments, as well as a list of fragments + * referenced by fragment spreads. + * + * A) Each selection set represented in the document first compares "within" its + * collected set of fields, finding any conflicts between every pair of + * overlapping fields. + * Note: This is the *only time* that a the fields "within" a set are compared + * to each other. After this only fields "between" sets are compared. + * + * B) Also, if any fragment is referenced in a selection set, then a + * comparison is made "between" the original set of fields and the + * referenced fragment. + * + * C) Also, if multiple fragments are referenced, then comparisons + * are made "between" each referenced fragment. + * + * D) When comparing "between" a set of fields and a referenced fragment, first + * a comparison is made between each field in the original set of fields and + * each field in the the referenced set of fields. + * + * E) Also, if any fragment is referenced in the referenced selection set, + * then a comparison is made "between" the original set of fields and the + * referenced fragment (recursively referring to step D). + * + * F) When comparing "between" two fragments, first a comparison is made between + * each field in the first referenced set of fields and each field in the the + * second referenced set of fields. + * + * G) Also, any fragments referenced by the first must be compared to the + * second, and any fragments referenced by the second must be compared to the + * first (recursively referring to step F). + * + * H) When comparing two fields, if both have selection sets, then a comparison + * is made "between" both selection sets, first comparing the set of fields in + * the first selection set with the set of fields in the second. + * + * I) Also, if any fragment is referenced in either selection set, then a + * comparison is made "between" the other set of fields and the + * referenced fragment. + * + * J) Also, if two fragments are referenced in both selection sets, then a + * comparison is made "between" the two fragments. + * + */ +// Find all conflicts found "within" a selection set, including those found +// via spreading in fragments. Called when visiting each SelectionSet in the +// GraphQL Document. +function findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentType, selectionSet) { + const conflicts = []; + const [fieldMap, fragmentNames] = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet); // (A) Find find all conflicts "within" the fields of this selection set. + // Note: this is the *only place* `collectConflictsWithin` is called. + + collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap); + if (fragmentNames.length !== 0) { + // (B) Then collect conflicts between these fields and those represented by + // each spread fragment name found. + for (let i = 0; i < fragmentNames.length; i++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, fieldMap, fragmentNames[i]); // (C) Then compare this fragment with all other fragments found in this + // selection set to collect conflicts between fragments spread together. + // This compares each item in the list of fragment names to every other + // item in that same list (except for itself). + + for (let j = i + 1; j < fragmentNames.length; j++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, fragmentNames[i], fragmentNames[j]); + } } - if (value === sep) { - push(part); - part = ''; + } + return conflicts; +} // Collect all conflicts found between a set of fields and a fragment reference +// including via spreading in any nested fragments. + +function collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentName) { + const fragment = context.getFragment(fragmentName); + if (!fragment) { + return; + } + const [fieldMap2, referencedFragmentNames] = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment); // Do not compare a fragment's fieldMap to itself. + + if (fieldMap === fieldMap2) { + return; + } // (D) First collect any conflicts between the provided collection of fields + // and the collection of fields represented by the given fragment. + + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fieldMap2); // (E) Then collect any conflicts between the provided collection of fields + // and any fragment names found in the given fragment. + + for (const referencedFragmentName of referencedFragmentNames) { + // Memoize so two fragments are not compared for conflicts more than once. + if (comparedFragmentPairs.has(referencedFragmentName, fragmentName, areMutuallyExclusive)) { continue; } - part += value; + comparedFragmentPairs.add(referencedFragmentName, fragmentName, areMutuallyExclusive); + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, referencedFragmentName); } - if (part) { - push(part); +} // Collect all conflicts found between two fragments, including via spreading in +// any nested fragments. + +function collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentName2) { + // No need to compare a fragment to itself. + if (fragmentName1 === fragmentName2) { + return; + } // Memoize so two fragments are not compared for conflicts more than once. + + if (comparedFragmentPairs.has(fragmentName1, fragmentName2, areMutuallyExclusive)) { + return; } - return parts; -}; -const split = (input, options) => { - if (options && typeof options.split === 'function') return options.split(input); - if (typeof input === 'symbol') return [input]; - if (Array.isArray(input)) return input; - return memoize(input, options, () => splitString(input, options)); -}; -const assignProp = (obj, prop, value, options) => { - validateKey(prop); + comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive); + const fragment1 = context.getFragment(fragmentName1); + const fragment2 = context.getFragment(fragmentName2); + if (!fragment1 || !fragment2) { + return; + } + const [fieldMap1, referencedFragmentNames1] = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment1); + const [fieldMap2, referencedFragmentNames2] = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment2); // (F) First, collect all conflicts between these two collections of fields + // (not including any nested fragments). - // Delete property when "value" is undefined - if (value === undefined) { - deleteProperty(obj, prop); - } else if (options && options.merge) { - const merge = options.merge === 'function' ? options.merge : Object.assign; + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (G) Then collect conflicts between the first fragment and any nested + // fragments spread in the second fragment. - // Only merge plain objects - if (merge && isPlainObject(obj[prop]) && isPlainObject(value)) { - obj[prop] = merge(obj[prop], value); - } else { - obj[prop] = value; - } - } else { - obj[prop] = value; + for (const referencedFragmentName2 of referencedFragmentNames2) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, referencedFragmentName2); + } // (G) Then collect conflicts between the second fragment and any nested + // fragments spread in the first fragment. + + for (const referencedFragmentName1 of referencedFragmentNames1) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, referencedFragmentName1, fragmentName2); } - return obj; -}; -const setValue = (target, path, value, options) => { - if (!path || !isObject(target)) return target; - const keys = split(path, options); - let obj = target; - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const next = keys[i + 1]; - validateKey(key); - if (next === undefined) { - assignProp(obj, key, value, options); - break; +} // Find all conflicts found between two selection sets, including those found +// via spreading in fragments. Called when determining if conflicts exist +// between the sub-fields of two overlapping fields. + +function findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, parentType1, selectionSet1, parentType2, selectionSet2) { + const conflicts = []; + const [fieldMap1, fragmentNames1] = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType1, selectionSet1); + const [fieldMap2, fragmentNames2] = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType2, selectionSet2); // (H) First, collect all conflicts between these two collections of field. + + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (I) Then collect conflicts between the first collection of fields and + // those referenced by each fragment name associated with the second. + + for (const fragmentName2 of fragmentNames2) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentName2); + } // (I) Then collect conflicts between the second collection of fields and + // those referenced by each fragment name associated with the first. + + for (const fragmentName1 of fragmentNames1) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap2, fragmentName1); + } // (J) Also collect conflicts between any fragment names by the first and + // fragment names by the second. This compares each item in the first set of + // names to each item in the second set of names. + + for (const fragmentName1 of fragmentNames1) { + for (const fragmentName2 of fragmentNames2) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentName2); } - if (typeof next === 'number' && !Array.isArray(obj[key])) { - obj = obj[key] = []; - continue; + } + return conflicts; +} // Collect all Conflicts "within" one collection of fields. + +function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap) { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For every response name, if there are multiple fields, they + // must be compared to find a potential conflict. + for (const [responseName, fields] of Object.entries(fieldMap)) { + // This compares every field in the list to every other field in this list + // (except to itself). If the list only has one item, nothing needs to + // be compared. + if (fields.length > 1) { + for (let i = 0; i < fields.length; i++) { + for (let j = i + 1; j < fields.length; j++) { + const conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, + // within one collection is never mutually exclusive + responseName, fields[i], fields[j]); + if (conflict) { + conflicts.push(conflict); + } + } + } } - if (!isObject(obj[key])) { - obj[key] = {}; + } +} // Collect all Conflicts between two collections of fields. This is similar to, +// but different from the `collectConflictsWithin` function above. This check +// assumes that `collectConflictsWithin` has already been called on each +// provided collection of fields. This is true because this validator traverses +// each individual selection set. + +function collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, fieldMap1, fieldMap2) { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For any response name which appears in both provided field + // maps, each field from the first field map must be compared to every field + // in the second field map to find potential conflicts. + for (const [responseName, fields1] of Object.entries(fieldMap1)) { + const fields2 = fieldMap2[responseName]; + if (fields2) { + for (const field1 of fields1) { + for (const field2 of fields2) { + const conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, field2); + if (conflict) { + conflicts.push(conflict); + } + } + } } - obj = obj[key]; } - return target; -}; -setValue.split = split; -setValue.cache = new Map(); -setValue.clear = () => { - setValue.cache = new Map(); -}; -module.exports = setValue; +} // Determines if there is a conflict between two particular fields, including +// comparing their sub-fields. -/***/ }), +function findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, field2) { + const [parentType1, node1, def1] = field1; + const [parentType2, node2, def2] = field2; // If it is known that two fields could not possibly apply at the same + // time, due to the parent types, then it is safe to permit them to diverge + // in aliased field or arguments used as they will not present any ambiguity + // by differing. + // It is known that two parent types could never overlap if they are + // different Object types. Interface or Union types might overlap - if not + // in the current state of the schema, then perhaps in some future version, + // thus may not safely diverge. -/***/ "../../../node_modules/style-value-types/dist/valueTypes.cjs.js": -/*!**********************************************************************!*\ - !*** ../../../node_modules/style-value-types/dist/valueTypes.cjs.js ***! - \**********************************************************************/ -/***/ (function(__unused_webpack_module, exports) { + const areMutuallyExclusive = parentFieldsAreMutuallyExclusive || parentType1 !== parentType2 && (0, _definition.isObjectType)(parentType1) && (0, _definition.isObjectType)(parentType2); + if (!areMutuallyExclusive) { + // Two aliases must refer to the same field. + const name1 = node1.name.value; + const name2 = node2.name.value; + if (name1 !== name2) { + return [[responseName, `"${name1}" and "${name2}" are different fields`], [node1], [node2]]; + } // Two field calls must have the same arguments. + if (!sameArguments(node1, node2)) { + return [[responseName, 'they have differing arguments'], [node1], [node2]]; + } + } // The return type for each field. + const type1 = def1 === null || def1 === void 0 ? void 0 : def1.type; + const type2 = def2 === null || def2 === void 0 ? void 0 : def2.type; + if (type1 && type2 && doTypesConflict(type1, type2)) { + return [[responseName, `they return conflicting types "${(0, _inspect.inspect)(type1)}" and "${(0, _inspect.inspect)(type2)}"`], [node1], [node2]]; + } // Collect and compare sub-fields. Use the same "visited fragment names" list + // for both collections so fields in a fragment reference are never + // compared to themselves. -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -const clamp = (min, max) => v => Math.max(Math.min(v, max), min); -const sanitize = v => v % 1 ? Number(v.toFixed(5)) : v; -const floatRegex = /(-)?([\d]*\.?[\d])+/g; -const colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi; -const singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i; -function isString(v) { - return typeof v === 'string'; + const selectionSet1 = node1.selectionSet; + const selectionSet2 = node2.selectionSet; + if (selectionSet1 && selectionSet2) { + const conflicts = findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, (0, _definition.getNamedType)(type1), selectionSet1, (0, _definition.getNamedType)(type2), selectionSet2); + return subfieldConflicts(conflicts, responseName, node1, node2); + } } -const number = { - test: v => typeof v === 'number', - parse: parseFloat, - transform: v => v -}; -const alpha = Object.assign(Object.assign({}, number), { - transform: clamp(0, 1) -}); -const scale = Object.assign(Object.assign({}, number), { - default: 1 -}); -const createUnitType = unit => ({ - test: v => isString(v) && v.endsWith(unit) && v.split(' ').length === 1, - parse: parseFloat, - transform: v => `${v}${unit}` -}); -const degrees = createUnitType('deg'); -const percent = createUnitType('%'); -const px = createUnitType('px'); -const vh = createUnitType('vh'); -const vw = createUnitType('vw'); -const progressPercentage = Object.assign(Object.assign({}, percent), { - parse: v => percent.parse(v) / 100, - transform: v => percent.transform(v * 100) -}); -const isColorString = (type, testProp) => v => { - return Boolean(isString(v) && singleColorRegex.test(v) && v.startsWith(type) || testProp && Object.prototype.hasOwnProperty.call(v, testProp)); -}; -const splitColor = (aName, bName, cName) => v => { - if (!isString(v)) return v; - const [a, b, c, alpha] = v.match(floatRegex); - return { - [aName]: parseFloat(a), - [bName]: parseFloat(b), - [cName]: parseFloat(c), - alpha: alpha !== undefined ? parseFloat(alpha) : 1 - }; -}; -const hsla = { - test: isColorString('hsl', 'hue'), - parse: splitColor('hue', 'saturation', 'lightness'), - transform: ({ - hue, - saturation, - lightness, - alpha: alpha$1 = 1 - }) => { - return 'hsla(' + Math.round(hue) + ', ' + percent.transform(sanitize(saturation)) + ', ' + percent.transform(sanitize(lightness)) + ', ' + sanitize(alpha.transform(alpha$1)) + ')'; +function sameArguments(node1, node2) { + const args1 = node1.arguments; + const args2 = node2.arguments; + if (args1 === undefined || args1.length === 0) { + return args2 === undefined || args2.length === 0; } -}; -const clampRgbUnit = clamp(0, 255); -const rgbUnit = Object.assign(Object.assign({}, number), { - transform: v => Math.round(clampRgbUnit(v)) -}); -const rgba = { - test: isColorString('rgb', 'red'), - parse: splitColor('red', 'green', 'blue'), - transform: ({ - red, - green, - blue, - alpha: alpha$1 = 1 - }) => 'rgba(' + rgbUnit.transform(red) + ', ' + rgbUnit.transform(green) + ', ' + rgbUnit.transform(blue) + ', ' + sanitize(alpha.transform(alpha$1)) + ')' -}; -function parseHex(v) { - let r = ''; - let g = ''; - let b = ''; - let a = ''; - if (v.length > 5) { - r = v.substr(1, 2); - g = v.substr(3, 2); - b = v.substr(5, 2); - a = v.substr(7, 2); - } else { - r = v.substr(1, 1); - g = v.substr(2, 1); - b = v.substr(3, 1); - a = v.substr(4, 1); - r += r; - g += g; - b += b; - a += a; + if (args2 === undefined || args2.length === 0) { + return false; } - return { - red: parseInt(r, 16), - green: parseInt(g, 16), - blue: parseInt(b, 16), - alpha: a ? parseInt(a, 16) / 255 : 1 - }; -} -const hex = { - test: isColorString('#'), - parse: parseHex, - transform: rgba.transform -}; -const color = { - test: v => rgba.test(v) || hex.test(v) || hsla.test(v), - parse: v => { - if (rgba.test(v)) { - return rgba.parse(v); - } else if (hsla.test(v)) { - return hsla.parse(v); - } else { - return hex.parse(v); - } - }, - transform: v => { - return isString(v) ? v : v.hasOwnProperty('red') ? rgba.transform(v) : hsla.transform(v); + /* c8 ignore next */ + + if (args1.length !== args2.length) { + /* c8 ignore next */ + return false; + /* c8 ignore next */ } -}; -const colorToken = '${c}'; -const numberToken = '${n}'; -function test(v) { - var _a, _b, _c, _d; - return isNaN(v) && isString(v) && ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0; + const values2 = new Map(args2.map(({ + name, + value + }) => [name.value, value])); + return args1.every(arg1 => { + const value1 = arg1.value; + const value2 = values2.get(arg1.name.value); + if (value2 === undefined) { + return false; + } + return stringifyValue(value1) === stringifyValue(value2); + }); } -function analyse(v) { - if (typeof v === 'number') v = `${v}`; - const values = []; - let numColors = 0; - const colors = v.match(colorRegex); - if (colors) { - numColors = colors.length; - v = v.replace(colorRegex, colorToken); - values.push(...colors.map(color.parse)); +function stringifyValue(value) { + return (0, _printer.print)((0, _sortValueNode.sortValueNode)(value)); +} // Two types conflict if both types could not apply to a value simultaneously. +// Composite types are ignored as their individual field types will be compared +// later recursively. However List and Non-Null types must match. + +function doTypesConflict(type1, type2) { + if ((0, _definition.isListType)(type1)) { + return (0, _definition.isListType)(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; } - const numbers = v.match(floatRegex); - if (numbers) { - v = v.replace(floatRegex, numberToken); - values.push(...numbers.map(number.parse)); + if ((0, _definition.isListType)(type2)) { + return true; } - return { - values, - numColors, - tokenised: v - }; -} -function parse(v) { - return analyse(v).values; + if ((0, _definition.isNonNullType)(type1)) { + return (0, _definition.isNonNullType)(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; + } + if ((0, _definition.isNonNullType)(type2)) { + return true; + } + if ((0, _definition.isLeafType)(type1) || (0, _definition.isLeafType)(type2)) { + return type1 !== type2; + } + return false; +} // Given a selection set, return the collection of fields (a mapping of response +// name to field nodes and definitions) as well as a list of fragment names +// referenced via fragment spreads. + +function getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet) { + const cached = cachedFieldsAndFragmentNames.get(selectionSet); + if (cached) { + return cached; + } + const nodeAndDefs = Object.create(null); + const fragmentNames = Object.create(null); + _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames); + const result = [nodeAndDefs, Object.keys(fragmentNames)]; + cachedFieldsAndFragmentNames.set(selectionSet, result); + return result; +} // Given a reference to a fragment, return the represented collection of fields +// as well as a list of nested fragment names referenced via fragment spreads. + +function getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment) { + // Short-circuit building a type from the node if possible. + const cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet); + if (cached) { + return cached; + } + const fragmentType = (0, _typeFromAST.typeFromAST)(context.getSchema(), fragment.typeCondition); + return getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragmentType, fragment.selectionSet); } -function createTransformer(v) { - const { - values, - numColors, - tokenised - } = analyse(v); - const numValues = values.length; - return v => { - let output = tokenised; - for (let i = 0; i < numValues; i++) { - output = output.replace(i < numColors ? colorToken : numberToken, i < numColors ? color.transform(v[i]) : sanitize(v[i])); +function _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames) { + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case _kinds.Kind.FIELD: + { + const fieldName = selection.name.value; + let fieldDef; + if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) { + fieldDef = parentType.getFields()[fieldName]; + } + const responseName = selection.alias ? selection.alias.value : fieldName; + if (!nodeAndDefs[responseName]) { + nodeAndDefs[responseName] = []; + } + nodeAndDefs[responseName].push([parentType, selection, fieldDef]); + break; + } + case _kinds.Kind.FRAGMENT_SPREAD: + fragmentNames[selection.name.value] = true; + break; + case _kinds.Kind.INLINE_FRAGMENT: + { + const typeCondition = selection.typeCondition; + const inlineFragmentType = typeCondition ? (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition) : parentType; + _collectFieldsAndFragmentNames(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentNames); + break; + } } - return output; - }; -} -const convertNumbersToZero = v => typeof v === 'number' ? 0 : v; -function getAnimatableNone(v) { - const parsed = parse(v); - const transformer = createTransformer(v); - return transformer(parsed.map(convertNumbersToZero)); -} -const complex = { - test, - parse, - createTransformer, - getAnimatableNone -}; -const maxDefaults = new Set(['brightness', 'contrast', 'saturate', 'opacity']); -function applyDefaultFilter(v) { - let [name, value] = v.slice(0, -1).split('('); - if (name === 'drop-shadow') return v; - const [number] = value.match(floatRegex) || []; - if (!number) return v; - const unit = value.replace(number, ''); - let defaultValue = maxDefaults.has(name) ? 1 : 0; - if (number !== value) defaultValue *= 100; - return name + '(' + defaultValue + unit + ')'; + } +} // Given a series of Conflicts which occurred between two sub-fields, generate +// a single Conflict. + +function subfieldConflicts(conflicts, responseName, node1, node2) { + if (conflicts.length > 0) { + return [[responseName, conflicts.map(([reason]) => reason)], [node1, ...conflicts.map(([, fields1]) => fields1).flat()], [node2, ...conflicts.map(([,, fields2]) => fields2).flat()]]; + } } -const functionRegex = /([a-z-]*)\(.*?\)/g; -const filter = Object.assign(Object.assign({}, complex), { - getAnimatableNone: v => { - const functions = v.match(functionRegex); - return functions ? functions.map(applyDefaultFilter).join(' ') : v; +/** + * A way to keep track of pairs of things when the ordering of the pair does not matter. + */ + +class PairSet { + constructor() { + this._data = new Map(); } -}); -exports.alpha = alpha; -exports.color = color; -exports.complex = complex; -exports.degrees = degrees; -exports.filter = filter; -exports.hex = hex; -exports.hsla = hsla; -exports.number = number; -exports.percent = percent; -exports.progressPercentage = progressPercentage; -exports.px = px; -exports.rgbUnit = rgbUnit; -exports.rgba = rgba; -exports.scale = scale; -exports.vh = vh; -exports.vw = vw; + has(a, b, areMutuallyExclusive) { + var _this$_data$get; + const [key1, key2] = a < b ? [a, b] : [b, a]; + const result = (_this$_data$get = this._data.get(key1)) === null || _this$_data$get === void 0 ? void 0 : _this$_data$get.get(key2); + if (result === undefined) { + return false; + } // areMutuallyExclusive being false is a superset of being true, hence if + // we want to know if this PairSet "has" these two with no exclusivity, + // we have to ensure it was added as such. + + return areMutuallyExclusive ? true : areMutuallyExclusive === result; + } + add(a, b, areMutuallyExclusive) { + const [key1, key2] = a < b ? [a, b] : [b, a]; + const map = this._data.get(key1); + if (map === undefined) { + this._data.set(key1, new Map([[key2, areMutuallyExclusive]])); + } else { + map.set(key2, areMutuallyExclusive); + } + } +} /***/ }), -/***/ "../../../node_modules/toggle-selection/index.js": -/*!*******************************************************!*\ - !*** ../../../node_modules/toggle-selection/index.js ***! - \*******************************************************/ -/***/ (function(module) { +/***/ "../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs": +/*!**************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; -module.exports = function () { - var selection = document.getSelection(); - if (!selection.rangeCount) { - return function () {}; - } - var active = document.activeElement; - var ranges = []; - for (var i = 0; i < selection.rangeCount; i++) { - ranges.push(selection.getRangeAt(i)); - } - switch (active.tagName.toUpperCase()) { - // .toUpperCase handles XHTML - case 'INPUT': - case 'TEXTAREA': - active.blur(); - break; - default: - active = null; - break; - } - selection.removeAllRanges(); - return function () { - selection.type === 'Caret' && selection.removeAllRanges(); - if (!selection.rangeCount) { - ranges.forEach(function (range) { - selection.addRange(range); - }); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PossibleFragmentSpreadsRule = PossibleFragmentSpreadsRule; +var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _typeComparators = __webpack_require__(/*! ../../utilities/typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); +var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); +/** + * Possible fragment spread + * + * A fragment spread is only valid if the type condition could ever possibly + * be true: if there is a non-empty intersection of the possible parent types, + * and possible types which pass the type condition. + */ +function PossibleFragmentSpreadsRule(context) { + return { + InlineFragment(node) { + const fragType = context.getType(); + const parentType = context.getParentType(); + if ((0, _definition.isCompositeType)(fragType) && (0, _definition.isCompositeType)(parentType) && !(0, _typeComparators.doTypesOverlap)(context.getSchema(), fragType, parentType)) { + const parentTypeStr = (0, _inspect.inspect)(parentType); + const fragTypeStr = (0, _inspect.inspect)(fragType); + context.reportError(new _GraphQLError.GraphQLError(`Fragment cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { + nodes: node + })); + } + }, + FragmentSpread(node) { + const fragName = node.name.value; + const fragType = getFragmentType(context, fragName); + const parentType = context.getParentType(); + if (fragType && parentType && !(0, _typeComparators.doTypesOverlap)(context.getSchema(), fragType, parentType)) { + const parentTypeStr = (0, _inspect.inspect)(parentType); + const fragTypeStr = (0, _inspect.inspect)(fragType); + context.reportError(new _GraphQLError.GraphQLError(`Fragment "${fragName}" cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { + nodes: node + })); + } } - active && active.focus(); }; -}; +} +function getFragmentType(context, name) { + const frag = context.getFragment(name); + if (frag) { + const type = (0, _typeFromAST.typeFromAST)(context.getSchema(), frag.typeCondition); + if ((0, _definition.isCompositeType)(type)) { + return type; + } + } +} /***/ }), -/***/ "../../../node_modules/tslib/tslib.es6.mjs": -/*!*************************************************!*\ - !*** ../../../node_modules/tslib/tslib.es6.mjs ***! - \*************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs": +/*!*************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs ***! + \*************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.__addDisposableResource = __addDisposableResource; -exports.__assign = void 0; -exports.__asyncDelegator = __asyncDelegator; -exports.__asyncGenerator = __asyncGenerator; -exports.__asyncValues = __asyncValues; -exports.__await = __await; -exports.__awaiter = __awaiter; -exports.__classPrivateFieldGet = __classPrivateFieldGet; -exports.__classPrivateFieldIn = __classPrivateFieldIn; -exports.__classPrivateFieldSet = __classPrivateFieldSet; -exports.__createBinding = void 0; -exports.__decorate = __decorate; -exports.__disposeResources = __disposeResources; -exports.__esDecorate = __esDecorate; -exports.__exportStar = __exportStar; -exports.__extends = __extends; -exports.__generator = __generator; -exports.__importDefault = __importDefault; -exports.__importStar = __importStar; -exports.__makeTemplateObject = __makeTemplateObject; -exports.__metadata = __metadata; -exports.__param = __param; -exports.__propKey = __propKey; -exports.__read = __read; -exports.__rest = __rest; -exports.__runInitializers = __runInitializers; -exports.__setFunctionName = __setFunctionName; -exports.__spread = __spread; -exports.__spreadArray = __spreadArray; -exports.__spreadArrays = __spreadArrays; -exports.__values = __values; -exports["default"] = void 0; -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol */ - -var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || { - __proto__: [] - } instanceof Array && function (d, b) { - d.__proto__ = b; - } || function (d, b) { - for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; - }; - return extendStatics(d, b); -}; -function __extends(d, b) { - if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -var __assign = function () { - exports.__assign = __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; +exports.PossibleTypeExtensionsRule = PossibleTypeExtensionsRule; +var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); +var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _invariant = __webpack_require__(/*! ../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _predicates = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +/** + * Possible type extension + * + * A type extension is only valid if the type is defined and has the same kind. + */ +function PossibleTypeExtensionsRule(context) { + const schema = context.getSchema(); + const definedTypes = Object.create(null); + for (const def of context.getDocument().definitions) { + if ((0, _predicates.isTypeDefinitionNode)(def)) { + definedTypes[def.name.value] = def; } - return t; - }; - return __assign.apply(this, arguments); -}; -exports.__assign = __assign; -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } - return t; -} -function __decorate(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} -function __param(paramIndex, decorator) { - return function (target, key) { - decorator(target, key, paramIndex); + return { + ScalarTypeExtension: checkExtension, + ObjectTypeExtension: checkExtension, + InterfaceTypeExtension: checkExtension, + UnionTypeExtension: checkExtension, + EnumTypeExtension: checkExtension, + InputObjectTypeExtension: checkExtension }; -} -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { - if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); - return f; - } - var kind = contextIn.kind, - key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, - done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); - }; - var result = (0, decorators[i])(kind === "accessor" ? { - get: descriptor.get, - set: descriptor.set - } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_);else descriptor[key] = _; + function checkExtension(node) { + const typeName = node.name.value; + const defNode = definedTypes[typeName]; + const existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName); + let expectedKind; + if (defNode) { + expectedKind = defKindToExtKind[defNode.kind]; + } else if (existingType) { + expectedKind = typeToExtKind(existingType); + } + if (expectedKind) { + if (expectedKind !== node.kind) { + const kindStr = extensionKindToTypeName(node.kind); + context.reportError(new _GraphQLError.GraphQLError(`Cannot extend non-${kindStr} type "${typeName}".`, { + nodes: defNode ? [defNode, node] : node + })); + } + } else { + const allTypeNames = Object.keys({ + ...definedTypes, + ...(schema === null || schema === void 0 ? void 0 : schema.getTypeMap()) + }); + const suggestedTypes = (0, _suggestionList.suggestionList)(typeName, allTypeNames); + context.reportError(new _GraphQLError.GraphQLError(`Cannot extend type "${typeName}" because it is not defined.` + (0, _didYouMean.didYouMean)(suggestedTypes), { + nodes: node.name + })); } } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; } -; -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); +const defKindToExtKind = { + [_kinds.Kind.SCALAR_TYPE_DEFINITION]: _kinds.Kind.SCALAR_TYPE_EXTENSION, + [_kinds.Kind.OBJECT_TYPE_DEFINITION]: _kinds.Kind.OBJECT_TYPE_EXTENSION, + [_kinds.Kind.INTERFACE_TYPE_DEFINITION]: _kinds.Kind.INTERFACE_TYPE_EXTENSION, + [_kinds.Kind.UNION_TYPE_DEFINITION]: _kinds.Kind.UNION_TYPE_EXTENSION, + [_kinds.Kind.ENUM_TYPE_DEFINITION]: _kinds.Kind.ENUM_TYPE_EXTENSION, + [_kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION]: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION +}; +function typeToExtKind(type) { + if ((0, _definition.isScalarType)(type)) { + return _kinds.Kind.SCALAR_TYPE_EXTENSION; } - return useValue ? value : void 0; -} -; -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -; -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { - configurable: true, - value: prefix ? "".concat(prefix, " ", name) : name - }); -} -; -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function (resolve) { - resolve(value); - }); + if ((0, _definition.isObjectType)(type)) { + return _kinds.Kind.OBJECT_TYPE_EXTENSION; } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { - label: 0, - sent: function () { - if (t[0] & 1) throw t[1]; - return t[1]; - }, - trys: [], - ops: [] - }, - f, - y, - t, - g; - return g = { - next: verb(0), - "throw": verb(1), - "return": verb(2) - }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { - return this; - }), g; - function verb(n) { - return function (v) { - return step([n, v]); - }; + if ((0, _definition.isInterfaceType)(type)) { + return _kinds.Kind.INTERFACE_TYPE_EXTENSION; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { - value: op[1], - done: false - }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } catch (e) { - op = [6, e]; - y = 0; - } finally { - f = t = 0; - } - if (op[0] & 5) throw op[1]; - return { - value: op[0] ? op[1] : void 0, - done: true - }; + if ((0, _definition.isUnionType)(type)) { + return _kinds.Kind.UNION_TYPE_EXTENSION; } -} -var __createBinding = exports.__createBinding = Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k]; - } - }; + if ((0, _definition.isEnumType)(type)) { + return _kinds.Kind.ENUM_TYPE_EXTENSION; } - Object.defineProperty(o, k2, desc); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}; -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, - m = s && o[s], - i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { - value: o && o[i++], - done: !o - }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), - r, - ar = [], - e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } catch (error) { - e = { - error: error - }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } + if ((0, _definition.isInputObjectType)(type)) { + return _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION; } - return ar; -} + /* c8 ignore next 3 */ + // Not reachable. All possible types have been considered -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; + false || (0, _invariant.invariant)(false, 'Unexpected type: ' + (0, _inspect.inspect)(type)); } +function extensionKindToTypeName(kind) { + switch (kind) { + case _kinds.Kind.SCALAR_TYPE_EXTENSION: + return 'scalar'; + case _kinds.Kind.OBJECT_TYPE_EXTENSION: + return 'object'; + case _kinds.Kind.INTERFACE_TYPE_EXTENSION: + return 'interface'; + case _kinds.Kind.UNION_TYPE_EXTENSION: + return 'union'; + case _kinds.Kind.ENUM_TYPE_EXTENSION: + return 'enum'; + case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION: + return 'input object'; + // Not reachable. All possible types have been considered -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; - return r; -} -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), - i, - q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); - } -} -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { - throw e; - }), verb("return"), i[Symbol.iterator] = function () { - return this; - }, i; - function verb(n, f) { - i[n] = o[n] ? function (v) { - return (p = !p) ? { - value: __await(o[n](v)), - done: false - } : f ? f(v) : v; - } : f; - } -} -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], - i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function (v) { - return new Promise(function (resolve, reject) { - v = o[n](v), settle(resolve, reject, v.done, v.value); - }); - }; - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ - value: v, - done: d - }); - }, reject); - } -} -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { - value: raw - }); - } else { - cooked.raw = raw; - } - return cooked; -} -; -var __setModuleDefault = Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}; -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} -function __importDefault(mod) { - return mod && mod.__esModule ? mod : { - default: mod - }; -} -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; -} -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ - value: value, - dispose: dispose, - async: async - }); - } else if (async) { - env.stack.push({ - async: true - }); - } - return value; -} -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function (e) { - fail(e); - return next(); - }); - } catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; + /* c8 ignore next */ + + default: + false || (0, _invariant.invariant)(false, 'Unexpected kind: ' + (0, _inspect.inspect)(kind)); } - return next(); } -var _default = exports["default"] = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources -}; - -/***/ }), - -/***/ "../../../node_modules/uc.micro/build/index.cjs.js": -/*!*********************************************************!*\ - !*** ../../../node_modules/uc.micro/build/index.cjs.js ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -var regex$5 = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var regex$4 = /[\0-\x1F\x7F-\x9F]/; -var regex$3 = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/; -var regex$2 = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/; -var regex$1 = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/; -var regex = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; -exports.Any = regex$5; -exports.Cc = regex$4; -exports.Cf = regex$3; -exports.P = regex$2; -exports.S = regex$1; -exports.Z = regex; /***/ }), -/***/ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js": -/*!***********************************************************************!*\ - !*** ../../../node_modules/use-callback-ref/dist/es2015/assignRef.js ***! - \***********************************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs": +/*!****************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs ***! + \****************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.assignRef = assignRef; +exports.ProvidedRequiredArgumentsOnDirectivesRule = ProvidedRequiredArgumentsOnDirectivesRule; +exports.ProvidedRequiredArgumentsRule = ProvidedRequiredArgumentsRule; +var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _keyMap = __webpack_require__(/*! ../../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _directives = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); /** - * Assigns a value for a given ref, no matter of the ref format - * @param {RefObject} ref - a callback function or ref object - * @param value - a new value - * - * @see https://github.com/theKashey/use-callback-ref#assignref - * @example - * const refObject = useRef(); - * const refFn = (ref) => {....} + * Provided required arguments * - * assignRef(refObject, "refValue"); - * assignRef(refFn, "refValue"); + * A field or directive is only valid if all required (non-null without a + * default value) field arguments have been provided. */ -function assignRef(ref, value) { - if (typeof ref === 'function') { - ref(value); - } else if (ref) { - ref.current = value; - } - return ref; +function ProvidedRequiredArgumentsRule(context) { + return { + // eslint-disable-next-line new-cap + ...ProvidedRequiredArgumentsOnDirectivesRule(context), + Field: { + // Validate on leave to allow for deeper errors to appear first. + leave(fieldNode) { + var _fieldNode$arguments; + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + return false; + } + const providedArgs = new Set( + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + (_fieldNode$arguments = fieldNode.arguments) === null || _fieldNode$arguments === void 0 ? void 0 : _fieldNode$arguments.map(arg => arg.name.value)); + for (const argDef of fieldDef.args) { + if (!providedArgs.has(argDef.name) && (0, _definition.isRequiredArgument)(argDef)) { + const argTypeStr = (0, _inspect.inspect)(argDef.type); + context.reportError(new _GraphQLError.GraphQLError(`Field "${fieldDef.name}" argument "${argDef.name}" of type "${argTypeStr}" is required, but it was not provided.`, { + nodes: fieldNode + })); + } + } + } + } + }; +} +/** + * @internal + */ + +function ProvidedRequiredArgumentsOnDirectivesRule(context) { + var _schema$getDirectives; + const requiredArgsMap = Object.create(null); + const schema = context.getSchema(); + const definedDirectives = (_schema$getDirectives = schema === null || schema === void 0 ? void 0 : schema.getDirectives()) !== null && _schema$getDirectives !== void 0 ? _schema$getDirectives : _directives.specifiedDirectives; + for (const directive of definedDirectives) { + requiredArgsMap[directive.name] = (0, _keyMap.keyMap)(directive.args.filter(_definition.isRequiredArgument), arg => arg.name); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + var _def$arguments; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + const argNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : []; + requiredArgsMap[def.name.value] = (0, _keyMap.keyMap)(argNodes.filter(isRequiredArgumentNode), arg => arg.name.value); + } + } + return { + Directive: { + // Validate on leave to allow for deeper errors to appear first. + leave(directiveNode) { + const directiveName = directiveNode.name.value; + const requiredArgs = requiredArgsMap[directiveName]; + if (requiredArgs) { + var _directiveNode$argume; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + const argNodes = (_directiveNode$argume = directiveNode.arguments) !== null && _directiveNode$argume !== void 0 ? _directiveNode$argume : []; + const argNodeMap = new Set(argNodes.map(arg => arg.name.value)); + for (const [argName, argDef] of Object.entries(requiredArgs)) { + if (!argNodeMap.has(argName)) { + const argType = (0, _definition.isType)(argDef.type) ? (0, _inspect.inspect)(argDef.type) : (0, _printer.print)(argDef.type); + context.reportError(new _GraphQLError.GraphQLError(`Directive "@${directiveName}" argument "${argName}" of type "${argType}" is required, but it was not provided.`, { + nodes: directiveNode + })); + } + } + } + } + } + }; +} +function isRequiredArgumentNode(arg) { + return arg.type.kind === _kinds.Kind.NON_NULL_TYPE && arg.defaultValue == null; } /***/ }), -/***/ "../../../node_modules/use-callback-ref/dist/es2015/createRef.js": -/*!***********************************************************************!*\ - !*** ../../../node_modules/use-callback-ref/dist/es2015/createRef.js ***! - \***********************************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs": +/*!**************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createCallbackRef = createCallbackRef; +exports.ScalarLeafsRule = ScalarLeafsRule; +var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); /** - * creates a Ref object with on change callback - * @param callback - * @returns {RefObject} + * Scalar leafs * - * @see {@link useCallbackRef} - * @see https://reactjs.org/docs/refs-and-the-dom.html#creating-refs + * A GraphQL document is valid only if all leaf fields (fields without + * sub selections) are of scalar or enum types. */ -function createCallbackRef(callback) { - var current = null; +function ScalarLeafsRule(context) { return { - get current() { - return current; - }, - set current(value) { - var last = current; - if (last !== value) { - current = value; - callback(value, last); + Field(node) { + const type = context.getType(); + const selectionSet = node.selectionSet; + if (type) { + if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type))) { + if (selectionSet) { + const fieldName = node.name.value; + const typeStr = (0, _inspect.inspect)(type); + context.reportError(new _GraphQLError.GraphQLError(`Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`, { + nodes: selectionSet + })); + } + } else if (!selectionSet) { + const fieldName = node.name.value; + const typeStr = (0, _inspect.inspect)(type); + context.reportError(new _GraphQLError.GraphQLError(`Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`, { + nodes: node + })); + } } } }; @@ -52503,15764 +57034,17622 @@ function createCallbackRef(callback) { /***/ }), -/***/ "../../../node_modules/use-callback-ref/dist/es2015/index.js": -/*!*******************************************************************!*\ - !*** ../../../node_modules/use-callback-ref/dist/es2015/index.js ***! - \*******************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs": +/*!***************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs ***! + \***************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -Object.defineProperty(exports, "assignRef", ({ - enumerable: true, - get: function () { - return _assignRef.assignRef; - } -})); -Object.defineProperty(exports, "createCallbackRef", ({ - enumerable: true, - get: function () { - return _createRef.createCallbackRef; - } -})); -Object.defineProperty(exports, "mergeRefs", ({ - enumerable: true, - get: function () { - return _mergeRef.mergeRefs; - } -})); -Object.defineProperty(exports, "refToCallback", ({ - enumerable: true, - get: function () { - return _refToCallback.refToCallback; - } -})); -Object.defineProperty(exports, "transformRef", ({ - enumerable: true, - get: function () { - return _transformRef.transformRef; - } -})); -Object.defineProperty(exports, "useCallbackRef", ({ - enumerable: true, - get: function () { - return _useRef.useCallbackRef; - } -})); -Object.defineProperty(exports, "useMergeRefs", ({ - enumerable: true, - get: function () { - return _useMergeRef.useMergeRefs; - } -})); -Object.defineProperty(exports, "useRefToCallback", ({ - enumerable: true, - get: function () { - return _refToCallback.useRefToCallback; - } -})); -Object.defineProperty(exports, "useTransformRef", ({ - enumerable: true, - get: function () { - return _useTransformRef.useTransformRef; - } -})); -var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); -var _useRef = __webpack_require__(/*! ./useRef */ "../../../node_modules/use-callback-ref/dist/es2015/useRef.js"); -var _createRef = __webpack_require__(/*! ./createRef */ "../../../node_modules/use-callback-ref/dist/es2015/createRef.js"); -var _mergeRef = __webpack_require__(/*! ./mergeRef */ "../../../node_modules/use-callback-ref/dist/es2015/mergeRef.js"); -var _useMergeRef = __webpack_require__(/*! ./useMergeRef */ "../../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js"); -var _useTransformRef = __webpack_require__(/*! ./useTransformRef */ "../../../node_modules/use-callback-ref/dist/es2015/useTransformRef.js"); -var _transformRef = __webpack_require__(/*! ./transformRef */ "../../../node_modules/use-callback-ref/dist/es2015/transformRef.js"); -var _refToCallback = __webpack_require__(/*! ./refToCallback */ "../../../node_modules/use-callback-ref/dist/es2015/refToCallback.js"); +exports.SingleFieldSubscriptionsRule = SingleFieldSubscriptionsRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _collectFields = __webpack_require__(/*! ../../execution/collectFields.mjs */ "../../../node_modules/graphql/execution/collectFields.mjs"); +/** + * Subscriptions must only include a non-introspection field. + * + * A GraphQL subscription is valid only if it contains a single root field and + * that root field is not an introspection field. + * + * See https://spec.graphql.org/draft/#sec-Single-root-field + */ +function SingleFieldSubscriptionsRule(context) { + return { + OperationDefinition(node) { + if (node.operation === 'subscription') { + const schema = context.getSchema(); + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType) { + const operationName = node.name ? node.name.value : null; + const variableValues = Object.create(null); + const document = context.getDocument(); + const fragments = Object.create(null); + for (const definition of document.definitions) { + if (definition.kind === _kinds.Kind.FRAGMENT_DEFINITION) { + fragments[definition.name.value] = definition; + } + } + const fields = (0, _collectFields.collectFields)(schema, fragments, variableValues, subscriptionType, node.selectionSet); + if (fields.size > 1) { + const fieldSelectionLists = [...fields.values()]; + const extraFieldSelectionLists = fieldSelectionLists.slice(1); + const extraFieldSelections = extraFieldSelectionLists.flat(); + context.reportError(new _GraphQLError.GraphQLError(operationName != null ? `Subscription "${operationName}" must select only one top level field.` : 'Anonymous Subscription must select only one top level field.', { + nodes: extraFieldSelections + })); + } + for (const fieldNodes of fields.values()) { + const field = fieldNodes[0]; + const fieldName = field.name.value; + if (fieldName.startsWith('__')) { + context.reportError(new _GraphQLError.GraphQLError(operationName != null ? `Subscription "${operationName}" must not select an introspection top level field.` : 'Anonymous Subscription must not select an introspection top level field.', { + nodes: fieldNodes + })); + } + } + } + } + } + }; +} /***/ }), -/***/ "../../../node_modules/use-callback-ref/dist/es2015/mergeRef.js": -/*!**********************************************************************!*\ - !*** ../../../node_modules/use-callback-ref/dist/es2015/mergeRef.js ***! - \**********************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs": +/*!********************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs ***! + \********************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.mergeRefs = mergeRefs; -var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); -var _createRef = __webpack_require__(/*! ./createRef */ "../../../node_modules/use-callback-ref/dist/es2015/createRef.js"); +exports.UniqueArgumentDefinitionNamesRule = UniqueArgumentDefinitionNamesRule; +var _groupBy = __webpack_require__(/*! ../../jsutils/groupBy.mjs */ "../../../node_modules/graphql/jsutils/groupBy.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); /** - * Merges two or more refs together providing a single interface to set their value - * @param {RefObject|Ref} refs - * @returns {MutableRefObject} - a new ref, which translates all changes to {refs} + * Unique argument definition names * - * @see {@link useMergeRefs} to be used in ReactComponents - * @example - * const Component = React.forwardRef((props, ref) => { - * const ownRef = useRef(); - * const domRef = mergeRefs([ref, ownRef]); // 👈 merge together - * return
...
- * } + * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments. + * A GraphQL Directive is only valid if all its arguments are uniquely named. */ -function mergeRefs(refs) { - return (0, _createRef.createCallbackRef)(function (newValue) { - return refs.forEach(function (ref) { - return (0, _assignRef.assignRef)(ref, newValue); - }); - }); -} +function UniqueArgumentDefinitionNamesRule(context) { + return { + DirectiveDefinition(directiveNode) { + var _directiveNode$argume; -/***/ }), + // FIXME: https://github.com/graphql/graphql-js/issues/2203 -/***/ "../../../node_modules/use-callback-ref/dist/es2015/refToCallback.js": -/*!***************************************************************************!*\ - !*** ../../../node_modules/use-callback-ref/dist/es2015/refToCallback.js ***! - \***************************************************************************/ -/***/ (function(__unused_webpack_module, exports) { + /* c8 ignore next */ + const argumentNodes = (_directiveNode$argume = directiveNode.arguments) !== null && _directiveNode$argume !== void 0 ? _directiveNode$argume : []; + return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes); + }, + InterfaceTypeDefinition: checkArgUniquenessPerField, + InterfaceTypeExtension: checkArgUniquenessPerField, + ObjectTypeDefinition: checkArgUniquenessPerField, + ObjectTypeExtension: checkArgUniquenessPerField + }; + function checkArgUniquenessPerField(typeNode) { + var _typeNode$fields; + const typeName = typeNode.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203 + /* c8 ignore next */ + const fieldNodes = (_typeNode$fields = typeNode.fields) !== null && _typeNode$fields !== void 0 ? _typeNode$fields : []; + for (const fieldDef of fieldNodes) { + var _fieldDef$arguments; + const fieldName = fieldDef.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203 -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.refToCallback = refToCallback; -exports.useRefToCallback = useRefToCallback; -/** - * Unmemoized version of {@link useRefToCallback} - * @see {@link useRefToCallback} - * @param ref - */ -function refToCallback(ref) { - return function (newValue) { - if (typeof ref === 'function') { - ref(newValue); - } else if (ref) { - ref.current = newValue; + /* c8 ignore next */ + + const argumentNodes = (_fieldDef$arguments = fieldDef.arguments) !== null && _fieldDef$arguments !== void 0 ? _fieldDef$arguments : []; + checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes); } - }; -} -var nullCallback = function () { - return null; -}; -// lets maintain a weak ref to, well, ref :) -// not using `kashe` to keep this package small -var weakMem = new WeakMap(); -var weakMemoize = function (ref) { - var usedRef = ref || nullCallback; - var storedRef = weakMem.get(usedRef); - if (storedRef) { - return storedRef; + return false; + } + function checkArgUniqueness(parentName, argumentNodes) { + const seenArgs = (0, _groupBy.groupBy)(argumentNodes, arg => arg.name.value); + for (const [argName, argNodes] of seenArgs) { + if (argNodes.length > 1) { + context.reportError(new _GraphQLError.GraphQLError(`Argument "${parentName}(${argName}:)" can only be defined once.`, { + nodes: argNodes.map(node => node.name) + })); + } + } + return false; } - var cb = refToCallback(usedRef); - weakMem.set(usedRef, cb); - return cb; -}; -/** - * Transforms a given `ref` into `callback`. - * - * To transform `callback` into ref use {@link useCallbackRef|useCallbackRef(undefined, callback)} - * - * @param {ReactRef} ref - * @returns {Function} - * - * @see https://github.com/theKashey/use-callback-ref#reftocallback - * - * @example - * const ref = useRef(0); - * const setRef = useRefToCallback(ref); - * 👉 setRef(10); - * ✅ ref.current === 10 - */ -function useRefToCallback(ref) { - return weakMemoize(ref); } /***/ }), -/***/ "../../../node_modules/use-callback-ref/dist/es2015/transformRef.js": -/*!**************************************************************************!*\ - !*** ../../../node_modules/use-callback-ref/dist/es2015/transformRef.js ***! - \**************************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs": +/*!**********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs ***! + \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.transformRef = transformRef; -var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); -var _createRef = __webpack_require__(/*! ./createRef */ "../../../node_modules/use-callback-ref/dist/es2015/createRef.js"); +exports.UniqueArgumentNamesRule = UniqueArgumentNamesRule; +var _groupBy = __webpack_require__(/*! ../../jsutils/groupBy.mjs */ "../../../node_modules/graphql/jsutils/groupBy.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); /** - * Transforms one ref to another - * @example - * ```tsx - * const ResizableWithRef = forwardRef((props, ref) => - * i ? i.resizable : null)}/> - * ); - * ``` + * Unique argument names + * + * A GraphQL field or directive is only valid if all supplied arguments are + * uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Argument-Names */ -function transformRef(ref, transformer) { - return (0, _createRef.createCallbackRef)(function (value) { - return (0, _assignRef.assignRef)(ref, transformer(value)); - }); +function UniqueArgumentNamesRule(context) { + return { + Field: checkArgUniqueness, + Directive: checkArgUniqueness + }; + function checkArgUniqueness(parentNode) { + var _parentNode$arguments; + + // FIXME: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + const argumentNodes = (_parentNode$arguments = parentNode.arguments) !== null && _parentNode$arguments !== void 0 ? _parentNode$arguments : []; + const seenArgs = (0, _groupBy.groupBy)(argumentNodes, arg => arg.name.value); + for (const [argName, argNodes] of seenArgs) { + if (argNodes.length > 1) { + context.reportError(new _GraphQLError.GraphQLError(`There can be only one argument named "${argName}".`, { + nodes: argNodes.map(node => node.name) + })); + } + } + } } /***/ }), -/***/ "../../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js": -/*!*************************************************************************!*\ - !*** ../../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js ***! - \*************************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs": +/*!***********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs ***! + \***********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.useMergeRefs = useMergeRefs; -var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); -var _useRef = __webpack_require__(/*! ./useRef */ "../../../node_modules/use-callback-ref/dist/es2015/useRef.js"); +exports.UniqueDirectiveNamesRule = UniqueDirectiveNamesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); /** - * Merges two or more refs together providing a single interface to set their value - * @param {RefObject|Ref} refs - * @returns {MutableRefObject} - a new ref, which translates all changes to {refs} + * Unique directive names * - * @see {@link mergeRefs} a version without buit-in memoization - * @see https://github.com/theKashey/use-callback-ref#usemergerefs - * @example - * const Component = React.forwardRef((props, ref) => { - * const ownRef = useRef(); - * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together - * return
...
- * } + * A GraphQL document is only valid if all defined directives have unique names. */ -function useMergeRefs(refs, defaultValue) { - return (0, _useRef.useCallbackRef)(defaultValue || null, function (newValue) { - return refs.forEach(function (ref) { - return (0, _assignRef.assignRef)(ref, newValue); - }); - }); +function UniqueDirectiveNamesRule(context) { + const knownDirectiveNames = Object.create(null); + const schema = context.getSchema(); + return { + DirectiveDefinition(node) { + const directiveName = node.name.value; + if (schema !== null && schema !== void 0 && schema.getDirective(directiveName)) { + context.reportError(new _GraphQLError.GraphQLError(`Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`, { + nodes: node.name + })); + return; + } + if (knownDirectiveNames[directiveName]) { + context.reportError(new _GraphQLError.GraphQLError(`There can be only one directive named "@${directiveName}".`, { + nodes: [knownDirectiveNames[directiveName], node.name] + })); + } else { + knownDirectiveNames[directiveName] = node.name; + } + return false; + } + }; } /***/ }), -/***/ "../../../node_modules/use-callback-ref/dist/es2015/useRef.js": -/*!********************************************************************!*\ - !*** ../../../node_modules/use-callback-ref/dist/es2015/useRef.js ***! - \********************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs": +/*!******************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs ***! + \******************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.useCallbackRef = useCallbackRef; -var _react = __webpack_require__(/*! react */ "react"); +exports.UniqueDirectivesPerLocationRule = UniqueDirectivesPerLocationRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _predicates = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); +var _directives = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); /** - * creates a MutableRef with ref change callback - * @param initialValue - initial ref value - * @param {Function} callback - a callback to run when value changes + * Unique directive names per location * - * @example - * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue); - * ref.current = 1; - * // prints 0 -> 1 + * A GraphQL document is only valid if all non-repeatable directives at + * a given location are uniquely named. * - * @see https://reactjs.org/docs/hooks-reference.html#useref - * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref - * @returns {MutableRefObject} + * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location */ -function useCallbackRef(initialValue, callback) { - var ref = (0, _react.useState)(function () { - return { - // value - value: initialValue, - // last callback - callback: callback, - // "memoized" public interface - facade: { - get current() { - return ref.value; - }, - set current(value) { - var last = ref.value; - if (last !== value) { - ref.value = value; - ref.callback(value, last); +function UniqueDirectivesPerLocationRule(context) { + const uniqueDirectiveMap = Object.create(null); + const schema = context.getSchema(); + const definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; + for (const directive of definedDirectives) { + uniqueDirectiveMap[directive.name] = !directive.isRepeatable; + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + uniqueDirectiveMap[def.name.value] = !def.repeatable; + } + } + const schemaDirectives = Object.create(null); + const typeDirectivesMap = Object.create(null); + return { + // Many different AST nodes may contain directives. Rather than listing + // them all, just listen for entering any node, and check to see if it + // defines any directives. + enter(node) { + if (!('directives' in node) || !node.directives) { + return; + } + let seenDirectives; + if (node.kind === _kinds.Kind.SCHEMA_DEFINITION || node.kind === _kinds.Kind.SCHEMA_EXTENSION) { + seenDirectives = schemaDirectives; + } else if ((0, _predicates.isTypeDefinitionNode)(node) || (0, _predicates.isTypeExtensionNode)(node)) { + const typeName = node.name.value; + seenDirectives = typeDirectivesMap[typeName]; + if (seenDirectives === undefined) { + typeDirectivesMap[typeName] = seenDirectives = Object.create(null); + } + } else { + seenDirectives = Object.create(null); + } + for (const directive of node.directives) { + const directiveName = directive.name.value; + if (uniqueDirectiveMap[directiveName]) { + if (seenDirectives[directiveName]) { + context.reportError(new _GraphQLError.GraphQLError(`The directive "@${directiveName}" can only be used once at this location.`, { + nodes: [seenDirectives[directiveName], directive] + })); + } else { + seenDirectives[directiveName] = directive; } } } - }; - })[0]; - // update callback - ref.callback = callback; - return ref.facade; + } + }; } /***/ }), -/***/ "../../../node_modules/use-callback-ref/dist/es2015/useTransformRef.js": -/*!*****************************************************************************!*\ - !*** ../../../node_modules/use-callback-ref/dist/es2015/useTransformRef.js ***! - \*****************************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs": +/*!***********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs ***! + \***********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.useTransformRef = useTransformRef; -var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); -var _useRef = __webpack_require__(/*! ./useRef */ "../../../node_modules/use-callback-ref/dist/es2015/useRef.js"); +exports.UniqueEnumValueNamesRule = UniqueEnumValueNamesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); /** - * Create a _lense_ on Ref, making it possible to transform ref value - * @param {ReactRef} ref - * @param {Function} transformer. 👉 Ref would be __NOT updated__ on `transformer` update. - * @returns {RefObject} - * - * @see https://github.com/theKashey/use-callback-ref#usetransformref-to-replace-reactuseimperativehandle - * @example + * Unique enum value names * - * const ResizableWithRef = forwardRef((props, ref) => - * i ? i.resizable : null)}/> - * ); + * A GraphQL enum type is only valid if all its values are uniquely named. */ -function useTransformRef(ref, transformer) { - return (0, _useRef.useCallbackRef)(null, function (value) { - return (0, _assignRef.assignRef)(ref, transformer(value)); - }); +function UniqueEnumValueNamesRule(context) { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownValueNames = Object.create(null); + return { + EnumTypeDefinition: checkValueUniqueness, + EnumTypeExtension: checkValueUniqueness + }; + function checkValueUniqueness(node) { + var _node$values; + const typeName = node.name.value; + if (!knownValueNames[typeName]) { + knownValueNames[typeName] = Object.create(null); + } // FIXME: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + + const valueNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : []; + const valueNames = knownValueNames[typeName]; + for (const valueDef of valueNodes) { + const valueName = valueDef.name.value; + const existingType = existingTypeMap[typeName]; + if ((0, _definition.isEnumType)(existingType) && existingType.getValue(valueName)) { + context.reportError(new _GraphQLError.GraphQLError(`Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`, { + nodes: valueDef.name + })); + } else if (valueNames[valueName]) { + context.reportError(new _GraphQLError.GraphQLError(`Enum value "${typeName}.${valueName}" can only be defined once.`, { + nodes: [valueNames[valueName], valueDef.name] + })); + } else { + valueNames[valueName] = valueDef.name; + } + } + return false; + } } /***/ }), -/***/ "../../../node_modules/use-sidecar/dist/es2015/config.js": -/*!***************************************************************!*\ - !*** ../../../node_modules/use-sidecar/dist/es2015/config.js ***! - \***************************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs": +/*!*****************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs ***! + \*****************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConfig = exports.config = void 0; -var config = exports.config = { - onError: function (e) { - return console.error(e); +exports.UniqueFieldDefinitionNamesRule = UniqueFieldDefinitionNamesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +/** + * Unique field definition names + * + * A GraphQL complex type is only valid if all its fields are uniquely named. + */ +function UniqueFieldDefinitionNamesRule(context) { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownFieldNames = Object.create(null); + return { + InputObjectTypeDefinition: checkFieldUniqueness, + InputObjectTypeExtension: checkFieldUniqueness, + InterfaceTypeDefinition: checkFieldUniqueness, + InterfaceTypeExtension: checkFieldUniqueness, + ObjectTypeDefinition: checkFieldUniqueness, + ObjectTypeExtension: checkFieldUniqueness + }; + function checkFieldUniqueness(node) { + var _node$fields; + const typeName = node.name.value; + if (!knownFieldNames[typeName]) { + knownFieldNames[typeName] = Object.create(null); + } // FIXME: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + + const fieldNodes = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : []; + const fieldNames = knownFieldNames[typeName]; + for (const fieldDef of fieldNodes) { + const fieldName = fieldDef.name.value; + if (hasField(existingTypeMap[typeName], fieldName)) { + context.reportError(new _GraphQLError.GraphQLError(`Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`, { + nodes: fieldDef.name + })); + } else if (fieldNames[fieldName]) { + context.reportError(new _GraphQLError.GraphQLError(`Field "${typeName}.${fieldName}" can only be defined once.`, { + nodes: [fieldNames[fieldName], fieldDef.name] + })); + } else { + fieldNames[fieldName] = fieldDef.name; + } + } + return false; } -}; -var setConfig = function (conf) { - Object.assign(config, conf); -}; -exports.setConfig = setConfig; +} +function hasField(type, fieldName) { + if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type) || (0, _definition.isInputObjectType)(type)) { + return type.getFields()[fieldName] != null; + } + return false; +} /***/ }), -/***/ "../../../node_modules/use-sidecar/dist/es2015/env.js": -/*!************************************************************!*\ - !*** ../../../node_modules/use-sidecar/dist/es2015/env.js ***! - \************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs": +/*!**********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs ***! + \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.env = void 0; -var _detectNodeEs = __webpack_require__(/*! detect-node-es */ "../../../node_modules/detect-node-es/esm/browser.js"); -var env = exports.env = { - isNode: _detectNodeEs.isNode, - forceCache: false -}; +exports.UniqueFragmentNamesRule = UniqueFragmentNamesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Unique fragment names + * + * A GraphQL document is only valid if all defined fragments have unique names. + * + * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness + */ +function UniqueFragmentNamesRule(context) { + const knownFragmentNames = Object.create(null); + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + const fragmentName = node.name.value; + if (knownFragmentNames[fragmentName]) { + context.reportError(new _GraphQLError.GraphQLError(`There can be only one fragment named "${fragmentName}".`, { + nodes: [knownFragmentNames[fragmentName], node.name] + })); + } else { + knownFragmentNames[fragmentName] = node.name; + } + return false; + } + }; +} /***/ }), -/***/ "../../../node_modules/use-sidecar/dist/es2015/exports.js": -/*!****************************************************************!*\ - !*** ../../../node_modules/use-sidecar/dist/es2015/exports.js ***! - \****************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs": +/*!************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs ***! + \************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.exportSidecar = exportSidecar; -var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); -function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } -var SideCar = function (_a) { - var sideCar = _a.sideCar, - rest = (0, _tslib.__rest)(_a, ["sideCar"]); - if (!sideCar) { - throw new Error('Sidecar: please provide `sideCar` property to import the right car'); - } - var Target = sideCar.read(); - if (!Target) { - throw new Error('Sidecar medium not found'); - } - return /*#__PURE__*/React.createElement(Target, (0, _tslib.__assign)({}, rest)); -}; -SideCar.isSideCarExport = true; -function exportSidecar(medium, exported) { - medium.useMedium(exported); - return SideCar; +exports.UniqueInputFieldNamesRule = UniqueInputFieldNamesRule; +var _invariant = __webpack_require__(/*! ../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Unique input field names + * + * A GraphQL input object value is only valid if all supplied fields are + * uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness + */ +function UniqueInputFieldNamesRule(context) { + const knownNameStack = []; + let knownNames = Object.create(null); + return { + ObjectValue: { + enter() { + knownNameStack.push(knownNames); + knownNames = Object.create(null); + }, + leave() { + const prevKnownNames = knownNameStack.pop(); + prevKnownNames || (0, _invariant.invariant)(false); + knownNames = prevKnownNames; + } + }, + ObjectField(node) { + const fieldName = node.name.value; + if (knownNames[fieldName]) { + context.reportError(new _GraphQLError.GraphQLError(`There can be only one input field named "${fieldName}".`, { + nodes: [knownNames[fieldName], node.name] + })); + } else { + knownNames[fieldName] = node.name; + } + } + }; } /***/ }), -/***/ "../../../node_modules/use-sidecar/dist/es2015/hoc.js": -/*!************************************************************!*\ - !*** ../../../node_modules/use-sidecar/dist/es2015/hoc.js ***! - \************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs": +/*!***********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs ***! + \***********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sidecar = sidecar; -var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); -var _hook = __webpack_require__(/*! ./hook */ "../../../node_modules/use-sidecar/dist/es2015/hook.js"); -function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } -// eslint-disable-next-line @typescript-eslint/ban-types -function sidecar(importer, errorComponent) { - var ErrorCase = function () { - return errorComponent; - }; - return function Sidecar(props) { - var _a = (0, _hook.useSidecar)(importer, props.sideCar), - Car = _a[0], - error = _a[1]; - if (error && errorComponent) { - return ErrorCase; - } - // @ts-expect-error type shenanigans - return Car ? /*#__PURE__*/React.createElement(Car, (0, _tslib.__assign)({}, props)) : null; +exports.UniqueOperationNamesRule = UniqueOperationNamesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Unique operation names + * + * A GraphQL document is only valid if all defined operations have unique names. + * + * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness + */ +function UniqueOperationNamesRule(context) { + const knownOperationNames = Object.create(null); + return { + OperationDefinition(node) { + const operationName = node.name; + if (operationName) { + if (knownOperationNames[operationName.value]) { + context.reportError(new _GraphQLError.GraphQLError(`There can be only one operation named "${operationName.value}".`, { + nodes: [knownOperationNames[operationName.value], operationName] + })); + } else { + knownOperationNames[operationName.value] = operationName; + } + } + return false; + }, + FragmentDefinition: () => false }; } /***/ }), -/***/ "../../../node_modules/use-sidecar/dist/es2015/hook.js": -/*!*************************************************************!*\ - !*** ../../../node_modules/use-sidecar/dist/es2015/hook.js ***! - \*************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs": +/*!***********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs ***! + \***********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.useSidecar = useSidecar; -var _react = __webpack_require__(/*! react */ "react"); -var _env = __webpack_require__(/*! ./env */ "../../../node_modules/use-sidecar/dist/es2015/env.js"); -var cache = new WeakMap(); -var NO_OPTIONS = {}; -function useSidecar(importer, effect) { - var options = effect && effect.options || NO_OPTIONS; - if (_env.env.isNode && !options.ssr) { - return [null, null]; - } - // eslint-disable-next-line react-hooks/rules-of-hooks - return useRealSidecar(importer, effect); -} -function useRealSidecar(importer, effect) { - var options = effect && effect.options || NO_OPTIONS; - var couldUseCache = _env.env.forceCache || _env.env.isNode && !!options.ssr || !options.async; - var _a = (0, _react.useState)(couldUseCache ? function () { - return cache.get(importer); - } : undefined), - Car = _a[0], - setCar = _a[1]; - var _b = (0, _react.useState)(null), - error = _b[0], - setError = _b[1]; - (0, _react.useEffect)(function () { - if (!Car) { - importer().then(function (car) { - var resolved = effect ? effect.read() : car.default || car; - if (!resolved) { - console.error('Sidecar error: with importer', importer); - var error_1; - if (effect) { - console.error('Sidecar error: with medium', effect); - error_1 = new Error('Sidecar medium was not found'); - } else { - error_1 = new Error('Sidecar was not found in exports'); - } - setError(function () { - return error_1; - }); - throw error_1; - } - cache.set(importer, resolved); - setCar(function () { - return resolved; - }); - }, function (e) { - return setError(function () { - return e; - }); - }); +exports.UniqueOperationTypesRule = UniqueOperationTypesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Unique operation types + * + * A GraphQL document is only valid if it has only one type per operation. + */ +function UniqueOperationTypesRule(context) { + const schema = context.getSchema(); + const definedOperationTypes = Object.create(null); + const existingOperationTypes = schema ? { + query: schema.getQueryType(), + mutation: schema.getMutationType(), + subscription: schema.getSubscriptionType() + } : {}; + return { + SchemaDefinition: checkOperationTypes, + SchemaExtension: checkOperationTypes + }; + function checkOperationTypes(node) { + var _node$operationTypes; + + // See: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + const operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : []; + for (const operationType of operationTypesNodes) { + const operation = operationType.operation; + const alreadyDefinedOperationType = definedOperationTypes[operation]; + if (existingOperationTypes[operation]) { + context.reportError(new _GraphQLError.GraphQLError(`Type for ${operation} already defined in the schema. It cannot be redefined.`, { + nodes: operationType + })); + } else if (alreadyDefinedOperationType) { + context.reportError(new _GraphQLError.GraphQLError(`There can be only one ${operation} type in schema.`, { + nodes: [alreadyDefinedOperationType, operationType] + })); + } else { + definedOperationTypes[operation] = operationType; + } } - }, []); - return [Car, error]; + return false; + } } /***/ }), -/***/ "../../../node_modules/use-sidecar/dist/es2015/index.js": -/*!**************************************************************!*\ - !*** ../../../node_modules/use-sidecar/dist/es2015/index.js ***! - \**************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs": +/*!******************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs ***! + \******************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -Object.defineProperty(exports, "createMedium", ({ - enumerable: true, - get: function () { - return _medium.createMedium; - } -})); -Object.defineProperty(exports, "createSidecarMedium", ({ - enumerable: true, - get: function () { - return _medium.createSidecarMedium; - } -})); -Object.defineProperty(exports, "exportSidecar", ({ - enumerable: true, - get: function () { - return _exports.exportSidecar; - } -})); -Object.defineProperty(exports, "renderCar", ({ - enumerable: true, - get: function () { - return _renderProp.renderCar; - } -})); -Object.defineProperty(exports, "setConfig", ({ - enumerable: true, - get: function () { - return _config.setConfig; - } -})); -Object.defineProperty(exports, "sidecar", ({ - enumerable: true, - get: function () { - return _hoc.sidecar; - } -})); -Object.defineProperty(exports, "useSidecar", ({ - enumerable: true, - get: function () { - return _hook.useSidecar; +exports.UniqueTypeNamesRule = UniqueTypeNamesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Unique type names + * + * A GraphQL document is only valid if all defined types have unique names. + */ +function UniqueTypeNamesRule(context) { + const knownTypeNames = Object.create(null); + const schema = context.getSchema(); + return { + ScalarTypeDefinition: checkTypeName, + ObjectTypeDefinition: checkTypeName, + InterfaceTypeDefinition: checkTypeName, + UnionTypeDefinition: checkTypeName, + EnumTypeDefinition: checkTypeName, + InputObjectTypeDefinition: checkTypeName + }; + function checkTypeName(node) { + const typeName = node.name.value; + if (schema !== null && schema !== void 0 && schema.getType(typeName)) { + context.reportError(new _GraphQLError.GraphQLError(`Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`, { + nodes: node.name + })); + return; + } + if (knownTypeNames[typeName]) { + context.reportError(new _GraphQLError.GraphQLError(`There can be only one type named "${typeName}".`, { + nodes: [knownTypeNames[typeName], node.name] + })); + } else { + knownTypeNames[typeName] = node.name; + } + return false; } -})); -var _hoc = __webpack_require__(/*! ./hoc */ "../../../node_modules/use-sidecar/dist/es2015/hoc.js"); -var _hook = __webpack_require__(/*! ./hook */ "../../../node_modules/use-sidecar/dist/es2015/hook.js"); -var _config = __webpack_require__(/*! ./config */ "../../../node_modules/use-sidecar/dist/es2015/config.js"); -var _medium = __webpack_require__(/*! ./medium */ "../../../node_modules/use-sidecar/dist/es2015/medium.js"); -var _renderProp = __webpack_require__(/*! ./renderProp */ "../../../node_modules/use-sidecar/dist/es2015/renderProp.js"); -var _exports = __webpack_require__(/*! ./exports */ "../../../node_modules/use-sidecar/dist/es2015/exports.js"); +} /***/ }), -/***/ "../../../node_modules/use-sidecar/dist/es2015/medium.js": -/*!***************************************************************!*\ - !*** ../../../node_modules/use-sidecar/dist/es2015/medium.js ***! - \***************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs": +/*!**********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs ***! + \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createMedium = createMedium; -exports.createSidecarMedium = createSidecarMedium; -var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); -function ItoI(a) { - return a; -} -function innerCreateMedium(defaults, middleware) { - if (middleware === void 0) { - middleware = ItoI; - } - var buffer = []; - var assigned = false; - var medium = { - read: function () { - if (assigned) { - throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.'); +exports.UniqueVariableNamesRule = UniqueVariableNamesRule; +var _groupBy = __webpack_require__(/*! ../../jsutils/groupBy.mjs */ "../../../node_modules/graphql/jsutils/groupBy.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +/** + * Unique variable names + * + * A GraphQL operation is only valid if all its variables are uniquely named. + */ +function UniqueVariableNamesRule(context) { + return { + OperationDefinition(operationNode) { + var _operationNode$variab; + + // See: https://github.com/graphql/graphql-js/issues/2203 + + /* c8 ignore next */ + const variableDefinitions = (_operationNode$variab = operationNode.variableDefinitions) !== null && _operationNode$variab !== void 0 ? _operationNode$variab : []; + const seenVariableDefinitions = (0, _groupBy.groupBy)(variableDefinitions, node => node.variable.name.value); + for (const [variableName, variableNodes] of seenVariableDefinitions) { + if (variableNodes.length > 1) { + context.reportError(new _GraphQLError.GraphQLError(`There can be only one variable named "$${variableName}".`, { + nodes: variableNodes.map(node => node.variable.name) + })); + } } - if (buffer.length) { - return buffer[buffer.length - 1]; + } + }; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs": +/*!**********************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs ***! + \**********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ValuesOfCorrectTypeRule = ValuesOfCorrectTypeRule; +var _didYouMean = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); +var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _keyMap = __webpack_require__(/*! ../../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); +var _suggestionList = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + * + * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type + */ +function ValuesOfCorrectTypeRule(context) { + let variableDefinitions = {}; + return { + OperationDefinition: { + enter() { + variableDefinitions = {}; } - return defaults; }, - useMedium: function (data) { - var item = middleware(data, assigned); - buffer.push(item); - return function () { - buffer = buffer.filter(function (x) { - return x !== item; - }); - }; + VariableDefinition(definition) { + variableDefinitions[definition.variable.name.value] = definition; }, - assignSyncMedium: function (cb) { - assigned = true; - while (buffer.length) { - var cbs = buffer; - buffer = []; - cbs.forEach(cb); + ListValue(node) { + // Note: TypeInfo will traverse into a list's item type, so look to the + // parent input type to check if it is a list. + const type = (0, _definition.getNullableType)(context.getParentInputType()); + if (!(0, _definition.isListType)(type)) { + isValidValueNode(context, node); + return false; // Don't traverse further. } - buffer = { - push: function (x) { - return cb(x); - }, - filter: function () { - return buffer; + }, + ObjectValue(node) { + const type = (0, _definition.getNamedType)(context.getInputType()); + if (!(0, _definition.isInputObjectType)(type)) { + isValidValueNode(context, node); + return false; // Don't traverse further. + } // Ensure every required field exists. + + const fieldNodeMap = (0, _keyMap.keyMap)(node.fields, field => field.name.value); + for (const fieldDef of Object.values(type.getFields())) { + const fieldNode = fieldNodeMap[fieldDef.name]; + if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) { + const typeStr = (0, _inspect.inspect)(fieldDef.type); + context.reportError(new _GraphQLError.GraphQLError(`Field "${type.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.`, { + nodes: node + })); } - }; + } + if (type.isOneOf) { + validateOneOfInputObject(context, node, type, fieldNodeMap, variableDefinitions); + } }, - assignMedium: function (cb) { - assigned = true; - var pendingQueue = []; - if (buffer.length) { - var cbs = buffer; - buffer = []; - cbs.forEach(cb); - pendingQueue = buffer; + ObjectField(node) { + const parentType = (0, _definition.getNamedType)(context.getParentInputType()); + const fieldType = context.getInputType(); + if (!fieldType && (0, _definition.isInputObjectType)(parentType)) { + const suggestions = (0, _suggestionList.suggestionList)(node.name.value, Object.keys(parentType.getFields())); + context.reportError(new _GraphQLError.GraphQLError(`Field "${node.name.value}" is not defined by type "${parentType.name}".` + (0, _didYouMean.didYouMean)(suggestions), { + nodes: node + })); } - var executeQueue = function () { - var cbs = pendingQueue; - pendingQueue = []; - cbs.forEach(cb); - }; - var cycle = function () { - return Promise.resolve().then(executeQueue); - }; - cycle(); - buffer = { - push: function (x) { - pendingQueue.push(x); - cycle(); - }, - filter: function (filter) { - pendingQueue = pendingQueue.filter(filter); - return buffer; - } - }; - } + }, + NullValue(node) { + const type = context.getInputType(); + if ((0, _definition.isNonNullType)(type)) { + context.reportError(new _GraphQLError.GraphQLError(`Expected value of type "${(0, _inspect.inspect)(type)}", found ${(0, _printer.print)(node)}.`, { + nodes: node + })); + } + }, + EnumValue: node => isValidValueNode(context, node), + IntValue: node => isValidValueNode(context, node), + FloatValue: node => isValidValueNode(context, node), + StringValue: node => isValidValueNode(context, node), + BooleanValue: node => isValidValueNode(context, node) }; - return medium; } -function createMedium(defaults, middleware) { - if (middleware === void 0) { - middleware = ItoI; +/** + * Any value literal may be a valid representation of a Scalar, depending on + * that scalar type. + */ + +function isValidValueNode(context, node) { + // Report any error at the full type expected by the location. + const locationType = context.getInputType(); + if (!locationType) { + return; + } + const type = (0, _definition.getNamedType)(locationType); + if (!(0, _definition.isLeafType)(type)) { + const typeStr = (0, _inspect.inspect)(locationType); + context.reportError(new _GraphQLError.GraphQLError(`Expected value of type "${typeStr}", found ${(0, _printer.print)(node)}.`, { + nodes: node + })); + return; + } // Scalars and Enums determine if a literal value is valid via parseLiteral(), + // which may throw or return an invalid value to indicate failure. + + try { + const parseResult = type.parseLiteral(node, undefined + /* variables */); + if (parseResult === undefined) { + const typeStr = (0, _inspect.inspect)(locationType); + context.reportError(new _GraphQLError.GraphQLError(`Expected value of type "${typeStr}", found ${(0, _printer.print)(node)}.`, { + nodes: node + })); + } + } catch (error) { + const typeStr = (0, _inspect.inspect)(locationType); + if (error instanceof _GraphQLError.GraphQLError) { + context.reportError(error); + } else { + context.reportError(new _GraphQLError.GraphQLError(`Expected value of type "${typeStr}", found ${(0, _printer.print)(node)}; ` + error.message, { + nodes: node, + originalError: error + })); + } } - return innerCreateMedium(defaults, middleware); } -// eslint-disable-next-line @typescript-eslint/ban-types -function createSidecarMedium(options) { - if (options === void 0) { - options = {}; +function validateOneOfInputObject(context, node, type, fieldNodeMap, variableDefinitions) { + var _fieldNodeMap$keys$; + const keys = Object.keys(fieldNodeMap); + const isNotExactlyOneField = keys.length !== 1; + if (isNotExactlyOneField) { + context.reportError(new _GraphQLError.GraphQLError(`OneOf Input Object "${type.name}" must specify exactly one key.`, { + nodes: [node] + })); + return; + } + const value = (_fieldNodeMap$keys$ = fieldNodeMap[keys[0]]) === null || _fieldNodeMap$keys$ === void 0 ? void 0 : _fieldNodeMap$keys$.value; + const isNullLiteral = !value || value.kind === _kinds.Kind.NULL; + const isVariable = (value === null || value === void 0 ? void 0 : value.kind) === _kinds.Kind.VARIABLE; + if (isNullLiteral) { + context.reportError(new _GraphQLError.GraphQLError(`Field "${type.name}.${keys[0]}" must be non-null.`, { + nodes: [node] + })); + return; + } + if (isVariable) { + const variableName = value.name.value; + const definition = variableDefinitions[variableName]; + const isNullableVariable = definition.type.kind !== _kinds.Kind.NON_NULL_TYPE; + if (isNullableVariable) { + context.reportError(new _GraphQLError.GraphQLError(`Variable "${variableName}" must be non-nullable to be used for OneOf Input Object "${type.name}".`, { + nodes: [node] + })); + } } - var medium = innerCreateMedium(null); - medium.options = (0, _tslib.__assign)({ - async: true, - ssr: false - }, options); - return medium; } /***/ }), -/***/ "../../../node_modules/use-sidecar/dist/es2015/renderProp.js": -/*!*******************************************************************!*\ - !*** ../../../node_modules/use-sidecar/dist/es2015/renderProp.js ***! - \*******************************************************************/ +/***/ "../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs": +/*!*************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs ***! + \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.renderCar = renderCar; -var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); -var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); -var React = _react; -function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } -function renderCar(WrappedComponent, defaults) { - function State(_a) { - var stateRef = _a.stateRef, - props = _a.props; - var renderTarget = (0, _react.useCallback)(function SideTarget() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; +exports.VariablesAreInputTypesRule = VariablesAreInputTypesRule; +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _printer = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); +/** + * Variables are input types + * + * A GraphQL operation is only valid if all the variables it defines are of + * input types (scalar, enum, or input object). + * + * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types + */ +function VariablesAreInputTypesRule(context) { + return { + VariableDefinition(node) { + const type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type); + if (type !== undefined && !(0, _definition.isInputType)(type)) { + const variableName = node.variable.name.value; + const typeName = (0, _printer.print)(node.type); + context.reportError(new _GraphQLError.GraphQLError(`Variable "$${variableName}" cannot be non-input type "${typeName}".`, { + nodes: node.type + })); } - (0, _react.useLayoutEffect)(function () { - stateRef.current(args); - }); - return null; - }, []); - // @ts-ignore - return /*#__PURE__*/React.createElement(WrappedComponent, (0, _tslib.__assign)({}, props, { - children: renderTarget - })); - } - var Children = /*#__PURE__*/React.memo(function (_a) { - var stateRef = _a.stateRef, - defaultState = _a.defaultState, - children = _a.children; - var _b = (0, _react.useState)(defaultState.current), - state = _b[0], - setState = _b[1]; - (0, _react.useEffect)(function () { - stateRef.current = setState; - }, []); - return children.apply(void 0, state); - }, function () { - return true; - }); - return function Combiner(props) { - var defaultState = React.useRef(defaults(props)); - var ref = React.useRef(function (state) { - return defaultState.current = state; - }); - return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(State, { - stateRef: ref, - props: props - }), /*#__PURE__*/React.createElement(Children, { - stateRef: ref, - defaultState: defaultState, - children: props.children - })); + } }; } /***/ }), -/***/ "../../../node_modules/vscode-languageserver-types/lib/esm/main.js": -/*!*************************************************************************!*\ - !*** ../../../node_modules/vscode-languageserver-types/lib/esm/main.js ***! - \*************************************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs": +/*!*****************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs ***! + \*****************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.uinteger = exports.integer = exports.WorkspaceSymbol = exports.WorkspaceFolder = exports.WorkspaceEdit = exports.WorkspaceChange = exports.VersionedTextDocumentIdentifier = exports.URI = exports.TextEdit = exports.TextDocumentItem = exports.TextDocumentIdentifier = exports.TextDocumentEdit = exports.TextDocument = exports.SymbolTag = exports.SymbolKind = exports.SymbolInformation = exports.SignatureInformation = exports.SemanticTokens = exports.SemanticTokenTypes = exports.SemanticTokenModifiers = exports.SelectionRange = exports.RenameFile = exports.Range = exports.Position = exports.ParameterInformation = exports.OptionalVersionedTextDocumentIdentifier = exports.MarkupKind = exports.MarkupContent = exports.MarkedString = exports.LocationLink = exports.Location = exports.InsertTextMode = exports.InsertTextFormat = exports.InsertReplaceEdit = exports.InlineValueVariableLookup = exports.InlineValueText = exports.InlineValueEvaluatableExpression = exports.InlineValueContext = exports.InlayHintLabelPart = exports.InlayHintKind = exports.InlayHint = exports.Hover = exports.FormattingOptions = exports.FoldingRangeKind = exports.FoldingRange = exports.EOL = exports.DocumentUri = exports.DocumentSymbol = exports.DocumentLink = exports.DocumentHighlightKind = exports.DocumentHighlight = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.Diagnostic = exports.DeleteFile = exports.CreateFile = exports.CompletionList = exports.CompletionItemTag = exports.CompletionItemLabelDetails = exports.CompletionItemKind = exports.CompletionItem = exports.Command = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.CodeLens = exports.CodeDescription = exports.CodeActionTriggerKind = exports.CodeActionKind = exports.CodeActionContext = exports.CodeAction = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.AnnotatedTextEdit = void 0; -var DocumentUri; -(function (DocumentUri) { - function is(value) { - return typeof value === 'string'; - } - DocumentUri.is = is; -})(DocumentUri || (exports.DocumentUri = DocumentUri = {})); -var URI; -(function (URI) { - function is(value) { - return typeof value === 'string'; - } - URI.is = is; -})(URI || (exports.URI = URI = {})); -var integer; -(function (integer) { - integer.MIN_VALUE = -2147483648; - integer.MAX_VALUE = 2147483647; - function is(value) { - return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE; - } - integer.is = is; -})(integer || (exports.integer = integer = {})); -var uinteger; -(function (uinteger) { - uinteger.MIN_VALUE = 0; - uinteger.MAX_VALUE = 2147483647; - function is(value) { - return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE; - } - uinteger.is = is; -})(uinteger || (exports.uinteger = uinteger = {})); -/** - * The Position namespace provides helper functions to work with - * {@link Position} literals. - */ -var Position; -(function (Position) { - /** - * Creates a new Position literal from the given line and character. - * @param line The position's line. - * @param character The position's character. - */ - function create(line, character) { - if (line === Number.MAX_VALUE) { - line = uinteger.MAX_VALUE; - } - if (character === Number.MAX_VALUE) { - character = uinteger.MAX_VALUE; - } - return { - line: line, - character: character - }; - } - Position.create = create; - /** - * Checks whether the given literal conforms to the {@link Position} interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character); - } - Position.is = is; -})(Position || (exports.Position = Position = {})); +exports.VariablesInAllowedPositionRule = VariablesInAllowedPositionRule; +var _inspect = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _kinds = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); +var _definition = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _typeComparators = __webpack_require__(/*! ../../utilities/typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); +var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); /** - * The Range namespace provides helper functions to work with - * {@link Range} literals. + * Variables in allowed position + * + * Variable usages must be compatible with the arguments they are passed to. + * + * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed */ -var Range; -(function (Range) { - function create(one, two, three, four) { - if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) { - return { - start: Position.create(one, two), - end: Position.create(three, four) - }; - } else if (Position.is(one) && Position.is(two)) { - return { - start: one, - end: two - }; - } else { - throw new Error("Range#create called with invalid arguments[".concat(one, ", ").concat(two, ", ").concat(three, ", ").concat(four, "]")); +function VariablesInAllowedPositionRule(context) { + let varDefMap = Object.create(null); + return { + OperationDefinition: { + enter() { + varDefMap = Object.create(null); + }, + leave(operation) { + const usages = context.getRecursiveVariableUsages(operation); + for (const { + node, + type, + defaultValue + } of usages) { + const varName = node.name.value; + const varDef = varDefMap[varName]; + if (varDef && type) { + // A var type is allowed if it is the same or more strict (e.g. is + // a subtype of) than the expected type. It can be more strict if + // the variable type is non-null when the expected type is nullable. + // If both are list types, the variable item type can be more strict + // than the expected item type (contravariant). + const schema = context.getSchema(); + const varType = (0, _typeFromAST.typeFromAST)(schema, varDef.type); + if (varType && !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) { + const varTypeStr = (0, _inspect.inspect)(varType); + const typeStr = (0, _inspect.inspect)(type); + context.reportError(new _GraphQLError.GraphQLError(`Variable "$${varName}" of type "${varTypeStr}" used in position expecting type "${typeStr}".`, { + nodes: [varDef, node] + })); + } + } + } + } + }, + VariableDefinition(node) { + varDefMap[node.variable.name.value] = node; } - } - Range.create = create; - /** - * Checks whether the given literal conforms to the {@link Range} interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); - } - Range.is = is; -})(Range || (exports.Range = Range = {})); + }; +} /** - * The Location namespace provides helper functions to work with - * {@link Location} literals. + * Returns true if the variable is allowed in the location it was found, + * which includes considering if default values exist for either the variable + * or the location at which it is located. */ -var Location; -(function (Location) { - /** - * Creates a Location literal. - * @param uri The location's uri. - * @param range The location's range. - */ - function create(uri, range) { - return { - uri: uri, - range: range - }; - } - Location.create = create; - /** - * Checks whether the given literal conforms to the {@link Location} interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + +function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) { + if ((0, _definition.isNonNullType)(locationType) && !(0, _definition.isNonNullType)(varType)) { + const hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== _kinds.Kind.NULL; + const hasLocationDefaultValue = locationDefaultValue !== undefined; + if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { + return false; + } + const nullableLocationType = locationType.ofType; + return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, nullableLocationType); } - Location.is = is; -})(Location || (exports.Location = Location = {})); + return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, locationType); +} + +/***/ }), + +/***/ "../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs": +/*!****************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs ***! + \****************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NoDeprecatedCustomRule = NoDeprecatedCustomRule; +var _invariant = __webpack_require__(/*! ../../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); +var _GraphQLError = __webpack_require__(/*! ../../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _definition = __webpack_require__(/*! ../../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); /** - * The LocationLink namespace provides helper functions to work with - * {@link LocationLink} literals. + * No deprecated + * + * A GraphQL document is only valid if all selected fields and all used enum values have not been + * deprecated. + * + * Note: This rule is optional and is not part of the Validation section of the GraphQL + * Specification. The main purpose of this rule is detection of deprecated usages and not + * necessarily to forbid their use when querying a service. */ -var LocationLink; -(function (LocationLink) { - /** - * Creates a LocationLink literal. - * @param targetUri The definition's uri. - * @param targetRange The full range of the definition. - * @param targetSelectionRange The span of the symbol definition at the target. - * @param originSelectionRange The span of the symbol being defined in the originating source file. - */ - function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { - return { - targetUri: targetUri, - targetRange: targetRange, - targetSelectionRange: targetSelectionRange, - originSelectionRange: originSelectionRange - }; - } - LocationLink.create = create; - /** - * Checks whether the given literal conforms to the {@link LocationLink} interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); - } - LocationLink.is = is; -})(LocationLink || (exports.LocationLink = LocationLink = {})); +function NoDeprecatedCustomRule(context) { + return { + Field(node) { + const fieldDef = context.getFieldDef(); + const deprecationReason = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.deprecationReason; + if (fieldDef && deprecationReason != null) { + const parentType = context.getParentType(); + parentType != null || (0, _invariant.invariant)(false); + context.reportError(new _GraphQLError.GraphQLError(`The field ${parentType.name}.${fieldDef.name} is deprecated. ${deprecationReason}`, { + nodes: node + })); + } + }, + Argument(node) { + const argDef = context.getArgument(); + const deprecationReason = argDef === null || argDef === void 0 ? void 0 : argDef.deprecationReason; + if (argDef && deprecationReason != null) { + const directiveDef = context.getDirective(); + if (directiveDef != null) { + context.reportError(new _GraphQLError.GraphQLError(`Directive "@${directiveDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, { + nodes: node + })); + } else { + const parentType = context.getParentType(); + const fieldDef = context.getFieldDef(); + parentType != null && fieldDef != null || (0, _invariant.invariant)(false); + context.reportError(new _GraphQLError.GraphQLError(`Field "${parentType.name}.${fieldDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, { + nodes: node + })); + } + } + }, + ObjectField(node) { + const inputObjectDef = (0, _definition.getNamedType)(context.getParentInputType()); + if ((0, _definition.isInputObjectType)(inputObjectDef)) { + const inputFieldDef = inputObjectDef.getFields()[node.name.value]; + const deprecationReason = inputFieldDef === null || inputFieldDef === void 0 ? void 0 : inputFieldDef.deprecationReason; + if (deprecationReason != null) { + context.reportError(new _GraphQLError.GraphQLError(`The input field ${inputObjectDef.name}.${inputFieldDef.name} is deprecated. ${deprecationReason}`, { + nodes: node + })); + } + } + }, + EnumValue(node) { + const enumValueDef = context.getEnumValue(); + const deprecationReason = enumValueDef === null || enumValueDef === void 0 ? void 0 : enumValueDef.deprecationReason; + if (enumValueDef && deprecationReason != null) { + const enumTypeDef = (0, _definition.getNamedType)(context.getInputType()); + enumTypeDef != null || (0, _invariant.invariant)(false); + context.reportError(new _GraphQLError.GraphQLError(`The enum value "${enumTypeDef.name}.${enumValueDef.name}" is deprecated. ${deprecationReason}`, { + nodes: node + })); + } + } + }; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs": +/*!*************************************************************************************************!*\ + !*** ../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs ***! + \*************************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NoSchemaIntrospectionCustomRule = NoSchemaIntrospectionCustomRule; +var _GraphQLError = __webpack_require__(/*! ../../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _definition = __webpack_require__(/*! ../../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); +var _introspection = __webpack_require__(/*! ../../../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); /** - * The Color namespace provides helper functions to work with - * {@link Color} literals. + * Prohibit introspection queries + * + * A GraphQL document is only valid if all fields selected are not fields that + * return an introspection type. + * + * Note: This rule is optional and is not part of the Validation section of the + * GraphQL Specification. This rule effectively disables introspection, which + * does not reflect best practices and should only be done if absolutely necessary. */ -var Color; -(function (Color) { - /** - * Creates a new Color literal. - */ - function create(red, green, blue, alpha) { - return { - red: red, - green: green, - blue: blue, - alpha: alpha - }; - } - Color.create = create; - /** - * Checks whether the given literal conforms to the {@link Color} interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1); - } - Color.is = is; -})(Color || (exports.Color = Color = {})); +function NoSchemaIntrospectionCustomRule(context) { + return { + Field(node) { + const type = (0, _definition.getNamedType)(context.getType()); + if (type && (0, _introspection.isIntrospectionType)(type)) { + context.reportError(new _GraphQLError.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`, { + nodes: node + })); + } + } + }; +} + +/***/ }), + +/***/ "../../../node_modules/graphql/validation/specifiedRules.mjs": +/*!*******************************************************************!*\ + !*** ../../../node_modules/graphql/validation/specifiedRules.mjs ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.specifiedSDLRules = exports.specifiedRules = exports.recommendedRules = void 0; +var _ExecutableDefinitionsRule = __webpack_require__(/*! ./rules/ExecutableDefinitionsRule.mjs */ "../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs"); +var _FieldsOnCorrectTypeRule = __webpack_require__(/*! ./rules/FieldsOnCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs"); +var _FragmentsOnCompositeTypesRule = __webpack_require__(/*! ./rules/FragmentsOnCompositeTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs"); +var _KnownArgumentNamesRule = __webpack_require__(/*! ./rules/KnownArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs"); +var _KnownDirectivesRule = __webpack_require__(/*! ./rules/KnownDirectivesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs"); +var _KnownFragmentNamesRule = __webpack_require__(/*! ./rules/KnownFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs"); +var _KnownTypeNamesRule = __webpack_require__(/*! ./rules/KnownTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs"); +var _LoneAnonymousOperationRule = __webpack_require__(/*! ./rules/LoneAnonymousOperationRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs"); +var _LoneSchemaDefinitionRule = __webpack_require__(/*! ./rules/LoneSchemaDefinitionRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs"); +var _MaxIntrospectionDepthRule = __webpack_require__(/*! ./rules/MaxIntrospectionDepthRule.mjs */ "../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs"); +var _NoFragmentCyclesRule = __webpack_require__(/*! ./rules/NoFragmentCyclesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs"); +var _NoUndefinedVariablesRule = __webpack_require__(/*! ./rules/NoUndefinedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs"); +var _NoUnusedFragmentsRule = __webpack_require__(/*! ./rules/NoUnusedFragmentsRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs"); +var _NoUnusedVariablesRule = __webpack_require__(/*! ./rules/NoUnusedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs"); +var _OverlappingFieldsCanBeMergedRule = __webpack_require__(/*! ./rules/OverlappingFieldsCanBeMergedRule.mjs */ "../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs"); +var _PossibleFragmentSpreadsRule = __webpack_require__(/*! ./rules/PossibleFragmentSpreadsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs"); +var _PossibleTypeExtensionsRule = __webpack_require__(/*! ./rules/PossibleTypeExtensionsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs"); +var _ProvidedRequiredArgumentsRule = __webpack_require__(/*! ./rules/ProvidedRequiredArgumentsRule.mjs */ "../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs"); +var _ScalarLeafsRule = __webpack_require__(/*! ./rules/ScalarLeafsRule.mjs */ "../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs"); +var _SingleFieldSubscriptionsRule = __webpack_require__(/*! ./rules/SingleFieldSubscriptionsRule.mjs */ "../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs"); +var _UniqueArgumentDefinitionNamesRule = __webpack_require__(/*! ./rules/UniqueArgumentDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs"); +var _UniqueArgumentNamesRule = __webpack_require__(/*! ./rules/UniqueArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs"); +var _UniqueDirectiveNamesRule = __webpack_require__(/*! ./rules/UniqueDirectiveNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs"); +var _UniqueDirectivesPerLocationRule = __webpack_require__(/*! ./rules/UniqueDirectivesPerLocationRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs"); +var _UniqueEnumValueNamesRule = __webpack_require__(/*! ./rules/UniqueEnumValueNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs"); +var _UniqueFieldDefinitionNamesRule = __webpack_require__(/*! ./rules/UniqueFieldDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs"); +var _UniqueFragmentNamesRule = __webpack_require__(/*! ./rules/UniqueFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs"); +var _UniqueInputFieldNamesRule = __webpack_require__(/*! ./rules/UniqueInputFieldNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs"); +var _UniqueOperationNamesRule = __webpack_require__(/*! ./rules/UniqueOperationNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs"); +var _UniqueOperationTypesRule = __webpack_require__(/*! ./rules/UniqueOperationTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs"); +var _UniqueTypeNamesRule = __webpack_require__(/*! ./rules/UniqueTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs"); +var _UniqueVariableNamesRule = __webpack_require__(/*! ./rules/UniqueVariableNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs"); +var _ValuesOfCorrectTypeRule = __webpack_require__(/*! ./rules/ValuesOfCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs"); +var _VariablesAreInputTypesRule = __webpack_require__(/*! ./rules/VariablesAreInputTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs"); +var _VariablesInAllowedPositionRule = __webpack_require__(/*! ./rules/VariablesInAllowedPositionRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs"); +// Spec Section: "Executable Definitions" +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" + +// Spec Section: "Fragments on Composite Types" + +// Spec Section: "Argument Names" + +// Spec Section: "Directives Are Defined" + +// Spec Section: "Fragment spread target defined" + +// Spec Section: "Fragment Spread Type Existence" + +// Spec Section: "Lone Anonymous Operation" + +// SDL-specific validation rules + +// TODO: Spec Section + +// Spec Section: "Fragments must not form cycles" + +// Spec Section: "All Variable Used Defined" + +// Spec Section: "Fragments must be used" + +// Spec Section: "All Variables Used" + +// Spec Section: "Field Selection Merging" + +// Spec Section: "Fragment spread is possible" + +// Spec Section: "Argument Optionality" + +// Spec Section: "Leaf Field Selections" + +// Spec Section: "Subscriptions with Single Root Field" + +// Spec Section: "Argument Uniqueness" + +// Spec Section: "Directives Are Unique Per Location" + +// Spec Section: "Fragment Name Uniqueness" + +// Spec Section: "Input Object Field Uniqueness" + +// Spec Section: "Operation Name Uniqueness" + +// Spec Section: "Variable Uniqueness" + +// Spec Section: "Value Type Correctness" + +// Spec Section: "Variables are Input Types" + +// Spec Section: "All Variable Usages Are Allowed" + /** - * The ColorInformation namespace provides helper functions to work with - * {@link ColorInformation} literals. + * Technically these aren't part of the spec but they are strongly encouraged + * validation rules. */ -var ColorInformation; -(function (ColorInformation) { - /** - * Creates a new ColorInformation literal. - */ - function create(range, color) { - return { - range: range, - color: color - }; - } - ColorInformation.create = create; - /** - * Checks whether the given literal conforms to the {@link ColorInformation} interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color); - } - ColorInformation.is = is; -})(ColorInformation || (exports.ColorInformation = ColorInformation = {})); +const recommendedRules = exports.recommendedRules = Object.freeze([_MaxIntrospectionDepthRule.MaxIntrospectionDepthRule]); /** - * The Color namespace provides helper functions to work with - * {@link ColorPresentation} literals. + * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. */ -var ColorPresentation; -(function (ColorPresentation) { - /** - * Creates a new ColorInformation literal. - */ - function create(label, textEdit, additionalTextEdits) { - return { - label: label, - textEdit: textEdit, - additionalTextEdits: additionalTextEdits - }; - } - ColorPresentation.create = create; - /** - * Checks whether the given literal conforms to the {@link ColorInformation} interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); - } - ColorPresentation.is = is; -})(ColorPresentation || (exports.ColorPresentation = ColorPresentation = {})); + +const specifiedRules = exports.specifiedRules = Object.freeze([_ExecutableDefinitionsRule.ExecutableDefinitionsRule, _UniqueOperationNamesRule.UniqueOperationNamesRule, _LoneAnonymousOperationRule.LoneAnonymousOperationRule, _SingleFieldSubscriptionsRule.SingleFieldSubscriptionsRule, _KnownTypeNamesRule.KnownTypeNamesRule, _FragmentsOnCompositeTypesRule.FragmentsOnCompositeTypesRule, _VariablesAreInputTypesRule.VariablesAreInputTypesRule, _ScalarLeafsRule.ScalarLeafsRule, _FieldsOnCorrectTypeRule.FieldsOnCorrectTypeRule, _UniqueFragmentNamesRule.UniqueFragmentNamesRule, _KnownFragmentNamesRule.KnownFragmentNamesRule, _NoUnusedFragmentsRule.NoUnusedFragmentsRule, _PossibleFragmentSpreadsRule.PossibleFragmentSpreadsRule, _NoFragmentCyclesRule.NoFragmentCyclesRule, _UniqueVariableNamesRule.UniqueVariableNamesRule, _NoUndefinedVariablesRule.NoUndefinedVariablesRule, _NoUnusedVariablesRule.NoUnusedVariablesRule, _KnownDirectivesRule.KnownDirectivesRule, _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule, _KnownArgumentNamesRule.KnownArgumentNamesRule, _UniqueArgumentNamesRule.UniqueArgumentNamesRule, _ValuesOfCorrectTypeRule.ValuesOfCorrectTypeRule, _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsRule, _VariablesInAllowedPositionRule.VariablesInAllowedPositionRule, _OverlappingFieldsCanBeMergedRule.OverlappingFieldsCanBeMergedRule, _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule, ...recommendedRules]); /** - * A set of predefined range kinds. + * @internal */ -var FoldingRangeKind; -(function (FoldingRangeKind) { - /** - * Folding range for a comment - */ - FoldingRangeKind.Comment = 'comment'; - /** - * Folding range for an import or include - */ - FoldingRangeKind.Imports = 'imports'; - /** - * Folding range for a region (e.g. `#region`) - */ - FoldingRangeKind.Region = 'region'; -})(FoldingRangeKind || (exports.FoldingRangeKind = FoldingRangeKind = {})); + +const specifiedSDLRules = exports.specifiedSDLRules = Object.freeze([_LoneSchemaDefinitionRule.LoneSchemaDefinitionRule, _UniqueOperationTypesRule.UniqueOperationTypesRule, _UniqueTypeNamesRule.UniqueTypeNamesRule, _UniqueEnumValueNamesRule.UniqueEnumValueNamesRule, _UniqueFieldDefinitionNamesRule.UniqueFieldDefinitionNamesRule, _UniqueArgumentDefinitionNamesRule.UniqueArgumentDefinitionNamesRule, _UniqueDirectiveNamesRule.UniqueDirectiveNamesRule, _KnownTypeNamesRule.KnownTypeNamesRule, _KnownDirectivesRule.KnownDirectivesRule, _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule, _PossibleTypeExtensionsRule.PossibleTypeExtensionsRule, _KnownArgumentNamesRule.KnownArgumentNamesOnDirectivesRule, _UniqueArgumentNamesRule.UniqueArgumentNamesRule, _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule, _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsOnDirectivesRule]); + +/***/ }), + +/***/ "../../../node_modules/graphql/validation/validate.mjs": +/*!*************************************************************!*\ + !*** ../../../node_modules/graphql/validation/validate.mjs ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.assertValidSDL = assertValidSDL; +exports.assertValidSDLExtension = assertValidSDLExtension; +exports.validate = validate; +exports.validateSDL = validateSDL; +var _devAssert = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); +var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); +var _visitor = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); +var _validate = __webpack_require__(/*! ../type/validate.mjs */ "../../../node_modules/graphql/type/validate.mjs"); +var _TypeInfo = __webpack_require__(/*! ../utilities/TypeInfo.mjs */ "../../../node_modules/graphql/utilities/TypeInfo.mjs"); +var _specifiedRules = __webpack_require__(/*! ./specifiedRules.mjs */ "../../../node_modules/graphql/validation/specifiedRules.mjs"); +var _ValidationContext = __webpack_require__(/*! ./ValidationContext.mjs */ "../../../node_modules/graphql/validation/ValidationContext.mjs"); /** - * The folding range namespace provides helper functions to work with - * {@link FoldingRange} literals. + * Implements the "Validation" section of the spec. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the document is valid. + * + * A list of specific validation rules may be provided. If not provided, the + * default list of rules defined by the GraphQL specification will be used. + * + * Each validation rules is a function which returns a visitor + * (see the language/visitor API). Visitor methods are expected to return + * GraphQLErrors, or Arrays of GraphQLErrors when invalid. + * + * Validate will stop validation after a `maxErrors` limit has been reached. + * Attackers can send pathologically invalid queries to induce a DoS attack, + * so by default `maxErrors` set to 100 errors. + * + * Optionally a custom TypeInfo instance may be provided. If not provided, one + * will be created from the provided schema. */ -var FoldingRange; -(function (FoldingRange) { - /** - * Creates a new FoldingRange literal. - */ - function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) { - var result = { - startLine: startLine, - endLine: endLine - }; - if (Is.defined(startCharacter)) { - result.startCharacter = startCharacter; - } - if (Is.defined(endCharacter)) { - result.endCharacter = endCharacter; - } - if (Is.defined(kind)) { - result.kind = kind; + +function validate(schema, documentAST, rules = _specifiedRules.specifiedRules, options, /** @deprecated will be removed in 17.0.0 */ +typeInfo = new _TypeInfo.TypeInfo(schema)) { + var _options$maxErrors; + const maxErrors = (_options$maxErrors = options === null || options === void 0 ? void 0 : options.maxErrors) !== null && _options$maxErrors !== void 0 ? _options$maxErrors : 100; + documentAST || (0, _devAssert.devAssert)(false, 'Must provide document.'); // If the schema used for validation is invalid, throw an error. + + (0, _validate.assertValidSchema)(schema); + const abortObj = Object.freeze({}); + const errors = []; + const context = new _ValidationContext.ValidationContext(schema, documentAST, typeInfo, error => { + if (errors.length >= maxErrors) { + errors.push(new _GraphQLError.GraphQLError('Too many validation errors, error limit reached. Validation aborted.')); // eslint-disable-next-line @typescript-eslint/no-throw-literal + + throw abortObj; } - if (Is.defined(collapsedText)) { - result.collapsedText = collapsedText; + errors.push(error); + }); // This uses a specialized visitor which runs multiple visitors in parallel, + // while maintaining the visitor skip and break API. + + const visitor = (0, _visitor.visitInParallel)(rules.map(rule => rule(context))); // Visit the whole document with each instance of all provided rules. + + try { + (0, _visitor.visit)(documentAST, (0, _TypeInfo.visitWithTypeInfo)(typeInfo, visitor)); + } catch (e) { + if (e !== abortObj) { + throw e; } - return result; - } - FoldingRange.create = create; - /** - * Checks whether the given literal conforms to the {@link FoldingRange} interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); - } - FoldingRange.is = is; -})(FoldingRange || (exports.FoldingRange = FoldingRange = {})); -/** - * The DiagnosticRelatedInformation namespace provides helper functions to work with - * {@link DiagnosticRelatedInformation} literals. - */ -var DiagnosticRelatedInformation; -(function (DiagnosticRelatedInformation) { - /** - * Creates a new DiagnosticRelatedInformation literal. - */ - function create(location, message) { - return { - location: location, - message: message - }; - } - DiagnosticRelatedInformation.create = create; - /** - * Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); } - DiagnosticRelatedInformation.is = is; -})(DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = DiagnosticRelatedInformation = {})); + return errors; +} /** - * The diagnostic's severity. + * @internal */ -var DiagnosticSeverity; -(function (DiagnosticSeverity) { - /** - * Reports an error. - */ - DiagnosticSeverity.Error = 1; - /** - * Reports a warning. - */ - DiagnosticSeverity.Warning = 2; - /** - * Reports an information. - */ - DiagnosticSeverity.Information = 3; - /** - * Reports a hint. - */ - DiagnosticSeverity.Hint = 4; -})(DiagnosticSeverity || (exports.DiagnosticSeverity = DiagnosticSeverity = {})); + +function validateSDL(documentAST, schemaToExtend, rules = _specifiedRules.specifiedSDLRules) { + const errors = []; + const context = new _ValidationContext.SDLValidationContext(documentAST, schemaToExtend, error => { + errors.push(error); + }); + const visitors = rules.map(rule => rule(context)); + (0, _visitor.visit)(documentAST, (0, _visitor.visitInParallel)(visitors)); + return errors; +} /** - * The diagnostic tags. + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. * - * @since 3.15.0 + * @internal */ -var DiagnosticTag; -(function (DiagnosticTag) { - /** - * Unused or unnecessary code. - * - * Clients are allowed to render diagnostics with this tag faded out instead of having - * an error squiggle. - */ - DiagnosticTag.Unnecessary = 1; - /** - * Deprecated or obsolete code. - * - * Clients are allowed to rendered diagnostics with this tag strike through. - */ - DiagnosticTag.Deprecated = 2; -})(DiagnosticTag || (exports.DiagnosticTag = DiagnosticTag = {})); + +function assertValidSDL(documentAST) { + const errors = validateSDL(documentAST); + if (errors.length !== 0) { + throw new Error(errors.map(error => error.message).join('\n\n')); + } +} /** - * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes. + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. * - * @since 3.16.0 + * @internal */ -var CodeDescription; -(function (CodeDescription) { - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.string(candidate.href); + +function assertValidSDLExtension(documentAST, schema) { + const errors = validateSDL(documentAST, schema); + if (errors.length !== 0) { + throw new Error(errors.map(error => error.message).join('\n\n')); } - CodeDescription.is = is; -})(CodeDescription || (exports.CodeDescription = CodeDescription = {})); +} + +/***/ }), + +/***/ "../../../node_modules/graphql/version.mjs": +/*!*************************************************!*\ + !*** ../../../node_modules/graphql/version.mjs ***! + \*************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.versionInfo = exports.version = void 0; +// Note: This file is autogenerated using "resources/gen-version.js" script and +// automatically updated by "npm version" command. + /** - * The Diagnostic namespace provides helper functions to work with - * {@link Diagnostic} literals. + * A string containing the version of the GraphQL.js library */ -var Diagnostic; -(function (Diagnostic) { - /** - * Creates a new Diagnostic literal. - */ - function create(range, message, severity, code, source, relatedInformation) { - var result = { - range: range, - message: message - }; - if (Is.defined(severity)) { - result.severity = severity; - } - if (Is.defined(code)) { - result.code = code; - } - if (Is.defined(source)) { - result.source = source; - } - if (Is.defined(relatedInformation)) { - result.relatedInformation = relatedInformation; - } - return result; - } - Diagnostic.create = create; - /** - * Checks whether the given literal conforms to the {@link Diagnostic} interface. - */ - function is(value) { - var _a; - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); - } - Diagnostic.is = is; -})(Diagnostic || (exports.Diagnostic = Diagnostic = {})); +const version = exports.version = '16.9.0'; /** - * The Command namespace provides helper functions to work with - * {@link Command} literals. + * An object containing the components of the GraphQL.js version string */ -var Command; -(function (Command) { - /** - * Creates a new Command literal. - */ - function create(title, command) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; + +const versionInfo = exports.versionInfo = Object.freeze({ + major: 16, + minor: 9, + patch: 0, + preReleaseTag: null +}); + +/***/ }), + +/***/ "../../../node_modules/hey-listen/dist/hey-listen.es.js": +/*!**************************************************************!*\ + !*** ../../../node_modules/hey-listen/dist/hey-listen.es.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.warning = exports.invariant = void 0; +var warning = function () {}; +exports.warning = warning; +var invariant = function () {}; +exports.invariant = invariant; +if (true) { + exports.warning = warning = function (check, message) { + if (!check && typeof console !== 'undefined') { + console.warn(message); } - var result = { - title: title, - command: command - }; - if (Is.defined(args) && args.length > 0) { - result.arguments = args; + }; + exports.invariant = invariant = function (check, message) { + if (!check) { + throw new Error(message); } - return result; - } - Command.create = create; - /** - * Checks whether the given literal conforms to the {@link Command} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); - } - Command.is = is; -})(Command || (exports.Command = Command = {})); -/** - * The TextEdit namespace provides helper function to create replace, - * insert and delete edits more easily. + }; +} + +/***/ }), + +/***/ "../../../node_modules/is-plain-object/index.js": +/*!******************************************************!*\ + !*** ../../../node_modules/is-plain-object/index.js ***! + \******************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. */ -var TextEdit; -(function (TextEdit) { - /** - * Creates a replace text edit. - * @param range The range of text to be replaced. - * @param newText The new text. - */ - function replace(range, newText) { - return { - range: range, - newText: newText - }; - } - TextEdit.replace = replace; - /** - * Creates an insert text edit. - * @param position The position to insert the text at. - * @param newText The text to be inserted. - */ - function insert(position, newText) { - return { - range: { - start: position, - end: position - }, - newText: newText - }; - } - TextEdit.insert = insert; - /** - * Creates a delete text edit. - * @param range The range of text to be deleted. - */ - function del(range) { - return { - range: range, - newText: '' - }; - } - TextEdit.del = del; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range); - } - TextEdit.is = is; -})(TextEdit || (exports.TextEdit = TextEdit = {})); -var ChangeAnnotation; -(function (ChangeAnnotation) { - function create(label, needsConfirmation, description) { - var result = { - label: label - }; - if (needsConfirmation !== undefined) { - result.needsConfirmation = needsConfirmation; - } - if (description !== undefined) { - result.description = description; - } - return result; - } - ChangeAnnotation.create = create; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) && (Is.string(candidate.description) || candidate.description === undefined); - } - ChangeAnnotation.is = is; -})(ChangeAnnotation || (exports.ChangeAnnotation = ChangeAnnotation = {})); -var ChangeAnnotationIdentifier; -(function (ChangeAnnotationIdentifier) { - function is(value) { - var candidate = value; - return Is.string(candidate); - } - ChangeAnnotationIdentifier.is = is; -})(ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = ChangeAnnotationIdentifier = {})); -var AnnotatedTextEdit; -(function (AnnotatedTextEdit) { - /** - * Creates an annotated replace text edit. - * - * @param range The range of text to be replaced. - * @param newText The new text. - * @param annotation The annotation. - */ - function replace(range, newText, annotation) { - return { - range: range, - newText: newText, - annotationId: annotation - }; - } - AnnotatedTextEdit.replace = replace; - /** - * Creates an annotated insert text edit. - * - * @param position The position to insert the text at. - * @param newText The text to be inserted. - * @param annotation The annotation. - */ - function insert(position, newText, annotation) { - return { - range: { - start: position, - end: position - }, - newText: newText, - annotationId: annotation - }; - } - AnnotatedTextEdit.insert = insert; - /** - * Creates an annotated delete text edit. - * - * @param range The range of text to be deleted. - * @param annotation The annotation. - */ - function del(range, annotation) { - return { - range: range, - newText: '', - annotationId: annotation - }; - } - AnnotatedTextEdit.del = del; - function is(value) { - var candidate = value; - return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId)); + + + +var isObject = __webpack_require__(/*! isobject */ "../../../node_modules/isobject/index.js"); +function isObjectObject(o) { + return isObject(o) === true && Object.prototype.toString.call(o) === '[object Object]'; +} +module.exports = function isPlainObject(o) { + var ctor, prot; + if (isObjectObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (typeof ctor !== 'function') return false; + + // If has modified prototype + prot = ctor.prototype; + if (isObjectObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; } - AnnotatedTextEdit.is = is; -})(AnnotatedTextEdit || (exports.AnnotatedTextEdit = AnnotatedTextEdit = {})); -/** - * The TextDocumentEdit namespace provides helper function to create - * an edit that manipulates a text document. + + // Most likely a plain Object + return true; +}; + +/***/ }), + +/***/ "../../../node_modules/is-primitive/index.js": +/*!***************************************************!*\ + !*** ../../../node_modules/is-primitive/index.js ***! + \***************************************************/ +/***/ (function(module) { + +"use strict"; +/*! + * is-primitive + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. */ -var TextDocumentEdit; -(function (TextDocumentEdit) { - /** - * Creates a new `TextDocumentEdit` - */ - function create(textDocument, edits) { - return { - textDocument: textDocument, - edits: edits - }; - } - TextDocumentEdit.create = create; - function is(value) { - var candidate = value; - return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits); - } - TextDocumentEdit.is = is; -})(TextDocumentEdit || (exports.TextDocumentEdit = TextDocumentEdit = {})); -var CreateFile; -(function (CreateFile) { - function create(uri, options, annotation) { - var result = { - kind: 'create', - uri: uri - }; - if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) { - result.options = options; - } - if (annotation !== undefined) { - result.annotationId = annotation; - } - return result; - } - CreateFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId)); + + + +module.exports = function isPrimitive(val) { + if (typeof val === 'object') { + return val === null; } - CreateFile.is = is; -})(CreateFile || (exports.CreateFile = CreateFile = {})); -var RenameFile; -(function (RenameFile) { - function create(oldUri, newUri, options, annotation) { - var result = { - kind: 'rename', - oldUri: oldUri, - newUri: newUri - }; - if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) { - result.options = options; - } - if (annotation !== undefined) { - result.annotationId = annotation; + return typeof val !== 'function'; +}; + +/***/ }), + +/***/ "../../../node_modules/isarray/index.js": +/*!**********************************************!*\ + !*** ../../../node_modules/isarray/index.js ***! + \**********************************************/ +/***/ (function(module) { + +"use strict"; + + +var toString = {}.toString; +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + +/***/ }), + +/***/ "../../../node_modules/isobject/index.js": +/*!***********************************************!*\ + !*** ../../../node_modules/isobject/index.js ***! + \***********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/*! + * isobject + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +var isArray = __webpack_require__(/*! isarray */ "../../../node_modules/isarray/index.js"); +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && isArray(val) === false; +}; + +/***/ }), + +/***/ "../../../node_modules/linkify-it/build/index.cjs.js": +/*!***********************************************************!*\ + !*** ../../../node_modules/linkify-it/build/index.cjs.js ***! + \***********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var uc_micro = __webpack_require__(/*! uc.micro */ "../../../node_modules/uc.micro/build/index.cjs.js"); +function reFactory(opts) { + const re = {}; + opts = opts || {}; + re.src_Any = uc_micro.Any.source; + re.src_Cc = uc_micro.Cc.source; + re.src_Z = uc_micro.Z.source; + re.src_P = uc_micro.P.source; + + // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation) + re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|'); + + // \p{\Z\Cc} (white spaces + control) + re.src_ZCc = [re.src_Z, re.src_Cc].join('|'); + + // Experimental. List of chars, completely prohibited in links + // because can separate it from other part of text + const text_separators = '[><\uff5c]'; + + // All possible word characters (everything without punctuation, spaces & controls) + // Defined via punctuation & spaces to save space + // Should be something like \p{\L\N\S\M} (\w but without `_`) + re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'; + // The same as abothe but without [0-9] + // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')'; + + re.src_ip4 = '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; + + // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch. + re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?'; + re.src_port = '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'; + re.src_host_terminator = '(?=$|' + text_separators + '|' + re.src_ZPCc + ')' + '(?!' + (opts['---'] ? '-(?!--)|' : '-|') + '_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; + re.src_path = '(?:' + '[/?#]' + '(?:' + '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-;]).|' + '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + + // allow `I'm_king` if no pair found + "\\'(?=" + re.src_pseudo_letter + '|[-])|' + + // google has many dots in "google search" links (#66, #81). + // github has ... in commit range links, + // Restrict to + // - english + // - percent-encoded + // - parts of file path + // - params separator + // until more examples found. + '\\.{2,}[a-zA-Z0-9%/&]|' + '\\.(?!' + re.src_ZCc + '|[.]|$)|' + (opts['---'] ? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate + : '\\-+|') + + // allow `,,,` in paths + ',(?!' + re.src_ZCc + '|$)|' + + // allow `;` if not followed by space-like char + ';(?!' + re.src_ZCc + '|$)|' + + // allow `!!!` in paths, but not at the end + '\\!+(?!' + re.src_ZCc + '|[!]|$)|' + '\\?(?!' + re.src_ZCc + '|[?]|$)' + ')+' + '|\\/' + ')?'; + + // Allow anything in markdown spec, forbid quote (") at the first position + // because emails enclosed in quotes are far more common + re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; + re.src_xn = 'xn--[a-z0-9\\-]{1,59}'; + + // More to read about domain names + // http://serverfault.com/questions/638260/ + + re.src_domain_root = + // Allow letters & digits (http://test1) + '(?:' + re.src_xn + '|' + re.src_pseudo_letter + '{1,63}' + ')'; + re.src_domain = '(?:' + re.src_xn + '|' + '(?:' + re.src_pseudo_letter + ')' + '|' + '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' + ')'; + re.src_host = '(?:' + + // Don't need IP check, because digits are already allowed in normal domain names + // src_ip4 + + // '|' + + '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain /* _root */ + ')' + ')'; + re.tpl_host_fuzzy = '(?:' + re.src_ip4 + '|' + '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' + ')'; + re.tpl_host_no_ip_fuzzy = '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))'; + re.src_host_strict = re.src_host + re.src_host_terminator; + re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator; + re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator; + re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator; + re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator; + + // + // Main rules + // + + // Rude test fuzzy links by host, for quick deny + re.tpl_host_fuzzy_test = 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'; + re.tpl_email_fuzzy = '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' + '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; + re.tpl_link_fuzzy = + // Fuzzy link can't be prepended with .:/\- and non punctuation. + // but can start with > (markdown blockquote) + '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; + re.tpl_link_no_ip_fuzzy = + // Fuzzy link can't be prepended with .:/\- and non punctuation. + // but can start with > (markdown blockquote) + '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; + return re; +} + +// +// Helpers +// + +// Merge objects +// +function assign(obj /* from1, from2, from3, ... */) { + const sources = Array.prototype.slice.call(arguments, 1); + sources.forEach(function (source) { + if (!source) { + return; } - return result; - } - RenameFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId)); - } - RenameFile.is = is; -})(RenameFile || (exports.RenameFile = RenameFile = {})); -var DeleteFile; -(function (DeleteFile) { - function create(uri, options, annotation) { - var result = { - kind: 'delete', - uri: uri - }; - if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) { - result.options = options; + Object.keys(source).forEach(function (key) { + obj[key] = source[key]; + }); + }); + return obj; +} +function _class(obj) { + return Object.prototype.toString.call(obj); +} +function isString(obj) { + return _class(obj) === '[object String]'; +} +function isObject(obj) { + return _class(obj) === '[object Object]'; +} +function isRegExp(obj) { + return _class(obj) === '[object RegExp]'; +} +function isFunction(obj) { + return _class(obj) === '[object Function]'; +} +function escapeRE(str) { + return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); +} + +// + +const defaultOptions = { + fuzzyLink: true, + fuzzyEmail: true, + fuzzyIP: false +}; +function isOptionsObj(obj) { + return Object.keys(obj || {}).reduce(function (acc, k) { + /* eslint-disable-next-line no-prototype-builtins */ + return acc || defaultOptions.hasOwnProperty(k); + }, false); +} +const defaultSchemas = { + 'http:': { + validate: function (text, pos, self) { + const tail = text.slice(pos); + if (!self.re.http) { + // compile lazily, because "host"-containing variables can change on tlds update. + self.re.http = new RegExp('^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'); + } + if (self.re.http.test(tail)) { + return tail.match(self.re.http)[0].length; + } + return 0; } - if (annotation !== undefined) { - result.annotationId = annotation; + }, + 'https:': 'http:', + 'ftp:': 'http:', + '//': { + validate: function (text, pos, self) { + const tail = text.slice(pos); + if (!self.re.no_http) { + // compile lazily, because "host"-containing variables can change on tlds update. + self.re.no_http = new RegExp('^' + self.re.src_auth + + // Don't allow single-level domains, because of false positives like '//test' + // with code comments + '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' + self.re.src_port + self.re.src_host_terminator + self.re.src_path, 'i'); + } + if (self.re.no_http.test(tail)) { + // should not be `://` & `///`, that protects from errors in protocol name + if (pos >= 3 && text[pos - 3] === ':') { + return 0; + } + if (pos >= 3 && text[pos - 3] === '/') { + return 0; + } + return tail.match(self.re.no_http)[0].length; + } + return 0; } - return result; - } - DeleteFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId)); - } - DeleteFile.is = is; -})(DeleteFile || (exports.DeleteFile = DeleteFile = {})); -var WorkspaceEdit; -(function (WorkspaceEdit) { - function is(value) { - var candidate = value; - return candidate && (candidate.changes !== undefined || candidate.documentChanges !== undefined) && (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) { - if (Is.string(change.kind)) { - return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); - } else { - return TextDocumentEdit.is(change); + }, + 'mailto:': { + validate: function (text, pos, self) { + const tail = text.slice(pos); + if (!self.re.mailto) { + self.re.mailto = new RegExp('^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'); } - })); - } - WorkspaceEdit.is = is; -})(WorkspaceEdit || (exports.WorkspaceEdit = WorkspaceEdit = {})); -var TextEditChangeImpl = /** @class */function () { - function TextEditChangeImpl(edits, changeAnnotations) { - this.edits = edits; - this.changeAnnotations = changeAnnotations; - } - TextEditChangeImpl.prototype.insert = function (position, newText, annotation) { - var edit; - var id; - if (annotation === undefined) { - edit = TextEdit.insert(position, newText); - } else if (ChangeAnnotationIdentifier.is(annotation)) { - id = annotation; - edit = AnnotatedTextEdit.insert(position, newText, annotation); - } else { - this.assertChangeAnnotations(this.changeAnnotations); - id = this.changeAnnotations.manage(annotation); - edit = AnnotatedTextEdit.insert(position, newText, id); + if (self.re.mailto.test(tail)) { + return tail.match(self.re.mailto)[0].length; + } + return 0; } - this.edits.push(edit); - if (id !== undefined) { - return id; + } +}; + +// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js) +/* eslint-disable-next-line max-len */ +const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'; + +// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead +const tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|'); +function resetScanCache(self) { + self.__index__ = -1; + self.__text_cache__ = ''; +} +function createValidator(re) { + return function (text, pos) { + const tail = text.slice(pos); + if (re.test(tail)) { + return tail.match(re)[0].length; } + return 0; }; - TextEditChangeImpl.prototype.replace = function (range, newText, annotation) { - var edit; - var id; - if (annotation === undefined) { - edit = TextEdit.replace(range, newText); - } else if (ChangeAnnotationIdentifier.is(annotation)) { - id = annotation; - edit = AnnotatedTextEdit.replace(range, newText, annotation); - } else { - this.assertChangeAnnotations(this.changeAnnotations); - id = this.changeAnnotations.manage(annotation); - edit = AnnotatedTextEdit.replace(range, newText, id); - } - this.edits.push(edit); - if (id !== undefined) { - return id; - } +} +function createNormalizer() { + return function (match, self) { + self.normalize(match); }; - TextEditChangeImpl.prototype.delete = function (range, annotation) { - var edit; - var id; - if (annotation === undefined) { - edit = TextEdit.del(range); - } else if (ChangeAnnotationIdentifier.is(annotation)) { - id = annotation; - edit = AnnotatedTextEdit.del(range, annotation); - } else { - this.assertChangeAnnotations(this.changeAnnotations); - id = this.changeAnnotations.manage(annotation); - edit = AnnotatedTextEdit.del(range, id); +} + +// Schemas compiler. Build regexps. +// +function compile(self) { + // Load & clone RE patterns. + const re = self.re = reFactory(self.__opts__); + + // Define dynamic patterns + const tlds = self.__tlds__.slice(); + self.onCompile(); + if (!self.__tlds_replaced__) { + tlds.push(tlds_2ch_src_re); + } + tlds.push(re.src_xn); + re.src_tlds = tlds.join('|'); + function untpl(tpl) { + return tpl.replace('%TLDS%', re.src_tlds); + } + re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i'); + re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i'); + re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i'); + re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i'); + + // + // Compile each schema + // + + const aliases = []; + self.__compiled__ = {}; // Reset compiled data + + function schemaError(name, val) { + throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); + } + Object.keys(self.__schemas__).forEach(function (name) { + const val = self.__schemas__[name]; + + // skip disabled methods + if (val === null) { + return; } - this.edits.push(edit); - if (id !== undefined) { - return id; + const compiled = { + validate: null, + link: null + }; + self.__compiled__[name] = compiled; + if (isObject(val)) { + if (isRegExp(val.validate)) { + compiled.validate = createValidator(val.validate); + } else if (isFunction(val.validate)) { + compiled.validate = val.validate; + } else { + schemaError(name, val); + } + if (isFunction(val.normalize)) { + compiled.normalize = val.normalize; + } else if (!val.normalize) { + compiled.normalize = createNormalizer(); + } else { + schemaError(name, val); + } + return; } - }; - TextEditChangeImpl.prototype.add = function (edit) { - this.edits.push(edit); - }; - TextEditChangeImpl.prototype.all = function () { - return this.edits; - }; - TextEditChangeImpl.prototype.clear = function () { - this.edits.splice(0, this.edits.length); - }; - TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) { - if (value === undefined) { - throw new Error("Text edit change is not configured to manage change annotations."); + if (isString(val)) { + aliases.push(name); + return; } - }; - return TextEditChangeImpl; -}(); -/** - * A helper class - */ -var ChangeAnnotations = /** @class */function () { - function ChangeAnnotations(annotations) { - this._annotations = annotations === undefined ? Object.create(null) : annotations; - this._counter = 0; - this._size = 0; - } - ChangeAnnotations.prototype.all = function () { - return this._annotations; - }; - Object.defineProperty(ChangeAnnotations.prototype, "size", { - get: function () { - return this._size; - }, - enumerable: false, - configurable: true + schemaError(name, val); }); - ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) { - var id; - if (ChangeAnnotationIdentifier.is(idOrAnnotation)) { - id = idOrAnnotation; - } else { - id = this.nextId(); - annotation = idOrAnnotation; - } - if (this._annotations[id] !== undefined) { - throw new Error("Id ".concat(id, " is already in use.")); - } - if (annotation === undefined) { - throw new Error("No annotation provided for id ".concat(id)); + + // + // Compile postponed aliases + // + + aliases.forEach(function (alias) { + if (!self.__compiled__[self.__schemas__[alias]]) { + // Silently fail on missed schemas to avoid errons on disable. + // schemaError(alias, self.__schemas__[alias]); + return; } - this._annotations[id] = annotation; - this._size++; - return id; - }; - ChangeAnnotations.prototype.nextId = function () { - this._counter++; - return this._counter.toString(); + self.__compiled__[alias].validate = self.__compiled__[self.__schemas__[alias]].validate; + self.__compiled__[alias].normalize = self.__compiled__[self.__schemas__[alias]].normalize; + }); + + // + // Fake record for guessed links + // + self.__compiled__[''] = { + validate: null, + normalize: createNormalizer() }; - return ChangeAnnotations; -}(); -/** - * A workspace change helps constructing changes to a workspace. - */ -var WorkspaceChange = exports.WorkspaceChange = /** @class */function () { - function WorkspaceChange(workspaceEdit) { - var _this = this; - this._textEditChanges = Object.create(null); - if (workspaceEdit !== undefined) { - this._workspaceEdit = workspaceEdit; - if (workspaceEdit.documentChanges) { - this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations); - workspaceEdit.changeAnnotations = this._changeAnnotations.all(); - workspaceEdit.documentChanges.forEach(function (change) { - if (TextDocumentEdit.is(change)) { - var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations); - _this._textEditChanges[change.textDocument.uri] = textEditChange; - } - }); - } else if (workspaceEdit.changes) { - Object.keys(workspaceEdit.changes).forEach(function (key) { - var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); - _this._textEditChanges[key] = textEditChange; - }); - } - } else { - this._workspaceEdit = {}; - } - } - Object.defineProperty(WorkspaceChange.prototype, "edit", { - /** - * Returns the underlying {@link WorkspaceEdit} literal - * use to be returned from a workspace edit operation like rename. - */ - get: function () { - this.initDocumentChanges(); - if (this._changeAnnotations !== undefined) { - if (this._changeAnnotations.size === 0) { - this._workspaceEdit.changeAnnotations = undefined; - } else { - this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); - } - } - return this._workspaceEdit; - }, - enumerable: false, - configurable: true - }); - WorkspaceChange.prototype.getTextEditChange = function (key) { - if (OptionalVersionedTextDocumentIdentifier.is(key)) { - this.initDocumentChanges(); - if (this._workspaceEdit.documentChanges === undefined) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var textDocument = { - uri: key.uri, - version: key.version - }; - var result = this._textEditChanges[textDocument.uri]; - if (!result) { - var edits = []; - var textDocumentEdit = { - textDocument: textDocument, - edits: edits - }; - this._workspaceEdit.documentChanges.push(textDocumentEdit); - result = new TextEditChangeImpl(edits, this._changeAnnotations); - this._textEditChanges[textDocument.uri] = result; - } - return result; - } else { - this.initChanges(); - if (this._workspaceEdit.changes === undefined) { - throw new Error('Workspace edit is not configured for normal text edit changes.'); - } - var result = this._textEditChanges[key]; - if (!result) { - var edits = []; - this._workspaceEdit.changes[key] = edits; - result = new TextEditChangeImpl(edits); - this._textEditChanges[key] = result; - } - return result; - } - }; - WorkspaceChange.prototype.initDocumentChanges = function () { - if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) { - this._changeAnnotations = new ChangeAnnotations(); - this._workspaceEdit.documentChanges = []; - this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); - } - }; - WorkspaceChange.prototype.initChanges = function () { - if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) { - this._workspaceEdit.changes = Object.create(null); - } - }; - WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) { - this.initDocumentChanges(); - if (this._workspaceEdit.documentChanges === undefined) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var annotation; - if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { - annotation = optionsOrAnnotation; - } else { - options = optionsOrAnnotation; - } - var operation; - var id; - if (annotation === undefined) { - operation = CreateFile.create(uri, options); - } else { - id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); - operation = CreateFile.create(uri, options, id); - } - this._workspaceEdit.documentChanges.push(operation); - if (id !== undefined) { - return id; - } - }; - WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) { - this.initDocumentChanges(); - if (this._workspaceEdit.documentChanges === undefined) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var annotation; - if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { - annotation = optionsOrAnnotation; - } else { - options = optionsOrAnnotation; - } - var operation; - var id; - if (annotation === undefined) { - operation = RenameFile.create(oldUri, newUri, options); - } else { - id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); - operation = RenameFile.create(oldUri, newUri, options, id); - } - this._workspaceEdit.documentChanges.push(operation); - if (id !== undefined) { - return id; - } - }; - WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) { - this.initDocumentChanges(); - if (this._workspaceEdit.documentChanges === undefined) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var annotation; - if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { - annotation = optionsOrAnnotation; - } else { - options = optionsOrAnnotation; - } - var operation; - var id; - if (annotation === undefined) { - operation = DeleteFile.create(uri, options); - } else { - id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); - operation = DeleteFile.create(uri, options, id); - } - this._workspaceEdit.documentChanges.push(operation); - if (id !== undefined) { - return id; - } - }; - return WorkspaceChange; -}(); + + // + // Build schema condition + // + const slist = Object.keys(self.__compiled__).filter(function (name) { + // Filter disabled & fake schemas + return name.length > 0 && self.__compiled__[name]; + }).map(escapeRE).join('|'); + // (?!_) cause 1.5x slowdown + self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); + self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); + self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i'); + self.re.pretest = RegExp('(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', 'i'); + + // + // Cleanup + // + + resetScanCache(self); +} + /** - * The TextDocumentIdentifier namespace provides helper functions to work with - * {@link TextDocumentIdentifier} literals. - */ -var TextDocumentIdentifier; -(function (TextDocumentIdentifier) { + * class Match + * + * Match result. Single element of array, returned by [[LinkifyIt#match]] + **/ +function Match(self, shift) { + const start = self.__index__; + const end = self.__last_index__; + const text = self.__text_cache__.slice(start, end); + /** - * Creates a new TextDocumentIdentifier literal. - * @param uri The document's uri. - */ - function create(uri) { - return { - uri: uri - }; - } - TextDocumentIdentifier.create = create; + * Match#schema -> String + * + * Prefix (protocol) for matched string. + **/ + this.schema = self.__schema__.toLowerCase(); /** - * Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri); - } - TextDocumentIdentifier.is = is; -})(TextDocumentIdentifier || (exports.TextDocumentIdentifier = TextDocumentIdentifier = {})); -/** - * The VersionedTextDocumentIdentifier namespace provides helper functions to work with - * {@link VersionedTextDocumentIdentifier} literals. - */ -var VersionedTextDocumentIdentifier; -(function (VersionedTextDocumentIdentifier) { + * Match#index -> Number + * + * First position of matched string. + **/ + this.index = start + shift; /** - * Creates a new VersionedTextDocumentIdentifier literal. - * @param uri The document's uri. - * @param version The document's version. - */ - function create(uri, version) { - return { - uri: uri, - version: version - }; - } - VersionedTextDocumentIdentifier.create = create; + * Match#lastIndex -> Number + * + * Next position after matched string. + **/ + this.lastIndex = end + shift; /** - * Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version); - } - VersionedTextDocumentIdentifier.is = is; -})(VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = VersionedTextDocumentIdentifier = {})); -/** - * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with - * {@link OptionalVersionedTextDocumentIdentifier} literals. - */ -var OptionalVersionedTextDocumentIdentifier; -(function (OptionalVersionedTextDocumentIdentifier) { + * Match#raw -> String + * + * Matched string. + **/ + this.raw = text; /** - * Creates a new OptionalVersionedTextDocumentIdentifier literal. - * @param uri The document's uri. - * @param version The document's version. - */ - function create(uri, version) { - return { - uri: uri, - version: version - }; - } - OptionalVersionedTextDocumentIdentifier.create = create; + * Match#text -> String + * + * Notmalized text of matched string. + **/ + this.text = text; /** - * Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version)); - } - OptionalVersionedTextDocumentIdentifier.is = is; -})(OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = OptionalVersionedTextDocumentIdentifier = {})); + * Match#url -> String + * + * Normalized url of matched string. + **/ + this.url = text; +} +function createMatch(self, shift) { + const match = new Match(self, shift); + self.__compiled__[match.schema].normalize(match, self); + return match; +} + /** - * The TextDocumentItem namespace provides helper functions to work with - * {@link TextDocumentItem} literals. - */ -var TextDocumentItem; -(function (TextDocumentItem) { - /** - * Creates a new TextDocumentItem literal. - * @param uri The document's uri. - * @param languageId The document's language identifier. - * @param version The document's version number. - * @param text The document's text. - */ - function create(uri, languageId, version, text) { - return { - uri: uri, - languageId: languageId, - version: version, - text: text - }; - } - TextDocumentItem.create = create; - /** - * Checks whether the given literal conforms to the {@link TextDocumentItem} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text); - } - TextDocumentItem.is = is; -})(TextDocumentItem || (exports.TextDocumentItem = TextDocumentItem = {})); + * class LinkifyIt + **/ + /** - * Describes the content type that a client supports in various - * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. + * new LinkifyIt(schemas, options) + * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) + * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } * - * Please note that `MarkupKinds` must not start with a `$`. This kinds - * are reserved for internal usage. - */ -var MarkupKind; -(function (MarkupKind) { - /** - * Plain text is supported as a content format - */ - MarkupKind.PlainText = 'plaintext'; - /** - * Markdown is supported as a content format - */ - MarkupKind.Markdown = 'markdown'; - /** - * Checks whether the given value is a value of the {@link MarkupKind} type. - */ - function is(value) { - var candidate = value; - return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; + * Creates new linkifier instance with optional additional schemas. + * Can be called without `new` keyword for convenience. + * + * By default understands: + * + * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links + * - "fuzzy" links and emails (example.com, foo@bar.com). + * + * `schemas` is an object, where each key/value describes protocol/rule: + * + * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` + * for example). `linkify-it` makes shure that prefix is not preceeded with + * alphanumeric char and symbols. Only whitespaces and punctuation allowed. + * - __value__ - rule to check tail after link prefix + * - _String_ - just alias to existing rule + * - _Object_ + * - _validate_ - validator function (should return matched length on success), + * or `RegExp`. + * - _normalize_ - optional function to normalize text & url of matched result + * (for example, for @twitter mentions). + * + * `options`: + * + * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`. + * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts + * like version numbers. Default `false`. + * - __fuzzyEmail__ - recognize emails without `mailto:` prefix. + * + **/ +function LinkifyIt(schemas, options) { + if (!(this instanceof LinkifyIt)) { + return new LinkifyIt(schemas, options); } - MarkupKind.is = is; -})(MarkupKind || (exports.MarkupKind = MarkupKind = {})); -var MarkupContent; -(function (MarkupContent) { - /** - * Checks whether the given value conforms to the {@link MarkupContent} interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); + if (!options) { + if (isOptionsObj(schemas)) { + options = schemas; + schemas = {}; + } } - MarkupContent.is = is; -})(MarkupContent || (exports.MarkupContent = MarkupContent = {})); -/** - * The kind of a completion entry. - */ -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind.Text = 1; - CompletionItemKind.Method = 2; - CompletionItemKind.Function = 3; - CompletionItemKind.Constructor = 4; - CompletionItemKind.Field = 5; - CompletionItemKind.Variable = 6; - CompletionItemKind.Class = 7; - CompletionItemKind.Interface = 8; - CompletionItemKind.Module = 9; - CompletionItemKind.Property = 10; - CompletionItemKind.Unit = 11; - CompletionItemKind.Value = 12; - CompletionItemKind.Enum = 13; - CompletionItemKind.Keyword = 14; - CompletionItemKind.Snippet = 15; - CompletionItemKind.Color = 16; - CompletionItemKind.File = 17; - CompletionItemKind.Reference = 18; - CompletionItemKind.Folder = 19; - CompletionItemKind.EnumMember = 20; - CompletionItemKind.Constant = 21; - CompletionItemKind.Struct = 22; - CompletionItemKind.Event = 23; - CompletionItemKind.Operator = 24; - CompletionItemKind.TypeParameter = 25; -})(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {})); -/** - * Defines whether the insert text in a completion item should be interpreted as - * plain text or a snippet. - */ -var InsertTextFormat; -(function (InsertTextFormat) { - /** - * The primary text to be inserted is treated as a plain string. - */ - InsertTextFormat.PlainText = 1; - /** - * The primary text to be inserted is treated as a snippet. - * - * A snippet can define tab stops and placeholders with `$1`, `$2` - * and `${3:foo}`. `$0` defines the final tab stop, it defaults to - * the end of the snippet. Placeholders with equal identifiers are linked, - * that is typing in one will update others too. - * - * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax - */ - InsertTextFormat.Snippet = 2; -})(InsertTextFormat || (exports.InsertTextFormat = InsertTextFormat = {})); -/** - * Completion item tags are extra annotations that tweak the rendering of a completion - * item. + this.__opts__ = assign({}, defaultOptions, options); + + // Cache last tested result. Used to skip repeating steps on next `match` call. + this.__index__ = -1; + this.__last_index__ = -1; // Next scan position + this.__schema__ = ''; + this.__text_cache__ = ''; + this.__schemas__ = assign({}, defaultSchemas, schemas); + this.__compiled__ = {}; + this.__tlds__ = tlds_default; + this.__tlds_replaced__ = false; + this.re = {}; + compile(this); +} + +/** chainable + * LinkifyIt#add(schema, definition) + * - schema (String): rule name (fixed pattern prefix) + * - definition (String|RegExp|Object): schema definition * - * @since 3.15.0 - */ -var CompletionItemTag; -(function (CompletionItemTag) { - /** - * Render a completion as obsolete, usually using a strike-out. - */ - CompletionItemTag.Deprecated = 1; -})(CompletionItemTag || (exports.CompletionItemTag = CompletionItemTag = {})); + * Add new rule definition. See constructor description for details. + **/ +LinkifyIt.prototype.add = function add(schema, definition) { + this.__schemas__[schema] = definition; + compile(this); + return this; +}; + +/** chainable + * LinkifyIt#set(options) + * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } + * + * Set recognition options for links without schema. + **/ +LinkifyIt.prototype.set = function set(options) { + this.__opts__ = assign(this.__opts__, options); + return this; +}; + /** - * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits. + * LinkifyIt#test(text) -> Boolean * - * @since 3.16.0 - */ -var InsertReplaceEdit; -(function (InsertReplaceEdit) { - /** - * Creates a new insert / replace edit - */ - function create(newText, insert, replace) { - return { - newText: newText, - insert: insert, - replace: replace - }; + * Searches linkifiable pattern and returns `true` on success or `false` on fail. + **/ +LinkifyIt.prototype.test = function test(text) { + // Reset scan cache + this.__text_cache__ = text; + this.__index__ = -1; + if (!text.length) { + return false; } - InsertReplaceEdit.create = create; - /** - * Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface. - */ - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace); + let m, ml, me, len, shift, next, re, tld_pos, at_pos; + + // try to scan for link with schema - that's the most simple rule + if (this.re.schema_test.test(text)) { + re = this.re.schema_search; + re.lastIndex = 0; + while ((m = re.exec(text)) !== null) { + len = this.testSchemaAt(text, m[2], re.lastIndex); + if (len) { + this.__schema__ = m[2]; + this.__index__ = m.index + m[1].length; + this.__last_index__ = m.index + m[0].length + len; + break; + } + } } - InsertReplaceEdit.is = is; -})(InsertReplaceEdit || (exports.InsertReplaceEdit = InsertReplaceEdit = {})); + if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { + // guess schemaless links + tld_pos = text.search(this.re.host_fuzzy_test); + if (tld_pos >= 0) { + // if tld is located after found link - no need to check fuzzy pattern + if (this.__index__ < 0 || tld_pos < this.__index__) { + if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { + shift = ml.index + ml[1].length; + if (this.__index__ < 0 || shift < this.__index__) { + this.__schema__ = ''; + this.__index__ = shift; + this.__last_index__ = ml.index + ml[0].length; + } + } + } + } + } + if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { + // guess schemaless emails + at_pos = text.indexOf('@'); + if (at_pos >= 0) { + // We can't skip this check, because this cases are possible: + // 192.168.1.1@gmail.com, my.in@example.com + if ((me = text.match(this.re.email_fuzzy)) !== null) { + shift = me.index + me[1].length; + next = me.index + me[0].length; + if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) { + this.__schema__ = 'mailto:'; + this.__index__ = shift; + this.__last_index__ = next; + } + } + } + } + return this.__index__ >= 0; +}; + /** - * How whitespace and indentation is handled during completion - * item insertion. + * LinkifyIt#pretest(text) -> Boolean * - * @since 3.16.0 - */ -var InsertTextMode; -(function (InsertTextMode) { - /** - * The insertion or replace strings is taken as it is. If the - * value is multi line the lines below the cursor will be - * inserted using the indentation defined in the string value. - * The client will not apply any kind of adjustments to the - * string. - */ - InsertTextMode.asIs = 1; - /** - * The editor adjusts leading whitespace of new lines so that - * they match the indentation up to the cursor of the line for - * which the item is accepted. - * - * Consider a line like this: <2tabs><3tabs>foo. Accepting a - * multi line completion item is indented using 2 tabs and all - * following lines inserted will be indented using 2 tabs as well. - */ - InsertTextMode.adjustIndentation = 2; -})(InsertTextMode || (exports.InsertTextMode = InsertTextMode = {})); -var CompletionItemLabelDetails; -(function (CompletionItemLabelDetails) { - function is(value) { - var candidate = value; - return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) && (Is.string(candidate.description) || candidate.description === undefined); - } - CompletionItemLabelDetails.is = is; -})(CompletionItemLabelDetails || (exports.CompletionItemLabelDetails = CompletionItemLabelDetails = {})); + * Very quick check, that can give false positives. Returns true if link MAY BE + * can exists. Can be used for speed optimization, when you need to check that + * link NOT exists. + **/ +LinkifyIt.prototype.pretest = function pretest(text) { + return this.re.pretest.test(text); +}; + /** - * The CompletionItem namespace provides functions to deal with - * completion items. - */ -var CompletionItem; -(function (CompletionItem) { - /** - * Create a completion item and seed it with a label. - * @param label The completion item's label - */ - function create(label) { - return { - label: label - }; + * LinkifyIt#testSchemaAt(text, name, position) -> Number + * - text (String): text to scan + * - name (String): rule (schema) name + * - position (Number): text offset to check from + * + * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly + * at given position. Returns length of found pattern (0 on fail). + **/ +LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) { + // If not supported schema check requested - terminate + if (!this.__compiled__[schema.toLowerCase()]) { + return 0; } - CompletionItem.create = create; -})(CompletionItem || (exports.CompletionItem = CompletionItem = {})); + return this.__compiled__[schema.toLowerCase()].validate(text, pos, this); +}; + /** - * The CompletionList namespace provides functions to deal with - * completion lists. - */ -var CompletionList; -(function (CompletionList) { - /** - * Creates a new completion list. - * - * @param items The completion items. - * @param isIncomplete The list is not complete. - */ - function create(items, isIncomplete) { - return { - items: items ? items : [], - isIncomplete: !!isIncomplete - }; - } - CompletionList.create = create; -})(CompletionList || (exports.CompletionList = CompletionList = {})); -var MarkedString; -(function (MarkedString) { - /** - * Creates a marked string from plain text. - * - * @param plainText The plain text. - */ - function fromPlainText(plainText) { - return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash + * LinkifyIt#match(text) -> Array|null + * + * Returns array of found link descriptions or `null` on fail. We strongly + * recommend to use [[LinkifyIt#test]] first, for best speed. + * + * ##### Result match description + * + * - __schema__ - link schema, can be empty for fuzzy links, or `//` for + * protocol-neutral links. + * - __index__ - offset of matched text + * - __lastIndex__ - index of next char after mathch end + * - __raw__ - matched text + * - __text__ - normalized text + * - __url__ - link, generated from matched text + **/ +LinkifyIt.prototype.match = function match(text) { + const result = []; + let shift = 0; + + // Try to take previous element from cache, if .test() called before + if (this.__index__ >= 0 && this.__text_cache__ === text) { + result.push(createMatch(this, shift)); + shift = this.__last_index__; } - MarkedString.fromPlainText = fromPlainText; - /** - * Checks whether the given value conforms to the {@link MarkedString} type. - */ - function is(value) { - var candidate = value; - return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value); + + // Cut head if cache was used + let tail = shift ? text.slice(shift) : text; + + // Scan string until end reached + while (this.test(tail)) { + result.push(createMatch(this, shift)); + tail = tail.slice(this.__last_index__); + shift += this.__last_index__; } - MarkedString.is = is; -})(MarkedString || (exports.MarkedString = MarkedString = {})); -var Hover; -(function (Hover) { - /** - * Checks whether the given value conforms to the {@link Hover} interface. - */ - function is(value) { - var candidate = value; - return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range)); + if (result.length) { + return result; } - Hover.is = is; -})(Hover || (exports.Hover = Hover = {})); + return null; +}; + /** - * The ParameterInformation namespace provides helper functions to work with - * {@link ParameterInformation} literals. - */ -var ParameterInformation; -(function (ParameterInformation) { - /** - * Creates a new parameter information literal. - * - * @param label A label string. - * @param documentation A doc string. - */ - function create(label, documentation) { - return documentation ? { - label: label, - documentation: documentation - } : { - label: label - }; + * LinkifyIt#matchAtStart(text) -> Match|null + * + * Returns fully-formed (not fuzzy) link if it starts at the beginning + * of the string, and null otherwise. + **/ +LinkifyIt.prototype.matchAtStart = function matchAtStart(text) { + // Reset scan cache + this.__text_cache__ = text; + this.__index__ = -1; + if (!text.length) return null; + const m = this.re.schema_at_start.exec(text); + if (!m) return null; + const len = this.testSchemaAt(text, m[2], m[0].length); + if (!len) return null; + this.__schema__ = m[2]; + this.__index__ = m.index + m[1].length; + this.__last_index__ = m.index + m[0].length + len; + return createMatch(this, 0); +}; + +/** chainable + * LinkifyIt#tlds(list [, keepOld]) -> this + * - list (Array): list of tlds + * - keepOld (Boolean): merge with current list if `true` (`false` by default) + * + * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) + * to avoid false positives. By default this algorythm used: + * + * - hostname with any 2-letter root zones are ok. + * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф + * are ok. + * - encoded (`xn--...`) root zones are ok. + * + * If list is replaced, then exact match for 2-chars root zones will be checked. + **/ +LinkifyIt.prototype.tlds = function tlds(list, keepOld) { + list = Array.isArray(list) ? list : [list]; + if (!keepOld) { + this.__tlds__ = list.slice(); + this.__tlds_replaced__ = true; + compile(this); + return this; } - ParameterInformation.create = create; -})(ParameterInformation || (exports.ParameterInformation = ParameterInformation = {})); + this.__tlds__ = this.__tlds__.concat(list).sort().filter(function (el, idx, arr) { + return el !== arr[idx - 1]; + }).reverse(); + compile(this); + return this; +}; + /** - * The SignatureInformation namespace provides helper functions to work with - * {@link SignatureInformation} literals. - */ -var SignatureInformation; -(function (SignatureInformation) { - function create(label, documentation) { - var parameters = []; - for (var _i = 2; _i < arguments.length; _i++) { - parameters[_i - 2] = arguments[_i]; - } - var result = { - label: label - }; - if (Is.defined(documentation)) { - result.documentation = documentation; - } - if (Is.defined(parameters)) { - result.parameters = parameters; - } else { - result.parameters = []; - } - return result; + * LinkifyIt#normalize(match) + * + * Default normalizer (if schema does not define it's own). + **/ +LinkifyIt.prototype.normalize = function normalize(match) { + // Do minimal possible changes by default. Need to collect feedback prior + // to move forward https://github.com/markdown-it/linkify-it/issues/1 + + if (!match.schema) { + match.url = 'http://' + match.url; } - SignatureInformation.create = create; -})(SignatureInformation || (exports.SignatureInformation = SignatureInformation = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind.Text = 1; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind.Read = 2; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind.Write = 3; -})(DocumentHighlightKind || (exports.DocumentHighlightKind = DocumentHighlightKind = {})); -/** - * DocumentHighlight namespace to provide helper functions to work with - * {@link DocumentHighlight} literals. - */ -var DocumentHighlight; -(function (DocumentHighlight) { - /** - * Create a DocumentHighlight object. - * @param range The range the highlight applies to. - * @param kind The highlight kind - */ - function create(range, kind) { - var result = { - range: range - }; - if (Is.number(kind)) { - result.kind = kind; - } - return result; + if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { + match.url = 'mailto:' + match.url; } - DocumentHighlight.create = create; -})(DocumentHighlight || (exports.DocumentHighlight = DocumentHighlight = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind.File = 1; - SymbolKind.Module = 2; - SymbolKind.Namespace = 3; - SymbolKind.Package = 4; - SymbolKind.Class = 5; - SymbolKind.Method = 6; - SymbolKind.Property = 7; - SymbolKind.Field = 8; - SymbolKind.Constructor = 9; - SymbolKind.Enum = 10; - SymbolKind.Interface = 11; - SymbolKind.Function = 12; - SymbolKind.Variable = 13; - SymbolKind.Constant = 14; - SymbolKind.String = 15; - SymbolKind.Number = 16; - SymbolKind.Boolean = 17; - SymbolKind.Array = 18; - SymbolKind.Object = 19; - SymbolKind.Key = 20; - SymbolKind.Null = 21; - SymbolKind.EnumMember = 22; - SymbolKind.Struct = 23; - SymbolKind.Event = 24; - SymbolKind.Operator = 25; - SymbolKind.TypeParameter = 26; -})(SymbolKind || (exports.SymbolKind = SymbolKind = {})); +}; + /** - * Symbol tags are extra annotations that tweak the rendering of a symbol. + * LinkifyIt#onCompile() * - * @since 3.16 - */ -var SymbolTag; -(function (SymbolTag) { - /** - * Render a symbol as obsolete, usually using a strike-out. - */ - SymbolTag.Deprecated = 1; -})(SymbolTag || (exports.SymbolTag = SymbolTag = {})); -var SymbolInformation; -(function (SymbolInformation) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the location of the symbol. - * @param uri The resource of the location of symbol. - * @param containerName The name of the symbol containing the symbol. - */ - function create(name, kind, range, uri, containerName) { - var result = { - name: name, - kind: kind, - location: { - uri: uri, - range: range - } - }; - if (containerName) { - result.containerName = containerName; - } - return result; - } - SymbolInformation.create = create; -})(SymbolInformation || (exports.SymbolInformation = SymbolInformation = {})); -var WorkspaceSymbol; -(function (WorkspaceSymbol) { - /** - * Create a new workspace symbol. - * - * @param name The name of the symbol. - * @param kind The kind of the symbol. - * @param uri The resource of the location of the symbol. - * @param range An options range of the location. - * @returns A WorkspaceSymbol. - */ - function create(name, kind, uri, range) { - return range !== undefined ? { - name: name, - kind: kind, - location: { - uri: uri, - range: range - } - } : { - name: name, - kind: kind, - location: { - uri: uri + * Override to modify basic RegExp-s. + **/ +LinkifyIt.prototype.onCompile = function onCompile() {}; +module.exports = LinkifyIt; + +/***/ }), + +/***/ "../../../node_modules/markdown-it/dist/index.cjs.js": +/*!***********************************************************!*\ + !*** ../../../node_modules/markdown-it/dist/index.cjs.js ***! + \***********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var mdurl = __webpack_require__(/*! mdurl */ "../../../node_modules/mdurl/build/index.cjs.js"); +var ucmicro = __webpack_require__(/*! uc.micro */ "../../../node_modules/uc.micro/build/index.cjs.js"); +var entities = __webpack_require__(/*! entities */ "../../../node_modules/entities/lib/index.js"); +var LinkifyIt = __webpack_require__(/*! linkify-it */ "../../../node_modules/linkify-it/build/index.cjs.js"); +var punycode = __webpack_require__(/*! punycode.js */ "../../../node_modules/punycode.js/punycode.es6.js"); +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { + return e[k]; + } + }); } - }; + }); } - WorkspaceSymbol.create = create; -})(WorkspaceSymbol || (exports.WorkspaceSymbol = WorkspaceSymbol = {})); -var DocumentSymbol; -(function (DocumentSymbol) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param detail The detail of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the symbol. - * @param selectionRange The selectionRange of the symbol. - * @param children Children of the symbol. - */ - function create(name, detail, kind, range, selectionRange, children) { - var result = { - name: name, - detail: detail, - kind: kind, - range: range, - selectionRange: selectionRange - }; - if (children !== undefined) { - result.children = children; - } - return result; - } - DocumentSymbol.create = create; - /** - * Checks whether the given literal conforms to the {@link DocumentSymbol} interface. - */ - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === undefined || Is.string(candidate.detail)) && (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) && (candidate.children === undefined || Array.isArray(candidate.children)) && (candidate.tags === undefined || Array.isArray(candidate.tags)); - } - DocumentSymbol.is = is; -})(DocumentSymbol || (exports.DocumentSymbol = DocumentSymbol = {})); -/** - * A set of predefined code action kinds - */ -var CodeActionKind; -(function (CodeActionKind) { - /** - * Empty kind. - */ - CodeActionKind.Empty = ''; - /** - * Base kind for quickfix actions: 'quickfix' - */ - CodeActionKind.QuickFix = 'quickfix'; - /** - * Base kind for refactoring actions: 'refactor' - */ - CodeActionKind.Refactor = 'refactor'; - /** - * Base kind for refactoring extraction actions: 'refactor.extract' - * - * Example extract actions: - * - * - Extract method - * - Extract function - * - Extract variable - * - Extract interface from class - * - ... - */ - CodeActionKind.RefactorExtract = 'refactor.extract'; - /** - * Base kind for refactoring inline actions: 'refactor.inline' - * - * Example inline actions: - * - * - Inline function - * - Inline variable - * - Inline constant - * - ... - */ - CodeActionKind.RefactorInline = 'refactor.inline'; - /** - * Base kind for refactoring rewrite actions: 'refactor.rewrite' - * - * Example rewrite actions: - * - * - Convert JavaScript function to class - * - Add or remove parameter - * - Encapsulate field - * - Make method static - * - Move method to base class - * - ... - */ - CodeActionKind.RefactorRewrite = 'refactor.rewrite'; - /** - * Base kind for source actions: `source` - * - * Source code actions apply to the entire file. - */ - CodeActionKind.Source = 'source'; - /** - * Base kind for an organize imports source action: `source.organizeImports` - */ - CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; - /** - * Base kind for auto-fix source actions: `source.fixAll`. - * - * Fix all actions automatically fix errors that have a clear fix that do not require user input. - * They should not suppress errors or perform unsafe fixes such as generating new types or classes. - * - * @since 3.15.0 - */ - CodeActionKind.SourceFixAll = 'source.fixAll'; -})(CodeActionKind || (exports.CodeActionKind = CodeActionKind = {})); -/** - * The reason why code actions were requested. - * - * @since 3.17.0 - */ -var CodeActionTriggerKind; -(function (CodeActionTriggerKind) { - /** - * Code actions were explicitly requested by the user or by an extension. - */ - CodeActionTriggerKind.Invoked = 1; - /** - * Code actions were requested automatically. - * - * This typically happens when current selection in a file changes, but can - * also be triggered when file content changes. - */ - CodeActionTriggerKind.Automatic = 2; -})(CodeActionTriggerKind || (exports.CodeActionTriggerKind = CodeActionTriggerKind = {})); -/** - * The CodeActionContext namespace provides helper functions to work with - * {@link CodeActionContext} literals. - */ -var CodeActionContext; -(function (CodeActionContext) { - /** - * Creates a new CodeActionContext literal. - */ - function create(diagnostics, only, triggerKind) { - var result = { - diagnostics: diagnostics - }; - if (only !== undefined && only !== null) { - result.only = only; + n.default = e; + return Object.freeze(n); +} +var mdurl__namespace = /*#__PURE__*/_interopNamespaceDefault(mdurl); +var ucmicro__namespace = /*#__PURE__*/_interopNamespaceDefault(ucmicro); + +// Utilities +// + +function _class(obj) { + return Object.prototype.toString.call(obj); +} +function isString(obj) { + return _class(obj) === '[object String]'; +} +const _hasOwnProperty = Object.prototype.hasOwnProperty; +function has(object, key) { + return _hasOwnProperty.call(object, key); +} + +// Merge objects +// +function assign(obj /* from1, from2, from3, ... */) { + const sources = Array.prototype.slice.call(arguments, 1); + sources.forEach(function (source) { + if (!source) { + return; } - if (triggerKind !== undefined && triggerKind !== null) { - result.triggerKind = triggerKind; + if (typeof source !== 'object') { + throw new TypeError(source + 'must be object'); } - return result; + Object.keys(source).forEach(function (key) { + obj[key] = source[key]; + }); + }); + return obj; +} + +// Remove element from array and put another array at those position. +// Useful for some operations with tokens +function arrayReplaceAt(src, pos, newElements) { + return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); +} +function isValidEntityCode(c) { + /* eslint no-bitwise:0 */ + // broken sequence + if (c >= 0xD800 && c <= 0xDFFF) { + return false; } - CodeActionContext.create = create; - /** - * Checks whether the given literal conforms to the {@link CodeActionContext} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic); + // never used + if (c >= 0xFDD0 && c <= 0xFDEF) { + return false; } - CodeActionContext.is = is; -})(CodeActionContext || (exports.CodeActionContext = CodeActionContext = {})); -var CodeAction; -(function (CodeAction) { - function create(title, kindOrCommandOrEdit, kind) { - var result = { - title: title - }; - var checkKind = true; - if (typeof kindOrCommandOrEdit === 'string') { - checkKind = false; - result.kind = kindOrCommandOrEdit; - } else if (Command.is(kindOrCommandOrEdit)) { - result.command = kindOrCommandOrEdit; - } else { - result.edit = kindOrCommandOrEdit; - } - if (checkKind && kind !== undefined) { - result.kind = kind; - } - return result; + if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { + return false; } - CodeAction.create = create; - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.title) && (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === undefined || Is.string(candidate.kind)) && (candidate.edit !== undefined || candidate.command !== undefined) && (candidate.command === undefined || Command.is(candidate.command)) && (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) && (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit)); + // control codes + if (c >= 0x00 && c <= 0x08) { + return false; } - CodeAction.is = is; -})(CodeAction || (exports.CodeAction = CodeAction = {})); -/** - * The CodeLens namespace provides helper functions to work with - * {@link CodeLens} literals. - */ -var CodeLens; -(function (CodeLens) { - /** - * Creates a new CodeLens literal. - */ - function create(range, data) { - var result = { - range: range - }; - if (Is.defined(data)) { - result.data = data; - } - return result; + if (c === 0x0B) { + return false; } - CodeLens.create = create; - /** - * Checks whether the given literal conforms to the {@link CodeLens} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + if (c >= 0x0E && c <= 0x1F) { + return false; } - CodeLens.is = is; -})(CodeLens || (exports.CodeLens = CodeLens = {})); -/** - * The FormattingOptions namespace provides helper functions to work with - * {@link FormattingOptions} literals. - */ -var FormattingOptions; -(function (FormattingOptions) { - /** - * Creates a new FormattingOptions literal. - */ - function create(tabSize, insertSpaces) { - return { - tabSize: tabSize, - insertSpaces: insertSpaces - }; + if (c >= 0x7F && c <= 0x9F) { + return false; } - FormattingOptions.create = create; - /** - * Checks whether the given literal conforms to the {@link FormattingOptions} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + // out of range + if (c > 0x10FFFF) { + return false; } - FormattingOptions.is = is; -})(FormattingOptions || (exports.FormattingOptions = FormattingOptions = {})); -/** - * The DocumentLink namespace provides helper functions to work with - * {@link DocumentLink} literals. - */ -var DocumentLink; -(function (DocumentLink) { - /** - * Creates a new DocumentLink literal. - */ - function create(range, target, data) { - return { - range: range, - target: target, - data: data - }; + return true; +} +function fromCodePoint(c) { + /* eslint no-bitwise:0 */ + if (c > 0xffff) { + c -= 0x10000; + const surrogate1 = 0xd800 + (c >> 10); + const surrogate2 = 0xdc00 + (c & 0x3ff); + return String.fromCharCode(surrogate1, surrogate2); } - DocumentLink.create = create; - /** - * Checks whether the given literal conforms to the {@link DocumentLink} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + return String.fromCharCode(c); +} +const UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g; +const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; +const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi'); +const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i; +function replaceEntityPattern(match, name) { + if (name.charCodeAt(0) === 0x23 /* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { + const code = name[1].toLowerCase() === 'x' ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10); + if (isValidEntityCode(code)) { + return fromCodePoint(code); + } + return match; } - DocumentLink.is = is; -})(DocumentLink || (exports.DocumentLink = DocumentLink = {})); -/** - * The SelectionRange namespace provides helper function to work with - * SelectionRange literals. - */ -var SelectionRange; -(function (SelectionRange) { - /** - * Creates a new SelectionRange - * @param range the range. - * @param parent an optional parent. - */ - function create(range, parent) { - return { - range: range, - parent: parent - }; + const decoded = entities.decodeHTML(match); + if (decoded !== match) { + return decoded; } - SelectionRange.create = create; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); + return match; +} + +/* function replaceEntities(str) { + if (str.indexOf('&') < 0) { return str; } + + return str.replace(ENTITY_RE, replaceEntityPattern); +} */ + +function unescapeMd(str) { + if (str.indexOf('\\') < 0) { + return str; } - SelectionRange.is = is; -})(SelectionRange || (exports.SelectionRange = SelectionRange = {})); -/** - * A set of predefined token types. This set is not fixed - * an clients can specify additional token types via the - * corresponding client capabilities. - * - * @since 3.16.0 - */ -var SemanticTokenTypes; -(function (SemanticTokenTypes) { - SemanticTokenTypes["namespace"] = "namespace"; - /** - * Represents a generic type. Acts as a fallback for types which can't be mapped to - * a specific type like class or enum. - */ - SemanticTokenTypes["type"] = "type"; - SemanticTokenTypes["class"] = "class"; - SemanticTokenTypes["enum"] = "enum"; - SemanticTokenTypes["interface"] = "interface"; - SemanticTokenTypes["struct"] = "struct"; - SemanticTokenTypes["typeParameter"] = "typeParameter"; - SemanticTokenTypes["parameter"] = "parameter"; - SemanticTokenTypes["variable"] = "variable"; - SemanticTokenTypes["property"] = "property"; - SemanticTokenTypes["enumMember"] = "enumMember"; - SemanticTokenTypes["event"] = "event"; - SemanticTokenTypes["function"] = "function"; - SemanticTokenTypes["method"] = "method"; - SemanticTokenTypes["macro"] = "macro"; - SemanticTokenTypes["keyword"] = "keyword"; - SemanticTokenTypes["modifier"] = "modifier"; - SemanticTokenTypes["comment"] = "comment"; - SemanticTokenTypes["string"] = "string"; - SemanticTokenTypes["number"] = "number"; - SemanticTokenTypes["regexp"] = "regexp"; - SemanticTokenTypes["operator"] = "operator"; - /** - * @since 3.17.0 - */ - SemanticTokenTypes["decorator"] = "decorator"; -})(SemanticTokenTypes || (exports.SemanticTokenTypes = SemanticTokenTypes = {})); -/** - * A set of predefined token modifiers. This set is not fixed - * an clients can specify additional token types via the - * corresponding client capabilities. - * - * @since 3.16.0 - */ -var SemanticTokenModifiers; -(function (SemanticTokenModifiers) { - SemanticTokenModifiers["declaration"] = "declaration"; - SemanticTokenModifiers["definition"] = "definition"; - SemanticTokenModifiers["readonly"] = "readonly"; - SemanticTokenModifiers["static"] = "static"; - SemanticTokenModifiers["deprecated"] = "deprecated"; - SemanticTokenModifiers["abstract"] = "abstract"; - SemanticTokenModifiers["async"] = "async"; - SemanticTokenModifiers["modification"] = "modification"; - SemanticTokenModifiers["documentation"] = "documentation"; - SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary"; -})(SemanticTokenModifiers || (exports.SemanticTokenModifiers = SemanticTokenModifiers = {})); -/** - * @since 3.16.0 - */ -var SemanticTokens; -(function (SemanticTokens) { - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number'); + return str.replace(UNESCAPE_MD_RE, '$1'); +} +function unescapeAll(str) { + if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { + return str; } - SemanticTokens.is = is; -})(SemanticTokens || (exports.SemanticTokens = SemanticTokens = {})); -/** - * The InlineValueText namespace provides functions to deal with InlineValueTexts. - * - * @since 3.17.0 - */ -var InlineValueText; -(function (InlineValueText) { - /** - * Creates a new InlineValueText literal. - */ - function create(range, text) { - return { - range: range, - text: text - }; + return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) { + if (escaped) { + return escaped; + } + return replaceEntityPattern(match, entity); + }); +} +const HTML_ESCAPE_TEST_RE = /[&<>"]/; +const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; +const HTML_REPLACEMENTS = { + '&': '&', + '<': '<', + '>': '>', + '"': '"' +}; +function replaceUnsafeChar(ch) { + return HTML_REPLACEMENTS[ch]; +} +function escapeHtml(str) { + if (HTML_ESCAPE_TEST_RE.test(str)) { + return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); } - InlineValueText.create = create; - function is(value) { - var candidate = value; - return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text); + return str; +} +const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; +function escapeRE(str) { + return str.replace(REGEXP_ESCAPE_RE, '\\$&'); +} +function isSpace(code) { + switch (code) { + case 0x09: + case 0x20: + return true; } - InlineValueText.is = is; -})(InlineValueText || (exports.InlineValueText = InlineValueText = {})); -/** - * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups. - * - * @since 3.17.0 - */ -var InlineValueVariableLookup; -(function (InlineValueVariableLookup) { - /** - * Creates a new InlineValueText literal. - */ - function create(range, variableName, caseSensitiveLookup) { - return { - range: range, - variableName: variableName, - caseSensitiveLookup: caseSensitiveLookup - }; - } - InlineValueVariableLookup.create = create; - function is(value) { - var candidate = value; - return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === undefined); - } - InlineValueVariableLookup.is = is; -})(InlineValueVariableLookup || (exports.InlineValueVariableLookup = InlineValueVariableLookup = {})); -/** - * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression. - * - * @since 3.17.0 - */ -var InlineValueEvaluatableExpression; -(function (InlineValueEvaluatableExpression) { - /** - * Creates a new InlineValueEvaluatableExpression literal. - */ - function create(range, expression) { - return { - range: range, - expression: expression - }; - } - InlineValueEvaluatableExpression.create = create; - function is(value) { - var candidate = value; - return candidate !== undefined && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === undefined); - } - InlineValueEvaluatableExpression.is = is; -})(InlineValueEvaluatableExpression || (exports.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {})); -/** - * The InlineValueContext namespace provides helper functions to work with - * {@link InlineValueContext} literals. - * - * @since 3.17.0 - */ -var InlineValueContext; -(function (InlineValueContext) { - /** - * Creates a new InlineValueContext literal. - */ - function create(frameId, stoppedLocation) { - return { - frameId: frameId, - stoppedLocation: stoppedLocation - }; - } - InlineValueContext.create = create; - /** - * Checks whether the given literal conforms to the {@link InlineValueContext} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(value.stoppedLocation); + return false; +} + +// Zs (unicode class) || [\t\f\v\r\n] +function isWhiteSpace(code) { + if (code >= 0x2000 && code <= 0x200A) { + return true; } - InlineValueContext.is = is; -})(InlineValueContext || (exports.InlineValueContext = InlineValueContext = {})); -/** - * Inlay hint kinds. - * - * @since 3.17.0 - */ -var InlayHintKind; -(function (InlayHintKind) { - /** - * An inlay hint that for a type annotation. - */ - InlayHintKind.Type = 1; - /** - * An inlay hint that is for a parameter. - */ - InlayHintKind.Parameter = 2; - function is(value) { - return value === 1 || value === 2; + switch (code) { + case 0x09: // \t + case 0x0A: // \n + case 0x0B: // \v + case 0x0C: // \f + case 0x0D: // \r + case 0x20: + case 0xA0: + case 0x1680: + case 0x202F: + case 0x205F: + case 0x3000: + return true; } - InlayHintKind.is = is; -})(InlayHintKind || (exports.InlayHintKind = InlayHintKind = {})); -var InlayHintLabelPart; -(function (InlayHintLabelPart) { - function create(value) { - return { - value: value - }; + return false; +} + +/* eslint-disable max-len */ + +// Currently without astral characters support. +function isPunctChar(ch) { + return ucmicro__namespace.P.test(ch) || ucmicro__namespace.S.test(ch); +} + +// Markdown ASCII punctuation characters. +// +// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ +// http://spec.commonmark.org/0.15/#ascii-punctuation-character +// +// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. +// +function isMdAsciiPunct(ch) { + switch (ch) { + case 0x21 /* ! */: + case 0x22 /* " */: + case 0x23 /* # */: + case 0x24 /* $ */: + case 0x25 /* % */: + case 0x26 /* & */: + case 0x27 /* ' */: + case 0x28 /* ( */: + case 0x29 /* ) */: + case 0x2A /* * */: + case 0x2B /* + */: + case 0x2C /* , */: + case 0x2D /* - */: + case 0x2E /* . */: + case 0x2F /* / */: + case 0x3A /* : */: + case 0x3B /* ; */: + case 0x3C /* < */: + case 0x3D /* = */: + case 0x3E /* > */: + case 0x3F /* ? */: + case 0x40 /* @ */: + case 0x5B /* [ */: + case 0x5C /* \ */: + case 0x5D /* ] */: + case 0x5E /* ^ */: + case 0x5F /* _ */: + case 0x60 /* ` */: + case 0x7B /* { */: + case 0x7C /* | */: + case 0x7D /* } */: + case 0x7E /* ~ */: + return true; + default: + return false; } - InlayHintLabelPart.create = create; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === undefined || Location.is(candidate.location)) && (candidate.command === undefined || Command.is(candidate.command)); +} + +// Hepler to unify [reference labels]. +// +function normalizeReference(str) { + // Trim and collapse whitespace + // + str = str.trim().replace(/\s+/g, ' '); + + // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug + // fixed in v12 (couldn't find any details). + // + // So treat this one as a special case + // (remove this when node v10 is no longer supported). + // + if ('ẞ'.toLowerCase() === 'Ṿ') { + str = str.replace(/ẞ/g, 'ß'); } - InlayHintLabelPart.is = is; -})(InlayHintLabelPart || (exports.InlayHintLabelPart = InlayHintLabelPart = {})); -var InlayHint; -(function (InlayHint) { - function create(position, label, kind) { - var result = { - position: position, - label: label - }; - if (kind !== undefined) { - result.kind = kind; + + // .toLowerCase().toUpperCase() should get rid of all differences + // between letter variants. + // + // Simple .toLowerCase() doesn't normalize 125 code points correctly, + // and .toUpperCase doesn't normalize 6 of them (list of exceptions: + // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently + // uppercased versions). + // + // Here's an example showing how it happens. Lets take greek letter omega: + // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ) + // + // Unicode entries: + // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8; + // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 + // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 + // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8; + // + // Case-insensitive comparison should treat all of them as equivalent. + // + // But .toLowerCase() doesn't change ϑ (it's already lowercase), + // and .toUpperCase() doesn't change ϴ (already uppercase). + // + // Applying first lower then upper case normalizes any character: + // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398' + // + // Note: this is equivalent to unicode case folding; unicode normalization + // is a different step that is not required here. + // + // Final result should be uppercased, because it's later stored in an object + // (this avoid a conflict with Object.prototype members, + // most notably, `__proto__`) + // + return str.toLowerCase().toUpperCase(); +} + +// Re-export libraries commonly used in both markdown-it and its plugins, +// so plugins won't have to depend on them explicitly, which reduces their +// bundled size (e.g. a browser build). +// +const lib = { + mdurl: mdurl__namespace, + ucmicro: ucmicro__namespace +}; +var utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + arrayReplaceAt: arrayReplaceAt, + assign: assign, + escapeHtml: escapeHtml, + escapeRE: escapeRE, + fromCodePoint: fromCodePoint, + has: has, + isMdAsciiPunct: isMdAsciiPunct, + isPunctChar: isPunctChar, + isSpace: isSpace, + isString: isString, + isValidEntityCode: isValidEntityCode, + isWhiteSpace: isWhiteSpace, + lib: lib, + normalizeReference: normalizeReference, + unescapeAll: unescapeAll, + unescapeMd: unescapeMd +}); + +// Parse link label +// +// this function assumes that first character ("[") already matches; +// returns the end of the label +// + +function parseLinkLabel(state, start, disableNested) { + let level, found, marker, prevPos; + const max = state.posMax; + const oldPos = state.pos; + state.pos = start + 1; + level = 1; + while (state.pos < max) { + marker = state.src.charCodeAt(state.pos); + if (marker === 0x5D /* ] */) { + level--; + if (level === 0) { + found = true; + break; + } + } + prevPos = state.pos; + state.md.inline.skipToken(state); + if (marker === 0x5B /* [ */) { + if (prevPos === state.pos - 1) { + // increase level if we find text `[`, which is not a part of any token + level++; + } else if (disableNested) { + state.pos = oldPos; + return -1; + } } - return result; - } - InlayHint.create = create; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === undefined || InlayHintKind.is(candidate.kind)) && candidate.textEdits === undefined || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight)); - } - InlayHint.is = is; -})(InlayHint || (exports.InlayHint = InlayHint = {})); -var WorkspaceFolder; -(function (WorkspaceFolder) { - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name); - } - WorkspaceFolder.is = is; -})(WorkspaceFolder || (exports.WorkspaceFolder = WorkspaceFolder = {})); -var EOL = exports.EOL = ['\n', '\r\n', '\r']; -/** - * @deprecated Use the text document from the new vscode-languageserver-textdocument package. - */ -var TextDocument; -(function (TextDocument) { - /** - * Creates a new ITextDocument literal from the given uri and content. - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param version The document's version. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new FullTextDocument(uri, languageId, version, content); } - TextDocument.create = create; - /** - * Checks whether the given literal conforms to the {@link ITextDocument} interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + let labelEnd = -1; + if (found) { + labelEnd = state.pos; } - TextDocument.is = is; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits, function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; + + // restore old state + state.pos = oldPos; + return labelEnd; +} + +// Parse link destination +// + +function parseLinkDestination(str, start, max) { + let code; + let pos = start; + const result = { + ok: false, + pos: 0, + str: '' + }; + if (str.charCodeAt(pos) === 0x3C /* < */) { + pos++; + while (pos < max) { + code = str.charCodeAt(pos); + if (code === 0x0A /* \n */) { + return result; } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } else { - throw new Error('Overlapping edit'); + if (code === 0x3C /* < */) { + return result; } - lastModifiedOffset = startOffset; + if (code === 0x3E /* > */) { + result.pos = pos + 1; + result.str = unescapeAll(str.slice(start + 1, pos)); + result.ok = true; + return result; + } + if (code === 0x5C /* \ */ && pos + 1 < max) { + pos += 2; + continue; + } + pos++; } - return text; + + // no closing '>' + return result; } - TextDocument.applyEdits = applyEdits; - function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; + + // this should be ... } else { ... branch + + let level = 0; + while (pos < max) { + code = str.charCodeAt(pos); + if (code === 0x20) { + break; } - var p = data.length / 2 | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } else { - // greater -> take right - data[i++] = right[rightIdx++]; + + // ascii control characters + if (code < 0x20 || code === 0x7F) { + break; + } + if (code === 0x5C /* \ */ && pos + 1 < max) { + if (str.charCodeAt(pos + 1) === 0x20) { + break; } + pos += 2; + continue; } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; + if (code === 0x28 /* ( */) { + level++; + if (level > 32) { + return result; + } } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; + if (code === 0x29 /* ) */) { + if (level === 0) { + break; + } + level--; } - return data; + pos++; } -})(TextDocument || (exports.TextDocument = TextDocument = {})); -/** - * @deprecated Use the text document from the new vscode-languageserver-textdocument package. - */ -var FullTextDocument = /** @class */function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; + if (start === pos) { + return result; } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: false, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (event, version) { - this._content = event.text; - this._version = version; - this._lineOffsets = undefined; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - var lineOffsets = []; - var text = this._content; - var isLineStart = true; - for (var i = 0; i < text.length; i++) { - if (isLineStart) { - lineOffsets.push(i); - isLineStart = false; - } - var ch = text.charAt(i); - isLineStart = ch === '\r' || ch === '\n'; - if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { - i++; - } - } - if (isLineStart && text.length > 0) { - lineOffsets.push(text.length); - } - this._lineOffsets = lineOffsets; - } - return this._lineOffsets; + if (level !== 0) { + return result; + } + result.str = unescapeAll(str.slice(start, pos)); + result.pos = pos; + result.ok = true; + return result; +} + +// Parse link title +// + +// Parse link title within `str` in [start, max] range, +// or continue previous parsing if `prev_state` is defined (equal to result of last execution). +// +function parseLinkTitle(str, start, max, prev_state) { + let code; + let pos = start; + const state = { + // if `true`, this is a valid link title + ok: false, + // if `true`, this link can be continued on the next line + can_continue: false, + // if `ok`, it's the position of the first character after the closing marker + pos: 0, + // if `ok`, it's the unescaped title + str: '', + // expected closing marker character code + marker: 0 }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, - high = lineOffsets.length; - if (high === 0) { - return Position.create(0, offset); + if (prev_state) { + // this is a continuation of a previous parseLinkTitle call on the next line, + // used in reference links only + state.str = prev_state.str; + state.marker = prev_state.marker; + } else { + if (pos >= max) { + return state; } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } else { - low = mid + 1; - } + let marker = str.charCodeAt(pos); + if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { + return state; } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return Position.create(line, offset - lineOffsets[line]); - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } else if (position.line < 0) { - return 0; + start++; + pos++; + + // if opening marker is "(", switch it to closing marker ")" + if (marker === 0x28) { + marker = 0x29; } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: false, - configurable: true - }); - return FullTextDocument; -}(); -var Is; -(function (Is) { - var toString = Object.prototype.toString; - function defined(value) { - return typeof value !== 'undefined'; - } - Is.defined = defined; - function undefined(value) { - return typeof value === 'undefined'; - } - Is.undefined = undefined; - function boolean(value) { - return value === true || value === false; - } - Is.boolean = boolean; - function string(value) { - return toString.call(value) === '[object String]'; - } - Is.string = string; - function number(value) { - return toString.call(value) === '[object Number]'; - } - Is.number = number; - function numberRange(value, min, max) { - return toString.call(value) === '[object Number]' && min <= value && value <= max; - } - Is.numberRange = numberRange; - function integer(value) { - return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647; - } - Is.integer = integer; - function uinteger(value) { - return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647; - } - Is.uinteger = uinteger; - function func(value) { - return toString.call(value) === '[object Function]'; - } - Is.func = func; - function objectLiteral(value) { - // Strictly speaking class instances pass this check as well. Since the LSP - // doesn't use classes we ignore this for now. If we do we need to add something - // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` - return value !== null && typeof value === 'object'; + state.marker = marker; } - Is.objectLiteral = objectLiteral; - function typedArray(value, check) { - return Array.isArray(value) && value.every(check); + while (pos < max) { + code = str.charCodeAt(pos); + if (code === state.marker) { + state.pos = pos + 1; + state.str += unescapeAll(str.slice(start, pos)); + state.ok = true; + return state; + } else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) { + return state; + } else if (code === 0x5C /* \ */ && pos + 1 < max) { + pos++; + } + pos++; } - Is.typedArray = typedArray; -})(Is || (Is = {})); -/***/ }), + // no closing marker found, but this link title may continue on the next line (for references) + state.can_continue = true; + state.str += unescapeAll(str.slice(start, pos)); + return state; +} -/***/ "../../graphiql-react/dist/SchemaReference.cjs.js": -/*!********************************************************!*\ - !*** ../../graphiql-react/dist/SchemaReference.cjs.js ***! - \********************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +// Just a shortcut for bulk export +var helpers = /*#__PURE__*/Object.freeze({ + __proto__: null, + parseLinkDestination: parseLinkDestination, + parseLinkLabel: parseLinkLabel, + parseLinkTitle: parseLinkTitle +}); +/** + * class Renderer + * + * Generates HTML from parsed token stream. Each instance has independent + * copy of rules. Those can be rewritten with ease. Also, you can add new + * rules if you create plugin and adds new token types. + **/ -const graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); -const forEachState = __webpack_require__(/*! ./forEachState.cjs.js */ "../../graphiql-react/dist/forEachState.cjs.js"); -function getTypeInfo(schema, tokenState) { - const info = { - schema, - type: null, - parentType: null, - inputType: null, - directiveDef: null, - fieldDef: null, - argDef: null, - argDefs: null, - objectFieldDefs: null - }; - forEachState.forEachState(tokenState, state => { - var _a, _b; - switch (state.kind) { - case "Query": - case "ShortQuery": - info.type = schema.getQueryType(); - break; - case "Mutation": - info.type = schema.getMutationType(); - break; - case "Subscription": - info.type = schema.getSubscriptionType(); - break; - case "InlineFragment": - case "FragmentDefinition": - if (state.type) { - info.type = schema.getType(state.type); - } - break; - case "Field": - case "AliasedField": - info.fieldDef = info.type && state.name ? getFieldDef(schema, info.parentType, state.name) : null; - info.type = (_a = info.fieldDef) === null || _a === void 0 ? void 0 : _a.type; - break; - case "SelectionSet": - info.parentType = info.type ? graphql.getNamedType(info.type) : null; - break; - case "Directive": - info.directiveDef = state.name ? schema.getDirective(state.name) : null; - break; - case "Arguments": - const parentDef = state.prevState ? state.prevState.kind === "Field" ? info.fieldDef : state.prevState.kind === "Directive" ? info.directiveDef : state.prevState.kind === "AliasedField" ? state.prevState.name && getFieldDef(schema, info.parentType, state.prevState.name) : null : null; - info.argDefs = parentDef ? parentDef.args : null; - break; - case "Argument": - info.argDef = null; - if (info.argDefs) { - for (let i = 0; i < info.argDefs.length; i++) { - if (info.argDefs[i].name === state.name) { - info.argDef = info.argDefs[i]; - break; - } - } - } - info.inputType = (_b = info.argDef) === null || _b === void 0 ? void 0 : _b.type; - break; - case "EnumValue": - const enumType = info.inputType ? graphql.getNamedType(info.inputType) : null; - info.enumValue = enumType instanceof graphql.GraphQLEnumType ? find(enumType.getValues(), val => val.value === state.name) : null; - break; - case "ListValue": - const nullableType = info.inputType ? graphql.getNullableType(info.inputType) : null; - info.inputType = nullableType instanceof graphql.GraphQLList ? nullableType.ofType : null; - break; - case "ObjectValue": - const objectType = info.inputType ? graphql.getNamedType(info.inputType) : null; - info.objectFieldDefs = objectType instanceof graphql.GraphQLInputObjectType ? objectType.getFields() : null; - break; - case "ObjectField": - const objectField = state.name && info.objectFieldDefs ? info.objectFieldDefs[state.name] : null; - info.inputType = objectField === null || objectField === void 0 ? void 0 : objectField.type; - info.fieldDef = objectField; - break; - case "NamedType": - info.type = state.name ? schema.getType(state.name) : null; - break; - } - }); - return info; -} -function getFieldDef(schema, type, fieldName) { - if (fieldName === graphql.SchemaMetaFieldDef.name && schema.getQueryType() === type) { - return graphql.SchemaMetaFieldDef; - } - if (fieldName === graphql.TypeMetaFieldDef.name && schema.getQueryType() === type) { - return graphql.TypeMetaFieldDef; +const default_rules = {}; +default_rules.code_inline = function (tokens, idx, options, env, slf) { + const token = tokens[idx]; + return '' + escapeHtml(token.content) + '
'; +}; +default_rules.code_block = function (tokens, idx, options, env, slf) { + const token = tokens[idx]; + return '' + escapeHtml(tokens[idx].content) + '\n'; +}; +default_rules.fence = function (tokens, idx, options, env, slf) { + const token = tokens[idx]; + const info = token.info ? unescapeAll(token.info).trim() : ''; + let langName = ''; + let langAttrs = ''; + if (info) { + const arr = info.split(/(\s+)/g); + langName = arr[0]; + langAttrs = arr.slice(2).join(''); } - if (fieldName === graphql.TypeNameMetaFieldDef.name && graphql.isCompositeType(type)) { - return graphql.TypeNameMetaFieldDef; + let highlighted; + if (options.highlight) { + highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content); + } else { + highlighted = escapeHtml(token.content); } - if (type && type.getFields) { - return type.getFields()[fieldName]; + if (highlighted.indexOf('${highlighted}\n`; + } + return `
${highlighted}
\n`; +}; +default_rules.image = function (tokens, idx, options, env, slf) { + const token = tokens[idx]; -/***/ "../../graphiql-react/dist/brace-fold.cjs.js": -/*!***************************************************!*\ - !*** ../../graphiql-react/dist/brace-fold.cjs.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + // "alt" attr MUST be set, even if empty. Because it's mandatory and + // should be placed on proper position for tests. + // + // Replace content with actual value + token.attrs[token.attrIndex('alt')][1] = slf.renderInlineAsText(token.children, options, env); + return slf.renderToken(tokens, idx, options); +}; +default_rules.hardbreak = function (tokens, idx, options /*, env */) { + return options.xhtmlOut ? '
\n' : '
\n'; +}; +default_rules.softbreak = function (tokens, idx, options /*, env */) { + return options.breaks ? options.xhtmlOut ? '
\n' : '
\n' : '\n'; +}; +default_rules.text = function (tokens, idx /*, options, env */) { + return escapeHtml(tokens[idx].content); +}; +default_rules.html_block = function (tokens, idx /*, options, env */) { + return tokens[idx].content; +}; +default_rules.html_inline = function (tokens, idx /*, options, env */) { + return tokens[idx].content; +}; +/** + * new Renderer() + * + * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults. + **/ +function Renderer() { + /** + * Renderer#rules -> Object + * + * Contains render rules for tokens. Can be updated and extended. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.renderer.rules.strong_open = function () { return ''; }; + * md.renderer.rules.strong_close = function () { return ''; }; + * + * var result = md.renderInline(...); + * ``` + * + * Each rule is called as independent static function with fixed signature: + * + * ```javascript + * function my_token_render(tokens, idx, options, env, renderer) { + * // ... + * return renderedHTML; + * } + * ``` + * + * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs) + * for more details and examples. + **/ + this.rules = assign({}, default_rules); +} -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - } +/** + * Renderer.renderAttrs(token) -> String + * + * Render token attributes to string. + **/ +Renderer.prototype.renderAttrs = function renderAttrs(token) { + let i, l, result; + if (!token.attrs) { + return ''; } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); -} -var braceFold$2 = { - exports: {} + result = ''; + for (i = 0, l = token.attrs.length; i < l; i++) { + result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"'; + } + return result; }; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - function bracketFolding(pairs) { - return function (cm, start) { - var line = start.line, - lineText = cm.getLine(line); - function findOpening(pair) { - var tokenType; - for (var at = start.ch, pass = 0;;) { - var found2 = at <= 0 ? -1 : lineText.lastIndexOf(pair[0], at - 1); - if (found2 == -1) { - if (pass == 1) break; - pass = 1; - at = lineText.length; - continue; - } - if (pass == 1 && found2 < start.ch) break; - tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found2 + 1)); - if (!/^(comment|string)/.test(tokenType)) return { - ch: found2 + 1, - tokenType, - pair - }; - at = found2 - 1; - } - } - function findRange(found2) { - var count = 1, - lastLine = cm.lastLine(), - end, - startCh = found2.ch, - endCh; - outer: for (var i2 = line; i2 <= lastLine; ++i2) { - var text = cm.getLine(i2), - pos = i2 == line ? startCh : 0; - for (;;) { - var nextOpen = text.indexOf(found2.pair[0], pos), - nextClose = text.indexOf(found2.pair[1], pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (cm.getTokenTypeAt(CodeMirror.Pos(i2, pos + 1)) == found2.tokenType) { - if (pos == nextOpen) ++count;else if (! --count) { - end = i2; - endCh = pos; - break outer; - } - } - ++pos; - } - } - if (end == null || line == end) return null; - return { - from: CodeMirror.Pos(line, startCh), - to: CodeMirror.Pos(end, endCh) - }; - } - var found = []; - for (var i = 0; i < pairs.length; i++) { - var open = findOpening(pairs[i]); - if (open) found.push(open); - } - found.sort(function (a, b) { - return a.ch - b.ch; - }); - for (var i = 0; i < found.length; i++) { - var range = findRange(found[i]); - if (range) return range; - } - return null; - }; - } - CodeMirror.registerHelper("fold", "brace", bracketFolding([["{", "}"], ["[", "]"]])); - CodeMirror.registerHelper("fold", "brace-paren", bracketFolding([["{", "}"], ["[", "]"], ["(", ")"]])); - CodeMirror.registerHelper("fold", "import", function (cm, start) { - function hasImport(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start2 = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start2.string)) start2 = cm.getTokenAt(CodeMirror.Pos(line, start2.end + 1)); - if (start2.type != "keyword" || start2.string != "import") return null; - for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { - var text = cm.getLine(i), - semi = text.indexOf(";"); - if (semi != -1) return { - startCh: start2.end, - end: CodeMirror.Pos(i, semi) - }; - } - } - var startLine = start.line, - has = hasImport(startLine), - prev; - if (!has || hasImport(startLine - 1) || (prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1) return null; - for (var end = has.end;;) { - var next = hasImport(end.line + 1); - if (next == null) break; - end = next.end; - } - return { - from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), - to: end - }; - }); - CodeMirror.registerHelper("fold", "include", function (cm, start) { - function hasInclude(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start2 = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start2.string)) start2 = cm.getTokenAt(CodeMirror.Pos(line, start2.end + 1)); - if (start2.type == "meta" && start2.string.slice(0, 8) == "#include") return start2.start + 8; - } - var startLine = start.line, - has = hasInclude(startLine); - if (has == null || hasInclude(startLine - 1) != null) return null; - for (var end = startLine;;) { - var next = hasInclude(end + 1); - if (next == null) break; - ++end; - } - return { - from: CodeMirror.Pos(startLine, has + 1), - to: cm.clipPos(CodeMirror.Pos(end)) - }; - }); - }); -})(); -var braceFoldExports = braceFold$2.exports; -const braceFold = /* @__PURE__ */codemirror.getDefaultExportFromCjs(braceFoldExports); -const braceFold$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: braceFold -}, [braceFoldExports]); -exports.braceFold = braceFold$1; -/***/ }), +/** + * Renderer.renderToken(tokens, idx, options) -> String + * - tokens (Array): list of tokens + * - idx (Numbed): token index to render + * - options (Object): params of parser instance + * + * Default token renderer. Can be overriden by custom function + * in [[Renderer#rules]]. + **/ +Renderer.prototype.renderToken = function renderToken(tokens, idx, options) { + const token = tokens[idx]; + let result = ''; -/***/ "../../graphiql-react/dist/closebrackets.cjs.js": -/*!******************************************************!*\ - !*** ../../graphiql-react/dist/closebrackets.cjs.js ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + // Tight list paragraphs + if (token.hidden) { + return ''; + } + // Insert a newline between hidden paragraph and subsequent opening + // block-level tag. + // + // For example, here we should insert a newline before blockquote: + // - a + // > + // + if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) { + result += '\n'; + } + // Add token name, e.g. ` e[k] - }); - } + // Encode attributes, e.g. ``. + // + needLf = false; } } } } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); -} -var closebrackets$2 = { - exports: {} + result += needLf ? '>\n' : '>'; + return result; }; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - var defaults = { - pairs: `()[]{}''""`, - closeBefore: `)]}'":;>`, - triples: "", - explode: "[]{}" - }; - var Pos = CodeMirror.Pos; - CodeMirror.defineOption("autoCloseBrackets", false, function (cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.removeKeyMap(keyMap); - cm.state.closeBrackets = null; - } - if (val) { - ensureBound(getOption(val, "pairs")); - cm.state.closeBrackets = val; - cm.addKeyMap(keyMap); - } - }); - function getOption(conf, name) { - if (name == "pairs" && typeof conf == "string") return conf; - if (typeof conf == "object" && conf[name] != null) return conf[name]; - return defaults[name]; - } - var keyMap = { - Backspace: handleBackspace, - Enter: handleEnter - }; - function ensureBound(chars) { - for (var i = 0; i < chars.length; i++) { - var ch = chars.charAt(i), - key = "'" + ch + "'"; - if (!keyMap[key]) keyMap[key] = handler(ch); - } + +/** + * Renderer.renderInline(tokens, options, env) -> String + * - tokens (Array): list on block tokens to render + * - options (Object): params of parser instance + * - env (Object): additional data from parsed input (references, for example) + * + * The same as [[Renderer.render]], but for single token of `inline` type. + **/ +Renderer.prototype.renderInline = function (tokens, options, env) { + let result = ''; + const rules = this.rules; + for (let i = 0, len = tokens.length; i < len; i++) { + const type = tokens[i].type; + if (typeof rules[type] !== 'undefined') { + result += rules[type](tokens, i, options, env, this); + } else { + result += this.renderToken(tokens, i, options); } - ensureBound(defaults.pairs + "`"); - function handler(ch) { - return function (cm) { - return handleChar(cm, ch); - }; + } + return result; +}; + +/** internal + * Renderer.renderInlineAsText(tokens, options, env) -> String + * - tokens (Array): list on block tokens to render + * - options (Object): params of parser instance + * - env (Object): additional data from parsed input (references, for example) + * + * Special kludge for image `alt` attributes to conform CommonMark spec. + * Don't try to use it! Spec requires to show `alt` content with stripped markup, + * instead of simple escaping. + **/ +Renderer.prototype.renderInlineAsText = function (tokens, options, env) { + let result = ''; + for (let i = 0, len = tokens.length; i < len; i++) { + switch (tokens[i].type) { + case 'text': + result += tokens[i].content; + break; + case 'image': + result += this.renderInlineAsText(tokens[i].children, options, env); + break; + case 'html_inline': + case 'html_block': + result += tokens[i].content; + break; + case 'softbreak': + case 'hardbreak': + result += '\n'; + break; + // all other tokens are skipped } - function getConfig(cm) { - var deflt = cm.state.closeBrackets; - if (!deflt || deflt.override) return deflt; - var mode = cm.getModeAt(cm.getCursor()); - return mode.closeBrackets || deflt; + } + return result; +}; + +/** + * Renderer.render(tokens, options, env) -> String + * - tokens (Array): list on block tokens to render + * - options (Object): params of parser instance + * - env (Object): additional data from parsed input (references, for example) + * + * Takes token stream and generates HTML. Probably, you will never need to call + * this method directly. + **/ +Renderer.prototype.render = function (tokens, options, env) { + let result = ''; + const rules = this.rules; + for (let i = 0, len = tokens.length; i < len; i++) { + const type = tokens[i].type; + if (type === 'inline') { + result += this.renderInline(tokens[i].children, options, env); + } else if (typeof rules[type] !== 'undefined') { + result += rules[type](tokens, i, options, env, this); + } else { + result += this.renderToken(tokens, i, options, env); } - function handleBackspace(cm) { - var conf = getConfig(cm); - if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; - var pairs = getOption(conf, "pairs"); - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - for (var i = ranges.length - 1; i >= 0; i--) { - var cur = ranges[i].head; - cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete"); - } + } + return result; +}; + +/** + * class Ruler + * + * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and + * [[MarkdownIt#inline]] to manage sequences of functions (rules): + * + * - keep rules in defined order + * - assign the name to each rule + * - enable/disable rules + * - add/replace rules + * - allow assign rules to additional named chains (in the same) + * - cacheing lists of active rules + * + * You will not need use this class directly until write plugins. For simple + * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and + * [[MarkdownIt.use]]. + **/ + +/** + * new Ruler() + **/ +function Ruler() { + // List of added rules. Each element is: + // + // { + // name: XXX, + // enabled: Boolean, + // fn: Function(), + // alt: [ name2, name3 ] + // } + // + this.__rules__ = []; + + // Cached rule chains. + // + // First level - chain name, '' for default. + // Second level - diginal anchor for fast filtering by charcodes. + // + this.__cache__ = null; +} + +// Helper methods, should not be used directly + +// Find rule index by name +// +Ruler.prototype.__find__ = function (name) { + for (let i = 0; i < this.__rules__.length; i++) { + if (this.__rules__[i].name === name) { + return i; } - function handleEnter(cm) { - var conf = getConfig(cm); - var explode = conf && getOption(conf, "explode"); - if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - cm.operation(function () { - var linesep = cm.lineSeparator() || "\n"; - cm.replaceSelection(linesep + linesep, null); - moveSel(cm, -1); - ranges = cm.listSelections(); - for (var i2 = 0; i2 < ranges.length; i2++) { - var line = ranges[i2].head.line; - cm.indentLine(line, null, true); - cm.indentLine(line + 1, null, true); - } - }); + } + return -1; +}; + +// Build rules lookup cache +// +Ruler.prototype.__compile__ = function () { + const self = this; + const chains = ['']; + + // collect unique names + self.__rules__.forEach(function (rule) { + if (!rule.enabled) { + return; } - function moveSel(cm, dir) { - var newRanges = [], - ranges = cm.listSelections(), - primary = 0; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.head == cm.getCursor()) primary = i; - var pos = range.head.ch || dir > 0 ? { - line: range.head.line, - ch: range.head.ch + dir - } : { - line: range.head.line - 1 - }; - newRanges.push({ - anchor: pos, - head: pos - }); + rule.alt.forEach(function (altName) { + if (chains.indexOf(altName) < 0) { + chains.push(altName); } - cm.setSelections(newRanges, primary); - } - function contractSelection(sel) { - var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0; - return { - anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)), - head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1)) - }; - } - function handleChar(cm, ch) { - var conf = getConfig(cm); - if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; - var pairs = getOption(conf, "pairs"); - var pos = pairs.indexOf(ch); - if (pos == -1) return CodeMirror.Pass; - var closeBefore = getOption(conf, "closeBefore"); - var triples = getOption(conf, "triples"); - var identical = pairs.charAt(pos + 1) == ch; - var ranges = cm.listSelections(); - var opening = pos % 2 == 0; - var type; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], - cur = range.head, - curType; - var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); - if (opening && !range.empty()) { - curType = "surround"; - } else if ((identical || !opening) && next == ch) { - if (identical && stringStartsAfter(cm, cur)) curType = "both";else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch) curType = "skipThree";else curType = "skip"; - } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) { - if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass; - curType = "addFour"; - } else if (identical) { - var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur); - if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";else return CodeMirror.Pass; - } else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) { - curType = "both"; - } else { - return CodeMirror.Pass; - } - if (!type) type = curType;else if (type != curType) return CodeMirror.Pass; + }); + }); + self.__cache__ = {}; + chains.forEach(function (chain) { + self.__cache__[chain] = []; + self.__rules__.forEach(function (rule) { + if (!rule.enabled) { + return; } - var left = pos % 2 ? pairs.charAt(pos - 1) : ch; - var right = pos % 2 ? ch : pairs.charAt(pos + 1); - cm.operation(function () { - if (type == "skip") { - moveSel(cm, 1); - } else if (type == "skipThree") { - moveSel(cm, 3); - } else if (type == "surround") { - var sels = cm.getSelections(); - for (var i2 = 0; i2 < sels.length; i2++) sels[i2] = left + sels[i2] + right; - cm.replaceSelections(sels, "around"); - sels = cm.listSelections().slice(); - for (var i2 = 0; i2 < sels.length; i2++) sels[i2] = contractSelection(sels[i2]); - cm.setSelections(sels); - } else if (type == "both") { - cm.replaceSelection(left + right, null); - cm.triggerElectric(left + right); - moveSel(cm, -1); - } else if (type == "addFour") { - cm.replaceSelection(left + left + left + left, "before"); - moveSel(cm, 1); - } - }); - } - function charsAround(cm, pos) { - var str = cm.getRange(Pos(pos.line, pos.ch - 1), Pos(pos.line, pos.ch + 1)); - return str.length == 2 ? str : null; - } - function stringStartsAfter(cm, pos) { - var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1)); - return /\bstring/.test(token.type) && token.start == pos.ch && (pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos))); - } + if (chain && rule.alt.indexOf(chain) < 0) { + return; + } + self.__cache__[chain].push(rule.fn); + }); }); -})(); -var closebracketsExports = closebrackets$2.exports; -const closebrackets = /* @__PURE__ */codemirror.getDefaultExportFromCjs(closebracketsExports); -const closebrackets$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: closebrackets -}, [closebracketsExports]); -exports.closebrackets = closebrackets$1; +}; -/***/ }), +/** + * Ruler.at(name, fn [, options]) + * - name (String): rule name to replace. + * - fn (Function): new rule function. + * - options (Object): new rule options (not mandatory). + * + * Replace rule by name with new function & options. Throws error if name not + * found. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * Replace existing typographer replacement rule with new one: + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.core.ruler.at('replacements', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.at = function (name, fn, options) { + const index = this.__find__(name); + const opt = options || {}; + if (index === -1) { + throw new Error('Parser rule not found: ' + name); + } + this.__rules__[index].fn = fn; + this.__rules__[index].alt = opt.alt || []; + this.__cache__ = null; +}; -/***/ "../../graphiql-react/dist/codemirror.cjs.js": -/*!***************************************************!*\ - !*** ../../graphiql-react/dist/codemirror.cjs.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/** + * Ruler.before(beforeName, ruleName, fn [, options]) + * - beforeName (String): new rule will be added before this one. + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Add new rule to chain before one with given name. See also + * [[Ruler.after]], [[Ruler.push]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.block.ruler.before('paragraph', 'my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.before = function (beforeName, ruleName, fn, options) { + const index = this.__find__(beforeName); + const opt = options || {}; + if (index === -1) { + throw new Error('Parser rule not found: ' + beforeName); + } + this.__rules__.splice(index, 0, { + name: ruleName, + enabled: true, + fn, + alt: opt.alt || [] + }); + this.__cache__ = null; +}; + +/** + * Ruler.after(afterName, ruleName, fn [, options]) + * - afterName (String): new rule will be added after this one. + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Add new rule to chain after one with given name. See also + * [[Ruler.before]], [[Ruler.push]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.inline.ruler.after('text', 'my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.after = function (afterName, ruleName, fn, options) { + const index = this.__find__(afterName); + const opt = options || {}; + if (index === -1) { + throw new Error('Parser rule not found: ' + afterName); + } + this.__rules__.splice(index + 1, 0, { + name: ruleName, + enabled: true, + fn, + alt: opt.alt || [] + }); + this.__cache__ = null; +}; +/** + * Ruler.push(ruleName, fn [, options]) + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Push new rule to the end of chain. See also + * [[Ruler.before]], [[Ruler.after]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.core.ruler.push('my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.push = function (ruleName, fn, options) { + const opt = options || {}; + this.__rules__.push({ + name: ruleName, + enabled: true, + fn, + alt: opt.alt || [] + }); + this.__cache__ = null; +}; +/** + * Ruler.enable(list [, ignoreInvalid]) -> Array + * - list (String|Array): list of rule names to enable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable rules with given names. If any rule name not found - throw Error. + * Errors can be disabled by second param. + * + * Returns list of found rule names (if no exception happened). + * + * See also [[Ruler.disable]], [[Ruler.enableOnly]]. + **/ +Ruler.prototype.enable = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + const result = []; -const codemirror$1 = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } + // Search by name and enable + list.forEach(function (name) { + const idx = this.__find__(name); + if (idx < 0) { + if (ignoreInvalid) { + return; } + throw new Error('Rules manager: invalid rule name ' + name); } - } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); -} -var codemirrorExports = codemirror$1.requireCodemirror(); -const CodeMirror = /* @__PURE__ */codemirror$1.getDefaultExportFromCjs(codemirrorExports); -const codemirror = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: CodeMirror -}, [codemirrorExports]); -exports.CodeMirror = CodeMirror; -exports.codemirror = codemirror; + this.__rules__[idx].enabled = true; + result.push(name); + }, this); + this.__cache__ = null; + return result; +}; -/***/ }), +/** + * Ruler.enableOnly(list [, ignoreInvalid]) + * - list (String|Array): list of rule names to enable (whitelist). + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable rules with given names, and disable everything else. If any rule name + * not found - throw Error. Errors can be disabled by second param. + * + * See also [[Ruler.disable]], [[Ruler.enable]]. + **/ +Ruler.prototype.enableOnly = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + this.__rules__.forEach(function (rule) { + rule.enabled = false; + }); + this.enable(list, ignoreInvalid); +}; -/***/ "../../graphiql-react/dist/codemirror.cjs2.js": -/*!****************************************************!*\ - !*** ../../graphiql-react/dist/codemirror.cjs2.js ***! - \****************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/** + * Ruler.disable(list [, ignoreInvalid]) -> Array + * - list (String|Array): list of rule names to disable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Disable rules with given names. If any rule name not found - throw Error. + * Errors can be disabled by second param. + * + * Returns list of found rule names (if no exception happened). + * + * See also [[Ruler.enable]], [[Ruler.enableOnly]]. + **/ +Ruler.prototype.disable = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + const result = []; + // Search by name and disable + list.forEach(function (name) { + const idx = this.__find__(name); + if (idx < 0) { + if (ignoreInvalid) { + return; + } + throw new Error('Rules manager: invalid rule name ' + name); + } + this.__rules__[idx].enabled = false; + result.push(name); + }, this); + this.__cache__ = null; + return result; +}; +/** + * Ruler.getRules(chainName) -> Array + * + * Return array of active functions (rules) for given chain name. It analyzes + * rules configuration, compiles caches if not exists and returns result. + * + * Default chain name is `''` (empty string). It can't be skipped. That's + * done intentionally, to keep signature monomorphic for high speed. + **/ +Ruler.prototype.getRules = function (chainName) { + if (this.__cache__ === null) { + this.__compile__(); + } -var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof self !== "undefined" ? self : {}; -function getDefaultExportFromCjs(x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; -} -var codemirror = { - exports: {} + // Chain can be empty, if rules disabled. But we still have to return Array. + return this.__cache__[chainName] || []; }; -var hasRequiredCodemirror; -function requireCodemirror() { - if (hasRequiredCodemirror) return codemirror.exports; - hasRequiredCodemirror = 1; - (function (module2, exports2) { - (function (global2, factory) { - module2.exports = factory(); - })(commonjsGlobal, function () { - var userAgent = navigator.userAgent; - var platform = navigator.platform; - var gecko = /gecko\/\d/i.test(userAgent); - var ie_upto10 = /MSIE \d/.test(userAgent); - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); - var edge = /Edge\/(\d+)/.exec(userAgent); - var ie = ie_upto10 || ie_11up || edge; - var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); - var webkit = !edge && /WebKit\//.test(userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); - var chrome = !edge && /Chrome\//.test(userAgent); - var presto = /Opera\//.test(userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); - var phantom = /PhantomJS/.test(userAgent); - var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2); - var android = /Android/.test(userAgent); - var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); - var mac = ios || /Mac/.test(platform); - var chromeOS = /\bCrOS\b/.test(userAgent); - var windows = /win/i.test(platform); - var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); - if (presto_version) { - presto_version = Number(presto_version[1]); - } - if (presto_version && presto_version >= 15) { - presto = false; - webkit = true; - } - var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || ie && ie_version >= 9; - function classTest(cls) { - return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); - } - var rmClass = function (node, cls) { - var current = node.className; - var match = classTest(cls).exec(current); - if (match) { - var after = current.slice(match.index + match[0].length); - node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); - } - }; - function removeChildren(e) { - for (var count = e.childNodes.length; count > 0; --count) { - e.removeChild(e.firstChild); - } - return e; - } - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e); - } - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) { - e.className = className; - } - if (style) { - e.style.cssText = style; - } - if (typeof content == "string") { - e.appendChild(document.createTextNode(content)); - } else if (content) { - for (var i2 = 0; i2 < content.length; ++i2) { - e.appendChild(content[i2]); - } - } - return e; - } - function eltP(tag, content, className, style) { - var e = elt(tag, content, className, style); - e.setAttribute("role", "presentation"); - return e; - } - var range; - if (document.createRange) { - range = function (node, start, end, endNode) { - var r = document.createRange(); - r.setEnd(endNode || node, end); - r.setStart(node, start); - return r; - }; - } else { - range = function (node, start, end) { - var r = document.body.createTextRange(); - try { - r.moveToElementText(node.parentNode); - } catch (e) { - return r; - } - r.collapse(true); - r.moveEnd("character", end); - r.moveStart("character", start); - return r; - }; - } - function contains(parent, child) { - if (child.nodeType == 3) { - child = child.parentNode; - } - if (parent.contains) { - return parent.contains(child); - } - do { - if (child.nodeType == 11) { - child = child.host; - } - if (child == parent) { - return true; - } - } while (child = child.parentNode); - } - function activeElt() { - var activeElement; - try { - activeElement = document.activeElement; - } catch (e) { - activeElement = document.body || null; - } - while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) { - activeElement = activeElement.shadowRoot.activeElement; - } - return activeElement; - } - function addClass(node, cls) { - var current = node.className; - if (!classTest(cls).test(current)) { - node.className += (current ? " " : "") + cls; - } - } - function joinClasses(a, b) { - var as = a.split(" "); - for (var i2 = 0; i2 < as.length; i2++) { - if (as[i2] && !classTest(as[i2]).test(b)) { - b += " " + as[i2]; - } - } - return b; - } - var selectInput = function (node) { - node.select(); - }; - if (ios) { - selectInput = function (node) { - node.selectionStart = 0; - node.selectionEnd = node.value.length; - }; - } else if (ie) { - selectInput = function (node) { - try { - node.select(); - } catch (_e) {} - }; - } - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return f.apply(null, args); - }; - } - function copyObj(obj, target, overwrite) { - if (!target) { - target = {}; - } - for (var prop2 in obj) { - if (obj.hasOwnProperty(prop2) && (overwrite !== false || !target.hasOwnProperty(prop2))) { - target[prop2] = obj[prop2]; - } - } - return target; - } - function countColumn(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) { - end = string.length; - } - } - for (var i2 = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf(" ", i2); - if (nextTab < 0 || nextTab >= end) { - return n + (end - i2); - } - n += nextTab - i2; - n += tabSize - n % tabSize; - i2 = nextTab + 1; - } - } - var Delayed = function () { - this.id = null; - this.f = null; - this.time = 0; - this.handler = bind(this.onTimeout, this); - }; - Delayed.prototype.onTimeout = function (self2) { - self2.id = 0; - if (self2.time <= + /* @__PURE__ */new Date()) { - self2.f(); - } else { - setTimeout(self2.handler, self2.time - + /* @__PURE__ */new Date()); - } - }; - Delayed.prototype.set = function (ms, f) { - this.f = f; - var time = + /* @__PURE__ */new Date() + ms; - if (!this.id || time < this.time) { - clearTimeout(this.id); - this.id = setTimeout(this.handler, ms); - this.time = time; - } - }; - function indexOf(array, elt2) { - for (var i2 = 0; i2 < array.length; ++i2) { - if (array[i2] == elt2) { - return i2; - } - } - return -1; - } - var scrollerGap = 50; - var Pass = { - toString: function () { - return "CodeMirror.Pass"; - } - }; - var sel_dontScroll = { - scroll: false - }, - sel_mouse = { - origin: "*mouse" - }, - sel_move = { - origin: "+move" - }; - function findColumn(string, goal, tabSize) { - for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf(" ", pos); - if (nextTab == -1) { - nextTab = string.length; - } - var skipped = nextTab - pos; - if (nextTab == string.length || col + skipped >= goal) { - return pos + Math.min(skipped, goal - col); - } - col += nextTab - pos; - col += tabSize - col % tabSize; - pos = nextTab + 1; - if (col >= goal) { - return pos; - } - } - } - var spaceStrs = [""]; - function spaceStr(n) { - while (spaceStrs.length <= n) { - spaceStrs.push(lst(spaceStrs) + " "); - } - return spaceStrs[n]; - } - function lst(arr) { - return arr[arr.length - 1]; - } - function map(array, f) { - var out = []; - for (var i2 = 0; i2 < array.length; i2++) { - out[i2] = f(array[i2], i2); - } - return out; - } - function insertSorted(array, value, score) { - var pos = 0, - priority = score(value); - while (pos < array.length && score(array[pos]) <= priority) { - pos++; - } - array.splice(pos, 0, value); - } - function nothing() {} - function createObj(base, props) { - var inst; - if (Object.create) { - inst = Object.create(base); - } else { - nothing.prototype = base; - inst = new nothing(); - } - if (props) { - copyObj(props, inst); - } - return inst; - } - var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - function isWordCharBasic(ch) { - return /\w/.test(ch) || ch > "€" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); - } - function isWordChar(ch, helper) { - if (!helper) { - return isWordCharBasic(ch); - } - if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { - return true; + +// Token class + +/** + * class Token + **/ + +/** + * new Token(type, tag, nesting) + * + * Create new token and fill passed properties. + **/ +function Token(type, tag, nesting) { + /** + * Token#type -> String + * + * Type of the token (string, e.g. "paragraph_open") + **/ + this.type = type; + + /** + * Token#tag -> String + * + * html tag name, e.g. "p" + **/ + this.tag = tag; + + /** + * Token#attrs -> Array + * + * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` + **/ + this.attrs = null; + + /** + * Token#map -> Array + * + * Source map info. Format: `[ line_begin, line_end ]` + **/ + this.map = null; + + /** + * Token#nesting -> Number + * + * Level change (number in {-1, 0, 1} set), where: + * + * - `1` means the tag is opening + * - `0` means the tag is self-closing + * - `-1` means the tag is closing + **/ + this.nesting = nesting; + + /** + * Token#level -> Number + * + * nesting level, the same as `state.level` + **/ + this.level = 0; + + /** + * Token#children -> Array + * + * An array of child nodes (inline and img tokens) + **/ + this.children = null; + + /** + * Token#content -> String + * + * In a case of self-closing tag (code, html, fence, etc.), + * it has contents of this tag. + **/ + this.content = ''; + + /** + * Token#markup -> String + * + * '*' or '_' for emphasis, fence string for fence, etc. + **/ + this.markup = ''; + + /** + * Token#info -> String + * + * Additional information: + * + * - Info string for "fence" tokens + * - The value "auto" for autolink "link_open" and "link_close" tokens + * - The string value of the item marker for ordered-list "list_item_open" tokens + **/ + this.info = ''; + + /** + * Token#meta -> Object + * + * A place for plugins to store an arbitrary data + **/ + this.meta = null; + + /** + * Token#block -> Boolean + * + * True for block-level tokens, false for inline tokens. + * Used in renderer to calculate line breaks + **/ + this.block = false; + + /** + * Token#hidden -> Boolean + * + * If it's true, ignore this element when rendering. Used for tight lists + * to hide paragraphs. + **/ + this.hidden = false; +} + +/** + * Token.attrIndex(name) -> Number + * + * Search attribute index by name. + **/ +Token.prototype.attrIndex = function attrIndex(name) { + if (!this.attrs) { + return -1; + } + const attrs = this.attrs; + for (let i = 0, len = attrs.length; i < len; i++) { + if (attrs[i][0] === name) { + return i; + } + } + return -1; +}; + +/** + * Token.attrPush(attrData) + * + * Add `[ name, value ]` attribute to list. Init attrs if necessary + **/ +Token.prototype.attrPush = function attrPush(attrData) { + if (this.attrs) { + this.attrs.push(attrData); + } else { + this.attrs = [attrData]; + } +}; + +/** + * Token.attrSet(name, value) + * + * Set `name` attribute to `value`. Override old value if exists. + **/ +Token.prototype.attrSet = function attrSet(name, value) { + const idx = this.attrIndex(name); + const attrData = [name, value]; + if (idx < 0) { + this.attrPush(attrData); + } else { + this.attrs[idx] = attrData; + } +}; + +/** + * Token.attrGet(name) + * + * Get the value of attribute `name`, or null if it does not exist. + **/ +Token.prototype.attrGet = function attrGet(name) { + const idx = this.attrIndex(name); + let value = null; + if (idx >= 0) { + value = this.attrs[idx][1]; + } + return value; +}; + +/** + * Token.attrJoin(name, value) + * + * Join value to existing attribute via space. Or create new attribute if not + * exists. Useful to operate with token classes. + **/ +Token.prototype.attrJoin = function attrJoin(name, value) { + const idx = this.attrIndex(name); + if (idx < 0) { + this.attrPush([name, value]); + } else { + this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value; + } +}; + +// Core state object +// + +function StateCore(src, md, env) { + this.src = src; + this.env = env; + this.tokens = []; + this.inlineMode = false; + this.md = md; // link to parser instance +} + +// re-export Token class to use in core rules +StateCore.prototype.Token = Token; + +// Normalize input string + +// https://spec.commonmark.org/0.29/#line-ending +const NEWLINES_RE = /\r\n?|\n/g; +const NULL_RE = /\0/g; +function normalize(state) { + let str; + + // Normalize newlines + str = state.src.replace(NEWLINES_RE, '\n'); + + // Replace NULL characters + str = str.replace(NULL_RE, '\uFFFD'); + state.src = str; +} +function block(state) { + let token; + if (state.inlineMode) { + token = new state.Token('inline', '', 0); + token.content = state.src; + token.map = [0, 1]; + token.children = []; + state.tokens.push(token); + } else { + state.md.block.parse(state.src, state.md, state.env, state.tokens); + } +} +function inline(state) { + const tokens = state.tokens; + + // Parse inlines + for (let i = 0, l = tokens.length; i < l; i++) { + const tok = tokens[i]; + if (tok.type === 'inline') { + state.md.inline.parse(tok.content, state.md, state.env, tok.children); + } + } +} + +// Replace link-like texts with link nodes. +// +// Currently restricted by `md.validateLink()` to http/https/ftp +// + +function isLinkOpen$1(str) { + return /^\s]/i.test(str); +} +function isLinkClose$1(str) { + return /^<\/a\s*>/i.test(str); +} +function linkify$1(state) { + const blockTokens = state.tokens; + if (!state.md.options.linkify) { + return; + } + for (let j = 0, l = blockTokens.length; j < l; j++) { + if (blockTokens[j].type !== 'inline' || !state.md.linkify.pretest(blockTokens[j].content)) { + continue; + } + let tokens = blockTokens[j].children; + let htmlLinkLevel = 0; + + // We scan from the end, to keep position when new tags added. + // Use reversed logic in links start/end match + for (let i = tokens.length - 1; i >= 0; i--) { + const currentToken = tokens[i]; + + // Skip content of markdown links + if (currentToken.type === 'link_close') { + i--; + while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') { + i--; } - return helper.test(ch); + continue; } - function isEmpty(obj) { - for (var n in obj) { - if (obj.hasOwnProperty(n) && obj[n]) { - return false; - } + + // Skip content of html tag links + if (currentToken.type === 'html_inline') { + if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) { + htmlLinkLevel--; } - return true; - } - var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; - function isExtendingChar(ch) { - return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); - } - function skipExtendingChars(str, pos, dir) { - while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { - pos += dir; + if (isLinkClose$1(currentToken.content)) { + htmlLinkLevel++; } - return pos; } - function findFirst(pred, from, to) { - var dir = from > to ? -1 : 1; - for (;;) { - if (from == to) { - return from; - } - var midF = (from + to) / 2, - mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); - if (mid == from) { - return pred(mid) ? from : to; - } - if (pred(mid)) { - to = mid; - } else { - from = mid + dir; - } - } + if (htmlLinkLevel > 0) { + continue; } - function iterateBidiSections(order, from, to, f) { - if (!order) { - return f(from, to, "ltr", 0); - } - var found = false; - for (var i2 = 0; i2 < order.length; ++i2) { - var part = order[i2]; - if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i2); - found = true; - } - } - if (!found) { - f(from, to, "ltr"); + if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) { + const text = currentToken.content; + let links = state.md.linkify.match(text); + + // Now split string to nodes + const nodes = []; + let level = currentToken.level; + let lastPos = 0; + + // forbid escape sequence at the start of the string, + // this avoids http\://example.com/ from being linkified as + // http:
//example.com/ + if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === 'text_special') { + links = links.slice(1); } - } - var bidiOther = null; - function getBidiPartAt(order, ch, sticky) { - var found; - bidiOther = null; - for (var i2 = 0; i2 < order.length; ++i2) { - var cur = order[i2]; - if (cur.from < ch && cur.to > ch) { - return i2; - } - if (cur.to == ch) { - if (cur.from != cur.to && sticky == "before") { - found = i2; - } else { - bidiOther = i2; - } - } - if (cur.from == ch) { - if (cur.from != cur.to && sticky != "before") { - found = i2; - } else { - bidiOther = i2; - } + for (let ln = 0; ln < links.length; ln++) { + const url = links[ln].url; + const fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) { + continue; } - } - return found != null ? found : bidiOther; - } - var bidiOrdering = /* @__PURE__ */function () { - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; - var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; - function charType(code) { - if (code <= 247) { - return lowTypes.charAt(code); - } else if (1424 <= code && code <= 1524) { - return "R"; - } else if (1536 <= code && code <= 1785) { - return arabicTypes.charAt(code - 1536); - } else if (1774 <= code && code <= 2220) { - return "r"; - } else if (8192 <= code && code <= 8203) { - return "w"; - } else if (code == 8204) { - return "b"; + let urlText = links[ln].text; + + // Linkifier might send raw hostnames like "example.com", where url + // starts with domain name. So we prepend http:// in those cases, + // and remove it afterwards. + // + if (!links[ln].schema) { + urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, ''); + } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) { + urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, ''); } else { - return "L"; - } - } - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var isNeutral = /[stwN]/, - isStrong = /[LRr]/, - countsAsLeft = /[Lb1n]/, - countsAsNum = /[1n]/; - function BidiSpan(level, from, to) { - this.level = level; - this.from = from; - this.to = to; - } - return function (str, direction) { - var outerType = direction == "ltr" ? "L" : "R"; - if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { - return false; - } - var len = str.length, - types = []; - for (var i2 = 0; i2 < len; ++i2) { - types.push(charType(str.charCodeAt(i2))); - } - for (var i$12 = 0, prev = outerType; i$12 < len; ++i$12) { - var type = types[i$12]; - if (type == "m") { - types[i$12] = prev; - } else { - prev = type; - } - } - for (var i$22 = 0, cur = outerType; i$22 < len; ++i$22) { - var type$1 = types[i$22]; - if (type$1 == "1" && cur == "r") { - types[i$22] = "n"; - } else if (isStrong.test(type$1)) { - cur = type$1; - if (type$1 == "r") { - types[i$22] = "R"; - } - } - } - for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { - var type$2 = types[i$3]; - if (type$2 == "+" && prev$1 == "1" && types[i$3 + 1] == "1") { - types[i$3] = "1"; - } else if (type$2 == "," && prev$1 == types[i$3 + 1] && (prev$1 == "1" || prev$1 == "n")) { - types[i$3] = prev$1; - } - prev$1 = type$2; - } - for (var i$4 = 0; i$4 < len; ++i$4) { - var type$3 = types[i$4]; - if (type$3 == ",") { - types[i$4] = "N"; - } else if (type$3 == "%") { - var end = void 0; - for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} - var replace = i$4 && types[i$4 - 1] == "!" || end < len && types[end] == "1" ? "1" : "N"; - for (var j = i$4; j < end; ++j) { - types[j] = replace; - } - i$4 = end - 1; - } - } - for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { - var type$4 = types[i$5]; - if (cur$1 == "L" && type$4 == "1") { - types[i$5] = "L"; - } else if (isStrong.test(type$4)) { - cur$1 = type$4; - } - } - for (var i$6 = 0; i$6 < len; ++i$6) { - if (isNeutral.test(types[i$6])) { - var end$1 = void 0; - for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} - var before = (i$6 ? types[i$6 - 1] : outerType) == "L"; - var after = (end$1 < len ? types[end$1] : outerType) == "L"; - var replace$1 = before == after ? before ? "L" : "R" : outerType; - for (var j$1 = i$6; j$1 < end$1; ++j$1) { - types[j$1] = replace$1; - } - i$6 = end$1 - 1; - } - } - var order = [], - m; - for (var i$7 = 0; i$7 < len;) { - if (countsAsLeft.test(types[i$7])) { - var start = i$7; - for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} - order.push(new BidiSpan(0, start, i$7)); - } else { - var pos = i$7, - at = order.length, - isRTL = direction == "rtl" ? 1 : 0; - for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} - for (var j$2 = pos; j$2 < i$7;) { - if (countsAsNum.test(types[j$2])) { - if (pos < j$2) { - order.splice(at, 0, new BidiSpan(1, pos, j$2)); - at += isRTL; - } - var nstart = j$2; - for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} - order.splice(at, 0, new BidiSpan(2, nstart, j$2)); - at += isRTL; - pos = j$2; - } else { - ++j$2; - } - } - if (pos < i$7) { - order.splice(at, 0, new BidiSpan(1, pos, i$7)); - } - } - } - if (direction == "ltr") { - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length; - order.unshift(new BidiSpan(0, 0, m[0].length)); - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length; - order.push(new BidiSpan(0, len - m[0].length, len)); - } + urlText = state.md.normalizeLinkText(urlText); } - return direction == "rtl" ? order.reverse() : order; - }; - }(); - function getOrder(line, direction) { - var order = line.order; - if (order == null) { - order = line.order = bidiOrdering(line.text, direction); - } - return order; - } - var noHandlers = []; - var on = function (emitter, type, f) { - if (emitter.addEventListener) { - emitter.addEventListener(type, f, false); - } else if (emitter.attachEvent) { - emitter.attachEvent("on" + type, f); - } else { - var map2 = emitter._handlers || (emitter._handlers = {}); - map2[type] = (map2[type] || noHandlers).concat(f); - } - }; - function getHandlers(emitter, type) { - return emitter._handlers && emitter._handlers[type] || noHandlers; - } - function off(emitter, type, f) { - if (emitter.removeEventListener) { - emitter.removeEventListener(type, f, false); - } else if (emitter.detachEvent) { - emitter.detachEvent("on" + type, f); - } else { - var map2 = emitter._handlers, - arr = map2 && map2[type]; - if (arr) { - var index = indexOf(arr, f); - if (index > -1) { - map2[type] = arr.slice(0, index).concat(arr.slice(index + 1)); - } + const pos = links[ln].index; + if (pos > lastPos) { + const token = new state.Token('text', '', 0); + token.content = text.slice(lastPos, pos); + token.level = level; + nodes.push(token); } + const token_o = new state.Token('link_open', 'a', 1); + token_o.attrs = [['href', fullUrl]]; + token_o.level = level++; + token_o.markup = 'linkify'; + token_o.info = 'auto'; + nodes.push(token_o); + const token_t = new state.Token('text', '', 0); + token_t.content = urlText; + token_t.level = level; + nodes.push(token_t); + const token_c = new state.Token('link_close', 'a', -1); + token_c.level = --level; + token_c.markup = 'linkify'; + token_c.info = 'auto'; + nodes.push(token_c); + lastPos = links[ln].lastIndex; } - } - function signal(emitter, type) { - var handlers = getHandlers(emitter, type); - if (!handlers.length) { - return; - } - var args = Array.prototype.slice.call(arguments, 2); - for (var i2 = 0; i2 < handlers.length; ++i2) { - handlers[i2].apply(null, args); - } - } - function signalDOMEvent(cm, e, override) { - if (typeof e == "string") { - e = { - type: e, - preventDefault: function () { - this.defaultPrevented = true; - } - }; - } - signal(cm, override || e.type, cm, e); - return e_defaultPrevented(e) || e.codemirrorIgnore; - } - function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity; - if (!arr) { - return; - } - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); - for (var i2 = 0; i2 < arr.length; ++i2) { - if (indexOf(set, arr[i2]) == -1) { - set.push(arr[i2]); - } + if (lastPos < text.length) { + const token = new state.Token('text', '', 0); + token.content = text.slice(lastPos); + token.level = level; + nodes.push(token); } + + // replace current node + blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes); } - function hasHandler(emitter, type) { - return getHandlers(emitter, type).length > 0; - } - function eventMixin(ctor) { - ctor.prototype.on = function (type, f) { - on(this, type, f); - }; - ctor.prototype.off = function (type, f) { - off(this, type, f); - }; + } + } +} + +// Simple typographic replacements +// +// (c) (C) → © +// (tm) (TM) → ™ +// (r) (R) → ® +// +- → ± +// ... → … (also ?.... → ?.., !.... → !..) +// ???????? → ???, !!!!! → !!!, `,,` → `,` +// -- → –, --- → — +// + +// TODO: +// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾ +// - multiplications 2 x 4 -> 2 × 4 + +const RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/; + +// Workaround for phantomjs - need regex without /g flag, +// or root check will fail every second time +const SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i; +const SCOPED_ABBR_RE = /\((c|tm|r)\)/ig; +const SCOPED_ABBR = { + c: '©', + r: '®', + tm: '™' +}; +function replaceFn(match, name) { + return SCOPED_ABBR[name.toLowerCase()]; +} +function replace_scoped(inlineTokens) { + let inside_autolink = 0; + for (let i = inlineTokens.length - 1; i >= 0; i--) { + const token = inlineTokens[i]; + if (token.type === 'text' && !inside_autolink) { + token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn); + } + if (token.type === 'link_open' && token.info === 'auto') { + inside_autolink--; + } + if (token.type === 'link_close' && token.info === 'auto') { + inside_autolink++; + } + } +} +function replace_rare(inlineTokens) { + let inside_autolink = 0; + for (let i = inlineTokens.length - 1; i >= 0; i--) { + const token = inlineTokens[i]; + if (token.type === 'text' && !inside_autolink) { + if (RARE_RE.test(token.content)) { + token.content = token.content.replace(/\+-/g, '±') + // .., ..., ....... -> … + // but ?..... & !..... -> ?.. & !.. + .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..').replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',') + // em-dash + .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\u2014') + // en-dash + .replace(/(^|\s)--(?=\s|$)/mg, '$1\u2013').replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, '$1\u2013'); } - function e_preventDefault(e) { - if (e.preventDefault) { - e.preventDefault(); - } else { - e.returnValue = false; - } - } - function e_stopPropagation(e) { - if (e.stopPropagation) { - e.stopPropagation(); - } else { - e.cancelBubble = true; - } + } + if (token.type === 'link_open' && token.info === 'auto') { + inside_autolink--; + } + if (token.type === 'link_close' && token.info === 'auto') { + inside_autolink++; + } + } +} +function replace(state) { + let blkIdx; + if (!state.md.options.typographer) { + return; + } + for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { + if (state.tokens[blkIdx].type !== 'inline') { + continue; + } + if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) { + replace_scoped(state.tokens[blkIdx].children); + } + if (RARE_RE.test(state.tokens[blkIdx].content)) { + replace_rare(state.tokens[blkIdx].children); + } + } +} + +// Convert straight quotation marks to typographic ones +// + +const QUOTE_TEST_RE = /['"]/; +const QUOTE_RE = /['"]/g; +const APOSTROPHE = '\u2019'; /* ’ */ + +function replaceAt(str, index, ch) { + return str.slice(0, index) + ch + str.slice(index + 1); +} +function process_inlines(tokens, state) { + let j; + const stack = []; + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + const thisLevel = tokens[i].level; + for (j = stack.length - 1; j >= 0; j--) { + if (stack[j].level <= thisLevel) { + break; } - function e_defaultPrevented(e) { - return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; + } + stack.length = j + 1; + if (token.type !== 'text') { + continue; + } + let text = token.content; + let pos = 0; + let max = text.length; + + /* eslint no-labels:0,block-scoped-var:0 */ + OUTER: while (pos < max) { + QUOTE_RE.lastIndex = pos; + const t = QUOTE_RE.exec(text); + if (!t) { + break; } - function e_stop(e) { - e_preventDefault(e); - e_stopPropagation(e); - } - function e_target(e) { - return e.target || e.srcElement; - } - function e_button(e) { - var b = e.which; - if (b == null) { - if (e.button & 1) { - b = 1; - } else if (e.button & 2) { - b = 3; - } else if (e.button & 4) { - b = 2; - } - } - if (mac && e.ctrlKey && b == 1) { - b = 3; + let canOpen = true; + let canClose = true; + pos = t.index + 1; + const isSingle = t[0] === "'"; + + // Find previous character, + // default to space if it's the beginning of the line + // + let lastChar = 0x20; + if (t.index - 1 >= 0) { + lastChar = text.charCodeAt(t.index - 1); + } else { + for (j = i - 1; j >= 0; j--) { + if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20 + if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' + + lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1); + break; } - return b; } - var dragAndDrop = function () { - if (ie && ie_version < 9) { - return false; - } - var div = elt("div"); - return "draggable" in div || "dragDrop" in div; - }(); - var zwspSupported; - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "​"); - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); - if (measure.firstChild.offsetHeight != 0) { - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); - } + + // Find next character, + // default to space if it's the end of the line + // + let nextChar = 0x20; + if (pos < max) { + nextChar = text.charCodeAt(pos); + } else { + for (j = i + 1; j < tokens.length; j++) { + if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20 + if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' + + nextChar = tokens[j].content.charCodeAt(0); + break; } - var node = zwspSupported ? elt("span", "​") : elt("span", " ", null, "display: inline-block; width: 1px; margin-right: -1px"); - node.setAttribute("cm-text", ""); - return node; } - var badBidiRects; - function hasBadBidiRects(measure) { - if (badBidiRects != null) { - return badBidiRects; - } - var txt = removeChildrenAndAdd(measure, document.createTextNode("AخA")); - var r0 = range(txt, 0, 1).getBoundingClientRect(); - var r1 = range(txt, 1, 2).getBoundingClientRect(); - removeChildren(measure); - if (!r0 || r0.left == r0.right) { - return false; + const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); + const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); + const isLastWhiteSpace = isWhiteSpace(lastChar); + const isNextWhiteSpace = isWhiteSpace(nextChar); + if (isNextWhiteSpace) { + canOpen = false; + } else if (isNextPunctChar) { + if (!(isLastWhiteSpace || isLastPunctChar)) { + canOpen = false; } - return badBidiRects = r1.right - r0.right < 3; } - var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { - var pos = 0, - result = [], - l = string.length; - while (pos <= l) { - var nl = string.indexOf("\n", pos); - if (nl == -1) { - nl = string.length; - } - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); - var rt = line.indexOf("\r"); - if (rt != -1) { - result.push(line.slice(0, rt)); - pos += rt + 1; - } else { - result.push(line); - pos = nl + 1; - } - } - return result; - } : function (string) { - return string.split(/\r\n?|\n/); - }; - var hasSelection = window.getSelection ? function (te) { - try { - return te.selectionStart != te.selectionEnd; - } catch (e) { - return false; - } - } : function (te) { - var range2; - try { - range2 = te.ownerDocument.selection.createRange(); - } catch (e) {} - if (!range2 || range2.parentElement() != te) { - return false; - } - return range2.compareEndPoints("StartToEnd", range2) != 0; - }; - var hasCopyEvent = function () { - var e = elt("div"); - if ("oncopy" in e) { - return true; - } - e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == "function"; - }(); - var badZoomedRects = null; - function hasBadZoomedRects(measure) { - if (badZoomedRects != null) { - return badZoomedRects; - } - var node = removeChildrenAndAdd(measure, elt("span", "x")); - var normal = node.getBoundingClientRect(); - var fromRange = range(node, 0, 1).getBoundingClientRect(); - return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; - } - var modes = {}, - mimeModes = {}; - function defineMode(name, mode) { - if (arguments.length > 2) { - mode.dependencies = Array.prototype.slice.call(arguments, 2); - } - modes[name] = mode; - } - function defineMIME(mime, spec) { - mimeModes[mime] = spec; - } - function resolveMode(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name]; - if (typeof found == "string") { - found = { - name: found - }; - } - spec = createObj(found, spec); - spec.name = found.name; - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { - return resolveMode("application/xml"); - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { - return resolveMode("application/json"); - } - if (typeof spec == "string") { - return { - name: spec - }; - } else { - return spec || { - name: "null" - }; + if (isLastWhiteSpace) { + canClose = false; + } else if (isLastPunctChar) { + if (!(isNextWhiteSpace || isNextPunctChar)) { + canClose = false; } } - function getMode(options, spec) { - spec = resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) { - return getMode(options, "text/plain"); - } - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop2 in exts) { - if (!exts.hasOwnProperty(prop2)) { - continue; - } - if (modeObj.hasOwnProperty(prop2)) { - modeObj["_" + prop2] = modeObj[prop2]; - } - modeObj[prop2] = exts[prop2]; - } - } - modeObj.name = spec.name; - if (spec.helperType) { - modeObj.helperType = spec.helperType; - } - if (spec.modeProps) { - for (var prop$1 in spec.modeProps) { - modeObj[prop$1] = spec.modeProps[prop$1]; - } + if (nextChar === 0x22 /* " */ && t[0] === '"') { + if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) { + // special case: 1"" - count first quote as an inch + canClose = canOpen = false; } - return modeObj; } - var modeExtensions = {}; - function extendMode(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : modeExtensions[mode] = {}; - copyObj(properties, exts); + if (canOpen && canClose) { + // Replace quotes in the middle of punctuation sequence, but not + // in the middle of the words, i.e.: + // + // 1. foo " bar " baz - not replaced + // 2. foo-"-bar-"-baz - replaced + // 3. foo"bar"baz - not replaced + // + canOpen = isLastPunctChar; + canClose = isNextPunctChar; } - function copyState(mode, state) { - if (state === true) { - return state; - } - if (mode.copyState) { - return mode.copyState(state); - } - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) { - val = val.concat([]); - } - nstate[n] = val; + if (!canOpen && !canClose) { + // middle of word + if (isSingle) { + token.content = replaceAt(token.content, t.index, APOSTROPHE); } - return nstate; + continue; } - function innerMode(mode, state) { - var info; - while (mode.innerMode) { - info = mode.innerMode(state); - if (!info || info.mode == mode) { + if (canClose) { + // this could be a closing quote, rewind the stack to get a match + for (j = stack.length - 1; j >= 0; j--) { + let item = stack[j]; + if (stack[j].level < thisLevel) { break; } - state = info.state; - mode = info.mode; - } - return info || { - mode, - state - }; - } - function startState(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; - } - var StringStream = function (string, tabSize, lineOracle) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - this.lineOracle = lineOracle; - }; - StringStream.prototype.eol = function () { - return this.pos >= this.string.length; - }; - StringStream.prototype.sol = function () { - return this.pos == this.lineStart; - }; - StringStream.prototype.peek = function () { - return this.string.charAt(this.pos) || void 0; - }; - StringStream.prototype.next = function () { - if (this.pos < this.string.length) { - return this.string.charAt(this.pos++); - } - }; - StringStream.prototype.eat = function (match) { - var ch = this.string.charAt(this.pos); - var ok; - if (typeof match == "string") { - ok = ch == match; - } else { - ok = ch && (match.test ? match.test(ch) : match(ch)); - } - if (ok) { - ++this.pos; - return ch; - } - }; - StringStream.prototype.eatWhile = function (match) { - var start = this.pos; - while (this.eat(match)) {} - return this.pos > start; - }; - StringStream.prototype.eatSpace = function () { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { - ++this.pos; - } - return this.pos > start; - }; - StringStream.prototype.skipToEnd = function () { - this.pos = this.string.length; - }; - StringStream.prototype.skipTo = function (ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) { - this.pos = found; - return true; - } - }; - StringStream.prototype.backUp = function (n) { - this.pos -= n; - }; - StringStream.prototype.column = function () { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }; - StringStream.prototype.indentation = function () { - return countColumn(this.string, null, this.tabSize) - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }; - StringStream.prototype.match = function (pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function (str) { - return caseInsensitive ? str.toLowerCase() : str; - }; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) { - this.pos += pattern.length; + if (item.single === isSingle && stack[j].level === thisLevel) { + item = stack[j]; + let openQuote; + let closeQuote; + if (isSingle) { + openQuote = state.md.options.quotes[2]; + closeQuote = state.md.options.quotes[3]; + } else { + openQuote = state.md.options.quotes[0]; + closeQuote = state.md.options.quotes[1]; } - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) { - return null; - } - if (match && consume !== false) { - this.pos += match[0].length; - } - return match; - } - }; - StringStream.prototype.current = function () { - return this.string.slice(this.start, this.pos); - }; - StringStream.prototype.hideFirstChars = function (n, inner) { - this.lineStart += n; - try { - return inner(); - } finally { - this.lineStart -= n; - } - }; - StringStream.prototype.lookAhead = function (n) { - var oracle = this.lineOracle; - return oracle && oracle.lookAhead(n); - }; - StringStream.prototype.baseToken = function () { - var oracle = this.lineOracle; - return oracle && oracle.baseToken(this.pos); - }; - function getLine(doc, n) { - n -= doc.first; - if (n < 0 || n >= doc.size) { - throw new Error("There is no line " + (n + doc.first) + " in the document."); - } - var chunk = doc; - while (!chunk.lines) { - for (var i2 = 0;; ++i2) { - var child = chunk.children[i2], - sz = child.chunkSize(); - if (n < sz) { - chunk = child; - break; + + // replace token.content *before* tokens[item.token].content, + // because, if they are pointing at the same token, replaceAt + // could mess up indices when quote length != 1 + token.content = replaceAt(token.content, t.index, closeQuote); + tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote); + pos += closeQuote.length - 1; + if (item.token === i) { + pos += openQuote.length - 1; } - n -= sz; + text = token.content; + max = text.length; + stack.length = j; + continue OUTER; } } - return chunk.lines[n]; - } - function getBetween(doc, start, end) { - var out = [], - n = start.line; - doc.iter(start.line, end.line + 1, function (line) { - var text = line.text; - if (n == end.line) { - text = text.slice(0, end.ch); - } - if (n == start.line) { - text = text.slice(start.ch); - } - out.push(text); - ++n; - }); - return out; } - function getLines(doc, from, to) { - var out = []; - doc.iter(from, to, function (line) { - out.push(line.text); + if (canOpen) { + stack.push({ + token: i, + pos: t.index, + single: isSingle, + level: thisLevel }); - return out; - } - function updateLineHeight(line, height) { - var diff = height - line.height; - if (diff) { - for (var n = line; n; n = n.parent) { - n.height += diff; - } - } - } - function lineNo(line) { - if (line.parent == null) { - return null; - } - var cur = line.parent, - no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i2 = 0;; ++i2) { - if (chunk.children[i2] == cur) { - break; - } - no += chunk.children[i2].chunkSize(); - } - } - return no + cur.first; - } - function lineAtHeight(chunk, h) { - var n = chunk.first; - outer: do { - for (var i$12 = 0; i$12 < chunk.children.length; ++i$12) { - var child = chunk.children[i$12], - ch = child.height; - if (h < ch) { - chunk = child; - continue outer; - } - h -= ch; - n += child.chunkSize(); - } - return n; - } while (!chunk.lines); - var i2 = 0; - for (; i2 < chunk.lines.length; ++i2) { - var line = chunk.lines[i2], - lh = line.height; - if (h < lh) { - break; - } - h -= lh; - } - return n + i2; - } - function isLine(doc, l) { - return l >= doc.first && l < doc.first + doc.size; - } - function lineNumberFor(options, i2) { - return String(options.lineNumberFormatter(i2 + options.firstLineNumber)); - } - function Pos(line, ch, sticky) { - if (sticky === void 0) sticky = null; - if (!(this instanceof Pos)) { - return new Pos(line, ch, sticky); - } - this.line = line; - this.ch = ch; - this.sticky = sticky; - } - function cmp(a, b) { - return a.line - b.line || a.ch - b.ch; - } - function equalCursorPos(a, b) { - return a.sticky == b.sticky && cmp(a, b) == 0; - } - function copyPos(x) { - return Pos(x.line, x.ch); - } - function maxPos(a, b) { - return cmp(a, b) < 0 ? b : a; - } - function minPos(a, b) { - return cmp(a, b) < 0 ? a : b; - } - function clipLine(doc, n) { - return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1)); - } - function clipPos(doc, pos) { - if (pos.line < doc.first) { - return Pos(doc.first, 0); - } - var last = doc.first + doc.size - 1; - if (pos.line > last) { - return Pos(last, getLine(doc, last).text.length); - } - return clipToLen(pos, getLine(doc, pos.line).text.length); + } else if (canClose && isSingle) { + token.content = replaceAt(token.content, t.index, APOSTROPHE); } - function clipToLen(pos, linelen) { - var ch = pos.ch; - if (ch == null || ch > linelen) { - return Pos(pos.line, linelen); - } else if (ch < 0) { - return Pos(pos.line, 0); - } else { - return pos; - } + } + } +} +function smartquotes(state) { + /* eslint max-depth:0 */ + if (!state.md.options.typographer) { + return; + } + for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { + if (state.tokens[blkIdx].type !== 'inline' || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) { + continue; + } + process_inlines(state.tokens[blkIdx].children, state); + } +} + +// Join raw text tokens with the rest of the text +// +// This is set as a separate rule to provide an opportunity for plugins +// to run text replacements after text join, but before escape join. +// +// For example, `\:)` shouldn't be replaced with an emoji. +// + +function text_join(state) { + let curr, last; + const blockTokens = state.tokens; + const l = blockTokens.length; + for (let j = 0; j < l; j++) { + if (blockTokens[j].type !== 'inline') continue; + const tokens = blockTokens[j].children; + const max = tokens.length; + for (curr = 0; curr < max; curr++) { + if (tokens[curr].type === 'text_special') { + tokens[curr].type = 'text'; } - function clipPosArray(doc, array) { - var out = []; - for (var i2 = 0; i2 < array.length; i2++) { - out[i2] = clipPos(doc, array[i2]); + } + for (curr = last = 0; curr < max; curr++) { + if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { + // collapse two adjacent text nodes + tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; + } else { + if (curr !== last) { + tokens[last] = tokens[curr]; } - return out; + last++; } - var SavedContext = function (state, lookAhead) { - this.state = state; - this.lookAhead = lookAhead; - }; - var Context = function (doc, state, line, lookAhead) { - this.state = state; - this.doc = doc; - this.line = line; - this.maxLookAhead = lookAhead || 0; - this.baseTokens = null; - this.baseTokenPos = 1; - }; - Context.prototype.lookAhead = function (n) { - var line = this.doc.getLine(this.line + n); - if (line != null && n > this.maxLookAhead) { - this.maxLookAhead = n; - } - return line; - }; - Context.prototype.baseToken = function (n) { - if (!this.baseTokens) { - return null; - } - while (this.baseTokens[this.baseTokenPos] <= n) { - this.baseTokenPos += 2; - } - var type = this.baseTokens[this.baseTokenPos + 1]; - return { - type: type && type.replace(/( |^)overlay .*/, ""), - size: this.baseTokens[this.baseTokenPos] - n - }; - }; - Context.prototype.nextLine = function () { - this.line++; - if (this.maxLookAhead > 0) { - this.maxLookAhead--; - } - }; - Context.fromSaved = function (doc, saved, line) { - if (saved instanceof SavedContext) { - return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead); + } + if (curr !== last) { + tokens.length = last; + } + } +} + +/** internal + * class Core + * + * Top-level rules executor. Glues block/inline parsers and does intermediate + * transformations. + **/ + +const _rules$2 = [['normalize', normalize], ['block', block], ['inline', inline], ['linkify', linkify$1], ['replacements', replace], ['smartquotes', smartquotes], +// `text_join` finds `text_special` tokens (for escape sequences) +// and joins them with the rest of the text +['text_join', text_join]]; + +/** + * new Core() + **/ +function Core() { + /** + * Core#ruler -> Ruler + * + * [[Ruler]] instance. Keep configuration of core rules. + **/ + this.ruler = new Ruler(); + for (let i = 0; i < _rules$2.length; i++) { + this.ruler.push(_rules$2[i][0], _rules$2[i][1]); + } +} + +/** + * Core.process(state) + * + * Executes core chain rules. + **/ +Core.prototype.process = function (state) { + const rules = this.ruler.getRules(''); + for (let i = 0, l = rules.length; i < l; i++) { + rules[i](state); + } +}; +Core.prototype.State = StateCore; + +// Parser state class + +function StateBlock(src, md, env, tokens) { + this.src = src; + + // link to parser instance + this.md = md; + this.env = env; + + // + // Internal state vartiables + // + + this.tokens = tokens; + this.bMarks = []; // line begin offsets for fast jumps + this.eMarks = []; // line end offsets for fast jumps + this.tShift = []; // offsets of the first non-space characters (tabs not expanded) + this.sCount = []; // indents for each line (tabs expanded) + + // An amount of virtual spaces (tabs expanded) between beginning + // of each line (bMarks) and real beginning of that line. + // + // It exists only as a hack because blockquotes override bMarks + // losing information in the process. + // + // It's used only when expanding tabs, you can think about it as + // an initial tab length, e.g. bsCount=21 applied to string `\t123` + // means first tab should be expanded to 4-21%4 === 3 spaces. + // + this.bsCount = []; + + // block parser variables + + // required block content indent (for example, if we are + // inside a list, it would be positioned after list marker) + this.blkIndent = 0; + this.line = 0; // line index in src + this.lineMax = 0; // lines count + this.tight = false; // loose/tight mode for lists + this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any) + this.listIndent = -1; // indent of the current list block (-1 if there isn't any) + + // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' + // used in lists to determine if they interrupt a paragraph + this.parentType = 'root'; + this.level = 0; + + // Create caches + // Generate markers. + const s = this.src; + for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) { + const ch = s.charCodeAt(pos); + if (!indent_found) { + if (isSpace(ch)) { + indent++; + if (ch === 0x09) { + offset += 4 - offset % 4; } else { - return new Context(doc, copyState(doc.mode, saved), line); - } - }; - Context.prototype.save = function (copy) { - var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; - return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state; - }; - function highlightLine(cm, line, context, forceToEnd) { - var st = [cm.state.modeGen], - lineClasses = {}; - runMode(cm, line.text, cm.doc.mode, context, function (end, style) { - return st.push(end, style); - }, lineClasses, forceToEnd); - var state = context.state; - var loop = function (o2) { - context.baseTokens = st; - var overlay = cm.state.overlays[o2], - i2 = 1, - at = 0; - context.state = true; - runMode(cm, line.text, overlay.mode, context, function (end, style) { - var start = i2; - while (at < end) { - var i_end = st[i2]; - if (i_end > end) { - st.splice(i2, 1, end, st[i2 + 1], i_end); - } - i2 += 2; - at = Math.min(end, i_end); - } - if (!style) { - return; - } - if (overlay.opaque) { - st.splice(start, i2 - start, end, "overlay " + style); - i2 = start + 2; - } else { - for (; start < i2; start += 2) { - var cur = st[start + 1]; - st[start + 1] = (cur ? cur + " " : "") + "overlay " + style; - } - } - }, lineClasses); - context.state = state; - context.baseTokens = null; - context.baseTokenPos = 1; - }; - for (var o = 0; o < cm.state.overlays.length; ++o) loop(o); - return { - styles: st, - classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null - }; - } - function getLineStyles(cm, line, updateFrontier) { - if (!line.styles || line.styles[0] != cm.state.modeGen) { - var context = getContextBefore(cm, lineNo(line)); - var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); - var result = highlightLine(cm, line, context); - if (resetState) { - context.state = resetState; - } - line.stateAfter = context.save(!resetState); - line.styles = result.styles; - if (result.classes) { - line.styleClasses = result.classes; - } else if (line.styleClasses) { - line.styleClasses = null; - } - if (updateFrontier === cm.doc.highlightFrontier) { - cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); - } - } - return line.styles; - } - function getContextBefore(cm, n, precise) { - var doc = cm.doc, - display = cm.display; - if (!doc.mode.startState) { - return new Context(doc, true, n); - } - var start = findStartLine(cm, n, precise); - var saved = start > doc.first && getLine(doc, start - 1).stateAfter; - var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); - doc.iter(start, n, function (line) { - processLine(cm, line.text, context); - var pos = context.line; - line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; - context.nextLine(); - }); - if (precise) { - doc.modeFrontier = context.line; - } - return context; - } - function processLine(cm, text, context, startAt) { - var mode = cm.doc.mode; - var stream = new StringStream(text, cm.options.tabSize, context); - stream.start = stream.pos = startAt || 0; - if (text == "") { - callBlankLine(mode, context.state); - } - while (!stream.eol()) { - readToken(mode, stream, context.state); - stream.start = stream.pos; - } - } - function callBlankLine(mode, state) { - if (mode.blankLine) { - return mode.blankLine(state); - } - if (!mode.innerMode) { - return; - } - var inner = innerMode(mode, state); - if (inner.mode.blankLine) { - return inner.mode.blankLine(inner.state); - } - } - function readToken(mode, stream, state, inner) { - for (var i2 = 0; i2 < 10; i2++) { - if (inner) { - inner[0] = innerMode(mode, state).mode; - } - var style = mode.token(stream, state); - if (stream.pos > stream.start) { - return style; - } - } - throw new Error("Mode " + mode.name + " failed to advance stream."); - } - var Token = function (stream, type, state) { - this.start = stream.start; - this.end = stream.pos; - this.string = stream.current(); - this.type = type || null; - this.state = state; - }; - function takeToken(cm, pos, precise, asArray) { - var doc = cm.doc, - mode = doc.mode, - style; - pos = clipPos(doc, pos); - var line = getLine(doc, pos.line), - context = getContextBefore(cm, pos.line, precise); - var stream = new StringStream(line.text, cm.options.tabSize, context), - tokens; - if (asArray) { - tokens = []; - } - while ((asArray || stream.pos < pos.ch) && !stream.eol()) { - stream.start = stream.pos; - style = readToken(mode, stream, context.state); - if (asArray) { - tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); - } + offset++; } - return asArray ? tokens : new Token(stream, style, context.state); + continue; + } else { + indent_found = true; } - function extractLineClasses(type, output) { - if (type) { - for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); - if (!lineClass) { - break; - } - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); - var prop2 = lineClass[1] ? "bgClass" : "textClass"; - if (output[prop2] == null) { - output[prop2] = lineClass[2]; - } else if (!new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)").test(output[prop2])) { - output[prop2] += " " + lineClass[2]; - } - } - } - return type; + } + if (ch === 0x0A || pos === len - 1) { + if (ch !== 0x0A) { + pos++; } - function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans; - if (flattenSpans == null) { - flattenSpans = cm.options.flattenSpans; - } - var curStart = 0, - curStyle = null; - var stream = new StringStream(text, cm.options.tabSize, context), - style; - var inner = cm.options.addModeClass && [null]; - if (text == "") { - extractLineClasses(callBlankLine(mode, context.state), lineClasses); - } - while (!stream.eol()) { - if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false; - if (forceToEnd) { - processLine(cm, text, context, stream.pos); - } - stream.pos = text.length; - style = null; - } else { - style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); - } - if (inner) { - var mName = inner[0].name; - if (mName) { - style = "m-" + (style ? mName + " " + style : mName); - } - } - if (!flattenSpans || curStyle != style) { - while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 5e3); - f(curStart, curStyle); - } - curStyle = style; - } - stream.start = stream.pos; - } - while (curStart < stream.pos) { - var pos = Math.min(stream.pos, curStart + 5e3); - f(pos, curStyle); - curStart = pos; - } - } - function findStartLine(cm, n, precise) { - var minindent, - minline, - doc = cm.doc; - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1e3 : 100); - for (var search = n; search > lim; --search) { - if (search <= doc.first) { - return doc.first; - } - var line = getLine(doc, search - 1), - after = line.stateAfter; - if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) { - return search; - } - var indented = countColumn(line.text, null, cm.options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline; - } - function retreatFrontier(doc, n) { - doc.modeFrontier = Math.min(doc.modeFrontier, n); - if (doc.highlightFrontier < n - 10) { - return; - } - var start = doc.first; - for (var line = n - 1; line > start; line--) { - var saved = getLine(doc, line).stateAfter; - if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { - start = line + 1; - break; - } - } - doc.highlightFrontier = Math.min(doc.highlightFrontier, start); - } - var sawReadOnlySpans = false, - sawCollapsedSpans = false; - function seeReadOnlySpans() { - sawReadOnlySpans = true; - } - function seeCollapsedSpans() { - sawCollapsedSpans = true; - } - function MarkedSpan(marker, from, to) { - this.marker = marker; - this.from = from; - this.to = to; - } - function getMarkedSpanFor(spans, marker) { - if (spans) { - for (var i2 = 0; i2 < spans.length; ++i2) { - var span = spans[i2]; - if (span.marker == marker) { - return span; - } - } - } - } - function removeMarkedSpan(spans, span) { - var r; - for (var i2 = 0; i2 < spans.length; ++i2) { - if (spans[i2] != span) { - (r || (r = [])).push(spans[i2]); - } - } - return r; - } - function addMarkedSpan(line, span, op) { - var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = /* @__PURE__ */new WeakSet())); - if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) { - line.markedSpans.push(span); + this.bMarks.push(start); + this.eMarks.push(pos); + this.tShift.push(indent); + this.sCount.push(offset); + this.bsCount.push(0); + indent_found = false; + indent = 0; + offset = 0; + start = pos + 1; + } + } + + // Push fake entry to simplify cache bounds checks + this.bMarks.push(s.length); + this.eMarks.push(s.length); + this.tShift.push(0); + this.sCount.push(0); + this.bsCount.push(0); + this.lineMax = this.bMarks.length - 1; // don't count last fake line +} + +// Push new token to "stream". +// +StateBlock.prototype.push = function (type, tag, nesting) { + const token = new Token(type, tag, nesting); + token.block = true; + if (nesting < 0) this.level--; // closing tag + token.level = this.level; + if (nesting > 0) this.level++; // opening tag + + this.tokens.push(token); + return token; +}; +StateBlock.prototype.isEmpty = function isEmpty(line) { + return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]; +}; +StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) { + for (let max = this.lineMax; from < max; from++) { + if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { + break; + } + } + return from; +}; + +// Skip spaces from given position. +StateBlock.prototype.skipSpaces = function skipSpaces(pos) { + for (let max = this.src.length; pos < max; pos++) { + const ch = this.src.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + } + return pos; +}; + +// Skip spaces from given position in reverse. +StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) { + if (pos <= min) { + return pos; + } + while (pos > min) { + if (!isSpace(this.src.charCodeAt(--pos))) { + return pos + 1; + } + } + return pos; +}; + +// Skip char codes from given position +StateBlock.prototype.skipChars = function skipChars(pos, code) { + for (let max = this.src.length; pos < max; pos++) { + if (this.src.charCodeAt(pos) !== code) { + break; + } + } + return pos; +}; + +// Skip char codes reverse from given position - 1 +StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) { + if (pos <= min) { + return pos; + } + while (pos > min) { + if (code !== this.src.charCodeAt(--pos)) { + return pos + 1; + } + } + return pos; +}; + +// cut lines range from source. +StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) { + if (begin >= end) { + return ''; + } + const queue = new Array(end - begin); + for (let i = 0, line = begin; line < end; line++, i++) { + let lineIndent = 0; + const lineStart = this.bMarks[line]; + let first = lineStart; + let last; + if (line + 1 < end || keepLastLF) { + // No need for bounds check because we have fake entry on tail. + last = this.eMarks[line] + 1; + } else { + last = this.eMarks[line]; + } + while (first < last && lineIndent < indent) { + const ch = this.src.charCodeAt(first); + if (isSpace(ch)) { + if (ch === 0x09) { + lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4; } else { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; - if (inThisOp) { - inThisOp.add(line.markedSpans); - } - } - span.marker.attachLine(line); - } - function markedSpansBefore(old, startCh, isInsert) { - var nw; - if (old) { - for (var i2 = 0; i2 < old.length; ++i2) { - var span = old[i2], - marker = span.marker; - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); - if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); - (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); - } - } - } - return nw; - } - function markedSpansAfter(old, endCh, isInsert) { - var nw; - if (old) { - for (var i2 = 0; i2 < old.length; ++i2) { - var span = old[i2], - marker = span.marker; - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); - if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); - (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, span.to == null ? null : span.to - endCh)); - } - } - } - return nw; - } - function stretchSpansOverChange(doc, change) { - if (change.full) { - return null; - } - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; - if (!oldFirst && !oldLast) { - return null; - } - var startCh = change.from.ch, - endCh = change.to.ch, - isInsert = cmp(change.from, change.to) == 0; - var first = markedSpansBefore(oldFirst, startCh, isInsert); - var last = markedSpansAfter(oldLast, endCh, isInsert); - var sameLine = change.text.length == 1, - offset = lst(change.text).length + (sameLine ? startCh : 0); - if (first) { - for (var i2 = 0; i2 < first.length; ++i2) { - var span = first[i2]; - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker); - if (!found) { - span.to = startCh; - } else if (sameLine) { - span.to = found.to == null ? null : found.to + offset; - } - } - } - } - if (last) { - for (var i$12 = 0; i$12 < last.length; ++i$12) { - var span$1 = last[i$12]; - if (span$1.to != null) { - span$1.to += offset; - } - if (span$1.from == null) { - var found$1 = getMarkedSpanFor(first, span$1.marker); - if (!found$1) { - span$1.from = offset; - if (sameLine) { - (first || (first = [])).push(span$1); - } - } - } else { - span$1.from += offset; - if (sameLine) { - (first || (first = [])).push(span$1); - } - } - } - } - if (first) { - first = clearEmptySpans(first); - } - if (last && last != first) { - last = clearEmptySpans(last); - } - var newMarkers = [first]; - if (!sameLine) { - var gap = change.text.length - 2, - gapMarkers; - if (gap > 0 && first) { - for (var i$22 = 0; i$22 < first.length; ++i$22) { - if (first[i$22].to == null) { - (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$22].marker, null, null)); - } - } - } - for (var i$3 = 0; i$3 < gap; ++i$3) { - newMarkers.push(gapMarkers); - } - newMarkers.push(last); - } - return newMarkers; - } - function clearEmptySpans(spans) { - for (var i2 = 0; i2 < spans.length; ++i2) { - var span = spans[i2]; - if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) { - spans.splice(i2--, 1); - } - } - if (!spans.length) { - return null; - } - return spans; - } - function removeReadOnlyRanges(doc, from, to) { - var markers = null; - doc.iter(from.line, to.line + 1, function (line) { - if (line.markedSpans) { - for (var i3 = 0; i3 < line.markedSpans.length; ++i3) { - var mark = line.markedSpans[i3].marker; - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) { - (markers || (markers = [])).push(mark); - } - } - } - }); - if (!markers) { - return null; - } - var parts = [{ - from, - to - }]; - for (var i2 = 0; i2 < markers.length; ++i2) { - var mk = markers[i2], - m = mk.find(0); - for (var j = 0; j < parts.length; ++j) { - var p = parts[j]; - if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { - continue; - } - var newParts = [j, 1], - dfrom = cmp(p.from, m.from), - dto = cmp(p.to, m.to); - if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) { - newParts.push({ - from: p.from, - to: m.from - }); - } - if (dto > 0 || !mk.inclusiveRight && !dto) { - newParts.push({ - from: m.to, - to: p.to - }); - } - parts.splice.apply(parts, newParts); - j += newParts.length - 3; - } - } - return parts; - } - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) { - return; - } - for (var i2 = 0; i2 < spans.length; ++i2) { - spans[i2].marker.detachLine(line); - } - line.markedSpans = null; - } - function attachMarkedSpans(line, spans) { - if (!spans) { - return; - } - for (var i2 = 0; i2 < spans.length; ++i2) { - spans[i2].marker.attachLine(line); - } - line.markedSpans = spans; - } - function extraLeft(marker) { - return marker.inclusiveLeft ? -1 : 0; - } - function extraRight(marker) { - return marker.inclusiveRight ? 1 : 0; - } - function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length; - if (lenDiff != 0) { - return lenDiff; - } - var aPos = a.find(), - bPos = b.find(); - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); - if (fromCmp) { - return -fromCmp; - } - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); - if (toCmp) { - return toCmp; - } - return b.id - a.id; - } - function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, - found; - if (sps) { - for (var sp = void 0, i2 = 0; i2 < sps.length; ++i2) { - sp = sps[i2]; - if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { - found = sp.marker; - } - } - } - return found; - } - function collapsedSpanAtStart(line) { - return collapsedSpanAtSide(line, true); - } - function collapsedSpanAtEnd(line) { - return collapsedSpanAtSide(line, false); - } - function collapsedSpanAround(line, ch) { - var sps = sawCollapsedSpans && line.markedSpans, - found; - if (sps) { - for (var i2 = 0; i2 < sps.length; ++i2) { - var sp = sps[i2]; - if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { - found = sp.marker; - } - } - } - return found; - } - function conflictingCollapsedRange(doc, lineNo2, from, to, marker) { - var line = getLine(doc, lineNo2); - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) { - for (var i2 = 0; i2 < sps.length; ++i2) { - var sp = sps[i2]; - if (!sp.marker.collapsed) { - continue; - } - var found = sp.marker.find(0); - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); - if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { - continue; - } - if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) { - return true; - } - } - } - } - function visualLine(line) { - var merged; - while (merged = collapsedSpanAtStart(line)) { - line = merged.find(-1, true).line; - } - return line; - } - function visualLineEnd(line) { - var merged; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - } - return line; - } - function visualLineContinued(line) { - var merged, lines; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - (lines || (lines = [])).push(line); - } - return lines; - } - function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), - vis = visualLine(line); - if (line == vis) { - return lineN; - } - return lineNo(vis); - } - function visualLineEndNo(doc, lineN) { - if (lineN > doc.lastLine()) { - return lineN; - } - var line = getLine(doc, lineN), - merged; - if (!lineIsHidden(doc, line)) { - return lineN; - } - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - } - return lineNo(line) + 1; - } - function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) { - for (var sp = void 0, i2 = 0; i2 < sps.length; ++i2) { - sp = sps[i2]; - if (!sp.marker.collapsed) { - continue; - } - if (sp.from == null) { - return true; - } - if (sp.marker.widgetNode) { - continue; - } - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) { - return true; - } - } - } - } - function lineIsHiddenInner(doc, line, span) { - if (span.to == null) { - var end = span.marker.find(1, true); - return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); - } - if (span.marker.inclusiveRight && span.to == line.text.length) { - return true; - } - for (var sp = void 0, i2 = 0; i2 < line.markedSpans.length; ++i2) { - sp = line.markedSpans[i2]; - if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && (sp.to == null || sp.to != span.from) && (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && lineIsHiddenInner(doc, line, sp)) { - return true; - } - } - } - function heightAtLine(lineObj) { - lineObj = visualLine(lineObj); - var h = 0, - chunk = lineObj.parent; - for (var i2 = 0; i2 < chunk.lines.length; ++i2) { - var line = chunk.lines[i2]; - if (line == lineObj) { - break; - } else { - h += line.height; - } - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i$12 = 0; i$12 < p.children.length; ++i$12) { - var cur = p.children[i$12]; - if (cur == chunk) { - break; - } else { - h += cur.height; - } - } + lineIndent++; } - return h; + } else if (first - lineStart < this.tShift[line]) { + // patched tShift masked characters to look like spaces (blockquotes, list markers) + lineIndent++; + } else { + break; } - function lineLength(line) { - if (line.height == 0) { - return 0; - } - var len = line.text.length, - merged, - cur = line; - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true); - cur = found.from.line; - len += found.from.ch - found.to.ch; - } - cur = line; - while (merged = collapsedSpanAtEnd(cur)) { - var found$1 = merged.find(0, true); - len -= cur.text.length - found$1.from.ch; - cur = found$1.to.line; - len += cur.text.length - found$1.to.ch; - } - return len; - } - function findMaxLine(cm) { - var d = cm.display, - doc = cm.doc; - d.maxLine = getLine(doc, doc.first); - d.maxLineLength = lineLength(d.maxLine); - d.maxLineChanged = true; - doc.iter(function (line) { - var len = lineLength(line); - if (len > d.maxLineLength) { - d.maxLineLength = len; - d.maxLine = line; - } - }); + first++; + } + if (lineIndent > indent) { + // partially expanding tabs in code blocks, e.g '\t\tfoobar' + // with indent=2 becomes ' \tfoobar' + queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last); + } else { + queue[i] = this.src.slice(first, last); + } + } + return queue.join(''); +}; + +// re-export Token class to use in block rules +StateBlock.prototype.Token = Token; + +// GFM table, https://github.github.com/gfm/#tables-extension- + +// Limit the amount of empty autocompleted cells in a table, +// see https://github.com/markdown-it/markdown-it/issues/1000, +// +// Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k. +// We set it to 65k, which can expand user input by a factor of x370 +// (256x256 square is 1.8kB expanded into 650kB). +const MAX_AUTOCOMPLETED_CELLS = 0x10000; +function getLine(state, line) { + const pos = state.bMarks[line] + state.tShift[line]; + const max = state.eMarks[line]; + return state.src.slice(pos, max); +} +function escapedSplit(str) { + const result = []; + const max = str.length; + let pos = 0; + let ch = str.charCodeAt(pos); + let isEscaped = false; + let lastPos = 0; + let current = ''; + while (pos < max) { + if (ch === 0x7c /* | */) { + if (!isEscaped) { + // pipe separating cells, '|' + result.push(current + str.substring(lastPos, pos)); + current = ''; + lastPos = pos + 1; + } else { + // escaped pipe, '\|' + current += str.substring(lastPos, pos - 1); + lastPos = pos; } - var Line = function (text, markedSpans, estimateHeight2) { - this.text = text; - attachMarkedSpans(this, markedSpans); - this.height = estimateHeight2 ? estimateHeight2(this) : 1; - }; - Line.prototype.lineNo = function () { - return lineNo(this); - }; - eventMixin(Line); - function updateLine(line, text, markedSpans, estimateHeight2) { - line.text = text; - if (line.stateAfter) { - line.stateAfter = null; - } - if (line.styles) { - line.styles = null; - } - if (line.order != null) { - line.order = null; - } - detachMarkedSpans(line); - attachMarkedSpans(line, markedSpans); - var estHeight = estimateHeight2 ? estimateHeight2(line) : 1; - if (estHeight != line.height) { - updateLineHeight(line, estHeight); - } + } + isEscaped = ch === 0x5c /* \ */; + pos++; + ch = str.charCodeAt(pos); + } + result.push(current + str.substring(lastPos)); + return result; +} +function table(state, startLine, endLine, silent) { + // should have at least two lines + if (startLine + 2 > endLine) { + return false; + } + let nextLine = startLine + 1; + if (state.sCount[nextLine] < state.blkIndent) { + return false; + } + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[nextLine] - state.blkIndent >= 4) { + return false; + } + + // first character of the second line should be '|', '-', ':', + // and no other characters are allowed but spaces; + // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp + + let pos = state.bMarks[nextLine] + state.tShift[nextLine]; + if (pos >= state.eMarks[nextLine]) { + return false; + } + const firstCh = state.src.charCodeAt(pos++); + if (firstCh !== 0x7C /* | */ && firstCh !== 0x2D /* - */ && firstCh !== 0x3A /* : */) { + return false; + } + if (pos >= state.eMarks[nextLine]) { + return false; + } + const secondCh = state.src.charCodeAt(pos++); + if (secondCh !== 0x7C /* | */ && secondCh !== 0x2D /* - */ && secondCh !== 0x3A /* : */ && !isSpace(secondCh)) { + return false; + } + + // if first character is '-', then second character must not be a space + // (due to parsing ambiguity with list) + if (firstCh === 0x2D /* - */ && isSpace(secondCh)) { + return false; + } + while (pos < state.eMarks[nextLine]) { + const ch = state.src.charCodeAt(pos); + if (ch !== 0x7C /* | */ && ch !== 0x2D /* - */ && ch !== 0x3A /* : */ && !isSpace(ch)) { + return false; + } + pos++; + } + let lineText = getLine(state, startLine + 1); + let columns = lineText.split('|'); + const aligns = []; + for (let i = 0; i < columns.length; i++) { + const t = columns[i].trim(); + if (!t) { + // allow empty columns before and after table, but not in between columns; + // e.g. allow ` |---| `, disallow ` ---||--- ` + if (i === 0 || i === columns.length - 1) { + continue; + } else { + return false; } - function cleanUpLine(line) { - line.parent = null; - detachMarkedSpans(line); + } + if (!/^:?-+:?$/.test(t)) { + return false; + } + if (t.charCodeAt(t.length - 1) === 0x3A /* : */) { + aligns.push(t.charCodeAt(0) === 0x3A /* : */ ? 'center' : 'right'); + } else if (t.charCodeAt(0) === 0x3A /* : */) { + aligns.push('left'); + } else { + aligns.push(''); + } + } + lineText = getLine(state, startLine).trim(); + if (lineText.indexOf('|') === -1) { + return false; + } + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + columns = escapedSplit(lineText); + if (columns.length && columns[0] === '') columns.shift(); + if (columns.length && columns[columns.length - 1] === '') columns.pop(); + + // header row will define an amount of columns in the entire table, + // and align row should be exactly the same (the rest of the rows can differ) + const columnCount = columns.length; + if (columnCount === 0 || columnCount !== aligns.length) { + return false; + } + if (silent) { + return true; + } + const oldParentType = state.parentType; + state.parentType = 'table'; + + // use 'blockquote' lists for termination because it's + // the most similar to tables + const terminatorRules = state.md.block.ruler.getRules('blockquote'); + const token_to = state.push('table_open', 'table', 1); + const tableLines = [startLine, 0]; + token_to.map = tableLines; + const token_tho = state.push('thead_open', 'thead', 1); + token_tho.map = [startLine, startLine + 1]; + const token_htro = state.push('tr_open', 'tr', 1); + token_htro.map = [startLine, startLine + 1]; + for (let i = 0; i < columns.length; i++) { + const token_ho = state.push('th_open', 'th', 1); + if (aligns[i]) { + token_ho.attrs = [['style', 'text-align:' + aligns[i]]]; + } + const token_il = state.push('inline', '', 0); + token_il.content = columns[i].trim(); + token_il.children = []; + state.push('th_close', 'th', -1); + } + state.push('tr_close', 'tr', -1); + state.push('thead_close', 'thead', -1); + let tbodyLines; + let autocompletedCells = 0; + for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; } - var styleToClassCache = {}, - styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, options) { - if (!style || /^\s*$/.test(style)) { - return null; - } - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; - return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&")); - } - function buildLineContent(cm, lineView) { - var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); - var builder = { - pre: eltP("pre", [content], "CodeMirror-line"), - content, - col: 0, - pos: 0, - cm, - trailingSpace: false, - splitSpaces: cm.getOption("lineWrapping") - }; - lineView.measure = {}; - for (var i2 = 0; i2 <= (lineView.rest ? lineView.rest.length : 0); i2++) { - var line = i2 ? lineView.rest[i2 - 1] : lineView.line, - order = void 0; - builder.pos = 0; - builder.addToken = buildToken; - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) { - builder.addToken = buildTokenBadBidi(builder.addToken, order); - } - builder.map = []; - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); - if (line.styleClasses) { - if (line.styleClasses.bgClass) { - builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); - } - if (line.styleClasses.textClass) { - builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); - } - } - if (builder.map.length == 0) { - builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); - } - if (i2 == 0) { - lineView.measure.map = builder.map; - lineView.measure.cache = {}; - } else { - (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); - (lineView.measure.caches || (lineView.measure.caches = [])).push({}); - } - } - if (webkit) { - var last = builder.content.lastChild; - if (/\bcm-tab\b/.test(last.className) || last.querySelector && last.querySelector(".cm-tab")) { - builder.content.className = "cm-tab-wrap-hack"; - } - } - signal(cm, "renderLine", cm, lineView.line, builder.pre); - if (builder.pre.className) { - builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); - } - return builder; + } + if (terminate) { + break; + } + lineText = getLine(state, nextLine).trim(); + if (!lineText) { + break; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + break; + } + columns = escapedSplit(lineText); + if (columns.length && columns[0] === '') columns.shift(); + if (columns.length && columns[columns.length - 1] === '') columns.pop(); + + // note: autocomplete count can be negative if user specifies more columns than header, + // but that does not affect intended use (which is limiting expansion) + autocompletedCells += columnCount - columns.length; + if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) { + break; + } + if (nextLine === startLine + 2) { + const token_tbo = state.push('tbody_open', 'tbody', 1); + token_tbo.map = tbodyLines = [startLine + 2, 0]; + } + const token_tro = state.push('tr_open', 'tr', 1); + token_tro.map = [nextLine, nextLine + 1]; + for (let i = 0; i < columnCount; i++) { + const token_tdo = state.push('td_open', 'td', 1); + if (aligns[i]) { + token_tdo.attrs = [['style', 'text-align:' + aligns[i]]]; } - function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "•", "cm-invalidchar"); - token.title = "\\u" + ch.charCodeAt(0).toString(16); - token.setAttribute("aria-label", token.title); - return token; - } - function buildToken(builder, text, style, startStyle, endStyle, css, attributes) { - if (!text) { - return; - } - var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; - var special = builder.cm.state.specialChars, - mustWrap = false; - var content; - if (!special.test(text)) { - builder.col += text.length; - content = document.createTextNode(displayText); - builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie && ie_version < 9) { - mustWrap = true; - } - builder.pos += text.length; - } else { - content = document.createDocumentFragment(); - var pos = 0; - while (true) { - special.lastIndex = pos; - var m = special.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { - var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); - if (ie && ie_version < 9) { - content.appendChild(elt("span", [txt])); - } else { - content.appendChild(txt); - } - builder.map.push(builder.pos, builder.pos + skipped, txt); - builder.col += skipped; - builder.pos += skipped; - } - if (!m) { - break; - } - pos += skipped + 1; - var txt$1 = void 0; - if (m[0] == " ") { - var tabSize = builder.cm.options.tabSize, - tabWidth = tabSize - builder.col % tabSize; - txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); - txt$1.setAttribute("role", "presentation"); - txt$1.setAttribute("cm-text", " "); - builder.col += tabWidth; - } else if (m[0] == "\r" || m[0] == "\n") { - txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "␍" : "␤", "cm-invalidchar")); - txt$1.setAttribute("cm-text", m[0]); - builder.col += 1; - } else { - txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); - txt$1.setAttribute("cm-text", m[0]); - if (ie && ie_version < 9) { - content.appendChild(elt("span", [txt$1])); - } else { - content.appendChild(txt$1); - } - builder.col += 1; - } - builder.map.push(builder.pos, builder.pos + 1, txt$1); - builder.pos++; - } - } - builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; - if (style || startStyle || endStyle || mustWrap || css || attributes) { - var fullStyle = style || ""; - if (startStyle) { - fullStyle += startStyle; - } - if (endStyle) { - fullStyle += endStyle; - } - var token = elt("span", [content], fullStyle, css); - if (attributes) { - for (var attr in attributes) { - if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class") { - token.setAttribute(attr, attributes[attr]); - } - } - } - return builder.content.appendChild(token); - } - builder.content.appendChild(content); - } - function splitSpaces(text, trailingBefore) { - if (text.length > 1 && !/ /.test(text)) { - return text; - } - var spaceBefore = trailingBefore, - result = ""; - for (var i2 = 0; i2 < text.length; i2++) { - var ch = text.charAt(i2); - if (ch == " " && spaceBefore && (i2 == text.length - 1 || text.charCodeAt(i2 + 1) == 32)) { - ch = " "; - } - result += ch; - spaceBefore = ch == " "; - } - return result; - } - function buildTokenBadBidi(inner, order) { - return function (builder, text, style, startStyle, endStyle, css, attributes) { - style = style ? style + " cm-force-border" : "cm-force-border"; - var start = builder.pos, - end = start + text.length; - for (;;) { - var part = void 0; - for (var i2 = 0; i2 < order.length; i2++) { - part = order[i2]; - if (part.to > start && part.from <= start) { - break; - } - } - if (part.to >= end) { - return inner(builder, text, style, startStyle, endStyle, css, attributes); - } - inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes); - startStyle = null; - text = text.slice(part.to - start); - start = part.to; - } - }; - } - function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode; - if (widget) { - builder.map.push(builder.pos, builder.pos + size, widget); - } - if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { - if (!widget) { - widget = builder.content.appendChild(document.createElement("span")); - } - widget.setAttribute("cm-marker", marker.id); - } - if (widget) { - builder.cm.display.input.setUneditable(widget); - builder.content.appendChild(widget); - } - builder.pos += size; - builder.trailingSpace = false; - } - function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, - allText = line.text, - at = 0; - if (!spans) { - for (var i$12 = 1; i$12 < styles.length; i$12 += 2) { - builder.addToken(builder, allText.slice(at, at = styles[i$12]), interpretTokenStyle(styles[i$12 + 1], builder.cm.options)); - } - return; - } - var len = allText.length, - pos = 0, - i2 = 1, - text = "", - style, - css; - var nextChange = 0, - spanStyle, - spanEndStyle, - spanStartStyle, - collapsed, - attributes; - for (;;) { - if (nextChange == pos) { - spanStyle = spanEndStyle = spanStartStyle = css = ""; - attributes = null; - collapsed = null; - nextChange = Infinity; - var foundBookmarks = [], - endStyles = void 0; - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], - m = sp.marker; - if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { - foundBookmarks.push(m); - } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { - if (sp.to != null && sp.to != pos && nextChange > sp.to) { - nextChange = sp.to; - spanEndStyle = ""; - } - if (m.className) { - spanStyle += " " + m.className; - } - if (m.css) { - css = (css ? css + ";" : "") + m.css; - } - if (m.startStyle && sp.from == pos) { - spanStartStyle += " " + m.startStyle; - } - if (m.endStyle && sp.to == nextChange) { - (endStyles || (endStyles = [])).push(m.endStyle, sp.to); - } - if (m.title) { - (attributes || (attributes = {})).title = m.title; - } - if (m.attributes) { - for (var attr in m.attributes) { - (attributes || (attributes = {}))[attr] = m.attributes[attr]; - } - } - if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) { - collapsed = sp; - } - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } - } - if (endStyles) { - for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) { - if (endStyles[j$1 + 1] == nextChange) { - spanEndStyle += " " + endStyles[j$1]; - } - } - } - if (!collapsed || collapsed.from == pos) { - for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) { - buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); - } - } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null); - if (collapsed.to == null) { - return; - } - if (collapsed.to == pos) { - collapsed = false; - } - } - } - if (pos >= len) { - break; - } - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text; - builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes); - } - if (end >= upto) { - text = text.slice(upto - pos); - pos = upto; - break; - } - pos = end; - spanStartStyle = ""; - } - text = allText.slice(at, at = styles[i2++]); - style = interpretTokenStyle(styles[i2++], builder.cm.options); - } - } - } - function LineView(doc, line, lineN) { - this.line = line; - this.rest = visualLineContinued(line); - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; - this.node = this.text = null; - this.hidden = lineIsHidden(doc, line); - } - function buildViewArray(cm, from, to) { - var array = [], - nextPos; - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); - nextPos = pos + view.size; - array.push(view); - } - return array; - } - var operationGroup = null; - function pushOperation(op) { - if (operationGroup) { - operationGroup.ops.push(op); - } else { - op.ownsGroup = operationGroup = { - ops: [op], - delayedCallbacks: [] - }; - } - } - function fireCallbacksForOps(group) { - var callbacks = group.delayedCallbacks, - i2 = 0; - do { - for (; i2 < callbacks.length; i2++) { - callbacks[i2].call(null); - } - for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j]; - if (op.cursorActivityHandlers) { - while (op.cursorActivityCalled < op.cursorActivityHandlers.length) { - op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); - } - } - } - } while (i2 < callbacks.length); - } - function finishOperation(op, endCb) { - var group = op.ownsGroup; - if (!group) { - return; - } - try { - fireCallbacksForOps(group); - } finally { - operationGroup = null; - endCb(group); - } - } - var orphanDelayedCallbacks = null; - function signalLater(emitter, type) { - var arr = getHandlers(emitter, type); - if (!arr.length) { - return; - } - var args = Array.prototype.slice.call(arguments, 2), - list; - if (operationGroup) { - list = operationGroup.delayedCallbacks; - } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks; + const token_il = state.push('inline', '', 0); + token_il.content = columns[i] ? columns[i].trim() : ''; + token_il.children = []; + state.push('td_close', 'td', -1); + } + state.push('tr_close', 'tr', -1); + } + if (tbodyLines) { + state.push('tbody_close', 'tbody', -1); + tbodyLines[1] = nextLine; + } + state.push('table_close', 'table', -1); + tableLines[1] = nextLine; + state.parentType = oldParentType; + state.line = nextLine; + return true; +} + +// Code block (4 spaces padded) + +function code(state, startLine, endLine /*, silent */) { + if (state.sCount[startLine] - state.blkIndent < 4) { + return false; + } + let nextLine = startLine + 1; + let last = nextLine; + while (nextLine < endLine) { + if (state.isEmpty(nextLine)) { + nextLine++; + continue; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + nextLine++; + last = nextLine; + continue; + } + break; + } + state.line = last; + const token = state.push('code_block', 'code', 0); + token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n'; + token.map = [startLine, state.line]; + return true; +} + +// fences (``` lang, ~~~ lang) + +function fence(state, startLine, endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (pos + 3 > max) { + return false; + } + const marker = state.src.charCodeAt(pos); + if (marker !== 0x7E /* ~ */ && marker !== 0x60 /* ` */) { + return false; + } + + // scan marker length + let mem = pos; + pos = state.skipChars(pos, marker); + let len = pos - mem; + if (len < 3) { + return false; + } + const markup = state.src.slice(mem, pos); + const params = state.src.slice(pos, max); + if (marker === 0x60 /* ` */) { + if (params.indexOf(String.fromCharCode(marker)) >= 0) { + return false; + } + } + + // Since start is found, we can report success here in validation mode + if (silent) { + return true; + } + + // search end of block + let nextLine = startLine; + let haveEndMarker = false; + for (;;) { + nextLine++; + if (nextLine >= endLine) { + // unclosed block should be autoclosed by end of document. + // also block seems to be autoclosed by end of parent + break; + } + pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos < max && state.sCount[nextLine] < state.blkIndent) { + // non-empty line with negative indent should stop the list: + // - ``` + // test + break; + } + if (state.src.charCodeAt(pos) !== marker) { + continue; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + // closing fence should be indented less than 4 spaces + continue; + } + pos = state.skipChars(pos, marker); + + // closing code fence must be at least as long as the opening one + if (pos - mem < len) { + continue; + } + + // make sure tail has spaces only + pos = state.skipSpaces(pos); + if (pos < max) { + continue; + } + haveEndMarker = true; + // found! + break; + } + + // If a fence has heading spaces, they should be removed from its inner block + len = state.sCount[startLine]; + state.line = nextLine + (haveEndMarker ? 1 : 0); + const token = state.push('fence', 'code', 0); + token.info = params; + token.content = state.getLines(startLine + 1, nextLine, len, true); + token.markup = markup; + token.map = [startLine, state.line]; + return true; +} + +// Block quotes + +function blockquote(state, startLine, endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + const oldLineMax = state.lineMax; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + + // check the block quote marker + if (state.src.charCodeAt(pos) !== 0x3E /* > */) { + return false; + } + + // we know that it's going to be a valid blockquote, + // so no point trying to find the end of it in silent mode + if (silent) { + return true; + } + const oldBMarks = []; + const oldBSCount = []; + const oldSCount = []; + const oldTShift = []; + const terminatorRules = state.md.block.ruler.getRules('blockquote'); + const oldParentType = state.parentType; + state.parentType = 'blockquote'; + let lastLineEmpty = false; + let nextLine; + + // Search the end of the block + // + // Block ends with either: + // 1. an empty line outside: + // ``` + // > test + // + // ``` + // 2. an empty line inside: + // ``` + // > + // test + // ``` + // 3. another tag: + // ``` + // > test + // - - - + // ``` + for (nextLine = startLine; nextLine < endLine; nextLine++) { + // check if it's outdented, i.e. it's inside list item and indented + // less than said list item: + // + // ``` + // 1. anything + // > current blockquote + // 2. checking this line + // ``` + const isOutdented = state.sCount[nextLine] < state.blkIndent; + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos >= max) { + // Case 1: line is not inside the blockquote, and this line is empty. + break; + } + if (state.src.charCodeAt(pos++) === 0x3E /* > */ && !isOutdented) { + // This line is inside the blockquote. + + // set offset past spaces and ">" + let initial = state.sCount[nextLine] + 1; + let spaceAfterMarker; + let adjustTab; + + // skip one optional space after '>' + if (state.src.charCodeAt(pos) === 0x20 /* space */) { + // ' > test ' + // ^ -- position start of line here: + pos++; + initial++; + adjustTab = false; + spaceAfterMarker = true; + } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { + spaceAfterMarker = true; + if ((state.bsCount[nextLine] + initial) % 4 === 3) { + // ' >\t test ' + // ^ -- position start of line here (tab has width===1) + pos++; + initial++; + adjustTab = false; } else { - list = orphanDelayedCallbacks = []; - setTimeout(fireOrphanDelayed, 0); - } - var loop = function (i3) { - list.push(function () { - return arr[i3].apply(null, args); - }); - }; - for (var i2 = 0; i2 < arr.length; ++i2) loop(i2); - } - function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks; - orphanDelayedCallbacks = null; - for (var i2 = 0; i2 < delayed.length; ++i2) { - delayed[i2](); - } - } - function updateLineForChanges(cm, lineView, lineN, dims) { - for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j]; - if (type == "text") { - updateLineText(cm, lineView); - } else if (type == "gutter") { - updateLineGutter(cm, lineView, lineN, dims); - } else if (type == "class") { - updateLineClasses(cm, lineView); - } else if (type == "widget") { - updateLineWidgets(cm, lineView, dims); - } - } - lineView.changes = null; - } - function ensureLineWrapped(lineView) { - if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative"); - if (lineView.text.parentNode) { - lineView.text.parentNode.replaceChild(lineView.node, lineView.text); - } - lineView.node.appendChild(lineView.text); - if (ie && ie_version < 8) { - lineView.node.style.zIndex = 2; - } - } - return lineView.node; - } - function updateLineBackground(cm, lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; - if (cls) { - cls += " CodeMirror-linebackground"; - } - if (lineView.background) { - if (cls) { - lineView.background.className = cls; - } else { - lineView.background.parentNode.removeChild(lineView.background); - lineView.background = null; - } - } else if (cls) { - var wrap = ensureLineWrapped(lineView); - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); - cm.display.input.setUneditable(lineView.background); - } - } - function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured; - if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null; - lineView.measure = ext.measure; - return ext.built; - } - return buildLineContent(cm, lineView); - } - function updateLineText(cm, lineView) { - var cls = lineView.text.className; - var built = getLineContent(cm, lineView); - if (lineView.text == lineView.node) { - lineView.node = built.pre; - } - lineView.text.parentNode.replaceChild(built.pre, lineView.text); - lineView.text = built.pre; - if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass; - lineView.textClass = built.textClass; - updateLineClasses(cm, lineView); - } else if (cls) { - lineView.text.className = cls; - } - } - function updateLineClasses(cm, lineView) { - updateLineBackground(cm, lineView); - if (lineView.line.wrapClass) { - ensureLineWrapped(lineView).className = lineView.line.wrapClass; - } else if (lineView.node != lineView.text) { - lineView.node.className = ""; - } - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; - lineView.text.className = textClass || ""; - } - function updateLineGutter(cm, lineView, lineN, dims) { - if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter); - lineView.gutter = null; - } - if (lineView.gutterBackground) { - lineView.node.removeChild(lineView.gutterBackground); - lineView.gutterBackground = null; - } - if (lineView.line.gutterClass) { - var wrap = ensureLineWrapped(lineView); - lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + dims.gutterTotalWidth + "px"); - cm.display.input.setUneditable(lineView.gutterBackground); - wrap.insertBefore(lineView.gutterBackground, lineView.text); - } - var markers = lineView.line.gutterMarkers; - if (cm.options.lineNumbers || markers) { - var wrap$1 = ensureLineWrapped(lineView); - var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"); - gutterWrap.setAttribute("aria-hidden", "true"); - cm.display.input.setUneditable(gutterWrap); - wrap$1.insertBefore(gutterWrap, lineView.text); - if (lineView.line.gutterClass) { - gutterWrap.className += " " + lineView.line.gutterClass; - } - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) { - lineView.lineNumber = gutterWrap.appendChild(elt("div", lineNumberFor(cm.options, lineN), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + cm.display.lineNumInnerWidth + "px")); - } - if (markers) { - for (var k = 0; k < cm.display.gutterSpecs.length; ++k) { - var id = cm.display.gutterSpecs[k].className, - found = markers.hasOwnProperty(id) && markers[id]; - if (found) { - gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); - } - } - } - } - } - function updateLineWidgets(cm, lineView, dims) { - if (lineView.alignable) { - lineView.alignable = null; - } - var isWidget = classTest("CodeMirror-linewidget"); - for (var node = lineView.node.firstChild, next = void 0; node; node = next) { - next = node.nextSibling; - if (isWidget.test(node.className)) { - lineView.node.removeChild(node); - } - } - insertLineWidgets(cm, lineView, dims); - } - function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView); - lineView.text = lineView.node = built.pre; - if (built.bgClass) { - lineView.bgClass = built.bgClass; - } - if (built.textClass) { - lineView.textClass = built.textClass; - } - updateLineClasses(cm, lineView); - updateLineGutter(cm, lineView, lineN, dims); - insertLineWidgets(cm, lineView, dims); - return lineView.node; - } - function insertLineWidgets(cm, lineView, dims) { - insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); - if (lineView.rest) { - for (var i2 = 0; i2 < lineView.rest.length; i2++) { - insertLineWidgetsFor(cm, lineView.rest[i2], lineView, dims, false); - } + // ' >\t test ' + // ^ -- position start of line here + shift bsCount slightly + // to make extra space appear + adjustTab = true; } + } else { + spaceAfterMarker = false; } - function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { - if (!line.widgets) { - return; - } - var wrap = ensureLineWrapped(lineView); - for (var i2 = 0, ws = line.widgets; i2 < ws.length; ++i2) { - var widget = ws[i2], - node = elt("div", [widget.node], "CodeMirror-linewidget" + (widget.className ? " " + widget.className : "")); - if (!widget.handleMouseEvents) { - node.setAttribute("cm-ignore-events", "true"); - } - positionLineWidget(widget, node, lineView, dims); - cm.display.input.setUneditable(node); - if (allowAbove && widget.above) { - wrap.insertBefore(node, lineView.gutter || lineView.text); + let offset = initial; + oldBMarks.push(state.bMarks[nextLine]); + state.bMarks[nextLine] = pos; + while (pos < max) { + const ch = state.src.charCodeAt(pos); + if (isSpace(ch)) { + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4; } else { - wrap.appendChild(node); - } - signalLater(widget, "redraw"); - } - } - function positionLineWidget(widget, node, lineView, dims) { - if (widget.noHScroll) { - (lineView.alignable || (lineView.alignable = [])).push(node); - var width = dims.wrapperWidth; - node.style.left = dims.fixedPos + "px"; - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth; - node.style.paddingLeft = dims.gutterTotalWidth + "px"; - } - node.style.width = width + "px"; - } - if (widget.coverGutter) { - node.style.zIndex = 5; - node.style.position = "relative"; - if (!widget.noHScroll) { - node.style.marginLeft = -dims.gutterTotalWidth + "px"; - } - } - } - function widgetHeight(widget) { - if (widget.height != null) { - return widget.height; - } - var cm = widget.doc.cm; - if (!cm) { - return 0; - } - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;"; - if (widget.coverGutter) { - parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; - } - if (widget.noHScroll) { - parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; - } - removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); - } - return widget.height = widget.node.parentNode.offsetHeight; - } - function eventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { - if (!n || n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true" || n.parentNode == display.sizer && n != display.mover) { - return true; - } - } - } - function paddingTop(display) { - return display.lineSpace.offsetTop; - } - function paddingVert(display) { - return display.mover.offsetHeight - display.lineSpace.offsetHeight; - } - function paddingH(display) { - if (display.cachedPaddingH) { - return display.cachedPaddingH; - } - var e = removeChildrenAndAdd(display.measure, elt("pre", "x", "CodeMirror-line-like")); - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; - var data = { - left: parseInt(style.paddingLeft), - right: parseInt(style.paddingRight) - }; - if (!isNaN(data.left) && !isNaN(data.right)) { - display.cachedPaddingH = data; - } - return data; - } - function scrollGap(cm) { - return scrollerGap - cm.display.nativeBarWidth; - } - function displayWidth(cm) { - return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; - } - function displayHeight(cm) { - return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; - } - function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping; - var curWidth = wrapping && displayWidth(cm); - if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = []; - if (wrapping) { - lineView.measure.width = curWidth; - var rects = lineView.text.firstChild.getClientRects(); - for (var i2 = 0; i2 < rects.length - 1; i2++) { - var cur = rects[i2], - next = rects[i2 + 1]; - if (Math.abs(cur.bottom - next.bottom) > 2) { - heights.push((cur.bottom + next.top) / 2 - rect.top); - } - } - } - heights.push(rect.bottom - rect.top); - } - } - function mapFromLineView(lineView, line, lineN) { - if (lineView.line == line) { - return { - map: lineView.measure.map, - cache: lineView.measure.cache - }; - } - if (lineView.rest) { - for (var i2 = 0; i2 < lineView.rest.length; i2++) { - if (lineView.rest[i2] == line) { - return { - map: lineView.measure.maps[i2], - cache: lineView.measure.caches[i2] - }; - } - } - for (var i$12 = 0; i$12 < lineView.rest.length; i$12++) { - if (lineNo(lineView.rest[i$12]) > lineN) { - return { - map: lineView.measure.maps[i$12], - cache: lineView.measure.caches[i$12], - before: true - }; - } + offset++; } - } - } - function updateExternalMeasurement(cm, line) { - line = visualLine(line); - var lineN = lineNo(line); - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); - view.lineN = lineN; - var built = view.built = buildLineContent(cm, view); - view.text = built.pre; - removeChildrenAndAdd(cm.display.lineMeasure, built.pre); - return view; - } - function measureChar(cm, line, ch, bias) { - return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); - } - function findViewForLine(cm, lineN) { - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) { - return cm.display.view[findViewIndex(cm, lineN)]; - } - var ext = cm.display.externalMeasured; - if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) { - return ext; - } - } - function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line); - var view = findViewForLine(cm, lineN); - if (view && !view.text) { - view = null; - } else if (view && view.changes) { - updateLineForChanges(cm, view, lineN, getDimensions(cm)); - cm.curOp.forceUpdate = true; - } - if (!view) { - view = updateExternalMeasurement(cm, line); - } - var info = mapFromLineView(view, line, lineN); - return { - line, - view, - rect: null, - map: info.map, - cache: info.cache, - before: info.before, - hasHeights: false - }; - } - function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) { - ch = -1; - } - var key = ch + (bias || ""), - found; - if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key]; } else { - if (!prepared.rect) { - prepared.rect = prepared.view.text.getBoundingClientRect(); - } - if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect); - prepared.hasHeights = true; - } - found = measureCharInner(cm, prepared, ch, bias); - if (!found.bogus) { - prepared.cache[key] = found; - } + break; } - return { - left: found.left, - right: found.right, - top: varHeight ? found.rtop : found.top, - bottom: varHeight ? found.rbottom : found.bottom - }; + pos++; } - var nullRect = { - left: 0, - right: 0, - top: 0, - bottom: 0 - }; - function nodeAndOffsetInLineMap(map2, ch, bias) { - var node, start, end, collapse, mStart, mEnd; - for (var i2 = 0; i2 < map2.length; i2 += 3) { - mStart = map2[i2]; - mEnd = map2[i2 + 1]; - if (ch < mStart) { - start = 0; - end = 1; - collapse = "left"; - } else if (ch < mEnd) { - start = ch - mStart; - end = start + 1; - } else if (i2 == map2.length - 3 || ch == mEnd && map2[i2 + 3] > ch) { - end = mEnd - mStart; - start = end - 1; - if (ch >= mEnd) { - collapse = "right"; - } - } - if (start != null) { - node = map2[i2 + 2]; - if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) { - collapse = bias; - } - if (bias == "left" && start == 0) { - while (i2 && map2[i2 - 2] == map2[i2 - 3] && map2[i2 - 1].insertLeft) { - node = map2[(i2 -= 3) + 2]; - collapse = "left"; - } - } - if (bias == "right" && start == mEnd - mStart) { - while (i2 < map2.length - 3 && map2[i2 + 3] == map2[i2 + 4] && !map2[i2 + 5].insertLeft) { - node = map2[(i2 += 3) + 2]; - collapse = "right"; - } - } - break; - } - } - return { - node, - start, - end, - collapse, - coverStart: mStart, - coverEnd: mEnd - }; + lastLineEmpty = pos >= max; + oldBSCount.push(state.bsCount[nextLine]); + state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] = offset - initial; + oldTShift.push(state.tShift[nextLine]); + state.tShift[nextLine] = pos - state.bMarks[nextLine]; + continue; + } + + // Case 2: line is not inside the blockquote, and the last line was empty. + if (lastLineEmpty) { + break; + } + + // Case 3: another tag found. + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; } - function getUsefulRect(rects, bias) { - var rect = nullRect; - if (bias == "left") { - for (var i2 = 0; i2 < rects.length; i2++) { - if ((rect = rects[i2]).left != rect.right) { - break; - } - } - } else { - for (var i$12 = rects.length - 1; i$12 >= 0; i$12--) { - if ((rect = rects[i$12]).left != rect.right) { - break; - } - } - } - return rect; - } - function measureCharInner(cm, prepared, ch, bias) { - var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); - var node = place.node, - start = place.start, - end = place.end, - collapse = place.collapse; - var rect; - if (node.nodeType == 3) { - for (var i$12 = 0; i$12 < 4; i$12++) { - while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { - --start; - } - while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { - ++end; - } - if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { - rect = node.parentNode.getBoundingClientRect(); - } else { - rect = getUsefulRect(range(node, start, end).getClientRects(), bias); - } - if (rect.left || rect.right || start == 0) { - break; - } - end = start; - start = start - 1; - collapse = "right"; - } - if (ie && ie_version < 11) { - rect = maybeUpdateRectForZooming(cm.display.measure, rect); - } - } else { - if (start > 0) { - collapse = bias = "right"; - } - var rects; - if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) { - rect = rects[bias == "right" ? rects.length - 1 : 0]; - } else { - rect = node.getBoundingClientRect(); - } - } - if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0]; - if (rSpan) { - rect = { - left: rSpan.left, - right: rSpan.left + charWidth(cm.display), - top: rSpan.top, - bottom: rSpan.bottom - }; - } else { - rect = nullRect; - } - } - var rtop = rect.top - prepared.rect.top, - rbot = rect.bottom - prepared.rect.top; - var mid = (rtop + rbot) / 2; - var heights = prepared.view.measure.heights; - var i2 = 0; - for (; i2 < heights.length - 1; i2++) { - if (mid < heights[i2]) { - break; - } - } - var top = i2 ? heights[i2 - 1] : 0, - bot = heights[i2]; - var result = { - left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, - right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top, - bottom: bot - }; - if (!rect.left && !rect.right) { - result.bogus = true; - } - if (!cm.options.singleCursorHeightPerLine) { - result.rtop = rtop; - result.rbottom = rbot; - } - return result; + } + if (terminate) { + // Quirk to enforce "hard termination mode" for paragraphs; + // normally if you call `tokenize(state, startLine, nextLine)`, + // paragraphs will look below nextLine for paragraph continuation, + // but if blockquote is terminated by another tag, they shouldn't + state.lineMax = nextLine; + if (state.blkIndent !== 0) { + // state.blkIndent was non-zero, we now set it to zero, + // so we need to re-calculate all offsets to appear as + // if indent wasn't changed + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] -= state.blkIndent; } - function maybeUpdateRectForZooming(measure, rect) { - if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) { - return rect; - } - var scaleX = screen.logicalXDPI / screen.deviceXDPI; - var scaleY = screen.logicalYDPI / screen.deviceYDPI; - return { - left: rect.left * scaleX, - right: rect.right * scaleX, - top: rect.top * scaleY, - bottom: rect.bottom * scaleY - }; - } - function clearLineMeasurementCacheFor(lineView) { - if (lineView.measure) { - lineView.measure.cache = {}; - lineView.measure.heights = null; - if (lineView.rest) { - for (var i2 = 0; i2 < lineView.rest.length; i2++) { - lineView.measure.caches[i2] = {}; - } - } - } + break; + } + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + + // A negative indentation means that this is a paragraph continuation + // + state.sCount[nextLine] = -1; + } + const oldIndent = state.blkIndent; + state.blkIndent = 0; + const token_o = state.push('blockquote_open', 'blockquote', 1); + token_o.markup = '>'; + const lines = [startLine, 0]; + token_o.map = lines; + state.md.block.tokenize(state, startLine, nextLine); + const token_c = state.push('blockquote_close', 'blockquote', -1); + token_c.markup = '>'; + state.lineMax = oldLineMax; + state.parentType = oldParentType; + lines[1] = state.line; + + // Restore original tShift; this might not be necessary since the parser + // has already been here, but just to make sure we can do that. + for (let i = 0; i < oldTShift.length; i++) { + state.bMarks[i + startLine] = oldBMarks[i]; + state.tShift[i + startLine] = oldTShift[i]; + state.sCount[i + startLine] = oldSCount[i]; + state.bsCount[i + startLine] = oldBSCount[i]; + } + state.blkIndent = oldIndent; + return true; +} + +// Horizontal rule + +function hr(state, startLine, endLine, silent) { + const max = state.eMarks[startLine]; + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + let pos = state.bMarks[startLine] + state.tShift[startLine]; + const marker = state.src.charCodeAt(pos++); + + // Check hr marker + if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x5F /* _ */) { + return false; + } + + // markers can be mixed with spaces, but there should be at least 3 of them + + let cnt = 1; + while (pos < max) { + const ch = state.src.charCodeAt(pos++); + if (ch !== marker && !isSpace(ch)) { + return false; + } + if (ch === marker) { + cnt++; + } + } + if (cnt < 3) { + return false; + } + if (silent) { + return true; + } + state.line = startLine + 1; + const token = state.push('hr', 'hr', 0); + token.map = [startLine, state.line]; + token.markup = Array(cnt + 1).join(String.fromCharCode(marker)); + return true; +} + +// Lists + +// Search `[-+*][\n ]`, returns next pos after marker on success +// or -1 on fail. +function skipBulletListMarker(state, startLine) { + const max = state.eMarks[startLine]; + let pos = state.bMarks[startLine] + state.tShift[startLine]; + const marker = state.src.charCodeAt(pos++); + // Check bullet + if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x2B /* + */) { + return -1; + } + if (pos < max) { + const ch = state.src.charCodeAt(pos); + if (!isSpace(ch)) { + // " -test " - is not a list item + return -1; + } + } + return pos; +} + +// Search `\d+[.)][\n ]`, returns next pos after marker on success +// or -1 on fail. +function skipOrderedListMarker(state, startLine) { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + let pos = start; + + // List marker should have at least 2 chars (digit + dot) + if (pos + 1 >= max) { + return -1; + } + let ch = state.src.charCodeAt(pos++); + if (ch < 0x30 /* 0 */ || ch > 0x39 /* 9 */) { + return -1; + } + for (;;) { + // EOL -> fail + if (pos >= max) { + return -1; + } + ch = state.src.charCodeAt(pos++); + if (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) { + // List marker should have no more than 9 digits + // (prevents integer overflow in browsers) + if (pos - start >= 10) { + return -1; } - function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null; - removeChildren(cm.display.lineMeasure); - for (var i2 = 0; i2 < cm.display.view.length; i2++) { - clearLineMeasurementCacheFor(cm.display.view[i2]); - } + continue; + } + + // found valid marker + if (ch === 0x29 /* ) */ || ch === 0x2e /* . */) { + break; + } + return -1; + } + if (pos < max) { + ch = state.src.charCodeAt(pos); + if (!isSpace(ch)) { + // " 1.test " - is not a list item + return -1; + } + } + return pos; +} +function markTightParagraphs(state, idx) { + const level = state.level + 2; + for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) { + if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') { + state.tokens[i + 2].hidden = true; + state.tokens[i].hidden = true; + i += 2; + } + } +} +function list(state, startLine, endLine, silent) { + let max, pos, start, token; + let nextLine = startLine; + let tight = true; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[nextLine] - state.blkIndent >= 4) { + return false; + } + + // Special case: + // - item 1 + // - item 2 + // - item 3 + // - item 4 + // - this one is a paragraph continuation + if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) { + return false; + } + let isTerminatingParagraph = false; + + // limit conditions when list can interrupt + // a paragraph (validation mode only) + if (silent && state.parentType === 'paragraph') { + // Next list item should still terminate previous list item; + // + // This code can fail if plugins use blkIndent as well as lists, + // but I hope the spec gets fixed long before that happens. + // + if (state.sCount[nextLine] >= state.blkIndent) { + isTerminatingParagraph = true; + } + } + + // Detect list type and position after marker + let isOrdered; + let markerValue; + let posAfterMarker; + if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) { + isOrdered = true; + start = state.bMarks[nextLine] + state.tShift[nextLine]; + markerValue = Number(state.src.slice(start, posAfterMarker - 1)); + + // If we're starting a new ordered list right after + // a paragraph, it should start with 1. + if (isTerminatingParagraph && markerValue !== 1) return false; + } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) { + isOrdered = false; + } else { + return false; + } + + // If we're starting a new unordered list right after + // a paragraph, first line should not be empty. + if (isTerminatingParagraph) { + if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false; + } + + // For validation mode we can terminate immediately + if (silent) { + return true; + } + + // We should terminate list on style change. Remember first one to compare. + const markerCharCode = state.src.charCodeAt(posAfterMarker - 1); + + // Start list + const listTokIdx = state.tokens.length; + if (isOrdered) { + token = state.push('ordered_list_open', 'ol', 1); + if (markerValue !== 1) { + token.attrs = [['start', markerValue]]; + } + } else { + token = state.push('bullet_list_open', 'ul', 1); + } + const listLines = [nextLine, 0]; + token.map = listLines; + token.markup = String.fromCharCode(markerCharCode); + + // + // Iterate list items + // + + let prevEmptyEnd = false; + const terminatorRules = state.md.block.ruler.getRules('list'); + const oldParentType = state.parentType; + state.parentType = 'list'; + while (nextLine < endLine) { + pos = posAfterMarker; + max = state.eMarks[nextLine]; + const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]); + let offset = initial; + while (pos < max) { + const ch = state.src.charCodeAt(pos); + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[nextLine]) % 4; + } else if (ch === 0x20) { + offset++; + } else { + break; } - function clearCaches(cm) { - clearLineMeasurementCache(cm); - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; - if (!cm.options.lineWrapping) { - cm.display.maxLineChanged = true; - } - cm.display.lineNumChars = null; + pos++; + } + const contentStart = pos; + let indentAfterMarker; + if (contentStart >= max) { + // trimming space in "- \n 3" case, indent is 1 here + indentAfterMarker = 1; + } else { + indentAfterMarker = offset - initial; + } + + // If we have more than 4 spaces, the indent is 1 + // (the rest is just indented code block) + if (indentAfterMarker > 4) { + indentAfterMarker = 1; + } + + // " - test" + // ^^^^^ - calculating total length of this thing + const indent = initial + indentAfterMarker; + + // Run subparser & write tokens + token = state.push('list_item_open', 'li', 1); + token.markup = String.fromCharCode(markerCharCode); + const itemLines = [nextLine, 0]; + token.map = itemLines; + if (isOrdered) { + token.info = state.src.slice(start, posAfterMarker - 1); + } + + // change current state, then restore it after parser subcall + const oldTight = state.tight; + const oldTShift = state.tShift[nextLine]; + const oldSCount = state.sCount[nextLine]; + + // - example list + // ^ listIndent position will be here + // ^ blkIndent position will be here + // + const oldListIndent = state.listIndent; + state.listIndent = state.blkIndent; + state.blkIndent = indent; + state.tight = true; + state.tShift[nextLine] = contentStart - state.bMarks[nextLine]; + state.sCount[nextLine] = offset; + if (contentStart >= max && state.isEmpty(nextLine + 1)) { + // workaround for this case + // (list item is empty, list terminates before "foo"): + // ~~~~~~~~ + // - + // + // foo + // ~~~~~~~~ + state.line = Math.min(state.line + 2, endLine); + } else { + state.md.block.tokenize(state, nextLine, endLine, true); + } + + // If any of list item is tight, mark list as tight + if (!state.tight || prevEmptyEnd) { + tight = false; + } + // Item become loose if finish with empty line, + // but we should filter last element, because it means list finish + prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1); + state.blkIndent = state.listIndent; + state.listIndent = oldListIndent; + state.tShift[nextLine] = oldTShift; + state.sCount[nextLine] = oldSCount; + state.tight = oldTight; + token = state.push('list_item_close', 'li', -1); + token.markup = String.fromCharCode(markerCharCode); + nextLine = state.line; + itemLines[1] = nextLine; + if (nextLine >= endLine) { + break; + } + + // + // Try to check if list is terminated or continued. + // + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[nextLine] - state.blkIndent >= 4) { + break; + } + + // fail if terminating block found + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; } - function pageScrollX() { - if (chrome && android) { - return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)); - } - return window.pageXOffset || (document.documentElement || document.body).scrollLeft; + } + if (terminate) { + break; + } + + // fail if list has another type + if (isOrdered) { + posAfterMarker = skipOrderedListMarker(state, nextLine); + if (posAfterMarker < 0) { + break; } - function pageScrollY() { - if (chrome && android) { - return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)); - } - return window.pageYOffset || (document.documentElement || document.body).scrollTop; + start = state.bMarks[nextLine] + state.tShift[nextLine]; + } else { + posAfterMarker = skipBulletListMarker(state, nextLine); + if (posAfterMarker < 0) { + break; } - function widgetTopHeight(lineObj) { - var ref = visualLine(lineObj); - var widgets = ref.widgets; - var height = 0; - if (widgets) { - for (var i2 = 0; i2 < widgets.length; ++i2) { - if (widgets[i2].above) { - height += widgetHeight(widgets[i2]); - } - } + } + if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { + break; + } + } + + // Finalize list + if (isOrdered) { + token = state.push('ordered_list_close', 'ol', -1); + } else { + token = state.push('bullet_list_close', 'ul', -1); + } + token.markup = String.fromCharCode(markerCharCode); + listLines[1] = nextLine; + state.line = nextLine; + state.parentType = oldParentType; + + // mark paragraphs tight if needed + if (tight) { + markTightParagraphs(state, listTokIdx); + } + return true; +} +function reference(state, startLine, _endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + let nextLine = startLine + 1; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (state.src.charCodeAt(pos) !== 0x5B /* [ */) { + return false; + } + function getNextLine(nextLine) { + const endLine = state.lineMax; + if (nextLine >= endLine || state.isEmpty(nextLine)) { + // empty line or end of input + return null; + } + let isContinuation = false; + + // this would be a code block normally, but after paragraph + // it's considered a lazy continuation regardless of what's there + if (state.sCount[nextLine] - state.blkIndent > 3) { + isContinuation = true; + } + + // quirk for blockquotes, this line should already be checked by that rule + if (state.sCount[nextLine] < 0) { + isContinuation = true; + } + if (!isContinuation) { + const terminatorRules = state.md.block.ruler.getRules('reference'); + const oldParentType = state.parentType; + state.parentType = 'reference'; + + // Some tags can terminate paragraph without empty line. + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; } - return height; } - function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { - if (!includeWidgets) { - var height = widgetTopHeight(lineObj); - rect.top += height; - rect.bottom += height; - } - if (context == "line") { - return rect; - } - if (!context) { - context = "local"; - } - var yOff = heightAtLine(lineObj); - if (context == "local") { - yOff += paddingTop(cm.display); - } else { - yOff -= cm.display.viewOffset; - } - if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect(); - yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); - rect.left += xOff; - rect.right += xOff; - } - rect.top += yOff; - rect.bottom += yOff; - return rect; - } - function fromCoordSystem(cm, coords, context) { - if (context == "div") { - return coords; - } - var left = coords.left, - top = coords.top; - if (context == "page") { - left -= pageScrollX(); - top -= pageScrollY(); - } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect(); - left += localBox.left; - top += localBox.top; - } - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); - return { - left: left - lineSpaceBox.left, - top: top - lineSpaceBox.top - }; + state.parentType = oldParentType; + if (terminate) { + // terminated by another block + return null; } - function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) { - lineObj = getLine(cm.doc, pos.line); - } - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); + } + const pos = state.bMarks[nextLine] + state.tShift[nextLine]; + const max = state.eMarks[nextLine]; + + // max + 1 explicitly includes the newline + return state.src.slice(pos, max + 1); + } + let str = state.src.slice(pos, max + 1); + max = str.length; + let labelEnd = -1; + for (pos = 1; pos < max; pos++) { + const ch = str.charCodeAt(pos); + if (ch === 0x5B /* [ */) { + return false; + } else if (ch === 0x5D /* ] */) { + labelEnd = pos; + break; + } else if (ch === 0x0A /* \n */) { + const lineContent = getNextLine(nextLine); + if (lineContent !== null) { + str += lineContent; + max = str.length; + nextLine++; } - function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line); - if (!preparedMeasure) { - preparedMeasure = prepareMeasureForLine(cm, lineObj); + } else if (ch === 0x5C /* \ */) { + pos++; + if (pos < max && str.charCodeAt(pos) === 0x0A) { + const lineContent = getNextLine(nextLine); + if (lineContent !== null) { + str += lineContent; + max = str.length; + nextLine++; } - function get(ch2, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch2, right ? "right" : "left", varHeight); - if (right) { - m.left = m.right; - } else { - m.right = m.left; - } - return intoCoordSystem(cm, lineObj, m, context); - } - var order = getOrder(lineObj, cm.doc.direction), - ch = pos.ch, - sticky = pos.sticky; - if (ch >= lineObj.text.length) { - ch = lineObj.text.length; - sticky = "before"; - } else if (ch <= 0) { - ch = 0; - sticky = "after"; - } - if (!order) { - return get(sticky == "before" ? ch - 1 : ch, sticky == "before"); - } - function getBidi(ch2, partPos2, invert) { - var part = order[partPos2], - right = part.level == 1; - return get(invert ? ch2 - 1 : ch2, right != invert); - } - var partPos = getBidiPartAt(order, ch, sticky); - var other = bidiOther; - var val = getBidi(ch, partPos, sticky == "before"); - if (other != null) { - val.other = getBidi(ch, other, sticky != "before"); - } - return val; - } - function estimateCoords(cm, pos) { - var left = 0; - pos = clipPos(cm.doc, pos); - if (!cm.options.lineWrapping) { - left = charWidth(cm.display) * pos.ch; - } - var lineObj = getLine(cm.doc, pos.line); - var top = heightAtLine(lineObj) + paddingTop(cm.display); - return { - left, - right: left, - top, - bottom: top + lineObj.height - }; } - function PosWithInfo(line, ch, sticky, outside, xRel) { - var pos = Pos(line, ch, sticky); - pos.xRel = xRel; - if (outside) { - pos.outside = outside; - } - return pos; + } + } + if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A /* : */) { + return false; + } + + // [label]: destination 'title' + // ^^^ skip optional whitespace here + for (pos = labelEnd + 2; pos < max; pos++) { + const ch = str.charCodeAt(pos); + if (ch === 0x0A) { + const lineContent = getNextLine(nextLine); + if (lineContent !== null) { + str += lineContent; + max = str.length; + nextLine++; } - function coordsChar(cm, x, y) { - var doc = cm.doc; - y += cm.display.viewOffset; - if (y < 0) { - return PosWithInfo(doc.first, 0, null, -1, -1); - } - var lineN = lineAtHeight(doc, y), - last = doc.first + doc.size - 1; - if (lineN > last) { - return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1); - } - if (x < 0) { - x = 0; - } - var lineObj = getLine(doc, lineN); - for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y); - var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0)); - if (!collapsed) { - return found; - } - var rangeEnd = collapsed.find(1); - if (rangeEnd.line == lineN) { - return rangeEnd; - } - lineObj = getLine(doc, lineN = rangeEnd.line); - } - } - function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { - y -= widgetTopHeight(lineObj); - var end = lineObj.text.length; - var begin = findFirst(function (ch) { - return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; - }, end, 0); - end = findFirst(function (ch) { - return measureCharPrepared(cm, preparedMeasure, ch).top > y; - }, begin, end); - return { - begin, - end - }; - } - function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { - if (!preparedMeasure) { - preparedMeasure = prepareMeasureForLine(cm, lineObj); - } - var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; - return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop); - } - function boxIsAfter(box, x, y, left) { - return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x; - } - function coordsCharInner(cm, lineObj, lineNo2, x, y) { - y -= heightAtLine(lineObj); - var preparedMeasure = prepareMeasureForLine(cm, lineObj); - var widgetHeight2 = widgetTopHeight(lineObj); - var begin = 0, - end = lineObj.text.length, - ltr = true; - var order = getOrder(lineObj, cm.doc.direction); - if (order) { - var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)(cm, lineObj, lineNo2, preparedMeasure, order, x, y); - ltr = part.level != 1; - begin = ltr ? part.from : part.to - 1; - end = ltr ? part.to : part.from - 1; - } - var chAround = null, - boxAround = null; - var ch = findFirst(function (ch2) { - var box = measureCharPrepared(cm, preparedMeasure, ch2); - box.top += widgetHeight2; - box.bottom += widgetHeight2; - if (!boxIsAfter(box, x, y, false)) { - return false; - } - if (box.top <= y && box.left <= x) { - chAround = ch2; - boxAround = box; - } - return true; - }, begin, end); - var baseX, - sticky, - outside = false; - if (boxAround) { - var atLeft = x - boxAround.left < boxAround.right - x, - atStart = atLeft == ltr; - ch = chAround + (atStart ? 0 : 1); - sticky = atStart ? "after" : "before"; - baseX = atLeft ? boxAround.left : boxAround.right; - } else { - if (!ltr && (ch == end || ch == begin)) { - ch++; - } - sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight2 <= y == ltr ? "after" : "before"; - var coords = cursorCoords(cm, Pos(lineNo2, ch, sticky), "line", lineObj, preparedMeasure); - baseX = coords.left; - outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0; - } - ch = skipExtendingChars(lineObj.text, ch, 1); - return PosWithInfo(lineNo2, ch, sticky, outside, x - baseX); - } - function coordsBidiPart(cm, lineObj, lineNo2, preparedMeasure, order, x, y) { - var index = findFirst(function (i2) { - var part2 = order[i2], - ltr2 = part2.level != 1; - return boxIsAfter(cursorCoords(cm, Pos(lineNo2, ltr2 ? part2.to : part2.from, ltr2 ? "before" : "after"), "line", lineObj, preparedMeasure), x, y, true); - }, 0, order.length - 1); - var part = order[index]; - if (index > 0) { - var ltr = part.level != 1; - var start = cursorCoords(cm, Pos(lineNo2, ltr ? part.from : part.to, ltr ? "after" : "before"), "line", lineObj, preparedMeasure); - if (boxIsAfter(start, x, y, true) && start.top > y) { - part = order[index - 1]; - } - } - return part; - } - function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { - var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); - var begin = ref.begin; - var end = ref.end; - if (/\s/.test(lineObj.text.charAt(end - 1))) { - end--; - } - var part = null, - closestDist = null; - for (var i2 = 0; i2 < order.length; i2++) { - var p = order[i2]; - if (p.from >= end || p.to <= begin) { - continue; - } - var ltr = p.level != 1; - var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right; - var dist = endX < x ? x - endX + 1e9 : endX - x; - if (!part || closestDist > dist) { - part = p; - closestDist = dist; - } - } - if (!part) { - part = order[order.length - 1]; - } - if (part.from < begin) { - part = { - from: begin, - to: part.to, - level: part.level - }; - } - if (part.to > end) { - part = { - from: part.from, - to: end, - level: part.level - }; - } - return part; + } else if (isSpace(ch)) ;else { + break; + } + } + + // [label]: destination 'title' + // ^^^^^^^^^^^ parse this + const destRes = state.md.helpers.parseLinkDestination(str, pos, max); + if (!destRes.ok) { + return false; + } + const href = state.md.normalizeLink(destRes.str); + if (!state.md.validateLink(href)) { + return false; + } + pos = destRes.pos; + + // save cursor state, we could require to rollback later + const destEndPos = pos; + const destEndLineNo = nextLine; + + // [label]: destination 'title' + // ^^^ skipping those spaces + const start = pos; + for (; pos < max; pos++) { + const ch = str.charCodeAt(pos); + if (ch === 0x0A) { + const lineContent = getNextLine(nextLine); + if (lineContent !== null) { + str += lineContent; + max = str.length; + nextLine++; } - var measureText; - function textHeight(display) { - if (display.cachedTextHeight != null) { - return display.cachedTextHeight; - } - if (measureText == null) { - measureText = elt("pre", null, "CodeMirror-line-like"); - for (var i2 = 0; i2 < 49; ++i2) { - measureText.appendChild(document.createTextNode("x")); - measureText.appendChild(elt("br")); - } - measureText.appendChild(document.createTextNode("x")); - } - removeChildrenAndAdd(display.measure, measureText); - var height = measureText.offsetHeight / 50; - if (height > 3) { - display.cachedTextHeight = height; - } - removeChildren(display.measure); - return height || 1; - } - function charWidth(display) { - if (display.cachedCharWidth != null) { - return display.cachedCharWidth; - } - var anchor = elt("span", "xxxxxxxxxx"); - var pre = elt("pre", [anchor], "CodeMirror-line-like"); - removeChildrenAndAdd(display.measure, pre); - var rect = anchor.getBoundingClientRect(), - width = (rect.right - rect.left) / 10; - if (width > 2) { - display.cachedCharWidth = width; - } - return width || 10; - } - function getDimensions(cm) { - var d = cm.display, - left = {}, - width = {}; - var gutterLeft = d.gutters.clientLeft; - for (var n = d.gutters.firstChild, i2 = 0; n; n = n.nextSibling, ++i2) { - var id = cm.display.gutterSpecs[i2].className; - left[id] = n.offsetLeft + n.clientLeft + gutterLeft; - width[id] = n.clientWidth; + } else if (isSpace(ch)) ;else { + break; + } + } + + // [label]: destination 'title' + // ^^^^^^^ parse this + let titleRes = state.md.helpers.parseLinkTitle(str, pos, max); + while (titleRes.can_continue) { + const lineContent = getNextLine(nextLine); + if (lineContent === null) break; + str += lineContent; + pos = max; + max = str.length; + nextLine++; + titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes); + } + let title; + if (pos < max && start !== pos && titleRes.ok) { + title = titleRes.str; + pos = titleRes.pos; + } else { + title = ''; + pos = destEndPos; + nextLine = destEndLineNo; + } + + // skip trailing spaces until the rest of the line + while (pos < max) { + const ch = str.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + pos++; + } + if (pos < max && str.charCodeAt(pos) !== 0x0A) { + if (title) { + // garbage at the end of the line after title, + // but it could still be a valid reference if we roll back + title = ''; + pos = destEndPos; + nextLine = destEndLineNo; + while (pos < max) { + const ch = str.charCodeAt(pos); + if (!isSpace(ch)) { + break; } - return { - fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth - }; - } - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; - } - function estimateHeight(cm) { - var th = textHeight(cm.display), - wrapping = cm.options.lineWrapping; - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); - return function (line) { - if (lineIsHidden(cm.doc, line)) { - return 0; - } - var widgetsHeight = 0; - if (line.widgets) { - for (var i2 = 0; i2 < line.widgets.length; i2++) { - if (line.widgets[i2].height) { - widgetsHeight += line.widgets[i2].height; - } - } - } - if (wrapping) { - return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; - } else { - return widgetsHeight + th; - } - }; - } - function estimateLineHeights(cm) { - var doc = cm.doc, - est = estimateHeight(cm); - doc.iter(function (line) { - var estHeight = est(line); - if (estHeight != line.height) { - updateLineHeight(line, estHeight); - } - }); + pos++; } - function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display; - if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { - return null; - } - var x, - y, - space = display.lineSpace.getBoundingClientRect(); - try { - x = e.clientX - space.left; - y = e.clientY - space.top; - } catch (e$1) { - return null; - } - var coords = coordsChar(cm, x, y), - line; - if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); - } - return coords; + } + } + if (pos < max && str.charCodeAt(pos) !== 0x0A) { + // garbage at the end of the line + return false; + } + const label = normalizeReference(str.slice(1, labelEnd)); + if (!label) { + // CommonMark 0.20 disallows empty labels + return false; + } + + // Reference can not terminate anything. This check is for safety only. + /* istanbul ignore if */ + if (silent) { + return true; + } + if (typeof state.env.references === 'undefined') { + state.env.references = {}; + } + if (typeof state.env.references[label] === 'undefined') { + state.env.references[label] = { + title, + href + }; + } + state.line = nextLine; + return true; +} + +// List of valid html blocks names, according to commonmark spec +// https://spec.commonmark.org/0.30/#html-blocks + +var block_names = ['address', 'article', 'aside', 'base', 'basefont', 'blockquote', 'body', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dialog', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'iframe', 'legend', 'li', 'link', 'main', 'menu', 'menuitem', 'nav', 'noframes', 'ol', 'optgroup', 'option', 'p', 'param', 'search', 'section', 'summary', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul']; + +// Regexps to match html elements + +const attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; +const unquoted = '[^"\'=<>`\\x00-\\x20]+'; +const single_quoted = "'[^']*'"; +const double_quoted = '"[^"]*"'; +const attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; +const attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; +const open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; +const close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; +const comment = ''; +const processing = '<[?][\\s\\S]*?[?]>'; +const declaration = ']*>'; +const cdata = ''; +const HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + '|' + processing + '|' + declaration + '|' + cdata + ')'); +const HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); + +// HTML block + +// An array of opening and corresponding closing sequences for html tags, +// last argument defines whether it can terminate a paragraph or not +// +const HTML_SEQUENCES = [[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true], [/^/, true], [/^<\?/, /\?>/, true], [/^/, true], [/^/, true], [new RegExp('^|$))', 'i'), /^$/, true], [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false]]; +function html_block(state, startLine, endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (!state.md.options.html) { + return false; + } + if (state.src.charCodeAt(pos) !== 0x3C /* < */) { + return false; + } + let lineText = state.src.slice(pos, max); + let i = 0; + for (; i < HTML_SEQUENCES.length; i++) { + if (HTML_SEQUENCES[i][0].test(lineText)) { + break; + } + } + if (i === HTML_SEQUENCES.length) { + return false; + } + if (silent) { + // true if this sequence can be a terminator, false otherwise + return HTML_SEQUENCES[i][2]; + } + let nextLine = startLine + 1; + + // If we are here - we detected HTML block. + // Let's roll down till block end. + if (!HTML_SEQUENCES[i][1].test(lineText)) { + for (; nextLine < endLine; nextLine++) { + if (state.sCount[nextLine] < state.blkIndent) { + break; } - function findViewIndex(cm, n) { - if (n >= cm.display.viewTo) { - return null; - } - n -= cm.display.viewFrom; - if (n < 0) { - return null; - } - var view = cm.display.view; - for (var i2 = 0; i2 < view.length; i2++) { - n -= view[i2].size; - if (n < 0) { - return i2; - } + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + lineText = state.src.slice(pos, max); + if (HTML_SEQUENCES[i][1].test(lineText)) { + if (lineText.length !== 0) { + nextLine++; } + break; } - function regChange(cm, from, to, lendiff) { - if (from == null) { - from = cm.doc.first; - } - if (to == null) { - to = cm.doc.first + cm.doc.size; - } - if (!lendiff) { - lendiff = 0; - } - var display = cm.display; - if (lendiff && to < display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers > from)) { - display.updateLineNumbers = from; - } - cm.curOp.viewChanged = true; - if (from >= display.viewTo) { - if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) { - resetView(cm); - } - } else if (to <= display.viewFrom) { - if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm); - } else { - display.viewFrom += lendiff; - display.viewTo += lendiff; - } - } else if (from <= display.viewFrom && to >= display.viewTo) { - resetView(cm); - } else if (from <= display.viewFrom) { - var cut = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cut) { - display.view = display.view.slice(cut.index); - display.viewFrom = cut.lineN; - display.viewTo += lendiff; - } else { - resetView(cm); - } - } else if (to >= display.viewTo) { - var cut$1 = viewCuttingPoint(cm, from, from, -1); - if (cut$1) { - display.view = display.view.slice(0, cut$1.index); - display.viewTo = cut$1.lineN; - } else { - resetView(cm); - } - } else { - var cutTop = viewCuttingPoint(cm, from, from, -1); - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cutTop && cutBot) { - display.view = display.view.slice(0, cutTop.index).concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)).concat(display.view.slice(cutBot.index)); - display.viewTo += lendiff; - } else { - resetView(cm); - } - } - var ext = display.externalMeasured; - if (ext) { - if (to < ext.lineN) { - ext.lineN += lendiff; - } else if (from < ext.lineN + ext.size) { - display.externalMeasured = null; + } + } + state.line = nextLine; + const token = state.push('html_block', '', 0); + token.map = [startLine, nextLine]; + token.content = state.getLines(startLine, nextLine, state.blkIndent, true); + return true; +} + +// heading (#, ##, ...) + +function heading(state, startLine, endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + let ch = state.src.charCodeAt(pos); + if (ch !== 0x23 /* # */ || pos >= max) { + return false; + } + + // count heading level + let level = 1; + ch = state.src.charCodeAt(++pos); + while (ch === 0x23 /* # */ && pos < max && level <= 6) { + level++; + ch = state.src.charCodeAt(++pos); + } + if (level > 6 || pos < max && !isSpace(ch)) { + return false; + } + if (silent) { + return true; + } + + // Let's cut tails like ' ### ' from the end of string + + max = state.skipSpacesBack(max, pos); + const tmp = state.skipCharsBack(max, 0x23, pos); // # + if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) { + max = tmp; + } + state.line = startLine + 1; + const token_o = state.push('heading_open', 'h' + String(level), 1); + token_o.markup = '########'.slice(0, level); + token_o.map = [startLine, state.line]; + const token_i = state.push('inline', '', 0); + token_i.content = state.src.slice(pos, max).trim(); + token_i.map = [startLine, state.line]; + token_i.children = []; + const token_c = state.push('heading_close', 'h' + String(level), -1); + token_c.markup = '########'.slice(0, level); + return true; +} + +// lheading (---, ===) + +function lheading(state, startLine, endLine /*, silent */) { + const terminatorRules = state.md.block.ruler.getRules('paragraph'); + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + const oldParentType = state.parentType; + state.parentType = 'paragraph'; // use paragraph to match terminatorRules + + // jump line-by-line until empty one or EOF + let level = 0; + let marker; + let nextLine = startLine + 1; + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + // this would be a code block normally, but after paragraph + // it's considered a lazy continuation regardless of what's there + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + + // + // Check for underline in setext header + // + if (state.sCount[nextLine] >= state.blkIndent) { + let pos = state.bMarks[nextLine] + state.tShift[nextLine]; + const max = state.eMarks[nextLine]; + if (pos < max) { + marker = state.src.charCodeAt(pos); + if (marker === 0x2D /* - */ || marker === 0x3D /* = */) { + pos = state.skipChars(pos, marker); + pos = state.skipSpaces(pos); + if (pos >= max) { + level = marker === 0x3D /* = */ ? 1 : 2; + break; } } } - function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true; - var display = cm.display, - ext = cm.display.externalMeasured; - if (ext && line >= ext.lineN && line < ext.lineN + ext.size) { - display.externalMeasured = null; - } - if (line < display.viewFrom || line >= display.viewTo) { - return; - } - var lineView = display.view[findViewIndex(cm, line)]; - if (lineView.node == null) { - return; - } - var arr = lineView.changes || (lineView.changes = []); - if (indexOf(arr, type) == -1) { - arr.push(type); - } + } + + // quirk for blockquotes, this line should already be checked by that rule + if (state.sCount[nextLine] < 0) { + continue; + } + + // Some tags can terminate paragraph without empty line. + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; } - function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first; - cm.display.view = []; - cm.display.viewOffset = 0; + } + if (terminate) { + break; + } + } + if (!level) { + // Didn't find valid underline + return false; + } + const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + state.line = nextLine + 1; + const token_o = state.push('heading_open', 'h' + String(level), 1); + token_o.markup = String.fromCharCode(marker); + token_o.map = [startLine, state.line]; + const token_i = state.push('inline', '', 0); + token_i.content = content; + token_i.map = [startLine, state.line - 1]; + token_i.children = []; + const token_c = state.push('heading_close', 'h' + String(level), -1); + token_c.markup = String.fromCharCode(marker); + state.parentType = oldParentType; + return true; +} + +// Paragraph + +function paragraph(state, startLine, endLine) { + const terminatorRules = state.md.block.ruler.getRules('paragraph'); + const oldParentType = state.parentType; + let nextLine = startLine + 1; + state.parentType = 'paragraph'; + + // jump line-by-line until empty one or EOF + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + // this would be a code block normally, but after paragraph + // it's considered a lazy continuation regardless of what's there + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + + // quirk for blockquotes, this line should already be checked by that rule + if (state.sCount[nextLine] < 0) { + continue; + } + + // Some tags can terminate paragraph without empty line. + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; } - function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), - diff, - view = cm.display.view; - if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) { - return { - index, - lineN: newN - }; - } - var n = cm.display.viewFrom; - for (var i2 = 0; i2 < index; i2++) { - n += view[i2].size; - } - if (n != oldN) { - if (dir > 0) { - if (index == view.length - 1) { - return null; - } - diff = n + view[index].size - oldN; - index++; - } else { - diff = n - oldN; - } - oldN += diff; - newN += diff; - } - while (visualLineNo(cm.doc, newN) != newN) { - if (index == (dir < 0 ? 0 : view.length - 1)) { - return null; - } - newN += dir * view[index - (dir < 0 ? 1 : 0)].size; - index += dir; + } + if (terminate) { + break; + } + } + const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + state.line = nextLine; + const token_o = state.push('paragraph_open', 'p', 1); + token_o.map = [startLine, state.line]; + const token_i = state.push('inline', '', 0); + token_i.content = content; + token_i.map = [startLine, state.line]; + token_i.children = []; + state.push('paragraph_close', 'p', -1); + state.parentType = oldParentType; + return true; +} + +/** internal + * class ParserBlock + * + * Block-level tokenizer. + **/ + +const _rules$1 = [ +// First 2 params - rule name & source. Secondary array - list of rules, +// which can be terminated by this one. +['table', table, ['paragraph', 'reference']], ['code', code], ['fence', fence, ['paragraph', 'reference', 'blockquote', 'list']], ['blockquote', blockquote, ['paragraph', 'reference', 'blockquote', 'list']], ['hr', hr, ['paragraph', 'reference', 'blockquote', 'list']], ['list', list, ['paragraph', 'reference', 'blockquote']], ['reference', reference], ['html_block', html_block, ['paragraph', 'reference', 'blockquote']], ['heading', heading, ['paragraph', 'reference', 'blockquote']], ['lheading', lheading], ['paragraph', paragraph]]; + +/** + * new ParserBlock() + **/ +function ParserBlock() { + /** + * ParserBlock#ruler -> Ruler + * + * [[Ruler]] instance. Keep configuration of block rules. + **/ + this.ruler = new Ruler(); + for (let i = 0; i < _rules$1.length; i++) { + this.ruler.push(_rules$1[i][0], _rules$1[i][1], { + alt: (_rules$1[i][2] || []).slice() + }); + } +} + +// Generate tokens for input range +// +ParserBlock.prototype.tokenize = function (state, startLine, endLine) { + const rules = this.ruler.getRules(''); + const len = rules.length; + const maxNesting = state.md.options.maxNesting; + let line = startLine; + let hasEmptyLines = false; + while (line < endLine) { + state.line = line = state.skipEmptyLines(line); + if (line >= endLine) { + break; + } + + // Termination condition for nested calls. + // Nested calls currently used for blockquotes & lists + if (state.sCount[line] < state.blkIndent) { + break; + } + + // If nesting level exceeded - skip tail to the end. That's not ordinary + // situation and we should not care about content. + if (state.level >= maxNesting) { + state.line = endLine; + break; + } + + // Try all possible rules. + // On success, rule should: + // + // - update `state.line` + // - update `state.tokens` + // - return true + const prevLine = state.line; + let ok = false; + for (let i = 0; i < len; i++) { + ok = rules[i](state, line, endLine, false); + if (ok) { + if (prevLine >= state.line) { + throw new Error("block rule didn't increment state.line"); } - return { - index, - lineN: newN - }; + break; } - function adjustView(cm, from, to) { - var display = cm.display, - view = display.view; - if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to); - display.viewFrom = from; - } else { - if (display.viewFrom > from) { - display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); - } else if (display.viewFrom < from) { - display.view = display.view.slice(findViewIndex(cm, from)); - } - display.viewFrom = from; - if (display.viewTo < to) { - display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); - } else if (display.viewTo > to) { - display.view = display.view.slice(0, findViewIndex(cm, to)); - } - } - display.viewTo = to; - } - function countDirtyView(cm) { - var view = cm.display.view, - dirty = 0; - for (var i2 = 0; i2 < view.length; i2++) { - var lineView = view[i2]; - if (!lineView.hidden && (!lineView.node || lineView.changes)) { - ++dirty; - } - } - return dirty; - } - function updateSelection(cm) { - cm.display.input.showSelection(cm.display.input.prepareSelection()); - } - function prepareSelection(cm, primary) { - if (primary === void 0) primary = true; - var doc = cm.doc, - result = {}; - var curFragment = result.cursors = document.createDocumentFragment(); - var selFragment = result.selection = document.createDocumentFragment(); - var customCursor = cm.options.$customCursor; - if (customCursor) { - primary = true; - } - for (var i2 = 0; i2 < doc.sel.ranges.length; i2++) { - if (!primary && i2 == doc.sel.primIndex) { - continue; - } - var range2 = doc.sel.ranges[i2]; - if (range2.from().line >= cm.display.viewTo || range2.to().line < cm.display.viewFrom) { - continue; - } - var collapsed = range2.empty(); - if (customCursor) { - var head = customCursor(cm, range2); - if (head) { - drawSelectionCursor(cm, head, curFragment); - } - } else if (collapsed || cm.options.showCursorWhenSelecting) { - drawSelectionCursor(cm, range2.head, curFragment); - } - if (!collapsed) { - drawSelectionRange(cm, range2, selFragment); - } - } - return result; - } - function drawSelectionCursor(cm, head, output) { - var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); - var cursor = output.appendChild(elt("div", " ", "CodeMirror-cursor")); - cursor.style.left = pos.left + "px"; - cursor.style.top = pos.top + "px"; - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) { - var charPos = charCoords(cm, head, "div", null, null); - var width = charPos.right - charPos.left; - cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px"; - } - if (pos.other) { - var otherCursor = output.appendChild(elt("div", " ", "CodeMirror-cursor CodeMirror-secondarycursor")); - otherCursor.style.display = ""; - otherCursor.style.left = pos.other.left + "px"; - otherCursor.style.top = pos.other.top + "px"; - otherCursor.style.height = (pos.other.bottom - pos.other.top) * 0.85 + "px"; - } - } - function cmpCoords(a, b) { - return a.top - b.top || a.left - b.left; - } - function drawSelectionRange(cm, range2, output) { - var display = cm.display, - doc = cm.doc; - var fragment = document.createDocumentFragment(); - var padding = paddingH(cm.display), - leftSide = padding.left; - var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; - var docLTR = doc.direction == "ltr"; - function add(left, top, width, bottom) { - if (top < 0) { - top = 0; - } - top = Math.round(top); - bottom = Math.round(bottom); - fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")); - } - function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line); - var lineLen = lineObj.text.length; - var start, end; - function coords(ch, bias) { - return charCoords(cm, Pos(line, ch), "div", lineObj, bias); - } - function wrapX(pos, dir, side) { - var extent = wrappedLineExtentChar(cm, lineObj, null, pos); - var prop2 = dir == "ltr" == (side == "after") ? "left" : "right"; - var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); - return coords(ch, prop2)[prop2]; - } - var order = getOrder(lineObj, doc.direction); - iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i2) { - var ltr = dir == "ltr"; - var fromPos = coords(from, ltr ? "left" : "right"); - var toPos = coords(to - 1, ltr ? "right" : "left"); - var openStart = fromArg == null && from == 0, - openEnd = toArg == null && to == lineLen; - var first = i2 == 0, - last = !order || i2 == order.length - 1; - if (toPos.top - fromPos.top <= 3) { - var openLeft = (docLTR ? openStart : openEnd) && first; - var openRight = (docLTR ? openEnd : openStart) && last; - var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; - var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; - add(left, fromPos.top, right - left, fromPos.bottom); - } else { - var topLeft, topRight, botLeft, botRight; - if (ltr) { - topLeft = docLTR && openStart && first ? leftSide : fromPos.left; - topRight = docLTR ? rightSide : wrapX(from, dir, "before"); - botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); - botRight = docLTR && openEnd && last ? rightSide : toPos.right; - } else { - topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); - topRight = !docLTR && openStart && first ? rightSide : fromPos.right; - botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; - botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); - } - add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); - if (fromPos.bottom < toPos.top) { - add(leftSide, fromPos.bottom, null, toPos.top); - } - add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); - } - if (!start || cmpCoords(fromPos, start) < 0) { - start = fromPos; - } - if (cmpCoords(toPos, start) < 0) { - start = toPos; - } - if (!end || cmpCoords(fromPos, end) < 0) { - end = fromPos; - } - if (cmpCoords(toPos, end) < 0) { - end = toPos; - } - }); - return { - start, - end - }; - } - var sFrom = range2.from(), - sTo = range2.to(); - if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch); - } else { - var fromLine = getLine(doc, sFrom.line), - toLine = getLine(doc, sTo.line); - var singleVLine = visualLine(fromLine) == visualLine(toLine); - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; - if (singleVLine) { - if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); - } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); - } - } - if (leftEnd.bottom < rightStart.top) { - add(leftSide, leftEnd.bottom, null, rightStart.top); - } - } - output.appendChild(fragment); - } - function restartBlink(cm) { - if (!cm.state.focused) { - return; - } - var display = cm.display; - clearInterval(display.blinker); - var on2 = true; - display.cursorDiv.style.visibility = ""; - if (cm.options.cursorBlinkRate > 0) { - display.blinker = setInterval(function () { - if (!cm.hasFocus()) { - onBlur(cm); - } - display.cursorDiv.style.visibility = (on2 = !on2) ? "" : "hidden"; - }, cm.options.cursorBlinkRate); - } else if (cm.options.cursorBlinkRate < 0) { - display.cursorDiv.style.visibility = "hidden"; - } - } - function ensureFocus(cm) { - if (!cm.hasFocus()) { - cm.display.input.focus(); - if (!cm.state.focused) { - onFocus(cm); - } - } - } - function delayBlurEvent(cm) { - cm.state.delayingBlurEvent = true; - setTimeout(function () { - if (cm.state.delayingBlurEvent) { - cm.state.delayingBlurEvent = false; - if (cm.state.focused) { - onBlur(cm); - } - } - }, 100); - } - function onFocus(cm, e) { - if (cm.state.delayingBlurEvent && !cm.state.draggingText) { - cm.state.delayingBlurEvent = false; - } - if (cm.options.readOnly == "nocursor") { - return; - } - if (!cm.state.focused) { - signal(cm, "focus", cm, e); - cm.state.focused = true; - addClass(cm.display.wrapper, "CodeMirror-focused"); - if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - cm.display.input.reset(); - if (webkit) { - setTimeout(function () { - return cm.display.input.reset(true); - }, 20); - } - } - cm.display.input.receivedFocus(); - } - restartBlink(cm); - } - function onBlur(cm, e) { - if (cm.state.delayingBlurEvent) { - return; - } - if (cm.state.focused) { - signal(cm, "blur", cm, e); - cm.state.focused = false; - rmClass(cm.display.wrapper, "CodeMirror-focused"); - } - clearInterval(cm.display.blinker); - setTimeout(function () { - if (!cm.state.focused) { - cm.display.shift = false; - } - }, 150); - } - function updateHeightsInViewport(cm) { - var display = cm.display; - var prevBottom = display.lineDiv.offsetTop; - var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top); - var oldHeight = display.lineDiv.getBoundingClientRect().top; - var mustScroll = 0; - for (var i2 = 0; i2 < display.view.length; i2++) { - var cur = display.view[i2], - wrapping = cm.options.lineWrapping; - var height = void 0, - width = 0; - if (cur.hidden) { - continue; - } - oldHeight += cur.line.height; - if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight; - height = bot - prevBottom; - prevBottom = bot; - } else { - var box = cur.node.getBoundingClientRect(); - height = box.bottom - box.top; - if (!wrapping && cur.text.firstChild) { - width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; - } - } - var diff = cur.line.height - height; - if (diff > 5e-3 || diff < -5e-3) { - if (oldHeight < viewTop) { - mustScroll -= diff; - } - updateLineHeight(cur.line, height); - updateWidgetHeight(cur.line); - if (cur.rest) { - for (var j = 0; j < cur.rest.length; j++) { - updateWidgetHeight(cur.rest[j]); - } - } - } - if (width > cm.display.sizerWidth) { - var chWidth = Math.ceil(width / charWidth(cm.display)); - if (chWidth > cm.display.maxLineLength) { - cm.display.maxLineLength = chWidth; - cm.display.maxLine = cur.line; - cm.display.maxLineChanged = true; - } - } - } - if (Math.abs(mustScroll) > 2) { - display.scroller.scrollTop += mustScroll; - } - } - function updateWidgetHeight(line) { - if (line.widgets) { - for (var i2 = 0; i2 < line.widgets.length; ++i2) { - var w = line.widgets[i2], - parent = w.node.parentNode; - if (parent) { - w.height = parent.offsetHeight; - } - } - } + } + + // this can only happen if user disables paragraph rule + if (!ok) throw new Error('none of the block rules matched'); + + // set state.tight if we had an empty line before current tag + // i.e. latest empty line should not count + state.tight = !hasEmptyLines; + + // paragraph might "eat" one newline after it in nested lists + if (state.isEmpty(state.line - 1)) { + hasEmptyLines = true; + } + line = state.line; + if (line < endLine && state.isEmpty(line)) { + hasEmptyLines = true; + line++; + state.line = line; + } + } +}; + +/** + * ParserBlock.parse(str, md, env, outTokens) + * + * Process input string and push block tokens into `outTokens` + **/ +ParserBlock.prototype.parse = function (src, md, env, outTokens) { + if (!src) { + return; + } + const state = new this.State(src, md, env, outTokens); + this.tokenize(state, state.line, state.lineMax); +}; +ParserBlock.prototype.State = StateBlock; + +// Inline parser state + +function StateInline(src, md, env, outTokens) { + this.src = src; + this.env = env; + this.md = md; + this.tokens = outTokens; + this.tokens_meta = Array(outTokens.length); + this.pos = 0; + this.posMax = this.src.length; + this.level = 0; + this.pending = ''; + this.pendingLevel = 0; + + // Stores { start: end } pairs. Useful for backtrack + // optimization of pairs parse (emphasis, strikes). + this.cache = {}; + + // List of emphasis-like delimiters for current tag + this.delimiters = []; + + // Stack of delimiter lists for upper level tags + this._prev_delimiters = []; + + // backtick length => last seen position + this.backticks = {}; + this.backticksScanned = false; + + // Counter used to disable inline linkify-it execution + // inside and markdown links + this.linkLevel = 0; +} + +// Flush pending text +// +StateInline.prototype.pushPending = function () { + const token = new Token('text', '', 0); + token.content = this.pending; + token.level = this.pendingLevel; + this.tokens.push(token); + this.pending = ''; + return token; +}; + +// Push new token to "stream". +// If pending text exists - flush it as text token +// +StateInline.prototype.push = function (type, tag, nesting) { + if (this.pending) { + this.pushPending(); + } + const token = new Token(type, tag, nesting); + let token_meta = null; + if (nesting < 0) { + // closing tag + this.level--; + this.delimiters = this._prev_delimiters.pop(); + } + token.level = this.level; + if (nesting > 0) { + // opening tag + this.level++; + this._prev_delimiters.push(this.delimiters); + this.delimiters = []; + token_meta = { + delimiters: this.delimiters + }; + } + this.pendingLevel = this.level; + this.tokens.push(token); + this.tokens_meta.push(token_meta); + return token; +}; + +// Scan a sequence of emphasis-like markers, and determine whether +// it can start an emphasis sequence or end an emphasis sequence. +// +// - start - position to scan from (it should point at a valid marker); +// - canSplitWord - determine if these markers can be found inside a word +// +StateInline.prototype.scanDelims = function (start, canSplitWord) { + const max = this.posMax; + const marker = this.src.charCodeAt(start); + + // treat beginning of the line as a whitespace + const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20; + let pos = start; + while (pos < max && this.src.charCodeAt(pos) === marker) { + pos++; + } + const count = pos - start; + + // treat end of the line as a whitespace + const nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20; + const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); + const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); + const isLastWhiteSpace = isWhiteSpace(lastChar); + const isNextWhiteSpace = isWhiteSpace(nextChar); + const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar); + const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar); + const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar); + const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar); + return { + can_open, + can_close, + length: count + }; +}; + +// re-export Token class to use in block rules +StateInline.prototype.Token = Token; + +// Skip text characters for text token, place those to pending buffer +// and increment current pos + +// Rule to skip pure text +// '{}$%@~+=:' reserved for extentions + +// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ + +// !!!! Don't confuse with "Markdown ASCII Punctuation" chars +// http://spec.commonmark.org/0.15/#ascii-punctuation-character +function isTerminatorChar(ch) { + switch (ch) { + case 0x0A /* \n */: + case 0x21 /* ! */: + case 0x23 /* # */: + case 0x24 /* $ */: + case 0x25 /* % */: + case 0x26 /* & */: + case 0x2A /* * */: + case 0x2B /* + */: + case 0x2D /* - */: + case 0x3A /* : */: + case 0x3C /* < */: + case 0x3D /* = */: + case 0x3E /* > */: + case 0x40 /* @ */: + case 0x5B /* [ */: + case 0x5C /* \ */: + case 0x5D /* ] */: + case 0x5E /* ^ */: + case 0x5F /* _ */: + case 0x60 /* ` */: + case 0x7B /* { */: + case 0x7D /* } */: + case 0x7E /* ~ */: + return true; + default: + return false; + } +} +function text(state, silent) { + let pos = state.pos; + while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) { + pos++; + } + if (pos === state.pos) { + return false; + } + if (!silent) { + state.pending += state.src.slice(state.pos, pos); + } + state.pos = pos; + return true; +} + +// Alternative implementation, for memory. +// +// It costs 10% of performance, but allows extend terminators list, if place it +// to `ParserInline` property. Probably, will switch to it sometime, such +// flexibility required. + +/* +var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/; + +module.exports = function text(state, silent) { + var pos = state.pos, + idx = state.src.slice(pos).search(TERMINATOR_RE); + + // first char is terminator -> empty text + if (idx === 0) { return false; } + + // no terminator -> text till end of string + if (idx < 0) { + if (!silent) { state.pending += state.src.slice(pos); } + state.pos = state.src.length; + return true; + } + + if (!silent) { state.pending += state.src.slice(pos, pos + idx); } + + state.pos += idx; + + return true; +}; */ + +// Process links like https://example.org/ + +// RFC3986: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) +const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i; +function linkify(state, silent) { + if (!state.md.options.linkify) return false; + if (state.linkLevel > 0) return false; + const pos = state.pos; + const max = state.posMax; + if (pos + 3 > max) return false; + if (state.src.charCodeAt(pos) !== 0x3A /* : */) return false; + if (state.src.charCodeAt(pos + 1) !== 0x2F /* / */) return false; + if (state.src.charCodeAt(pos + 2) !== 0x2F /* / */) return false; + const match = state.pending.match(SCHEME_RE); + if (!match) return false; + const proto = match[1]; + const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length)); + if (!link) return false; + let url = link.url; + + // invalid link, but still detected by linkify somehow; + // need to check to prevent infinite loop below + if (url.length <= proto.length) return false; + + // disallow '*' at the end of the link (conflicts with emphasis) + url = url.replace(/\*+$/, ''); + const fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) return false; + if (!silent) { + state.pending = state.pending.slice(0, -proto.length); + const token_o = state.push('link_open', 'a', 1); + token_o.attrs = [['href', fullUrl]]; + token_o.markup = 'linkify'; + token_o.info = 'auto'; + const token_t = state.push('text', '', 0); + token_t.content = state.md.normalizeLinkText(url); + const token_c = state.push('link_close', 'a', -1); + token_c.markup = 'linkify'; + token_c.info = 'auto'; + } + state.pos += url.length - proto.length; + return true; +} + +// Proceess '\n' + +function newline(state, silent) { + let pos = state.pos; + if (state.src.charCodeAt(pos) !== 0x0A /* \n */) { + return false; + } + const pmax = state.pending.length - 1; + const max = state.posMax; + + // ' \n' -> hardbreak + // Lookup in pending chars is bad practice! Don't copy to other rules! + // Pending string is stored in concat mode, indexed lookups will cause + // convertion to flat mode. + if (!silent) { + if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) { + if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) { + // Find whitespaces tail of pending chars. + let ws = pmax - 1; + while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws--; + state.pending = state.pending.slice(0, ws); + state.push('hardbreak', 'br', 0); + } else { + state.pending = state.pending.slice(0, -1); + state.push('softbreak', 'br', 0); } - function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; - top = Math.floor(top - paddingTop(display)); - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; - var from = lineAtHeight(doc, top), - to = lineAtHeight(doc, bottom); - if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, - ensureTo = viewport.ensure.to.line; - if (ensureFrom < from) { - from = ensureFrom; - to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); - } else if (Math.min(ensureTo, doc.lastLine()) >= to) { - from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); - to = ensureTo; - } - } - return { - from, - to: Math.max(to, from + 1) - }; + } else { + state.push('softbreak', 'br', 0); + } + } + pos++; + + // skip heading spaces for next line + while (pos < max && isSpace(state.src.charCodeAt(pos))) { + pos++; + } + state.pos = pos; + return true; +} + +// Process escaped chars and hardbreaks + +const ESCAPED = []; +for (let i = 0; i < 256; i++) { + ESCAPED.push(0); +} +'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'.split('').forEach(function (ch) { + ESCAPED[ch.charCodeAt(0)] = 1; +}); +function escape(state, silent) { + let pos = state.pos; + const max = state.posMax; + if (state.src.charCodeAt(pos) !== 0x5C /* \ */) return false; + pos++; + + // '\' at the end of the inline block + if (pos >= max) return false; + let ch1 = state.src.charCodeAt(pos); + if (ch1 === 0x0A) { + if (!silent) { + state.push('hardbreak', 'br', 0); + } + pos++; + // skip leading whitespaces from next line + while (pos < max) { + ch1 = state.src.charCodeAt(pos); + if (!isSpace(ch1)) break; + pos++; + } + state.pos = pos; + return true; + } + let escapedStr = state.src[pos]; + if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) { + const ch2 = state.src.charCodeAt(pos + 1); + if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { + escapedStr += state.src[pos + 1]; + pos++; + } + } + const origStr = '\\' + escapedStr; + if (!silent) { + const token = state.push('text_special', '', 0); + if (ch1 < 256 && ESCAPED[ch1] !== 0) { + token.content = escapedStr; + } else { + token.content = origStr; + } + token.markup = origStr; + token.info = 'escape'; + } + state.pos = pos + 1; + return true; +} + +// Parse backticks + +function backtick(state, silent) { + let pos = state.pos; + const ch = state.src.charCodeAt(pos); + if (ch !== 0x60 /* ` */) { + return false; + } + const start = pos; + pos++; + const max = state.posMax; + + // scan marker length + while (pos < max && state.src.charCodeAt(pos) === 0x60 /* ` */) { + pos++; + } + const marker = state.src.slice(start, pos); + const openerLength = marker.length; + if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) { + if (!silent) state.pending += marker; + state.pos += openerLength; + return true; + } + let matchEnd = pos; + let matchStart; + + // Nothing found in the cache, scan until the end of the line (or until marker is found) + while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) { + matchEnd = matchStart + 1; + + // scan marker length + while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60 /* ` */) { + matchEnd++; + } + const closerLength = matchEnd - matchStart; + if (closerLength === openerLength) { + // Found matching closer length. + if (!silent) { + const token = state.push('code_inline', 'code', 0); + token.markup = marker; + token.content = state.src.slice(pos, matchStart).replace(/\n/g, ' ').replace(/^ (.+) $/, '$1'); } - function maybeScrollWindow(cm, rect) { - if (signalDOMEvent(cm, "scrollCursorIntoView")) { - return; - } - var display = cm.display, - box = display.sizer.getBoundingClientRect(), - doScroll = null; - if (rect.top + box.top < 0) { - doScroll = true; - } else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { - doScroll = false; - } - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "​", null, "position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + rect.left + "px; width: " + Math.max(2, rect.right - rect.left) + "px;"); - cm.display.lineSpace.appendChild(scrollNode); - scrollNode.scrollIntoView(doScroll); - cm.display.lineSpace.removeChild(scrollNode); - } - } - function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) { - margin = 0; - } - var rect; - if (!cm.options.lineWrapping && pos == end) { - end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; - pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; - } - for (var limit = 0; limit < 5; limit++) { - var changed = false; - var coords = cursorCoords(cm, pos); - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); - rect = { - left: Math.min(coords.left, endCoords.left), - top: Math.min(coords.top, endCoords.top) - margin, - right: Math.max(coords.left, endCoords.left), - bottom: Math.max(coords.bottom, endCoords.bottom) + margin - }; - var scrollPos = calculateScrollPos(cm, rect); - var startTop = cm.doc.scrollTop, - startLeft = cm.doc.scrollLeft; - if (scrollPos.scrollTop != null) { - updateScrollTop(cm, scrollPos.scrollTop); - if (Math.abs(cm.doc.scrollTop - startTop) > 1) { - changed = true; - } - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { - changed = true; - } - } - if (!changed) { - break; - } - } - return rect; - } - function scrollIntoView(cm, rect) { - var scrollPos = calculateScrollPos(cm, rect); - if (scrollPos.scrollTop != null) { - updateScrollTop(cm, scrollPos.scrollTop); - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - } - } - function calculateScrollPos(cm, rect) { - var display = cm.display, - snapMargin = textHeight(cm.display); - if (rect.top < 0) { - rect.top = 0; - } - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; - var screen2 = displayHeight(cm), - result = {}; - if (rect.bottom - rect.top > screen2) { - rect.bottom = rect.top + screen2; - } - var docBottom = cm.doc.height + paddingVert(display); - var atTop = rect.top < snapMargin, - atBottom = rect.bottom > docBottom - snapMargin; - if (rect.top < screentop) { - result.scrollTop = atTop ? 0 : rect.top; - } else if (rect.bottom > screentop + screen2) { - var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen2); - if (newTop != screentop) { - result.scrollTop = newTop; - } - } - var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth; - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace; - var screenw = displayWidth(cm) - display.gutters.offsetWidth; - var tooWide = rect.right - rect.left > screenw; - if (tooWide) { - rect.right = rect.left + screenw; - } - if (rect.left < 10) { - result.scrollLeft = 0; - } else if (rect.left < screenleft) { - result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); - } else if (rect.right > screenw + screenleft - 3) { - result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; - } - return result; - } - function addToScrollTop(cm, top) { - if (top == null) { - return; - } - resolveScrollToPos(cm); - cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + state.pos = matchEnd; + return true; + } + + // Some different length found, put it in cache as upper limit of where closer can be found + state.backticks[closerLength] = matchStart; + } + + // Scanned through the end, didn't find anything + state.backticksScanned = true; + if (!silent) state.pending += marker; + state.pos += openerLength; + return true; +} + +// ~~strike through~~ +// + +// Insert each marker as a separate text token, and add it to delimiter list +// +function strikethrough_tokenize(state, silent) { + const start = state.pos; + const marker = state.src.charCodeAt(start); + if (silent) { + return false; + } + if (marker !== 0x7E /* ~ */) { + return false; + } + const scanned = state.scanDelims(state.pos, true); + let len = scanned.length; + const ch = String.fromCharCode(marker); + if (len < 2) { + return false; + } + let token; + if (len % 2) { + token = state.push('text', '', 0); + token.content = ch; + len--; + } + for (let i = 0; i < len; i += 2) { + token = state.push('text', '', 0); + token.content = ch + ch; + state.delimiters.push({ + marker, + length: 0, + // disable "rule of 3" length checks meant for emphasis + token: state.tokens.length - 1, + end: -1, + open: scanned.can_open, + close: scanned.can_close + }); + } + state.pos += scanned.length; + return true; +} +function postProcess$1(state, delimiters) { + let token; + const loneMarkers = []; + const max = delimiters.length; + for (let i = 0; i < max; i++) { + const startDelim = delimiters[i]; + if (startDelim.marker !== 0x7E /* ~ */) { + continue; + } + if (startDelim.end === -1) { + continue; + } + const endDelim = delimiters[startDelim.end]; + token = state.tokens[startDelim.token]; + token.type = 's_open'; + token.tag = 's'; + token.nesting = 1; + token.markup = '~~'; + token.content = ''; + token = state.tokens[endDelim.token]; + token.type = 's_close'; + token.tag = 's'; + token.nesting = -1; + token.markup = '~~'; + token.content = ''; + if (state.tokens[endDelim.token - 1].type === 'text' && state.tokens[endDelim.token - 1].content === '~') { + loneMarkers.push(endDelim.token - 1); + } + } + + // If a marker sequence has an odd number of characters, it's splitted + // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the + // start of the sequence. + // + // So, we have to move all those markers after subsequent s_close tags. + // + while (loneMarkers.length) { + const i = loneMarkers.pop(); + let j = i + 1; + while (j < state.tokens.length && state.tokens[j].type === 's_close') { + j++; + } + j--; + if (i !== j) { + token = state.tokens[j]; + state.tokens[j] = state.tokens[i]; + state.tokens[i] = token; + } + } +} + +// Walk through delimiter list and replace text tokens with tags +// +function strikethrough_postProcess(state) { + const tokens_meta = state.tokens_meta; + const max = state.tokens_meta.length; + postProcess$1(state, state.delimiters); + for (let curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + postProcess$1(state, tokens_meta[curr].delimiters); + } + } +} +var r_strikethrough = { + tokenize: strikethrough_tokenize, + postProcess: strikethrough_postProcess +}; + +// Process *this* and _that_ +// + +// Insert each marker as a separate text token, and add it to delimiter list +// +function emphasis_tokenize(state, silent) { + const start = state.pos; + const marker = state.src.charCodeAt(start); + if (silent) { + return false; + } + if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { + return false; + } + const scanned = state.scanDelims(state.pos, marker === 0x2A); + for (let i = 0; i < scanned.length; i++) { + const token = state.push('text', '', 0); + token.content = String.fromCharCode(marker); + state.delimiters.push({ + // Char code of the starting marker (number). + // + marker, + // Total length of these series of delimiters. + // + length: scanned.length, + // A position of the token this delimiter corresponds to. + // + token: state.tokens.length - 1, + // If this delimiter is matched as a valid opener, `end` will be + // equal to its position, otherwise it's `-1`. + // + end: -1, + // Boolean flags that determine if this delimiter could open or close + // an emphasis. + // + open: scanned.can_open, + close: scanned.can_close + }); + } + state.pos += scanned.length; + return true; +} +function postProcess(state, delimiters) { + const max = delimiters.length; + for (let i = max - 1; i >= 0; i--) { + const startDelim = delimiters[i]; + if (startDelim.marker !== 0x5F /* _ */ && startDelim.marker !== 0x2A /* * */) { + continue; + } + + // Process only opening markers + if (startDelim.end === -1) { + continue; + } + const endDelim = delimiters[startDelim.end]; + + // If the previous delimiter has the same marker and is adjacent to this one, + // merge those into one strong delimiter. + // + // `whatever` -> `whatever` + // + const isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && + // check that first two markers match and adjacent + delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 && + // check that last two markers are adjacent (we can safely assume they match) + delimiters[startDelim.end + 1].token === endDelim.token + 1; + const ch = String.fromCharCode(startDelim.marker); + const token_o = state.tokens[startDelim.token]; + token_o.type = isStrong ? 'strong_open' : 'em_open'; + token_o.tag = isStrong ? 'strong' : 'em'; + token_o.nesting = 1; + token_o.markup = isStrong ? ch + ch : ch; + token_o.content = ''; + const token_c = state.tokens[endDelim.token]; + token_c.type = isStrong ? 'strong_close' : 'em_close'; + token_c.tag = isStrong ? 'strong' : 'em'; + token_c.nesting = -1; + token_c.markup = isStrong ? ch + ch : ch; + token_c.content = ''; + if (isStrong) { + state.tokens[delimiters[i - 1].token].content = ''; + state.tokens[delimiters[startDelim.end + 1].token].content = ''; + i--; + } + } +} + +// Walk through delimiter list and replace text tokens with tags +// +function emphasis_post_process(state) { + const tokens_meta = state.tokens_meta; + const max = state.tokens_meta.length; + postProcess(state, state.delimiters); + for (let curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + postProcess(state, tokens_meta[curr].delimiters); + } + } +} +var r_emphasis = { + tokenize: emphasis_tokenize, + postProcess: emphasis_post_process +}; + +// Process [link]( "stuff") + +function link(state, silent) { + let code, label, res, ref; + let href = ''; + let title = ''; + let start = state.pos; + let parseReference = true; + if (state.src.charCodeAt(state.pos) !== 0x5B /* [ */) { + return false; + } + const oldPos = state.pos; + const max = state.posMax; + const labelStart = state.pos + 1; + const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true); + + // parser failed to find ']', so it's not a valid link + if (labelEnd < 0) { + return false; + } + let pos = labelEnd + 1; + if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { + // + // Inline link + // + + // might have found a valid shortcut link, disable reference parsing + parseReference = false; + + // [link]( "title" ) + // ^^ skipping these spaces + pos++; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; } - function ensureCursorVisible(cm) { - resolveScrollToPos(cm); - var cur = cm.getCursor(); - cm.curOp.scrollToPos = { - from: cur, - to: cur, - margin: cm.options.cursorScrollMargin - }; + } + if (pos >= max) { + return false; + } + + // [link]( "title" ) + // ^^^^^^ parsing link destination + start = pos; + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); + if (res.ok) { + href = state.md.normalizeLink(res.str); + if (state.md.validateLink(href)) { + pos = res.pos; + } else { + href = ''; } - function scrollToCoords(cm, x, y) { - if (x != null || y != null) { - resolveScrollToPos(cm); - } - if (x != null) { - cm.curOp.scrollLeft = x; - } - if (y != null) { - cm.curOp.scrollTop = y; + + // [link]( "title" ) + // ^^ skipping these spaces + start = pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; } } - function scrollToRange(cm, range2) { - resolveScrollToPos(cm); - cm.curOp.scrollToPos = range2; - } - function resolveScrollToPos(cm) { - var range2 = cm.curOp.scrollToPos; - if (range2) { - cm.curOp.scrollToPos = null; - var from = estimateCoords(cm, range2.from), - to = estimateCoords(cm, range2.to); - scrollToCoordsRange(cm, from, to, range2.margin); + + // [link]( "title" ) + // ^^^^^^^ parsing link title + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + + // [link]( "title" ) + // ^^ skipping these spaces + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } } } - function scrollToCoordsRange(cm, from, to, margin) { - var sPos = calculateScrollPos(cm, { - left: Math.min(from.left, to.left), - top: Math.min(from.top, to.top) - margin, - right: Math.max(from.right, to.right), - bottom: Math.max(from.bottom, to.bottom) + margin - }); - scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); - } - function updateScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) { - return; - } - if (!gecko) { - updateDisplaySimple(cm, { - top: val - }); - } - setScrollTop(cm, val, true); - if (gecko) { - updateDisplaySimple(cm); - } - startWorker(cm, 100); + } + if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { + // parsing a valid shortcut link failed, fallback to reference + parseReference = true; + } + pos++; + } + if (parseReference) { + // + // Link reference + // + if (typeof state.env.references === 'undefined') { + return false; + } + if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { + start = pos + 1; + pos = state.md.helpers.parseLinkLabel(state, pos); + if (pos >= 0) { + label = state.src.slice(start, pos++); + } else { + pos = labelEnd + 1; } - function setScrollTop(cm, val, forceScroll) { - val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)); - if (cm.display.scroller.scrollTop == val && !forceScroll) { - return; - } - cm.doc.scrollTop = val; - cm.display.scrollbars.setScrollTop(val); - if (cm.display.scroller.scrollTop != val) { - cm.display.scroller.scrollTop = val; - } + } else { + pos = labelEnd + 1; + } + + // covers label === '' and label === undefined + // (collapsed reference link and shortcut reference link respectively) + if (!label) { + label = state.src.slice(labelStart, labelEnd); + } + ref = state.env.references[normalizeReference(label)]; + if (!ref) { + state.pos = oldPos; + return false; + } + href = ref.href; + title = ref.title; + } + + // + // We found the end of the link, and know for a fact it's a valid link; + // so all that's left to do is to call tokenizer. + // + if (!silent) { + state.pos = labelStart; + state.posMax = labelEnd; + const token_o = state.push('link_open', 'a', 1); + const attrs = [['href', href]]; + token_o.attrs = attrs; + if (title) { + attrs.push(['title', title]); + } + state.linkLevel++; + state.md.inline.tokenize(state); + state.linkLevel--; + state.push('link_close', 'a', -1); + } + state.pos = pos; + state.posMax = max; + return true; +} + +// Process ![image]( "title") + +function image(state, silent) { + let code, content, label, pos, ref, res, title, start; + let href = ''; + const oldPos = state.pos; + const max = state.posMax; + if (state.src.charCodeAt(state.pos) !== 0x21 /* ! */) { + return false; + } + if (state.src.charCodeAt(state.pos + 1) !== 0x5B /* [ */) { + return false; + } + const labelStart = state.pos + 2; + const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false); + + // parser failed to find ']', so it's not a valid link + if (labelEnd < 0) { + return false; + } + pos = labelEnd + 1; + if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { + // + // Inline link + // + + // [link]( "title" ) + // ^^ skipping these spaces + pos++; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; } - function setScrollLeft(cm, val, isScroller, forceScroll) { - val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)); - if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { - return; - } - cm.doc.scrollLeft = val; - alignHorizontally(cm); - if (cm.display.scroller.scrollLeft != val) { - cm.display.scroller.scrollLeft = val; - } - cm.display.scrollbars.setScrollLeft(val); + } + if (pos >= max) { + return false; + } + + // [link]( "title" ) + // ^^^^^^ parsing link destination + start = pos; + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); + if (res.ok) { + href = state.md.normalizeLink(res.str); + if (state.md.validateLink(href)) { + pos = res.pos; + } else { + href = ''; } - function measureForScrollbars(cm) { - var d = cm.display, - gutterW = d.gutters.offsetWidth; - var docH = Math.round(cm.doc.height + paddingVert(cm.display)); - return { - clientHeight: d.scroller.clientHeight, - viewHeight: d.wrapper.clientHeight, - scrollWidth: d.scroller.scrollWidth, - clientWidth: d.scroller.clientWidth, - viewWidth: d.wrapper.clientWidth, - barLeft: cm.options.fixedGutter ? gutterW : 0, - docHeight: docH, - scrollHeight: docH + scrollGap(cm) + d.barHeight, - nativeBarWidth: d.nativeBarWidth, - gutterWidth: gutterW - }; + } + + // [link]( "title" ) + // ^^ skipping these spaces + start = pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; } - var NativeScrollbars = function (place, scroll, cm) { - this.cm = cm; - var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); - var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); - vert.tabIndex = horiz.tabIndex = -1; - place(vert); - place(horiz); - on(vert, "scroll", function () { - if (vert.clientHeight) { - scroll(vert.scrollTop, "vertical"); - } - }); - on(horiz, "scroll", function () { - if (horiz.clientWidth) { - scroll(horiz.scrollLeft, "horizontal"); - } - }); - this.checkedZeroWidth = false; - if (ie && ie_version < 8) { - this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; - } - }; - NativeScrollbars.prototype.update = function (measure) { - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - var sWidth = measure.nativeBarWidth; - if (needsV) { - this.vert.style.display = "block"; - this.vert.style.bottom = needsH ? sWidth + "px" : "0"; - var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); - this.vert.firstChild.style.height = Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; - } else { - this.vert.scrollTop = 0; - this.vert.style.display = ""; - this.vert.firstChild.style.height = "0"; - } - if (needsH) { - this.horiz.style.display = "block"; - this.horiz.style.right = needsV ? sWidth + "px" : "0"; - this.horiz.style.left = measure.barLeft + "px"; - var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); - this.horiz.firstChild.style.width = Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; - } else { - this.horiz.style.display = ""; - this.horiz.firstChild.style.width = "0"; - } - if (!this.checkedZeroWidth && measure.clientHeight > 0) { - if (sWidth == 0) { - this.zeroWidthHack(); - } - this.checkedZeroWidth = true; - } - return { - right: needsV ? sWidth : 0, - bottom: needsH ? sWidth : 0 - }; - }; - NativeScrollbars.prototype.setScrollLeft = function (pos) { - if (this.horiz.scrollLeft != pos) { - this.horiz.scrollLeft = pos; - } - if (this.disableHoriz) { - this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); - } - }; - NativeScrollbars.prototype.setScrollTop = function (pos) { - if (this.vert.scrollTop != pos) { - this.vert.scrollTop = pos; - } - if (this.disableVert) { - this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); - } - }; - NativeScrollbars.prototype.zeroWidthHack = function () { - var w = mac && !mac_geMountainLion ? "12px" : "18px"; - this.horiz.style.height = this.vert.style.width = w; - this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; - this.disableHoriz = new Delayed(); - this.disableVert = new Delayed(); - }; - NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { - bar.style.pointerEvents = "auto"; - function maybeDisable() { - var box = bar.getBoundingClientRect(); - var elt2 = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); - if (elt2 != bar) { - bar.style.pointerEvents = "none"; - } else { - delay.set(1e3, maybeDisable); - } - } - delay.set(1e3, maybeDisable); - }; - NativeScrollbars.prototype.clear = function () { - var parent = this.horiz.parentNode; - parent.removeChild(this.horiz); - parent.removeChild(this.vert); - }; - var NullScrollbars = function () {}; - NullScrollbars.prototype.update = function () { - return { - bottom: 0, - right: 0 - }; - }; - NullScrollbars.prototype.setScrollLeft = function () {}; - NullScrollbars.prototype.setScrollTop = function () {}; - NullScrollbars.prototype.clear = function () {}; - function updateScrollbars(cm, measure) { - if (!measure) { - measure = measureForScrollbars(cm); - } - var startWidth = cm.display.barWidth, - startHeight = cm.display.barHeight; - updateScrollbarsInner(cm, measure); - for (var i2 = 0; i2 < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i2++) { - if (startWidth != cm.display.barWidth && cm.options.lineWrapping) { - updateHeightsInViewport(cm); - } - updateScrollbarsInner(cm, measureForScrollbars(cm)); - startWidth = cm.display.barWidth; - startHeight = cm.display.barHeight; - } - } - function updateScrollbarsInner(cm, measure) { - var d = cm.display; - var sizes = d.scrollbars.update(measure); - d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; - d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; - d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; - if (sizes.right && sizes.bottom) { - d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = sizes.bottom + "px"; - d.scrollbarFiller.style.width = sizes.right + "px"; - } else { - d.scrollbarFiller.style.display = ""; - } - if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block"; - d.gutterFiller.style.height = sizes.bottom + "px"; - d.gutterFiller.style.width = measure.gutterWidth + "px"; - } else { - d.gutterFiller.style.display = ""; + } + + // [link]( "title" ) + // ^^^^^^^ parsing link title + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + + // [link]( "title" ) + // ^^ skipping these spaces + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; } } - var scrollbarModel = { - "native": NativeScrollbars, - "null": NullScrollbars - }; - function initScrollbars(cm) { - if (cm.display.scrollbars) { - cm.display.scrollbars.clear(); - if (cm.display.scrollbars.addClass) { - rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - } - cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { - cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); - on(node, "mousedown", function () { - if (cm.state.focused) { - setTimeout(function () { - return cm.display.input.focus(); - }, 0); - } - }); - node.setAttribute("cm-not-content", "true"); - }, function (pos, axis) { - if (axis == "horizontal") { - setScrollLeft(cm, pos); - } else { - updateScrollTop(cm, pos); - } - }, cm); - if (cm.display.scrollbars.addClass) { - addClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - } - var nextOpId = 0; - function startOperation(cm) { - cm.curOp = { - cm, - viewChanged: false, - // Flag that indicates that lines might need to be redrawn - startHeight: cm.doc.height, - // Used to detect need to update scrollbar - forceUpdate: false, - // Used to force a redraw - updateInput: 0, - // Whether to reset the input textarea - typing: false, - // Whether this reset should be careful to leave existing text (for compositing) - changeObjs: null, - // Accumulated changes, for firing change events - cursorActivityHandlers: null, - // Set of handlers to fire cursorActivity on - cursorActivityCalled: 0, - // Tracks which cursorActivity handlers have been called already - selectionChanged: false, - // Whether the selection needs to be redrawn - updateMaxLine: false, - // Set when the widest line needs to be determined anew - scrollLeft: null, - scrollTop: null, - // Intermediate scroll position, not pushed to DOM yet - scrollToPos: null, - // Used to scroll to a specific position - focus: false, - id: ++nextOpId, - // Unique ID - markArrays: null - // Used by addMarkedSpan - }; - pushOperation(cm.curOp); - } - function endOperation(cm) { - var op = cm.curOp; - if (op) { - finishOperation(op, function (group) { - for (var i2 = 0; i2 < group.ops.length; i2++) { - group.ops[i2].cm.curOp = null; - } - endOperations(group); - }); - } - } - function endOperations(group) { - var ops = group.ops; - for (var i2 = 0; i2 < ops.length; i2++) { - endOperation_R1(ops[i2]); - } - for (var i$12 = 0; i$12 < ops.length; i$12++) { - endOperation_W1(ops[i$12]); - } - for (var i$22 = 0; i$22 < ops.length; i$22++) { - endOperation_R2(ops[i$22]); - } - for (var i$3 = 0; i$3 < ops.length; i$3++) { - endOperation_W2(ops[i$3]); - } - for (var i$4 = 0; i$4 < ops.length; i$4++) { - endOperation_finish(ops[i$4]); - } - } - function endOperation_R1(op) { - var cm = op.cm, - display = cm.display; - maybeClipScrollbars(cm); - if (op.updateMaxLine) { - findMaxLine(cm); - } - op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || op.scrollToPos.to.line >= display.viewTo) || display.maxLineChanged && cm.options.lineWrapping; - op.update = op.mustUpdate && new DisplayUpdate(cm, op.mustUpdate && { - top: op.scrollTop, - ensure: op.scrollToPos - }, op.forceUpdate); - } - function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } else { + title = ''; + } + if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { + state.pos = oldPos; + return false; + } + pos++; + } else { + // + // Link reference + // + if (typeof state.env.references === 'undefined') { + return false; + } + if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { + start = pos + 1; + pos = state.md.helpers.parseLinkLabel(state, pos); + if (pos >= 0) { + label = state.src.slice(start, pos++); + } else { + pos = labelEnd + 1; } - function endOperation_R2(op) { - var cm = op.cm, - display = cm.display; - if (op.updatedDisplay) { - updateHeightsInViewport(cm); - } - op.barMeasure = measureForScrollbars(cm); - if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; - cm.display.sizerWidth = op.adjustWidthTo; - op.barMeasure.scrollWidth = Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); - } - if (op.updatedDisplay || op.selectionChanged) { - op.preparedSelection = display.input.prepareSelection(); - } + } else { + pos = labelEnd + 1; + } + + // covers label === '' and label === undefined + // (collapsed reference link and shortcut reference link respectively) + if (!label) { + label = state.src.slice(labelStart, labelEnd); + } + ref = state.env.references[normalizeReference(label)]; + if (!ref) { + state.pos = oldPos; + return false; + } + href = ref.href; + title = ref.title; + } + + // + // We found the end of the link, and know for a fact it's a valid link; + // so all that's left to do is to call tokenizer. + // + if (!silent) { + content = state.src.slice(labelStart, labelEnd); + const tokens = []; + state.md.inline.parse(content, state.md, state.env, tokens); + const token = state.push('image', 'img', 0); + const attrs = [['src', href], ['alt', '']]; + token.attrs = attrs; + token.children = tokens; + token.content = content; + if (title) { + attrs.push(['title', title]); + } + } + state.pos = pos; + state.posMax = max; + return true; +} + +// Process autolinks '' + +/* eslint max-len:0 */ +const EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/; +/* eslint-disable-next-line no-control-regex */ +const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/; +function autolink(state, silent) { + let pos = state.pos; + if (state.src.charCodeAt(pos) !== 0x3C /* < */) { + return false; + } + const start = state.pos; + const max = state.posMax; + for (;;) { + if (++pos >= max) return false; + const ch = state.src.charCodeAt(pos); + if (ch === 0x3C /* < */) return false; + if (ch === 0x3E /* > */) break; + } + const url = state.src.slice(start + 1, pos); + if (AUTOLINK_RE.test(url)) { + const fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) { + return false; + } + if (!silent) { + const token_o = state.push('link_open', 'a', 1); + token_o.attrs = [['href', fullUrl]]; + token_o.markup = 'autolink'; + token_o.info = 'auto'; + const token_t = state.push('text', '', 0); + token_t.content = state.md.normalizeLinkText(url); + const token_c = state.push('link_close', 'a', -1); + token_c.markup = 'autolink'; + token_c.info = 'auto'; + } + state.pos += url.length + 2; + return true; + } + if (EMAIL_RE.test(url)) { + const fullUrl = state.md.normalizeLink('mailto:' + url); + if (!state.md.validateLink(fullUrl)) { + return false; + } + if (!silent) { + const token_o = state.push('link_open', 'a', 1); + token_o.attrs = [['href', fullUrl]]; + token_o.markup = 'autolink'; + token_o.info = 'auto'; + const token_t = state.push('text', '', 0); + token_t.content = state.md.normalizeLinkText(url); + const token_c = state.push('link_close', 'a', -1); + token_c.markup = 'autolink'; + token_c.info = 'auto'; + } + state.pos += url.length + 2; + return true; + } + return false; +} + +// Process html tags + +function isLinkOpen(str) { + return /^\s]/i.test(str); +} +function isLinkClose(str) { + return /^<\/a\s*>/i.test(str); +} +function isLetter(ch) { + /* eslint no-bitwise:0 */ + const lc = ch | 0x20; // to lower case + return lc >= 0x61 /* a */ && lc <= 0x7a /* z */; +} +function html_inline(state, silent) { + if (!state.md.options.html) { + return false; + } + + // Check start + const max = state.posMax; + const pos = state.pos; + if (state.src.charCodeAt(pos) !== 0x3C /* < */ || pos + 2 >= max) { + return false; + } + + // Quick fail on second char + const ch = state.src.charCodeAt(pos + 1); + if (ch !== 0x21 /* ! */ && ch !== 0x3F /* ? */ && ch !== 0x2F /* / */ && !isLetter(ch)) { + return false; + } + const match = state.src.slice(pos).match(HTML_TAG_RE); + if (!match) { + return false; + } + if (!silent) { + const token = state.push('html_inline', '', 0); + token.content = match[0]; + if (isLinkOpen(token.content)) state.linkLevel++; + if (isLinkClose(token.content)) state.linkLevel--; + } + state.pos += match[0].length; + return true; +} + +// Process html entity - {, ¯, ", ... + +const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i; +const NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i; +function entity(state, silent) { + const pos = state.pos; + const max = state.posMax; + if (state.src.charCodeAt(pos) !== 0x26 /* & */) return false; + if (pos + 1 >= max) return false; + const ch = state.src.charCodeAt(pos + 1); + if (ch === 0x23 /* # */) { + const match = state.src.slice(pos).match(DIGITAL_RE); + if (match) { + if (!silent) { + const code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10); + const token = state.push('text_special', '', 0); + token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD); + token.markup = match[0]; + token.info = 'entity'; } - function endOperation_W2(op) { - var cm = op.cm; - if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; - if (op.maxScrollLeft < cm.doc.scrollLeft) { - setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); - } - cm.display.maxLineChanged = false; - } - var takeFocus = op.focus && op.focus == activeElt(); - if (op.preparedSelection) { - cm.display.input.showSelection(op.preparedSelection, takeFocus); - } - if (op.updatedDisplay || op.startHeight != cm.doc.height) { - updateScrollbars(cm, op.barMeasure); - } - if (op.updatedDisplay) { - setDocumentHeight(cm, op.barMeasure); - } - if (op.selectionChanged) { - restartBlink(cm); - } - if (cm.state.focused && op.updateInput) { - cm.display.input.reset(op.typing); - } - if (takeFocus) { - ensureFocus(op.cm); + state.pos += match[0].length; + return true; + } + } else { + const match = state.src.slice(pos).match(NAMED_RE); + if (match) { + const decoded = entities.decodeHTML(match[0]); + if (decoded !== match[0]) { + if (!silent) { + const token = state.push('text_special', '', 0); + token.content = decoded; + token.markup = match[0]; + token.info = 'entity'; } + state.pos += match[0].length; + return true; } - function endOperation_finish(op) { - var cm = op.cm, - display = cm.display, - doc = cm.doc; - if (op.updatedDisplay) { - postUpdateDisplay(cm, op.update); - } - if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) { - display.wheelStartX = display.wheelStartY = null; - } - if (op.scrollTop != null) { - setScrollTop(cm, op.scrollTop, op.forceScroll); - } - if (op.scrollLeft != null) { - setScrollLeft(cm, op.scrollLeft, true, true); - } - if (op.scrollToPos) { - var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); - maybeScrollWindow(cm, rect); - } - var hidden = op.maybeHiddenMarkers, - unhidden = op.maybeUnhiddenMarkers; - if (hidden) { - for (var i2 = 0; i2 < hidden.length; ++i2) { - if (!hidden[i2].lines.length) { - signal(hidden[i2], "hide"); - } - } - } - if (unhidden) { - for (var i$12 = 0; i$12 < unhidden.length; ++i$12) { - if (unhidden[i$12].lines.length) { - signal(unhidden[i$12], "unhide"); + } + } + return false; +} + +// For each opening emphasis-like marker find a matching closing one +// + +function processDelimiters(delimiters) { + const openersBottom = {}; + const max = delimiters.length; + if (!max) return; + + // headerIdx is the first delimiter of the current (where closer is) delimiter run + let headerIdx = 0; + let lastTokenIdx = -2; // needs any value lower than -1 + const jumps = []; + for (let closerIdx = 0; closerIdx < max; closerIdx++) { + const closer = delimiters[closerIdx]; + jumps.push(0); + + // markers belong to same delimiter run if: + // - they have adjacent tokens + // - AND markers are the same + // + if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) { + headerIdx = closerIdx; + } + lastTokenIdx = closer.token; + + // Length is only used for emphasis-specific "rule of 3", + // if it's not defined (in strikethrough or 3rd party plugins), + // we can default it to 0 to disable those checks. + // + closer.length = closer.length || 0; + if (!closer.close) continue; + + // Previously calculated lower bounds (previous fails) + // for each marker, each delimiter length modulo 3, + // and for whether this closer can be an opener; + // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460 + /* eslint-disable-next-line no-prototype-builtins */ + if (!openersBottom.hasOwnProperty(closer.marker)) { + openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]; + } + const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3]; + let openerIdx = headerIdx - jumps[headerIdx] - 1; + let newMinOpenerIdx = openerIdx; + for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) { + const opener = delimiters[openerIdx]; + if (opener.marker !== closer.marker) continue; + if (opener.open && opener.end < 0) { + let isOddMatch = false; + + // from spec: + // + // If one of the delimiters can both open and close emphasis, then the + // sum of the lengths of the delimiter runs containing the opening and + // closing delimiters must not be a multiple of 3 unless both lengths + // are multiples of 3. + // + if (opener.close || closer.open) { + if ((opener.length + closer.length) % 3 === 0) { + if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { + isOddMatch = true; } } } - if (display.wrapper.offsetHeight) { - doc.scrollTop = cm.display.scroller.scrollTop; - } - if (op.changeObjs) { - signal(cm, "changes", cm, op.changeObjs); - } - if (op.update) { - op.update.finish(); + if (!isOddMatch) { + // If previous delimiter cannot be an opener, we can safely skip + // the entire sequence in future checks. This is required to make + // sure algorithm has linear complexity (see *_*_*_*_*_... case). + // + const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0; + jumps[closerIdx] = closerIdx - openerIdx + lastJump; + jumps[openerIdx] = lastJump; + closer.open = false; + opener.end = closerIdx; + opener.close = false; + newMinOpenerIdx = -1; + // treat next token as start of run, + // it optimizes skips in **<...>**a**<...>** pathological case + lastTokenIdx = -2; + break; } } - function runInOp(cm, f) { - if (cm.curOp) { - return f(); - } - startOperation(cm); - try { - return f(); - } finally { - endOperation(cm); + } + if (newMinOpenerIdx !== -1) { + // If match for this delimiter run failed, we want to set lower bound for + // future lookups. This is required to make sure algorithm has linear + // complexity. + // + // See details here: + // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442 + // + openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx; + } + } +} +function link_pairs(state) { + const tokens_meta = state.tokens_meta; + const max = state.tokens_meta.length; + processDelimiters(state.delimiters); + for (let curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + processDelimiters(tokens_meta[curr].delimiters); + } + } +} + +// Clean up tokens after emphasis and strikethrough postprocessing: +// merge adjacent text nodes into one and re-calculate all token levels +// +// This is necessary because initially emphasis delimiter markers (*, _, ~) +// are treated as their own separate text tokens. Then emphasis rule either +// leaves them as text (needed to merge with adjacent text) or turns them +// into opening/closing tags (which messes up levels inside). +// + +function fragments_join(state) { + let curr, last; + let level = 0; + const tokens = state.tokens; + const max = state.tokens.length; + for (curr = last = 0; curr < max; curr++) { + // re-calculate levels after emphasis/strikethrough turns some text nodes + // into opening/closing tags + if (tokens[curr].nesting < 0) level--; // closing tag + tokens[curr].level = level; + if (tokens[curr].nesting > 0) level++; // opening tag + + if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { + // collapse two adjacent text nodes + tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; + } else { + if (curr !== last) { + tokens[last] = tokens[curr]; + } + last++; + } + } + if (curr !== last) { + tokens.length = last; + } +} + +/** internal + * class ParserInline + * + * Tokenizes paragraph content. + **/ + +// Parser rules + +const _rules = [['text', text], ['linkify', linkify], ['newline', newline], ['escape', escape], ['backticks', backtick], ['strikethrough', r_strikethrough.tokenize], ['emphasis', r_emphasis.tokenize], ['link', link], ['image', image], ['autolink', autolink], ['html_inline', html_inline], ['entity', entity]]; + +// `rule2` ruleset was created specifically for emphasis/strikethrough +// post-processing and may be changed in the future. +// +// Don't use this for anything except pairs (plugins working with `balance_pairs`). +// +const _rules2 = [['balance_pairs', link_pairs], ['strikethrough', r_strikethrough.postProcess], ['emphasis', r_emphasis.postProcess], +// rules for pairs separate '**' into its own text tokens, which may be left unused, +// rule below merges unused segments back with the rest of the text +['fragments_join', fragments_join]]; + +/** + * new ParserInline() + **/ +function ParserInline() { + /** + * ParserInline#ruler -> Ruler + * + * [[Ruler]] instance. Keep configuration of inline rules. + **/ + this.ruler = new Ruler(); + for (let i = 0; i < _rules.length; i++) { + this.ruler.push(_rules[i][0], _rules[i][1]); + } + + /** + * ParserInline#ruler2 -> Ruler + * + * [[Ruler]] instance. Second ruler used for post-processing + * (e.g. in emphasis-like rules). + **/ + this.ruler2 = new Ruler(); + for (let i = 0; i < _rules2.length; i++) { + this.ruler2.push(_rules2[i][0], _rules2[i][1]); + } +} + +// Skip single token by running all rules in validation mode; +// returns `true` if any rule reported success +// +ParserInline.prototype.skipToken = function (state) { + const pos = state.pos; + const rules = this.ruler.getRules(''); + const len = rules.length; + const maxNesting = state.md.options.maxNesting; + const cache = state.cache; + if (typeof cache[pos] !== 'undefined') { + state.pos = cache[pos]; + return; + } + let ok = false; + if (state.level < maxNesting) { + for (let i = 0; i < len; i++) { + // Increment state.level and decrement it later to limit recursion. + // It's harmless to do here, because no tokens are created. But ideally, + // we'd need a separate private state variable for this purpose. + // + state.level++; + ok = rules[i](state, true); + state.level--; + if (ok) { + if (pos >= state.pos) { + throw new Error("inline rule didn't increment state.pos"); } + break; } - function operation(cm, f) { - return function () { - if (cm.curOp) { - return f.apply(cm, arguments); - } - startOperation(cm); - try { - return f.apply(cm, arguments); - } finally { - endOperation(cm); + } + } else { + // Too much nesting, just skip until the end of the paragraph. + // + // NOTE: this will cause links to behave incorrectly in the following case, + // when an amount of `[` is exactly equal to `maxNesting + 1`: + // + // [[[[[[[[[[[[[[[[[[[[[foo]() + // + // TODO: remove this workaround when CM standard will allow nested links + // (we can replace it by preventing links from being parsed in + // validation mode) + // + state.pos = state.posMax; + } + if (!ok) { + state.pos++; + } + cache[pos] = state.pos; +}; + +// Generate tokens for input range +// +ParserInline.prototype.tokenize = function (state) { + const rules = this.ruler.getRules(''); + const len = rules.length; + const end = state.posMax; + const maxNesting = state.md.options.maxNesting; + while (state.pos < end) { + // Try all possible rules. + // On success, rule should: + // + // - update `state.pos` + // - update `state.tokens` + // - return true + const prevPos = state.pos; + let ok = false; + if (state.level < maxNesting) { + for (let i = 0; i < len; i++) { + ok = rules[i](state, false); + if (ok) { + if (prevPos >= state.pos) { + throw new Error("inline rule didn't increment state.pos"); } - }; + break; + } } - function methodOp(f) { - return function () { - if (this.curOp) { - return f.apply(this, arguments); - } - startOperation(this); - try { - return f.apply(this, arguments); - } finally { - endOperation(this); - } - }; + } + if (ok) { + if (state.pos >= end) { + break; } - function docMethodOp(f) { - return function () { - var cm = this.cm; - if (!cm || cm.curOp) { - return f.apply(this, arguments); - } - startOperation(cm); - try { - return f.apply(this, arguments); - } finally { - endOperation(cm); + continue; + } + state.pending += state.src[state.pos++]; + } + if (state.pending) { + state.pushPending(); + } +}; + +/** + * ParserInline.parse(str, md, env, outTokens) + * + * Process input string and push inline tokens into `outTokens` + **/ +ParserInline.prototype.parse = function (str, md, env, outTokens) { + const state = new this.State(str, md, env, outTokens); + this.tokenize(state); + const rules = this.ruler2.getRules(''); + const len = rules.length; + for (let i = 0; i < len; i++) { + rules[i](state); + } +}; +ParserInline.prototype.State = StateInline; + +// markdown-it default options + +var cfg_default = { + options: { + // Enable HTML tags in source + html: false, + // Use '/' to close single tags (
) + xhtmlOut: false, + // Convert '\n' in paragraphs into
+ breaks: false, + // CSS language prefix for fenced blocks + langPrefix: 'language-', + // autoconvert URL-like texts to links + linkify: false, + // Enable some language-neutral replacements + quotes beautification + typographer: false, + // Double + single quotes replacement pairs, when typographer enabled, + // and smartquotes on. Could be either a String or an Array. + // + // For example, you can use '«»„“' for Russian, '„“‚‘' for German, + // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). + quotes: '\u201c\u201d\u2018\u2019', + /* “”‘’ */ + + // Highlighter function. Should return escaped HTML, + // or '' if the source string is not changed and should be escaped externaly. + // If result starts with ) + xhtmlOut: false, + // Convert '\n' in paragraphs into
+ breaks: false, + // CSS language prefix for fenced blocks + langPrefix: 'language-', + // autoconvert URL-like texts to links + linkify: false, + // Enable some language-neutral replacements + quotes beautification + typographer: false, + // Double + single quotes replacement pairs, when typographer enabled, + // and smartquotes on. Could be either a String or an Array. + // + // For example, you can use '«»„“' for Russian, '„“‚‘' for German, + // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). + quotes: '\u201c\u201d\u2018\u2019', + /* “”‘’ */ + + // Highlighter function. Should return escaped HTML, + // or '' if the source string is not changed and should be escaped externaly. + // If result starts with ) + xhtmlOut: true, + // Convert '\n' in paragraphs into
+ breaks: false, + // CSS language prefix for fenced blocks + langPrefix: 'language-', + // autoconvert URL-like texts to links + linkify: false, + // Enable some language-neutral replacements + quotes beautification + typographer: false, + // Double + single quotes replacement pairs, when typographer enabled, + // and smartquotes on. Could be either a String or an Array. + // + // For example, you can use '«»„“' for Russian, '„“‚‘' for German, + // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). + quotes: '\u201c\u201d\u2018\u2019', + /* “”‘’ */ + + // Highlighter function. Should return escaped HTML, + // or '' if the source string is not changed and should be escaped externaly. + // If result starts with = 0) { + try { + parsed.hostname = punycode.toASCII(parsed.hostname); + } catch (er) {/**/} + } + } + return mdurl__namespace.encode(mdurl__namespace.format(parsed)); +} +function normalizeLinkText(url) { + const parsed = mdurl__namespace.parse(url, true); + if (parsed.hostname) { + // Encode hostnames in urls like: + // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` + // + // We don't encode unknown schemas, because it's likely that we encode + // something we shouldn't (e.g. `skype:name` treated as `skype:host`) + // + if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { + try { + parsed.hostname = punycode.toUnicode(parsed.hostname); + } catch (er) {/**/} + } + } + + // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720 + return mdurl__namespace.decode(mdurl__namespace.format(parsed), mdurl__namespace.decode.defaultChars + '%'); +} + +/** + * class MarkdownIt + * + * Main parser/renderer class. + * + * ##### Usage + * + * ```javascript + * // node.js, "classic" way: + * var MarkdownIt = require('markdown-it'), + * md = new MarkdownIt(); + * var result = md.render('# markdown-it rulezz!'); + * + * // node.js, the same, but with sugar: + * var md = require('markdown-it')(); + * var result = md.render('# markdown-it rulezz!'); + * + * // browser without AMD, added to "window" on script load + * // Note, there are no dash. + * var md = window.markdownit(); + * var result = md.render('# markdown-it rulezz!'); + * ``` + * + * Single line rendering, without paragraph wrap: + * + * ```javascript + * var md = require('markdown-it')(); + * var result = md.renderInline('__markdown-it__ rulezz!'); + * ``` + **/ + +/** + * new MarkdownIt([presetName, options]) + * - presetName (String): optional, `commonmark` / `zero` + * - options (Object) + * + * Creates parser instanse with given config. Can be called without `new`. + * + * ##### presetName + * + * MarkdownIt provides named presets as a convenience to quickly + * enable/disable active syntax rules and options for common use cases. + * + * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.mjs) - + * configures parser to strict [CommonMark](http://commonmark.org/) mode. + * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.mjs) - + * similar to GFM, used when no preset name given. Enables all available rules, + * but still without html, typographer & autolinker. + * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.mjs) - + * all rules disabled. Useful to quickly setup your config via `.enable()`. + * For example, when you need only `bold` and `italic` markup and nothing else. + * + * ##### options: + * + * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful! + * That's not safe! You may need external sanitizer to protect output from XSS. + * It's better to extend features via plugins, instead of enabling HTML. + * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags + * (`
`). This is needed only for full CommonMark compatibility. In real + * world you will need HTML output. + * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `
`. + * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks. + * Can be useful for external highlighters. + * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links. + * - __typographer__ - `false`. Set `true` to enable [some language-neutral + * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs) + + * quotes beautification (smartquotes). + * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement + * pairs, when typographer enabled and smartquotes on. For example, you can + * use `'«»„“'` for Russian, `'„“‚‘'` for German, and + * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp). + * - __highlight__ - `null`. Highlighter function for fenced code blocks. + * Highlighter `function (str, lang)` should return escaped HTML. It can also + * return empty string if the source was not changed and should be escaped + * externaly. If result starts with ` or ``): + * + * ```javascript + * var hljs = require('highlight.js') // https://highlightjs.org/ + * + * // Actual default values + * var md = require('markdown-it')({ + * highlight: function (str, lang) { + * if (lang && hljs.getLanguage(lang)) { + * try { + * return '
' +
+ *                hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
+ *                '
'; + * } catch (__) {} + * } + * + * return '
' + md.utils.escapeHtml(str) + '
'; + * } + * }); + * ``` + * + **/ +function MarkdownIt(presetName, options) { + if (!(this instanceof MarkdownIt)) { + return new MarkdownIt(presetName, options); + } + if (!options) { + if (!isString(presetName)) { + options = presetName || {}; + presetName = 'default'; + } + } + + /** + * MarkdownIt#inline -> ParserInline + * + * Instance of [[ParserInline]]. You may need it to add new rules when + * writing plugins. For simple rules control use [[MarkdownIt.disable]] and + * [[MarkdownIt.enable]]. + **/ + this.inline = new ParserInline(); + + /** + * MarkdownIt#block -> ParserBlock + * + * Instance of [[ParserBlock]]. You may need it to add new rules when + * writing plugins. For simple rules control use [[MarkdownIt.disable]] and + * [[MarkdownIt.enable]]. + **/ + this.block = new ParserBlock(); + + /** + * MarkdownIt#core -> Core + * + * Instance of [[Core]] chain executor. You may need it to add new rules when + * writing plugins. For simple rules control use [[MarkdownIt.disable]] and + * [[MarkdownIt.enable]]. + **/ + this.core = new Core(); + + /** + * MarkdownIt#renderer -> Renderer + * + * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering + * rules for new token types, generated by plugins. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * function myToken(tokens, idx, options, env, self) { + * //... + * return result; + * }; + * + * md.renderer.rules['my_token'] = myToken + * ``` + * + * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs). + **/ + this.renderer = new Renderer(); + + /** + * MarkdownIt#linkify -> LinkifyIt + * + * [linkify-it](https://github.com/markdown-it/linkify-it) instance. + * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs) + * rule. + **/ + this.linkify = new LinkifyIt(); + + /** + * MarkdownIt#validateLink(url) -> Boolean + * + * Link validation function. CommonMark allows too much in links. By default + * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas + * except some embedded image types. + * + * You can change this behaviour: + * + * ```javascript + * var md = require('markdown-it')(); + * // enable everything + * md.validateLink = function () { return true; } + * ``` + **/ + this.validateLink = validateLink; + + /** + * MarkdownIt#normalizeLink(url) -> String + * + * Function used to encode link url to a machine-readable format, + * which includes url-encoding, punycode, etc. + **/ + this.normalizeLink = normalizeLink; + + /** + * MarkdownIt#normalizeLinkText(url) -> String + * + * Function used to decode link url to a human-readable format` + **/ + this.normalizeLinkText = normalizeLinkText; + + // Expose utils & helpers for easy acces from plugins + + /** + * MarkdownIt#utils -> utils + * + * Assorted utility functions, useful to write plugins. See details + * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.mjs). + **/ + this.utils = utils; + + /** + * MarkdownIt#helpers -> helpers + * + * Link components parser functions, useful to write plugins. See details + * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers). + **/ + this.helpers = assign({}, helpers); + this.options = {}; + this.configure(presetName); + if (options) { + this.set(options); + } +} + +/** chainable + * MarkdownIt.set(options) + * + * Set parser options (in the same format as in constructor). Probably, you + * will never need it, but you can change options after constructor call. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')() + * .set({ html: true, breaks: true }) + * .set({ typographer, true }); + * ``` + * + * __Note:__ To achieve the best possible performance, don't modify a + * `markdown-it` instance options on the fly. If you need multiple configurations + * it's best to create multiple instances and initialize each with separate + * config. + **/ +MarkdownIt.prototype.set = function (options) { + assign(this.options, options); + return this; +}; + +/** chainable, internal + * MarkdownIt.configure(presets) + * + * Batch load of all options and compenent settings. This is internal method, + * and you probably will not need it. But if you will - see available presets + * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets) + * + * We strongly recommend to use presets instead of direct config loads. That + * will give better compatibility with next versions. + **/ +MarkdownIt.prototype.configure = function (presets) { + const self = this; + if (isString(presets)) { + const presetName = presets; + presets = config[presetName]; + if (!presets) { + throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); + } + } + if (!presets) { + throw new Error('Wrong `markdown-it` preset, can\'t be empty'); + } + if (presets.options) { + self.set(presets.options); + } + if (presets.components) { + Object.keys(presets.components).forEach(function (name) { + if (presets.components[name].rules) { + self[name].ruler.enableOnly(presets.components[name].rules); + } + if (presets.components[name].rules2) { + self[name].ruler2.enableOnly(presets.components[name].rules2); + } + }); + } + return this; +}; + +/** chainable + * MarkdownIt.enable(list, ignoreInvalid) + * - list (String|Array): rule name or list of rule names to enable + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable list or rules. It will automatically find appropriate components, + * containing rules with given names. If rule not found, and `ignoreInvalid` + * not set - throws exception. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')() + * .enable(['sub', 'sup']) + * .disable('smartquotes'); + * ``` + **/ +MarkdownIt.prototype.enable = function (list, ignoreInvalid) { + let result = []; + if (!Array.isArray(list)) { + list = [list]; + } + ['core', 'block', 'inline'].forEach(function (chain) { + result = result.concat(this[chain].ruler.enable(list, true)); + }, this); + result = result.concat(this.inline.ruler2.enable(list, true)); + const missed = list.filter(function (name) { + return result.indexOf(name) < 0; + }); + if (missed.length && !ignoreInvalid) { + throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed); + } + return this; +}; + +/** chainable + * MarkdownIt.disable(list, ignoreInvalid) + * - list (String|Array): rule name or list of rule names to disable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * The same as [[MarkdownIt.enable]], but turn specified rules off. + **/ +MarkdownIt.prototype.disable = function (list, ignoreInvalid) { + let result = []; + if (!Array.isArray(list)) { + list = [list]; + } + ['core', 'block', 'inline'].forEach(function (chain) { + result = result.concat(this[chain].ruler.disable(list, true)); + }, this); + result = result.concat(this.inline.ruler2.disable(list, true)); + const missed = list.filter(function (name) { + return result.indexOf(name) < 0; + }); + if (missed.length && !ignoreInvalid) { + throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed); + } + return this; +}; + +/** chainable + * MarkdownIt.use(plugin, params) + * + * Load specified plugin with given params into current parser instance. + * It's just a sugar to call `plugin(md, params)` with curring. + * + * ##### Example + * + * ```javascript + * var iterator = require('markdown-it-for-inline'); + * var md = require('markdown-it')() + * .use(iterator, 'foo_replace', 'text', function (tokens, idx) { + * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); + * }); + * ``` + **/ +MarkdownIt.prototype.use = function (plugin /*, params, ... */) { + const args = [this].concat(Array.prototype.slice.call(arguments, 1)); + plugin.apply(plugin, args); + return this; +}; + +/** internal + * MarkdownIt.parse(src, env) -> Array + * - src (String): source string + * - env (Object): environment sandbox + * + * Parse input string and return list of block tokens (special token type + * "inline" will contain list of inline tokens). You should not call this + * method directly, until you write custom renderer (for example, to produce + * AST). + * + * `env` is used to pass data between "distributed" rules and return additional + * metadata like reference info, needed for the renderer. It also can be used to + * inject data in specific cases. Usually, you will be ok to pass `{}`, + * and then pass updated object to renderer. + **/ +MarkdownIt.prototype.parse = function (src, env) { + if (typeof src !== 'string') { + throw new Error('Input data should be a String'); + } + const state = new this.core.State(src, this, env); + this.core.process(state); + return state.tokens; +}; + +/** + * MarkdownIt.render(src [, env]) -> String + * - src (String): source string + * - env (Object): environment sandbox + * + * Render markdown string into html. It does all magic for you :). + * + * `env` can be used to inject additional metadata (`{}` by default). + * But you will not need it with high probability. See also comment + * in [[MarkdownIt.parse]]. + **/ +MarkdownIt.prototype.render = function (src, env) { + env = env || {}; + return this.renderer.render(this.parse(src, env), this.options, env); +}; + +/** internal + * MarkdownIt.parseInline(src, env) -> Array + * - src (String): source string + * - env (Object): environment sandbox + * + * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the + * block tokens list with the single `inline` element, containing parsed inline + * tokens in `children` property. Also updates `env` object. + **/ +MarkdownIt.prototype.parseInline = function (src, env) { + const state = new this.core.State(src, this, env); + state.inlineMode = true; + this.core.process(state); + return state.tokens; +}; + +/** + * MarkdownIt.renderInline(src [, env]) -> String + * - src (String): source string + * - env (Object): environment sandbox + * + * Similar to [[MarkdownIt.render]] but for single paragraph content. Result + * will NOT be wrapped into `

` tags. + **/ +MarkdownIt.prototype.renderInline = function (src, env) { + env = env || {}; + return this.renderer.render(this.parseInline(src, env), this.options, env); +}; +module.exports = MarkdownIt; + +/***/ }), + +/***/ "../../../node_modules/mdurl/build/index.cjs.js": +/*!******************************************************!*\ + !*** ../../../node_modules/mdurl/build/index.cjs.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +/* eslint-disable no-bitwise */ +const decodeCache = {}; +function getDecodeCache(exclude) { + let cache = decodeCache[exclude]; + if (cache) { + return cache; + } + cache = decodeCache[exclude] = []; + for (let i = 0; i < 128; i++) { + const ch = String.fromCharCode(i); + cache.push(ch); + } + for (let i = 0; i < exclude.length; i++) { + const ch = exclude.charCodeAt(i); + cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2); + } + return cache; +} + +// Decode percent-encoded string. +// +function decode(string, exclude) { + if (typeof exclude !== 'string') { + exclude = decode.defaultChars; + } + const cache = getDecodeCache(exclude); + return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) { + let result = ''; + for (let i = 0, l = seq.length; i < l; i += 3) { + const b1 = parseInt(seq.slice(i + 1, i + 3), 16); + if (b1 < 0x80) { + result += cache[b1]; + continue; + } + if ((b1 & 0xE0) === 0xC0 && i + 3 < l) { + // 110xxxxx 10xxxxxx + const b2 = parseInt(seq.slice(i + 4, i + 6), 16); + if ((b2 & 0xC0) === 0x80) { + const chr = b1 << 6 & 0x7C0 | b2 & 0x3F; + if (chr < 0x80) { + result += '\ufffd\ufffd'; + } else { + result += String.fromCharCode(chr); + } + i += 3; + continue; + } + } + if ((b1 & 0xF0) === 0xE0 && i + 6 < l) { + // 1110xxxx 10xxxxxx 10xxxxxx + const b2 = parseInt(seq.slice(i + 4, i + 6), 16); + const b3 = parseInt(seq.slice(i + 7, i + 9), 16); + if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) { + const chr = b1 << 12 & 0xF000 | b2 << 6 & 0xFC0 | b3 & 0x3F; + if (chr < 0x800 || chr >= 0xD800 && chr <= 0xDFFF) { + result += '\ufffd\ufffd\ufffd'; + } else { + result += String.fromCharCode(chr); + } + i += 6; + continue; + } + } + if ((b1 & 0xF8) === 0xF0 && i + 9 < l) { + // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx + const b2 = parseInt(seq.slice(i + 4, i + 6), 16); + const b3 = parseInt(seq.slice(i + 7, i + 9), 16); + const b4 = parseInt(seq.slice(i + 10, i + 12), 16); + if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) { + let chr = b1 << 18 & 0x1C0000 | b2 << 12 & 0x3F000 | b3 << 6 & 0xFC0 | b4 & 0x3F; + if (chr < 0x10000 || chr > 0x10FFFF) { + result += '\ufffd\ufffd\ufffd\ufffd'; + } else { + chr -= 0x10000; + result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF)); + } + i += 9; + continue; + } + } + result += '\ufffd'; + } + return result; + }); +} +decode.defaultChars = ';/?:@&=+$,#'; +decode.componentChars = ''; +const encodeCache = {}; + +// Create a lookup array where anything but characters in `chars` string +// and alphanumeric chars is percent-encoded. +// +function getEncodeCache(exclude) { + let cache = encodeCache[exclude]; + if (cache) { + return cache; + } + cache = encodeCache[exclude] = []; + for (let i = 0; i < 128; i++) { + const ch = String.fromCharCode(i); + if (/^[0-9a-z]$/i.test(ch)) { + // always allow unencoded alphanumeric characters + cache.push(ch); + } else { + cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2)); + } + } + for (let i = 0; i < exclude.length; i++) { + cache[exclude.charCodeAt(i)] = exclude[i]; + } + return cache; +} + +// Encode unsafe characters with percent-encoding, skipping already +// encoded sequences. +// +// - string - string to encode +// - exclude - list of characters to ignore (in addition to a-zA-Z0-9) +// - keepEscaped - don't encode '%' in a correct escape sequence (default: true) +// +function encode(string, exclude, keepEscaped) { + if (typeof exclude !== 'string') { + // encode(string, keepEscaped) + keepEscaped = exclude; + exclude = encode.defaultChars; + } + if (typeof keepEscaped === 'undefined') { + keepEscaped = true; + } + const cache = getEncodeCache(exclude); + let result = ''; + for (let i = 0, l = string.length; i < l; i++) { + const code = string.charCodeAt(i); + if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) { + if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { + result += string.slice(i, i + 3); + i += 2; + continue; + } + } + if (code < 128) { + result += cache[code]; + continue; + } + if (code >= 0xD800 && code <= 0xDFFF) { + if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) { + const nextCode = string.charCodeAt(i + 1); + if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { + result += encodeURIComponent(string[i] + string[i + 1]); + i++; + continue; + } + } + result += '%EF%BF%BD'; + continue; + } + result += encodeURIComponent(string[i]); + } + return result; +} +encode.defaultChars = ";/?:@&=+$,-_.!~*'()#"; +encode.componentChars = "-_.!~*'()"; +function format(url) { + let result = ''; + result += url.protocol || ''; + result += url.slashes ? '//' : ''; + result += url.auth ? url.auth + '@' : ''; + if (url.hostname && url.hostname.indexOf(':') !== -1) { + // ipv6 address + result += '[' + url.hostname + ']'; + } else { + result += url.hostname || ''; + } + result += url.port ? ':' + url.port : ''; + result += url.pathname || ''; + result += url.search || ''; + result += url.hash || ''; + return result; +} + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// +// Changes from joyent/node: +// +// 1. No leading slash in paths, +// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/` +// +// 2. Backslashes are not replaced with slashes, +// so `http:\\example.org\` is treated like a relative path +// +// 3. Trailing colon is treated like a part of the path, +// i.e. in `http://example.org:foo` pathname is `:foo` +// +// 4. Nothing is URL-encoded in the resulting object, +// (in joyent/node some chars in auth and paths are encoded) +// +// 5. `url.parse()` does not have `parseQueryString` argument +// +// 6. Removed extraneous result properties: `host`, `path`, `query`, etc., +// which can be constructed using other parts of the url. +// + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.pathname = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +const protocolPattern = /^([a-z0-9.+-]+:)/i; +const portPattern = /:[0-9]*$/; + +// Special case for a simple path URL +/* eslint-disable-next-line no-useless-escape */ +const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/; + +// RFC 2396: characters reserved for delimiting URLs. +// We actually just auto-escape these. +const delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t']; + +// RFC 2396: characters not allowed for various reasons. +const unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims); + +// Allowed by RFCs, but cause of XSS attacks. Always escape these. +const autoEscape = ['\''].concat(unwise); +// Characters that are never ever allowed in a hostname. +// Note that any invalid chars are also handled, but these +// are the ones that are *expected* to be seen, so we fast-path +// them. +const nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape); +const hostEndingChars = ['/', '?', '#']; +const hostnameMaxLen = 255; +const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/; +const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/; +// protocols that can allow "unsafe" and "unwise" chars. +// protocols that never have a hostname. +const hostlessProtocol = { + javascript: true, + 'javascript:': true +}; +// protocols that always contain a // bit. +const slashedProtocol = { + http: true, + https: true, + ftp: true, + gopher: true, + file: true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true +}; +function urlParse(url, slashesDenoteHost) { + if (url && url instanceof Url) return url; + const u = new Url(); + u.parse(url, slashesDenoteHost); + return u; +} +Url.prototype.parse = function (url, slashesDenoteHost) { + let lowerProto, hec, slashes; + let rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + const simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + } + return this; + } + } + let proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + lowerProto = proto.toLowerCase(); + this.protocol = proto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + /* eslint-disable-next-line no-useless-escape */ + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) { + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + let hostEnd = -1; + for (let i = 0; i < hostEndingChars.length; i++) { + hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + let auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = auth; + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (let i = 0; i < nonHostChars.length; i++) { + hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) { + hostEnd = rest.length; + } + if (rest[hostEnd - 1] === ':') { + hostEnd--; + } + const host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(host); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + const ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + const hostparts = this.hostname.split(/\./); + for (let i = 0, l = hostparts.length; i < l; i++) { + const part = hostparts[i]; + if (!part) { + continue; + } + if (!part.match(hostnamePartPattern)) { + let newpart = ''; + for (let j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + const validParts = hostparts.slice(0, i); + const notHost = hostparts.slice(i + 1); + const bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + } + } + + // chop off from the tail first. + const hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + const qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + rest = rest.slice(0, qm); + } + if (rest) { + this.pathname = rest; + } + if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { + this.pathname = ''; + } + return this; +}; +Url.prototype.parseHost = function (host) { + let port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) { + this.hostname = host; + } +}; +exports.decode = decode; +exports.encode = encode; +exports.format = format; +exports.parse = urlParse; + +/***/ }), + +/***/ "../../../node_modules/meros/browser/index.js": +/*!****************************************************!*\ + !*** ../../../node_modules/meros/browser/index.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +var e = new TextDecoder(); +async function t(t, n) { + if (!t.ok || !t.body || t.bodyUsed) return t; + let i = t.headers.get("content-type"); + if (!i || !~i.indexOf("multipart/")) return t; + let l = i.indexOf("boundary="), + r = "-"; + if (~l) { + let e = l + 9, + t = i.indexOf(";", e); + r = i.slice(e, t > -1 ? t : void 0).trim().replace(/"/g, ""); + } + return async function* (t, n, i) { + let l, + r, + d, + o = t.getReader(), + a = !i || !i.multiple, + f = n.length, + s = "", + c = []; + try { + let t; + e: for (; !(t = await o.read()).done;) { + let i = e.decode(t.value); + l = s.length, s += i; + let o = i.indexOf(n); + for (~o ? l += o : l = s.indexOf(n), c = []; ~l;) { + let e = s.slice(0, l), + t = s.slice(l + f); + if (r) { + let n = e.indexOf("\r\n\r\n") + 4, + i = e.lastIndexOf("\r\n", n), + l = !1, + r = e.slice(n, i > -1 ? void 0 : i), + o = String(e.slice(0, n)).trim().split("\r\n"), + f = {}, + s = o.length; + for (; d = o[--s]; d = d.split(": "), f[d.shift().toLowerCase()] = d.join(": ")); + if (d = f["content-type"], d && ~d.indexOf("application/json")) try { + r = JSON.parse(r), l = !0; + } catch (e) {} + if (d = { + headers: f, + body: r, + json: l + }, a ? yield d : c.push(d), "--" === t.slice(0, 2)) break e; + } else n = "\r\n" + n, r = f += 2; + s = t, l = s.indexOf(n); + } + c.length && (yield c); + } + } finally { + c.length && (yield c), await o.cancel(); + } + }(t.body, `--${r}`, n); +} +exports.meros = t; + +/***/ }), + +/***/ "../../../node_modules/nullthrows/nullthrows.js": +/*!******************************************************!*\ + !*** ../../../node_modules/nullthrows/nullthrows.js ***! + \******************************************************/ +/***/ (function(module) { + +"use strict"; + + +function nullthrows(x, message) { + if (x != null) { + return x; + } + var error = new Error(message !== undefined ? message : 'Got unexpected ' + x); + error.framesToPop = 1; // Skip nullthrows's own stack frame. + throw error; +} +module.exports = nullthrows; +module.exports["default"] = nullthrows; +Object.defineProperty(module.exports, "__esModule", ({ + value: true +})); + +/***/ }), + +/***/ "../../../node_modules/popmotion/dist/popmotion.cjs.js": +/*!*************************************************************!*\ + !*** ../../../node_modules/popmotion/dist/popmotion.cjs.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); +var heyListen = __webpack_require__(/*! hey-listen */ "../../../node_modules/hey-listen/dist/hey-listen.es.js"); +var styleValueTypes = __webpack_require__(/*! style-value-types */ "../../../node_modules/style-value-types/dist/valueTypes.cjs.js"); +var sync = __webpack_require__(/*! framesync */ "../../../node_modules/framesync/dist/framesync.cjs.js"); +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : { + 'default': e + }; +} +var sync__default = /*#__PURE__*/_interopDefaultLegacy(sync); +const clamp = (min, max, v) => Math.min(Math.max(v, min), max); +const safeMin = 0.001; +const minDuration = 0.01; +const maxDuration = 10.0; +const minDamping = 0.05; +const maxDamping = 1; +function findSpring({ + duration = 800, + bounce = 0.25, + velocity = 0, + mass = 1 +}) { + let envelope; + let derivative; + heyListen.warning(duration <= maxDuration * 1000, "Spring duration must be 10 seconds or less"); + let dampingRatio = 1 - bounce; + dampingRatio = clamp(minDamping, maxDamping, dampingRatio); + duration = clamp(minDuration, maxDuration, duration / 1000); + if (dampingRatio < 1) { + envelope = undampedFreq => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - a / b * c; + }; + derivative = undampedFreq => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return factor * ((d - e) * f) / g; + }; + } else { + envelope = undampedFreq => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = undampedFreq => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = duration * 1000; + if (isNaN(undampedFreq)) { + return { + stiffness: 100, + damping: 10, + duration + }; + } else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration + }; + } +} +const rootIterations = 12; +function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; +} +function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); +} +const durationKeys = ["duration", "bounce"]; +const physicsKeys = ["stiffness", "damping", "mass"]; +function isSpringType(options, keys) { + return keys.some(key => options[key] !== undefined); +} +function getSpringOptions(options) { + let springOptions = Object.assign({ + velocity: 0.0, + stiffness: 100, + damping: 10, + mass: 1.0, + isResolvedFromDuration: false + }, options); + if (!isSpringType(options, physicsKeys) && isSpringType(options, durationKeys)) { + const derived = findSpring(options); + springOptions = Object.assign(Object.assign(Object.assign({}, springOptions), derived), { + velocity: 0.0, + mass: 1.0 + }); + springOptions.isResolvedFromDuration = true; + } + return springOptions; +} +function spring(_a) { + var { + from = 0.0, + to = 1.0, + restSpeed = 2, + restDelta + } = _a, + options = tslib.__rest(_a, ["from", "to", "restSpeed", "restDelta"]); + const state = { + done: false, + value: from + }; + let { + stiffness, + damping, + mass, + velocity, + duration, + isResolvedFromDuration + } = getSpringOptions(options); + let resolveSpring = zero; + let resolveVelocity = zero; + function createSpring() { + const initialVelocity = velocity ? -(velocity / 1000) : 0.0; + const initialDelta = to - from; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000; + if (restDelta === undefined) { + restDelta = Math.min(Math.abs(to - from) / 100, 0.4); + } + if (dampingRatio < 1) { + const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + resolveSpring = t => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return to - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq * Math.sin(angularFreq * t) + initialDelta * Math.cos(angularFreq * t)); + }; + resolveVelocity = t => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return dampingRatio * undampedAngularFreq * envelope * (Math.sin(angularFreq * t) * (initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq + initialDelta * Math.cos(angularFreq * t)) - envelope * (Math.cos(angularFreq * t) * (initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) - angularFreq * initialDelta * Math.sin(angularFreq * t)); + }; + } else if (dampingRatio === 1) { + resolveSpring = t => to - Math.exp(-undampedAngularFreq * t) * (initialDelta + (initialVelocity + undampedAngularFreq * initialDelta) * t); + } else { + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = t => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const freqForT = Math.min(dampedAngularFreq * t, 300); + return to - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) * Math.sinh(freqForT) + dampedAngularFreq * initialDelta * Math.cosh(freqForT)) / dampedAngularFreq; + }; + } + } + createSpring(); + return { + next: t => { + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + const currentVelocity = resolveVelocity(t) * 1000; + const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; + const isBelowDisplacementThreshold = Math.abs(to - current) <= restDelta; + state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold; + } else { + state.done = t >= duration; + } + state.value = state.done ? to : current; + return state; + }, + flipTarget: () => { + velocity = -velocity; + [from, to] = [to, from]; + createSpring(); + } + }; +} +spring.needsInterpolation = (a, b) => typeof a === "string" || typeof b === "string"; +const zero = _t => 0; +const progress = (from, to, value) => { + const toFromDifference = to - from; + return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; +}; +const mix = (from, to, progress) => -progress * from + progress * to + from; +function hueToRgb(p, q, t) { + if (t < 0) t += 1; + if (t > 1) t -= 1; + if (t < 1 / 6) return p + (q - p) * 6 * t; + if (t < 1 / 2) return q; + if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; + return p; +} +function hslaToRgba({ + hue, + saturation, + lightness, + alpha +}) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } else { + const q = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha + }; +} +const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const toExpo = to * to; + return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo)); +}; +const colorTypes = [styleValueTypes.hex, styleValueTypes.rgba, styleValueTypes.hsla]; +const getColorType = v => colorTypes.find(type => type.test(v)); +const notAnimatable = color => `'${color}' is not an animatable color. Use the equivalent color code instead.`; +const mixColor = (from, to) => { + let fromColorType = getColorType(from); + let toColorType = getColorType(to); + heyListen.invariant(!!fromColorType, notAnimatable(from)); + heyListen.invariant(!!toColorType, notAnimatable(to)); + let fromColor = fromColorType.parse(from); + let toColor = toColorType.parse(to); + if (fromColorType === styleValueTypes.hsla) { + fromColor = hslaToRgba(fromColor); + fromColorType = styleValueTypes.rgba; + } + if (toColorType === styleValueTypes.hsla) { + toColor = hslaToRgba(toColor); + toColorType = styleValueTypes.rgba; + } + const blended = Object.assign({}, fromColor); + return v => { + for (const key in blended) { + if (key !== "alpha") { + blended[key] = mixLinearColor(fromColor[key], toColor[key], v); + } + } + blended.alpha = mix(fromColor.alpha, toColor.alpha, v); + return fromColorType.transform(blended); + }; +}; +const zeroPoint = { + x: 0, + y: 0, + z: 0 +}; +const isNum = v => typeof v === 'number'; +const combineFunctions = (a, b) => v => b(a(v)); +const pipe = (...transformers) => transformers.reduce(combineFunctions); +function getMixer(origin, target) { + if (isNum(origin)) { + return v => mix(origin, target, v); + } else if (styleValueTypes.color.test(origin)) { + return mixColor(origin, target); + } else { + return mixComplex(origin, target); + } +} +const mixArray = (from, to) => { + const output = [...from]; + const numValues = output.length; + const blendValue = from.map((fromThis, i) => getMixer(fromThis, to[i])); + return v => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](v); + } + return output; + }; +}; +const mixObject = (origin, target) => { + const output = Object.assign(Object.assign({}, origin), target); + const blendValue = {}; + for (const key in output) { + if (origin[key] !== undefined && target[key] !== undefined) { + blendValue[key] = getMixer(origin[key], target[key]); + } + } + return v => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; +}; +function analyse(value) { + const parsed = styleValueTypes.complex.parse(value); + const numValues = parsed.length; + let numNumbers = 0; + let numRGB = 0; + let numHSL = 0; + for (let i = 0; i < numValues; i++) { + if (numNumbers || typeof parsed[i] === "number") { + numNumbers++; + } else { + if (parsed[i].hue !== undefined) { + numHSL++; + } else { + numRGB++; + } + } + } + return { + parsed, + numNumbers, + numRGB, + numHSL + }; +} +const mixComplex = (origin, target) => { + const template = styleValueTypes.complex.createTransformer(target); + const originStats = analyse(origin); + const targetStats = analyse(target); + const canInterpolate = originStats.numHSL === targetStats.numHSL && originStats.numRGB === targetStats.numRGB && originStats.numNumbers >= targetStats.numNumbers; + if (canInterpolate) { + return pipe(mixArray(originStats.parsed, targetStats.parsed), template); + } else { + heyListen.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`); + return p => `${p > 0 ? target : origin}`; + } +}; +const mixNumber = (from, to) => p => mix(from, to, p); +function detectMixerFactory(v) { + if (typeof v === 'number') { + return mixNumber; + } else if (typeof v === 'string') { + if (styleValueTypes.color.test(v)) { + return mixColor; + } else { + return mixComplex; + } + } else if (Array.isArray(v)) { + return mixArray; + } else if (typeof v === 'object') { + return mixObject; + } +} +function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || detectMixerFactory(output[0]); + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] : ease; + mixer = pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; +} +function fastInterpolate([from, to], [mixer]) { + return v => mixer(progress(from, to, v)); +} +function slowInterpolate(input, mixers) { + const inputLength = input.length; + const lastInputIndex = inputLength - 1; + return v => { + let mixerIndex = 0; + let foundMixerIndex = false; + if (v <= input[0]) { + foundMixerIndex = true; + } else if (v >= input[lastInputIndex]) { + mixerIndex = lastInputIndex - 1; + foundMixerIndex = true; + } + if (!foundMixerIndex) { + let i = 1; + for (; i < inputLength; i++) { + if (input[i] > v || i === lastInputIndex) { + break; + } + } + mixerIndex = i - 1; + } + const progressInRange = progress(input[mixerIndex], input[mixerIndex + 1], v); + return mixers[mixerIndex](progressInRange); + }; +} +function interpolate(input, output, { + clamp: isClamp = true, + ease, + mixer +} = {}) { + const inputLength = input.length; + heyListen.invariant(inputLength === output.length, 'Both input and output ranges must be the same length'); + heyListen.invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.'); + if (input[0] > input[inputLength - 1]) { + input = [].concat(input); + output = [].concat(output); + input.reverse(); + output.reverse(); + } + const mixers = createMixers(output, ease, mixer); + const interpolator = inputLength === 2 ? fastInterpolate(input, mixers) : slowInterpolate(input, mixers); + return isClamp ? v => interpolator(clamp(input[0], input[inputLength - 1], v)) : interpolator; +} +const reverseEasing = easing => p => 1 - easing(1 - p); +const mirrorEasing = easing => p => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; +const createExpoIn = power => p => Math.pow(p, power); +const createBackIn = power => p => p * p * ((power + 1) * p - power); +const createAnticipate = power => { + const backEasing = createBackIn(power); + return p => (p *= 2) < 1 ? 0.5 * backEasing(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); +}; +const DEFAULT_OVERSHOOT_STRENGTH = 1.525; +const BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0; +const BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0; +const BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0; +const linear = p => p; +const easeIn = createExpoIn(2); +const easeOut = reverseEasing(easeIn); +const easeInOut = mirrorEasing(easeIn); +const circIn = p => 1 - Math.sin(Math.acos(p)); +const circOut = reverseEasing(circIn); +const circInOut = mirrorEasing(circOut); +const backIn = createBackIn(DEFAULT_OVERSHOOT_STRENGTH); +const backOut = reverseEasing(backIn); +const backInOut = mirrorEasing(backIn); +const anticipate = createAnticipate(DEFAULT_OVERSHOOT_STRENGTH); +const ca = 4356.0 / 361.0; +const cb = 35442.0 / 1805.0; +const cc = 16061.0 / 1805.0; +const bounceOut = p => { + if (p === 1 || p === 0) return p; + const p2 = p * p; + return p < BOUNCE_FIRST_THRESHOLD ? 7.5625 * p2 : p < BOUNCE_SECOND_THRESHOLD ? 9.075 * p2 - 9.9 * p + 3.4 : p < BOUNCE_THIRD_THRESHOLD ? ca * p2 - cb * p + cc : 10.8 * p * p - 20.52 * p + 10.72; +}; +const bounceIn = reverseEasing(bounceOut); +const bounceInOut = p => p < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0)) : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5; +function defaultEasing(values, easing) { + return values.map(() => easing || easeInOut).splice(0, values.length - 1); +} +function defaultOffset(values) { + const numValues = values.length; + return values.map((_value, i) => i !== 0 ? i / (numValues - 1) : 0); +} +function convertOffsetToTimes(offset, duration) { + return offset.map(o => o * duration); +} +function keyframes({ + from = 0, + to = 1, + ease, + offset, + duration = 300 +}) { + const state = { + done: false, + value: from + }; + const values = Array.isArray(to) ? to : [from, to]; + const times = convertOffsetToTimes(offset && offset.length === values.length ? offset : defaultOffset(values), duration); + function createInterpolator() { + return interpolate(times, values, { + ease: Array.isArray(ease) ? ease : defaultEasing(values, ease) + }); + } + let interpolator = createInterpolator(); + return { + next: t => { + state.value = interpolator(t); + state.done = t >= duration; + return state; + }, + flipTarget: () => { + values.reverse(); + interpolator = createInterpolator(); + } + }; +} +function decay({ + velocity = 0, + from = 0, + power = 0.8, + timeConstant = 350, + restDelta = 0.5, + modifyTarget +}) { + const state = { + done: false, + value: from + }; + let amplitude = power * velocity; + const ideal = from + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + if (target !== ideal) amplitude = target - from; + return { + next: t => { + const delta = -amplitude * Math.exp(-t / timeConstant); + state.done = !(delta > restDelta || delta < -restDelta); + state.value = state.done ? target : target + delta; + return state; + }, + flipTarget: () => {} + }; +} +const types = { + keyframes, + spring, + decay +}; +function detectAnimationFromOptions(config) { + if (Array.isArray(config.to)) { + return keyframes; + } else if (types[config.type]) { + return types[config.type]; + } + const keys = new Set(Object.keys(config)); + if (keys.has("ease") || keys.has("duration") && !keys.has("dampingRatio")) { + return keyframes; + } else if (keys.has("dampingRatio") || keys.has("stiffness") || keys.has("mass") || keys.has("damping") || keys.has("restSpeed") || keys.has("restDelta")) { + return spring; + } + return keyframes; +} +function loopElapsed(elapsed, duration, delay = 0) { + return elapsed - duration - delay; +} +function reverseElapsed(elapsed, duration, delay = 0, isForwardPlayback = true) { + return isForwardPlayback ? loopElapsed(duration + -elapsed, duration, delay) : duration - (elapsed - duration) + delay; +} +function hasRepeatDelayElapsed(elapsed, duration, delay, isForwardPlayback) { + return isForwardPlayback ? elapsed >= duration + delay : elapsed <= -delay; +} +const framesync = update => { + const passTimestamp = ({ + delta + }) => update(delta); + return { + start: () => sync__default["default"].update(passTimestamp, true), + stop: () => sync.cancelSync.update(passTimestamp) + }; +}; +function animate(_a) { + var _b, _c; + var { + from, + autoplay = true, + driver = framesync, + elapsed = 0, + repeat: repeatMax = 0, + repeatType = "loop", + repeatDelay = 0, + onPlay, + onStop, + onComplete, + onRepeat, + onUpdate + } = _a, + options = tslib.__rest(_a, ["from", "autoplay", "driver", "elapsed", "repeat", "repeatType", "repeatDelay", "onPlay", "onStop", "onComplete", "onRepeat", "onUpdate"]); + let { + to + } = options; + let driverControls; + let repeatCount = 0; + let computedDuration = options.duration; + let latest; + let isComplete = false; + let isForwardPlayback = true; + let interpolateFromNumber; + const animator = detectAnimationFromOptions(options); + if ((_c = (_b = animator).needsInterpolation) === null || _c === void 0 ? void 0 : _c.call(_b, from, to)) { + interpolateFromNumber = interpolate([0, 100], [from, to], { + clamp: false + }); + from = 0; + to = 100; + } + const animation = animator(Object.assign(Object.assign({}, options), { + from, + to + })); + function repeat() { + repeatCount++; + if (repeatType === "reverse") { + isForwardPlayback = repeatCount % 2 === 0; + elapsed = reverseElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback); + } else { + elapsed = loopElapsed(elapsed, computedDuration, repeatDelay); + if (repeatType === "mirror") animation.flipTarget(); + } + isComplete = false; + onRepeat && onRepeat(); + } + function complete() { + driverControls.stop(); + onComplete && onComplete(); + } + function update(delta) { + if (!isForwardPlayback) delta = -delta; + elapsed += delta; + if (!isComplete) { + const state = animation.next(Math.max(0, elapsed)); + latest = state.value; + if (interpolateFromNumber) latest = interpolateFromNumber(latest); + isComplete = isForwardPlayback ? state.done : elapsed <= 0; + } + onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(latest); + if (isComplete) { + if (repeatCount === 0) computedDuration !== null && computedDuration !== void 0 ? computedDuration : computedDuration = elapsed; + if (repeatCount < repeatMax) { + hasRepeatDelayElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback) && repeat(); + } else { + complete(); + } + } + } + function play() { + onPlay === null || onPlay === void 0 ? void 0 : onPlay(); + driverControls = driver(update); + driverControls.start(); + } + autoplay && play(); + return { + stop: () => { + onStop === null || onStop === void 0 ? void 0 : onStop(); + driverControls.stop(); + } + }; +} +function velocityPerSecond(velocity, frameDuration) { + return frameDuration ? velocity * (1000 / frameDuration) : 0; +} +function inertia({ + from = 0, + velocity = 0, + min, + max, + power = 0.8, + timeConstant = 750, + bounceStiffness = 500, + bounceDamping = 10, + restDelta = 1, + modifyTarget, + driver, + onUpdate, + onComplete, + onStop +}) { + let currentAnimation; + function isOutOfBounds(v) { + return min !== undefined && v < min || max !== undefined && v > max; + } + function boundaryNearest(v) { + if (min === undefined) return max; + if (max === undefined) return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + } + function startAnimation(options) { + currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(); + currentAnimation = animate(Object.assign(Object.assign({}, options), { + driver, + onUpdate: v => { + var _a; + onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(v); + (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, v); + }, + onComplete, + onStop + })); + } + function startSpring(options) { + startAnimation(Object.assign({ + type: "spring", + stiffness: bounceStiffness, + damping: bounceDamping, + restDelta + }, options)); + } + if (isOutOfBounds(from)) { + startSpring({ + from, + velocity, + to: boundaryNearest(from) + }); + } else { + let target = power * velocity + from; + if (typeof modifyTarget !== "undefined") target = modifyTarget(target); + const boundary = boundaryNearest(target); + const heading = boundary === min ? -1 : 1; + let prev; + let current; + const checkBoundary = v => { + prev = current; + current = v; + velocity = velocityPerSecond(v - prev, sync.getFrameData().delta); + if (heading === 1 && v > boundary || heading === -1 && v < boundary) { + startSpring({ + from: v, + to: boundary, + velocity + }); + } + }; + startAnimation({ + type: "decay", + from, + velocity, + timeConstant, + power, + restDelta, + modifyTarget, + onUpdate: isOutOfBounds(target) ? checkBoundary : undefined + }); + } + return { + stop: () => currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop() + }; +} +const radiansToDegrees = radians => radians * 180 / Math.PI; +const angle = (a, b = zeroPoint) => radiansToDegrees(Math.atan2(b.y - a.y, b.x - a.x)); +const applyOffset = (from, to) => { + let hasReceivedFrom = true; + if (to === undefined) { + to = from; + hasReceivedFrom = false; + } + return v => { + if (hasReceivedFrom) { + return v - from + to; + } else { + from = v; + hasReceivedFrom = true; + return to; + } + }; +}; +const identity = v => v; +const createAttractor = (alterDisplacement = identity) => (constant, origin, v) => { + const displacement = origin - v; + const springModifiedDisplacement = -(0 - constant + 1) * (0 - alterDisplacement(Math.abs(displacement))); + return displacement <= 0 ? origin + springModifiedDisplacement : origin - springModifiedDisplacement; +}; +const attract = createAttractor(); +const attractExpo = createAttractor(Math.sqrt); +const degreesToRadians = degrees => degrees * Math.PI / 180; +const isPoint = point => point.hasOwnProperty('x') && point.hasOwnProperty('y'); +const isPoint3D = point => isPoint(point) && point.hasOwnProperty('z'); +const distance1D = (a, b) => Math.abs(a - b); +function distance(a, b) { + if (isNum(a) && isNum(b)) { + return distance1D(a, b); + } else if (isPoint(a) && isPoint(b)) { + const xDelta = distance1D(a.x, b.x); + const yDelta = distance1D(a.y, b.y); + const zDelta = isPoint3D(a) && isPoint3D(b) ? distance1D(a.z, b.z) : 0; + return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2)); + } +} +const pointFromVector = (origin, angle, distance) => { + angle = degreesToRadians(angle); + return { + x: distance * Math.cos(angle) + origin.x, + y: distance * Math.sin(angle) + origin.y + }; +}; +const toDecimal = (num, precision = 2) => { + precision = Math.pow(10, precision); + return Math.round(num * precision) / precision; +}; +const smoothFrame = (prevValue, nextValue, duration, smoothing = 0) => toDecimal(prevValue + duration * (nextValue - prevValue) / Math.max(smoothing, duration)); +const smooth = (strength = 50) => { + let previousValue = 0; + let lastUpdated = 0; + return v => { + const currentFramestamp = sync.getFrameData().timestamp; + const timeDelta = currentFramestamp !== lastUpdated ? currentFramestamp - lastUpdated : 0; + const newValue = timeDelta ? smoothFrame(previousValue, v, timeDelta, strength) : previousValue; + lastUpdated = currentFramestamp; + previousValue = newValue; + return newValue; + }; +}; +const snap = points => { + if (typeof points === 'number') { + return v => Math.round(v / points) * points; + } else { + let i = 0; + const numPoints = points.length; + return v => { + let lastDistance = Math.abs(points[0] - v); + for (i = 1; i < numPoints; i++) { + const point = points[i]; + const distance = Math.abs(point - v); + if (distance === 0) return point; + if (distance > lastDistance) return points[i - 1]; + if (i === numPoints - 1) return point; + lastDistance = distance; + } + }; + } +}; +function velocityPerFrame(xps, frameDuration) { + return xps / (1000 / frameDuration); +} +const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((v - min) % rangeSize + rangeSize) % rangeSize + min; +}; +const a = (a1, a2) => 1.0 - 3.0 * a2 + 3.0 * a1; +const b = (a1, a2) => 3.0 * a2 - 6.0 * a1; +const c = a1 => 3.0 * a1; +const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t; +const getSlope = (t, a1, a2) => 3.0 * a(a1, a2) * t * t + 2.0 * b(a1, a2) * t + c(a1); +const subdivisionPrecision = 0.0000001; +const subdivisionMaxIterations = 10; +function binarySubdivide(aX, aA, aB, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = aA + (aB - aA) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - aX; + if (currentX > 0.0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && ++i < subdivisionMaxIterations); + return currentT; +} +const newtonIterations = 8; +const newtonMinSlope = 0.001; +function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { + for (let i = 0; i < newtonIterations; ++i) { + const currentSlope = getSlope(aGuessT, mX1, mX2); + if (currentSlope === 0.0) { + return aGuessT; + } + const currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + return aGuessT; +} +const kSplineTableSize = 11; +const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); +function cubicBezier(mX1, mY1, mX2, mY2) { + if (mX1 === mY1 && mX2 === mY2) return linear; + const sampleValues = new Float32Array(kSplineTableSize); + for (let i = 0; i < kSplineTableSize; ++i) { + sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); + } + function getTForX(aX) { + let intervalStart = 0.0; + let currentSample = 1; + const lastSample = kSplineTableSize - 1; + for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + --currentSample; + const dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); + const guessForT = intervalStart + dist * kSampleStepSize; + const initialSlope = getSlope(guessForT, mX1, mX2); + if (initialSlope >= newtonMinSlope) { + return newtonRaphsonIterate(aX, guessForT, mX1, mX2); + } else if (initialSlope === 0.0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); + } + } + return t => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); +} +const steps = (steps, direction = 'end') => progress => { + progress = direction === 'end' ? Math.min(progress, 0.999) : Math.max(progress, 0.001); + const expanded = progress * steps; + const rounded = direction === 'end' ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / steps); +}; +exports.angle = angle; +exports.animate = animate; +exports.anticipate = anticipate; +exports.applyOffset = applyOffset; +exports.attract = attract; +exports.attractExpo = attractExpo; +exports.backIn = backIn; +exports.backInOut = backInOut; +exports.backOut = backOut; +exports.bounceIn = bounceIn; +exports.bounceInOut = bounceInOut; +exports.bounceOut = bounceOut; +exports.circIn = circIn; +exports.circInOut = circInOut; +exports.circOut = circOut; +exports.clamp = clamp; +exports.createAnticipate = createAnticipate; +exports.createAttractor = createAttractor; +exports.createBackIn = createBackIn; +exports.createExpoIn = createExpoIn; +exports.cubicBezier = cubicBezier; +exports.decay = decay; +exports.degreesToRadians = degreesToRadians; +exports.distance = distance; +exports.easeIn = easeIn; +exports.easeInOut = easeInOut; +exports.easeOut = easeOut; +exports.inertia = inertia; +exports.interpolate = interpolate; +exports.isPoint = isPoint; +exports.isPoint3D = isPoint3D; +exports.keyframes = keyframes; +exports.linear = linear; +exports.mirrorEasing = mirrorEasing; +exports.mix = mix; +exports.mixColor = mixColor; +exports.mixComplex = mixComplex; +exports.pipe = pipe; +exports.pointFromVector = pointFromVector; +exports.progress = progress; +exports.radiansToDegrees = radiansToDegrees; +exports.reverseEasing = reverseEasing; +exports.smooth = smooth; +exports.smoothFrame = smoothFrame; +exports.snap = snap; +exports.spring = spring; +exports.steps = steps; +exports.toDecimal = toDecimal; +exports.velocityPerFrame = velocityPerFrame; +exports.velocityPerSecond = velocityPerSecond; +exports.wrap = wrap; + +/***/ }), + +/***/ "../../../node_modules/punycode.js/punycode.es6.js": +/*!*********************************************************!*\ + !*** ../../../node_modules/punycode.js/punycode.es6.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +/** Highest positive signed 32-bit float value */ +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.toUnicode = exports.toASCII = exports.encode = exports["default"] = exports.decode = void 0; +exports.ucs2decode = ucs2decode; +exports.ucs2encode = void 0; +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +exports.ucs2encode = ucs2encode; +const basicToDigit = function (codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function (digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function (delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for /* no initialization */ + (; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function (input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for /* no final expression */ + (let index = basic > 0 ? basic + 1 : 0; index < inputLength;) { + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for /* no condition */ + (let w = 1, k = base;; k += base) { + if (index >= inputLength) { + error('invalid-input'); + } + const digit = basicToDigit(input.charCodeAt(index++)); + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + i += digit * w; + const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (digit < t) { + break; + } + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + w *= baseMinusT; + } + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +exports.decode = decode; +const encode = function (input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + delta += (m - n) * handledCPCountPlusOne; + n = m; + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for /* no condition */ + (let k = base;; k += base) { + const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; } - }; + const qMinusT = q - t; + const baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + ++delta; + ++n; + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +exports.encode = encode; +const toUnicode = function (input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +exports.toUnicode = toUnicode; +const toASCII = function (input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +exports.toASCII = toASCII; +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.3.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; +var _default = exports["default"] = punycode; + +/***/ }), + +/***/ "../../../node_modules/react-compiler-runtime/dist/index.js": +/*!******************************************************************!*\ + !*** ../../../node_modules/react-compiler-runtime/dist/index.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @lightSyntaxTransform + * @noflow + * @nolint + * @preventMunge + * @preserve-invariant-messages + */ + +"use no memo"; +'use strict'; + +var React = __webpack_require__(/*! react */ "react"); +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { + return e[k]; + } + }); + } + }); + } + n.default = e; + return Object.freeze(n); +} +var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); +var _a, _b; +const { + useRef, + useEffect, + isValidElement +} = React__namespace; +const ReactSecretInternals = (_a = React__namespace.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE) !== null && _a !== void 0 ? _a : React__namespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; +const $empty = Symbol.for('react.memo_cache_sentinel'); +const c = typeof ((_b = React__namespace.__COMPILER_RUNTIME) === null || _b === void 0 ? void 0 : _b.c) === 'function' ? React__namespace.__COMPILER_RUNTIME.c : function c(size) { + return React__namespace.useMemo(() => { + const $ = new Array(size); + for (let ii = 0; ii < size; ii++) { + $[ii] = $empty; + } + $[$empty] = true; + return $; + }, []); +}; +const LazyGuardDispatcher = {}; +['readContext', 'useCallback', 'useContext', 'useEffect', 'useImperativeHandle', 'useInsertionEffect', 'useLayoutEffect', 'useMemo', 'useReducer', 'useRef', 'useState', 'useDebugValue', 'useDeferredValue', 'useTransition', 'useMutableSource', 'useSyncExternalStore', 'useId', 'unstable_isNewReconciler', 'getCacheSignal', 'getCacheForType', 'useCacheRefresh'].forEach(name => { + LazyGuardDispatcher[name] = () => { + throw new Error(`[React] Unexpected React hook call (${name}) from a React compiled function. ` + "Check that all hooks are called directly and named according to convention ('use[A-Z]') "); + }; +}); +let originalDispatcher = null; +LazyGuardDispatcher['useMemoCache'] = count => { + if (originalDispatcher == null) { + throw new Error('React Compiler internal invariant violation: unexpected null dispatcher'); + } else { + return originalDispatcher.useMemoCache(count); + } +}; +var GuardKind; +(function (GuardKind) { + GuardKind[GuardKind["PushGuardContext"] = 0] = "PushGuardContext"; + GuardKind[GuardKind["PopGuardContext"] = 1] = "PopGuardContext"; + GuardKind[GuardKind["PushExpectHook"] = 2] = "PushExpectHook"; + GuardKind[GuardKind["PopExpectHook"] = 3] = "PopExpectHook"; +})(GuardKind || (GuardKind = {})); +function setCurrent(newDispatcher) { + ReactSecretInternals.ReactCurrentDispatcher.current = newDispatcher; + return ReactSecretInternals.ReactCurrentDispatcher.current; +} +const guardFrames = []; +function $dispatcherGuard(kind) { + const curr = ReactSecretInternals.ReactCurrentDispatcher.current; + if (kind === GuardKind.PushGuardContext) { + guardFrames.push(curr); + if (guardFrames.length === 1) { + originalDispatcher = curr; + } + if (curr === LazyGuardDispatcher) { + throw new Error(`[React] Unexpected call to custom hook or component from a React compiled function. ` + "Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') " + 'and (2) components are returned as JSX instead of being directly invoked.'); + } + setCurrent(LazyGuardDispatcher); + } else if (kind === GuardKind.PopGuardContext) { + const lastFrame = guardFrames.pop(); + if (lastFrame == null) { + throw new Error('React Compiler internal error: unexpected null in guard stack'); + } + if (guardFrames.length === 0) { + originalDispatcher = null; + } + setCurrent(lastFrame); + } else if (kind === GuardKind.PushExpectHook) { + guardFrames.push(curr); + setCurrent(originalDispatcher); + } else if (kind === GuardKind.PopExpectHook) { + const lastFrame = guardFrames.pop(); + if (lastFrame == null) { + throw new Error('React Compiler internal error: unexpected null in guard stack'); + } + setCurrent(lastFrame); + } else { + throw new Error('React Compiler internal error: unreachable block' + kind); + } +} +function $reset($) { + for (let ii = 0; ii < $.length; ii++) { + $[ii] = $empty; + } +} +function $makeReadOnly() { + throw new Error('TODO: implement $makeReadOnly in react-compiler-runtime'); +} +const renderCounterRegistry = new Map(); +function clearRenderCounterRegistry() { + for (const counters of renderCounterRegistry.values()) { + counters.forEach(counter => { + counter.count = 0; + }); + } +} +function registerRenderCounter(name, val) { + let counters = renderCounterRegistry.get(name); + if (counters == null) { + counters = new Set(); + renderCounterRegistry.set(name, counters); + } + counters.add(val); +} +function removeRenderCounter(name, val) { + const counters = renderCounterRegistry.get(name); + if (counters == null) { + return; + } + counters.delete(val); +} +function useRenderCounter(name) { + const val = useRef(null); + if (val.current != null) { + val.current.count += 1; + } + useEffect(() => { + if (val.current == null) { + const counter = { + count: 0 + }; + registerRenderCounter(name, counter); + val.current = counter; + } + return () => { + if (val.current !== null) { + removeRenderCounter(name, val.current); + } + }; + }); +} +const seenErrors = new Set(); +function $structuralCheck(oldValue, newValue, variableName, fnName, kind, loc) { + function error(l, r, path, depth) { + const str = `${fnName}:${loc} [${kind}] ${variableName}${path} changed from ${l} to ${r} at depth ${depth}`; + if (seenErrors.has(str)) { + return; + } + seenErrors.add(str); + console.error(str); + } + const depthLimit = 2; + function recur(oldValue, newValue, path, depth) { + if (depth > depthLimit) { + return; + } else if (oldValue === newValue) { + return; + } else if (typeof oldValue !== typeof newValue) { + error(`type ${typeof oldValue}`, `type ${typeof newValue}`, path, depth); + } else if (typeof oldValue === 'object') { + const oldArray = Array.isArray(oldValue); + const newArray = Array.isArray(newValue); + if (oldValue === null && newValue !== null) { + error('null', `type ${typeof newValue}`, path, depth); + } else if (newValue === null) { + error(`type ${typeof oldValue}`, 'null', path, depth); + } else if (oldValue instanceof Map) { + if (!(newValue instanceof Map)) { + error(`Map instance`, `other value`, path, depth); + } else if (oldValue.size !== newValue.size) { + error(`Map instance with size ${oldValue.size}`, `Map instance with size ${newValue.size}`, path, depth); + } else { + for (const [k, v] of oldValue) { + if (!newValue.has(k)) { + error(`Map instance with key ${k}`, `Map instance without key ${k}`, path, depth); + } else { + recur(v, newValue.get(k), `${path}.get(${k})`, depth + 1); + } + } + } + } else if (newValue instanceof Map) { + error('other value', `Map instance`, path, depth); + } else if (oldValue instanceof Set) { + if (!(newValue instanceof Set)) { + error(`Set instance`, `other value`, path, depth); + } else if (oldValue.size !== newValue.size) { + error(`Set instance with size ${oldValue.size}`, `Set instance with size ${newValue.size}`, path, depth); + } else { + for (const v of newValue) { + if (!oldValue.has(v)) { + error(`Set instance without element ${v}`, `Set instance with element ${v}`, path, depth); + } + } + } + } else if (newValue instanceof Set) { + error('other value', `Set instance`, path, depth); + } else if (oldArray || newArray) { + if (oldArray !== newArray) { + error(`type ${oldArray ? 'array' : 'object'}`, `type ${newArray ? 'array' : 'object'}`, path, depth); + } else if (oldValue.length !== newValue.length) { + error(`array with length ${oldValue.length}`, `array with length ${newValue.length}`, path, depth); + } else { + for (let ii = 0; ii < oldValue.length; ii++) { + recur(oldValue[ii], newValue[ii], `${path}[${ii}]`, depth + 1); + } + } + } else if (isValidElement(oldValue) || isValidElement(newValue)) { + if (isValidElement(oldValue) !== isValidElement(newValue)) { + error(`type ${isValidElement(oldValue) ? 'React element' : 'object'}`, `type ${isValidElement(newValue) ? 'React element' : 'object'}`, path, depth); + } else if (oldValue.type !== newValue.type) { + error(`React element of type ${oldValue.type}`, `React element of type ${newValue.type}`, path, depth); + } else { + recur(oldValue.props, newValue.props, `[props of ${path}]`, depth + 1); + } + } else { + for (const key in newValue) { + if (!(key in oldValue)) { + error(`object without key ${key}`, `object with key ${key}`, path, depth); + } + } + for (const key in oldValue) { + if (!(key in newValue)) { + error(`object with key ${key}`, `object without key ${key}`, path, depth); + } else { + recur(oldValue[key], newValue[key], `${path}.${key}`, depth + 1); + } + } + } + } else if (typeof oldValue === 'function') { + return; + } else if (isNaN(oldValue) || isNaN(newValue)) { + if (isNaN(oldValue) !== isNaN(newValue)) { + error(`${isNaN(oldValue) ? 'NaN' : 'non-NaN value'}`, `${isNaN(newValue) ? 'NaN' : 'non-NaN value'}`, path, depth); + } + } else if (oldValue !== newValue) { + error(oldValue, newValue, path, depth); + } + } + recur(oldValue, newValue, '', 0); +} +exports.$dispatcherGuard = $dispatcherGuard; +exports.$makeReadOnly = $makeReadOnly; +exports.$reset = $reset; +exports.$structuralCheck = $structuralCheck; +exports.c = c; +exports.clearRenderCounterRegistry = clearRenderCounterRegistry; +exports.renderCounterRegistry = renderCounterRegistry; +exports.useRenderCounter = useRenderCounter; + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll-bar/dist/es2015/component.js": +/*!******************************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll-bar/dist/es2015/component.js ***! + \******************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.RemoveScrollBar = void 0; +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactStyleSingleton = __webpack_require__(/*! react-style-singleton */ "../../../node_modules/react-style-singleton/dist/es2015/index.js"); +var _constants = __webpack_require__(/*! ./constants */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js"); +var _utils = __webpack_require__(/*! ./utils */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +var Style = (0, _reactStyleSingleton.styleSingleton)(); +// important tip - once we measure scrollBar width and remove them +// we could not repeat this operation +// thus we are using style-singleton - only the first "yet correct" style will be applied. +var getStyles = function (_a, allowRelative, gapMode, important) { + var left = _a.left, + top = _a.top, + right = _a.right, + gap = _a.gap; + if (gapMode === void 0) { + gapMode = 'margin'; + } + return "\n .".concat(_constants.noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([allowRelative && "position: relative ".concat(important, ";"), gapMode === 'margin' && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "), gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";")].filter(Boolean).join(''), "\n }\n \n .").concat(_constants.zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(_constants.fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(_constants.zeroRightClassName, " .").concat(_constants.zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(_constants.fullWidthClassName, " .").concat(_constants.fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body {\n ").concat(_constants.removedBarSizeVariable, ": ").concat(gap, "px;\n }\n"); +}; +/** + * Removes page scrollbar and blocks page scroll when mounted + */ +var RemoveScrollBar = function (props) { + var noRelative = props.noRelative, + noImportant = props.noImportant, + _a = props.gapMode, + gapMode = _a === void 0 ? 'margin' : _a; + var gap = React.useMemo(function () { + return (0, _utils.getGapWidth)(gapMode); + }, [gapMode]); + return /*#__PURE__*/React.createElement(Style, { + styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') + }); +}; +exports.RemoveScrollBar = RemoveScrollBar; + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js": +/*!******************************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js ***! + \******************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.zeroRightClassName = exports.removedBarSizeVariable = exports.noScrollbarsClassName = exports.fullWidthClassName = void 0; +var zeroRightClassName = exports.zeroRightClassName = 'right-scroll-bar-position'; +var fullWidthClassName = exports.fullWidthClassName = 'width-before-scroll-bar'; +var noScrollbarsClassName = exports.noScrollbarsClassName = 'with-scroll-bars-hidden'; +/** + * Name of a CSS variable containing the amount of "hidden" scrollbar + * ! might be undefined ! use will fallback! + */ +var removedBarSizeVariable = exports.removedBarSizeVariable = '--removed-body-scroll-bar-size'; + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll-bar/dist/es2015/index.js": +/*!**************************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll-bar/dist/es2015/index.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "RemoveScrollBar", ({ + enumerable: true, + get: function () { + return _component.RemoveScrollBar; + } +})); +Object.defineProperty(exports, "fullWidthClassName", ({ + enumerable: true, + get: function () { + return _constants.fullWidthClassName; + } +})); +Object.defineProperty(exports, "getGapWidth", ({ + enumerable: true, + get: function () { + return _utils.getGapWidth; + } +})); +Object.defineProperty(exports, "noScrollbarsClassName", ({ + enumerable: true, + get: function () { + return _constants.noScrollbarsClassName; + } +})); +Object.defineProperty(exports, "removedBarSizeVariable", ({ + enumerable: true, + get: function () { + return _constants.removedBarSizeVariable; + } +})); +Object.defineProperty(exports, "zeroRightClassName", ({ + enumerable: true, + get: function () { + return _constants.zeroRightClassName; + } +})); +var _component = __webpack_require__(/*! ./component */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/component.js"); +var _constants = __webpack_require__(/*! ./constants */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js"); +var _utils = __webpack_require__(/*! ./utils */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js"); + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js": +/*!**************************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.zeroGap = exports.getGapWidth = void 0; +var zeroGap = exports.zeroGap = { + left: 0, + top: 0, + right: 0, + gap: 0 +}; +var parse = function (x) { + return parseInt(x || '', 10) || 0; +}; +var getOffset = function (gapMode) { + var cs = window.getComputedStyle(document.body); + if (true) { + if (cs.overflowY === 'hidden') { + console.error('react-remove-scroll-bar: cannot calculate scrollbar size because it is removed (overflow:hidden on body'); + } + } + var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft']; + var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop']; + var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight']; + return [parse(left), parse(top), parse(right)]; +}; +var getGapWidth = function (gapMode) { + if (gapMode === void 0) { + gapMode = 'margin'; + } + if (typeof window === 'undefined') { + return zeroGap; + } + var offsets = getOffset(gapMode); + var documentWidth = document.documentElement.clientWidth; + var windowWidth = window.innerWidth; + return { + left: offsets[0], + top: offsets[1], + right: offsets[2], + gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]) + }; +}; +exports.getGapWidth = getGapWidth; + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll/dist/es2015/Combination.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll/dist/es2015/Combination.js ***! + \****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _UI = __webpack_require__(/*! ./UI */ "../../../node_modules/react-remove-scroll/dist/es2015/UI.js"); +var _sidecar = _interopRequireDefault(__webpack_require__(/*! ./sidecar */ "../../../node_modules/react-remove-scroll/dist/es2015/sidecar.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +var ReactRemoveScroll = /*#__PURE__*/React.forwardRef(function (props, ref) { + return /*#__PURE__*/React.createElement(_UI.RemoveScroll, (0, _tslib.__assign)({}, props, { + ref: ref, + sideCar: _sidecar.default + })); +}); +ReactRemoveScroll.classNames = _UI.RemoveScroll.classNames; +var _default = exports["default"] = ReactRemoveScroll; + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js": +/*!***************************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.RemoveScrollSideCar = RemoveScrollSideCar; +exports.getTouchXY = exports.getDeltaXY = void 0; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _reactRemoveScrollBar = __webpack_require__(/*! react-remove-scroll-bar */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/index.js"); +var _reactStyleSingleton = __webpack_require__(/*! react-style-singleton */ "../../../node_modules/react-style-singleton/dist/es2015/index.js"); +var _aggresiveCapture = __webpack_require__(/*! ./aggresiveCapture */ "../../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js"); +var _handleScroll = __webpack_require__(/*! ./handleScroll */ "../../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +var getTouchXY = function (event) { + return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; +}; +exports.getTouchXY = getTouchXY; +var getDeltaXY = function (event) { + return [event.deltaX, event.deltaY]; +}; +exports.getDeltaXY = getDeltaXY; +var extractRef = function (ref) { + return ref && 'current' in ref ? ref.current : ref; +}; +var deltaCompare = function (x, y) { + return x[0] === y[0] && x[1] === y[1]; +}; +var generateStyle = function (id) { + return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); +}; +var idCounter = 0; +var lockStack = []; +function RemoveScrollSideCar(props) { + var shouldPreventQueue = React.useRef([]); + var touchStartRef = React.useRef([0, 0]); + var activeAxis = React.useRef(); + var id = React.useState(idCounter++)[0]; + var Style = React.useState(function () { + return (0, _reactStyleSingleton.styleSingleton)(); + })[0]; + var lastProps = React.useRef(props); + React.useEffect(function () { + lastProps.current = props; + }, [props]); + React.useEffect(function () { + if (props.inert) { + document.body.classList.add("block-interactivity-".concat(id)); + var allow_1 = (0, _tslib.__spreadArray)([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean); + allow_1.forEach(function (el) { + return el.classList.add("allow-interactivity-".concat(id)); + }); + return function () { + document.body.classList.remove("block-interactivity-".concat(id)); + allow_1.forEach(function (el) { + return el.classList.remove("allow-interactivity-".concat(id)); + }); + }; + } + return; + }, [props.inert, props.lockRef.current, props.shards]); + var shouldCancelEvent = React.useCallback(function (event, parent) { + if ('touches' in event && event.touches.length === 2) { + return !lastProps.current.allowPinchZoom; + } + var touch = getTouchXY(event); + var touchStart = touchStartRef.current; + var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0]; + var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1]; + var currentAxis; + var target = event.target; + var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v'; + // allow horizontal touch move on Range inputs. They will not cause any scroll + if ('touches' in event && moveDirection === 'h' && target.type === 'range') { + return false; + } + var canBeScrolledInMainDirection = (0, _handleScroll.locationCouldBeScrolled)(moveDirection, target); + if (!canBeScrolledInMainDirection) { + return true; + } + if (canBeScrolledInMainDirection) { + currentAxis = moveDirection; + } else { + currentAxis = moveDirection === 'v' ? 'h' : 'v'; + canBeScrolledInMainDirection = (0, _handleScroll.locationCouldBeScrolled)(moveDirection, target); + // other axis might be not scrollable + } + if (!canBeScrolledInMainDirection) { + return false; + } + if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) { + activeAxis.current = currentAxis; + } + if (!currentAxis) { + return true; + } + var cancelingAxis = activeAxis.current || currentAxis; + return (0, _handleScroll.handleScroll)(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true); + }, []); + var shouldPrevent = React.useCallback(function (_event) { + var event = _event; + if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) { + // not the last active + return; + } + var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event); + var sourceEvent = shouldPreventQueue.current.filter(function (e) { + return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); + })[0]; + // self event, and should be canceled + if (sourceEvent && sourceEvent.should) { + if (event.cancelable) { + event.preventDefault(); + } + return; + } + // outside or shard event + if (!sourceEvent) { + var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function (node) { + return node.contains(event.target); + }); + var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; + if (shouldStop) { + if (event.cancelable) { + event.preventDefault(); + } + } + } + }, []); + var shouldCancel = React.useCallback(function (name, delta, target, should) { + var event = { + name: name, + delta: delta, + target: target, + should: should + }; + shouldPreventQueue.current.push(event); + setTimeout(function () { + shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { + return e !== event; + }); + }, 1); + }, []); + var scrollTouchStart = React.useCallback(function (event) { + touchStartRef.current = getTouchXY(event); + activeAxis.current = undefined; + }, []); + var scrollWheel = React.useCallback(function (event) { + shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); + }, []); + var scrollTouchMove = React.useCallback(function (event) { + shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); + }, []); + React.useEffect(function () { + lockStack.push(Style); + props.setCallbacks({ + onScrollCapture: scrollWheel, + onWheelCapture: scrollWheel, + onTouchMoveCapture: scrollTouchMove + }); + document.addEventListener('wheel', shouldPrevent, _aggresiveCapture.nonPassive); + document.addEventListener('touchmove', shouldPrevent, _aggresiveCapture.nonPassive); + document.addEventListener('touchstart', scrollTouchStart, _aggresiveCapture.nonPassive); + return function () { + lockStack = lockStack.filter(function (inst) { + return inst !== Style; + }); + document.removeEventListener('wheel', shouldPrevent, _aggresiveCapture.nonPassive); + document.removeEventListener('touchmove', shouldPrevent, _aggresiveCapture.nonPassive); + document.removeEventListener('touchstart', scrollTouchStart, _aggresiveCapture.nonPassive); + }; + }, []); + var removeScrollBar = props.removeScrollBar, + inert = props.inert; + return /*#__PURE__*/React.createElement(React.Fragment, null, inert ? /*#__PURE__*/React.createElement(Style, { + styles: generateStyle(id) + }) : null, removeScrollBar ? /*#__PURE__*/React.createElement(_reactRemoveScrollBar.RemoveScrollBar, { + gapMode: "margin" + }) : null); +} + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll/dist/es2015/UI.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll/dist/es2015/UI.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.RemoveScroll = void 0; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _constants = __webpack_require__(/*! react-remove-scroll-bar/constants */ "../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js"); +var _useCallbackRef = __webpack_require__(/*! use-callback-ref */ "../../../node_modules/use-callback-ref/dist/es2015/index.js"); +var _medium = __webpack_require__(/*! ./medium */ "../../../node_modules/react-remove-scroll/dist/es2015/medium.js"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +var nothing = function () { + return; +}; +/** + * Removes scrollbar from the page and contain the scroll within the Lock + */ +var RemoveScroll = exports.RemoveScroll = /*#__PURE__*/React.forwardRef(function (props, parentRef) { + var ref = React.useRef(null); + var _a = React.useState({ + onScrollCapture: nothing, + onWheelCapture: nothing, + onTouchMoveCapture: nothing + }), + callbacks = _a[0], + setCallbacks = _a[1]; + var forwardProps = props.forwardProps, + children = props.children, + className = props.className, + removeScrollBar = props.removeScrollBar, + enabled = props.enabled, + shards = props.shards, + sideCar = props.sideCar, + noIsolation = props.noIsolation, + inert = props.inert, + allowPinchZoom = props.allowPinchZoom, + _b = props.as, + Container = _b === void 0 ? 'div' : _b, + rest = (0, _tslib.__rest)(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]); + var SideCar = sideCar; + var containerRef = (0, _useCallbackRef.useMergeRefs)([ref, parentRef]); + var containerProps = (0, _tslib.__assign)((0, _tslib.__assign)({}, rest), callbacks); + return /*#__PURE__*/React.createElement(React.Fragment, null, enabled && ( /*#__PURE__*/React.createElement(SideCar, { + sideCar: _medium.effectCar, + removeScrollBar: removeScrollBar, + shards: shards, + noIsolation: noIsolation, + inert: inert, + setCallbacks: setCallbacks, + allowPinchZoom: !!allowPinchZoom, + lockRef: ref + })), forwardProps ? ( /*#__PURE__*/React.cloneElement(React.Children.only(children), (0, _tslib.__assign)((0, _tslib.__assign)({}, containerProps), { + ref: containerRef + }))) : ( /*#__PURE__*/React.createElement(Container, (0, _tslib.__assign)({}, containerProps, { + className: className, + ref: containerRef + }), children))); +}); +RemoveScroll.defaultProps = { + enabled: true, + removeScrollBar: true, + inert: false +}; +RemoveScroll.classNames = { + fullWidth: _constants.fullWidthClassName, + zeroRight: _constants.zeroRightClassName +}; + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js": +/*!*********************************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js ***! + \*********************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.nonPassive = void 0; +var passiveSupported = false; +if (typeof window !== 'undefined') { + try { + var options = Object.defineProperty({}, 'passive', { + get: function () { + passiveSupported = true; + return true; + } + }); + // @ts-ignore + window.addEventListener('test', options, options); + // @ts-ignore + window.removeEventListener('test', options, options); + } catch (err) { + passiveSupported = false; + } +} +var nonPassive = exports.nonPassive = passiveSupported ? { + passive: false +} : false; + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.locationCouldBeScrolled = exports.handleScroll = void 0; +var alwaysContainsScroll = function (node) { + // textarea will always _contain_ scroll inside self. It only can be hidden + return node.tagName === 'TEXTAREA'; +}; +var elementCanBeScrolled = function (node, overflow) { + var styles = window.getComputedStyle(node); + return ( + // not-not-scrollable + styles[overflow] !== 'hidden' && + // contains scroll inside self + !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible') + ); +}; +var elementCouldBeVScrolled = function (node) { + return elementCanBeScrolled(node, 'overflowY'); +}; +var elementCouldBeHScrolled = function (node) { + return elementCanBeScrolled(node, 'overflowX'); +}; +var locationCouldBeScrolled = function (axis, node) { + var current = node; + do { + // Skip over shadow root + if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) { + current = current.host; + } + var isScrollable = elementCouldBeScrolled(axis, current); + if (isScrollable) { + var _a = getScrollVariables(axis, current), + s = _a[1], + d = _a[2]; + if (s > d) { + return true; + } + } + current = current.parentNode; + } while (current && current !== document.body); + return false; +}; +exports.locationCouldBeScrolled = locationCouldBeScrolled; +var getVScrollVariables = function (_a) { + var scrollTop = _a.scrollTop, + scrollHeight = _a.scrollHeight, + clientHeight = _a.clientHeight; + return [scrollTop, scrollHeight, clientHeight]; +}; +var getHScrollVariables = function (_a) { + var scrollLeft = _a.scrollLeft, + scrollWidth = _a.scrollWidth, + clientWidth = _a.clientWidth; + return [scrollLeft, scrollWidth, clientWidth]; +}; +var elementCouldBeScrolled = function (axis, node) { + return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node); +}; +var getScrollVariables = function (axis, node) { + return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node); +}; +var getDirectionFactor = function (axis, direction) { + /** + * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position, + * and then increasingly negative as you scroll towards the end of the content. + * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft + */ + return axis === 'h' && direction === 'rtl' ? -1 : 1; +}; +var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) { + var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); + var delta = directionFactor * sourceDelta; + // find scrollable target + var target = event.target; + var targetInLock = endTarget.contains(target); + var shouldCancelScroll = false; + var isDeltaPositive = delta > 0; + var availableScroll = 0; + var availableScrollTop = 0; + do { + var _a = getScrollVariables(axis, target), + position = _a[0], + scroll_1 = _a[1], + capacity = _a[2]; + var elementScroll = scroll_1 - capacity - directionFactor * position; + if (position || elementScroll) { + if (elementCouldBeScrolled(axis, target)) { + availableScroll += elementScroll; + availableScrollTop += position; } - function startWorker(cm, time) { - if (cm.doc.highlightFrontier < cm.display.viewTo) { - cm.state.highlight.set(time, bind(highlightWorker, cm)); + } + target = target.parentNode; + } while ( + // portaled content + !targetInLock && target !== document.body || + // self content + targetInLock && (endTarget.contains(target) || endTarget === target)); + if (isDeltaPositive && (noOverscroll && availableScroll === 0 || !noOverscroll && delta > availableScroll)) { + shouldCancelScroll = true; + } else if (!isDeltaPositive && (noOverscroll && availableScrollTop === 0 || !noOverscroll && -delta > availableScrollTop)) { + shouldCancelScroll = true; + } + return shouldCancelScroll; +}; +exports.handleScroll = handleScroll; + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll/dist/es2015/index.js": +/*!**********************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll/dist/es2015/index.js ***! + \**********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "RemoveScroll", ({ + enumerable: true, + get: function () { + return _Combination.default; + } +})); +var _Combination = _interopRequireDefault(__webpack_require__(/*! ./Combination */ "../../../node_modules/react-remove-scroll/dist/es2015/Combination.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll/dist/es2015/medium.js": +/*!***********************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll/dist/es2015/medium.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.effectCar = void 0; +var _useSidecar = __webpack_require__(/*! use-sidecar */ "../../../node_modules/use-sidecar/dist/es2015/index.js"); +var effectCar = exports.effectCar = (0, _useSidecar.createSidecarMedium)(); + +/***/ }), + +/***/ "../../../node_modules/react-remove-scroll/dist/es2015/sidecar.js": +/*!************************************************************************!*\ + !*** ../../../node_modules/react-remove-scroll/dist/es2015/sidecar.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _useSidecar = __webpack_require__(/*! use-sidecar */ "../../../node_modules/use-sidecar/dist/es2015/index.js"); +var _SideEffect = __webpack_require__(/*! ./SideEffect */ "../../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js"); +var _medium = __webpack_require__(/*! ./medium */ "../../../node_modules/react-remove-scroll/dist/es2015/medium.js"); +var _default = exports["default"] = (0, _useSidecar.exportSidecar)(_medium.effectCar, _SideEffect.RemoveScrollSideCar); + +/***/ }), + +/***/ "../../../node_modules/react-style-singleton/dist/es2015/component.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/react-style-singleton/dist/es2015/component.js ***! + \****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.styleSingleton = void 0; +var _hook = __webpack_require__(/*! ./hook */ "../../../node_modules/react-style-singleton/dist/es2015/hook.js"); +/** + * create a Component to add styles on demand + * - styles are added when first instance is mounted + * - styles are removed when the last instance is unmounted + * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior + */ +var styleSingleton = function () { + var useStyle = (0, _hook.styleHookSingleton)(); + var Sheet = function (_a) { + var styles = _a.styles, + dynamic = _a.dynamic; + useStyle(styles, dynamic); + return null; + }; + return Sheet; +}; +exports.styleSingleton = styleSingleton; + +/***/ }), + +/***/ "../../../node_modules/react-style-singleton/dist/es2015/hook.js": +/*!***********************************************************************!*\ + !*** ../../../node_modules/react-style-singleton/dist/es2015/hook.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.styleHookSingleton = void 0; +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _singleton = __webpack_require__(/*! ./singleton */ "../../../node_modules/react-style-singleton/dist/es2015/singleton.js"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +/** + * creates a hook to control style singleton + * @see {@link styleSingleton} for a safer component version + * @example + * ```tsx + * const useStyle = styleHookSingleton(); + * /// + * useStyle('body { overflow: hidden}'); + */ +var styleHookSingleton = function () { + var sheet = (0, _singleton.stylesheetSingleton)(); + return function (styles, isDynamic) { + React.useEffect(function () { + sheet.add(styles); + return function () { + sheet.remove(); + }; + }, [styles && isDynamic]); + }; +}; +exports.styleHookSingleton = styleHookSingleton; + +/***/ }), + +/***/ "../../../node_modules/react-style-singleton/dist/es2015/index.js": +/*!************************************************************************!*\ + !*** ../../../node_modules/react-style-singleton/dist/es2015/index.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "styleHookSingleton", ({ + enumerable: true, + get: function () { + return _hook.styleHookSingleton; + } +})); +Object.defineProperty(exports, "styleSingleton", ({ + enumerable: true, + get: function () { + return _component.styleSingleton; + } +})); +Object.defineProperty(exports, "stylesheetSingleton", ({ + enumerable: true, + get: function () { + return _singleton.stylesheetSingleton; + } +})); +var _component = __webpack_require__(/*! ./component */ "../../../node_modules/react-style-singleton/dist/es2015/component.js"); +var _singleton = __webpack_require__(/*! ./singleton */ "../../../node_modules/react-style-singleton/dist/es2015/singleton.js"); +var _hook = __webpack_require__(/*! ./hook */ "../../../node_modules/react-style-singleton/dist/es2015/hook.js"); + +/***/ }), + +/***/ "../../../node_modules/react-style-singleton/dist/es2015/singleton.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/react-style-singleton/dist/es2015/singleton.js ***! + \****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.stylesheetSingleton = void 0; +var _getNonce = __webpack_require__(/*! get-nonce */ "../../../node_modules/get-nonce/dist/es2015/index.js"); +function makeStyleTag() { + if (!document) return null; + var tag = document.createElement('style'); + tag.type = 'text/css'; + var nonce = (0, _getNonce.getNonce)(); + if (nonce) { + tag.setAttribute('nonce', nonce); + } + return tag; +} +function injectStyles(tag, css) { + // @ts-ignore + if (tag.styleSheet) { + // @ts-ignore + tag.styleSheet.cssText = css; + } else { + tag.appendChild(document.createTextNode(css)); + } +} +function insertStyleTag(tag) { + var head = document.head || document.getElementsByTagName('head')[0]; + head.appendChild(tag); +} +var stylesheetSingleton = function () { + var counter = 0; + var stylesheet = null; + return { + add: function (style) { + if (counter == 0) { + if (stylesheet = makeStyleTag()) { + injectStyles(stylesheet, style); + insertStyleTag(stylesheet); } } - function highlightWorker(cm) { - var doc = cm.doc; - if (doc.highlightFrontier >= cm.display.viewTo) { - return; - } - var end = + /* @__PURE__ */new Date() + cm.options.workTime; - var context = getContextBefore(cm, doc.highlightFrontier); - var changedLines = []; - doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { - if (context.line >= cm.display.viewFrom) { - var oldStyles = line.styles; - var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; - var highlighted = highlightLine(cm, line, context, true); - if (resetState) { - context.state = resetState; - } - line.styles = highlighted.styles; - var oldCls = line.styleClasses, - newCls = highlighted.classes; - if (newCls) { - line.styleClasses = newCls; - } else if (oldCls) { - line.styleClasses = null; - } - var ischange = !oldStyles || oldStyles.length != line.styles.length || oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); - for (var i2 = 0; !ischange && i2 < oldStyles.length; ++i2) { - ischange = oldStyles[i2] != line.styles[i2]; - } - if (ischange) { - changedLines.push(context.line); - } - line.stateAfter = context.save(); - context.nextLine(); - } else { - if (line.text.length <= cm.options.maxHighlightLength) { - processLine(cm, line.text, context); - } - line.stateAfter = context.line % 5 == 0 ? context.save() : null; - context.nextLine(); - } - if (+ /* @__PURE__ */new Date() > end) { - startWorker(cm, cm.options.workDelay); - return true; - } - }); - doc.highlightFrontier = context.line; - doc.modeFrontier = Math.max(doc.modeFrontier, context.line); - if (changedLines.length) { - runInOp(cm, function () { - for (var i2 = 0; i2 < changedLines.length; i2++) { - regLineChange(cm, changedLines[i2], "text"); - } - }); - } + counter++; + }, + remove: function () { + counter--; + if (!counter && stylesheet) { + stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); + stylesheet = null; } - var DisplayUpdate = function (cm, viewport, force) { - var display = cm.display; - this.viewport = viewport; - this.visible = visibleLines(display, cm.doc, viewport); - this.editorIsHidden = !display.wrapper.offsetWidth; - this.wrapperHeight = display.wrapper.clientHeight; - this.wrapperWidth = display.wrapper.clientWidth; - this.oldDisplayWidth = displayWidth(cm); - this.force = force; - this.dims = getDimensions(cm); - this.events = []; - }; - DisplayUpdate.prototype.signal = function (emitter, type) { - if (hasHandler(emitter, type)) { - this.events.push(arguments); - } - }; - DisplayUpdate.prototype.finish = function () { - for (var i2 = 0; i2 < this.events.length; i2++) { - signal.apply(null, this.events[i2]); - } - }; - function maybeClipScrollbars(cm) { - var display = cm.display; - if (!display.scrollbarsClipped && display.scroller.offsetWidth) { - display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; - display.heightForcer.style.height = scrollGap(cm) + "px"; - display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; - display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; - display.scrollbarsClipped = true; - } + } + }; +}; +exports.stylesheetSingleton = stylesheetSingleton; + +/***/ }), + +/***/ "../../../node_modules/react/cjs/react-jsx-runtime.development.js": +/*!************************************************************************!*\ + !*** ../../../node_modules/react/cjs/react-jsx-runtime.development.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +/** + * @license React + * react-jsx-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +if (true) { + (function () { + 'use strict'; + + var React = __webpack_require__(/*! react */ "react"); + + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. + var REACT_ELEMENT_TYPE = Symbol.for('react.element'); + var REACT_PORTAL_TYPE = Symbol.for('react.portal'); + var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); + var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); + var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); + var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); + var REACT_CONTEXT_TYPE = Symbol.for('react.context'); + var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); + var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); + var REACT_MEMO_TYPE = Symbol.for('react.memo'); + var REACT_LAZY_TYPE = Symbol.for('react.lazy'); + var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; } - function selectionSnapshot(cm) { - if (cm.hasFocus()) { - return null; - } - var active = activeElt(); - if (!active || !contains(cm.display.lineDiv, active)) { - return null; - } - var result = { - activeElt: active - }; - if (window.getSelection) { - var sel = window.getSelection(); - if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { - result.anchorNode = sel.anchorNode; - result.anchorOffset = sel.anchorOffset; - result.focusNode = sel.focusNode; - result.focusOffset = sel.focusOffset; + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + return null; + } + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + function error(format) { + { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; } + printWarning('error', format, args); } - return result; } - function restoreSelection(snapshot) { - if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { - return; - } - snapshot.activeElt.focus(); - if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) && snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { - var sel = window.getSelection(), - range2 = document.createRange(); - range2.setEnd(snapshot.anchorNode, snapshot.anchorOffset); - range2.collapse(false); - sel.removeAllRanges(); - sel.addRange(range2); - sel.extend(snapshot.focusNode, snapshot.focusOffset); - } + } + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } // eslint-disable-next-line react-internal/safe-string-coercion + + var argsWithFormat = args.map(function (item) { + return String(item); + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); } - function updateDisplayIfNeeded(cm, update) { - var display = cm.display, - doc = cm.doc; - if (update.editorIsHidden) { - resetView(cm); - return false; - } - if (!update.force && update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && display.renderedView == display.view && countDirtyView(cm) == 0) { - return false; - } - if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm); - update.dims = getDimensions(cm); - } - var end = doc.first + doc.size; - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); - var to = Math.min(end, update.visible.to + cm.options.viewportMargin); - if (display.viewFrom < from && from - display.viewFrom < 20) { - from = Math.max(doc.first, display.viewFrom); - } - if (display.viewTo > to && display.viewTo - to < 20) { - to = Math.min(end, display.viewTo); - } - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from); - to = visualLineEndNo(cm.doc, to); - } - var different = from != display.viewFrom || to != display.viewTo || display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; - adjustView(cm, from, to); - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); - cm.display.mover.style.top = display.viewOffset + "px"; - var toUpdate = countDirtyView(cm); - if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) { - return false; - } - var selSnapshot = selectionSnapshot(cm); - if (toUpdate > 4) { - display.lineDiv.style.display = "none"; - } - patchDisplay(cm, display.updateLineNumbers, update.dims); - if (toUpdate > 4) { - display.lineDiv.style.display = ""; - } - display.renderedView = display.view; - restoreSelection(selSnapshot); - removeChildren(display.cursorDiv); - removeChildren(display.selectionDiv); - display.gutters.style.height = display.sizer.style.minHeight = 0; - if (different) { - display.lastWrapHeight = update.wrapperHeight; - display.lastWrapWidth = update.wrapperWidth; - startWorker(cm, 400); - } - display.updateLineNumbers = null; + } + + // ----------------------------------------------------------------------------- + + var enableScopeAPI = false; // Experimental Create Event Handle API. + var enableCacheElement = false; + var enableTransitionTracing = false; // No known bugs, but needs performance testing + + var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber + // stuff. Intended to enable React core members to more easily debug scheduling + // issues in DEV builds. + + var enableDebugTracing = false; // Track which Fiber(s) schedule render work. + + var REACT_MODULE_REFERENCE; + { + REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); + } + function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { return true; } - function postUpdateDisplay(cm, update) { - var viewport = update.viewport; - for (var first = true;; first = false) { - if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { - if (viewport && viewport.top != null) { - viewport = { - top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top) - }; - } - update.visible = visibleLines(cm.display, cm.doc, viewport); - if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) { - break; - } - } else if (first) { - update.visible = visibleLines(cm.display, cm.doc, viewport); - } - if (!updateDisplayIfNeeded(cm, update)) { - break; - } - updateHeightsInViewport(cm); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - update.force = false; - } - update.signal(cm, "update", cm); - if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { - update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); - cm.display.reportedViewFrom = cm.display.viewFrom; - cm.display.reportedViewTo = cm.display.viewTo; - } - } - function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport); - if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm); - postUpdateDisplay(cm, update); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - update.finish(); - } - } - function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, - lineNumbers = cm.options.lineNumbers; - var container = display.lineDiv, - cur = container.firstChild; - function rm(node2) { - var next = node2.nextSibling; - if (webkit && mac && cm.display.currentWheelTarget == node2) { - node2.style.display = "none"; - } else { - node2.parentNode.removeChild(node2); - } - return next; - } - var view = display.view, - lineN = display.viewFrom; - for (var i2 = 0; i2 < view.length; i2++) { - var lineView = view[i2]; - if (lineView.hidden) ;else if (!lineView.node || lineView.node.parentNode != container) { - var node = buildLineElement(cm, lineView, lineN, dims); - container.insertBefore(node, cur); - } else { - while (cur != lineView.node) { - cur = rm(cur); - } - var updateNumber = lineNumbers && updateNumbersFrom != null && updateNumbersFrom <= lineN && lineView.lineNumber; - if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) { - updateNumber = false; - } - updateLineForChanges(cm, lineView, lineN, dims); - } - if (updateNumber) { - removeChildren(lineView.lineNumber); - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); - } - cur = lineView.node.nextSibling; - } - lineN += lineView.size; - } - while (cur) { - cur = rm(cur); + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || + // This needs to include all possible module reference object + // types supported by any Flight configuration anywhere since + // we don't know which Flight build this will end up being used + // with. + type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { + return true; } } - function updateGutterSpace(display) { - var width = display.gutters.offsetWidth; - display.sizer.style.marginLeft = width + "px"; - signalLater(display, "gutterChanged", display); + return false; + } + function getWrappedName(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + if (displayName) { + return displayName; } - function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = measure.docHeight + "px"; - cm.display.heightForcer.style.top = measure.docHeight + "px"; - cm.display.gutters.style.height = measure.docHeight + cm.display.barHeight + scrollGap(cm) + "px"; + var functionName = innerType.displayName || innerType.name || ''; + return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; + } // Keep in sync with react-reconciler/getComponentNameFromFiber + + function getContextName(type) { + return type.displayName || 'Context'; + } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. + + function getComponentNameFromType(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; } - function alignHorizontally(cm) { - var display = cm.display, - view = display.view; - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { - return; - } - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; - var gutterW = display.gutters.offsetWidth, - left = comp + "px"; - for (var i2 = 0; i2 < view.length; i2++) { - if (!view[i2].hidden) { - if (cm.options.fixedGutter) { - if (view[i2].gutter) { - view[i2].gutter.style.left = left; - } - if (view[i2].gutterBackground) { - view[i2].gutterBackground.style.left = left; - } - } - var align = view[i2].alignable; - if (align) { - for (var j = 0; j < align.length; j++) { - align[j].style.left = left; - } - } - } - } - if (cm.options.fixedGutter) { - display.gutters.style.left = comp + gutterW + "px"; + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); } } - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) { - return false; - } - var doc = cm.doc, - last = lineNumberFor(cm.options, doc.first + doc.size - 1), - display = cm.display; - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, - padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; - updateGutterSpace(cm.display); - return true; - } - return false; + if (typeof type === 'function') { + return type.displayName || type.name || null; } - function getGutters(gutters, lineNumbers) { - var result = [], - sawLineNumbers = false; - for (var i2 = 0; i2 < gutters.length; i2++) { - var name = gutters[i2], - style = null; - if (typeof name != "string") { - style = name.style; - name = name.className; - } - if (name == "CodeMirror-linenumbers") { - if (!lineNumbers) { - continue; - } else { - sawLineNumbers = true; - } - } - result.push({ - className: name, - style - }); - } - if (lineNumbers && !sawLineNumbers) { - result.push({ - className: "CodeMirror-linenumbers", - style: null - }); - } - return result; + if (typeof type === 'string') { + return type; } - function renderGutters(display) { - var gutters = display.gutters, - specs = display.gutterSpecs; - removeChildren(gutters); - display.lineGutter = null; - for (var i2 = 0; i2 < specs.length; ++i2) { - var ref = specs[i2]; - var className = ref.className; - var style = ref.style; - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + className)); - if (style) { - gElt.style.cssText = style; - } - if (className == "CodeMirror-linenumbers") { - display.lineGutter = gElt; - gElt.style.width = (display.lineNumWidth || 1) + "px"; - } - } - gutters.style.display = specs.length ? "" : "none"; - updateGutterSpace(display); - } - function updateGutters(cm) { - renderGutters(cm.display); - regChange(cm); - alignHorizontally(cm); - } - function Display(place, doc, input, options) { - var d = this; - this.input = input; - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); - d.scrollbarFiller.setAttribute("cm-not-content", "true"); - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); - d.gutterFiller.setAttribute("cm-not-content", "true"); - d.lineDiv = eltP("div", null, "CodeMirror-code"); - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - d.cursorDiv = elt("div", null, "CodeMirror-cursors"); - d.measure = elt("div", null, "CodeMirror-measure"); - d.lineMeasure = elt("div", null, "CodeMirror-measure"); - d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], null, "position: relative; outline: none"); - var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); - d.mover = elt("div", [lines], null, "position: relative"); - d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - d.sizerWidth = null; - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); - d.gutters = elt("div", null, "CodeMirror-gutters"); - d.lineGutter = null; - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); - d.scroller.setAttribute("tabIndex", "-1"); - d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); - d.wrapper.setAttribute("translate", "no"); - if (ie && ie_version < 8) { - d.gutters.style.zIndex = -1; - d.scroller.style.paddingRight = 0; - } - if (!webkit && !(gecko && mobile)) { - d.scroller.draggable = true; - } - if (place) { - if (place.appendChild) { - place.appendChild(d.wrapper); - } else { - place(d.wrapper); - } - } - d.viewFrom = d.viewTo = doc.first; - d.reportedViewFrom = d.reportedViewTo = doc.first; - d.view = []; - d.renderedView = null; - d.externalMeasured = null; - d.viewOffset = 0; - d.lastWrapHeight = d.lastWrapWidth = 0; - d.updateLineNumbers = null; - d.nativeBarWidth = d.barHeight = d.barWidth = 0; - d.scrollbarsClipped = false; - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; - d.alignWidgets = false; - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - d.maxLine = null; - d.maxLineLength = 0; - d.maxLineChanged = false; - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; - d.shift = false; - d.selForContextMenu = null; - d.activeTouch = null; - d.gutterSpecs = getGutters(options.gutters, options.lineNumbers); - renderGutters(d); - input.init(d); - } - var wheelSamples = 0, - wheelPixelsPerUnit = null; - if (ie) { - wheelPixelsPerUnit = -0.53; - } else if (gecko) { - wheelPixelsPerUnit = 15; - } else if (chrome) { - wheelPixelsPerUnit = -0.7; - } else if (safari) { - wheelPixelsPerUnit = -1 / 3; - } - function wheelEventDelta(e) { - var dx = e.wheelDeltaX, - dy = e.wheelDeltaY; - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { - dx = e.detail; - } - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { - dy = e.detail; - } else if (dy == null) { - dy = e.wheelDelta; - } - return { - x: dx, - y: dy - }; + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + case REACT_PORTAL_TYPE: + return 'Portal'; + case REACT_PROFILER_TYPE: + return 'Profiler'; + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; } - function wheelEventPixels(e) { - var delta = wheelEventDelta(e); - delta.x *= wheelPixelsPerUnit; - delta.y *= wheelPixelsPerUnit; - return delta; - } - function onScrollWheel(cm, e) { - var delta = wheelEventDelta(e), - dx = delta.x, - dy = delta.y; - var pixelsPerUnit = wheelPixelsPerUnit; - if (e.deltaMode === 0) { - dx = e.deltaX; - dy = e.deltaY; - pixelsPerUnit = 1; - } - var display = cm.display, - scroll = display.scroller; - var canScrollX = scroll.scrollWidth > scroll.clientWidth; - var canScrollY = scroll.scrollHeight > scroll.clientHeight; - if (!(dx && canScrollX || dy && canScrollY)) { - return; - } - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i2 = 0; i2 < view.length; i2++) { - if (view[i2].node == cur) { - cm.display.currentWheelTarget = cur; - break outer; - } + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + case REACT_MEMO_TYPE: + var outerName = type.displayName || null; + if (outerName !== null) { + return outerName; } - } - } - if (dx && !gecko && !presto && pixelsPerUnit != null) { - if (dy && canScrollY) { - updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); - } - setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit)); - if (!dy || dy && canScrollY) { - e_preventDefault(e); - } - display.wheelStartX = null; - return; - } - if (dy && pixelsPerUnit != null) { - var pixels = dy * pixelsPerUnit; - var top = cm.doc.scrollTop, - bot = top + display.wrapper.clientHeight; - if (pixels < 0) { - top = Math.max(0, top + pixels - 50); - } else { - bot = Math.min(cm.doc.height, bot + pixels + 50); - } - updateDisplaySimple(cm, { - top, - bottom: bot - }); - } - if (wheelSamples < 20 && e.deltaMode !== 0) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; - display.wheelStartY = scroll.scrollTop; - display.wheelDX = dx; - display.wheelDY = dy; - setTimeout(function () { - if (display.wheelStartX == null) { - return; - } - var movedX = scroll.scrollLeft - display.wheelStartX; - var movedY = scroll.scrollTop - display.wheelStartY; - var sample = movedY && display.wheelDY && movedY / display.wheelDY || movedX && display.wheelDX && movedX / display.wheelDX; - display.wheelStartX = display.wheelStartY = null; - if (!sample) { - return; + return getComponentNameFromType(type.type) || 'Memo'; + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return getComponentNameFromType(init(payload)); + } catch (x) { + return null; } - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); - ++wheelSamples; - }, 200); - } else { - display.wheelDX += dx; - display.wheelDY += dy; - } - } - } - var Selection = function (ranges, primIndex) { - this.ranges = ranges; - this.primIndex = primIndex; - }; - Selection.prototype.primary = function () { - return this.ranges[this.primIndex]; - }; - Selection.prototype.equals = function (other) { - if (other == this) { - return true; - } - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { - return false; - } - for (var i2 = 0; i2 < this.ranges.length; i2++) { - var here = this.ranges[i2], - there = other.ranges[i2]; - if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { - return false; - } - } - return true; - }; - Selection.prototype.deepCopy = function () { - var out = []; - for (var i2 = 0; i2 < this.ranges.length; i2++) { - out[i2] = new Range(copyPos(this.ranges[i2].anchor), copyPos(this.ranges[i2].head)); - } - return new Selection(out, this.primIndex); - }; - Selection.prototype.somethingSelected = function () { - for (var i2 = 0; i2 < this.ranges.length; i2++) { - if (!this.ranges[i2].empty()) { - return true; - } - } - return false; - }; - Selection.prototype.contains = function (pos, end) { - if (!end) { - end = pos; - } - for (var i2 = 0; i2 < this.ranges.length; i2++) { - var range2 = this.ranges[i2]; - if (cmp(end, range2.from()) >= 0 && cmp(pos, range2.to()) <= 0) { - return i2; - } - } - return -1; - }; - var Range = function (anchor, head) { - this.anchor = anchor; - this.head = head; - }; - Range.prototype.from = function () { - return minPos(this.anchor, this.head); - }; - Range.prototype.to = function () { - return maxPos(this.anchor, this.head); - }; - Range.prototype.empty = function () { - return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; - }; - function normalizeSelection(cm, ranges, primIndex) { - var mayTouch = cm && cm.options.selectionsMayTouch; - var prim = ranges[primIndex]; - ranges.sort(function (a, b) { - return cmp(a.from(), b.from()); - }); - primIndex = indexOf(ranges, prim); - for (var i2 = 1; i2 < ranges.length; i2++) { - var cur = ranges[i2], - prev = ranges[i2 - 1]; - var diff = cmp(prev.to(), cur.from()); - if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) { - var from = minPos(prev.from(), cur.from()), - to = maxPos(prev.to(), cur.to()); - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; - if (i2 <= primIndex) { - --primIndex; } - ranges.splice(--i2, 2, new Range(inv ? to : from, inv ? from : to)); - } + + // eslint-disable-next-line no-fallthrough } - return new Selection(ranges, primIndex); } - function simpleSelection(anchor, head) { - return new Selection([new Range(anchor, head || anchor)], 0); - } - function changeEnd(change) { - if (!change.text) { - return change.to; + return null; + } + var assign = Object.assign; + + // Helpers to patch console.logs to avoid logging during side-effect free + // replaying on render function. This currently only patches the object + // lazily which won't cover if the log function was extracted eagerly. + // We could also eagerly patch the method. + var disabledDepth = 0; + var prevLog; + var prevInfo; + var prevWarn; + var prevError; + var prevGroup; + var prevGroupCollapsed; + var prevGroupEnd; + function disabledLog() {} + disabledLog.__reactDisabledLog = true; + function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ } - return Pos(change.from.line + change.text.length - 1, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); + disabledDepth++; } - function adjustForChange(pos, change) { - if (cmp(pos, change.from) < 0) { - return pos; - } - if (cmp(pos, change.to) <= 0) { - return changeEnd(change); - } - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, - ch = pos.ch; - if (pos.line == change.to.line) { - ch += changeEnd(change).ch - change.to.ch; + } + function reenableLogs() { + { + disabledDepth--; + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: assign({}, props, { + value: prevLog + }), + info: assign({}, props, { + value: prevInfo + }), + warn: assign({}, props, { + value: prevWarn + }), + error: assign({}, props, { + value: prevError + }), + group: assign({}, props, { + value: prevGroup + }), + groupCollapsed: assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ } - return Pos(line, ch); - } - function computeSelAfterChange(doc, change) { - var out = []; - for (var i2 = 0; i2 < doc.sel.ranges.length; i2++) { - var range2 = doc.sel.ranges[i2]; - out.push(new Range(adjustForChange(range2.anchor, change), adjustForChange(range2.head, change))); + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); } - return normalizeSelection(doc.cm, out, doc.sel.primIndex); } - function offsetPos(pos, old, nw) { - if (pos.line == old.line) { - return Pos(nw.line, pos.ch - old.ch + nw.ch); - } else { - return Pos(nw.line + (pos.line - old.line), pos.ch); - } - } - function computeReplacedSel(doc, changes, hint) { - var out = []; - var oldPrev = Pos(doc.first, 0), - newPrev = oldPrev; - for (var i2 = 0; i2 < changes.length; i2++) { - var change = changes[i2]; - var from = offsetPos(change.from, oldPrev, newPrev); - var to = offsetPos(changeEnd(change), oldPrev, newPrev); - oldPrev = change.to; - newPrev = to; - if (hint == "around") { - var range2 = doc.sel.ranges[i2], - inv = cmp(range2.head, range2.anchor) < 0; - out[i2] = new Range(inv ? to : from, inv ? from : to); - } else { - out[i2] = new Range(from, from); + } + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; } - } - return new Selection(out, doc.sel.primIndex); + } // We use the prefix to ensure our stacks line up with native stack frames. + + return '\n' + prefix + name; } - function loadMode(cm) { - cm.doc.mode = getMode(cm.options, cm.doc.modeOption); - resetModeState(cm); + } + var reentry = false; + var componentFrameCache; + { + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); + } + function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; } - function resetModeState(cm) { - cm.doc.iter(function (line) { - if (line.stateAfter) { - line.stateAfter = null; - } - if (line.styles) { - line.styles = null; - } - }); - cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; - startWorker(cm, 100); - cm.state.modeGen++; - if (cm.curOp) { - regChange(cm); + { + var frame = componentFrameCache.get(fn); + if (frame !== undefined) { + return frame; } } - function isWholeLineUpdate(doc, change) { - return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && (!doc.cm || doc.cm.options.wholeLineUpdateBefore); + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + { + previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher.current = null; + disableLogs(); } - function updateDoc(doc, change, markedSpans, estimateHeight2) { - function spansFor(n) { - return markedSpans ? markedSpans[n] : null; - } - function update(line, text2, spans) { - updateLine(line, text2, spans, estimateHeight2); - signalLater(line, "change", line, change); - } - function linesFor(start, end) { - var result = []; - for (var i2 = start; i2 < end; ++i2) { - result.push(new Line(text[i2], spansFor(i2), estimateHeight2)); - } - return result; - } - var from = change.from, - to = change.to, - text = change.text; - var firstLine = getLine(doc, from.line), - lastLine = getLine(doc, to.line); - var lastText = lst(text), - lastSpans = spansFor(text.length - 1), - nlines = to.line - from.line; - if (change.full) { - doc.insert(0, linesFor(0, text.length)); - doc.remove(text.length, doc.size - text.length); - } else if (isWholeLineUpdate(doc, change)) { - var added = linesFor(0, text.length - 1); - update(lastLine, lastLine.text, lastSpans); - if (nlines) { - doc.remove(from.line, nlines); - } - if (added.length) { - doc.insert(from.line, added); - } - } else if (firstLine == lastLine) { - if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe + + Object.defineProperty(Fake.prototype, 'props', { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + Reflect.construct(fn, [], Fake); } else { - var added$1 = linesFor(1, text.length - 1); - added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight2)); - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - doc.insert(from.line + 1, added$1); + try { + Fake.call(); + } catch (x) { + control = x; + } + fn.call(Fake.prototype); } - } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); - doc.remove(from.line + 1, nlines); } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); - var added$2 = linesFor(1, text.length - 1); - if (nlines > 1) { - doc.remove(from.line + 1, nlines - 1); + try { + throw Error(); + } catch (x) { + control = x; } - doc.insert(from.line + 1, added$2); + fn(); } - signalLater(doc, "change", doc, change); - } - function linkedDocs(doc, f, sharedHistOnly) { - function propagate(doc2, skip, sharedHist) { - if (doc2.linked) { - for (var i2 = 0; i2 < doc2.linked.length; ++i2) { - var rel = doc2.linked[i2]; - if (rel.doc == skip) { - continue; - } - var shared = sharedHist && rel.sharedHist; - if (sharedHistOnly && !shared) { - continue; + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "" + // but we have a user-provided "displayName" + // splice it in to make the stack more readable. + + if (fn.displayName && _frame.includes('')) { + _frame = _frame.replace('', fn.displayName); + } + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + return _frame; + } + } while (s >= 1 && c >= 0); } - f(rel.doc, shared); - propagate(rel.doc, doc2, shared); + break; } } } - propagate(doc, null, true); - } - function attachDoc(cm, doc) { - if (doc.cm) { - throw new Error("This document is already in use."); - } - cm.doc = doc; - doc.cm = cm; - estimateLineHeights(cm); - loadMode(cm); - setDirectionClass(cm); - cm.options.direction = doc.direction; - if (!cm.options.lineWrapping) { - findMaxLine(cm); + } finally { + reentry = false; + { + ReactCurrentDispatcher.current = previousDispatcher; + reenableLogs(); } - cm.options.mode = doc.modeOption; - regChange(cm); - } - function setDirectionClass(cm) { - (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); - } - function directionChanged(cm) { - runInOp(cm, function () { - setDirectionClass(cm); - regChange(cm); - }); - } - function History(prev) { - this.done = []; - this.undone = []; - this.undoDepth = prev ? prev.undoDepth : Infinity; - this.lastModTime = this.lastSelTime = 0; - this.lastOp = this.lastSelOp = null; - this.lastOrigin = this.lastSelOrigin = null; - this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1; - } - function historyChangeFromChange(doc, change) { - var histChange = { - from: copyPos(change.from), - to: changeEnd(change), - text: getBetween(doc, change.from, change.to) - }; - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); - linkedDocs(doc, function (doc2) { - return attachLocalSpans(doc2, histChange, change.from.line, change.to.line + 1); - }, true); - return histChange; - } - function clearSelectionEvents(array) { - while (array.length) { - var last = lst(array); - if (last.ranges) { - array.pop(); - } else { - break; - } + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); } } - function lastChangeEvent(hist, force) { - if (force) { - clearSelectionEvents(hist.done); - return lst(hist.done); - } else if (hist.done.length && !lst(hist.done).ranges) { - return lst(hist.done); - } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop(); - return lst(hist.done); - } - } - function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history; - hist.undone.length = 0; - var time = + /* @__PURE__ */new Date(), - cur; - var last; - if ((hist.lastOp == opId || hist.lastOrigin == change.origin && change.origin && (change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500) || change.origin.charAt(0) == "*")) && (cur = lastChangeEvent(hist, hist.lastOp == opId))) { - last = lst(cur.changes); - if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { - last.to = changeEnd(change); - } else { - cur.changes.push(historyChangeFromChange(doc, change)); - } - } else { - var before = lst(hist.done); - if (!before || !before.ranges) { - pushSelectionToHistory(doc.sel, hist.done); - } - cur = { - changes: [historyChangeFromChange(doc, change)], - generation: hist.generation - }; - hist.done.push(cur); - while (hist.done.length > hist.undoDepth) { - hist.done.shift(); - if (!hist.done[0].ranges) { - hist.done.shift(); - } - } - } - hist.done.push(selAfter); - hist.generation = ++hist.maxGeneration; - hist.lastModTime = hist.lastSelTime = time; - hist.lastOp = hist.lastSelOp = opId; - hist.lastOrigin = hist.lastSelOrigin = change.origin; - if (!last) { - signal(doc, "historyAdded"); - } + return syntheticFrame; + } + function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); } - function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0); - return ch == "*" || ch == "+" && prev.ranges.length == sel.ranges.length && prev.somethingSelected() == sel.somethingSelected() && /* @__PURE__ */new Date() - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); + } + function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); + } + function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + if (type == null) { + return ''; } - function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, - origin = options && options.origin; - if (opId == hist.lastSelOp || origin && hist.lastSelOrigin == origin && (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))) { - hist.done[hist.done.length - 1] = sel; - } else { - pushSelectionToHistory(sel, hist.done); - } - hist.lastSelTime = + /* @__PURE__ */new Date(); - hist.lastSelOrigin = origin; - hist.lastSelOp = opId; - if (options && options.clearRedo !== false) { - clearSelectionEvents(hist.undone); + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); } } - function pushSelectionToHistory(sel, dest) { - var top = lst(dest); - if (!(top && top.ranges && top.equals(sel))) { - dest.push(sel); - } + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); } - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], - n = 0; - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { - if (line.markedSpans) { - (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; - } - ++n; - }); + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame('Suspense'); + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); } - function removeClearedSpans(spans) { - if (!spans) { - return null; - } - var out; - for (var i2 = 0; i2 < spans.length; ++i2) { - if (spans[i2].marker.explicitlyCleared) { - if (!out) { - out = spans.slice(0, i2); + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} } - } else if (out) { - out.push(spans[i2]); - } } - return !out ? spans : out.length ? out : null; } - function getOldSpans(doc, change) { - var found = change["spans_" + doc.id]; - if (!found) { - return null; - } - var nw = []; - for (var i2 = 0; i2 < change.text.length; ++i2) { - nw.push(removeClearedSpans(found[i2])); - } - return nw; - } - function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change); - var stretched = stretchSpansOverChange(doc, change); - if (!old) { - return stretched; - } - if (!stretched) { - return old; - } - for (var i2 = 0; i2 < old.length; ++i2) { - var oldCur = old[i2], - stretchCur = stretched[i2]; - if (oldCur && stretchCur) { - spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j]; - for (var k = 0; k < oldCur.length; ++k) { - if (oldCur[k].marker == span.marker) { - continue spans; - } - } - oldCur.push(span); - } - } else if (stretchCur) { - old[i2] = stretchCur; - } + return ''; + } + var hasOwnProperty = Object.prototype.hasOwnProperty; + var loggedTypeFailures = {}; + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame.setExtraStackFrame(null); } - return old; } - function copyHistoryArray(events, newGroup, instantiateSel) { - var copy = []; - for (var i2 = 0; i2 < events.length; ++i2) { - var event = events[i2]; - if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); - continue; - } - var changes = event.changes, - newChanges = []; - copy.push({ - changes: newChanges - }); - for (var j = 0; j < changes.length; ++j) { - var change = changes[j], - m = void 0; - newChanges.push({ - from: change.from, - to: change.to, - text: change.text - }); - if (newGroup) { - for (var prop2 in change) { - if (m = prop2.match(/^spans_(\d+)$/)) { - if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop2] = change[prop2]; - delete change[prop2]; - } - } + } + function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(hasOwnProperty); + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + // eslint-disable-next-line react-internal/prod-error-codes + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; } + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; } - } - } - return copy; - } - function extendRange(range2, head, other, extend) { - if (extend) { - var anchor = range2.anchor; - if (other) { - var posBefore = cmp(head, anchor) < 0; - if (posBefore != cmp(other, anchor) < 0) { - anchor = head; - head = other; - } else if (posBefore != cmp(head, other) < 0) { - head = other; + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + setCurrentlyValidatingElement(null); + } + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + error('Failed %s type: %s', location, error$1.message); + setCurrentlyValidatingElement(null); } } - return new Range(anchor, head); - } else { - return new Range(other || head, head); - } - } - function extendSelection(doc, head, other, options, extend) { - if (extend == null) { - extend = doc.cm && (doc.cm.display.shift || doc.extend); - } - setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); - } - function extendSelections(doc, heads, options) { - var out = []; - var extend = doc.cm && (doc.cm.display.shift || doc.extend); - for (var i2 = 0; i2 < doc.sel.ranges.length; i2++) { - out[i2] = extendRange(doc.sel.ranges[i2], heads[i2], null, extend); } - var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex); - setSelection(doc, newSel, options); - } - function replaceOneSelection(doc, i2, range2, options) { - var ranges = doc.sel.ranges.slice(0); - ranges[i2] = range2; - setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options); } - function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options); - } - function filterSelectionChange(doc, sel, options) { - var obj = { - ranges: sel.ranges, - update: function (ranges) { - this.ranges = []; - for (var i2 = 0; i2 < ranges.length; i2++) { - this.ranges[i2] = new Range(clipPos(doc, ranges[i2].anchor), clipPos(doc, ranges[i2].head)); - } - }, - origin: options && options.origin - }; - signal(doc, "beforeSelectionChange", doc, obj); - if (doc.cm) { - signal(doc.cm, "beforeSelectionChange", doc.cm, obj); - } - if (obj.ranges != sel.ranges) { - return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1); - } else { - return sel; - } + } + var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + + function isArray(a) { + return isArrayImpl(a); + } + + /* + * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol + * and Temporal.* types. See https://github.com/facebook/react/pull/22064. + * + * The functions in this module will throw an easier-to-understand, + * easier-to-debug exception with a clear errors message message explaining the + * problem. (Instead of a confusing exception thrown inside the implementation + * of the `value` object). + */ + // $FlowFixMe only called in DEV, so void return is not possible. + function typeName(value) { + { + // toStringTag is needed for namespaced types like Temporal.Instant + var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; + var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; + return type; } - function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, - last = lst(done); - if (last && last.ranges) { - done[done.length - 1] = sel; - setSelectionNoUndo(doc, sel, options); - } else { - setSelection(doc, sel, options); + } // $FlowFixMe only called in DEV, so void return is not possible. + + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; } } - function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options); - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); - } - function setSelectionNoUndo(doc, sel, options) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) { - sel = filterSelectionChange(doc, sel, options); - } - var bias = options && options.bias || (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor") { - ensureCursorVisible(doc.cm); + } + function testStringCoercion(value) { + // If you ended up here by following an exception call stack, here's what's + // happened: you supplied an object or symbol value to React (as a prop, key, + // DOM attribute, CSS property, string ref, etc.) and when React tried to + // coerce it to a string using `'' + value`, an exception was thrown. + // + // The most common types that will cause this exception are `Symbol` instances + // and Temporal objects like `Temporal.Instant`. But any object that has a + // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this + // exception. (Library authors do this to prevent users from using built-in + // numeric operators like `+` or comparison operators like `>=` because custom + // methods are needed to perform accurate arithmetic or comparison.) + // + // To fix the problem, coerce this object or symbol value to a string before + // passing it to React. The most reliable way is usually `String(value)`. + // + // To find which value is throwing, check the browser or debugger console. + // Before this exception was thrown, there should be `console.error` output + // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the + // problem and how that type was used: key, atrribute, input value prop, etc. + // In most cases, this console output also shows the component and its + // ancestor components where the exception happened. + // + // eslint-disable-next-line react-internal/safe-string-coercion + return '' + value; + } + function checkKeyStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) { - return; - } - doc.sel = sel; - if (doc.cm) { - doc.cm.curOp.updateInput = 1; - doc.cm.curOp.selectionChanged = true; - signalCursorActivity(doc.cm); - } - signalLater(doc, "cursorActivity", doc); - } - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); - } - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out; - for (var i2 = 0; i2 < sel.ranges.length; i2++) { - var range2 = sel.ranges[i2]; - var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i2]; - var newAnchor = skipAtomic(doc, range2.anchor, old && old.anchor, bias, mayClear); - var newHead = skipAtomic(doc, range2.head, old && old.head, bias, mayClear); - if (out || newAnchor != range2.anchor || newHead != range2.head) { - if (!out) { - out = sel.ranges.slice(0, i2); - } - out[i2] = new Range(newAnchor, newHead); - } - } - return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel; - } - function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { - var line = getLine(doc, pos.line); - if (line.markedSpans) { - for (var i2 = 0; i2 < line.markedSpans.length; ++i2) { - var sp = line.markedSpans[i2], - m = sp.marker; - var preventCursorLeft = "selectLeft" in m ? !m.selectLeft : m.inclusiveLeft; - var preventCursorRight = "selectRight" in m ? !m.selectRight : m.inclusiveRight; - if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) { - break; - } else { - --i2; - continue; - } - } - } - if (!m.atomic) { - continue; - } - if (oldPos) { - var near = m.find(dir < 0 ? 1 : -1), - diff = void 0; - if (dir < 0 ? preventCursorRight : preventCursorLeft) { - near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); - } - if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) { - return skipAtomicInner(doc, near, pos, dir, mayClear); - } - } - var far = m.find(dir < 0 ? -1 : 1); - if (dir < 0 ? preventCursorLeft : preventCursorRight) { - far = movePos(doc, far, dir, far.line == pos.line ? line : null); - } - return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null; - } + } + var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + var specialPropKeyWarningShown; + var specialPropRefWarningShown; + var didWarnAboutStringRefs; + { + didWarnAboutStringRefs = {}; + } + function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + if (getter && getter.isReactWarning) { + return false; } } - return pos; } - function skipAtomic(doc, pos, oldPos, bias, mayClear) { - var dir = bias || 1; - var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || !mayClear && skipAtomicInner(doc, pos, oldPos, dir, true) || skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || !mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true); - if (!found) { - doc.cantEdit = true; - return Pos(doc.first, 0); + return config.ref !== undefined; + } + function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + if (getter && getter.isReactWarning) { + return false; + } } - return found; } - function movePos(doc, pos, dir, line) { - if (dir < 0 && pos.ch == 0) { - if (pos.line > doc.first) { - return clipPos(doc, Pos(pos.line - 1)); - } else { - return null; - } - } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { - if (pos.line < doc.first + doc.size - 1) { - return Pos(pos.line + 1, 0); - } else { - return null; + return config.key !== undefined; + } + function warnIfStringRefCannotBeAutoConverted(config, self) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref); + didWarnAboutStringRefs[componentName] = true; } - } else { - return new Pos(pos.line, pos.ch + dir); } } - function selectAll(cm) { - cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); - } - function filterChange(doc, change, update) { - var obj = { - canceled: false, - from: change.from, - to: change.to, - text: change.text, - origin: change.origin, - cancel: function () { - return obj.canceled = true; + } + function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); } }; - if (update) { - obj.update = function (from, to, text, origin) { - if (from) { - obj.from = clipPos(doc, from); - } - if (to) { - obj.to = clipPos(doc, to); - } - if (text) { - obj.text = text; - } - if (origin !== void 0) { - obj.origin = origin; - } - }; - } - signal(doc, "beforeChange", doc, obj); - if (doc.cm) { - signal(doc.cm, "beforeChange", doc.cm, obj); - } - if (obj.canceled) { - if (doc.cm) { - doc.cm.curOp.updateInput = 2; + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } + } + function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); } - return null; + }; + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } + } + /** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); } - return { - from: obj.from, - to: obj.to, - text: obj.text, - origin: obj.origin - }; } - function makeChange(doc, change, ignoreReadOnly) { - if (doc.cm) { - if (!doc.cm.curOp) { - return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); - } - if (doc.cm.state.suppressEdits) { - return; - } - } - if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true); - if (!change) { - return; - } - } - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); - if (split) { - for (var i2 = split.length - 1; i2 >= 0; --i2) { - makeChangeInner(doc, { - from: split[i2].from, - to: split[i2].to, - text: i2 ? [""] : change.text, - origin: change.origin - }); + return element; + }; + /** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + + function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.

+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + { + checkKeyStringCoercion(maybeKey); } - } else { - makeChangeInner(doc, change); - } - } - function makeChangeInner(doc, change) { - if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { - return; + key = '' + maybeKey; } - var selAfter = computeSelAfterChange(doc, change); - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); - var rebased = []; - linkedDocs(doc, function (doc2, sharedHist) { - if (!sharedHist && indexOf(rebased, doc2.history) == -1) { - rebaseHist(doc2.history, change); - rebased.push(doc2.history); + if (hasValidKey(config)) { + { + checkKeyStringCoercion(config.key); } - makeChangeSingleDoc(doc2, change, null, stretchSpansOverChange(doc2, change)); - }); - } - function makeChangeFromHistory(doc, type, allowSelectionOnly) { - var suppress = doc.cm && doc.cm.state.suppressEdits; - if (suppress && !allowSelectionOnly) { - return; + key = '' + config.key; } - var hist = doc.history, - event, - selAfter = doc.sel; - var source = type == "undo" ? hist.done : hist.undone, - dest = type == "undo" ? hist.undone : hist.done; - var i2 = 0; - for (; i2 < source.length; i2++) { - event = source[i2]; - if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) { - break; + if (hasValidRef(config)) { + ref = config.ref; + warnIfStringRefCannotBeAutoConverted(config, self); + } // Remaining properties are added to a new props object + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; } - } - if (i2 == source.length) { - return; - } - hist.lastOrigin = hist.lastSelOrigin = null; - for (;;) { - event = source.pop(); - if (event.ranges) { - pushSelectionToHistory(event, dest); - if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, { - clearRedo: false - }); - return; + } // Resolve default props + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; } - selAfter = event; - } else if (suppress) { - source.push(event); - return; - } else { - break; } } - var antiChanges = []; - pushSelectionToHistory(selAfter, dest); - dest.push({ - changes: antiChanges, - generation: hist.generation - }); - hist.generation = event.generation || ++hist.maxGeneration; - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); - var loop = function (i3) { - var change = event.changes[i3]; - change.origin = type; - if (filter && !filterChange(doc, change, false)) { - source.length = 0; - return {}; - } - antiChanges.push(historyChangeFromChange(doc, change)); - var after = i3 ? computeSelAfterChange(doc, change) : lst(source); - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (!i3 && doc.cm) { - doc.cm.scrollIntoView({ - from: change.from, - to: changeEnd(change) - }); + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); } - var rebased = []; - linkedDocs(doc, function (doc2, sharedHist) { - if (!sharedHist && indexOf(rebased, doc2.history) == -1) { - rebaseHist(doc2.history, change); - rebased.push(doc2.history); - } - makeChangeSingleDoc(doc2, change, null, mergeOldSpans(doc2, change)); - }); - }; - for (var i$12 = event.changes.length - 1; i$12 >= 0; --i$12) { - var returned = loop(i$12); - if (returned) return returned.v; - } - } - function shiftDoc(doc, distance) { - if (distance == 0) { - return; - } - doc.first += distance; - doc.sel = new Selection(map(doc.sel.ranges, function (range2) { - return new Range(Pos(range2.anchor.line + distance, range2.anchor.ch), Pos(range2.head.line + distance, range2.head.ch)); - }), doc.sel.primIndex); - if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance); - for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) { - regLineChange(doc.cm, l, "gutter"); + if (ref) { + defineRefPropWarningGetter(props, displayName); } } + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); } - function makeChangeSingleDoc(doc, change, selAfter, spans) { - if (doc.cm && !doc.cm.curOp) { - return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); - } - if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); - return; - } - if (change.from.line > doc.lastLine()) { - return; - } - if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line); - shiftDoc(doc, shift); - change = { - from: Pos(doc.first, 0), - to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], - origin: change.origin - }; - } - var last = doc.lastLine(); - if (change.to.line > last) { - change = { - from: change.from, - to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], - origin: change.origin - }; - } - change.removed = getBetween(doc, change.from, change.to); - if (!selAfter) { - selAfter = computeSelAfterChange(doc, change); - } - if (doc.cm) { - makeChangeSingleDocInEditor(doc.cm, change, spans); - } else { - updateDoc(doc, change, spans); - } - setSelectionNoUndo(doc, selAfter, sel_dontScroll); - if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0))) { - doc.cantEdit = false; - } - } - function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, - display = cm.display, - from = change.from, - to = change.to; - var recomputeMaxLength = false, - checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); - doc.iter(checkWidthStart, to.line + 1, function (line) { - if (line == display.maxLine) { - recomputeMaxLength = true; - return true; - } - }); - } - if (doc.sel.contains(change.from, change.to) > -1) { - signalCursorActivity(cm); - } - updateDoc(doc, change, spans, estimateHeight(cm)); - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function (line) { - var len = lineLength(line); - if (len > display.maxLineLength) { - display.maxLine = line; - display.maxLineLength = len; - display.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) { - cm.curOp.updateMaxLine = true; - } - } - retreatFrontier(doc, from.line); - startWorker(cm, 400); - var lendiff = change.text.length - (to.line - from.line) - 1; - if (change.full) { - regChange(cm); - } else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) { - regLineChange(cm, from.line, "text"); + } + var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); } else { - regChange(cm, from.line, to.line + 1, lendiff); - } - var changesHandler = hasHandler(cm, "changes"), - changeHandler = hasHandler(cm, "change"); - if (changeHandler || changesHandler) { - var obj = { - from, - to, - text: change.text, - removed: change.removed, - origin: change.origin - }; - if (changeHandler) { - signalLater(cm, "change", cm, obj); - } - if (changesHandler) { - (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); - } + ReactDebugCurrentFrame$1.setExtraStackFrame(null); } - cm.display.selForContextMenu = null; } - function replaceRange(doc, code, from, to, origin) { - var assign; - if (!to) { - to = from; - } - if (cmp(to, from) < 0) { - assign = [to, from], from = assign[0], to = assign[1]; - } - if (typeof code == "string") { - code = doc.splitLines(code); - } - makeChange(doc, { - from, - to, - text: code, - origin - }); + } + var propTypesMisspellWarningShown; + { + propTypesMisspellWarningShown = false; + } + /** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + + function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } - function rebaseHistSelSingle(pos, from, to, diff) { - if (to < pos.line) { - pos.line += diff; - } else if (from < pos.line) { - pos.line = from; - pos.ch = 0; - } - } - function rebaseHistArray(array, from, to, diff) { - for (var i2 = 0; i2 < array.length; ++i2) { - var sub = array[i2], - ok = true; - if (sub.ranges) { - if (!sub.copied) { - sub = array[i2] = sub.deepCopy(); - sub.copied = true; - } - for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); - } - continue; - } - for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { - var cur = sub.changes[j$1]; - if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch); - cur.to = Pos(cur.to.line + diff, cur.to.ch); - } else if (from <= cur.to.line) { - ok = false; - break; - } - } - if (!ok) { - array.splice(0, i2 + 1); - i2 = 0; + } + function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = getComponentNameFromType(ReactCurrentOwner$1.current.type); + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; } } + return ''; } - function rebaseHist(hist, change) { - var from = change.from.line, - to = change.to.line, - diff = change.text.length - (to - from) - 1; - rebaseHistArray(hist.done, from, to, diff); - rebaseHistArray(hist.undone, from, to, diff); - } - function changeLine(doc, handle, changeType, op) { - var no = handle, - line = handle; - if (typeof handle == "number") { - line = getLine(doc, clipLine(doc, handle)); - } else { - no = lineNo(handle); - } - if (no == null) { - return null; - } - if (op(line, no) && doc.cm) { - regLineChange(doc.cm, no, changeType); - } - return line; - } - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - var height = 0; - for (var i2 = 0; i2 < lines.length; ++i2) { - lines[i2].parent = this; - height += lines[i2].height; + } + function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; } - this.height = height; + return ''; } - LeafChunk.prototype = { - chunkSize: function () { - return this.lines.length; - }, - // Remove the n lines at offset 'at'. - removeInner: function (at, n) { - for (var i2 = at, e = at + n; i2 < e; ++i2) { - var line = this.lines[i2]; - this.height -= line.height; - cleanUpLine(line); - signalLater(line, "delete"); - } - this.lines.splice(at, n); - }, - // Helper used to collapse a small branch into a single leaf. - collapse: function (lines) { - lines.push.apply(lines, this.lines); - }, - // Insert the given array of lines at offset 'at', count them as - // having the given height. - insertInner: function (at, lines, height) { - this.height += height; - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i2 = 0; i2 < lines.length; ++i2) { - lines[i2].parent = this; - } - }, - // Used to iterate over a part of the tree. - iterN: function (at, n, op) { - for (var e = at + n; at < e; ++at) { - if (op(this.lines[at])) { - return true; - } - } - } - }; - function BranchChunk(children) { - this.children = children; - var size = 0, - height = 0; - for (var i2 = 0; i2 < children.length; ++i2) { - var ch = children[i2]; - size += ch.chunkSize(); - height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - BranchChunk.prototype = { - chunkSize: function () { - return this.size; - }, - removeInner: function (at, n) { - this.size -= n; - for (var i2 = 0; i2 < this.children.length; ++i2) { - var child = this.children[i2], - sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), - oldHeight = child.height; - child.removeInner(at, rm); - this.height -= oldHeight - child.height; - if (sz == rm) { - this.children.splice(i2--, 1); - child.parent = null; - } - if ((n -= rm) == 0) { - break; - } - at = 0; - } else { - at -= sz; - } - } - if (this.size - n < 25 && (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - collapse: function (lines) { - for (var i2 = 0; i2 < this.children.length; ++i2) { - this.children[i2].collapse(lines); - } - }, - insertInner: function (at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i2 = 0; i2 < this.children.length; ++i2) { - var child = this.children[i2], - sz = child.chunkSize(); - if (at <= sz) { - child.insertInner(at, lines, height); - if (child.lines && child.lines.length > 50) { - var remaining = child.lines.length % 25 + 25; - for (var pos = remaining; pos < child.lines.length;) { - var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); - child.height -= leaf.height; - this.children.splice(++i2, 0, leaf); - leaf.parent = this; - } - child.lines = child.lines.slice(0, remaining); - this.maybeSpill(); - } - break; - } - at -= sz; - } - }, - // When a node has grown, check whether it should be split. - maybeSpill: function () { - if (this.children.length <= 10) { - return; - } - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10); - me.parent.maybeSpill(); - }, - iterN: function (at, n, op) { - for (var i2 = 0; i2 < this.children.length; ++i2) { - var child = this.children[i2], - sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) { - return true; - } - if ((n -= used) == 0) { - break; - } - at = 0; - } else { - at -= sz; - } - } - } - }; - var LineWidget = function (doc, node, options) { - if (options) { - for (var opt in options) { - if (options.hasOwnProperty(opt)) { - this[opt] = options[opt]; - } + } + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + var ownerHasKeyUseWarning = {}; + function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; } } - this.doc = doc; - this.node = node; - }; - LineWidget.prototype.clear = function () { - var cm = this.doc.cm, - ws = this.line.widgets, - line = this.line, - no = lineNo(line); - if (no == null || !ws) { + return info; + } + } + /** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { return; } - for (var i2 = 0; i2 < ws.length; ++i2) { - if (ws[i2] == this) { - ws.splice(i2--, 1); - } - } - if (!ws.length) { - line.widgets = null; - } - var height = widgetHeight(this); - updateLineHeight(line, Math.max(0, line.height - height)); - if (cm) { - runInOp(cm, function () { - adjustScrollWhenAboveVisible(cm, line, -height); - regLineChange(cm, no, "widget"); - }); - signalLater(cm, "lineWidgetCleared", cm, this, no); - } - }; - LineWidget.prototype.changed = function () { - var this$1$1 = this; - var oldH = this.height, - cm = this.doc.cm, - line = this.line; - this.height = null; - var diff = widgetHeight(this) - oldH; - if (!diff) { + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } - if (!lineIsHidden(this.doc, line)) { - updateLineHeight(line, line.height + diff); - } - if (cm) { - runInOp(cm, function () { - cm.curOp.forceUpdate = true; - adjustScrollWhenAboveVisible(cm, line, diff); - signalLater(cm, "lineWidgetChanged", cm, this$1$1, lineNo(line)); - }); - } - }; - eventMixin(LineWidget); - function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < (cm.curOp && cm.curOp.scrollTop || cm.doc.scrollTop)) { - addToScrollTop(cm, diff); - } - } - function addLineWidget(doc, handle, node, options) { - var widget = new LineWidget(doc, node, options); - var cm = doc.cm; - if (cm && widget.noHScroll) { - cm.display.alignWidgets = true; - } - changeLine(doc, handle, "widget", function (line) { - var widgets = line.widgets || (line.widgets = []); - if (widget.insertAt == null) { - widgets.push(widget); - } else { - widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); - } - widget.line = line; - if (cm && !lineIsHidden(doc, line)) { - var aboveVisible = heightAtLine(line) < doc.scrollTop; - updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) { - addToScrollTop(cm, widget.height); - } - cm.curOp.forceUpdate = true; - } - return true; - }); - if (cm) { - signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; } - return widget; + setCurrentlyValidatingElement$1(element); + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + setCurrentlyValidatingElement$1(null); } - var nextMarkerId = 0; - var TextMarker = function (doc, type) { - this.lines = []; - this.type = type; - this.doc = doc; - this.id = ++nextMarkerId; - }; - TextMarker.prototype.clear = function () { - if (this.explicitlyCleared) { - return; - } - var cm = this.doc.cm, - withOp = cm && !cm.curOp; - if (withOp) { - startOperation(cm); - } - if (hasHandler(this, "clear")) { - var found = this.find(); - if (found) { - signalLater(this, "clear", found.from, found.to); - } - } - var min = null, - max = null; - for (var i2 = 0; i2 < this.lines.length; ++i2) { - var line = this.lines[i2]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (cm && !this.collapsed) { - regLineChange(cm, lineNo(line), "text"); - } else if (cm) { - if (span.to != null) { - max = lineNo(line); - } - if (span.from != null) { - min = lineNo(line); - } - } - line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) { - updateLineHeight(line, textHeight(cm.display)); - } - } - if (cm && this.collapsed && !cm.options.lineWrapping) { - for (var i$12 = 0; i$12 < this.lines.length; ++i$12) { - var visual = visualLine(this.lines[i$12]), - len = lineLength(visual); - if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual; - cm.display.maxLineLength = len; - cm.display.maxLineChanged = true; - } - } - } - if (min != null && cm && this.collapsed) { - regChange(cm, min, max + 1); - } - this.lines.length = 0; - this.explicitlyCleared = true; - if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false; - if (cm) { - reCheckSelection(cm.doc); - } - } - if (cm) { - signalLater(cm, "markerCleared", cm, this, min, max); - } - if (withOp) { - endOperation(cm); - } - if (this.parent) { - this.parent.clear(); - } - }; - TextMarker.prototype.find = function (side, lineObj) { - if (side == null && this.type == "bookmark") { - side = 1; - } - var from, to; - for (var i2 = 0; i2 < this.lines.length; ++i2) { - var line = this.lines[i2]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from); - if (side == -1) { - return from; - } - } - if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to); - if (side == 1) { - return to; - } - } - } - return from && { - from, - to - }; - }; - TextMarker.prototype.changed = function () { - var this$1$1 = this; - var pos = this.find(-1, true), - widget = this, - cm = this.doc.cm; - if (!pos || !cm) { + } + /** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { return; } - runInOp(cm, function () { - var line = pos.line, - lineN = lineNo(pos.line); - var view = findViewForLine(cm, lineN); - if (view) { - clearLineMeasurementCacheFor(view); - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; - } - cm.curOp.updateMaxLine = true; - if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height; - widget.height = null; - var dHeight = widgetHeight(widget) - oldHeight; - if (dHeight) { - updateLineHeight(line, line.height + dHeight); - } - } - signalLater(cm, "markerChanged", cm, this$1$1); - }); - }; - TextMarker.prototype.attachLine = function (line) { - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) { - (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); - } - } - this.lines.push(line); - }; - TextMarker.prototype.detachLine = function (line) { - this.lines.splice(indexOf(this.lines, line), 1); - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); - } - }; - eventMixin(TextMarker); - function markText(doc, from, to, options, type) { - if (options && options.shared) { - return markTextShared(doc, from, to, options, type); - } - if (doc.cm && !doc.cm.curOp) { - return operation(doc.cm, markText)(doc, from, to, options, type); - } - var marker = new TextMarker(doc, type), - diff = cmp(from, to); - if (options) { - copyObj(options, marker, false); - } - if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) { - return marker; - } - if (marker.replacedWith) { - marker.collapsed = true; - marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); - if (!options.handleMouseEvents) { - marker.widgetNode.setAttribute("cm-ignore-events", "true"); - } - if (options.insertLeft) { - marker.widgetNode.insertLeft = true; - } - } - if (marker.collapsed) { - if (conflictingCollapsedRange(doc, from.line, from, to, marker) || from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) { - throw new Error("Inserting collapsed marker partially overlapping an existing one"); - } - seeCollapsedSpans(); - } - if (marker.addToHistory) { - addChangeToHistory(doc, { - from, - to, - origin: "markText" - }, doc.sel, NaN); - } - var curLine = from.line, - cm = doc.cm, - updateMaxLine; - doc.iter(curLine, to.line + 1, function (line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) { - updateMaxLine = true; - } - if (marker.collapsed && curLine != from.line) { - updateLineHeight(line, 0); - } - addMarkedSpan(line, new MarkedSpan(marker, curLine == from.line ? from.ch : null, curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp); - ++curLine; - }); - if (marker.collapsed) { - doc.iter(from.line, to.line + 1, function (line) { - if (lineIsHidden(doc, line)) { - updateLineHeight(line, 0); + if (isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + if (isValidElement(child)) { + validateExplicitKey(child, parentType); } - }); - } - if (marker.clearOnEnter) { - on(marker, "beforeCursorEnter", function () { - return marker.clear(); - }); - } - if (marker.readOnly) { - seeReadOnlySpans(); - if (doc.history.done.length || doc.history.undone.length) { - doc.clearHistory(); } - } - if (marker.collapsed) { - marker.id = ++nextMarkerId; - marker.atomic = true; - } - if (cm) { - if (updateMaxLine) { - cm.curOp.updateMaxLine = true; + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; } - if (marker.collapsed) { - regChange(cm, from.line, to.line + 1); - } else if (marker.className || marker.startStyle || marker.endStyle || marker.css || marker.attributes || marker.title) { - for (var i2 = from.line; i2 <= to.line; i2++) { - regLineChange(cm, i2, "text"); + } else if (node) { + var iteratorFn = getIteratorFn(node); + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } } } - if (marker.atomic) { - reCheckSelection(cm.doc); - } - signalLater(cm, "markerAdded", cm, marker); } - return marker; } - var SharedTextMarker = function (markers, primary) { - this.markers = markers; - this.primary = primary; - for (var i2 = 0; i2 < markers.length; ++i2) { - markers[i2].parent = this; + } + /** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + function validatePropTypes(element) { + { + var type = element.type; + if (type === null || type === undefined || typeof type === 'string') { + return; } - }; - SharedTextMarker.prototype.clear = function () { - if (this.explicitlyCleared) { + var propTypes; + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || + // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { return; } - this.explicitlyCleared = true; - for (var i2 = 0; i2 < this.markers.length; ++i2) { - this.markers[i2].clear(); + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentNameFromType(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentNameFromType(type); + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); } - signalLater(this, "clear"); - }; - SharedTextMarker.prototype.find = function (side, lineObj) { - return this.primary.find(side, lineObj); - }; - eventMixin(SharedTextMarker); - function markTextShared(doc, from, to, options, type) { - options = copyObj(options); - options.shared = false; - var markers = [markText(doc, from, to, options, type)], - primary = markers[0]; - var widget = options.widgetNode; - linkedDocs(doc, function (doc2) { - if (widget) { - options.widgetNode = widget.cloneNode(true); - } - markers.push(markText(doc2, clipPos(doc2, from), clipPos(doc2, to), options, type)); - for (var i2 = 0; i2 < doc2.linked.length; ++i2) { - if (doc2.linked[i2].isParent) { - return; - } - } - primary = lst(markers); - }); - return new SharedTextMarker(markers, primary); - } - function findSharedMarkers(doc) { - return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { - return m.parent; - }); - } - function copySharedMarkers(doc, markers) { - for (var i2 = 0; i2 < markers.length; i2++) { - var marker = markers[i2], - pos = marker.find(); - var mFrom = doc.clipPos(pos.from), - mTo = doc.clipPos(pos.to); - if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); - marker.markers.push(subMark); - subMark.parent = marker; - } + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); } } - function detachSharedMarkers(markers) { - var loop = function (i3) { - var marker = markers[i3], - linked = [marker.primary.doc]; - linkedDocs(marker.primary.doc, function (d) { - return linked.push(d); - }); - for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j]; - if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null; - marker.markers.splice(j--, 1); - } - } - }; - for (var i2 = 0; i2 < markers.length; i2++) loop(i2); - } - var nextDocId = 0; - var Doc = function (text, mode, firstLine, lineSep, direction) { - if (!(this instanceof Doc)) { - return new Doc(text, mode, firstLine, lineSep, direction); - } - if (firstLine == null) { - firstLine = 0; - } - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); - this.first = firstLine; - this.scrollTop = this.scrollLeft = 0; - this.cantEdit = false; - this.cleanGeneration = 1; - this.modeFrontier = this.highlightFrontier = firstLine; - var start = Pos(firstLine, 0); - this.sel = simpleSelection(start); - this.history = new History(null); - this.id = ++nextDocId; - this.modeOption = mode; - this.lineSep = lineSep; - this.direction = direction == "rtl" ? "rtl" : "ltr"; - this.extend = false; - if (typeof text == "string") { - text = this.splitLines(text); - } - updateDoc(this, { - from: start, - to: start, - text - }); - setSelection(this, simpleSelection(start), sel_dontScroll); - }; - Doc.prototype = createObj(BranchChunk.prototype, { - constructor: Doc, - // Iterate over the document. Supports two forms -- with only one - // argument, it calls that for each line in the document. With - // three, it iterates over the range given by the first two (with - // the second being non-inclusive). - iter: function (from, to, op) { - if (op) { - this.iterN(from - this.first, to - from, op); - } else { - this.iterN(this.first, this.first + this.size, from); - } - }, - // Non-public interface for adding and removing lines. - insert: function (at, lines) { - var height = 0; - for (var i2 = 0; i2 < lines.length; ++i2) { - height += lines[i2].height; - } - this.insertInner(at - this.first, lines, height); - }, - remove: function (at, n) { - this.removeInner(at - this.first, n); - }, - // From here, the methods are part of the public interface. Most - // are also available from CodeMirror (editor) instances. - getValue: function (lineSep) { - var lines = getLines(this, this.first, this.first + this.size); - if (lineSep === false) { - return lines; - } - return lines.join(lineSep || this.lineSeparator()); - }, - setValue: docMethodOp(function (code) { - var top = Pos(this.first, 0), - last = this.first + this.size - 1; - makeChange(this, { - from: top, - to: Pos(last, getLine(this, last).text.length), - text: this.splitLines(code), - origin: "setValue", - full: true - }, true); - if (this.cm) { - scrollToCoords(this.cm, 0, 0); - } - setSelection(this, simpleSelection(top), sel_dontScroll); - }), - replaceRange: function (code, from, to, origin) { - from = clipPos(this, from); - to = to ? clipPos(this, to) : from; - replaceRange(this, code, from, to, origin); - }, - getRange: function (from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); - if (lineSep === false) { - return lines; - } - if (lineSep === "") { - return lines.join(""); - } - return lines.join(lineSep || this.lineSeparator()); - }, - getLine: function (line) { - var l = this.getLineHandle(line); - return l && l.text; - }, - getLineHandle: function (line) { - if (isLine(this, line)) { - return getLine(this, line); - } - }, - getLineNumber: function (line) { - return lineNo(line); - }, - getLineHandleVisualStart: function (line) { - if (typeof line == "number") { - line = getLine(this, line); - } - return visualLine(line); - }, - lineCount: function () { - return this.size; - }, - firstLine: function () { - return this.first; - }, - lastLine: function () { - return this.first + this.size - 1; - }, - clipPos: function (pos) { - return clipPos(this, pos); - }, - getCursor: function (start) { - var range2 = this.sel.primary(), - pos; - if (start == null || start == "head") { - pos = range2.head; - } else if (start == "anchor") { - pos = range2.anchor; - } else if (start == "end" || start == "to" || start === false) { - pos = range2.to(); - } else { - pos = range2.from(); - } - return pos; - }, - listSelections: function () { - return this.sel.ranges; - }, - somethingSelected: function () { - return this.sel.somethingSelected(); - }, - setCursor: docMethodOp(function (line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); - }), - setSelection: docMethodOp(function (anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); - }), - extendSelection: docMethodOp(function (head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); - }), - extendSelections: docMethodOp(function (heads, options) { - extendSelections(this, clipPosArray(this, heads), options); - }), - extendSelectionsBy: docMethodOp(function (f, options) { - var heads = map(this.sel.ranges, f); - extendSelections(this, clipPosArray(this, heads), options); - }), - setSelections: docMethodOp(function (ranges, primary, options) { - if (!ranges.length) { - return; - } - var out = []; - for (var i2 = 0; i2 < ranges.length; i2++) { - out[i2] = new Range(clipPos(this, ranges[i2].anchor), clipPos(this, ranges[i2].head || ranges[i2].anchor)); - } - if (primary == null) { - primary = Math.min(ranges.length - 1, this.sel.primIndex); - } - setSelection(this, normalizeSelection(this.cm, out, primary), options); - }), - addSelection: docMethodOp(function (anchor, head, options) { - var ranges = this.sel.ranges.slice(0); - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); - setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options); - }), - getSelection: function (lineSep) { - var ranges = this.sel.ranges, - lines; - for (var i2 = 0; i2 < ranges.length; i2++) { - var sel = getBetween(this, ranges[i2].from(), ranges[i2].to()); - lines = lines ? lines.concat(sel) : sel; - } - if (lineSep === false) { - return lines; - } else { - return lines.join(lineSep || this.lineSeparator()); - } - }, - getSelections: function (lineSep) { - var parts = [], - ranges = this.sel.ranges; - for (var i2 = 0; i2 < ranges.length; i2++) { - var sel = getBetween(this, ranges[i2].from(), ranges[i2].to()); - if (lineSep !== false) { - sel = sel.join(lineSep || this.lineSeparator()); - } - parts[i2] = sel; - } - return parts; - }, - replaceSelection: function (code, collapse, origin) { - var dup = []; - for (var i2 = 0; i2 < this.sel.ranges.length; i2++) { - dup[i2] = code; - } - this.replaceSelections(dup, collapse, origin || "+input"); - }, - replaceSelections: docMethodOp(function (code, collapse, origin) { - var changes = [], - sel = this.sel; - for (var i2 = 0; i2 < sel.ranges.length; i2++) { - var range2 = sel.ranges[i2]; - changes[i2] = { - from: range2.from(), - to: range2.to(), - text: this.splitLines(code[i2]), - origin - }; - } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); - for (var i$12 = changes.length - 1; i$12 >= 0; i$12--) { - makeChange(this, changes[i$12]); - } - if (newSel) { - setSelectionReplaceHistory(this, newSel); - } else if (this.cm) { - ensureCursorVisible(this.cm); - } - }), - undo: docMethodOp(function () { - makeChangeFromHistory(this, "undo"); - }), - redo: docMethodOp(function () { - makeChangeFromHistory(this, "redo"); - }), - undoSelection: docMethodOp(function () { - makeChangeFromHistory(this, "undo", true); - }), - redoSelection: docMethodOp(function () { - makeChangeFromHistory(this, "redo", true); - }), - setExtending: function (val) { - this.extend = val; - }, - getExtending: function () { - return this.extend; - }, - historySize: function () { - var hist = this.history, - done = 0, - undone = 0; - for (var i2 = 0; i2 < hist.done.length; i2++) { - if (!hist.done[i2].ranges) { - ++done; - } - } - for (var i$12 = 0; i$12 < hist.undone.length; i$12++) { - if (!hist.undone[i$12].ranges) { - ++undone; - } + } + /** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + setCurrentlyValidatingElement$1(null); + break; } - return { - undo: done, - redo: undone - }; - }, - clearHistory: function () { - var this$1$1 = this; - this.history = new History(this.history); - linkedDocs(this, function (doc) { - return doc.history = this$1$1.history; - }, true); - }, - markClean: function () { - this.cleanGeneration = this.changeGeneration(true); - }, - changeGeneration: function (forceSplit) { - if (forceSplit) { - this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; + } + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + setCurrentlyValidatingElement$1(null); + } + } + } + function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; } - return this.history.generation; - }, - isClean: function (gen) { - return this.history.generation == (gen || this.cleanGeneration); - }, - getHistory: function () { - return { - done: copyHistoryArray(this.history.done), - undone: copyHistoryArray(this.history.undone) - }; - }, - setHistory: function (histData) { - var hist = this.history = new History(this.history); - hist.done = copyHistoryArray(histData.done.slice(0), null, true); - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); - }, - setGutterMarker: docMethodOp(function (line, gutterID, value) { - return changeLine(this, line, "gutter", function (line2) { - var markers = line2.gutterMarkers || (line2.gutterMarkers = {}); - markers[gutterID] = value; - if (!value && isEmpty(markers)) { - line2.gutterMarkers = null; - } - return true; - }); - }), - clearGutter: docMethodOp(function (gutterID) { - var this$1$1 = this; - this.iter(function (line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - changeLine(this$1$1, line, "gutter", function () { - line.gutterMarkers[gutterID] = null; - if (isEmpty(line.gutterMarkers)) { - line.gutterMarkers = null; - } - return true; - }); - } - }); - }), - lineInfo: function (line) { - var n; - if (typeof line == "number") { - if (!isLine(this, line)) { - return null; - } - n = line; - line = getLine(this, line); - if (!line) { - return null; - } + var sourceInfo = getSourceInfoErrorAddendum(source); + if (sourceInfo) { + info += sourceInfo; } else { - n = lineNo(line); - if (n == null) { - return null; - } + info += getDeclarationErrorAddendum(); } - return { - line: n, - handle: line, - text: line.text, - gutterMarkers: line.gutterMarkers, - textClass: line.textClass, - bgClass: line.bgClass, - wrapClass: line.wrapClass, - widgets: line.widgets - }; - }, - addLineClass: docMethodOp(function (handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop2 = where == "text" ? "textClass" : where == "background" ? "bgClass" : where == "gutter" ? "gutterClass" : "wrapClass"; - if (!line[prop2]) { - line[prop2] = cls; - } else if (classTest(cls).test(line[prop2])) { - return false; - } else { - line[prop2] += " " + cls; - } - return true; - }); - }), - removeLineClass: docMethodOp(function (handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop2 = where == "text" ? "textClass" : where == "background" ? "bgClass" : where == "gutter" ? "gutterClass" : "wrapClass"; - var cur = line[prop2]; - if (!cur) { - return false; - } else if (cls == null) { - line[prop2] = null; - } else { - var found = cur.match(classTest(cls)); - if (!found) { - return false; - } - var end = found.index + found[0].length; - line[prop2] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; - } - return true; - }); - }), - addLineWidget: docMethodOp(function (handle, node, options) { - return addLineWidget(this, handle, node, options); - }), - removeLineWidget: function (widget) { - widget.clear(); - }, - markText: function (from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range"); - }, - setBookmark: function (pos, options) { - var realOpts = { - replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, - clearWhenEmpty: false, - shared: options && options.shared, - handleMouseEvents: options && options.handleMouseEvents - }; - pos = clipPos(this, pos); - return markText(this, pos, pos, realOpts, "bookmark"); - }, - findMarksAt: function (pos) { - pos = clipPos(this, pos); - var markers = [], - spans = getLine(this, pos.line).markedSpans; - if (spans) { - for (var i2 = 0; i2 < spans.length; ++i2) { - var span = spans[i2]; - if ((span.from == null || span.from <= pos.ch) && (span.to == null || span.to >= pos.ch)) { - markers.push(span.marker.parent || span.marker); - } - } + var typeString; + if (type === null) { + typeString = 'null'; + } else if (isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; } - return markers; - }, - findMarks: function (from, to, filter) { - from = clipPos(this, from); - to = clipPos(this, to); - var found = [], - lineNo2 = from.line; - this.iter(from.line, to.line + 1, function (line) { - var spans = line.markedSpans; - if (spans) { - for (var i2 = 0; i2 < spans.length; i2++) { - var span = spans[i2]; - if (!(span.to != null && lineNo2 == from.line && from.ch >= span.to || span.from == null && lineNo2 != from.line || span.from != null && lineNo2 == to.line && span.from >= to.ch) && (!filter || filter(span.marker))) { - found.push(span.marker.parent || span.marker); + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + if (validType) { + var children = props.children; + if (children !== undefined) { + if (isStaticChildren) { + if (isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); } - } - } - ++lineNo2; - }); - return found; - }, - getAllMarks: function () { - var markers = []; - this.iter(function (line) { - var sps = line.markedSpans; - if (sps) { - for (var i2 = 0; i2 < sps.length; ++i2) { - if (sps[i2].from != null) { - markers.push(sps[i2].marker); + if (Object.freeze) { + Object.freeze(children); } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); } + } else { + validateChildKeys(children, type); } - }); - return markers; - }, - posFromIndex: function (off2) { - var ch, - lineNo2 = this.first, - sepSize = this.lineSeparator().length; - this.iter(function (line) { - var sz = line.text.length + sepSize; - if (sz > off2) { - ch = off2; - return true; - } - off2 -= sz; - ++lineNo2; - }); - return clipPos(this, Pos(lineNo2, ch)); - }, - indexFromPos: function (coords) { - coords = clipPos(this, coords); - var index = coords.ch; - if (coords.line < this.first || coords.ch < 0) { - return 0; - } - var sepSize = this.lineSeparator().length; - this.iter(this.first, coords.line, function (line) { - index += line.text.length + sepSize; - }); - return index; - }, - copy: function (copyHistory) { - var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction); - doc.scrollTop = this.scrollTop; - doc.scrollLeft = this.scrollLeft; - doc.sel = this.sel; - doc.extend = false; - if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth; - doc.setHistory(this.getHistory()); - } - return doc; - }, - linkedDoc: function (options) { - if (!options) { - options = {}; - } - var from = this.first, - to = this.first + this.size; - if (options.from != null && options.from > from) { - from = options.from; - } - if (options.to != null && options.to < to) { - to = options.to; - } - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); - if (options.sharedHist) { - copy.history = this.history; - } - (this.linked || (this.linked = [])).push({ - doc: copy, - sharedHist: options.sharedHist - }); - copy.linked = [{ - doc: this, - isParent: true, - sharedHist: options.sharedHist - }]; - copySharedMarkers(copy, findSharedMarkers(this)); - return copy; - }, - unlinkDoc: function (other) { - if (other instanceof CodeMirror) { - other = other.doc; - } - if (this.linked) { - for (var i2 = 0; i2 < this.linked.length; ++i2) { - var link = this.linked[i2]; - if (link.doc != other) { - continue; - } - this.linked.splice(i2, 1); - other.unlinkDoc(this); - detachSharedMarkers(findSharedMarkers(this)); - break; - } - } - if (other.history == this.history) { - var splitIds = [other.id]; - linkedDocs(other, function (doc) { - return splitIds.push(doc.id); - }, true); - other.history = new History(null); - other.history.done = copyHistoryArray(this.history.done, splitIds); - other.history.undone = copyHistoryArray(this.history.undone, splitIds); - } - }, - iterLinkedDocs: function (f) { - linkedDocs(this, f); - }, - getMode: function () { - return this.mode; - }, - getEditor: function () { - return this.cm; - }, - splitLines: function (str) { - if (this.lineSep) { - return str.split(this.lineSep); - } - return splitLinesAuto(str); - }, - lineSeparator: function () { - return this.lineSep || "\n"; - }, - setDirection: docMethodOp(function (dir) { - if (dir != "rtl") { - dir = "ltr"; - } - if (dir == this.direction) { - return; - } - this.direction = dir; - this.iter(function (line) { - return line.order = null; - }); - if (this.cm) { - directionChanged(this.cm); } - }) + } + if (type === REACT_FRAGMENT_TYPE) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + return element; + } + } // These two functions exist to still get child warnings in dev + // even with the prod transform. This means that jsxDEV is purely + // opt-in behavior for better messages but that we won't stop + // giving you warnings if you use production apis. + + function jsxWithValidationStatic(type, props, key) { + { + return jsxWithValidation(type, props, key, true); + } + } + function jsxWithValidationDynamic(type, props, key) { + { + return jsxWithValidation(type, props, key, false); + } + } + var jsx = jsxWithValidationDynamic; // we may want to special case jsxs internally to take advantage of static children. + // for now we can ship identical prod functions + + var jsxs = jsxWithValidationStatic; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.jsx = jsx; + exports.jsxs = jsxs; + })(); +} + +/***/ }), + +/***/ "../../../node_modules/react/jsx-runtime.js": +/*!**************************************************!*\ + !*** ../../../node_modules/react/jsx-runtime.js ***! + \**************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +if (false) {} else { + module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "../../../node_modules/react/cjs/react-jsx-runtime.development.js"); +} + +/***/ }), + +/***/ "../../../node_modules/set-value/index.js": +/*!************************************************!*\ + !*** ../../../node_modules/set-value/index.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/*! + * set-value + * + * Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert). + * Released under the MIT License. + */ + + + +const { + deleteProperty +} = Reflect; +const isPrimitive = __webpack_require__(/*! is-primitive */ "../../../node_modules/is-primitive/index.js"); +const isPlainObject = __webpack_require__(/*! is-plain-object */ "../../../node_modules/is-plain-object/index.js"); +const isObject = value => { + return typeof value === 'object' && value !== null || typeof value === 'function'; +}; +const isUnsafeKey = key => { + return key === '__proto__' || key === 'constructor' || key === 'prototype'; +}; +const validateKey = key => { + if (!isPrimitive(key)) { + throw new TypeError('Object keys must be strings or symbols'); + } + if (isUnsafeKey(key)) { + throw new Error(`Cannot set unsafe key: "${key}"`); + } +}; +const toStringKey = input => { + return Array.isArray(input) ? input.flat().map(String).join(',') : input; +}; +const createMemoKey = (input, options) => { + if (typeof input !== 'string' || !options) return input; + let key = input + ';'; + if (options.arrays !== undefined) key += `arrays=${options.arrays};`; + if (options.separator !== undefined) key += `separator=${options.separator};`; + if (options.split !== undefined) key += `split=${options.split};`; + if (options.merge !== undefined) key += `merge=${options.merge};`; + if (options.preservePaths !== undefined) key += `preservePaths=${options.preservePaths};`; + return key; +}; +const memoize = (input, options, fn) => { + const key = toStringKey(options ? createMemoKey(input, options) : input); + validateKey(key); + const value = setValue.cache.get(key) || fn(); + setValue.cache.set(key, value); + return value; +}; +const splitString = (input, options = {}) => { + const sep = options.separator || '.'; + const preserve = sep === '/' ? false : options.preservePaths; + if (typeof input === 'string' && preserve !== false && /\//.test(input)) { + return [input]; + } + const parts = []; + let part = ''; + const push = part => { + let number; + if (part.trim() !== '' && Number.isInteger(number = Number(part))) { + parts.push(number); + } else { + parts.push(part); + } + }; + for (let i = 0; i < input.length; i++) { + const value = input[i]; + if (value === '\\') { + part += input[++i]; + continue; + } + if (value === sep) { + push(part); + part = ''; + continue; + } + part += value; + } + if (part) { + push(part); + } + return parts; +}; +const split = (input, options) => { + if (options && typeof options.split === 'function') return options.split(input); + if (typeof input === 'symbol') return [input]; + if (Array.isArray(input)) return input; + return memoize(input, options, () => splitString(input, options)); +}; +const assignProp = (obj, prop, value, options) => { + validateKey(prop); + + // Delete property when "value" is undefined + if (value === undefined) { + deleteProperty(obj, prop); + } else if (options && options.merge) { + const merge = options.merge === 'function' ? options.merge : Object.assign; + + // Only merge plain objects + if (merge && isPlainObject(obj[prop]) && isPlainObject(value)) { + obj[prop] = merge(obj[prop], value); + } else { + obj[prop] = value; + } + } else { + obj[prop] = value; + } + return obj; +}; +const setValue = (target, path, value, options) => { + if (!path || !isObject(target)) return target; + const keys = split(path, options); + let obj = target; + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const next = keys[i + 1]; + validateKey(key); + if (next === undefined) { + assignProp(obj, key, value, options); + break; + } + if (typeof next === 'number' && !Array.isArray(obj[key])) { + obj = obj[key] = []; + continue; + } + if (!isObject(obj[key])) { + obj[key] = {}; + } + obj = obj[key]; + } + return target; +}; +setValue.split = split; +setValue.cache = new Map(); +setValue.clear = () => { + setValue.cache = new Map(); +}; +module.exports = setValue; + +/***/ }), + +/***/ "../../../node_modules/style-value-types/dist/valueTypes.cjs.js": +/*!**********************************************************************!*\ + !*** ../../../node_modules/style-value-types/dist/valueTypes.cjs.js ***! + \**********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +const clamp = (min, max) => v => Math.max(Math.min(v, max), min); +const sanitize = v => v % 1 ? Number(v.toFixed(5)) : v; +const floatRegex = /(-)?([\d]*\.?[\d])+/g; +const colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi; +const singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i; +function isString(v) { + return typeof v === 'string'; +} +const number = { + test: v => typeof v === 'number', + parse: parseFloat, + transform: v => v +}; +const alpha = Object.assign(Object.assign({}, number), { + transform: clamp(0, 1) +}); +const scale = Object.assign(Object.assign({}, number), { + default: 1 +}); +const createUnitType = unit => ({ + test: v => isString(v) && v.endsWith(unit) && v.split(' ').length === 1, + parse: parseFloat, + transform: v => `${v}${unit}` +}); +const degrees = createUnitType('deg'); +const percent = createUnitType('%'); +const px = createUnitType('px'); +const vh = createUnitType('vh'); +const vw = createUnitType('vw'); +const progressPercentage = Object.assign(Object.assign({}, percent), { + parse: v => percent.parse(v) / 100, + transform: v => percent.transform(v * 100) +}); +const isColorString = (type, testProp) => v => { + return Boolean(isString(v) && singleColorRegex.test(v) && v.startsWith(type) || testProp && Object.prototype.hasOwnProperty.call(v, testProp)); +}; +const splitColor = (aName, bName, cName) => v => { + if (!isString(v)) return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1 + }; +}; +const hsla = { + test: isColorString('hsl', 'hue'), + parse: splitColor('hue', 'saturation', 'lightness'), + transform: ({ + hue, + saturation, + lightness, + alpha: alpha$1 = 1 + }) => { + return 'hsla(' + Math.round(hue) + ', ' + percent.transform(sanitize(saturation)) + ', ' + percent.transform(sanitize(lightness)) + ', ' + sanitize(alpha.transform(alpha$1)) + ')'; + } +}; +const clampRgbUnit = clamp(0, 255); +const rgbUnit = Object.assign(Object.assign({}, number), { + transform: v => Math.round(clampRgbUnit(v)) +}); +const rgba = { + test: isColorString('rgb', 'red'), + parse: splitColor('red', 'green', 'blue'), + transform: ({ + red, + green, + blue, + alpha: alpha$1 = 1 + }) => 'rgba(' + rgbUnit.transform(red) + ', ' + rgbUnit.transform(green) + ', ' + rgbUnit.transform(blue) + ', ' + sanitize(alpha.transform(alpha$1)) + ')' +}; +function parseHex(v) { + let r = ''; + let g = ''; + let b = ''; + let a = ''; + if (v.length > 5) { + r = v.substr(1, 2); + g = v.substr(3, 2); + b = v.substr(5, 2); + a = v.substr(7, 2); + } else { + r = v.substr(1, 1); + g = v.substr(2, 1); + b = v.substr(3, 1); + a = v.substr(4, 1); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1 + }; +} +const hex = { + test: isColorString('#'), + parse: parseHex, + transform: rgba.transform +}; +const color = { + test: v => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: v => { + if (rgba.test(v)) { + return rgba.parse(v); + } else if (hsla.test(v)) { + return hsla.parse(v); + } else { + return hex.parse(v); + } + }, + transform: v => { + return isString(v) ? v : v.hasOwnProperty('red') ? rgba.transform(v) : hsla.transform(v); + } +}; +const colorToken = '${c}'; +const numberToken = '${n}'; +function test(v) { + var _a, _b, _c, _d; + return isNaN(v) && isString(v) && ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0; +} +function analyse(v) { + if (typeof v === 'number') v = `${v}`; + const values = []; + let numColors = 0; + const colors = v.match(colorRegex); + if (colors) { + numColors = colors.length; + v = v.replace(colorRegex, colorToken); + values.push(...colors.map(color.parse)); + } + const numbers = v.match(floatRegex); + if (numbers) { + v = v.replace(floatRegex, numberToken); + values.push(...numbers.map(number.parse)); + } + return { + values, + numColors, + tokenised: v + }; +} +function parse(v) { + return analyse(v).values; +} +function createTransformer(v) { + const { + values, + numColors, + tokenised + } = analyse(v); + const numValues = values.length; + return v => { + let output = tokenised; + for (let i = 0; i < numValues; i++) { + output = output.replace(i < numColors ? colorToken : numberToken, i < numColors ? color.transform(v[i]) : sanitize(v[i])); + } + return output; + }; +} +const convertNumbersToZero = v => typeof v === 'number' ? 0 : v; +function getAnimatableNone(v) { + const parsed = parse(v); + const transformer = createTransformer(v); + return transformer(parsed.map(convertNumbersToZero)); +} +const complex = { + test, + parse, + createTransformer, + getAnimatableNone +}; +const maxDefaults = new Set(['brightness', 'contrast', 'saturate', 'opacity']); +function applyDefaultFilter(v) { + let [name, value] = v.slice(0, -1).split('('); + if (name === 'drop-shadow') return v; + const [number] = value.match(floatRegex) || []; + if (!number) return v; + const unit = value.replace(number, ''); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) defaultValue *= 100; + return name + '(' + defaultValue + unit + ')'; +} +const functionRegex = /([a-z-]*)\(.*?\)/g; +const filter = Object.assign(Object.assign({}, complex), { + getAnimatableNone: v => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(' ') : v; + } +}); +exports.alpha = alpha; +exports.color = color; +exports.complex = complex; +exports.degrees = degrees; +exports.filter = filter; +exports.hex = hex; +exports.hsla = hsla; +exports.number = number; +exports.percent = percent; +exports.progressPercentage = progressPercentage; +exports.px = px; +exports.rgbUnit = rgbUnit; +exports.rgba = rgba; +exports.scale = scale; +exports.vh = vh; +exports.vw = vw; + +/***/ }), + +/***/ "../../../node_modules/toggle-selection/index.js": +/*!*******************************************************!*\ + !*** ../../../node_modules/toggle-selection/index.js ***! + \*******************************************************/ +/***/ (function(module) { + +"use strict"; + + +module.exports = function () { + var selection = document.getSelection(); + if (!selection.rangeCount) { + return function () {}; + } + var active = document.activeElement; + var ranges = []; + for (var i = 0; i < selection.rangeCount; i++) { + ranges.push(selection.getRangeAt(i)); + } + switch (active.tagName.toUpperCase()) { + // .toUpperCase handles XHTML + case 'INPUT': + case 'TEXTAREA': + active.blur(); + break; + default: + active = null; + break; + } + selection.removeAllRanges(); + return function () { + selection.type === 'Caret' && selection.removeAllRanges(); + if (!selection.rangeCount) { + ranges.forEach(function (range) { + selection.addRange(range); }); - Doc.prototype.eachLine = Doc.prototype.iter; - var lastDrop = 0; - function onDrop(e) { - var cm = this; - clearDragCursor(cm); - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { - return; - } - e_preventDefault(e); - if (ie) { - lastDrop = + /* @__PURE__ */new Date(); - } - var pos = posFromMouse(cm, e, true), - files = e.dataTransfer.files; - if (!pos || cm.isReadOnly()) { - return; - } - if (files && files.length && window.FileReader && window.File) { - var n = files.length, - text = Array(n), - read = 0; - var markAsReadAndPasteIfAllFilesAreRead = function () { - if (++read == n) { - operation(cm, function () { - pos = clipPos(cm.doc, pos); - var change = { - from: pos, - to: pos, - text: cm.doc.splitLines(text.filter(function (t) { - return t != null; - }).join(cm.doc.lineSeparator())), - origin: "paste" - }; - makeChange(cm.doc, change); - setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change)))); - })(); - } - }; - var readTextFromFile = function (file, i3) { - if (cm.options.allowDropFileTypes && indexOf(cm.options.allowDropFileTypes, file.type) == -1) { - markAsReadAndPasteIfAllFilesAreRead(); - return; - } - var reader = new FileReader(); - reader.onerror = function () { - return markAsReadAndPasteIfAllFilesAreRead(); - }; - reader.onload = function () { - var content = reader.result; - if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { - markAsReadAndPasteIfAllFilesAreRead(); - return; - } - text[i3] = content; - markAsReadAndPasteIfAllFilesAreRead(); - }; - reader.readAsText(file); - }; - for (var i2 = 0; i2 < files.length; i2++) { - readTextFromFile(files[i2], i2); - } - } else { - if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e); - setTimeout(function () { - return cm.display.input.focus(); - }, 20); - return; - } - try { - var text$1 = e.dataTransfer.getData("Text"); - if (text$1) { - var selected; - if (cm.state.draggingText && !cm.state.draggingText.copy) { - selected = cm.listSelections(); - } - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); - if (selected) { - for (var i$12 = 0; i$12 < selected.length; ++i$12) { - replaceRange(cm.doc, "", selected[i$12].anchor, selected[i$12].head, "drag"); - } - } - cm.replaceSelection(text$1, "around", "paste"); - cm.display.input.focus(); - } - } catch (e$1) {} - } - } - function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || + /* @__PURE__ */new Date() - lastDrop < 100)) { - e_stop(e); - return; - } - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { - return; - } - e.dataTransfer.setData("Text", cm.getSelection()); - e.dataTransfer.effectAllowed = "copyMove"; - if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (presto) { - img.width = img.height = 1; - cm.display.wrapper.appendChild(img); - img._top = img.offsetTop; - } - e.dataTransfer.setDragImage(img, 0, 0); - if (presto) { - img.parentNode.removeChild(img); - } - } - } - function onDragOver(cm, e) { - var pos = posFromMouse(cm, e); - if (!pos) { - return; - } - var frag = document.createDocumentFragment(); - drawSelectionCursor(cm, pos, frag); - if (!cm.display.dragCursor) { - cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); - cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); - } - removeChildrenAndAdd(cm.display.dragCursor, frag); - } - function clearDragCursor(cm) { - if (cm.display.dragCursor) { - cm.display.lineSpace.removeChild(cm.display.dragCursor); - cm.display.dragCursor = null; - } - } - function forEachCodeMirror(f) { - if (!document.getElementsByClassName) { - return; - } - var byClass = document.getElementsByClassName("CodeMirror"), - editors = []; - for (var i2 = 0; i2 < byClass.length; i2++) { - var cm = byClass[i2].CodeMirror; - if (cm) { - editors.push(cm); - } - } - if (editors.length) { - editors[0].operation(function () { - for (var i3 = 0; i3 < editors.length; i3++) { - f(editors[i3]); - } - }); - } - } - var globalsRegistered = false; - function ensureGlobalHandlers() { - if (globalsRegistered) { - return; - } - registerGlobalHandlers(); - globalsRegistered = true; - } - function registerGlobalHandlers() { - var resizeTimer; - on(window, "resize", function () { - if (resizeTimer == null) { - resizeTimer = setTimeout(function () { - resizeTimer = null; - forEachCodeMirror(onResize); - }, 100); - } - }); - on(window, "blur", function () { - return forEachCodeMirror(onBlur); - }); - } - function onResize(cm) { - var d = cm.display; - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - d.scrollbarsClipped = false; - cm.setSize(); - } - var keyNames = { - 3: "Pause", - 8: "Backspace", - 9: "Tab", - 13: "Enter", - 16: "Shift", - 17: "Ctrl", - 18: "Alt", - 19: "Pause", - 20: "CapsLock", - 27: "Esc", - 32: "Space", - 33: "PageUp", - 34: "PageDown", - 35: "End", - 36: "Home", - 37: "Left", - 38: "Up", - 39: "Right", - 40: "Down", - 44: "PrintScrn", - 45: "Insert", - 46: "Delete", - 59: ";", - 61: "=", - 91: "Mod", - 92: "Mod", - 93: "Mod", - 106: "*", - 107: "=", - 109: "-", - 110: ".", - 111: "/", - 145: "ScrollLock", - 173: "-", - 186: ";", - 187: "=", - 188: ",", - 189: "-", - 190: ".", - 191: "/", - 192: "`", - 219: "[", - 220: "\\", - 221: "]", - 222: "'", - 224: "Mod", - 63232: "Up", - 63233: "Down", - 63234: "Left", - 63235: "Right", - 63272: "Delete", - 63273: "Home", - 63275: "End", - 63276: "PageUp", - 63277: "PageDown", - 63302: "Insert" - }; - for (var i = 0; i < 10; i++) { - keyNames[i + 48] = keyNames[i + 96] = String(i); - } - for (var i$1 = 65; i$1 <= 90; i$1++) { - keyNames[i$1] = String.fromCharCode(i$1); - } - for (var i$2 = 1; i$2 <= 12; i$2++) { - keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; - } - var keyMap = {}; - keyMap.basic = { - "Left": "goCharLeft", - "Right": "goCharRight", - "Up": "goLineUp", - "Down": "goLineDown", - "End": "goLineEnd", - "Home": "goLineStartSmart", - "PageUp": "goPageUp", - "PageDown": "goPageDown", - "Delete": "delCharAfter", - "Backspace": "delCharBefore", - "Shift-Backspace": "delCharBefore", - "Tab": "defaultTab", - "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", - "Insert": "toggleOverwrite", - "Esc": "singleSelection" - }; - keyMap.pcDefault = { - "Ctrl-A": "selectAll", - "Ctrl-D": "deleteLine", - "Ctrl-Z": "undo", - "Shift-Ctrl-Z": "redo", - "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", - "Ctrl-End": "goDocEnd", - "Ctrl-Up": "goLineUp", - "Ctrl-Down": "goLineDown", - "Ctrl-Left": "goGroupLeft", - "Ctrl-Right": "goGroupRight", - "Alt-Left": "goLineStart", - "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delGroupBefore", - "Ctrl-Delete": "delGroupAfter", - "Ctrl-S": "save", - "Ctrl-F": "find", - "Ctrl-G": "findNext", - "Shift-Ctrl-G": "findPrev", - "Shift-Ctrl-F": "replace", - "Shift-Ctrl-R": "replaceAll", - "Ctrl-[": "indentLess", - "Ctrl-]": "indentMore", - "Ctrl-U": "undoSelection", - "Shift-Ctrl-U": "redoSelection", - "Alt-U": "redoSelection", - "fallthrough": "basic" - }; - keyMap.emacsy = { - "Ctrl-F": "goCharRight", - "Ctrl-B": "goCharLeft", - "Ctrl-P": "goLineUp", - "Ctrl-N": "goLineDown", - "Ctrl-A": "goLineStart", - "Ctrl-E": "goLineEnd", - "Ctrl-V": "goPageDown", - "Shift-Ctrl-V": "goPageUp", - "Ctrl-D": "delCharAfter", - "Ctrl-H": "delCharBefore", - "Alt-Backspace": "delWordBefore", - "Ctrl-K": "killLine", - "Ctrl-T": "transposeChars", - "Ctrl-O": "openLine" - }; - keyMap.macDefault = { - "Cmd-A": "selectAll", - "Cmd-D": "deleteLine", - "Cmd-Z": "undo", - "Shift-Cmd-Z": "redo", - "Cmd-Y": "redo", - "Cmd-Home": "goDocStart", - "Cmd-Up": "goDocStart", - "Cmd-End": "goDocEnd", - "Cmd-Down": "goDocEnd", - "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight", - "Cmd-Left": "goLineLeft", - "Cmd-Right": "goLineRight", - "Alt-Backspace": "delGroupBefore", - "Ctrl-Alt-Backspace": "delGroupAfter", - "Alt-Delete": "delGroupAfter", - "Cmd-S": "save", - "Cmd-F": "find", - "Cmd-G": "findNext", - "Shift-Cmd-G": "findPrev", - "Cmd-Alt-F": "replace", - "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", - "Cmd-]": "indentMore", - "Cmd-Backspace": "delWrappedLineLeft", - "Cmd-Delete": "delWrappedLineRight", - "Cmd-U": "undoSelection", - "Shift-Cmd-U": "redoSelection", - "Ctrl-Up": "goDocStart", - "Ctrl-Down": "goDocEnd", - "fallthrough": ["basic", "emacsy"] - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - function normalizeKeyName(name) { - var parts = name.split(/-(?!$)/); - name = parts[parts.length - 1]; - var alt, ctrl, shift, cmd; - for (var i2 = 0; i2 < parts.length - 1; i2++) { - var mod = parts[i2]; - if (/^(cmd|meta|m)$/i.test(mod)) { - cmd = true; - } else if (/^a(lt)?$/i.test(mod)) { - alt = true; - } else if (/^(c|ctrl|control)$/i.test(mod)) { - ctrl = true; - } else if (/^s(hift)?$/i.test(mod)) { - shift = true; - } else { - throw new Error("Unrecognized modifier name: " + mod); - } - } - if (alt) { - name = "Alt-" + name; - } - if (ctrl) { - name = "Ctrl-" + name; - } - if (cmd) { - name = "Cmd-" + name; - } - if (shift) { - name = "Shift-" + name; - } - return name; - } - function normalizeKeyMap(keymap) { - var copy = {}; - for (var keyname in keymap) { - if (keymap.hasOwnProperty(keyname)) { - var value = keymap[keyname]; - if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { - continue; - } - if (value == "...") { - delete keymap[keyname]; - continue; - } - var keys = map(keyname.split(" "), normalizeKeyName); - for (var i2 = 0; i2 < keys.length; i2++) { - var val = void 0, - name = void 0; - if (i2 == keys.length - 1) { - name = keys.join(" "); - val = value; - } else { - name = keys.slice(0, i2 + 1).join(" "); - val = "..."; - } - var prev = copy[name]; - if (!prev) { - copy[name] = val; - } else if (prev != val) { - throw new Error("Inconsistent bindings for " + name); - } - } - delete keymap[keyname]; - } - } - for (var prop2 in copy) { - keymap[prop2] = copy[prop2]; - } - return keymap; - } - function lookupKey(key, map2, handle, context) { - map2 = getKeyMap(map2); - var found = map2.call ? map2.call(key, context) : map2[key]; - if (found === false) { - return "nothing"; - } - if (found === "...") { - return "multi"; - } - if (found != null && handle(found)) { - return "handled"; - } - if (map2.fallthrough) { - if (Object.prototype.toString.call(map2.fallthrough) != "[object Array]") { - return lookupKey(key, map2.fallthrough, handle, context); - } - for (var i2 = 0; i2 < map2.fallthrough.length; i2++) { - var result = lookupKey(key, map2.fallthrough[i2], handle, context); - if (result) { - return result; - } - } - } - } - function isModifierKey(value) { - var name = typeof value == "string" ? value : keyNames[value.keyCode]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; - } - function addModifierNames(name, event, noShift) { - var base = name; - if (event.altKey && base != "Alt") { - name = "Alt-" + name; - } - if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { - name = "Ctrl-" + name; - } - if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Mod") { - name = "Cmd-" + name; - } - if (!noShift && event.shiftKey && base != "Shift") { - name = "Shift-" + name; - } - return name; - } - function keyName(event, noShift) { - if (presto && event.keyCode == 34 && event["char"]) { - return false; - } - var name = keyNames[event.keyCode]; - if (name == null || event.altGraphKey) { - return false; - } - if (event.keyCode == 3 && event.code) { - name = event.code; - } - return addModifierNames(name, event, noShift); - } - function getKeyMap(val) { - return typeof val == "string" ? keyMap[val] : val; - } - function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, - kill = []; - for (var i2 = 0; i2 < ranges.length; i2++) { - var toKill = compute(ranges[i2]); - while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop(); - if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from; - break; - } - } - kill.push(toKill); - } - runInOp(cm, function () { - for (var i3 = kill.length - 1; i3 >= 0; i3--) { - replaceRange(cm.doc, "", kill[i3].from, kill[i3].to, "+delete"); - } - ensureCursorVisible(cm); - }); - } - function moveCharLogically(line, ch, dir) { - var target = skipExtendingChars(line.text, ch + dir, dir); - return target < 0 || target > line.text.length ? null : target; - } - function moveLogically(line, start, dir) { - var ch = moveCharLogically(line, start.ch, dir); - return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before"); - } - function endOfLine(visually, cm, lineObj, lineNo2, dir) { - if (visually) { - if (cm.doc.direction == "rtl") { - dir = -dir; - } - var order = getOrder(lineObj, cm.doc.direction); - if (order) { - var part = dir < 0 ? lst(order) : order[0]; - var moveInStorageOrder = dir < 0 == (part.level == 1); - var sticky = moveInStorageOrder ? "after" : "before"; - var ch; - if (part.level > 0 || cm.doc.direction == "rtl") { - var prep = prepareMeasureForLine(cm, lineObj); - ch = dir < 0 ? lineObj.text.length - 1 : 0; - var targetTop = measureCharPrepared(cm, prep, ch).top; - ch = findFirst(function (ch2) { - return measureCharPrepared(cm, prep, ch2).top == targetTop; - }, dir < 0 == (part.level == 1) ? part.from : part.to - 1, ch); - if (sticky == "before") { - ch = moveCharLogically(lineObj, ch, 1); - } - } else { - ch = dir < 0 ? part.to : part.from; - } - return new Pos(lineNo2, ch, sticky); - } - } - return new Pos(lineNo2, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after"); - } - function moveVisually(cm, line, start, dir) { - var bidi = getOrder(line, cm.doc.direction); - if (!bidi) { - return moveLogically(line, start, dir); - } - if (start.ch >= line.text.length) { - start.ch = line.text.length; - start.sticky = "before"; - } else if (start.ch <= 0) { - start.ch = 0; - start.sticky = "after"; - } - var partPos = getBidiPartAt(bidi, start.ch, start.sticky), - part = bidi[partPos]; - if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { - return moveLogically(line, start, dir); - } - var mv = function (pos, dir2) { - return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir2); - }; - var prep; - var getWrappedLineExtent = function (ch2) { - if (!cm.options.lineWrapping) { - return { - begin: 0, - end: line.text.length - }; - } - prep = prep || prepareMeasureForLine(cm, line); - return wrappedLineExtentChar(cm, line, prep, ch2); - }; - var wrappedLineExtent2 = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); - if (cm.doc.direction == "rtl" || part.level == 1) { - var moveInStorageOrder = part.level == 1 == dir < 0; - var ch = mv(start, moveInStorageOrder ? 1 : -1); - if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent2.begin : ch <= part.to && ch <= wrappedLineExtent2.end)) { - var sticky = moveInStorageOrder ? "before" : "after"; - return new Pos(start.line, ch, sticky); - } - } - var searchInVisualLine = function (partPos2, dir2, wrappedLineExtent3) { - var getRes = function (ch3, moveInStorageOrder3) { - return moveInStorageOrder3 ? new Pos(start.line, mv(ch3, 1), "before") : new Pos(start.line, ch3, "after"); - }; - for (; partPos2 >= 0 && partPos2 < bidi.length; partPos2 += dir2) { - var part2 = bidi[partPos2]; - var moveInStorageOrder2 = dir2 > 0 == (part2.level != 1); - var ch2 = moveInStorageOrder2 ? wrappedLineExtent3.begin : mv(wrappedLineExtent3.end, -1); - if (part2.from <= ch2 && ch2 < part2.to) { - return getRes(ch2, moveInStorageOrder2); - } - ch2 = moveInStorageOrder2 ? part2.from : mv(part2.to, -1); - if (wrappedLineExtent3.begin <= ch2 && ch2 < wrappedLineExtent3.end) { - return getRes(ch2, moveInStorageOrder2); - } - } - }; - var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent2); - if (res) { - return res; - } - var nextCh = dir > 0 ? wrappedLineExtent2.end : mv(wrappedLineExtent2.begin, -1); - if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { - res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); - if (res) { - return res; - } - } - return null; - } - var commands = { - selectAll, - singleSelection: function (cm) { - return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); - }, - killLine: function (cm) { - return deleteNearSelection(cm, function (range2) { - if (range2.empty()) { - var len = getLine(cm.doc, range2.head.line).text.length; - if (range2.head.ch == len && range2.head.line < cm.lastLine()) { - return { - from: range2.head, - to: Pos(range2.head.line + 1, 0) - }; - } else { - return { - from: range2.head, - to: Pos(range2.head.line, len) - }; - } - } else { - return { - from: range2.from(), - to: range2.to() - }; - } - }); - }, - deleteLine: function (cm) { - return deleteNearSelection(cm, function (range2) { - return { - from: Pos(range2.from().line, 0), - to: clipPos(cm.doc, Pos(range2.to().line + 1, 0)) - }; - }); - }, - delLineLeft: function (cm) { - return deleteNearSelection(cm, function (range2) { - return { - from: Pos(range2.from().line, 0), - to: range2.from() - }; - }); - }, - delWrappedLineLeft: function (cm) { - return deleteNearSelection(cm, function (range2) { - var top = cm.charCoords(range2.head, "div").top + 5; - var leftPos = cm.coordsChar({ - left: 0, - top - }, "div"); - return { - from: leftPos, - to: range2.from() - }; - }); - }, - delWrappedLineRight: function (cm) { - return deleteNearSelection(cm, function (range2) { - var top = cm.charCoords(range2.head, "div").top + 5; - var rightPos = cm.coordsChar({ - left: cm.display.lineDiv.offsetWidth + 100, - top - }, "div"); - return { - from: range2.from(), - to: rightPos - }; - }); - }, - undo: function (cm) { - return cm.undo(); - }, - redo: function (cm) { - return cm.redo(); - }, - undoSelection: function (cm) { - return cm.undoSelection(); - }, - redoSelection: function (cm) { - return cm.redoSelection(); - }, - goDocStart: function (cm) { - return cm.extendSelection(Pos(cm.firstLine(), 0)); - }, - goDocEnd: function (cm) { - return cm.extendSelection(Pos(cm.lastLine())); - }, - goLineStart: function (cm) { - return cm.extendSelectionsBy(function (range2) { - return lineStart(cm, range2.head.line); - }, { - origin: "+move", - bias: 1 - }); - }, - goLineStartSmart: function (cm) { - return cm.extendSelectionsBy(function (range2) { - return lineStartSmart(cm, range2.head); - }, { - origin: "+move", - bias: 1 - }); - }, - goLineEnd: function (cm) { - return cm.extendSelectionsBy(function (range2) { - return lineEnd(cm, range2.head.line); - }, { - origin: "+move", - bias: -1 - }); - }, - goLineRight: function (cm) { - return cm.extendSelectionsBy(function (range2) { - var top = cm.cursorCoords(range2.head, "div").top + 5; - return cm.coordsChar({ - left: cm.display.lineDiv.offsetWidth + 100, - top - }, "div"); - }, sel_move); - }, - goLineLeft: function (cm) { - return cm.extendSelectionsBy(function (range2) { - var top = cm.cursorCoords(range2.head, "div").top + 5; - return cm.coordsChar({ - left: 0, - top - }, "div"); - }, sel_move); - }, - goLineLeftSmart: function (cm) { - return cm.extendSelectionsBy(function (range2) { - var top = cm.cursorCoords(range2.head, "div").top + 5; - var pos = cm.coordsChar({ - left: 0, - top - }, "div"); - if (pos.ch < cm.getLine(pos.line).search(/\S/)) { - return lineStartSmart(cm, range2.head); - } - return pos; - }, sel_move); - }, - goLineUp: function (cm) { - return cm.moveV(-1, "line"); - }, - goLineDown: function (cm) { - return cm.moveV(1, "line"); - }, - goPageUp: function (cm) { - return cm.moveV(-1, "page"); - }, - goPageDown: function (cm) { - return cm.moveV(1, "page"); - }, - goCharLeft: function (cm) { - return cm.moveH(-1, "char"); - }, - goCharRight: function (cm) { - return cm.moveH(1, "char"); - }, - goColumnLeft: function (cm) { - return cm.moveH(-1, "column"); - }, - goColumnRight: function (cm) { - return cm.moveH(1, "column"); - }, - goWordLeft: function (cm) { - return cm.moveH(-1, "word"); - }, - goGroupRight: function (cm) { - return cm.moveH(1, "group"); - }, - goGroupLeft: function (cm) { - return cm.moveH(-1, "group"); - }, - goWordRight: function (cm) { - return cm.moveH(1, "word"); - }, - delCharBefore: function (cm) { - return cm.deleteH(-1, "codepoint"); - }, - delCharAfter: function (cm) { - return cm.deleteH(1, "char"); - }, - delWordBefore: function (cm) { - return cm.deleteH(-1, "word"); - }, - delWordAfter: function (cm) { - return cm.deleteH(1, "word"); - }, - delGroupBefore: function (cm) { - return cm.deleteH(-1, "group"); - }, - delGroupAfter: function (cm) { - return cm.deleteH(1, "group"); - }, - indentAuto: function (cm) { - return cm.indentSelection("smart"); - }, - indentMore: function (cm) { - return cm.indentSelection("add"); - }, - indentLess: function (cm) { - return cm.indentSelection("subtract"); - }, - insertTab: function (cm) { - return cm.replaceSelection(" "); - }, - insertSoftTab: function (cm) { - var spaces = [], - ranges = cm.listSelections(), - tabSize = cm.options.tabSize; - for (var i2 = 0; i2 < ranges.length; i2++) { - var pos = ranges[i2].from(); - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); - spaces.push(spaceStr(tabSize - col % tabSize)); - } - cm.replaceSelections(spaces); - }, - defaultTab: function (cm) { - if (cm.somethingSelected()) { - cm.indentSelection("add"); - } else { - cm.execCommand("insertTab"); - } - }, - // Swap the two chars left and right of each selection's head. - // Move cursor behind the two swapped characters afterwards. - // - // Doesn't consider line feeds a character. - // Doesn't scan more than one line above to find a character. - // Doesn't do anything on an empty line. - // Doesn't do anything with non-empty selections. - transposeChars: function (cm) { - return runInOp(cm, function () { - var ranges = cm.listSelections(), - newSel = []; - for (var i2 = 0; i2 < ranges.length; i2++) { - if (!ranges[i2].empty()) { - continue; - } - var cur = ranges[i2].head, - line = getLine(cm.doc, cur.line).text; - if (line) { - if (cur.ch == line.length) { - cur = new Pos(cur.line, cur.ch - 1); - } - if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1); - cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), Pos(cur.line, cur.ch - 2), cur, "+transpose"); - } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text; - if (prev) { - cur = new Pos(cur.line, 1); - cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + prev.charAt(prev.length - 1), Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); - } - } - } - newSel.push(new Range(cur, cur)); - } - cm.setSelections(newSel); - }); - }, - newlineAndIndent: function (cm) { - return runInOp(cm, function () { - var sels = cm.listSelections(); - for (var i2 = sels.length - 1; i2 >= 0; i2--) { - cm.replaceRange(cm.doc.lineSeparator(), sels[i2].anchor, sels[i2].head, "+input"); - } - sels = cm.listSelections(); - for (var i$12 = 0; i$12 < sels.length; i$12++) { - cm.indentLine(sels[i$12].from().line, null, true); - } - ensureCursorVisible(cm); - }); - }, - openLine: function (cm) { - return cm.replaceSelection("\n", "start"); - }, - toggleOverwrite: function (cm) { - return cm.toggleOverwrite(); - } - }; - function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLine(line); - if (visual != line) { - lineN = lineNo(visual); - } - return endOfLine(true, cm, visual, lineN, 1); - } - function lineEnd(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLineEnd(line); - if (visual != line) { - lineN = lineNo(visual); - } - return endOfLine(true, cm, line, lineN, -1); - } - function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line); - var line = getLine(cm.doc, start.line); - var order = getOrder(line, cm.doc.direction); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(start.ch, line.text.search(/\S/)); - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; - return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky); - } - return start; - } - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound]; - if (!bound) { - return false; - } - } - cm.display.input.ensurePolled(); - var prevShift = cm.display.shift, - done = false; - try { - if (cm.isReadOnly()) { - cm.state.suppressEdits = true; - } - if (dropShift) { - cm.display.shift = false; - } - done = bound(cm) != Pass; - } finally { - cm.display.shift = prevShift; - cm.state.suppressEdits = false; - } - return done; - } - function lookupKeyForEditor(cm, name, handle) { - for (var i2 = 0; i2 < cm.state.keyMaps.length; i2++) { - var result = lookupKey(name, cm.state.keyMaps[i2], handle, cm); - if (result) { - return result; - } - } - return cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm) || lookupKey(name, cm.options.keyMap, handle, cm); - } - var stopSeq = new Delayed(); - function dispatchKey(cm, name, e, handle) { - var seq = cm.state.keySeq; - if (seq) { - if (isModifierKey(name)) { - return "handled"; - } - if (/\'$/.test(name)) { - cm.state.keySeq = null; - } else { - stopSeq.set(50, function () { - if (cm.state.keySeq == seq) { - cm.state.keySeq = null; - cm.display.input.reset(); - } - }); - } - if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { - return true; - } - } - return dispatchKeyInner(cm, name, e, handle); - } - function dispatchKeyInner(cm, name, e, handle) { - var result = lookupKeyForEditor(cm, name, handle); - if (result == "multi") { - cm.state.keySeq = name; - } - if (result == "handled") { - signalLater(cm, "keyHandled", cm, name, e); - } - if (result == "handled" || result == "multi") { - e_preventDefault(e); - restartBlink(cm); - } - return !!result; - } - function handleKeyBinding(cm, e) { - var name = keyName(e, true); - if (!name) { - return false; - } - if (e.shiftKey && !cm.state.keySeq) { - return dispatchKey(cm, "Shift-" + name, e, function (b) { - return doHandleBinding(cm, b, true); - }) || dispatchKey(cm, name, e, function (b) { - if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) { - return doHandleBinding(cm, b); - } - }); - } else { - return dispatchKey(cm, name, e, function (b) { - return doHandleBinding(cm, b); - }); - } - } - function handleCharBinding(cm, e, ch) { - return dispatchKey(cm, "'" + ch + "'", e, function (b) { - return doHandleBinding(cm, b, true); - }); - } - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; - if (e.target && e.target != cm.display.input.getField()) { - return; - } - cm.curOp.focus = activeElt(); - if (signalDOMEvent(cm, e)) { - return; - } - if (ie && ie_version < 11 && e.keyCode == 27) { - e.returnValue = false; - } - var code = e.keyCode; - cm.display.shift = code == 16 || e.shiftKey; - var handled = handleKeyBinding(cm, e); - if (presto) { - lastStoppedKey = handled ? code : null; - if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) { - cm.replaceSelection("", null, "cut"); - } - } - if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand) { - document.execCommand("cut"); - } - if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) { - showCrossHair(cm); - } - } - function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv; - addClass(lineDiv, "CodeMirror-crosshair"); - function up(e) { - if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair"); - off(document, "keyup", up); - off(document, "mouseover", up); - } - } - on(document, "keyup", up); - on(document, "mouseover", up); - } - function onKeyUp(e) { - if (e.keyCode == 16) { - this.doc.sel.shift = false; - } - signalDOMEvent(this, e); - } - function onKeyPress(e) { - var cm = this; - if (e.target && e.target != cm.display.input.getField()) { - return; - } - if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { - return; - } - var keyCode = e.keyCode, - charCode = e.charCode; - if (presto && keyCode == lastStoppedKey) { - lastStoppedKey = null; - e_preventDefault(e); - return; - } - if (presto && (!e.which || e.which < 10) && handleKeyBinding(cm, e)) { - return; - } - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - if (ch == "\b") { - return; - } - if (handleCharBinding(cm, e, ch)) { - return; - } - cm.display.input.onKeyPress(e); + } + active && active.focus(); + }; +}; + +/***/ }), + +/***/ "../../../node_modules/tslib/tslib.es6.mjs": +/*!*************************************************!*\ + !*** ../../../node_modules/tslib/tslib.es6.mjs ***! + \*************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.__addDisposableResource = __addDisposableResource; +exports.__assign = void 0; +exports.__asyncDelegator = __asyncDelegator; +exports.__asyncGenerator = __asyncGenerator; +exports.__asyncValues = __asyncValues; +exports.__await = __await; +exports.__awaiter = __awaiter; +exports.__classPrivateFieldGet = __classPrivateFieldGet; +exports.__classPrivateFieldIn = __classPrivateFieldIn; +exports.__classPrivateFieldSet = __classPrivateFieldSet; +exports.__createBinding = void 0; +exports.__decorate = __decorate; +exports.__disposeResources = __disposeResources; +exports.__esDecorate = __esDecorate; +exports.__exportStar = __exportStar; +exports.__extends = __extends; +exports.__generator = __generator; +exports.__importDefault = __importDefault; +exports.__importStar = __importStar; +exports.__makeTemplateObject = __makeTemplateObject; +exports.__metadata = __metadata; +exports.__param = __param; +exports.__propKey = __propKey; +exports.__read = __read; +exports.__rest = __rest; +exports.__runInitializers = __runInitializers; +exports.__setFunctionName = __setFunctionName; +exports.__spread = __spread; +exports.__spreadArray = __spreadArray; +exports.__spreadArrays = __spreadArrays; +exports.__values = __values; +exports["default"] = void 0; +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol */ + +var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; + }; + return extendStatics(d, b); +}; +function __extends(d, b) { + if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} +var __assign = function () { + exports.__assign = __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +exports.__assign = __assign; +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +} +function __decorate(decorators, target, key, desc) { + var c = arguments.length, + r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, + d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} +function __param(paramIndex, decorator) { + return function (target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { + if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); + return f; + } + var kind = contextIn.kind, + key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, + done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); + }; + var result = (0, decorators[i])(kind === "accessor" ? { + get: descriptor.get, + set: descriptor.set + } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_);else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +; +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +} +; +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +} +; +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { + configurable: true, + value: prefix ? "".concat(prefix, " ", name) : name + }); +} +; +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - var DOUBLECLICK_DELAY = 400; - var PastClick = function (time, pos, button) { - this.time = time; - this.pos = pos; - this.button = button; - }; - PastClick.prototype.compare = function (time, pos, button) { - return this.time + DOUBLECLICK_DELAY > time && cmp(pos, this.pos) == 0 && button == this.button; - }; - var lastClick, lastDoubleClick; - function clickRepeat(pos, button) { - var now = + /* @__PURE__ */new Date(); - if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { - lastClick = lastDoubleClick = null; - return "triple"; - } else if (lastClick && lastClick.compare(now, pos, button)) { - lastDoubleClick = new PastClick(now, pos, button); - lastClick = null; - return "double"; - } else { - lastClick = new PastClick(now, pos, button); - lastDoubleClick = null; - return "single"; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - function onMouseDown(e) { - var cm = this, - display = cm.display; - if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { - return; - } - display.input.ensurePolled(); - display.shift = e.shiftKey; - if (eventInWidget(display, e)) { - if (!webkit) { - display.scroller.draggable = false; - setTimeout(function () { - return display.scroller.draggable = true; - }, 100); + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { + label: 0, + sent: function () { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [] + }, + f, + y, + t, + g; + return g = { + next: verb(0), + "throw": verb(1), + "return": verb(2) + }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { + return this; + }), g; + function verb(n) { + return function (v) { + return step([n, v]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { + value: op[1], + done: false + }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; } - return; - } - if (clickInGutter(cm, e)) { - return; - } - var pos = posFromMouse(cm, e), - button = e_button(e), - repeat = pos ? clickRepeat(pos, button) : "single"; - window.focus(); - if (button == 1 && cm.state.selectingText) { - cm.state.selectingText(e); - } - if (pos && handleMappedButton(cm, button, pos, repeat, e)) { - return; - } - if (button == 1) { - if (pos) { - leftButtonDown(cm, pos, repeat, e); - } else if (e_target(e) == display.scroller) { - e_preventDefault(e); + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; } - } else if (button == 2) { - if (pos) { - extendSelection(cm.doc, pos); + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; } - setTimeout(function () { - return display.input.focus(); - }, 20); - } else if (button == 3) { - if (captureRightClick) { - cm.display.input.onContextMenu(e); - } else { - delayBlurEvent(cm); + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; } - } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; } - function handleMappedButton(cm, button, pos, repeat, event) { - var name = "Click"; - if (repeat == "double") { - name = "Double" + name; - } else if (repeat == "triple") { - name = "Triple" + name; - } - name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; - return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { - if (typeof bound == "string") { - bound = commands[bound]; - } - if (!bound) { - return false; - } - var done = false; - try { - if (cm.isReadOnly()) { - cm.state.suppressEdits = true; - } - done = bound(cm, pos) != Pass; - } finally { - cm.state.suppressEdits = false; - } - return done; - }); + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { + value: op[0] ? op[1] : void 0, + done: true + }; + } +} +var __createBinding = exports.__createBinding = Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function () { + return m[k]; } - function configureMouse(cm, repeat, event) { - var option = cm.getOption("configureMouse"); - var value = option ? option(cm, repeat, event) : {}; - if (value.unit == null) { - var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; - value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; - } - if (value.extend == null || cm.doc.extend) { - value.extend = cm.doc.extend || event.shiftKey; - } - if (value.addNew == null) { - value.addNew = mac ? event.metaKey : event.ctrlKey; - } - if (value.moveOnDrag == null) { - value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); - } - return value; + }; + } + Object.defineProperty(o, k2, desc); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}; +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, + m = s && o[s], + i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { + value: o && o[i++], + done: !o + }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), + r, + ar = [], + e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } catch (error) { + e = { + error: error + }; + } finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } finally { + if (e) throw e.error; + } + } + return ar; +} + +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; + return r; +} +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), + i, + q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function (v) { + return new Promise(function (a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; + } + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); + } + } + function step(r) { + r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + } +} +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { + throw e; + }), verb("return"), i[Symbol.iterator] = function () { + return this; + }, i; + function verb(n, f) { + i[n] = o[n] ? function (v) { + return (p = !p) ? { + value: __await(o[n](v)), + done: false + } : f ? f(v) : v; + } : f; + } +} +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], + i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { + return this; + }, i); + function verb(n) { + i[n] = o[n] && function (v) { + return new Promise(function (resolve, reject) { + v = o[n](v), settle(resolve, reject, v.done, v.value); + }); + }; + } + function settle(resolve, reject, d, v) { + Promise.resolve(v).then(function (v) { + resolve({ + value: v, + done: d + }); + }, reject); + } +} +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { + value: raw + }); + } else { + cooked.raw = raw; + } + return cooked; +} +; +var __setModuleDefault = Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}; +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} +function __importDefault(mod) { + return mod && mod.__esModule ? mod : { + default: mod + }; +} +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; +} +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + env.stack.push({ + value: value, + dispose: dispose, + async: async + }); + } else if (async) { + env.stack.push({ + async: true + }); + } + return value; +} +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + function next() { + while (env.stack.length) { + var rec = env.stack.pop(); + try { + var result = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) return Promise.resolve(result).then(next, function (e) { + fail(e); + return next(); + }); + } catch (e) { + fail(e); } - function leftButtonDown(cm, pos, repeat, event) { - if (ie) { - setTimeout(bind(ensureFocus, cm), 0); - } else { - cm.curOp.focus = activeElt(); - } - var behavior = configureMouse(cm, repeat, event); - var sel = cm.doc.sel, - contained; - if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && repeat == "single" && (contained = sel.contains(pos)) > -1 && (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) { - leftButtonStartDrag(cm, event, pos, behavior); - } else { - leftButtonSelect(cm, event, pos, behavior); - } + } + if (env.hasError) throw env.error; + } + return next(); +} +var _default = exports["default"] = { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources +}; + +/***/ }), + +/***/ "../../../node_modules/uc.micro/build/index.cjs.js": +/*!*********************************************************!*\ + !*** ../../../node_modules/uc.micro/build/index.cjs.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +var regex$5 = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var regex$4 = /[\0-\x1F\x7F-\x9F]/; +var regex$3 = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/; +var regex$2 = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/; +var regex$1 = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/; +var regex = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; +exports.Any = regex$5; +exports.Cc = regex$4; +exports.Cf = regex$3; +exports.P = regex$2; +exports.S = regex$1; +exports.Z = regex; + +/***/ }), + +/***/ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js": +/*!***********************************************************************!*\ + !*** ../../../node_modules/use-callback-ref/dist/es2015/assignRef.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.assignRef = assignRef; +/** + * Assigns a value for a given ref, no matter of the ref format + * @param {RefObject} ref - a callback function or ref object + * @param value - a new value + * + * @see https://github.com/theKashey/use-callback-ref#assignref + * @example + * const refObject = useRef(); + * const refFn = (ref) => {....} + * + * assignRef(refObject, "refValue"); + * assignRef(refFn, "refValue"); + */ +function assignRef(ref, value) { + if (typeof ref === 'function') { + ref(value); + } else if (ref) { + ref.current = value; + } + return ref; +} + +/***/ }), + +/***/ "../../../node_modules/use-callback-ref/dist/es2015/createRef.js": +/*!***********************************************************************!*\ + !*** ../../../node_modules/use-callback-ref/dist/es2015/createRef.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createCallbackRef = createCallbackRef; +/** + * creates a Ref object with on change callback + * @param callback + * @returns {RefObject} + * + * @see {@link useCallbackRef} + * @see https://reactjs.org/docs/refs-and-the-dom.html#creating-refs + */ +function createCallbackRef(callback) { + var current = null; + return { + get current() { + return current; + }, + set current(value) { + var last = current; + if (last !== value) { + current = value; + callback(value, last); } - function leftButtonStartDrag(cm, event, pos, behavior) { - var display = cm.display, - moved = false; - var dragEnd = operation(cm, function (e) { - if (webkit) { - display.scroller.draggable = false; - } - cm.state.draggingText = false; - if (cm.state.delayingBlurEvent) { - if (cm.hasFocus()) { - cm.state.delayingBlurEvent = false; - } else { - delayBlurEvent(cm); - } - } - off(display.wrapper.ownerDocument, "mouseup", dragEnd); - off(display.wrapper.ownerDocument, "mousemove", mouseMove); - off(display.scroller, "dragstart", dragStart); - off(display.scroller, "drop", dragEnd); - if (!moved) { - e_preventDefault(e); - if (!behavior.addNew) { - extendSelection(cm.doc, pos, null, null, behavior.extend); - } - if (webkit && !safari || ie && ie_version == 9) { - setTimeout(function () { - display.wrapper.ownerDocument.body.focus({ - preventScroll: true - }); - display.input.focus(); - }, 20); - } else { - display.input.focus(); - } + } + }; +} + +/***/ }), + +/***/ "../../../node_modules/use-callback-ref/dist/es2015/index.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/use-callback-ref/dist/es2015/index.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "assignRef", ({ + enumerable: true, + get: function () { + return _assignRef.assignRef; + } +})); +Object.defineProperty(exports, "createCallbackRef", ({ + enumerable: true, + get: function () { + return _createRef.createCallbackRef; + } +})); +Object.defineProperty(exports, "mergeRefs", ({ + enumerable: true, + get: function () { + return _mergeRef.mergeRefs; + } +})); +Object.defineProperty(exports, "refToCallback", ({ + enumerable: true, + get: function () { + return _refToCallback.refToCallback; + } +})); +Object.defineProperty(exports, "transformRef", ({ + enumerable: true, + get: function () { + return _transformRef.transformRef; + } +})); +Object.defineProperty(exports, "useCallbackRef", ({ + enumerable: true, + get: function () { + return _useRef.useCallbackRef; + } +})); +Object.defineProperty(exports, "useMergeRefs", ({ + enumerable: true, + get: function () { + return _useMergeRef.useMergeRefs; + } +})); +Object.defineProperty(exports, "useRefToCallback", ({ + enumerable: true, + get: function () { + return _refToCallback.useRefToCallback; + } +})); +Object.defineProperty(exports, "useTransformRef", ({ + enumerable: true, + get: function () { + return _useTransformRef.useTransformRef; + } +})); +var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); +var _useRef = __webpack_require__(/*! ./useRef */ "../../../node_modules/use-callback-ref/dist/es2015/useRef.js"); +var _createRef = __webpack_require__(/*! ./createRef */ "../../../node_modules/use-callback-ref/dist/es2015/createRef.js"); +var _mergeRef = __webpack_require__(/*! ./mergeRef */ "../../../node_modules/use-callback-ref/dist/es2015/mergeRef.js"); +var _useMergeRef = __webpack_require__(/*! ./useMergeRef */ "../../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js"); +var _useTransformRef = __webpack_require__(/*! ./useTransformRef */ "../../../node_modules/use-callback-ref/dist/es2015/useTransformRef.js"); +var _transformRef = __webpack_require__(/*! ./transformRef */ "../../../node_modules/use-callback-ref/dist/es2015/transformRef.js"); +var _refToCallback = __webpack_require__(/*! ./refToCallback */ "../../../node_modules/use-callback-ref/dist/es2015/refToCallback.js"); + +/***/ }), + +/***/ "../../../node_modules/use-callback-ref/dist/es2015/mergeRef.js": +/*!**********************************************************************!*\ + !*** ../../../node_modules/use-callback-ref/dist/es2015/mergeRef.js ***! + \**********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.mergeRefs = mergeRefs; +var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); +var _createRef = __webpack_require__(/*! ./createRef */ "../../../node_modules/use-callback-ref/dist/es2015/createRef.js"); +/** + * Merges two or more refs together providing a single interface to set their value + * @param {RefObject|Ref} refs + * @returns {MutableRefObject} - a new ref, which translates all changes to {refs} + * + * @see {@link useMergeRefs} to be used in ReactComponents + * @example + * const Component = React.forwardRef((props, ref) => { + * const ownRef = useRef(); + * const domRef = mergeRefs([ref, ownRef]); // 👈 merge together + * return
...
+ * } + */ +function mergeRefs(refs) { + return (0, _createRef.createCallbackRef)(function (newValue) { + return refs.forEach(function (ref) { + return (0, _assignRef.assignRef)(ref, newValue); + }); + }); +} + +/***/ }), + +/***/ "../../../node_modules/use-callback-ref/dist/es2015/refToCallback.js": +/*!***************************************************************************!*\ + !*** ../../../node_modules/use-callback-ref/dist/es2015/refToCallback.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.refToCallback = refToCallback; +exports.useRefToCallback = useRefToCallback; +/** + * Unmemoized version of {@link useRefToCallback} + * @see {@link useRefToCallback} + * @param ref + */ +function refToCallback(ref) { + return function (newValue) { + if (typeof ref === 'function') { + ref(newValue); + } else if (ref) { + ref.current = newValue; + } + }; +} +var nullCallback = function () { + return null; +}; +// lets maintain a weak ref to, well, ref :) +// not using `kashe` to keep this package small +var weakMem = new WeakMap(); +var weakMemoize = function (ref) { + var usedRef = ref || nullCallback; + var storedRef = weakMem.get(usedRef); + if (storedRef) { + return storedRef; + } + var cb = refToCallback(usedRef); + weakMem.set(usedRef, cb); + return cb; +}; +/** + * Transforms a given `ref` into `callback`. + * + * To transform `callback` into ref use {@link useCallbackRef|useCallbackRef(undefined, callback)} + * + * @param {ReactRef} ref + * @returns {Function} + * + * @see https://github.com/theKashey/use-callback-ref#reftocallback + * + * @example + * const ref = useRef(0); + * const setRef = useRefToCallback(ref); + * 👉 setRef(10); + * ✅ ref.current === 10 + */ +function useRefToCallback(ref) { + return weakMemoize(ref); +} + +/***/ }), + +/***/ "../../../node_modules/use-callback-ref/dist/es2015/transformRef.js": +/*!**************************************************************************!*\ + !*** ../../../node_modules/use-callback-ref/dist/es2015/transformRef.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.transformRef = transformRef; +var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); +var _createRef = __webpack_require__(/*! ./createRef */ "../../../node_modules/use-callback-ref/dist/es2015/createRef.js"); +/** + * Transforms one ref to another + * @example + * ```tsx + * const ResizableWithRef = forwardRef((props, ref) => + * i ? i.resizable : null)}/> + * ); + * ``` + */ +function transformRef(ref, transformer) { + return (0, _createRef.createCallbackRef)(function (value) { + return (0, _assignRef.assignRef)(ref, transformer(value)); + }); +} + +/***/ }), + +/***/ "../../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js": +/*!*************************************************************************!*\ + !*** ../../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js ***! + \*************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.useMergeRefs = useMergeRefs; +var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); +var _useRef = __webpack_require__(/*! ./useRef */ "../../../node_modules/use-callback-ref/dist/es2015/useRef.js"); +/** + * Merges two or more refs together providing a single interface to set their value + * @param {RefObject|Ref} refs + * @returns {MutableRefObject} - a new ref, which translates all changes to {refs} + * + * @see {@link mergeRefs} a version without buit-in memoization + * @see https://github.com/theKashey/use-callback-ref#usemergerefs + * @example + * const Component = React.forwardRef((props, ref) => { + * const ownRef = useRef(); + * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together + * return
...
+ * } + */ +function useMergeRefs(refs, defaultValue) { + return (0, _useRef.useCallbackRef)(defaultValue || null, function (newValue) { + return refs.forEach(function (ref) { + return (0, _assignRef.assignRef)(ref, newValue); + }); + }); +} + +/***/ }), + +/***/ "../../../node_modules/use-callback-ref/dist/es2015/useRef.js": +/*!********************************************************************!*\ + !*** ../../../node_modules/use-callback-ref/dist/es2015/useRef.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.useCallbackRef = useCallbackRef; +var _react = __webpack_require__(/*! react */ "react"); +/** + * creates a MutableRef with ref change callback + * @param initialValue - initial ref value + * @param {Function} callback - a callback to run when value changes + * + * @example + * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue); + * ref.current = 1; + * // prints 0 -> 1 + * + * @see https://reactjs.org/docs/hooks-reference.html#useref + * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref + * @returns {MutableRefObject} + */ +function useCallbackRef(initialValue, callback) { + var ref = (0, _react.useState)(function () { + return { + // value + value: initialValue, + // last callback + callback: callback, + // "memoized" public interface + facade: { + get current() { + return ref.value; + }, + set current(value) { + var last = ref.value; + if (last !== value) { + ref.value = value; + ref.callback(value, last); } - }); - var mouseMove = function (e2) { - moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; - }; - var dragStart = function () { - return moved = true; - }; - if (webkit) { - display.scroller.draggable = true; - } - cm.state.draggingText = dragEnd; - dragEnd.copy = !behavior.moveOnDrag; - on(display.wrapper.ownerDocument, "mouseup", dragEnd); - on(display.wrapper.ownerDocument, "mousemove", mouseMove); - on(display.scroller, "dragstart", dragStart); - on(display.scroller, "drop", dragEnd); - cm.state.delayingBlurEvent = true; - setTimeout(function () { - return display.input.focus(); - }, 20); - if (display.scroller.dragDrop) { - display.scroller.dragDrop(); - } - } - function rangeForUnit(cm, pos, unit) { - if (unit == "char") { - return new Range(pos, pos); - } - if (unit == "word") { - return cm.findWordAt(pos); - } - if (unit == "line") { - return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); } - var result = unit(cm, pos); - return new Range(result.from, result.to); } - function leftButtonSelect(cm, event, start, behavior) { - if (ie) { - delayBlurEvent(cm); - } - var display = cm.display, - doc = cm.doc; - e_preventDefault(event); - var ourRange, - ourIndex, - startSel = doc.sel, - ranges = startSel.ranges; - if (behavior.addNew && !behavior.extend) { - ourIndex = doc.sel.contains(start); - if (ourIndex > -1) { - ourRange = ranges[ourIndex]; - } else { - ourRange = new Range(start, start); - } - } else { - ourRange = doc.sel.primary(); - ourIndex = doc.sel.primIndex; - } - if (behavior.unit == "rectangle") { - if (!behavior.addNew) { - ourRange = new Range(start, start); - } - start = posFromMouse(cm, event, true, true); - ourIndex = -1; - } else { - var range2 = rangeForUnit(cm, start, behavior.unit); - if (behavior.extend) { - ourRange = extendRange(ourRange, range2.anchor, range2.head, behavior.extend); - } else { - ourRange = range2; - } - } - if (!behavior.addNew) { - ourIndex = 0; - setSelection(doc, new Selection([ourRange], 0), sel_mouse); - startSel = doc.sel; - } else if (ourIndex == -1) { - ourIndex = ranges.length; - setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), { - scroll: false, - origin: "*mouse" - }); - } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { - setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), { - scroll: false, - origin: "*mouse" - }); - startSel = doc.sel; - } else { - replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); - } - var lastPos = start; - function extendTo(pos) { - if (cmp(lastPos, pos) == 0) { - return; - } - lastPos = pos; - if (behavior.unit == "rectangle") { - var ranges2 = [], - tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); - var left = Math.min(startCol, posCol), - right = Math.max(startCol, posCol); - for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); line <= end; line++) { - var text = getLine(doc, line).text, - leftPos = findColumn(text, left, tabSize); - if (left == right) { - ranges2.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); - } else if (text.length > leftPos) { - ranges2.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); - } - } - if (!ranges2.length) { - ranges2.push(new Range(start, start)); - } - setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges2), ourIndex), { - origin: "*mouse", - scroll: false - }); - cm.scrollIntoView(pos); - } else { - var oldRange = ourRange; - var range3 = rangeForUnit(cm, pos, behavior.unit); - var anchor = oldRange.anchor, - head; - if (cmp(range3.anchor, anchor) > 0) { - head = range3.head; - anchor = minPos(oldRange.from(), range3.anchor); - } else { - head = range3.anchor; - anchor = maxPos(oldRange.to(), range3.head); - } - var ranges$1 = startSel.ranges.slice(0); - ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); - setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); - } - } - var editorSize = display.wrapper.getBoundingClientRect(); - var counter = 0; - function extend(e) { - var curCount = ++counter; - var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); - if (!cur) { - return; - } - if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt(); - extendTo(cur); - var visible = visibleLines(display, doc); - if (cur.line >= visible.to || cur.line < visible.from) { - setTimeout(operation(cm, function () { - if (counter == curCount) { - extend(e); - } - }), 150); - } - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; - if (outside) { - setTimeout(operation(cm, function () { - if (counter != curCount) { - return; - } - display.scroller.scrollTop += outside; - extend(e); - }), 50); - } - } - } - function done(e) { - cm.state.selectingText = false; - counter = Infinity; - if (e) { - e_preventDefault(e); - display.input.focus(); - } - off(display.wrapper.ownerDocument, "mousemove", move); - off(display.wrapper.ownerDocument, "mouseup", up); - doc.history.lastSelOrigin = null; - } - var move = operation(cm, function (e) { - if (e.buttons === 0 || !e_button(e)) { - done(e); - } else { - extend(e); - } - }); - var up = operation(cm, done); - cm.state.selectingText = up; - on(display.wrapper.ownerDocument, "mousemove", move); - on(display.wrapper.ownerDocument, "mouseup", up); - } - function bidiSimplify(cm, range2) { - var anchor = range2.anchor; - var head = range2.head; - var anchorLine = getLine(cm.doc, anchor.line); - if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { - return range2; - } - var order = getOrder(anchorLine); - if (!order) { - return range2; - } - var index = getBidiPartAt(order, anchor.ch, anchor.sticky), - part = order[index]; - if (part.from != anchor.ch && part.to != anchor.ch) { - return range2; - } - var boundary = index + (part.from == anchor.ch == (part.level != 1) ? 0 : 1); - if (boundary == 0 || boundary == order.length) { - return range2; - } - var leftSide; - if (head.line != anchor.line) { - leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0; - } else { - var headIndex = getBidiPartAt(order, head.ch, head.sticky); - var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1); - if (headIndex == boundary - 1 || headIndex == boundary) { - leftSide = dir < 0; + }; + })[0]; + // update callback + ref.callback = callback; + return ref.facade; +} + +/***/ }), + +/***/ "../../../node_modules/use-callback-ref/dist/es2015/useTransformRef.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/use-callback-ref/dist/es2015/useTransformRef.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.useTransformRef = useTransformRef; +var _assignRef = __webpack_require__(/*! ./assignRef */ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"); +var _useRef = __webpack_require__(/*! ./useRef */ "../../../node_modules/use-callback-ref/dist/es2015/useRef.js"); +/** + * Create a _lense_ on Ref, making it possible to transform ref value + * @param {ReactRef} ref + * @param {Function} transformer. 👉 Ref would be __NOT updated__ on `transformer` update. + * @returns {RefObject} + * + * @see https://github.com/theKashey/use-callback-ref#usetransformref-to-replace-reactuseimperativehandle + * @example + * + * const ResizableWithRef = forwardRef((props, ref) => + * i ? i.resizable : null)}/> + * ); + */ +function useTransformRef(ref, transformer) { + return (0, _useRef.useCallbackRef)(null, function (value) { + return (0, _assignRef.assignRef)(ref, transformer(value)); + }); +} + +/***/ }), + +/***/ "../../../node_modules/use-sidecar/dist/es2015/config.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/use-sidecar/dist/es2015/config.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.setConfig = exports.config = void 0; +var config = exports.config = { + onError: function (e) { + return console.error(e); + } +}; +var setConfig = function (conf) { + Object.assign(config, conf); +}; +exports.setConfig = setConfig; + +/***/ }), + +/***/ "../../../node_modules/use-sidecar/dist/es2015/env.js": +/*!************************************************************!*\ + !*** ../../../node_modules/use-sidecar/dist/es2015/env.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.env = void 0; +var _detectNodeEs = __webpack_require__(/*! detect-node-es */ "../../../node_modules/detect-node-es/esm/browser.js"); +var env = exports.env = { + isNode: _detectNodeEs.isNode, + forceCache: false +}; + +/***/ }), + +/***/ "../../../node_modules/use-sidecar/dist/es2015/exports.js": +/*!****************************************************************!*\ + !*** ../../../node_modules/use-sidecar/dist/es2015/exports.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.exportSidecar = exportSidecar; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +var SideCar = function (_a) { + var sideCar = _a.sideCar, + rest = (0, _tslib.__rest)(_a, ["sideCar"]); + if (!sideCar) { + throw new Error('Sidecar: please provide `sideCar` property to import the right car'); + } + var Target = sideCar.read(); + if (!Target) { + throw new Error('Sidecar medium not found'); + } + return /*#__PURE__*/React.createElement(Target, (0, _tslib.__assign)({}, rest)); +}; +SideCar.isSideCarExport = true; +function exportSidecar(medium, exported) { + medium.useMedium(exported); + return SideCar; +} + +/***/ }), + +/***/ "../../../node_modules/use-sidecar/dist/es2015/hoc.js": +/*!************************************************************!*\ + !*** ../../../node_modules/use-sidecar/dist/es2015/hoc.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.sidecar = sidecar; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _hook = __webpack_require__(/*! ./hook */ "../../../node_modules/use-sidecar/dist/es2015/hook.js"); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +// eslint-disable-next-line @typescript-eslint/ban-types +function sidecar(importer, errorComponent) { + var ErrorCase = function () { + return errorComponent; + }; + return function Sidecar(props) { + var _a = (0, _hook.useSidecar)(importer, props.sideCar), + Car = _a[0], + error = _a[1]; + if (error && errorComponent) { + return ErrorCase; + } + // @ts-expect-error type shenanigans + return Car ? /*#__PURE__*/React.createElement(Car, (0, _tslib.__assign)({}, props)) : null; + }; +} + +/***/ }), + +/***/ "../../../node_modules/use-sidecar/dist/es2015/hook.js": +/*!*************************************************************!*\ + !*** ../../../node_modules/use-sidecar/dist/es2015/hook.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.useSidecar = useSidecar; +var _react = __webpack_require__(/*! react */ "react"); +var _env = __webpack_require__(/*! ./env */ "../../../node_modules/use-sidecar/dist/es2015/env.js"); +var cache = new WeakMap(); +var NO_OPTIONS = {}; +function useSidecar(importer, effect) { + var options = effect && effect.options || NO_OPTIONS; + if (_env.env.isNode && !options.ssr) { + return [null, null]; + } + // eslint-disable-next-line react-hooks/rules-of-hooks + return useRealSidecar(importer, effect); +} +function useRealSidecar(importer, effect) { + var options = effect && effect.options || NO_OPTIONS; + var couldUseCache = _env.env.forceCache || _env.env.isNode && !!options.ssr || !options.async; + var _a = (0, _react.useState)(couldUseCache ? function () { + return cache.get(importer); + } : undefined), + Car = _a[0], + setCar = _a[1]; + var _b = (0, _react.useState)(null), + error = _b[0], + setError = _b[1]; + (0, _react.useEffect)(function () { + if (!Car) { + importer().then(function (car) { + var resolved = effect ? effect.read() : car.default || car; + if (!resolved) { + console.error('Sidecar error: with importer', importer); + var error_1; + if (effect) { + console.error('Sidecar error: with medium', effect); + error_1 = new Error('Sidecar medium was not found'); } else { - leftSide = dir > 0; - } - } - var usePart = order[boundary + (leftSide ? -1 : 0)]; - var from = leftSide == (usePart.level == 1); - var ch = from ? usePart.from : usePart.to, - sticky = from ? "after" : "before"; - return anchor.ch == ch && anchor.sticky == sticky ? range2 : new Range(new Pos(anchor.line, ch, sticky), head); - } - function gutterEvent(cm, e, type, prevent) { - var mX, mY; - if (e.touches) { - mX = e.touches[0].clientX; - mY = e.touches[0].clientY; - } else { - try { - mX = e.clientX; - mY = e.clientY; - } catch (e$1) { - return false; - } - } - if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { - return false; - } - if (prevent) { - e_preventDefault(e); - } - var display = cm.display; - var lineBox = display.lineDiv.getBoundingClientRect(); - if (mY > lineBox.bottom || !hasHandler(cm, type)) { - return e_defaultPrevented(e); - } - mY -= lineBox.top - display.viewOffset; - for (var i2 = 0; i2 < cm.display.gutterSpecs.length; ++i2) { - var g = display.gutters.childNodes[i2]; - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY); - var gutter = cm.display.gutterSpecs[i2]; - signal(cm, type, cm, line, gutter.className, e); - return e_defaultPrevented(e); - } - } - } - function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true); - } - function onContextMenu(cm, e) { - if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { - return; - } - if (signalDOMEvent(cm, e, "contextmenu")) { - return; - } - if (!captureRightClick) { - cm.display.input.onContextMenu(e); - } - } - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) { - return false; - } - return gutterEvent(cm, e, "gutterContextMenu", false); - } - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - clearCaches(cm); - } - var Init = { - toString: function () { - return "CodeMirror.Init"; - } - }; - var defaults = {}; - var optionHandlers = {}; - function defineOptions(CodeMirror2) { - var optionHandlers2 = CodeMirror2.optionHandlers; - function option(name, deflt, handle, notOnInit) { - CodeMirror2.defaults[name] = deflt; - if (handle) { - optionHandlers2[name] = notOnInit ? function (cm, val, old) { - if (old != Init) { - handle(cm, val, old); - } - } : handle; - } - } - CodeMirror2.defineOption = option; - CodeMirror2.Init = Init; - option("value", "", function (cm, val) { - return cm.setValue(val); - }, true); - option("mode", null, function (cm, val) { - cm.doc.modeOption = val; - loadMode(cm); - }, true); - option("indentUnit", 2, loadMode, true); - option("indentWithTabs", false); - option("smartIndent", true); - option("tabSize", 4, function (cm) { - resetModeState(cm); - clearCaches(cm); - regChange(cm); - }, true); - option("lineSeparator", null, function (cm, val) { - cm.doc.lineSep = val; - if (!val) { - return; - } - var newBreaks = [], - lineNo2 = cm.doc.first; - cm.doc.iter(function (line) { - for (var pos = 0;;) { - var found = line.text.indexOf(val, pos); - if (found == -1) { - break; - } - pos = found + val.length; - newBreaks.push(Pos(lineNo2, found)); - } - lineNo2++; - }); - for (var i2 = newBreaks.length - 1; i2 >= 0; i2--) { - replaceRange(cm.doc, val, newBreaks[i2], Pos(newBreaks[i2].line, newBreaks[i2].ch + val.length)); - } - }); - option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { - cm.state.specialChars = new RegExp(val.source + (val.test(" ") ? "" : "| "), "g"); - if (old != Init) { - cm.refresh(); - } - }); - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { - return cm.refresh(); - }, true); - option("electricChars", true); - option("inputStyle", mobile ? "contenteditable" : "textarea", function () { - throw new Error("inputStyle can not (yet) be changed in a running editor"); - }, true); - option("spellcheck", false, function (cm, val) { - return cm.getInputField().spellcheck = val; - }, true); - option("autocorrect", false, function (cm, val) { - return cm.getInputField().autocorrect = val; - }, true); - option("autocapitalize", false, function (cm, val) { - return cm.getInputField().autocapitalize = val; - }, true); - option("rtlMoveVisually", !windows); - option("wholeLineUpdateBefore", true); - option("theme", "default", function (cm) { - themeChanged(cm); - updateGutters(cm); - }, true); - option("keyMap", "default", function (cm, val, old) { - var next = getKeyMap(val); - var prev = old != Init && getKeyMap(old); - if (prev && prev.detach) { - prev.detach(cm, next); - } - if (next.attach) { - next.attach(cm, prev || null); - } - }); - option("extraKeys", null); - option("configureMouse", null); - option("lineWrapping", false, wrappingChanged, true); - option("gutters", [], function (cm, val) { - cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers); - updateGutters(cm); - }, true); - option("fixedGutter", true, function (cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; - cm.refresh(); - }, true); - option("coverGutterNextToScrollbar", false, function (cm) { - return updateScrollbars(cm); - }, true); - option("scrollbarStyle", "native", function (cm) { - initScrollbars(cm); - updateScrollbars(cm); - cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); - cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); - }, true); - option("lineNumbers", false, function (cm, val) { - cm.display.gutterSpecs = getGutters(cm.options.gutters, val); - updateGutters(cm); - }, true); - option("firstLineNumber", 1, updateGutters, true); - option("lineNumberFormatter", function (integer) { - return integer; - }, updateGutters, true); - option("showCursorWhenSelecting", false, updateSelection, true); - option("resetSelectionOnContextMenu", true); - option("lineWiseCopyCut", true); - option("pasteLinesPerSelection", true); - option("selectionsMayTouch", false); - option("readOnly", false, function (cm, val) { - if (val == "nocursor") { - onBlur(cm); - cm.display.input.blur(); - } - cm.display.input.readOnlyChanged(val); - }); - option("screenReaderLabel", null, function (cm, val) { - val = val === "" ? null : val; - cm.display.input.screenReaderLabelChanged(val); - }); - option("disableInput", false, function (cm, val) { - if (!val) { - cm.display.input.reset(); - } - }, true); - option("dragDrop", true, dragDropChanged); - option("allowDropFileTypes", null); - option("cursorBlinkRate", 530); - option("cursorScrollMargin", 0); - option("cursorHeight", 1, updateSelection, true); - option("singleCursorHeightPerLine", true, updateSelection, true); - option("workTime", 100); - option("workDelay", 100); - option("flattenSpans", true, resetModeState, true); - option("addModeClass", false, resetModeState, true); - option("pollInterval", 100); - option("undoDepth", 200, function (cm, val) { - return cm.doc.history.undoDepth = val; - }); - option("historyEventDelay", 1250); - option("viewportMargin", 10, function (cm) { - return cm.refresh(); - }, true); - option("maxHighlightLength", 1e4, resetModeState, true); - option("moveInputWithCursor", true, function (cm, val) { - if (!val) { - cm.display.input.resetPosition(); - } - }); - option("tabindex", null, function (cm, val) { - return cm.display.input.getField().tabIndex = val || ""; - }); - option("autofocus", null); - option("direction", "ltr", function (cm, val) { - return cm.doc.setDirection(val); - }, true); - option("phrases", null); - } - function dragDropChanged(cm, value, old) { - var wasOn = old && old != Init; - if (!value != !wasOn) { - var funcs = cm.display.dragFunctions; - var toggle = value ? on : off; - toggle(cm.display.scroller, "dragstart", funcs.start); - toggle(cm.display.scroller, "dragenter", funcs.enter); - toggle(cm.display.scroller, "dragover", funcs.over); - toggle(cm.display.scroller, "dragleave", funcs.leave); - toggle(cm.display.scroller, "drop", funcs.drop); - } - } - function wrappingChanged(cm) { - if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap"); - cm.display.sizer.style.minWidth = ""; - cm.display.sizerWidth = null; - } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap"); - findMaxLine(cm); - } - estimateLineHeights(cm); - regChange(cm); - clearCaches(cm); - setTimeout(function () { - return updateScrollbars(cm); - }, 100); - } - function CodeMirror(place, options) { - var this$1$1 = this; - if (!(this instanceof CodeMirror)) { - return new CodeMirror(place, options); - } - this.options = options = options ? copyObj(options) : {}; - copyObj(defaults, options, false); - var doc = options.value; - if (typeof doc == "string") { - doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); - } else if (options.mode) { - doc.modeOption = options.mode; - } - this.doc = doc; - var input = new CodeMirror.inputStyles[options.inputStyle](this); - var display = this.display = new Display(place, doc, input, options); - display.wrapper.CodeMirror = this; - themeChanged(this); - if (options.lineWrapping) { - this.display.wrapper.className += " CodeMirror-wrap"; - } - initScrollbars(this); - this.state = { - keyMaps: [], - // stores maps added by addKeyMap - overlays: [], - // highlighting overlays, as added by addOverlay - modeGen: 0, - // bumped when mode/overlay changes, used to invalidate highlighting info - overwrite: false, - delayingBlurEvent: false, - focused: false, - suppressEdits: false, - // used to disable editing during key handlers when in readOnly mode - pasteIncoming: -1, - cutIncoming: -1, - // help recognize paste/cut edits in input.poll - selectingText: false, - draggingText: false, - highlight: new Delayed(), - // stores highlight worker timeout - keySeq: null, - // Unfinished key sequence - specialChars: null - }; - if (options.autofocus && !mobile) { - display.input.focus(); - } - if (ie && ie_version < 11) { - setTimeout(function () { - return this$1$1.display.input.reset(true); - }, 20); - } - registerEventHandlers(this); - ensureGlobalHandlers(); - startOperation(this); - this.curOp.forceUpdate = true; - attachDoc(this, doc); - if (options.autofocus && !mobile || this.hasFocus()) { - setTimeout(function () { - if (this$1$1.hasFocus() && !this$1$1.state.focused) { - onFocus(this$1$1); - } - }, 20); - } else { - onBlur(this); - } - for (var opt in optionHandlers) { - if (optionHandlers.hasOwnProperty(opt)) { - optionHandlers[opt](this, options[opt], Init); + error_1 = new Error('Sidecar was not found in exports'); } - } - maybeUpdateLineNumberWidth(this); - if (options.finishInit) { - options.finishInit(this); - } - for (var i2 = 0; i2 < initHooks.length; ++i2) { - initHooks[i2](this); - } - endOperation(this); - if (webkit && options.lineWrapping && getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") { - display.lineDiv.style.textRendering = "auto"; - } - } - CodeMirror.defaults = defaults; - CodeMirror.optionHandlers = optionHandlers; - function registerEventHandlers(cm) { - var d = cm.display; - on(d.scroller, "mousedown", operation(cm, onMouseDown)); - if (ie && ie_version < 11) { - on(d.scroller, "dblclick", operation(cm, function (e) { - if (signalDOMEvent(cm, e)) { - return; - } - var pos = posFromMouse(cm, e); - if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { - return; - } - e_preventDefault(e); - var word = cm.findWordAt(pos); - extendSelection(cm.doc, word.anchor, word.head); - })); - } else { - on(d.scroller, "dblclick", function (e) { - return signalDOMEvent(cm, e) || e_preventDefault(e); + setError(function () { + return error_1; }); + throw error_1; } - on(d.scroller, "contextmenu", function (e) { - return onContextMenu(cm, e); - }); - on(d.input.getField(), "contextmenu", function (e) { - if (!d.scroller.contains(e.target)) { - onContextMenu(cm, e); - } - }); - var touchFinished, - prevTouch = { - end: 0 - }; - function finishTouch() { - if (d.activeTouch) { - touchFinished = setTimeout(function () { - return d.activeTouch = null; - }, 1e3); - prevTouch = d.activeTouch; - prevTouch.end = + /* @__PURE__ */new Date(); - } - } - function isMouseLikeTouchEvent(e) { - if (e.touches.length != 1) { - return false; - } - var touch = e.touches[0]; - return touch.radiusX <= 1 && touch.radiusY <= 1; - } - function farAway(touch, other) { - if (other.left == null) { - return true; - } - var dx = other.left - touch.left, - dy = other.top - touch.top; - return dx * dx + dy * dy > 20 * 20; - } - on(d.scroller, "touchstart", function (e) { - if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { - d.input.ensurePolled(); - clearTimeout(touchFinished); - var now = + /* @__PURE__ */new Date(); - d.activeTouch = { - start: now, - moved: false, - prev: now - prevTouch.end <= 300 ? prevTouch : null - }; - if (e.touches.length == 1) { - d.activeTouch.left = e.touches[0].pageX; - d.activeTouch.top = e.touches[0].pageY; - } - } - }); - on(d.scroller, "touchmove", function () { - if (d.activeTouch) { - d.activeTouch.moved = true; - } - }); - on(d.scroller, "touchend", function (e) { - var touch = d.activeTouch; - if (touch && !eventInWidget(d, e) && touch.left != null && !touch.moved && /* @__PURE__ */new Date() - touch.start < 300) { - var pos = cm.coordsChar(d.activeTouch, "page"), - range2; - if (!touch.prev || farAway(touch, touch.prev)) { - range2 = new Range(pos, pos); - } else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) { - range2 = cm.findWordAt(pos); - } else { - range2 = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); - } - cm.setSelection(range2.anchor, range2.head); - cm.focus(); - e_preventDefault(e); - } - finishTouch(); - }); - on(d.scroller, "touchcancel", finishTouch); - on(d.scroller, "scroll", function () { - if (d.scroller.clientHeight) { - updateScrollTop(cm, d.scroller.scrollTop); - setScrollLeft(cm, d.scroller.scrollLeft, true); - signal(cm, "scroll", cm); - } - }); - on(d.scroller, "mousewheel", function (e) { - return onScrollWheel(cm, e); - }); - on(d.scroller, "DOMMouseScroll", function (e) { - return onScrollWheel(cm, e); - }); - on(d.wrapper, "scroll", function () { - return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; - }); - d.dragFunctions = { - enter: function (e) { - if (!signalDOMEvent(cm, e)) { - e_stop(e); - } - }, - over: function (e) { - if (!signalDOMEvent(cm, e)) { - onDragOver(cm, e); - e_stop(e); - } - }, - start: function (e) { - return onDragStart(cm, e); - }, - drop: operation(cm, onDrop), - leave: function (e) { - if (!signalDOMEvent(cm, e)) { - clearDragCursor(cm); - } - } - }; - var inp = d.input.getField(); - on(inp, "keyup", function (e) { - return onKeyUp.call(cm, e); - }); - on(inp, "keydown", operation(cm, onKeyDown)); - on(inp, "keypress", operation(cm, onKeyPress)); - on(inp, "focus", function (e) { - return onFocus(cm, e); + cache.set(importer, resolved); + setCar(function () { + return resolved; }); - on(inp, "blur", function (e) { - return onBlur(cm, e); + }, function (e) { + return setError(function () { + return e; }); + }); + } + }, []); + return [Car, error]; +} + +/***/ }), + +/***/ "../../../node_modules/use-sidecar/dist/es2015/index.js": +/*!**************************************************************!*\ + !*** ../../../node_modules/use-sidecar/dist/es2015/index.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "createMedium", ({ + enumerable: true, + get: function () { + return _medium.createMedium; + } +})); +Object.defineProperty(exports, "createSidecarMedium", ({ + enumerable: true, + get: function () { + return _medium.createSidecarMedium; + } +})); +Object.defineProperty(exports, "exportSidecar", ({ + enumerable: true, + get: function () { + return _exports.exportSidecar; + } +})); +Object.defineProperty(exports, "renderCar", ({ + enumerable: true, + get: function () { + return _renderProp.renderCar; + } +})); +Object.defineProperty(exports, "setConfig", ({ + enumerable: true, + get: function () { + return _config.setConfig; + } +})); +Object.defineProperty(exports, "sidecar", ({ + enumerable: true, + get: function () { + return _hoc.sidecar; + } +})); +Object.defineProperty(exports, "useSidecar", ({ + enumerable: true, + get: function () { + return _hook.useSidecar; + } +})); +var _hoc = __webpack_require__(/*! ./hoc */ "../../../node_modules/use-sidecar/dist/es2015/hoc.js"); +var _hook = __webpack_require__(/*! ./hook */ "../../../node_modules/use-sidecar/dist/es2015/hook.js"); +var _config = __webpack_require__(/*! ./config */ "../../../node_modules/use-sidecar/dist/es2015/config.js"); +var _medium = __webpack_require__(/*! ./medium */ "../../../node_modules/use-sidecar/dist/es2015/medium.js"); +var _renderProp = __webpack_require__(/*! ./renderProp */ "../../../node_modules/use-sidecar/dist/es2015/renderProp.js"); +var _exports = __webpack_require__(/*! ./exports */ "../../../node_modules/use-sidecar/dist/es2015/exports.js"); + +/***/ }), + +/***/ "../../../node_modules/use-sidecar/dist/es2015/medium.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/use-sidecar/dist/es2015/medium.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createMedium = createMedium; +exports.createSidecarMedium = createSidecarMedium; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); +function ItoI(a) { + return a; +} +function innerCreateMedium(defaults, middleware) { + if (middleware === void 0) { + middleware = ItoI; + } + var buffer = []; + var assigned = false; + var medium = { + read: function () { + if (assigned) { + throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.'); } - var initHooks = []; - CodeMirror.defineInitHook = function (f) { - return initHooks.push(f); - }; - function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, - state; - if (how == null) { - how = "add"; - } - if (how == "smart") { - if (!doc.mode.indent) { - how = "prev"; - } else { - state = getContextBefore(cm, n).state; - } - } - var tabSize = cm.options.tabSize; - var line = getLine(doc, n), - curSpace = countColumn(line.text, null, tabSize); - if (line.stateAfter) { - line.stateAfter = null; - } - var curSpaceString = line.text.match(/^\s*/)[0], - indentation; - if (!aggressive && !/\S/.test(line.text)) { - indentation = 0; - how = "not"; - } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass || indentation > 150) { - if (!aggressive) { - return; - } - how = "prev"; - } - } - if (how == "prev") { - if (n > doc.first) { - indentation = countColumn(getLine(doc, n - 1).text, null, tabSize); - } else { - indentation = 0; - } - } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit; - } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit; - } else if (typeof how == "number") { - indentation = curSpace + how; - } - indentation = Math.max(0, indentation); - var indentString = "", - pos = 0; - if (cm.options.indentWithTabs) { - for (var i2 = Math.floor(indentation / tabSize); i2; --i2) { - pos += tabSize; - indentString += " "; - } - } - if (pos < indentation) { - indentString += spaceStr(indentation - pos); - } - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); - line.stateAfter = null; - return true; - } else { - for (var i$12 = 0; i$12 < doc.sel.ranges.length; i$12++) { - var range2 = doc.sel.ranges[i$12]; - if (range2.head.line == n && range2.head.ch < curSpaceString.length) { - var pos$1 = Pos(n, curSpaceString.length); - replaceOneSelection(doc, i$12, new Range(pos$1, pos$1)); - break; - } - } - } - } - var lastCopied = null; - function setLastCopied(newLastCopied) { - lastCopied = newLastCopied; - } - function applyTextInput(cm, inserted, deleted, sel, origin) { - var doc = cm.doc; - cm.display.shift = false; - if (!sel) { - sel = doc.sel; - } - var recent = + /* @__PURE__ */new Date() - 200; - var paste = origin == "paste" || cm.state.pasteIncoming > recent; - var textLines = splitLinesAuto(inserted), - multiPaste = null; - if (paste && sel.ranges.length > 1) { - if (lastCopied && lastCopied.text.join("\n") == inserted) { - if (sel.ranges.length % lastCopied.text.length == 0) { - multiPaste = []; - for (var i2 = 0; i2 < lastCopied.text.length; i2++) { - multiPaste.push(doc.splitLines(lastCopied.text[i2])); - } - } - } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { - multiPaste = map(textLines, function (l) { - return [l]; - }); - } - } - var updateInput = cm.curOp.updateInput; - for (var i$12 = sel.ranges.length - 1; i$12 >= 0; i$12--) { - var range2 = sel.ranges[i$12]; - var from = range2.from(), - to = range2.to(); - if (range2.empty()) { - if (deleted && deleted > 0) { - from = Pos(from.line, from.ch - deleted); - } else if (cm.state.overwrite && !paste) { - to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); - } else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n")) { - from = to = Pos(from.line, 0); - } - } - var changeEvent = { - from, - to, - text: multiPaste ? multiPaste[i$12 % multiPaste.length] : textLines, - origin: origin || (paste ? "paste" : cm.state.cutIncoming > recent ? "cut" : "+input") - }; - makeChange(cm.doc, changeEvent); - signalLater(cm, "inputRead", cm, changeEvent); - } - if (inserted && !paste) { - triggerElectric(cm, inserted); - } - ensureCursorVisible(cm); - if (cm.curOp.updateInput < 2) { - cm.curOp.updateInput = updateInput; - } - cm.curOp.typing = true; - cm.state.pasteIncoming = cm.state.cutIncoming = -1; - } - function handlePaste(e, cm) { - var pasted = e.clipboardData && e.clipboardData.getData("Text"); - if (pasted) { - e.preventDefault(); - if (!cm.isReadOnly() && !cm.options.disableInput) { - runInOp(cm, function () { - return applyTextInput(cm, pasted, 0, null, "paste"); - }); - } - return true; - } - } - function triggerElectric(cm, inserted) { - if (!cm.options.electricChars || !cm.options.smartIndent) { - return; - } - var sel = cm.doc.sel; - for (var i2 = sel.ranges.length - 1; i2 >= 0; i2--) { - var range2 = sel.ranges[i2]; - if (range2.head.ch > 100 || i2 && sel.ranges[i2 - 1].head.line == range2.head.line) { - continue; - } - var mode = cm.getModeAt(range2.head); - var indented = false; - if (mode.electricChars) { - for (var j = 0; j < mode.electricChars.length; j++) { - if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indented = indentLine(cm, range2.head.line, "smart"); - break; - } - } - } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(cm.doc, range2.head.line).text.slice(0, range2.head.ch))) { - indented = indentLine(cm, range2.head.line, "smart"); - } - } - if (indented) { - signalLater(cm, "electricInput", cm, range2.head.line); - } - } - } - function copyableRanges(cm) { - var text = [], - ranges = []; - for (var i2 = 0; i2 < cm.doc.sel.ranges.length; i2++) { - var line = cm.doc.sel.ranges[i2].head.line; - var lineRange = { - anchor: Pos(line, 0), - head: Pos(line + 1, 0) - }; - ranges.push(lineRange); - text.push(cm.getRange(lineRange.anchor, lineRange.head)); - } - return { - text, - ranges - }; - } - function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { - field.setAttribute("autocorrect", autocorrect ? "" : "off"); - field.setAttribute("autocapitalize", autocapitalize ? "" : "off"); - field.setAttribute("spellcheck", !!spellcheck); - } - function hiddenTextarea() { - var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"); - var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - if (webkit) { - te.style.width = "1000px"; - } else { - te.setAttribute("wrap", "off"); - } - if (ios) { - te.style.border = "1px solid black"; - } - disableBrowserMagic(te); - return div; - } - function addEditorMethods(CodeMirror2) { - var optionHandlers2 = CodeMirror2.optionHandlers; - var helpers = CodeMirror2.helpers = {}; - CodeMirror2.prototype = { - constructor: CodeMirror2, - focus: function () { - window.focus(); - this.display.input.focus(); - }, - setOption: function (option, value) { - var options = this.options, - old = options[option]; - if (options[option] == value && option != "mode") { - return; - } - options[option] = value; - if (optionHandlers2.hasOwnProperty(option)) { - operation(this, optionHandlers2[option])(this, value, old); - } - signal(this, "optionChange", this, option); - }, - getOption: function (option) { - return this.options[option]; - }, - getDoc: function () { - return this.doc; - }, - addKeyMap: function (map2, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map2)); - }, - removeKeyMap: function (map2) { - var maps = this.state.keyMaps; - for (var i2 = 0; i2 < maps.length; ++i2) { - if (maps[i2] == map2 || maps[i2].name == map2) { - maps.splice(i2, 1); - return true; - } - } - }, - addOverlay: methodOp(function (spec, options) { - var mode = spec.token ? spec : CodeMirror2.getMode(this.options, spec); - if (mode.startState) { - throw new Error("Overlays may not be stateful."); - } - insertSorted(this.state.overlays, { - mode, - modeSpec: spec, - opaque: options && options.opaque, - priority: options && options.priority || 0 - }, function (overlay) { - return overlay.priority; - }); - this.state.modeGen++; - regChange(this); - }), - removeOverlay: methodOp(function (spec) { - var overlays = this.state.overlays; - for (var i2 = 0; i2 < overlays.length; ++i2) { - var cur = overlays[i2].modeSpec; - if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i2, 1); - this.state.modeGen++; - regChange(this); - return; - } - } - }), - indentLine: methodOp(function (n, dir, aggressive) { - if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) { - dir = this.options.smartIndent ? "smart" : "prev"; - } else { - dir = dir ? "add" : "subtract"; - } - } - if (isLine(this.doc, n)) { - indentLine(this, n, dir, aggressive); - } - }), - indentSelection: methodOp(function (how) { - var ranges = this.doc.sel.ranges, - end = -1; - for (var i2 = 0; i2 < ranges.length; i2++) { - var range2 = ranges[i2]; - if (!range2.empty()) { - var from = range2.from(), - to = range2.to(); - var start = Math.max(end, from.line); - end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; - for (var j = start; j < end; ++j) { - indentLine(this, j, how); - } - var newRanges = this.doc.sel.ranges; - if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i2].from().ch > 0) { - replaceOneSelection(this.doc, i2, new Range(from, newRanges[i2].to()), sel_dontScroll); - } - } else if (range2.head.line > end) { - indentLine(this, range2.head.line, how, true); - end = range2.head.line; - if (i2 == this.doc.sel.primIndex) { - ensureCursorVisible(this); - } - } - } - }), - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function (pos, precise) { - return takeToken(this, pos, precise); - }, - getLineTokens: function (line, precise) { - return takeToken(this, Pos(line), precise, true); - }, - getTokenTypeAt: function (pos) { - pos = clipPos(this.doc, pos); - var styles = getLineStyles(this, getLine(this.doc, pos.line)); - var before = 0, - after = (styles.length - 1) / 2, - ch = pos.ch; - var type; - if (ch == 0) { - type = styles[2]; - } else { - for (;;) { - var mid = before + after >> 1; - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { - after = mid; - } else if (styles[mid * 2 + 1] < ch) { - before = mid + 1; - } else { - type = styles[mid * 2 + 2]; - break; - } - } - } - var cut = type ? type.indexOf("overlay ") : -1; - return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); - }, - getModeAt: function (pos) { - var mode = this.doc.mode; - if (!mode.innerMode) { - return mode; - } - return CodeMirror2.innerMode(mode, this.getTokenAt(pos).state).mode; - }, - getHelper: function (pos, type) { - return this.getHelpers(pos, type)[0]; - }, - getHelpers: function (pos, type) { - var found = []; - if (!helpers.hasOwnProperty(type)) { - return found; - } - var help = helpers[type], - mode = this.getModeAt(pos); - if (typeof mode[type] == "string") { - if (help[mode[type]]) { - found.push(help[mode[type]]); - } - } else if (mode[type]) { - for (var i2 = 0; i2 < mode[type].length; i2++) { - var val = help[mode[type][i2]]; - if (val) { - found.push(val); - } - } - } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]); - } else if (help[mode.name]) { - found.push(help[mode.name]); - } - for (var i$12 = 0; i$12 < help._global.length; i$12++) { - var cur = help._global[i$12]; - if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) { - found.push(cur.val); - } - } - return found; - }, - getStateAfter: function (line, precise) { - var doc = this.doc; - line = clipLine(doc, line == null ? doc.first + doc.size - 1 : line); - return getContextBefore(this, line + 1, precise).state; - }, - cursorCoords: function (start, mode) { - var pos, - range2 = this.doc.sel.primary(); - if (start == null) { - pos = range2.head; - } else if (typeof start == "object") { - pos = clipPos(this.doc, start); - } else { - pos = start ? range2.from() : range2.to(); - } - return cursorCoords(this, pos, mode || "page"); - }, - charCoords: function (pos, mode) { - return charCoords(this, clipPos(this.doc, pos), mode || "page"); - }, - coordsChar: function (coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page"); - return coordsChar(this, coords.left, coords.top); - }, - lineAtHeight: function (height, mode) { - height = fromCoordSystem(this, { - top: height, - left: 0 - }, mode || "page").top; - return lineAtHeight(this.doc, height + this.display.viewOffset); - }, - heightAtLine: function (line, mode, includeWidgets) { - var end = false, - lineObj; - if (typeof line == "number") { - var last = this.doc.first + this.doc.size - 1; - if (line < this.doc.first) { - line = this.doc.first; - } else if (line > last) { - line = last; - end = true; - } - lineObj = getLine(this.doc, line); - } else { - lineObj = line; - } - return intoCoordSystem(this, lineObj, { - top: 0, - left: 0 - }, mode || "page", includeWidgets || end).top + (end ? this.doc.height - heightAtLine(lineObj) : 0); - }, - defaultTextHeight: function () { - return textHeight(this.display); - }, - defaultCharWidth: function () { - return charWidth(this.display); - }, - getViewport: function () { - return { - from: this.display.viewFrom, - to: this.display.viewTo - }; - }, - addWidget: function (pos, node, scroll, vert, horiz) { - var display = this.display; - pos = cursorCoords(this, clipPos(this.doc, pos)); - var top = pos.bottom, - left = pos.left; - node.style.position = "absolute"; - node.setAttribute("cm-ignore-events", "true"); - this.display.input.setUneditable(node); - display.sizer.appendChild(node); - if (vert == "over") { - top = pos.top; - } else if (vert == "above" || vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); - if ((vert == "above" || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) { - top = pos.top - node.offsetHeight; - } else if (pos.bottom + node.offsetHeight <= vspace) { - top = pos.bottom; - } - if (left + node.offsetWidth > hspace) { - left = hspace - node.offsetWidth; - } - } - node.style.top = top + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") { - left = 0; - } else if (horiz == "middle") { - left = (display.sizer.clientWidth - node.offsetWidth) / 2; - } - node.style.left = left + "px"; - } - if (scroll) { - scrollIntoView(this, { - left, - top, - right: left + node.offsetWidth, - bottom: top + node.offsetHeight - }); - } - }, - triggerOnKeyDown: methodOp(onKeyDown), - triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: onKeyUp, - triggerOnMouseDown: methodOp(onMouseDown), - execCommand: function (cmd) { - if (commands.hasOwnProperty(cmd)) { - return commands[cmd].call(null, this); - } - }, - triggerElectric: methodOp(function (text) { - triggerElectric(this, text); - }), - findPosH: function (from, amount, unit, visually) { - var dir = 1; - if (amount < 0) { - dir = -1; - amount = -amount; - } - var cur = clipPos(this.doc, from); - for (var i2 = 0; i2 < amount; ++i2) { - cur = findPosH(this.doc, cur, dir, unit, visually); - if (cur.hitSide) { - break; - } - } - return cur; - }, - moveH: methodOp(function (dir, unit) { - var this$1$1 = this; - this.extendSelectionsBy(function (range2) { - if (this$1$1.display.shift || this$1$1.doc.extend || range2.empty()) { - return findPosH(this$1$1.doc, range2.head, dir, unit, this$1$1.options.rtlMoveVisually); - } else { - return dir < 0 ? range2.from() : range2.to(); - } - }, sel_move); - }), - deleteH: methodOp(function (dir, unit) { - var sel = this.doc.sel, - doc = this.doc; - if (sel.somethingSelected()) { - doc.replaceSelection("", null, "+delete"); - } else { - deleteNearSelection(this, function (range2) { - var other = findPosH(doc, range2.head, dir, unit, false); - return dir < 0 ? { - from: other, - to: range2.head - } : { - from: range2.head, - to: other - }; - }); - } - }), - findPosV: function (from, amount, unit, goalColumn) { - var dir = 1, - x = goalColumn; - if (amount < 0) { - dir = -1; - amount = -amount; - } - var cur = clipPos(this.doc, from); - for (var i2 = 0; i2 < amount; ++i2) { - var coords = cursorCoords(this, cur, "div"); - if (x == null) { - x = coords.left; - } else { - coords.left = x; - } - cur = findPosV(this, coords, dir, unit); - if (cur.hitSide) { - break; - } - } - return cur; - }, - moveV: methodOp(function (dir, unit) { - var this$1$1 = this; - var doc = this.doc, - goals = []; - var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); - doc.extendSelectionsBy(function (range2) { - if (collapse) { - return dir < 0 ? range2.from() : range2.to(); - } - var headPos = cursorCoords(this$1$1, range2.head, "div"); - if (range2.goalColumn != null) { - headPos.left = range2.goalColumn; - } - goals.push(headPos.left); - var pos = findPosV(this$1$1, headPos, dir, unit); - if (unit == "page" && range2 == doc.sel.primary()) { - addToScrollTop(this$1$1, charCoords(this$1$1, pos, "div").top - headPos.top); - } - return pos; - }, sel_move); - if (goals.length) { - for (var i2 = 0; i2 < doc.sel.ranges.length; i2++) { - doc.sel.ranges[i2].goalColumn = goals[i2]; - } - } - }), - // Find the word at the given position (as returned by coordsChar). - findWordAt: function (pos) { - var doc = this.doc, - line = getLine(doc, pos.line).text; - var start = pos.ch, - end = pos.ch; - if (line) { - var helper = this.getHelper(pos, "wordChars"); - if ((pos.sticky == "before" || end == line.length) && start) { - --start; - } else { - ++end; - } - var startChar = line.charAt(start); - var check = isWordChar(startChar, helper) ? function (ch) { - return isWordChar(ch, helper); - } : /\s/.test(startChar) ? function (ch) { - return /\s/.test(ch); - } : function (ch) { - return !/\s/.test(ch) && !isWordChar(ch); - }; - while (start > 0 && check(line.charAt(start - 1))) { - --start; - } - while (end < line.length && check(line.charAt(end))) { - ++end; - } - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)); - }, - toggleOverwrite: function (value) { - if (value != null && value == this.state.overwrite) { - return; - } - if (this.state.overwrite = !this.state.overwrite) { - addClass(this.display.cursorDiv, "CodeMirror-overwrite"); - } else { - rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); - } - signal(this, "overwriteToggle", this, this.state.overwrite); - }, - hasFocus: function () { - return this.display.input.getField() == activeElt(); - }, - isReadOnly: function () { - return !!(this.options.readOnly || this.doc.cantEdit); - }, - scrollTo: methodOp(function (x, y) { - scrollToCoords(this, x, y); - }), - getScrollInfo: function () { - var scroller = this.display.scroller; - return { - left: scroller.scrollLeft, - top: scroller.scrollTop, - height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, - width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, - clientHeight: displayHeight(this), - clientWidth: displayWidth(this) - }; - }, - scrollIntoView: methodOp(function (range2, margin) { - if (range2 == null) { - range2 = { - from: this.doc.sel.primary().head, - to: null - }; - if (margin == null) { - margin = this.options.cursorScrollMargin; - } - } else if (typeof range2 == "number") { - range2 = { - from: Pos(range2, 0), - to: null - }; - } else if (range2.from == null) { - range2 = { - from: range2, - to: null - }; - } - if (!range2.to) { - range2.to = range2.from; - } - range2.margin = margin || 0; - if (range2.from.line != null) { - scrollToRange(this, range2); - } else { - scrollToCoordsRange(this, range2.from, range2.to, range2.margin); - } - }), - setSize: methodOp(function (width, height) { - var this$1$1 = this; - var interpret = function (val) { - return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; - }; - if (width != null) { - this.display.wrapper.style.width = interpret(width); - } - if (height != null) { - this.display.wrapper.style.height = interpret(height); - } - if (this.options.lineWrapping) { - clearLineMeasurementCache(this); - } - var lineNo2 = this.display.viewFrom; - this.doc.iter(lineNo2, this.display.viewTo, function (line) { - if (line.widgets) { - for (var i2 = 0; i2 < line.widgets.length; i2++) { - if (line.widgets[i2].noHScroll) { - regLineChange(this$1$1, lineNo2, "widget"); - break; - } - } - } - ++lineNo2; - }); - this.curOp.forceUpdate = true; - signal(this, "refresh", this); - }), - operation: function (f) { - return runInOp(this, f); - }, - startOperation: function () { - return startOperation(this); - }, - endOperation: function () { - return endOperation(this); - }, - refresh: methodOp(function () { - var oldHeight = this.display.cachedTextHeight; - regChange(this); - this.curOp.forceUpdate = true; - clearCaches(this); - scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); - updateGutterSpace(this.display); - if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > 0.5 || this.options.lineWrapping) { - estimateLineHeights(this); - } - signal(this, "refresh", this); - }), - swapDoc: methodOp(function (doc) { - var old = this.doc; - old.cm = null; - if (this.state.selectingText) { - this.state.selectingText(); - } - attachDoc(this, doc); - clearCaches(this); - this.display.input.reset(); - scrollToCoords(this, doc.scrollLeft, doc.scrollTop); - this.curOp.forceScroll = true; - signalLater(this, "swapDoc", this, old); - return old; - }), - phrase: function (phraseText) { - var phrases = this.options.phrases; - return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText; - }, - getInputField: function () { - return this.display.input.getField(); - }, - getWrapperElement: function () { - return this.display.wrapper; - }, - getScrollerElement: function () { - return this.display.scroller; - }, - getGutterElement: function () { - return this.display.gutters; - } - }; - eventMixin(CodeMirror2); - CodeMirror2.registerHelper = function (type, name, value) { - if (!helpers.hasOwnProperty(type)) { - helpers[type] = CodeMirror2[type] = { - _global: [] - }; - } - helpers[type][name] = value; - }; - CodeMirror2.registerGlobalHelper = function (type, name, predicate, value) { - CodeMirror2.registerHelper(type, name, value); - helpers[type]._global.push({ - pred: predicate, - val: value - }); - }; - } - function findPosH(doc, pos, dir, unit, visually) { - var oldPos = pos; - var origDir = dir; - var lineObj = getLine(doc, pos.line); - var lineDir = visually && doc.direction == "rtl" ? -dir : dir; - function findNextLine() { - var l = pos.line + lineDir; - if (l < doc.first || l >= doc.first + doc.size) { - return false; - } - pos = new Pos(l, pos.ch, pos.sticky); - return lineObj = getLine(doc, l); - } - function moveOnce(boundToLine) { - var next; - if (unit == "codepoint") { - var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1)); - if (isNaN(ch)) { - next = null; - } else { - var astral = dir > 0 ? ch >= 55296 && ch < 56320 : ch >= 56320 && ch < 57343; - next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir); - } - } else if (visually) { - next = moveVisually(doc.cm, lineObj, pos, dir); - } else { - next = moveLogically(lineObj, pos, dir); - } - if (next == null) { - if (!boundToLine && findNextLine()) { - pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); - } else { - return false; - } - } else { - pos = next; - } - return true; - } - if (unit == "char" || unit == "codepoint") { - moveOnce(); - } else if (unit == "column") { - moveOnce(true); - } else if (unit == "word" || unit == "group") { - var sawType = null, - group = unit == "group"; - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); - for (var first = true;; first = false) { - if (dir < 0 && !moveOnce(!first)) { - break; - } - var cur = lineObj.text.charAt(pos.ch) || "\n"; - var type = isWordChar(cur, helper) ? "w" : group && cur == "\n" ? "n" : !group || /\s/.test(cur) ? null : "p"; - if (group && !first && !type) { - type = "s"; - } - if (sawType && sawType != type) { - if (dir < 0) { - dir = 1; - moveOnce(); - pos.sticky = "after"; - } - break; - } - if (type) { - sawType = type; - } - if (dir > 0 && !moveOnce(!first)) { - break; - } - } - } - var result = skipAtomic(doc, pos, oldPos, origDir, true); - if (equalCursorPos(oldPos, result)) { - result.hitSide = true; + if (buffer.length) { + return buffer[buffer.length - 1]; + } + return defaults; + }, + useMedium: function (data) { + var item = middleware(data, assigned); + buffer.push(item); + return function () { + buffer = buffer.filter(function (x) { + return x !== item; + }); + }; + }, + assignSyncMedium: function (cb) { + assigned = true; + while (buffer.length) { + var cbs = buffer; + buffer = []; + cbs.forEach(cb); + } + buffer = { + push: function (x) { + return cb(x); + }, + filter: function () { + return buffer; } - return result; + }; + }, + assignMedium: function (cb) { + assigned = true; + var pendingQueue = []; + if (buffer.length) { + var cbs = buffer; + buffer = []; + cbs.forEach(cb); + pendingQueue = buffer; } - function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, - x = pos.left, - y; - if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); - var moveAmount = Math.max(pageSize - 0.5 * textHeight(cm.display), 3); - y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3; - } - var target; - for (;;) { - target = coordsChar(cm, x, y); - if (!target.outside) { - break; - } - if (dir < 0 ? y <= 0 : y >= doc.height) { - target.hitSide = true; - break; - } - y += dir * 5; + var executeQueue = function () { + var cbs = pendingQueue; + pendingQueue = []; + cbs.forEach(cb); + }; + var cycle = function () { + return Promise.resolve().then(executeQueue); + }; + cycle(); + buffer = { + push: function (x) { + pendingQueue.push(x); + cycle(); + }, + filter: function (filter) { + pendingQueue = pendingQueue.filter(filter); + return buffer; } - return target; + }; + } + }; + return medium; +} +function createMedium(defaults, middleware) { + if (middleware === void 0) { + middleware = ItoI; + } + return innerCreateMedium(defaults, middleware); +} +// eslint-disable-next-line @typescript-eslint/ban-types +function createSidecarMedium(options) { + if (options === void 0) { + options = {}; + } + var medium = innerCreateMedium(null); + medium.options = (0, _tslib.__assign)({ + async: true, + ssr: false + }, options); + return medium; +} + +/***/ }), + +/***/ "../../../node_modules/use-sidecar/dist/es2015/renderProp.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/use-sidecar/dist/es2015/renderProp.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.renderCar = renderCar; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.mjs"); +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var React = _react; +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function renderCar(WrappedComponent, defaults) { + function State(_a) { + var stateRef = _a.stateRef, + props = _a.props; + var renderTarget = (0, _react.useCallback)(function SideTarget() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + (0, _react.useLayoutEffect)(function () { + stateRef.current(args); + }); + return null; + }, []); + // @ts-ignore + return /*#__PURE__*/React.createElement(WrappedComponent, (0, _tslib.__assign)({}, props, { + children: renderTarget + })); + } + var Children = /*#__PURE__*/React.memo(function (_a) { + var stateRef = _a.stateRef, + defaultState = _a.defaultState, + children = _a.children; + var _b = (0, _react.useState)(defaultState.current), + state = _b[0], + setState = _b[1]; + (0, _react.useEffect)(function () { + stateRef.current = setState; + }, []); + return children.apply(void 0, state); + }, function () { + return true; + }); + return function Combiner(props) { + var defaultState = React.useRef(defaults(props)); + var ref = React.useRef(function (state) { + return defaultState.current = state; + }); + return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(State, { + stateRef: ref, + props: props + }), /*#__PURE__*/React.createElement(Children, { + stateRef: ref, + defaultState: defaultState, + children: props.children + })); + }; +} + +/***/ }), + +/***/ "../../../node_modules/vscode-languageserver-types/lib/esm/main.js": +/*!*************************************************************************!*\ + !*** ../../../node_modules/vscode-languageserver-types/lib/esm/main.js ***! + \*************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.uinteger = exports.integer = exports.WorkspaceSymbol = exports.WorkspaceFolder = exports.WorkspaceEdit = exports.WorkspaceChange = exports.VersionedTextDocumentIdentifier = exports.URI = exports.TextEdit = exports.TextDocumentItem = exports.TextDocumentIdentifier = exports.TextDocumentEdit = exports.TextDocument = exports.SymbolTag = exports.SymbolKind = exports.SymbolInformation = exports.SignatureInformation = exports.SemanticTokens = exports.SemanticTokenTypes = exports.SemanticTokenModifiers = exports.SelectionRange = exports.RenameFile = exports.Range = exports.Position = exports.ParameterInformation = exports.OptionalVersionedTextDocumentIdentifier = exports.MarkupKind = exports.MarkupContent = exports.MarkedString = exports.LocationLink = exports.Location = exports.InsertTextMode = exports.InsertTextFormat = exports.InsertReplaceEdit = exports.InlineValueVariableLookup = exports.InlineValueText = exports.InlineValueEvaluatableExpression = exports.InlineValueContext = exports.InlayHintLabelPart = exports.InlayHintKind = exports.InlayHint = exports.Hover = exports.FormattingOptions = exports.FoldingRangeKind = exports.FoldingRange = exports.EOL = exports.DocumentUri = exports.DocumentSymbol = exports.DocumentLink = exports.DocumentHighlightKind = exports.DocumentHighlight = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.Diagnostic = exports.DeleteFile = exports.CreateFile = exports.CompletionList = exports.CompletionItemTag = exports.CompletionItemLabelDetails = exports.CompletionItemKind = exports.CompletionItem = exports.Command = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.CodeLens = exports.CodeDescription = exports.CodeActionTriggerKind = exports.CodeActionKind = exports.CodeActionContext = exports.CodeAction = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.AnnotatedTextEdit = void 0; +var DocumentUri; +(function (DocumentUri) { + function is(value) { + return typeof value === 'string'; + } + DocumentUri.is = is; +})(DocumentUri || (exports.DocumentUri = DocumentUri = {})); +var URI; +(function (URI) { + function is(value) { + return typeof value === 'string'; + } + URI.is = is; +})(URI || (exports.URI = URI = {})); +var integer; +(function (integer) { + integer.MIN_VALUE = -2147483648; + integer.MAX_VALUE = 2147483647; + function is(value) { + return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE; + } + integer.is = is; +})(integer || (exports.integer = integer = {})); +var uinteger; +(function (uinteger) { + uinteger.MIN_VALUE = 0; + uinteger.MAX_VALUE = 2147483647; + function is(value) { + return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE; + } + uinteger.is = is; +})(uinteger || (exports.uinteger = uinteger = {})); +/** + * The Position namespace provides helper functions to work with + * {@link Position} literals. + */ +var Position; +(function (Position) { + /** + * Creates a new Position literal from the given line and character. + * @param line The position's line. + * @param character The position's character. + */ + function create(line, character) { + if (line === Number.MAX_VALUE) { + line = uinteger.MAX_VALUE; + } + if (character === Number.MAX_VALUE) { + character = uinteger.MAX_VALUE; + } + return { + line: line, + character: character + }; + } + Position.create = create; + /** + * Checks whether the given literal conforms to the {@link Position} interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character); + } + Position.is = is; +})(Position || (exports.Position = Position = {})); +/** + * The Range namespace provides helper functions to work with + * {@link Range} literals. + */ +var Range; +(function (Range) { + function create(one, two, three, four) { + if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) { + return { + start: Position.create(one, two), + end: Position.create(three, four) + }; + } else if (Position.is(one) && Position.is(two)) { + return { + start: one, + end: two + }; + } else { + throw new Error("Range#create called with invalid arguments[".concat(one, ", ").concat(two, ", ").concat(three, ", ").concat(four, "]")); + } + } + Range.create = create; + /** + * Checks whether the given literal conforms to the {@link Range} interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + } + Range.is = is; +})(Range || (exports.Range = Range = {})); +/** + * The Location namespace provides helper functions to work with + * {@link Location} literals. + */ +var Location; +(function (Location) { + /** + * Creates a Location literal. + * @param uri The location's uri. + * @param range The location's range. + */ + function create(uri, range) { + return { + uri: uri, + range: range + }; + } + Location.create = create; + /** + * Checks whether the given literal conforms to the {@link Location} interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + } + Location.is = is; +})(Location || (exports.Location = Location = {})); +/** + * The LocationLink namespace provides helper functions to work with + * {@link LocationLink} literals. + */ +var LocationLink; +(function (LocationLink) { + /** + * Creates a LocationLink literal. + * @param targetUri The definition's uri. + * @param targetRange The full range of the definition. + * @param targetSelectionRange The span of the symbol definition at the target. + * @param originSelectionRange The span of the symbol being defined in the originating source file. + */ + function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { + return { + targetUri: targetUri, + targetRange: targetRange, + targetSelectionRange: targetSelectionRange, + originSelectionRange: originSelectionRange + }; + } + LocationLink.create = create; + /** + * Checks whether the given literal conforms to the {@link LocationLink} interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); + } + LocationLink.is = is; +})(LocationLink || (exports.LocationLink = LocationLink = {})); +/** + * The Color namespace provides helper functions to work with + * {@link Color} literals. + */ +var Color; +(function (Color) { + /** + * Creates a new Color literal. + */ + function create(red, green, blue, alpha) { + return { + red: red, + green: green, + blue: blue, + alpha: alpha + }; + } + Color.create = create; + /** + * Checks whether the given literal conforms to the {@link Color} interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1); + } + Color.is = is; +})(Color || (exports.Color = Color = {})); +/** + * The ColorInformation namespace provides helper functions to work with + * {@link ColorInformation} literals. + */ +var ColorInformation; +(function (ColorInformation) { + /** + * Creates a new ColorInformation literal. + */ + function create(range, color) { + return { + range: range, + color: color + }; + } + ColorInformation.create = create; + /** + * Checks whether the given literal conforms to the {@link ColorInformation} interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color); + } + ColorInformation.is = is; +})(ColorInformation || (exports.ColorInformation = ColorInformation = {})); +/** + * The Color namespace provides helper functions to work with + * {@link ColorPresentation} literals. + */ +var ColorPresentation; +(function (ColorPresentation) { + /** + * Creates a new ColorInformation literal. + */ + function create(label, textEdit, additionalTextEdits) { + return { + label: label, + textEdit: textEdit, + additionalTextEdits: additionalTextEdits + }; + } + ColorPresentation.create = create; + /** + * Checks whether the given literal conforms to the {@link ColorInformation} interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); + } + ColorPresentation.is = is; +})(ColorPresentation || (exports.ColorPresentation = ColorPresentation = {})); +/** + * A set of predefined range kinds. + */ +var FoldingRangeKind; +(function (FoldingRangeKind) { + /** + * Folding range for a comment + */ + FoldingRangeKind.Comment = 'comment'; + /** + * Folding range for an import or include + */ + FoldingRangeKind.Imports = 'imports'; + /** + * Folding range for a region (e.g. `#region`) + */ + FoldingRangeKind.Region = 'region'; +})(FoldingRangeKind || (exports.FoldingRangeKind = FoldingRangeKind = {})); +/** + * The folding range namespace provides helper functions to work with + * {@link FoldingRange} literals. + */ +var FoldingRange; +(function (FoldingRange) { + /** + * Creates a new FoldingRange literal. + */ + function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) { + var result = { + startLine: startLine, + endLine: endLine + }; + if (Is.defined(startCharacter)) { + result.startCharacter = startCharacter; + } + if (Is.defined(endCharacter)) { + result.endCharacter = endCharacter; + } + if (Is.defined(kind)) { + result.kind = kind; + } + if (Is.defined(collapsedText)) { + result.collapsedText = collapsedText; + } + return result; + } + FoldingRange.create = create; + /** + * Checks whether the given literal conforms to the {@link FoldingRange} interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); + } + FoldingRange.is = is; +})(FoldingRange || (exports.FoldingRange = FoldingRange = {})); +/** + * The DiagnosticRelatedInformation namespace provides helper functions to work with + * {@link DiagnosticRelatedInformation} literals. + */ +var DiagnosticRelatedInformation; +(function (DiagnosticRelatedInformation) { + /** + * Creates a new DiagnosticRelatedInformation literal. + */ + function create(location, message) { + return { + location: location, + message: message + }; + } + DiagnosticRelatedInformation.create = create; + /** + * Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); + } + DiagnosticRelatedInformation.is = is; +})(DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = DiagnosticRelatedInformation = {})); +/** + * The diagnostic's severity. + */ +var DiagnosticSeverity; +(function (DiagnosticSeverity) { + /** + * Reports an error. + */ + DiagnosticSeverity.Error = 1; + /** + * Reports a warning. + */ + DiagnosticSeverity.Warning = 2; + /** + * Reports an information. + */ + DiagnosticSeverity.Information = 3; + /** + * Reports a hint. + */ + DiagnosticSeverity.Hint = 4; +})(DiagnosticSeverity || (exports.DiagnosticSeverity = DiagnosticSeverity = {})); +/** + * The diagnostic tags. + * + * @since 3.15.0 + */ +var DiagnosticTag; +(function (DiagnosticTag) { + /** + * Unused or unnecessary code. + * + * Clients are allowed to render diagnostics with this tag faded out instead of having + * an error squiggle. + */ + DiagnosticTag.Unnecessary = 1; + /** + * Deprecated or obsolete code. + * + * Clients are allowed to rendered diagnostics with this tag strike through. + */ + DiagnosticTag.Deprecated = 2; +})(DiagnosticTag || (exports.DiagnosticTag = DiagnosticTag = {})); +/** + * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes. + * + * @since 3.16.0 + */ +var CodeDescription; +(function (CodeDescription) { + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.href); + } + CodeDescription.is = is; +})(CodeDescription || (exports.CodeDescription = CodeDescription = {})); +/** + * The Diagnostic namespace provides helper functions to work with + * {@link Diagnostic} literals. + */ +var Diagnostic; +(function (Diagnostic) { + /** + * Creates a new Diagnostic literal. + */ + function create(range, message, severity, code, source, relatedInformation) { + var result = { + range: range, + message: message + }; + if (Is.defined(severity)) { + result.severity = severity; + } + if (Is.defined(code)) { + result.code = code; + } + if (Is.defined(source)) { + result.source = source; + } + if (Is.defined(relatedInformation)) { + result.relatedInformation = relatedInformation; + } + return result; + } + Diagnostic.create = create; + /** + * Checks whether the given literal conforms to the {@link Diagnostic} interface. + */ + function is(value) { + var _a; + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); + } + Diagnostic.is = is; +})(Diagnostic || (exports.Diagnostic = Diagnostic = {})); +/** + * The Command namespace provides helper functions to work with + * {@link Command} literals. + */ +var Command; +(function (Command) { + /** + * Creates a new Command literal. + */ + function create(title, command) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var result = { + title: title, + command: command + }; + if (Is.defined(args) && args.length > 0) { + result.arguments = args; + } + return result; + } + Command.create = create; + /** + * Checks whether the given literal conforms to the {@link Command} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); + } + Command.is = is; +})(Command || (exports.Command = Command = {})); +/** + * The TextEdit namespace provides helper function to create replace, + * insert and delete edits more easily. + */ +var TextEdit; +(function (TextEdit) { + /** + * Creates a replace text edit. + * @param range The range of text to be replaced. + * @param newText The new text. + */ + function replace(range, newText) { + return { + range: range, + newText: newText + }; + } + TextEdit.replace = replace; + /** + * Creates an insert text edit. + * @param position The position to insert the text at. + * @param newText The text to be inserted. + */ + function insert(position, newText) { + return { + range: { + start: position, + end: position + }, + newText: newText + }; + } + TextEdit.insert = insert; + /** + * Creates a delete text edit. + * @param range The range of text to be deleted. + */ + function del(range) { + return { + range: range, + newText: '' + }; + } + TextEdit.del = del; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range); + } + TextEdit.is = is; +})(TextEdit || (exports.TextEdit = TextEdit = {})); +var ChangeAnnotation; +(function (ChangeAnnotation) { + function create(label, needsConfirmation, description) { + var result = { + label: label + }; + if (needsConfirmation !== undefined) { + result.needsConfirmation = needsConfirmation; + } + if (description !== undefined) { + result.description = description; + } + return result; + } + ChangeAnnotation.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) && (Is.string(candidate.description) || candidate.description === undefined); + } + ChangeAnnotation.is = is; +})(ChangeAnnotation || (exports.ChangeAnnotation = ChangeAnnotation = {})); +var ChangeAnnotationIdentifier; +(function (ChangeAnnotationIdentifier) { + function is(value) { + var candidate = value; + return Is.string(candidate); + } + ChangeAnnotationIdentifier.is = is; +})(ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = ChangeAnnotationIdentifier = {})); +var AnnotatedTextEdit; +(function (AnnotatedTextEdit) { + /** + * Creates an annotated replace text edit. + * + * @param range The range of text to be replaced. + * @param newText The new text. + * @param annotation The annotation. + */ + function replace(range, newText, annotation) { + return { + range: range, + newText: newText, + annotationId: annotation + }; + } + AnnotatedTextEdit.replace = replace; + /** + * Creates an annotated insert text edit. + * + * @param position The position to insert the text at. + * @param newText The text to be inserted. + * @param annotation The annotation. + */ + function insert(position, newText, annotation) { + return { + range: { + start: position, + end: position + }, + newText: newText, + annotationId: annotation + }; + } + AnnotatedTextEdit.insert = insert; + /** + * Creates an annotated delete text edit. + * + * @param range The range of text to be deleted. + * @param annotation The annotation. + */ + function del(range, annotation) { + return { + range: range, + newText: '', + annotationId: annotation + }; + } + AnnotatedTextEdit.del = del; + function is(value) { + var candidate = value; + return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + AnnotatedTextEdit.is = is; +})(AnnotatedTextEdit || (exports.AnnotatedTextEdit = AnnotatedTextEdit = {})); +/** + * The TextDocumentEdit namespace provides helper function to create + * an edit that manipulates a text document. + */ +var TextDocumentEdit; +(function (TextDocumentEdit) { + /** + * Creates a new `TextDocumentEdit` + */ + function create(textDocument, edits) { + return { + textDocument: textDocument, + edits: edits + }; + } + TextDocumentEdit.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits); + } + TextDocumentEdit.is = is; +})(TextDocumentEdit || (exports.TextDocumentEdit = TextDocumentEdit = {})); +var CreateFile; +(function (CreateFile) { + function create(uri, options, annotation) { + var result = { + kind: 'create', + uri: uri + }; + if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) { + result.options = options; + } + if (annotation !== undefined) { + result.annotationId = annotation; + } + return result; + } + CreateFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + CreateFile.is = is; +})(CreateFile || (exports.CreateFile = CreateFile = {})); +var RenameFile; +(function (RenameFile) { + function create(oldUri, newUri, options, annotation) { + var result = { + kind: 'rename', + oldUri: oldUri, + newUri: newUri + }; + if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) { + result.options = options; + } + if (annotation !== undefined) { + result.annotationId = annotation; + } + return result; + } + RenameFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + RenameFile.is = is; +})(RenameFile || (exports.RenameFile = RenameFile = {})); +var DeleteFile; +(function (DeleteFile) { + function create(uri, options, annotation) { + var result = { + kind: 'delete', + uri: uri + }; + if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) { + result.options = options; + } + if (annotation !== undefined) { + result.annotationId = annotation; + } + return result; + } + DeleteFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + DeleteFile.is = is; +})(DeleteFile || (exports.DeleteFile = DeleteFile = {})); +var WorkspaceEdit; +(function (WorkspaceEdit) { + function is(value) { + var candidate = value; + return candidate && (candidate.changes !== undefined || candidate.documentChanges !== undefined) && (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) { + if (Is.string(change.kind)) { + return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); + } else { + return TextDocumentEdit.is(change); } - var ContentEditableInput = function (cm) { - this.cm = cm; - this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; - this.polling = new Delayed(); - this.composing = null; - this.gracePeriod = false; - this.readDOMTimeout = null; - }; - ContentEditableInput.prototype.init = function (display) { - var this$1$1 = this; - var input = this, - cm = input.cm; - var div = input.div = display.lineDiv; - div.contentEditable = true; - disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize); - function belongsToInput(e) { - for (var t = e.target; t; t = t.parentNode) { - if (t == div) { - return true; - } - if (/\bCodeMirror-(?:line)?widget\b/.test(t.className)) { - break; - } - } - return false; - } - on(div, "paste", function (e) { - if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { - return; - } - if (ie_version <= 11) { - setTimeout(operation(cm, function () { - return this$1$1.updateFromDOM(); - }), 20); - } - }); - on(div, "compositionstart", function (e) { - this$1$1.composing = { - data: e.data, - done: false - }; - }); - on(div, "compositionupdate", function (e) { - if (!this$1$1.composing) { - this$1$1.composing = { - data: e.data, - done: false - }; - } - }); - on(div, "compositionend", function (e) { - if (this$1$1.composing) { - if (e.data != this$1$1.composing.data) { - this$1$1.readFromDOMSoon(); - } - this$1$1.composing.done = true; + })); + } + WorkspaceEdit.is = is; +})(WorkspaceEdit || (exports.WorkspaceEdit = WorkspaceEdit = {})); +var TextEditChangeImpl = /** @class */function () { + function TextEditChangeImpl(edits, changeAnnotations) { + this.edits = edits; + this.changeAnnotations = changeAnnotations; + } + TextEditChangeImpl.prototype.insert = function (position, newText, annotation) { + var edit; + var id; + if (annotation === undefined) { + edit = TextEdit.insert(position, newText); + } else if (ChangeAnnotationIdentifier.is(annotation)) { + id = annotation; + edit = AnnotatedTextEdit.insert(position, newText, annotation); + } else { + this.assertChangeAnnotations(this.changeAnnotations); + id = this.changeAnnotations.manage(annotation); + edit = AnnotatedTextEdit.insert(position, newText, id); + } + this.edits.push(edit); + if (id !== undefined) { + return id; + } + }; + TextEditChangeImpl.prototype.replace = function (range, newText, annotation) { + var edit; + var id; + if (annotation === undefined) { + edit = TextEdit.replace(range, newText); + } else if (ChangeAnnotationIdentifier.is(annotation)) { + id = annotation; + edit = AnnotatedTextEdit.replace(range, newText, annotation); + } else { + this.assertChangeAnnotations(this.changeAnnotations); + id = this.changeAnnotations.manage(annotation); + edit = AnnotatedTextEdit.replace(range, newText, id); + } + this.edits.push(edit); + if (id !== undefined) { + return id; + } + }; + TextEditChangeImpl.prototype.delete = function (range, annotation) { + var edit; + var id; + if (annotation === undefined) { + edit = TextEdit.del(range); + } else if (ChangeAnnotationIdentifier.is(annotation)) { + id = annotation; + edit = AnnotatedTextEdit.del(range, annotation); + } else { + this.assertChangeAnnotations(this.changeAnnotations); + id = this.changeAnnotations.manage(annotation); + edit = AnnotatedTextEdit.del(range, id); + } + this.edits.push(edit); + if (id !== undefined) { + return id; + } + }; + TextEditChangeImpl.prototype.add = function (edit) { + this.edits.push(edit); + }; + TextEditChangeImpl.prototype.all = function () { + return this.edits; + }; + TextEditChangeImpl.prototype.clear = function () { + this.edits.splice(0, this.edits.length); + }; + TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) { + if (value === undefined) { + throw new Error("Text edit change is not configured to manage change annotations."); + } + }; + return TextEditChangeImpl; +}(); +/** + * A helper class + */ +var ChangeAnnotations = /** @class */function () { + function ChangeAnnotations(annotations) { + this._annotations = annotations === undefined ? Object.create(null) : annotations; + this._counter = 0; + this._size = 0; + } + ChangeAnnotations.prototype.all = function () { + return this._annotations; + }; + Object.defineProperty(ChangeAnnotations.prototype, "size", { + get: function () { + return this._size; + }, + enumerable: false, + configurable: true + }); + ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) { + var id; + if (ChangeAnnotationIdentifier.is(idOrAnnotation)) { + id = idOrAnnotation; + } else { + id = this.nextId(); + annotation = idOrAnnotation; + } + if (this._annotations[id] !== undefined) { + throw new Error("Id ".concat(id, " is already in use.")); + } + if (annotation === undefined) { + throw new Error("No annotation provided for id ".concat(id)); + } + this._annotations[id] = annotation; + this._size++; + return id; + }; + ChangeAnnotations.prototype.nextId = function () { + this._counter++; + return this._counter.toString(); + }; + return ChangeAnnotations; +}(); +/** + * A workspace change helps constructing changes to a workspace. + */ +var WorkspaceChange = exports.WorkspaceChange = /** @class */function () { + function WorkspaceChange(workspaceEdit) { + var _this = this; + this._textEditChanges = Object.create(null); + if (workspaceEdit !== undefined) { + this._workspaceEdit = workspaceEdit; + if (workspaceEdit.documentChanges) { + this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations); + workspaceEdit.changeAnnotations = this._changeAnnotations.all(); + workspaceEdit.documentChanges.forEach(function (change) { + if (TextDocumentEdit.is(change)) { + var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations); + _this._textEditChanges[change.textDocument.uri] = textEditChange; } }); - on(div, "touchstart", function () { - return input.forceCompositionEnd(); - }); - on(div, "input", function () { - if (!this$1$1.composing) { - this$1$1.readFromDOMSoon(); - } + } else if (workspaceEdit.changes) { + Object.keys(workspaceEdit.changes).forEach(function (key) { + var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); + _this._textEditChanges[key] = textEditChange; }); - function onCopyCut(e) { - if (!belongsToInput(e) || signalDOMEvent(cm, e)) { - return; - } - if (cm.somethingSelected()) { - setLastCopied({ - lineWise: false, - text: cm.getSelections() - }); - if (e.type == "cut") { - cm.replaceSelection("", null, "cut"); - } - } else if (!cm.options.lineWiseCopyCut) { - return; - } else { - var ranges = copyableRanges(cm); - setLastCopied({ - lineWise: true, - text: ranges.text - }); - if (e.type == "cut") { - cm.operation(function () { - cm.setSelections(ranges.ranges, 0, sel_dontScroll); - cm.replaceSelection("", null, "cut"); - }); - } - } - if (e.clipboardData) { - e.clipboardData.clearData(); - var content = lastCopied.text.join("\n"); - e.clipboardData.setData("Text", content); - if (e.clipboardData.getData("Text") == content) { - e.preventDefault(); - return; - } - } - var kludge = hiddenTextarea(), - te = kludge.firstChild; - cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); - te.value = lastCopied.text.join("\n"); - var hadFocus = activeElt(); - selectInput(te); - setTimeout(function () { - cm.display.lineSpace.removeChild(kludge); - hadFocus.focus(); - if (hadFocus == div) { - input.showPrimarySelection(); - } - }, 50); - } - on(div, "copy", onCopyCut); - on(div, "cut", onCopyCut); - }; - ContentEditableInput.prototype.screenReaderLabelChanged = function (label) { - if (label) { - this.div.setAttribute("aria-label", label); + } + } else { + this._workspaceEdit = {}; + } + } + Object.defineProperty(WorkspaceChange.prototype, "edit", { + /** + * Returns the underlying {@link WorkspaceEdit} literal + * use to be returned from a workspace edit operation like rename. + */ + get: function () { + this.initDocumentChanges(); + if (this._changeAnnotations !== undefined) { + if (this._changeAnnotations.size === 0) { + this._workspaceEdit.changeAnnotations = undefined; } else { - this.div.removeAttribute("aria-label"); - } - }; - ContentEditableInput.prototype.prepareSelection = function () { - var result = prepareSelection(this.cm, false); - result.focus = activeElt() == this.div; - return result; - }; - ContentEditableInput.prototype.showSelection = function (info, takeFocus) { - if (!info || !this.cm.display.view.length) { - return; - } - if (info.focus || takeFocus) { - this.showPrimarySelection(); + this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); } - this.showMultipleSelections(info); - }; - ContentEditableInput.prototype.getSelection = function () { - return this.cm.display.wrapper.ownerDocument.getSelection(); + } + return this._workspaceEdit; + }, + enumerable: false, + configurable: true + }); + WorkspaceChange.prototype.getTextEditChange = function (key) { + if (OptionalVersionedTextDocumentIdentifier.is(key)) { + this.initDocumentChanges(); + if (this._workspaceEdit.documentChanges === undefined) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var textDocument = { + uri: key.uri, + version: key.version }; - ContentEditableInput.prototype.showPrimarySelection = function () { - var sel = this.getSelection(), - cm = this.cm, - prim = cm.doc.sel.primary(); - var from = prim.from(), - to = prim.to(); - if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { - sel.removeAllRanges(); - return; - } - var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); - if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && cmp(minPos(curAnchor, curFocus), from) == 0 && cmp(maxPos(curAnchor, curFocus), to) == 0) { - return; - } - var view = cm.display.view; - var start = from.line >= cm.display.viewFrom && posToDOM(cm, from) || { - node: view[0].measure.map[2], - offset: 0 + var result = this._textEditChanges[textDocument.uri]; + if (!result) { + var edits = []; + var textDocumentEdit = { + textDocument: textDocument, + edits: edits }; - var end = to.line < cm.display.viewTo && posToDOM(cm, to); - if (!end) { - var measure = view[view.length - 1].measure; - var map2 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; - end = { - node: map2[map2.length - 1], - offset: map2[map2.length - 2] - map2[map2.length - 3] - }; - } - if (!start || !end) { - sel.removeAllRanges(); - return; - } - var old = sel.rangeCount && sel.getRangeAt(0), - rng; - try { - rng = range(start.node, start.offset, end.offset, end.node); - } catch (e) {} - if (rng) { - if (!gecko && cm.state.focused) { - sel.collapse(start.node, start.offset); - if (!rng.collapsed) { - sel.removeAllRanges(); - sel.addRange(rng); - } - } else { - sel.removeAllRanges(); - sel.addRange(rng); - } - if (old && sel.anchorNode == null) { - sel.addRange(old); - } else if (gecko) { - this.startGracePeriod(); - } - } - this.rememberSelection(); - }; - ContentEditableInput.prototype.startGracePeriod = function () { - var this$1$1 = this; - clearTimeout(this.gracePeriod); - this.gracePeriod = setTimeout(function () { - this$1$1.gracePeriod = false; - if (this$1$1.selectionChanged()) { - this$1$1.cm.operation(function () { - return this$1$1.cm.curOp.selectionChanged = true; - }); - } - }, 20); - }; - ContentEditableInput.prototype.showMultipleSelections = function (info) { - removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); - removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); - }; - ContentEditableInput.prototype.rememberSelection = function () { - var sel = this.getSelection(); - this.lastAnchorNode = sel.anchorNode; - this.lastAnchorOffset = sel.anchorOffset; - this.lastFocusNode = sel.focusNode; - this.lastFocusOffset = sel.focusOffset; - }; - ContentEditableInput.prototype.selectionInEditor = function () { - var sel = this.getSelection(); - if (!sel.rangeCount) { - return false; - } - var node = sel.getRangeAt(0).commonAncestorContainer; - return contains(this.div, node); - }; - ContentEditableInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor") { - if (!this.selectionInEditor() || activeElt() != this.div) { - this.showSelection(this.prepareSelection(), true); - } - this.div.focus(); - } - }; - ContentEditableInput.prototype.blur = function () { - this.div.blur(); - }; - ContentEditableInput.prototype.getField = function () { - return this.div; - }; - ContentEditableInput.prototype.supportsTouch = function () { - return true; - }; - ContentEditableInput.prototype.receivedFocus = function () { - var this$1$1 = this; - var input = this; - if (this.selectionInEditor()) { - setTimeout(function () { - return this$1$1.pollSelection(); - }, 20); - } else { - runInOp(this.cm, function () { - return input.cm.curOp.selectionChanged = true; - }); - } - function poll() { - if (input.cm.state.focused) { - input.pollSelection(); - input.polling.set(input.cm.options.pollInterval, poll); - } - } - this.polling.set(this.cm.options.pollInterval, poll); - }; - ContentEditableInput.prototype.selectionChanged = function () { - var sel = this.getSelection(); - return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; - }; - ContentEditableInput.prototype.pollSelection = function () { - if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { - return; - } - var sel = this.getSelection(), - cm = this.cm; - if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) { - this.cm.triggerOnKeyDown({ - type: "keydown", - keyCode: 8, - preventDefault: Math.abs - }); - this.blur(); - this.focus(); - return; - } - if (this.composing) { - return; - } - this.rememberSelection(); - var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var head = domToPos(cm, sel.focusNode, sel.focusOffset); - if (anchor && head) { - runInOp(cm, function () { - setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); - if (anchor.bad || head.bad) { - cm.curOp.selectionChanged = true; - } - }); - } - }; - ContentEditableInput.prototype.pollContent = function () { - if (this.readDOMTimeout != null) { - clearTimeout(this.readDOMTimeout); - this.readDOMTimeout = null; - } - var cm = this.cm, - display = cm.display, - sel = cm.doc.sel.primary(); - var from = sel.from(), - to = sel.to(); - if (from.ch == 0 && from.line > cm.firstLine()) { - from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); - } - if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) { - to = Pos(to.line + 1, 0); - } - if (from.line < display.viewFrom || to.line > display.viewTo - 1) { - return false; - } - var fromIndex, fromLine, fromNode; - if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { - fromLine = lineNo(display.view[0].line); - fromNode = display.view[0].node; - } else { - fromLine = lineNo(display.view[fromIndex].line); - fromNode = display.view[fromIndex - 1].node.nextSibling; - } - var toIndex = findViewIndex(cm, to.line); - var toLine, toNode; - if (toIndex == display.view.length - 1) { - toLine = display.viewTo - 1; - toNode = display.lineDiv.lastChild; - } else { - toLine = lineNo(display.view[toIndex + 1].line) - 1; - toNode = display.view[toIndex + 1].node.previousSibling; - } - if (!fromNode) { - return false; - } - var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); - var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); - while (newText.length > 1 && oldText.length > 1) { - if (lst(newText) == lst(oldText)) { - newText.pop(); - oldText.pop(); - toLine--; - } else if (newText[0] == oldText[0]) { - newText.shift(); - oldText.shift(); - fromLine++; - } else { - break; - } - } - var cutFront = 0, - cutEnd = 0; - var newTop = newText[0], - oldTop = oldText[0], - maxCutFront = Math.min(newTop.length, oldTop.length); - while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) { - ++cutFront; - } - var newBot = lst(newText), - oldBot = lst(oldText); - var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), oldBot.length - (oldText.length == 1 ? cutFront : 0)); - while (cutEnd < maxCutEnd && newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { - ++cutEnd; - } - if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { - while (cutFront && cutFront > from.ch && newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { - cutFront--; - cutEnd++; - } - } - newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); - newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); - var chFrom = Pos(fromLine, cutFront); - var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); - if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { - replaceRange(cm.doc, newText, chFrom, chTo, "+input"); - return true; - } - }; - ContentEditableInput.prototype.ensurePolled = function () { - this.forceCompositionEnd(); - }; - ContentEditableInput.prototype.reset = function () { - this.forceCompositionEnd(); - }; - ContentEditableInput.prototype.forceCompositionEnd = function () { - if (!this.composing) { - return; - } - clearTimeout(this.readDOMTimeout); - this.composing = null; - this.updateFromDOM(); - this.div.blur(); - this.div.focus(); - }; - ContentEditableInput.prototype.readFromDOMSoon = function () { - var this$1$1 = this; - if (this.readDOMTimeout != null) { - return; - } - this.readDOMTimeout = setTimeout(function () { - this$1$1.readDOMTimeout = null; - if (this$1$1.composing) { - if (this$1$1.composing.done) { - this$1$1.composing = null; - } else { - return; - } - } - this$1$1.updateFromDOM(); - }, 80); - }; - ContentEditableInput.prototype.updateFromDOM = function () { - var this$1$1 = this; - if (this.cm.isReadOnly() || !this.pollContent()) { - runInOp(this.cm, function () { - return regChange(this$1$1.cm); - }); - } - }; - ContentEditableInput.prototype.setUneditable = function (node) { - node.contentEditable = "false"; - }; - ContentEditableInput.prototype.onKeyPress = function (e) { - if (e.charCode == 0 || this.composing) { - return; - } - e.preventDefault(); - if (!this.cm.isReadOnly()) { - operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); - } - }; - ContentEditableInput.prototype.readOnlyChanged = function (val) { - this.div.contentEditable = String(val != "nocursor"); - }; - ContentEditableInput.prototype.onContextMenu = function () {}; - ContentEditableInput.prototype.resetPosition = function () {}; - ContentEditableInput.prototype.needsContentAttribute = true; - function posToDOM(cm, pos) { - var view = findViewForLine(cm, pos.line); - if (!view || view.hidden) { - return null; - } - var line = getLine(cm.doc, pos.line); - var info = mapFromLineView(view, line, pos.line); - var order = getOrder(line, cm.doc.direction), - side = "left"; - if (order) { - var partPos = getBidiPartAt(order, pos.ch); - side = partPos % 2 ? "right" : "left"; - } - var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); - result.offset = result.collapse == "right" ? result.end : result.start; - return result; + this._workspaceEdit.documentChanges.push(textDocumentEdit); + result = new TextEditChangeImpl(edits, this._changeAnnotations); + this._textEditChanges[textDocument.uri] = result; } - function isInGutter(node) { - for (var scan = node; scan; scan = scan.parentNode) { - if (/CodeMirror-gutter-wrapper/.test(scan.className)) { - return true; - } - } - return false; + return result; + } else { + this.initChanges(); + if (this._workspaceEdit.changes === undefined) { + throw new Error('Workspace edit is not configured for normal text edit changes.'); + } + var result = this._textEditChanges[key]; + if (!result) { + var edits = []; + this._workspaceEdit.changes[key] = edits; + result = new TextEditChangeImpl(edits); + this._textEditChanges[key] = result; + } + return result; + } + }; + WorkspaceChange.prototype.initDocumentChanges = function () { + if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) { + this._changeAnnotations = new ChangeAnnotations(); + this._workspaceEdit.documentChanges = []; + this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); + } + }; + WorkspaceChange.prototype.initChanges = function () { + if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) { + this._workspaceEdit.changes = Object.create(null); + } + }; + WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) { + this.initDocumentChanges(); + if (this._workspaceEdit.documentChanges === undefined) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var annotation; + if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { + annotation = optionsOrAnnotation; + } else { + options = optionsOrAnnotation; + } + var operation; + var id; + if (annotation === undefined) { + operation = CreateFile.create(uri, options); + } else { + id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); + operation = CreateFile.create(uri, options, id); + } + this._workspaceEdit.documentChanges.push(operation); + if (id !== undefined) { + return id; + } + }; + WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) { + this.initDocumentChanges(); + if (this._workspaceEdit.documentChanges === undefined) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var annotation; + if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { + annotation = optionsOrAnnotation; + } else { + options = optionsOrAnnotation; + } + var operation; + var id; + if (annotation === undefined) { + operation = RenameFile.create(oldUri, newUri, options); + } else { + id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); + operation = RenameFile.create(oldUri, newUri, options, id); + } + this._workspaceEdit.documentChanges.push(operation); + if (id !== undefined) { + return id; + } + }; + WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) { + this.initDocumentChanges(); + if (this._workspaceEdit.documentChanges === undefined) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var annotation; + if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { + annotation = optionsOrAnnotation; + } else { + options = optionsOrAnnotation; + } + var operation; + var id; + if (annotation === undefined) { + operation = DeleteFile.create(uri, options); + } else { + id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); + operation = DeleteFile.create(uri, options, id); + } + this._workspaceEdit.documentChanges.push(operation); + if (id !== undefined) { + return id; + } + }; + return WorkspaceChange; +}(); +/** + * The TextDocumentIdentifier namespace provides helper functions to work with + * {@link TextDocumentIdentifier} literals. + */ +var TextDocumentIdentifier; +(function (TextDocumentIdentifier) { + /** + * Creates a new TextDocumentIdentifier literal. + * @param uri The document's uri. + */ + function create(uri) { + return { + uri: uri + }; + } + TextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri); + } + TextDocumentIdentifier.is = is; +})(TextDocumentIdentifier || (exports.TextDocumentIdentifier = TextDocumentIdentifier = {})); +/** + * The VersionedTextDocumentIdentifier namespace provides helper functions to work with + * {@link VersionedTextDocumentIdentifier} literals. + */ +var VersionedTextDocumentIdentifier; +(function (VersionedTextDocumentIdentifier) { + /** + * Creates a new VersionedTextDocumentIdentifier literal. + * @param uri The document's uri. + * @param version The document's version. + */ + function create(uri, version) { + return { + uri: uri, + version: version + }; + } + VersionedTextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version); + } + VersionedTextDocumentIdentifier.is = is; +})(VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = VersionedTextDocumentIdentifier = {})); +/** + * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with + * {@link OptionalVersionedTextDocumentIdentifier} literals. + */ +var OptionalVersionedTextDocumentIdentifier; +(function (OptionalVersionedTextDocumentIdentifier) { + /** + * Creates a new OptionalVersionedTextDocumentIdentifier literal. + * @param uri The document's uri. + * @param version The document's version. + */ + function create(uri, version) { + return { + uri: uri, + version: version + }; + } + OptionalVersionedTextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version)); + } + OptionalVersionedTextDocumentIdentifier.is = is; +})(OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = OptionalVersionedTextDocumentIdentifier = {})); +/** + * The TextDocumentItem namespace provides helper functions to work with + * {@link TextDocumentItem} literals. + */ +var TextDocumentItem; +(function (TextDocumentItem) { + /** + * Creates a new TextDocumentItem literal. + * @param uri The document's uri. + * @param languageId The document's language identifier. + * @param version The document's version number. + * @param text The document's text. + */ + function create(uri, languageId, version, text) { + return { + uri: uri, + languageId: languageId, + version: version, + text: text + }; + } + TextDocumentItem.create = create; + /** + * Checks whether the given literal conforms to the {@link TextDocumentItem} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text); + } + TextDocumentItem.is = is; +})(TextDocumentItem || (exports.TextDocumentItem = TextDocumentItem = {})); +/** + * Describes the content type that a client supports in various + * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. + * + * Please note that `MarkupKinds` must not start with a `$`. This kinds + * are reserved for internal usage. + */ +var MarkupKind; +(function (MarkupKind) { + /** + * Plain text is supported as a content format + */ + MarkupKind.PlainText = 'plaintext'; + /** + * Markdown is supported as a content format + */ + MarkupKind.Markdown = 'markdown'; + /** + * Checks whether the given value is a value of the {@link MarkupKind} type. + */ + function is(value) { + var candidate = value; + return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; + } + MarkupKind.is = is; +})(MarkupKind || (exports.MarkupKind = MarkupKind = {})); +var MarkupContent; +(function (MarkupContent) { + /** + * Checks whether the given value conforms to the {@link MarkupContent} interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); + } + MarkupContent.is = is; +})(MarkupContent || (exports.MarkupContent = MarkupContent = {})); +/** + * The kind of a completion entry. + */ +var CompletionItemKind; +(function (CompletionItemKind) { + CompletionItemKind.Text = 1; + CompletionItemKind.Method = 2; + CompletionItemKind.Function = 3; + CompletionItemKind.Constructor = 4; + CompletionItemKind.Field = 5; + CompletionItemKind.Variable = 6; + CompletionItemKind.Class = 7; + CompletionItemKind.Interface = 8; + CompletionItemKind.Module = 9; + CompletionItemKind.Property = 10; + CompletionItemKind.Unit = 11; + CompletionItemKind.Value = 12; + CompletionItemKind.Enum = 13; + CompletionItemKind.Keyword = 14; + CompletionItemKind.Snippet = 15; + CompletionItemKind.Color = 16; + CompletionItemKind.File = 17; + CompletionItemKind.Reference = 18; + CompletionItemKind.Folder = 19; + CompletionItemKind.EnumMember = 20; + CompletionItemKind.Constant = 21; + CompletionItemKind.Struct = 22; + CompletionItemKind.Event = 23; + CompletionItemKind.Operator = 24; + CompletionItemKind.TypeParameter = 25; +})(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {})); +/** + * Defines whether the insert text in a completion item should be interpreted as + * plain text or a snippet. + */ +var InsertTextFormat; +(function (InsertTextFormat) { + /** + * The primary text to be inserted is treated as a plain string. + */ + InsertTextFormat.PlainText = 1; + /** + * The primary text to be inserted is treated as a snippet. + * + * A snippet can define tab stops and placeholders with `$1`, `$2` + * and `${3:foo}`. `$0` defines the final tab stop, it defaults to + * the end of the snippet. Placeholders with equal identifiers are linked, + * that is typing in one will update others too. + * + * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax + */ + InsertTextFormat.Snippet = 2; +})(InsertTextFormat || (exports.InsertTextFormat = InsertTextFormat = {})); +/** + * Completion item tags are extra annotations that tweak the rendering of a completion + * item. + * + * @since 3.15.0 + */ +var CompletionItemTag; +(function (CompletionItemTag) { + /** + * Render a completion as obsolete, usually using a strike-out. + */ + CompletionItemTag.Deprecated = 1; +})(CompletionItemTag || (exports.CompletionItemTag = CompletionItemTag = {})); +/** + * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits. + * + * @since 3.16.0 + */ +var InsertReplaceEdit; +(function (InsertReplaceEdit) { + /** + * Creates a new insert / replace edit + */ + function create(newText, insert, replace) { + return { + newText: newText, + insert: insert, + replace: replace + }; + } + InsertReplaceEdit.create = create; + /** + * Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface. + */ + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace); + } + InsertReplaceEdit.is = is; +})(InsertReplaceEdit || (exports.InsertReplaceEdit = InsertReplaceEdit = {})); +/** + * How whitespace and indentation is handled during completion + * item insertion. + * + * @since 3.16.0 + */ +var InsertTextMode; +(function (InsertTextMode) { + /** + * The insertion or replace strings is taken as it is. If the + * value is multi line the lines below the cursor will be + * inserted using the indentation defined in the string value. + * The client will not apply any kind of adjustments to the + * string. + */ + InsertTextMode.asIs = 1; + /** + * The editor adjusts leading whitespace of new lines so that + * they match the indentation up to the cursor of the line for + * which the item is accepted. + * + * Consider a line like this: <2tabs><3tabs>foo. Accepting a + * multi line completion item is indented using 2 tabs and all + * following lines inserted will be indented using 2 tabs as well. + */ + InsertTextMode.adjustIndentation = 2; +})(InsertTextMode || (exports.InsertTextMode = InsertTextMode = {})); +var CompletionItemLabelDetails; +(function (CompletionItemLabelDetails) { + function is(value) { + var candidate = value; + return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) && (Is.string(candidate.description) || candidate.description === undefined); + } + CompletionItemLabelDetails.is = is; +})(CompletionItemLabelDetails || (exports.CompletionItemLabelDetails = CompletionItemLabelDetails = {})); +/** + * The CompletionItem namespace provides functions to deal with + * completion items. + */ +var CompletionItem; +(function (CompletionItem) { + /** + * Create a completion item and seed it with a label. + * @param label The completion item's label + */ + function create(label) { + return { + label: label + }; + } + CompletionItem.create = create; +})(CompletionItem || (exports.CompletionItem = CompletionItem = {})); +/** + * The CompletionList namespace provides functions to deal with + * completion lists. + */ +var CompletionList; +(function (CompletionList) { + /** + * Creates a new completion list. + * + * @param items The completion items. + * @param isIncomplete The list is not complete. + */ + function create(items, isIncomplete) { + return { + items: items ? items : [], + isIncomplete: !!isIncomplete + }; + } + CompletionList.create = create; +})(CompletionList || (exports.CompletionList = CompletionList = {})); +var MarkedString; +(function (MarkedString) { + /** + * Creates a marked string from plain text. + * + * @param plainText The plain text. + */ + function fromPlainText(plainText) { + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash + } + MarkedString.fromPlainText = fromPlainText; + /** + * Checks whether the given value conforms to the {@link MarkedString} type. + */ + function is(value) { + var candidate = value; + return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value); + } + MarkedString.is = is; +})(MarkedString || (exports.MarkedString = MarkedString = {})); +var Hover; +(function (Hover) { + /** + * Checks whether the given value conforms to the {@link Hover} interface. + */ + function is(value) { + var candidate = value; + return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range)); + } + Hover.is = is; +})(Hover || (exports.Hover = Hover = {})); +/** + * The ParameterInformation namespace provides helper functions to work with + * {@link ParameterInformation} literals. + */ +var ParameterInformation; +(function (ParameterInformation) { + /** + * Creates a new parameter information literal. + * + * @param label A label string. + * @param documentation A doc string. + */ + function create(label, documentation) { + return documentation ? { + label: label, + documentation: documentation + } : { + label: label + }; + } + ParameterInformation.create = create; +})(ParameterInformation || (exports.ParameterInformation = ParameterInformation = {})); +/** + * The SignatureInformation namespace provides helper functions to work with + * {@link SignatureInformation} literals. + */ +var SignatureInformation; +(function (SignatureInformation) { + function create(label, documentation) { + var parameters = []; + for (var _i = 2; _i < arguments.length; _i++) { + parameters[_i - 2] = arguments[_i]; + } + var result = { + label: label + }; + if (Is.defined(documentation)) { + result.documentation = documentation; + } + if (Is.defined(parameters)) { + result.parameters = parameters; + } else { + result.parameters = []; + } + return result; + } + SignatureInformation.create = create; +})(SignatureInformation || (exports.SignatureInformation = SignatureInformation = {})); +/** + * A document highlight kind. + */ +var DocumentHighlightKind; +(function (DocumentHighlightKind) { + /** + * A textual occurrence. + */ + DocumentHighlightKind.Text = 1; + /** + * Read-access of a symbol, like reading a variable. + */ + DocumentHighlightKind.Read = 2; + /** + * Write-access of a symbol, like writing to a variable. + */ + DocumentHighlightKind.Write = 3; +})(DocumentHighlightKind || (exports.DocumentHighlightKind = DocumentHighlightKind = {})); +/** + * DocumentHighlight namespace to provide helper functions to work with + * {@link DocumentHighlight} literals. + */ +var DocumentHighlight; +(function (DocumentHighlight) { + /** + * Create a DocumentHighlight object. + * @param range The range the highlight applies to. + * @param kind The highlight kind + */ + function create(range, kind) { + var result = { + range: range + }; + if (Is.number(kind)) { + result.kind = kind; + } + return result; + } + DocumentHighlight.create = create; +})(DocumentHighlight || (exports.DocumentHighlight = DocumentHighlight = {})); +/** + * A symbol kind. + */ +var SymbolKind; +(function (SymbolKind) { + SymbolKind.File = 1; + SymbolKind.Module = 2; + SymbolKind.Namespace = 3; + SymbolKind.Package = 4; + SymbolKind.Class = 5; + SymbolKind.Method = 6; + SymbolKind.Property = 7; + SymbolKind.Field = 8; + SymbolKind.Constructor = 9; + SymbolKind.Enum = 10; + SymbolKind.Interface = 11; + SymbolKind.Function = 12; + SymbolKind.Variable = 13; + SymbolKind.Constant = 14; + SymbolKind.String = 15; + SymbolKind.Number = 16; + SymbolKind.Boolean = 17; + SymbolKind.Array = 18; + SymbolKind.Object = 19; + SymbolKind.Key = 20; + SymbolKind.Null = 21; + SymbolKind.EnumMember = 22; + SymbolKind.Struct = 23; + SymbolKind.Event = 24; + SymbolKind.Operator = 25; + SymbolKind.TypeParameter = 26; +})(SymbolKind || (exports.SymbolKind = SymbolKind = {})); +/** + * Symbol tags are extra annotations that tweak the rendering of a symbol. + * + * @since 3.16 + */ +var SymbolTag; +(function (SymbolTag) { + /** + * Render a symbol as obsolete, usually using a strike-out. + */ + SymbolTag.Deprecated = 1; +})(SymbolTag || (exports.SymbolTag = SymbolTag = {})); +var SymbolInformation; +(function (SymbolInformation) { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the location of the symbol. + * @param uri The resource of the location of symbol. + * @param containerName The name of the symbol containing the symbol. + */ + function create(name, kind, range, uri, containerName) { + var result = { + name: name, + kind: kind, + location: { + uri: uri, + range: range } - function badPos(pos, bad) { - if (bad) { - pos.bad = true; - } - return pos; + }; + if (containerName) { + result.containerName = containerName; + } + return result; + } + SymbolInformation.create = create; +})(SymbolInformation || (exports.SymbolInformation = SymbolInformation = {})); +var WorkspaceSymbol; +(function (WorkspaceSymbol) { + /** + * Create a new workspace symbol. + * + * @param name The name of the symbol. + * @param kind The kind of the symbol. + * @param uri The resource of the location of the symbol. + * @param range An options range of the location. + * @returns A WorkspaceSymbol. + */ + function create(name, kind, uri, range) { + return range !== undefined ? { + name: name, + kind: kind, + location: { + uri: uri, + range: range } - function domTextBetween(cm, from, to, fromLine, toLine) { - var text = "", - closing = false, - lineSep = cm.doc.lineSeparator(), - extraLinebreak = false; - function recognizeMarker(id) { - return function (marker) { - return marker.id == id; - }; - } - function close() { - if (closing) { - text += lineSep; - if (extraLinebreak) { - text += lineSep; - } - closing = extraLinebreak = false; - } - } - function addText(str) { - if (str) { - close(); - text += str; - } - } - function walk(node) { - if (node.nodeType == 1) { - var cmText = node.getAttribute("cm-text"); - if (cmText) { - addText(cmText); - return; - } - var markerID = node.getAttribute("cm-marker"), - range2; - if (markerID) { - var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); - if (found.length && (range2 = found[0].find(0))) { - addText(getBetween(cm.doc, range2.from, range2.to).join(lineSep)); - } - return; - } - if (node.getAttribute("contenteditable") == "false") { - return; - } - var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName); - if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { - return; - } - if (isBlock) { - close(); - } - for (var i2 = 0; i2 < node.childNodes.length; i2++) { - walk(node.childNodes[i2]); - } - if (/^(pre|p)$/i.test(node.nodeName)) { - extraLinebreak = true; - } - if (isBlock) { - closing = true; - } - } else if (node.nodeType == 3) { - addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); - } - } - for (;;) { - walk(from); - if (from == to) { - break; - } - from = from.nextSibling; - extraLinebreak = false; - } - return text; + } : { + name: name, + kind: kind, + location: { + uri: uri } - function domToPos(cm, node, offset) { - var lineNode; - if (node == cm.display.lineDiv) { - lineNode = cm.display.lineDiv.childNodes[offset]; - if (!lineNode) { - return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); - } - node = null; - offset = 0; - } else { - for (lineNode = node;; lineNode = lineNode.parentNode) { - if (!lineNode || lineNode == cm.display.lineDiv) { - return null; - } - if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { - break; - } - } - } - for (var i2 = 0; i2 < cm.display.view.length; i2++) { - var lineView = cm.display.view[i2]; - if (lineView.node == lineNode) { - return locateNodeInLineView(lineView, node, offset); - } - } + }; + } + WorkspaceSymbol.create = create; +})(WorkspaceSymbol || (exports.WorkspaceSymbol = WorkspaceSymbol = {})); +var DocumentSymbol; +(function (DocumentSymbol) { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param detail The detail of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the symbol. + * @param selectionRange The selectionRange of the symbol. + * @param children Children of the symbol. + */ + function create(name, detail, kind, range, selectionRange, children) { + var result = { + name: name, + detail: detail, + kind: kind, + range: range, + selectionRange: selectionRange + }; + if (children !== undefined) { + result.children = children; + } + return result; + } + DocumentSymbol.create = create; + /** + * Checks whether the given literal conforms to the {@link DocumentSymbol} interface. + */ + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === undefined || Is.string(candidate.detail)) && (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) && (candidate.children === undefined || Array.isArray(candidate.children)) && (candidate.tags === undefined || Array.isArray(candidate.tags)); + } + DocumentSymbol.is = is; +})(DocumentSymbol || (exports.DocumentSymbol = DocumentSymbol = {})); +/** + * A set of predefined code action kinds + */ +var CodeActionKind; +(function (CodeActionKind) { + /** + * Empty kind. + */ + CodeActionKind.Empty = ''; + /** + * Base kind for quickfix actions: 'quickfix' + */ + CodeActionKind.QuickFix = 'quickfix'; + /** + * Base kind for refactoring actions: 'refactor' + */ + CodeActionKind.Refactor = 'refactor'; + /** + * Base kind for refactoring extraction actions: 'refactor.extract' + * + * Example extract actions: + * + * - Extract method + * - Extract function + * - Extract variable + * - Extract interface from class + * - ... + */ + CodeActionKind.RefactorExtract = 'refactor.extract'; + /** + * Base kind for refactoring inline actions: 'refactor.inline' + * + * Example inline actions: + * + * - Inline function + * - Inline variable + * - Inline constant + * - ... + */ + CodeActionKind.RefactorInline = 'refactor.inline'; + /** + * Base kind for refactoring rewrite actions: 'refactor.rewrite' + * + * Example rewrite actions: + * + * - Convert JavaScript function to class + * - Add or remove parameter + * - Encapsulate field + * - Make method static + * - Move method to base class + * - ... + */ + CodeActionKind.RefactorRewrite = 'refactor.rewrite'; + /** + * Base kind for source actions: `source` + * + * Source code actions apply to the entire file. + */ + CodeActionKind.Source = 'source'; + /** + * Base kind for an organize imports source action: `source.organizeImports` + */ + CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; + /** + * Base kind for auto-fix source actions: `source.fixAll`. + * + * Fix all actions automatically fix errors that have a clear fix that do not require user input. + * They should not suppress errors or perform unsafe fixes such as generating new types or classes. + * + * @since 3.15.0 + */ + CodeActionKind.SourceFixAll = 'source.fixAll'; +})(CodeActionKind || (exports.CodeActionKind = CodeActionKind = {})); +/** + * The reason why code actions were requested. + * + * @since 3.17.0 + */ +var CodeActionTriggerKind; +(function (CodeActionTriggerKind) { + /** + * Code actions were explicitly requested by the user or by an extension. + */ + CodeActionTriggerKind.Invoked = 1; + /** + * Code actions were requested automatically. + * + * This typically happens when current selection in a file changes, but can + * also be triggered when file content changes. + */ + CodeActionTriggerKind.Automatic = 2; +})(CodeActionTriggerKind || (exports.CodeActionTriggerKind = CodeActionTriggerKind = {})); +/** + * The CodeActionContext namespace provides helper functions to work with + * {@link CodeActionContext} literals. + */ +var CodeActionContext; +(function (CodeActionContext) { + /** + * Creates a new CodeActionContext literal. + */ + function create(diagnostics, only, triggerKind) { + var result = { + diagnostics: diagnostics + }; + if (only !== undefined && only !== null) { + result.only = only; + } + if (triggerKind !== undefined && triggerKind !== null) { + result.triggerKind = triggerKind; + } + return result; + } + CodeActionContext.create = create; + /** + * Checks whether the given literal conforms to the {@link CodeActionContext} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic); + } + CodeActionContext.is = is; +})(CodeActionContext || (exports.CodeActionContext = CodeActionContext = {})); +var CodeAction; +(function (CodeAction) { + function create(title, kindOrCommandOrEdit, kind) { + var result = { + title: title + }; + var checkKind = true; + if (typeof kindOrCommandOrEdit === 'string') { + checkKind = false; + result.kind = kindOrCommandOrEdit; + } else if (Command.is(kindOrCommandOrEdit)) { + result.command = kindOrCommandOrEdit; + } else { + result.edit = kindOrCommandOrEdit; + } + if (checkKind && kind !== undefined) { + result.kind = kind; + } + return result; + } + CodeAction.create = create; + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.title) && (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === undefined || Is.string(candidate.kind)) && (candidate.edit !== undefined || candidate.command !== undefined) && (candidate.command === undefined || Command.is(candidate.command)) && (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) && (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit)); + } + CodeAction.is = is; +})(CodeAction || (exports.CodeAction = CodeAction = {})); +/** + * The CodeLens namespace provides helper functions to work with + * {@link CodeLens} literals. + */ +var CodeLens; +(function (CodeLens) { + /** + * Creates a new CodeLens literal. + */ + function create(range, data) { + var result = { + range: range + }; + if (Is.defined(data)) { + result.data = data; + } + return result; + } + CodeLens.create = create; + /** + * Checks whether the given literal conforms to the {@link CodeLens} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + } + CodeLens.is = is; +})(CodeLens || (exports.CodeLens = CodeLens = {})); +/** + * The FormattingOptions namespace provides helper functions to work with + * {@link FormattingOptions} literals. + */ +var FormattingOptions; +(function (FormattingOptions) { + /** + * Creates a new FormattingOptions literal. + */ + function create(tabSize, insertSpaces) { + return { + tabSize: tabSize, + insertSpaces: insertSpaces + }; + } + FormattingOptions.create = create; + /** + * Checks whether the given literal conforms to the {@link FormattingOptions} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + } + FormattingOptions.is = is; +})(FormattingOptions || (exports.FormattingOptions = FormattingOptions = {})); +/** + * The DocumentLink namespace provides helper functions to work with + * {@link DocumentLink} literals. + */ +var DocumentLink; +(function (DocumentLink) { + /** + * Creates a new DocumentLink literal. + */ + function create(range, target, data) { + return { + range: range, + target: target, + data: data + }; + } + DocumentLink.create = create; + /** + * Checks whether the given literal conforms to the {@link DocumentLink} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + DocumentLink.is = is; +})(DocumentLink || (exports.DocumentLink = DocumentLink = {})); +/** + * The SelectionRange namespace provides helper function to work with + * SelectionRange literals. + */ +var SelectionRange; +(function (SelectionRange) { + /** + * Creates a new SelectionRange + * @param range the range. + * @param parent an optional parent. + */ + function create(range, parent) { + return { + range: range, + parent: parent + }; + } + SelectionRange.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); + } + SelectionRange.is = is; +})(SelectionRange || (exports.SelectionRange = SelectionRange = {})); +/** + * A set of predefined token types. This set is not fixed + * an clients can specify additional token types via the + * corresponding client capabilities. + * + * @since 3.16.0 + */ +var SemanticTokenTypes; +(function (SemanticTokenTypes) { + SemanticTokenTypes["namespace"] = "namespace"; + /** + * Represents a generic type. Acts as a fallback for types which can't be mapped to + * a specific type like class or enum. + */ + SemanticTokenTypes["type"] = "type"; + SemanticTokenTypes["class"] = "class"; + SemanticTokenTypes["enum"] = "enum"; + SemanticTokenTypes["interface"] = "interface"; + SemanticTokenTypes["struct"] = "struct"; + SemanticTokenTypes["typeParameter"] = "typeParameter"; + SemanticTokenTypes["parameter"] = "parameter"; + SemanticTokenTypes["variable"] = "variable"; + SemanticTokenTypes["property"] = "property"; + SemanticTokenTypes["enumMember"] = "enumMember"; + SemanticTokenTypes["event"] = "event"; + SemanticTokenTypes["function"] = "function"; + SemanticTokenTypes["method"] = "method"; + SemanticTokenTypes["macro"] = "macro"; + SemanticTokenTypes["keyword"] = "keyword"; + SemanticTokenTypes["modifier"] = "modifier"; + SemanticTokenTypes["comment"] = "comment"; + SemanticTokenTypes["string"] = "string"; + SemanticTokenTypes["number"] = "number"; + SemanticTokenTypes["regexp"] = "regexp"; + SemanticTokenTypes["operator"] = "operator"; + /** + * @since 3.17.0 + */ + SemanticTokenTypes["decorator"] = "decorator"; +})(SemanticTokenTypes || (exports.SemanticTokenTypes = SemanticTokenTypes = {})); +/** + * A set of predefined token modifiers. This set is not fixed + * an clients can specify additional token types via the + * corresponding client capabilities. + * + * @since 3.16.0 + */ +var SemanticTokenModifiers; +(function (SemanticTokenModifiers) { + SemanticTokenModifiers["declaration"] = "declaration"; + SemanticTokenModifiers["definition"] = "definition"; + SemanticTokenModifiers["readonly"] = "readonly"; + SemanticTokenModifiers["static"] = "static"; + SemanticTokenModifiers["deprecated"] = "deprecated"; + SemanticTokenModifiers["abstract"] = "abstract"; + SemanticTokenModifiers["async"] = "async"; + SemanticTokenModifiers["modification"] = "modification"; + SemanticTokenModifiers["documentation"] = "documentation"; + SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary"; +})(SemanticTokenModifiers || (exports.SemanticTokenModifiers = SemanticTokenModifiers = {})); +/** + * @since 3.16.0 + */ +var SemanticTokens; +(function (SemanticTokens) { + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number'); + } + SemanticTokens.is = is; +})(SemanticTokens || (exports.SemanticTokens = SemanticTokens = {})); +/** + * The InlineValueText namespace provides functions to deal with InlineValueTexts. + * + * @since 3.17.0 + */ +var InlineValueText; +(function (InlineValueText) { + /** + * Creates a new InlineValueText literal. + */ + function create(range, text) { + return { + range: range, + text: text + }; + } + InlineValueText.create = create; + function is(value) { + var candidate = value; + return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text); + } + InlineValueText.is = is; +})(InlineValueText || (exports.InlineValueText = InlineValueText = {})); +/** + * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups. + * + * @since 3.17.0 + */ +var InlineValueVariableLookup; +(function (InlineValueVariableLookup) { + /** + * Creates a new InlineValueText literal. + */ + function create(range, variableName, caseSensitiveLookup) { + return { + range: range, + variableName: variableName, + caseSensitiveLookup: caseSensitiveLookup + }; + } + InlineValueVariableLookup.create = create; + function is(value) { + var candidate = value; + return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === undefined); + } + InlineValueVariableLookup.is = is; +})(InlineValueVariableLookup || (exports.InlineValueVariableLookup = InlineValueVariableLookup = {})); +/** + * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression. + * + * @since 3.17.0 + */ +var InlineValueEvaluatableExpression; +(function (InlineValueEvaluatableExpression) { + /** + * Creates a new InlineValueEvaluatableExpression literal. + */ + function create(range, expression) { + return { + range: range, + expression: expression + }; + } + InlineValueEvaluatableExpression.create = create; + function is(value) { + var candidate = value; + return candidate !== undefined && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === undefined); + } + InlineValueEvaluatableExpression.is = is; +})(InlineValueEvaluatableExpression || (exports.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {})); +/** + * The InlineValueContext namespace provides helper functions to work with + * {@link InlineValueContext} literals. + * + * @since 3.17.0 + */ +var InlineValueContext; +(function (InlineValueContext) { + /** + * Creates a new InlineValueContext literal. + */ + function create(frameId, stoppedLocation) { + return { + frameId: frameId, + stoppedLocation: stoppedLocation + }; + } + InlineValueContext.create = create; + /** + * Checks whether the given literal conforms to the {@link InlineValueContext} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(value.stoppedLocation); + } + InlineValueContext.is = is; +})(InlineValueContext || (exports.InlineValueContext = InlineValueContext = {})); +/** + * Inlay hint kinds. + * + * @since 3.17.0 + */ +var InlayHintKind; +(function (InlayHintKind) { + /** + * An inlay hint that for a type annotation. + */ + InlayHintKind.Type = 1; + /** + * An inlay hint that is for a parameter. + */ + InlayHintKind.Parameter = 2; + function is(value) { + return value === 1 || value === 2; + } + InlayHintKind.is = is; +})(InlayHintKind || (exports.InlayHintKind = InlayHintKind = {})); +var InlayHintLabelPart; +(function (InlayHintLabelPart) { + function create(value) { + return { + value: value + }; + } + InlayHintLabelPart.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === undefined || Location.is(candidate.location)) && (candidate.command === undefined || Command.is(candidate.command)); + } + InlayHintLabelPart.is = is; +})(InlayHintLabelPart || (exports.InlayHintLabelPart = InlayHintLabelPart = {})); +var InlayHint; +(function (InlayHint) { + function create(position, label, kind) { + var result = { + position: position, + label: label + }; + if (kind !== undefined) { + result.kind = kind; + } + return result; + } + InlayHint.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === undefined || InlayHintKind.is(candidate.kind)) && candidate.textEdits === undefined || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight)); + } + InlayHint.is = is; +})(InlayHint || (exports.InlayHint = InlayHint = {})); +var WorkspaceFolder; +(function (WorkspaceFolder) { + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name); + } + WorkspaceFolder.is = is; +})(WorkspaceFolder || (exports.WorkspaceFolder = WorkspaceFolder = {})); +var EOL = exports.EOL = ['\n', '\r\n', '\r']; +/** + * @deprecated Use the text document from the new vscode-languageserver-textdocument package. + */ +var TextDocument; +(function (TextDocument) { + /** + * Creates a new ITextDocument literal from the given uri and content. + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param version The document's version. + * @param content The document's content. + */ + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + /** + * Checks whether the given literal conforms to the {@link ITextDocument} interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + } + TextDocument.is = is; + function applyEdits(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits, function (a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; } - function locateNodeInLineView(lineView, node, offset) { - var wrapper = lineView.text.firstChild, - bad = false; - if (!node || !contains(wrapper, node)) { - return badPos(Pos(lineNo(lineView.line), 0), true); - } - if (node == wrapper) { - bad = true; - node = wrapper.childNodes[offset]; - offset = 0; - if (!node) { - var line = lineView.rest ? lst(lineView.rest) : lineView.line; - return badPos(Pos(lineNo(line), line.text.length), bad); - } - } - var textNode = node.nodeType == 3 ? node : null, - topNode = node; - if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { - textNode = node.firstChild; - if (offset) { - offset = textNode.nodeValue.length; - } - } - while (topNode.parentNode != wrapper) { - topNode = topNode.parentNode; - } - var measure = lineView.measure, - maps = measure.maps; - function find(textNode2, topNode2, offset2) { - for (var i2 = -1; i2 < (maps ? maps.length : 0); i2++) { - var map2 = i2 < 0 ? measure.map : maps[i2]; - for (var j = 0; j < map2.length; j += 3) { - var curNode = map2[j + 2]; - if (curNode == textNode2 || curNode == topNode2) { - var line2 = lineNo(i2 < 0 ? lineView.line : lineView.rest[i2]); - var ch = map2[j] + offset2; - if (offset2 < 0 || curNode != textNode2) { - ch = map2[j + (offset2 ? 1 : 0)]; - } - return Pos(line2, ch); - } - } - } - } - var found = find(textNode, topNode, offset); - if (found) { - return badPos(found, bad); - } - for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { - found = find(after, after.firstChild, 0); - if (found) { - return badPos(Pos(found.line, found.ch - dist), bad); - } else { - dist += after.textContent.length; - } - } - for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { - found = find(before, before.firstChild, -1); - if (found) { - return badPos(Pos(found.line, found.ch + dist$1), bad); - } else { - dist$1 += before.textContent.length; - } - } + return diff; + }); + var lastModifiedOffset = text.length; + for (var i = sortedEdits.length - 1; i >= 0; i--) { + var e = sortedEdits[i]; + var startOffset = document.offsetAt(e.range.start); + var endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } else { + throw new Error('Overlapping edit'); } - var TextareaInput = function (cm) { - this.cm = cm; - this.prevInput = ""; - this.pollingFast = false; - this.polling = new Delayed(); - this.hasSelection = false; - this.composing = null; - }; - TextareaInput.prototype.init = function (display) { - var this$1$1 = this; - var input = this, - cm = this.cm; - this.createField(display); - var te = this.textarea; - display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild); - if (ios) { - te.style.width = "0px"; - } - on(te, "input", function () { - if (ie && ie_version >= 9 && this$1$1.hasSelection) { - this$1$1.hasSelection = null; - } - input.poll(); - }); - on(te, "paste", function (e) { - if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { - return; - } - cm.state.pasteIncoming = + /* @__PURE__ */new Date(); - input.fastPoll(); - }); - function prepareCopyCut(e) { - if (signalDOMEvent(cm, e)) { - return; - } - if (cm.somethingSelected()) { - setLastCopied({ - lineWise: false, - text: cm.getSelections() - }); - } else if (!cm.options.lineWiseCopyCut) { - return; - } else { - var ranges = copyableRanges(cm); - setLastCopied({ - lineWise: true, - text: ranges.text - }); - if (e.type == "cut") { - cm.setSelections(ranges.ranges, null, sel_dontScroll); - } else { - input.prevInput = ""; - te.value = ranges.text.join("\n"); - selectInput(te); - } - } - if (e.type == "cut") { - cm.state.cutIncoming = + /* @__PURE__ */new Date(); - } - } - on(te, "cut", prepareCopyCut); - on(te, "copy", prepareCopyCut); - on(display.scroller, "paste", function (e) { - if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { - return; - } - if (!te.dispatchEvent) { - cm.state.pasteIncoming = + /* @__PURE__ */new Date(); - input.focus(); - return; - } - var event = new Event("paste"); - event.clipboardData = e.clipboardData; - te.dispatchEvent(event); - }); - on(display.lineSpace, "selectstart", function (e) { - if (!eventInWidget(display, e)) { - e_preventDefault(e); - } - }); - on(te, "compositionstart", function () { - var start = cm.getCursor("from"); - if (input.composing) { - input.composing.range.clear(); - } - input.composing = { - start, - range: cm.markText(start, cm.getCursor("to"), { - className: "CodeMirror-composing" - }) - }; - }); - on(te, "compositionend", function () { - if (input.composing) { - input.poll(); - input.composing.range.clear(); - input.composing = null; - } - }); - }; - TextareaInput.prototype.createField = function (_display) { - this.wrapper = hiddenTextarea(); - this.textarea = this.wrapper.firstChild; - }; - TextareaInput.prototype.screenReaderLabelChanged = function (label) { - if (label) { - this.textarea.setAttribute("aria-label", label); - } else { - this.textarea.removeAttribute("aria-label"); - } - }; - TextareaInput.prototype.prepareSelection = function () { - var cm = this.cm, - display = cm.display, - doc = cm.doc; - var result = prepareSelection(cm); - if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); - var wrapOff = display.wrapper.getBoundingClientRect(), - lineOff = display.lineDiv.getBoundingClientRect(); - result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, headPos.top + lineOff.top - wrapOff.top)); - result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, headPos.left + lineOff.left - wrapOff.left)); - } - return result; - }; - TextareaInput.prototype.showSelection = function (drawn) { - var cm = this.cm, - display = cm.display; - removeChildrenAndAdd(display.cursorDiv, drawn.cursors); - removeChildrenAndAdd(display.selectionDiv, drawn.selection); - if (drawn.teTop != null) { - this.wrapper.style.top = drawn.teTop + "px"; - this.wrapper.style.left = drawn.teLeft + "px"; - } - }; - TextareaInput.prototype.reset = function (typing) { - if (this.contextMenuPending || this.composing) { - return; - } - var cm = this.cm; - if (cm.somethingSelected()) { - this.prevInput = ""; - var content = cm.getSelection(); - this.textarea.value = content; - if (cm.state.focused) { - selectInput(this.textarea); - } - if (ie && ie_version >= 9) { - this.hasSelection = content; - } - } else if (!typing) { - this.prevInput = this.textarea.value = ""; - if (ie && ie_version >= 9) { - this.hasSelection = null; - } - } - }; - TextareaInput.prototype.getField = function () { - return this.textarea; - }; - TextareaInput.prototype.supportsTouch = function () { - return false; - }; - TextareaInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { - try { - this.textarea.focus(); - } catch (e) {} - } - }; - TextareaInput.prototype.blur = function () { - this.textarea.blur(); - }; - TextareaInput.prototype.resetPosition = function () { - this.wrapper.style.top = this.wrapper.style.left = 0; - }; - TextareaInput.prototype.receivedFocus = function () { - this.slowPoll(); - }; - TextareaInput.prototype.slowPoll = function () { - var this$1$1 = this; - if (this.pollingFast) { - return; - } - this.polling.set(this.cm.options.pollInterval, function () { - this$1$1.poll(); - if (this$1$1.cm.state.focused) { - this$1$1.slowPoll(); - } - }); - }; - TextareaInput.prototype.fastPoll = function () { - var missed = false, - input = this; - input.pollingFast = true; - function p() { - var changed = input.poll(); - if (!changed && !missed) { - missed = true; - input.polling.set(60, p); - } else { - input.pollingFast = false; - input.slowPoll(); - } - } - input.polling.set(20, p); - }; - TextareaInput.prototype.poll = function () { - var this$1$1 = this; - var cm = this.cm, - input = this.textarea, - prevInput = this.prevInput; - if (this.contextMenuPending || !cm.state.focused || hasSelection(input) && !prevInput && !this.composing || cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) { - return false; - } - var text = input.value; - if (text == prevInput && !cm.somethingSelected()) { - return false; - } - if (ie && ie_version >= 9 && this.hasSelection === text || mac && /[\uf700-\uf7ff]/.test(text)) { - cm.display.input.reset(); - return false; - } - if (cm.doc.sel == cm.display.selForContextMenu) { - var first = text.charCodeAt(0); - if (first == 8203 && !prevInput) { - prevInput = "​"; - } - if (first == 8666) { - this.reset(); - return this.cm.execCommand("undo"); - } - } - var same = 0, - l = Math.min(prevInput.length, text.length); - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { - ++same; - } - runInOp(cm, function () { - applyTextInput(cm, text.slice(same), prevInput.length - same, null, this$1$1.composing ? "*compose" : null); - if (text.length > 1e3 || text.indexOf("\n") > -1) { - input.value = this$1$1.prevInput = ""; - } else { - this$1$1.prevInput = text; - } - if (this$1$1.composing) { - this$1$1.composing.range.clear(); - this$1$1.composing.range = cm.markText(this$1$1.composing.start, cm.getCursor("to"), { - className: "CodeMirror-composing" - }); - } - }); - return true; - }; - TextareaInput.prototype.ensurePolled = function () { - if (this.pollingFast && this.poll()) { - this.pollingFast = false; + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument.applyEdits = applyEdits; + function mergeSort(data, compare) { + if (data.length <= 1) { + // sorted + return data; + } + var p = data.length / 2 | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data[i++] = left[leftIdx++]; + } else { + // greater -> take right + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; + } +})(TextDocument || (exports.TextDocument = TextDocument = {})); +/** + * @deprecated Use the text document from the new vscode-languageserver-textdocument package. + */ +var FullTextDocument = /** @class */function () { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + Object.defineProperty(FullTextDocument.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "languageId", { + get: function () { + return this._languageId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: false, + configurable: true + }); + FullTextDocument.prototype.getText = function (range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument.prototype.update = function (event, version) { + this._content = event.text; + this._version = version; + this._lineOffsets = undefined; + }; + FullTextDocument.prototype.getLineOffsets = function () { + if (this._lineOffsets === undefined) { + var lineOffsets = []; + var text = this._content; + var isLineStart = true; + for (var i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; } - }; - TextareaInput.prototype.onKeyPress = function () { - if (ie && ie_version >= 9) { - this.hasSelection = null; + var ch = text.charAt(i); + isLineStart = ch === '\r' || ch === '\n'; + if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { + i++; } - this.fastPoll(); + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + this._lineOffsets = lineOffsets; + } + return this._lineOffsets; + }; + FullTextDocument.prototype.positionAt = function (offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, + high = lineOffsets.length; + if (high === 0) { + return Position.create(0, offset); + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; + } + } + // low is the least x for which the line offset is larger than the current offset + // or array.length if no line offset is larger than the current offset + var line = low - 1; + return Position.create(line, offset - lineOffsets[line]); + }; + FullTextDocument.prototype.offsetAt = function (position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument.prototype, "lineCount", { + get: function () { + return this.getLineOffsets().length; + }, + enumerable: false, + configurable: true + }); + return FullTextDocument; +}(); +var Is; +(function (Is) { + var toString = Object.prototype.toString; + function defined(value) { + return typeof value !== 'undefined'; + } + Is.defined = defined; + function undefined(value) { + return typeof value === 'undefined'; + } + Is.undefined = undefined; + function boolean(value) { + return value === true || value === false; + } + Is.boolean = boolean; + function string(value) { + return toString.call(value) === '[object String]'; + } + Is.string = string; + function number(value) { + return toString.call(value) === '[object Number]'; + } + Is.number = number; + function numberRange(value, min, max) { + return toString.call(value) === '[object Number]' && min <= value && value <= max; + } + Is.numberRange = numberRange; + function integer(value) { + return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647; + } + Is.integer = integer; + function uinteger(value) { + return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647; + } + Is.uinteger = uinteger; + function func(value) { + return toString.call(value) === '[object Function]'; + } + Is.func = func; + function objectLiteral(value) { + // Strictly speaking class instances pass this check as well. Since the LSP + // doesn't use classes we ignore this for now. If we do we need to add something + // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` + return value !== null && typeof value === 'object'; + } + Is.objectLiteral = objectLiteral; + function typedArray(value, check) { + return Array.isArray(value) && value.every(check); + } + Is.typedArray = typedArray; +})(Is || (Is = {})); + +/***/ }), + +/***/ "../../codemirror-graphql/esm/hint.js": +/*!********************************************!*\ + !*** ../../codemirror-graphql/esm/hint.js ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +__webpack_require__(/*! codemirror/addon/hint/show-hint.js */ "../../../node_modules/codemirror/addon/hint/show-hint.js"); +var _graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.registerHelper('hint', 'graphql', (editor, options) => { + const { + schema, + externalFragments, + autocompleteOptions + } = options; + if (!schema) { + return; + } + const cur = editor.getCursor(); + const token = editor.getTokenAt(cur); + const tokenStart = token.type !== null && /"|\w/.test(token.string[0]) ? token.start : token.end; + const position = new _graphqlLanguageService.Position(cur.line, tokenStart); + const rawResults = (0, _graphqlLanguageService.getAutocompleteSuggestions)(schema, editor.getValue(), position, token, externalFragments, autocompleteOptions); + const results = { + list: rawResults.map(item => { + var _a; + return { + text: (_a = item === null || item === void 0 ? void 0 : item.rawInsert) !== null && _a !== void 0 ? _a : item.label, + type: item.type, + description: item.documentation, + isDeprecated: item.isDeprecated, + deprecationReason: item.deprecationReason }; - TextareaInput.prototype.onContextMenu = function (e) { - var input = this, - cm = input.cm, - display = cm.display, - te = input.textarea; - if (input.contextMenuPending) { - input.contextMenuPending(); - } - var pos = posFromMouse(cm, e), - scrollPos = display.scroller.scrollTop; - if (!pos || presto) { - return; - } - var reset = cm.options.resetSelectionOnContextMenu; - if (reset && cm.doc.sel.contains(pos) == -1) { - operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); - } - var oldCSS = te.style.cssText, - oldWrapperCSS = input.wrapper.style.cssText; - var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect(); - input.wrapper.style.cssText = "position: static"; - te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - var oldScrollY; - if (webkit) { - oldScrollY = window.scrollY; - } - display.input.focus(); - if (webkit) { - window.scrollTo(null, oldScrollY); + }), + from: { + line: cur.line, + ch: tokenStart + }, + to: { + line: cur.line, + ch: token.end + } + }; + if ((results === null || results === void 0 ? void 0 : results.list) && results.list.length > 0) { + results.from = _codemirror.default.Pos(results.from.line, results.from.ch); + results.to = _codemirror.default.Pos(results.to.line, results.to.ch); + _codemirror.default.signal(editor, 'hasCompletion', editor, results, token); + } + return results; +}); + +/***/ }), + +/***/ "../../codemirror-graphql/esm/info.js": +/*!********************************************!*\ + !*** ../../codemirror-graphql/esm/info.js ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +var _getTypeInfo = _interopRequireDefault(__webpack_require__(/*! ./utils/getTypeInfo */ "../../codemirror-graphql/esm/utils/getTypeInfo.js")); +var _SchemaReference = __webpack_require__(/*! ./utils/SchemaReference */ "../../codemirror-graphql/esm/utils/SchemaReference.js"); +__webpack_require__(/*! ./utils/info-addon */ "../../codemirror-graphql/esm/utils/info-addon.js"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.registerHelper('info', 'graphql', (token, options) => { + var _a; + if (!options.schema || !token.state) { + return; + } + const { + kind, + step + } = token.state; + const typeInfo = (0, _getTypeInfo.default)(options.schema, token.state); + if (kind === 'Field' && step === 0 && typeInfo.fieldDef || kind === 'AliasedField' && step === 2 && typeInfo.fieldDef || kind === 'ObjectField' && step === 0 && typeInfo.fieldDef) { + const header = document.createElement('div'); + header.className = 'CodeMirror-info-header'; + renderField(header, typeInfo, options); + const into = document.createElement('div'); + into.append(header); + renderDescription(into, options, typeInfo.fieldDef); + return into; + } + if (kind === 'Directive' && step === 1 && typeInfo.directiveDef) { + const header = document.createElement('div'); + header.className = 'CodeMirror-info-header'; + renderDirective(header, typeInfo, options); + const into = document.createElement('div'); + into.append(header); + renderDescription(into, options, typeInfo.directiveDef); + return into; + } + if (kind === 'Argument' && step === 0 && typeInfo.argDef) { + const header = document.createElement('div'); + header.className = 'CodeMirror-info-header'; + renderArg(header, typeInfo, options); + const into = document.createElement('div'); + into.append(header); + renderDescription(into, options, typeInfo.argDef); + return into; + } + if (kind === 'EnumValue' && ((_a = typeInfo.enumValue) === null || _a === void 0 ? void 0 : _a.description)) { + const header = document.createElement('div'); + header.className = 'CodeMirror-info-header'; + renderEnumValue(header, typeInfo, options); + const into = document.createElement('div'); + into.append(header); + renderDescription(into, options, typeInfo.enumValue); + return into; + } + if (kind === 'NamedType' && typeInfo.type && typeInfo.type.description) { + const header = document.createElement('div'); + header.className = 'CodeMirror-info-header'; + renderType(header, typeInfo, options, typeInfo.type); + const into = document.createElement('div'); + into.append(header); + renderDescription(into, options, typeInfo.type); + return into; + } +}); +function renderField(into, typeInfo, options) { + renderQualifiedField(into, typeInfo, options); + renderTypeAnnotation(into, typeInfo, options, typeInfo.type); +} +function renderQualifiedField(into, typeInfo, options) { + var _a; + const fieldName = ((_a = typeInfo.fieldDef) === null || _a === void 0 ? void 0 : _a.name) || ''; + text(into, fieldName, 'field-name', options, (0, _SchemaReference.getFieldReference)(typeInfo)); +} +function renderDirective(into, typeInfo, options) { + var _a; + const name = '@' + (((_a = typeInfo.directiveDef) === null || _a === void 0 ? void 0 : _a.name) || ''); + text(into, name, 'directive-name', options, (0, _SchemaReference.getDirectiveReference)(typeInfo)); +} +function renderArg(into, typeInfo, options) { + var _a; + const name = ((_a = typeInfo.argDef) === null || _a === void 0 ? void 0 : _a.name) || ''; + text(into, name, 'arg-name', options, (0, _SchemaReference.getArgumentReference)(typeInfo)); + renderTypeAnnotation(into, typeInfo, options, typeInfo.inputType); +} +function renderEnumValue(into, typeInfo, options) { + var _a; + const name = ((_a = typeInfo.enumValue) === null || _a === void 0 ? void 0 : _a.name) || ''; + renderType(into, typeInfo, options, typeInfo.inputType); + text(into, '.'); + text(into, name, 'enum-value', options, (0, _SchemaReference.getEnumValueReference)(typeInfo)); +} +function renderTypeAnnotation(into, typeInfo, options, t) { + const typeSpan = document.createElement('span'); + typeSpan.className = 'type-name-pill'; + if (t instanceof _graphql.GraphQLNonNull) { + renderType(typeSpan, typeInfo, options, t.ofType); + text(typeSpan, '!'); + } else if (t instanceof _graphql.GraphQLList) { + text(typeSpan, '['); + renderType(typeSpan, typeInfo, options, t.ofType); + text(typeSpan, ']'); + } else { + text(typeSpan, (t === null || t === void 0 ? void 0 : t.name) || '', 'type-name', options, (0, _SchemaReference.getTypeReference)(typeInfo, t)); + } + into.append(typeSpan); +} +function renderType(into, typeInfo, options, t) { + if (t instanceof _graphql.GraphQLNonNull) { + renderType(into, typeInfo, options, t.ofType); + text(into, '!'); + } else if (t instanceof _graphql.GraphQLList) { + text(into, '['); + renderType(into, typeInfo, options, t.ofType); + text(into, ']'); + } else { + text(into, (t === null || t === void 0 ? void 0 : t.name) || '', 'type-name', options, (0, _SchemaReference.getTypeReference)(typeInfo, t)); + } +} +function renderDescription(into, options, def) { + const { + description + } = def; + if (description) { + const descriptionDiv = document.createElement('div'); + descriptionDiv.className = 'info-description'; + if (options.renderDescription) { + descriptionDiv.innerHTML = options.renderDescription(description); + } else { + descriptionDiv.append(document.createTextNode(description)); + } + into.append(descriptionDiv); + } + renderDeprecation(into, options, def); +} +function renderDeprecation(into, options, def) { + const reason = def.deprecationReason; + if (reason) { + const deprecationDiv = document.createElement('div'); + deprecationDiv.className = 'info-deprecation'; + into.append(deprecationDiv); + const label = document.createElement('span'); + label.className = 'info-deprecation-label'; + label.append(document.createTextNode('Deprecated')); + deprecationDiv.append(label); + const reasonDiv = document.createElement('div'); + reasonDiv.className = 'info-deprecation-reason'; + if (options.renderDescription) { + reasonDiv.innerHTML = options.renderDescription(reason); + } else { + reasonDiv.append(document.createTextNode(reason)); + } + deprecationDiv.append(reasonDiv); + } +} +function text(into, content, className = '', options = { + onClick: null +}, ref = null) { + if (className) { + const { + onClick + } = options; + let node; + if (onClick) { + node = document.createElement('a'); + node.href = 'javascript:void 0'; + node.addEventListener('click', e => { + e.preventDefault(); + onClick(ref, e); + }); + } else { + node = document.createElement('span'); + } + node.className = className; + node.append(document.createTextNode(content)); + into.append(node); + } else { + into.append(document.createTextNode(content)); + } +} + +/***/ }), + +/***/ "../../codemirror-graphql/esm/jump.js": +/*!********************************************!*\ + !*** ../../codemirror-graphql/esm/jump.js ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +var _getTypeInfo = _interopRequireDefault(__webpack_require__(/*! ./utils/getTypeInfo */ "../../codemirror-graphql/esm/utils/getTypeInfo.js")); +var _SchemaReference = __webpack_require__(/*! ./utils/SchemaReference */ "../../codemirror-graphql/esm/utils/SchemaReference.js"); +__webpack_require__(/*! ./utils/jump-addon */ "../../codemirror-graphql/esm/utils/jump-addon.js"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.registerHelper('jump', 'graphql', (token, options) => { + if (!options.schema || !options.onClick || !token.state) { + return; + } + const { + state + } = token; + const { + kind, + step + } = state; + const typeInfo = (0, _getTypeInfo.default)(options.schema, state); + if (kind === 'Field' && step === 0 && typeInfo.fieldDef || kind === 'AliasedField' && step === 2 && typeInfo.fieldDef) { + return (0, _SchemaReference.getFieldReference)(typeInfo); + } + if (kind === 'Directive' && step === 1 && typeInfo.directiveDef) { + return (0, _SchemaReference.getDirectiveReference)(typeInfo); + } + if (kind === 'Argument' && step === 0 && typeInfo.argDef) { + return (0, _SchemaReference.getArgumentReference)(typeInfo); + } + if (kind === 'EnumValue' && typeInfo.enumValue) { + return (0, _SchemaReference.getEnumValueReference)(typeInfo); + } + if (kind === 'NamedType' && typeInfo.type) { + return (0, _SchemaReference.getTypeReference)(typeInfo); + } +}); + +/***/ }), + +/***/ "../../codemirror-graphql/esm/lint.js": +/*!********************************************!*\ + !*** ../../codemirror-graphql/esm/lint.js ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +var _graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const SEVERITY = ['error', 'warning', 'information', 'hint']; +const TYPE = { + 'GraphQL: Validation': 'validation', + 'GraphQL: Deprecation': 'deprecation', + 'GraphQL: Syntax': 'syntax' +}; +_codemirror.default.registerHelper('lint', 'graphql', (text, options) => { + const { + schema, + validationRules, + externalFragments + } = options; + const rawResults = (0, _graphqlLanguageService.getDiagnostics)(text, schema, validationRules, undefined, externalFragments); + const results = rawResults.map(error => ({ + message: error.message, + severity: error.severity ? SEVERITY[error.severity - 1] : SEVERITY[0], + type: error.source ? TYPE[error.source] : undefined, + from: _codemirror.default.Pos(error.range.start.line, error.range.start.character), + to: _codemirror.default.Pos(error.range.end.line, error.range.end.character) + })); + return results; +}); + +/***/ }), + +/***/ "../../codemirror-graphql/esm/mode.js": +/*!********************************************!*\ + !*** ../../codemirror-graphql/esm/mode.js ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +var _modeFactory = _interopRequireDefault(__webpack_require__(/*! ./utils/mode-factory */ "../../codemirror-graphql/esm/utils/mode-factory.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.defineMode('graphql', _modeFactory.default); + +/***/ }), + +/***/ "../../codemirror-graphql/esm/results/mode.js": +/*!****************************************************!*\ + !*** ../../codemirror-graphql/esm/results/mode.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +var _graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); +var _modeIndent = _interopRequireDefault(__webpack_require__(/*! ../utils/mode-indent */ "../../codemirror-graphql/esm/utils/mode-indent.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.defineMode('graphql-results', config => { + const parser = (0, _graphqlLanguageService.onlineParser)({ + eatWhitespace: stream => stream.eatSpace(), + lexRules: LexRules, + parseRules: ParseRules, + editorConfig: { + tabSize: config.tabSize + } + }); + return { + config, + startState: parser.startState, + token: parser.token, + indent: _modeIndent.default, + electricInput: /^\s*[}\]]/, + fold: 'brace', + closeBrackets: { + pairs: '[]{}""', + explode: '[]{}' + } + }; +}); +const LexRules = { + Punctuation: /^\[|]|\{|\}|:|,/, + Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, + String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, + Keyword: /^true|false|null/ +}; +const ParseRules = { + Document: [(0, _graphqlLanguageService.p)('{'), (0, _graphqlLanguageService.list)('Entry', (0, _graphqlLanguageService.p)(',')), (0, _graphqlLanguageService.p)('}')], + Entry: [(0, _graphqlLanguageService.t)('String', 'def'), (0, _graphqlLanguageService.p)(':'), 'Value'], + Value(token) { + switch (token.kind) { + case 'Number': + return 'NumberValue'; + case 'String': + return 'StringValue'; + case 'Punctuation': + switch (token.value) { + case '[': + return 'ListValue'; + case '{': + return 'ObjectValue'; } - display.input.reset(); - if (!cm.somethingSelected()) { - te.value = input.prevInput = " "; + return null; + case 'Keyword': + switch (token.value) { + case 'true': + case 'false': + return 'BooleanValue'; + case 'null': + return 'NullValue'; } - input.contextMenuPending = rehide; - display.selForContextMenu = cm.doc.sel; - clearTimeout(display.detectingSelectAll); - function prepareSelectAllHack() { - if (te.selectionStart != null) { - var selected = cm.somethingSelected(); - var extval = "​" + (selected ? te.value : ""); - te.value = "⇚"; - te.value = extval; - input.prevInput = selected ? "" : "​"; - te.selectionStart = 1; - te.selectionEnd = extval.length; - display.selForContextMenu = cm.doc.sel; - } + return null; + } + }, + NumberValue: [(0, _graphqlLanguageService.t)('Number', 'number')], + StringValue: [(0, _graphqlLanguageService.t)('String', 'string')], + BooleanValue: [(0, _graphqlLanguageService.t)('Keyword', 'builtin')], + NullValue: [(0, _graphqlLanguageService.t)('Keyword', 'keyword')], + ListValue: [(0, _graphqlLanguageService.p)('['), (0, _graphqlLanguageService.list)('Value', (0, _graphqlLanguageService.p)(',')), (0, _graphqlLanguageService.p)(']')], + ObjectValue: [(0, _graphqlLanguageService.p)('{'), (0, _graphqlLanguageService.list)('ObjectField', (0, _graphqlLanguageService.p)(',')), (0, _graphqlLanguageService.p)('}')], + ObjectField: [(0, _graphqlLanguageService.t)('String', 'property'), (0, _graphqlLanguageService.p)(':'), 'Value'] +}; + +/***/ }), + +/***/ "../../codemirror-graphql/esm/utils/SchemaReference.js": +/*!*************************************************************!*\ + !*** ../../codemirror-graphql/esm/utils/SchemaReference.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getArgumentReference = getArgumentReference; +exports.getDirectiveReference = getDirectiveReference; +exports.getEnumValueReference = getEnumValueReference; +exports.getFieldReference = getFieldReference; +exports.getTypeReference = getTypeReference; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +function getFieldReference(typeInfo) { + return { + kind: 'Field', + schema: typeInfo.schema, + field: typeInfo.fieldDef, + type: isMetaField(typeInfo.fieldDef) ? null : typeInfo.parentType + }; +} +function getDirectiveReference(typeInfo) { + return { + kind: 'Directive', + schema: typeInfo.schema, + directive: typeInfo.directiveDef + }; +} +function getArgumentReference(typeInfo) { + return typeInfo.directiveDef ? { + kind: 'Argument', + schema: typeInfo.schema, + argument: typeInfo.argDef, + directive: typeInfo.directiveDef + } : { + kind: 'Argument', + schema: typeInfo.schema, + argument: typeInfo.argDef, + field: typeInfo.fieldDef, + type: isMetaField(typeInfo.fieldDef) ? null : typeInfo.parentType + }; +} +function getEnumValueReference(typeInfo) { + return { + kind: 'EnumValue', + value: typeInfo.enumValue || undefined, + type: typeInfo.inputType ? (0, _graphql.getNamedType)(typeInfo.inputType) : undefined + }; +} +function getTypeReference(typeInfo, type) { + return { + kind: 'Type', + schema: typeInfo.schema, + type: type || typeInfo.type + }; +} +function isMetaField(fieldDef) { + return fieldDef.name.slice(0, 2) === '__'; +} + +/***/ }), + +/***/ "../../codemirror-graphql/esm/utils/forEachState.js": +/*!**********************************************************!*\ + !*** ../../codemirror-graphql/esm/utils/forEachState.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = forEachState; +function forEachState(stack, fn) { + const reverseStateStack = []; + let state = stack; + while (state === null || state === void 0 ? void 0 : state.kind) { + reverseStateStack.push(state); + state = state.prevState; + } + for (let i = reverseStateStack.length - 1; i >= 0; i--) { + fn(reverseStateStack[i]); + } +} + +/***/ }), + +/***/ "../../codemirror-graphql/esm/utils/getTypeInfo.js": +/*!*********************************************************!*\ + !*** ../../codemirror-graphql/esm/utils/getTypeInfo.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getTypeInfo; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _forEachState = _interopRequireDefault(__webpack_require__(/*! ./forEachState */ "../../codemirror-graphql/esm/utils/forEachState.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function getTypeInfo(schema, tokenState) { + const info = { + schema, + type: null, + parentType: null, + inputType: null, + directiveDef: null, + fieldDef: null, + argDef: null, + argDefs: null, + objectFieldDefs: null + }; + (0, _forEachState.default)(tokenState, state => { + var _a, _b; + switch (state.kind) { + case 'Query': + case 'ShortQuery': + info.type = schema.getQueryType(); + break; + case 'Mutation': + info.type = schema.getMutationType(); + break; + case 'Subscription': + info.type = schema.getSubscriptionType(); + break; + case 'InlineFragment': + case 'FragmentDefinition': + if (state.type) { + info.type = schema.getType(state.type); } - function rehide() { - if (input.contextMenuPending != rehide) { - return; - } - input.contextMenuPending = false; - input.wrapper.style.cssText = oldWrapperCSS; - te.style.cssText = oldCSS; - if (ie && ie_version < 9) { - display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); - } - if (te.selectionStart != null) { - if (!ie || ie && ie_version < 9) { - prepareSelectAllHack(); + break; + case 'Field': + case 'AliasedField': + info.fieldDef = info.type && state.name ? getFieldDef(schema, info.parentType, state.name) : null; + info.type = (_a = info.fieldDef) === null || _a === void 0 ? void 0 : _a.type; + break; + case 'SelectionSet': + info.parentType = info.type ? (0, _graphql.getNamedType)(info.type) : null; + break; + case 'Directive': + info.directiveDef = state.name ? schema.getDirective(state.name) : null; + break; + case 'Arguments': + const parentDef = state.prevState ? state.prevState.kind === 'Field' ? info.fieldDef : state.prevState.kind === 'Directive' ? info.directiveDef : state.prevState.kind === 'AliasedField' ? state.prevState.name && getFieldDef(schema, info.parentType, state.prevState.name) : null : null; + info.argDefs = parentDef ? parentDef.args : null; + break; + case 'Argument': + info.argDef = null; + if (info.argDefs) { + for (let i = 0; i < info.argDefs.length; i++) { + if (info.argDefs[i].name === state.name) { + info.argDef = info.argDefs[i]; + break; } - var i2 = 0, - poll = function () { - if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && te.selectionEnd > 0 && input.prevInput == "​") { - operation(cm, selectAll)(cm); - } else if (i2++ < 10) { - display.detectingSelectAll = setTimeout(poll, 500); - } else { - display.selForContextMenu = null; - display.input.reset(); - } - }; - display.detectingSelectAll = setTimeout(poll, 200); - } - } - if (ie && ie_version >= 9) { - prepareSelectAllHack(); - } - if (captureRightClick) { - e_stop(e); - var mouseup = function () { - off(window, "mouseup", mouseup); - setTimeout(rehide, 20); - }; - on(window, "mouseup", mouseup); - } else { - setTimeout(rehide, 50); - } - }; - TextareaInput.prototype.readOnlyChanged = function (val) { - if (!val) { - this.reset(); - } - this.textarea.disabled = val == "nocursor"; - this.textarea.readOnly = !!val; - }; - TextareaInput.prototype.setUneditable = function () {}; - TextareaInput.prototype.needsContentAttribute = false; - function fromTextArea(textarea, options) { - options = options ? copyObj(options) : {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabIndex) { - options.tabindex = textarea.tabIndex; - } - if (!options.placeholder && textarea.placeholder) { - options.placeholder = textarea.placeholder; - } - if (options.autofocus == null) { - var hasFocus = activeElt(); - options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body; - } - function save() { - textarea.value = cm.getValue(); - } - var realSubmit; - if (textarea.form) { - on(textarea.form, "submit", save); - if (!options.leaveSubmitMethodAlone) { - var form = textarea.form; - realSubmit = form.submit; - try { - var wrappedSubmit = form.submit = function () { - save(); - form.submit = realSubmit; - form.submit(); - form.submit = wrappedSubmit; - }; - } catch (e) {} } } - options.finishInit = function (cm2) { - cm2.save = save; - cm2.getTextArea = function () { - return textarea; - }; - cm2.toTextArea = function () { - cm2.toTextArea = isNaN; - save(); - textarea.parentNode.removeChild(cm2.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - off(textarea.form, "submit", save); - if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == "function") { - textarea.form.submit = realSubmit; - } - } - }; - }; - textarea.style.display = "none"; - var cm = CodeMirror(function (node) { - return textarea.parentNode.insertBefore(node, textarea.nextSibling); - }, options); - return cm; - } - function addLegacyProps(CodeMirror2) { - CodeMirror2.off = off; - CodeMirror2.on = on; - CodeMirror2.wheelEventPixels = wheelEventPixels; - CodeMirror2.Doc = Doc; - CodeMirror2.splitLines = splitLinesAuto; - CodeMirror2.countColumn = countColumn; - CodeMirror2.findColumn = findColumn; - CodeMirror2.isWordChar = isWordCharBasic; - CodeMirror2.Pass = Pass; - CodeMirror2.signal = signal; - CodeMirror2.Line = Line; - CodeMirror2.changeEnd = changeEnd; - CodeMirror2.scrollbarModel = scrollbarModel; - CodeMirror2.Pos = Pos; - CodeMirror2.cmpPos = cmp; - CodeMirror2.modes = modes; - CodeMirror2.mimeModes = mimeModes; - CodeMirror2.resolveMode = resolveMode; - CodeMirror2.getMode = getMode; - CodeMirror2.modeExtensions = modeExtensions; - CodeMirror2.extendMode = extendMode; - CodeMirror2.copyState = copyState; - CodeMirror2.startState = startState; - CodeMirror2.innerMode = innerMode; - CodeMirror2.commands = commands; - CodeMirror2.keyMap = keyMap; - CodeMirror2.keyName = keyName; - CodeMirror2.isModifierKey = isModifierKey; - CodeMirror2.lookupKey = lookupKey; - CodeMirror2.normalizeKeyMap = normalizeKeyMap; - CodeMirror2.StringStream = StringStream; - CodeMirror2.SharedTextMarker = SharedTextMarker; - CodeMirror2.TextMarker = TextMarker; - CodeMirror2.LineWidget = LineWidget; - CodeMirror2.e_preventDefault = e_preventDefault; - CodeMirror2.e_stopPropagation = e_stopPropagation; - CodeMirror2.e_stop = e_stop; - CodeMirror2.addClass = addClass; - CodeMirror2.contains = contains; - CodeMirror2.rmClass = rmClass; - CodeMirror2.keyNames = keyNames; - } - defineOptions(CodeMirror); - addEditorMethods(CodeMirror); - var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); - for (var prop in Doc.prototype) { - if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) { - CodeMirror.prototype[prop] = /* @__PURE__ */function (method) { - return function () { - return method.apply(this.doc, arguments); - }; - }(Doc.prototype[prop]); - } + info.inputType = (_b = info.argDef) === null || _b === void 0 ? void 0 : _b.type; + break; + case 'EnumValue': + const enumType = info.inputType ? (0, _graphql.getNamedType)(info.inputType) : null; + info.enumValue = enumType instanceof _graphql.GraphQLEnumType ? find(enumType.getValues(), val => val.value === state.name) : null; + break; + case 'ListValue': + const nullableType = info.inputType ? (0, _graphql.getNullableType)(info.inputType) : null; + info.inputType = nullableType instanceof _graphql.GraphQLList ? nullableType.ofType : null; + break; + case 'ObjectValue': + const objectType = info.inputType ? (0, _graphql.getNamedType)(info.inputType) : null; + info.objectFieldDefs = objectType instanceof _graphql.GraphQLInputObjectType ? objectType.getFields() : null; + break; + case 'ObjectField': + const objectField = state.name && info.objectFieldDefs ? info.objectFieldDefs[state.name] : null; + info.inputType = objectField === null || objectField === void 0 ? void 0 : objectField.type; + info.fieldDef = objectField; + break; + case 'NamedType': + info.type = state.name ? schema.getType(state.name) : null; + break; + } + }); + return info; +} +function getFieldDef(schema, type, fieldName) { + if (fieldName === _graphql.SchemaMetaFieldDef.name && schema.getQueryType() === type) { + return _graphql.SchemaMetaFieldDef; + } + if (fieldName === _graphql.TypeMetaFieldDef.name && schema.getQueryType() === type) { + return _graphql.TypeMetaFieldDef; + } + if (fieldName === _graphql.TypeNameMetaFieldDef.name && (0, _graphql.isCompositeType)(type)) { + return _graphql.TypeNameMetaFieldDef; + } + if (type && type.getFields) { + return type.getFields()[fieldName]; + } +} +function find(array, predicate) { + for (let i = 0; i < array.length; i++) { + if (predicate(array[i])) { + return array[i]; + } + } +} + +/***/ }), + +/***/ "../../codemirror-graphql/esm/utils/hintList.js": +/*!******************************************************!*\ + !*** ../../codemirror-graphql/esm/utils/hintList.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = hintList; +function hintList(cursor, token, list) { + const hints = filterAndSortList(list, normalizeText(token.string)); + if (!hints) { + return; + } + const tokenStart = token.type !== null && /"|\w/.test(token.string[0]) ? token.start : token.end; + return { + list: hints, + from: { + line: cursor.line, + ch: tokenStart + }, + to: { + line: cursor.line, + ch: token.end + } + }; +} +function filterAndSortList(list, text) { + if (!text) { + return filterNonEmpty(list, entry => !entry.isDeprecated); + } + const byProximity = list.map(entry => ({ + proximity: getProximity(normalizeText(entry.text), text), + entry + })); + const conciseMatches = filterNonEmpty(filterNonEmpty(byProximity, pair => pair.proximity <= 2), pair => !pair.entry.isDeprecated); + const sortedMatches = conciseMatches.sort((a, b) => (a.entry.isDeprecated ? 1 : 0) - (b.entry.isDeprecated ? 1 : 0) || a.proximity - b.proximity || a.entry.text.length - b.entry.text.length); + return sortedMatches.map(pair => pair.entry); +} +function filterNonEmpty(array, predicate) { + const filtered = array.filter(predicate); + return filtered.length === 0 ? array : filtered; +} +function normalizeText(text) { + return text.toLowerCase().replaceAll(/\W/g, ''); +} +function getProximity(suggestion, text) { + let proximity = lexicalDistance(text, suggestion); + if (suggestion.length > text.length) { + proximity -= suggestion.length - text.length - 1; + proximity += suggestion.indexOf(text) === 0 ? 0 : 0.5; + } + return proximity; +} +function lexicalDistance(a, b) { + let i; + let j; + const d = []; + const aLength = a.length; + const bLength = b.length; + for (i = 0; i <= aLength; i++) { + d[i] = [i]; + } + for (j = 1; j <= bLength; j++) { + d[0][j] = j; + } + for (i = 1; i <= aLength; i++) { + for (j = 1; j <= bLength; j++) { + const cost = a[i - 1] === b[j - 1] ? 0 : 1; + d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); } - eventMixin(Doc); - CodeMirror.inputStyles = { - "textarea": TextareaInput, - "contenteditable": ContentEditableInput - }; - CodeMirror.defineMode = function (name) { - if (!CodeMirror.defaults.mode && name != "null") { - CodeMirror.defaults.mode = name; - } - defineMode.apply(this, arguments); - }; - CodeMirror.defineMIME = defineMIME; - CodeMirror.defineMode("null", function () { - return { - token: function (stream) { - return stream.skipToEnd(); - } - }; - }); - CodeMirror.defineMIME("text/plain", "null"); - CodeMirror.defineExtension = function (name, func) { - CodeMirror.prototype[name] = func; - }; - CodeMirror.defineDocExtension = function (name, func) { - Doc.prototype[name] = func; - }; - CodeMirror.fromTextArea = fromTextArea; - addLegacyProps(CodeMirror); - CodeMirror.version = "5.65.3"; - return CodeMirror; - }); - })(codemirror); - return codemirror.exports; + } + } + return d[aLength][bLength]; } -exports.getDefaultExportFromCjs = getDefaultExportFromCjs; -exports.requireCodemirror = requireCodemirror; /***/ }), -/***/ "../../graphiql-react/dist/comment.cjs.js": -/*!************************************************!*\ - !*** ../../graphiql-react/dist/comment.cjs.js ***! - \************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../codemirror-graphql/esm/utils/info-addon.js": +/*!********************************************************!*\ + !*** ../../codemirror-graphql/esm/utils/info-addon.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.defineOption('info', false, (cm, options, old) => { + if (old && old !== _codemirror.default.Init) { + const oldOnMouseOver = cm.state.info.onMouseOver; + _codemirror.default.off(cm.getWrapperElement(), 'mouseover', oldOnMouseOver); + clearTimeout(cm.state.info.hoverTimeout); + delete cm.state.info; + } + if (options) { + const state = cm.state.info = createState(options); + state.onMouseOver = onMouseOver.bind(null, cm); + _codemirror.default.on(cm.getWrapperElement(), 'mouseover', state.onMouseOver); + } +}); +function createState(options) { + return { + options: options instanceof Function ? { + render: options + } : options === true ? {} : options + }; +} +function getHoverTime(cm) { + const { + options + } = cm.state.info; + return (options === null || options === void 0 ? void 0 : options.hoverTime) || 500; +} +function onMouseOver(cm, e) { + const state = cm.state.info; + const target = e.target || e.srcElement; + if (!(target instanceof HTMLElement)) { + return; + } + if (target.nodeName !== 'SPAN' || state.hoverTimeout !== undefined) { + return; + } + const box = target.getBoundingClientRect(); + const onMouseMove = function () { + clearTimeout(state.hoverTimeout); + state.hoverTimeout = setTimeout(onHover, hoverTime); + }; + const onMouseOut = function () { + _codemirror.default.off(document, 'mousemove', onMouseMove); + _codemirror.default.off(cm.getWrapperElement(), 'mouseout', onMouseOut); + clearTimeout(state.hoverTimeout); + state.hoverTimeout = undefined; + }; + const onHover = function () { + _codemirror.default.off(document, 'mousemove', onMouseMove); + _codemirror.default.off(cm.getWrapperElement(), 'mouseout', onMouseOut); + state.hoverTimeout = undefined; + onMouseHover(cm, box); + }; + const hoverTime = getHoverTime(cm); + state.hoverTimeout = setTimeout(onHover, hoverTime); + _codemirror.default.on(document, 'mousemove', onMouseMove); + _codemirror.default.on(cm.getWrapperElement(), 'mouseout', onMouseOut); +} +function onMouseHover(cm, box) { + const pos = cm.coordsChar({ + left: (box.left + box.right) / 2, + top: (box.top + box.bottom) / 2 + }, 'window'); + const state = cm.state.info; + const { + options + } = state; + const render = options.render || cm.getHelper(pos, 'info'); + if (render) { + const token = cm.getTokenAt(pos, true); + if (token) { + const info = render(token, options, cm, pos); + if (info) { + showPopup(cm, box, info); + } + } + } +} +function showPopup(cm, box, info) { + const popup = document.createElement('div'); + popup.className = 'CodeMirror-info'; + popup.append(info); + document.body.append(popup); + const popupBox = popup.getBoundingClientRect(); + const popupStyle = window.getComputedStyle(popup); + const popupWidth = popupBox.right - popupBox.left + parseFloat(popupStyle.marginLeft) + parseFloat(popupStyle.marginRight); + const popupHeight = popupBox.bottom - popupBox.top + parseFloat(popupStyle.marginTop) + parseFloat(popupStyle.marginBottom); + let topPos = box.bottom; + if (popupHeight > window.innerHeight - box.bottom - 15 && box.top > window.innerHeight - box.bottom) { + topPos = box.top - popupHeight; + } + if (topPos < 0) { + topPos = box.bottom; + } + let leftPos = Math.max(0, window.innerWidth - popupWidth - 15); + if (leftPos > box.left) { + leftPos = box.left; + } + popup.style.opacity = '1'; + popup.style.top = topPos + 'px'; + popup.style.left = leftPos + 'px'; + let popupTimeout; + const onMouseOverPopup = function () { + clearTimeout(popupTimeout); + }; + const onMouseOut = function () { + clearTimeout(popupTimeout); + popupTimeout = setTimeout(hidePopup, 200); + }; + const hidePopup = function () { + _codemirror.default.off(popup, 'mouseover', onMouseOverPopup); + _codemirror.default.off(popup, 'mouseout', onMouseOut); + _codemirror.default.off(cm.getWrapperElement(), 'mouseout', onMouseOut); + if (popup.style.opacity) { + popup.style.opacity = '0'; + setTimeout(() => { + if (popup.parentNode) { + popup.remove(); } + }, 600); + } else if (popup.parentNode) { + popup.remove(); + } + }; + _codemirror.default.on(popup, 'mouseover', onMouseOverPopup); + _codemirror.default.on(popup, 'mouseout', onMouseOut); + _codemirror.default.on(cm.getWrapperElement(), 'mouseout', onMouseOut); +} + +/***/ }), + +/***/ "../../codemirror-graphql/esm/utils/jsonParse.js": +/*!*******************************************************!*\ + !*** ../../codemirror-graphql/esm/utils/jsonParse.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.JSONSyntaxError = void 0; +exports["default"] = jsonParse; +function jsonParse(str) { + string = str; + strLen = str.length; + start = end = lastEnd = -1; + ch(); + lex(); + const ast = parseObj(); + expect('EOF'); + return ast; +} +let string; +let strLen; +let start; +let end; +let lastEnd; +let code; +let kind; +function parseObj() { + const nodeStart = start; + const members = []; + expect('{'); + if (!skip('}')) { + do { + members.push(parseMember()); + } while (skip(',')); + expect('}'); + } + return { + kind: 'Object', + start: nodeStart, + end: lastEnd, + members + }; +} +function parseMember() { + const nodeStart = start; + const key = kind === 'String' ? curToken() : null; + expect('String'); + expect(':'); + const value = parseVal(); + return { + kind: 'Member', + start: nodeStart, + end: lastEnd, + key, + value + }; +} +function parseArr() { + const nodeStart = start; + const values = []; + expect('['); + if (!skip(']')) { + do { + values.push(parseVal()); + } while (skip(',')); + expect(']'); + } + return { + kind: 'Array', + start: nodeStart, + end: lastEnd, + values + }; +} +function parseVal() { + switch (kind) { + case '[': + return parseArr(); + case '{': + return parseObj(); + case 'String': + case 'Number': + case 'Boolean': + case 'Null': + const token = curToken(); + lex(); + return token; + } + expect('Value'); +} +function curToken() { + return { + kind, + start, + end, + value: JSON.parse(string.slice(start, end)) + }; +} +function expect(str) { + if (kind === str) { + lex(); + return; + } + let found; + if (kind === 'EOF') { + found = '[end of file]'; + } else if (end - start > 1) { + found = '`' + string.slice(start, end) + '`'; + } else { + const match = string.slice(start).match(/^.+?\b/); + found = '`' + (match ? match[0] : string[start]) + '`'; + } + throw syntaxError(`Expected ${str} but found ${found}.`); +} +class JSONSyntaxError extends Error { + constructor(message, position) { + super(message); + this.position = position; + } +} +exports.JSONSyntaxError = JSONSyntaxError; +function syntaxError(message) { + return new JSONSyntaxError(message, { + start, + end + }); +} +function skip(k) { + if (kind === k) { + lex(); + return true; + } +} +function ch() { + if (end < strLen) { + end++; + code = end === strLen ? 0 : string.charCodeAt(end); + } + return code; +} +function lex() { + lastEnd = end; + while (code === 9 || code === 10 || code === 13 || code === 32) { + ch(); + } + if (code === 0) { + kind = 'EOF'; + return; + } + start = end; + switch (code) { + case 34: + kind = 'String'; + return readString(); + case 45: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + kind = 'Number'; + return readNumber(); + case 102: + if (string.slice(start, start + 5) !== 'false') { + break; } - } + end += 4; + ch(); + kind = 'Boolean'; + return; + case 110: + if (string.slice(start, start + 4) !== 'null') { + break; + } + end += 3; + ch(); + kind = 'Null'; + return; + case 116: + if (string.slice(start, start + 4) !== 'true') { + break; + } + end += 3; + ch(); + kind = 'Boolean'; + return; } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); + kind = string[start]; + ch(); } -var comment$2 = { - exports: {} -}; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - var noOptions = {}; - var nonWS = /[^\s\u00a0]/; - var Pos = CodeMirror.Pos, - cmp = CodeMirror.cmpPos; - function firstNonWS(str) { - var found = str.search(nonWS); - return found == -1 ? 0 : found; - } - CodeMirror.commands.toggleComment = function (cm) { - cm.toggleComment(); - }; - CodeMirror.defineExtension("toggleComment", function (options) { - if (!options) options = noOptions; - var cm = this; - var minLine = Infinity, - ranges = this.listSelections(), - mode = null; - for (var i = ranges.length - 1; i >= 0; i--) { - var from = ranges[i].from(), - to = ranges[i].to(); - if (from.line >= minLine) continue; - if (to.line >= minLine) to = Pos(minLine, 0); - minLine = from.line; - if (mode == null) { - if (cm.uncomment(from, to, options)) mode = "un";else { - cm.lineComment(from, to, options); - mode = "line"; - } - } else if (mode == "un") { - cm.uncomment(from, to, options); - } else { - cm.lineComment(from, to, options); - } +function readString() { + ch(); + while (code !== 34 && code > 31) { + if (code === 92) { + code = ch(); + switch (code) { + case 34: + case 47: + case 92: + case 98: + case 102: + case 110: + case 114: + case 116: + ch(); + break; + case 117: + ch(); + readHex(); + readHex(); + readHex(); + readHex(); + break; + default: + throw syntaxError('Bad character escape sequence.'); } - }); - function probablyInsideString(cm, pos, line) { - return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"\`]/.test(line); - } - function getMode(cm, pos) { - var mode = cm.getMode(); - return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos); + } else if (end === strLen) { + throw syntaxError('Unterminated string.'); + } else { + ch(); } - CodeMirror.defineExtension("lineComment", function (from, to, options) { - if (!options) options = noOptions; - var self = this, - mode = getMode(self, from); - var firstLine = self.getLine(from.line); - if (firstLine == null || probablyInsideString(self, from, firstLine)) return; - var commentString = options.lineComment || mode.lineComment; - if (!commentString) { - if (options.blockCommentStart || mode.blockCommentStart) { - options.fullLines = true; - self.blockComment(from, to, options); - } - return; - } - var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1); - var pad = options.padding == null ? " " : options.padding; - var blankLines = options.commentBlankLines || from.line == to.line; - self.operation(function () { - if (options.indent) { - var baseString = null; - for (var i = from.line; i < end; ++i) { - var line = self.getLine(i); - var whitespace = line.slice(0, firstNonWS(line)); - if (baseString == null || baseString.length > whitespace.length) { - baseString = whitespace; - } - } - for (var i = from.line; i < end; ++i) { - var line = self.getLine(i), - cut = baseString.length; - if (!blankLines && !nonWS.test(line)) continue; - if (line.slice(0, cut) != baseString) cut = firstNonWS(line); - self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut)); - } - } else { - for (var i = from.line; i < end; ++i) { - if (blankLines || nonWS.test(self.getLine(i))) self.replaceRange(commentString + pad, Pos(i, 0)); - } - } - }); - }); - CodeMirror.defineExtension("blockComment", function (from, to, options) { - if (!options) options = noOptions; - var self = this, - mode = getMode(self, from); - var startString = options.blockCommentStart || mode.blockCommentStart; - var endString = options.blockCommentEnd || mode.blockCommentEnd; - if (!startString || !endString) { - if ((options.lineComment || mode.lineComment) && options.fullLines != false) self.lineComment(from, to, options); - return; - } - if (/\bcomment\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return; - var end = Math.min(to.line, self.lastLine()); - if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end; - var pad = options.padding == null ? " " : options.padding; - if (from.line > end) return; - self.operation(function () { - if (options.fullLines != false) { - var lastLineHasText = nonWS.test(self.getLine(end)); - self.replaceRange(pad + endString, Pos(end)); - self.replaceRange(startString + pad, Pos(from.line, 0)); - var lead = options.blockCommentLead || mode.blockCommentLead; - if (lead != null) { - for (var i = from.line + 1; i <= end; ++i) if (i != end || lastLineHasText) self.replaceRange(lead + pad, Pos(i, 0)); - } - } else { - var atCursor = cmp(self.getCursor("to"), to) == 0, - empty = !self.somethingSelected(); - self.replaceRange(endString, to); - if (atCursor) self.setSelection(empty ? to : self.getCursor("from"), to); - self.replaceRange(startString, from); - } - }); - }); - CodeMirror.defineExtension("uncomment", function (from, to, options) { - if (!options) options = noOptions; - var self = this, - mode = getMode(self, from); - var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), - start = Math.min(from.line, end); - var lineString = options.lineComment || mode.lineComment, - lines = []; - var pad = options.padding == null ? " " : options.padding, - didSomething; - lineComment: { - if (!lineString) break lineComment; - for (var i = start; i <= end; ++i) { - var line = self.getLine(i); - var found = line.indexOf(lineString); - if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1; - if (found == -1 && nonWS.test(line)) break lineComment; - if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment; - lines.push(line); - } - self.operation(function () { - for (var i2 = start; i2 <= end; ++i2) { - var line2 = lines[i2 - start]; - var pos = line2.indexOf(lineString), - endPos = pos + lineString.length; - if (pos < 0) continue; - if (line2.slice(endPos, endPos + pad.length) == pad) endPos += pad.length; - didSomething = true; - self.replaceRange("", Pos(i2, pos), Pos(i2, endPos)); - } - }); - if (didSomething) return true; - } - var startString = options.blockCommentStart || mode.blockCommentStart; - var endString = options.blockCommentEnd || mode.blockCommentEnd; - if (!startString || !endString) return false; - var lead = options.blockCommentLead || mode.blockCommentLead; - var startLine = self.getLine(start), - open = startLine.indexOf(startString); - if (open == -1) return false; - var endLine = end == start ? startLine : self.getLine(end); - var close = endLine.indexOf(endString, end == start ? open + startString.length : 0); - var insideStart = Pos(start, open + 1), - insideEnd = Pos(end, close + 1); - if (close == -1 || !/comment/.test(self.getTokenTypeAt(insideStart)) || !/comment/.test(self.getTokenTypeAt(insideEnd)) || self.getRange(insideStart, insideEnd, "\n").indexOf(endString) > -1) return false; - var lastStart = startLine.lastIndexOf(startString, from.ch); - var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length); - if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false; - firstEnd = endLine.indexOf(endString, to.ch); - var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch); - lastStart = firstEnd == -1 || almostLastStart == -1 ? -1 : to.ch + almostLastStart; - if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false; - self.operation(function () { - self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)), Pos(end, close + endString.length)); - var openEnd = open + startString.length; - if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length; - self.replaceRange("", Pos(start, open), Pos(start, openEnd)); - if (lead) for (var i2 = start + 1; i2 <= end; ++i2) { - var line2 = self.getLine(i2), - found2 = line2.indexOf(lead); - if (found2 == -1 || nonWS.test(line2.slice(0, found2))) continue; - var foundEnd = found2 + lead.length; - if (pad && line2.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length; - self.replaceRange("", Pos(i2, found2), Pos(i2, foundEnd)); - } - }); - return true; - }); - }); -})(); -var commentExports = comment$2.exports; -const comment = /* @__PURE__ */codemirror.getDefaultExportFromCjs(commentExports); -const comment$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: comment -}, [commentExports]); -exports.comment = comment$1; - -/***/ }), - -/***/ "../../graphiql-react/dist/dialog.cjs.js": -/*!***********************************************!*\ - !*** ../../graphiql-react/dist/dialog.cjs.js ***! - \***********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } + } + if (code === 34) { + ch(); + return; + } + throw syntaxError('Unterminated string.'); +} +function readHex() { + if (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102) { + return ch(); + } + throw syntaxError('Expected hexadecimal digit.'); +} +function readNumber() { + if (code === 45) { + ch(); + } + if (code === 48) { + ch(); + } else { + readDigits(); + } + if (code === 46) { + ch(); + readDigits(); + } + if (code === 69 || code === 101) { + code = ch(); + if (code === 43 || code === 45) { + ch(); } + readDigits(); } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); } -var dialog$2 = { - exports: {} -}; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - function dialogDiv(cm, template, bottom) { - var wrap = cm.getWrapperElement(); - var dialog2; - dialog2 = wrap.appendChild(document.createElement("div")); - if (bottom) dialog2.className = "CodeMirror-dialog CodeMirror-dialog-bottom";else dialog2.className = "CodeMirror-dialog CodeMirror-dialog-top"; - if (typeof template == "string") { - dialog2.innerHTML = template; - } else { - dialog2.appendChild(template); - } - CodeMirror.addClass(wrap, "dialog-opened"); - return dialog2; - } - function closeNotification(cm, newVal) { - if (cm.state.currentNotificationClose) cm.state.currentNotificationClose(); - cm.state.currentNotificationClose = newVal; - } - CodeMirror.defineExtension("openDialog", function (template, callback, options) { - if (!options) options = {}; - closeNotification(this, null); - var dialog2 = dialogDiv(this, template, options.bottom); - var closed = false, - me = this; - function close(newVal) { - if (typeof newVal == "string") { - inp.value = newVal; - } else { - if (closed) return; - closed = true; - CodeMirror.rmClass(dialog2.parentNode, "dialog-opened"); - dialog2.parentNode.removeChild(dialog2); - me.focus(); - if (options.onClose) options.onClose(dialog2); - } - } - var inp = dialog2.getElementsByTagName("input")[0], - button; - if (inp) { - inp.focus(); - if (options.value) { - inp.value = options.value; - if (options.selectValueOnOpen !== false) { - inp.select(); - } - } - if (options.onInput) CodeMirror.on(inp, "input", function (e) { - options.onInput(e, inp.value, close); - }); - if (options.onKeyUp) CodeMirror.on(inp, "keyup", function (e) { - options.onKeyUp(e, inp.value, close); - }); - CodeMirror.on(inp, "keydown", function (e) { - if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { - return; - } - if (e.keyCode == 27 || options.closeOnEnter !== false && e.keyCode == 13) { - inp.blur(); - CodeMirror.e_stop(e); - close(); - } - if (e.keyCode == 13) callback(inp.value, e); - }); - if (options.closeOnBlur !== false) CodeMirror.on(dialog2, "focusout", function (evt) { - if (evt.relatedTarget !== null) close(); - }); - } else if (button = dialog2.getElementsByTagName("button")[0]) { - CodeMirror.on(button, "click", function () { - close(); - me.focus(); - }); - if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close); - button.focus(); - } - return close; - }); - CodeMirror.defineExtension("openConfirm", function (template, callbacks, options) { - closeNotification(this, null); - var dialog2 = dialogDiv(this, template, options && options.bottom); - var buttons = dialog2.getElementsByTagName("button"); - var closed = false, - me = this, - blurring = 1; - function close() { - if (closed) return; - closed = true; - CodeMirror.rmClass(dialog2.parentNode, "dialog-opened"); - dialog2.parentNode.removeChild(dialog2); - me.focus(); - } - buttons[0].focus(); - for (var i = 0; i < buttons.length; ++i) { - var b = buttons[i]; - (function (callback) { - CodeMirror.on(b, "click", function (e) { - CodeMirror.e_preventDefault(e); - close(); - if (callback) callback(me); - }); - })(callbacks[i]); - CodeMirror.on(b, "blur", function () { - --blurring; - setTimeout(function () { - if (blurring <= 0) close(); - }, 200); - }); - CodeMirror.on(b, "focus", function () { - ++blurring; - }); - } - }); - CodeMirror.defineExtension("openNotification", function (template, options) { - closeNotification(this, close); - var dialog2 = dialogDiv(this, template, options && options.bottom); - var closed = false, - doneTimer; - var duration = options && typeof options.duration !== "undefined" ? options.duration : 5e3; - function close() { - if (closed) return; - closed = true; - clearTimeout(doneTimer); - CodeMirror.rmClass(dialog2.parentNode, "dialog-opened"); - dialog2.parentNode.removeChild(dialog2); - } - CodeMirror.on(dialog2, "click", function (e) { - CodeMirror.e_preventDefault(e); - close(); - }); - if (duration) doneTimer = setTimeout(close, duration); - return close; - }); - }); -})(); -var dialogExports = dialog$2.exports; -const dialog = /* @__PURE__ */codemirror.getDefaultExportFromCjs(dialogExports); -const dialog$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: dialog -}, [dialogExports]); -exports.dialog = dialog$1; -exports.dialogExports = dialogExports; +function readDigits() { + if (code < 48 || code > 57) { + throw syntaxError('Expected decimal digit.'); + } + do { + ch(); + } while (code >= 48 && code <= 57); +} /***/ }), -/***/ "../../graphiql-react/dist/foldgutter.cjs.js": -/*!***************************************************!*\ - !*** ../../graphiql-react/dist/foldgutter.cjs.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "../../codemirror-graphql/esm/utils/jump-addon.js": +/*!********************************************************!*\ + !*** ../../codemirror-graphql/esm/utils/jump-addon.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - } +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.defineOption('jump', false, (cm, options, old) => { + if (old && old !== _codemirror.default.Init) { + const oldOnMouseOver = cm.state.jump.onMouseOver; + _codemirror.default.off(cm.getWrapperElement(), 'mouseover', oldOnMouseOver); + const oldOnMouseOut = cm.state.jump.onMouseOut; + _codemirror.default.off(cm.getWrapperElement(), 'mouseout', oldOnMouseOut); + _codemirror.default.off(document, 'keydown', cm.state.jump.onKeyDown); + delete cm.state.jump; + } + if (options) { + const state = cm.state.jump = { + options, + onMouseOver: onMouseOver.bind(null, cm), + onMouseOut: onMouseOut.bind(null, cm), + onKeyDown: onKeyDown.bind(null, cm) + }; + _codemirror.default.on(cm.getWrapperElement(), 'mouseover', state.onMouseOver); + _codemirror.default.on(cm.getWrapperElement(), 'mouseout', state.onMouseOut); + _codemirror.default.on(document, 'keydown', state.onKeyDown); + } +}); +function onMouseOver(cm, event) { + const target = event.target || event.srcElement; + if (!(target instanceof HTMLElement)) { + return; + } + if ((target === null || target === void 0 ? void 0 : target.nodeName) !== 'SPAN') { + return; + } + const box = target.getBoundingClientRect(); + const cursor = { + left: (box.left + box.right) / 2, + top: (box.top + box.bottom) / 2 + }; + cm.state.jump.cursor = cursor; + if (cm.state.jump.isHoldingModifier) { + enableJumpMode(cm); } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); } -var foldgutter$2 = { - exports: {} -}; -var foldcode = { - exports: {} -}; -var hasRequiredFoldcode; -function requireFoldcode() { - if (hasRequiredFoldcode) return foldcode.exports; - hasRequiredFoldcode = 1; - (function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - function doFold(cm, pos, options, force) { - if (options && options.call) { - var finder = options; - options = null; - } else { - var finder = getOption(cm, options, "rangeFinder"); - } - if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); - var minSize = getOption(cm, options, "minFoldSize"); - function getRange(allowFolded) { - var range2 = finder(cm, pos); - if (!range2 || range2.to.line - range2.from.line < minSize) return null; - if (force === "fold") return range2; - var marks = cm.findMarksAt(range2.from); - for (var i = 0; i < marks.length; ++i) { - if (marks[i].__isFold) { - if (!allowFolded) return null; - range2.cleared = true; - marks[i].clear(); - } - } - return range2; - } - var range = getRange(true); - if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) { - pos = CodeMirror.Pos(pos.line - 1, 0); - range = getRange(false); - } - if (!range || range.cleared || force === "unfold") return; - var myWidget = makeWidget(cm, options, range); - CodeMirror.on(myWidget, "mousedown", function (e) { - myRange.clear(); - CodeMirror.e_preventDefault(e); - }); - var myRange = cm.markText(range.from, range.to, { - replacedWith: myWidget, - clearOnEnter: getOption(cm, options, "clearOnEnter"), - __isFold: true - }); - myRange.on("clear", function (from, to) { - CodeMirror.signal(cm, "unfold", cm, from, to); - }); - CodeMirror.signal(cm, "fold", cm, range.from, range.to); - } - function makeWidget(cm, options, range) { - var widget = getOption(cm, options, "widget"); - if (typeof widget == "function") { - widget = widget(range.from, range.to); - } - if (typeof widget == "string") { - var text = document.createTextNode(widget); - widget = document.createElement("span"); - widget.appendChild(text); - widget.className = "CodeMirror-foldmarker"; - } else if (widget) { - widget = widget.cloneNode(true); - } - return widget; - } - CodeMirror.newFoldFunction = function (rangeFinder, widget) { - return function (cm, pos) { - doFold(cm, pos, { - rangeFinder, - widget - }); - }; - }; - CodeMirror.defineExtension("foldCode", function (pos, options, force) { - doFold(this, pos, options, force); - }); - CodeMirror.defineExtension("isFolded", function (pos) { - var marks = this.findMarksAt(pos); - for (var i = 0; i < marks.length; ++i) if (marks[i].__isFold) return true; - }); - CodeMirror.commands.toggleFold = function (cm) { - cm.foldCode(cm.getCursor()); - }; - CodeMirror.commands.fold = function (cm) { - cm.foldCode(cm.getCursor(), null, "fold"); - }; - CodeMirror.commands.unfold = function (cm) { - cm.foldCode(cm.getCursor(), { - scanUp: false - }, "unfold"); - }; - CodeMirror.commands.foldAll = function (cm) { - cm.operation(function () { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) cm.foldCode(CodeMirror.Pos(i, 0), { - scanUp: false - }, "fold"); - }); - }; - CodeMirror.commands.unfoldAll = function (cm) { - cm.operation(function () { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) cm.foldCode(CodeMirror.Pos(i, 0), { - scanUp: false - }, "unfold"); - }); - }; - CodeMirror.registerHelper("fold", "combine", function () { - var funcs = Array.prototype.slice.call(arguments, 0); - return function (cm, start) { - for (var i = 0; i < funcs.length; ++i) { - var found = funcs[i](cm, start); - if (found) return found; - } - }; - }); - CodeMirror.registerHelper("fold", "auto", function (cm, start) { - var helpers = cm.getHelpers(start, "fold"); - for (var i = 0; i < helpers.length; i++) { - var cur = helpers[i](cm, start); - if (cur) return cur; - } - }); - var defaultOptions = { - rangeFinder: CodeMirror.fold.auto, - widget: "↔", - minFoldSize: 0, - scanUp: false, - clearOnEnter: true - }; - CodeMirror.defineOption("foldOptions", null); - function getOption(cm, options, name) { - if (options && options[name] !== void 0) return options[name]; - var editorOptions = cm.options.foldOptions; - if (editorOptions && editorOptions[name] !== void 0) return editorOptions[name]; - return defaultOptions[name]; - } - CodeMirror.defineExtension("foldOption", function (options, name) { - return getOption(this, options, name); - }); - }); - })(); - return foldcode.exports; -} -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror(), requireFoldcode()); - })(function (CodeMirror) { - CodeMirror.defineOption("foldGutter", false, function (cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.clearGutter(cm.state.foldGutter.options.gutter); - cm.state.foldGutter = null; - cm.off("gutterClick", onGutterClick); - cm.off("changes", onChange); - cm.off("viewportChange", onViewportChange); - cm.off("fold", onFold); - cm.off("unfold", onFold); - cm.off("swapDoc", onChange); - } - if (val) { - cm.state.foldGutter = new State(parseOptions(val)); - updateInViewport(cm); - cm.on("gutterClick", onGutterClick); - cm.on("changes", onChange); - cm.on("viewportChange", onViewportChange); - cm.on("fold", onFold); - cm.on("unfold", onFold); - cm.on("swapDoc", onChange); - } - }); - var Pos = CodeMirror.Pos; - function State(options) { - this.options = options; - this.from = this.to = 0; - } - function parseOptions(opts) { - if (opts === true) opts = {}; - if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter"; - if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open"; - if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded"; - return opts; - } - function isFolded(cm, line) { - var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0)); - for (var i = 0; i < marks.length; ++i) { - if (marks[i].__isFold) { - var fromPos = marks[i].find(-1); - if (fromPos && fromPos.line === line) return marks[i]; - } - } +function onMouseOut(cm) { + if (!cm.state.jump.isHoldingModifier && cm.state.jump.cursor) { + cm.state.jump.cursor = null; + return; + } + if (cm.state.jump.isHoldingModifier && cm.state.jump.marker) { + disableJumpMode(cm); + } +} +function onKeyDown(cm, event) { + if (cm.state.jump.isHoldingModifier || !isJumpModifier(event.key)) { + return; + } + cm.state.jump.isHoldingModifier = true; + if (cm.state.jump.cursor) { + enableJumpMode(cm); + } + const onKeyUp = upEvent => { + if (upEvent.code !== event.code) { + return; } - function marker(spec) { - if (typeof spec == "string") { - var elt = document.createElement("div"); - elt.className = spec + " CodeMirror-guttermarker-subtle"; - return elt; - } else { - return spec.cloneNode(true); - } - } - function updateFoldInfo(cm, from, to) { - var opts = cm.state.foldGutter.options, - cur = from - 1; - var minSize = cm.foldOption(opts, "minFoldSize"); - var func = cm.foldOption(opts, "rangeFinder"); - var clsFolded = typeof opts.indicatorFolded == "string" && classTest(opts.indicatorFolded); - var clsOpen = typeof opts.indicatorOpen == "string" && classTest(opts.indicatorOpen); - cm.eachLine(from, to, function (line) { - ++cur; - var mark = null; - var old = line.gutterMarkers; - if (old) old = old[opts.gutter]; - if (isFolded(cm, cur)) { - if (clsFolded && old && clsFolded.test(old.className)) return; - mark = marker(opts.indicatorFolded); - } else { - var pos = Pos(cur, 0); - var range = func && func(cm, pos); - if (range && range.to.line - range.from.line >= minSize) { - if (clsOpen && old && clsOpen.test(old.className)) return; - mark = marker(opts.indicatorOpen); - } - } - if (!mark && !old) return; - cm.setGutterMarker(line, opts.gutter, mark); - }); + cm.state.jump.isHoldingModifier = false; + if (cm.state.jump.marker) { + disableJumpMode(cm); } - function classTest(cls) { - return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); + _codemirror.default.off(document, 'keyup', onKeyUp); + _codemirror.default.off(document, 'click', onClick); + cm.off('mousedown', onMouseDown); + }; + const onClick = clickEvent => { + const { + destination, + options + } = cm.state.jump; + if (destination) { + options.onClick(destination, clickEvent); } - function updateInViewport(cm) { - var vp = cm.getViewport(), - state = cm.state.foldGutter; - if (!state) return; - cm.operation(function () { - updateFoldInfo(cm, vp.from, vp.to); - }); - state.from = vp.from; - state.to = vp.to; - } - function onGutterClick(cm, line, gutter) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - if (gutter != opts.gutter) return; - var folded = isFolded(cm, line); - if (folded) folded.clear();else cm.foldCode(Pos(line, 0), opts); - } - function onChange(cm) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - state.from = state.to = 0; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function () { - updateInViewport(cm); - }, opts.foldOnChangeTimeSpan || 600); - } - function onViewportChange(cm) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function () { - var vp = cm.getViewport(); - if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { - updateInViewport(cm); - } else { - cm.operation(function () { - if (vp.from < state.from) { - updateFoldInfo(cm, vp.from, state.from); - state.from = vp.from; - } - if (vp.to > state.to) { - updateFoldInfo(cm, state.to, vp.to); - state.to = vp.to; - } - }); - } - }, opts.updateViewportTimeSpan || 400); + }; + const onMouseDown = (_, downEvent) => { + if (cm.state.jump.destination) { + downEvent.codemirrorIgnore = true; } - function onFold(cm, from) { - var state = cm.state.foldGutter; - if (!state) return; - var line = from.line; - if (line >= state.from && line < state.to) updateFoldInfo(cm, line, line + 1); + }; + _codemirror.default.on(document, 'keyup', onKeyUp); + _codemirror.default.on(document, 'click', onClick); + cm.on('mousedown', onMouseDown); +} +const isMac = typeof navigator !== 'undefined' && navigator.userAgent.includes('Mac'); +function isJumpModifier(key) { + return key === (isMac ? 'Meta' : 'Control'); +} +function enableJumpMode(cm) { + if (cm.state.jump.marker) { + return; + } + const { + cursor, + options + } = cm.state.jump; + const pos = cm.coordsChar(cursor); + const token = cm.getTokenAt(pos, true); + const getDestination = options.getDestination || cm.getHelper(pos, 'jump'); + if (getDestination) { + const destination = getDestination(token, options, cm); + if (destination) { + const marker = cm.markText({ + line: pos.line, + ch: token.start + }, { + line: pos.line, + ch: token.end + }, { + className: 'CodeMirror-jump-token' + }); + cm.state.jump.marker = marker; + cm.state.jump.destination = destination; } - }); -})(); -var foldgutterExports = foldgutter$2.exports; -const foldgutter = /* @__PURE__ */codemirror.getDefaultExportFromCjs(foldgutterExports); -const foldgutter$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: foldgutter -}, [foldgutterExports]); -exports.foldgutter = foldgutter$1; + } +} +function disableJumpMode(cm) { + const { + marker + } = cm.state.jump; + cm.state.jump.marker = null; + cm.state.jump.destination = null; + marker.clear(); +} /***/ }), -/***/ "../../graphiql-react/dist/forEachState.cjs.js": -/*!*****************************************************!*\ - !*** ../../graphiql-react/dist/forEachState.cjs.js ***! - \*****************************************************/ -/***/ (function(__unused_webpack_module, exports) { +/***/ "../../codemirror-graphql/esm/utils/mode-factory.js": +/*!**********************************************************!*\ + !*** ../../codemirror-graphql/esm/utils/mode-factory.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; -function forEachState(stack, fn) { - const reverseStateStack = []; - let state = stack; - while (state === null || state === void 0 ? void 0 : state.kind) { - reverseStateStack.push(state); - state = state.prevState; - } - for (let i = reverseStateStack.length - 1; i >= 0; i--) { - fn(reverseStateStack[i]); - } -} -exports.forEachState = forEachState; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); +var _modeIndent = _interopRequireDefault(__webpack_require__(/*! ./mode-indent */ "../../codemirror-graphql/esm/utils/mode-indent.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const graphqlModeFactory = config => { + const parser = (0, _graphqlLanguageService.onlineParser)({ + eatWhitespace: stream => stream.eatWhile(_graphqlLanguageService.isIgnored), + lexRules: _graphqlLanguageService.LexRules, + parseRules: _graphqlLanguageService.ParseRules, + editorConfig: { + tabSize: config.tabSize + } + }); + return { + config, + startState: parser.startState, + token: parser.token, + indent: _modeIndent.default, + electricInput: /^\s*[})\]]/, + fold: 'brace', + lineComment: '#', + closeBrackets: { + pairs: '()[]{}""', + explode: '()[]{}' + } + }; +}; +var _default = exports["default"] = graphqlModeFactory; /***/ }), -/***/ "../../graphiql-react/dist/hint.cjs.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/hint.cjs.js ***! - \*********************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +/***/ "../../codemirror-graphql/esm/utils/mode-indent.js": +/*!*********************************************************!*\ + !*** ../../codemirror-graphql/esm/utils/mode-indent.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports) { +"use strict"; -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -__webpack_require__(/*! ./show-hint.cjs.js */ "../../graphiql-react/dist/show-hint.cjs.js"); -const graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); -codemirror.CodeMirror.registerHelper("hint", "graphql", (editor, options) => { +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = indent; +function indent(state, textAfter) { + var _a, _b; const { - schema, - externalFragments, - autocompleteOptions - } = options; - if (!schema) { - return; - } - const cur = editor.getCursor(); - const token = editor.getTokenAt(cur); - const tokenStart = token.type !== null && /"|\w/.test(token.string[0]) ? token.start : token.end; - const position = new graphqlLanguageService.Position(cur.line, tokenStart); - const rawResults = graphqlLanguageService.getAutocompleteSuggestions(schema, editor.getValue(), position, token, externalFragments, autocompleteOptions); - const results = { - list: rawResults.map(item => { - var _a; - return { - text: (_a = item === null || item === void 0 ? void 0 : item.rawInsert) !== null && _a !== void 0 ? _a : item.label, - type: item.type, - description: item.documentation, - isDeprecated: item.isDeprecated, - deprecationReason: item.deprecationReason - }; - }), - from: { - line: cur.line, - ch: tokenStart - }, - to: { - line: cur.line, - ch: token.end - } - }; - if ((results === null || results === void 0 ? void 0 : results.list) && results.list.length > 0) { - results.from = codemirror.CodeMirror.Pos(results.from.line, results.from.ch); - results.to = codemirror.CodeMirror.Pos(results.to.line, results.to.ch); - codemirror.CodeMirror.signal(editor, "hasCompletion", editor, results, token); - } - return results; -}); + levels, + indentLevel + } = state; + const level = !levels || levels.length === 0 ? indentLevel : levels.at(-1) - (((_a = this.electricInput) === null || _a === void 0 ? void 0 : _a.test(textAfter)) ? 1 : 0); + return (level || 0) * (((_b = this.config) === null || _b === void 0 ? void 0 : _b.indentUnit) || 0); +} /***/ }), -/***/ "../../graphiql-react/dist/hint.cjs2.js": -/*!**********************************************!*\ - !*** ../../graphiql-react/dist/hint.cjs2.js ***! - \**********************************************/ +/***/ "../../codemirror-graphql/esm/variables/hint.js": +/*!******************************************************!*\ + !*** ../../codemirror-graphql/esm/variables/hint.js ***! + \******************************************************/ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { +"use strict"; -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -const graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); -const forEachState = __webpack_require__(/*! ./forEachState.cjs.js */ "../../graphiql-react/dist/forEachState.cjs.js"); -function hintList(cursor, token, list) { - const hints = filterAndSortList(list, normalizeText(token.string)); - if (!hints) { - return; - } - const tokenStart = token.type !== null && /"|\w/.test(token.string[0]) ? token.start : token.end; - return { - list: hints, - from: { - line: cursor.line, - ch: tokenStart - }, - to: { - line: cursor.line, - ch: token.end - } - }; -} -function filterAndSortList(list, text) { - if (!text) { - return filterNonEmpty(list, entry => !entry.isDeprecated); - } - const byProximity = list.map(entry => ({ - proximity: getProximity(normalizeText(entry.text), text), - entry - })); - const conciseMatches = filterNonEmpty(filterNonEmpty(byProximity, pair => pair.proximity <= 2), pair => !pair.entry.isDeprecated); - const sortedMatches = conciseMatches.sort((a, b) => (a.entry.isDeprecated ? 1 : 0) - (b.entry.isDeprecated ? 1 : 0) || a.proximity - b.proximity || a.entry.text.length - b.entry.text.length); - return sortedMatches.map(pair => pair.entry); -} -function filterNonEmpty(array, predicate) { - const filtered = array.filter(predicate); - return filtered.length === 0 ? array : filtered; -} -function normalizeText(text) { - return text.toLowerCase().replaceAll(/\W/g, ""); -} -function getProximity(suggestion, text) { - let proximity = lexicalDistance(text, suggestion); - if (suggestion.length > text.length) { - proximity -= suggestion.length - text.length - 1; - proximity += suggestion.indexOf(text) === 0 ? 0 : 0.5; - } - return proximity; -} -function lexicalDistance(a, b) { - let i; - let j; - const d = []; - const aLength = a.length; - const bLength = b.length; - for (i = 0; i <= aLength; i++) { - d[i] = [i]; - } - for (j = 1; j <= bLength; j++) { - d[0][j] = j; - } - for (i = 1; i <= aLength; i++) { - for (j = 1; j <= bLength; j++) { - const cost = a[i - 1] === b[j - 1] ? 0 : 1; - d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); - if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { - d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); - } - } - } - return d[aLength][bLength]; -} -codemirror.CodeMirror.registerHelper("hint", "graphql-variables", (editor, options) => { +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _forEachState = _interopRequireDefault(__webpack_require__(/*! ../utils/forEachState */ "../../codemirror-graphql/esm/utils/forEachState.js")); +var _hintList = _interopRequireDefault(__webpack_require__(/*! ../utils/hintList */ "../../codemirror-graphql/esm/utils/hintList.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.registerHelper('hint', 'graphql-variables', (editor, options) => { const cur = editor.getCursor(); const token = editor.getTokenAt(cur); const results = getVariablesHint(cur, token, options); if ((results === null || results === void 0 ? void 0 : results.list) && results.list.length > 0) { - results.from = codemirror.CodeMirror.Pos(results.from.line, results.from.ch); - results.to = codemirror.CodeMirror.Pos(results.to.line, results.to.ch); - codemirror.CodeMirror.signal(editor, "hasCompletion", editor, results, token); + results.from = _codemirror.default.Pos(results.from.line, results.from.ch); + results.to = _codemirror.default.Pos(results.to.line, results.to.ch); + _codemirror.default.signal(editor, 'hasCompletion', editor, results, token); } return results; }); function getVariablesHint(cur, token, options) { - const state = token.state.kind === "Invalid" ? token.state.prevState : token.state; + const state = token.state.kind === 'Invalid' ? token.state.prevState : token.state; const { kind, step } = state; - if (kind === "Document" && step === 0) { - return hintList(cur, token, [{ - text: "{" + if (kind === 'Document' && step === 0) { + return (0, _hintList.default)(cur, token, [{ + text: '{' }]); } const { @@ -68270,45 +74659,45 @@ function getVariablesHint(cur, token, options) { return; } const typeInfo = getTypeInfo(variableToType, token.state); - if (kind === "Document" || kind === "Variable" && step === 0) { + if (kind === 'Document' || kind === 'Variable' && step === 0) { const variableNames = Object.keys(variableToType); - return hintList(cur, token, variableNames.map(name => ({ + return (0, _hintList.default)(cur, token, variableNames.map(name => ({ text: `"${name}": `, type: variableToType[name] }))); } - if ((kind === "ObjectValue" || kind === "ObjectField" && step === 0) && typeInfo.fields) { + if ((kind === 'ObjectValue' || kind === 'ObjectField' && step === 0) && typeInfo.fields) { const inputFields = Object.keys(typeInfo.fields).map(fieldName => typeInfo.fields[fieldName]); - return hintList(cur, token, inputFields.map(field => ({ + return (0, _hintList.default)(cur, token, inputFields.map(field => ({ text: `"${field.name}": `, type: field.type, description: field.description }))); } - if (kind === "StringValue" || kind === "NumberValue" || kind === "BooleanValue" || kind === "NullValue" || kind === "ListValue" && step === 1 || kind === "ObjectField" && step === 2 || kind === "Variable" && step === 2) { - const namedInputType = typeInfo.type ? graphql.getNamedType(typeInfo.type) : void 0; - if (namedInputType instanceof graphql.GraphQLInputObjectType) { - return hintList(cur, token, [{ - text: "{" + if (kind === 'StringValue' || kind === 'NumberValue' || kind === 'BooleanValue' || kind === 'NullValue' || kind === 'ListValue' && step === 1 || kind === 'ObjectField' && step === 2 || kind === 'Variable' && step === 2) { + const namedInputType = typeInfo.type ? (0, _graphql.getNamedType)(typeInfo.type) : undefined; + if (namedInputType instanceof _graphql.GraphQLInputObjectType) { + return (0, _hintList.default)(cur, token, [{ + text: '{' }]); } - if (namedInputType instanceof graphql.GraphQLEnumType) { + if (namedInputType instanceof _graphql.GraphQLEnumType) { const values = namedInputType.getValues(); - return hintList(cur, token, values.map(value => ({ + return (0, _hintList.default)(cur, token, values.map(value => ({ text: `"${value.name}"`, type: namedInputType, description: value.description }))); } - if (namedInputType === graphql.GraphQLBoolean) { - return hintList(cur, token, [{ - text: "true", - type: graphql.GraphQLBoolean, - description: "Not false." + if (namedInputType === _graphql.GraphQLBoolean) { + return (0, _hintList.default)(cur, token, [{ + text: 'true', + type: _graphql.GraphQLBoolean, + description: 'Not false.' }, { - text: "false", - type: graphql.GraphQLBoolean, - description: "Not true." + text: 'false', + type: _graphql.GraphQLBoolean, + description: 'Not true.' }]); } } @@ -68318,26 +74707,26 @@ function getTypeInfo(variableToType, tokenState) { type: null, fields: null }; - forEachState.forEachState(tokenState, state => { + (0, _forEachState.default)(tokenState, state => { switch (state.kind) { - case "Variable": + case 'Variable': { info.type = variableToType[state.name]; break; } - case "ListValue": + case 'ListValue': { - const nullableType = info.type ? graphql.getNullableType(info.type) : void 0; - info.type = nullableType instanceof graphql.GraphQLList ? nullableType.ofType : null; + const nullableType = info.type ? (0, _graphql.getNullableType)(info.type) : undefined; + info.type = nullableType instanceof _graphql.GraphQLList ? nullableType.ofType : null; break; } - case "ObjectValue": + case 'ObjectValue': { - const objectType = info.type ? graphql.getNamedType(info.type) : void 0; - info.fields = objectType instanceof graphql.GraphQLInputObjectType ? objectType.getFields() : null; + const objectType = info.type ? (0, _graphql.getNamedType)(info.type) : undefined; + info.fields = objectType instanceof _graphql.GraphQLInputObjectType ? objectType.getFields() : null; break; } - case "ObjectField": + case 'ObjectField': { const objectField = state.name && info.fields ? info.fields[state.name] : null; info.type = objectField === null || objectField === void 0 ? void 0 : objectField.type; @@ -68350,18 +74739,260 @@ function getTypeInfo(variableToType, tokenState) { /***/ }), +/***/ "../../codemirror-graphql/esm/variables/lint.js": +/*!******************************************************!*\ + !*** ../../codemirror-graphql/esm/variables/lint.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _jsonParse = _interopRequireWildcard(__webpack_require__(/*! ../utils/jsonParse */ "../../codemirror-graphql/esm/utils/jsonParse.js")); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.registerHelper('lint', 'graphql-variables', (text, options, editor) => { + if (!text) { + return []; + } + let ast; + try { + ast = (0, _jsonParse.default)(text); + } catch (error) { + if (error instanceof _jsonParse.JSONSyntaxError) { + return [lintError(editor, error.position, error.message)]; + } + throw error; + } + const { + variableToType + } = options; + if (!variableToType) { + return []; + } + return validateVariables(editor, variableToType, ast); +}); +function validateVariables(editor, variableToType, variablesAST) { + var _a; + const errors = []; + for (const member of variablesAST.members) { + if (member) { + const variableName = (_a = member.key) === null || _a === void 0 ? void 0 : _a.value; + const type = variableToType[variableName]; + if (type) { + for (const [node, message] of validateValue(type, member.value)) { + errors.push(lintError(editor, node, message)); + } + } else { + errors.push(lintError(editor, member.key, `Variable "$${variableName}" does not appear in any GraphQL query.`)); + } + } + } + return errors; +} +function validateValue(type, valueAST) { + if (!type || !valueAST) { + return []; + } + if (type instanceof _graphql.GraphQLNonNull) { + if (valueAST.kind === 'Null') { + return [[valueAST, `Type "${type}" is non-nullable and cannot be null.`]]; + } + return validateValue(type.ofType, valueAST); + } + if (valueAST.kind === 'Null') { + return []; + } + if (type instanceof _graphql.GraphQLList) { + const itemType = type.ofType; + if (valueAST.kind === 'Array') { + const values = valueAST.values || []; + return mapCat(values, item => validateValue(itemType, item)); + } + return validateValue(itemType, valueAST); + } + if (type instanceof _graphql.GraphQLInputObjectType) { + if (valueAST.kind !== 'Object') { + return [[valueAST, `Type "${type}" must be an Object.`]]; + } + const providedFields = Object.create(null); + const fieldErrors = mapCat(valueAST.members, member => { + var _a; + const fieldName = (_a = member === null || member === void 0 ? void 0 : member.key) === null || _a === void 0 ? void 0 : _a.value; + providedFields[fieldName] = true; + const inputField = type.getFields()[fieldName]; + if (!inputField) { + return [[member.key, `Type "${type}" does not have a field "${fieldName}".`]]; + } + const fieldType = inputField ? inputField.type : undefined; + return validateValue(fieldType, member.value); + }); + for (const fieldName of Object.keys(type.getFields())) { + const field = type.getFields()[fieldName]; + if (!providedFields[fieldName] && field.type instanceof _graphql.GraphQLNonNull && !field.defaultValue) { + fieldErrors.push([valueAST, `Object of type "${type}" is missing required field "${fieldName}".`]); + } + } + return fieldErrors; + } + if (type.name === 'Boolean' && valueAST.kind !== 'Boolean' || type.name === 'String' && valueAST.kind !== 'String' || type.name === 'ID' && valueAST.kind !== 'Number' && valueAST.kind !== 'String' || type.name === 'Float' && valueAST.kind !== 'Number' || type.name === 'Int' && (valueAST.kind !== 'Number' || (valueAST.value | 0) !== valueAST.value)) { + return [[valueAST, `Expected value of type "${type}".`]]; + } + if ((type instanceof _graphql.GraphQLEnumType || type instanceof _graphql.GraphQLScalarType) && (valueAST.kind !== 'String' && valueAST.kind !== 'Number' && valueAST.kind !== 'Boolean' && valueAST.kind !== 'Null' || isNullish(type.parseValue(valueAST.value)))) { + return [[valueAST, `Expected value of type "${type}".`]]; + } + return []; +} +function lintError(editor, node, message) { + return { + message, + severity: 'error', + type: 'validation', + from: editor.posFromIndex(node.start), + to: editor.posFromIndex(node.end) + }; +} +function isNullish(value) { + return value === null || value === undefined || value !== value; +} +function mapCat(array, mapper) { + return Array.prototype.concat.apply([], array.map(mapper)); +} + +/***/ }), + +/***/ "../../codemirror-graphql/esm/variables/mode.js": +/*!******************************************************!*\ + !*** ../../codemirror-graphql/esm/variables/mode.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +var _codemirror = _interopRequireDefault(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js")); +var _graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); +var _modeIndent = _interopRequireDefault(__webpack_require__(/*! ../utils/mode-indent */ "../../codemirror-graphql/esm/utils/mode-indent.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +_codemirror.default.defineMode('graphql-variables', config => { + const parser = (0, _graphqlLanguageService.onlineParser)({ + eatWhitespace: stream => stream.eatSpace(), + lexRules: LexRules, + parseRules: ParseRules, + editorConfig: { + tabSize: config.tabSize + } + }); + return { + config, + startState: parser.startState, + token: parser.token, + indent: _modeIndent.default, + electricInput: /^\s*[}\]]/, + fold: 'brace', + closeBrackets: { + pairs: '[]{}""', + explode: '[]{}' + } + }; +}); +const LexRules = { + Punctuation: /^\[|]|\{|\}|:|,/, + Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, + String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, + Keyword: /^true|false|null/ +}; +const ParseRules = { + Document: [(0, _graphqlLanguageService.p)('{'), (0, _graphqlLanguageService.list)('Variable', (0, _graphqlLanguageService.opt)((0, _graphqlLanguageService.p)(','))), (0, _graphqlLanguageService.p)('}')], + Variable: [namedKey('variable'), (0, _graphqlLanguageService.p)(':'), 'Value'], + Value(token) { + switch (token.kind) { + case 'Number': + return 'NumberValue'; + case 'String': + return 'StringValue'; + case 'Punctuation': + switch (token.value) { + case '[': + return 'ListValue'; + case '{': + return 'ObjectValue'; + } + return null; + case 'Keyword': + switch (token.value) { + case 'true': + case 'false': + return 'BooleanValue'; + case 'null': + return 'NullValue'; + } + return null; + } + }, + NumberValue: [(0, _graphqlLanguageService.t)('Number', 'number')], + StringValue: [(0, _graphqlLanguageService.t)('String', 'string')], + BooleanValue: [(0, _graphqlLanguageService.t)('Keyword', 'builtin')], + NullValue: [(0, _graphqlLanguageService.t)('Keyword', 'keyword')], + ListValue: [(0, _graphqlLanguageService.p)('['), (0, _graphqlLanguageService.list)('Value', (0, _graphqlLanguageService.opt)((0, _graphqlLanguageService.p)(','))), (0, _graphqlLanguageService.p)(']')], + ObjectValue: [(0, _graphqlLanguageService.p)('{'), (0, _graphqlLanguageService.list)('ObjectField', (0, _graphqlLanguageService.opt)((0, _graphqlLanguageService.p)(','))), (0, _graphqlLanguageService.p)('}')], + ObjectField: [namedKey('attribute'), (0, _graphqlLanguageService.p)(':'), 'Value'] +}; +function namedKey(style) { + return { + style, + match: token => token.kind === 'String', + update(state, token) { + state.name = token.value.slice(1, -1); + } + }; +} + +/***/ }), + /***/ "../../graphiql-react/dist/index.js": /*!******************************************!*\ !*** ../../graphiql-react/dist/index.js ***! \******************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { + get: () => from[key], + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable + }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( +// If the importer is in node compatibility mode or this is not an ESM +// file that has been converted to a CommonJS file using a Babel- +// compatible transform (i.e. "__esModule" has not been set), then set +// "default" to the CommonJS "module.exports" for node compatibility. +isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { + value: mod, + enumerable: true +}) : target, mod)); Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js"); +const reactCompilerRuntime = __webpack_require__(/*! react-compiler-runtime */ "../../../node_modules/react-compiler-runtime/dist/index.js"); const React = __webpack_require__(/*! react */ "react"); const clsx = __webpack_require__(/*! clsx */ "../../../node_modules/clsx/dist/clsx.m.js"); const graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); @@ -68422,19 +75053,49 @@ function createContextHook(context) { } const StorageContext = createNullableContext("StorageContext"); function StorageContextProvider(props) { + const $ = reactCompilerRuntime.c(8); const isInitialRender = React.useRef(true); - const [storage, setStorage] = React.useState(() => new toolkit.StorageAPI(props.storage)); - React.useEffect(() => { - if (isInitialRender.current) { - isInitialRender.current = false; - } else { - setStorage(new toolkit.StorageAPI(props.storage)); - } - }, [props.storage]); - return /* @__PURE__ */jsxRuntime.jsx(StorageContext.Provider, { - value: storage, - children: props.children - }); + let t0; + if ($[0] !== props.storage) { + t0 = () => new toolkit.StorageAPI(props.storage); + $[0] = props.storage; + $[1] = t0; + } else { + t0 = $[1]; + } + const [storage, setStorage] = React.useState(t0); + let t1; + let t2; + if ($[2] !== props.storage) { + t1 = () => { + if (isInitialRender.current) { + isInitialRender.current = false; + } else { + setStorage(new toolkit.StorageAPI(props.storage)); + } + }; + t2 = [props.storage]; + $[2] = props.storage; + $[3] = t1; + $[4] = t2; + } else { + t1 = $[3]; + t2 = $[4]; + } + React.useEffect(t1, t2); + let t3; + if ($[5] !== props.children || $[6] !== storage) { + t3 = /* @__PURE__ */jsxRuntime.jsx(StorageContext.Provider, { + value: storage, + children: props.children + }); + $[5] = props.children; + $[6] = storage; + $[7] = t3; + } else { + t3 = $[7]; + } + return t3; } const useStorageContext = createContextHook(StorageContext); const SvgArgument = ({ @@ -68921,198 +75582,20 @@ const SvgMerge = ({ d: "M17.2492 6V2.9569C17.2492 1.73806 16.2611 0.75 15.0423 0.75L2.9569 0.75C1.73806 0.75 0.75 1.73806 0.75 2.9569L0.75 6", stroke: "currentColor", strokeWidth: 1.5 -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M0.749873 12V15.0431C0.749873 16.2619 1.73794 17.25 2.95677 17.25H15.0421C16.261 17.25 17.249 16.2619 17.249 15.0431V12", - stroke: "currentColor", - strokeWidth: 1.5 -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M6 4.5L9 7.5L12 4.5", - stroke: "currentColor", - strokeWidth: 1.5 -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M12 13.5L9 10.5L6 13.5", - stroke: "currentColor", - strokeWidth: 1.5 -})); -const SvgPen = ({ - title, - titleId, - ...props -}) => /* @__PURE__ */React__namespace.createElement("svg", { - height: "1em", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId, - ...props -}, title ? /* @__PURE__ */React__namespace.createElement("title", { - id: titleId -}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { - d: "M0.75 13.25L0.0554307 12.967C-0.0593528 13.2488 0.00743073 13.5719 0.224488 13.7851C0.441545 13.9983 0.765869 14.0592 1.04549 13.9393L0.75 13.25ZM12.8214 1.83253L12.2911 2.36286L12.2911 2.36286L12.8214 1.83253ZM12.8214 3.90194L13.3517 4.43227L12.8214 3.90194ZM10.0981 1.17859L9.56773 0.648259L10.0981 1.17859ZM12.1675 1.17859L12.6978 0.648258L12.6978 0.648257L12.1675 1.17859ZM2.58049 8.75697L3.27506 9.03994L2.58049 8.75697ZM2.70066 8.57599L3.23099 9.10632L2.70066 8.57599ZM5.2479 11.4195L4.95355 10.7297L5.2479 11.4195ZM5.42036 11.303L4.89003 10.7727L5.42036 11.303ZM4.95355 10.7297C4.08882 11.0987 3.41842 11.362 2.73535 11.6308C2.05146 11.9 1.35588 12.1743 0.454511 12.5607L1.04549 13.9393C1.92476 13.5624 2.60256 13.2951 3.28469 13.0266C3.96762 12.7578 4.65585 12.4876 5.54225 12.1093L4.95355 10.7297ZM1.44457 13.533L3.27506 9.03994L1.88592 8.474L0.0554307 12.967L1.44457 13.533ZM3.23099 9.10632L10.6284 1.70892L9.56773 0.648259L2.17033 8.04566L3.23099 9.10632ZM11.6371 1.70892L12.2911 2.36286L13.3517 1.3022L12.6978 0.648258L11.6371 1.70892ZM12.2911 3.37161L4.89003 10.7727L5.95069 11.8333L13.3517 4.43227L12.2911 3.37161ZM12.2911 2.36286C12.5696 2.64142 12.5696 3.09305 12.2911 3.37161L13.3517 4.43227C14.2161 3.56792 14.2161 2.16654 13.3517 1.3022L12.2911 2.36286ZM10.6284 1.70892C10.9069 1.43036 11.3586 1.43036 11.6371 1.70892L12.6978 0.648257C11.8335 -0.216088 10.4321 -0.216084 9.56773 0.648259L10.6284 1.70892ZM3.27506 9.03994C3.26494 9.06479 3.24996 9.08735 3.23099 9.10632L2.17033 8.04566C2.04793 8.16806 1.95123 8.31369 1.88592 8.474L3.27506 9.03994ZM5.54225 12.1093C5.69431 12.0444 5.83339 11.9506 5.95069 11.8333L4.89003 10.7727C4.90863 10.7541 4.92988 10.7398 4.95355 10.7297L5.54225 12.1093Z", - fill: "currentColor" -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M11.5 4.5L9.5 2.5", - stroke: "currentColor", - strokeWidth: 1.4026, - strokeLinecap: "round", - strokeLinejoin: "round" -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M5.5 10.5L3.5 8.5", - stroke: "currentColor", - strokeWidth: 1.4026, - strokeLinecap: "round", - strokeLinejoin: "round" -})); -const SvgPlay = ({ - title, - titleId, - ...props -}) => /* @__PURE__ */React__namespace.createElement("svg", { - height: "1em", - viewBox: "0 0 16 18", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId, - ...props -}, title ? /* @__PURE__ */React__namespace.createElement("title", { - id: titleId -}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { - d: "M1.32226e-07 1.6609C7.22332e-08 0.907329 0.801887 0.424528 1.46789 0.777117L15.3306 8.11621C16.0401 8.49182 16.0401 9.50818 15.3306 9.88379L1.46789 17.2229C0.801886 17.5755 1.36076e-06 17.0927 1.30077e-06 16.3391L1.32226e-07 1.6609Z", - fill: "currentColor" -})); -const SvgPlus = ({ - title, - titleId, - ...props -}) => /* @__PURE__ */React__namespace.createElement("svg", { - height: "1em", - viewBox: "0 0 10 16", - fill: "currentColor", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId, - ...props -}, title ? /* @__PURE__ */React__namespace.createElement("title", { - id: titleId -}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M4.25 9.25V13.5H5.75V9.25L10 9.25V7.75L5.75 7.75V3.5H4.25V7.75L0 7.75V9.25L4.25 9.25Z" -})); -const SvgPrettify = ({ - title, - titleId, - ...props -}) => /* @__PURE__ */React__namespace.createElement("svg", { - width: 25, - height: 25, - viewBox: "0 0 25 25", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId, - ...props -}, title ? /* @__PURE__ */React__namespace.createElement("title", { - id: titleId -}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { - d: "M10.2852 24.0745L13.7139 18.0742", - stroke: "currentColor", - strokeWidth: 1.5625 -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M14.5742 24.0749L17.1457 19.7891", - stroke: "currentColor", - strokeWidth: 1.5625 -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M19.4868 24.0735L20.7229 21.7523C21.3259 20.6143 21.5457 19.3122 21.3496 18.0394C21.1535 16.7666 20.5519 15.591 19.6342 14.6874L23.7984 6.87853C24.0123 6.47728 24.0581 6.00748 23.9256 5.57249C23.7932 5.1375 23.4933 4.77294 23.0921 4.55901C22.6908 4.34509 22.221 4.29932 21.7861 4.43178C21.3511 4.56424 20.9865 4.86408 20.7726 5.26533L16.6084 13.0742C15.3474 12.8142 14.0362 12.9683 12.8699 13.5135C11.7035 14.0586 10.7443 14.9658 10.135 16.1L6 24.0735", - stroke: "currentColor", - strokeWidth: 1.5625 -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M4 15L5 13L7 12L5 11L4 9L3 11L1 12L3 13L4 15Z", - stroke: "currentColor", - strokeWidth: 1.5625, - strokeLinejoin: "round" -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M11.5 8L12.6662 5.6662L15 4.5L12.6662 3.3338L11.5 1L10.3338 3.3338L8 4.5L10.3338 5.6662L11.5 8Z", - stroke: "currentColor", - strokeWidth: 1.5625, - strokeLinejoin: "round" -})); -const SvgReload = ({ - title, - titleId, - ...props -}) => /* @__PURE__ */React__namespace.createElement("svg", { - height: "1em", - viewBox: "0 0 16 16", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId, - ...props -}, title ? /* @__PURE__ */React__namespace.createElement("title", { - id: titleId -}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { - d: "M4.75 9.25H1.25V12.75", - stroke: "currentColor", - strokeWidth: 1, - strokeLinecap: "square" -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M11.25 6.75H14.75V3.25", - stroke: "currentColor", - strokeWidth: 1, - strokeLinecap: "square" -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M14.1036 6.65539C13.8 5.27698 13.0387 4.04193 11.9437 3.15131C10.8487 2.26069 9.48447 1.76694 8.0731 1.75043C6.66173 1.73392 5.28633 2.19563 4.17079 3.0604C3.05526 3.92516 2.26529 5.14206 1.92947 6.513", - stroke: "currentColor", - strokeWidth: 1 -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M1.89635 9.34461C2.20001 10.723 2.96131 11.9581 4.05631 12.8487C5.15131 13.7393 6.51553 14.2331 7.9269 14.2496C9.33827 14.2661 10.7137 13.8044 11.8292 12.9396C12.9447 12.0748 13.7347 10.8579 14.0705 9.487", - stroke: "currentColor", - strokeWidth: 1 -})); -const SvgRootType = ({ - title, - titleId, - ...props -}) => /* @__PURE__ */React__namespace.createElement("svg", { - height: "1em", - viewBox: "0 0 13 13", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId, - ...props -}, title ? /* @__PURE__ */React__namespace.createElement("title", { - id: titleId -}, title) : null, /* @__PURE__ */React__namespace.createElement("rect", { - x: 0.6, - y: 0.6, - width: 11.8, - height: 11.8, - rx: 5.9, - stroke: "currentColor", - strokeWidth: 1.2 -}), /* @__PURE__ */React__namespace.createElement("path", { - d: "M4.25 7.5C4.25 6 5.75 5 6.5 6.5C7.25 8 8.75 7 8.75 5.5", - stroke: "currentColor", - strokeWidth: 1.2 -})); -const SvgSettings = ({ - title, - titleId, - ...props -}) => /* @__PURE__ */React__namespace.createElement("svg", { - height: "1em", - viewBox: "0 0 21 20", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId, - ...props -}, title ? /* @__PURE__ */React__namespace.createElement("title", { - id: titleId -}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M9.29186 1.92702C9.06924 1.82745 8.87014 1.68202 8.70757 1.50024L7.86631 0.574931C7.62496 0.309957 7.30773 0.12592 6.95791 0.0479385C6.60809 -0.0300431 6.24274 0.00182978 5.91171 0.139208C5.58068 0.276585 5.3001 0.512774 5.10828 0.815537C4.91645 1.1183 4.82272 1.47288 4.83989 1.83089L4.90388 3.08019C4.91612 3.32348 4.87721 3.56662 4.78968 3.79394C4.70215 4.02126 4.56794 4.2277 4.39571 4.39994C4.22347 4.57219 4.01704 4.7064 3.78974 4.79394C3.56243 4.88147 3.3193 4.92038 3.07603 4.90814L1.8308 4.84414C1.47162 4.82563 1.11553 4.91881 0.811445 5.11086C0.507359 5.30292 0.270203 5.58443 0.132561 5.91671C-0.00508149 6.249 -0.0364554 6.61576 0.0427496 6.9666C0.121955 7.31744 0.307852 7.63514 0.5749 7.87606L1.50016 8.71204C1.68193 8.87461 1.82735 9.07373 1.92692 9.29636C2.02648 9.51898 2.07794 9.76012 2.07794 10.004C2.07794 10.2479 2.02648 10.489 1.92692 10.7116C1.82735 10.9343 1.68193 11.1334 1.50016 11.296L0.5749 12.1319C0.309856 12.3729 0.125575 12.6898 0.0471809 13.0393C-0.0312128 13.3888 9.64098e-05 13.754 0.13684 14.0851C0.273583 14.4162 0.509106 14.6971 0.811296 14.8894C1.11349 15.0817 1.46764 15.1762 1.82546 15.1599L3.0707 15.0959C3.31397 15.0836 3.5571 15.1225 3.7844 15.2101C4.01171 15.2976 4.21814 15.4318 4.39037 15.6041C4.56261 15.7763 4.69682 15.9827 4.78435 16.2101C4.87188 16.4374 4.91078 16.6805 4.89855 16.9238L4.83455 18.1691C4.81605 18.5283 4.90921 18.8844 5.10126 19.1885C5.2933 19.4926 5.5748 19.7298 5.90707 19.8674C6.23934 20.0051 6.60608 20.0365 6.9569 19.9572C7.30772 19.878 7.6254 19.6921 7.86631 19.4251L8.7129 18.4998C8.87547 18.318 9.07458 18.1725 9.29719 18.073C9.51981 17.9734 9.76093 17.9219 10.0048 17.9219C10.2487 17.9219 10.4898 17.9734 10.7124 18.073C10.935 18.1725 11.1341 18.318 11.2967 18.4998L12.1326 19.4251C12.3735 19.6921 12.6912 19.878 13.042 19.9572C13.3929 20.0365 13.7596 20.0051 14.0919 19.8674C14.4241 19.7298 14.7056 19.4926 14.8977 19.1885C15.0897 18.8844 15.1829 18.5283 15.1644 18.1691L15.1004 16.9238C15.0882 16.6805 15.1271 16.4374 15.2146 16.2101C15.3021 15.9827 15.4363 15.7763 15.6086 15.6041C15.7808 15.4318 15.9872 15.2976 16.2145 15.2101C16.4418 15.1225 16.685 15.0836 16.9282 15.0959L18.1735 15.1599C18.5326 15.1784 18.8887 15.0852 19.1928 14.8931C19.4969 14.7011 19.7341 14.4196 19.8717 14.0873C20.0093 13.755 20.0407 13.3882 19.9615 13.0374C19.8823 12.6866 19.6964 12.3689 19.4294 12.1279L18.5041 11.292C18.3223 11.1294 18.1769 10.9303 18.0774 10.7076C17.9778 10.485 17.9263 10.2439 17.9263 10C17.9263 9.75612 17.9778 9.51499 18.0774 9.29236C18.1769 9.06973 18.3223 8.87062 18.5041 8.70804L19.4294 7.87206C19.6964 7.63114 19.8823 7.31344 19.9615 6.9626C20.0407 6.61176 20.0093 6.245 19.8717 5.91271C19.7341 5.58043 19.4969 5.29892 19.1928 5.10686C18.8887 4.91481 18.5326 4.82163 18.1735 4.84014L16.9282 4.90414C16.685 4.91638 16.4418 4.87747 16.2145 4.78994C15.9872 4.7024 15.7808 4.56818 15.6086 4.39594C15.4363 4.2237 15.3021 4.01726 15.2146 3.78994C15.1271 3.56262 15.0882 3.31948 15.1004 3.07619L15.1644 1.83089C15.1829 1.4717 15.0897 1.11559 14.8977 0.811487C14.7056 0.507385 14.4241 0.270217 14.0919 0.132568C13.7596 -0.00508182 13.3929 -0.0364573 13.042 0.0427519C12.6912 0.121961 12.3735 0.307869 12.1326 0.574931L11.2914 1.50024C11.1288 1.68202 10.9297 1.82745 10.7071 1.92702C10.4845 2.02659 10.2433 2.07805 9.99947 2.07805C9.7556 2.07805 9.51448 2.02659 9.29186 1.92702ZM14.3745 10C14.3745 12.4162 12.4159 14.375 9.99977 14.375C7.58365 14.375 5.625 12.4162 5.625 10C5.625 7.58375 7.58365 5.625 9.99977 5.625C12.4159 5.625 14.3745 7.58375 14.3745 10Z", - fill: "currentColor" +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M0.749873 12V15.0431C0.749873 16.2619 1.73794 17.25 2.95677 17.25H15.0421C16.261 17.25 17.249 16.2619 17.249 15.0431V12", + stroke: "currentColor", + strokeWidth: 1.5 +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M6 4.5L9 7.5L12 4.5", + stroke: "currentColor", + strokeWidth: 1.5 +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M12 13.5L9 10.5L6 13.5", + stroke: "currentColor", + strokeWidth: 1.5 })); -const SvgStarFilled = ({ +const SvgPen = ({ title, titleId, ...props @@ -69126,17 +75609,28 @@ const SvgStarFilled = ({ }, title ? /* @__PURE__ */React__namespace.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */React__namespace.createElement("path", { - d: "M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z", - fill: "currentColor", - stroke: "currentColor" + d: "M0.75 13.25L0.0554307 12.967C-0.0593528 13.2488 0.00743073 13.5719 0.224488 13.7851C0.441545 13.9983 0.765869 14.0592 1.04549 13.9393L0.75 13.25ZM12.8214 1.83253L12.2911 2.36286L12.2911 2.36286L12.8214 1.83253ZM12.8214 3.90194L13.3517 4.43227L12.8214 3.90194ZM10.0981 1.17859L9.56773 0.648259L10.0981 1.17859ZM12.1675 1.17859L12.6978 0.648258L12.6978 0.648257L12.1675 1.17859ZM2.58049 8.75697L3.27506 9.03994L2.58049 8.75697ZM2.70066 8.57599L3.23099 9.10632L2.70066 8.57599ZM5.2479 11.4195L4.95355 10.7297L5.2479 11.4195ZM5.42036 11.303L4.89003 10.7727L5.42036 11.303ZM4.95355 10.7297C4.08882 11.0987 3.41842 11.362 2.73535 11.6308C2.05146 11.9 1.35588 12.1743 0.454511 12.5607L1.04549 13.9393C1.92476 13.5624 2.60256 13.2951 3.28469 13.0266C3.96762 12.7578 4.65585 12.4876 5.54225 12.1093L4.95355 10.7297ZM1.44457 13.533L3.27506 9.03994L1.88592 8.474L0.0554307 12.967L1.44457 13.533ZM3.23099 9.10632L10.6284 1.70892L9.56773 0.648259L2.17033 8.04566L3.23099 9.10632ZM11.6371 1.70892L12.2911 2.36286L13.3517 1.3022L12.6978 0.648258L11.6371 1.70892ZM12.2911 3.37161L4.89003 10.7727L5.95069 11.8333L13.3517 4.43227L12.2911 3.37161ZM12.2911 2.36286C12.5696 2.64142 12.5696 3.09305 12.2911 3.37161L13.3517 4.43227C14.2161 3.56792 14.2161 2.16654 13.3517 1.3022L12.2911 2.36286ZM10.6284 1.70892C10.9069 1.43036 11.3586 1.43036 11.6371 1.70892L12.6978 0.648257C11.8335 -0.216088 10.4321 -0.216084 9.56773 0.648259L10.6284 1.70892ZM3.27506 9.03994C3.26494 9.06479 3.24996 9.08735 3.23099 9.10632L2.17033 8.04566C2.04793 8.16806 1.95123 8.31369 1.88592 8.474L3.27506 9.03994ZM5.54225 12.1093C5.69431 12.0444 5.83339 11.9506 5.95069 11.8333L4.89003 10.7727C4.90863 10.7541 4.92988 10.7398 4.95355 10.7297L5.54225 12.1093Z", + fill: "currentColor" +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M11.5 4.5L9.5 2.5", + stroke: "currentColor", + strokeWidth: 1.4026, + strokeLinecap: "round", + strokeLinejoin: "round" +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M5.5 10.5L3.5 8.5", + stroke: "currentColor", + strokeWidth: 1.4026, + strokeLinecap: "round", + strokeLinejoin: "round" })); -const SvgStar = ({ +const SvgPlay = ({ title, titleId, ...props }) => /* @__PURE__ */React__namespace.createElement("svg", { height: "1em", - viewBox: "0 0 14 14", + viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": titleId, @@ -69144,8991 +75638,7774 @@ const SvgStar = ({ }, title ? /* @__PURE__ */React__namespace.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */React__namespace.createElement("path", { - d: "M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z", - stroke: "currentColor", - strokeWidth: 1.5 + d: "M1.32226e-07 1.6609C7.22332e-08 0.907329 0.801887 0.424528 1.46789 0.777117L15.3306 8.11621C16.0401 8.49182 16.0401 9.50818 15.3306 9.88379L1.46789 17.2229C0.801886 17.5755 1.36076e-06 17.0927 1.30077e-06 16.3391L1.32226e-07 1.6609Z", + fill: "currentColor" })); -const SvgStop = ({ +const SvgPlus = ({ title, titleId, ...props }) => /* @__PURE__ */React__namespace.createElement("svg", { height: "1em", - viewBox: "0 0 16 16", - fill: "none", + viewBox: "0 0 10 16", + fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": titleId, ...props }, title ? /* @__PURE__ */React__namespace.createElement("title", { id: titleId -}, title) : null, /* @__PURE__ */React__namespace.createElement("rect", { - width: 16, - height: 16, - rx: 2, - fill: "currentColor" +}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M4.25 9.25V13.5H5.75V9.25L10 9.25V7.75L5.75 7.75V3.5H4.25V7.75L0 7.75V9.25L4.25 9.25Z" })); -const SvgTrash = ({ +const SvgPrettify = ({ title, titleId, ...props }) => /* @__PURE__ */React__namespace.createElement("svg", { - width: "1em", - height: "5em", + width: 25, + height: 25, + viewBox: "0 0 25 25", + fill: "none", xmlns: "http://www.w3.org/2000/svg", - fillRule: "evenodd", - "aria-hidden": "true", - viewBox: "0 0 23 23", - style: { - height: "1.5em" - }, - clipRule: "evenodd", "aria-labelledby": titleId, ...props }, title ? /* @__PURE__ */React__namespace.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */React__namespace.createElement("path", { - d: "M19 24h-14c-1.104 0-2-.896-2-2v-17h-1v-2h6v-1.5c0-.827.673-1.5 1.5-1.5h5c.825 0 1.5.671 1.5 1.5v1.5h6v2h-1v17c0 1.104-.896 2-2 2zm0-19h-14v16.5c0 .276.224.5.5.5h13c.276 0 .5-.224.5-.5v-16.5zm-7 7.586l3.293-3.293 1.414 1.414-3.293 3.293 3.293 3.293-1.414 1.414-3.293-3.293-3.293 3.293-1.414-1.414 3.293-3.293-3.293-3.293 1.414-1.414 3.293 3.293zm2-10.586h-4v1h4v-1z", - fill: "currentColor", - strokeWidth: 0.25, - stroke: "currentColor" + d: "M10.2852 24.0745L13.7139 18.0742", + stroke: "currentColor", + strokeWidth: 1.5625 +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M14.5742 24.0749L17.1457 19.7891", + stroke: "currentColor", + strokeWidth: 1.5625 +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M19.4868 24.0735L20.7229 21.7523C21.3259 20.6143 21.5457 19.3122 21.3496 18.0394C21.1535 16.7666 20.5519 15.591 19.6342 14.6874L23.7984 6.87853C24.0123 6.47728 24.0581 6.00748 23.9256 5.57249C23.7932 5.1375 23.4933 4.77294 23.0921 4.55901C22.6908 4.34509 22.221 4.29932 21.7861 4.43178C21.3511 4.56424 20.9865 4.86408 20.7726 5.26533L16.6084 13.0742C15.3474 12.8142 14.0362 12.9683 12.8699 13.5135C11.7035 14.0586 10.7443 14.9658 10.135 16.1L6 24.0735", + stroke: "currentColor", + strokeWidth: 1.5625 +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M4 15L5 13L7 12L5 11L4 9L3 11L1 12L3 13L4 15Z", + stroke: "currentColor", + strokeWidth: 1.5625, + strokeLinejoin: "round" +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M11.5 8L12.6662 5.6662L15 4.5L12.6662 3.3338L11.5 1L10.3338 3.3338L8 4.5L10.3338 5.6662L11.5 8Z", + stroke: "currentColor", + strokeWidth: 1.5625, + strokeLinejoin: "round" })); -const SvgType = ({ +const SvgReload = ({ title, titleId, ...props }) => /* @__PURE__ */React__namespace.createElement("svg", { height: "1em", - viewBox: "0 0 13 13", + viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": titleId, ...props }, title ? /* @__PURE__ */React__namespace.createElement("title", { id: titleId -}, title) : null, /* @__PURE__ */React__namespace.createElement("rect", { - x: 0.6, - y: 0.6, - width: 11.8, - height: 11.8, - rx: 5.9, +}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { + d: "M4.75 9.25H1.25V12.75", stroke: "currentColor", - strokeWidth: 1.2 -}), /* @__PURE__ */React__namespace.createElement("rect", { - x: 5.5, - y: 5.5, - width: 2, - height: 2, - rx: 1, - fill: "currentColor" -})); -const ArgumentIcon = generateIcon(SvgArgument); -const ChevronDownIcon = generateIcon(SvgChevronDown); -const ChevronLeftIcon = generateIcon(SvgChevronLeft); -const ChevronUpIcon = generateIcon(SvgChevronUp); -const CloseIcon = generateIcon(SvgClose); -const CopyIcon = generateIcon(SvgCopy); -const DeprecatedArgumentIcon = generateIcon(SvgDeprecatedArgument); -const DeprecatedEnumValueIcon = generateIcon(SvgDeprecatedEnumValue); -const DeprecatedFieldIcon = generateIcon(SvgDeprecatedField); -const DirectiveIcon = generateIcon(SvgDirective); -const DocsFilledIcon = generateIcon(SvgDocsFilled); -const DocsIcon = generateIcon(SvgDocs); -const EnumValueIcon = generateIcon(SvgEnumValue); -const FieldIcon = generateIcon(SvgField); -const HistoryIcon = generateIcon(SvgHistory); -const ImplementsIcon = generateIcon(SvgImplements); -const KeyboardShortcutIcon = generateIcon(SvgKeyboardShortcut); -const MagnifyingGlassIcon = generateIcon(SvgMagnifyingGlass); -const MergeIcon = generateIcon(SvgMerge); -const PenIcon = generateIcon(SvgPen); -const PlayIcon = generateIcon(SvgPlay); -const PlusIcon = generateIcon(SvgPlus); -const PrettifyIcon = generateIcon(SvgPrettify); -const ReloadIcon = generateIcon(SvgReload); -const RootTypeIcon = generateIcon(SvgRootType); -const SettingsIcon = generateIcon(SvgSettings); -const StarFilledIcon = generateIcon(SvgStarFilled); -const StarIcon = generateIcon(SvgStar); -const StopIcon = generateIcon(SvgStop); -const TrashIcon = generateIcon(SvgTrash); -const TypeIcon = generateIcon(SvgType); -function generateIcon(RawComponent) { - const title = RawComponent.name.replace("Svg", "").replaceAll(/([A-Z])/g, " $1").trimStart().toLowerCase() + " icon"; - function IconComponent(props) { - return /* @__PURE__ */jsxRuntime.jsx(RawComponent, { - title, - ...props - }); - } - IconComponent.displayName = RawComponent.name; - return IconComponent; -} -const UnStyledButton = React.forwardRef((props, ref) => /* @__PURE__ */jsxRuntime.jsx("button", { - ...props, - ref, - className: clsx.clsx("graphiql-un-styled", props.className) -})); -UnStyledButton.displayName = "UnStyledButton"; -const Button$1 = React.forwardRef((props, ref) => /* @__PURE__ */jsxRuntime.jsx("button", { - ...props, - ref, - className: clsx.clsx("graphiql-button", { - success: "graphiql-button-success", - error: "graphiql-button-error" - }[props.state], props.className) -})); -Button$1.displayName = "Button"; -const ButtonGroup = React.forwardRef((props, ref) => /* @__PURE__ */jsxRuntime.jsx("div", { - ...props, - ref, - className: clsx.clsx("graphiql-button-group", props.className) -})); -ButtonGroup.displayName = "ButtonGroup"; -const createComponentGroup = (root, children) => Object.entries(children).reduce((r, [key, value]) => { - r[key] = value; - return r; -}, root); -const DialogClose = React.forwardRef((props, ref) => /* @__PURE__ */jsxRuntime.jsx(D__namespace.Close, { - asChild: true, - children: /* @__PURE__ */jsxRuntime.jsxs(UnStyledButton, { - ...props, - ref, - type: "button", - className: clsx.clsx("graphiql-dialog-close", props.className), - children: [/* @__PURE__ */jsxRuntime.jsx(reactVisuallyHidden.Root, { - children: "Close dialog" - }), /* @__PURE__ */jsxRuntime.jsx(CloseIcon, {})] - }) -})); -DialogClose.displayName = "Dialog.Close"; -function DialogRoot({ - children, - ...props -}) { - return /* @__PURE__ */jsxRuntime.jsx(D__namespace.Root, { - ...props, - children: /* @__PURE__ */jsxRuntime.jsxs(D__namespace.Portal, { - children: [/* @__PURE__ */jsxRuntime.jsx(D__namespace.Overlay, { - className: "graphiql-dialog-overlay" - }), /* @__PURE__ */jsxRuntime.jsx(D__namespace.Content, { - className: "graphiql-dialog", - children - })] - }) - }); -} -const Dialog = createComponentGroup(DialogRoot, { - Close: DialogClose, - Title: D__namespace.Title, - Trigger: D__namespace.Trigger, - Description: D__namespace.Description -}); -const Button = React.forwardRef((props, ref) => /* @__PURE__ */jsxRuntime.jsx(reactDropdownMenu.Trigger, { - asChild: true, - children: /* @__PURE__ */jsxRuntime.jsx("button", { - ...props, - ref, - className: clsx.clsx("graphiql-un-styled", props.className) - }) -})); -Button.displayName = "DropdownMenuButton"; -function Content({ - children, - align = "start", - sideOffset = 5, - className, - ...props -}) { - return /* @__PURE__ */jsxRuntime.jsx(reactDropdownMenu.Portal, { - children: /* @__PURE__ */jsxRuntime.jsx(reactDropdownMenu.Content, { - align, - sideOffset, - className: clsx.clsx("graphiql-dropdown-content", className), - ...props, - children - }) - }); -} -const Item = ({ - className, - children, - ...props -}) => /* @__PURE__ */jsxRuntime.jsx(reactDropdownMenu.Item, { - className: clsx.clsx("graphiql-dropdown-item", className), - ...props, - children -}); -const DropdownMenu = createComponentGroup(reactDropdownMenu.Root, { - Button, - Item, - Content -}); -const markdown = new MarkdownIt({ - breaks: true, - linkify: true -}); -const MarkdownContent = React.forwardRef(({ - children, - onlyShowFirstChild, - type, - ...props -}, ref) => /* @__PURE__ */jsxRuntime.jsx("div", { - ...props, - ref, - className: clsx.clsx(`graphiql-markdown-${type}`, onlyShowFirstChild && "graphiql-markdown-preview", props.className), - dangerouslySetInnerHTML: { - __html: markdown.render(children) - } -})); -MarkdownContent.displayName = "MarkdownContent"; -const Spinner = React.forwardRef((props, ref) => /* @__PURE__ */jsxRuntime.jsx("div", { - ...props, - ref, - className: clsx.clsx("graphiql-spinner", props.className) -})); -Spinner.displayName = "Spinner"; -function TooltipRoot({ - children, - align = "start", - side = "bottom", - sideOffset = 5, - label -}) { - return /* @__PURE__ */jsxRuntime.jsxs(T__namespace.Root, { - children: [/* @__PURE__ */jsxRuntime.jsx(T__namespace.Trigger, { - asChild: true, - children - }), /* @__PURE__ */jsxRuntime.jsx(T__namespace.Portal, { - children: /* @__PURE__ */jsxRuntime.jsx(T__namespace.Content, { - className: "graphiql-tooltip", - align, - side, - sideOffset, - children: label - }) - })] - }); -} -const Tooltip = createComponentGroup(TooltipRoot, { - Provider: T__namespace.Provider -}); -const TabRoot = React.forwardRef(({ - isActive, - value, - children, - className, - ...props -}, ref) => /* @__PURE__ */jsxRuntime.jsx(framerMotion.Reorder.Item, { - ...props, - ref, - value, - "aria-selected": isActive ? "true" : void 0, - role: "tab", - className: clsx.clsx("graphiql-tab", isActive && "graphiql-tab-active", className), - children -})); -TabRoot.displayName = "Tab"; -const TabButton = React.forwardRef((props, ref) => /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { - ...props, - ref, - type: "button", - className: clsx.clsx("graphiql-tab-button", props.className), - children: props.children -})); -TabButton.displayName = "Tab.Button"; -const TabClose = React.forwardRef((props, ref) => /* @__PURE__ */jsxRuntime.jsx(Tooltip, { - label: "Close Tab", - children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { - "aria-label": "Close Tab", - ...props, - ref, - type: "button", - className: clsx.clsx("graphiql-tab-close", props.className), - children: /* @__PURE__ */jsxRuntime.jsx(CloseIcon, {}) - }) -})); -TabClose.displayName = "Tab.Close"; -const Tab = createComponentGroup(TabRoot, { - Button: TabButton, - Close: TabClose -}); -const Tabs = React.forwardRef(({ - values, - onReorder, - children, - className, - ...props -}, ref) => /* @__PURE__ */jsxRuntime.jsx(framerMotion.Reorder.Group, { - ...props, - ref, - values, - onReorder, - axis: "x", - role: "tablist", - className: clsx.clsx("graphiql-tabs", className), - children -})); -Tabs.displayName = "Tabs"; -const HistoryContext = createNullableContext("HistoryContext"); -function HistoryContextProvider({ - maxHistoryLength = DEFAULT_HISTORY_LENGTH, - children -}) { - const storage = useStorageContext(); - const [historyStore] = React.useState(() => - // Fall back to a noop storage when the StorageContext is empty - new toolkit.HistoryStore(storage || new toolkit.StorageAPI(null), maxHistoryLength)); - const [items, setItems] = React.useState(() => historyStore.queries || []); - const value = React.useMemo(() => ({ - addToHistory(operation) { - historyStore.updateHistory(operation); - setItems(historyStore.queries); - }, - editLabel(operation, index) { - historyStore.editLabel(operation, index); - setItems(historyStore.queries); - }, - items, - toggleFavorite(operation) { - historyStore.toggleFavorite(operation); - setItems(historyStore.queries); - }, - setActive: item => item, - deleteFromHistory(item, clearFavorites) { - historyStore.deleteHistory(item, clearFavorites); - setItems(historyStore.queries); - } - }), [items, historyStore]); - return /* @__PURE__ */jsxRuntime.jsx(HistoryContext.Provider, { - value, - children - }); -} -const useHistoryContext = createContextHook(HistoryContext); -const DEFAULT_HISTORY_LENGTH = 20; -function History() { - const { - items: all, - deleteFromHistory - } = useHistoryContext({ - nonNull: true - }); - let items = all.slice().map((item, i) => ({ - ...item, - index: i - })).reverse(); - const favorites = items.filter(item => item.favorite); - if (favorites.length) { - items = items.filter(item => !item.favorite); - } - const [clearStatus, setClearStatus] = React.useState(null); - React.useEffect(() => { - if (clearStatus) { - setTimeout(() => { - setClearStatus(null); - }, 2e3); - } - }, [clearStatus]); - const handleClearStatus = React.useCallback(() => { - try { - for (const item of items) { - deleteFromHistory(item, true); - } - setClearStatus("success"); - } catch { - setClearStatus("error"); - } - }, [deleteFromHistory, items]); - return /* @__PURE__ */jsxRuntime.jsxs("section", { - "aria-label": "History", - className: "graphiql-history", - children: [/* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-history-header", - children: ["History", (clearStatus || items.length > 0) && /* @__PURE__ */jsxRuntime.jsx(Button$1, { - type: "button", - state: clearStatus || void 0, - disabled: !items.length, - onClick: handleClearStatus, - children: { - success: "Cleared", - error: "Failed to Clear" - }[clearStatus] || "Clear" - })] - }), Boolean(favorites.length) && /* @__PURE__ */jsxRuntime.jsx("ul", { - className: "graphiql-history-items", - children: favorites.map(item => /* @__PURE__ */jsxRuntime.jsx(HistoryItem, { - item - }, item.index)) - }), Boolean(favorites.length) && Boolean(items.length) && /* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-history-item-spacer" - }), Boolean(items.length) && /* @__PURE__ */jsxRuntime.jsx("ul", { - className: "graphiql-history-items", - children: items.map(item => /* @__PURE__ */jsxRuntime.jsx(HistoryItem, { - item - }, item.index)) - })] - }); -} -function HistoryItem(props) { - const { - editLabel, - toggleFavorite, - deleteFromHistory, - setActive - } = useHistoryContext({ - nonNull: true, - caller: HistoryItem - }); - const { - headerEditor, - queryEditor, - variableEditor - } = useEditorContext({ - nonNull: true, - caller: HistoryItem - }); - const inputRef = React.useRef(null); - const buttonRef = React.useRef(null); - const [isEditable, setIsEditable] = React.useState(false); - React.useEffect(() => { - var _a; - if (isEditable) { - (_a = inputRef.current) == null ? void 0 : _a.focus(); - } - }, [isEditable]); - const displayName = props.item.label || props.item.operationName || formatQuery(props.item.query); - const handleSave = React.useCallback(() => { - var _a; - setIsEditable(false); - const { - index, - ...item - } = props.item; - editLabel({ - ...item, - label: (_a = inputRef.current) == null ? void 0 : _a.value - }, index); - }, [editLabel, props.item]); - const handleClose = React.useCallback(() => { - setIsEditable(false); - }, []); - const handleEditLabel = React.useCallback(e => { - e.stopPropagation(); - setIsEditable(true); - }, []); - const handleHistoryItemClick = React.useCallback(() => { - const { - query, - variables, - headers - } = props.item; - queryEditor == null ? void 0 : queryEditor.setValue(query !== null && query !== void 0 ? query : ""); - variableEditor == null ? void 0 : variableEditor.setValue(variables !== null && variables !== void 0 ? variables : ""); - headerEditor == null ? void 0 : headerEditor.setValue(headers !== null && headers !== void 0 ? headers : ""); - setActive(props.item); - }, [headerEditor, props.item, queryEditor, setActive, variableEditor]); - const handleDeleteItemFromHistory = React.useCallback(e => { - e.stopPropagation(); - deleteFromHistory(props.item); - }, [props.item, deleteFromHistory]); - const handleToggleFavorite = React.useCallback(e => { - e.stopPropagation(); - toggleFavorite(props.item); - }, [props.item, toggleFavorite]); - return /* @__PURE__ */jsxRuntime.jsx("li", { - className: clsx.clsx("graphiql-history-item", isEditable && "editable"), - children: isEditable ? /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [/* @__PURE__ */jsxRuntime.jsx("input", { - type: "text", - defaultValue: props.item.label, - ref: inputRef, - onKeyDown: e => { - if (e.key === "Esc") { - setIsEditable(false); - } else if (e.key === "Enter") { - setIsEditable(false); - editLabel({ - ...props.item, - label: e.currentTarget.value - }); - } - }, - placeholder: "Type a label" - }), /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { - type: "button", - ref: buttonRef, - onClick: handleSave, - children: "Save" - }), /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { - type: "button", - ref: buttonRef, - onClick: handleClose, - children: /* @__PURE__ */jsxRuntime.jsx(CloseIcon, {}) - })] - }) : /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [/* @__PURE__ */jsxRuntime.jsx(Tooltip, { - label: "Set active", - children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { - type: "button", - className: "graphiql-history-item-label", - onClick: handleHistoryItemClick, - "aria-label": "Set active", - children: displayName - }) - }), /* @__PURE__ */jsxRuntime.jsx(Tooltip, { - label: "Edit label", - children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { - type: "button", - className: "graphiql-history-item-action", - onClick: handleEditLabel, - "aria-label": "Edit label", - children: /* @__PURE__ */jsxRuntime.jsx(PenIcon, { - "aria-hidden": "true" - }) - }) - }), /* @__PURE__ */jsxRuntime.jsx(Tooltip, { - label: props.item.favorite ? "Remove favorite" : "Add favorite", - children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { - type: "button", - className: "graphiql-history-item-action", - onClick: handleToggleFavorite, - "aria-label": props.item.favorite ? "Remove favorite" : "Add favorite", - children: props.item.favorite ? /* @__PURE__ */jsxRuntime.jsx(StarFilledIcon, { - "aria-hidden": "true" - }) : /* @__PURE__ */jsxRuntime.jsx(StarIcon, { - "aria-hidden": "true" - }) - }) - }), /* @__PURE__ */jsxRuntime.jsx(Tooltip, { - label: "Delete from history", - children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { - type: "button", - className: "graphiql-history-item-action", - onClick: handleDeleteItemFromHistory, - "aria-label": "Delete from history", - children: /* @__PURE__ */jsxRuntime.jsx(TrashIcon, { - "aria-hidden": "true" - }) - }) - })] - }) - }); -} -function formatQuery(query) { - return query == null ? void 0 : query.split("\n").map(line => line.replace(/#(.*)/, "")).join(" ").replaceAll("{", " { ").replaceAll("}", " } ").replaceAll(/[\s]{2,}/g, " "); -} -const ExecutionContext = createNullableContext("ExecutionContext"); -function ExecutionContextProvider({ - fetcher, - getDefaultFieldNames, - children, - operationName -}) { - if (!fetcher) { - throw new TypeError("The `ExecutionContextProvider` component requires a `fetcher` function to be passed as prop."); - } - const { - externalFragments, - headerEditor, - queryEditor, - responseEditor, - variableEditor, - updateActiveTabValues - } = useEditorContext({ - nonNull: true, - caller: ExecutionContextProvider - }); - const history = useHistoryContext(); - const autoCompleteLeafs = useAutoCompleteLeafs({ - getDefaultFieldNames, - caller: ExecutionContextProvider - }); - const [isFetching, setIsFetching] = React.useState(false); - const [subscription, setSubscription] = React.useState(null); - const queryIdRef = React.useRef(0); - const stop = React.useCallback(() => { - subscription == null ? void 0 : subscription.unsubscribe(); - setIsFetching(false); - setSubscription(null); - }, [subscription]); - const run = React.useCallback(async () => { - var _ref; - if (!queryEditor || !responseEditor) { - return; - } - if (subscription) { - stop(); - return; - } - const setResponse = value2 => { - responseEditor.setValue(value2); - updateActiveTabValues({ - response: value2 - }); - }; - queryIdRef.current += 1; - const queryId = queryIdRef.current; - let query = autoCompleteLeafs() || queryEditor.getValue(); - const variablesString = variableEditor == null ? void 0 : variableEditor.getValue(); - let variables; - try { - variables = tryParseJsonObject({ - json: variablesString, - errorMessageParse: "Variables are invalid JSON", - errorMessageType: "Variables are not a JSON object." - }); - } catch (error) { - setResponse(error instanceof Error ? error.message : `${error}`); - return; - } - const headersString = headerEditor == null ? void 0 : headerEditor.getValue(); - let headers; - try { - headers = tryParseJsonObject({ - json: headersString, - errorMessageParse: "Headers are invalid JSON", - errorMessageType: "Headers are not a JSON object." - }); - } catch (error) { - setResponse(error instanceof Error ? error.message : `${error}`); - return; - } - if (externalFragments) { - const fragmentDependencies = queryEditor.documentAST ? graphqlLanguageService.getFragmentDependenciesForAST(queryEditor.documentAST, externalFragments) : []; - if (fragmentDependencies.length > 0) { - query += "\n" + fragmentDependencies.map(node => graphql.print(node)).join("\n"); - } - } - setResponse(""); - setIsFetching(true); - const opName = (_ref = operationName !== null && operationName !== void 0 ? operationName : queryEditor.operationName) !== null && _ref !== void 0 ? _ref : void 0; - history == null ? void 0 : history.addToHistory({ - query, - variables: variablesString, - headers: headersString, - operationName: opName - }); - try { - var _headers, _queryEditor$document; - const fullResponse = {}; - const handleResponse = result => { - if (queryId !== queryIdRef.current) { - return; - } - let maybeMultipart = Array.isArray(result) ? result : false; - if (!maybeMultipart && typeof result === "object" && result !== null && "hasNext" in result) { - maybeMultipart = [result]; - } - if (maybeMultipart) { - for (const part of maybeMultipart) { - mergeIncrementalResult(fullResponse, part); - } - setIsFetching(false); - setResponse(toolkit.formatResult(fullResponse)); - } else { - const response = toolkit.formatResult(result); - setIsFetching(false); - setResponse(response); - } - }; - const fetch2 = fetcher({ - query, - variables, - operationName: opName - }, { - headers: (_headers = headers) !== null && _headers !== void 0 ? _headers : void 0, - documentAST: (_queryEditor$document = queryEditor.documentAST) !== null && _queryEditor$document !== void 0 ? _queryEditor$document : void 0 + strokeWidth: 1, + strokeLinecap: "square" +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M11.25 6.75H14.75V3.25", + stroke: "currentColor", + strokeWidth: 1, + strokeLinecap: "square" +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M14.1036 6.65539C13.8 5.27698 13.0387 4.04193 11.9437 3.15131C10.8487 2.26069 9.48447 1.76694 8.0731 1.75043C6.66173 1.73392 5.28633 2.19563 4.17079 3.0604C3.05526 3.92516 2.26529 5.14206 1.92947 6.513", + stroke: "currentColor", + strokeWidth: 1 +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M1.89635 9.34461C2.20001 10.723 2.96131 11.9581 4.05631 12.8487C5.15131 13.7393 6.51553 14.2331 7.9269 14.2496C9.33827 14.2661 10.7137 13.8044 11.8292 12.9396C12.9447 12.0748 13.7347 10.8579 14.0705 9.487", + stroke: "currentColor", + strokeWidth: 1 +})); +const SvgRootType = ({ + title, + titleId, + ...props +}) => /* @__PURE__ */React__namespace.createElement("svg", { + height: "1em", + viewBox: "0 0 13 13", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + "aria-labelledby": titleId, + ...props +}, title ? /* @__PURE__ */React__namespace.createElement("title", { + id: titleId +}, title) : null, /* @__PURE__ */React__namespace.createElement("rect", { + x: 0.6, + y: 0.6, + width: 11.8, + height: 11.8, + rx: 5.9, + stroke: "currentColor", + strokeWidth: 1.2 +}), /* @__PURE__ */React__namespace.createElement("path", { + d: "M4.25 7.5C4.25 6 5.75 5 6.5 6.5C7.25 8 8.75 7 8.75 5.5", + stroke: "currentColor", + strokeWidth: 1.2 +})); +const SvgSettings = ({ + title, + titleId, + ...props +}) => /* @__PURE__ */React__namespace.createElement("svg", { + height: "1em", + viewBox: "0 0 21 20", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + "aria-labelledby": titleId, + ...props +}, title ? /* @__PURE__ */React__namespace.createElement("title", { + id: titleId +}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M9.29186 1.92702C9.06924 1.82745 8.87014 1.68202 8.70757 1.50024L7.86631 0.574931C7.62496 0.309957 7.30773 0.12592 6.95791 0.0479385C6.60809 -0.0300431 6.24274 0.00182978 5.91171 0.139208C5.58068 0.276585 5.3001 0.512774 5.10828 0.815537C4.91645 1.1183 4.82272 1.47288 4.83989 1.83089L4.90388 3.08019C4.91612 3.32348 4.87721 3.56662 4.78968 3.79394C4.70215 4.02126 4.56794 4.2277 4.39571 4.39994C4.22347 4.57219 4.01704 4.7064 3.78974 4.79394C3.56243 4.88147 3.3193 4.92038 3.07603 4.90814L1.8308 4.84414C1.47162 4.82563 1.11553 4.91881 0.811445 5.11086C0.507359 5.30292 0.270203 5.58443 0.132561 5.91671C-0.00508149 6.249 -0.0364554 6.61576 0.0427496 6.9666C0.121955 7.31744 0.307852 7.63514 0.5749 7.87606L1.50016 8.71204C1.68193 8.87461 1.82735 9.07373 1.92692 9.29636C2.02648 9.51898 2.07794 9.76012 2.07794 10.004C2.07794 10.2479 2.02648 10.489 1.92692 10.7116C1.82735 10.9343 1.68193 11.1334 1.50016 11.296L0.5749 12.1319C0.309856 12.3729 0.125575 12.6898 0.0471809 13.0393C-0.0312128 13.3888 9.64098e-05 13.754 0.13684 14.0851C0.273583 14.4162 0.509106 14.6971 0.811296 14.8894C1.11349 15.0817 1.46764 15.1762 1.82546 15.1599L3.0707 15.0959C3.31397 15.0836 3.5571 15.1225 3.7844 15.2101C4.01171 15.2976 4.21814 15.4318 4.39037 15.6041C4.56261 15.7763 4.69682 15.9827 4.78435 16.2101C4.87188 16.4374 4.91078 16.6805 4.89855 16.9238L4.83455 18.1691C4.81605 18.5283 4.90921 18.8844 5.10126 19.1885C5.2933 19.4926 5.5748 19.7298 5.90707 19.8674C6.23934 20.0051 6.60608 20.0365 6.9569 19.9572C7.30772 19.878 7.6254 19.6921 7.86631 19.4251L8.7129 18.4998C8.87547 18.318 9.07458 18.1725 9.29719 18.073C9.51981 17.9734 9.76093 17.9219 10.0048 17.9219C10.2487 17.9219 10.4898 17.9734 10.7124 18.073C10.935 18.1725 11.1341 18.318 11.2967 18.4998L12.1326 19.4251C12.3735 19.6921 12.6912 19.878 13.042 19.9572C13.3929 20.0365 13.7596 20.0051 14.0919 19.8674C14.4241 19.7298 14.7056 19.4926 14.8977 19.1885C15.0897 18.8844 15.1829 18.5283 15.1644 18.1691L15.1004 16.9238C15.0882 16.6805 15.1271 16.4374 15.2146 16.2101C15.3021 15.9827 15.4363 15.7763 15.6086 15.6041C15.7808 15.4318 15.9872 15.2976 16.2145 15.2101C16.4418 15.1225 16.685 15.0836 16.9282 15.0959L18.1735 15.1599C18.5326 15.1784 18.8887 15.0852 19.1928 14.8931C19.4969 14.7011 19.7341 14.4196 19.8717 14.0873C20.0093 13.755 20.0407 13.3882 19.9615 13.0374C19.8823 12.6866 19.6964 12.3689 19.4294 12.1279L18.5041 11.292C18.3223 11.1294 18.1769 10.9303 18.0774 10.7076C17.9778 10.485 17.9263 10.2439 17.9263 10C17.9263 9.75612 17.9778 9.51499 18.0774 9.29236C18.1769 9.06973 18.3223 8.87062 18.5041 8.70804L19.4294 7.87206C19.6964 7.63114 19.8823 7.31344 19.9615 6.9626C20.0407 6.61176 20.0093 6.245 19.8717 5.91271C19.7341 5.58043 19.4969 5.29892 19.1928 5.10686C18.8887 4.91481 18.5326 4.82163 18.1735 4.84014L16.9282 4.90414C16.685 4.91638 16.4418 4.87747 16.2145 4.78994C15.9872 4.7024 15.7808 4.56818 15.6086 4.39594C15.4363 4.2237 15.3021 4.01726 15.2146 3.78994C15.1271 3.56262 15.0882 3.31948 15.1004 3.07619L15.1644 1.83089C15.1829 1.4717 15.0897 1.11559 14.8977 0.811487C14.7056 0.507385 14.4241 0.270217 14.0919 0.132568C13.7596 -0.00508182 13.3929 -0.0364573 13.042 0.0427519C12.6912 0.121961 12.3735 0.307869 12.1326 0.574931L11.2914 1.50024C11.1288 1.68202 10.9297 1.82745 10.7071 1.92702C10.4845 2.02659 10.2433 2.07805 9.99947 2.07805C9.7556 2.07805 9.51448 2.02659 9.29186 1.92702ZM14.3745 10C14.3745 12.4162 12.4159 14.375 9.99977 14.375C7.58365 14.375 5.625 12.4162 5.625 10C5.625 7.58375 7.58365 5.625 9.99977 5.625C12.4159 5.625 14.3745 7.58375 14.3745 10Z", + fill: "currentColor" +})); +const SvgStarFilled = ({ + title, + titleId, + ...props +}) => /* @__PURE__ */React__namespace.createElement("svg", { + height: "1em", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + "aria-labelledby": titleId, + ...props +}, title ? /* @__PURE__ */React__namespace.createElement("title", { + id: titleId +}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { + d: "M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z", + fill: "currentColor", + stroke: "currentColor" +})); +const SvgStar = ({ + title, + titleId, + ...props +}) => /* @__PURE__ */React__namespace.createElement("svg", { + height: "1em", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + "aria-labelledby": titleId, + ...props +}, title ? /* @__PURE__ */React__namespace.createElement("title", { + id: titleId +}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { + d: "M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z", + stroke: "currentColor", + strokeWidth: 1.5 +})); +const SvgStop = ({ + title, + titleId, + ...props +}) => /* @__PURE__ */React__namespace.createElement("svg", { + height: "1em", + viewBox: "0 0 16 16", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + "aria-labelledby": titleId, + ...props +}, title ? /* @__PURE__ */React__namespace.createElement("title", { + id: titleId +}, title) : null, /* @__PURE__ */React__namespace.createElement("rect", { + width: 16, + height: 16, + rx: 2, + fill: "currentColor" +})); +const SvgTrash = ({ + title, + titleId, + ...props +}) => /* @__PURE__ */React__namespace.createElement("svg", { + width: "1em", + height: "5em", + xmlns: "http://www.w3.org/2000/svg", + fillRule: "evenodd", + "aria-hidden": "true", + viewBox: "0 0 23 23", + style: { + height: "1.5em" + }, + clipRule: "evenodd", + "aria-labelledby": titleId, + ...props +}, title ? /* @__PURE__ */React__namespace.createElement("title", { + id: titleId +}, title) : null, /* @__PURE__ */React__namespace.createElement("path", { + d: "M19 24h-14c-1.104 0-2-.896-2-2v-17h-1v-2h6v-1.5c0-.827.673-1.5 1.5-1.5h5c.825 0 1.5.671 1.5 1.5v1.5h6v2h-1v17c0 1.104-.896 2-2 2zm0-19h-14v16.5c0 .276.224.5.5.5h13c.276 0 .5-.224.5-.5v-16.5zm-7 7.586l3.293-3.293 1.414 1.414-3.293 3.293 3.293 3.293-1.414 1.414-3.293-3.293-3.293 3.293-1.414-1.414 3.293-3.293-3.293-3.293 1.414-1.414 3.293 3.293zm2-10.586h-4v1h4v-1z", + fill: "currentColor", + strokeWidth: 0.25, + stroke: "currentColor" +})); +const SvgType = ({ + title, + titleId, + ...props +}) => /* @__PURE__ */React__namespace.createElement("svg", { + height: "1em", + viewBox: "0 0 13 13", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + "aria-labelledby": titleId, + ...props +}, title ? /* @__PURE__ */React__namespace.createElement("title", { + id: titleId +}, title) : null, /* @__PURE__ */React__namespace.createElement("rect", { + x: 0.6, + y: 0.6, + width: 11.8, + height: 11.8, + rx: 5.9, + stroke: "currentColor", + strokeWidth: 1.2 +}), /* @__PURE__ */React__namespace.createElement("rect", { + x: 5.5, + y: 5.5, + width: 2, + height: 2, + rx: 1, + fill: "currentColor" +})); +const ArgumentIcon = generateIcon(SvgArgument); +const ChevronDownIcon = generateIcon(SvgChevronDown); +const ChevronLeftIcon = generateIcon(SvgChevronLeft); +const ChevronUpIcon = generateIcon(SvgChevronUp); +const CloseIcon = generateIcon(SvgClose); +const CopyIcon = generateIcon(SvgCopy); +const DeprecatedArgumentIcon = generateIcon(SvgDeprecatedArgument); +const DeprecatedEnumValueIcon = generateIcon(SvgDeprecatedEnumValue); +const DeprecatedFieldIcon = generateIcon(SvgDeprecatedField); +const DirectiveIcon = generateIcon(SvgDirective); +const DocsFilledIcon = generateIcon(SvgDocsFilled); +const DocsIcon = generateIcon(SvgDocs); +const EnumValueIcon = generateIcon(SvgEnumValue); +const FieldIcon = generateIcon(SvgField); +const HistoryIcon = generateIcon(SvgHistory); +const ImplementsIcon = generateIcon(SvgImplements); +const KeyboardShortcutIcon = generateIcon(SvgKeyboardShortcut); +const MagnifyingGlassIcon = generateIcon(SvgMagnifyingGlass); +const MergeIcon = generateIcon(SvgMerge); +const PenIcon = generateIcon(SvgPen); +const PlayIcon = generateIcon(SvgPlay); +const PlusIcon = generateIcon(SvgPlus); +const PrettifyIcon = generateIcon(SvgPrettify); +const ReloadIcon = generateIcon(SvgReload); +const RootTypeIcon = generateIcon(SvgRootType); +const SettingsIcon = generateIcon(SvgSettings); +const StarFilledIcon = generateIcon(SvgStarFilled); +const StarIcon = generateIcon(SvgStar); +const StopIcon = generateIcon(SvgStop); +const TrashIcon = generateIcon(SvgTrash); +const TypeIcon = generateIcon(SvgType); +function generateIcon(RawComponent) { + const title = RawComponent.name.replace("Svg", "").replaceAll(/([A-Z])/g, " $1").trimStart().toLowerCase() + " icon"; + function IconComponent(props) { + const $ = reactCompilerRuntime.c(2); + let t0; + if ($[0] !== props) { + t0 = /* @__PURE__ */jsxRuntime.jsx(RawComponent, { + title, + ...props }); - const value2 = await Promise.resolve(fetch2); - if (toolkit.isObservable(value2)) { - setSubscription(value2.subscribe({ - next(result) { - handleResponse(result); - }, - error(error) { - setIsFetching(false); - if (error) { - setResponse(toolkit.formatError(error)); - } - setSubscription(null); - }, - complete() { - setIsFetching(false); - setSubscription(null); - } - })); - } else if (toolkit.isAsyncIterable(value2)) { - setSubscription({ - unsubscribe: () => { - var _a, _b; - return (_b = (_a = value2[Symbol.asyncIterator]()).return) == null ? void 0 : _b.call(_a); - } - }); - for await (const result of value2) { - handleResponse(result); - } - setIsFetching(false); - setSubscription(null); - } else { - handleResponse(value2); - } - } catch (error) { - setIsFetching(false); - setResponse(toolkit.formatError(error)); - setSubscription(null); - } - }, [autoCompleteLeafs, externalFragments, fetcher, headerEditor, history, operationName, queryEditor, responseEditor, stop, subscription, updateActiveTabValues, variableEditor]); - const isSubscribed = Boolean(subscription); - const value = React.useMemo(() => ({ - isFetching, - isSubscribed, - operationName: operationName !== null && operationName !== void 0 ? operationName : null, - run, - stop - }), [isFetching, isSubscribed, operationName, run, stop]); - return /* @__PURE__ */jsxRuntime.jsx(ExecutionContext.Provider, { - value, - children - }); -} -const useExecutionContext = createContextHook(ExecutionContext); -function tryParseJsonObject({ - json, - errorMessageParse, - errorMessageType -}) { - let parsed; - try { - parsed = json && json.trim() !== "" ? JSON.parse(json) : void 0; - } catch (error) { - throw new Error(`${errorMessageParse}: ${error instanceof Error ? error.message : error}.`); - } - const isObject = typeof parsed === "object" && parsed !== null && !Array.isArray(parsed); - if (parsed !== void 0 && !isObject) { - throw new Error(errorMessageType); - } - return parsed; -} -const pathsMap = /* @__PURE__ */new WeakMap(); -function mergeIncrementalResult(executionResult, incrementalResult) { - var _incrementalResult$pa; - var _a, _b, _c; - let path = ["data", ...((_incrementalResult$pa = incrementalResult.path) !== null && _incrementalResult$pa !== void 0 ? _incrementalResult$pa : [])]; - for (const result of [executionResult, incrementalResult]) { - if (result.pending) { - let paths = pathsMap.get(executionResult); - if (paths === void 0) { - paths = /* @__PURE__ */new Map(); - pathsMap.set(executionResult, paths); - } - for (const { - id, - path: pendingPath - } of result.pending) { - paths.set(id, ["data", ...pendingPath]); - } - } - } - const { - items - } = incrementalResult; - if (items) { - const { - id - } = incrementalResult; - if (id) { - path = (_a = pathsMap.get(executionResult)) == null ? void 0 : _a.get(id); - if (path === void 0) { - throw new Error("Invalid incremental delivery format."); - } - const list = getValue(executionResult, path.join(".")); - list.push(...items); + $[0] = props; + $[1] = t0; } else { - var _incrementalResult$pa2; - path = ["data", ...((_incrementalResult$pa2 = incrementalResult.path) !== null && _incrementalResult$pa2 !== void 0 ? _incrementalResult$pa2 : [])]; - for (const item of items) { - setValue(executionResult, path.join("."), item); - path[path.length - 1]++; - } - } - } - const { - data - } = incrementalResult; - if (data) { - const { - id - } = incrementalResult; - if (id) { - path = (_b = pathsMap.get(executionResult)) == null ? void 0 : _b.get(id); - if (path === void 0) { - throw new Error("Invalid incremental delivery format."); - } - const { - subPath - } = incrementalResult; - if (subPath !== void 0) { - path = [...path, ...subPath]; - } - } - setValue(executionResult, path.join("."), data, { - merge: true - }); - } - if (incrementalResult.errors) { - executionResult.errors || (executionResult.errors = []); - executionResult.errors.push(...incrementalResult.errors); - } - if (incrementalResult.extensions) { - setValue(executionResult, "extensions", incrementalResult.extensions, { - merge: true - }); - } - if (incrementalResult.incremental) { - for (const incrementalSubResult of incrementalResult.incremental) { - mergeIncrementalResult(executionResult, incrementalSubResult); - } - } - if (incrementalResult.completed) { - for (const { - id, - errors - } of incrementalResult.completed) { - (_c = pathsMap.get(executionResult)) == null ? void 0 : _c.delete(id); - if (errors) { - executionResult.errors || (executionResult.errors = []); - executionResult.errors.push(...errors); - } + t0 = $[1]; } + return t0; } + IconComponent.displayName = RawComponent.name; + return IconComponent; } -const isMacOs = typeof navigator !== "undefined" && navigator.userAgent.includes("Mac"); -const DEFAULT_EDITOR_THEME = "graphiql"; -const DEFAULT_KEY_MAP = "sublime"; -const commonKeys = { - // Persistent search box in Query Editor - [isMacOs ? "Cmd-F" : "Ctrl-F"]: "findPersistent", - "Cmd-G": "findPersistent", - "Ctrl-G": "findPersistent", - // Editor improvements - "Ctrl-Left": "goSubwordLeft", - "Ctrl-Right": "goSubwordRight", - "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight" -}; -async function importCodeMirror(addons, options) { - const CodeMirror = await Promise.resolve().then(() => __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js")).then(n => n.codemirror).then(c => - // Depending on bundler and settings the dynamic import either returns a - // function (e.g. parcel) or an object containing a `default` property - typeof c === "function" ? c : c.default); - await Promise.all((options == null ? void 0 : options.useCommonAddons) === false ? addons : [Promise.resolve().then(() => __webpack_require__(/*! ./show-hint.cjs.js */ "../../graphiql-react/dist/show-hint.cjs.js")).then(n => n.showHint), Promise.resolve().then(() => __webpack_require__(/*! ./matchbrackets.cjs.js */ "../../graphiql-react/dist/matchbrackets.cjs.js")).then(n => n.matchbrackets), Promise.resolve().then(() => __webpack_require__(/*! ./closebrackets.cjs.js */ "../../graphiql-react/dist/closebrackets.cjs.js")).then(n => n.closebrackets), Promise.resolve().then(() => __webpack_require__(/*! ./brace-fold.cjs.js */ "../../graphiql-react/dist/brace-fold.cjs.js")).then(n => n.braceFold), Promise.resolve().then(() => __webpack_require__(/*! ./foldgutter.cjs.js */ "../../graphiql-react/dist/foldgutter.cjs.js")).then(n => n.foldgutter), Promise.resolve().then(() => __webpack_require__(/*! ./lint.cjs.js */ "../../graphiql-react/dist/lint.cjs.js")).then(n => n.lint), Promise.resolve().then(() => __webpack_require__(/*! ./searchcursor.cjs.js */ "../../graphiql-react/dist/searchcursor.cjs.js")).then(n => n.searchcursor), Promise.resolve().then(() => __webpack_require__(/*! ./jump-to-line.cjs.js */ "../../graphiql-react/dist/jump-to-line.cjs.js")).then(n => n.jumpToLine), Promise.resolve().then(() => __webpack_require__(/*! ./dialog.cjs.js */ "../../graphiql-react/dist/dialog.cjs.js")).then(n => n.dialog), - // @ts-expect-error - Promise.resolve().then(() => __webpack_require__(/*! ./sublime.cjs.js */ "../../graphiql-react/dist/sublime.cjs.js")).then(n => n.sublime), ...addons]); - return CodeMirror; -} -const printDefault = ast => { - if (!ast) { - return ""; - } - return graphql.print(ast); -}; -function DefaultValue({ - field -}) { - if (!("defaultValue" in field) || field.defaultValue === void 0) { - return null; - } - const ast = graphql.astFromValue(field.defaultValue, field.type); - if (!ast) { - return null; - } - return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [" = ", /* @__PURE__ */jsxRuntime.jsx("span", { - className: "graphiql-doc-explorer-default-value", - children: printDefault(ast) - })] - }); -} -const SchemaContext = createNullableContext("SchemaContext"); -function SchemaContextProvider(props) { - if (!props.fetcher) { - throw new TypeError("The `SchemaContextProvider` component requires a `fetcher` function to be passed as prop."); +const UnStyledButton = React.forwardRef((props, ref) => { + const $ = reactCompilerRuntime.c(6); + let t0; + if ($[0] !== props.className) { + t0 = clsx.clsx("graphiql-un-styled", props.className); + $[0] = props.className; + $[1] = t0; + } else { + t0 = $[1]; } - const { - initialHeaders, - headerEditor - } = useEditorContext({ - nonNull: true, - caller: SchemaContextProvider - }); - const [schema, setSchema] = React.useState(); - const [isFetching, setIsFetching] = React.useState(false); - const [fetchError, setFetchError] = React.useState(null); - const counterRef = React.useRef(0); - React.useEffect(() => { - setSchema(graphql.isSchema(props.schema) || props.schema === null || props.schema === void 0 ? props.schema : void 0); - counterRef.current++; - }, [props.schema]); - const headersRef = React.useRef(initialHeaders); - React.useEffect(() => { - if (headerEditor) { - headersRef.current = headerEditor.getValue(); - } - }); - const { - introspectionQuery, - introspectionQueryName, - introspectionQuerySansSubscriptions - } = useIntrospectionQuery({ - inputValueDeprecation: props.inputValueDeprecation, - introspectionQueryName: props.introspectionQueryName, - schemaDescription: props.schemaDescription - }); - const { - fetcher, - onSchemaChange, - dangerouslyAssumeSchemaIsValid, - children - } = props; - const introspect = React.useCallback(() => { - if (graphql.isSchema(props.schema) || props.schema === null) { - return; - } - const counter = ++counterRef.current; - const maybeIntrospectionData = props.schema; - async function fetchIntrospectionData() { - if (maybeIntrospectionData) { - return maybeIntrospectionData; - } - const parsedHeaders = parseHeaderString(headersRef.current); - if (!parsedHeaders.isValidJSON) { - setFetchError("Introspection failed as headers are invalid."); - return; - } - const fetcherOpts = parsedHeaders.headers ? { - headers: parsedHeaders.headers - } : {}; - const fetch2 = toolkit.fetcherReturnToPromise(fetcher({ - query: introspectionQuery, - operationName: introspectionQueryName - }, fetcherOpts)); - if (!toolkit.isPromise(fetch2)) { - setFetchError("Fetcher did not return a Promise for introspection."); - return; - } - setIsFetching(true); - setFetchError(null); - let result = await fetch2; - if (typeof result !== "object" || result === null || !("data" in result)) { - const fetch22 = toolkit.fetcherReturnToPromise(fetcher({ - query: introspectionQuerySansSubscriptions, - operationName: introspectionQueryName - }, fetcherOpts)); - if (!toolkit.isPromise(fetch22)) { - throw new Error("Fetcher did not return a Promise for introspection."); - } - result = await fetch22; - } - setIsFetching(false); - if ((result == null ? void 0 : result.data) && "__schema" in result.data) { - return result.data; - } - const responseString = typeof result === "string" ? result : toolkit.formatResult(result); - setFetchError(responseString); - } - fetchIntrospectionData().then(introspectionData => { - if (counter !== counterRef.current || !introspectionData) { - return; - } - try { - const newSchema = graphql.buildClientSchema(introspectionData); - setSchema(newSchema); - onSchemaChange == null ? void 0 : onSchemaChange(newSchema); - } catch (error) { - setFetchError(toolkit.formatError(error)); - } - }).catch(error => { - if (counter !== counterRef.current) { - return; - } - setFetchError(toolkit.formatError(error)); - setIsFetching(false); - }); - }, [fetcher, introspectionQueryName, introspectionQuery, introspectionQuerySansSubscriptions, onSchemaChange, props.schema]); - React.useEffect(() => { - introspect(); - }, [introspect]); - React.useEffect(() => { - function triggerIntrospection(event) { - if (event.ctrlKey && event.key === "R") { - introspect(); - } - } - window.addEventListener("keydown", triggerIntrospection); - return () => window.removeEventListener("keydown", triggerIntrospection); - }); - const validationErrors = React.useMemo(() => { - if (!schema || dangerouslyAssumeSchemaIsValid) { - return []; - } - return graphql.validateSchema(schema); - }, [schema, dangerouslyAssumeSchemaIsValid]); - const value = React.useMemo(() => ({ - fetchError, - introspect, - isFetching, - schema, - validationErrors - }), [fetchError, introspect, isFetching, schema, validationErrors]); - return /* @__PURE__ */jsxRuntime.jsx(SchemaContext.Provider, { - value, - children - }); -} -const useSchemaContext = createContextHook(SchemaContext); -function useIntrospectionQuery({ - inputValueDeprecation, - introspectionQueryName, - schemaDescription -}) { - return React.useMemo(() => { - const queryName = introspectionQueryName || "IntrospectionQuery"; - let query = graphql.getIntrospectionQuery({ - inputValueDeprecation, - schemaDescription + let t1; + if ($[2] !== props || $[3] !== ref || $[4] !== t0) { + t1 = /* @__PURE__ */jsxRuntime.jsx("button", { + ...props, + ref, + className: t0 }); - if (introspectionQueryName) { - query = query.replace("query IntrospectionQuery", `query ${queryName}`); - } - const querySansSubscriptions = query.replace("subscriptionType { name }", ""); - return { - introspectionQueryName: queryName, - introspectionQuery: query, - introspectionQuerySansSubscriptions: querySansSubscriptions - }; - }, [inputValueDeprecation, introspectionQueryName, schemaDescription]); -} -function parseHeaderString(headersString) { - let headers = null; - let isValidJSON = true; - try { - if (headersString) { - headers = JSON.parse(headersString); - } - } catch { - isValidJSON = false; + $[2] = props; + $[3] = ref; + $[4] = t0; + $[5] = t1; + } else { + t1 = $[5]; } - return { - headers, - isValidJSON - }; -} -const initialNavStackItem = { - name: "Docs" -}; -const ExplorerContext = createNullableContext("ExplorerContext"); -function ExplorerContextProvider(props) { - const { - schema, - validationErrors - } = useSchemaContext({ - nonNull: true, - caller: ExplorerContextProvider - }); - const [navStack, setNavStack] = React.useState([initialNavStackItem]); - const push = React.useCallback(item => { - setNavStack(currentState => { - const lastItem = currentState.at(-1); - return lastItem.def === item.def ? - // Avoid pushing duplicate items - currentState : [...currentState, item]; - }); - }, []); - const pop = React.useCallback(() => { - setNavStack(currentState => currentState.length > 1 ? currentState.slice(0, -1) : currentState); - }, []); - const reset = React.useCallback(() => { - setNavStack(currentState => currentState.length === 1 ? currentState : [initialNavStackItem]); - }, []); - React.useEffect(() => { - if (schema == null || validationErrors.length > 0) { - reset(); - } else { - setNavStack(oldNavStack => { - if (oldNavStack.length === 1) { - return oldNavStack; - } - const newNavStack = [initialNavStackItem]; - let lastEntity = null; - for (const item of oldNavStack) { - if (item === initialNavStackItem) { - continue; - } - if (item.def) { - if (graphql.isNamedType(item.def)) { - const newType = schema.getType(item.def.name); - if (newType) { - newNavStack.push({ - name: item.name, - def: newType - }); - lastEntity = newType; - } else { - break; - } - } else if (lastEntity === null) { - break; - } else if (graphql.isObjectType(lastEntity) || graphql.isInputObjectType(lastEntity)) { - const field = lastEntity.getFields()[item.name]; - if (field) { - newNavStack.push({ - name: item.name, - def: field - }); - } else { - break; - } - } else if (graphql.isScalarType(lastEntity) || graphql.isEnumType(lastEntity) || graphql.isInterfaceType(lastEntity) || graphql.isUnionType(lastEntity)) { - break; - } else { - const field = lastEntity; - const arg = field.args.find(a => a.name === item.name); - if (arg) { - newNavStack.push({ - name: item.name, - def: field - }); - } else { - break; - } - } - } else { - lastEntity = null; - newNavStack.push(item); - } - } - return newNavStack; - }); - } - }, [reset, schema, validationErrors]); - const value = React.useMemo(() => ({ - explorerNavStack: navStack, - push, - pop, - reset - }), [navStack, push, pop, reset]); - return /* @__PURE__ */jsxRuntime.jsx(ExplorerContext.Provider, { - value, - children: props.children - }); -} -const useExplorerContext = createContextHook(ExplorerContext); -function renderType(type, renderNamedType) { - if (graphql.isNonNullType(type)) { - return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [renderType(type.ofType, renderNamedType), "!"] + return t1; +}); +UnStyledButton.displayName = "UnStyledButton"; +const Button$1 = React.forwardRef((props, ref) => { + const $ = reactCompilerRuntime.c(7); + let t0; + if ($[0] !== props.className || $[1] !== props.state) { + t0 = clsx.clsx("graphiql-button", { + success: "graphiql-button-success", + error: "graphiql-button-error" + }[props.state], props.className); + $[0] = props.className; + $[1] = props.state; + $[2] = t0; + } else { + t0 = $[2]; + } + let t1; + if ($[3] !== props || $[4] !== ref || $[5] !== t0) { + t1 = /* @__PURE__ */jsxRuntime.jsx("button", { + ...props, + ref, + className: t0 }); + $[3] = props; + $[4] = ref; + $[5] = t0; + $[6] = t1; + } else { + t1 = $[6]; } - if (graphql.isListType(type)) { - return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: ["[", renderType(type.ofType, renderNamedType), "]"] + return t1; +}); +Button$1.displayName = "Button"; +const ButtonGroup = React.forwardRef((props, ref) => { + const $ = reactCompilerRuntime.c(6); + let t0; + if ($[0] !== props.className) { + t0 = clsx.clsx("graphiql-button-group", props.className); + $[0] = props.className; + $[1] = t0; + } else { + t0 = $[1]; + } + let t1; + if ($[2] !== props || $[3] !== ref || $[4] !== t0) { + t1 = /* @__PURE__ */jsxRuntime.jsx("div", { + ...props, + ref, + className: t0 }); + $[2] = props; + $[3] = ref; + $[4] = t0; + $[5] = t1; + } else { + t1 = $[5]; } - return renderNamedType(type); -} -function TypeLink(props) { - const { - push - } = useExplorerContext({ - nonNull: true, - caller: TypeLink - }); - if (!props.type) { - return null; + return t1; +}); +ButtonGroup.displayName = "ButtonGroup"; +const createComponentGroup = (root, children) => Object.entries(children).reduce((r, [key, value]) => { + r[key] = value; + return r; +}, root); +const DialogClose = React.forwardRef((props, ref) => { + const $ = reactCompilerRuntime.c(8); + let t0; + if ($[0] !== props.className) { + t0 = clsx.clsx("graphiql-dialog-close", props.className); + $[0] = props.className; + $[1] = t0; + } else { + t0 = $[1]; } - return renderType(props.type, namedType => /* @__PURE__ */jsxRuntime.jsx("a", { - className: "graphiql-doc-explorer-type-name", - onClick: event => { - event.preventDefault(); - push({ - name: namedType.name, - def: namedType - }); - }, - href: "#", - children: namedType.name - })); -} -function Argument({ - arg, - showDefaultValue, - inline -}) { - const definition = /* @__PURE__ */jsxRuntime.jsxs("span", { - children: [/* @__PURE__ */jsxRuntime.jsx("span", { - className: "graphiql-doc-explorer-argument-name", - children: arg.name - }), ": ", /* @__PURE__ */jsxRuntime.jsx(TypeLink, { - type: arg.type - }), showDefaultValue !== false && /* @__PURE__ */jsxRuntime.jsx(DefaultValue, { - field: arg - })] - }); - if (inline) { - return definition; + let t1; + let t2; + if ($[2] === Symbol.for("react.memo_cache_sentinel")) { + t1 = /* @__PURE__ */jsxRuntime.jsx(reactVisuallyHidden.Root, { + children: "Close dialog" + }); + t2 = /* @__PURE__ */jsxRuntime.jsx(CloseIcon, {}); + $[2] = t1; + $[3] = t2; + } else { + t1 = $[2]; + t2 = $[3]; } - return /* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-argument", - children: [definition, arg.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { - type: "description", - children: arg.description - }) : null, arg.deprecationReason ? /* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-argument-deprecation", - children: [/* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-argument-deprecation-label", - children: "Deprecated" - }), /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { - type: "deprecation", - children: arg.deprecationReason - })] - }) : null] - }); -} -function DeprecationReason(props) { - var _props$preview; - return props.children ? /* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-deprecation", - children: [/* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-deprecation-label", - children: "Deprecated" - }), /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { - type: "deprecation", - onlyShowFirstChild: (_props$preview = props.preview) !== null && _props$preview !== void 0 ? _props$preview : true, - children: props.children - })] - }) : null; -} -function Directive({ - directive -}) { - return /* @__PURE__ */jsxRuntime.jsxs("span", { - className: "graphiql-doc-explorer-directive", - children: ["@", directive.name.value] - }); -} -function ExplorerSection(props) { - const Icon2 = TYPE_TO_ICON[props.title]; - return /* @__PURE__ */jsxRuntime.jsxs("div", { - children: [/* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-section-title", - children: [/* @__PURE__ */jsxRuntime.jsx(Icon2, {}), props.title] - }), /* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-section-content", - children: props.children - })] - }); -} -const TYPE_TO_ICON = { - Arguments: ArgumentIcon, - "Deprecated Arguments": DeprecatedArgumentIcon, - "Deprecated Enum Values": DeprecatedEnumValueIcon, - "Deprecated Fields": DeprecatedFieldIcon, - Directives: DirectiveIcon, - "Enum Values": EnumValueIcon, - Fields: FieldIcon, - Implements: ImplementsIcon, - Implementations: TypeIcon, - "Possible Types": TypeIcon, - "Root Types": RootTypeIcon, - Type: TypeIcon, - "All Schema Types": TypeIcon -}; -function FieldDocumentation(props) { - return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [props.field.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { - type: "description", - children: props.field.description - }) : null, /* @__PURE__ */jsxRuntime.jsx(DeprecationReason, { - preview: false, - children: props.field.deprecationReason - }), /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "Type", - children: /* @__PURE__ */jsxRuntime.jsx(TypeLink, { - type: props.field.type + let t3; + if ($[4] !== props || $[5] !== ref || $[6] !== t0) { + t3 = /* @__PURE__ */jsxRuntime.jsx(D__namespace.Close, { + asChild: true, + children: /* @__PURE__ */jsxRuntime.jsxs(UnStyledButton, { + ...props, + ref, + type: "button", + className: t0, + children: [t1, t2] }) - }), /* @__PURE__ */jsxRuntime.jsx(Arguments, { - field: props.field - }), /* @__PURE__ */jsxRuntime.jsx(Directives, { - field: props.field - })] - }); -} -function Arguments({ - field -}) { - const [showDeprecated, setShowDeprecated] = React.useState(false); - const handleShowDeprecated = React.useCallback(() => { - setShowDeprecated(true); - }, []); - if (!("args" in field)) { - return null; + }); + $[4] = props; + $[5] = ref; + $[6] = t0; + $[7] = t3; + } else { + t3 = $[7]; } - const args = []; - const deprecatedArgs = []; - for (const argument of field.args) { - if (argument.deprecationReason) { - deprecatedArgs.push(argument); - } else { - args.push(argument); - } + return t3; +}); +DialogClose.displayName = "Dialog.Close"; +function DialogRoot(t0) { + const $ = reactCompilerRuntime.c(9); + let children; + let props; + if ($[0] !== t0) { + ({ + children, + ...props + } = t0); + $[0] = t0; + $[1] = children; + $[2] = props; + } else { + children = $[1]; + props = $[2]; } - return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [args.length > 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "Arguments", - children: args.map(arg => /* @__PURE__ */jsxRuntime.jsx(Argument, { - arg - }, arg.name)) - }) : null, deprecatedArgs.length > 0 ? showDeprecated || args.length === 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "Deprecated Arguments", - children: deprecatedArgs.map(arg => /* @__PURE__ */jsxRuntime.jsx(Argument, { - arg - }, arg.name)) - }) : /* @__PURE__ */jsxRuntime.jsx(Button$1, { - type: "button", - onClick: handleShowDeprecated, - children: "Show Deprecated Arguments" - }) : null] - }); -} -function Directives({ - field -}) { - var _a; - const directives = ((_a = field.astNode) == null ? void 0 : _a.directives) || []; - if (!directives || directives.length === 0) { - return null; + let t1; + if ($[3] === Symbol.for("react.memo_cache_sentinel")) { + t1 = /* @__PURE__ */jsxRuntime.jsx(D__namespace.Overlay, { + className: "graphiql-dialog-overlay" + }); + $[3] = t1; + } else { + t1 = $[3]; } - return /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "Directives", - children: directives.map(directive => /* @__PURE__ */jsxRuntime.jsx("div", { - children: /* @__PURE__ */jsxRuntime.jsx(Directive, { - directive - }) - }, directive.name.value)) - }); -} -function SchemaDocumentation(props) { - var _a, _b, _c, _d; - const queryType = props.schema.getQueryType(); - const mutationType = (_b = (_a = props.schema).getMutationType) == null ? void 0 : _b.call(_a); - const subscriptionType = (_d = (_c = props.schema).getSubscriptionType) == null ? void 0 : _d.call(_c); - const typeMap = props.schema.getTypeMap(); - const ignoreTypesInAllSchema = [queryType == null ? void 0 : queryType.name, mutationType == null ? void 0 : mutationType.name, subscriptionType == null ? void 0 : subscriptionType.name]; - return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [/* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { - type: "description", - children: props.schema.description || "A GraphQL schema provides a root type for each kind of operation." - }), /* @__PURE__ */jsxRuntime.jsxs(ExplorerSection, { - title: "Root Types", - children: [queryType ? /* @__PURE__ */jsxRuntime.jsxs("div", { - children: [/* @__PURE__ */jsxRuntime.jsx("span", { - className: "graphiql-doc-explorer-root-type", - children: "query" - }), ": ", /* @__PURE__ */jsxRuntime.jsx(TypeLink, { - type: queryType - })] - }) : null, mutationType && /* @__PURE__ */jsxRuntime.jsxs("div", { - children: [/* @__PURE__ */jsxRuntime.jsx("span", { - className: "graphiql-doc-explorer-root-type", - children: "mutation" - }), ": ", /* @__PURE__ */jsxRuntime.jsx(TypeLink, { - type: mutationType - })] - }), subscriptionType && /* @__PURE__ */jsxRuntime.jsxs("div", { - children: [/* @__PURE__ */jsxRuntime.jsx("span", { - className: "graphiql-doc-explorer-root-type", - children: "subscription" - }), ": ", /* @__PURE__ */jsxRuntime.jsx(TypeLink, { - type: subscriptionType - })] + let t2; + if ($[4] !== children) { + t2 = /* @__PURE__ */jsxRuntime.jsxs(D__namespace.Portal, { + children: [t1, /* @__PURE__ */jsxRuntime.jsx(D__namespace.Content, { + className: "graphiql-dialog", + children })] - }), /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "All Schema Types", - children: typeMap && /* @__PURE__ */jsxRuntime.jsx("div", { - children: Object.values(typeMap).map(type => { - if (ignoreTypesInAllSchema.includes(type.name) || type.name.startsWith("__")) { - return null; - } - return /* @__PURE__ */jsxRuntime.jsx("div", { - children: /* @__PURE__ */jsxRuntime.jsx(TypeLink, { - type - }) - }, type.name); - }) - }) - })] - }); -} -function debounce(duration, fn) { - let timeout; - return function (...args) { - if (timeout) { - window.clearTimeout(timeout); - } - timeout = window.setTimeout(() => { - timeout = null; - fn(...args); - }, duration); - }; -} -function Search() { - const { - explorerNavStack, - push - } = useExplorerContext({ - nonNull: true, - caller: Search - }); - const inputRef = React.useRef(null); - const getSearchResults = useSearchResults(); - const [searchValue, setSearchValue] = React.useState(""); - const [results, setResults] = React.useState(getSearchResults(searchValue)); - const debouncedGetSearchResults = React.useMemo(() => debounce(200, search => { - setResults(getSearchResults(search)); - }), [getSearchResults]); - React.useEffect(() => { - debouncedGetSearchResults(searchValue); - }, [debouncedGetSearchResults, searchValue]); - React.useEffect(() => { - function handleKeyDown(event) { - var _a; - if (event.metaKey && event.key === "k") { - (_a = inputRef.current) == null ? void 0 : _a.focus(); - } - } - window.addEventListener("keydown", handleKeyDown); - return () => window.removeEventListener("keydown", handleKeyDown); - }, []); - const navItem = explorerNavStack.at(-1); - const onSelect = React.useCallback(def => { - push("field" in def ? { - name: def.field.name, - def: def.field - } : { - name: def.type.name, - def: def.type }); - }, [push]); - const isFocused = React.useRef(false); - const handleFocus = React.useCallback(e => { - isFocused.current = e.type === "focus"; - }, []); - const shouldSearchBoxAppear = explorerNavStack.length === 1 || graphql.isObjectType(navItem.def) || graphql.isInterfaceType(navItem.def) || graphql.isInputObjectType(navItem.def); - if (!shouldSearchBoxAppear) { - return null; + $[4] = children; + $[5] = t2; + } else { + t2 = $[5]; } - return /* @__PURE__ */jsxRuntime.jsxs(react.Combobox, { - as: "div", - className: "graphiql-doc-explorer-search", - onChange: onSelect, - "data-state": isFocused ? void 0 : "idle", - "aria-label": `Search ${navItem.name}...`, - children: [/* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-search-input", - onClick: () => { - var _a; - (_a = inputRef.current) == null ? void 0 : _a.focus(); - }, - children: [/* @__PURE__ */jsxRuntime.jsx(MagnifyingGlassIcon, {}), /* @__PURE__ */jsxRuntime.jsx(react.Combobox.Input, { - autoComplete: "off", - onFocus: handleFocus, - onBlur: handleFocus, - onChange: event => setSearchValue(event.target.value), - placeholder: `${isMacOs ? "⌘" : "Ctrl"} K`, - ref: inputRef, - value: searchValue, - "data-cy": "doc-explorer-input" - })] - }), isFocused.current && /* @__PURE__ */jsxRuntime.jsxs(react.Combobox.Options, { - "data-cy": "doc-explorer-list", - children: [results.within.length + results.types.length + results.fields.length === 0 ? /* @__PURE__ */jsxRuntime.jsx("li", { - className: "graphiql-doc-explorer-search-empty", - children: "No results found" - }) : results.within.map((result, i) => /* @__PURE__ */jsxRuntime.jsx(react.Combobox.Option, { - value: result, - "data-cy": "doc-explorer-option", - children: /* @__PURE__ */jsxRuntime.jsx(Field$1, { - field: result.field, - argument: result.argument - }) - }, `within-${i}`)), results.within.length > 0 && results.types.length + results.fields.length > 0 ? /* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-search-divider", - children: "Other results" - }) : null, results.types.map((result, i) => /* @__PURE__ */jsxRuntime.jsx(react.Combobox.Option, { - value: result, - "data-cy": "doc-explorer-option", - children: /* @__PURE__ */jsxRuntime.jsx(Type, { - type: result.type - }) - }, `type-${i}`)), results.fields.map((result, i) => /* @__PURE__ */jsxRuntime.jsxs(react.Combobox.Option, { - value: result, - "data-cy": "doc-explorer-option", - children: [/* @__PURE__ */jsxRuntime.jsx(Type, { - type: result.type - }), ".", /* @__PURE__ */jsxRuntime.jsx(Field$1, { - field: result.field, - argument: result.argument - })] - }, `field-${i}`))] - })] - }); -} -function useSearchResults(caller) { - const { - explorerNavStack - } = useExplorerContext({ - nonNull: true, - caller: caller || useSearchResults - }); - const { - schema - } = useSchemaContext({ - nonNull: true, - caller: caller || useSearchResults - }); - const navItem = explorerNavStack.at(-1); - return React.useCallback(searchValue => { - const matches = { - within: [], - types: [], - fields: [] - }; - if (!schema) { - return matches; - } - const withinType = navItem.def; - const typeMap = schema.getTypeMap(); - let typeNames = Object.keys(typeMap); - if (withinType) { - typeNames = typeNames.filter(n => n !== withinType.name); - typeNames.unshift(withinType.name); - } - for (const typeName of typeNames) { - if (matches.within.length + matches.types.length + matches.fields.length >= 100) { - break; - } - const type = typeMap[typeName]; - if (withinType !== type && isMatch(typeName, searchValue)) { - matches.types.push({ - type - }); - } - if (!graphql.isObjectType(type) && !graphql.isInterfaceType(type) && !graphql.isInputObjectType(type)) { - continue; - } - const fields = type.getFields(); - for (const fieldName in fields) { - const field = fields[fieldName]; - let matchingArgs; - if (!isMatch(fieldName, searchValue)) { - if ("args" in field) { - matchingArgs = field.args.filter(arg => isMatch(arg.name, searchValue)); - if (matchingArgs.length === 0) { - continue; - } - } else { - continue; - } - } - matches[withinType === type ? "within" : "fields"].push(...(matchingArgs ? matchingArgs.map(argument => ({ - type, - field, - argument - })) : [{ - type, - field - }])); - } - } - return matches; - }, [navItem.def, schema]); -} -function isMatch(sourceText, searchValue) { - try { - const escaped = searchValue.replaceAll(/[^_0-9A-Za-z]/g, ch => "\\" + ch); - return sourceText.search(new RegExp(escaped, "i")) !== -1; - } catch { - return sourceText.toLowerCase().includes(searchValue.toLowerCase()); + let t3; + if ($[6] !== props || $[7] !== t2) { + t3 = /* @__PURE__ */jsxRuntime.jsx(D__namespace.Root, { + ...props, + children: t2 + }); + $[6] = props; + $[7] = t2; + $[8] = t3; + } else { + t3 = $[8]; } + return t3; } -function Type(props) { - return /* @__PURE__ */jsxRuntime.jsx("span", { - className: "graphiql-doc-explorer-search-type", - children: props.type.name - }); -} -function Field$1({ - field, - argument -}) { - return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [/* @__PURE__ */jsxRuntime.jsx("span", { - className: "graphiql-doc-explorer-search-field", - children: field.name - }), argument ? /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: ["(", /* @__PURE__ */jsxRuntime.jsx("span", { - className: "graphiql-doc-explorer-search-argument", - children: argument.name - }), ":", " ", renderType(argument.type, namedType => /* @__PURE__ */jsxRuntime.jsx(Type, { - type: namedType - })), ")"] - }) : null] - }); -} -function FieldLink(props) { - const { - push - } = useExplorerContext({ - nonNull: true - }); - return /* @__PURE__ */jsxRuntime.jsx("a", { - className: "graphiql-doc-explorer-field-name", - onClick: event => { - event.preventDefault(); - push({ - name: props.field.name, - def: props.field - }); - }, - href: "#", - children: props.field.name - }); -} -function TypeDocumentation(props) { - return graphql.isNamedType(props.type) ? /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [props.type.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { - type: "description", - children: props.type.description - }) : null, /* @__PURE__ */jsxRuntime.jsx(ImplementsInterfaces, { - type: props.type - }), /* @__PURE__ */jsxRuntime.jsx(Fields, { - type: props.type - }), /* @__PURE__ */jsxRuntime.jsx(EnumValues, { - type: props.type - }), /* @__PURE__ */jsxRuntime.jsx(PossibleTypes, { - type: props.type - })] - }) : null; -} -function ImplementsInterfaces({ - type -}) { - if (!graphql.isObjectType(type)) { - return null; +const Dialog = createComponentGroup(DialogRoot, { + Close: DialogClose, + Title: D__namespace.Title, + Trigger: D__namespace.Trigger, + Description: D__namespace.Description +}); +const Button = React.forwardRef((props, ref) => { + const $ = reactCompilerRuntime.c(6); + let t0; + if ($[0] !== props.className) { + t0 = clsx.clsx("graphiql-un-styled", props.className); + $[0] = props.className; + $[1] = t0; + } else { + t0 = $[1]; } - const interfaces = type.getInterfaces(); - return interfaces.length > 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "Implements", - children: type.getInterfaces().map(implementedInterface => /* @__PURE__ */jsxRuntime.jsx("div", { - children: /* @__PURE__ */jsxRuntime.jsx(TypeLink, { - type: implementedInterface + let t1; + if ($[2] !== props || $[3] !== ref || $[4] !== t0) { + t1 = /* @__PURE__ */jsxRuntime.jsx(reactDropdownMenu.Trigger, { + asChild: true, + children: /* @__PURE__ */jsxRuntime.jsx("button", { + ...props, + ref, + className: t0 }) - }, implementedInterface.name)) - }) : null; -} -function Fields({ - type -}) { - const [showDeprecated, setShowDeprecated] = React.useState(false); - const handleShowDeprecated = React.useCallback(() => { - setShowDeprecated(true); - }, []); - if (!graphql.isObjectType(type) && !graphql.isInterfaceType(type) && !graphql.isInputObjectType(type)) { - return null; + }); + $[2] = props; + $[3] = ref; + $[4] = t0; + $[5] = t1; + } else { + t1 = $[5]; } - const fieldMap = type.getFields(); - const fields = []; - const deprecatedFields = []; - for (const field of Object.keys(fieldMap).map(name => fieldMap[name])) { - if (field.deprecationReason) { - deprecatedFields.push(field); - } else { - fields.push(field); - } + return t1; +}); +Button.displayName = "DropdownMenuButton"; +function Content(t0) { + const $ = reactCompilerRuntime.c(14); + let children; + let className; + let props; + let t1; + let t2; + if ($[0] !== t0) { + ({ + children, + align: t1, + sideOffset: t2, + className, + ...props + } = t0); + $[0] = t0; + $[1] = children; + $[2] = className; + $[3] = props; + $[4] = t1; + $[5] = t2; + } else { + children = $[1]; + className = $[2]; + props = $[3]; + t1 = $[4]; + t2 = $[5]; + } + const align = t1 === void 0 ? "start" : t1; + const sideOffset = t2 === void 0 ? 5 : t2; + let t3; + if ($[6] !== className) { + t3 = clsx.clsx("graphiql-dropdown-content", className); + $[6] = className; + $[7] = t3; + } else { + t3 = $[7]; } - return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [fields.length > 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "Fields", - children: fields.map(field => /* @__PURE__ */jsxRuntime.jsx(Field, { - field - }, field.name)) - }) : null, deprecatedFields.length > 0 ? showDeprecated || fields.length === 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "Deprecated Fields", - children: deprecatedFields.map(field => /* @__PURE__ */jsxRuntime.jsx(Field, { - field - }, field.name)) - }) : /* @__PURE__ */jsxRuntime.jsx(Button$1, { - type: "button", - onClick: handleShowDeprecated, - children: "Show Deprecated Fields" - }) : null] - }); -} -function Field({ - field -}) { - const args = "args" in field ? field.args.filter(arg => !arg.deprecationReason) : []; - return /* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-item", - children: [/* @__PURE__ */jsxRuntime.jsxs("div", { - children: [/* @__PURE__ */jsxRuntime.jsx(FieldLink, { - field - }), args.length > 0 ? /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: ["(", /* @__PURE__ */jsxRuntime.jsx("span", { - children: args.map(arg => args.length === 1 ? /* @__PURE__ */jsxRuntime.jsx(Argument, { - arg, - inline: true - }, arg.name) : /* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-argument-multiple", - children: /* @__PURE__ */jsxRuntime.jsx(Argument, { - arg, - inline: true - }) - }, arg.name)) - }), ")"] - }) : null, ": ", /* @__PURE__ */jsxRuntime.jsx(TypeLink, { - type: field.type - }), /* @__PURE__ */jsxRuntime.jsx(DefaultValue, { - field - })] - }), field.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { - type: "description", - onlyShowFirstChild: true, - children: field.description - }) : null, /* @__PURE__ */jsxRuntime.jsx(DeprecationReason, { - children: field.deprecationReason - })] - }); + let t4; + if ($[8] !== align || $[9] !== children || $[10] !== props || $[11] !== sideOffset || $[12] !== t3) { + t4 = /* @__PURE__ */jsxRuntime.jsx(reactDropdownMenu.Portal, { + children: /* @__PURE__ */jsxRuntime.jsx(reactDropdownMenu.Content, { + align, + sideOffset, + className: t3, + ...props, + children + }) + }); + $[8] = align; + $[9] = children; + $[10] = props; + $[11] = sideOffset; + $[12] = t3; + $[13] = t4; + } else { + t4 = $[13]; + } + return t4; } -function EnumValues({ - type -}) { - const [showDeprecated, setShowDeprecated] = React.useState(false); - const handleShowDeprecated = React.useCallback(() => { - setShowDeprecated(true); - }, []); - if (!graphql.isEnumType(type)) { - return null; +const Item = ({ + className, + children, + ...props +}) => /* @__PURE__ */jsxRuntime.jsx(reactDropdownMenu.Item, { + className: clsx.clsx("graphiql-dropdown-item", className), + ...props, + children +}); +const DropdownMenu = createComponentGroup(reactDropdownMenu.Root, { + Button, + Item, + Content +}); +const markdown = new MarkdownIt({ + breaks: true, + linkify: true +}); +const MarkdownContent = React.forwardRef((t0, ref) => { + const $ = reactCompilerRuntime.c(18); + let children; + let onlyShowFirstChild; + let props; + let type; + if ($[0] !== t0) { + ({ + children, + onlyShowFirstChild, + type, + ...props + } = t0); + $[0] = t0; + $[1] = children; + $[2] = onlyShowFirstChild; + $[3] = props; + $[4] = type; + } else { + children = $[1]; + onlyShowFirstChild = $[2]; + props = $[3]; + type = $[4]; + } + const t1 = `graphiql-markdown-${type}`; + const t2 = onlyShowFirstChild && "graphiql-markdown-preview"; + let t3; + if ($[5] !== props.className || $[6] !== t1 || $[7] !== t2) { + t3 = clsx.clsx(t1, t2, props.className); + $[5] = props.className; + $[6] = t1; + $[7] = t2; + $[8] = t3; + } else { + t3 = $[8]; } - const values = []; - const deprecatedValues = []; - for (const value of type.getValues()) { - if (value.deprecationReason) { - deprecatedValues.push(value); - } else { - values.push(value); - } + let t4; + if ($[9] !== children) { + t4 = markdown.render(children); + $[9] = children; + $[10] = t4; + } else { + t4 = $[10]; } - return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { - children: [values.length > 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "Enum Values", - children: values.map(value => /* @__PURE__ */jsxRuntime.jsx(EnumValue, { - value - }, value.name)) - }) : null, deprecatedValues.length > 0 ? showDeprecated || values.length === 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: "Deprecated Enum Values", - children: deprecatedValues.map(value => /* @__PURE__ */jsxRuntime.jsx(EnumValue, { - value - }, value.name)) - }) : /* @__PURE__ */jsxRuntime.jsx(Button$1, { - type: "button", - onClick: handleShowDeprecated, - children: "Show Deprecated Values" - }) : null] - }); -} -function EnumValue({ - value -}) { - return /* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-item", - children: [/* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-enum-value", - children: value.name - }), value.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { - type: "description", - children: value.description - }) : null, value.deprecationReason ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { - type: "deprecation", - children: value.deprecationReason - }) : null] - }); -} -function PossibleTypes({ - type -}) { - const { - schema - } = useSchemaContext({ - nonNull: true - }); - if (!schema || !graphql.isAbstractType(type)) { - return null; + let t5; + if ($[11] !== t4) { + t5 = { + __html: t4 + }; + $[11] = t4; + $[12] = t5; + } else { + t5 = $[12]; } - return /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { - title: graphql.isInterfaceType(type) ? "Implementations" : "Possible Types", - children: schema.getPossibleTypes(type).map(possibleType => /* @__PURE__ */jsxRuntime.jsx("div", { - children: /* @__PURE__ */jsxRuntime.jsx(TypeLink, { - type: possibleType - }) - }, possibleType.name)) - }); -} -function DocExplorer() { - const { - fetchError, - isFetching, - schema, - validationErrors - } = useSchemaContext({ - nonNull: true, - caller: DocExplorer - }); - const { - explorerNavStack, - pop - } = useExplorerContext({ - nonNull: true, - caller: DocExplorer - }); - const navItem = explorerNavStack.at(-1); - let content = null; - if (fetchError) { - content = /* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-error", - children: "Error fetching schema" + let t6; + if ($[13] !== props || $[14] !== ref || $[15] !== t3 || $[16] !== t5) { + t6 = /* @__PURE__ */jsxRuntime.jsx("div", { + ...props, + ref, + className: t3, + dangerouslySetInnerHTML: t5 + }); + $[13] = props; + $[14] = ref; + $[15] = t3; + $[16] = t5; + $[17] = t6; + } else { + t6 = $[17]; + } + return t6; +}); +MarkdownContent.displayName = "MarkdownContent"; +const Spinner = React.forwardRef((props, ref) => { + const $ = reactCompilerRuntime.c(6); + let t0; + if ($[0] !== props.className) { + t0 = clsx.clsx("graphiql-spinner", props.className); + $[0] = props.className; + $[1] = t0; + } else { + t0 = $[1]; + } + let t1; + if ($[2] !== props || $[3] !== ref || $[4] !== t0) { + t1 = /* @__PURE__ */jsxRuntime.jsx("div", { + ...props, + ref, + className: t0 }); - } else if (validationErrors.length > 0) { - content = /* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-error", - children: ["Schema is invalid: ", validationErrors[0].message] + $[2] = props; + $[3] = ref; + $[4] = t0; + $[5] = t1; + } else { + t1 = $[5]; + } + return t1; +}); +Spinner.displayName = "Spinner"; +function TooltipRoot(t0) { + const $ = reactCompilerRuntime.c(10); + const { + children, + align: t1, + side: t2, + sideOffset: t3, + label + } = t0; + const align = t1 === void 0 ? "start" : t1; + const side = t2 === void 0 ? "bottom" : t2; + const sideOffset = t3 === void 0 ? 5 : t3; + let t4; + if ($[0] !== children) { + t4 = /* @__PURE__ */jsxRuntime.jsx(T__namespace.Trigger, { + asChild: true, + children }); - } else if (isFetching) { - content = /* @__PURE__ */jsxRuntime.jsx(Spinner, {}); - } else if (!schema) { - content = /* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-error", - children: "No GraphQL schema available" + $[0] = children; + $[1] = t4; + } else { + t4 = $[1]; + } + let t5; + if ($[2] !== align || $[3] !== label || $[4] !== side || $[5] !== sideOffset) { + t5 = /* @__PURE__ */jsxRuntime.jsx(T__namespace.Portal, { + children: /* @__PURE__ */jsxRuntime.jsx(T__namespace.Content, { + className: "graphiql-tooltip", + align, + side, + sideOffset, + children: label + }) }); - } else if (explorerNavStack.length === 1) { - content = /* @__PURE__ */jsxRuntime.jsx(SchemaDocumentation, { - schema + $[2] = align; + $[3] = label; + $[4] = side; + $[5] = sideOffset; + $[6] = t5; + } else { + t5 = $[6]; + } + let t6; + if ($[7] !== t4 || $[8] !== t5) { + t6 = /* @__PURE__ */jsxRuntime.jsxs(T__namespace.Root, { + children: [t4, t5] }); - } else if (graphql.isType(navItem.def)) { - content = /* @__PURE__ */jsxRuntime.jsx(TypeDocumentation, { - type: navItem.def + $[7] = t4; + $[8] = t5; + $[9] = t6; + } else { + t6 = $[9]; + } + return t6; +} +const Tooltip = createComponentGroup(TooltipRoot, { + Provider: T__namespace.Provider +}); +const TabRoot = React.forwardRef((t0, ref) => { + const $ = reactCompilerRuntime.c(16); + let children; + let className; + let isActive; + let props; + let value; + if ($[0] !== t0) { + ({ + isActive, + value, + children, + className, + ...props + } = t0); + $[0] = t0; + $[1] = children; + $[2] = className; + $[3] = isActive; + $[4] = props; + $[5] = value; + } else { + children = $[1]; + className = $[2]; + isActive = $[3]; + props = $[4]; + value = $[5]; + } + const t1 = isActive ? "true" : void 0; + const t2 = isActive && "graphiql-tab-active"; + let t3; + if ($[6] !== className || $[7] !== t2) { + t3 = clsx.clsx("graphiql-tab", t2, className); + $[6] = className; + $[7] = t2; + $[8] = t3; + } else { + t3 = $[8]; + } + let t4; + if ($[9] !== children || $[10] !== props || $[11] !== ref || $[12] !== t1 || $[13] !== t3 || $[14] !== value) { + t4 = /* @__PURE__ */jsxRuntime.jsx(framerMotion.Reorder.Item, { + ...props, + ref, + value, + "aria-selected": t1, + role: "tab", + className: t3, + children }); - } else if (navItem.def) { - content = /* @__PURE__ */jsxRuntime.jsx(FieldDocumentation, { - field: navItem.def + $[9] = children; + $[10] = props; + $[11] = ref; + $[12] = t1; + $[13] = t3; + $[14] = value; + $[15] = t4; + } else { + t4 = $[15]; + } + return t4; +}); +TabRoot.displayName = "Tab"; +const TabButton = React.forwardRef((props, ref) => { + const $ = reactCompilerRuntime.c(6); + let t0; + if ($[0] !== props.className) { + t0 = clsx.clsx("graphiql-tab-button", props.className); + $[0] = props.className; + $[1] = t0; + } else { + t0 = $[1]; + } + let t1; + if ($[2] !== props || $[3] !== ref || $[4] !== t0) { + t1 = /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { + ...props, + ref, + type: "button", + className: t0, + children: props.children }); + $[2] = props; + $[3] = ref; + $[4] = t0; + $[5] = t1; + } else { + t1 = $[5]; } - let prevName; - if (explorerNavStack.length > 1) { - prevName = explorerNavStack.at(-2).name; + return t1; +}); +TabButton.displayName = "Tab.Button"; +const TabClose = React.forwardRef((props, ref) => { + const $ = reactCompilerRuntime.c(7); + let t0; + if ($[0] !== props.className) { + t0 = clsx.clsx("graphiql-tab-close", props.className); + $[0] = props.className; + $[1] = t0; + } else { + t0 = $[1]; } - return /* @__PURE__ */jsxRuntime.jsxs("section", { - className: "graphiql-doc-explorer", - "aria-label": "Documentation Explorer", - children: [/* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-header", - children: [/* @__PURE__ */jsxRuntime.jsxs("div", { - className: "graphiql-doc-explorer-header-content", - children: [prevName && /* @__PURE__ */jsxRuntime.jsxs("a", { - href: "#", - className: "graphiql-doc-explorer-back", - onClick: event => { - event.preventDefault(); - pop(); - }, - "aria-label": `Go back to ${prevName}`, - children: [/* @__PURE__ */jsxRuntime.jsx(ChevronLeftIcon, {}), prevName] - }), /* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-title", - children: navItem.name - })] - }), /* @__PURE__ */jsxRuntime.jsx(Search, {}, navItem.name)] - }), /* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-doc-explorer-content", - children: content - })] - }); -} -const DOC_EXPLORER_PLUGIN = { - title: "Documentation Explorer", - icon: function Icon() { - const pluginContext = usePluginContext(); - return (pluginContext == null ? void 0 : pluginContext.visiblePlugin) === DOC_EXPLORER_PLUGIN ? /* @__PURE__ */jsxRuntime.jsx(DocsFilledIcon, {}) : /* @__PURE__ */jsxRuntime.jsx(DocsIcon, {}); - }, - content: DocExplorer -}; -const HISTORY_PLUGIN = { - title: "History", - icon: HistoryIcon, - content: History -}; -const PluginContext = createNullableContext("PluginContext"); -function PluginContextProvider(props) { - const storage = useStorageContext(); - const explorerContext = useExplorerContext(); - const historyContext = useHistoryContext(); - const hasExplorerContext = Boolean(explorerContext); - const hasHistoryContext = Boolean(historyContext); - const plugins = React.useMemo(() => { - const pluginList = []; - const pluginTitles = {}; - if (hasExplorerContext) { - pluginList.push(DOC_EXPLORER_PLUGIN); - pluginTitles[DOC_EXPLORER_PLUGIN.title] = true; - } - if (hasHistoryContext) { - pluginList.push(HISTORY_PLUGIN); - pluginTitles[HISTORY_PLUGIN.title] = true; - } - for (const plugin of props.plugins || []) { - if (typeof plugin.title !== "string" || !plugin.title) { - throw new Error("All GraphiQL plugins must have a unique title"); - } - if (pluginTitles[plugin.title]) { - throw new Error(`All GraphiQL plugins must have a unique title, found two plugins with the title '${plugin.title}'`); - } else { - pluginList.push(plugin); - pluginTitles[plugin.title] = true; - } - } - return pluginList; - }, [hasExplorerContext, hasHistoryContext, props.plugins]); - const [visiblePlugin, internalSetVisiblePlugin] = React.useState(() => { - const storedValue = storage == null ? void 0 : storage.get(STORAGE_KEY$4); - const pluginForStoredValue = plugins.find(plugin => plugin.title === storedValue); - if (pluginForStoredValue) { - return pluginForStoredValue; - } - if (storedValue) { - storage == null ? void 0 : storage.set(STORAGE_KEY$4, ""); - } - if (!props.visiblePlugin) { - return null; - } - return plugins.find(plugin => (typeof props.visiblePlugin === "string" ? plugin.title : plugin) === props.visiblePlugin) || null; - }); - const { - onTogglePluginVisibility, - children - } = props; - const setVisiblePlugin = React.useCallback(plugin => { - const newVisiblePlugin = plugin ? plugins.find(p => (typeof plugin === "string" ? p.title : p) === plugin) || null : null; - internalSetVisiblePlugin(current => { - if (newVisiblePlugin === current) { - return current; - } - onTogglePluginVisibility == null ? void 0 : onTogglePluginVisibility(newVisiblePlugin); - return newVisiblePlugin; + let t1; + if ($[2] === Symbol.for("react.memo_cache_sentinel")) { + t1 = /* @__PURE__ */jsxRuntime.jsx(CloseIcon, {}); + $[2] = t1; + } else { + t1 = $[2]; + } + let t2; + if ($[3] !== props || $[4] !== ref || $[5] !== t0) { + t2 = /* @__PURE__ */jsxRuntime.jsx(Tooltip, { + label: "Close Tab", + children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { + "aria-label": "Close Tab", + ...props, + ref, + type: "button", + className: t0, + children: t1 + }) }); - }, [onTogglePluginVisibility, plugins]); - React.useEffect(() => { - if (props.visiblePlugin) { - setVisiblePlugin(props.visiblePlugin); - } - }, [plugins, props.visiblePlugin, setVisiblePlugin]); - const value = React.useMemo(() => ({ - plugins, - setVisiblePlugin, - visiblePlugin - }), [plugins, setVisiblePlugin, visiblePlugin]); - return /* @__PURE__ */jsxRuntime.jsx(PluginContext.Provider, { - value, - children - }); -} -const usePluginContext = createContextHook(PluginContext); -const STORAGE_KEY$4 = "visiblePlugin"; -function onHasCompletion(_cm, data, schema, explorer, plugin, callback) { - void importCodeMirror([], { - useCommonAddons: false - }).then(CodeMirror => { - let information; - let fieldName; - let typeNamePill; - let typeNamePrefix; - let typeName; - let typeNameSuffix; - let description; - let deprecation; - let deprecationReason; - CodeMirror.on(data, "select", - // @ts-expect-error - (ctx, el) => { - if (!information) { - const hintsUl = el.parentNode; - information = document.createElement("div"); - information.className = "CodeMirror-hint-information"; - hintsUl.append(information); - const header = document.createElement("header"); - header.className = "CodeMirror-hint-information-header"; - information.append(header); - fieldName = document.createElement("span"); - fieldName.className = "CodeMirror-hint-information-field-name"; - header.append(fieldName); - typeNamePill = document.createElement("span"); - typeNamePill.className = "CodeMirror-hint-information-type-name-pill"; - header.append(typeNamePill); - typeNamePrefix = document.createElement("span"); - typeNamePill.append(typeNamePrefix); - typeName = document.createElement("a"); - typeName.className = "CodeMirror-hint-information-type-name"; - typeName.href = "javascript:void 0"; - typeName.addEventListener("click", onClickHintInformation); - typeNamePill.append(typeName); - typeNameSuffix = document.createElement("span"); - typeNamePill.append(typeNameSuffix); - description = document.createElement("div"); - description.className = "CodeMirror-hint-information-description"; - information.append(description); - deprecation = document.createElement("div"); - deprecation.className = "CodeMirror-hint-information-deprecation"; - information.append(deprecation); - const deprecationLabel = document.createElement("span"); - deprecationLabel.className = "CodeMirror-hint-information-deprecation-label"; - deprecationLabel.textContent = "Deprecated"; - deprecation.append(deprecationLabel); - deprecationReason = document.createElement("div"); - deprecationReason.className = "CodeMirror-hint-information-deprecation-reason"; - deprecation.append(deprecationReason); - const defaultInformationPadding = parseInt(window.getComputedStyle(information).paddingBottom.replace(/px$/, ""), 10) || 0; - const defaultInformationMaxHeight = parseInt(window.getComputedStyle(information).maxHeight.replace(/px$/, ""), 10) || 0; - const handleScroll = () => { - if (information) { - information.style.paddingTop = hintsUl.scrollTop + defaultInformationPadding + "px"; - information.style.maxHeight = hintsUl.scrollTop + defaultInformationMaxHeight + "px"; - } - }; - hintsUl.addEventListener("scroll", handleScroll); - let onRemoveFn; - hintsUl.addEventListener("DOMNodeRemoved", onRemoveFn = event => { - if (event.target !== hintsUl) { - return; - } - hintsUl.removeEventListener("scroll", handleScroll); - hintsUl.removeEventListener("DOMNodeRemoved", onRemoveFn); - if (information) { - information.removeEventListener("click", onClickHintInformation); - } - information = null; - fieldName = null; - typeNamePill = null; - typeNamePrefix = null; - typeName = null; - typeNameSuffix = null; - description = null; - deprecation = null; - deprecationReason = null; - onRemoveFn = null; - }); - } - if (fieldName) { - fieldName.textContent = ctx.text; - } - if (typeNamePill && typeNamePrefix && typeName && typeNameSuffix) { - if (ctx.type) { - typeNamePill.style.display = "inline"; - const renderType2 = type => { - if (graphql.isNonNullType(type)) { - typeNameSuffix.textContent = "!" + typeNameSuffix.textContent; - renderType2(type.ofType); - } else if (graphql.isListType(type)) { - typeNamePrefix.textContent += "["; - typeNameSuffix.textContent = "]" + typeNameSuffix.textContent; - renderType2(type.ofType); - } else { - typeName.textContent = type.name; - } - }; - typeNamePrefix.textContent = ""; - typeNameSuffix.textContent = ""; - renderType2(ctx.type); - } else { - typeNamePrefix.textContent = ""; - typeName.textContent = ""; - typeNameSuffix.textContent = ""; - typeNamePill.style.display = "none"; - } - } - if (description) { - if (ctx.description) { - description.style.display = "block"; - description.innerHTML = markdown.render(ctx.description); - } else { - description.style.display = "none"; - description.innerHTML = ""; - } - } - if (deprecation && deprecationReason) { - if (ctx.deprecationReason) { - deprecation.style.display = "block"; - deprecationReason.innerHTML = markdown.render(ctx.deprecationReason); - } else { - deprecation.style.display = "none"; - deprecationReason.innerHTML = ""; - } - } + $[3] = props; + $[4] = ref; + $[5] = t0; + $[6] = t2; + } else { + t2 = $[6]; + } + return t2; +}); +TabClose.displayName = "Tab.Close"; +const Tab = createComponentGroup(TabRoot, { + Button: TabButton, + Close: TabClose +}); +const Tabs = React.forwardRef((t0, ref) => { + const $ = reactCompilerRuntime.c(15); + let children; + let className; + let onReorder; + let props; + let values; + if ($[0] !== t0) { + ({ + values, + onReorder, + children, + className, + ...props + } = t0); + $[0] = t0; + $[1] = children; + $[2] = className; + $[3] = onReorder; + $[4] = props; + $[5] = values; + } else { + children = $[1]; + className = $[2]; + onReorder = $[3]; + props = $[4]; + values = $[5]; + } + let t1; + if ($[6] !== className) { + t1 = clsx.clsx("graphiql-tabs", className); + $[6] = className; + $[7] = t1; + } else { + t1 = $[7]; + } + let t2; + if ($[8] !== children || $[9] !== onReorder || $[10] !== props || $[11] !== ref || $[12] !== t1 || $[13] !== values) { + t2 = /* @__PURE__ */jsxRuntime.jsx(framerMotion.Reorder.Group, { + ...props, + ref, + values, + onReorder, + axis: "x", + role: "tablist", + className: t1, + children }); - }); - function onClickHintInformation(event) { - if (!schema || !explorer || !plugin || !(event.currentTarget instanceof HTMLElement)) { - return; - } - const typeName = event.currentTarget.textContent || ""; - const type = schema.getType(typeName); - if (type) { - plugin.setVisiblePlugin(DOC_EXPLORER_PLUGIN); - explorer.push({ - name: type.name, - def: type - }); - callback == null ? void 0 : callback(type); - } + $[8] = children; + $[9] = onReorder; + $[10] = props; + $[11] = ref; + $[12] = t1; + $[13] = values; + $[14] = t2; + } else { + t2 = $[14]; } -} -function useSynchronizeValue(editor, value) { - React.useEffect(() => { - if (editor && typeof value === "string" && value !== editor.getValue()) { - editor.setValue(value); - } - }, [editor, value]); -} -function useSynchronizeOption(editor, option, value) { - React.useEffect(() => { - if (editor) { - editor.setOption(option, value); - } - }, [editor, option, value]); -} -function useChangeHandler(editor, callback, storageKey, tabProperty, caller) { + return t2; +}); +Tabs.displayName = "Tabs"; +const HistoryContext = createNullableContext("HistoryContext"); +function HistoryContextProvider(t0) { + const $ = reactCompilerRuntime.c(11); const { - updateActiveTabValues - } = useEditorContext({ - nonNull: true, - caller - }); + maxHistoryLength: t1, + children + } = t0; + const maxHistoryLength = t1 === void 0 ? DEFAULT_HISTORY_LENGTH : t1; const storage = useStorageContext(); - React.useEffect(() => { - if (!editor) { - return; - } - const store = debounce(500, value => { - if (!storage || storageKey === null) { - return; - } - storage.set(storageKey, value); - }); - const updateTab = debounce(100, value => { - updateActiveTabValues({ - [tabProperty]: value - }); - }); - const handleChange = (editorInstance, changeObj) => { - if (!changeObj) { - return; + let t2; + if ($[0] !== maxHistoryLength || $[1] !== storage) { + t2 = () => new toolkit.HistoryStore(storage || new toolkit.StorageAPI(null), maxHistoryLength); + $[0] = maxHistoryLength; + $[1] = storage; + $[2] = t2; + } else { + t2 = $[2]; + } + const [historyStore] = React.useState(t2); + let t3; + if ($[3] !== historyStore.queries) { + t3 = () => historyStore.queries || []; + $[3] = historyStore.queries; + $[4] = t3; + } else { + t3 = $[4]; + } + const [items, setItems] = React.useState(t3); + let t4; + if ($[5] !== historyStore || $[6] !== items) { + t4 = { + addToHistory(operation) { + historyStore.updateHistory(operation); + setItems(historyStore.queries); + }, + editLabel(operation_0, index) { + historyStore.editLabel(operation_0, index); + setItems(historyStore.queries); + }, + items, + toggleFavorite(operation_1) { + historyStore.toggleFavorite(operation_1); + setItems(historyStore.queries); + }, + setActive: _temp$8, + deleteFromHistory(item_0, clearFavorites) { + historyStore.deleteHistory(item_0, clearFavorites); + setItems(historyStore.queries); } - const newValue = editorInstance.getValue(); - store(newValue); - updateTab(newValue); - callback == null ? void 0 : callback(newValue); }; - editor.on("change", handleChange); - return () => editor.off("change", handleChange); - }, [callback, editor, storage, storageKey, tabProperty, updateActiveTabValues]); + $[5] = historyStore; + $[6] = items; + $[7] = t4; + } else { + t4 = $[7]; + } + const value = t4; + let t5; + if ($[8] !== children || $[9] !== value) { + t5 = /* @__PURE__ */jsxRuntime.jsx(HistoryContext.Provider, { + value, + children + }); + $[8] = children; + $[9] = value; + $[10] = t5; + } else { + t5 = $[10]; + } + return t5; } -function useCompletion(editor, callback, caller) { +function _temp$8(item) { + return item; +} +const useHistoryContext = createContextHook(HistoryContext); +const DEFAULT_HISTORY_LENGTH = 20; +function History() { const { - schema - } = useSchemaContext({ - nonNull: true, - caller + items: all, + deleteFromHistory + } = useHistoryContext({ + nonNull: true }); - const explorer = useExplorerContext(); - const plugin = usePluginContext(); - React.useEffect(() => { - if (!editor) { - return; - } - const handleCompletion = (instance, changeObj) => { - onHasCompletion(instance, changeObj, schema, explorer, plugin, type => { - callback == null ? void 0 : callback({ - kind: "Type", - type, - schema: schema || void 0 - }); - }); - }; - editor.on( - // @ts-expect-error @TODO additional args for hasCompletion event - "hasCompletion", handleCompletion); - return () => editor.off( - // @ts-expect-error @TODO additional args for hasCompletion event - "hasCompletion", handleCompletion); - }, [callback, editor, explorer, plugin, schema]); -} -function useKeyMap(editor, keys, callback) { + let items = all.slice().map((item, i) => ({ + ...item, + index: i + })).reverse(); + const favorites = items.filter(item_0 => item_0.favorite); + if (favorites.length) { + items = items.filter(item_1 => !item_1.favorite); + } + const [clearStatus, setClearStatus] = React.useState(null); React.useEffect(() => { - if (!editor) { - return; - } - for (const key of keys) { - editor.removeKeyMap(key); + if (clearStatus) { + setTimeout(() => { + setClearStatus(null); + }, 2e3); } - if (callback) { - const keyMap = {}; - for (const key of keys) { - keyMap[key] = () => callback(); + }, [clearStatus]); + const handleClearStatus = () => { + try { + for (const item_2 of items) { + deleteFromHistory(item_2, true); } - editor.addKeyMap(keyMap); + setClearStatus("success"); + } catch { + setClearStatus("error"); } - }, [editor, keys, callback]); -} -function useCopyQuery({ - caller, - onCopyQuery -} = {}) { - const { - queryEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useCopyQuery + }; + return /* @__PURE__ */jsxRuntime.jsxs("section", { + "aria-label": "History", + className: "graphiql-history", + children: [/* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-history-header", + children: ["History", (clearStatus || items.length > 0) && /* @__PURE__ */jsxRuntime.jsx(Button$1, { + type: "button", + state: clearStatus || void 0, + disabled: !items.length, + onClick: handleClearStatus, + children: { + success: "Cleared", + error: "Failed to Clear" + }[clearStatus] || "Clear" + })] + }), Boolean(favorites.length) && /* @__PURE__ */jsxRuntime.jsx("ul", { + className: "graphiql-history-items", + children: favorites.map(item_3 => /* @__PURE__ */jsxRuntime.jsx(HistoryItem, { + item: item_3 + }, item_3.index)) + }), Boolean(favorites.length) && Boolean(items.length) && /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-history-item-spacer" + }), Boolean(items.length) && /* @__PURE__ */jsxRuntime.jsx("ul", { + className: "graphiql-history-items", + children: items.map(item_4 => /* @__PURE__ */jsxRuntime.jsx(HistoryItem, { + item: item_4 + }, item_4.index)) + })] }); - return React.useCallback(() => { - if (!queryEditor) { - return; - } - const query = queryEditor.getValue(); - copyToClipboard(query); - onCopyQuery == null ? void 0 : onCopyQuery(query); - }, [queryEditor, onCopyQuery]); } -function useMergeQuery({ - caller -} = {}) { - const { - queryEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useMergeQuery - }); +function HistoryItem(props) { + const $ = reactCompilerRuntime.c(40); + let t0; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t0 = { + nonNull: true, + caller: HistoryItem + }; + $[0] = t0; + } else { + t0 = $[0]; + } const { - schema - } = useSchemaContext({ - nonNull: true, - caller: useMergeQuery - }); - return React.useCallback(() => { - const documentAST = queryEditor == null ? void 0 : queryEditor.documentAST; - const query = queryEditor == null ? void 0 : queryEditor.getValue(); - if (!documentAST || !query) { - return; - } - queryEditor.setValue(graphql.print(toolkit.mergeAst(documentAST, schema))); - }, [queryEditor, schema]); -} -function usePrettifyEditors({ - caller -} = {}) { + editLabel, + toggleFavorite, + deleteFromHistory, + setActive + } = useHistoryContext(t0); + let t1; + if ($[1] === Symbol.for("react.memo_cache_sentinel")) { + t1 = { + nonNull: true, + caller: HistoryItem + }; + $[1] = t1; + } else { + t1 = $[1]; + } const { - queryEditor, headerEditor, + queryEditor, variableEditor - } = useEditorContext({ - nonNull: true, - caller: caller || usePrettifyEditors - }); - return React.useCallback(() => { - if (variableEditor) { - const variableEditorContent = variableEditor.getValue(); - try { - const prettifiedVariableEditorContent = JSON.stringify(JSON.parse(variableEditorContent), null, 2); - if (prettifiedVariableEditorContent !== variableEditorContent) { - variableEditor.setValue(prettifiedVariableEditorContent); - } - } catch {} - } - if (headerEditor) { - const headerEditorContent = headerEditor.getValue(); - try { - const prettifiedHeaderEditorContent = JSON.stringify(JSON.parse(headerEditorContent), null, 2); - if (prettifiedHeaderEditorContent !== headerEditorContent) { - headerEditor.setValue(prettifiedHeaderEditorContent); - } - } catch {} - } - if (queryEditor) { - const editorContent = queryEditor.getValue(); - const prettifiedEditorContent = graphql.print(graphql.parse(editorContent)); - if (prettifiedEditorContent !== editorContent) { - queryEditor.setValue(prettifiedEditorContent); + } = useEditorContext(t1); + const inputRef = React.useRef(null); + const buttonRef = React.useRef(null); + const [isEditable, setIsEditable] = React.useState(false); + let t2; + let t3; + if ($[2] !== isEditable) { + t2 = () => { + var _a; + if (isEditable) { + (_a = inputRef.current) == null ? void 0 : _a.focus(); } - } - }, [queryEditor, variableEditor, headerEditor]); -} -function useAutoCompleteLeafs({ - getDefaultFieldNames, - caller -} = {}) { - const { - schema - } = useSchemaContext({ - nonNull: true, - caller: caller || useAutoCompleteLeafs - }); - const { - queryEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useAutoCompleteLeafs - }); - return React.useCallback(() => { - if (!queryEditor) { - return; - } - const query = queryEditor.getValue(); - const { - insertions, - result - } = toolkit.fillLeafs(schema, query, getDefaultFieldNames); - if (insertions && insertions.length > 0) { - queryEditor.operation(() => { - const cursor = queryEditor.getCursor(); - const cursorIndex = queryEditor.indexFromPos(cursor); - queryEditor.setValue(result || ""); - let added = 0; - const markers = insertions.map(({ - index, - string - }) => queryEditor.markText(queryEditor.posFromIndex(index + added), queryEditor.posFromIndex(index + (added += string.length)), { - className: "auto-inserted-leaf", - clearOnEnter: true, - title: "Automatically added leaf fields" - })); - setTimeout(() => { - for (const marker of markers) { - marker.clear(); - } - }, 7e3); - let newCursorIndex = cursorIndex; - for (const { - index, - string - } of insertions) { - if (index < cursorIndex) { - newCursorIndex += string.length; - } - } - queryEditor.setCursor(queryEditor.posFromIndex(newCursorIndex)); - }); - } - return result; - }, [getDefaultFieldNames, queryEditor, schema]); -} -const useEditorState = editor => { - var _ref2; - const context = useEditorContext({ - nonNull: true - }); - const editorInstance = context[`${editor}Editor`]; - let valueString = ""; - const editorValue = (_ref2 = editorInstance == null ? void 0 : editorInstance.getValue()) !== null && _ref2 !== void 0 ? _ref2 : false; - if (editorValue && editorValue.length > 0) { - valueString = editorValue; + }; + t3 = [isEditable]; + $[2] = isEditable; + $[3] = t2; + $[4] = t3; + } else { + t2 = $[3]; + t3 = $[4]; + } + React.useEffect(t2, t3); + let t4; + if ($[5] !== props.item.label || $[6] !== props.item.operationName || $[7] !== props.item.query) { + t4 = props.item.label || props.item.operationName || formatQuery(props.item.query); + $[5] = props.item.label; + $[6] = props.item.operationName; + $[7] = props.item.query; + $[8] = t4; + } else { + t4 = $[8]; } - const handleEditorValue = React.useCallback(value => editorInstance == null ? void 0 : editorInstance.setValue(value), [editorInstance]); - return React.useMemo(() => [valueString, handleEditorValue], [valueString, handleEditorValue]); -}; -const useOperationsEditorState = () => { - return useEditorState("query"); -}; -const useVariablesEditorState = () => { - return useEditorState("variable"); -}; -const useHeadersEditorState = () => { - return useEditorState("header"); -}; -function useOptimisticState([upstreamState, upstreamSetState]) { - const lastStateRef = React.useRef({ - /** The last thing that we sent upstream; we're expecting this back */ - pending: null, - /** The last thing we received from upstream */ - last: upstreamState - }); - const [state, setOperationsText] = React.useState(upstreamState); - React.useEffect(() => { - if (lastStateRef.current.last === upstreamState) ;else { - lastStateRef.current.last = upstreamState; - if (lastStateRef.current.pending === null) { - setOperationsText(upstreamState); - } else if (lastStateRef.current.pending === upstreamState) { - lastStateRef.current.pending = null; - if (upstreamState !== state) { - lastStateRef.current.pending = state; - upstreamSetState(state); - } - } else { - lastStateRef.current.pending = null; - setOperationsText(upstreamState); - } - } - }, [upstreamState, state, upstreamSetState]); - const setState = React.useCallback(newState => { - setOperationsText(newState); - if (lastStateRef.current.pending === null && lastStateRef.current.last !== newState) { - lastStateRef.current.pending = newState; - upstreamSetState(newState); - } - }, [upstreamSetState]); - return React.useMemo(() => [state, setState], [state, setState]); -} -function useHeaderEditor({ - editorTheme = DEFAULT_EDITOR_THEME, - keyMap = DEFAULT_KEY_MAP, - onEdit, - readOnly = false -} = {}, caller) { - const { - initialHeaders, - headerEditor, - setHeaderEditor, - shouldPersistHeaders - } = useEditorContext({ - nonNull: true, - caller: caller || useHeaderEditor - }); - const executionContext = useExecutionContext(); - const merge = useMergeQuery({ - caller: caller || useHeaderEditor - }); - const prettify = usePrettifyEditors({ - caller: caller || useHeaderEditor - }); - const ref = React.useRef(null); - React.useEffect(() => { - let isActive = true; - void importCodeMirror([ - // @ts-expect-error - Promise.resolve().then(() => __webpack_require__(/*! ./javascript.cjs.js */ "../../graphiql-react/dist/javascript.cjs.js")).then(n => n.javascript)]).then(CodeMirror => { - if (!isActive) { - return; - } - const container = ref.current; - if (!container) { - return; - } - const newEditor = CodeMirror(container, { - value: initialHeaders, - lineNumbers: true, - tabSize: 2, - mode: { - name: "javascript", - json: true - }, - theme: editorTheme, - autoCloseBrackets: true, - matchBrackets: true, - showCursorWhenSelecting: true, - readOnly: readOnly ? "nocursor" : false, - foldGutter: true, - gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], - extraKeys: commonKeys - }); - newEditor.addKeyMap({ - "Cmd-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Ctrl-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Alt-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); + const displayName = t4; + let t5; + if ($[9] !== editLabel || $[10] !== props.item) { + t5 = () => { + var _a; + setIsEditable(false); + const { + index, + ...item + } = props.item; + editLabel({ + ...item, + label: (_a = inputRef.current) == null ? void 0 : _a.value + }, index); + }; + $[9] = editLabel; + $[10] = props.item; + $[11] = t5; + } else { + t5 = $[11]; + } + const handleSave = t5; + let t6; + if ($[12] === Symbol.for("react.memo_cache_sentinel")) { + t6 = () => { + setIsEditable(false); + }; + $[12] = t6; + } else { + t6 = $[12]; + } + const handleClose = t6; + let t7; + if ($[13] === Symbol.for("react.memo_cache_sentinel")) { + t7 = e => { + e.stopPropagation(); + setIsEditable(true); + }; + $[13] = t7; + } else { + t7 = $[13]; + } + const handleEditLabel = t7; + let t8; + if ($[14] !== headerEditor || $[15] !== props.item || $[16] !== queryEditor || $[17] !== setActive || $[18] !== variableEditor) { + t8 = () => { + const { + query, + variables, + headers + } = props.item; + queryEditor == null ? void 0 : queryEditor.setValue(query !== null && query !== void 0 ? query : ""); + variableEditor == null ? void 0 : variableEditor.setValue(variables !== null && variables !== void 0 ? variables : ""); + headerEditor == null ? void 0 : headerEditor.setValue(headers !== null && headers !== void 0 ? headers : ""); + setActive(props.item); + }; + $[14] = headerEditor; + $[15] = props.item; + $[16] = queryEditor; + $[17] = setActive; + $[18] = variableEditor; + $[19] = t8; + } else { + t8 = $[19]; + } + const handleHistoryItemClick = t8; + let t9; + if ($[20] !== deleteFromHistory || $[21] !== props.item) { + t9 = e_0 => { + e_0.stopPropagation(); + deleteFromHistory(props.item); + }; + $[20] = deleteFromHistory; + $[21] = props.item; + $[22] = t9; + } else { + t9 = $[22]; + } + const handleDeleteItemFromHistory = t9; + let t10; + if ($[23] !== props.item || $[24] !== toggleFavorite) { + t10 = e_1 => { + e_1.stopPropagation(); + toggleFavorite(props.item); + }; + $[23] = props.item; + $[24] = toggleFavorite; + $[25] = t10; + } else { + t10 = $[25]; + } + const handleToggleFavorite = t10; + const t11 = isEditable && "editable"; + let t12; + if ($[26] !== t11) { + t12 = clsx.clsx("graphiql-history-item", t11); + $[26] = t11; + $[27] = t12; + } else { + t12 = $[27]; + } + let t13; + if ($[28] !== displayName || $[29] !== editLabel || $[30] !== handleDeleteItemFromHistory || $[31] !== handleHistoryItemClick || $[32] !== handleSave || $[33] !== handleToggleFavorite || $[34] !== isEditable || $[35] !== props.item) { + t13 = isEditable ? /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [/* @__PURE__ */jsxRuntime.jsx("input", { + type: "text", + defaultValue: props.item.label, + ref: inputRef, + onKeyDown: e_2 => { + if (e_2.key === "Esc") { + setIsEditable(false); + } else { + if (e_2.key === "Enter") { + setIsEditable(false); + editLabel({ + ...props.item, + label: e_2.currentTarget.value + }); + } + } }, - "Shift-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - } - }); - newEditor.on("keyup", (editorInstance, event) => { - const { - code, - key, - shiftKey - } = event; - const isLetter = code.startsWith("Key"); - const isNumber = !shiftKey && code.startsWith("Digit"); - if (isLetter || isNumber || key === "_" || key === '"') { - editorInstance.execCommand("autocomplete"); - } - }); - setHeaderEditor(newEditor); + placeholder: "Type a label" + }), /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { + type: "button", + ref: buttonRef, + onClick: handleSave, + children: "Save" + }), /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { + type: "button", + ref: buttonRef, + onClick: handleClose, + children: /* @__PURE__ */jsxRuntime.jsx(CloseIcon, {}) + })] + }) : /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [/* @__PURE__ */jsxRuntime.jsx(Tooltip, { + label: "Set active", + children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { + type: "button", + className: "graphiql-history-item-label", + onClick: handleHistoryItemClick, + "aria-label": "Set active", + children: displayName + }) + }), /* @__PURE__ */jsxRuntime.jsx(Tooltip, { + label: "Edit label", + children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { + type: "button", + className: "graphiql-history-item-action", + onClick: handleEditLabel, + "aria-label": "Edit label", + children: /* @__PURE__ */jsxRuntime.jsx(PenIcon, { + "aria-hidden": "true" + }) + }) + }), /* @__PURE__ */jsxRuntime.jsx(Tooltip, { + label: props.item.favorite ? "Remove favorite" : "Add favorite", + children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { + type: "button", + className: "graphiql-history-item-action", + onClick: handleToggleFavorite, + "aria-label": props.item.favorite ? "Remove favorite" : "Add favorite", + children: props.item.favorite ? /* @__PURE__ */jsxRuntime.jsx(StarFilledIcon, { + "aria-hidden": "true" + }) : /* @__PURE__ */jsxRuntime.jsx(StarIcon, { + "aria-hidden": "true" + }) + }) + }), /* @__PURE__ */jsxRuntime.jsx(Tooltip, { + label: "Delete from history", + children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { + type: "button", + className: "graphiql-history-item-action", + onClick: handleDeleteItemFromHistory, + "aria-label": "Delete from history", + children: /* @__PURE__ */jsxRuntime.jsx(TrashIcon, { + "aria-hidden": "true" + }) + }) + })] }); - return () => { - isActive = false; - }; - }, [editorTheme, initialHeaders, readOnly, setHeaderEditor]); - useSynchronizeOption(headerEditor, "keyMap", keyMap); - useChangeHandler(headerEditor, onEdit, shouldPersistHeaders ? STORAGE_KEY$3 : null, "headers", useHeaderEditor); - useKeyMap(headerEditor, ["Cmd-Enter", "Ctrl-Enter"], executionContext == null ? void 0 : executionContext.run); - useKeyMap(headerEditor, ["Shift-Ctrl-P"], prettify); - useKeyMap(headerEditor, ["Shift-Ctrl-M"], merge); - return ref; + $[28] = displayName; + $[29] = editLabel; + $[30] = handleDeleteItemFromHistory; + $[31] = handleHistoryItemClick; + $[32] = handleSave; + $[33] = handleToggleFavorite; + $[34] = isEditable; + $[35] = props.item; + $[36] = t13; + } else { + t13 = $[36]; + } + let t14; + if ($[37] !== t12 || $[38] !== t13) { + t14 = /* @__PURE__ */jsxRuntime.jsx("li", { + className: t12, + children: t13 + }); + $[37] = t12; + $[38] = t13; + $[39] = t14; + } else { + t14 = $[39]; + } + return t14; } -const STORAGE_KEY$3 = "headers"; -const invalidCharacters = Array.from({ - length: 11 -}, (_, i) => { - return String.fromCharCode(8192 + i); -}).concat(["\u2028", "\u2029", " ", " "]); -const sanitizeRegex = new RegExp("[" + invalidCharacters.join("") + "]", "g"); -function normalizeWhitespace(line) { - return line.replace(sanitizeRegex, " "); +function formatQuery(query) { + return query == null ? void 0 : query.split("\n").map(line => line.replace(/#(.*)/, "")).join(" ").replaceAll("{", " { ").replaceAll("}", " } ").replaceAll(/[\s]{2,}/g, " "); } -function useQueryEditor({ - editorTheme = DEFAULT_EDITOR_THEME, - keyMap = DEFAULT_KEY_MAP, - onClickReference, - onCopyQuery, - onEdit, - readOnly = false -} = {}, caller) { +const ExecutionContext = createNullableContext("ExecutionContext"); +function ExecutionContextProvider(t0) { + const $ = reactCompilerRuntime.c(27); const { - schema - } = useSchemaContext({ - nonNull: true, - caller: caller || useQueryEditor - }); + fetcher, + getDefaultFieldNames, + children, + operationName + } = t0; + if (!fetcher) { + throw new TypeError("The `ExecutionContextProvider` component requires a `fetcher` function to be passed as prop."); + } + let t1; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t1 = { + nonNull: true, + caller: ExecutionContextProvider + }; + $[0] = t1; + } else { + t1 = $[0]; + } const { externalFragments, - initialQuery, + headerEditor, queryEditor, - setOperationName, - setQueryEditor, - validationRules, + responseEditor, variableEditor, updateActiveTabValues - } = useEditorContext({ - nonNull: true, - caller: caller || useQueryEditor - }); - const executionContext = useExecutionContext(); - const storage = useStorageContext(); - const explorer = useExplorerContext(); - const plugin = usePluginContext(); - const copy = useCopyQuery({ - caller: caller || useQueryEditor, - onCopyQuery - }); - const merge = useMergeQuery({ - caller: caller || useQueryEditor - }); - const prettify = usePrettifyEditors({ - caller: caller || useQueryEditor - }); - const ref = React.useRef(null); - const codeMirrorRef = React.useRef(); - const onClickReferenceRef = React.useRef(() => {}); - React.useEffect(() => { - onClickReferenceRef.current = reference => { - if (!explorer || !plugin) { + } = useEditorContext(t1); + const history = useHistoryContext(); + let t2; + if ($[1] !== getDefaultFieldNames) { + t2 = { + getDefaultFieldNames, + caller: ExecutionContextProvider + }; + $[1] = getDefaultFieldNames; + $[2] = t2; + } else { + t2 = $[2]; + } + const autoCompleteLeafs = useAutoCompleteLeafs(t2); + const [isFetching, setIsFetching] = React.useState(false); + const [subscription, setSubscription] = React.useState(null); + const queryIdRef = React.useRef(0); + let t3; + if ($[3] !== subscription) { + t3 = () => { + subscription == null ? void 0 : subscription.unsubscribe(); + setIsFetching(false); + setSubscription(null); + }; + $[3] = subscription; + $[4] = t3; + } else { + t3 = $[4]; + } + const stop = t3; + let t4; + if ($[5] !== autoCompleteLeafs || $[6] !== externalFragments || $[7] !== fetcher || $[8] !== headerEditor || $[9] !== history || $[10] !== operationName || $[11] !== queryEditor || $[12] !== responseEditor || $[13] !== stop || $[14] !== subscription || $[15] !== updateActiveTabValues || $[16] !== variableEditor) { + t4 = async () => { + var _ref, _headers2, _queryEditor$document; + if (!queryEditor || !responseEditor) { return; } - plugin.setVisiblePlugin(DOC_EXPLORER_PLUGIN); - switch (reference.kind) { - case "Type": - { - explorer.push({ - name: reference.type.name, - def: reference.type - }); - break; - } - case "Field": - { - explorer.push({ - name: reference.field.name, - def: reference.field - }); - break; - } - case "Argument": - { - if (reference.field) { - explorer.push({ - name: reference.field.name, - def: reference.field - }); - } - break; - } - case "EnumValue": - { - if (reference.type) { - explorer.push({ - name: reference.type.name, - def: reference.type - }); - } - break; - } + if (subscription) { + stop(); + return; } - onClickReference == null ? void 0 : onClickReference(reference); - }; - }, [explorer, onClickReference, plugin]); - React.useEffect(() => { - let isActive = true; - void importCodeMirror([Promise.resolve().then(() => __webpack_require__(/*! ./comment.cjs.js */ "../../graphiql-react/dist/comment.cjs.js")).then(n => n.comment), Promise.resolve().then(() => __webpack_require__(/*! ./search.cjs.js */ "../../graphiql-react/dist/search.cjs.js")).then(n => n.search), Promise.resolve().then(() => __webpack_require__(/*! ./hint.cjs.js */ "../../graphiql-react/dist/hint.cjs.js")), Promise.resolve().then(() => __webpack_require__(/*! ./lint.cjs2.js */ "../../graphiql-react/dist/lint.cjs2.js")), Promise.resolve().then(() => __webpack_require__(/*! ./info.cjs.js */ "../../graphiql-react/dist/info.cjs.js")), Promise.resolve().then(() => __webpack_require__(/*! ./jump.cjs.js */ "../../graphiql-react/dist/jump.cjs.js")), Promise.resolve().then(() => __webpack_require__(/*! ./mode.cjs.js */ "../../graphiql-react/dist/mode.cjs.js"))]).then(CodeMirror => { - if (!isActive) { + const setResponse = value => { + responseEditor.setValue(value); + updateActiveTabValues({ + response: value + }); + }; + queryIdRef.current = queryIdRef.current + 1; + const queryId = queryIdRef.current; + let query = autoCompleteLeafs() || queryEditor.getValue(); + const variablesString = variableEditor == null ? void 0 : variableEditor.getValue(); + let variables; + try { + variables = tryParseJsonObject({ + json: variablesString, + errorMessageParse: "Variables are invalid JSON", + errorMessageType: "Variables are not a JSON object." + }); + } catch (t52) { + const error = t52; + setResponse(error instanceof Error ? error.message : `${error}`); return; } - codeMirrorRef.current = CodeMirror; - const container = ref.current; - if (!container) { + const headersString = headerEditor == null ? void 0 : headerEditor.getValue(); + let headers; + try { + headers = tryParseJsonObject({ + json: headersString, + errorMessageParse: "Headers are invalid JSON", + errorMessageType: "Headers are not a JSON object." + }); + } catch (t62) { + const error_0 = t62; + setResponse(error_0 instanceof Error ? error_0.message : `${error_0}`); return; } - const newEditor = CodeMirror(container, { - value: initialQuery, - lineNumbers: true, - tabSize: 2, - foldGutter: true, - mode: "graphql", - theme: editorTheme, - autoCloseBrackets: true, - matchBrackets: true, - showCursorWhenSelecting: true, - readOnly: readOnly ? "nocursor" : false, - lint: { - // @ts-expect-error - schema: void 0, - validationRules: null, - // linting accepts string or FragmentDefinitionNode[] - externalFragments: void 0 - }, - hintOptions: { - // @ts-expect-error - schema: void 0, - closeOnUnfocus: false, - completeSingle: false, - container, - externalFragments: void 0, - autocompleteOptions: { - // for the query editor, restrict to executable type definitions - mode: graphqlLanguageService.GraphQLDocumentMode.EXECUTABLE + if (externalFragments) { + const fragmentDependencies = queryEditor.documentAST ? graphqlLanguageService.getFragmentDependenciesForAST(queryEditor.documentAST, externalFragments) : []; + if (fragmentDependencies.length > 0) { + query = query + ("\n" + fragmentDependencies.map(_temp$7).join("\n")); + } + } + setResponse(""); + setIsFetching(true); + const opName = (_ref = operationName !== null && operationName !== void 0 ? operationName : queryEditor.operationName) !== null && _ref !== void 0 ? _ref : void 0; + history == null ? void 0 : history.addToHistory({ + query, + variables: variablesString, + headers: headersString, + operationName: opName + }); + const _headers = (_headers2 = headers) !== null && _headers2 !== void 0 ? _headers2 : void 0; + const documentAST = (_queryEditor$document = queryEditor.documentAST) !== null && _queryEditor$document !== void 0 ? _queryEditor$document : void 0; + try { + const fullResponse = {}; + const handleResponse = result => { + if (queryId !== queryIdRef.current) { + return; } - }, - info: { - schema: void 0, - renderDescription: text => markdown.render(text), - onClick(reference) { - onClickReferenceRef.current(reference); + let maybeMultipart = Array.isArray(result) ? result : false; + if (!maybeMultipart && typeof result === "object" && result !== null && "hasNext" in result) { + maybeMultipart = [result]; } - }, - jump: { - schema: void 0, - onClick(reference) { - onClickReferenceRef.current(reference); + if (maybeMultipart) { + for (const part of maybeMultipart) { + mergeIncrementalResult(fullResponse, part); + } + setIsFetching(false); + setResponse(toolkit.formatResult(fullResponse)); + } else { + const response = toolkit.formatResult(result); + setIsFetching(false); + setResponse(response); + } + }; + const fetch2 = fetcher({ + query, + variables, + operationName: opName + }, { + headers: _headers, + documentAST + }); + const value_0 = await Promise.resolve(fetch2); + if (toolkit.isObservable(value_0)) { + setSubscription(value_0.subscribe({ + next(result_0) { + handleResponse(result_0); + }, + error(error_2) { + setIsFetching(false); + if (error_2) { + setResponse(toolkit.formatError(error_2)); + } + setSubscription(null); + }, + complete() { + setIsFetching(false); + setSubscription(null); + } + })); + } else { + if (toolkit.isAsyncIterable(value_0)) { + setSubscription({ + unsubscribe: () => { + var _a, _b; + return (_b = (_a = value_0[Symbol.asyncIterator]()).return) == null ? void 0 : _b.call(_a); + } + }); + await handleAsyncResults(handleResponse, value_0); + setIsFetching(false); + setSubscription(null); + } else { + handleResponse(value_0); } - }, - gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], - extraKeys: { - ...commonKeys, - "Cmd-S"() {}, - "Ctrl-S"() {} - } - }); - newEditor.addKeyMap({ - "Cmd-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - }, - "Ctrl-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - }, - "Alt-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - }, - "Shift-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - }, - "Shift-Alt-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - } - }); - newEditor.on("keyup", (editorInstance, event) => { - if (AUTO_COMPLETE_AFTER_KEY.test(event.key)) { - editorInstance.execCommand("autocomplete"); - } - }); - let showingHints = false; - newEditor.on("startCompletion", () => { - showingHints = true; - }); - newEditor.on("endCompletion", () => { - showingHints = false; - }); - newEditor.on("keydown", (editorInstance, event) => { - if (event.key === "Escape" && showingHints) { - event.stopPropagation(); - } - }); - newEditor.on("beforeChange", (editorInstance, change) => { - var _a; - if (change.origin === "paste") { - const text = change.text.map(normalizeWhitespace); - (_a = change.update) == null ? void 0 : _a.call(change, change.from, change.to, text); } - }); - newEditor.documentAST = null; - newEditor.operationName = null; - newEditor.operations = null; - newEditor.variableToType = null; - setQueryEditor(newEditor); - }); - return () => { - isActive = false; + } catch (t72) { + const error_1 = t72; + setIsFetching(false); + setResponse(toolkit.formatError(error_1)); + setSubscription(null); + } }; - }, [editorTheme, initialQuery, readOnly, setQueryEditor]); - useSynchronizeOption(queryEditor, "keyMap", keyMap); - React.useEffect(() => { - if (!queryEditor) { - return; - } - function getAndUpdateOperationFacts(editorInstance) { - var _editorInstance$opera, _editorInstance$opera2, _ref3, _ref4; - var _a; - const operationFacts = graphqlLanguageService.getOperationFacts(schema, editorInstance.getValue()); - const operationName = toolkit.getSelectedOperationName((_editorInstance$opera = editorInstance.operations) !== null && _editorInstance$opera !== void 0 ? _editorInstance$opera : void 0, (_editorInstance$opera2 = editorInstance.operationName) !== null && _editorInstance$opera2 !== void 0 ? _editorInstance$opera2 : void 0, operationFacts == null ? void 0 : operationFacts.operations); - editorInstance.documentAST = (_ref3 = operationFacts == null ? void 0 : operationFacts.documentAST) !== null && _ref3 !== void 0 ? _ref3 : null; - editorInstance.operationName = operationName !== null && operationName !== void 0 ? operationName : null; - editorInstance.operations = (_ref4 = operationFacts == null ? void 0 : operationFacts.operations) !== null && _ref4 !== void 0 ? _ref4 : null; - if (variableEditor) { - variableEditor.state.lint.linterOptions.variableToType = operationFacts == null ? void 0 : operationFacts.variableToType; - variableEditor.options.lint.variableToType = operationFacts == null ? void 0 : operationFacts.variableToType; - variableEditor.options.hintOptions.variableToType = operationFacts == null ? void 0 : operationFacts.variableToType; - (_a = codeMirrorRef.current) == null ? void 0 : _a.signal(variableEditor, "change", variableEditor); + $[5] = autoCompleteLeafs; + $[6] = externalFragments; + $[7] = fetcher; + $[8] = headerEditor; + $[9] = history; + $[10] = operationName; + $[11] = queryEditor; + $[12] = responseEditor; + $[13] = stop; + $[14] = subscription; + $[15] = updateActiveTabValues; + $[16] = variableEditor; + $[17] = t4; + } else { + t4 = $[17]; + } + const run = t4; + const isSubscribed = Boolean(subscription); + const t5 = operationName !== null && operationName !== void 0 ? operationName : null; + let t6; + if ($[18] !== isFetching || $[19] !== isSubscribed || $[20] !== run || $[21] !== stop || $[22] !== t5) { + t6 = { + isFetching, + isSubscribed, + operationName: t5, + run, + stop + }; + $[18] = isFetching; + $[19] = isSubscribed; + $[20] = run; + $[21] = stop; + $[22] = t5; + $[23] = t6; + } else { + t6 = $[23]; + } + const value_1 = t6; + let t7; + if ($[24] !== children || $[25] !== value_1) { + t7 = /* @__PURE__ */jsxRuntime.jsx(ExecutionContext.Provider, { + value: value_1, + children + }); + $[24] = children; + $[25] = value_1; + $[26] = t7; + } else { + t7 = $[26]; + } + return t7; +} +function _temp$7(node) { + return graphql.print(node); +} +async function handleAsyncResults(onResponse, value) { + for await (const result of value) { + onResponse(result); + } +} +const useExecutionContext = createContextHook(ExecutionContext); +function tryParseJsonObject({ + json, + errorMessageParse, + errorMessageType +}) { + let parsed; + try { + parsed = json && json.trim() !== "" ? JSON.parse(json) : void 0; + } catch (error) { + throw new Error(`${errorMessageParse}: ${error instanceof Error ? error.message : error}.`); + } + const isObject = typeof parsed === "object" && parsed !== null && !Array.isArray(parsed); + if (parsed !== void 0 && !isObject) { + throw new Error(errorMessageType); + } + return parsed; +} +const pathsMap = /* @__PURE__ */new WeakMap(); +function mergeIncrementalResult(executionResult, incrementalResult) { + var _incrementalResult$pa; + var _a, _b, _c; + let path = ["data", ...((_incrementalResult$pa = incrementalResult.path) !== null && _incrementalResult$pa !== void 0 ? _incrementalResult$pa : [])]; + for (const result of [executionResult, incrementalResult]) { + if (result.pending) { + let paths = pathsMap.get(executionResult); + if (paths === void 0) { + paths = /* @__PURE__ */new Map(); + pathsMap.set(executionResult, paths); + } + for (const { + id, + path: pendingPath + } of result.pending) { + paths.set(id, ["data", ...pendingPath]); } - return operationFacts ? { - ...operationFacts, - operationName - } : null; } - const handleChange = debounce(100, editorInstance => { - var _ref5; - const query = editorInstance.getValue(); - storage == null ? void 0 : storage.set(STORAGE_KEY_QUERY, query); - const currentOperationName = editorInstance.operationName; - const operationFacts = getAndUpdateOperationFacts(editorInstance); - if ((operationFacts == null ? void 0 : operationFacts.operationName) !== void 0) { - storage == null ? void 0 : storage.set(STORAGE_KEY_OPERATION_NAME, operationFacts.operationName); + } + const { + items + } = incrementalResult; + if (items) { + const { + id + } = incrementalResult; + if (id) { + path = (_a = pathsMap.get(executionResult)) == null ? void 0 : _a.get(id); + if (path === void 0) { + throw new Error("Invalid incremental delivery format."); } - onEdit == null ? void 0 : onEdit(query, operationFacts == null ? void 0 : operationFacts.documentAST); - if ((operationFacts == null ? void 0 : operationFacts.operationName) && currentOperationName !== operationFacts.operationName) { - setOperationName(operationFacts.operationName); + const list = getValue(executionResult, path.join(".")); + list.push(...items); + } else { + var _incrementalResult$pa2; + path = ["data", ...((_incrementalResult$pa2 = incrementalResult.path) !== null && _incrementalResult$pa2 !== void 0 ? _incrementalResult$pa2 : [])]; + for (const item of items) { + setValue(executionResult, path.join("."), item); + path[path.length - 1]++; } - updateActiveTabValues({ - query, - operationName: (_ref5 = operationFacts == null ? void 0 : operationFacts.operationName) !== null && _ref5 !== void 0 ? _ref5 : null - }); - }); - getAndUpdateOperationFacts(queryEditor); - queryEditor.on("change", handleChange); - return () => queryEditor.off("change", handleChange); - }, [onEdit, queryEditor, schema, setOperationName, storage, variableEditor, updateActiveTabValues]); - useSynchronizeSchema(queryEditor, schema !== null && schema !== void 0 ? schema : null, codeMirrorRef); - useSynchronizeValidationRules(queryEditor, validationRules !== null && validationRules !== void 0 ? validationRules : null, codeMirrorRef); - useSynchronizeExternalFragments(queryEditor, externalFragments, codeMirrorRef); - useCompletion(queryEditor, onClickReference || null, useQueryEditor); - const run = executionContext == null ? void 0 : executionContext.run; - const runAtCursor = React.useCallback(() => { - var _a; - if (!run || !queryEditor || !queryEditor.operations || !queryEditor.hasFocus()) { - run == null ? void 0 : run(); - return; } - const cursorIndex = queryEditor.indexFromPos(queryEditor.getCursor()); - let operationName; - for (const operation of queryEditor.operations) { - if (operation.loc && operation.loc.start <= cursorIndex && operation.loc.end >= cursorIndex) { - operationName = (_a = operation.name) == null ? void 0 : _a.value; + } + const { + data + } = incrementalResult; + if (data) { + const { + id + } = incrementalResult; + if (id) { + path = (_b = pathsMap.get(executionResult)) == null ? void 0 : _b.get(id); + if (path === void 0) { + throw new Error("Invalid incremental delivery format."); + } + const { + subPath + } = incrementalResult; + if (subPath !== void 0) { + path = [...path, ...subPath]; } } - if (operationName && operationName !== queryEditor.operationName) { - setOperationName(operationName); - } - run(); - }, [queryEditor, run, setOperationName]); - useKeyMap(queryEditor, ["Cmd-Enter", "Ctrl-Enter"], runAtCursor); - useKeyMap(queryEditor, ["Shift-Ctrl-C"], copy); - useKeyMap(queryEditor, ["Shift-Ctrl-P", - // Shift-Ctrl-P is hard coded in Firefox for private browsing so adding an alternative to prettify - "Shift-Ctrl-F"], prettify); - useKeyMap(queryEditor, ["Shift-Ctrl-M"], merge); - return ref; -} -function useSynchronizeSchema(editor, schema, codeMirrorRef) { - React.useEffect(() => { - if (!editor) { - return; + setValue(executionResult, path.join("."), data, { + merge: true + }); + } + if (incrementalResult.errors) { + executionResult.errors || (executionResult.errors = []); + executionResult.errors.push(...incrementalResult.errors); + } + if (incrementalResult.extensions) { + setValue(executionResult, "extensions", incrementalResult.extensions, { + merge: true + }); + } + if (incrementalResult.incremental) { + for (const incrementalSubResult of incrementalResult.incremental) { + mergeIncrementalResult(executionResult, incrementalSubResult); } - const didChange = editor.options.lint.schema !== schema; - editor.state.lint.linterOptions.schema = schema; - editor.options.lint.schema = schema; - editor.options.hintOptions.schema = schema; - editor.options.info.schema = schema; - editor.options.jump.schema = schema; - if (didChange && codeMirrorRef.current) { - codeMirrorRef.current.signal(editor, "change", editor); + } + if (incrementalResult.completed) { + for (const { + id, + errors + } of incrementalResult.completed) { + (_c = pathsMap.get(executionResult)) == null ? void 0 : _c.delete(id); + if (errors) { + executionResult.errors || (executionResult.errors = []); + executionResult.errors.push(...errors); + } } - }, [editor, schema, codeMirrorRef]); + } } -function useSynchronizeValidationRules(editor, validationRules, codeMirrorRef) { - React.useEffect(() => { - if (!editor) { - return; - } - const didChange = editor.options.lint.validationRules !== validationRules; - editor.state.lint.linterOptions.validationRules = validationRules; - editor.options.lint.validationRules = validationRules; - if (didChange && codeMirrorRef.current) { - codeMirrorRef.current.signal(editor, "change", editor); - } - }, [editor, validationRules, codeMirrorRef]); +const isMacOs = typeof navigator !== "undefined" && navigator.userAgent.includes("Mac"); +const DEFAULT_EDITOR_THEME = "graphiql"; +const DEFAULT_KEY_MAP = "sublime"; +const commonKeys = { + // Persistent search box in Query Editor + [isMacOs ? "Cmd-F" : "Ctrl-F"]: "findPersistent", + "Cmd-G": "findPersistent", + "Ctrl-G": "findPersistent", + // Editor improvements + "Ctrl-Left": "goSubwordLeft", + "Ctrl-Right": "goSubwordRight", + "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight" +}; +async function importCodeMirror(addons, options) { + const CodeMirror = await Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror */ "../../../node_modules/codemirror/lib/codemirror.js"))).then(c => + // Depending on bundler and settings the dynamic import either returns a + // function (e.g. parcel) or an object containing a `default` property + typeof c === "function" ? c : c.default); + await Promise.all((options == null ? void 0 : options.useCommonAddons) === false ? addons : [Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/hint/show-hint.js */ "../../../node_modules/codemirror/addon/hint/show-hint.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/edit/matchbrackets.js */ "../../../node_modules/codemirror/addon/edit/matchbrackets.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/edit/closebrackets.js */ "../../../node_modules/codemirror/addon/edit/closebrackets.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/fold/brace-fold.js */ "../../../node_modules/codemirror/addon/fold/brace-fold.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/fold/foldgutter.js */ "../../../node_modules/codemirror/addon/fold/foldgutter.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/lint/lint.js */ "../../../node_modules/codemirror/addon/lint/lint.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/search/searchcursor.js */ "../../../node_modules/codemirror/addon/search/searchcursor.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/search/jump-to-line.js */ "../../../node_modules/codemirror/addon/search/jump-to-line.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/dialog/dialog.js */ "../../../node_modules/codemirror/addon/dialog/dialog.js"))), // @ts-expect-error + Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/keymap/sublime.js */ "../../../node_modules/codemirror/keymap/sublime.js"))), ...addons]); + return CodeMirror; } -function useSynchronizeExternalFragments(editor, externalFragments, codeMirrorRef) { - const externalFragmentList = React.useMemo(() => [...externalFragments.values()], [externalFragments]); - React.useEffect(() => { - if (!editor) { - return; - } - const didChange = editor.options.lint.externalFragments !== externalFragmentList; - editor.state.lint.linterOptions.externalFragments = externalFragmentList; - editor.options.lint.externalFragments = externalFragmentList; - editor.options.hintOptions.externalFragments = externalFragmentList; - if (didChange && codeMirrorRef.current) { - codeMirrorRef.current.signal(editor, "change", editor); - } - }, [editor, externalFragmentList, codeMirrorRef]); +const printDefault = ast => { + if (!ast) { + return ""; + } + return graphql.print(ast); +}; +function DefaultValue(t0) { + const $ = reactCompilerRuntime.c(12); + const { + field + } = t0; + if (!("defaultValue" in field) || field.defaultValue === void 0) { + return null; + } + const t1 = field.defaultValue; + const t2 = field.type; + let t3; + let t4; + let t5; + let t6; + if ($[0] !== field.defaultValue || $[1] !== field.type) { + t6 = Symbol.for("react.early_return_sentinel"); + bb0: { + const ast = graphql.astFromValue(t1, t2); + if (!ast) { + t6 = null; + break bb0; + } + t5 = " = "; + t3 = "graphiql-doc-explorer-default-value"; + t4 = printDefault(ast); + } + $[0] = field.defaultValue; + $[1] = field.type; + $[2] = t3; + $[3] = t4; + $[4] = t5; + $[5] = t6; + } else { + t3 = $[2]; + t4 = $[3]; + t5 = $[4]; + t6 = $[5]; + } + if (t6 !== Symbol.for("react.early_return_sentinel")) { + return t6; + } + let t7; + if ($[6] !== t3 || $[7] !== t4) { + t7 = /* @__PURE__ */jsxRuntime.jsx("span", { + className: t3, + children: t4 + }); + $[6] = t3; + $[7] = t4; + $[8] = t7; + } else { + t7 = $[8]; + } + let t8; + if ($[9] !== t5 || $[10] !== t7) { + t8 = /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [t5, t7] + }); + $[9] = t5; + $[10] = t7; + $[11] = t8; + } else { + t8 = $[11]; + } + return t8; } -const AUTO_COMPLETE_AFTER_KEY = /^[a-zA-Z0-9_@(]$/; -const STORAGE_KEY_QUERY = "query"; -const STORAGE_KEY_OPERATION_NAME = "operationName"; -function getDefaultTabState({ - defaultQuery, - defaultHeaders, - headers, - defaultTabs, - query, - variables, - storage, - shouldPersistHeaders -}) { - const storedState = storage == null ? void 0 : storage.get(STORAGE_KEY$2); - try { - if (!storedState) { - throw new Error("Storage for tabs is empty"); - } - const parsed = JSON.parse(storedState); - const headersForHash = shouldPersistHeaders ? headers : void 0; - if (isTabsState(parsed)) { - const expectedHash = hashFromTabContents({ - query, - variables, - headers: headersForHash - }); - let matchingTabIndex = -1; - for (let index = 0; index < parsed.tabs.length; index++) { - const tab = parsed.tabs[index]; - tab.hash = hashFromTabContents({ - query: tab.query, - variables: tab.variables, - headers: tab.headers - }); - if (tab.hash === expectedHash) { - matchingTabIndex = index; - } +const SchemaContext = createNullableContext("SchemaContext"); +function SchemaContextProvider(t0) { + const $ = reactCompilerRuntime.c(38); + let fetcher; + let onSchemaChange; + let props; + if ($[0] !== t0) { + ({ + fetcher, + onSchemaChange, + ...props + } = t0); + $[0] = t0; + $[1] = fetcher; + $[2] = onSchemaChange; + $[3] = props; + } else { + fetcher = $[1]; + onSchemaChange = $[2]; + props = $[3]; + } + if (!fetcher) { + throw new TypeError("The `SchemaContextProvider` component requires a `fetcher` function to be passed as prop."); + } + let t1; + if ($[4] === Symbol.for("react.memo_cache_sentinel")) { + t1 = { + nonNull: true, + caller: SchemaContextProvider + }; + $[4] = t1; + } else { + t1 = $[4]; + } + const { + initialHeaders, + headerEditor + } = useEditorContext(t1); + const [schema, setSchema] = React.useState(); + const [isFetching, setIsFetching] = React.useState(false); + const [fetchError, setFetchError] = React.useState(null); + const counterRef = React.useRef(0); + let t2; + let t3; + if ($[5] !== props.schema) { + t2 = () => { + setSchema(graphql.isSchema(props.schema) || props.schema == null ? props.schema : void 0); + counterRef.current = counterRef.current + 1; + }; + t3 = [props.schema]; + $[5] = props.schema; + $[6] = t2; + $[7] = t3; + } else { + t2 = $[6]; + t3 = $[7]; + } + React.useEffect(t2, t3); + const headersRef = React.useRef(initialHeaders); + let t4; + if ($[8] !== headerEditor) { + t4 = () => { + if (headerEditor) { + headersRef.current = headerEditor.getValue(); } - if (matchingTabIndex >= 0) { - parsed.activeTabIndex = matchingTabIndex; - } else { - const operationName = query ? fuzzyExtractOperationName(query) : null; - parsed.tabs.push({ - id: guid(), - hash: expectedHash, - title: operationName || DEFAULT_TITLE, - query, - variables, - headers, - operationName, - response: null - }); - parsed.activeTabIndex = parsed.tabs.length - 1; + }; + $[8] = headerEditor; + $[9] = t4; + } else { + t4 = $[9]; + } + React.useEffect(t4); + let t5; + if ($[10] !== props.inputValueDeprecation || $[11] !== props.introspectionQueryName || $[12] !== props.schemaDescription) { + t5 = { + inputValueDeprecation: props.inputValueDeprecation, + introspectionQueryName: props.introspectionQueryName, + schemaDescription: props.schemaDescription + }; + $[10] = props.inputValueDeprecation; + $[11] = props.introspectionQueryName; + $[12] = props.schemaDescription; + $[13] = t5; + } else { + t5 = $[13]; + } + const { + introspectionQuery, + introspectionQueryName, + introspectionQuerySansSubscriptions + } = useIntrospectionQuery(t5); + let t6; + if ($[14] !== fetcher || $[15] !== introspectionQuery || $[16] !== introspectionQueryName || $[17] !== introspectionQuerySansSubscriptions || $[18] !== onSchemaChange || $[19] !== props.schema) { + t6 = () => { + if (graphql.isSchema(props.schema) || props.schema === null) { + return; } - return parsed; - } - throw new Error("Storage for tabs is invalid"); - } catch { - return { - activeTabIndex: 0, - tabs: (defaultTabs || [{ - query: query !== null && query !== void 0 ? query : defaultQuery, - variables, - headers: headers !== null && headers !== void 0 ? headers : defaultHeaders - }]).map(createTab) + const counter = counterRef.current = counterRef.current + 1; + const maybeIntrospectionData = props.schema; + const fetchIntrospectionData = async function fetchIntrospectionData2() { + if (maybeIntrospectionData) { + return maybeIntrospectionData; + } + const parsedHeaders = parseHeaderString(headersRef.current); + if (!parsedHeaders.isValidJSON) { + setFetchError("Introspection failed as headers are invalid."); + return; + } + const fetcherOpts = parsedHeaders.headers ? { + headers: parsedHeaders.headers + } : {}; + const fetch2 = toolkit.fetcherReturnToPromise(fetcher({ + query: introspectionQuery, + operationName: introspectionQueryName + }, fetcherOpts)); + if (!toolkit.isPromise(fetch2)) { + setFetchError("Fetcher did not return a Promise for introspection."); + return; + } + setIsFetching(true); + setFetchError(null); + let result = await fetch2; + if (typeof result !== "object" || result === null || !("data" in result)) { + const fetch22 = toolkit.fetcherReturnToPromise(fetcher({ + query: introspectionQuerySansSubscriptions, + operationName: introspectionQueryName + }, fetcherOpts)); + if (!toolkit.isPromise(fetch22)) { + throw new Error("Fetcher did not return a Promise for introspection."); + } + result = await fetch22; + } + setIsFetching(false); + if ((result == null ? void 0 : result.data) && "__schema" in result.data) { + return result.data; + } + const responseString = typeof result === "string" ? result : toolkit.formatResult(result); + setFetchError(responseString); + }; + fetchIntrospectionData().then(introspectionData => { + if (counter !== counterRef.current || !introspectionData) { + return; + } + try { + const newSchema = graphql.buildClientSchema(introspectionData); + setSchema(newSchema); + if (onSchemaChange) { + onSchemaChange(newSchema); + } + } catch (t72) { + const error = t72; + setFetchError(toolkit.formatError(error)); + } + }).catch(error_0 => { + if (counter !== counterRef.current) { + return; + } + setFetchError(toolkit.formatError(error_0)); + setIsFetching(false); + }); + }; + $[14] = fetcher; + $[15] = introspectionQuery; + $[16] = introspectionQueryName; + $[17] = introspectionQuerySansSubscriptions; + $[18] = onSchemaChange; + $[19] = props.schema; + $[20] = t6; + } else { + t6 = $[20]; + } + const introspect = t6; + let t7; + let t8; + if ($[21] !== introspect) { + t7 = () => { + introspect(); }; + t8 = [introspect]; + $[21] = introspect; + $[22] = t7; + $[23] = t8; + } else { + t7 = $[22]; + t8 = $[23]; } -} -function isTabsState(obj) { - return obj && typeof obj === "object" && !Array.isArray(obj) && hasNumberKey(obj, "activeTabIndex") && "tabs" in obj && Array.isArray(obj.tabs) && obj.tabs.every(isTabState); -} -function isTabState(obj) { - return obj && typeof obj === "object" && !Array.isArray(obj) && hasStringKey(obj, "id") && hasStringKey(obj, "title") && hasStringOrNullKey(obj, "query") && hasStringOrNullKey(obj, "variables") && hasStringOrNullKey(obj, "headers") && hasStringOrNullKey(obj, "operationName") && hasStringOrNullKey(obj, "response"); -} -function hasNumberKey(obj, key) { - return key in obj && typeof obj[key] === "number"; -} -function hasStringKey(obj, key) { - return key in obj && typeof obj[key] === "string"; -} -function hasStringOrNullKey(obj, key) { - return key in obj && (typeof obj[key] === "string" || obj[key] === null); -} -function useSynchronizeActiveTabValues({ - queryEditor, - variableEditor, - headerEditor, - responseEditor -}) { - return React.useCallback(state => { - var _ref6, _ref7, _ref8, _ref9, _ref10; - const query = (_ref6 = queryEditor == null ? void 0 : queryEditor.getValue()) !== null && _ref6 !== void 0 ? _ref6 : null; - const variables = (_ref7 = variableEditor == null ? void 0 : variableEditor.getValue()) !== null && _ref7 !== void 0 ? _ref7 : null; - const headers = (_ref8 = headerEditor == null ? void 0 : headerEditor.getValue()) !== null && _ref8 !== void 0 ? _ref8 : null; - const operationName = (_ref9 = queryEditor == null ? void 0 : queryEditor.operationName) !== null && _ref9 !== void 0 ? _ref9 : null; - const response = (_ref10 = responseEditor == null ? void 0 : responseEditor.getValue()) !== null && _ref10 !== void 0 ? _ref10 : null; - return setPropertiesInActiveTab(state, { - query, - variables, - headers, - response, - operationName + React.useEffect(t7, t8); + let t9; + if ($[24] !== introspect) { + t9 = () => { + const triggerIntrospection = function triggerIntrospection2(event) { + if (event.ctrlKey && event.key === "R") { + introspect(); + } + }; + window.addEventListener("keydown", triggerIntrospection); + return () => { + window.removeEventListener("keydown", triggerIntrospection); + }; + }; + $[24] = introspect; + $[25] = t9; + } else { + t9 = $[25]; + } + React.useEffect(t9); + let t10; + if ($[26] !== props.dangerouslyAssumeSchemaIsValid || $[27] !== schema) { + t10 = !schema || props.dangerouslyAssumeSchemaIsValid ? [] : graphql.validateSchema(schema); + $[26] = props.dangerouslyAssumeSchemaIsValid; + $[27] = schema; + $[28] = t10; + } else { + t10 = $[28]; + } + const validationErrors = t10; + let t11; + if ($[29] !== fetchError || $[30] !== introspect || $[31] !== isFetching || $[32] !== schema || $[33] !== validationErrors) { + t11 = { + fetchError, + introspect, + isFetching, + schema, + validationErrors + }; + $[29] = fetchError; + $[30] = introspect; + $[31] = isFetching; + $[32] = schema; + $[33] = validationErrors; + $[34] = t11; + } else { + t11 = $[34]; + } + const value = t11; + let t12; + if ($[35] !== props.children || $[36] !== value) { + t12 = /* @__PURE__ */jsxRuntime.jsx(SchemaContext.Provider, { + value, + children: props.children }); - }, [queryEditor, variableEditor, headerEditor, responseEditor]); -} -function serializeTabState(tabState, shouldPersistHeaders = false) { - return JSON.stringify(tabState, (key, value) => key === "hash" || key === "response" || !shouldPersistHeaders && key === "headers" ? null : value); -} -function useStoreTabs({ - storage, - shouldPersistHeaders -}) { - const store = React.useMemo(() => debounce(500, value => { - storage == null ? void 0 : storage.set(STORAGE_KEY$2, value); - }), [storage]); - return React.useCallback(currentState => { - store(serializeTabState(currentState, shouldPersistHeaders)); - }, [shouldPersistHeaders, store]); + $[35] = props.children; + $[36] = value; + $[37] = t12; + } else { + t12 = $[37]; + } + return t12; } -function useSetEditorValues({ - queryEditor, - variableEditor, - headerEditor, - responseEditor, - defaultHeaders +const useSchemaContext = createContextHook(SchemaContext); +function useIntrospectionQuery({ + inputValueDeprecation, + introspectionQueryName, + schemaDescription }) { - return React.useCallback(({ - query, - variables, - headers, - response - }) => { - var _ref11; - queryEditor == null ? void 0 : queryEditor.setValue(query !== null && query !== void 0 ? query : ""); - variableEditor == null ? void 0 : variableEditor.setValue(variables !== null && variables !== void 0 ? variables : ""); - headerEditor == null ? void 0 : headerEditor.setValue((_ref11 = headers !== null && headers !== void 0 ? headers : defaultHeaders) !== null && _ref11 !== void 0 ? _ref11 : ""); - responseEditor == null ? void 0 : responseEditor.setValue(response !== null && response !== void 0 ? response : ""); - }, [headerEditor, queryEditor, responseEditor, variableEditor, defaultHeaders]); -} -function createTab({ - query = null, - variables = null, - headers = null -} = {}) { + const queryName = introspectionQueryName || "IntrospectionQuery"; + let query = graphql.getIntrospectionQuery({ + inputValueDeprecation, + schemaDescription + }); + if (introspectionQueryName) { + query = query.replace("query IntrospectionQuery", `query ${queryName}`); + } + const querySansSubscriptions = query.replace("subscriptionType { name }", ""); return { - id: guid(), - hash: hashFromTabContents({ - query, - variables, - headers - }), - title: query && fuzzyExtractOperationName(query) || DEFAULT_TITLE, - query, - variables, - headers, - operationName: null, - response: null + introspectionQueryName: queryName, + introspectionQuery: query, + introspectionQuerySansSubscriptions: querySansSubscriptions }; } -function setPropertiesInActiveTab(state, partialTab) { +function parseHeaderString(headersString) { + let headers = null; + let isValidJSON = true; + try { + if (headersString) { + headers = JSON.parse(headersString); + } + } catch { + isValidJSON = false; + } return { - ...state, - tabs: state.tabs.map((tab, index) => { - if (index !== state.activeTabIndex) { - return tab; - } - const newTab = { - ...tab, - ...partialTab - }; - return { - ...newTab, - hash: hashFromTabContents(newTab), - title: newTab.operationName || (newTab.query ? fuzzyExtractOperationName(newTab.query) : void 0) || DEFAULT_TITLE - }; - }) - }; -} -function guid() { - const s4 = () => { - return Math.floor((1 + Math.random()) * 65536).toString(16).slice(1); + headers, + isValidJSON }; - return `${s4()}${s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`; -} -function hashFromTabContents(args) { - var _args$query, _args$variables, _args$headers; - return [(_args$query = args.query) !== null && _args$query !== void 0 ? _args$query : "", (_args$variables = args.variables) !== null && _args$variables !== void 0 ? _args$variables : "", (_args$headers = args.headers) !== null && _args$headers !== void 0 ? _args$headers : ""].join("|"); -} -function fuzzyExtractOperationName(str) { - var _ref12; - const regex = /^(?!#).*(query|subscription|mutation)\s+([a-zA-Z0-9_]+)/m; - const match = regex.exec(str); - return (_ref12 = match == null ? void 0 : match[2]) !== null && _ref12 !== void 0 ? _ref12 : null; } -function clearHeadersFromTabs(storage) { - const persistedTabs = storage == null ? void 0 : storage.get(STORAGE_KEY$2); - if (persistedTabs) { - const parsedTabs = JSON.parse(persistedTabs); - storage == null ? void 0 : storage.set(STORAGE_KEY$2, JSON.stringify(parsedTabs, (key, value) => key === "headers" ? null : value)); +const initialNavStackItem = { + name: "Docs" +}; +const ExplorerContext = createNullableContext("ExplorerContext"); +function ExplorerContextProvider(props) { + const $ = reactCompilerRuntime.c(14); + let t0; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t0 = { + nonNull: true, + caller: ExplorerContextProvider + }; + $[0] = t0; + } else { + t0 = $[0]; } -} -const DEFAULT_TITLE = ""; -const STORAGE_KEY$2 = "tabState"; -function useVariableEditor({ - editorTheme = DEFAULT_EDITOR_THEME, - keyMap = DEFAULT_KEY_MAP, - onClickReference, - onEdit, - readOnly = false -} = {}, caller) { const { - initialVariables, - variableEditor, - setVariableEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useVariableEditor - }); - const executionContext = useExecutionContext(); - const merge = useMergeQuery({ - caller: caller || useVariableEditor - }); - const prettify = usePrettifyEditors({ - caller: caller || useVariableEditor - }); - const ref = React.useRef(null); - const codeMirrorRef = React.useRef(); - React.useEffect(() => { - let isActive = true; - void importCodeMirror([Promise.resolve().then(() => __webpack_require__(/*! ./hint.cjs2.js */ "../../graphiql-react/dist/hint.cjs2.js")), Promise.resolve().then(() => __webpack_require__(/*! ./lint.cjs3.js */ "../../graphiql-react/dist/lint.cjs3.js")), Promise.resolve().then(() => __webpack_require__(/*! ./mode.cjs2.js */ "../../graphiql-react/dist/mode.cjs2.js"))]).then(CodeMirror => { - if (!isActive) { - return; - } - codeMirrorRef.current = CodeMirror; - const container = ref.current; - if (!container) { - return; - } - const newEditor = CodeMirror(container, { - value: initialVariables, - lineNumbers: true, - tabSize: 2, - mode: "graphql-variables", - theme: editorTheme, - autoCloseBrackets: true, - matchBrackets: true, - showCursorWhenSelecting: true, - readOnly: readOnly ? "nocursor" : false, - foldGutter: true, - lint: { - // @ts-expect-error - variableToType: void 0 - }, - hintOptions: { - closeOnUnfocus: false, - completeSingle: false, - container, - // @ts-expect-error - variableToType: void 0 - }, - gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], - extraKeys: commonKeys - }); - newEditor.addKeyMap({ - "Cmd-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Ctrl-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Alt-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Shift-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - } - }); - newEditor.on("keyup", (editorInstance, event) => { - const { - code, - key, - shiftKey - } = event; - const isLetter = code.startsWith("Key"); - const isNumber = !shiftKey && code.startsWith("Digit"); - if (isLetter || isNumber || key === "_" || key === '"') { - editorInstance.execCommand("autocomplete"); - } + schema, + validationErrors + } = useSchemaContext(t0); + let t1; + if ($[1] === Symbol.for("react.memo_cache_sentinel")) { + t1 = [initialNavStackItem]; + $[1] = t1; + } else { + t1 = $[1]; + } + const [navStack, setNavStack] = React.useState(t1); + let t2; + if ($[2] === Symbol.for("react.memo_cache_sentinel")) { + t2 = item => { + setNavStack(currentState => { + const lastItem = currentState.at(-1); + return lastItem.def === item.def ? currentState : [...currentState, item]; }); - setVariableEditor(newEditor); - }); - return () => { - isActive = false; }; - }, [editorTheme, initialVariables, readOnly, setVariableEditor]); - useSynchronizeOption(variableEditor, "keyMap", keyMap); - useChangeHandler(variableEditor, onEdit, STORAGE_KEY$1, "variables", useVariableEditor); - useCompletion(variableEditor, onClickReference || null, useVariableEditor); - useKeyMap(variableEditor, ["Cmd-Enter", "Ctrl-Enter"], executionContext == null ? void 0 : executionContext.run); - useKeyMap(variableEditor, ["Shift-Ctrl-P"], prettify); - useKeyMap(variableEditor, ["Shift-Ctrl-M"], merge); - return ref; + $[2] = t2; + } else { + t2 = $[2]; + } + const push = t2; + let t3; + if ($[3] === Symbol.for("react.memo_cache_sentinel")) { + t3 = () => { + setNavStack(_temp$6); + }; + $[3] = t3; + } else { + t3 = $[3]; + } + const pop = t3; + let t4; + if ($[4] === Symbol.for("react.memo_cache_sentinel")) { + t4 = () => { + setNavStack(_temp2$3); + }; + $[4] = t4; + } else { + t4 = $[4]; + } + const reset = t4; + let t5; + let t6; + if ($[5] !== schema || $[6] !== validationErrors) { + t5 = () => { + if (schema == null || validationErrors.length > 0) { + reset(); + } else { + setNavStack(oldNavStack => { + if (oldNavStack.length === 1) { + return oldNavStack; + } + const newNavStack = [initialNavStackItem]; + let lastEntity = null; + for (const item_0 of oldNavStack) { + if (item_0 === initialNavStackItem) { + continue; + } + if (item_0.def) { + if (graphql.isNamedType(item_0.def)) { + const newType = schema.getType(item_0.def.name); + if (newType) { + newNavStack.push({ + name: item_0.name, + def: newType + }); + lastEntity = newType; + } else { + break; + } + } else { + if (lastEntity === null) { + break; + } else { + if (graphql.isObjectType(lastEntity) || graphql.isInputObjectType(lastEntity)) { + const field = lastEntity.getFields()[item_0.name]; + if (field) { + newNavStack.push({ + name: item_0.name, + def: field + }); + } else { + break; + } + } else { + if (graphql.isScalarType(lastEntity) || graphql.isEnumType(lastEntity) || graphql.isInterfaceType(lastEntity) || graphql.isUnionType(lastEntity)) { + break; + } else { + const field_0 = lastEntity; + const arg = field_0.args.find(a => a.name === item_0.name); + if (arg) { + newNavStack.push({ + name: item_0.name, + def: field_0 + }); + } else { + break; + } + } + } + } + } + } else { + lastEntity = null; + newNavStack.push(item_0); + } + } + return newNavStack; + }); + } + }; + t6 = [schema, validationErrors]; + $[5] = schema; + $[6] = validationErrors; + $[7] = t5; + $[8] = t6; + } else { + t5 = $[7]; + t6 = $[8]; + } + React.useEffect(t5, t6); + let t7; + if ($[9] !== navStack) { + t7 = { + explorerNavStack: navStack, + push, + pop, + reset + }; + $[9] = navStack; + $[10] = t7; + } else { + t7 = $[10]; + } + const value = t7; + let t8; + if ($[11] !== props.children || $[12] !== value) { + t8 = /* @__PURE__ */jsxRuntime.jsx(ExplorerContext.Provider, { + value, + children: props.children + }); + $[11] = props.children; + $[12] = value; + $[13] = t8; + } else { + t8 = $[13]; + } + return t8; } -const STORAGE_KEY$1 = "variables"; -const EditorContext = createNullableContext("EditorContext"); -function EditorContextProvider(props) { - const storage = useStorageContext(); - const [headerEditor, setHeaderEditor] = React.useState(null); - const [queryEditor, setQueryEditor] = React.useState(null); - const [responseEditor, setResponseEditor] = React.useState(null); - const [variableEditor, setVariableEditor] = React.useState(null); - const [shouldPersistHeaders, setShouldPersistHeadersInternal] = React.useState(() => { - const isStored = (storage == null ? void 0 : storage.get(PERSIST_HEADERS_STORAGE_KEY)) !== null; - return props.shouldPersistHeaders !== false && isStored ? (storage == null ? void 0 : storage.get(PERSIST_HEADERS_STORAGE_KEY)) === "true" : Boolean(props.shouldPersistHeaders); - }); - useSynchronizeValue(headerEditor, props.headers); - useSynchronizeValue(queryEditor, props.query); - useSynchronizeValue(responseEditor, props.response); - useSynchronizeValue(variableEditor, props.variables); - const storeTabs = useStoreTabs({ - storage, - shouldPersistHeaders - }); - const [initialState] = React.useState(() => { - var _ref13, _props$query, _ref14, _props$variables, _ref15, _props$headers, _props$response, _ref16, _ref17; - const query = (_ref13 = (_props$query = props.query) !== null && _props$query !== void 0 ? _props$query : storage == null ? void 0 : storage.get(STORAGE_KEY_QUERY)) !== null && _ref13 !== void 0 ? _ref13 : null; - const variables = (_ref14 = (_props$variables = props.variables) !== null && _props$variables !== void 0 ? _props$variables : storage == null ? void 0 : storage.get(STORAGE_KEY$1)) !== null && _ref14 !== void 0 ? _ref14 : null; - const headers = (_ref15 = (_props$headers = props.headers) !== null && _props$headers !== void 0 ? _props$headers : storage == null ? void 0 : storage.get(STORAGE_KEY$3)) !== null && _ref15 !== void 0 ? _ref15 : null; - const response = (_props$response = props.response) !== null && _props$response !== void 0 ? _props$response : ""; - const tabState2 = getDefaultTabState({ - query, - variables, - headers, - defaultTabs: props.defaultTabs, - defaultQuery: props.defaultQuery || DEFAULT_QUERY, - defaultHeaders: props.defaultHeaders, - storage, - shouldPersistHeaders +function _temp2$3(currentState_1) { + return currentState_1.length === 1 ? currentState_1 : [initialNavStackItem]; +} +function _temp$6(currentState_0) { + return currentState_0.length > 1 ? currentState_0.slice(0, -1) : currentState_0; +} +const useExplorerContext = createContextHook(ExplorerContext); +function renderType(type, renderNamedType) { + if (graphql.isNonNullType(type)) { + return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [renderType(type.ofType, renderNamedType), "!"] }); - storeTabs(tabState2); - return { - query: (_ref16 = query !== null && query !== void 0 ? query : tabState2.activeTabIndex === 0 ? tabState2.tabs[0].query : null) !== null && _ref16 !== void 0 ? _ref16 : "", - variables: variables !== null && variables !== void 0 ? variables : "", - headers: (_ref17 = headers !== null && headers !== void 0 ? headers : props.defaultHeaders) !== null && _ref17 !== void 0 ? _ref17 : "", - response, - tabState: tabState2 + } + if (graphql.isListType(type)) { + return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: ["[", renderType(type.ofType, renderNamedType), "]"] + }); + } + return renderNamedType(type); +} +function TypeLink(props) { + const $ = reactCompilerRuntime.c(6); + let t0; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t0 = { + nonNull: true, + caller: TypeLink }; - }); - const [tabState, setTabState] = React.useState(initialState.tabState); - const setShouldPersistHeaders = React.useCallback(persist => { - if (persist) { - var _ref18; - storage == null ? void 0 : storage.set(STORAGE_KEY$3, (_ref18 = headerEditor == null ? void 0 : headerEditor.getValue()) !== null && _ref18 !== void 0 ? _ref18 : ""); - const serializedTabs = serializeTabState(tabState, true); - storage == null ? void 0 : storage.set(STORAGE_KEY$2, serializedTabs); - } else { - storage == null ? void 0 : storage.set(STORAGE_KEY$3, ""); - clearHeadersFromTabs(storage); - } - setShouldPersistHeadersInternal(persist); - storage == null ? void 0 : storage.set(PERSIST_HEADERS_STORAGE_KEY, persist.toString()); - }, [storage, tabState, headerEditor]); - const lastShouldPersistHeadersProp = React.useRef(); - React.useEffect(() => { - const propValue = Boolean(props.shouldPersistHeaders); - if ((lastShouldPersistHeadersProp == null ? void 0 : lastShouldPersistHeadersProp.current) !== propValue) { - setShouldPersistHeaders(propValue); - lastShouldPersistHeadersProp.current = propValue; - } - }, [props.shouldPersistHeaders, setShouldPersistHeaders]); - const synchronizeActiveTabValues = useSynchronizeActiveTabValues({ - queryEditor, - variableEditor, - headerEditor, - responseEditor - }); + $[0] = t0; + } else { + t0 = $[0]; + } const { - onTabChange, - defaultHeaders, - defaultQuery, - children - } = props; - const setEditorValues = useSetEditorValues({ - queryEditor, - variableEditor, - headerEditor, - responseEditor, - defaultHeaders - }); - const addTab = React.useCallback(() => { - setTabState(current => { - const updatedValues = synchronizeActiveTabValues(current); - const updated = { - tabs: [...updatedValues.tabs, createTab({ - headers: defaultHeaders, - query: defaultQuery !== null && defaultQuery !== void 0 ? defaultQuery : DEFAULT_QUERY - })], - activeTabIndex: updatedValues.tabs.length - }; - storeTabs(updated); - setEditorValues(updated.tabs[updated.activeTabIndex]); - onTabChange == null ? void 0 : onTabChange(updated); - return updated; + push + } = useExplorerContext(t0); + if (!props.type) { + return null; + } + let t1; + if ($[1] !== push) { + t1 = namedType => /* @__PURE__ */jsxRuntime.jsx("a", { + className: "graphiql-doc-explorer-type-name", + onClick: event => { + event.preventDefault(); + push({ + name: namedType.name, + def: namedType + }); + }, + href: "#", + children: namedType.name }); - }, [defaultHeaders, defaultQuery, onTabChange, setEditorValues, storeTabs, synchronizeActiveTabValues]); - const changeTab = React.useCallback(index => { - setTabState(current => { - const updated = { - ...current, - activeTabIndex: index - }; - storeTabs(updated); - setEditorValues(updated.tabs[updated.activeTabIndex]); - onTabChange == null ? void 0 : onTabChange(updated); - return updated; + $[1] = push; + $[2] = t1; + } else { + t1 = $[2]; + } + let t2; + if ($[3] !== props.type || $[4] !== t1) { + t2 = renderType(props.type, t1); + $[3] = props.type; + $[4] = t1; + $[5] = t2; + } else { + t2 = $[5]; + } + return t2; +} +function Argument(t0) { + const $ = reactCompilerRuntime.c(19); + const { + arg, + showDefaultValue, + inline + } = t0; + let t1; + if ($[0] !== arg.name) { + t1 = /* @__PURE__ */jsxRuntime.jsx("span", { + className: "graphiql-doc-explorer-argument-name", + children: arg.name }); - }, [onTabChange, setEditorValues, storeTabs]); - const moveTab = React.useCallback(newOrder => { - setTabState(current => { - const activeTab = current.tabs[current.activeTabIndex]; - const updated = { - tabs: newOrder, - activeTabIndex: newOrder.indexOf(activeTab) - }; - storeTabs(updated); - setEditorValues(updated.tabs[updated.activeTabIndex]); - onTabChange == null ? void 0 : onTabChange(updated); - return updated; + $[0] = arg.name; + $[1] = t1; + } else { + t1 = $[1]; + } + let t2; + if ($[2] !== arg.type) { + t2 = /* @__PURE__ */jsxRuntime.jsx(TypeLink, { + type: arg.type }); - }, [onTabChange, setEditorValues, storeTabs]); - const closeTab = React.useCallback(index => { - setTabState(current => { - const updated = { - tabs: current.tabs.filter((_tab, i) => index !== i), - activeTabIndex: Math.max(current.activeTabIndex - 1, 0) - }; - storeTabs(updated); - setEditorValues(updated.tabs[updated.activeTabIndex]); - onTabChange == null ? void 0 : onTabChange(updated); - return updated; + $[2] = arg.type; + $[3] = t2; + } else { + t2 = $[3]; + } + let t3; + if ($[4] !== arg || $[5] !== showDefaultValue) { + t3 = showDefaultValue !== false && /* @__PURE__ */jsxRuntime.jsx(DefaultValue, { + field: arg }); - }, [onTabChange, setEditorValues, storeTabs]); - const updateActiveTabValues = React.useCallback(partialTab => { - setTabState(current => { - const updated = setPropertiesInActiveTab(current, partialTab); - storeTabs(updated); - onTabChange == null ? void 0 : onTabChange(updated); - return updated; + $[4] = arg; + $[5] = showDefaultValue; + $[6] = t3; + } else { + t3 = $[6]; + } + let t4; + if ($[7] !== t1 || $[8] !== t2 || $[9] !== t3) { + t4 = /* @__PURE__ */jsxRuntime.jsxs("span", { + children: [t1, ": ", t2, t3] }); - }, [onTabChange, storeTabs]); - const { - onEditOperationName - } = props; - const setOperationName = React.useCallback(operationName => { - if (!queryEditor) { - return; - } - queryEditor.operationName = operationName; - updateActiveTabValues({ - operationName + $[7] = t1; + $[8] = t2; + $[9] = t3; + $[10] = t4; + } else { + t4 = $[10]; + } + const definition = t4; + if (inline) { + return definition; + } + let t5; + if ($[11] !== arg.description) { + t5 = arg.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { + type: "description", + children: arg.description + }) : null; + $[11] = arg.description; + $[12] = t5; + } else { + t5 = $[12]; + } + let t6; + if ($[13] !== arg.deprecationReason) { + t6 = arg.deprecationReason ? /* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-doc-explorer-argument-deprecation", + children: [/* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-argument-deprecation-label", + children: "Deprecated" + }), /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { + type: "deprecation", + children: arg.deprecationReason + })] + }) : null; + $[13] = arg.deprecationReason; + $[14] = t6; + } else { + t6 = $[14]; + } + let t7; + if ($[15] !== definition || $[16] !== t5 || $[17] !== t6) { + t7 = /* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-doc-explorer-argument", + children: [definition, t5, t6] }); - onEditOperationName == null ? void 0 : onEditOperationName(operationName); - }, [onEditOperationName, queryEditor, updateActiveTabValues]); - const externalFragments = React.useMemo(() => { - const map = /* @__PURE__ */new Map(); - if (Array.isArray(props.externalFragments)) { - for (const fragment of props.externalFragments) { - map.set(fragment.name.value, fragment); - } - } else if (typeof props.externalFragments === "string") { - graphql.visit(graphql.parse(props.externalFragments, {}), { - FragmentDefinition(fragment) { - map.set(fragment.name.value, fragment); - } - }); - } else if (props.externalFragments) { - throw new Error("The `externalFragments` prop must either be a string that contains the fragment definitions in SDL or a list of FragmentDefinitionNode objects."); - } - return map; - }, [props.externalFragments]); - const validationRules = React.useMemo(() => props.validationRules || [], [props.validationRules]); - const value = React.useMemo(() => ({ - ...tabState, - addTab, - changeTab, - moveTab, - closeTab, - updateActiveTabValues, - headerEditor, - queryEditor, - responseEditor, - variableEditor, - setHeaderEditor, - setQueryEditor, - setResponseEditor, - setVariableEditor, - setOperationName, - initialQuery: initialState.query, - initialVariables: initialState.variables, - initialHeaders: initialState.headers, - initialResponse: initialState.response, - externalFragments, - validationRules, - shouldPersistHeaders, - setShouldPersistHeaders - }), [tabState, addTab, changeTab, moveTab, closeTab, updateActiveTabValues, headerEditor, queryEditor, responseEditor, variableEditor, setOperationName, initialState, externalFragments, validationRules, shouldPersistHeaders, setShouldPersistHeaders]); - return /* @__PURE__ */jsxRuntime.jsx(EditorContext.Provider, { - value, - children - }); + $[15] = definition; + $[16] = t5; + $[17] = t6; + $[18] = t7; + } else { + t7 = $[18]; + } + return t7; } -const useEditorContext = createContextHook(EditorContext); -const PERSIST_HEADERS_STORAGE_KEY = "shouldPersistHeaders"; -const DEFAULT_QUERY = `# Welcome to GraphiQL -# -# GraphiQL is an in-browser tool for writing, validating, and -# testing GraphQL queries. -# -# Type queries into this side of the screen, and you will see intelligent -# typeaheads aware of the current GraphQL type schema and live syntax and -# validation errors highlighted within the text. -# -# GraphQL queries typically start with a "{" character. Lines that start -# with a # are ignored. -# -# An example GraphQL query might look like: -# -# { -# field(arg: "value") { -# subField -# } -# } -# -# Keyboard shortcuts: -# -# Prettify query: Shift-Ctrl-P (or press the prettify button) -# -# Merge fragments: Shift-Ctrl-M (or press the merge button) -# -# Run Query: Ctrl-Enter (or press the play button) -# -# Auto Complete: Ctrl-Space (or just start typing) -# - -`; -function HeaderEditor({ - isHidden, - ...hookArgs -}) { +function DeprecationReason(props) { + const $ = reactCompilerRuntime.c(3); + let t0; + if ($[0] !== props.children || $[1] !== props.preview) { + var _props$preview; + t0 = props.children ? /* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-doc-explorer-deprecation", + children: [/* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-deprecation-label", + children: "Deprecated" + }), /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { + type: "deprecation", + onlyShowFirstChild: (_props$preview = props.preview) !== null && _props$preview !== void 0 ? _props$preview : true, + children: props.children + })] + }) : null; + $[0] = props.children; + $[1] = props.preview; + $[2] = t0; + } else { + t0 = $[2]; + } + return t0; +} +function Directive(t0) { + const $ = reactCompilerRuntime.c(2); const { - headerEditor - } = useEditorContext({ - nonNull: true, - caller: HeaderEditor - }); - const ref = useHeaderEditor(hookArgs, HeaderEditor); - React.useEffect(() => { - if (!isHidden) { - headerEditor == null ? void 0 : headerEditor.refresh(); - } - }, [headerEditor, isHidden]); - return /* @__PURE__ */jsxRuntime.jsx("div", { - className: clsx.clsx("graphiql-editor", isHidden && "hidden"), - ref - }); + directive + } = t0; + let t1; + if ($[0] !== directive.name.value) { + t1 = /* @__PURE__ */jsxRuntime.jsxs("span", { + className: "graphiql-doc-explorer-directive", + children: ["@", directive.name.value] + }); + $[0] = directive.name.value; + $[1] = t1; + } else { + t1 = $[1]; + } + return t1; } -function ImagePreview(props) { - var _a; - const [dimensions, setDimensions] = React.useState({ - width: null, - height: null - }); - const [mime, setMime] = React.useState(null); - const ref = React.useRef(null); - const src = (_a = tokenToURL(props.token)) == null ? void 0 : _a.href; - React.useEffect(() => { - if (!ref.current) { - return; - } - if (!src) { - setDimensions({ - width: null, - height: null - }); - setMime(null); - return; - } - fetch(src, { - method: "HEAD" - }).then(response => { - setMime(response.headers.get("Content-Type")); - }).catch(() => { - setMime(null); +function ExplorerSection(props) { + const $ = reactCompilerRuntime.c(10); + const Icon2 = TYPE_TO_ICON[props.title]; + let t0; + if ($[0] !== Icon2) { + t0 = /* @__PURE__ */jsxRuntime.jsx(Icon2, {}); + $[0] = Icon2; + $[1] = t0; + } else { + t0 = $[1]; + } + let t1; + if ($[2] !== props.title || $[3] !== t0) { + t1 = /* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-doc-explorer-section-title", + children: [t0, props.title] }); - }, [src]); - const dims = dimensions.width !== null && dimensions.height !== null ? /* @__PURE__ */jsxRuntime.jsxs("div", { - children: [dimensions.width, "x", dimensions.height, mime === null ? null : " " + mime] - }) : null; - return /* @__PURE__ */jsxRuntime.jsxs("div", { - children: [/* @__PURE__ */jsxRuntime.jsx("img", { - onLoad: () => { - var _ref19, _ref20; - var _a2, _b; - setDimensions({ - width: (_ref19 = (_a2 = ref.current) == null ? void 0 : _a2.naturalWidth) !== null && _ref19 !== void 0 ? _ref19 : null, - height: (_ref20 = (_b = ref.current) == null ? void 0 : _b.naturalHeight) !== null && _ref20 !== void 0 ? _ref20 : null - }); - }, - ref, - src - }), dims] - }); + $[2] = props.title; + $[3] = t0; + $[4] = t1; + } else { + t1 = $[4]; + } + let t2; + if ($[5] !== props.children) { + t2 = /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-section-content", + children: props.children + }); + $[5] = props.children; + $[6] = t2; + } else { + t2 = $[6]; + } + let t3; + if ($[7] !== t1 || $[8] !== t2) { + t3 = /* @__PURE__ */jsxRuntime.jsxs("div", { + children: [t1, t2] + }); + $[7] = t1; + $[8] = t2; + $[9] = t3; + } else { + t3 = $[9]; + } + return t3; } -ImagePreview.shouldRender = function shouldRender(token) { - const url = tokenToURL(token); - return url ? isImageURL(url) : false; +const TYPE_TO_ICON = { + Arguments: ArgumentIcon, + "Deprecated Arguments": DeprecatedArgumentIcon, + "Deprecated Enum Values": DeprecatedEnumValueIcon, + "Deprecated Fields": DeprecatedFieldIcon, + Directives: DirectiveIcon, + "Enum Values": EnumValueIcon, + Fields: FieldIcon, + Implements: ImplementsIcon, + Implementations: TypeIcon, + "Possible Types": TypeIcon, + "Root Types": RootTypeIcon, + Type: TypeIcon, + "All Schema Types": TypeIcon }; -function tokenToURL(token) { - if (token.type !== "string") { - return; +function FieldDocumentation(props) { + const $ = reactCompilerRuntime.c(15); + let t0; + if ($[0] !== props.field.description) { + t0 = props.field.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { + type: "description", + children: props.field.description + }) : null; + $[0] = props.field.description; + $[1] = t0; + } else { + t0 = $[1]; } - const value = token.string.slice(1).slice(0, -1).trim(); - try { - const { - location - } = window; - return new URL(value, location.protocol + "//" + location.host); - } catch { - return; + let t1; + if ($[2] !== props.field.deprecationReason) { + t1 = /* @__PURE__ */jsxRuntime.jsx(DeprecationReason, { + preview: false, + children: props.field.deprecationReason + }); + $[2] = props.field.deprecationReason; + $[3] = t1; + } else { + t1 = $[3]; } + let t2; + if ($[4] !== props.field.type) { + t2 = /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: "Type", + children: /* @__PURE__ */jsxRuntime.jsx(TypeLink, { + type: props.field.type + }) + }); + $[4] = props.field.type; + $[5] = t2; + } else { + t2 = $[5]; + } + let t3; + let t4; + if ($[6] !== props.field) { + t3 = /* @__PURE__ */jsxRuntime.jsx(Arguments, { + field: props.field + }); + t4 = /* @__PURE__ */jsxRuntime.jsx(Directives, { + field: props.field + }); + $[6] = props.field; + $[7] = t3; + $[8] = t4; + } else { + t3 = $[7]; + t4 = $[8]; + } + let t5; + if ($[9] !== t0 || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 || $[13] !== t4) { + t5 = /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [t0, t1, t2, t3, t4] + }); + $[9] = t0; + $[10] = t1; + $[11] = t2; + $[12] = t3; + $[13] = t4; + $[14] = t5; + } else { + t5 = $[14]; + } + return t5; } -function isImageURL(url) { - return /\.(bmp|gif|jpe?g|png|svg|webp)$/.test(url.pathname); -} -function QueryEditor(props) { - const ref = useQueryEditor(props, QueryEditor); - return /* @__PURE__ */jsxRuntime.jsx("div", { - className: "graphiql-editor", - ref - }); -} -function useResponseEditor({ - responseTooltip, - editorTheme = DEFAULT_EDITOR_THEME, - keyMap = DEFAULT_KEY_MAP -} = {}, caller) { - const { - fetchError, - validationErrors - } = useSchemaContext({ - nonNull: true, - caller: caller || useResponseEditor - }); +function Arguments(t0) { + const $ = reactCompilerRuntime.c(12); const { - initialResponse, - responseEditor, - setResponseEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useResponseEditor - }); - const ref = React.useRef(null); - const responseTooltipRef = React.useRef(responseTooltip); - React.useEffect(() => { - responseTooltipRef.current = responseTooltip; - }, [responseTooltip]); - React.useEffect(() => { - let isActive = true; - void importCodeMirror([Promise.resolve().then(() => __webpack_require__(/*! ./foldgutter.cjs.js */ "../../graphiql-react/dist/foldgutter.cjs.js")).then(n => n.foldgutter), Promise.resolve().then(() => __webpack_require__(/*! ./brace-fold.cjs.js */ "../../graphiql-react/dist/brace-fold.cjs.js")).then(n => n.braceFold), Promise.resolve().then(() => __webpack_require__(/*! ./dialog.cjs.js */ "../../graphiql-react/dist/dialog.cjs.js")).then(n => n.dialog), Promise.resolve().then(() => __webpack_require__(/*! ./search.cjs.js */ "../../graphiql-react/dist/search.cjs.js")).then(n => n.search), Promise.resolve().then(() => __webpack_require__(/*! ./searchcursor.cjs.js */ "../../graphiql-react/dist/searchcursor.cjs.js")).then(n => n.searchcursor), Promise.resolve().then(() => __webpack_require__(/*! ./jump-to-line.cjs.js */ "../../graphiql-react/dist/jump-to-line.cjs.js")).then(n => n.jumpToLine), - // @ts-expect-error - Promise.resolve().then(() => __webpack_require__(/*! ./sublime.cjs.js */ "../../graphiql-react/dist/sublime.cjs.js")).then(n => n.sublime), Promise.resolve().then(() => __webpack_require__(/*! ./mode.cjs3.js */ "../../graphiql-react/dist/mode.cjs3.js")), Promise.resolve().then(() => __webpack_require__(/*! ./info-addon.cjs.js */ "../../graphiql-react/dist/info-addon.cjs.js"))], { - useCommonAddons: false - }).then(CodeMirror => { - if (!isActive) { - return; - } - const tooltipDiv = document.createElement("div"); - CodeMirror.registerHelper("info", "graphql-results", (token, _options, _cm, pos) => { - const infoElements = []; - const ResponseTooltipComponent = responseTooltipRef.current; - if (ResponseTooltipComponent) { - infoElements.push( /* @__PURE__ */jsxRuntime.jsx(ResponseTooltipComponent, { - pos, - token - })); - } - if (ImagePreview.shouldRender(token)) { - infoElements.push( /* @__PURE__ */jsxRuntime.jsx(ImagePreview, { - token - }, "image-preview")); - } - if (!infoElements.length) { - ReactDOM.unmountComponentAtNode(tooltipDiv); - return null; - } - ReactDOM.render(infoElements, tooltipDiv); - return tooltipDiv; - }); - const container = ref.current; - if (!container) { - return; - } - const newEditor = CodeMirror(container, { - value: initialResponse, - lineWrapping: true, - readOnly: true, - theme: editorTheme, - mode: "graphql-results", - foldGutter: true, - gutters: ["CodeMirror-foldgutter"], - // @ts-expect-error - info: true, - extraKeys: commonKeys - }); - setResponseEditor(newEditor); - }); - return () => { - isActive = false; + field + } = t0; + const [showDeprecated, setShowDeprecated] = React.useState(false); + let t1; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t1 = () => { + setShowDeprecated(true); }; - }, [editorTheme, initialResponse, setResponseEditor]); - useSynchronizeOption(responseEditor, "keyMap", keyMap); - React.useEffect(() => { - if (fetchError) { - responseEditor == null ? void 0 : responseEditor.setValue(fetchError); - } - if (validationErrors.length > 0) { - responseEditor == null ? void 0 : responseEditor.setValue(toolkit.formatError(validationErrors)); + $[0] = t1; + } else { + t1 = $[0]; + } + const handleShowDeprecated = t1; + if (!("args" in field)) { + return null; + } + let args; + let deprecatedArgs; + let t2; + if ($[1] !== field.args) { + args = []; + deprecatedArgs = []; + for (const argument of field.args) { + if (argument.deprecationReason) { + deprecatedArgs.push(argument); + } else { + args.push(argument); + } } - }, [responseEditor, fetchError, validationErrors]); - return ref; + t2 = args.length > 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: "Arguments", + children: args.map(_temp$5) + }) : null; + $[1] = field.args; + $[2] = args; + $[3] = deprecatedArgs; + $[4] = t2; + } else { + args = $[2]; + deprecatedArgs = $[3]; + t2 = $[4]; + } + let t3; + if ($[5] !== args.length || $[6] !== deprecatedArgs || $[7] !== showDeprecated) { + t3 = deprecatedArgs.length > 0 ? showDeprecated || args.length === 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: "Deprecated Arguments", + children: deprecatedArgs.map(_temp2$2) + }) : /* @__PURE__ */jsxRuntime.jsx(Button$1, { + type: "button", + onClick: handleShowDeprecated, + children: "Show Deprecated Arguments" + }) : null; + $[5] = args.length; + $[6] = deprecatedArgs; + $[7] = showDeprecated; + $[8] = t3; + } else { + t3 = $[8]; + } + let t4; + if ($[9] !== t2 || $[10] !== t3) { + t4 = /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [t2, t3] + }); + $[9] = t2; + $[10] = t3; + $[11] = t4; + } else { + t4 = $[11]; + } + return t4; } -function ResponseEditor(props) { - const ref = useResponseEditor(props, ResponseEditor); - return /* @__PURE__ */jsxRuntime.jsx("section", { - className: "result-window", - "aria-label": "Result Window", - "aria-live": "polite", - "aria-atomic": "true", - ref - }); +function _temp2$2(arg_0) { + return /* @__PURE__ */jsxRuntime.jsx(Argument, { + arg: arg_0 + }, arg_0.name); } -function VariableEditor({ - isHidden, - ...hookArgs -}) { +function _temp$5(arg) { + return /* @__PURE__ */jsxRuntime.jsx(Argument, { + arg + }, arg.name); +} +function Directives(t0) { + var _a, _b, _c; + const $ = reactCompilerRuntime.c(6); const { - variableEditor - } = useEditorContext({ - nonNull: true, - caller: VariableEditor - }); - const ref = useVariableEditor(hookArgs, VariableEditor); - React.useEffect(() => { - if (variableEditor && !isHidden) { - variableEditor.refresh(); - } - }, [variableEditor, isHidden]); - return /* @__PURE__ */jsxRuntime.jsx("div", { - className: clsx.clsx("graphiql-editor", isHidden && "hidden"), - ref - }); + field + } = t0; + let t1; + if ($[0] !== ((_a = field.astNode) == null ? void 0 : _a.directives)) { + t1 = ((_b = field.astNode) == null ? void 0 : _b.directives) || []; + $[0] = (_c = field.astNode) == null ? void 0 : _c.directives; + $[1] = t1; + } else { + t1 = $[1]; + } + const directives = t1; + if (!directives || directives.length === 0) { + return null; + } + let t2; + if ($[2] !== directives) { + t2 = directives.map(_temp3$2); + $[2] = directives; + $[3] = t2; + } else { + t2 = $[3]; + } + let t3; + if ($[4] !== t2) { + t3 = /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: "Directives", + children: t2 + }); + $[4] = t2; + $[5] = t3; + } else { + t3 = $[5]; + } + return t3; } -function GraphiQLProvider({ - children, - dangerouslyAssumeSchemaIsValid, - defaultQuery, - defaultHeaders, - defaultTabs, - externalFragments, - fetcher, - getDefaultFieldNames, - headers, - inputValueDeprecation, - introspectionQueryName, - maxHistoryLength, - onEditOperationName, - onSchemaChange, - onTabChange, - onTogglePluginVisibility, - operationName, - plugins, - query, - response, - schema, - schemaDescription, - shouldPersistHeaders, - storage, - validationRules, - variables, - visiblePlugin -}) { - return /* @__PURE__ */jsxRuntime.jsx(StorageContextProvider, { - storage, - children: /* @__PURE__ */jsxRuntime.jsx(HistoryContextProvider, { - maxHistoryLength, - children: /* @__PURE__ */jsxRuntime.jsx(EditorContextProvider, { - defaultQuery, - defaultHeaders, - defaultTabs, - externalFragments, - headers, - onEditOperationName, - onTabChange, - query, - response, - shouldPersistHeaders, - validationRules, - variables, - children: /* @__PURE__ */jsxRuntime.jsx(SchemaContextProvider, { - dangerouslyAssumeSchemaIsValid, - fetcher, - inputValueDeprecation, - introspectionQueryName, - onSchemaChange, - schema, - schemaDescription, - children: /* @__PURE__ */jsxRuntime.jsx(ExecutionContextProvider, { - getDefaultFieldNames, - fetcher, - operationName, - children: /* @__PURE__ */jsxRuntime.jsx(ExplorerContextProvider, { - children: /* @__PURE__ */jsxRuntime.jsx(PluginContextProvider, { - onTogglePluginVisibility, - plugins, - visiblePlugin, - children - }) - }) - }) - }) - }) +function _temp3$2(directive) { + return /* @__PURE__ */jsxRuntime.jsx("div", { + children: /* @__PURE__ */jsxRuntime.jsx(Directive, { + directive }) - }); -} -function useTheme(defaultTheme = null) { - const storageContext = useStorageContext(); - const [theme, setThemeInternal] = React.useState(() => { - if (!storageContext) { - return null; - } - const stored = storageContext.get(STORAGE_KEY); - switch (stored) { - case "light": - return "light"; - case "dark": - return "dark"; - default: - if (typeof stored === "string") { - storageContext.set(STORAGE_KEY, ""); - } - return defaultTheme; - } - }); - React.useLayoutEffect(() => { - if (typeof window === "undefined") { - return; - } - document.body.classList.remove("graphiql-light", "graphiql-dark"); - if (theme) { - document.body.classList.add(`graphiql-${theme}`); - } - }, [theme]); - const setTheme = React.useCallback(newTheme => { - storageContext == null ? void 0 : storageContext.set(STORAGE_KEY, newTheme || ""); - setThemeInternal(newTheme); - }, [storageContext]); - return React.useMemo(() => ({ - theme, - setTheme - }), [theme, setTheme]); + }, directive.name.value); } -const STORAGE_KEY = "theme"; -function useDragResize({ - defaultSizeRelation = DEFAULT_FLEX, - direction, - initiallyHidden, - onHiddenElementChange, - sizeThresholdFirst = 100, - sizeThresholdSecond = 100, - storageKey -}) { - const storage = useStorageContext(); - const store = React.useMemo(() => debounce(500, value => { - if (storageKey) { - storage == null ? void 0 : storage.set(storageKey, value); - } - }), [storage, storageKey]); - const [hiddenElement, setHiddenElement] = React.useState(() => { - const storedValue = storageKey && (storage == null ? void 0 : storage.get(storageKey)); - if (storedValue === HIDE_FIRST || initiallyHidden === "first") { - return "first"; - } - if (storedValue === HIDE_SECOND || initiallyHidden === "second") { - return "second"; - } - return null; - }); - const setHiddenElementWithCallback = React.useCallback(element => { - if (element !== hiddenElement) { - setHiddenElement(element); - onHiddenElementChange == null ? void 0 : onHiddenElementChange(element); - } - }, [hiddenElement, onHiddenElementChange]); - const firstRef = React.useRef(null); - const dragBarRef = React.useRef(null); - const secondRef = React.useRef(null); - const defaultFlexRef = React.useRef(`${defaultSizeRelation}`); - React.useLayoutEffect(() => { - const storedValue = storageKey && (storage == null ? void 0 : storage.get(storageKey)) || defaultFlexRef.current; - if (firstRef.current) { - firstRef.current.style.display = "flex"; - firstRef.current.style.flex = storedValue === HIDE_FIRST || storedValue === HIDE_SECOND ? defaultFlexRef.current : storedValue; - } - if (secondRef.current) { - secondRef.current.style.display = "flex"; - secondRef.current.style.flex = "1"; - } - if (dragBarRef.current) { - dragBarRef.current.style.display = "flex"; - } - }, [direction, storage, storageKey]); - const hide = React.useCallback(resizableElement => { - const element = resizableElement === "first" ? firstRef.current : secondRef.current; - if (!element) { - return; - } - element.style.left = "-1000px"; - element.style.position = "absolute"; - element.style.opacity = "0"; - element.style.height = "500px"; - element.style.width = "500px"; - if (firstRef.current) { - const flex = parseFloat(firstRef.current.style.flex); - if (!Number.isFinite(flex) || flex < 1) { - firstRef.current.style.flex = "1"; - } +function SchemaDocumentation(props) { + var _a, _b, _c, _d; + const $ = reactCompilerRuntime.c(39); + let t0; + if ($[0] !== props.schema) { + t0 = props.schema.getQueryType(); + $[0] = props.schema; + $[1] = t0; + } else { + t0 = $[1]; + } + const queryType = t0; + let t1; + if ($[2] !== props.schema) { + t1 = (_b = (_a = props.schema).getMutationType) == null ? void 0 : _b.call(_a); + $[2] = props.schema; + $[3] = t1; + } else { + t1 = $[3]; + } + const mutationType = t1; + let t2; + if ($[4] !== props.schema) { + t2 = (_d = (_c = props.schema).getSubscriptionType) == null ? void 0 : _d.call(_c); + $[4] = props.schema; + $[5] = t2; + } else { + t2 = $[5]; + } + const subscriptionType = t2; + let T0; + let t3; + let t4; + let t5; + let t6; + if ($[6] !== mutationType || $[7] !== props.schema || $[8] !== queryType || $[9] !== subscriptionType) { + const typeMap = props.schema.getTypeMap(); + const t72 = queryType == null ? void 0 : queryType.name; + const t82 = mutationType == null ? void 0 : mutationType.name; + const t9 = subscriptionType == null ? void 0 : subscriptionType.name; + let t10; + if ($[15] !== t72 || $[16] !== t82 || $[17] !== t9) { + t10 = [t72, t82, t9]; + $[15] = t72; + $[16] = t82; + $[17] = t9; + $[18] = t10; + } else { + t10 = $[18]; + } + const ignoreTypesInAllSchema = t10; + const t11 = props.schema.description || "A GraphQL schema provides a root type for each kind of operation."; + if ($[19] !== t11) { + t5 = /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { + type: "description", + children: t11 + }); + $[19] = t11; + $[20] = t5; + } else { + t5 = $[20]; } - }, []); - const show = React.useCallback(resizableElement => { - const element = resizableElement === "first" ? firstRef.current : secondRef.current; - if (!element) { - return; + let t12; + if ($[21] !== queryType) { + t12 = queryType ? /* @__PURE__ */jsxRuntime.jsxs("div", { + children: [/* @__PURE__ */jsxRuntime.jsx("span", { + className: "graphiql-doc-explorer-root-type", + children: "query" + }), ": ", /* @__PURE__ */jsxRuntime.jsx(TypeLink, { + type: queryType + })] + }) : null; + $[21] = queryType; + $[22] = t12; + } else { + t12 = $[22]; } - element.style.width = ""; - element.style.height = ""; - element.style.opacity = ""; - element.style.position = ""; - element.style.left = ""; - if (storage && storageKey) { - const storedValue = storage.get(storageKey); - if (firstRef.current && storedValue !== HIDE_FIRST && storedValue !== HIDE_SECOND) { - firstRef.current.style.flex = storedValue || defaultFlexRef.current; - } - } - }, [storage, storageKey]); - React.useLayoutEffect(() => { - if (hiddenElement === "first") { - hide("first"); + let t13; + if ($[23] !== mutationType) { + t13 = mutationType && /* @__PURE__ */jsxRuntime.jsxs("div", { + children: [/* @__PURE__ */jsxRuntime.jsx("span", { + className: "graphiql-doc-explorer-root-type", + children: "mutation" + }), ": ", /* @__PURE__ */jsxRuntime.jsx(TypeLink, { + type: mutationType + })] + }); + $[23] = mutationType; + $[24] = t13; } else { - show("first"); + t13 = $[24]; } - if (hiddenElement === "second") { - hide("second"); + let t14; + if ($[25] !== subscriptionType) { + t14 = subscriptionType && /* @__PURE__ */jsxRuntime.jsxs("div", { + children: [/* @__PURE__ */jsxRuntime.jsx("span", { + className: "graphiql-doc-explorer-root-type", + children: "subscription" + }), ": ", /* @__PURE__ */jsxRuntime.jsx(TypeLink, { + type: subscriptionType + })] + }); + $[25] = subscriptionType; + $[26] = t14; } else { - show("second"); + t14 = $[26]; } - }, [hiddenElement, hide, show]); - React.useEffect(() => { - if (!dragBarRef.current || !firstRef.current || !secondRef.current) { - return; + if ($[27] !== t12 || $[28] !== t13 || $[29] !== t14) { + t6 = /* @__PURE__ */jsxRuntime.jsxs(ExplorerSection, { + title: "Root Types", + children: [t12, t13, t14] + }); + $[27] = t12; + $[28] = t13; + $[29] = t14; + $[30] = t6; + } else { + t6 = $[30]; } - const dragBarContainer = dragBarRef.current; - const firstContainer = firstRef.current; - const wrapper = firstContainer.parentElement; - const eventProperty = direction === "horizontal" ? "clientX" : "clientY"; - const rectProperty = direction === "horizontal" ? "left" : "top"; - const adjacentRectProperty = direction === "horizontal" ? "right" : "bottom"; - const sizeProperty = direction === "horizontal" ? "clientWidth" : "clientHeight"; - function handleMouseDown(downEvent) { - downEvent.preventDefault(); - const offset = downEvent[eventProperty] - dragBarContainer.getBoundingClientRect()[rectProperty]; - function handleMouseMove(moveEvent) { - if (moveEvent.buttons === 0) { - return handleMouseUp(); - } - const firstSize = moveEvent[eventProperty] - wrapper.getBoundingClientRect()[rectProperty] - offset; - const secondSize = wrapper.getBoundingClientRect()[adjacentRectProperty] - moveEvent[eventProperty] + offset - dragBarContainer[sizeProperty]; - if (firstSize < sizeThresholdFirst) { - setHiddenElementWithCallback("first"); - store(HIDE_FIRST); - } else if (secondSize < sizeThresholdSecond) { - setHiddenElementWithCallback("second"); - store(HIDE_SECOND); - } else { - setHiddenElementWithCallback(null); - const newFlex = `${firstSize / secondSize}`; - firstContainer.style.flex = newFlex; - store(newFlex); + T0 = ExplorerSection; + t3 = "All Schema Types"; + t4 = typeMap && /* @__PURE__ */jsxRuntime.jsx("div", { + children: Object.values(typeMap).map(type => { + if (ignoreTypesInAllSchema.includes(type.name) || type.name.startsWith("__")) { + return null; } - } - function handleMouseUp() { - document.removeEventListener("mousemove", handleMouseMove); - document.removeEventListener("mouseup", handleMouseUp); - } - document.addEventListener("mousemove", handleMouseMove); - document.addEventListener("mouseup", handleMouseUp); - } - dragBarContainer.addEventListener("mousedown", handleMouseDown); - function reset() { - if (firstRef.current) { - firstRef.current.style.flex = defaultFlexRef.current; - } - store(defaultFlexRef.current); - setHiddenElementWithCallback(null); - } - dragBarContainer.addEventListener("dblclick", reset); - return () => { - dragBarContainer.removeEventListener("mousedown", handleMouseDown); - dragBarContainer.removeEventListener("dblclick", reset); - }; - }, [direction, setHiddenElementWithCallback, sizeThresholdFirst, sizeThresholdSecond, store]); - return React.useMemo(() => ({ - dragBarRef, - hiddenElement, - firstRef, - setHiddenElement, - secondRef - }), [hiddenElement, setHiddenElement]); + return /* @__PURE__ */jsxRuntime.jsx("div", { + children: /* @__PURE__ */jsxRuntime.jsx(TypeLink, { + type + }) + }, type.name); + }) + }); + $[6] = mutationType; + $[7] = props.schema; + $[8] = queryType; + $[9] = subscriptionType; + $[10] = T0; + $[11] = t3; + $[12] = t4; + $[13] = t5; + $[14] = t6; + } else { + T0 = $[10]; + t3 = $[11]; + t4 = $[12]; + t5 = $[13]; + t6 = $[14]; + } + let t7; + if ($[31] !== T0 || $[32] !== t3 || $[33] !== t4) { + t7 = /* @__PURE__ */jsxRuntime.jsx(T0, { + title: t3, + children: t4 + }); + $[31] = T0; + $[32] = t3; + $[33] = t4; + $[34] = t7; + } else { + t7 = $[34]; + } + let t8; + if ($[35] !== t5 || $[36] !== t6 || $[37] !== t7) { + t8 = /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [t5, t6, t7] + }); + $[35] = t5; + $[36] = t6; + $[37] = t7; + $[38] = t8; + } else { + t8 = $[38]; + } + return t8; } -const DEFAULT_FLEX = 1; -const HIDE_FIRST = "hide-first"; -const HIDE_SECOND = "hide-second"; -const ToolbarButton = React.forwardRef(({ - label, - onClick, - ...props -}, ref) => { - const [error, setError] = React.useState(null); - const handleClick = React.useCallback(event => { - try { - onClick == null ? void 0 : onClick(event); - setError(null); - } catch (err) { - setError(err instanceof Error ? err : new Error(`Toolbar button click failed: ${err}`)); +function debounce(duration, fn) { + let timeout; + return function (...args) { + if (timeout) { + window.clearTimeout(timeout); } - }, [onClick]); - return /* @__PURE__ */jsxRuntime.jsx(Tooltip, { - label, - children: /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { - ...props, - ref, - type: "button", - className: clsx.clsx("graphiql-toolbar-button", error && "error", props.className), - onClick: handleClick, - "aria-label": error ? error.message : label, - "aria-invalid": error ? "true" : props["aria-invalid"] - }) - }); -}); -ToolbarButton.displayName = "ToolbarButton"; -function ExecuteButton() { - const { - queryEditor, - setOperationName - } = useEditorContext({ - nonNull: true, - caller: ExecuteButton - }); + timeout = window.setTimeout(() => { + timeout = null; + fn(...args); + }, duration); + }; +} +function Search() { + "use no memo"; + const { - isFetching, - isSubscribed, - operationName, - run, - stop - } = useExecutionContext({ + explorerNavStack, + push + } = useExplorerContext({ nonNull: true, - caller: ExecuteButton + caller: Search }); - const operations = (queryEditor == null ? void 0 : queryEditor.operations) || []; - const hasOptions = operations.length > 1 && typeof operationName !== "string"; - const isRunning = isFetching || isSubscribed; - const label = `${isRunning ? "Stop" : "Execute"} query (Ctrl-Enter)`; - const buttonProps = { - type: "button", - className: "graphiql-execute-button", - children: isRunning ? /* @__PURE__ */jsxRuntime.jsx(StopIcon, {}) : /* @__PURE__ */jsxRuntime.jsx(PlayIcon, {}), - "aria-label": label - }; - return hasOptions && !isRunning ? /* @__PURE__ */jsxRuntime.jsxs(DropdownMenu, { - children: [/* @__PURE__ */jsxRuntime.jsx(Tooltip, { - label, - children: /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Button, { - ...buttonProps - }) - }), /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Content, { - children: operations.map((operation, i) => { - const opName = operation.name ? operation.name.value : ``; - return /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Item, { - onSelect: () => { - var _a; - const selectedOperationName = (_a = operation.name) == null ? void 0 : _a.value; - if (queryEditor && selectedOperationName && selectedOperationName !== queryEditor.operationName) { - setOperationName(selectedOperationName); - } - run(); - }, - children: opName - }, `${opName}-${i}`); - }) - })] - }) : /* @__PURE__ */jsxRuntime.jsx(Tooltip, { - label, - children: /* @__PURE__ */jsxRuntime.jsx("button", { - ...buttonProps, - onClick: () => { - if (isRunning) { - stop(); - } else { - run(); - } + const inputRef = React.useRef(null); + const getSearchResults = useSearchResults(); + const [searchValue, setSearchValue] = React.useState(""); + const [results, setResults] = React.useState(getSearchResults(searchValue)); + const debouncedGetSearchResults = React.useMemo(() => debounce(200, search => { + setResults(getSearchResults(search)); + }), [getSearchResults]); + React.useEffect(() => { + debouncedGetSearchResults(searchValue); + }, [debouncedGetSearchResults, searchValue]); + React.useEffect(() => { + function handleKeyDown(event) { + var _a; + if (event.metaKey && event.key === "k") { + (_a = inputRef.current) == null ? void 0 : _a.focus(); } - }) - }); -} -const ToolbarMenuRoot = ({ - button, - children, - label, - ...props -}) => /* @__PURE__ */jsxRuntime.jsxs(DropdownMenu, { - ...props, - children: [/* @__PURE__ */jsxRuntime.jsx(Tooltip, { - label, - children: /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Button, { - className: clsx.clsx("graphiql-un-styled graphiql-toolbar-menu", props.className), - "aria-label": label, - children: button - }) - }), /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Content, { - children - })] -}); -const ToolbarMenu = createComponentGroup(ToolbarMenuRoot, { - Item: DropdownMenu.Item -}); -exports.Argument = Argument; -exports.ArgumentIcon = ArgumentIcon; -exports.Button = Button$1; -exports.ButtonGroup = ButtonGroup; -exports.ChevronDownIcon = ChevronDownIcon; -exports.ChevronLeftIcon = ChevronLeftIcon; -exports.ChevronUpIcon = ChevronUpIcon; -exports.CloseIcon = CloseIcon; -exports.CopyIcon = CopyIcon; -exports.DOC_EXPLORER_PLUGIN = DOC_EXPLORER_PLUGIN; -exports.DefaultValue = DefaultValue; -exports.DeprecatedArgumentIcon = DeprecatedArgumentIcon; -exports.DeprecatedEnumValueIcon = DeprecatedEnumValueIcon; -exports.DeprecatedFieldIcon = DeprecatedFieldIcon; -exports.DeprecationReason = DeprecationReason; -exports.Dialog = Dialog; -exports.DialogRoot = DialogRoot; -exports.Directive = Directive; -exports.DirectiveIcon = DirectiveIcon; -exports.DocExplorer = DocExplorer; -exports.DocsFilledIcon = DocsFilledIcon; -exports.DocsIcon = DocsIcon; -exports.DropdownMenu = DropdownMenu; -exports.EditorContext = EditorContext; -exports.EditorContextProvider = EditorContextProvider; -exports.EnumValueIcon = EnumValueIcon; -exports.ExecuteButton = ExecuteButton; -exports.ExecutionContext = ExecutionContext; -exports.ExecutionContextProvider = ExecutionContextProvider; -exports.ExplorerContext = ExplorerContext; -exports.ExplorerContextProvider = ExplorerContextProvider; -exports.ExplorerSection = ExplorerSection; -exports.FieldDocumentation = FieldDocumentation; -exports.FieldIcon = FieldIcon; -exports.FieldLink = FieldLink; -exports.GraphiQLProvider = GraphiQLProvider; -exports.HISTORY_PLUGIN = HISTORY_PLUGIN; -exports.HeaderEditor = HeaderEditor; -exports.History = History; -exports.HistoryContext = HistoryContext; -exports.HistoryContextProvider = HistoryContextProvider; -exports.HistoryIcon = HistoryIcon; -exports.ImagePreview = ImagePreview; -exports.ImplementsIcon = ImplementsIcon; -exports.KeyboardShortcutIcon = KeyboardShortcutIcon; -exports.MagnifyingGlassIcon = MagnifyingGlassIcon; -exports.MarkdownContent = MarkdownContent; -exports.MergeIcon = MergeIcon; -exports.PenIcon = PenIcon; -exports.PlayIcon = PlayIcon; -exports.PluginContext = PluginContext; -exports.PluginContextProvider = PluginContextProvider; -exports.PlusIcon = PlusIcon; -exports.PrettifyIcon = PrettifyIcon; -exports.QueryEditor = QueryEditor; -exports.ReloadIcon = ReloadIcon; -exports.ResponseEditor = ResponseEditor; -exports.RootTypeIcon = RootTypeIcon; -exports.SchemaContext = SchemaContext; -exports.SchemaContextProvider = SchemaContextProvider; -exports.SchemaDocumentation = SchemaDocumentation; -exports.Search = Search; -exports.SettingsIcon = SettingsIcon; -exports.Spinner = Spinner; -exports.StarFilledIcon = StarFilledIcon; -exports.StarIcon = StarIcon; -exports.StopIcon = StopIcon; -exports.StorageContext = StorageContext; -exports.StorageContextProvider = StorageContextProvider; -exports.Tab = Tab; -exports.Tabs = Tabs; -exports.ToolbarButton = ToolbarButton; -exports.ToolbarMenu = ToolbarMenu; -exports.Tooltip = Tooltip; -exports.TooltipRoot = TooltipRoot; -exports.TrashIcon = TrashIcon; -exports.TypeDocumentation = TypeDocumentation; -exports.TypeIcon = TypeIcon; -exports.TypeLink = TypeLink; -exports.UnStyledButton = UnStyledButton; -exports.VariableEditor = VariableEditor; -exports.isMacOs = isMacOs; -exports.useAutoCompleteLeafs = useAutoCompleteLeafs; -exports.useCopyQuery = useCopyQuery; -exports.useDragResize = useDragResize; -exports.useEditorContext = useEditorContext; -exports.useEditorState = useEditorState; -exports.useExecutionContext = useExecutionContext; -exports.useExplorerContext = useExplorerContext; -exports.useHeaderEditor = useHeaderEditor; -exports.useHeadersEditorState = useHeadersEditorState; -exports.useHistoryContext = useHistoryContext; -exports.useMergeQuery = useMergeQuery; -exports.useOperationsEditorState = useOperationsEditorState; -exports.useOptimisticState = useOptimisticState; -exports.usePluginContext = usePluginContext; -exports.usePrettifyEditors = usePrettifyEditors; -exports.useQueryEditor = useQueryEditor; -exports.useResponseEditor = useResponseEditor; -exports.useSchemaContext = useSchemaContext; -exports.useStorageContext = useStorageContext; -exports.useTheme = useTheme; -exports.useVariableEditor = useVariableEditor; -exports.useVariablesEditorState = useVariablesEditorState; - -/***/ }), - -/***/ "../../graphiql-react/dist/info-addon.cjs.js": -/*!***************************************************!*\ - !*** ../../graphiql-react/dist/info-addon.cjs.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -codemirror.CodeMirror.defineOption("info", false, (cm, options, old) => { - if (old && old !== codemirror.CodeMirror.Init) { - const oldOnMouseOver = cm.state.info.onMouseOver; - codemirror.CodeMirror.off(cm.getWrapperElement(), "mouseover", oldOnMouseOver); - clearTimeout(cm.state.info.hoverTimeout); - delete cm.state.info; + } + window.addEventListener("keydown", handleKeyDown); + return () => window.removeEventListener("keydown", handleKeyDown); + }, []); + const navItem = explorerNavStack.at(-1); + const onSelect = React.useCallback(def => { + push("field" in def ? { + name: def.field.name, + def: def.field + } : { + name: def.type.name, + def: def.type + }); + }, [push]); + const isFocused = React.useRef(false); + const handleFocus = React.useCallback(e => { + isFocused.current = e.type === "focus"; + }, []); + const shouldSearchBoxAppear = explorerNavStack.length === 1 || graphql.isObjectType(navItem.def) || graphql.isInterfaceType(navItem.def) || graphql.isInputObjectType(navItem.def); + if (!shouldSearchBoxAppear) { + return null; + } + return /* @__PURE__ */jsxRuntime.jsxs(react.Combobox, { + as: "div", + className: "graphiql-doc-explorer-search", + onChange: onSelect, + "data-state": isFocused ? void 0 : "idle", + "aria-label": `Search ${navItem.name}...`, + children: [/* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-doc-explorer-search-input", + onClick: () => { + var _a; + (_a = inputRef.current) == null ? void 0 : _a.focus(); + }, + children: [/* @__PURE__ */jsxRuntime.jsx(MagnifyingGlassIcon, {}), /* @__PURE__ */jsxRuntime.jsx(react.Combobox.Input, { + autoComplete: "off", + onFocus: handleFocus, + onBlur: handleFocus, + onChange: event_0 => setSearchValue(event_0.target.value), + placeholder: `${isMacOs ? "⌘" : "Ctrl"} K`, + ref: inputRef, + value: searchValue, + "data-cy": "doc-explorer-input" + })] + }), isFocused.current && /* @__PURE__ */jsxRuntime.jsxs(react.Combobox.Options, { + "data-cy": "doc-explorer-list", + children: [results.within.length + results.types.length + results.fields.length === 0 ? /* @__PURE__ */jsxRuntime.jsx("li", { + className: "graphiql-doc-explorer-search-empty", + children: "No results found" + }) : results.within.map((result, i) => /* @__PURE__ */jsxRuntime.jsx(react.Combobox.Option, { + value: result, + "data-cy": "doc-explorer-option", + children: /* @__PURE__ */jsxRuntime.jsx(Field$1, { + field: result.field, + argument: result.argument + }) + }, `within-${i}`)), results.within.length > 0 && results.types.length + results.fields.length > 0 ? /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-search-divider", + children: "Other results" + }) : null, results.types.map((result_0, i_0) => /* @__PURE__ */jsxRuntime.jsx(react.Combobox.Option, { + value: result_0, + "data-cy": "doc-explorer-option", + children: /* @__PURE__ */jsxRuntime.jsx(Type, { + type: result_0.type + }) + }, `type-${i_0}`)), results.fields.map((result_1, i_1) => /* @__PURE__ */jsxRuntime.jsxs(react.Combobox.Option, { + value: result_1, + "data-cy": "doc-explorer-option", + children: [/* @__PURE__ */jsxRuntime.jsx(Type, { + type: result_1.type + }), ".", /* @__PURE__ */jsxRuntime.jsx(Field$1, { + field: result_1.field, + argument: result_1.argument + })] + }, `field-${i_1}`))] + })] + }); +} +const _useSearchResults = useSearchResults; +function useSearchResults(caller) { + const $ = reactCompilerRuntime.c(9); + const t0 = caller || _useSearchResults; + let t1; + if ($[0] !== t0) { + t1 = { + nonNull: true, + caller: t0 + }; + $[0] = t0; + $[1] = t1; + } else { + t1 = $[1]; } - if (options) { - const state = cm.state.info = createState(options); - state.onMouseOver = onMouseOver.bind(null, cm); - codemirror.CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); + const { + explorerNavStack + } = useExplorerContext(t1); + const t2 = caller || _useSearchResults; + let t3; + if ($[2] !== t2) { + t3 = { + nonNull: true, + caller: t2 + }; + $[2] = t2; + $[3] = t3; + } else { + t3 = $[3]; } -}); -function createState(options) { - return { - options: options instanceof Function ? { - render: options - } : options === true ? {} : options - }; -} -function getHoverTime(cm) { const { - options - } = cm.state.info; - return (options === null || options === void 0 ? void 0 : options.hoverTime) || 500; + schema + } = useSchemaContext(t3); + let t4; + if ($[4] !== explorerNavStack) { + t4 = explorerNavStack.at(-1); + $[4] = explorerNavStack; + $[5] = t4; + } else { + t4 = $[5]; + } + const navItem = t4; + let t5; + if ($[6] !== navItem || $[7] !== schema) { + t5 = searchValue => { + const matches = { + within: [], + types: [], + fields: [] + }; + if (!schema) { + return matches; + } + const withinType = navItem.def; + const typeMap = schema.getTypeMap(); + let typeNames = Object.keys(typeMap); + if (withinType) { + typeNames = typeNames.filter(n => n !== withinType.name); + typeNames.unshift(withinType.name); + } + for (const typeName of typeNames) { + if (matches.within.length + matches.types.length + matches.fields.length >= 100) { + break; + } + const type = typeMap[typeName]; + if (withinType !== type && isMatch(typeName, searchValue)) { + matches.types.push({ + type + }); + } + if (!graphql.isObjectType(type) && !graphql.isInterfaceType(type) && !graphql.isInputObjectType(type)) { + continue; + } + const fields = type.getFields(); + for (const fieldName in fields) { + const field = fields[fieldName]; + let matchingArgs; + if (!isMatch(fieldName, searchValue)) { + if ("args" in field) { + matchingArgs = field.args.filter(arg => isMatch(arg.name, searchValue)); + if (matchingArgs.length === 0) { + continue; + } + } else { + continue; + } + } + matches[withinType === type ? "within" : "fields"].push(...(matchingArgs ? matchingArgs.map(argument => ({ + type, + field, + argument + })) : [{ + type, + field + }])); + } + } + return matches; + }; + $[6] = navItem; + $[7] = schema; + $[8] = t5; + } else { + t5 = $[8]; + } + return t5; } -function onMouseOver(cm, e) { - const state = cm.state.info; - const target = e.target || e.srcElement; - if (!(target instanceof HTMLElement)) { - return; +function isMatch(sourceText, searchValue) { + try { + const escaped = searchValue.replaceAll(/[^_0-9A-Za-z]/g, ch => "\\" + ch); + return sourceText.search(new RegExp(escaped, "i")) !== -1; + } catch { + return sourceText.toLowerCase().includes(searchValue.toLowerCase()); } - if (target.nodeName !== "SPAN" || state.hoverTimeout !== void 0) { - return; +} +function Type(props) { + const $ = reactCompilerRuntime.c(2); + let t0; + if ($[0] !== props.type.name) { + t0 = /* @__PURE__ */jsxRuntime.jsx("span", { + className: "graphiql-doc-explorer-search-type", + children: props.type.name + }); + $[0] = props.type.name; + $[1] = t0; + } else { + t0 = $[1]; } - const box = target.getBoundingClientRect(); - const onMouseMove = function () { - clearTimeout(state.hoverTimeout); - state.hoverTimeout = setTimeout(onHover, hoverTime); - }; - const onMouseOut = function () { - codemirror.CodeMirror.off(document, "mousemove", onMouseMove); - codemirror.CodeMirror.off(cm.getWrapperElement(), "mouseout", onMouseOut); - clearTimeout(state.hoverTimeout); - state.hoverTimeout = void 0; - }; - const onHover = function () { - codemirror.CodeMirror.off(document, "mousemove", onMouseMove); - codemirror.CodeMirror.off(cm.getWrapperElement(), "mouseout", onMouseOut); - state.hoverTimeout = void 0; - onMouseHover(cm, box); - }; - const hoverTime = getHoverTime(cm); - state.hoverTimeout = setTimeout(onHover, hoverTime); - codemirror.CodeMirror.on(document, "mousemove", onMouseMove); - codemirror.CodeMirror.on(cm.getWrapperElement(), "mouseout", onMouseOut); + return t0; } -function onMouseHover(cm, box) { - const pos = cm.coordsChar({ - left: (box.left + box.right) / 2, - top: (box.top + box.bottom) / 2 - }, "window"); - const state = cm.state.info; +function Field$1(t0) { + const $ = reactCompilerRuntime.c(7); const { - options - } = state; - const render = options.render || cm.getHelper(pos, "info"); - if (render) { - const token = cm.getTokenAt(pos, true); - if (token) { - const info = render(token, options, cm, pos); - if (info) { - showPopup(cm, box, info); - } - } + field, + argument + } = t0; + let t1; + if ($[0] !== field.name) { + t1 = /* @__PURE__ */jsxRuntime.jsx("span", { + className: "graphiql-doc-explorer-search-field", + children: field.name + }); + $[0] = field.name; + $[1] = t1; + } else { + t1 = $[1]; + } + let t2; + if ($[2] !== argument) { + t2 = argument ? /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: ["(", /* @__PURE__ */jsxRuntime.jsx("span", { + className: "graphiql-doc-explorer-search-argument", + children: argument.name + }), ":", " ", renderType(argument.type, _temp$4), ")"] + }) : null; + $[2] = argument; + $[3] = t2; + } else { + t2 = $[3]; + } + let t3; + if ($[4] !== t1 || $[5] !== t2) { + t3 = /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [t1, t2] + }); + $[4] = t1; + $[5] = t2; + $[6] = t3; + } else { + t3 = $[6]; } + return t3; } -function showPopup(cm, box, info) { - const popup = document.createElement("div"); - popup.className = "CodeMirror-info"; - popup.append(info); - document.body.append(popup); - const popupBox = popup.getBoundingClientRect(); - const popupStyle = window.getComputedStyle(popup); - const popupWidth = popupBox.right - popupBox.left + parseFloat(popupStyle.marginLeft) + parseFloat(popupStyle.marginRight); - const popupHeight = popupBox.bottom - popupBox.top + parseFloat(popupStyle.marginTop) + parseFloat(popupStyle.marginBottom); - let topPos = box.bottom; - if (popupHeight > window.innerHeight - box.bottom - 15 && box.top > window.innerHeight - box.bottom) { - topPos = box.top - popupHeight; +function _temp$4(namedType) { + return /* @__PURE__ */jsxRuntime.jsx(Type, { + type: namedType + }); +} +function FieldLink(props) { + const $ = reactCompilerRuntime.c(7); + let t0; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t0 = { + nonNull: true + }; + $[0] = t0; + } else { + t0 = $[0]; } - if (topPos < 0) { - topPos = box.bottom; + const { + push + } = useExplorerContext(t0); + let t1; + if ($[1] !== props.field || $[2] !== push) { + t1 = event => { + event.preventDefault(); + push({ + name: props.field.name, + def: props.field + }); + }; + $[1] = props.field; + $[2] = push; + $[3] = t1; + } else { + t1 = $[3]; + } + let t2; + if ($[4] !== props.field.name || $[5] !== t1) { + t2 = /* @__PURE__ */jsxRuntime.jsx("a", { + className: "graphiql-doc-explorer-field-name", + onClick: t1, + href: "#", + children: props.field.name + }); + $[4] = props.field.name; + $[5] = t1; + $[6] = t2; + } else { + t2 = $[6]; } - let leftPos = Math.max(0, window.innerWidth - popupWidth - 15); - if (leftPos > box.left) { - leftPos = box.left; + return t2; +} +function TypeDocumentation(props) { + const $ = reactCompilerRuntime.c(2); + let t0; + if ($[0] !== props.type) { + t0 = graphql.isNamedType(props.type) ? /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [props.type.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { + type: "description", + children: props.type.description + }) : null, /* @__PURE__ */jsxRuntime.jsx(ImplementsInterfaces, { + type: props.type + }), /* @__PURE__ */jsxRuntime.jsx(Fields, { + type: props.type + }), /* @__PURE__ */jsxRuntime.jsx(EnumValues, { + type: props.type + }), /* @__PURE__ */jsxRuntime.jsx(PossibleTypes, { + type: props.type + })] + }) : null; + $[0] = props.type; + $[1] = t0; + } else { + t0 = $[1]; } - popup.style.opacity = "1"; - popup.style.top = topPos + "px"; - popup.style.left = leftPos + "px"; - let popupTimeout; - const onMouseOverPopup = function () { - clearTimeout(popupTimeout); - }; - const onMouseOut = function () { - clearTimeout(popupTimeout); - popupTimeout = setTimeout(hidePopup, 200); - }; - const hidePopup = function () { - codemirror.CodeMirror.off(popup, "mouseover", onMouseOverPopup); - codemirror.CodeMirror.off(popup, "mouseout", onMouseOut); - codemirror.CodeMirror.off(cm.getWrapperElement(), "mouseout", onMouseOut); - if (popup.style.opacity) { - popup.style.opacity = "0"; - setTimeout(() => { - if (popup.parentNode) { - popup.remove(); - } - }, 600); - } else if (popup.parentNode) { - popup.remove(); - } - }; - codemirror.CodeMirror.on(popup, "mouseover", onMouseOverPopup); - codemirror.CodeMirror.on(popup, "mouseout", onMouseOut); - codemirror.CodeMirror.on(cm.getWrapperElement(), "mouseout", onMouseOut); + return t0; } - -/***/ }), - -/***/ "../../graphiql-react/dist/info.cjs.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/info.cjs.js ***! - \*********************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { - - - -const graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -const SchemaReference = __webpack_require__(/*! ./SchemaReference.cjs.js */ "../../graphiql-react/dist/SchemaReference.cjs.js"); -__webpack_require__(/*! ./info-addon.cjs.js */ "../../graphiql-react/dist/info-addon.cjs.js"); -codemirror.CodeMirror.registerHelper("info", "graphql", (token, options) => { - var _a; - if (!options.schema || !token.state) { - return; +function ImplementsInterfaces(t0) { + const $ = reactCompilerRuntime.c(5); + const { + type + } = t0; + if (!graphql.isObjectType(type)) { + return null; } + let t1; + if ($[0] !== type) { + t1 = type.getInterfaces(); + $[0] = type; + $[1] = t1; + } else { + t1 = $[1]; + } + const interfaces = t1; + let t2; + if ($[2] !== interfaces.length || $[3] !== type) { + t2 = interfaces.length > 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: "Implements", + children: type.getInterfaces().map(_temp$3) + }) : null; + $[2] = interfaces.length; + $[3] = type; + $[4] = t2; + } else { + t2 = $[4]; + } + return t2; +} +function _temp$3(implementedInterface) { + return /* @__PURE__ */jsxRuntime.jsx("div", { + children: /* @__PURE__ */jsxRuntime.jsx(TypeLink, { + type: implementedInterface + }) + }, implementedInterface.name); +} +function Fields(t0) { + const $ = reactCompilerRuntime.c(12); const { - kind, - step - } = token.state; - const typeInfo = SchemaReference.getTypeInfo(options.schema, token.state); - if (kind === "Field" && step === 0 && typeInfo.fieldDef || kind === "AliasedField" && step === 2 && typeInfo.fieldDef || kind === "ObjectField" && step === 0 && typeInfo.fieldDef) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderField(header, typeInfo, options); - const into = document.createElement("div"); - into.append(header); - renderDescription(into, options, typeInfo.fieldDef); - return into; + type + } = t0; + const [showDeprecated, setShowDeprecated] = React.useState(false); + let t1; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t1 = () => { + setShowDeprecated(true); + }; + $[0] = t1; + } else { + t1 = $[0]; } - if (kind === "Directive" && step === 1 && typeInfo.directiveDef) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderDirective(header, typeInfo, options); - const into = document.createElement("div"); - into.append(header); - renderDescription(into, options, typeInfo.directiveDef); - return into; + const handleShowDeprecated = t1; + if (!graphql.isObjectType(type) && !graphql.isInterfaceType(type) && !graphql.isInputObjectType(type)) { + return null; } - if (kind === "Argument" && step === 0 && typeInfo.argDef) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderArg(header, typeInfo, options); - const into = document.createElement("div"); - into.append(header); - renderDescription(into, options, typeInfo.argDef); - return into; + let deprecatedFields; + let fields; + let t2; + if ($[1] !== type) { + const fieldMap = type.getFields(); + fields = []; + deprecatedFields = []; + for (const field of Object.keys(fieldMap).map(name => fieldMap[name])) { + if (field.deprecationReason) { + deprecatedFields.push(field); + } else { + fields.push(field); + } + } + t2 = fields.length > 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: "Fields", + children: fields.map(_temp2$1) + }) : null; + $[1] = type; + $[2] = deprecatedFields; + $[3] = fields; + $[4] = t2; + } else { + deprecatedFields = $[2]; + fields = $[3]; + t2 = $[4]; } - if (kind === "EnumValue" && ((_a = typeInfo.enumValue) === null || _a === void 0 ? void 0 : _a.description)) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderEnumValue(header, typeInfo, options); - const into = document.createElement("div"); - into.append(header); - renderDescription(into, options, typeInfo.enumValue); - return into; + let t3; + if ($[5] !== deprecatedFields || $[6] !== fields.length || $[7] !== showDeprecated) { + t3 = deprecatedFields.length > 0 ? showDeprecated || fields.length === 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: "Deprecated Fields", + children: deprecatedFields.map(_temp3$1) + }) : /* @__PURE__ */jsxRuntime.jsx(Button$1, { + type: "button", + onClick: handleShowDeprecated, + children: "Show Deprecated Fields" + }) : null; + $[5] = deprecatedFields; + $[6] = fields.length; + $[7] = showDeprecated; + $[8] = t3; + } else { + t3 = $[8]; } - if (kind === "NamedType" && typeInfo.type && typeInfo.type.description) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderType(header, typeInfo, options, typeInfo.type); - const into = document.createElement("div"); - into.append(header); - renderDescription(into, options, typeInfo.type); - return into; + let t4; + if ($[9] !== t2 || $[10] !== t3) { + t4 = /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [t2, t3] + }); + $[9] = t2; + $[10] = t3; + $[11] = t4; + } else { + t4 = $[11]; } -}); -function renderField(into, typeInfo, options) { - renderQualifiedField(into, typeInfo, options); - renderTypeAnnotation(into, typeInfo, options, typeInfo.type); + return t4; } -function renderQualifiedField(into, typeInfo, options) { - var _a; - const fieldName = ((_a = typeInfo.fieldDef) === null || _a === void 0 ? void 0 : _a.name) || ""; - text(into, fieldName, "field-name", options, SchemaReference.getFieldReference(typeInfo)); +function _temp3$1(field_1) { + return /* @__PURE__ */jsxRuntime.jsx(Field, { + field: field_1 + }, field_1.name); } -function renderDirective(into, typeInfo, options) { - var _a; - const name = "@" + (((_a = typeInfo.directiveDef) === null || _a === void 0 ? void 0 : _a.name) || ""); - text(into, name, "directive-name", options, SchemaReference.getDirectiveReference(typeInfo)); +function _temp2$1(field_0) { + return /* @__PURE__ */jsxRuntime.jsx(Field, { + field: field_0 + }, field_0.name); } -function renderArg(into, typeInfo, options) { - var _a; - const name = ((_a = typeInfo.argDef) === null || _a === void 0 ? void 0 : _a.name) || ""; - text(into, name, "arg-name", options, SchemaReference.getArgumentReference(typeInfo)); - renderTypeAnnotation(into, typeInfo, options, typeInfo.inputType); +function Field(t0) { + const $ = reactCompilerRuntime.c(22); + const { + field + } = t0; + let t1; + let t2; + let t3; + if ($[0] !== field) { + const args = "args" in field ? field.args.filter(_temp4$1) : []; + t3 = "graphiql-doc-explorer-item"; + t1 = /* @__PURE__ */jsxRuntime.jsx(FieldLink, { + field + }); + t2 = args.length > 0 ? /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: ["(", /* @__PURE__ */jsxRuntime.jsx("span", { + children: args.map(arg_0 => args.length === 1 ? /* @__PURE__ */jsxRuntime.jsx(Argument, { + arg: arg_0, + inline: true + }, arg_0.name) : /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-argument-multiple", + children: /* @__PURE__ */jsxRuntime.jsx(Argument, { + arg: arg_0, + inline: true + }) + }, arg_0.name)) + }), ")"] + }) : null; + $[0] = field; + $[1] = t1; + $[2] = t2; + $[3] = t3; + } else { + t1 = $[1]; + t2 = $[2]; + t3 = $[3]; + } + let t4; + if ($[4] !== field.type) { + t4 = /* @__PURE__ */jsxRuntime.jsx(TypeLink, { + type: field.type + }); + $[4] = field.type; + $[5] = t4; + } else { + t4 = $[5]; + } + let t5; + if ($[6] !== field) { + t5 = /* @__PURE__ */jsxRuntime.jsx(DefaultValue, { + field + }); + $[6] = field; + $[7] = t5; + } else { + t5 = $[7]; + } + let t6; + if ($[8] !== t1 || $[9] !== t2 || $[10] !== t4 || $[11] !== t5) { + t6 = /* @__PURE__ */jsxRuntime.jsxs("div", { + children: [t1, t2, ": ", t4, t5] + }); + $[8] = t1; + $[9] = t2; + $[10] = t4; + $[11] = t5; + $[12] = t6; + } else { + t6 = $[12]; + } + let t7; + if ($[13] !== field.description) { + t7 = field.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { + type: "description", + onlyShowFirstChild: true, + children: field.description + }) : null; + $[13] = field.description; + $[14] = t7; + } else { + t7 = $[14]; + } + let t8; + if ($[15] !== field.deprecationReason) { + t8 = /* @__PURE__ */jsxRuntime.jsx(DeprecationReason, { + children: field.deprecationReason + }); + $[15] = field.deprecationReason; + $[16] = t8; + } else { + t8 = $[16]; + } + let t9; + if ($[17] !== t3 || $[18] !== t6 || $[19] !== t7 || $[20] !== t8) { + t9 = /* @__PURE__ */jsxRuntime.jsxs("div", { + className: t3, + children: [t6, t7, t8] + }); + $[17] = t3; + $[18] = t6; + $[19] = t7; + $[20] = t8; + $[21] = t9; + } else { + t9 = $[21]; + } + return t9; } -function renderEnumValue(into, typeInfo, options) { - var _a; - const name = ((_a = typeInfo.enumValue) === null || _a === void 0 ? void 0 : _a.name) || ""; - renderType(into, typeInfo, options, typeInfo.inputType); - text(into, "."); - text(into, name, "enum-value", options, SchemaReference.getEnumValueReference(typeInfo)); +function _temp4$1(arg) { + return !arg.deprecationReason; } -function renderTypeAnnotation(into, typeInfo, options, t) { - const typeSpan = document.createElement("span"); - typeSpan.className = "type-name-pill"; - if (t instanceof graphql.GraphQLNonNull) { - renderType(typeSpan, typeInfo, options, t.ofType); - text(typeSpan, "!"); - } else if (t instanceof graphql.GraphQLList) { - text(typeSpan, "["); - renderType(typeSpan, typeInfo, options, t.ofType); - text(typeSpan, "]"); +function EnumValues(t0) { + const $ = reactCompilerRuntime.c(12); + const { + type + } = t0; + const [showDeprecated, setShowDeprecated] = React.useState(false); + let t1; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t1 = () => { + setShowDeprecated(true); + }; + $[0] = t1; } else { - text(typeSpan, (t === null || t === void 0 ? void 0 : t.name) || "", "type-name", options, SchemaReference.getTypeReference(typeInfo, t)); + t1 = $[0]; } - into.append(typeSpan); + const handleShowDeprecated = t1; + if (!graphql.isEnumType(type)) { + return null; + } + let deprecatedValues; + let t2; + let values; + if ($[1] !== type) { + values = []; + deprecatedValues = []; + for (const value of type.getValues()) { + if (value.deprecationReason) { + deprecatedValues.push(value); + } else { + values.push(value); + } + } + t2 = values.length > 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: "Enum Values", + children: values.map(_temp5) + }) : null; + $[1] = type; + $[2] = deprecatedValues; + $[3] = t2; + $[4] = values; + } else { + deprecatedValues = $[2]; + t2 = $[3]; + values = $[4]; + } + let t3; + if ($[5] !== deprecatedValues || $[6] !== showDeprecated || $[7] !== values.length) { + t3 = deprecatedValues.length > 0 ? showDeprecated || values.length === 0 ? /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: "Deprecated Enum Values", + children: deprecatedValues.map(_temp6) + }) : /* @__PURE__ */jsxRuntime.jsx(Button$1, { + type: "button", + onClick: handleShowDeprecated, + children: "Show Deprecated Values" + }) : null; + $[5] = deprecatedValues; + $[6] = showDeprecated; + $[7] = values.length; + $[8] = t3; + } else { + t3 = $[8]; + } + let t4; + if ($[9] !== t2 || $[10] !== t3) { + t4 = /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, { + children: [t2, t3] + }); + $[9] = t2; + $[10] = t3; + $[11] = t4; + } else { + t4 = $[11]; + } + return t4; } -function renderType(into, typeInfo, options, t) { - if (t instanceof graphql.GraphQLNonNull) { - renderType(into, typeInfo, options, t.ofType); - text(into, "!"); - } else if (t instanceof graphql.GraphQLList) { - text(into, "["); - renderType(into, typeInfo, options, t.ofType); - text(into, "]"); +function _temp6(value_1) { + return /* @__PURE__ */jsxRuntime.jsx(EnumValue, { + value: value_1 + }, value_1.name); +} +function _temp5(value_0) { + return /* @__PURE__ */jsxRuntime.jsx(EnumValue, { + value: value_0 + }, value_0.name); +} +function EnumValue(t0) { + const $ = reactCompilerRuntime.c(10); + const { + value + } = t0; + let t1; + if ($[0] !== value.name) { + t1 = /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-enum-value", + children: value.name + }); + $[0] = value.name; + $[1] = t1; + } else { + t1 = $[1]; + } + let t2; + if ($[2] !== value.description) { + t2 = value.description ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { + type: "description", + children: value.description + }) : null; + $[2] = value.description; + $[3] = t2; + } else { + t2 = $[3]; + } + let t3; + if ($[4] !== value.deprecationReason) { + t3 = value.deprecationReason ? /* @__PURE__ */jsxRuntime.jsx(MarkdownContent, { + type: "deprecation", + children: value.deprecationReason + }) : null; + $[4] = value.deprecationReason; + $[5] = t3; + } else { + t3 = $[5]; + } + let t4; + if ($[6] !== t1 || $[7] !== t2 || $[8] !== t3) { + t4 = /* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-doc-explorer-item", + children: [t1, t2, t3] + }); + $[6] = t1; + $[7] = t2; + $[8] = t3; + $[9] = t4; } else { - text(into, (t === null || t === void 0 ? void 0 : t.name) || "", "type-name", options, SchemaReference.getTypeReference(typeInfo, t)); + t4 = $[9]; } + return t4; } -function renderDescription(into, options, def) { +function PossibleTypes(t0) { + const $ = reactCompilerRuntime.c(7); const { - description - } = def; - if (description) { - const descriptionDiv = document.createElement("div"); - descriptionDiv.className = "info-description"; - if (options.renderDescription) { - descriptionDiv.innerHTML = options.renderDescription(description); + type + } = t0; + let t1; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t1 = { + nonNull: true + }; + $[0] = t1; + } else { + t1 = $[0]; + } + const { + schema + } = useSchemaContext(t1); + if (!schema || !graphql.isAbstractType(type)) { + return null; + } + const t2 = graphql.isInterfaceType(type) ? "Implementations" : "Possible Types"; + let t3; + if ($[1] !== schema || $[2] !== type) { + t3 = schema.getPossibleTypes(type).map(_temp7); + $[1] = schema; + $[2] = type; + $[3] = t3; + } else { + t3 = $[3]; + } + let t4; + if ($[4] !== t2 || $[5] !== t3) { + t4 = /* @__PURE__ */jsxRuntime.jsx(ExplorerSection, { + title: t2, + children: t3 + }); + $[4] = t2; + $[5] = t3; + $[6] = t4; + } else { + t4 = $[6]; + } + return t4; +} +function _temp7(possibleType) { + return /* @__PURE__ */jsxRuntime.jsx("div", { + children: /* @__PURE__ */jsxRuntime.jsx(TypeLink, { + type: possibleType + }) + }, possibleType.name); +} +function DocExplorer() { + const $ = reactCompilerRuntime.c(40); + let t0; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t0 = { + nonNull: true, + caller: DocExplorer + }; + $[0] = t0; + } else { + t0 = $[0]; + } + const { + fetchError, + isFetching, + schema, + validationErrors + } = useSchemaContext(t0); + let t1; + if ($[1] === Symbol.for("react.memo_cache_sentinel")) { + t1 = { + nonNull: true, + caller: DocExplorer + }; + $[1] = t1; + } else { + t1 = $[1]; + } + const { + explorerNavStack, + pop + } = useExplorerContext(t1); + let content; + let navItem; + if ($[2] !== explorerNavStack || $[3] !== fetchError || $[4] !== isFetching || $[5] !== schema || $[6] !== validationErrors) { + navItem = explorerNavStack.at(-1); + content = null; + if (fetchError) { + let t22; + if ($[9] === Symbol.for("react.memo_cache_sentinel")) { + t22 = /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-error", + children: "Error fetching schema" + }); + $[9] = t22; + } else { + t22 = $[9]; + } + content = t22; } else { - descriptionDiv.append(document.createTextNode(description)); + if (validationErrors.length > 0) { + const t22 = validationErrors[0]; + let t32; + if ($[10] !== t22.message) { + t32 = /* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-doc-explorer-error", + children: ["Schema is invalid: ", t22.message] + }); + $[10] = t22.message; + $[11] = t32; + } else { + t32 = $[11]; + } + content = t32; + } else { + if (isFetching) { + let t22; + if ($[12] === Symbol.for("react.memo_cache_sentinel")) { + t22 = /* @__PURE__ */jsxRuntime.jsx(Spinner, {}); + $[12] = t22; + } else { + t22 = $[12]; + } + content = t22; + } else { + if (!schema) { + let t22; + if ($[13] === Symbol.for("react.memo_cache_sentinel")) { + t22 = /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-error", + children: "No GraphQL schema available" + }); + $[13] = t22; + } else { + t22 = $[13]; + } + content = t22; + } else { + if (explorerNavStack.length === 1) { + let t22; + if ($[14] !== schema) { + t22 = /* @__PURE__ */jsxRuntime.jsx(SchemaDocumentation, { + schema + }); + $[14] = schema; + $[15] = t22; + } else { + t22 = $[15]; + } + content = t22; + } else { + if (graphql.isType(navItem.def)) { + let t22; + if ($[16] !== navItem.def) { + t22 = /* @__PURE__ */jsxRuntime.jsx(TypeDocumentation, { + type: navItem.def + }); + $[16] = navItem.def; + $[17] = t22; + } else { + t22 = $[17]; + } + content = t22; + } else { + if (navItem.def) { + let t22; + if ($[18] !== navItem.def) { + t22 = /* @__PURE__ */jsxRuntime.jsx(FieldDocumentation, { + field: navItem.def + }); + $[18] = navItem.def; + $[19] = t22; + } else { + t22 = $[19]; + } + content = t22; + } + } + } + } + } + } } - into.append(descriptionDiv); + $[2] = explorerNavStack; + $[3] = fetchError; + $[4] = isFetching; + $[5] = schema; + $[6] = validationErrors; + $[7] = content; + $[8] = navItem; + } else { + content = $[7]; + navItem = $[8]; } - renderDeprecation(into, options, def); -} -function renderDeprecation(into, options, def) { - const reason = def.deprecationReason; - if (reason) { - const deprecationDiv = document.createElement("div"); - deprecationDiv.className = "info-deprecation"; - into.append(deprecationDiv); - const label = document.createElement("span"); - label.className = "info-deprecation-label"; - label.append(document.createTextNode("Deprecated")); - deprecationDiv.append(label); - const reasonDiv = document.createElement("div"); - reasonDiv.className = "info-deprecation-reason"; - if (options.renderDescription) { - reasonDiv.innerHTML = options.renderDescription(reason); + let prevName; + if (explorerNavStack.length > 1) { + let t22; + if ($[20] !== explorerNavStack) { + t22 = explorerNavStack.at(-2); + $[20] = explorerNavStack; + $[21] = t22; } else { - reasonDiv.append(document.createTextNode(reason)); + t22 = $[21]; } - deprecationDiv.append(reasonDiv); + prevName = t22.name; + } + let t2; + if ($[22] !== pop || $[23] !== prevName) { + t2 = prevName && /* @__PURE__ */jsxRuntime.jsxs("a", { + href: "#", + className: "graphiql-doc-explorer-back", + onClick: event => { + event.preventDefault(); + pop(); + }, + "aria-label": `Go back to ${prevName}`, + children: [/* @__PURE__ */jsxRuntime.jsx(ChevronLeftIcon, {}), prevName] + }); + $[22] = pop; + $[23] = prevName; + $[24] = t2; + } else { + t2 = $[24]; + } + let t3; + if ($[25] !== navItem.name) { + t3 = /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-title", + children: navItem.name + }); + $[25] = navItem.name; + $[26] = t3; + } else { + t3 = $[26]; + } + let t4; + if ($[27] !== t2 || $[28] !== t3) { + t4 = /* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-doc-explorer-header-content", + children: [t2, t3] + }); + $[27] = t2; + $[28] = t3; + $[29] = t4; + } else { + t4 = $[29]; + } + let t5; + if ($[30] !== navItem.name) { + t5 = /* @__PURE__ */jsxRuntime.jsx(Search, {}, navItem.name); + $[30] = navItem.name; + $[31] = t5; + } else { + t5 = $[31]; + } + let t6; + if ($[32] !== t4 || $[33] !== t5) { + t6 = /* @__PURE__ */jsxRuntime.jsxs("div", { + className: "graphiql-doc-explorer-header", + children: [t4, t5] + }); + $[32] = t4; + $[33] = t5; + $[34] = t6; + } else { + t6 = $[34]; + } + let t7; + if ($[35] !== content) { + t7 = /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-doc-explorer-content", + children: content + }); + $[35] = content; + $[36] = t7; + } else { + t7 = $[36]; + } + let t8; + if ($[37] !== t6 || $[38] !== t7) { + t8 = /* @__PURE__ */jsxRuntime.jsxs("section", { + className: "graphiql-doc-explorer", + "aria-label": "Documentation Explorer", + children: [t6, t7] + }); + $[37] = t6; + $[38] = t7; + $[39] = t8; + } else { + t8 = $[39]; } + return t8; } -function text(into, content, className = "", options = { - onClick: null -}, ref = null) { - if (className) { - const { - onClick - } = options; - let node; - if (onClick) { - node = document.createElement("a"); - node.href = "javascript:void 0"; - node.addEventListener("click", e => { - e.preventDefault(); - onClick(ref, e); - }); +const DOC_EXPLORER_PLUGIN = { + title: "Documentation Explorer", + icon: function Icon() { + const pluginContext = usePluginContext(); + return (pluginContext == null ? void 0 : pluginContext.visiblePlugin) === DOC_EXPLORER_PLUGIN ? /* @__PURE__ */jsxRuntime.jsx(DocsFilledIcon, {}) : /* @__PURE__ */jsxRuntime.jsx(DocsIcon, {}); + }, + content: DocExplorer +}; +const HISTORY_PLUGIN = { + title: "History", + icon: HistoryIcon, + content: History +}; +const PluginContext = createNullableContext("PluginContext"); +function PluginContextProvider(props) { + const $ = reactCompilerRuntime.c(27); + const storage = useStorageContext(); + const explorerContext = useExplorerContext(); + const historyContext = useHistoryContext(); + const hasExplorerContext = Boolean(explorerContext); + const hasHistoryContext = Boolean(historyContext); + let t0; + let pluginList; + if ($[0] !== hasExplorerContext || $[1] !== hasHistoryContext || $[2] !== props.plugins) { + pluginList = []; + const pluginTitles = {}; + if (hasExplorerContext) { + pluginList.push(DOC_EXPLORER_PLUGIN); + pluginTitles[DOC_EXPLORER_PLUGIN.title] = true; + } + if (hasHistoryContext) { + pluginList.push(HISTORY_PLUGIN); + pluginTitles[HISTORY_PLUGIN.title] = true; + } + let t12; + if ($[4] !== props.plugins) { + t12 = props.plugins || []; + $[4] = props.plugins; + $[5] = t12; } else { - node = document.createElement("span"); + t12 = $[5]; } - node.className = className; - node.append(document.createTextNode(content)); - into.append(node); + for (const plugin of t12) { + if (typeof plugin.title !== "string" || !plugin.title) { + throw new Error("All GraphiQL plugins must have a unique title"); + } + if (pluginTitles[plugin.title]) { + throw new Error(`All GraphiQL plugins must have a unique title, found two plugins with the title '${plugin.title}'`); + } else { + pluginList.push(plugin); + pluginTitles[plugin.title] = true; + } + } + $[0] = hasExplorerContext; + $[1] = hasHistoryContext; + $[2] = props.plugins; + $[3] = pluginList; + } else { + pluginList = $[3]; + } + t0 = pluginList; + const plugins = t0; + let t1; + if ($[6] !== plugins || $[7] !== props.visiblePlugin || $[8] !== storage) { + t1 = () => { + const storedValue = storage == null ? void 0 : storage.get(STORAGE_KEY$4); + const pluginForStoredValue = plugins.find(plugin_0 => plugin_0.title === storedValue); + if (pluginForStoredValue) { + return pluginForStoredValue; + } + if (storedValue) { + storage == null ? void 0 : storage.set(STORAGE_KEY$4, ""); + } + if (!props.visiblePlugin) { + return null; + } + return plugins.find(plugin_1 => (typeof props.visiblePlugin === "string" ? plugin_1.title : plugin_1) === props.visiblePlugin) || null; + }; + $[6] = plugins; + $[7] = props.visiblePlugin; + $[8] = storage; + $[9] = t1; + } else { + t1 = $[9]; + } + const [visiblePlugin, internalSetVisiblePlugin] = React.useState(t1); + const { + onTogglePluginVisibility, + children + } = props; + let t2; + if ($[10] !== onTogglePluginVisibility || $[11] !== plugins) { + t2 = plugin_2 => { + const newVisiblePlugin = plugin_2 ? plugins.find(p => (typeof plugin_2 === "string" ? p.title : p) === plugin_2) || null : null; + internalSetVisiblePlugin(current => { + if (newVisiblePlugin === current) { + return current; + } + onTogglePluginVisibility == null ? void 0 : onTogglePluginVisibility(newVisiblePlugin); + return newVisiblePlugin; + }); + }; + $[10] = onTogglePluginVisibility; + $[11] = plugins; + $[12] = t2; + } else { + t2 = $[12]; + } + const setVisiblePlugin = t2; + let t3; + if ($[13] !== props.visiblePlugin || $[14] !== setVisiblePlugin) { + t3 = () => { + if (props.visiblePlugin) { + setVisiblePlugin(props.visiblePlugin); + } + }; + $[13] = props.visiblePlugin; + $[14] = setVisiblePlugin; + $[15] = t3; + } else { + t3 = $[15]; + } + let t4; + if ($[16] !== plugins || $[17] !== props.visiblePlugin || $[18] !== setVisiblePlugin) { + t4 = [plugins, props.visiblePlugin, setVisiblePlugin]; + $[16] = plugins; + $[17] = props.visiblePlugin; + $[18] = setVisiblePlugin; + $[19] = t4; + } else { + t4 = $[19]; + } + React.useEffect(t3, t4); + let t5; + if ($[20] !== plugins || $[21] !== setVisiblePlugin || $[22] !== visiblePlugin) { + t5 = { + plugins, + setVisiblePlugin, + visiblePlugin + }; + $[20] = plugins; + $[21] = setVisiblePlugin; + $[22] = visiblePlugin; + $[23] = t5; } else { - into.append(document.createTextNode(content)); + t5 = $[23]; } -} - -/***/ }), - -/***/ "../../graphiql-react/dist/javascript.cjs.js": -/*!***************************************************!*\ - !*** ../../graphiql-react/dist/javascript.cjs.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - } + const value = t5; + let t6; + if ($[24] !== children || $[25] !== value) { + t6 = /* @__PURE__ */jsxRuntime.jsx(PluginContext.Provider, { + value, + children + }); + $[24] = children; + $[25] = value; + $[26] = t6; + } else { + t6 = $[26]; } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); + return t6; } -var javascript$2 = { - exports: {} -}; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - CodeMirror.defineMode("javascript", function (config, parserConfig) { - var indentUnit = config.indentUnit; - var statementIndent = parserConfig.statementIndent; - var jsonldMode = parserConfig.jsonld; - var jsonMode = parserConfig.json || jsonldMode; - var trackScope = parserConfig.trackScope !== false; - var isTS = parserConfig.typescript; - var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; - var keywords = function () { - function kw(type2) { - return { - type: type2, - style: "keyword" - }; - } - var A = kw("keyword a"), - B = kw("keyword b"), - C = kw("keyword c"), - D = kw("keyword d"); - var operator = kw("operator"), - atom = { - type: "atom", - style: "atom" - }; - return { - "if": kw("if"), - "while": A, - "with": A, - "else": B, - "do": B, - "try": B, - "finally": B, - "return": D, - "break": D, - "continue": D, - "new": kw("new"), - "delete": C, - "void": C, - "throw": C, - "debugger": kw("debugger"), - "var": kw("var"), - "const": kw("var"), - "let": kw("var"), - "function": kw("function"), - "catch": kw("catch"), - "for": kw("for"), - "switch": kw("switch"), - "case": kw("case"), - "default": kw("default"), - "in": operator, - "typeof": operator, - "instanceof": operator, - "true": atom, - "false": atom, - "null": atom, - "undefined": atom, - "NaN": atom, - "Infinity": atom, - "this": kw("this"), - "class": kw("class"), - "super": kw("atom"), - "yield": C, - "export": kw("export"), - "import": kw("import"), - "extends": C, - "await": C - }; - }(); - var isOperatorChar = /[+\-*&%=<>!?|~^@]/; - var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; - function readRegexp(stream) { - var escaped = false, - next, - inSet = false; - while ((next = stream.next()) != null) { - if (!escaped) { - if (next == "/" && !inSet) return; - if (next == "[") inSet = true;else if (inSet && next == "]") inSet = false; - } - escaped = !escaped && next == "\\"; - } - } - var type, content; - function ret(tp, style, cont2) { - type = tp; - content = cont2; - return style; - } - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) { - return ret("number", "number"); - } else if (ch == "." && stream.match("..")) { - return ret("spread", "meta"); - } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return ret(ch); - } else if (ch == "=" && stream.eat(">")) { - return ret("=>", "operator"); - } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) { - return ret("number", "number"); - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/); - return ret("number", "number"); - } else if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } else if (expressionAllowed(stream, state, 1)) { - readRegexp(stream); - stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/); - return ret("regexp", "string-2"); - } else { - stream.eat("="); - return ret("operator", "operator", stream.current()); - } - } else if (ch == "`") { - state.tokenize = tokenQuasi; - return tokenQuasi(stream, state); - } else if (ch == "#" && stream.peek() == "!") { - stream.skipToEnd(); - return ret("meta", "meta"); - } else if (ch == "#" && stream.eatWhile(wordRE)) { - return ret("variable", "property"); - } else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start))) { - stream.skipToEnd(); - return ret("comment", "comment"); - } else if (isOperatorChar.test(ch)) { - if (ch != ">" || !state.lexical || state.lexical.type != ">") { - if (stream.eat("=")) { - if (ch == "!" || ch == "=") stream.eat("="); - } else if (/[<>*+\-|&?]/.test(ch)) { - stream.eat(ch); - if (ch == ">") stream.eat(ch); - } - } - if (ch == "?" && stream.eat(".")) return ret("."); - return ret("operator", "operator", stream.current()); - } else if (wordRE.test(ch)) { - stream.eatWhile(wordRE); - var word = stream.current(); - if (state.lastType != ".") { - if (keywords.propertyIsEnumerable(word)) { - var kw = keywords[word]; - return ret(kw.type, kw.style, word); - } - if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false)) return ret("async", "keyword", word); - } - return ret("variable", "variable", word); - } - } - function tokenString(quote) { - return function (stream, state) { - var escaped = false, - next; - if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)) { - state.tokenize = tokenBase; - return ret("jsonld-keyword", "meta"); - } - while ((next = stream.next()) != null) { - if (next == quote && !escaped) break; - escaped = !escaped && next == "\\"; +const usePluginContext = createContextHook(PluginContext); +const STORAGE_KEY$4 = "visiblePlugin"; +function onHasCompletion(_cm, data, schema, explorer, plugin, callback) { + void importCodeMirror([], { + useCommonAddons: false + }).then(CodeMirror => { + let information; + let fieldName; + let typeNamePill; + let typeNamePrefix; + let typeName; + let typeNameSuffix; + let description; + let deprecation; + let deprecationReason; + CodeMirror.on(data, "select", + // @ts-expect-error + (ctx, el) => { + if (!information) { + const hintsUl = el.parentNode; + information = document.createElement("div"); + information.className = "CodeMirror-hint-information"; + hintsUl.append(information); + const header = document.createElement("header"); + header.className = "CodeMirror-hint-information-header"; + information.append(header); + fieldName = document.createElement("span"); + fieldName.className = "CodeMirror-hint-information-field-name"; + header.append(fieldName); + typeNamePill = document.createElement("span"); + typeNamePill.className = "CodeMirror-hint-information-type-name-pill"; + header.append(typeNamePill); + typeNamePrefix = document.createElement("span"); + typeNamePill.append(typeNamePrefix); + typeName = document.createElement("a"); + typeName.className = "CodeMirror-hint-information-type-name"; + typeName.href = "javascript:void 0"; + typeName.addEventListener("click", onClickHintInformation); + typeNamePill.append(typeName); + typeNameSuffix = document.createElement("span"); + typeNamePill.append(typeNameSuffix); + description = document.createElement("div"); + description.className = "CodeMirror-hint-information-description"; + information.append(description); + deprecation = document.createElement("div"); + deprecation.className = "CodeMirror-hint-information-deprecation"; + information.append(deprecation); + const deprecationLabel = document.createElement("span"); + deprecationLabel.className = "CodeMirror-hint-information-deprecation-label"; + deprecationLabel.textContent = "Deprecated"; + deprecation.append(deprecationLabel); + deprecationReason = document.createElement("div"); + deprecationReason.className = "CodeMirror-hint-information-deprecation-reason"; + deprecation.append(deprecationReason); + const defaultInformationPadding = parseInt(window.getComputedStyle(information).paddingBottom.replace(/px$/, ""), 10) || 0; + const defaultInformationMaxHeight = parseInt(window.getComputedStyle(information).maxHeight.replace(/px$/, ""), 10) || 0; + const handleScroll = () => { + if (information) { + information.style.paddingTop = hintsUl.scrollTop + defaultInformationPadding + "px"; + information.style.maxHeight = hintsUl.scrollTop + defaultInformationMaxHeight + "px"; } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); }; - } - function tokenComment(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = ch == "*"; - } - return ret("comment", "comment"); - } - function tokenQuasi(stream, state) { - var escaped = false, - next; - while ((next = stream.next()) != null) { - if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && next == "\\"; - } - return ret("quasi", "string-2", stream.current()); - } - var brackets = "([{}])"; - function findFatArrow(stream, state) { - if (state.fatArrowAt) state.fatArrowAt = null; - var arrow = stream.string.indexOf("=>", stream.start); - if (arrow < 0) return; - if (isTS) { - var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow)); - if (m) arrow = m.index; - } - var depth = 0, - sawSomething = false; - for (var pos = arrow - 1; pos >= 0; --pos) { - var ch = stream.string.charAt(pos); - var bracket = brackets.indexOf(ch); - if (bracket >= 0 && bracket < 3) { - if (!depth) { - ++pos; - break; - } - if (--depth == 0) { - if (ch == "(") sawSomething = true; - break; - } - } else if (bracket >= 3 && bracket < 6) { - ++depth; - } else if (wordRE.test(ch)) { - sawSomething = true; - } else if (/["'\/`]/.test(ch)) { - for (;; --pos) { - if (pos == 0) return; - var next = stream.string.charAt(pos - 1); - if (next == ch && stream.string.charAt(pos - 2) != "\\") { - pos--; - break; - } - } - } else if (sawSomething && !depth) { - ++pos; - break; + hintsUl.addEventListener("scroll", handleScroll); + let onRemoveFn; + hintsUl.addEventListener("DOMNodeRemoved", onRemoveFn = event => { + if (event.target !== hintsUl) { + return; } - } - if (sawSomething && !depth) state.fatArrowAt = pos; - } - var atomicTypes = { - "atom": true, - "number": true, - "variable": true, - "string": true, - "regexp": true, - "this": true, - "import": true, - "jsonld-keyword": true - }; - function JSLexical(indented, column, type2, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type2; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - function inScope(state, varname) { - if (!trackScope) return false; - for (var v = state.localVars; v; v = v.next) if (v.name == varname) return true; - for (var cx2 = state.context; cx2; cx2 = cx2.prev) { - for (var v = cx2.vars; v; v = v.next) if (v.name == varname) return true; - } - } - function parseJS(state, style, type2, content2, stream) { - var cc = state.cc; - cx.state = state; - cx.stream = stream; - cx.marked = null, cx.cc = cc; - cx.style = style; - if (!state.lexical.hasOwnProperty("align")) state.lexical.align = true; - while (true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type2, content2)) { - while (cc.length && cc[cc.length - 1].lex) cc.pop()(); - if (cx.marked) return cx.marked; - if (type2 == "variable" && inScope(state, content2)) return "variable-2"; - return style; + hintsUl.removeEventListener("scroll", handleScroll); + hintsUl.removeEventListener("DOMNodeRemoved", onRemoveFn); + if (information) { + information.removeEventListener("click", onClickHintInformation); } - } - } - var cx = { - state: null, - column: null, - marked: null, - cc: null - }; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; + information = null; + fieldName = null; + typeNamePill = null; + typeNamePrefix = null; + typeName = null; + typeNameSuffix = null; + description = null; + deprecation = null; + deprecationReason = null; + onRemoveFn = null; + }); } - function inList(name, list) { - for (var v = list; v; v = v.next) if (v.name == name) return true; - return false; + if (fieldName) { + fieldName.textContent = ctx.text; } - function register(varname) { - var state = cx.state; - cx.marked = "def"; - if (!trackScope) return; - if (state.context) { - if (state.lexical.info == "var" && state.context && state.context.block) { - var newContext = registerVarScoped(varname, state.context); - if (newContext != null) { - state.context = newContext; - return; + if (typeNamePill && typeNamePrefix && typeName && typeNameSuffix) { + if (ctx.type) { + typeNamePill.style.display = "inline"; + const renderType2 = type => { + if (graphql.isNonNullType(type)) { + typeNameSuffix.textContent = "!" + typeNameSuffix.textContent; + renderType2(type.ofType); + } else if (graphql.isListType(type)) { + typeNamePrefix.textContent += "["; + typeNameSuffix.textContent = "]" + typeNameSuffix.textContent; + renderType2(type.ofType); + } else { + typeName.textContent = type.name; } - } else if (!inList(varname, state.localVars)) { - state.localVars = new Var(varname, state.localVars); - return; - } - } - if (parserConfig.globalVars && !inList(varname, state.globalVars)) state.globalVars = new Var(varname, state.globalVars); - } - function registerVarScoped(varname, context) { - if (!context) { - return null; - } else if (context.block) { - var inner = registerVarScoped(varname, context.prev); - if (!inner) return null; - if (inner == context.prev) return context; - return new Context(inner, context.vars, true); - } else if (inList(varname, context.vars)) { - return context; + }; + typeNamePrefix.textContent = ""; + typeNameSuffix.textContent = ""; + renderType2(ctx.type); } else { - return new Context(context.prev, new Var(varname, context.vars), false); - } - } - function isModifier(name) { - return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly"; - } - function Context(prev, vars, block2) { - this.prev = prev; - this.vars = vars; - this.block = block2; - } - function Var(name, next) { - this.name = name; - this.next = next; - } - var defaultVars = new Var("this", new Var("arguments", null)); - function pushcontext() { - cx.state.context = new Context(cx.state.context, cx.state.localVars, false); - cx.state.localVars = defaultVars; - } - function pushblockcontext() { - cx.state.context = new Context(cx.state.context, cx.state.localVars, true); - cx.state.localVars = null; - } - pushcontext.lex = pushblockcontext.lex = true; - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - popcontext.lex = true; - function pushlex(type2, info) { - var result = function () { - var state = cx.state, - indent = state.indented; - if (state.lexical.type == "stat") indent = state.lexical.indented;else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) indent = outer.indented; - state.lexical = new JSLexical(indent, cx.stream.column(), type2, null, state.lexical, info); - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - function expect(wanted) { - function exp(type2) { - if (type2 == wanted) return cont();else if (wanted == ";" || type2 == "}" || type2 == ")" || type2 == "]") return pass();else return cont(exp); - } - return exp; - } - function statement(type2, value) { - if (type2 == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex); - if (type2 == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex); - if (type2 == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type2 == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex); - if (type2 == "debugger") return cont(expect(";")); - if (type2 == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext); - if (type2 == ";") return cont(); - if (type2 == "if") { - if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) cx.state.cc.pop()(); - return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse); - } - if (type2 == "function") return cont(functiondef); - if (type2 == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex); - if (type2 == "class" || isTS && value == "interface") { - cx.marked = "keyword"; - return cont(pushlex("form", type2 == "class" ? type2 : value), className, poplex); - } - if (type2 == "variable") { - if (isTS && value == "declare") { - cx.marked = "keyword"; - return cont(statement); - } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) { - cx.marked = "keyword"; - if (value == "enum") return cont(enumdef);else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";"));else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex); - } else if (isTS && value == "namespace") { - cx.marked = "keyword"; - return cont(pushlex("form"), expression, statement, poplex); - } else if (isTS && value == "abstract") { - cx.marked = "keyword"; - return cont(statement); - } else { - return cont(pushlex("stat"), maybelabel); - } - } - if (type2 == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext, block, poplex, poplex, popcontext); - if (type2 == "case") return cont(expression, expect(":")); - if (type2 == "default") return cont(expect(":")); - if (type2 == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext); - if (type2 == "export") return cont(pushlex("stat"), afterExport, poplex); - if (type2 == "import") return cont(pushlex("stat"), afterImport, poplex); - if (type2 == "async") return cont(statement); - if (value == "@") return cont(expression, statement); - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function maybeCatchBinding(type2) { - if (type2 == "(") return cont(funarg, expect(")")); - } - function expression(type2, value) { - return expressionInner(type2, value, false); - } - function expressionNoComma(type2, value) { - return expressionInner(type2, value, true); - } - function parenExpr(type2) { - if (type2 != "(") return pass(); - return cont(pushlex(")"), maybeexpression, expect(")"), poplex); - } - function expressionInner(type2, value, noComma) { - if (cx.state.fatArrowAt == cx.stream.start) { - var body = noComma ? arrowBodyNoComma : arrowBody; - if (type2 == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);else if (type2 == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); - } - var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; - if (atomicTypes.hasOwnProperty(type2)) return cont(maybeop); - if (type2 == "function") return cont(functiondef, maybeop); - if (type2 == "class" || isTS && value == "interface") { - cx.marked = "keyword"; - return cont(pushlex("form"), classExpression, poplex); - } - if (type2 == "keyword c" || type2 == "async") return cont(noComma ? expressionNoComma : expression); - if (type2 == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); - if (type2 == "operator" || type2 == "spread") return cont(noComma ? expressionNoComma : expression); - if (type2 == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); - if (type2 == "{") return contCommasep(objprop, "}", null, maybeop); - if (type2 == "quasi") return pass(quasi, maybeop); - if (type2 == "new") return cont(maybeTarget(noComma)); - return cont(); - } - function maybeexpression(type2) { - if (type2.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - function maybeoperatorComma(type2, value) { - if (type2 == ",") return cont(maybeexpression); - return maybeoperatorNoComma(type2, value, false); - } - function maybeoperatorNoComma(type2, value, noComma) { - var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; - var expr = noComma == false ? expression : expressionNoComma; - if (type2 == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); - if (type2 == "operator") { - if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me); - if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false)) return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me); - if (value == "?") return cont(expression, expect(":"), expr); - return cont(expr); - } - if (type2 == "quasi") { - return pass(quasi, me); - } - if (type2 == ";") return; - if (type2 == "(") return contCommasep(expressionNoComma, ")", "call", me); - if (type2 == ".") return cont(property, me); - if (type2 == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); - if (isTS && value == "as") { - cx.marked = "keyword"; - return cont(typeexpr, me); - } - if (type2 == "regexp") { - cx.state.lastType = cx.marked = "operator"; - cx.stream.backUp(cx.stream.pos - cx.stream.start - 1); - return cont(expr); - } - } - function quasi(type2, value) { - if (type2 != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasi); - return cont(maybeexpression, continueQuasi); - } - function continueQuasi(type2) { - if (type2 == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasi); - } - } - function arrowBody(type2) { - findFatArrow(cx.stream, cx.state); - return pass(type2 == "{" ? statement : expression); - } - function arrowBodyNoComma(type2) { - findFatArrow(cx.stream, cx.state); - return pass(type2 == "{" ? statement : expressionNoComma); - } - function maybeTarget(noComma) { - return function (type2) { - if (type2 == ".") return cont(noComma ? targetNoComma : target);else if (type2 == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma);else return pass(noComma ? expressionNoComma : expression); - }; - } - function target(_, value) { - if (value == "target") { - cx.marked = "keyword"; - return cont(maybeoperatorComma); - } - } - function targetNoComma(_, value) { - if (value == "target") { - cx.marked = "keyword"; - return cont(maybeoperatorNoComma); - } - } - function maybelabel(type2) { - if (type2 == ":") return cont(poplex, statement); - return pass(maybeoperatorComma, expect(";"), poplex); - } - function property(type2) { - if (type2 == "variable") { - cx.marked = "property"; - return cont(); - } - } - function objprop(type2, value) { - if (type2 == "async") { - cx.marked = "property"; - return cont(objprop); - } else if (type2 == "variable" || cx.style == "keyword") { - cx.marked = "property"; - if (value == "get" || value == "set") return cont(getterSetter); - var m; - if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false))) cx.state.fatArrowAt = cx.stream.pos + m[0].length; - return cont(afterprop); - } else if (type2 == "number" || type2 == "string") { - cx.marked = jsonldMode ? "property" : cx.style + " property"; - return cont(afterprop); - } else if (type2 == "jsonld-keyword") { - return cont(afterprop); - } else if (isTS && isModifier(value)) { - cx.marked = "keyword"; - return cont(objprop); - } else if (type2 == "[") { - return cont(expression, maybetype, expect("]"), afterprop); - } else if (type2 == "spread") { - return cont(expressionNoComma, afterprop); - } else if (value == "*") { - cx.marked = "keyword"; - return cont(objprop); - } else if (type2 == ":") { - return pass(afterprop); - } - } - function getterSetter(type2) { - if (type2 != "variable") return pass(afterprop); - cx.marked = "property"; - return cont(functiondef); - } - function afterprop(type2) { - if (type2 == ":") return cont(expressionNoComma); - if (type2 == "(") return pass(functiondef); - } - function commasep(what, end, sep) { - function proceed(type2, value) { - if (sep ? sep.indexOf(type2) > -1 : type2 == ",") { - var lex = cx.state.lexical; - if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; - return cont(function (type3, value2) { - if (type3 == end || value2 == end) return pass(); - return pass(what); - }, proceed); - } - if (type2 == end || value == end) return cont(); - if (sep && sep.indexOf(";") > -1) return pass(what); - return cont(expect(end)); - } - return function (type2, value) { - if (type2 == end || value == end) return cont(); - return pass(what, proceed); - }; - } - function contCommasep(what, end, info) { - for (var i = 3; i < arguments.length; i++) cx.cc.push(arguments[i]); - return cont(pushlex(end, info), commasep(what, end), poplex); - } - function block(type2) { - if (type2 == "}") return cont(); - return pass(statement, block); - } - function maybetype(type2, value) { - if (isTS) { - if (type2 == ":") return cont(typeexpr); - if (value == "?") return cont(maybetype); - } - } - function maybetypeOrIn(type2, value) { - if (isTS && (type2 == ":" || value == "in")) return cont(typeexpr); - } - function mayberettype(type2) { - if (isTS && type2 == ":") { - if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr);else return cont(typeexpr); - } - } - function isKW(_, value) { - if (value == "is") { - cx.marked = "keyword"; - return cont(); - } - } - function typeexpr(type2, value) { - if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") { - cx.marked = "keyword"; - return cont(value == "typeof" ? expressionNoComma : typeexpr); - } - if (type2 == "variable" || value == "void") { - cx.marked = "type"; - return cont(afterType); - } - if (value == "|" || value == "&") return cont(typeexpr); - if (type2 == "string" || type2 == "number" || type2 == "atom") return cont(afterType); - if (type2 == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType); - if (type2 == "{") return cont(pushlex("}"), typeprops, poplex, afterType); - if (type2 == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType); - if (type2 == "<") return cont(commasep(typeexpr, ">"), typeexpr); - if (type2 == "quasi") { - return pass(quasiType, afterType); - } - } - function maybeReturnType(type2) { - if (type2 == "=>") return cont(typeexpr); - } - function typeprops(type2) { - if (type2.match(/[\}\)\]]/)) return cont(); - if (type2 == "," || type2 == ";") return cont(typeprops); - return pass(typeprop, typeprops); - } - function typeprop(type2, value) { - if (type2 == "variable" || cx.style == "keyword") { - cx.marked = "property"; - return cont(typeprop); - } else if (value == "?" || type2 == "number" || type2 == "string") { - return cont(typeprop); - } else if (type2 == ":") { - return cont(typeexpr); - } else if (type2 == "[") { - return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop); - } else if (type2 == "(") { - return pass(functiondecl, typeprop); - } else if (!type2.match(/[;\}\)\],]/)) { - return cont(); - } - } - function quasiType(type2, value) { - if (type2 != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasiType); - return cont(typeexpr, continueQuasiType); - } - function continueQuasiType(type2) { - if (type2 == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasiType); - } - } - function typearg(type2, value) { - if (type2 == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg); - if (type2 == ":") return cont(typeexpr); - if (type2 == "spread") return cont(typearg); - return pass(typeexpr); - } - function afterType(type2, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType); - if (value == "|" || type2 == "." || value == "&") return cont(typeexpr); - if (type2 == "[") return cont(typeexpr, expect("]"), afterType); - if (value == "extends" || value == "implements") { - cx.marked = "keyword"; - return cont(typeexpr); - } - if (value == "?") return cont(typeexpr, expect(":"), typeexpr); - } - function maybeTypeArgs(_, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType); - } - function typeparam() { - return pass(typeexpr, maybeTypeDefault); - } - function maybeTypeDefault(_, value) { - if (value == "=") return cont(typeexpr); - } - function vardef(_, value) { - if (value == "enum") { - cx.marked = "keyword"; - return cont(enumdef); - } - return pass(pattern, maybetype, maybeAssign, vardefCont); - } - function pattern(type2, value) { - if (isTS && isModifier(value)) { - cx.marked = "keyword"; - return cont(pattern); - } - if (type2 == "variable") { - register(value); - return cont(); - } - if (type2 == "spread") return cont(pattern); - if (type2 == "[") return contCommasep(eltpattern, "]"); - if (type2 == "{") return contCommasep(proppattern, "}"); - } - function proppattern(type2, value) { - if (type2 == "variable" && !cx.stream.match(/^\s*:/, false)) { - register(value); - return cont(maybeAssign); - } - if (type2 == "variable") cx.marked = "property"; - if (type2 == "spread") return cont(pattern); - if (type2 == "}") return pass(); - if (type2 == "[") return cont(expression, expect("]"), expect(":"), proppattern); - return cont(expect(":"), pattern, maybeAssign); - } - function eltpattern() { - return pass(pattern, maybeAssign); - } - function maybeAssign(_type, value) { - if (value == "=") return cont(expressionNoComma); - } - function vardefCont(type2) { - if (type2 == ",") return cont(vardef); - } - function maybeelse(type2, value) { - if (type2 == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); - } - function forspec(type2, value) { - if (value == "await") return cont(forspec); - if (type2 == "(") return cont(pushlex(")"), forspec1, poplex); - } - function forspec1(type2) { - if (type2 == "var") return cont(vardef, forspec2); - if (type2 == "variable") return cont(forspec2); - return pass(forspec2); - } - function forspec2(type2, value) { - if (type2 == ")") return cont(); - if (type2 == ";") return cont(forspec2); - if (value == "in" || value == "of") { - cx.marked = "keyword"; - return cont(expression, forspec2); - } - return pass(expression, forspec2); - } - function functiondef(type2, value) { - if (value == "*") { - cx.marked = "keyword"; - return cont(functiondef); - } - if (type2 == "variable") { - register(value); - return cont(functiondef); - } - if (type2 == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext); - if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef); - } - function functiondecl(type2, value) { - if (value == "*") { - cx.marked = "keyword"; - return cont(functiondecl); - } - if (type2 == "variable") { - register(value); - return cont(functiondecl); - } - if (type2 == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext); - if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl); - } - function typename(type2, value) { - if (type2 == "keyword" || type2 == "variable") { - cx.marked = "type"; - return cont(typename); - } else if (value == "<") { - return cont(pushlex(">"), commasep(typeparam, ">"), poplex); - } - } - function funarg(type2, value) { - if (value == "@") cont(expression, funarg); - if (type2 == "spread") return cont(funarg); - if (isTS && isModifier(value)) { - cx.marked = "keyword"; - return cont(funarg); - } - if (isTS && type2 == "this") return cont(maybetype, maybeAssign); - return pass(pattern, maybetype, maybeAssign); - } - function classExpression(type2, value) { - if (type2 == "variable") return className(type2, value); - return classNameAfter(type2, value); - } - function className(type2, value) { - if (type2 == "variable") { - register(value); - return cont(classNameAfter); - } - } - function classNameAfter(type2, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter); - if (value == "extends" || value == "implements" || isTS && type2 == ",") { - if (value == "implements") cx.marked = "keyword"; - return cont(isTS ? typeexpr : expression, classNameAfter); - } - if (type2 == "{") return cont(pushlex("}"), classBody, poplex); - } - function classBody(type2, value) { - if (type2 == "async" || type2 == "variable" && (value == "static" || value == "get" || value == "set" || isTS && isModifier(value)) && cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false)) { - cx.marked = "keyword"; - return cont(classBody); - } - if (type2 == "variable" || cx.style == "keyword") { - cx.marked = "property"; - return cont(classfield, classBody); - } - if (type2 == "number" || type2 == "string") return cont(classfield, classBody); - if (type2 == "[") return cont(expression, maybetype, expect("]"), classfield, classBody); - if (value == "*") { - cx.marked = "keyword"; - return cont(classBody); - } - if (isTS && type2 == "(") return pass(functiondecl, classBody); - if (type2 == ";" || type2 == ",") return cont(classBody); - if (type2 == "}") return cont(); - if (value == "@") return cont(expression, classBody); - } - function classfield(type2, value) { - if (value == "!") return cont(classfield); - if (value == "?") return cont(classfield); - if (type2 == ":") return cont(typeexpr, maybeAssign); - if (value == "=") return cont(expressionNoComma); - var context = cx.state.lexical.prev, - isInterface = context && context.info == "interface"; - return pass(isInterface ? functiondecl : functiondef); - } - function afterExport(type2, value) { - if (value == "*") { - cx.marked = "keyword"; - return cont(maybeFrom, expect(";")); - } - if (value == "default") { - cx.marked = "keyword"; - return cont(expression, expect(";")); - } - if (type2 == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";")); - return pass(statement); - } - function exportField(type2, value) { - if (value == "as") { - cx.marked = "keyword"; - return cont(expect("variable")); + typeNamePrefix.textContent = ""; + typeName.textContent = ""; + typeNameSuffix.textContent = ""; + typeNamePill.style.display = "none"; } - if (type2 == "variable") return pass(expressionNoComma, exportField); - } - function afterImport(type2) { - if (type2 == "string") return cont(); - if (type2 == "(") return pass(expression); - if (type2 == ".") return pass(maybeoperatorComma); - return pass(importSpec, maybeMoreImports, maybeFrom); - } - function importSpec(type2, value) { - if (type2 == "{") return contCommasep(importSpec, "}"); - if (type2 == "variable") register(value); - if (value == "*") cx.marked = "keyword"; - return cont(maybeAs); } - function maybeMoreImports(type2) { - if (type2 == ",") return cont(importSpec, maybeMoreImports); - } - function maybeAs(_type, value) { - if (value == "as") { - cx.marked = "keyword"; - return cont(importSpec); + if (description) { + if (ctx.description) { + description.style.display = "block"; + description.innerHTML = markdown.render(ctx.description); + } else { + description.style.display = "none"; + description.innerHTML = ""; } } - function maybeFrom(_type, value) { - if (value == "from") { - cx.marked = "keyword"; - return cont(expression); + if (deprecation && deprecationReason) { + if (ctx.deprecationReason) { + deprecation.style.display = "block"; + deprecationReason.innerHTML = markdown.render(ctx.deprecationReason); + } else { + deprecation.style.display = "none"; + deprecationReason.innerHTML = ""; } } - function arrayLiteral(type2) { - if (type2 == "]") return cont(); - return pass(commasep(expressionNoComma, "]")); - } - function enumdef() { - return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex); - } - function enummember() { - return pass(pattern, maybeAssign); - } - function isContinuedStatement(state, textAfter) { - return state.lastType == "operator" || state.lastType == "," || isOperatorChar.test(textAfter.charAt(0)) || /[,.]/.test(textAfter.charAt(0)); - } - function expressionAllowed(stream, state, backUp) { - return state.tokenize == tokenBase && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))); - } - return { - startState: function (basecolumn) { - var state = { - tokenize: tokenBase, - lastType: "sof", - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: parserConfig.localVars, - context: parserConfig.localVars && new Context(null, null, false), - indented: basecolumn || 0 - }; - if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") state.globalVars = parserConfig.globalVars; - return state; - }, - token: function (stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) state.lexical.align = false; - state.indented = stream.indentation(); - findFatArrow(stream, state); - } - if (state.tokenize != tokenComment && stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; - return parseJS(state, style, type, content, stream); - }, - indent: function (state, textAfter) { - if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass; - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), - lexical = state.lexical, - top; - if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { - var c = state.cc[i]; - if (c == poplex) lexical = lexical.prev;else if (c != maybeelse && c != popcontext) break; - } - while ((lexical.type == "stat" || lexical.type == "form") && (firstChar == "}" || (top = state.cc[state.cc.length - 1]) && (top == maybeoperatorComma || top == maybeoperatorNoComma) && !/^[,\.=+\-*:?[\(]/.test(textAfter))) lexical = lexical.prev; - if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") lexical = lexical.prev; - var type2 = lexical.type, - closing = firstChar == type2; - if (type2 == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0);else if (type2 == "form" && firstChar == "{") return lexical.indented;else if (type2 == "form") return lexical.indented + indentUnit;else if (type2 == "stat") return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);else if (lexical.align) return lexical.column + (closing ? 0 : 1);else return lexical.indented + (closing ? 0 : indentUnit); - }, - electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, - blockCommentStart: jsonMode ? null : "/*", - blockCommentEnd: jsonMode ? null : "*/", - blockCommentContinue: jsonMode ? null : " * ", - lineComment: jsonMode ? null : "//", - fold: "brace", - closeBrackets: "()[]{}''\"\"``", - helperType: jsonMode ? "json" : "javascript", - jsonldMode, - jsonMode, - expressionAllowed, - skipExpression: function (state) { - parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null)); - } - }; - }); - CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); - CodeMirror.defineMIME("text/javascript", "javascript"); - CodeMirror.defineMIME("text/ecmascript", "javascript"); - CodeMirror.defineMIME("application/javascript", "javascript"); - CodeMirror.defineMIME("application/x-javascript", "javascript"); - CodeMirror.defineMIME("application/ecmascript", "javascript"); - CodeMirror.defineMIME("application/json", { - name: "javascript", - json: true - }); - CodeMirror.defineMIME("application/x-json", { - name: "javascript", - json: true - }); - CodeMirror.defineMIME("application/manifest+json", { - name: "javascript", - json: true - }); - CodeMirror.defineMIME("application/ld+json", { - name: "javascript", - jsonld: true - }); - CodeMirror.defineMIME("text/typescript", { - name: "javascript", - typescript: true - }); - CodeMirror.defineMIME("application/typescript", { - name: "javascript", - typescript: true }); }); -})(); -var javascriptExports = javascript$2.exports; -const javascript = /* @__PURE__ */codemirror.getDefaultExportFromCjs(javascriptExports); -const javascript$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: javascript -}, [javascriptExports]); -exports.javascript = javascript$1; - -/***/ }), - -/***/ "../../graphiql-react/dist/jump-to-line.cjs.js": -/*!*****************************************************!*\ - !*** ../../graphiql-react/dist/jump-to-line.cjs.js ***! - \*****************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -const dialog = __webpack_require__(/*! ./dialog.cjs.js */ "../../graphiql-react/dist/dialog.cjs.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } + function onClickHintInformation(event) { + if (!schema || !explorer || !plugin || !(event.currentTarget instanceof HTMLElement)) { + return; + } + const typeName = event.currentTarget.textContent || ""; + const type = schema.getType(typeName); + if (type) { + plugin.setVisiblePlugin(DOC_EXPLORER_PLUGIN); + explorer.push({ + name: type.name, + def: type + }); + callback == null ? void 0 : callback(type); } } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); } -var jumpToLine$2 = { - exports: {} -}; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror(), dialog.dialogExports); - })(function (CodeMirror) { - CodeMirror.defineOption("search", { - bottom: false - }); - function dialog2(cm, text, shortText, deflt, f) { - if (cm.openDialog) cm.openDialog(text, f, { - value: deflt, - selectValueOnOpen: true, - bottom: cm.options.search.bottom - });else f(prompt(shortText, deflt)); - } - function getJumpDialog(cm) { - return cm.phrase("Jump to line:") + ' ' + cm.phrase("(Use line:column or scroll% syntax)") + ""; - } - function interpretLine(cm, string) { - var num = Number(string); - if (/^[-+]/.test(string)) return cm.getCursor().line + num;else return num - 1; - } - CodeMirror.commands.jumpToLine = function (cm) { - var cur = cm.getCursor(); - dialog2(cm, getJumpDialog(cm), cm.phrase("Jump to line:"), cur.line + 1 + ":" + cur.ch, function (posStr) { - if (!posStr) return; - var match; - if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) { - cm.setCursor(interpretLine(cm, match[1]), Number(match[2])); - } else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) { - var line = Math.round(cm.lineCount() * Number(match[1]) / 100); - if (/^[-+]/.test(match[1])) line = cur.line + line + 1; - cm.setCursor(line - 1, cur.ch); - } else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) { - cm.setCursor(interpretLine(cm, match[1]), cur.ch); - } - }); +function useSynchronizeValue(editor, value) { + const $ = reactCompilerRuntime.c(4); + let t0; + let t1; + if ($[0] !== editor || $[1] !== value) { + t0 = () => { + if (editor && typeof value === "string" && value !== editor.getValue()) { + editor.setValue(value); + } }; - CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine"; - }); -})(); -var jumpToLineExports = jumpToLine$2.exports; -const jumpToLine = /* @__PURE__ */codemirror.getDefaultExportFromCjs(jumpToLineExports); -const jumpToLine$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: jumpToLine -}, [jumpToLineExports]); -exports.jumpToLine = jumpToLine$1; - -/***/ }), - -/***/ "../../graphiql-react/dist/jump.cjs.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/jump.cjs.js ***! - \*********************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -const SchemaReference = __webpack_require__(/*! ./SchemaReference.cjs.js */ "../../graphiql-react/dist/SchemaReference.cjs.js"); -codemirror.CodeMirror.defineOption("jump", false, (cm, options, old) => { - if (old && old !== codemirror.CodeMirror.Init) { - const oldOnMouseOver = cm.state.jump.onMouseOver; - codemirror.CodeMirror.off(cm.getWrapperElement(), "mouseover", oldOnMouseOver); - const oldOnMouseOut = cm.state.jump.onMouseOut; - codemirror.CodeMirror.off(cm.getWrapperElement(), "mouseout", oldOnMouseOut); - codemirror.CodeMirror.off(document, "keydown", cm.state.jump.onKeyDown); - delete cm.state.jump; + t1 = [editor, value]; + $[0] = editor; + $[1] = value; + $[2] = t0; + $[3] = t1; + } else { + t0 = $[2]; + t1 = $[3]; } - if (options) { - const state = cm.state.jump = { - options, - onMouseOver: onMouseOver.bind(null, cm), - onMouseOut: onMouseOut.bind(null, cm), - onKeyDown: onKeyDown.bind(null, cm) + React.useEffect(t0, t1); +} +function useSynchronizeOption(editor, option, value) { + const $ = reactCompilerRuntime.c(5); + let t0; + let t1; + if ($[0] !== editor || $[1] !== option || $[2] !== value) { + t0 = () => { + if (editor) { + editor.setOption(option, value); + } }; - codemirror.CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); - codemirror.CodeMirror.on(cm.getWrapperElement(), "mouseout", state.onMouseOut); - codemirror.CodeMirror.on(document, "keydown", state.onKeyDown); - } -}); -function onMouseOver(cm, event) { - const target = event.target || event.srcElement; - if (!(target instanceof HTMLElement)) { - return; - } - if ((target === null || target === void 0 ? void 0 : target.nodeName) !== "SPAN") { - return; - } - const box = target.getBoundingClientRect(); - const cursor = { - left: (box.left + box.right) / 2, - top: (box.top + box.bottom) / 2 - }; - cm.state.jump.cursor = cursor; - if (cm.state.jump.isHoldingModifier) { - enableJumpMode(cm); + t1 = [editor, option, value]; + $[0] = editor; + $[1] = option; + $[2] = value; + $[3] = t0; + $[4] = t1; + } else { + t0 = $[3]; + t1 = $[4]; } + React.useEffect(t0, t1); } -function onMouseOut(cm) { - if (!cm.state.jump.isHoldingModifier && cm.state.jump.cursor) { - cm.state.jump.cursor = null; - return; +function useChangeHandler(editor, callback, storageKey, tabProperty, caller) { + const $ = reactCompilerRuntime.c(10); + let t0; + if ($[0] !== caller) { + t0 = { + nonNull: true, + caller + }; + $[0] = caller; + $[1] = t0; + } else { + t0 = $[1]; } - if (cm.state.jump.isHoldingModifier && cm.state.jump.marker) { - disableJumpMode(cm); + const { + updateActiveTabValues + } = useEditorContext(t0); + const storage = useStorageContext(); + let t1; + let t2; + if ($[2] !== callback || $[3] !== editor || $[4] !== storage || $[5] !== storageKey || $[6] !== tabProperty || $[7] !== updateActiveTabValues) { + t1 = () => { + if (!editor) { + return; + } + const store = debounce(500, value => { + if (!storage || storageKey === null) { + return; + } + storage.set(storageKey, value); + }); + const updateTab = debounce(100, value_0 => { + updateActiveTabValues({ + [tabProperty]: value_0 + }); + }); + const handleChange = (editorInstance, changeObj) => { + if (!changeObj) { + return; + } + const newValue = editorInstance.getValue(); + store(newValue); + updateTab(newValue); + callback == null ? void 0 : callback(newValue); + }; + editor.on("change", handleChange); + return () => editor.off("change", handleChange); + }; + t2 = [callback, editor, storage, storageKey, tabProperty, updateActiveTabValues]; + $[2] = callback; + $[3] = editor; + $[4] = storage; + $[5] = storageKey; + $[6] = tabProperty; + $[7] = updateActiveTabValues; + $[8] = t1; + $[9] = t2; + } else { + t1 = $[8]; + t2 = $[9]; } + React.useEffect(t1, t2); } -function onKeyDown(cm, event) { - if (cm.state.jump.isHoldingModifier || !isJumpModifier(event.key)) { - return; +function useCompletion(editor, callback, caller) { + const $ = reactCompilerRuntime.c(9); + let t0; + if ($[0] !== caller) { + t0 = { + nonNull: true, + caller + }; + $[0] = caller; + $[1] = t0; + } else { + t0 = $[1]; } - cm.state.jump.isHoldingModifier = true; - if (cm.state.jump.cursor) { - enableJumpMode(cm); + const { + schema + } = useSchemaContext(t0); + const explorer = useExplorerContext(); + const plugin = usePluginContext(); + let t1; + let t2; + if ($[2] !== callback || $[3] !== editor || $[4] !== explorer || $[5] !== plugin || $[6] !== schema) { + t1 = () => { + if (!editor) { + return; + } + const handleCompletion = (instance, changeObj) => { + onHasCompletion(instance, changeObj, schema, explorer, plugin, type => { + callback == null ? void 0 : callback({ + kind: "Type", + type, + schema: schema || void 0 + }); + }); + }; + editor.on("hasCompletion", handleCompletion); + return () => editor.off("hasCompletion", handleCompletion); + }; + t2 = [callback, editor, explorer, plugin, schema]; + $[2] = callback; + $[3] = editor; + $[4] = explorer; + $[5] = plugin; + $[6] = schema; + $[7] = t1; + $[8] = t2; + } else { + t1 = $[7]; + t2 = $[8]; } - const onKeyUp = upEvent => { - if (upEvent.code !== event.code) { - return; - } - cm.state.jump.isHoldingModifier = false; - if (cm.state.jump.marker) { - disableJumpMode(cm); - } - codemirror.CodeMirror.off(document, "keyup", onKeyUp); - codemirror.CodeMirror.off(document, "click", onClick); - cm.off("mousedown", onMouseDown); - }; - const onClick = clickEvent => { - const { - destination, - options - } = cm.state.jump; - if (destination) { - options.onClick(destination, clickEvent); - } - }; - const onMouseDown = (_, downEvent) => { - if (cm.state.jump.destination) { - downEvent.codemirrorIgnore = true; - } - }; - codemirror.CodeMirror.on(document, "keyup", onKeyUp); - codemirror.CodeMirror.on(document, "click", onClick); - cm.on("mousedown", onMouseDown); -} -const isMac = typeof navigator !== "undefined" && navigator.userAgent.includes("Mac"); -function isJumpModifier(key) { - return key === (isMac ? "Meta" : "Control"); + React.useEffect(t1, t2); } -function enableJumpMode(cm) { - if (cm.state.jump.marker) { - return; +function useKeyMap(editor, keys, callback) { + const $ = reactCompilerRuntime.c(5); + let t0; + let t1; + if ($[0] !== callback || $[1] !== editor || $[2] !== keys) { + t0 = () => { + if (!editor) { + return; + } + for (const key of keys) { + editor.removeKeyMap(key); + } + if (callback) { + const keyMap = {}; + for (const key_0 of keys) { + keyMap[key_0] = () => callback(); + } + editor.addKeyMap(keyMap); + } + }; + t1 = [editor, keys, callback]; + $[0] = callback; + $[1] = editor; + $[2] = keys; + $[3] = t0; + $[4] = t1; + } else { + t0 = $[3]; + t1 = $[4]; + } + React.useEffect(t0, t1); +} +const _useCopyQuery = useCopyQuery; +const _useMergeQuery = useMergeQuery; +const _usePrettifyEditors = usePrettifyEditors; +const _useAutoCompleteLeafs = useAutoCompleteLeafs; +function useCopyQuery(t0) { + const $ = reactCompilerRuntime.c(7); + let t1; + if ($[0] !== t0) { + t1 = t0 === void 0 ? {} : t0; + $[0] = t0; + $[1] = t1; + } else { + t1 = $[1]; } const { - cursor, - options - } = cm.state.jump; - const pos = cm.coordsChar(cursor); - const token = cm.getTokenAt(pos, true); - const getDestination = options.getDestination || cm.getHelper(pos, "jump"); - if (getDestination) { - const destination = getDestination(token, options, cm); - if (destination) { - const marker = cm.markText({ - line: pos.line, - ch: token.start - }, { - line: pos.line, - ch: token.end - }, { - className: "CodeMirror-jump-token" - }); - cm.state.jump.marker = marker; - cm.state.jump.destination = destination; - } + caller, + onCopyQuery + } = t1; + const t2 = caller || _useCopyQuery; + let t3; + if ($[2] !== t2) { + t3 = { + nonNull: true, + caller: t2 + }; + $[2] = t2; + $[3] = t3; + } else { + t3 = $[3]; + } + const { + queryEditor + } = useEditorContext(t3); + let t4; + if ($[4] !== onCopyQuery || $[5] !== queryEditor) { + t4 = () => { + if (!queryEditor) { + return; + } + const query = queryEditor.getValue(); + copyToClipboard(query); + onCopyQuery == null ? void 0 : onCopyQuery(query); + }; + $[4] = onCopyQuery; + $[5] = queryEditor; + $[6] = t4; + } else { + t4 = $[6]; } + return t4; } -function disableJumpMode(cm) { +function useMergeQuery(t0) { + const $ = reactCompilerRuntime.c(8); + let t1; + if ($[0] !== t0) { + t1 = t0 === void 0 ? {} : t0; + $[0] = t0; + $[1] = t1; + } else { + t1 = $[1]; + } const { - marker - } = cm.state.jump; - cm.state.jump.marker = null; - cm.state.jump.destination = null; - marker.clear(); -} -codemirror.CodeMirror.registerHelper("jump", "graphql", (token, options) => { - if (!options.schema || !options.onClick || !token.state) { - return; + caller + } = t1; + const t2 = caller || _useMergeQuery; + let t3; + if ($[2] !== t2) { + t3 = { + nonNull: true, + caller: t2 + }; + $[2] = t2; + $[3] = t3; + } else { + t3 = $[3]; } const { - state - } = token; + queryEditor + } = useEditorContext(t3); + let t4; + if ($[4] === Symbol.for("react.memo_cache_sentinel")) { + t4 = { + nonNull: true, + caller: _useMergeQuery + }; + $[4] = t4; + } else { + t4 = $[4]; + } const { - kind, - step - } = state; - const typeInfo = SchemaReference.getTypeInfo(options.schema, state); - if (kind === "Field" && step === 0 && typeInfo.fieldDef || kind === "AliasedField" && step === 2 && typeInfo.fieldDef) { - return SchemaReference.getFieldReference(typeInfo); + schema + } = useSchemaContext(t4); + let t5; + if ($[5] !== queryEditor || $[6] !== schema) { + t5 = () => { + const documentAST = queryEditor == null ? void 0 : queryEditor.documentAST; + const query = queryEditor == null ? void 0 : queryEditor.getValue(); + if (!documentAST || !query) { + return; + } + queryEditor.setValue(graphql.print(toolkit.mergeAst(documentAST, schema))); + }; + $[5] = queryEditor; + $[6] = schema; + $[7] = t5; + } else { + t5 = $[7]; } - if (kind === "Directive" && step === 1 && typeInfo.directiveDef) { - return SchemaReference.getDirectiveReference(typeInfo); + return t5; +} +function usePrettifyEditors(t0) { + const $ = reactCompilerRuntime.c(8); + let t1; + if ($[0] !== t0) { + t1 = t0 === void 0 ? {} : t0; + $[0] = t0; + $[1] = t1; + } else { + t1 = $[1]; } - if (kind === "Argument" && step === 0 && typeInfo.argDef) { - return SchemaReference.getArgumentReference(typeInfo); + const { + caller + } = t1; + const t2 = caller || _usePrettifyEditors; + let t3; + if ($[2] !== t2) { + t3 = { + nonNull: true, + caller: t2 + }; + $[2] = t2; + $[3] = t3; + } else { + t3 = $[3]; } - if (kind === "EnumValue" && typeInfo.enumValue) { - return SchemaReference.getEnumValueReference(typeInfo); + const { + queryEditor, + headerEditor, + variableEditor + } = useEditorContext(t3); + let t4; + if ($[4] !== headerEditor || $[5] !== queryEditor || $[6] !== variableEditor) { + t4 = () => { + if (variableEditor) { + const variableEditorContent = variableEditor.getValue(); + try { + const prettifiedVariableEditorContent = JSON.stringify(JSON.parse(variableEditorContent), null, 2); + if (prettifiedVariableEditorContent !== variableEditorContent) { + variableEditor.setValue(prettifiedVariableEditorContent); + } + } catch {} + } + if (headerEditor) { + const headerEditorContent = headerEditor.getValue(); + try { + const prettifiedHeaderEditorContent = JSON.stringify(JSON.parse(headerEditorContent), null, 2); + if (prettifiedHeaderEditorContent !== headerEditorContent) { + headerEditor.setValue(prettifiedHeaderEditorContent); + } + } catch {} + } + if (queryEditor) { + const editorContent = queryEditor.getValue(); + const prettifiedEditorContent = graphql.print(graphql.parse(editorContent)); + if (prettifiedEditorContent !== editorContent) { + queryEditor.setValue(prettifiedEditorContent); + } + } + }; + $[4] = headerEditor; + $[5] = queryEditor; + $[6] = variableEditor; + $[7] = t4; + } else { + t4 = $[7]; } - if (kind === "NamedType" && typeInfo.type) { - return SchemaReference.getTypeReference(typeInfo); + return t4; +} +function useAutoCompleteLeafs(t0) { + const $ = reactCompilerRuntime.c(10); + let t1; + if ($[0] !== t0) { + t1 = t0 === void 0 ? {} : t0; + $[0] = t0; + $[1] = t1; + } else { + t1 = $[1]; } -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/lint.cjs.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/lint.cjs.js ***! - \*********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] + const { + getDefaultFieldNames, + caller + } = t1; + const t2 = caller || _useAutoCompleteLeafs; + let t3; + if ($[2] !== t2) { + t3 = { + nonNull: true, + caller: t2 + }; + $[2] = t2; + $[3] = t3; + } else { + t3 = $[3]; + } + const { + schema + } = useSchemaContext(t3); + const t4 = caller || _useAutoCompleteLeafs; + let t5; + if ($[4] !== t4) { + t5 = { + nonNull: true, + caller: t4 + }; + $[4] = t4; + $[5] = t5; + } else { + t5 = $[5]; + } + const { + queryEditor + } = useEditorContext(t5); + let t6; + if ($[6] !== getDefaultFieldNames || $[7] !== queryEditor || $[8] !== schema) { + t6 = () => { + if (!queryEditor) { + return; + } + const query = queryEditor.getValue(); + const { + insertions, + result + } = toolkit.fillLeafs(schema, query, getDefaultFieldNames); + if (insertions && insertions.length > 0) { + queryEditor.operation(() => { + const cursor = queryEditor.getCursor(); + const cursorIndex = queryEditor.indexFromPos(cursor); + queryEditor.setValue(result || ""); + let added; + added = 0; + const markers = insertions.map(t7 => { + const { + index, + string + } = t7; + added = added + string.length; + return queryEditor.markText(queryEditor.posFromIndex(index + added), queryEditor.posFromIndex(index + added), { + className: "auto-inserted-leaf", + clearOnEnter: true, + title: "Automatically added leaf fields" }); + }); + setTimeout(() => { + for (const marker of markers) { + marker.clear(); + } + }, 7e3); + let newCursorIndex = cursorIndex; + for (const { + index: index_0, + string: string_0 + } of insertions) { + if (index_0 < cursorIndex) { + newCursorIndex = newCursorIndex + string_0.length; + } } - } + queryEditor.setCursor(queryEditor.posFromIndex(newCursorIndex)); + }); } - } + return result; + }; + $[6] = getDefaultFieldNames; + $[7] = queryEditor; + $[8] = schema; + $[9] = t6; + } else { + t6 = $[9]; } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); + return t6; } -var lint$2 = { - exports: {} +const useEditorState = editor => { + "use no memo"; + + var _ref2; + const context = useEditorContext({ + nonNull: true + }); + const editorInstance = context[`${editor}Editor`]; + let valueString = ""; + const editorValue = (_ref2 = editorInstance == null ? void 0 : editorInstance.getValue()) !== null && _ref2 !== void 0 ? _ref2 : false; + if (editorValue && editorValue.length > 0) { + valueString = editorValue; + } + const handleEditorValue = React.useCallback(value => editorInstance == null ? void 0 : editorInstance.setValue(value), [editorInstance]); + return React.useMemo(() => [valueString, handleEditorValue], [valueString, handleEditorValue]); }; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - var GUTTER_ID = "CodeMirror-lint-markers"; - var LINT_LINE_ID = "CodeMirror-lint-line-"; - function showTooltip(cm, e, content) { - var tt = document.createElement("div"); - tt.className = "CodeMirror-lint-tooltip cm-s-" + cm.options.theme; - tt.appendChild(content.cloneNode(true)); - if (cm.state.lint.options.selfContain) cm.getWrapperElement().appendChild(tt);else document.body.appendChild(tt); - function position(e2) { - if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position); - tt.style.top = Math.max(0, e2.clientY - tt.offsetHeight - 5) + "px"; - tt.style.left = e2.clientX + 5 + "px"; - } - CodeMirror.on(document, "mousemove", position); - position(e); - if (tt.style.opacity != null) tt.style.opacity = 1; - return tt; - } - function rm(elt) { - if (elt.parentNode) elt.parentNode.removeChild(elt); - } - function hideTooltip(tt) { - if (!tt.parentNode) return; - if (tt.style.opacity == null) rm(tt); - tt.style.opacity = 0; - setTimeout(function () { - rm(tt); - }, 600); - } - function showTooltipFor(cm, e, content, node) { - var tooltip = showTooltip(cm, e, content); - function hide() { - CodeMirror.off(node, "mouseout", hide); - if (tooltip) { - hideTooltip(tooltip); - tooltip = null; - } - } - var poll = setInterval(function () { - if (tooltip) for (var n = node;; n = n.parentNode) { - if (n && n.nodeType == 11) n = n.host; - if (n == document.body) return; - if (!n) { - hide(); - break; +const useOperationsEditorState = () => { + return useEditorState("query"); +}; +const useVariablesEditorState = () => { + return useEditorState("variable"); +}; +const useHeadersEditorState = () => { + return useEditorState("header"); +}; +function useOptimisticState(t0) { + const $ = reactCompilerRuntime.c(12); + const [upstreamState, upstreamSetState] = t0; + let t1; + if ($[0] !== upstreamState) { + t1 = { + pending: null, + last: upstreamState + }; + $[0] = upstreamState; + $[1] = t1; + } else { + t1 = $[1]; + } + const lastStateRef = React.useRef(t1); + const [state, setOperationsText] = React.useState(upstreamState); + let t2; + let t3; + if ($[2] !== state || $[3] !== upstreamSetState || $[4] !== upstreamState) { + t2 = () => { + if (lastStateRef.current.last === upstreamState) ;else { + lastStateRef.current.last = upstreamState; + if (lastStateRef.current.pending === null) { + setOperationsText(upstreamState); + } else { + if (lastStateRef.current.pending === upstreamState) { + lastStateRef.current.pending = null; + if (upstreamState !== state) { + lastStateRef.current.pending = state; + upstreamSetState(state); + } + } else { + lastStateRef.current.pending = null; + setOperationsText(upstreamState); } } - if (!tooltip) return clearInterval(poll); - }, 400); - CodeMirror.on(node, "mouseout", hide); - } - function LintState(cm, conf, hasGutter) { - this.marked = []; - if (conf instanceof Function) conf = { - getAnnotations: conf - }; - if (!conf || conf === true) conf = {}; - this.options = {}; - this.linterOptions = conf.options || {}; - for (var prop in defaults) this.options[prop] = defaults[prop]; - for (var prop in conf) { - if (defaults.hasOwnProperty(prop)) { - if (conf[prop] != null) this.options[prop] = conf[prop]; - } else if (!conf.options) { - this.linterOptions[prop] = conf[prop]; - } - } - this.timeout = null; - this.hasGutter = hasGutter; - this.onMouseOver = function (e) { - onMouseOver(cm, e); - }; - this.waitingFor = 0; - } - var defaults = { - highlightLines: false, - tooltips: true, - delay: 500, - lintOnChange: true, - getAnnotations: null, - async: false, - selfContain: null, - formatAnnotation: null, - onUpdateLinting: null - }; - function clearMarks(cm) { - var state = cm.state.lint; - if (state.hasGutter) cm.clearGutter(GUTTER_ID); - if (state.options.highlightLines) clearErrorLines(cm); - for (var i = 0; i < state.marked.length; ++i) state.marked[i].clear(); - state.marked.length = 0; - } - function clearErrorLines(cm) { - cm.eachLine(function (line) { - var has = line.wrapClass && /\bCodeMirror-lint-line-\w+\b/.exec(line.wrapClass); - if (has) cm.removeLineClass(line, "wrap", has[0]); - }); - } - function makeMarker(cm, labels, severity, multiple, tooltips) { - var marker = document.createElement("div"), - inner = marker; - marker.className = "CodeMirror-lint-marker CodeMirror-lint-marker-" + severity; - if (multiple) { - inner = marker.appendChild(document.createElement("div")); - inner.className = "CodeMirror-lint-marker CodeMirror-lint-marker-multiple"; - } - if (tooltips != false) CodeMirror.on(inner, "mouseover", function (e) { - showTooltipFor(cm, e, labels, inner); - }); - return marker; - } - function getMaxSeverity(a, b) { - if (a == "error") return a;else return b; - } - function groupByLine(annotations) { - var lines = []; - for (var i = 0; i < annotations.length; ++i) { - var ann = annotations[i], - line = ann.from.line; - (lines[line] || (lines[line] = [])).push(ann); - } - return lines; - } - function annotationTooltip(ann) { - var severity = ann.severity; - if (!severity) severity = "error"; - var tip = document.createElement("div"); - tip.className = "CodeMirror-lint-message CodeMirror-lint-message-" + severity; - if (typeof ann.messageHTML != "undefined") { - tip.innerHTML = ann.messageHTML; - } else { - tip.appendChild(document.createTextNode(ann.message)); - } - return tip; - } - function lintAsync(cm, getAnnotations) { - var state = cm.state.lint; - var id = ++state.waitingFor; - function abort() { - id = -1; - cm.off("change", abort); - } - cm.on("change", abort); - getAnnotations(cm.getValue(), function (annotations, arg2) { - cm.off("change", abort); - if (state.waitingFor != id) return; - if (arg2 && annotations instanceof CodeMirror) annotations = arg2; - cm.operation(function () { - updateLinting(cm, annotations); - }); - }, state.linterOptions, cm); - } - function startLinting(cm) { - var state = cm.state.lint; - if (!state) return; - var options = state.options; - var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint"); - if (!getAnnotations) return; - if (options.async || getAnnotations.async) { - lintAsync(cm, getAnnotations); - } else { - var annotations = getAnnotations(cm.getValue(), state.linterOptions, cm); - if (!annotations) return; - if (annotations.then) annotations.then(function (issues) { - cm.operation(function () { - updateLinting(cm, issues); - }); - });else cm.operation(function () { - updateLinting(cm, annotations); - }); } - } - function updateLinting(cm, annotationsNotSorted) { - var state = cm.state.lint; - if (!state) return; - var options = state.options; - clearMarks(cm); - var annotations = groupByLine(annotationsNotSorted); - for (var line = 0; line < annotations.length; ++line) { - var anns = annotations[line]; - if (!anns) continue; - var message = []; - anns = anns.filter(function (item) { - return message.indexOf(item.message) > -1 ? false : message.push(item.message); - }); - var maxSeverity = null; - var tipLabel = state.hasGutter && document.createDocumentFragment(); - for (var i = 0; i < anns.length; ++i) { - var ann = anns[i]; - var severity = ann.severity; - if (!severity) severity = "error"; - maxSeverity = getMaxSeverity(maxSeverity, severity); - if (options.formatAnnotation) ann = options.formatAnnotation(ann); - if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann)); - if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, { - className: "CodeMirror-lint-mark CodeMirror-lint-mark-" + severity, - __annotation: ann - })); - } - if (state.hasGutter) cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, annotations[line].length > 1, options.tooltips)); - if (options.highlightLines) cm.addLineClass(line, "wrap", LINT_LINE_ID + maxSeverity); - } - if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm); - } - function onChange(cm) { - var state = cm.state.lint; - if (!state) return; - clearTimeout(state.timeout); - state.timeout = setTimeout(function () { - startLinting(cm); - }, state.options.delay); - } - function popupTooltips(cm, annotations, e) { - var target = e.target || e.srcElement; - var tooltip = document.createDocumentFragment(); - for (var i = 0; i < annotations.length; i++) { - var ann = annotations[i]; - tooltip.appendChild(annotationTooltip(ann)); - } - showTooltipFor(cm, e, tooltip, target); - } - function onMouseOver(cm, e) { - var target = e.target || e.srcElement; - if (!/\bCodeMirror-lint-mark-/.test(target.className)) return; - var box = target.getBoundingClientRect(), - x = (box.left + box.right) / 2, - y = (box.top + box.bottom) / 2; - var spans = cm.findMarksAt(cm.coordsChar({ - left: x, - top: y - }, "client")); - var annotations = []; - for (var i = 0; i < spans.length; ++i) { - var ann = spans[i].__annotation; - if (ann) annotations.push(ann); - } - if (annotations.length) popupTooltips(cm, annotations, e); - } - CodeMirror.defineOption("lint", false, function (cm, val, old) { - if (old && old != CodeMirror.Init) { - clearMarks(cm); - if (cm.state.lint.options.lintOnChange !== false) cm.off("change", onChange); - CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver); - clearTimeout(cm.state.lint.timeout); - delete cm.state.lint; - } - if (val) { - var gutters = cm.getOption("gutters"), - hasLintGutter = false; - for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true; - var state = cm.state.lint = new LintState(cm, val, hasLintGutter); - if (state.options.lintOnChange) cm.on("change", onChange); - if (state.options.tooltips != false && state.options.tooltips != "gutter") CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); - startLinting(cm); + }; + t3 = [upstreamState, state, upstreamSetState]; + $[2] = state; + $[3] = upstreamSetState; + $[4] = upstreamState; + $[5] = t2; + $[6] = t3; + } else { + t2 = $[5]; + t3 = $[6]; + } + React.useEffect(t2, t3); + let t4; + if ($[7] !== upstreamSetState) { + t4 = newState => { + setOperationsText(newState); + if (lastStateRef.current.pending === null && lastStateRef.current.last !== newState) { + lastStateRef.current.pending = newState; + upstreamSetState(newState); } - }); - CodeMirror.defineExtension("performLint", function () { - startLinting(this); - }); - }); -})(); -var lintExports = lint$2.exports; -const lint = /* @__PURE__ */codemirror.getDefaultExportFromCjs(lintExports); -const lint$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: lint -}, [lintExports]); -exports.lint = lint$1; - -/***/ }), - -/***/ "../../graphiql-react/dist/lint.cjs2.js": -/*!**********************************************!*\ - !*** ../../graphiql-react/dist/lint.cjs2.js ***! - \**********************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -const graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); -const SEVERITY = ["error", "warning", "information", "hint"]; -const TYPE = { - "GraphQL: Validation": "validation", - "GraphQL: Deprecation": "deprecation", - "GraphQL: Syntax": "syntax" -}; -codemirror.CodeMirror.registerHelper("lint", "graphql", (text, options) => { + }; + $[7] = upstreamSetState; + $[8] = t4; + } else { + t4 = $[8]; + } + const setState = t4; + let t5; + if ($[9] !== setState || $[10] !== state) { + t5 = [state, setState]; + $[9] = setState; + $[10] = state; + $[11] = t5; + } else { + t5 = $[11]; + } + return t5; +} +function importCodeMirrorImports$3() { + return importCodeMirror([// @ts-expect-error + Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/mode/javascript/javascript.js */ "../../../node_modules/codemirror/mode/javascript/javascript.js")))]); +} +const _useHeaderEditor = useHeaderEditor; +function useHeaderEditor(t0, caller) { + const $ = reactCompilerRuntime.c(17); + let t1; + if ($[0] !== t0) { + t1 = t0 === void 0 ? {} : t0; + $[0] = t0; + $[1] = t1; + } else { + t1 = $[1]; + } const { - schema, - validationRules, - externalFragments - } = options; - const rawResults = graphqlLanguageService.getDiagnostics(text, schema, validationRules, void 0, externalFragments); - const results = rawResults.map(error => ({ - message: error.message, - severity: error.severity ? SEVERITY[error.severity - 1] : SEVERITY[0], - type: error.source ? TYPE[error.source] : void 0, - from: codemirror.CodeMirror.Pos(error.range.start.line, error.range.start.character), - to: codemirror.CodeMirror.Pos(error.range.end.line, error.range.end.character) - })); - return results; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/lint.cjs3.js": -/*!**********************************************!*\ - !*** ../../graphiql-react/dist/lint.cjs3.js ***! - \**********************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -const graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); -function jsonParse(str) { - string = str; - strLen = str.length; - start = end = lastEnd = -1; - ch(); - lex(); - const ast = parseObj(); - expect("EOF"); - return ast; -} -let string; -let strLen; -let start; -let end; -let lastEnd; -let code; -let kind; -function parseObj() { - const nodeStart = start; - const members = []; - expect("{"); - if (!skip("}")) { - do { - members.push(parseMember()); - } while (skip(",")); - expect("}"); + editorTheme: t2, + keyMap: t3, + onEdit, + readOnly: t4 + } = t1; + const editorTheme = t2 === void 0 ? DEFAULT_EDITOR_THEME : t2; + const keyMap = t3 === void 0 ? DEFAULT_KEY_MAP : t3; + const readOnly = t4 === void 0 ? false : t4; + const t5 = caller || _useHeaderEditor; + let t6; + if ($[2] !== t5) { + t6 = { + nonNull: true, + caller: t5 + }; + $[2] = t5; + $[3] = t6; + } else { + t6 = $[3]; } - return { - kind: "Object", - start: nodeStart, - end: lastEnd, - members - }; -} -function parseMember() { - const nodeStart = start; - const key = kind === "String" ? curToken() : null; - expect("String"); - expect(":"); - const value = parseVal(); - return { - kind: "Member", - start: nodeStart, - end: lastEnd, - key, - value - }; -} -function parseArr() { - const nodeStart = start; - const values = []; - expect("["); - if (!skip("]")) { - do { - values.push(parseVal()); - } while (skip(",")); - expect("]"); + const { + initialHeaders, + headerEditor, + setHeaderEditor, + shouldPersistHeaders + } = useEditorContext(t6); + const executionContext = useExecutionContext(); + const t7 = caller || _useHeaderEditor; + let t8; + if ($[4] !== t7) { + t8 = { + caller: t7 + }; + $[4] = t7; + $[5] = t8; + } else { + t8 = $[5]; + } + const merge = useMergeQuery(t8); + const t9 = caller || _useHeaderEditor; + let t10; + if ($[6] !== t9) { + t10 = { + caller: t9 + }; + $[6] = t9; + $[7] = t10; + } else { + t10 = $[7]; } - return { - kind: "Array", - start: nodeStart, - end: lastEnd, - values - }; -} -function parseVal() { - switch (kind) { - case "[": - return parseArr(); - case "{": - return parseObj(); - case "String": - case "Number": - case "Boolean": - case "Null": - const token = curToken(); - lex(); - return token; + const prettify = usePrettifyEditors(t10); + const ref = React.useRef(null); + let t11; + let t12; + if ($[8] !== editorTheme || $[9] !== initialHeaders || $[10] !== readOnly || $[11] !== setHeaderEditor) { + t11 = () => { + let isActive; + isActive = true; + importCodeMirrorImports$3().then(CodeMirror => { + if (!isActive) { + return; + } + const container = ref.current; + if (!container) { + return; + } + const newEditor = CodeMirror(container, { + value: initialHeaders, + lineNumbers: true, + tabSize: 2, + mode: { + name: "javascript", + json: true + }, + theme: editorTheme, + autoCloseBrackets: true, + matchBrackets: true, + showCursorWhenSelecting: true, + readOnly: readOnly ? "nocursor" : false, + foldGutter: true, + gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], + extraKeys: commonKeys + }); + newEditor.addKeyMap({ + "Cmd-Space"() { + newEditor.showHint({ + completeSingle: false, + container + }); + }, + "Ctrl-Space"() { + newEditor.showHint({ + completeSingle: false, + container + }); + }, + "Alt-Space"() { + newEditor.showHint({ + completeSingle: false, + container + }); + }, + "Shift-Space"() { + newEditor.showHint({ + completeSingle: false, + container + }); + } + }); + newEditor.on("keyup", _temp$2); + setHeaderEditor(newEditor); + }); + return () => { + isActive = false; + }; + }; + t12 = [editorTheme, initialHeaders, readOnly, setHeaderEditor]; + $[8] = editorTheme; + $[9] = initialHeaders; + $[10] = readOnly; + $[11] = setHeaderEditor; + $[12] = t11; + $[13] = t12; + } else { + t11 = $[12]; + t12 = $[13]; } - expect("Value"); -} -function curToken() { - return { - kind, - start, - end, - value: JSON.parse(string.slice(start, end)) - }; -} -function expect(str) { - if (kind === str) { - lex(); - return; + React.useEffect(t11, t12); + useSynchronizeOption(headerEditor, "keyMap", keyMap); + useChangeHandler(headerEditor, onEdit, shouldPersistHeaders ? STORAGE_KEY$3 : null, "headers", _useHeaderEditor); + let t13; + if ($[14] === Symbol.for("react.memo_cache_sentinel")) { + t13 = ["Cmd-Enter", "Ctrl-Enter"]; + $[14] = t13; + } else { + t13 = $[14]; } - let found; - if (kind === "EOF") { - found = "[end of file]"; - } else if (end - start > 1) { - found = "`" + string.slice(start, end) + "`"; + useKeyMap(headerEditor, t13, executionContext == null ? void 0 : executionContext.run); + let t14; + if ($[15] === Symbol.for("react.memo_cache_sentinel")) { + t14 = ["Shift-Ctrl-P"]; + $[15] = t14; } else { - const match = string.slice(start).match(/^.+?\b/); - found = "`" + (match ? match[0] : string[start]) + "`"; + t14 = $[15]; } - throw syntaxError(`Expected ${str} but found ${found}.`); + useKeyMap(headerEditor, t14, prettify); + let t15; + if ($[16] === Symbol.for("react.memo_cache_sentinel")) { + t15 = ["Shift-Ctrl-M"]; + $[16] = t15; + } else { + t15 = $[16]; + } + useKeyMap(headerEditor, t15, merge); + return ref; } -class JSONSyntaxError extends Error { - constructor(message, position) { - super(message); - this.position = position; +function _temp$2(editorInstance, event) { + const { + code, + key, + shiftKey + } = event; + const isLetter = code.startsWith("Key"); + const isNumber = !shiftKey && code.startsWith("Digit"); + if (isLetter || isNumber || key === "_" || key === '"') { + editorInstance.execCommand("autocomplete"); } } -function syntaxError(message) { - return new JSONSyntaxError(message, { - start, - end - }); +const STORAGE_KEY$3 = "headers"; +const invalidCharacters = Array.from({ + length: 11 +}, (_, i) => { + return String.fromCharCode(8192 + i); +}).concat(["\u2028", "\u2029", " ", " "]); +const sanitizeRegex = new RegExp("[" + invalidCharacters.join("") + "]", "g"); +function normalizeWhitespace(line) { + return line.replace(sanitizeRegex, " "); } -function skip(k) { - if (kind === k) { - lex(); - return true; +function importCodeMirrorImports$2() { + return importCodeMirror([Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/comment/comment.js */ "../../../node_modules/codemirror/addon/comment/comment.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/search/search.js */ "../../../node_modules/codemirror/addon/search/search.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/hint.js */ "../../codemirror-graphql/esm/hint.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/lint.js */ "../../codemirror-graphql/esm/lint.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/info.js */ "../../codemirror-graphql/esm/info.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/jump.js */ "../../codemirror-graphql/esm/jump.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/mode.js */ "../../codemirror-graphql/esm/mode.js")))]); +} +const _useQueryEditor = useQueryEditor; +function updateVariableEditor(variableEditor, operationFacts) { + variableEditor.state.lint.linterOptions.variableToType = operationFacts == null ? void 0 : operationFacts.variableToType; + variableEditor.options.lint.variableToType = operationFacts == null ? void 0 : operationFacts.variableToType; + variableEditor.options.hintOptions.variableToType = operationFacts == null ? void 0 : operationFacts.variableToType; +} +function updateEditorSchema(editor, schema) { + editor.state.lint.linterOptions.schema = schema; + editor.options.lint.schema = schema; + editor.options.hintOptions.schema = schema; + editor.options.info.schema = schema; + editor.options.jump.schema = schema; +} +function updateEditorValidationRules(editor, validationRules) { + editor.state.lint.linterOptions.validationRules = validationRules; + editor.options.lint.validationRules = validationRules; +} +function updateEditorExternalFragments(editor, externalFragmentList) { + editor.state.lint.linterOptions.externalFragments = externalFragmentList; + editor.options.lint.externalFragments = externalFragmentList; + editor.options.hintOptions.externalFragments = externalFragmentList; +} +function useQueryEditor(t0, caller) { + const $ = reactCompilerRuntime.c(41); + let t1; + if ($[0] !== t0) { + t1 = t0 === void 0 ? {} : t0; + $[0] = t0; + $[1] = t1; + } else { + t1 = $[1]; } -} -function ch() { - if (end < strLen) { - end++; - code = end === strLen ? 0 : string.charCodeAt(end); + const { + editorTheme: t2, + keyMap: t3, + onClickReference, + onCopyQuery, + onEdit, + readOnly: t4 + } = t1; + const editorTheme = t2 === void 0 ? DEFAULT_EDITOR_THEME : t2; + const keyMap = t3 === void 0 ? DEFAULT_KEY_MAP : t3; + const readOnly = t4 === void 0 ? false : t4; + const t5 = caller || _useQueryEditor; + let t6; + if ($[2] !== t5) { + t6 = { + nonNull: true, + caller: t5 + }; + $[2] = t5; + $[3] = t6; + } else { + t6 = $[3]; } - return code; -} -function lex() { - lastEnd = end; - while (code === 9 || code === 10 || code === 13 || code === 32) { - ch(); + const { + schema + } = useSchemaContext(t6); + const t7 = caller || _useQueryEditor; + let t8; + if ($[4] !== t7) { + t8 = { + nonNull: true, + caller: t7 + }; + $[4] = t7; + $[5] = t8; + } else { + t8 = $[5]; } - if (code === 0) { - kind = "EOF"; - return; + const { + externalFragments, + initialQuery, + queryEditor, + setOperationName, + setQueryEditor, + validationRules, + variableEditor, + updateActiveTabValues + } = useEditorContext(t8); + const executionContext = useExecutionContext(); + const storage = useStorageContext(); + const explorer = useExplorerContext(); + const plugin = usePluginContext(); + const t9 = caller || _useQueryEditor; + let t10; + if ($[6] !== onCopyQuery || $[7] !== t9) { + t10 = { + caller: t9, + onCopyQuery + }; + $[6] = onCopyQuery; + $[7] = t9; + $[8] = t10; + } else { + t10 = $[8]; + } + const copy = useCopyQuery(t10); + const t11 = caller || _useQueryEditor; + let t12; + if ($[9] !== t11) { + t12 = { + caller: t11 + }; + $[9] = t11; + $[10] = t12; + } else { + t12 = $[10]; + } + const merge = useMergeQuery(t12); + const t13 = caller || _useQueryEditor; + let t14; + if ($[11] !== t13) { + t14 = { + caller: t13 + }; + $[11] = t13; + $[12] = t14; + } else { + t14 = $[12]; } - start = end; - switch (code) { - case 34: - kind = "String"; - return readString(); - case 45: - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - kind = "Number"; - return readNumber(); - case 102: - if (string.slice(start, start + 5) !== "false") { - break; - } - end += 4; - ch(); - kind = "Boolean"; - return; - case 110: - if (string.slice(start, start + 4) !== "null") { - break; - } - end += 3; - ch(); - kind = "Null"; - return; - case 116: - if (string.slice(start, start + 4) !== "true") { - break; - } - end += 3; - ch(); - kind = "Boolean"; - return; + const prettify = usePrettifyEditors(t14); + const ref = React.useRef(null); + const codeMirrorRef = React.useRef(); + const onClickReferenceRef = React.useRef(_temp$1); + let t15; + let t16; + if ($[13] !== explorer || $[14] !== onClickReference || $[15] !== plugin) { + t15 = () => { + onClickReferenceRef.current = reference => { + if (!explorer || !plugin) { + return; + } + plugin.setVisiblePlugin(DOC_EXPLORER_PLUGIN); + bb47: switch (reference.kind) { + case "Type": + { + explorer.push({ + name: reference.type.name, + def: reference.type + }); + break bb47; + } + case "Field": + { + explorer.push({ + name: reference.field.name, + def: reference.field + }); + break bb47; + } + case "Argument": + { + if (reference.field) { + explorer.push({ + name: reference.field.name, + def: reference.field + }); + } + break bb47; + } + case "EnumValue": + { + if (reference.type) { + explorer.push({ + name: reference.type.name, + def: reference.type + }); + } + } + } + onClickReference == null ? void 0 : onClickReference(reference); + }; + }; + t16 = [explorer, onClickReference, plugin]; + $[13] = explorer; + $[14] = onClickReference; + $[15] = plugin; + $[16] = t15; + $[17] = t16; + } else { + t15 = $[16]; + t16 = $[17]; + } + React.useEffect(t15, t16); + let t17; + let t18; + if ($[18] !== editorTheme || $[19] !== initialQuery || $[20] !== readOnly || $[21] !== setQueryEditor) { + t17 = () => { + let isActive; + isActive = true; + importCodeMirrorImports$2().then(CodeMirror => { + if (!isActive) { + return; + } + codeMirrorRef.current = CodeMirror; + const container = ref.current; + if (!container) { + return; + } + const newEditor = CodeMirror(container, { + value: initialQuery, + lineNumbers: true, + tabSize: 2, + foldGutter: true, + mode: "graphql", + theme: editorTheme, + autoCloseBrackets: true, + matchBrackets: true, + showCursorWhenSelecting: true, + readOnly: readOnly ? "nocursor" : false, + lint: { + schema: void 0, + validationRules: null, + externalFragments: void 0 + }, + hintOptions: { + schema: void 0, + closeOnUnfocus: false, + completeSingle: false, + container, + externalFragments: void 0, + autocompleteOptions: { + mode: graphqlLanguageService.GraphQLDocumentMode.EXECUTABLE + } + }, + info: { + schema: void 0, + renderDescription: _temp2, + onClick(reference_0) { + onClickReferenceRef.current(reference_0); + } + }, + jump: { + schema: void 0, + onClick(reference_1) { + onClickReferenceRef.current(reference_1); + } + }, + gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], + extraKeys: { + ...commonKeys, + "Cmd-S"() {}, + "Ctrl-S"() {} + } + }); + newEditor.addKeyMap({ + "Cmd-Space"() { + newEditor.showHint({ + completeSingle: true, + container + }); + }, + "Ctrl-Space"() { + newEditor.showHint({ + completeSingle: true, + container + }); + }, + "Alt-Space"() { + newEditor.showHint({ + completeSingle: true, + container + }); + }, + "Shift-Space"() { + newEditor.showHint({ + completeSingle: true, + container + }); + }, + "Shift-Alt-Space"() { + newEditor.showHint({ + completeSingle: true, + container + }); + } + }); + newEditor.on("keyup", _temp3); + let showingHints; + showingHints = false; + newEditor.on("startCompletion", () => { + showingHints = true; + }); + newEditor.on("endCompletion", () => { + showingHints = false; + }); + newEditor.on("keydown", (editorInstance_0, event_0) => { + if (event_0.key === "Escape" && showingHints) { + event_0.stopPropagation(); + } + }); + newEditor.on("beforeChange", _temp4); + newEditor.documentAST = null; + newEditor.operationName = null; + newEditor.operations = null; + newEditor.variableToType = null; + setQueryEditor(newEditor); + }); + return () => { + isActive = false; + }; + }; + t18 = [editorTheme, initialQuery, readOnly, setQueryEditor]; + $[18] = editorTheme; + $[19] = initialQuery; + $[20] = readOnly; + $[21] = setQueryEditor; + $[22] = t17; + $[23] = t18; + } else { + t17 = $[22]; + t18 = $[23]; } - kind = string[start]; - ch(); -} -function readString() { - ch(); - while (code !== 34 && code > 31) { - if (code === 92) { - code = ch(); - switch (code) { - case 34: - case 47: - case 92: - case 98: - case 102: - case 110: - case 114: - case 116: - ch(); - break; - case 117: - ch(); - readHex(); - readHex(); - readHex(); - readHex(); - break; - default: - throw syntaxError("Bad character escape sequence."); + React.useEffect(t17, t18); + useSynchronizeOption(queryEditor, "keyMap", keyMap); + let t19; + let t20; + if ($[24] !== onEdit || $[25] !== queryEditor || $[26] !== schema || $[27] !== setOperationName || $[28] !== storage || $[29] !== updateActiveTabValues || $[30] !== variableEditor) { + t19 = () => { + if (!queryEditor) { + return; } - } else if (end === strLen) { - throw syntaxError("Unterminated string."); - } else { - ch(); - } - } - if (code === 34) { - ch(); - return; + const getAndUpdateOperationFacts = function getAndUpdateOperationFacts2(editorInstance_2) { + var _editorInstance_2$ope, _editorInstance_2$ope2, _ref3, _ref4; + var _a; + const operationFacts = graphqlLanguageService.getOperationFacts(schema, editorInstance_2.getValue()); + const operationName = toolkit.getSelectedOperationName((_editorInstance_2$ope = editorInstance_2.operations) !== null && _editorInstance_2$ope !== void 0 ? _editorInstance_2$ope : void 0, (_editorInstance_2$ope2 = editorInstance_2.operationName) !== null && _editorInstance_2$ope2 !== void 0 ? _editorInstance_2$ope2 : void 0, operationFacts == null ? void 0 : operationFacts.operations); + editorInstance_2.documentAST = (_ref3 = operationFacts == null ? void 0 : operationFacts.documentAST) !== null && _ref3 !== void 0 ? _ref3 : null; + editorInstance_2.operationName = operationName !== null && operationName !== void 0 ? operationName : null; + editorInstance_2.operations = (_ref4 = operationFacts == null ? void 0 : operationFacts.operations) !== null && _ref4 !== void 0 ? _ref4 : null; + if (variableEditor) { + updateVariableEditor(variableEditor, operationFacts); + (_a = codeMirrorRef.current) == null ? void 0 : _a.signal(variableEditor, "change", variableEditor); + } + return operationFacts ? { + ...operationFacts, + operationName + } : null; + }; + const handleChange = debounce(100, editorInstance_3 => { + var _ref5; + const query = editorInstance_3.getValue(); + storage == null ? void 0 : storage.set(STORAGE_KEY_QUERY, query); + const currentOperationName = editorInstance_3.operationName; + const operationFacts_0 = getAndUpdateOperationFacts(editorInstance_3); + if ((operationFacts_0 == null ? void 0 : operationFacts_0.operationName) !== void 0) { + storage == null ? void 0 : storage.set(STORAGE_KEY_OPERATION_NAME, operationFacts_0.operationName); + } + onEdit == null ? void 0 : onEdit(query, operationFacts_0 == null ? void 0 : operationFacts_0.documentAST); + if ((operationFacts_0 == null ? void 0 : operationFacts_0.operationName) && currentOperationName !== operationFacts_0.operationName) { + setOperationName(operationFacts_0.operationName); + } + updateActiveTabValues({ + query, + operationName: (_ref5 = operationFacts_0 == null ? void 0 : operationFacts_0.operationName) !== null && _ref5 !== void 0 ? _ref5 : null + }); + }); + getAndUpdateOperationFacts(queryEditor); + queryEditor.on("change", handleChange); + return () => queryEditor.off("change", handleChange); + }; + t20 = [onEdit, queryEditor, schema, setOperationName, storage, variableEditor, updateActiveTabValues]; + $[24] = onEdit; + $[25] = queryEditor; + $[26] = schema; + $[27] = setOperationName; + $[28] = storage; + $[29] = updateActiveTabValues; + $[30] = variableEditor; + $[31] = t19; + $[32] = t20; + } else { + t19 = $[31]; + t20 = $[32]; } - throw syntaxError("Unterminated string."); -} -function readHex() { - if (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102) { - return ch(); + React.useEffect(t19, t20); + useSynchronizeSchema(queryEditor, schema !== null && schema !== void 0 ? schema : null, codeMirrorRef); + useSynchronizeValidationRules(queryEditor, validationRules !== null && validationRules !== void 0 ? validationRules : null, codeMirrorRef); + useSynchronizeExternalFragments(queryEditor, externalFragments, codeMirrorRef); + useCompletion(queryEditor, onClickReference || null, _useQueryEditor); + const run = executionContext == null ? void 0 : executionContext.run; + let t21; + if ($[33] !== queryEditor || $[34] !== run || $[35] !== setOperationName) { + t21 = () => { + var _a; + if (!run || !queryEditor || !queryEditor.operations || !queryEditor.hasFocus()) { + run == null ? void 0 : run(); + return; + } + const cursorIndex = queryEditor.indexFromPos(queryEditor.getCursor()); + let operationName_0; + for (const operation of queryEditor.operations) { + if (operation.loc && operation.loc.start <= cursorIndex && operation.loc.end >= cursorIndex) { + operationName_0 = (_a = operation.name) == null ? void 0 : _a.value; + } + } + if (operationName_0 && operationName_0 !== queryEditor.operationName) { + setOperationName(operationName_0); + } + run(); + }; + $[33] = queryEditor; + $[34] = run; + $[35] = setOperationName; + $[36] = t21; + } else { + t21 = $[36]; } - throw syntaxError("Expected hexadecimal digit."); -} -function readNumber() { - if (code === 45) { - ch(); + const runAtCursor = t21; + let t22; + if ($[37] === Symbol.for("react.memo_cache_sentinel")) { + t22 = ["Cmd-Enter", "Ctrl-Enter"]; + $[37] = t22; + } else { + t22 = $[37]; } - if (code === 48) { - ch(); + useKeyMap(queryEditor, t22, runAtCursor); + let t23; + if ($[38] === Symbol.for("react.memo_cache_sentinel")) { + t23 = ["Shift-Ctrl-C"]; + $[38] = t23; } else { - readDigits(); + t23 = $[38]; } - if (code === 46) { - ch(); - readDigits(); + useKeyMap(queryEditor, t23, copy); + let t24; + if ($[39] === Symbol.for("react.memo_cache_sentinel")) { + t24 = ["Shift-Ctrl-P", "Shift-Ctrl-F"]; + $[39] = t24; + } else { + t24 = $[39]; } - if (code === 69 || code === 101) { - code = ch(); - if (code === 43 || code === 45) { - ch(); - } - readDigits(); + useKeyMap(queryEditor, t24, prettify); + let t25; + if ($[40] === Symbol.for("react.memo_cache_sentinel")) { + t25 = ["Shift-Ctrl-M"]; + $[40] = t25; + } else { + t25 = $[40]; } + useKeyMap(queryEditor, t25, merge); + return ref; } -function readDigits() { - if (code < 48 || code > 57) { - throw syntaxError("Expected decimal digit."); +function _temp4(editorInstance_1, change) { + var _a; + if (change.origin === "paste") { + const text_0 = change.text.map(normalizeWhitespace); + (_a = change.update) == null ? void 0 : _a.call(change, change.from, change.to, text_0); } - do { - ch(); - } while (code >= 48 && code <= 57); } -codemirror.CodeMirror.registerHelper("lint", "graphql-variables", (text, options, editor) => { - if (!text) { - return []; - } - let ast; - try { - ast = jsonParse(text); - } catch (error) { - if (error instanceof JSONSyntaxError) { - return [lintError(editor, error.position, error.message)]; - } - throw error; - } - const { - variableToType - } = options; - if (!variableToType) { - return []; +function _temp3(editorInstance, event) { + if (AUTO_COMPLETE_AFTER_KEY.test(event.key)) { + editorInstance.execCommand("autocomplete"); } - return validateVariables(editor, variableToType, ast); -}); -function validateVariables(editor, variableToType, variablesAST) { - var _a; - const errors = []; - for (const member of variablesAST.members) { - if (member) { - const variableName = (_a = member.key) === null || _a === void 0 ? void 0 : _a.value; - const type = variableToType[variableName]; - if (type) { - for (const [node, message] of validateValue(type, member.value)) { - errors.push(lintError(editor, node, message)); - } - } else { - errors.push(lintError(editor, member.key, `Variable "$${variableName}" does not appear in any GraphQL query.`)); +} +function _temp2(text) { + return markdown.render(text); +} +function _temp$1() {} +function useSynchronizeSchema(editor, schema, codeMirrorRef) { + const $ = reactCompilerRuntime.c(5); + let t0; + let t1; + if ($[0] !== codeMirrorRef || $[1] !== editor || $[2] !== schema) { + t0 = () => { + if (!editor) { + return; } - } + const didChange = editor.options.lint.schema !== schema; + updateEditorSchema(editor, schema); + if (didChange && codeMirrorRef.current) { + codeMirrorRef.current.signal(editor, "change", editor); + } + }; + t1 = [editor, schema, codeMirrorRef]; + $[0] = codeMirrorRef; + $[1] = editor; + $[2] = schema; + $[3] = t0; + $[4] = t1; + } else { + t0 = $[3]; + t1 = $[4]; } - return errors; + React.useEffect(t0, t1); } -function validateValue(type, valueAST) { - if (!type || !valueAST) { - return []; - } - if (type instanceof graphql.GraphQLNonNull) { - if (valueAST.kind === "Null") { - return [[valueAST, `Type "${type}" is non-nullable and cannot be null.`]]; - } - return validateValue(type.ofType, valueAST); +function useSynchronizeValidationRules(editor, validationRules, codeMirrorRef) { + const $ = reactCompilerRuntime.c(5); + let t0; + let t1; + if ($[0] !== codeMirrorRef || $[1] !== editor || $[2] !== validationRules) { + t0 = () => { + if (!editor) { + return; + } + const didChange = editor.options.lint.validationRules !== validationRules; + updateEditorValidationRules(editor, validationRules); + if (didChange && codeMirrorRef.current) { + codeMirrorRef.current.signal(editor, "change", editor); + } + }; + t1 = [editor, validationRules, codeMirrorRef]; + $[0] = codeMirrorRef; + $[1] = editor; + $[2] = validationRules; + $[3] = t0; + $[4] = t1; + } else { + t0 = $[3]; + t1 = $[4]; } - if (valueAST.kind === "Null") { - return []; + React.useEffect(t0, t1); +} +function useSynchronizeExternalFragments(editor, externalFragments, codeMirrorRef) { + const $ = reactCompilerRuntime.c(9); + let t0; + if ($[0] !== externalFragments) { + t0 = externalFragments.values(); + $[0] = externalFragments; + $[1] = t0; + } else { + t0 = $[1]; } - if (type instanceof graphql.GraphQLList) { - const itemType = type.ofType; - if (valueAST.kind === "Array") { - const values = valueAST.values || []; - return mapCat(values, item => validateValue(itemType, item)); - } - return validateValue(itemType, valueAST); + let t1; + if ($[2] !== t0) { + t1 = [...t0]; + $[2] = t0; + $[3] = t1; + } else { + t1 = $[3]; + } + const externalFragmentList = t1; + let t2; + let t3; + if ($[4] !== codeMirrorRef || $[5] !== editor || $[6] !== externalFragmentList) { + t2 = () => { + if (!editor) { + return; + } + const didChange = editor.options.lint.externalFragments !== externalFragmentList; + updateEditorExternalFragments(editor, externalFragmentList); + if (didChange && codeMirrorRef.current) { + codeMirrorRef.current.signal(editor, "change", editor); + } + }; + t3 = [editor, externalFragmentList, codeMirrorRef]; + $[4] = codeMirrorRef; + $[5] = editor; + $[6] = externalFragmentList; + $[7] = t2; + $[8] = t3; + } else { + t2 = $[7]; + t3 = $[8]; } - if (type instanceof graphql.GraphQLInputObjectType) { - if (valueAST.kind !== "Object") { - return [[valueAST, `Type "${type}" must be an Object.`]]; + React.useEffect(t2, t3); +} +const AUTO_COMPLETE_AFTER_KEY = /^[a-zA-Z0-9_@(]$/; +const STORAGE_KEY_QUERY = "query"; +const STORAGE_KEY_OPERATION_NAME = "operationName"; +function getDefaultTabState({ + defaultQuery, + defaultHeaders, + headers, + defaultTabs, + query, + variables, + storage, + shouldPersistHeaders +}) { + const storedState = storage == null ? void 0 : storage.get(STORAGE_KEY$2); + try { + if (!storedState) { + throw new Error("Storage for tabs is empty"); } - const providedFields = /* @__PURE__ */Object.create(null); - const fieldErrors = mapCat(valueAST.members, member => { - var _a; - const fieldName = (_a = member === null || member === void 0 ? void 0 : member.key) === null || _a === void 0 ? void 0 : _a.value; - providedFields[fieldName] = true; - const inputField = type.getFields()[fieldName]; - if (!inputField) { - return [[member.key, `Type "${type}" does not have a field "${fieldName}".`]]; + const parsed = JSON.parse(storedState); + const headersForHash = shouldPersistHeaders ? headers : void 0; + if (isTabsState(parsed)) { + const expectedHash = hashFromTabContents({ + query, + variables, + headers: headersForHash + }); + let matchingTabIndex = -1; + for (let index = 0; index < parsed.tabs.length; index++) { + const tab = parsed.tabs[index]; + tab.hash = hashFromTabContents({ + query: tab.query, + variables: tab.variables, + headers: tab.headers + }); + if (tab.hash === expectedHash) { + matchingTabIndex = index; + } } - const fieldType = inputField ? inputField.type : void 0; - return validateValue(fieldType, member.value); - }); - for (const fieldName of Object.keys(type.getFields())) { - const field = type.getFields()[fieldName]; - if (!providedFields[fieldName] && field.type instanceof graphql.GraphQLNonNull && !field.defaultValue) { - fieldErrors.push([valueAST, `Object of type "${type}" is missing required field "${fieldName}".`]); + if (matchingTabIndex >= 0) { + parsed.activeTabIndex = matchingTabIndex; + } else { + const operationName = query ? fuzzyExtractOperationName(query) : null; + parsed.tabs.push({ + id: guid(), + hash: expectedHash, + title: operationName || DEFAULT_TITLE, + query, + variables, + headers, + operationName, + response: null + }); + parsed.activeTabIndex = parsed.tabs.length - 1; } + return parsed; } - return fieldErrors; - } - if (type.name === "Boolean" && valueAST.kind !== "Boolean" || type.name === "String" && valueAST.kind !== "String" || type.name === "ID" && valueAST.kind !== "Number" && valueAST.kind !== "String" || type.name === "Float" && valueAST.kind !== "Number" || type.name === "Int" && (valueAST.kind !== "Number" || (valueAST.value | 0) !== valueAST.value)) { - return [[valueAST, `Expected value of type "${type}".`]]; - } - if ((type instanceof graphql.GraphQLEnumType || type instanceof graphql.GraphQLScalarType) && (valueAST.kind !== "String" && valueAST.kind !== "Number" && valueAST.kind !== "Boolean" && valueAST.kind !== "Null" || isNullish(type.parseValue(valueAST.value)))) { - return [[valueAST, `Expected value of type "${type}".`]]; + throw new Error("Storage for tabs is invalid"); + } catch { + return { + activeTabIndex: 0, + tabs: (defaultTabs || [{ + query: query !== null && query !== void 0 ? query : defaultQuery, + variables, + headers: headers !== null && headers !== void 0 ? headers : defaultHeaders + }]).map(createTab) + }; } - return []; } -function lintError(editor, node, message) { - return { - message, - severity: "error", - type: "validation", - from: editor.posFromIndex(node.start), - to: editor.posFromIndex(node.end) - }; +function isTabsState(obj) { + return obj && typeof obj === "object" && !Array.isArray(obj) && hasNumberKey(obj, "activeTabIndex") && "tabs" in obj && Array.isArray(obj.tabs) && obj.tabs.every(isTabState); } -function isNullish(value) { - return value === null || value === void 0 || value !== value; +function isTabState(obj) { + return obj && typeof obj === "object" && !Array.isArray(obj) && hasStringKey(obj, "id") && hasStringKey(obj, "title") && hasStringOrNullKey(obj, "query") && hasStringOrNullKey(obj, "variables") && hasStringOrNullKey(obj, "headers") && hasStringOrNullKey(obj, "operationName") && hasStringOrNullKey(obj, "response"); } -function mapCat(array, mapper) { - return Array.prototype.concat.apply([], array.map(mapper)); +function hasNumberKey(obj, key) { + return key in obj && typeof obj[key] === "number"; } - -/***/ }), - -/***/ "../../graphiql-react/dist/matchbrackets.cjs.js": -/*!******************************************************!*\ - !*** ../../graphiql-react/dist/matchbrackets.cjs.js ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -const matchbrackets$2 = __webpack_require__(/*! ./matchbrackets.cjs2.js */ "../../graphiql-react/dist/matchbrackets.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - } - } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); +function hasStringKey(obj, key) { + return key in obj && typeof obj[key] === "string"; } -var matchbracketsExports = matchbrackets$2.requireMatchbrackets(); -const matchbrackets = /* @__PURE__ */codemirror.getDefaultExportFromCjs(matchbracketsExports); -const matchbrackets$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: matchbrackets -}, [matchbracketsExports]); -exports.matchbrackets = matchbrackets$1; - -/***/ }), - -/***/ "../../graphiql-react/dist/matchbrackets.cjs2.js": -/*!*******************************************************!*\ - !*** ../../graphiql-react/dist/matchbrackets.cjs2.js ***! - \*******************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -var matchbrackets = { - exports: {} -}; -var hasRequiredMatchbrackets; -function requireMatchbrackets() { - if (hasRequiredMatchbrackets) return matchbrackets.exports; - hasRequiredMatchbrackets = 1; - (function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - var ie_lt8 = /MSIE \d/.test(navigator.userAgent) && (document.documentMode == null || document.documentMode < 8); - var Pos = CodeMirror.Pos; - var matching = { - "(": ")>", - ")": "(<", - "[": "]>", - "]": "[<", - "{": "}>", - "}": "{<", - "<": ">>", - ">": "<<" - }; - function bracketRegex(config) { - return config && config.bracketRegex || /[(){}[\]]/; - } - function findMatchingBracket(cm, where, config) { - var line = cm.getLineHandle(where.line), - pos = where.ch - 1; - var afterCursor = config && config.afterCursor; - if (afterCursor == null) afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className); - var re = bracketRegex(config); - var match = !afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)] || re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)]; - if (!match) return null; - var dir = match.charAt(1) == ">" ? 1 : -1; - if (config && config.strict && dir > 0 != (pos == where.ch)) return null; - var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); - var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config); - if (found == null) return null; - return { - from: Pos(where.line, pos), - to: found && found.pos, - match: found && found.ch == match.charAt(0), - forward: dir > 0 - }; - } - function scanForBracket(cm, where, dir, style, config) { - var maxScanLen = config && config.maxScanLineLength || 1e4; - var maxScanLines = config && config.maxScanLines || 1e3; - var stack = []; - var re = bracketRegex(config); - var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) : Math.max(cm.firstLine() - 1, where.line - maxScanLines); - for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { - var line = cm.getLine(lineNo); - if (!line) continue; - var pos = dir > 0 ? 0 : line.length - 1, - end = dir > 0 ? line.length : -1; - if (line.length > maxScanLen) continue; - if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); - for (; pos != end; pos += dir) { - var ch = line.charAt(pos); - if (re.test(ch) && (style === void 0 || (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || "") == (style || ""))) { - var match = matching[ch]; - if (match && match.charAt(1) == ">" == dir > 0) stack.push(ch);else if (!stack.length) return { - pos: Pos(lineNo, pos), - ch - };else stack.pop(); - } - } - } - return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null; - } - function matchBrackets(cm, autoclear, config) { - var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1e3, - highlightNonMatching = config && config.highlightNonMatching; - var marks = [], - ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config); - if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) { - var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; - marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), { - className: style - })); - if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), { - className: style - })); - } - } - if (marks.length) { - if (ie_lt8 && cm.state.focused) cm.focus(); - var clear = function () { - cm.operation(function () { - for (var i2 = 0; i2 < marks.length; i2++) marks[i2].clear(); - }); - }; - if (autoclear) setTimeout(clear, 800);else return clear; - } - } - function doMatchBrackets(cm) { - cm.operation(function () { - if (cm.state.matchBrackets.currentlyHighlighted) { - cm.state.matchBrackets.currentlyHighlighted(); - cm.state.matchBrackets.currentlyHighlighted = null; - } - cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); - }); - } - function clearHighlighted(cm) { - if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) { - cm.state.matchBrackets.currentlyHighlighted(); - cm.state.matchBrackets.currentlyHighlighted = null; - } - } - CodeMirror.defineOption("matchBrackets", false, function (cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.off("cursorActivity", doMatchBrackets); - cm.off("focus", doMatchBrackets); - cm.off("blur", clearHighlighted); - clearHighlighted(cm); - } - if (val) { - cm.state.matchBrackets = typeof val == "object" ? val : {}; - cm.on("cursorActivity", doMatchBrackets); - cm.on("focus", doMatchBrackets); - cm.on("blur", clearHighlighted); - } - }); - CodeMirror.defineExtension("matchBrackets", function () { - matchBrackets(this, true); - }); - CodeMirror.defineExtension("findMatchingBracket", function (pos, config, oldConfig) { - if (oldConfig || typeof config == "boolean") { - if (!oldConfig) { - config = config ? { - strict: true - } : null; - } else { - oldConfig.strict = config; - config = oldConfig; - } - } - return findMatchingBracket(this, pos, config); - }); - CodeMirror.defineExtension("scanForBracket", function (pos, dir, style, config) { - return scanForBracket(this, pos, dir, style, config); - }); +function hasStringOrNullKey(obj, key) { + return key in obj && (typeof obj[key] === "string" || obj[key] === null); +} +function useSynchronizeActiveTabValues({ + queryEditor, + variableEditor, + headerEditor, + responseEditor +}) { + return React.useCallback(state => { + var _ref6, _ref7, _ref8, _ref9, _ref10; + const query = (_ref6 = queryEditor == null ? void 0 : queryEditor.getValue()) !== null && _ref6 !== void 0 ? _ref6 : null; + const variables = (_ref7 = variableEditor == null ? void 0 : variableEditor.getValue()) !== null && _ref7 !== void 0 ? _ref7 : null; + const headers = (_ref8 = headerEditor == null ? void 0 : headerEditor.getValue()) !== null && _ref8 !== void 0 ? _ref8 : null; + const operationName = (_ref9 = queryEditor == null ? void 0 : queryEditor.operationName) !== null && _ref9 !== void 0 ? _ref9 : null; + const response = (_ref10 = responseEditor == null ? void 0 : responseEditor.getValue()) !== null && _ref10 !== void 0 ? _ref10 : null; + return setPropertiesInActiveTab(state, { + query, + variables, + headers, + response, + operationName }); - })(); - return matchbrackets.exports; + }, [queryEditor, variableEditor, headerEditor, responseEditor]); } -exports.requireMatchbrackets = requireMatchbrackets; - -/***/ }), - -/***/ "../../graphiql-react/dist/mode-indent.cjs.js": -/*!****************************************************!*\ - !*** ../../graphiql-react/dist/mode-indent.cjs.js ***! - \****************************************************/ -/***/ (function(__unused_webpack_module, exports) { - - - -function indent(state, textAfter) { - var _a, _b; - const { - levels, - indentLevel - } = state; - const level = !levels || levels.length === 0 ? indentLevel : levels.at(-1) - (((_a = this.electricInput) === null || _a === void 0 ? void 0 : _a.test(textAfter)) ? 1 : 0); - return (level || 0) * (((_b = this.config) === null || _b === void 0 ? void 0 : _b.indentUnit) || 0); +function serializeTabState(tabState, shouldPersistHeaders = false) { + return JSON.stringify(tabState, (key, value) => key === "hash" || key === "response" || !shouldPersistHeaders && key === "headers" ? null : value); } -exports.indent = indent; - -/***/ }), - -/***/ "../../graphiql-react/dist/mode.cjs.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/mode.cjs.js ***! - \*********************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -const graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); -const modeIndent = __webpack_require__(/*! ./mode-indent.cjs.js */ "../../graphiql-react/dist/mode-indent.cjs.js"); -const graphqlModeFactory = config => { - const parser = graphqlLanguageService.onlineParser({ - eatWhitespace: stream => stream.eatWhile(graphqlLanguageService.isIgnored), - lexRules: graphqlLanguageService.LexRules, - parseRules: graphqlLanguageService.ParseRules, - editorConfig: { - tabSize: config.tabSize - } - }); - return { - config, - startState: parser.startState, - token: parser.token, - indent: modeIndent.indent, - electricInput: /^\s*[})\]]/, - fold: "brace", - lineComment: "#", - closeBrackets: { - pairs: '()[]{}""', - explode: "()[]{}" - } - }; -}; -codemirror.CodeMirror.defineMode("graphql", graphqlModeFactory); - -/***/ }), - -/***/ "../../graphiql-react/dist/mode.cjs2.js": -/*!**********************************************!*\ - !*** ../../graphiql-react/dist/mode.cjs2.js ***! - \**********************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -const graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); -const modeIndent = __webpack_require__(/*! ./mode-indent.cjs.js */ "../../graphiql-react/dist/mode-indent.cjs.js"); -codemirror.CodeMirror.defineMode("graphql-variables", config => { - const parser = graphqlLanguageService.onlineParser({ - eatWhitespace: stream => stream.eatSpace(), - lexRules: LexRules, - parseRules: ParseRules, - editorConfig: { - tabSize: config.tabSize - } - }); +function useStoreTabs({ + storage, + shouldPersistHeaders +}) { + const store = React.useMemo(() => debounce(500, value => { + storage == null ? void 0 : storage.set(STORAGE_KEY$2, value); + }), [storage]); + return React.useCallback(currentState => { + store(serializeTabState(currentState, shouldPersistHeaders)); + }, [shouldPersistHeaders, store]); +} +function useSetEditorValues({ + queryEditor, + variableEditor, + headerEditor, + responseEditor, + defaultHeaders +}) { + return React.useCallback(({ + query, + variables, + headers, + response + }) => { + var _ref11; + queryEditor == null ? void 0 : queryEditor.setValue(query !== null && query !== void 0 ? query : ""); + variableEditor == null ? void 0 : variableEditor.setValue(variables !== null && variables !== void 0 ? variables : ""); + headerEditor == null ? void 0 : headerEditor.setValue((_ref11 = headers !== null && headers !== void 0 ? headers : defaultHeaders) !== null && _ref11 !== void 0 ? _ref11 : ""); + responseEditor == null ? void 0 : responseEditor.setValue(response !== null && response !== void 0 ? response : ""); + }, [headerEditor, queryEditor, responseEditor, variableEditor, defaultHeaders]); +} +function createTab({ + query = null, + variables = null, + headers = null +} = {}) { return { - config, - startState: parser.startState, - token: parser.token, - indent: modeIndent.indent, - electricInput: /^\s*[}\]]/, - fold: "brace", - closeBrackets: { - pairs: '[]{}""', - explode: "[]{}" - } + id: guid(), + hash: hashFromTabContents({ + query, + variables, + headers + }), + title: query && fuzzyExtractOperationName(query) || DEFAULT_TITLE, + query, + variables, + headers, + operationName: null, + response: null }; -}); -const LexRules = { - Punctuation: /^\[|]|\{|\}|:|,/, - Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, - String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, - Keyword: /^true|false|null/ -}; -const ParseRules = { - Document: [graphqlLanguageService.p("{"), graphqlLanguageService.list("Variable", graphqlLanguageService.opt(graphqlLanguageService.p(","))), graphqlLanguageService.p("}")], - Variable: [namedKey("variable"), graphqlLanguageService.p(":"), "Value"], - Value(token) { - switch (token.kind) { - case "Number": - return "NumberValue"; - case "String": - return "StringValue"; - case "Punctuation": - switch (token.value) { - case "[": - return "ListValue"; - case "{": - return "ObjectValue"; - } - return null; - case "Keyword": - switch (token.value) { - case "true": - case "false": - return "BooleanValue"; - case "null": - return "NullValue"; - } - return null; - } - }, - NumberValue: [graphqlLanguageService.t("Number", "number")], - StringValue: [graphqlLanguageService.t("String", "string")], - BooleanValue: [graphqlLanguageService.t("Keyword", "builtin")], - NullValue: [graphqlLanguageService.t("Keyword", "keyword")], - ListValue: [graphqlLanguageService.p("["), graphqlLanguageService.list("Value", graphqlLanguageService.opt(graphqlLanguageService.p(","))), graphqlLanguageService.p("]")], - ObjectValue: [graphqlLanguageService.p("{"), graphqlLanguageService.list("ObjectField", graphqlLanguageService.opt(graphqlLanguageService.p(","))), graphqlLanguageService.p("}")], - ObjectField: [namedKey("attribute"), graphqlLanguageService.p(":"), "Value"] -}; -function namedKey(style) { +} +function setPropertiesInActiveTab(state, partialTab) { return { - style, - match: token => token.kind === "String", - update(state, token) { - state.name = token.value.slice(1, -1); - } + ...state, + tabs: state.tabs.map((tab, index) => { + if (index !== state.activeTabIndex) { + return tab; + } + const newTab = { + ...tab, + ...partialTab + }; + return { + ...newTab, + hash: hashFromTabContents(newTab), + title: newTab.operationName || (newTab.query ? fuzzyExtractOperationName(newTab.query) : void 0) || DEFAULT_TITLE + }; + }) }; } - -/***/ }), - -/***/ "../../graphiql-react/dist/mode.cjs3.js": -/*!**********************************************!*\ - !*** ../../graphiql-react/dist/mode.cjs3.js ***! - \**********************************************/ -/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"); -const graphqlLanguageService = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); -const modeIndent = __webpack_require__(/*! ./mode-indent.cjs.js */ "../../graphiql-react/dist/mode-indent.cjs.js"); -codemirror.CodeMirror.defineMode("graphql-results", config => { - const parser = graphqlLanguageService.onlineParser({ - eatWhitespace: stream => stream.eatSpace(), - lexRules: LexRules, - parseRules: ParseRules, - editorConfig: { - tabSize: config.tabSize - } - }); - return { - config, - startState: parser.startState, - token: parser.token, - indent: modeIndent.indent, - electricInput: /^\s*[}\]]/, - fold: "brace", - closeBrackets: { - pairs: '[]{}""', - explode: "[]{}" - } +function guid() { + const s4 = () => { + return Math.floor((1 + Math.random()) * 65536).toString(16).slice(1); }; -}); -const LexRules = { - Punctuation: /^\[|]|\{|\}|:|,/, - Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, - String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, - Keyword: /^true|false|null/ -}; -const ParseRules = { - Document: [graphqlLanguageService.p("{"), graphqlLanguageService.list("Entry", graphqlLanguageService.p(",")), graphqlLanguageService.p("}")], - Entry: [graphqlLanguageService.t("String", "def"), graphqlLanguageService.p(":"), "Value"], - Value(token) { - switch (token.kind) { - case "Number": - return "NumberValue"; - case "String": - return "StringValue"; - case "Punctuation": - switch (token.value) { - case "[": - return "ListValue"; - case "{": - return "ObjectValue"; + return `${s4()}${s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`; +} +function hashFromTabContents(args) { + var _args$query, _args$variables, _args$headers; + return [(_args$query = args.query) !== null && _args$query !== void 0 ? _args$query : "", (_args$variables = args.variables) !== null && _args$variables !== void 0 ? _args$variables : "", (_args$headers = args.headers) !== null && _args$headers !== void 0 ? _args$headers : ""].join("|"); +} +function fuzzyExtractOperationName(str) { + var _ref12; + const regex = /^(?!#).*(query|subscription|mutation)\s+([a-zA-Z0-9_]+)/m; + const match = regex.exec(str); + return (_ref12 = match == null ? void 0 : match[2]) !== null && _ref12 !== void 0 ? _ref12 : null; +} +function clearHeadersFromTabs(storage) { + const persistedTabs = storage == null ? void 0 : storage.get(STORAGE_KEY$2); + if (persistedTabs) { + const parsedTabs = JSON.parse(persistedTabs); + storage == null ? void 0 : storage.set(STORAGE_KEY$2, JSON.stringify(parsedTabs, (key, value) => key === "headers" ? null : value)); + } +} +const DEFAULT_TITLE = ""; +const STORAGE_KEY$2 = "tabState"; +function importCodeMirrorImports$1() { + return importCodeMirror([Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/variables/hint.js */ "../../codemirror-graphql/esm/variables/hint.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/variables/lint.js */ "../../codemirror-graphql/esm/variables/lint.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/variables/mode.js */ "../../codemirror-graphql/esm/variables/mode.js")))]); +} +const _useVariableEditor = useVariableEditor; +function useVariableEditor(t0, caller) { + const $ = reactCompilerRuntime.c(17); + let t1; + if ($[0] !== t0) { + t1 = t0 === void 0 ? {} : t0; + $[0] = t0; + $[1] = t1; + } else { + t1 = $[1]; + } + const { + editorTheme: t2, + keyMap: t3, + onClickReference, + onEdit, + readOnly: t4 + } = t1; + const editorTheme = t2 === void 0 ? DEFAULT_EDITOR_THEME : t2; + const keyMap = t3 === void 0 ? DEFAULT_KEY_MAP : t3; + const readOnly = t4 === void 0 ? false : t4; + const t5 = caller || _useVariableEditor; + let t6; + if ($[2] !== t5) { + t6 = { + nonNull: true, + caller: t5 + }; + $[2] = t5; + $[3] = t6; + } else { + t6 = $[3]; + } + const { + initialVariables, + variableEditor, + setVariableEditor + } = useEditorContext(t6); + const executionContext = useExecutionContext(); + const t7 = caller || _useVariableEditor; + let t8; + if ($[4] !== t7) { + t8 = { + caller: t7 + }; + $[4] = t7; + $[5] = t8; + } else { + t8 = $[5]; + } + const merge = useMergeQuery(t8); + const t9 = caller || _useVariableEditor; + let t10; + if ($[6] !== t9) { + t10 = { + caller: t9 + }; + $[6] = t9; + $[7] = t10; + } else { + t10 = $[7]; + } + const prettify = usePrettifyEditors(t10); + const ref = React.useRef(null); + const codeMirrorRef = React.useRef(); + let t11; + let t12; + if ($[8] !== editorTheme || $[9] !== initialVariables || $[10] !== readOnly || $[11] !== setVariableEditor) { + t11 = () => { + let isActive; + isActive = true; + importCodeMirrorImports$1().then(CodeMirror => { + if (!isActive) { + return; } - return null; - case "Keyword": - switch (token.value) { - case "true": - case "false": - return "BooleanValue"; - case "null": - return "NullValue"; + codeMirrorRef.current = CodeMirror; + const container = ref.current; + if (!container) { + return; } - return null; - } - }, - NumberValue: [graphqlLanguageService.t("Number", "number")], - StringValue: [graphqlLanguageService.t("String", "string")], - BooleanValue: [graphqlLanguageService.t("Keyword", "builtin")], - NullValue: [graphqlLanguageService.t("Keyword", "keyword")], - ListValue: [graphqlLanguageService.p("["), graphqlLanguageService.list("Value", graphqlLanguageService.p(",")), graphqlLanguageService.p("]")], - ObjectValue: [graphqlLanguageService.p("{"), graphqlLanguageService.list("ObjectField", graphqlLanguageService.p(",")), graphqlLanguageService.p("}")], - ObjectField: [graphqlLanguageService.t("String", "property"), graphqlLanguageService.p(":"), "Value"] -}; - -/***/ }), - -/***/ "../../graphiql-react/dist/search.cjs.js": -/*!***********************************************!*\ - !*** ../../graphiql-react/dist/search.cjs.js ***! - \***********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -const searchcursor = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"); -const dialog = __webpack_require__(/*! ./dialog.cjs.js */ "../../graphiql-react/dist/dialog.cjs.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] + const newEditor = CodeMirror(container, { + value: initialVariables, + lineNumbers: true, + tabSize: 2, + mode: "graphql-variables", + theme: editorTheme, + autoCloseBrackets: true, + matchBrackets: true, + showCursorWhenSelecting: true, + readOnly: readOnly ? "nocursor" : false, + foldGutter: true, + lint: { + variableToType: void 0 + }, + hintOptions: { + closeOnUnfocus: false, + completeSingle: false, + container, + variableToType: void 0 + }, + gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], + extraKeys: commonKeys + }); + newEditor.addKeyMap({ + "Cmd-Space"() { + newEditor.showHint({ + completeSingle: false, + container + }); + }, + "Ctrl-Space"() { + newEditor.showHint({ + completeSingle: false, + container + }); + }, + "Alt-Space"() { + newEditor.showHint({ + completeSingle: false, + container + }); + }, + "Shift-Space"() { + newEditor.showHint({ + completeSingle: false, + container }); } - } - } - } + }); + newEditor.on("keyup", _temp); + setVariableEditor(newEditor); + }); + return () => { + isActive = false; + }; + }; + t12 = [editorTheme, initialVariables, readOnly, setVariableEditor]; + $[8] = editorTheme; + $[9] = initialVariables; + $[10] = readOnly; + $[11] = setVariableEditor; + $[12] = t11; + $[13] = t12; + } else { + t11 = $[12]; + t12 = $[13]; } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); + React.useEffect(t11, t12); + useSynchronizeOption(variableEditor, "keyMap", keyMap); + useChangeHandler(variableEditor, onEdit, STORAGE_KEY$1, "variables", _useVariableEditor); + useCompletion(variableEditor, onClickReference || null, _useVariableEditor); + let t13; + if ($[14] === Symbol.for("react.memo_cache_sentinel")) { + t13 = ["Cmd-Enter", "Ctrl-Enter"]; + $[14] = t13; + } else { + t13 = $[14]; + } + useKeyMap(variableEditor, t13, executionContext == null ? void 0 : executionContext.run); + let t14; + if ($[15] === Symbol.for("react.memo_cache_sentinel")) { + t14 = ["Shift-Ctrl-P"]; + $[15] = t14; + } else { + t14 = $[15]; + } + useKeyMap(variableEditor, t14, prettify); + let t15; + if ($[16] === Symbol.for("react.memo_cache_sentinel")) { + t15 = ["Shift-Ctrl-M"]; + $[16] = t15; + } else { + t15 = $[16]; + } + useKeyMap(variableEditor, t15, merge); + return ref; } -var search$2 = { - exports: {} -}; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror(), searchcursor.requireSearchcursor(), dialog.dialogExports); - })(function (CodeMirror) { - CodeMirror.defineOption("search", { - bottom: false - }); - function searchOverlay(query, caseInsensitive) { - if (typeof query == "string") query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");else if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "gi" : "g"); +function _temp(editorInstance, event) { + const { + code, + key, + shiftKey + } = event; + const isLetter = code.startsWith("Key"); + const isNumber = !shiftKey && code.startsWith("Digit"); + if (isLetter || isNumber || key === "_" || key === '"') { + editorInstance.execCommand("autocomplete"); + } +} +const STORAGE_KEY$1 = "variables"; +const EditorContext = createNullableContext("EditorContext"); +function EditorContextProvider(props) { + const $ = reactCompilerRuntime.c(89); + const storage = useStorageContext(); + const [headerEditor, setHeaderEditor] = React.useState(null); + const [queryEditor, setQueryEditor] = React.useState(null); + const [responseEditor, setResponseEditor] = React.useState(null); + const [variableEditor, setVariableEditor] = React.useState(null); + let t0; + if ($[0] !== props.shouldPersistHeaders || $[1] !== storage) { + t0 = () => { + const isStored = (storage == null ? void 0 : storage.get(PERSIST_HEADERS_STORAGE_KEY)) !== null; + return props.shouldPersistHeaders !== false && isStored ? (storage == null ? void 0 : storage.get(PERSIST_HEADERS_STORAGE_KEY)) === "true" : Boolean(props.shouldPersistHeaders); + }; + $[0] = props.shouldPersistHeaders; + $[1] = storage; + $[2] = t0; + } else { + t0 = $[2]; + } + const [shouldPersistHeaders, setShouldPersistHeadersInternal] = React.useState(t0); + useSynchronizeValue(headerEditor, props.headers); + useSynchronizeValue(queryEditor, props.query); + useSynchronizeValue(responseEditor, props.response); + useSynchronizeValue(variableEditor, props.variables); + let t1; + if ($[3] !== shouldPersistHeaders || $[4] !== storage) { + t1 = { + storage, + shouldPersistHeaders + }; + $[3] = shouldPersistHeaders; + $[4] = storage; + $[5] = t1; + } else { + t1 = $[5]; + } + const storeTabs = useStoreTabs(t1); + let t2; + if ($[6] !== props.defaultHeaders || $[7] !== props.defaultQuery || $[8] !== props.defaultTabs || $[9] !== props.headers || $[10] !== props.query || $[11] !== props.response || $[12] !== props.variables || $[13] !== shouldPersistHeaders || $[14] !== storage || $[15] !== storeTabs) { + t2 = () => { + var _ref13, _props$query, _ref14, _props$variables, _ref15, _props$headers, _props$response, _ref16, _ref17; + const query = (_ref13 = (_props$query = props.query) !== null && _props$query !== void 0 ? _props$query : storage == null ? void 0 : storage.get(STORAGE_KEY_QUERY)) !== null && _ref13 !== void 0 ? _ref13 : null; + const variables = (_ref14 = (_props$variables = props.variables) !== null && _props$variables !== void 0 ? _props$variables : storage == null ? void 0 : storage.get(STORAGE_KEY$1)) !== null && _ref14 !== void 0 ? _ref14 : null; + const headers = (_ref15 = (_props$headers = props.headers) !== null && _props$headers !== void 0 ? _props$headers : storage == null ? void 0 : storage.get(STORAGE_KEY$3)) !== null && _ref15 !== void 0 ? _ref15 : null; + const response = (_props$response = props.response) !== null && _props$response !== void 0 ? _props$response : ""; + const tabState = getDefaultTabState({ + query, + variables, + headers, + defaultTabs: props.defaultTabs, + defaultQuery: props.defaultQuery || DEFAULT_QUERY, + defaultHeaders: props.defaultHeaders, + storage, + shouldPersistHeaders + }); + storeTabs(tabState); return { - token: function (stream) { - query.lastIndex = stream.pos; - var match = query.exec(stream.string); - if (match && match.index == stream.pos) { - stream.pos += match[0].length || 1; - return "searching"; - } else if (match) { - stream.pos = match.index; - } else { - stream.skipToEnd(); - } - } + query: (_ref16 = query !== null && query !== void 0 ? query : tabState.activeTabIndex === 0 ? tabState.tabs[0].query : null) !== null && _ref16 !== void 0 ? _ref16 : "", + variables: variables !== null && variables !== void 0 ? variables : "", + headers: (_ref17 = headers !== null && headers !== void 0 ? headers : props.defaultHeaders) !== null && _ref17 !== void 0 ? _ref17 : "", + response, + tabState }; - } - function SearchState() { - this.posFrom = this.posTo = this.lastQuery = this.query = null; - this.overlay = null; - } - function getSearchState(cm) { - return cm.state.search || (cm.state.search = new SearchState()); - } - function queryCaseInsensitive(query) { - return typeof query == "string" && query == query.toLowerCase(); - } - function getSearchCursor(cm, query, pos) { - return cm.getSearchCursor(query, pos, { - caseFold: queryCaseInsensitive(query), - multiline: true - }); - } - function persistentDialog(cm, text, deflt, onEnter, onKeyDown) { - cm.openDialog(text, onEnter, { - value: deflt, - selectValueOnOpen: true, - closeOnEnter: false, - onClose: function () { - clearSearch(cm); - }, - onKeyDown, - bottom: cm.options.search.bottom - }); - } - function dialog2(cm, text, shortText, deflt, f) { - if (cm.openDialog) cm.openDialog(text, f, { - value: deflt, - selectValueOnOpen: true, - bottom: cm.options.search.bottom - });else f(prompt(shortText, deflt)); - } - function confirmDialog(cm, text, shortText, fs) { - if (cm.openConfirm) cm.openConfirm(text, fs);else if (confirm(shortText)) fs[0](); - } - function parseString(string) { - return string.replace(/\\([nrt\\])/g, function (match, ch) { - if (ch == "n") return "\n"; - if (ch == "r") return "\r"; - if (ch == "t") return " "; - if (ch == "\\") return "\\"; - return match; - }); - } - function parseQuery(query) { - var isRE = query.match(/^\/(.*)\/([a-z]*)$/); - if (isRE) { - try { - query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); - } catch (e) {} + }; + $[6] = props.defaultHeaders; + $[7] = props.defaultQuery; + $[8] = props.defaultTabs; + $[9] = props.headers; + $[10] = props.query; + $[11] = props.response; + $[12] = props.variables; + $[13] = shouldPersistHeaders; + $[14] = storage; + $[15] = storeTabs; + $[16] = t2; + } else { + t2 = $[16]; + } + const [initialState] = React.useState(t2); + const [tabState_0, setTabState] = React.useState(initialState.tabState); + let t3; + if ($[17] !== headerEditor || $[18] !== storage || $[19] !== tabState_0) { + t3 = persist => { + if (persist) { + var _ref18; + storage == null ? void 0 : storage.set(STORAGE_KEY$3, (_ref18 = headerEditor == null ? void 0 : headerEditor.getValue()) !== null && _ref18 !== void 0 ? _ref18 : ""); + const serializedTabs = serializeTabState(tabState_0, true); + storage == null ? void 0 : storage.set(STORAGE_KEY$2, serializedTabs); } else { - query = parseString(query); + storage == null ? void 0 : storage.set(STORAGE_KEY$3, ""); + clearHeadersFromTabs(storage); } - if (typeof query == "string" ? query == "" : query.test("")) query = /x^/; - return query; - } - function startSearch(cm, state, query) { - state.queryText = query; - state.query = parseQuery(query); - cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query)); - state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query)); - cm.addOverlay(state.overlay); - if (cm.showMatchesOnScrollbar) { - if (state.annotate) { - state.annotate.clear(); - state.annotate = null; - } - state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query)); + setShouldPersistHeadersInternal(persist); + storage == null ? void 0 : storage.set(PERSIST_HEADERS_STORAGE_KEY, persist.toString()); + }; + $[17] = headerEditor; + $[18] = storage; + $[19] = tabState_0; + $[20] = t3; + } else { + t3 = $[20]; + } + const setShouldPersistHeaders = t3; + const lastShouldPersistHeadersProp = React.useRef(); + let t4; + let t5; + if ($[21] !== props.shouldPersistHeaders || $[22] !== setShouldPersistHeaders) { + t4 = () => { + const propValue = Boolean(props.shouldPersistHeaders); + if ((lastShouldPersistHeadersProp == null ? void 0 : lastShouldPersistHeadersProp.current) !== propValue) { + setShouldPersistHeaders(propValue); + lastShouldPersistHeadersProp.current = propValue; } - } - function doSearch(cm, rev, persistent, immediate) { - var state = getSearchState(cm); - if (state.query) return findNext(cm, rev); - var q = cm.getSelection() || state.lastQuery; - if (q instanceof RegExp && q.source == "x^") q = null; - if (persistent && cm.openDialog) { - var hiding = null; - var searchNext = function (query, event) { - CodeMirror.e_stop(event); - if (!query) return; - if (query != state.queryText) { - startSearch(cm, state, query); - state.posFrom = state.posTo = cm.getCursor(); - } - if (hiding) hiding.style.opacity = 1; - findNext(cm, event.shiftKey, function (_, to) { - var dialog3; - if (to.line < 3 && document.querySelector && (dialog3 = cm.display.wrapper.querySelector(".CodeMirror-dialog")) && dialog3.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top) (hiding = dialog3).style.opacity = 0.4; - }); + }; + t5 = [props.shouldPersistHeaders, setShouldPersistHeaders]; + $[21] = props.shouldPersistHeaders; + $[22] = setShouldPersistHeaders; + $[23] = t4; + $[24] = t5; + } else { + t4 = $[23]; + t5 = $[24]; + } + React.useEffect(t4, t5); + let t6; + if ($[25] !== headerEditor || $[26] !== queryEditor || $[27] !== responseEditor || $[28] !== variableEditor) { + t6 = { + queryEditor, + variableEditor, + headerEditor, + responseEditor + }; + $[25] = headerEditor; + $[26] = queryEditor; + $[27] = responseEditor; + $[28] = variableEditor; + $[29] = t6; + } else { + t6 = $[29]; + } + const synchronizeActiveTabValues = useSynchronizeActiveTabValues(t6); + const { + onTabChange, + defaultHeaders, + defaultQuery, + children + } = props; + let t7; + if ($[30] !== defaultHeaders || $[31] !== headerEditor || $[32] !== queryEditor || $[33] !== responseEditor || $[34] !== variableEditor) { + t7 = { + queryEditor, + variableEditor, + headerEditor, + responseEditor, + defaultHeaders + }; + $[30] = defaultHeaders; + $[31] = headerEditor; + $[32] = queryEditor; + $[33] = responseEditor; + $[34] = variableEditor; + $[35] = t7; + } else { + t7 = $[35]; + } + const setEditorValues = useSetEditorValues(t7); + let t8; + if ($[36] !== defaultHeaders || $[37] !== defaultQuery || $[38] !== onTabChange || $[39] !== setEditorValues || $[40] !== storeTabs || $[41] !== synchronizeActiveTabValues) { + t8 = () => { + setTabState(current => { + const updatedValues = synchronizeActiveTabValues(current); + const updated = { + tabs: [...updatedValues.tabs, createTab({ + headers: defaultHeaders, + query: defaultQuery !== null && defaultQuery !== void 0 ? defaultQuery : DEFAULT_QUERY + })], + activeTabIndex: updatedValues.tabs.length }; - persistentDialog(cm, getQueryDialog(cm), q, searchNext, function (event, query) { - var keyName = CodeMirror.keyName(event); - var extra = cm.getOption("extraKeys"), - cmd = extra && extra[keyName] || CodeMirror.keyMap[cm.getOption("keyMap")][keyName]; - if (cmd == "findNext" || cmd == "findPrev" || cmd == "findPersistentNext" || cmd == "findPersistentPrev") { - CodeMirror.e_stop(event); - startSearch(cm, getSearchState(cm), query); - cm.execCommand(cmd); - } else if (cmd == "find" || cmd == "findPersistent") { - CodeMirror.e_stop(event); - searchNext(query, event); - } - }); - if (immediate && q) { - startSearch(cm, state, q); - findNext(cm, rev); - } - } else { - dialog2(cm, getQueryDialog(cm), "Search for:", q, function (query) { - if (query && !state.query) cm.operation(function () { - startSearch(cm, state, query); - state.posFrom = state.posTo = cm.getCursor(); - findNext(cm, rev); - }); - }); - } - } - function findNext(cm, rev, callback) { - cm.operation(function () { - var state = getSearchState(cm); - var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); - if (!cursor.find(rev)) { - cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0)); - if (!cursor.find(rev)) return; - } - cm.setSelection(cursor.from(), cursor.to()); - cm.scrollIntoView({ - from: cursor.from(), - to: cursor.to() - }, 20); - state.posFrom = cursor.from(); - state.posTo = cursor.to(); - if (callback) callback(cursor.from(), cursor.to()); - }); - } - function clearSearch(cm) { - cm.operation(function () { - var state = getSearchState(cm); - state.lastQuery = state.query; - if (!state.query) return; - state.query = state.queryText = null; - cm.removeOverlay(state.overlay); - if (state.annotate) { - state.annotate.clear(); - state.annotate = null; - } - }); - } - function el(tag, attrs) { - var element = tag ? document.createElement(tag) : document.createDocumentFragment(); - for (var key in attrs) { - element[key] = attrs[key]; - } - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - element.appendChild(typeof child == "string" ? document.createTextNode(child) : child); - } - return element; - } - function getQueryDialog(cm) { - return el("", null, el("span", { - className: "CodeMirror-search-label" - }, cm.phrase("Search:")), " ", el("input", { - type: "text", - "style": "width: 10em", - className: "CodeMirror-search-field" - }), " ", el("span", { - style: "color: #888", - className: "CodeMirror-search-hint" - }, cm.phrase("(Use /re/ syntax for regexp search)"))); - } - function getReplaceQueryDialog(cm) { - return el("", null, " ", el("input", { - type: "text", - "style": "width: 10em", - className: "CodeMirror-search-field" - }), " ", el("span", { - style: "color: #888", - className: "CodeMirror-search-hint" - }, cm.phrase("(Use /re/ syntax for regexp search)"))); - } - function getReplacementQueryDialog(cm) { - return el("", null, el("span", { - className: "CodeMirror-search-label" - }, cm.phrase("With:")), " ", el("input", { - type: "text", - "style": "width: 10em", - className: "CodeMirror-search-field" - })); - } - function getDoReplaceConfirm(cm) { - return el("", null, el("span", { - className: "CodeMirror-search-label" - }, cm.phrase("Replace?")), " ", el("button", {}, cm.phrase("Yes")), " ", el("button", {}, cm.phrase("No")), " ", el("button", {}, cm.phrase("All")), " ", el("button", {}, cm.phrase("Stop"))); - } - function replaceAll(cm, query, text) { - cm.operation(function () { - for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { - if (typeof query != "string") { - var match = cm.getRange(cursor.from(), cursor.to()).match(query); - cursor.replace(text.replace(/\$(\d)/g, function (_, i) { - return match[i]; - })); - } else cursor.replace(text); - } - }); - } - function replace(cm, all) { - if (cm.getOption("readOnly")) return; - var query = cm.getSelection() || getSearchState(cm).lastQuery; - var dialogText = all ? cm.phrase("Replace all:") : cm.phrase("Replace:"); - var fragment = el("", null, el("span", { - className: "CodeMirror-search-label" - }, dialogText), getReplaceQueryDialog(cm)); - dialog2(cm, fragment, dialogText, query, function (query2) { - if (!query2) return; - query2 = parseQuery(query2); - dialog2(cm, getReplacementQueryDialog(cm), cm.phrase("Replace with:"), "", function (text) { - text = parseString(text); - if (all) { - replaceAll(cm, query2, text); - } else { - clearSearch(cm); - var cursor = getSearchCursor(cm, query2, cm.getCursor("from")); - var advance = function () { - var start = cursor.from(), - match; - if (!(match = cursor.findNext())) { - cursor = getSearchCursor(cm, query2); - if (!(match = cursor.findNext()) || start && cursor.from().line == start.line && cursor.from().ch == start.ch) return; - } - cm.setSelection(cursor.from(), cursor.to()); - cm.scrollIntoView({ - from: cursor.from(), - to: cursor.to() - }); - confirmDialog(cm, getDoReplaceConfirm(cm), cm.phrase("Replace?"), [function () { - doReplace(match); - }, advance, function () { - replaceAll(cm, query2, text); - }]); - }; - var doReplace = function (match) { - cursor.replace(typeof query2 == "string" ? text : text.replace(/\$(\d)/g, function (_, i) { - return match[i]; - })); - advance(); - }; - advance(); - } - }); + storeTabs(updated); + setEditorValues(updated.tabs[updated.activeTabIndex]); + onTabChange == null ? void 0 : onTabChange(updated); + return updated; }); - } - CodeMirror.commands.find = function (cm) { - clearSearch(cm); - doSearch(cm); }; - CodeMirror.commands.findPersistent = function (cm) { - clearSearch(cm); - doSearch(cm, false, true); + $[36] = defaultHeaders; + $[37] = defaultQuery; + $[38] = onTabChange; + $[39] = setEditorValues; + $[40] = storeTabs; + $[41] = synchronizeActiveTabValues; + $[42] = t8; + } else { + t8 = $[42]; + } + const addTab = t8; + let t9; + if ($[43] !== onTabChange || $[44] !== setEditorValues || $[45] !== storeTabs) { + t9 = index => { + setTabState(current_0 => { + const updated_0 = { + ...current_0, + activeTabIndex: index + }; + storeTabs(updated_0); + setEditorValues(updated_0.tabs[updated_0.activeTabIndex]); + onTabChange == null ? void 0 : onTabChange(updated_0); + return updated_0; + }); }; - CodeMirror.commands.findPersistentNext = function (cm) { - doSearch(cm, false, true, true); + $[43] = onTabChange; + $[44] = setEditorValues; + $[45] = storeTabs; + $[46] = t9; + } else { + t9 = $[46]; + } + const changeTab = t9; + let t10; + if ($[47] !== onTabChange || $[48] !== setEditorValues || $[49] !== storeTabs) { + t10 = newOrder => { + setTabState(current_1 => { + const activeTab = current_1.tabs[current_1.activeTabIndex]; + const updated_1 = { + tabs: newOrder, + activeTabIndex: newOrder.indexOf(activeTab) + }; + storeTabs(updated_1); + setEditorValues(updated_1.tabs[updated_1.activeTabIndex]); + onTabChange == null ? void 0 : onTabChange(updated_1); + return updated_1; + }); }; - CodeMirror.commands.findPersistentPrev = function (cm) { - doSearch(cm, true, true, true); + $[47] = onTabChange; + $[48] = setEditorValues; + $[49] = storeTabs; + $[50] = t10; + } else { + t10 = $[50]; + } + const moveTab = t10; + let t11; + if ($[51] !== onTabChange || $[52] !== setEditorValues || $[53] !== storeTabs) { + t11 = index_0 => { + setTabState(current_2 => { + const updated_2 = { + tabs: current_2.tabs.filter((_tab, i) => index_0 !== i), + activeTabIndex: Math.max(current_2.activeTabIndex - 1, 0) + }; + storeTabs(updated_2); + setEditorValues(updated_2.tabs[updated_2.activeTabIndex]); + onTabChange == null ? void 0 : onTabChange(updated_2); + return updated_2; + }); }; - CodeMirror.commands.findNext = doSearch; - CodeMirror.commands.findPrev = function (cm) { - doSearch(cm, true); + $[51] = onTabChange; + $[52] = setEditorValues; + $[53] = storeTabs; + $[54] = t11; + } else { + t11 = $[54]; + } + const closeTab = t11; + let t12; + if ($[55] !== onTabChange || $[56] !== storeTabs) { + t12 = partialTab => { + setTabState(current_3 => { + const updated_3 = setPropertiesInActiveTab(current_3, partialTab); + storeTabs(updated_3); + onTabChange == null ? void 0 : onTabChange(updated_3); + return updated_3; + }); }; - CodeMirror.commands.clearSearch = clearSearch; - CodeMirror.commands.replace = replace; - CodeMirror.commands.replaceAll = function (cm) { - replace(cm, true); + $[55] = onTabChange; + $[56] = storeTabs; + $[57] = t12; + } else { + t12 = $[57]; + } + const updateActiveTabValues = t12; + const { + onEditOperationName + } = props; + let t13; + if ($[58] !== onEditOperationName || $[59] !== queryEditor || $[60] !== updateActiveTabValues) { + t13 = operationName => { + if (!queryEditor) { + return; + } + updateQueryEditor(queryEditor, operationName); + updateActiveTabValues({ + operationName + }); + onEditOperationName == null ? void 0 : onEditOperationName(operationName); }; - }); -})(); -var searchExports = search$2.exports; -const search = /* @__PURE__ */codemirror.getDefaultExportFromCjs(searchExports); -const search$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: search -}, [searchExports]); -exports.search = search$1; - -/***/ }), - -/***/ "../../graphiql-react/dist/searchcursor.cjs.js": -/*!*****************************************************!*\ - !*** ../../graphiql-react/dist/searchcursor.cjs.js ***! - \*****************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -const searchcursor$2 = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); + $[58] = onEditOperationName; + $[59] = queryEditor; + $[60] = updateActiveTabValues; + $[61] = t13; + } else { + t13 = $[61]; + } + const setOperationName = t13; + let t14; + let map; + if ($[62] !== props.externalFragments) { + map = /* @__PURE__ */new Map(); + if (Array.isArray(props.externalFragments)) { + for (const fragment of props.externalFragments) { + map.set(fragment.name.value, fragment); + } + } else { + if (typeof props.externalFragments === "string") { + graphql.visit(graphql.parse(props.externalFragments, {}), { + FragmentDefinition(fragment_0) { + map.set(fragment_0.name.value, fragment_0); } + }); + } else { + if (props.externalFragments) { + throw new Error("The `externalFragments` prop must either be a string that contains the fragment definitions in SDL or a list of FragmentDefinitionNode objects."); } } } + $[62] = props.externalFragments; + $[63] = map; + } else { + map = $[63]; + } + t14 = map; + const externalFragments = t14; + let t15; + if ($[64] !== props.validationRules) { + t15 = props.validationRules || []; + $[64] = props.validationRules; + $[65] = t15; + } else { + t15 = $[65]; + } + const validationRules = t15; + let t16; + if ($[66] !== addTab || $[67] !== changeTab || $[68] !== closeTab || $[69] !== externalFragments || $[70] !== headerEditor || $[71] !== initialState.headers || $[72] !== initialState.query || $[73] !== initialState.response || $[74] !== initialState.variables || $[75] !== moveTab || $[76] !== queryEditor || $[77] !== responseEditor || $[78] !== setOperationName || $[79] !== setShouldPersistHeaders || $[80] !== shouldPersistHeaders || $[81] !== tabState_0 || $[82] !== updateActiveTabValues || $[83] !== validationRules || $[84] !== variableEditor) { + t16 = { + ...tabState_0, + addTab, + changeTab, + moveTab, + closeTab, + updateActiveTabValues, + headerEditor, + queryEditor, + responseEditor, + variableEditor, + setHeaderEditor, + setQueryEditor, + setResponseEditor, + setVariableEditor, + setOperationName, + initialQuery: initialState.query, + initialVariables: initialState.variables, + initialHeaders: initialState.headers, + initialResponse: initialState.response, + externalFragments, + validationRules, + shouldPersistHeaders, + setShouldPersistHeaders + }; + $[66] = addTab; + $[67] = changeTab; + $[68] = closeTab; + $[69] = externalFragments; + $[70] = headerEditor; + $[71] = initialState.headers; + $[72] = initialState.query; + $[73] = initialState.response; + $[74] = initialState.variables; + $[75] = moveTab; + $[76] = queryEditor; + $[77] = responseEditor; + $[78] = setOperationName; + $[79] = setShouldPersistHeaders; + $[80] = shouldPersistHeaders; + $[81] = tabState_0; + $[82] = updateActiveTabValues; + $[83] = validationRules; + $[84] = variableEditor; + $[85] = t16; + } else { + t16 = $[85]; } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); + const value = t16; + let t17; + if ($[86] !== children || $[87] !== value) { + t17 = /* @__PURE__ */jsxRuntime.jsx(EditorContext.Provider, { + value, + children + }); + $[86] = children; + $[87] = value; + $[88] = t17; + } else { + t17 = $[88]; + } + return t17; } -var searchcursorExports = searchcursor$2.requireSearchcursor(); -const searchcursor = /* @__PURE__ */codemirror.getDefaultExportFromCjs(searchcursorExports); -const searchcursor$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: searchcursor -}, [searchcursorExports]); -exports.searchcursor = searchcursor$1; - -/***/ }), - -/***/ "../../graphiql-react/dist/searchcursor.cjs2.js": -/*!******************************************************!*\ - !*** ../../graphiql-react/dist/searchcursor.cjs2.js ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - +function updateQueryEditor(queryEditor, operationName) { + queryEditor.operationName = operationName; +} +const useEditorContext = createContextHook(EditorContext); +const PERSIST_HEADERS_STORAGE_KEY = "shouldPersistHeaders"; +const DEFAULT_QUERY = `# Welcome to GraphiQL +# +# GraphiQL is an in-browser tool for writing, validating, and +# testing GraphQL queries. +# +# Type queries into this side of the screen, and you will see intelligent +# typeaheads aware of the current GraphQL type schema and live syntax and +# validation errors highlighted within the text. +# +# GraphQL queries typically start with a "{" character. Lines that start +# with a # are ignored. +# +# An example GraphQL query might look like: +# +# { +# field(arg: "value") { +# subField +# } +# } +# +# Keyboard shortcuts: +# +# Prettify query: Shift-Ctrl-P (or press the prettify button) +# +# Merge fragments: Shift-Ctrl-M (or press the merge button) +# +# Run Query: Ctrl-Enter (or press the play button) +# +# Auto Complete: Ctrl-Space (or just start typing) +# -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -var searchcursor = { - exports: {} -}; -var hasRequiredSearchcursor; -function requireSearchcursor() { - if (hasRequiredSearchcursor) return searchcursor.exports; - hasRequiredSearchcursor = 1; - (function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - var Pos = CodeMirror.Pos; - function regexpFlags(regexp) { - var flags = regexp.flags; - return flags != null ? flags : (regexp.ignoreCase ? "i" : "") + (regexp.global ? "g" : "") + (regexp.multiline ? "m" : ""); - } - function ensureFlags(regexp, flags) { - var current = regexpFlags(regexp), - target = current; - for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1) target += flags.charAt(i); - return current == target ? regexp : new RegExp(regexp.source, target); - } - function maybeMultiline(regexp) { - return /\\s|\\n|\n|\\W|\\D|\[\^/.test(regexp.source); - } - function searchRegexpForward(doc, regexp, start) { - regexp = ensureFlags(regexp, "g"); - for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) { - regexp.lastIndex = ch; - var string = doc.getLine(line), - match = regexp.exec(string); - if (match) return { - from: Pos(line, match.index), - to: Pos(line, match.index + match[0].length), - match - }; - } - } - function searchRegexpForwardMultiline(doc, regexp, start) { - if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start); - regexp = ensureFlags(regexp, "gm"); - var string, - chunk = 1; - for (var line = start.line, last = doc.lastLine(); line <= last;) { - for (var i = 0; i < chunk; i++) { - if (line > last) break; - var curLine = doc.getLine(line++); - string = string == null ? curLine : string + "\n" + curLine; - } - chunk = chunk * 2; - regexp.lastIndex = start.ch; - var match = regexp.exec(string); - if (match) { - var before = string.slice(0, match.index).split("\n"), - inside = match[0].split("\n"); - var startLine = start.line + before.length - 1, - startCh = before[before.length - 1].length; - return { - from: Pos(startLine, startCh), - to: Pos(startLine + inside.length - 1, inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), - match - }; - } - } - } - function lastMatchIn(string, regexp, endMargin) { - var match, - from = 0; - while (from <= string.length) { - regexp.lastIndex = from; - var newMatch = regexp.exec(string); - if (!newMatch) break; - var end = newMatch.index + newMatch[0].length; - if (end > string.length - endMargin) break; - if (!match || end > match.index + match[0].length) match = newMatch; - from = newMatch.index + 1; - } - return match; - } - function searchRegexpBackward(doc, regexp, start) { - regexp = ensureFlags(regexp, "g"); - for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) { - var string = doc.getLine(line); - var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch); - if (match) return { - from: Pos(line, match.index), - to: Pos(line, match.index + match[0].length), - match - }; - } - } - function searchRegexpBackwardMultiline(doc, regexp, start) { - if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start); - regexp = ensureFlags(regexp, "gm"); - var string, - chunkSize = 1, - endMargin = doc.getLine(start.line).length - start.ch; - for (var line = start.line, first = doc.firstLine(); line >= first;) { - for (var i = 0; i < chunkSize && line >= first; i++) { - var curLine = doc.getLine(line--); - string = string == null ? curLine : curLine + "\n" + string; - } - chunkSize *= 2; - var match = lastMatchIn(string, regexp, endMargin); - if (match) { - var before = string.slice(0, match.index).split("\n"), - inside = match[0].split("\n"); - var startLine = line + before.length, - startCh = before[before.length - 1].length; - return { - from: Pos(startLine, startCh), - to: Pos(startLine + inside.length - 1, inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), - match - }; - } - } - } - var doFold, noFold; - if (String.prototype.normalize) { - doFold = function (str) { - return str.normalize("NFD").toLowerCase(); - }; - noFold = function (str) { - return str.normalize("NFD"); - }; - } else { - doFold = function (str) { - return str.toLowerCase(); - }; - noFold = function (str) { - return str; - }; - } - function adjustPos(orig, folded, pos, foldFunc) { - if (orig.length == folded.length) return pos; - for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) { - if (min == max) return min; - var mid = min + max >> 1; - var len = foldFunc(orig.slice(0, mid)).length; - if (len == pos) return mid;else if (len > pos) max = mid;else min = mid + 1; - } - } - function searchStringForward(doc, query, start, caseFold) { - if (!query.length) return null; - var fold = caseFold ? doFold : noFold; - var lines = fold(query).split(/\r|\n\r?/); - search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) { - var orig = doc.getLine(line).slice(ch), - string = fold(orig); - if (lines.length == 1) { - var found = string.indexOf(lines[0]); - if (found == -1) continue search; - var start = adjustPos(orig, string, found, fold) + ch; - return { - from: Pos(line, adjustPos(orig, string, found, fold) + ch), - to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch) - }; - } else { - var cutFrom = string.length - lines[0].length; - if (string.slice(cutFrom) != lines[0]) continue search; - for (var i = 1; i < lines.length - 1; i++) if (fold(doc.getLine(line + i)) != lines[i]) continue search; - var end = doc.getLine(line + lines.length - 1), - endString = fold(end), - lastLine = lines[lines.length - 1]; - if (endString.slice(0, lastLine.length) != lastLine) continue search; - return { - from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch), - to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold)) - }; - } - } +`; +function HeaderEditor(t0) { + const $ = reactCompilerRuntime.c(13); + let hookArgs; + let isHidden; + if ($[0] !== t0) { + ({ + isHidden, + ...hookArgs + } = t0); + $[0] = t0; + $[1] = hookArgs; + $[2] = isHidden; + } else { + hookArgs = $[1]; + isHidden = $[2]; + } + let t1; + if ($[3] === Symbol.for("react.memo_cache_sentinel")) { + t1 = { + nonNull: true, + caller: HeaderEditor + }; + $[3] = t1; + } else { + t1 = $[3]; + } + const { + headerEditor + } = useEditorContext(t1); + const ref = useHeaderEditor(hookArgs, HeaderEditor); + let t2; + let t3; + if ($[4] !== headerEditor || $[5] !== isHidden) { + t2 = () => { + if (!isHidden) { + headerEditor == null ? void 0 : headerEditor.refresh(); } - function searchStringBackward(doc, query, start, caseFold) { - if (!query.length) return null; - var fold = caseFold ? doFold : noFold; - var lines = fold(query).split(/\r|\n\r?/); - search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) { - var orig = doc.getLine(line); - if (ch > -1) orig = orig.slice(0, ch); - var string = fold(orig); - if (lines.length == 1) { - var found = string.lastIndexOf(lines[0]); - if (found == -1) continue search; - return { - from: Pos(line, adjustPos(orig, string, found, fold)), - to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold)) - }; - } else { - var lastLine = lines[lines.length - 1]; - if (string.slice(0, lastLine.length) != lastLine) continue search; - for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++) if (fold(doc.getLine(start + i)) != lines[i]) continue search; - var top = doc.getLine(line + 1 - lines.length), - topString = fold(top); - if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search; - return { - from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)), - to: Pos(line, adjustPos(orig, string, lastLine.length, fold)) - }; - } - } + }; + t3 = [headerEditor, isHidden]; + $[4] = headerEditor; + $[5] = isHidden; + $[6] = t2; + $[7] = t3; + } else { + t2 = $[6]; + t3 = $[7]; + } + React.useEffect(t2, t3); + const t4 = isHidden && "hidden"; + let t5; + if ($[8] !== t4) { + t5 = clsx.clsx("graphiql-editor", t4); + $[8] = t4; + $[9] = t5; + } else { + t5 = $[9]; + } + let t6; + if ($[10] !== ref || $[11] !== t5) { + t6 = /* @__PURE__ */jsxRuntime.jsx("div", { + className: t5, + ref + }); + $[10] = ref; + $[11] = t5; + $[12] = t6; + } else { + t6 = $[12]; + } + return t6; +} +function ImagePreview(props) { + var _a; + const $ = reactCompilerRuntime.c(14); + let t0; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t0 = { + width: null, + height: null + }; + $[0] = t0; + } else { + t0 = $[0]; + } + const [dimensions, setDimensions] = React.useState(t0); + const [mime, setMime] = React.useState(null); + const ref = React.useRef(null); + const src = (_a = tokenToURL(props.token)) == null ? void 0 : _a.href; + let t1; + let t2; + if ($[1] !== src) { + t1 = () => { + if (!ref.current) { + return; } - function SearchCursor(doc, query, pos, options) { - this.atOccurrence = false; - this.afterEmptyMatch = false; - this.doc = doc; - pos = pos ? doc.clipPos(pos) : Pos(0, 0); - this.pos = { - from: pos, - to: pos - }; - var caseFold; - if (typeof options == "object") { - caseFold = options.caseFold; - } else { - caseFold = options; - options = null; - } - if (typeof query == "string") { - if (caseFold == null) caseFold = false; - this.matches = function (reverse, pos2) { - return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos2, caseFold); - }; - } else { - query = ensureFlags(query, "gm"); - if (!options || options.multiline !== false) this.matches = function (reverse, pos2) { - return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos2); - };else this.matches = function (reverse, pos2) { - return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos2); - }; - } + if (!src) { + setDimensions({ + width: null, + height: null + }); + setMime(null); + return; } - SearchCursor.prototype = { - findNext: function () { - return this.find(false); - }, - findPrevious: function () { - return this.find(true); - }, - find: function (reverse) { - var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to); - if (this.afterEmptyMatch && this.atOccurrence) { - head = Pos(head.line, head.ch); - if (reverse) { - head.ch--; - if (head.ch < 0) { - head.line--; - head.ch = (this.doc.getLine(head.line) || "").length; - } - } else { - head.ch++; - if (head.ch > (this.doc.getLine(head.line) || "").length) { - head.ch = 0; - head.line++; - } - } - if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) { - return this.atOccurrence = false; - } - } - var result = this.matches(reverse, head); - this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0; - if (result) { - this.pos = result; - this.atOccurrence = true; - return this.pos.match || true; - } else { - var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0); - this.pos = { - from: end, - to: end - }; - return this.atOccurrence = false; - } - }, - from: function () { - if (this.atOccurrence) return this.pos.from; - }, - to: function () { - if (this.atOccurrence) return this.pos.to; - }, - replace: function (newText, origin) { - if (!this.atOccurrence) return; - var lines = CodeMirror.splitLines(newText); - this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin); - this.pos.to = Pos(this.pos.from.line + lines.length - 1, lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0)); - } - }; - CodeMirror.defineExtension("getSearchCursor", function (query, pos, caseFold) { - return new SearchCursor(this.doc, query, pos, caseFold); - }); - CodeMirror.defineDocExtension("getSearchCursor", function (query, pos, caseFold) { - return new SearchCursor(this, query, pos, caseFold); + fetch(src, { + method: "HEAD" + }).then(response => { + setMime(response.headers.get("Content-Type")); + }).catch(() => { + setMime(null); }); - CodeMirror.defineExtension("selectMatches", function (query, caseFold) { - var ranges = []; - var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold); - while (cur.findNext()) { - if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break; - ranges.push({ - anchor: cur.from(), - head: cur.to() - }); - } - if (ranges.length) this.setSelections(ranges, 0); + }; + t2 = [src]; + $[1] = src; + $[2] = t1; + $[3] = t2; + } else { + t1 = $[2]; + t2 = $[3]; + } + React.useEffect(t1, t2); + let t3; + if ($[4] !== dimensions.height || $[5] !== dimensions.width || $[6] !== mime) { + t3 = dimensions.width !== null && dimensions.height !== null ? /* @__PURE__ */jsxRuntime.jsxs("div", { + children: [dimensions.width, "x", dimensions.height, mime === null ? null : " " + mime] + }) : null; + $[4] = dimensions.height; + $[5] = dimensions.width; + $[6] = mime; + $[7] = t3; + } else { + t3 = $[7]; + } + const dims = t3; + let t4; + if ($[8] === Symbol.for("react.memo_cache_sentinel")) { + t4 = () => { + var _ref19, _ref20; + var _a2, _b; + setDimensions({ + width: (_ref19 = (_a2 = ref.current) == null ? void 0 : _a2.naturalWidth) !== null && _ref19 !== void 0 ? _ref19 : null, + height: (_ref20 = (_b = ref.current) == null ? void 0 : _b.naturalHeight) !== null && _ref20 !== void 0 ? _ref20 : null }); + }; + $[8] = t4; + } else { + t4 = $[8]; + } + let t5; + if ($[9] !== src) { + t5 = /* @__PURE__ */jsxRuntime.jsx("img", { + onLoad: t4, + ref, + src }); - })(); - return searchcursor.exports; -} -exports.requireSearchcursor = requireSearchcursor; - -/***/ }), - -/***/ "../../graphiql-react/dist/show-hint.cjs.js": -/*!**************************************************!*\ - !*** ../../graphiql-react/dist/show-hint.cjs.js ***! - \**************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - } + $[9] = src; + $[10] = t5; + } else { + t5 = $[10]; } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); + let t6; + if ($[11] !== dims || $[12] !== t5) { + t6 = /* @__PURE__ */jsxRuntime.jsxs("div", { + children: [t5, dims] + }); + $[11] = dims; + $[12] = t5; + $[13] = t6; + } else { + t6 = $[13]; + } + return t6; } -var showHint$2 = { - exports: {} +ImagePreview.shouldRender = function shouldRender(token) { + const url = tokenToURL(token); + return url ? isImageURL(url) : false; }; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror()); - })(function (CodeMirror) { - var HINT_ELEMENT_CLASS = "CodeMirror-hint"; - var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active"; - CodeMirror.showHint = function (cm, getHints, options) { - if (!getHints) return cm.showHint(options); - if (options && options.async) getHints.async = true; - var newOpts = { - hint: getHints - }; - if (options) for (var prop in options) newOpts[prop] = options[prop]; - return cm.showHint(newOpts); - }; - CodeMirror.defineExtension("showHint", function (options) { - options = parseOptions(this, this.getCursor("start"), options); - var selections = this.listSelections(); - if (selections.length > 1) return; - if (this.somethingSelected()) { - if (!options.hint.supportsSelection) return; - for (var i = 0; i < selections.length; i++) if (selections[i].head.line != selections[i].anchor.line) return; - } - if (this.state.completionActive) this.state.completionActive.close(); - var completion = this.state.completionActive = new Completion(this, options); - if (!completion.options.hint) return; - CodeMirror.signal(this, "startCompletion", this); - completion.update(true); - }); - CodeMirror.defineExtension("closeHint", function () { - if (this.state.completionActive) this.state.completionActive.close(); +function tokenToURL(token) { + if (token.type !== "string") { + return; + } + const value = token.string.slice(1).slice(0, -1).trim(); + try { + const { + location + } = window; + return new URL(value, location.protocol + "//" + location.host); + } catch { + return; + } +} +function isImageURL(url) { + return /\.(bmp|gif|jpe?g|png|svg|webp)$/.test(url.pathname); +} +function QueryEditor(props) { + const $ = reactCompilerRuntime.c(2); + const ref = useQueryEditor(props, QueryEditor); + let t0; + if ($[0] !== ref) { + t0 = /* @__PURE__ */jsxRuntime.jsx("div", { + className: "graphiql-editor", + ref }); - function Completion(cm, options) { - this.cm = cm; - this.options = options; - this.widget = null; - this.debounce = 0; - this.tick = 0; - this.startPos = this.cm.getCursor("start"); - this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length; - if (this.options.updateOnCursorActivity) { - var self = this; - cm.on("cursorActivity", this.activityFunc = function () { - self.cursorActivity(); - }); - } - } - var requestAnimationFrame = window.requestAnimationFrame || function (fn) { - return setTimeout(fn, 1e3 / 60); + $[0] = ref; + $[1] = t0; + } else { + t0 = $[1]; + } + return t0; +} +function importCodeMirrorImports() { + return importCodeMirror([Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/fold/foldgutter.js */ "../../../node_modules/codemirror/addon/fold/foldgutter.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/fold/brace-fold.js */ "../../../node_modules/codemirror/addon/fold/brace-fold.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/dialog/dialog.js */ "../../../node_modules/codemirror/addon/dialog/dialog.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/search/search.js */ "../../../node_modules/codemirror/addon/search/search.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/search/searchcursor.js */ "../../../node_modules/codemirror/addon/search/searchcursor.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/addon/search/jump-to-line.js */ "../../../node_modules/codemirror/addon/search/jump-to-line.js"))), // @ts-expect-error + Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror/keymap/sublime.js */ "../../../node_modules/codemirror/keymap/sublime.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/results/mode.js */ "../../codemirror-graphql/esm/results/mode.js"))), Promise.resolve().then(() => _interopRequireWildcard(__webpack_require__(/*! codemirror-graphql/esm/utils/info-addon.js */ "../../codemirror-graphql/esm/utils/info-addon.js")))], { + useCommonAddons: false + }); +} +const _useResponseEditor = useResponseEditor; +function useResponseEditor(t0, caller) { + const $ = reactCompilerRuntime.c(19); + let t1; + if ($[0] !== t0) { + t1 = t0 === void 0 ? {} : t0; + $[0] = t0; + $[1] = t1; + } else { + t1 = $[1]; + } + const { + responseTooltip, + editorTheme: t2, + keyMap: t3 + } = t1; + const editorTheme = t2 === void 0 ? DEFAULT_EDITOR_THEME : t2; + const keyMap = t3 === void 0 ? DEFAULT_KEY_MAP : t3; + const t4 = caller || _useResponseEditor; + let t5; + if ($[2] !== t4) { + t5 = { + nonNull: true, + caller: t4 }; - var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; - Completion.prototype = { - close: function () { - if (!this.active()) return; - this.cm.state.completionActive = null; - this.tick = null; - if (this.options.updateOnCursorActivity) { - this.cm.off("cursorActivity", this.activityFunc); - } - if (this.widget && this.data) CodeMirror.signal(this.data, "close"); - if (this.widget) this.widget.close(); - CodeMirror.signal(this.cm, "endCompletion", this.cm); - }, - active: function () { - return this.cm.state.completionActive == this; - }, - pick: function (data, i) { - var completion = data.list[i], - self = this; - this.cm.operation(function () { - if (completion.hint) completion.hint(self.cm, data, completion);else self.cm.replaceRange(getText(completion), completion.from || data.from, completion.to || data.to, "complete"); - CodeMirror.signal(data, "pick", completion); - self.cm.scrollIntoView(); - }); - if (this.options.closeOnPick) { - this.close(); - } - }, - cursorActivity: function () { - if (this.debounce) { - cancelAnimationFrame(this.debounce); - this.debounce = 0; - } - var identStart = this.startPos; - if (this.data) { - identStart = this.data.from; - } - var pos = this.cm.getCursor(), - line = this.cm.getLine(pos.line); - if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || pos.ch < identStart.ch || this.cm.somethingSelected() || !pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1))) { - this.close(); - } else { - var self = this; - this.debounce = requestAnimationFrame(function () { - self.update(); - }); - if (this.widget) this.widget.disable(); + $[2] = t4; + $[3] = t5; + } else { + t5 = $[3]; + } + const { + fetchError, + validationErrors + } = useSchemaContext(t5); + const t6 = caller || _useResponseEditor; + let t7; + if ($[4] !== t6) { + t7 = { + nonNull: true, + caller: t6 + }; + $[4] = t6; + $[5] = t7; + } else { + t7 = $[5]; + } + const { + initialResponse, + responseEditor, + setResponseEditor + } = useEditorContext(t7); + const ref = React.useRef(null); + const responseTooltipRef = React.useRef(responseTooltip); + let t8; + let t9; + if ($[6] !== responseTooltip) { + t8 = () => { + responseTooltipRef.current = responseTooltip; + }; + t9 = [responseTooltip]; + $[6] = responseTooltip; + $[7] = t8; + $[8] = t9; + } else { + t8 = $[7]; + t9 = $[8]; + } + React.useEffect(t8, t9); + let t10; + let t11; + if ($[9] !== editorTheme || $[10] !== initialResponse || $[11] !== setResponseEditor) { + t10 = () => { + let isActive; + isActive = true; + importCodeMirrorImports().then(CodeMirror => { + if (!isActive) { + return; } - }, - update: function (first) { - if (this.tick == null) return; - var self = this, - myTick = ++this.tick; - fetchHints(this.options.hint, this.cm, this.options, function (data) { - if (self.tick == myTick) self.finishUpdate(data, first); - }); - }, - finishUpdate: function (data, first) { - if (this.data) CodeMirror.signal(this.data, "update"); - var picked = this.widget && this.widget.picked || first && this.options.completeSingle; - if (this.widget) this.widget.close(); - this.data = data; - if (data && data.list.length) { - if (picked && data.list.length == 1) { - this.pick(data, 0); - } else { - this.widget = new Widget(this, data); - CodeMirror.signal(data, "shown"); + const tooltipDiv = document.createElement("div"); + CodeMirror.registerHelper("info", "graphql-results", (token, _options, _cm, pos) => { + const infoElements = []; + const ResponseTooltipComponent = responseTooltipRef.current; + if (ResponseTooltipComponent) { + infoElements.push( /* @__PURE__ */jsxRuntime.jsx(ResponseTooltipComponent, { + pos, + token + })); } - } - } - }; - function parseOptions(cm, pos, options) { - var editor = cm.options.hintOptions; - var out = {}; - for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; - if (editor) { - for (var prop in editor) if (editor[prop] !== void 0) out[prop] = editor[prop]; - } - if (options) { - for (var prop in options) if (options[prop] !== void 0) out[prop] = options[prop]; - } - if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos); - return out; - } - function getText(completion) { - if (typeof completion == "string") return completion;else return completion.text; - } - function buildKeyMap(completion, handle) { - var baseMap = { - Up: function () { - handle.moveFocus(-1); - }, - Down: function () { - handle.moveFocus(1); - }, - PageUp: function () { - handle.moveFocus(-handle.menuSize() + 1, true); - }, - PageDown: function () { - handle.moveFocus(handle.menuSize() - 1, true); - }, - Home: function () { - handle.setFocus(0); - }, - End: function () { - handle.setFocus(handle.length - 1); - }, - Enter: handle.pick, - Tab: handle.pick, - Esc: handle.close - }; - var mac = /Mac/.test(navigator.platform); - if (mac) { - baseMap["Ctrl-P"] = function () { - handle.moveFocus(-1); - }; - baseMap["Ctrl-N"] = function () { - handle.moveFocus(1); - }; - } - var custom = completion.options.customKeys; - var ourMap = custom ? {} : baseMap; - function addBinding(key2, val) { - var bound; - if (typeof val != "string") bound = function (cm) { - return val(cm, handle); - };else if (baseMap.hasOwnProperty(val)) bound = baseMap[val];else bound = val; - ourMap[key2] = bound; - } - if (custom) { - for (var key in custom) if (custom.hasOwnProperty(key)) addBinding(key, custom[key]); - } - var extra = completion.options.extraKeys; - if (extra) { - for (var key in extra) if (extra.hasOwnProperty(key)) addBinding(key, extra[key]); - } - return ourMap; - } - function getHintElement(hintsElement, el) { - while (el && el != hintsElement) { - if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el; - el = el.parentNode; - } - } - function Widget(completion, data) { - this.id = "cm-complete-" + Math.floor(Math.random(1e6)); - this.completion = completion; - this.data = data; - this.picked = false; - var widget = this, - cm = completion.cm; - var ownerDocument = cm.getInputField().ownerDocument; - var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow; - var hints = this.hints = ownerDocument.createElement("ul"); - hints.setAttribute("role", "listbox"); - hints.setAttribute("aria-expanded", "true"); - hints.id = this.id; - var theme = completion.cm.options.theme; - hints.className = "CodeMirror-hints " + theme; - this.selectedHint = data.selectedHint || 0; - var completions = data.list; - for (var i = 0; i < completions.length; ++i) { - var elt = hints.appendChild(ownerDocument.createElement("li")), - cur = completions[i]; - var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS); - if (cur.className != null) className = cur.className + " " + className; - elt.className = className; - if (i == this.selectedHint) elt.setAttribute("aria-selected", "true"); - elt.id = this.id + "-" + i; - elt.setAttribute("role", "option"); - if (cur.render) cur.render(elt, data, cur);else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur))); - elt.hintId = i; - } - var container = completion.options.container || ownerDocument.body; - var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); - var left = pos.left, - top = pos.bottom, - below = true; - var offsetLeft = 0, - offsetTop = 0; - if (container !== ownerDocument.body) { - var isContainerPositioned = ["absolute", "relative", "fixed"].indexOf(parentWindow.getComputedStyle(container).position) !== -1; - var offsetParent = isContainerPositioned ? container : container.offsetParent; - var offsetParentPosition = offsetParent.getBoundingClientRect(); - var bodyPosition = ownerDocument.body.getBoundingClientRect(); - offsetLeft = offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft; - offsetTop = offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop; - } - hints.style.left = left - offsetLeft + "px"; - hints.style.top = top - offsetTop + "px"; - var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth); - var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight); - container.appendChild(hints); - cm.getInputField().setAttribute("aria-autocomplete", "list"); - cm.getInputField().setAttribute("aria-owns", this.id); - cm.getInputField().setAttribute("aria-activedescendant", this.id + "-" + this.selectedHint); - var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect(); - var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false; - var startScroll; - setTimeout(function () { - startScroll = cm.getScrollInfo(); - }); - var overlapY = box.bottom - winH; - if (overlapY > 0) { - var height = box.bottom - box.top, - curTop = pos.top - (pos.bottom - box.top); - if (curTop - height > 0) { - hints.style.top = (top = pos.top - height - offsetTop) + "px"; - below = false; - } else if (height > winH) { - hints.style.height = winH - 5 + "px"; - hints.style.top = (top = pos.bottom - box.top - offsetTop) + "px"; - var cursor = cm.getCursor(); - if (data.from.ch != cursor.ch) { - pos = cm.cursorCoords(cursor); - hints.style.left = (left = pos.left - offsetLeft) + "px"; - box = hints.getBoundingClientRect(); + if (ImagePreview.shouldRender(token)) { + infoElements.push( /* @__PURE__ */jsxRuntime.jsx(ImagePreview, { + token + }, "image-preview")); } - } - } - var overlapX = box.right - winW; - if (scrolls) overlapX += cm.display.nativeBarWidth; - if (overlapX > 0) { - if (box.right - box.left > winW) { - hints.style.width = winW - 5 + "px"; - overlapX -= box.right - box.left - winW; - } - hints.style.left = (left = pos.left - overlapX - offsetLeft) + "px"; - } - if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling) node.style.paddingRight = cm.display.nativeBarWidth + "px"; - cm.addKeyMap(this.keyMap = buildKeyMap(completion, { - moveFocus: function (n, avoidWrap) { - widget.changeActive(widget.selectedHint + n, avoidWrap); - }, - setFocus: function (n) { - widget.changeActive(n); - }, - menuSize: function () { - return widget.screenAmount(); - }, - length: completions.length, - close: function () { - completion.close(); - }, - pick: function () { - widget.pick(); - }, - data - })); - if (completion.options.closeOnUnfocus) { - var closingOnBlur; - cm.on("blur", this.onBlur = function () { - closingOnBlur = setTimeout(function () { - completion.close(); - }, 100); - }); - cm.on("focus", this.onFocus = function () { - clearTimeout(closingOnBlur); + if (!infoElements.length) { + ReactDOM.unmountComponentAtNode(tooltipDiv); + return null; + } + ReactDOM.render(infoElements, tooltipDiv); + return tooltipDiv; }); - } - cm.on("scroll", this.onScroll = function () { - var curScroll = cm.getScrollInfo(), - editor = cm.getWrapperElement().getBoundingClientRect(); - if (!startScroll) startScroll = cm.getScrollInfo(); - var newTop = top + startScroll.top - curScroll.top; - var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop); - if (!below) point += hints.offsetHeight; - if (point <= editor.top || point >= editor.bottom) return completion.close(); - hints.style.top = newTop + "px"; - hints.style.left = left + startScroll.left - curScroll.left + "px"; - }); - CodeMirror.on(hints, "dblclick", function (e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) { - widget.changeActive(t.hintId); - widget.pick(); - } - }); - CodeMirror.on(hints, "click", function (e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) { - widget.changeActive(t.hintId); - if (completion.options.completeOnSingleClick) widget.pick(); + const container = ref.current; + if (!container) { + return; } + const newEditor = CodeMirror(container, { + value: initialResponse, + lineWrapping: true, + readOnly: true, + theme: editorTheme, + mode: "graphql-results", + foldGutter: true, + gutters: ["CodeMirror-foldgutter"], + info: true, + extraKeys: commonKeys + }); + setResponseEditor(newEditor); }); - CodeMirror.on(hints, "mousedown", function () { - setTimeout(function () { - cm.focus(); - }, 20); - }); - var selectedHintRange = this.getSelectedHintRange(); - if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) { - this.scrollToActive(); + return () => { + isActive = false; + }; + }; + t11 = [editorTheme, initialResponse, setResponseEditor]; + $[9] = editorTheme; + $[10] = initialResponse; + $[11] = setResponseEditor; + $[12] = t10; + $[13] = t11; + } else { + t10 = $[12]; + t11 = $[13]; + } + React.useEffect(t10, t11); + useSynchronizeOption(responseEditor, "keyMap", keyMap); + let t12; + let t13; + if ($[14] !== fetchError || $[15] !== responseEditor || $[16] !== validationErrors) { + t12 = () => { + if (fetchError) { + responseEditor == null ? void 0 : responseEditor.setValue(fetchError); } - CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]); - return true; - } - Widget.prototype = { - close: function () { - if (this.completion.widget != this) return; - this.completion.widget = null; - if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints); - this.completion.cm.removeKeyMap(this.keyMap); - var input = this.completion.cm.getInputField(); - input.removeAttribute("aria-activedescendant"); - input.removeAttribute("aria-owns"); - var cm = this.completion.cm; - if (this.completion.options.closeOnUnfocus) { - cm.off("blur", this.onBlur); - cm.off("focus", this.onFocus); - } - cm.off("scroll", this.onScroll); - }, - disable: function () { - this.completion.cm.removeKeyMap(this.keyMap); - var widget = this; - this.keyMap = { - Enter: function () { - widget.picked = true; - } - }; - this.completion.cm.addKeyMap(this.keyMap); - }, - pick: function () { - this.completion.pick(this.data, this.selectedHint); - }, - changeActive: function (i, avoidWrap) { - if (i >= this.data.list.length) i = avoidWrap ? this.data.list.length - 1 : 0;else if (i < 0) i = avoidWrap ? 0 : this.data.list.length - 1; - if (this.selectedHint == i) return; - var node = this.hints.childNodes[this.selectedHint]; - if (node) { - node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); - node.removeAttribute("aria-selected"); - } - node = this.hints.childNodes[this.selectedHint = i]; - node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; - node.setAttribute("aria-selected", "true"); - this.completion.cm.getInputField().setAttribute("aria-activedescendant", node.id); - this.scrollToActive(); - CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); - }, - scrollToActive: function () { - var selectedHintRange = this.getSelectedHintRange(); - var node1 = this.hints.childNodes[selectedHintRange.from]; - var node2 = this.hints.childNodes[selectedHintRange.to]; - var firstNode = this.hints.firstChild; - if (node1.offsetTop < this.hints.scrollTop) this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop; - }, - screenAmount: function () { - return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; - }, - getSelectedHintRange: function () { - var margin = this.completion.options.scrollMargin || 0; - return { - from: Math.max(0, this.selectedHint - margin), - to: Math.min(this.data.list.length - 1, this.selectedHint + margin) - }; + if (validationErrors.length > 0) { + responseEditor == null ? void 0 : responseEditor.setValue(toolkit.formatError(validationErrors)); } }; - function applicableHelpers(cm, helpers) { - if (!cm.somethingSelected()) return helpers; - var result = []; - for (var i = 0; i < helpers.length; i++) if (helpers[i].supportsSelection) result.push(helpers[i]); - return result; - } - function fetchHints(hint, cm, options, callback) { - if (hint.async) { - hint(cm, callback, options); - } else { - var result = hint(cm, options); - if (result && result.then) result.then(callback);else callback(result); - } - } - function resolveAutoHints(cm, pos) { - var helpers = cm.getHelpers(pos, "hint"), - words; - if (helpers.length) { - var resolved = function (cm2, callback, options) { - var app = applicableHelpers(cm2, helpers); - function run(i) { - if (i == app.length) return callback(null); - fetchHints(app[i], cm2, options, function (result) { - if (result && result.list.length > 0) callback(result);else run(i + 1); - }); - } - run(0); - }; - resolved.async = true; - resolved.supportsSelection = true; - return resolved; - } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { - return function (cm2) { - return CodeMirror.hint.fromList(cm2, { - words - }); - }; - } else if (CodeMirror.hint.anyword) { - return function (cm2, options) { - return CodeMirror.hint.anyword(cm2, options); - }; - } else { - return function () {}; - } - } - CodeMirror.registerHelper("hint", "auto", { - resolve: resolveAutoHints + t13 = [responseEditor, fetchError, validationErrors]; + $[14] = fetchError; + $[15] = responseEditor; + $[16] = validationErrors; + $[17] = t12; + $[18] = t13; + } else { + t12 = $[17]; + t13 = $[18]; + } + React.useEffect(t12, t13); + return ref; +} +function ResponseEditor(props) { + const $ = reactCompilerRuntime.c(2); + const ref = useResponseEditor(props, ResponseEditor); + let t0; + if ($[0] !== ref) { + t0 = /* @__PURE__ */jsxRuntime.jsx("section", { + className: "result-window", + "aria-label": "Result Window", + "aria-live": "polite", + "aria-atomic": "true", + ref }); - CodeMirror.registerHelper("hint", "fromList", function (cm, options) { - var cur = cm.getCursor(), - token = cm.getTokenAt(cur); - var term, - from = CodeMirror.Pos(cur.line, token.start), - to = cur; - if (token.start < cur.ch && /\w/.test(token.string.charAt(cur.ch - token.start - 1))) { - term = token.string.substr(0, cur.ch - token.start); - } else { - term = ""; - from = cur; + $[0] = ref; + $[1] = t0; + } else { + t0 = $[1]; + } + return t0; +} +function VariableEditor(t0) { + const $ = reactCompilerRuntime.c(13); + let hookArgs; + let isHidden; + if ($[0] !== t0) { + ({ + isHidden, + ...hookArgs + } = t0); + $[0] = t0; + $[1] = hookArgs; + $[2] = isHidden; + } else { + hookArgs = $[1]; + isHidden = $[2]; + } + let t1; + if ($[3] === Symbol.for("react.memo_cache_sentinel")) { + t1 = { + nonNull: true, + caller: VariableEditor + }; + $[3] = t1; + } else { + t1 = $[3]; + } + const { + variableEditor + } = useEditorContext(t1); + const ref = useVariableEditor(hookArgs, VariableEditor); + let t2; + let t3; + if ($[4] !== isHidden || $[5] !== variableEditor) { + t2 = () => { + if (variableEditor && !isHidden) { + variableEditor.refresh(); } - var found = []; - for (var i = 0; i < options.words.length; i++) { - var word = options.words[i]; - if (word.slice(0, term.length) == term) found.push(word); - } - if (found.length) return { - list: found, - from, - to - }; + }; + t3 = [variableEditor, isHidden]; + $[4] = isHidden; + $[5] = variableEditor; + $[6] = t2; + $[7] = t3; + } else { + t2 = $[6]; + t3 = $[7]; + } + React.useEffect(t2, t3); + const t4 = isHidden && "hidden"; + let t5; + if ($[8] !== t4) { + t5 = clsx.clsx("graphiql-editor", t4); + $[8] = t4; + $[9] = t5; + } else { + t5 = $[9]; + } + let t6; + if ($[10] !== ref || $[11] !== t5) { + t6 = /* @__PURE__ */jsxRuntime.jsx("div", { + className: t5, + ref }); - CodeMirror.commands.autocomplete = CodeMirror.showHint; - var defaultOptions = { - hint: CodeMirror.hint.auto, - completeSingle: true, - alignWithWord: true, - closeCharacters: /[\s()\[\]{};:>,]/, - closeOnPick: true, - closeOnUnfocus: true, - updateOnCursorActivity: true, - completeOnSingleClick: true, - container: null, - customKeys: null, - extraKeys: null, - paddingForScrollbar: true, - moveOnOverlap: true - }; - CodeMirror.defineOption("hintOptions", null); - }); -})(); -var showHintExports = showHint$2.exports; -const showHint = /* @__PURE__ */codemirror.getDefaultExportFromCjs(showHintExports); -const showHint$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: showHint -}, [showHintExports]); -exports.showHint = showHint$1; - -/***/ }), - -/***/ "../../graphiql-react/dist/sublime.cjs.js": -/*!************************************************!*\ - !*** ../../graphiql-react/dist/sublime.cjs.js ***! - \************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -const codemirror = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -const searchcursor = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"); -const matchbrackets = __webpack_require__(/*! ./matchbrackets.cjs2.js */ "../../graphiql-react/dist/matchbrackets.cjs2.js"); -function _mergeNamespaces(n, m) { - for (var i = 0; i < m.length; i++) { - const e = m[i]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - } + $[10] = ref; + $[11] = t5; + $[12] = t6; + } else { + t6 = $[12]; } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); + return t6; } -var sublime$2 = { - exports: {} -}; -(function (module2, exports2) { - (function (mod) { - mod(codemirror.requireCodemirror(), searchcursor.requireSearchcursor(), matchbrackets.requireMatchbrackets()); - })(function (CodeMirror) { - var cmds = CodeMirror.commands; - var Pos = CodeMirror.Pos; - function findPosSubword(doc, start, dir) { - if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1)); - var line = doc.getLine(start.line); - if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0)); - var state = "start", - type, - startPos = start.ch; - for (var pos = startPos, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) { - var next = line.charAt(dir < 0 ? pos - 1 : pos); - var cat = next != "_" && CodeMirror.isWordChar(next) ? "w" : "o"; - if (cat == "w" && next.toUpperCase() == next) cat = "W"; - if (state == "start") { - if (cat != "o") { - state = "in"; - type = cat; - } else startPos = pos + dir; - } else if (state == "in") { - if (type != cat) { - if (type == "w" && cat == "W" && dir < 0) pos--; - if (type == "W" && cat == "w" && dir > 0) { - if (pos == startPos + 1) { - type = "w"; - continue; - } else pos--; +function GraphiQLProvider(t0) { + const $ = reactCompilerRuntime.c(39); + const { + children, + dangerouslyAssumeSchemaIsValid, + defaultQuery, + defaultHeaders, + defaultTabs, + externalFragments, + fetcher, + getDefaultFieldNames, + headers, + inputValueDeprecation, + introspectionQueryName, + maxHistoryLength, + onEditOperationName, + onSchemaChange, + onTabChange, + onTogglePluginVisibility, + operationName, + plugins, + query, + response, + schema, + schemaDescription, + shouldPersistHeaders, + storage, + validationRules, + variables, + visiblePlugin + } = t0; + let t1; + if ($[0] !== children || $[1] !== onTogglePluginVisibility || $[2] !== plugins || $[3] !== visiblePlugin) { + t1 = /* @__PURE__ */jsxRuntime.jsx(ExplorerContextProvider, { + children: /* @__PURE__ */jsxRuntime.jsx(PluginContextProvider, { + onTogglePluginVisibility, + plugins, + visiblePlugin, + children + }) + }); + $[0] = children; + $[1] = onTogglePluginVisibility; + $[2] = plugins; + $[3] = visiblePlugin; + $[4] = t1; + } else { + t1 = $[4]; + } + let t2; + if ($[5] !== fetcher || $[6] !== getDefaultFieldNames || $[7] !== operationName || $[8] !== t1) { + t2 = /* @__PURE__ */jsxRuntime.jsx(ExecutionContextProvider, { + getDefaultFieldNames, + fetcher, + operationName, + children: t1 + }); + $[5] = fetcher; + $[6] = getDefaultFieldNames; + $[7] = operationName; + $[8] = t1; + $[9] = t2; + } else { + t2 = $[9]; + } + let t3; + if ($[10] !== dangerouslyAssumeSchemaIsValid || $[11] !== fetcher || $[12] !== inputValueDeprecation || $[13] !== introspectionQueryName || $[14] !== onSchemaChange || $[15] !== schema || $[16] !== schemaDescription || $[17] !== t2) { + t3 = /* @__PURE__ */jsxRuntime.jsx(SchemaContextProvider, { + dangerouslyAssumeSchemaIsValid, + fetcher, + inputValueDeprecation, + introspectionQueryName, + onSchemaChange, + schema, + schemaDescription, + children: t2 + }); + $[10] = dangerouslyAssumeSchemaIsValid; + $[11] = fetcher; + $[12] = inputValueDeprecation; + $[13] = introspectionQueryName; + $[14] = onSchemaChange; + $[15] = schema; + $[16] = schemaDescription; + $[17] = t2; + $[18] = t3; + } else { + t3 = $[18]; + } + let t4; + if ($[19] !== defaultHeaders || $[20] !== defaultQuery || $[21] !== defaultTabs || $[22] !== externalFragments || $[23] !== headers || $[24] !== onEditOperationName || $[25] !== onTabChange || $[26] !== query || $[27] !== response || $[28] !== shouldPersistHeaders || $[29] !== t3 || $[30] !== validationRules || $[31] !== variables) { + t4 = /* @__PURE__ */jsxRuntime.jsx(EditorContextProvider, { + defaultQuery, + defaultHeaders, + defaultTabs, + externalFragments, + headers, + onEditOperationName, + onTabChange, + query, + response, + shouldPersistHeaders, + validationRules, + variables, + children: t3 + }); + $[19] = defaultHeaders; + $[20] = defaultQuery; + $[21] = defaultTabs; + $[22] = externalFragments; + $[23] = headers; + $[24] = onEditOperationName; + $[25] = onTabChange; + $[26] = query; + $[27] = response; + $[28] = shouldPersistHeaders; + $[29] = t3; + $[30] = validationRules; + $[31] = variables; + $[32] = t4; + } else { + t4 = $[32]; + } + let t5; + if ($[33] !== maxHistoryLength || $[34] !== t4) { + t5 = /* @__PURE__ */jsxRuntime.jsx(HistoryContextProvider, { + maxHistoryLength, + children: t4 + }); + $[33] = maxHistoryLength; + $[34] = t4; + $[35] = t5; + } else { + t5 = $[35]; + } + let t6; + if ($[36] !== storage || $[37] !== t5) { + t6 = /* @__PURE__ */jsxRuntime.jsx(StorageContextProvider, { + storage, + children: t5 + }); + $[36] = storage; + $[37] = t5; + $[38] = t6; + } else { + t6 = $[38]; + } + return t6; +} +function useTheme(t0) { + const $ = reactCompilerRuntime.c(11); + const defaultTheme = t0 === void 0 ? null : t0; + const storageContext = useStorageContext(); + let t1; + if ($[0] !== defaultTheme || $[1] !== storageContext) { + t1 = () => { + if (!storageContext) { + return null; + } + const stored = storageContext.get(STORAGE_KEY); + switch (stored) { + case "light": + { + return "light"; + } + case "dark": + { + return "dark"; + } + default: + { + if (typeof stored === "string") { + storageContext.set(STORAGE_KEY, ""); } - break; + return defaultTheme; } - } } - return Pos(start.line, pos); - } - function moveSubword(cm, dir) { - cm.extendSelectionsBy(function (range) { - if (cm.display.shift || cm.doc.extend || range.empty()) return findPosSubword(cm.doc, range.head, dir);else return dir < 0 ? range.from() : range.to(); - }); - } - cmds.goSubwordLeft = function (cm) { - moveSubword(cm, -1); }; - cmds.goSubwordRight = function (cm) { - moveSubword(cm, 1); - }; - cmds.scrollLineUp = function (cm) { - var info = cm.getScrollInfo(); - if (!cm.somethingSelected()) { - var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local"); - if (cm.getCursor().line >= visibleBottomLine) cm.execCommand("goLineUp"); + $[0] = defaultTheme; + $[1] = storageContext; + $[2] = t1; + } else { + t1 = $[2]; + } + const [theme, setThemeInternal] = React.useState(t1); + let t2; + let t3; + if ($[3] !== theme) { + t2 = () => { + if (typeof window === "undefined") { + return; } - cm.scrollTo(null, info.top - cm.defaultTextHeight()); - }; - cmds.scrollLineDown = function (cm) { - var info = cm.getScrollInfo(); - if (!cm.somethingSelected()) { - var visibleTopLine = cm.lineAtHeight(info.top, "local") + 1; - if (cm.getCursor().line <= visibleTopLine) cm.execCommand("goLineDown"); + document.body.classList.remove("graphiql-light", "graphiql-dark"); + if (theme) { + document.body.classList.add(`graphiql-${theme}`); } - cm.scrollTo(null, info.top + cm.defaultTextHeight()); }; - cmds.splitSelectionByLine = function (cm) { - var ranges = cm.listSelections(), - lineRanges = []; - for (var i = 0; i < ranges.length; i++) { - var from = ranges[i].from(), - to = ranges[i].to(); - for (var line = from.line; line <= to.line; ++line) if (!(to.line > from.line && line == to.line && to.ch == 0)) lineRanges.push({ - anchor: line == from.line ? from : Pos(line, 0), - head: line == to.line ? to : Pos(line) - }); - } - cm.setSelections(lineRanges, 0); + t3 = [theme]; + $[3] = theme; + $[4] = t2; + $[5] = t3; + } else { + t2 = $[4]; + t3 = $[5]; + } + React.useLayoutEffect(t2, t3); + let t4; + if ($[6] !== storageContext) { + t4 = newTheme => { + storageContext == null ? void 0 : storageContext.set(STORAGE_KEY, newTheme || ""); + setThemeInternal(newTheme); }; - cmds.singleSelectionTop = function (cm) { - var range = cm.listSelections()[0]; - cm.setSelection(range.anchor, range.head, { - scroll: false - }); + $[6] = storageContext; + $[7] = t4; + } else { + t4 = $[7]; + } + const setTheme = t4; + let t5; + if ($[8] !== setTheme || $[9] !== theme) { + t5 = { + theme, + setTheme }; - cmds.selectLine = function (cm) { - var ranges = cm.listSelections(), - extended = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - extended.push({ - anchor: Pos(range.from().line, 0), - head: Pos(range.to().line + 1, 0) - }); + $[8] = setTheme; + $[9] = theme; + $[10] = t5; + } else { + t5 = $[10]; + } + return t5; +} +const STORAGE_KEY = "theme"; +function useDragResize(t0) { + const $ = reactCompilerRuntime.c(31); + const { + defaultSizeRelation: t1, + direction, + initiallyHidden, + onHiddenElementChange, + sizeThresholdFirst: t2, + sizeThresholdSecond: t3, + storageKey + } = t0; + const defaultSizeRelation = t1 === void 0 ? DEFAULT_FLEX : t1; + const sizeThresholdFirst = t2 === void 0 ? 100 : t2; + const sizeThresholdSecond = t3 === void 0 ? 100 : t3; + const storage = useStorageContext(); + let t4; + if ($[0] !== storage || $[1] !== storageKey) { + t4 = debounce(500, value => { + if (storageKey) { + storage == null ? void 0 : storage.set(storageKey, value); } - cm.setSelections(extended); - }; - function insertLine(cm, above) { - if (cm.isReadOnly()) return CodeMirror.Pass; - cm.operation(function () { - var len = cm.listSelections().length, - newSelection = [], - last = -1; - for (var i = 0; i < len; i++) { - var head = cm.listSelections()[i].head; - if (head.line <= last) continue; - var at = Pos(head.line + (above ? 0 : 1), 0); - cm.replaceRange("\n", at, null, "+insertLine"); - cm.indentLine(at.line, null, true); - newSelection.push({ - head: at, - anchor: at - }); - last = head.line + 1; - } - cm.setSelections(newSelection); - }); - cm.execCommand("indentAuto"); - } - cmds.insertLineAfter = function (cm) { - return insertLine(cm, false); - }; - cmds.insertLineBefore = function (cm) { - return insertLine(cm, true); - }; - function wordAt(cm, pos) { - var start = pos.ch, - end = start, - line = cm.getLine(pos.line); - while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start; - while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end; - return { - from: Pos(pos.line, start), - to: Pos(pos.line, end), - word: line.slice(start, end) - }; - } - cmds.selectNextOccurrence = function (cm) { - var from = cm.getCursor("from"), - to = cm.getCursor("to"); - var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel; - if (CodeMirror.cmpPos(from, to) == 0) { - var word = wordAt(cm, from); - if (!word.word) return; - cm.setSelection(word.from, word.to); - fullWord = true; - } else { - var text = cm.getRange(from, to); - var query = fullWord ? new RegExp("\\b" + text + "\\b") : text; - var cur = cm.getSearchCursor(query, to); - var found = cur.findNext(); - if (!found) { - cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0)); - found = cur.findNext(); - } - if (!found || isSelectedRange(cm.listSelections(), cur.from(), cur.to())) return; - cm.addSelection(cur.from(), cur.to()); - } - if (fullWord) cm.state.sublimeFindFullWord = cm.doc.sel; - }; - cmds.skipAndSelectNextOccurrence = function (cm) { - var prevAnchor = cm.getCursor("anchor"), - prevHead = cm.getCursor("head"); - cmds.selectNextOccurrence(cm); - if (CodeMirror.cmpPos(prevAnchor, prevHead) != 0) { - cm.doc.setSelections(cm.doc.listSelections().filter(function (sel) { - return sel.anchor != prevAnchor || sel.head != prevHead; - })); + }); + $[0] = storage; + $[1] = storageKey; + $[2] = t4; + } else { + t4 = $[2]; + } + const store = t4; + let t5; + if ($[3] !== initiallyHidden || $[4] !== storage || $[5] !== storageKey) { + t5 = () => { + const storedValue = storageKey && (storage == null ? void 0 : storage.get(storageKey)); + if (storedValue === HIDE_FIRST || initiallyHidden === "first") { + return "first"; } - }; - function addCursorToSelection(cm, dir) { - var ranges = cm.listSelections(), - newRanges = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - var newAnchor = cm.findPosV(range.anchor, dir, "line", range.anchor.goalColumn); - var newHead = cm.findPosV(range.head, dir, "line", range.head.goalColumn); - newAnchor.goalColumn = range.anchor.goalColumn != null ? range.anchor.goalColumn : cm.cursorCoords(range.anchor, "div").left; - newHead.goalColumn = range.head.goalColumn != null ? range.head.goalColumn : cm.cursorCoords(range.head, "div").left; - var newRange = { - anchor: newAnchor, - head: newHead - }; - newRanges.push(range); - newRanges.push(newRange); + if (storedValue === HIDE_SECOND || initiallyHidden === "second") { + return "second"; } - cm.setSelections(newRanges); - } - cmds.addCursorToPrevLine = function (cm) { - addCursorToSelection(cm, -1); - }; - cmds.addCursorToNextLine = function (cm) { - addCursorToSelection(cm, 1); + return null; }; - function isSelectedRange(ranges, from, to) { - for (var i = 0; i < ranges.length; i++) if (CodeMirror.cmpPos(ranges[i].from(), from) == 0 && CodeMirror.cmpPos(ranges[i].to(), to) == 0) return true; - return false; - } - var mirror = "(){}[]"; - function selectBetweenBrackets(cm) { - var ranges = cm.listSelections(), - newRanges = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], - pos = range.head, - opening = cm.scanForBracket(pos, -1); - if (!opening) return false; - for (;;) { - var closing = cm.scanForBracket(pos, 1); - if (!closing) return false; - if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) { - var startPos = Pos(opening.pos.line, opening.pos.ch + 1); - if (CodeMirror.cmpPos(startPos, range.from()) == 0 && CodeMirror.cmpPos(closing.pos, range.to()) == 0) { - opening = cm.scanForBracket(opening.pos, -1); - if (!opening) return false; - } else { - newRanges.push({ - anchor: startPos, - head: closing.pos - }); - break; - } - } - pos = Pos(closing.pos.line, closing.pos.ch + 1); - } + $[3] = initiallyHidden; + $[4] = storage; + $[5] = storageKey; + $[6] = t5; + } else { + t5 = $[6]; + } + const [hiddenElement, setHiddenElement] = React.useState(t5); + let t6; + if ($[7] !== hiddenElement || $[8] !== onHiddenElementChange) { + t6 = element => { + if (element !== hiddenElement) { + setHiddenElement(element); + onHiddenElementChange == null ? void 0 : onHiddenElementChange(element); } - cm.setSelections(newRanges); - return true; - } - cmds.selectScope = function (cm) { - selectBetweenBrackets(cm) || cm.execCommand("selectAll"); - }; - cmds.selectBetweenBrackets = function (cm) { - if (!selectBetweenBrackets(cm)) return CodeMirror.Pass; - }; - function puncType(type) { - return !type ? null : /\bpunctuation\b/.test(type) ? type : void 0; - } - cmds.goToBracket = function (cm) { - cm.extendSelectionsBy(function (range) { - var next = cm.scanForBracket(range.head, 1, puncType(cm.getTokenTypeAt(range.head))); - if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos; - var prev = cm.scanForBracket(range.head, -1, puncType(cm.getTokenTypeAt(Pos(range.head.line, range.head.ch + 1)))); - return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head; - }); }; - cmds.swapLineUp = function (cm) { - if (cm.isReadOnly()) return CodeMirror.Pass; - var ranges = cm.listSelections(), - linesToMove = [], - at = cm.firstLine() - 1, - newSels = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], - from = range.from().line - 1, - to = range.to().line; - newSels.push({ - anchor: Pos(range.anchor.line - 1, range.anchor.ch), - head: Pos(range.head.line - 1, range.head.ch) - }); - if (range.to().ch == 0 && !range.empty()) --to; - if (from > at) linesToMove.push(from, to);else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; - at = to; + $[7] = hiddenElement; + $[8] = onHiddenElementChange; + $[9] = t6; + } else { + t6 = $[9]; + } + const setHiddenElementWithCallback = t6; + const firstRef = React.useRef(null); + const dragBarRef = React.useRef(null); + const secondRef = React.useRef(null); + const defaultFlexRef = React.useRef(`${defaultSizeRelation}`); + let t7; + if ($[10] !== storage || $[11] !== storageKey) { + t7 = () => { + const storedValue_0 = storageKey && (storage == null ? void 0 : storage.get(storageKey)) || defaultFlexRef.current; + if (firstRef.current) { + firstRef.current.style.display = "flex"; + firstRef.current.style.flex = storedValue_0 === HIDE_FIRST || storedValue_0 === HIDE_SECOND ? defaultFlexRef.current : storedValue_0; } - cm.operation(function () { - for (var i2 = 0; i2 < linesToMove.length; i2 += 2) { - var from2 = linesToMove[i2], - to2 = linesToMove[i2 + 1]; - var line = cm.getLine(from2); - cm.replaceRange("", Pos(from2, 0), Pos(from2 + 1, 0), "+swapLine"); - if (to2 > cm.lastLine()) cm.replaceRange("\n" + line, Pos(cm.lastLine()), null, "+swapLine");else cm.replaceRange(line + "\n", Pos(to2, 0), null, "+swapLine"); - } - cm.setSelections(newSels); - cm.scrollIntoView(); - }); - }; - cmds.swapLineDown = function (cm) { - if (cm.isReadOnly()) return CodeMirror.Pass; - var ranges = cm.listSelections(), - linesToMove = [], - at = cm.lastLine() + 1; - for (var i = ranges.length - 1; i >= 0; i--) { - var range = ranges[i], - from = range.to().line + 1, - to = range.from().line; - if (range.to().ch == 0 && !range.empty()) from--; - if (from < at) linesToMove.push(from, to);else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; - at = to; + if (secondRef.current) { + secondRef.current.style.display = "flex"; + secondRef.current.style.flex = "1"; } - cm.operation(function () { - for (var i2 = linesToMove.length - 2; i2 >= 0; i2 -= 2) { - var from2 = linesToMove[i2], - to2 = linesToMove[i2 + 1]; - var line = cm.getLine(from2); - if (from2 == cm.lastLine()) cm.replaceRange("", Pos(from2 - 1), Pos(from2), "+swapLine");else cm.replaceRange("", Pos(from2, 0), Pos(from2 + 1, 0), "+swapLine"); - cm.replaceRange(line + "\n", Pos(to2, 0), null, "+swapLine"); - } - cm.scrollIntoView(); - }); - }; - cmds.toggleCommentIndented = function (cm) { - cm.toggleComment({ - indent: true - }); - }; - cmds.joinLines = function (cm) { - var ranges = cm.listSelections(), - joined = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], - from = range.from(); - var start = from.line, - end = range.to().line; - while (i < ranges.length - 1 && ranges[i + 1].from().line == end) end = ranges[++i].to().line; - joined.push({ - start, - end, - anchor: !range.empty() && from - }); + if (dragBarRef.current) { + dragBarRef.current.style.display = "flex"; } - cm.operation(function () { - var offset = 0, - ranges2 = []; - for (var i2 = 0; i2 < joined.length; i2++) { - var obj = joined[i2]; - var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), - head; - for (var line = obj.start; line <= obj.end; line++) { - var actual = line - offset; - if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1); - if (actual < cm.lastLine()) { - cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length)); - ++offset; - } - } - ranges2.push({ - anchor: anchor || head, - head - }); - } - cm.setSelections(ranges2, 0); - }); }; - cmds.duplicateLine = function (cm) { - cm.operation(function () { - var rangeCount = cm.listSelections().length; - for (var i = 0; i < rangeCount; i++) { - var range = cm.listSelections()[i]; - if (range.empty()) cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0));else cm.replaceRange(cm.getRange(range.from(), range.to()), range.from()); + $[10] = storage; + $[11] = storageKey; + $[12] = t7; + } else { + t7 = $[12]; + } + let t8; + if ($[13] !== direction || $[14] !== storage || $[15] !== storageKey) { + t8 = [direction, storage, storageKey]; + $[13] = direction; + $[14] = storage; + $[15] = storageKey; + $[16] = t8; + } else { + t8 = $[16]; + } + React.useLayoutEffect(t7, t8); + let t10; + let t9; + if ($[17] !== hiddenElement || $[18] !== storage || $[19] !== storageKey) { + t9 = () => { + const hide = resizableElement => { + const element_0 = resizableElement === "first" ? firstRef.current : secondRef.current; + if (!element_0) { + return; } - cm.scrollIntoView(); - }); - }; - function sortLines(cm, caseSensitive, direction) { - if (cm.isReadOnly()) return CodeMirror.Pass; - var ranges = cm.listSelections(), - toSort = [], - selected; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.empty()) continue; - var from = range.from().line, - to = range.to().line; - while (i < ranges.length - 1 && ranges[i + 1].from().line == to) to = ranges[++i].to().line; - if (!ranges[i].to().ch) to--; - toSort.push(from, to); - } - if (toSort.length) selected = true;else toSort.push(cm.firstLine(), cm.lastLine()); - cm.operation(function () { - var ranges2 = []; - for (var i2 = 0; i2 < toSort.length; i2 += 2) { - var from2 = toSort[i2], - to2 = toSort[i2 + 1]; - var start = Pos(from2, 0), - end = Pos(to2); - var lines = cm.getRange(start, end, false); - if (caseSensitive) lines.sort(function (a, b) { - return a < b ? -direction : a == b ? 0 : direction; - });else lines.sort(function (a, b) { - var au = a.toUpperCase(), - bu = b.toUpperCase(); - if (au != bu) { - a = au; - b = bu; - } - return a < b ? -direction : a == b ? 0 : direction; - }); - cm.replaceRange(lines, start, end); - if (selected) ranges2.push({ - anchor: start, - head: Pos(to2 + 1, 0) - }); + element_0.style.left = "-1000px"; + element_0.style.position = "absolute"; + element_0.style.opacity = "0"; + element_0.style.height = "500px"; + element_0.style.width = "500px"; + if (firstRef.current) { + const flex = parseFloat(firstRef.current.style.flex); + if (!Number.isFinite(flex) || flex < 1) { + firstRef.current.style.flex = "1"; + } } - if (selected) cm.setSelections(ranges2, 0); - }); - } - cmds.sortLines = function (cm) { - sortLines(cm, true, 1); - }; - cmds.reverseSortLines = function (cm) { - sortLines(cm, true, -1); - }; - cmds.sortLinesInsensitive = function (cm) { - sortLines(cm, false, 1); - }; - cmds.reverseSortLinesInsensitive = function (cm) { - sortLines(cm, false, -1); - }; - cmds.nextBookmark = function (cm) { - var marks = cm.state.sublimeBookmarks; - if (marks) while (marks.length) { - var current = marks.shift(); - var found = current.find(); - if (found) { - marks.push(current); - return cm.setSelection(found.from, found.to); + }; + const show = resizableElement_0 => { + const element_1 = resizableElement_0 === "first" ? firstRef.current : secondRef.current; + if (!element_1) { + return; } - } - }; - cmds.prevBookmark = function (cm) { - var marks = cm.state.sublimeBookmarks; - if (marks) while (marks.length) { - marks.unshift(marks.pop()); - var found = marks[marks.length - 1].find(); - if (!found) marks.pop();else return cm.setSelection(found.from, found.to); - } - }; - cmds.toggleBookmark = function (cm) { - var ranges = cm.listSelections(); - var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []); - for (var i = 0; i < ranges.length; i++) { - var from = ranges[i].from(), - to = ranges[i].to(); - var found = ranges[i].empty() ? cm.findMarksAt(from) : cm.findMarks(from, to); - for (var j = 0; j < found.length; j++) { - if (found[j].sublimeBookmark) { - found[j].clear(); - for (var k = 0; k < marks.length; k++) if (marks[k] == found[j]) marks.splice(k--, 1); - break; + element_1.style.width = ""; + element_1.style.height = ""; + element_1.style.opacity = ""; + element_1.style.position = ""; + element_1.style.left = ""; + if (storage && storageKey) { + const storedValue_1 = storage.get(storageKey); + if (firstRef.current && storedValue_1 !== HIDE_FIRST && storedValue_1 !== HIDE_SECOND) { + firstRef.current.style.flex = storedValue_1 || defaultFlexRef.current; } } - if (j == found.length) marks.push(cm.markText(from, to, { - sublimeBookmark: true, - clearWhenEmpty: false - })); + }; + if (hiddenElement === "first") { + hide("first"); + } else { + show("first"); } - }; - cmds.clearBookmarks = function (cm) { - var marks = cm.state.sublimeBookmarks; - if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear(); - marks.length = 0; - }; - cmds.selectBookmarks = function (cm) { - var marks = cm.state.sublimeBookmarks, - ranges = []; - if (marks) for (var i = 0; i < marks.length; i++) { - var found = marks[i].find(); - if (!found) marks.splice(i--, 0);else ranges.push({ - anchor: found.from, - head: found.to - }); + if (hiddenElement === "second") { + hide("second"); + } else { + show("second"); } - if (ranges.length) cm.setSelections(ranges, 0); }; - function modifyWordOrSelection(cm, mod) { - cm.operation(function () { - var ranges = cm.listSelections(), - indices = [], - replacements = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.empty()) { - indices.push(i); - replacements.push(""); - } else replacements.push(mod(cm.getRange(range.from(), range.to()))); - } - cm.replaceSelections(replacements, "around", "case"); - for (var i = indices.length - 1, at; i >= 0; i--) { - var range = ranges[indices[i]]; - if (at && CodeMirror.cmpPos(range.head, at) > 0) continue; - var word = wordAt(cm, range.head); - at = word.from; - cm.replaceRange(mod(word.word), word.from, word.to); - } - }); - } - cmds.smartBackspace = function (cm) { - if (cm.somethingSelected()) return CodeMirror.Pass; - cm.operation(function () { - var cursors = cm.listSelections(); - var indentUnit = cm.getOption("indentUnit"); - for (var i = cursors.length - 1; i >= 0; i--) { - var cursor = cursors[i].head; - var toStartOfLine = cm.getRange({ - line: cursor.line, - ch: 0 - }, cursor); - var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize")); - var deletePos = cm.findPosH(cursor, -1, "char", false); - if (toStartOfLine && !/\S/.test(toStartOfLine) && column % indentUnit == 0) { - var prevIndent = new Pos(cursor.line, CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit)); - if (prevIndent.ch != cursor.ch) deletePos = prevIndent; + t10 = [hiddenElement, storage, storageKey]; + $[17] = hiddenElement; + $[18] = storage; + $[19] = storageKey; + $[20] = t10; + $[21] = t9; + } else { + t10 = $[20]; + t9 = $[21]; + } + React.useLayoutEffect(t9, t10); + let t11; + let t12; + if ($[22] !== direction || $[23] !== setHiddenElementWithCallback || $[24] !== sizeThresholdFirst || $[25] !== sizeThresholdSecond || $[26] !== store) { + t11 = () => { + if (!dragBarRef.current || !firstRef.current || !secondRef.current) { + return; + } + const dragBarContainer = dragBarRef.current; + const firstContainer = firstRef.current; + const wrapper = firstContainer.parentElement; + const eventProperty = direction === "horizontal" ? "clientX" : "clientY"; + const rectProperty = direction === "horizontal" ? "left" : "top"; + const adjacentRectProperty = direction === "horizontal" ? "right" : "bottom"; + const sizeProperty = direction === "horizontal" ? "clientWidth" : "clientHeight"; + const handleMouseDown = function handleMouseDown2(downEvent) { + downEvent.preventDefault(); + const offset = downEvent[eventProperty] - dragBarContainer.getBoundingClientRect()[rectProperty]; + const handleMouseMove = function handleMouseMove2(moveEvent) { + if (moveEvent.buttons === 0) { + return handleMouseUp(); + } + const firstSize = moveEvent[eventProperty] - wrapper.getBoundingClientRect()[rectProperty] - offset; + const secondSize = wrapper.getBoundingClientRect()[adjacentRectProperty] - moveEvent[eventProperty] + offset - dragBarContainer[sizeProperty]; + if (firstSize < sizeThresholdFirst) { + setHiddenElementWithCallback("first"); + store(HIDE_FIRST); + } else { + if (secondSize < sizeThresholdSecond) { + setHiddenElementWithCallback("second"); + store(HIDE_SECOND); + } else { + setHiddenElementWithCallback(null); + const newFlex = `${firstSize / secondSize}`; + firstContainer.style.flex = newFlex; + store(newFlex); + } } - cm.replaceRange("", deletePos, cursor, "+delete"); + }; + function handleMouseUp() { + document.removeEventListener("mousemove", handleMouseMove); + document.removeEventListener("mouseup", handleMouseUp); } - }); - }; - cmds.delLineRight = function (cm) { - cm.operation(function () { - var ranges = cm.listSelections(); - for (var i = ranges.length - 1; i >= 0; i--) cm.replaceRange("", ranges[i].anchor, Pos(ranges[i].to().line), "+delete"); - cm.scrollIntoView(); - }); - }; - cmds.upcaseAtCursor = function (cm) { - modifyWordOrSelection(cm, function (str) { - return str.toUpperCase(); - }); - }; - cmds.downcaseAtCursor = function (cm) { - modifyWordOrSelection(cm, function (str) { - return str.toLowerCase(); - }); - }; - cmds.setSublimeMark = function (cm) { - if (cm.state.sublimeMark) cm.state.sublimeMark.clear(); - cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); + document.addEventListener("mousemove", handleMouseMove); + document.addEventListener("mouseup", handleMouseUp); + }; + dragBarContainer.addEventListener("mousedown", handleMouseDown); + const reset = function reset2() { + if (firstRef.current) { + firstRef.current.style.flex = defaultFlexRef.current; + } + store(defaultFlexRef.current); + setHiddenElementWithCallback(null); + }; + dragBarContainer.addEventListener("dblclick", reset); + return () => { + dragBarContainer.removeEventListener("mousedown", handleMouseDown); + dragBarContainer.removeEventListener("dblclick", reset); + }; }; - cmds.selectToSublimeMark = function (cm) { - var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); - if (found) cm.setSelection(cm.getCursor(), found); + t12 = [direction, setHiddenElementWithCallback, sizeThresholdFirst, sizeThresholdSecond, store]; + $[22] = direction; + $[23] = setHiddenElementWithCallback; + $[24] = sizeThresholdFirst; + $[25] = sizeThresholdSecond; + $[26] = store; + $[27] = t11; + $[28] = t12; + } else { + t11 = $[27]; + t12 = $[28]; + } + React.useEffect(t11, t12); + let t13; + if ($[29] !== hiddenElement) { + t13 = { + dragBarRef, + hiddenElement, + firstRef, + setHiddenElement, + secondRef }; - cmds.deleteToSublimeMark = function (cm) { - var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); - if (found) { - var from = cm.getCursor(), - to = found; - if (CodeMirror.cmpPos(from, to) > 0) { - var tmp = to; - to = from; - from = tmp; + $[29] = hiddenElement; + $[30] = t13; + } else { + t13 = $[30]; + } + return t13; +} +const DEFAULT_FLEX = 1; +const HIDE_FIRST = "hide-first"; +const HIDE_SECOND = "hide-second"; +const ToolbarButton = React.forwardRef((t0, ref) => { + const $ = reactCompilerRuntime.c(19); + let label; + let onClick; + let props; + if ($[0] !== t0) { + ({ + label, + onClick, + ...props + } = t0); + $[0] = t0; + $[1] = label; + $[2] = onClick; + $[3] = props; + } else { + label = $[1]; + onClick = $[2]; + props = $[3]; + } + const [error, setError] = React.useState(null); + let t1; + if ($[4] !== onClick) { + t1 = event => { + try { + if (onClick) { + onClick(event); } - cm.state.sublimeKilled = cm.getRange(from, to); - cm.replaceRange("", from, to); - } - }; - cmds.swapWithSublimeMark = function (cm) { - var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); - if (found) { - cm.state.sublimeMark.clear(); - cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); - cm.setCursor(found); + setError(null); + } catch (t22) { + const err = t22; + setError(err instanceof Error ? err : new Error(`Toolbar button click failed: ${err}`)); } }; - cmds.sublimeYank = function (cm) { - if (cm.state.sublimeKilled != null) cm.replaceSelection(cm.state.sublimeKilled, null, "paste"); - }; - cmds.showInCenter = function (cm) { - var pos = cm.cursorCoords(null, "local"); - cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2); + $[4] = onClick; + $[5] = t1; + } else { + t1 = $[5]; + } + const handleClick = t1; + const t2 = error && "error"; + let t3; + if ($[6] !== props.className || $[7] !== t2) { + t3 = clsx.clsx("graphiql-toolbar-button", t2, props.className); + $[6] = props.className; + $[7] = t2; + $[8] = t3; + } else { + t3 = $[8]; + } + const t4 = error ? error.message : label; + const t5 = error ? "true" : props["aria-invalid"]; + let t6; + if ($[9] !== handleClick || $[10] !== props || $[11] !== ref || $[12] !== t3 || $[13] !== t4 || $[14] !== t5) { + t6 = /* @__PURE__ */jsxRuntime.jsx(UnStyledButton, { + ...props, + ref, + type: "button", + className: t3, + onClick: handleClick, + "aria-label": t4, + "aria-invalid": t5 + }); + $[9] = handleClick; + $[10] = props; + $[11] = ref; + $[12] = t3; + $[13] = t4; + $[14] = t5; + $[15] = t6; + } else { + t6 = $[15]; + } + let t7; + if ($[16] !== label || $[17] !== t6) { + t7 = /* @__PURE__ */jsxRuntime.jsx(Tooltip, { + label, + children: t6 + }); + $[16] = label; + $[17] = t6; + $[18] = t7; + } else { + t7 = $[18]; + } + return t7; +}); +ToolbarButton.displayName = "ToolbarButton"; +function ExecuteButton() { + const $ = reactCompilerRuntime.c(19); + let t0; + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { + t0 = { + nonNull: true, + caller: ExecuteButton }; - function getTarget(cm) { - var from = cm.getCursor("from"), - to = cm.getCursor("to"); - if (CodeMirror.cmpPos(from, to) == 0) { - var word = wordAt(cm, from); - if (!word.word) return; - from = word.from; - to = word.to; - } - return { - from, - to, - query: cm.getRange(from, to), - word - }; - } - function findAndGoTo(cm, forward) { - var target = getTarget(cm); - if (!target) return; - var query = target.query; - var cur = cm.getSearchCursor(query, forward ? target.to : target.from); - if (forward ? cur.findNext() : cur.findPrevious()) { - cm.setSelection(cur.from(), cur.to()); - } else { - cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0) : cm.clipPos(Pos(cm.lastLine()))); - if (forward ? cur.findNext() : cur.findPrevious()) cm.setSelection(cur.from(), cur.to());else if (target.word) cm.setSelection(target.from, target.to); - } - } - cmds.findUnder = function (cm) { - findAndGoTo(cm, true); + $[0] = t0; + } else { + t0 = $[0]; + } + const { + queryEditor, + setOperationName + } = useEditorContext(t0); + let t1; + if ($[1] === Symbol.for("react.memo_cache_sentinel")) { + t1 = { + nonNull: true, + caller: ExecuteButton }; - cmds.findUnderPrevious = function (cm) { - findAndGoTo(cm, false); + $[1] = t1; + } else { + t1 = $[1]; + } + const { + isFetching, + isSubscribed, + operationName, + run, + stop + } = useExecutionContext(t1); + let t2; + if ($[2] !== (queryEditor == null ? void 0 : queryEditor.operations)) { + t2 = (queryEditor == null ? void 0 : queryEditor.operations) || []; + $[2] = queryEditor == null ? void 0 : queryEditor.operations; + $[3] = t2; + } else { + t2 = $[3]; + } + const operations = t2; + const hasOptions = operations.length > 1 && typeof operationName !== "string"; + const isRunning = isFetching || isSubscribed; + const label = `${isRunning ? "Stop" : "Execute"} query (Ctrl-Enter)`; + let t3; + if ($[4] !== isRunning) { + t3 = isRunning ? /* @__PURE__ */jsxRuntime.jsx(StopIcon, {}) : /* @__PURE__ */jsxRuntime.jsx(PlayIcon, {}); + $[4] = isRunning; + $[5] = t3; + } else { + t3 = $[5]; + } + let t4; + if ($[6] !== label || $[7] !== t3) { + t4 = { + type: "button", + className: "graphiql-execute-button", + children: t3, + "aria-label": label }; - cmds.findAllUnder = function (cm) { - var target = getTarget(cm); - if (!target) return; - var cur = cm.getSearchCursor(target.query); - var matches = []; - var primaryIndex = -1; - while (cur.findNext()) { - matches.push({ - anchor: cur.from(), - head: cur.to() - }); - if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch) primaryIndex++; - } - cm.setSelections(matches, primaryIndex); - }; - var keyMap = CodeMirror.keyMap; - keyMap.macSublime = { - "Cmd-Left": "goLineStartSmart", - "Shift-Tab": "indentLess", - "Shift-Ctrl-K": "deleteLine", - "Alt-Q": "wrapLines", - "Ctrl-Left": "goSubwordLeft", - "Ctrl-Right": "goSubwordRight", - "Ctrl-Alt-Up": "scrollLineUp", - "Ctrl-Alt-Down": "scrollLineDown", - "Cmd-L": "selectLine", - "Shift-Cmd-L": "splitSelectionByLine", - "Esc": "singleSelectionTop", - "Cmd-Enter": "insertLineAfter", - "Shift-Cmd-Enter": "insertLineBefore", - "Cmd-D": "selectNextOccurrence", - "Shift-Cmd-Space": "selectScope", - "Shift-Cmd-M": "selectBetweenBrackets", - "Cmd-M": "goToBracket", - "Cmd-Ctrl-Up": "swapLineUp", - "Cmd-Ctrl-Down": "swapLineDown", - "Cmd-/": "toggleCommentIndented", - "Cmd-J": "joinLines", - "Shift-Cmd-D": "duplicateLine", - "F5": "sortLines", - "Shift-F5": "reverseSortLines", - "Cmd-F5": "sortLinesInsensitive", - "Shift-Cmd-F5": "reverseSortLinesInsensitive", - "F2": "nextBookmark", - "Shift-F2": "prevBookmark", - "Cmd-F2": "toggleBookmark", - "Shift-Cmd-F2": "clearBookmarks", - "Alt-F2": "selectBookmarks", - "Backspace": "smartBackspace", - "Cmd-K Cmd-D": "skipAndSelectNextOccurrence", - "Cmd-K Cmd-K": "delLineRight", - "Cmd-K Cmd-U": "upcaseAtCursor", - "Cmd-K Cmd-L": "downcaseAtCursor", - "Cmd-K Cmd-Space": "setSublimeMark", - "Cmd-K Cmd-A": "selectToSublimeMark", - "Cmd-K Cmd-W": "deleteToSublimeMark", - "Cmd-K Cmd-X": "swapWithSublimeMark", - "Cmd-K Cmd-Y": "sublimeYank", - "Cmd-K Cmd-C": "showInCenter", - "Cmd-K Cmd-G": "clearBookmarks", - "Cmd-K Cmd-Backspace": "delLineLeft", - "Cmd-K Cmd-1": "foldAll", - "Cmd-K Cmd-0": "unfoldAll", - "Cmd-K Cmd-J": "unfoldAll", - "Ctrl-Shift-Up": "addCursorToPrevLine", - "Ctrl-Shift-Down": "addCursorToNextLine", - "Cmd-F3": "findUnder", - "Shift-Cmd-F3": "findUnderPrevious", - "Alt-F3": "findAllUnder", - "Shift-Cmd-[": "fold", - "Shift-Cmd-]": "unfold", - "Cmd-I": "findIncremental", - "Shift-Cmd-I": "findIncrementalReverse", - "Cmd-H": "replace", - "F3": "findNext", - "Shift-F3": "findPrev", - "fallthrough": "macDefault" - }; - CodeMirror.normalizeKeyMap(keyMap.macSublime); - keyMap.pcSublime = { - "Shift-Tab": "indentLess", - "Shift-Ctrl-K": "deleteLine", - "Alt-Q": "wrapLines", - "Ctrl-T": "transposeChars", - "Alt-Left": "goSubwordLeft", - "Alt-Right": "goSubwordRight", - "Ctrl-Up": "scrollLineUp", - "Ctrl-Down": "scrollLineDown", - "Ctrl-L": "selectLine", - "Shift-Ctrl-L": "splitSelectionByLine", - "Esc": "singleSelectionTop", - "Ctrl-Enter": "insertLineAfter", - "Shift-Ctrl-Enter": "insertLineBefore", - "Ctrl-D": "selectNextOccurrence", - "Shift-Ctrl-Space": "selectScope", - "Shift-Ctrl-M": "selectBetweenBrackets", - "Ctrl-M": "goToBracket", - "Shift-Ctrl-Up": "swapLineUp", - "Shift-Ctrl-Down": "swapLineDown", - "Ctrl-/": "toggleCommentIndented", - "Ctrl-J": "joinLines", - "Shift-Ctrl-D": "duplicateLine", - "F9": "sortLines", - "Shift-F9": "reverseSortLines", - "Ctrl-F9": "sortLinesInsensitive", - "Shift-Ctrl-F9": "reverseSortLinesInsensitive", - "F2": "nextBookmark", - "Shift-F2": "prevBookmark", - "Ctrl-F2": "toggleBookmark", - "Shift-Ctrl-F2": "clearBookmarks", - "Alt-F2": "selectBookmarks", - "Backspace": "smartBackspace", - "Ctrl-K Ctrl-D": "skipAndSelectNextOccurrence", - "Ctrl-K Ctrl-K": "delLineRight", - "Ctrl-K Ctrl-U": "upcaseAtCursor", - "Ctrl-K Ctrl-L": "downcaseAtCursor", - "Ctrl-K Ctrl-Space": "setSublimeMark", - "Ctrl-K Ctrl-A": "selectToSublimeMark", - "Ctrl-K Ctrl-W": "deleteToSublimeMark", - "Ctrl-K Ctrl-X": "swapWithSublimeMark", - "Ctrl-K Ctrl-Y": "sublimeYank", - "Ctrl-K Ctrl-C": "showInCenter", - "Ctrl-K Ctrl-G": "clearBookmarks", - "Ctrl-K Ctrl-Backspace": "delLineLeft", - "Ctrl-K Ctrl-1": "foldAll", - "Ctrl-K Ctrl-0": "unfoldAll", - "Ctrl-K Ctrl-J": "unfoldAll", - "Ctrl-Alt-Up": "addCursorToPrevLine", - "Ctrl-Alt-Down": "addCursorToNextLine", - "Ctrl-F3": "findUnder", - "Shift-Ctrl-F3": "findUnderPrevious", - "Alt-F3": "findAllUnder", - "Shift-Ctrl-[": "fold", - "Shift-Ctrl-]": "unfold", - "Ctrl-I": "findIncremental", - "Shift-Ctrl-I": "findIncrementalReverse", - "Ctrl-H": "replace", - "F3": "findNext", - "Shift-F3": "findPrev", - "fallthrough": "pcDefault" - }; - CodeMirror.normalizeKeyMap(keyMap.pcSublime); - var mac = keyMap.default == keyMap.macDefault; - keyMap.sublime = mac ? keyMap.macSublime : keyMap.pcSublime; - }); -})(); -var sublimeExports = sublime$2.exports; -const sublime = /* @__PURE__ */codemirror.getDefaultExportFromCjs(sublimeExports); -const sublime$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - default: sublime -}, [sublimeExports]); -exports.sublime = sublime$1; + $[6] = label; + $[7] = t3; + $[8] = t4; + } else { + t4 = $[8]; + } + const buttonProps = t4; + let t5; + if ($[9] !== buttonProps || $[10] !== hasOptions || $[11] !== isRunning || $[12] !== label || $[13] !== operations || $[14] !== queryEditor || $[15] !== run || $[16] !== setOperationName || $[17] !== stop) { + t5 = hasOptions && !isRunning ? /* @__PURE__ */jsxRuntime.jsxs(DropdownMenu, { + children: [/* @__PURE__ */jsxRuntime.jsx(Tooltip, { + label, + children: /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Button, { + ...buttonProps + }) + }), /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Content, { + children: operations.map((operation, i) => { + const opName = operation.name ? operation.name.value : ``; + return /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Item, { + onSelect: () => { + var _a; + const selectedOperationName = (_a = operation.name) == null ? void 0 : _a.value; + if (queryEditor && selectedOperationName && selectedOperationName !== queryEditor.operationName) { + setOperationName(selectedOperationName); + } + run(); + }, + children: opName + }, `${opName}-${i}`); + }) + })] + }) : /* @__PURE__ */jsxRuntime.jsx(Tooltip, { + label, + children: /* @__PURE__ */jsxRuntime.jsx("button", { + ...buttonProps, + onClick: () => { + if (isRunning) { + stop(); + } else { + run(); + } + } + }) + }); + $[9] = buttonProps; + $[10] = hasOptions; + $[11] = isRunning; + $[12] = label; + $[13] = operations; + $[14] = queryEditor; + $[15] = run; + $[16] = setOperationName; + $[17] = stop; + $[18] = t5; + } else { + t5 = $[18]; + } + return t5; +} +const ToolbarMenuRoot = t0 => { + const $ = reactCompilerRuntime.c(20); + let button; + let children; + let label; + let props; + if ($[0] !== t0) { + ({ + button, + children, + label, + ...props + } = t0); + $[0] = t0; + $[1] = button; + $[2] = children; + $[3] = label; + $[4] = props; + } else { + button = $[1]; + children = $[2]; + label = $[3]; + props = $[4]; + } + let t1; + if ($[5] !== props.className) { + t1 = clsx.clsx("graphiql-un-styled graphiql-toolbar-menu", props.className); + $[5] = props.className; + $[6] = t1; + } else { + t1 = $[6]; + } + let t2; + if ($[7] !== button || $[8] !== label || $[9] !== t1) { + t2 = /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Button, { + className: t1, + "aria-label": label, + children: button + }); + $[7] = button; + $[8] = label; + $[9] = t1; + $[10] = t2; + } else { + t2 = $[10]; + } + let t3; + if ($[11] !== label || $[12] !== t2) { + t3 = /* @__PURE__ */jsxRuntime.jsx(Tooltip, { + label, + children: t2 + }); + $[11] = label; + $[12] = t2; + $[13] = t3; + } else { + t3 = $[13]; + } + let t4; + if ($[14] !== children) { + t4 = /* @__PURE__ */jsxRuntime.jsx(DropdownMenu.Content, { + children + }); + $[14] = children; + $[15] = t4; + } else { + t4 = $[15]; + } + let t5; + if ($[16] !== props || $[17] !== t3 || $[18] !== t4) { + t5 = /* @__PURE__ */jsxRuntime.jsxs(DropdownMenu, { + ...props, + children: [t3, t4] + }); + $[16] = props; + $[17] = t3; + $[18] = t4; + $[19] = t5; + } else { + t5 = $[19]; + } + return t5; +}; +const ToolbarMenu = createComponentGroup(ToolbarMenuRoot, { + Item: DropdownMenu.Item +}); +exports.Argument = Argument; +exports.ArgumentIcon = ArgumentIcon; +exports.Button = Button$1; +exports.ButtonGroup = ButtonGroup; +exports.ChevronDownIcon = ChevronDownIcon; +exports.ChevronLeftIcon = ChevronLeftIcon; +exports.ChevronUpIcon = ChevronUpIcon; +exports.CloseIcon = CloseIcon; +exports.CopyIcon = CopyIcon; +exports.DOC_EXPLORER_PLUGIN = DOC_EXPLORER_PLUGIN; +exports.DefaultValue = DefaultValue; +exports.DeprecatedArgumentIcon = DeprecatedArgumentIcon; +exports.DeprecatedEnumValueIcon = DeprecatedEnumValueIcon; +exports.DeprecatedFieldIcon = DeprecatedFieldIcon; +exports.DeprecationReason = DeprecationReason; +exports.Dialog = Dialog; +exports.DialogRoot = DialogRoot; +exports.Directive = Directive; +exports.DirectiveIcon = DirectiveIcon; +exports.DocExplorer = DocExplorer; +exports.DocsFilledIcon = DocsFilledIcon; +exports.DocsIcon = DocsIcon; +exports.DropdownMenu = DropdownMenu; +exports.EditorContext = EditorContext; +exports.EditorContextProvider = EditorContextProvider; +exports.EnumValueIcon = EnumValueIcon; +exports.ExecuteButton = ExecuteButton; +exports.ExecutionContext = ExecutionContext; +exports.ExecutionContextProvider = ExecutionContextProvider; +exports.ExplorerContext = ExplorerContext; +exports.ExplorerContextProvider = ExplorerContextProvider; +exports.ExplorerSection = ExplorerSection; +exports.FieldDocumentation = FieldDocumentation; +exports.FieldIcon = FieldIcon; +exports.FieldLink = FieldLink; +exports.GraphiQLProvider = GraphiQLProvider; +exports.HISTORY_PLUGIN = HISTORY_PLUGIN; +exports.HeaderEditor = HeaderEditor; +exports.History = History; +exports.HistoryContext = HistoryContext; +exports.HistoryContextProvider = HistoryContextProvider; +exports.HistoryIcon = HistoryIcon; +exports.ImagePreview = ImagePreview; +exports.ImplementsIcon = ImplementsIcon; +exports.KeyboardShortcutIcon = KeyboardShortcutIcon; +exports.MagnifyingGlassIcon = MagnifyingGlassIcon; +exports.MarkdownContent = MarkdownContent; +exports.MergeIcon = MergeIcon; +exports.PenIcon = PenIcon; +exports.PlayIcon = PlayIcon; +exports.PluginContext = PluginContext; +exports.PluginContextProvider = PluginContextProvider; +exports.PlusIcon = PlusIcon; +exports.PrettifyIcon = PrettifyIcon; +exports.QueryEditor = QueryEditor; +exports.ReloadIcon = ReloadIcon; +exports.ResponseEditor = ResponseEditor; +exports.RootTypeIcon = RootTypeIcon; +exports.SchemaContext = SchemaContext; +exports.SchemaContextProvider = SchemaContextProvider; +exports.SchemaDocumentation = SchemaDocumentation; +exports.Search = Search; +exports.SettingsIcon = SettingsIcon; +exports.Spinner = Spinner; +exports.StarFilledIcon = StarFilledIcon; +exports.StarIcon = StarIcon; +exports.StopIcon = StopIcon; +exports.StorageContext = StorageContext; +exports.StorageContextProvider = StorageContextProvider; +exports.Tab = Tab; +exports.Tabs = Tabs; +exports.ToolbarButton = ToolbarButton; +exports.ToolbarMenu = ToolbarMenu; +exports.Tooltip = Tooltip; +exports.TooltipRoot = TooltipRoot; +exports.TrashIcon = TrashIcon; +exports.TypeDocumentation = TypeDocumentation; +exports.TypeIcon = TypeIcon; +exports.TypeLink = TypeLink; +exports.UnStyledButton = UnStyledButton; +exports.VariableEditor = VariableEditor; +exports.isMacOs = isMacOs; +exports.useAutoCompleteLeafs = useAutoCompleteLeafs; +exports.useCopyQuery = useCopyQuery; +exports.useDragResize = useDragResize; +exports.useEditorContext = useEditorContext; +exports.useEditorState = useEditorState; +exports.useExecutionContext = useExecutionContext; +exports.useExplorerContext = useExplorerContext; +exports.useHeaderEditor = useHeaderEditor; +exports.useHeadersEditorState = useHeadersEditorState; +exports.useHistoryContext = useHistoryContext; +exports.useMergeQuery = useMergeQuery; +exports.useOperationsEditorState = useOperationsEditorState; +exports.useOptimisticState = useOptimisticState; +exports.usePluginContext = usePluginContext; +exports.usePrettifyEditors = usePrettifyEditors; +exports.useQueryEditor = useQueryEditor; +exports.useResponseEditor = useResponseEditor; +exports.useSchemaContext = useSchemaContext; +exports.useStorageContext = useStorageContext; +exports.useTheme = useTheme; +exports.useVariableEditor = useVariableEditor; +exports.useVariablesEditorState = useVariablesEditorState; /***/ }), @@ -78138,6 +83415,7 @@ exports.sublime = sublime$1; \**************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78192,6 +83470,7 @@ async function fetcherReturnToPromise(fetcherResult) { \*********************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78259,6 +83538,7 @@ exports.__forAwait = __forAwait; \***********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78292,6 +83572,7 @@ function createGraphiQLFetcher(options) { \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78329,6 +83610,7 @@ var _createFetcher = __webpack_require__(/*! ./createFetcher */ "../../graphiql- \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78445,6 +83727,7 @@ async function getWsFetcher(options, fetcherOpts) { \***************************************************************/ /***/ (function() { +"use strict"; /***/ }), @@ -78455,6 +83738,7 @@ async function getWsFetcher(options, fetcherOpts) { \*******************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78495,6 +83779,7 @@ function formatResult(result) { \************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78608,6 +83893,7 @@ function isFieldType(fieldType) { \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78655,6 +83941,7 @@ Object.keys(_operationName).forEach(function (key) { \********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78762,6 +84049,7 @@ function mergeAst(documentAST, schema) { \*************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78794,6 +84082,7 @@ function getSelectedOperationName(prevOperations, prevSelectedOperationName, ope \************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78863,6 +84152,7 @@ Object.keys(_storage).forEach(function (key) { \*******************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78937,6 +84227,7 @@ const STORAGE_NAMESPACE = "graphiql"; \*********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -78972,6 +84263,7 @@ function createLocalStorage({ \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -79074,6 +84366,7 @@ exports.HistoryStore = HistoryStore; \********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -79132,6 +84425,7 @@ Object.keys(_custom).forEach(function (key) { \********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -79194,12 +84488,13 @@ exports.QueryStore = QueryStore; /***/ }), -/***/ "./components/GraphiQL.tsx": -/*!*********************************!*\ - !*** ./components/GraphiQL.tsx ***! - \*********************************/ +/***/ "./GraphiQL.tsx": +/*!**********************!*\ + !*** ./GraphiQL.tsx ***! + \**********************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -79817,6 +85112,7 @@ function isChildComponentType(child, component) { \***************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -80117,6 +85413,7 @@ var _utils = __webpack_require__(/*! ./utils */ "../../graphql-language-service/ \*************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -80223,6 +85520,7 @@ exports.getFieldInsertText = getFieldInsertText; \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -80863,6 +86161,7 @@ function unwrapType(state) { \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -81085,6 +86384,7 @@ function getDefinitionForArgumentDefinition(path, text, definition) { \**********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -81207,6 +86507,7 @@ function getLocation(node) { \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -81400,6 +86701,7 @@ function text(into, content) { \******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -81535,6 +86837,7 @@ function concatMap(arr, fn) { \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -81615,6 +86918,7 @@ var _getHoverInformation = __webpack_require__(/*! ./getHoverInformation */ "../ \********************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -81734,6 +87038,7 @@ exports["default"] = CharacterStream; \****************************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -81788,6 +87093,7 @@ function p(value, style) { \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -81992,6 +87298,7 @@ function type(style) { \********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -82116,6 +87423,7 @@ function getContextAtPosition(queryText, cursor, schema, contextToken, options) \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -82333,6 +87641,7 @@ function getTypeInfo(schema, tokenState) { \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -82494,6 +87803,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de \*****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -82715,6 +88025,7 @@ function lex(lexRules, stream) { \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -82763,6 +88074,7 @@ const RuleKinds = exports.RuleKinds = Object.assign(Object.assign({}, _graphql.K \***************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -82825,6 +88137,7 @@ var CompletionItemKind; \*********************************************************/ /***/ (function(__unused_webpack_module, exports) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -82890,6 +88203,7 @@ function locToRange(text, loc) { \********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -82930,6 +88244,7 @@ function collectVariables(schema, documentAST) { \************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -83000,6 +88315,7 @@ exports.getFragmentDependenciesForAST = getFragmentDependenciesForAST; \************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -83040,6 +88356,7 @@ function pointToOffset(text, point) { \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -83086,6 +88403,7 @@ const getQueryFacts = exports.getQueryFacts = getOperationFacts; \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -83325,6 +88643,7 @@ function getVariablesJSONSchema(variableToType, options) { \*********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -83432,6 +88751,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { +"use strict"; Object.defineProperty(exports, "__esModule", ({ @@ -83479,6 +88799,7 @@ function validateWithCustomRules(schema, ast, customRules, isRelayCompatMode, is \*******************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin @@ -83491,6 +88812,7 @@ __webpack_require__.r(__webpack_exports__); \*******************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin @@ -83503,6 +88825,7 @@ __webpack_require__.r(__webpack_exports__); \***********************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin @@ -83515,6 +88838,7 @@ __webpack_require__.r(__webpack_exports__); \********************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +"use strict"; __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin @@ -83527,6 +88851,7 @@ __webpack_require__.r(__webpack_exports__); \************************/ /***/ (function(module) { +"use strict"; module.exports = window["React"]; /***/ }), @@ -83537,6 +88862,7 @@ module.exports = window["React"]; \***************************/ /***/ (function(module) { +"use strict"; module.exports = window["ReactDOM"]; /***/ }), @@ -83547,6 +88873,7 @@ module.exports = window["ReactDOM"]; \***********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; @@ -90708,6 +96035,7 @@ var Transition = Object.assign(TransitionRoot, { Child, Root: TransitionRoot }); \**************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { +"use strict"; if (false) {} else { @@ -90723,6 +96051,7 @@ if (false) {} else { \***************************************************************/ /***/ (function(module) { +"use strict"; function _extends() { @@ -90800,8 +96129,9 @@ module.exports = _extends, module.exports.__esModule = true, module.exports["def /******/ /************************************************************************/ var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +// This entry need to be wrapped in an IIFE because it need to be in strict mode. !function() { +"use strict"; var exports = __webpack_exports__; /*!****************!*\ !*** ./cdn.ts ***! @@ -90815,7 +96145,7 @@ exports["default"] = void 0; var GraphiQLReact = _interopRequireWildcard(__webpack_require__(/*! @graphiql/react */ "../../graphiql-react/dist/index.js")); var _toolkit = __webpack_require__(/*! @graphiql/toolkit */ "../../graphiql-toolkit/dist/esm/index.js"); var GraphQL = _interopRequireWildcard(__webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs")); -var _GraphiQL = __webpack_require__(/*! ./components/GraphiQL */ "./components/GraphiQL.tsx"); +var _GraphiQL = __webpack_require__(/*! ./GraphiQL */ "./GraphiQL.tsx"); __webpack_require__(/*! @graphiql/react/font/roboto.css */ "../../graphiql-react/font/roboto.css"); __webpack_require__(/*! @graphiql/react/font/fira-code.css */ "../../graphiql-react/font/fira-code.css"); __webpack_require__(/*! @graphiql/react/dist/style.css */ "../../graphiql-react/dist/style.css"); diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index 1492913d94d..4661582a3ff 100644 --- a/netbox/project-static/dist/netbox.js +++ b/netbox/project-static/dist/netbox.js @@ -4,9 +4,9 @@ `+hi.join("")+` - `}}function Yi(){ti.calendarContainer.classList.add("hasWeeks");var fi=tn("div","flatpickr-weekwrapper");fi.appendChild(tn("span","flatpickr-weekday",ti.l10n.weekAbbreviation));var hi=tn("div","flatpickr-weeks");return fi.appendChild(hi),{weekWrapper:fi,weekNumbers:hi}}function Ri(fi,hi){hi===void 0&&(hi=!0);var mi=hi?fi:fi-ti.currentMonth;mi<0&&ti._hidePrevMonthArrow===!0||mi>0&&ti._hideNextMonthArrow===!0||(ti.currentMonth+=mi,(ti.currentMonth<0||ti.currentMonth>11)&&(ti.currentYear+=ti.currentMonth>11?1:-1,ti.currentMonth=(ti.currentMonth+12)%12,un("onYearChange"),Ji()),Qi(),un("onMonthChange"),Ca())}function Ii(fi,hi){if(fi===void 0&&(fi=!0),hi===void 0&&(hi=!0),ti.input.value="",ti.altInput!==void 0&&(ti.altInput.value=""),ti.mobileInput!==void 0&&(ti.mobileInput.value=""),ti.selectedDates=[],ti.latestSelectedDateObj=void 0,hi===!0&&(ti.currentYear=ti._initialDate.getFullYear(),ti.currentMonth=ti._initialDate.getMonth()),ti.config.enableTime===!0){var mi=Dl(ti.config),_i=mi.hours,Ti=mi.minutes,Ni=mi.seconds;yi(_i,Ti,Ni)}ti.redraw(),fi&&un("onChange")}function Ui(){ti.isOpen=!1,ti.isMobile||(ti.calendarContainer!==void 0&&ti.calendarContainer.classList.remove("open"),ti._input!==void 0&&ti._input.classList.remove("active")),un("onClose")}function ji(){ti.config!==void 0&&un("onDestroy");for(var fi=ti._handlers.length;fi--;)ti._handlers[fi].remove();if(ti._handlers=[],ti.mobileInput)ti.mobileInput.parentNode&&ti.mobileInput.parentNode.removeChild(ti.mobileInput),ti.mobileInput=void 0;else if(ti.calendarContainer&&ti.calendarContainer.parentNode)if(ti.config.static&&ti.calendarContainer.parentNode){var hi=ti.calendarContainer.parentNode;if(hi.lastChild&&hi.removeChild(hi.lastChild),hi.parentNode){for(;hi.firstChild;)hi.parentNode.insertBefore(hi.firstChild,hi);hi.parentNode.removeChild(hi)}}else ti.calendarContainer.parentNode.removeChild(ti.calendarContainer);ti.altInput&&(ti.input.type="text",ti.altInput.parentNode&&ti.altInput.parentNode.removeChild(ti.altInput),delete ti.altInput),ti.input&&(ti.input.type=ti.input._type,ti.input.classList.remove("flatpickr-input"),ti.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(mi){try{delete ti[mi]}catch(_i){}})}function Pi(fi){return ti.calendarContainer.contains(fi)}function ln(fi){if(ti.isOpen&&!ti.config.inline){var hi=Wn(fi),mi=Pi(hi),_i=hi===ti.input||hi===ti.altInput||ti.element.contains(hi)||fi.path&&fi.path.indexOf&&(~fi.path.indexOf(ti.input)||~fi.path.indexOf(ti.altInput)),Ti=!_i&&!mi&&!Pi(fi.relatedTarget),Ni=!ti.config.ignoredFocusElements.some(function(Ki){return Ki.contains(hi)});Ti&&Ni&&(ti.config.allowInput&&ti.setDate(ti._input.value,!1,ti.config.altInput?ti.config.altFormat:ti.config.dateFormat),ti.timeContainer!==void 0&&ti.minuteElement!==void 0&&ti.hourElement!==void 0&&ti.input.value!==""&&ti.input.value!==void 0&&li(),ti.close(),ti.config&&ti.config.mode==="range"&&ti.selectedDates.length===1&&ti.clear(!1))}}function kn(fi){if(!(!fi||ti.config.minDate&&fiti.config.maxDate.getFullYear())){var hi=fi,mi=ti.currentYear!==hi;ti.currentYear=hi||ti.currentYear,ti.config.maxDate&&ti.currentYear===ti.config.maxDate.getFullYear()?ti.currentMonth=Math.min(ti.config.maxDate.getMonth(),ti.currentMonth):ti.config.minDate&&ti.currentYear===ti.config.minDate.getFullYear()&&(ti.currentMonth=Math.max(ti.config.minDate.getMonth(),ti.currentMonth)),mi&&(ti.redraw(),un("onYearChange"),Ji())}}function yn(fi,hi){var mi;hi===void 0&&(hi=!0);var _i=ti.parseDate(fi,void 0,hi);if(ti.config.minDate&&_i&&Un(_i,ti.config.minDate,hi!==void 0?hi:!ti.minDateHasTime)<0||ti.config.maxDate&&_i&&Un(_i,ti.config.maxDate,hi!==void 0?hi:!ti.maxDateHasTime)>0)return!1;if(!ti.config.enable&&ti.config.disable.length===0)return!0;if(_i===void 0)return!1;for(var Ti=!!ti.config.enable,Ni=(mi=ti.config.enable)!==null&&mi!==void 0?mi:ti.config.disable,Ki=0,$i=void 0;Ki=$i.from.getTime()&&_i.getTime()<=$i.to.getTime())return Ti}return!Ti}function Cn(fi){return ti.daysContainer!==void 0?fi.className.indexOf("hidden")===-1&&fi.className.indexOf("flatpickr-disabled")===-1&&ti.daysContainer.contains(fi):!1}function $s(fi){var hi=fi.target===ti._input,mi=ti._input.value.trimEnd()!==Hl();hi&&mi&&!(fi.relatedTarget&&Pi(fi.relatedTarget))&&ti.setDate(ti._input.value,!0,fi.target===ti.altInput?ti.config.altFormat:ti.config.dateFormat)}function ro(fi){var hi=Wn(fi),mi=ti.config.wrap?ii.contains(hi):hi===ti._input,_i=ti.config.allowInput,Ti=ti.isOpen&&(!_i||!mi),Ni=ti.config.inline&&mi&&!_i;if(fi.keyCode===13&&mi){if(_i)return ti.setDate(ti._input.value,!0,hi===ti.altInput?ti.config.altFormat:ti.config.dateFormat),ti.close(),hi.blur();ti.open()}else if(Pi(hi)||Ti||Ni){var Ki=!!ti.timeContainer&&ti.timeContainer.contains(hi);switch(fi.keyCode){case 13:Ki?(fi.preventDefault(),li(),us()):ds(fi);break;case 27:fi.preventDefault(),us();break;case 8:case 46:mi&&!ti.config.allowInput&&(fi.preventDefault(),ti.clear());break;case 37:case 39:if(!Ki&&!mi){fi.preventDefault();var $i=oi();if(ti.daysContainer!==void 0&&(_i===!1||$i&&Cn($i))){var Xi=fi.keyCode===39?1:-1;fi.ctrlKey?(fi.stopPropagation(),Ri(Xi),qi(Mi(1),0)):qi(void 0,Xi)}}else ti.hourElement&&ti.hourElement.focus();break;case 38:case 40:fi.preventDefault();var Fi=fi.keyCode===40?1:-1;ti.daysContainer&&hi.$i!==void 0||hi===ti.input||hi===ti.altInput?fi.ctrlKey?(fi.stopPropagation(),kn(ti.currentYear-Fi),qi(Mi(1),0)):Ki||qi(void 0,Fi*7):hi===ti.currentYearElement?kn(ti.currentYear-Fi):ti.config.enableTime&&(!Ki&&ti.hourElement&&ti.hourElement.focus(),li(fi),ti._debouncedChange());break;case 9:if(Ki){var Gi=[ti.hourElement,ti.minuteElement,ti.secondElement,ti.amPM].concat(ti.pluginElements).filter(function(Kn){return Kn}),nn=Gi.indexOf(hi);if(nn!==-1){var oo=Gi[nn+(fi.shiftKey?-1:1)];fi.preventDefault(),(oo||ti._input).focus()}}else!ti.config.noCalendar&&ti.daysContainer&&ti.daysContainer.contains(hi)&&fi.shiftKey&&(fi.preventDefault(),ti._input.focus());break;default:break}}if(ti.amPM!==void 0&&hi===ti.amPM)switch(fi.key){case ti.l10n.amPM[0].charAt(0):case ti.l10n.amPM[0].charAt(0).toLowerCase():ti.amPM.textContent=ti.l10n.amPM[0],di(),lo();break;case ti.l10n.amPM[1].charAt(0):case ti.l10n.amPM[1].charAt(0).toLowerCase():ti.amPM.textContent=ti.l10n.amPM[1],di(),lo();break}(mi||Pi(hi))&&un("onKeyDown",fi)}function wo(fi,hi){if(hi===void 0&&(hi="flatpickr-day"),!(ti.selectedDates.length!==1||fi&&(!fi.classList.contains(hi)||fi.classList.contains("flatpickr-disabled")))){for(var mi=fi?fi.dateObj.getTime():ti.days.firstElementChild.dateObj.getTime(),_i=ti.parseDate(ti.selectedDates[0],void 0,!0).getTime(),Ti=Math.min(mi,ti.selectedDates[0].getTime()),Ni=Math.max(mi,ti.selectedDates[0].getTime()),Ki=!1,$i=0,Xi=0,Fi=Ti;FiTi&&Fi$i)?$i=Fi:Fi>_i&&(!Xi||Fi ."+hi));Gi.forEach(function(nn){var oo=nn.dateObj,Kn=oo.getTime(),Vs=$i>0&&Kn<$i||Xi>0&&Kn>Xi;if(Vs){nn.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(fs){nn.classList.remove(fs)});return}else if(Ki&&!Vs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(fs){nn.classList.remove(fs)}),fi!==void 0&&(fi.classList.add(mi<=ti.selectedDates[0].getTime()?"startRange":"endRange"),_imi&&Kn===_i&&nn.classList.add("endRange"),Kn>=$i&&(Xi===0||Kn<=Xi)&&mh(Kn,_i,mi)&&nn.classList.add("inRange"))})}}function bn(){ti.isOpen&&!ti.config.static&&!ti.config.inline&&Gn()}function xo(fi,hi){if(hi===void 0&&(hi=ti._positionElement),ti.isMobile===!0){if(fi){fi.preventDefault();var mi=Wn(fi);mi&&mi.blur()}ti.mobileInput!==void 0&&(ti.mobileInput.focus(),ti.mobileInput.click()),un("onOpen");return}else if(ti._input.disabled||ti.config.inline)return;var _i=ti.isOpen;ti.isOpen=!0,_i||(ti.calendarContainer.classList.add("open"),ti._input.classList.add("active"),un("onOpen"),Gn(hi)),ti.config.enableTime===!0&&ti.config.noCalendar===!0&&ti.config.allowInput===!1&&(fi===void 0||!ti.timeContainer.contains(fi.relatedTarget))&&setTimeout(function(){return ti.hourElement.select()},50)}function ao(fi){return function(hi){var mi=ti.config["_"+fi+"Date"]=ti.parseDate(hi,ti.config.dateFormat),_i=ti.config["_"+(fi==="min"?"max":"min")+"Date"];mi!==void 0&&(ti[fi==="min"?"minDateHasTime":"maxDateHasTime"]=mi.getHours()>0||mi.getMinutes()>0||mi.getSeconds()>0),ti.selectedDates&&(ti.selectedDates=ti.selectedDates.filter(function(Ti){return yn(Ti)}),!ti.selectedDates.length&&fi==="min"&&pi(mi),lo()),ti.daysContainer&&(Bs(),mi!==void 0?ti.currentYearElement[fi]=mi.getFullYear().toString():ti.currentYearElement.removeAttribute(fi),ti.currentYearElement.disabled=!!_i&&mi!==void 0&&_i.getFullYear()===mi.getFullYear())}}function ls(){var fi=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],hi=Hn(Hn({},JSON.parse(JSON.stringify(ii.dataset||{}))),ei),mi={};ti.config.parseDate=hi.parseDate,ti.config.formatDate=hi.formatDate,Object.defineProperty(ti.config,"enable",{get:function(){return ti.config._enable},set:function(Gi){ti.config._enable=nu(Gi)}}),Object.defineProperty(ti.config,"disable",{get:function(){return ti.config._disable},set:function(Gi){ti.config._disable=nu(Gi)}});var _i=hi.mode==="time";if(!hi.dateFormat&&(hi.enableTime||_i)){var Ti=xn.defaultConfig.dateFormat||Bo.dateFormat;mi.dateFormat=hi.noCalendar||_i?"H:i"+(hi.enableSeconds?":S":""):Ti+" H:i"+(hi.enableSeconds?":S":"")}if(hi.altInput&&(hi.enableTime||_i)&&!hi.altFormat){var Ni=xn.defaultConfig.altFormat||Bo.altFormat;mi.altFormat=hi.noCalendar||_i?"h:i"+(hi.enableSeconds?":S K":" K"):Ni+(" h:i"+(hi.enableSeconds?":S":"")+" K")}Object.defineProperty(ti.config,"minDate",{get:function(){return ti.config._minDate},set:ao("min")}),Object.defineProperty(ti.config,"maxDate",{get:function(){return ti.config._maxDate},set:ao("max")});var Ki=function(Gi){return function(nn){ti.config[Gi==="min"?"_minTime":"_maxTime"]=ti.parseDate(nn,"H:i:S")}};Object.defineProperty(ti.config,"minTime",{get:function(){return ti.config._minTime},set:Ki("min")}),Object.defineProperty(ti.config,"maxTime",{get:function(){return ti.config._maxTime},set:Ki("max")}),hi.mode==="time"&&(ti.config.noCalendar=!0,ti.config.enableTime=!0),Object.assign(ti.config,mi,hi);for(var $i=0;$i-1?ti.config[Fi]=Sl(Xi[Fi]).map(si).concat(ti.config[Fi]):typeof hi[Fi]=="undefined"&&(ti.config[Fi]=Xi[Fi])}hi.altInputClass||(ti.config.altInputClass=On().className+" "+ti.config.altInputClass),un("onParseConfig")}function On(){return ti.config.wrap?ii.querySelector("[data-input]"):ii}function zn(){typeof ti.config.locale!="object"&&typeof xn.l10ns[ti.config.locale]=="undefined"&&ti.config.errorHandler(new Error("flatpickr: invalid locale "+ti.config.locale)),ti.l10n=Hn(Hn({},xn.l10ns.default),typeof ti.config.locale=="object"?ti.config.locale:ti.config.locale!=="default"?xn.l10ns[ti.config.locale]:void 0),Eo.D="("+ti.l10n.weekdays.shorthand.join("|")+")",Eo.l="("+ti.l10n.weekdays.longhand.join("|")+")",Eo.M="("+ti.l10n.months.shorthand.join("|")+")",Eo.F="("+ti.l10n.months.longhand.join("|")+")",Eo.K="("+ti.l10n.amPM[0]+"|"+ti.l10n.amPM[1]+"|"+ti.l10n.amPM[0].toLowerCase()+"|"+ti.l10n.amPM[1].toLowerCase()+")";var fi=Hn(Hn({},ei),JSON.parse(JSON.stringify(ii.dataset||{})));fi.time_24hr===void 0&&xn.defaultConfig.time_24hr===void 0&&(ti.config.time_24hr=ti.l10n.time_24hr),ti.formatDate=Qc(ti),ti.parseDate=Cl({config:ti.config,l10n:ti.l10n})}function Gn(fi){if(typeof ti.config.position=="function")return void ti.config.position(ti,fi);if(ti.calendarContainer!==void 0){un("onPreCalendarPosition");var hi=fi||ti._positionElement,mi=Array.prototype.reduce.call(ti.calendarContainer.children,function(Kh,Qh){return Kh+Qh.offsetHeight},0),_i=ti.calendarContainer.offsetWidth,Ti=ti.config.position.split(" "),Ni=Ti[0],Ki=Ti.length>1?Ti[1]:null,$i=hi.getBoundingClientRect(),Xi=window.innerHeight-$i.bottom,Fi=Ni==="above"||Ni!=="below"&&Ximi,Gi=window.pageYOffset+$i.top+(Fi?-mi-2:hi.offsetHeight+2);if(In(ti.calendarContainer,"arrowTop",!Fi),In(ti.calendarContainer,"arrowBottom",Fi),!ti.config.inline){var nn=window.pageXOffset+$i.left,oo=!1,Kn=!1;Ki==="center"?(nn-=(_i-$i.width)/2,oo=!0):Ki==="right"&&(nn-=_i-$i.width,Kn=!0),In(ti.calendarContainer,"arrowLeft",!oo&&!Kn),In(ti.calendarContainer,"arrowCenter",oo),In(ti.calendarContainer,"arrowRight",Kn);var Vs=window.document.body.offsetWidth-(window.pageXOffset+$i.right),fs=nn+_i>window.document.body.offsetWidth,Vh=Vs+_i>window.document.body.offsetWidth;if(In(ti.calendarContainer,"rightMost",fs),!ti.config.static)if(ti.calendarContainer.style.top=Gi+"px",!fs)ti.calendarContainer.style.left=nn+"px",ti.calendarContainer.style.right="auto";else if(!Vh)ti.calendarContainer.style.left="auto",ti.calendarContainer.style.right=Vs+"px";else{var Pl=Jn();if(Pl===void 0)return;var jh=window.document.body.offsetWidth,qh=Math.max(0,jh/2-_i/2),Wh=".flatpickr-calendar.centerMost:before",Uh=".flatpickr-calendar.centerMost:after",Yh=Pl.cssRules.length,Gh="{left:"+$i.left+"px;right:auto;}";In(ti.calendarContainer,"rightMost",!1),In(ti.calendarContainer,"centerMost",!0),Pl.insertRule(Wh+","+Uh+Gh,Yh),ti.calendarContainer.style.left=qh+"px",ti.calendarContainer.style.right="auto"}}}}function Jn(){for(var fi=null,hi=0;hiti.currentMonth+ti.config.showMonths-1)&&ti.config.mode!=="range";if(ti.selectedDateElem=_i,ti.config.mode==="single")ti.selectedDates=[Ti];else if(ti.config.mode==="multiple"){var Ki=Il(Ti);Ki?ti.selectedDates.splice(parseInt(Ki),1):ti.selectedDates.push(Ti)}else ti.config.mode==="range"&&(ti.selectedDates.length===2&&ti.clear(!1,!1),ti.latestSelectedDateObj=Ti,ti.selectedDates.push(Ti),Un(Ti,ti.selectedDates[0],!0)!==0&&ti.selectedDates.sort(function(Gi,nn){return Gi.getTime()-nn.getTime()}));if(di(),Ni){var $i=ti.currentYear!==Ti.getFullYear();ti.currentYear=Ti.getFullYear(),ti.currentMonth=Ti.getMonth(),$i&&(un("onYearChange"),Ji()),un("onMonthChange")}if(Ca(),Qi(),lo(),!Ni&&ti.config.mode!=="range"&&ti.config.showMonths===1?ki(_i):ti.selectedDateElem!==void 0&&ti.hourElement===void 0&&ti.selectedDateElem&&ti.selectedDateElem.focus(),ti.hourElement!==void 0&&ti.hourElement!==void 0&&ti.hourElement.focus(),ti.config.closeOnSelect){var Xi=ti.config.mode==="single"&&!ti.config.enableTime,Fi=ti.config.mode==="range"&&ti.selectedDates.length===2&&!ti.config.enableTime;(Xi||Fi)&&us()}Ei()}}var Vo={locale:[zn,vn],showMonths:[rn,ai,Mn],minDate:[xi],maxDate:[xi],positionElement:[ru],clickOpens:[function(){ti.config.clickOpens===!0?(vi(ti._input,"focus",ti.open),vi(ti._input,"click",ti.open)):(ti._input.removeEventListener("focus",ti.open),ti._input.removeEventListener("click",ti.open))}]};function Ta(fi,hi){if(fi!==null&&typeof fi=="object"){Object.assign(ti.config,fi);for(var mi in fi)Vo[mi]!==void 0&&Vo[mi].forEach(function(_i){return _i()})}else ti.config[fi]=hi,Vo[fi]!==void 0?Vo[fi].forEach(function(_i){return _i()}):wl.indexOf(fi)>-1&&(ti.config[fi]=Sl(hi));ti.redraw(),lo(!0)}function zs(fi,hi){var mi=[];if(fi instanceof Array)mi=fi.map(function(_i){return ti.parseDate(_i,hi)});else if(fi instanceof Date||typeof fi=="number")mi=[ti.parseDate(fi,hi)];else if(typeof fi=="string")switch(ti.config.mode){case"single":case"time":mi=[ti.parseDate(fi,hi)];break;case"multiple":mi=fi.split(ti.config.conjunction).map(function(_i){return ti.parseDate(_i,hi)});break;case"range":mi=fi.split(ti.l10n.rangeSeparator).map(function(_i){return ti.parseDate(_i,hi)});break;default:break}else ti.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(fi)));ti.selectedDates=ti.config.allowInvalidPreload?mi:mi.filter(function(_i){return _i instanceof Date&&yn(_i,!1)}),ti.config.mode==="range"&&ti.selectedDates.sort(function(_i,Ti){return _i.getTime()-Ti.getTime()})}function Sa(fi,hi,mi){if(hi===void 0&&(hi=!1),mi===void 0&&(mi=ti.config.dateFormat),fi!==0&&!fi||fi instanceof Array&&fi.length===0)return ti.clear(hi);zs(fi,mi),ti.latestSelectedDateObj=ti.selectedDates[ti.selectedDates.length-1],ti.redraw(),xi(void 0,hi),pi(),ti.selectedDates.length===0&&ti.clear(!1),lo(hi),hi&&un("onChange")}function nu(fi){return fi.slice().map(function(hi){return typeof hi=="string"||typeof hi=="number"||hi instanceof Date?ti.parseDate(hi,void 0,!0):hi&&typeof hi=="object"&&hi.from&&hi.to?{from:ti.parseDate(hi.from,void 0),to:ti.parseDate(hi.to,void 0)}:hi}).filter(function(hi){return hi})}function Ih(){ti.selectedDates=[],ti.now=ti.parseDate(ti.config.now)||new Date;var fi=ti.config.defaultDate||((ti.input.nodeName==="INPUT"||ti.input.nodeName==="TEXTAREA")&&ti.input.placeholder&&ti.input.value===ti.input.placeholder?null:ti.input.value);fi&&zs(fi,ti.config.dateFormat),ti._initialDate=ti.selectedDates.length>0?ti.selectedDates[0]:ti.config.minDate&&ti.config.minDate.getTime()>ti.now.getTime()?ti.config.minDate:ti.config.maxDate&&ti.config.maxDate.getTime()0&&(ti.latestSelectedDateObj=ti.selectedDates[0]),ti.config.minTime!==void 0&&(ti.config.minTime=ti.parseDate(ti.config.minTime,"H:i")),ti.config.maxTime!==void 0&&(ti.config.maxTime=ti.parseDate(ti.config.maxTime,"H:i")),ti.minDateHasTime=!!ti.config.minDate&&(ti.config.minDate.getHours()>0||ti.config.minDate.getMinutes()>0||ti.config.minDate.getSeconds()>0),ti.maxDateHasTime=!!ti.config.maxDate&&(ti.config.maxDate.getHours()>0||ti.config.maxDate.getMinutes()>0||ti.config.maxDate.getSeconds()>0)}function Hh(){if(ti.input=On(),!ti.input){ti.config.errorHandler(new Error("Invalid input element specified"));return}ti.input._type=ti.input.type,ti.input.type="text",ti.input.classList.add("flatpickr-input"),ti._input=ti.input,ti.config.altInput&&(ti.altInput=tn(ti.input.nodeName,ti.config.altInputClass),ti._input=ti.altInput,ti.altInput.placeholder=ti.input.placeholder,ti.altInput.disabled=ti.input.disabled,ti.altInput.required=ti.input.required,ti.altInput.tabIndex=ti.input.tabIndex,ti.altInput.type="text",ti.input.setAttribute("type","hidden"),!ti.config.static&&ti.input.parentNode&&ti.input.parentNode.insertBefore(ti.altInput,ti.input.nextSibling)),ti.config.allowInput||ti._input.setAttribute("readonly","readonly"),ru()}function ru(){ti._positionElement=ti.config.positionElement||ti._input}function Ph(){var fi=ti.config.enableTime?ti.config.noCalendar?"time":"datetime-local":"date";ti.mobileInput=tn("input",ti.input.className+" flatpickr-mobile"),ti.mobileInput.tabIndex=1,ti.mobileInput.type=fi,ti.mobileInput.disabled=ti.input.disabled,ti.mobileInput.required=ti.input.required,ti.mobileInput.placeholder=ti.input.placeholder,ti.mobileFormatStr=fi==="datetime-local"?"Y-m-d\\TH:i:S":fi==="date"?"Y-m-d":"H:i:S",ti.selectedDates.length>0&&(ti.mobileInput.defaultValue=ti.mobileInput.value=ti.formatDate(ti.selectedDates[0],ti.mobileFormatStr)),ti.config.minDate&&(ti.mobileInput.min=ti.formatDate(ti.config.minDate,"Y-m-d")),ti.config.maxDate&&(ti.mobileInput.max=ti.formatDate(ti.config.maxDate,"Y-m-d")),ti.input.getAttribute("step")&&(ti.mobileInput.step=String(ti.input.getAttribute("step"))),ti.input.type="hidden",ti.altInput!==void 0&&(ti.altInput.type="hidden");try{ti.input.parentNode&&ti.input.parentNode.insertBefore(ti.mobileInput,ti.input.nextSibling)}catch(hi){}vi(ti.mobileInput,"change",function(hi){ti.setDate(Wn(hi).value,!1,ti.mobileFormatStr),un("onChange"),un("onClose")})}function Fh(fi){if(ti.isOpen===!0)return ti.close();ti.open(fi)}function un(fi,hi){if(ti.config!==void 0){var mi=ti.config[fi];if(mi!==void 0&&mi.length>0)for(var _i=0;mi[_i]&&_i=0&&Un(fi,ti.selectedDates[1])<=0}function Ca(){ti.config.noCalendar||ti.isMobile||!ti.monthNav||(ti.yearElements.forEach(function(fi,hi){var mi=new Date(ti.currentYear,ti.currentMonth,1);mi.setMonth(ti.currentMonth+hi),ti.config.showMonths>1||ti.config.monthSelectorType==="static"?ti.monthElements[hi].textContent=_a(mi.getMonth(),ti.config.shorthandCurrentMonth,ti.l10n)+" ":ti.monthsDropdownContainer.value=mi.getMonth().toString(),fi.value=mi.getFullYear().toString()}),ti._hidePrevMonthArrow=ti.config.minDate!==void 0&&(ti.currentYear===ti.config.minDate.getFullYear()?ti.currentMonth<=ti.config.minDate.getMonth():ti.currentYearti.config.maxDate.getMonth():ti.currentYear>ti.config.maxDate.getFullYear()))}function Hl(fi){var hi=fi||(ti.config.altInput?ti.config.altFormat:ti.config.dateFormat);return ti.selectedDates.map(function(mi){return ti.formatDate(mi,hi)}).filter(function(mi,_i,Ti){return ti.config.mode!=="range"||ti.config.enableTime||Ti.indexOf(mi)===_i}).join(ti.config.mode!=="range"?ti.config.conjunction:ti.l10n.rangeSeparator)}function lo(fi){fi===void 0&&(fi=!0),ti.mobileInput!==void 0&&ti.mobileFormatStr&&(ti.mobileInput.value=ti.latestSelectedDateObj!==void 0?ti.formatDate(ti.latestSelectedDateObj,ti.mobileFormatStr):""),ti.input.value=Hl(ti.config.dateFormat),ti.altInput!==void 0&&(ti.altInput.value=Hl(ti.config.altFormat)),fi!==!1&&un("onValueUpdate")}function Bh(fi){var hi=Wn(fi),mi=ti.prevMonthNav.contains(hi),_i=ti.nextMonthNav.contains(hi);mi||_i?Ri(mi?-1:1):ti.yearElements.indexOf(hi)>=0?hi.select():hi.classList.contains("arrowUp")?ti.changeYear(ti.currentYear+1):hi.classList.contains("arrowDown")&&ti.changeYear(ti.currentYear-1)}function zh(fi){fi.preventDefault();var hi=fi.type==="keydown",mi=Wn(fi),_i=mi;ti.amPM!==void 0&&mi===ti.amPM&&(ti.amPM.textContent=ti.l10n.amPM[qn(ti.amPM.textContent===ti.l10n.amPM[0])]);var Ti=parseFloat(_i.getAttribute("min")),Ni=parseFloat(_i.getAttribute("max")),Ki=parseFloat(_i.getAttribute("step")),$i=parseInt(_i.value,10),Xi=fi.delta||(hi?fi.which===38?1:-1:0),Fi=$i+Ki*Xi;if(typeof _i.value!="undefined"&&_i.value.length===2){var Gi=_i===ti.hourElement,nn=_i===ti.minuteElement;FiNi&&(Fi=_i===ti.hourElement?Fi-Ni-qn(!ti.amPM):Ti,nn&&Oi(void 0,1,ti.hourElement)),ti.amPM&&Gi&&(Ki===1?Fi+$i===23:Math.abs(Fi-$i)>Ki)&&(ti.amPM.textContent=ti.l10n.amPM[qn(ti.amPM.textContent===ti.l10n.amPM[0])]),_i.value=Rn(Fi)}}return ri(),ti}function Ns(ii,ei){for(var ti=Array.prototype.slice.call(ii).filter(function(si){return si instanceof HTMLElement}),ni=[],ri=0;ri option"))if(ei.selected){for(let ti of Hi("#id_columns"))ti.appendChild(ei.cloneNode(!0));ei.remove()}ii.preventDefault()}function z_(ii){for(let ei of Hi("#id_columns > option"))if(ei.selected){for(let ti of Hi("#id_available_columns"))ti.appendChild(ei.cloneNode(!0));ei.remove()}ii.preventDefault()}function _h(ii,ei){return co(this,null,function*(){return yield Ls(ii,ei)})}function V_(ii){var li,ui,ci;ii.preventDefault();let ei=ii.currentTarget,ti=ei.getAttribute("data-url");if(ti==null){Po("danger","Error Updating Table Configuration","No API path defined for configuration form.").show();return}let ni=((li=document.activeElement)==null?void 0:li.getAttribute("value"))==="Reset",ri=(ci=(ui=ei.getAttribute("data-config-root"))==null?void 0:ui.split("."))!=null?ci:[];if(ni){let di=ri.reduceRight((pi,yi)=>({[yi]:pi}),{});_h(ti,di).then(pi=>{rs(pi)?Po("danger","Error Resetting Table Configuration",pi.error).show():location.reload()});return}let oi=yf(ei,"select[name=columns]"),si=Object.assign({},...oi.map(di=>({[di.name]:di.options}))),ai=ri.reduceRight((di,pi)=>({[pi]:di}),si);_h(ti,ai).then(di=>{rs(di)?Po("danger","Error Updating Table Configuration",di.error).show():location.reload()})}function Eh(){for(let ii of Hi("#save_tableconfig"))ii.addEventListener("click",$_);for(let ii of Hi("#add_columns"))ii.addEventListener("click",B_);for(let ii of Hi("#remove_columns"))ii.addEventListener("click",z_);for(let ii of Hi("form.userconfigform"))ii.addEventListener("submit",V_)}function wh(ii){return typeof ii=="string"&&["show","hide"].includes(ii)}var ss=class extends Error{constructor(ti,ni){super(ti);en(this,"table");this.table=ni}},Rs=class{constructor(ei,ti){en(this,"button");en(this,"rows");this.button=ei,this.rows=ti}hideRows(){for(let ei of this.rows)ei.classList.add("d-none")}set buttonState(ei){wh(ei)&&this.button.setAttribute("data-state",ei)}get buttonState(){let ei=this.button.getAttribute("data-state");return wh(ei)?ei:null}toggleButton(){this.buttonState==="show"?this.button.innerText=Ms(this.button.innerText,"Show","Hide"):this.buttonState==="hide"&&(this.button.innerText=Ms(this.button.innerHTML,"Hide","Show"))}toggleState(){this.buttonState==="show"?this.buttonState="hide":this.buttonState==="hide"&&(this.buttonState="show")}toggle(){this.toggleState(),this.toggleButton()}handleClick(ei){ei.currentTarget.isEqualNode(this.button)&&this.toggle(),this.buttonState==="hide"&&this.hideRows()}},Xc=class{constructor(ei){en(this,"table");en(this,"enabledButton");en(this,"disabledButton");en(this,"virtualButton");en(this,"disconnectedButton");en(this,"rows");this.table=ei,this.rows=this.table.querySelectorAll("tr");try{let ti=os(this.table,"button.toggle-enabled"),ni=os(this.table,"button.toggle-disabled"),ri=os(this.table,"button.toggle-virtual"),oi=os(this.table,"button.toggle-disconnected");if(ti===null)throw new ss("Table is missing a 'toggle-enabled' button.",ei);if(ni===null)throw new ss("Table is missing a 'toggle-disabled' button.",ei);if(ri===null)throw new ss("Table is missing a 'toggle-virtual' button.",ei);if(oi===null)throw new ss("Table is missing a 'toggle-disconnected' button.",ei);ti.addEventListener("click",si=>this.handleClick(si,this)),ni.addEventListener("click",si=>this.handleClick(si,this)),ri.addEventListener("click",si=>this.handleClick(si,this)),oi.addEventListener("click",si=>this.handleClick(si,this)),this.enabledButton=new Rs(ti,ei.querySelectorAll('tr[data-enabled="enabled"]')),this.disabledButton=new Rs(ni,ei.querySelectorAll('tr[data-enabled="disabled"]')),this.virtualButton=new Rs(ri,ei.querySelectorAll('tr[data-type="virtual"]')),this.disconnectedButton=new Rs(oi,ei.querySelectorAll('tr[data-connected="disconnected"]'))}catch(ti){if(ti instanceof ss){console.debug("Table does not contain enable/disable toggle buttons");return}else throw ti}}handleClick(ei,ti){for(let ni of this.rows)ni.classList.remove("d-none");ti.enabledButton.handleClick(ei),ti.disabledButton.handleClick(ei),ti.virtualButton.handleClick(ei),ti.disconnectedButton.handleClick(ei)}};function xh(){for(let ii of Hi("table"))new Xc(ii)}var Jc=class{constructor(ei){en(this,"base");en(this,"state");en(this,"activeLink",null);en(this,"sections",[]);this.base=ei,this.state=new ga({pinned:!0},{persist:!0,key:"netbox-sidenav"}),this.init(),this.initSectionLinks(),this.initLinks()}bodyHas(ei){return document.body.hasAttribute(`data-sidenav-${ei}`)}bodyRemove(...ei){for(let ti of ei)document.body.removeAttribute(`data-sidenav-${ti}`)}bodyAdd(...ei){for(let ti of ei)document.body.setAttribute(`data-sidenav-${ti}`,"")}init(){for(let ei of this.base.querySelectorAll(".sidenav-toggle"))ei.addEventListener("click",ti=>this.onToggle(ti));for(let ei of Hi(".sidenav-toggle-mobile"))ei.addEventListener("click",ti=>this.onMobileToggle(ti));window.innerWidth>1200&&(this.state.get("pinned")&&this.pin(),this.state.get("pinned")||this.unpin(),window.addEventListener("resize",()=>this.onResize())),window.innerWidth<1200&&(this.bodyRemove("hide"),this.bodyAdd("hidden"),window.addEventListener("resize",()=>this.onResize())),this.base.addEventListener("mouseenter",()=>this.onEnter()),this.base.addEventListener("mouseleave",()=>this.onLeave())}initLinks(){for(let ei of this.getActiveLinks())this.bodyHas("show")?this.activateLink(ei,"expand"):this.bodyHas("hidden")&&this.activateLink(ei,"collapse")}show(){this.bodyAdd("show"),this.bodyRemove("hidden","hide")}hide(){this.bodyAdd("hidden"),this.bodyRemove("pinned","show");for(let ei of this.base.querySelectorAll(".collapse"))ei.classList.remove("show")}pin(){this.bodyAdd("show","pinned"),this.bodyRemove("hidden"),this.state.set("pinned",!0)}unpin(){this.bodyRemove("pinned","show"),this.bodyAdd("hidden");for(let ei of this.base.querySelectorAll(".collapse"))ei.classList.remove("show");this.state.set("pinned",!1)}handleSectionClick(ei){ei.preventDefault();let ti=ei.target;this.activeLink=ti,this.closeInactiveSections()}closeInactiveSections(){for(let[ei,ti]of this.sections)ei!==this.activeLink&&(ei.classList.add("collapsed"),ei.setAttribute("aria-expanded","false"),ti.hide())}initSectionLinks(){for(let ei of Hi(".navbar-nav .nav-item .nav-link[data-bs-toggle]"))if(ei.parentElement!==null){let ti=ei.parentElement.querySelector(".collapse");if(ti!==null){let ni=new Oo(ti,{toggle:!1});this.sections.push([ei,ni]),ei.addEventListener("click",ri=>this.handleSectionClick(ri))}}}activateLink(ei,ti){var ri;let ni=ei.closest(".dropdown-menu");if(fl(ni)){let oi=ni.parentElement,si=(ri=ni.parentElement)==null?void 0:ri.querySelector(".nav-link");if(fl(si)&&fl(oi))switch(ti){case"expand":si.setAttribute("aria-expanded","true"),oi.classList.add("active"),ni.classList.add("show"),ei.classList.add("active");break;case"collapse":si.setAttribute("aria-expanded","false"),oi.classList.remove("active"),ni.classList.remove("show"),ei.classList.remove("active");break}}}*getActiveLinks(){for(let ei of this.base.querySelectorAll("ul.navbar-nav .nav-item .dropdown-item")){let ti=ei.querySelector("a");if(ti){let ni=new RegExp(ti.href,"gi");window.location.href.match(ni)&&(yield ei)}}}onEnter(){if(!this.bodyHas("pinned")){this.bodyRemove("hide","hidden"),this.bodyAdd("show");for(let ei of this.getActiveLinks())this.activateLink(ei,"expand")}}onLeave(){if(!this.bodyHas("pinned")){this.bodyRemove("show"),this.bodyAdd("hide");for(let ei of this.getActiveLinks())this.activateLink(ei,"collapse");this.bodyRemove("hide"),this.bodyAdd("hidden")}}onResize(){this.bodyHas("show")&&!this.bodyHas("pinned")&&(this.bodyRemove("show"),this.bodyAdd("hidden"))}onToggle(ei){ei.preventDefault(),this.state.get("pinned")?this.unpin():this.pin()}onMobileToggle(ei){ei.preventDefault(),this.bodyHas("hidden")?this.show():this.hide()}};function Th(){for(let ii of Hi(".navbar"))new Jc(ii)}function Sh(ii,ei,ti,ni,ri){let oi=(...si)=>(console.warn("gridstack.js: Function `"+ti+"` is deprecated in "+ri+" and has been replaced with `"+ni+"`. It will be **removed** in a future release"),ei.apply(ii,si));return oi.prototype=ei.prototype,oi}var bi=class ii{static getElements(ei,ti=document){if(typeof ei=="string"){let ni="getElementById"in ti?ti:void 0;if(ni&&!isNaN(+ei[0])){let oi=ni.getElementById(ei);return oi?[oi]:[]}let ri=ti.querySelectorAll(ei);return!ri.length&&ei[0]!=="."&&ei[0]!=="#"&&(ri=ti.querySelectorAll("."+ei),ri.length||(ri=ti.querySelectorAll("#"+ei))),Array.from(ri)}return[ei]}static getElement(ei,ti=document){if(typeof ei=="string"){let ni="getElementById"in ti?ti:void 0;if(!ei.length)return null;if(ni&&ei[0]==="#")return ni.getElementById(ei.substring(1));if(ei[0]==="#"||ei[0]==="."||ei[0]==="[")return ti.querySelector(ei);if(ni&&!isNaN(+ei[0]))return ni.getElementById(ei);let ri=ti.querySelector(ei);return ni&&!ri&&(ri=ni.getElementById(ei)),ri||(ri=ti.querySelector("."+ei)),ri}return ei}static createWidgetDivs(ei,ti){var si,ai;let ni=ii.createDiv(["grid-stack-item",ei]),ri=ii.createDiv(["grid-stack-item-content"],ni);return ti.lazyLoad||((ai=(si=ti.grid)==null?void 0:si.opts)==null?void 0:ai.lazyLoad)&&ti.lazyLoad!==!1?ti.visibleObservable||(ti.visibleObservable=new IntersectionObserver(([li])=>{var ui;li.isIntersecting&&((ui=ti.visibleObservable)==null||ui.disconnect(),delete ti.visibleObservable,Jr.renderCB(ri,ti))}),window.setTimeout(()=>{var li;return(li=ti.visibleObservable)==null?void 0:li.observe(ni)})):Jr.renderCB(ri,ti),ni}static createDiv(ei,ti){let ni=document.createElement("div");return ei.forEach(ri=>{ri&&ni.classList.add(ri)}),ti==null||ti.appendChild(ni),ni}static shouldSizeToContent(ei,ti=!1){return(ei==null?void 0:ei.grid)&&(ti?ei.sizeToContent===!0||ei.grid.opts.sizeToContent===!0&&ei.sizeToContent===void 0:!!ei.sizeToContent||ei.grid.opts.sizeToContent&&ei.sizeToContent!==!1)}static isIntercepted(ei,ti){return!(ei.y>=ti.y+ti.h||ei.y+ei.h<=ti.y||ei.x+ei.w<=ti.x||ei.x>=ti.x+ti.w)}static isTouching(ei,ti){return ii.isIntercepted(ei,{x:ti.x-.5,y:ti.y-.5,w:ti.w+1,h:ti.h+1})}static areaIntercept(ei,ti){let ni=ei.x>ti.x?ei.x:ti.x,ri=ei.x+ei.wti.y?ei.y:ti.y,si=ei.y+ei.h{var ai,li,ui,ci;let si=ti*(((ai=ri.y)!=null?ai:1e4)-((li=oi.y)!=null?li:1e4));return si===0?ti*(((ui=ri.x)!=null?ui:1e4)-((ci=oi.x)!=null?ci:1e4)):si})}static find(ei,ti){return ti?ei.find(ni=>ni.id===ti):void 0}static createStylesheet(ei,ti,ni){let ri=document.createElement("style"),oi=ni==null?void 0:ni.nonce;return oi&&(ri.nonce=oi),ri.setAttribute("type","text/css"),ri.setAttribute("gs-style-id",ei),ri.styleSheet?ri.styleSheet.cssText="":ri.appendChild(document.createTextNode("")),ti?ti.insertBefore(ri,ti.firstChild):(ti=document.getElementsByTagName("head")[0],ti.appendChild(ri)),ri.sheet}static removeStylesheet(ei,ti){let ri=(ti||document).querySelector("STYLE[gs-style-id="+ei+"]");ri&&ri.parentNode&&ri.remove()}static addCSSRule(ei,ti,ni){typeof ei.addRule=="function"?ei.addRule(ti,ni):typeof ei.insertRule=="function"&&ei.insertRule(`${ti}{${ni}}`)}static toBool(ei){return typeof ei=="boolean"?ei:typeof ei=="string"?(ei=ei.toLowerCase(),!(ei===""||ei==="no"||ei==="false"||ei==="0")):!!ei}static toNumber(ei){return ei===null||ei.length===0?void 0:Number(ei)}static parseHeight(ei){let ti,ni="px";if(typeof ei=="string")if(ei==="auto"||ei==="")ti=0;else{let ri=ei.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!ri)throw new Error(`Invalid height val = ${ei}`);ni=ri[2]||"px",ti=parseFloat(ri[1])}else ti=ei;return{h:ti,unit:ni}}static defaults(ei,...ti){return ti.forEach(ni=>{for(let ri in ni){if(!ni.hasOwnProperty(ri))return;ei[ri]===null||ei[ri]===void 0?ei[ri]=ni[ri]:typeof ni[ri]=="object"&&typeof ei[ri]=="object"&&this.defaults(ei[ri],ni[ri])}}),ei}static same(ei,ti){if(typeof ei!="object")return ei==ti;if(typeof ei!=typeof ti||Object.keys(ei).length!==Object.keys(ti).length)return!1;for(let ni in ei)if(ei[ni]!==ti[ni])return!1;return!0}static copyPos(ei,ti,ni=!1){return ti.x!==void 0&&(ei.x=ti.x),ti.y!==void 0&&(ei.y=ti.y),ti.w!==void 0&&(ei.w=ti.w),ti.h!==void 0&&(ei.h=ti.h),ni&&(ti.minW&&(ei.minW=ti.minW),ti.minH&&(ei.minH=ti.minH),ti.maxW&&(ei.maxW=ti.maxW),ti.maxH&&(ei.maxH=ti.maxH)),ei}static samePos(ei,ti){return ei&&ti&&ei.x===ti.x&&ei.y===ti.y&&(ei.w||1)===(ti.w||1)&&(ei.h||1)===(ti.h||1)}static sanitizeMinMax(ei){ei.minW||delete ei.minW,ei.minH||delete ei.minH,ei.maxW||delete ei.maxW,ei.maxH||delete ei.maxH}static removeInternalAndSame(ei,ti){if(!(typeof ei!="object"||typeof ti!="object"))for(let ni in ei){let ri=ei[ni],oi=ti[ni];ni[0]==="_"||ri===oi?delete ei[ni]:ri&&typeof ri=="object"&&oi!==void 0&&(ii.removeInternalAndSame(ri,oi),Object.keys(ri).length||delete ei[ni])}}static removeInternalForSave(ei,ti=!0){for(let ni in ei)(ni[0]==="_"||ei[ni]===null||ei[ni]===void 0)&&delete ei[ni];delete ei.grid,ti&&delete ei.el,ei.autoPosition||delete ei.autoPosition,ei.noResize||delete ei.noResize,ei.noMove||delete ei.noMove,ei.locked||delete ei.locked,(ei.w===1||ei.w===ei.minW)&&delete ei.w,(ei.h===1||ei.h===ei.minH)&&delete ei.h}static throttle(ei,ti){let ni=!1;return(...ri)=>{ni||(ni=!0,setTimeout(()=>{ei(...ri),ni=!1},ti))}}static removePositioningStyles(ei){let ti=ei.style;ti.position&&ti.removeProperty("position"),ti.left&&ti.removeProperty("left"),ti.top&&ti.removeProperty("top"),ti.width&&ti.removeProperty("width"),ti.height&&ti.removeProperty("height")}static getScrollElement(ei){if(!ei)return document.scrollingElement||document.documentElement;let ti=getComputedStyle(ei);return/(auto|scroll)/.test(ti.overflow+ti.overflowY)?ei:this.getScrollElement(ei.parentElement)}static updateScrollPosition(ei,ti,ni){let ri=ei.getBoundingClientRect(),oi=window.innerHeight||document.documentElement.clientHeight;if(ri.top<0||ri.bottom>oi){let si=ri.bottom-oi,ai=ri.top,li=this.getScrollElement(ei);if(li!==null){let ui=li.scrollTop;ri.top<0&&ni<0?ei.offsetHeight>oi?li.scrollTop+=ni:li.scrollTop+=Math.abs(ai)>Math.abs(ni)?ni:ai:ni>0&&(ei.offsetHeight>oi?li.scrollTop+=ni:li.scrollTop+=si>ni?ni:si),ti.top+=li.scrollTop-ui}}}static updateScrollResize(ei,ti,ni){let ri=this.getScrollElement(ti),oi=ri.clientHeight,si=ri===this.getScrollElement()?0:ri.getBoundingClientRect().top,ai=ei.clientY-si,li=aioi-ni;li?ri.scrollBy({behavior:"smooth",top:ai-ni}):ui&&ri.scrollBy({behavior:"smooth",top:ni-(oi-ai)})}static clone(ei){return ei==null||typeof ei!="object"?ei:ei instanceof Array?[...ei]:Di({},ei)}static cloneDeep(ei){let ti=["parentGrid","el","grid","subGrid","engine"],ni=ii.clone(ei);for(let ri in ni)ni.hasOwnProperty(ri)&&typeof ni[ri]=="object"&&ri.substring(0,2)!=="__"&&!ti.find(oi=>oi===ri)&&(ni[ri]=ii.cloneDeep(ei[ri]));return ni}static cloneNode(ei){let ti=ei.cloneNode(!0);return ti.removeAttribute("id"),ti}static appendTo(ei,ti){let ni;typeof ti=="string"?ni=ii.getElement(ti):ni=ti,ni&&ni.appendChild(ei)}static addElStyles(ei,ti){if(ti instanceof Object)for(let ni in ti)ti.hasOwnProperty(ni)&&(Array.isArray(ti[ni])?ti[ni].forEach(ri=>{ei.style[ni]=ri}):ei.style[ni]=ti[ni])}static initEvent(ei,ti){let ni={type:ti.type},ri={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:ti.target?ti.target:ei.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(oi=>ni[oi]=ei[oi]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(oi=>ni[oi]=ei[oi]),Di(Di({},ni),ri)}static simulateMouseEvent(ei,ti,ni){let ri=document.createEvent("MouseEvents");ri.initMouseEvent(ti,!0,!0,window,1,ei.screenX,ei.screenY,ei.clientX,ei.clientY,ei.ctrlKey,ei.altKey,ei.shiftKey,ei.metaKey,0,ei.target),(ni||ei.target).dispatchEvent(ri)}static getValuesFromTransformedElement(ei){let ti=document.createElement("div");ii.addElStyles(ti,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),ei.appendChild(ti);let ni=ti.getBoundingClientRect();return ei.removeChild(ti),ti.remove(),{xScale:1/ni.width,yScale:1/ni.height,xOffset:ni.left,yOffset:ni.top}}static swap(ei,ti,ni){if(!ei)return;let ri=ei[ti];ei[ti]=ei[ni],ei[ni]=ri}static canBeRotated(ei){var ti;return!(!ei||ei.w===ei.h||ei.locked||ei.noResize||(ti=ei.grid)!=null&&ti.opts.disableResize||ei.minW&&ei.minW===ei.maxW||ei.minH&&ei.minH===ei.maxH)}};var as=class ii{constructor(ei={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=ei.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=ei.maxRow,this._float=ei.float,this.nodes=ei.nodes||[],this.onChange=ei.onChange}batchUpdate(ei=!0,ti=!0){return!!this.batchMode===ei?this:(this.batchMode=ei,ei?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,ti&&this._packNodes(),this._notify()),this)}_useEntireRowArea(ei,ti){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!ei._moving||ei._skipDown||ti.y<=ei.y)}_fixCollisions(ei,ti=ei,ni,ri={}){if(this.sortNodes(-1),ni=ni||this.collide(ei,ti),!ni)return!1;if(ei._moving&&!ri.nested&&!this.float&&this.swap(ei,ni))return!0;let oi=ti;!this._loading&&this._useEntireRowArea(ei,ti)&&(oi={x:0,w:this.column,y:ti.y,h:ti.h},ni=this.collide(ei,oi,ri.skip));let si=!1,ai={nested:!0,pack:!1},li=0;for(;ni=ni||this.collide(ei,oi,ri.skip);){if(li++>this.nodes.length*2)throw new Error("Infinite collide check");let ui;if(ni.locked||this._loading||ei._moving&&!ei._skipDown&&ti.y>ei.y&&!this.float&&(!this.collide(ni,sn(Di({},ni),{y:ei.y}),ei)||!this.collide(ni,sn(Di({},ni),{y:ti.y-ni.h}),ei))){ei._skipDown=ei._skipDown||ti.y>ei.y;let ci=Di(sn(Di({},ti),{y:ni.y+ni.h}),ai);ui=this._loading&&bi.samePos(ei,ci)?!0:this.moveNode(ei,ci),(ni.locked||this._loading)&&ui?bi.copyPos(ti,ei):!ni.locked&&ui&&ri.pack&&(this._packNodes(),ti.y=ni.y+ni.h,bi.copyPos(ei,ti)),si=si||ui}else ui=this.moveNode(ni,Di(sn(Di({},ni),{y:ti.y+ti.h,skip:ei}),ai));if(!ui)return si;ni=void 0}return si}collide(ei,ti=ei,ni){let ri=ei._id,oi=ni==null?void 0:ni._id;return this.nodes.find(si=>si._id!==ri&&si._id!==oi&&bi.isIntercepted(si,ti))}collideAll(ei,ti=ei,ni){let ri=ei._id,oi=ni==null?void 0:ni._id;return this.nodes.filter(si=>si._id!==ri&&si._id!==oi&&bi.isIntercepted(si,ti))}directionCollideCoverage(ei,ti,ni){if(!ti.rect||!ei._rect)return;let ri=ei._rect,oi=Di({},ti.rect);oi.y>ri.y?(oi.h+=oi.y-ri.y,oi.y=ri.y):oi.h+=ri.y-oi.y,oi.x>ri.x?(oi.w+=oi.x-ri.x,oi.x=ri.x):oi.w+=ri.x-oi.x;let si,ai=.5;for(let li of ni){if(li.locked||!li._rect)break;let ui=li._rect,ci=Number.MAX_VALUE,di=Number.MAX_VALUE;ri.yui.y+ui.h&&(ci=(ui.y+ui.h-oi.y)/ui.h),ri.xui.x+ui.w&&(di=(ui.x+ui.w-oi.x)/ui.w);let pi=Math.min(di,ci);pi>ai&&(ai=pi,si=li)}return ti.collide=si,si}cacheRects(ei,ti,ni,ri,oi,si){return this.nodes.forEach(ai=>ai._rect={y:ai.y*ti+ni,x:ai.x*ei+si,w:ai.w*ei-si-ri,h:ai.h*ti-ni-oi}),this}swap(ei,ti){if(!ti||ti.locked||!ei||ei.locked)return!1;function ni(){let oi=ti.x,si=ti.y;return ti.x=ei.x,ti.y=ei.y,ei.h!=ti.h?(ei.x=oi,ei.y=ti.y+ti.h):ei.w!=ti.w?(ei.x=ti.x+ti.w,ei.y=si):(ei.x=oi,ei.y=si),ei._dirty=ti._dirty=!0,!0}let ri;if(ei.w===ti.w&&ei.h===ti.h&&(ei.x===ti.x||ei.y===ti.y)&&(ri=bi.isTouching(ei,ti)))return ni();if(ri!==!1){if(ei.w===ti.w&&ei.x===ti.x&&(ri||(ri=bi.isTouching(ei,ti)))){if(ti.y{let ui;si.locked||(si.autoPosition=!0,ei==="list"&&ai&&(ui=li[ai-1])),this.addNode(si,!1,ui)}),ri||delete this._inColumnResize,ni||this.batchUpdate(!1),this}set float(ei){this._float!==ei&&(this._float=ei||!1,ei||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(ei=1){return this.nodes=bi.sort(this.nodes,ei),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(ei=>{if(ei._updating||ei._orig===void 0||ei.y===ei._orig.y)return;let ti=ei.y;for(;ti>ei._orig.y;)--ti,this.collide(ei,{x:ei.x,y:ti,w:ei.w,h:ei.h})||(ei._dirty=!0,ei.y=ti)}):this.nodes.forEach((ei,ti)=>{if(!ei.locked)for(;ei.y>0;){let ni=ti===0?0:ei.y-1;if(!(ti===0||!this.collide(ei,{x:ei.x,y:ni,w:ei.w,h:ei.h})))break;ei._dirty=ei.y!==ni,ei.y=ni}}),this)}prepareNode(ei,ti){var oi;ei._id=(oi=ei._id)!=null?oi:ii._idSeq++;let ni=ei.id;if(ni){let si=1;for(;this.nodes.find(ai=>ai.id===ei.id&&ai!==ei);)ei.id=ni+"_"+si++}(ei.x===void 0||ei.y===void 0||ei.x===null||ei.y===null)&&(ei.autoPosition=!0);let ri={x:0,y:0,w:1,h:1};return bi.defaults(ei,ri),ei.autoPosition||delete ei.autoPosition,ei.noResize||delete ei.noResize,ei.noMove||delete ei.noMove,bi.sanitizeMinMax(ei),typeof ei.x=="string"&&(ei.x=Number(ei.x)),typeof ei.y=="string"&&(ei.y=Number(ei.y)),typeof ei.w=="string"&&(ei.w=Number(ei.w)),typeof ei.h=="string"&&(ei.h=Number(ei.h)),isNaN(ei.x)&&(ei.x=ri.x,ei.autoPosition=!0),isNaN(ei.y)&&(ei.y=ri.y,ei.autoPosition=!0),isNaN(ei.w)&&(ei.w=ri.w),isNaN(ei.h)&&(ei.h=ri.h),this.nodeBoundFix(ei,ti),ei}nodeBoundFix(ei,ti){let ni=ei._orig||bi.copyPos({},ei);if(ei.maxW&&ei.w&&(ei.w=Math.min(ei.w,ei.maxW)),ei.maxH&&ei.h&&(ei.h=Math.min(ei.h,ei.maxH)),ei.minW&&ei.w&&ei.minW<=this.column&&(ei.w=Math.max(ei.w,ei.minW)),ei.minH&&ei.h&&(ei.h=Math.max(ei.h,ei.minH)),(ei.x||0)+(ei.w||1)>this.column&&this.columnthis.column?ei.w=this.column:ei.w<1&&(ei.w=1),this.maxRow&&ei.h>this.maxRow?ei.h=this.maxRow:ei.h<1&&(ei.h=1),ei.x<0&&(ei.x=0),ei.y<0&&(ei.y=0),ei.x+ei.w>this.column&&(ti?ei.w=this.column-ei.x:ei.x=this.column-ei.w),this.maxRow&&ei.y+ei.h>this.maxRow&&(ti?ei.h=this.maxRow-ei.y:ei.y=this.maxRow-ei.h),bi.samePos(ei,ni)||(ei._dirty=!0),this}getDirtyNodes(ei){return ei?this.nodes.filter(ti=>ti._dirty&&!bi.samePos(ti,ti._orig)):this.nodes.filter(ti=>ti._dirty)}_notify(ei){if(this.batchMode||!this.onChange)return this;let ti=(ei||[]).concat(this.getDirtyNodes());return this.onChange(ti),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(ei=>{delete ei._dirty,delete ei._lastTried}),this)}saveInitial(){return this.nodes.forEach(ei=>{ei._orig=bi.copyPos({},ei),delete ei._dirty}),this._hasLocked=this.nodes.some(ei=>ei.locked),this}restoreInitial(){return this.nodes.forEach(ei=>{bi.samePos(ei,ei._orig)||(bi.copyPos(ei,ei._orig),ei._dirty=!0)}),this._notify(),this}findEmptyPosition(ei,ti=this.nodes,ni=this.column,ri){let oi=ri?ri.y*ni+(ri.x+ri.w):0,si=!1;for(let ai=oi;!si;++ai){let li=ai%ni,ui=Math.floor(ai/ni);if(li+ei.w>ni)continue;let ci={x:li,y:ui,w:ei.w,h:ei.h};ti.find(di=>bi.isIntercepted(ci,di))||((ei.x!==li||ei.y!==ui)&&(ei._dirty=!0),ei.x=li,ei.y=ui,delete ei.autoPosition,si=!0)}return si}addNode(ei,ti=!1,ni){let ri=this.nodes.find(si=>si._id===ei._id);if(ri)return ri;this._inColumnResize?this.nodeBoundFix(ei):this.prepareNode(ei),delete ei._temporaryRemoved,delete ei._removeDOM;let oi;return ei.autoPosition&&this.findEmptyPosition(ei,this.nodes,this.column,ni)&&(delete ei.autoPosition,oi=!0),this.nodes.push(ei),ti&&this.addedNodes.push(ei),oi||this._fixCollisions(ei),this.batchMode||this._packNodes()._notify(),ei}removeNode(ei,ti=!0,ni=!1){return this.nodes.find(ri=>ri._id===ei._id)?(ni&&this.removedNodes.push(ei),ti&&(ei._removeDOM=!0),this.nodes=this.nodes.filter(ri=>ri._id!==ei._id),ei._isAboutToRemove||this._packNodes(),this._notify([ei]),this):this}removeAll(ei=!0,ti=!0){if(delete this._layouts,!this.nodes.length)return this;ei&&this.nodes.forEach(ri=>ri._removeDOM=!0);let ni=this.nodes;return this.removedNodes=ti?ni:[],this.nodes=[],this._notify(ni)}moveNodeCheck(ei,ti){if(!this.changedPosConstrain(ei,ti))return!1;if(ti.pack=!0,!this.maxRow)return this.moveNode(ei,ti);let ni,ri=new ii({column:this.column,float:this.float,nodes:this.nodes.map(si=>si._id===ei._id?(ni=Di({},si),ni):Di({},si))});if(!ni)return!1;let oi=ri.moveNode(ni,ti)&&ri.getRow()<=Math.max(this.getRow(),this.maxRow);if(!oi&&!ti.resizing&&ti.collide){let si=ti.collide.el.gridstackNode;if(this.swap(ei,si))return this._notify(),!0}return oi?(ri.nodes.filter(si=>si._dirty).forEach(si=>{let ai=this.nodes.find(li=>li._id===si._id);ai&&(bi.copyPos(ai,si),ai._dirty=!0)}),this._notify(),!0):!1}willItFit(ei){if(delete ei._willFitPos,!this.maxRow)return!0;let ti=new ii({column:this.column,float:this.float,nodes:this.nodes.map(ri=>Di({},ri))}),ni=Di({},ei);return this.cleanupNode(ni),delete ni.el,delete ni._id,delete ni.content,delete ni.grid,ti.addNode(ni),ti.getRow()<=this.maxRow?(ei._willFitPos=bi.copyPos({},ni),!0):!1}changedPosConstrain(ei,ti){return ti.w=ti.w||ei.w,ti.h=ti.h||ei.h,ei.x!==ti.x||ei.y!==ti.y?!0:(ei.maxW&&(ti.w=Math.min(ti.w,ei.maxW)),ei.maxH&&(ti.h=Math.min(ti.h,ei.maxH)),ei.minW&&(ti.w=Math.max(ti.w,ei.minW)),ei.minH&&(ti.h=Math.max(ti.h,ei.minH)),ei.w!==ti.w||ei.h!==ti.h)}moveNode(ei,ti){var ui,ci;if(!ei||!ti)return!1;let ni;ti.pack===void 0&&!this.batchMode&&(ni=ti.pack=!0),typeof ti.x!="number"&&(ti.x=ei.x),typeof ti.y!="number"&&(ti.y=ei.y),typeof ti.w!="number"&&(ti.w=ei.w),typeof ti.h!="number"&&(ti.h=ei.h);let ri=ei.w!==ti.w||ei.h!==ti.h,oi=bi.copyPos({},ei,!0);if(bi.copyPos(oi,ti),this.nodeBoundFix(oi,ri),bi.copyPos(ti,oi),!ti.forceCollide&&bi.samePos(ei,ti))return!1;let si=bi.copyPos({},ei),ai=this.collideAll(ei,oi,ti.skip),li=!0;if(ai.length){let di=ei._moving&&!ti.nested,pi=di?this.directionCollideCoverage(ei,ti,ai):ai[0];if(di&&pi&&((ci=(ui=ei.grid)==null?void 0:ui.opts)!=null&&ci.subGridDynamic)&&!ei.grid._isTemp){let yi=bi.areaIntercept(ti.rect,pi._rect),gi=bi.area(ti.rect),vi=bi.area(pi._rect);yi/(gi.8&&(pi.grid.makeSubGrid(pi.el,void 0,ei),pi=void 0)}pi?li=!this._fixCollisions(ei,oi,pi,ti):(li=!1,ni&&delete ti.pack)}return li&&!bi.samePos(ei,oi)&&(ei._dirty=!0,bi.copyPos(ei,oi)),ti.pack&&this._packNodes()._notify(),!bi.samePos(ei,si)}getRow(){return this.nodes.reduce((ei,ti)=>Math.max(ei,ti.y+ti.h),0)}beginUpdate(ei){return ei._updating||(ei._updating=!0,delete ei._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let ei=this.nodes.find(ti=>ti._updating);return ei&&(delete ei._updating,delete ei._skipDown),this}save(ei=!0,ti){var si;let ni=(si=this._layouts)==null?void 0:si.length,ri=ni&&this.column!==ni-1?this._layouts[ni-1]:null,oi=[];return this.sortNodes(),this.nodes.forEach(ai=>{let li=ri==null?void 0:ri.find(ci=>ci._id===ai._id),ui=Di(Di({},ai),li||{});bi.removeInternalForSave(ui,!ei),ti&&ti(ai,ui),oi.push(ui)}),oi}layoutsNodesChange(ei){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((ti,ni)=>{if(!ti||ni===this.column)return this;if(ni{if(!oi._orig)return;let si=ti.find(ai=>ai._id===oi._id);si&&(si.y>=0&&oi.y!==oi._orig.y&&(si.y+=oi.y-oi._orig.y),oi.x!==oi._orig.x&&(si.x=Math.round(oi.x*ri)),oi.w!==oi._orig.w&&(si.w=Math.round(oi.w*ri)))})}}),this)}columnChanged(ei,ti,ni="moveScale"){var ai;if(!this.nodes.length||!ti||ei===ti)return this;if(ni==="none")return this;let ri=ni==="compact"||ni==="list";ri&&this.sortNodes(1),tiei&&this._layouts){let li=this._layouts[ti]||[],ui=this._layouts.length-1;!li.length&&ei!==ui&&((ai=this._layouts[ui])!=null&&ai.length)&&(ei=ui,this._layouts[ui].forEach(ci=>{var pi,yi,gi;let di=si.find(vi=>vi._id===ci._id);di&&(!ri&&!ci.autoPosition&&(di.x=(pi=ci.x)!=null?pi:di.x,di.y=(yi=ci.y)!=null?yi:di.y),di.w=(gi=ci.w)!=null?gi:di.w,(ci.x==null||ci.y===void 0)&&(di.autoPosition=!0))})),li.forEach(ci=>{var pi,yi,gi;let di=si.findIndex(vi=>vi._id===ci._id);if(di!==-1){let vi=si[di];if(ri){vi.w=ci.w;return}(ci.autoPosition||isNaN(ci.x)||isNaN(ci.y))&&this.findEmptyPosition(ci,oi),ci.autoPosition||(vi.x=(pi=ci.x)!=null?pi:vi.x,vi.y=(yi=ci.y)!=null?yi:vi.y,vi.w=(gi=ci.w)!=null?gi:vi.w,oi.push(vi)),si.splice(di,1)}})}if(ri)this.compact(ni,!1);else{if(si.length)if(typeof ni=="function")ni(ti,ei,oi,si);else{let li=ri?1:ti/ei,ui=ni==="move"||ni==="moveScale",ci=ni==="scale"||ni==="moveScale";si.forEach(di=>{di.x=ti===1?0:ui?Math.round(di.x*li):Math.min(di.x,ti-1),di.w=ti===1||ei===1?1:ci?Math.round(di.w*li)||1:Math.min(di.w,ti),oi.push(di)}),si=[]}oi=bi.sort(oi,-1),this._inColumnResize=!0,this.nodes=[],oi.forEach(li=>{this.addNode(li,!1),delete li._orig})}return this.nodes.forEach(li=>delete li._orig),this.batchUpdate(!1,!ri),delete this._inColumnResize,this}cacheLayout(ei,ti,ni=!1){let ri=[];return ei.forEach((oi,si)=>{var ai;if(oi._id===void 0){let li=oi.id?this.nodes.find(ui=>ui.id===oi.id):void 0;oi._id=(ai=li==null?void 0:li._id)!=null?ai:ii._idSeq++}ri[si]={x:oi.x,y:oi.y,w:oi.w,_id:oi._id}}),this._layouts=ni?[]:this._layouts||[],this._layouts[ti]=ri,this}cacheOneLayout(ei,ti){var oi;ei._id=(oi=ei._id)!=null?oi:ii._idSeq++;let ni={x:ei.x,y:ei.y,w:ei.w,_id:ei._id};(ei.autoPosition||ei.x===void 0)&&(delete ni.x,delete ni.y,ei.autoPosition&&(ni.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[ti]=this._layouts[ti]||[];let ri=this.findCacheLayout(ei,ti);return ri===-1?this._layouts[ti].push(ni):this._layouts[ti][ri]=ni,this}findCacheLayout(ei,ti){var ni,ri,oi;return(oi=(ri=(ni=this._layouts)==null?void 0:ni[ti])==null?void 0:ri.findIndex(si=>si._id===ei._id))!=null?oi:-1}removeNodeFromLayoutCache(ei){if(this._layouts)for(let ti=0;ti0||navigator.msMaxTouchPoints>0),Zr=class{};function Ll(ii,ei){if(ii.touches.length>1)return;ii.cancelable&&ii.preventDefault();let ti=ii.changedTouches[0],ni=document.createEvent("MouseEvents");ni.initMouseEvent(ei,!0,!0,window,1,ti.screenX,ti.screenY,ti.clientX,ti.clientY,!1,!1,!1,!1,0,null),ii.target.dispatchEvent(ni)}function Ch(ii,ei){ii.cancelable&&ii.preventDefault();let ti=document.createEvent("MouseEvents");ti.initMouseEvent(ei,!0,!0,window,1,ii.screenX,ii.screenY,ii.clientX,ii.clientY,!1,!1,!1,!1,0,null),ii.target.dispatchEvent(ti)}function Is(ii){Zr.touchHandled||(Zr.touchHandled=!0,Ll(ii,"mousedown"))}function Hs(ii){Zr.touchHandled&&Ll(ii,"mousemove")}function Ps(ii){if(!Zr.touchHandled)return;Zr.pointerLeaveTimeout&&(window.clearTimeout(Zr.pointerLeaveTimeout),delete Zr.pointerLeaveTimeout);let ei=!!Bi.dragElement;Ll(ii,"mouseup"),ei||Ll(ii,"click"),Zr.touchHandled=!1}function Fs(ii){ii.pointerType!=="mouse"&&ii.target.releasePointerCapture(ii.pointerId)}function Zc(ii){Bi.dragElement&&ii.pointerType!=="mouse"&&Ch(ii,"mouseenter")}function eu(ii){Bi.dragElement&&ii.pointerType!=="mouse"&&(Zr.pointerLeaveTimeout=window.setTimeout(()=>{delete Zr.pointerLeaveTimeout,Ch(ii,"mouseleave")},10))}var Ea=class ii{constructor(ei,ti,ni){this.host=ei,this.dir=ti,this.option=ni,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){let ei=this.el=document.createElement("div");return ei.classList.add("ui-resizable-handle"),ei.classList.add(`${ii.prefix}${this.dir}`),ei.style.zIndex="100",ei.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),$n&&(this.el.addEventListener("touchstart",Is),this.el.addEventListener("pointerdown",Fs)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),$n&&(this.el.removeEventListener("touchstart",Is),this.el.removeEventListener("pointerdown",Fs)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(ei){this.mouseDownEvent=ei,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),$n&&(this.el.addEventListener("touchmove",Hs),this.el.addEventListener("touchend",Ps)),ei.stopPropagation(),ei.preventDefault()}_mouseMove(ei){let ti=this.mouseDownEvent;this.moving?this._triggerEvent("move",ei):Math.abs(ei.x-ti.x)+Math.abs(ei.y-ti.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",ei),document.addEventListener("keydown",this._keyEvent)),ei.stopPropagation()}_mouseUp(ei){this.moving&&(this._triggerEvent("stop",ei),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),$n&&(this.el.removeEventListener("touchmove",Hs),this.el.removeEventListener("touchend",Ps)),delete this.moving,delete this.mouseDownEvent,ei.stopPropagation(),ei.preventDefault()}_keyEvent(ei){var ti,ni;ei.key==="Escape"&&((ni=(ti=this.host.gridstackNode)==null?void 0:ti.grid)==null||ni.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(ei,ti){return this.option[ei]&&this.option[ei](ti),this}};Ea.prefix="ui-resizable-";var zo=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(ei,ti){this._eventRegister[ei]=ti}off(ei){delete this._eventRegister[ei]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(ei,ti){if(!this.disabled&&this._eventRegister&&this._eventRegister[ei])return this._eventRegister[ei](ti)}};var wa=class ii extends zo{constructor(ei,ti={}){super(),this.el=ei,this.option=ti,this.rectScale={x:1,y:1},this._ui=()=>{let ri=this.el.parentElement.getBoundingClientRect(),oi={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},si=this.temporalRect||oi;return{position:{left:(si.left-ri.left)*this.rectScale.x,top:(si.top-ri.top)*this.rectScale.y},size:{width:si.width*this.rectScale.x,height:si.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(ei,ti){super.on(ei,ti)}off(ei){super.off(ei)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(ei){let ti=ei.handles&&ei.handles!==this.option.handles,ni=ei.autoHide&&ei.autoHide!==this.option.autoHide;return Object.keys(ei).forEach(ri=>this.option[ri]=ei[ri]),ti&&(this._removeHandlers(),this._setupHandlers()),ni&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(ei){return ei?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Bi.overResizeElement===this&&delete Bi.overResizeElement),this}_mouseOver(ei){Bi.overResizeElement||Bi.dragElement||(Bi.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(ei){Bi.overResizeElement===this&&(delete Bi.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(ei=>ei.trim()).map(ei=>new Ea(this.el,ei,{start:ti=>{this._resizeStart(ti)},stop:ti=>{this._resizeStop(ti)},move:ti=>{this._resizing(ti,ei)}})),this}_resizeStart(ei){this.sizeToContent=bi.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=bi.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=ei,this._setupHelper(),this._applyChange();let ti=bi.initEvent(ei,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(ti,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",ti),this}_resizing(ei,ti){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(ei,ti),this._applyChange();let ni=bi.initEvent(ei,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(ni,this._ui()),this.triggerEvent("resize",ni),this}_resizeStop(ei){let ti=bi.initEvent(ei,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(ti),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",ti),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=ii._originStyleProp.map(ni=>this.el.style[ni]),this.parentOriginStylePosition=this.el.parentElement.style.position;let ei=this.el.parentElement,ti=bi.getValuesFromTransformedElement(ei);return this.rectScale={x:ti.xScale,y:ti.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return ii._originStyleProp.forEach((ei,ti)=>{this.el.style[ei]=this.elOriginStyleVal[ti]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(ei,ti){let ni=this.startEvent,ri={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},oi=ei.clientX-ni.clientX,si=this.sizeToContent?0:ei.clientY-ni.clientY,ai,li;ti.indexOf("e")>-1?ri.width+=oi:ti.indexOf("w")>-1&&(ri.width-=oi,ri.left+=oi,ai=!0),ti.indexOf("s")>-1?ri.height+=si:ti.indexOf("n")>-1&&(ri.height-=si,ri.top+=si,li=!0);let ui=this._constrainSize(ri.width,ri.height,ai,li);return Math.round(ri.width)!==Math.round(ui.width)&&(ti.indexOf("w")>-1&&(ri.left+=ri.width-ui.width),ri.width=ui.width),Math.round(ri.height)!==Math.round(ui.height)&&(ti.indexOf("n")>-1&&(ri.top+=ri.height-ui.height),ri.height=ui.height),ri}_constrainSize(ei,ti,ni,ri){let oi=this.option,si=(ni?oi.maxWidthMoveLeft:oi.maxWidth)||Number.MAX_SAFE_INTEGER,ai=oi.minWidth/this.rectScale.x||ei,li=(ri?oi.maxHeightMoveUp:oi.maxHeight)||Number.MAX_SAFE_INTEGER,ui=oi.minHeight/this.rectScale.y||ti,ci=Math.min(si,Math.max(ai,ei)),di=Math.min(li,Math.max(ui,ti));return{width:ci,height:di}}_applyChange(){let ei={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let ti=this.el.parentElement,{left:ni,top:ri}=ti.getBoundingClientRect();ei={left:ni,top:ri,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(ti=>{let ni=this.temporalRect[ti],ri=ti==="width"||ti==="left"?this.rectScale.x:ti==="height"||ti==="top"?this.rectScale.y:1;this.el.style[ti]=(ni-ei[ti])*ri+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(ei=>ei.destroy()),delete this.handlers,this}};wa._originStyleProp=["width","height","position","left","top","opacity","zIndex"];var j_='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',xa=class ii extends zo{constructor(ei,ti={}){var oi;super(),this.el=ei,this.option=ti,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let ni=(oi=ti==null?void 0:ti.handle)==null?void 0:oi.substring(1),ri=ei.gridstackNode;this.dragEls=!ni||ei.classList.contains(ni)?[ei]:ri!=null&&ri.subGrid?[ei.querySelector(ti.handle)||ei]:Array.from(ei.querySelectorAll(ti.handle)),this.dragEls.length===0&&(this.dragEls=[ei]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(ei,ti){super.on(ei,ti)}off(ei){super.off(ei)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(ei=>{ei.addEventListener("mousedown",this._mouseDown),$n&&(ei.addEventListener("touchstart",Is),ei.addEventListener("pointerdown",Fs))}),this.el.classList.remove("ui-draggable-disabled"))}disable(ei=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(ti=>{ti.removeEventListener("mousedown",this._mouseDown),$n&&(ti.removeEventListener("touchstart",Is),ti.removeEventListener("pointerdown",Fs))}),ei||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(ei){return Object.keys(ei).forEach(ti=>this.option[ti]=ei[ti]),this}_mouseDown(ei){if(!Bi.mouseHandled)return ei.button!==0||!this.dragEls.find(ti=>ti===ei.target)&&ei.target.closest(j_)||this.option.cancel&&ei.target.closest(this.option.cancel)||(this.mouseDownEvent=ei,delete this.dragging,delete Bi.dragElement,delete Bi.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),$n&&(ei.currentTarget.addEventListener("touchmove",Hs),ei.currentTarget.addEventListener("touchend",Ps)),ei.preventDefault(),document.activeElement&&document.activeElement.blur(),Bi.mouseHandled=!0),!0}_callDrag(ei){if(!this.dragging)return;let ti=bi.initEvent(ei,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(ti,this.ui()),this.triggerEvent("drag",ti)}_mouseMove(ei){var ni;let ti=this.mouseDownEvent;if(this.lastDrag=ei,this.dragging)if(this._dragFollow(ei),Bi.pauseDrag){let ri=Number.isInteger(Bi.pauseDrag)?Bi.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(ei),ri)}else this._callDrag(ei);else if(Math.abs(ei.x-ti.x)+Math.abs(ei.y-ti.y)>3){this.dragging=!0,Bi.dragElement=this;let ri=(ni=this.el.gridstackNode)==null?void 0:ni.grid;ri?Bi.dropElement=ri.el.ddElement.ddDroppable:delete Bi.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=bi.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(ei,this.el,this.helperContainment),this._setupHelperStyle(ei);let oi=bi.initEvent(ei,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(oi,this.ui()),this.triggerEvent("dragstart",oi),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(ei){var ti,ni;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),$n&&ei.currentTarget&&(ei.currentTarget.removeEventListener("touchmove",Hs,!0),ei.currentTarget.removeEventListener("touchend",Ps,!0)),this.dragging){delete this.dragging,(ti=this.el.gridstackNode)==null||delete ti._origRotate,document.removeEventListener("keydown",this._keyEvent),((ni=Bi.dropElement)==null?void 0:ni.el)===this.el.parentElement&&delete Bi.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let ri=bi.initEvent(ei,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(ri),this.triggerEvent("dragstop",ri),Bi.dropElement&&Bi.dropElement.drop(ei)}delete this.helper,delete this.mouseDownEvent,delete Bi.dragElement,delete Bi.dropElement,delete Bi.mouseHandled,ei.preventDefault()}_keyEvent(ei){let ti=this.el.gridstackNode;if(!(ti!=null&&ti.grid))return;let ni=ti.grid;if(ei.key==="Escape")ti._origRotate&&(ti._orig=ti._origRotate,delete ti._origRotate),ni.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent);else if(ei.key==="r"||ei.key==="R"){if(!bi.canBeRotated(ti))return;ti._origRotate=ti._origRotate||Di({},ti._orig),delete ti._moving,ni.setAnimation(!1).rotate(ti.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),ti._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,ti.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",bi.swap(ti._orig,"w","h"),delete ti._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let ei=this.el;return typeof this.option.helper=="function"?ei=this.option.helper(this.el):this.option.helper==="clone"&&(ei=bi.cloneNode(this.el)),document.body.contains(ei)||bi.appendTo(ei,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=ii.originStyleProp.map(ti=>this.el.style[ti]),ei}_setupHelperStyle(ei){this.helper.classList.add("ui-draggable-dragging");let ti=this.helper.style;return ti.pointerEvents="none",ti.width=this.dragOffset.width+"px",ti.height=this.dragOffset.height+"px",ti.willChange="left, top",ti.position="fixed",this._dragFollow(ei),ti.transition="none",setTimeout(()=>{this.helper&&(ti.transition=null)},0),this}_removeHelperStyle(){var ti;this.helper.classList.remove("ui-draggable-dragging");let ei=(ti=this.helper)==null?void 0:ti.gridstackNode;if(!(ei!=null&&ei._isAboutToRemove)&&this.dragElementOriginStyle){let ni=this.helper,ri=this.dragElementOriginStyle.transition||null;ni.style.transition=this.dragElementOriginStyle.transition="none",ii.originStyleProp.forEach(oi=>ni.style[oi]=this.dragElementOriginStyle[oi]||null),setTimeout(()=>ni.style.transition=ri,50)}return delete this.dragElementOriginStyle,this}_dragFollow(ei){let ti={left:0,top:0},ni=this.helper.style,ri=this.dragOffset;ni.left=(ei.clientX+ri.offsetLeft-ti.left)*this.dragTransform.xScale+"px",ni.top=(ei.clientY+ri.offsetTop-ti.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(ei,ti,ni){let ri=0,oi=0;ni&&(ri=this.dragTransform.xOffset,oi=this.dragTransform.yOffset);let si=ti.getBoundingClientRect();return{left:si.left,top:si.top,offsetLeft:-ei.clientX+si.left-ri,offsetTop:-ei.clientY+si.top-oi,width:si.width*this.dragTransform.xScale,height:si.height*this.dragTransform.yScale}}ui(){let ti=this.el.parentElement.getBoundingClientRect(),ni=this.helper.getBoundingClientRect();return{position:{top:(ni.top-ti.top)*this.dragTransform.yScale,left:(ni.left-ti.left)*this.dragTransform.xScale}}}};xa.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];var Ml=class extends zo{constructor(ei,ti={}){super(),this.el=ei,this.option=ti,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(ei,ti){super.on(ei,ti)}off(ei){super.off(ei)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),$n&&(this.el.addEventListener("pointerenter",Zc),this.el.addEventListener("pointerleave",eu)))}disable(ei=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),ei||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),$n&&(this.el.removeEventListener("pointerenter",Zc),this.el.removeEventListener("pointerleave",eu)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(ei){return Object.keys(ei).forEach(ti=>this.option[ti]=ei[ti]),this._setupAccept(),this}_mouseEnter(ei){if(!Bi.dragElement||!this._canDrop(Bi.dragElement.el))return;ei.preventDefault(),ei.stopPropagation(),Bi.dropElement&&Bi.dropElement!==this&&Bi.dropElement._mouseLeave(ei,!0),Bi.dropElement=this;let ti=bi.initEvent(ei,{target:this.el,type:"dropover"});this.option.over&&this.option.over(ti,this._ui(Bi.dragElement)),this.triggerEvent("dropover",ti),this.el.classList.add("ui-droppable-over")}_mouseLeave(ei,ti=!1){var ri;if(!Bi.dragElement||Bi.dropElement!==this)return;ei.preventDefault(),ei.stopPropagation();let ni=bi.initEvent(ei,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(ni,this._ui(Bi.dragElement)),this.triggerEvent("dropout",ni),Bi.dropElement===this&&(delete Bi.dropElement,!ti)){let oi,si=this.el.parentElement;for(;!oi&&si;)oi=(ri=si.ddElement)==null?void 0:ri.ddDroppable,si=si.parentElement;oi&&oi._mouseEnter(ei)}}drop(ei){ei.preventDefault();let ti=bi.initEvent(ei,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(ti,this._ui(Bi.dragElement)),this.triggerEvent("drop",ti)}_canDrop(ei){return ei&&(!this.accept||this.accept(ei))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=ei=>ei.classList.contains(this.option.accept)||ei.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(ei){return Di({draggable:ei.el},ei.ui())}};var kl=class ii{static init(ei){return ei.ddElement||(ei.ddElement=new ii(ei)),ei.ddElement}constructor(ei){this.el=ei}on(ei,ti){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(ei)>-1?this.ddDraggable.on(ei,ti):this.ddDroppable&&["drop","dropover","dropout"].indexOf(ei)>-1?this.ddDroppable.on(ei,ti):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(ei)>-1&&this.ddResizable.on(ei,ti),this}off(ei){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(ei)>-1?this.ddDraggable.off(ei):this.ddDroppable&&["drop","dropover","dropout"].indexOf(ei)>-1?this.ddDroppable.off(ei):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(ei)>-1&&this.ddResizable.off(ei),this}setupDraggable(ei){return this.ddDraggable?this.ddDraggable.updateOption(ei):this.ddDraggable=new xa(this.el,ei),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(ei){return this.ddResizable?this.ddResizable.updateOption(ei):this.ddResizable=new wa(this.el,ei),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(ei){return this.ddDroppable?this.ddDroppable.updateOption(ei):this.ddDroppable=new Ml(this.el,ei),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Nl=class{resizable(ei,ti,ni,ri){return this._getDDElements(ei).forEach(oi=>{if(ti==="disable"||ti==="enable")oi.ddResizable&&oi.ddResizable[ti]();else if(ti==="destroy")oi.ddResizable&&oi.cleanResizable();else if(ti==="option")oi.setupResizable({[ni]:ri});else{let ai=oi.el.gridstackNode.grid,li=oi.el.getAttribute("gs-resize-handles")||ai.opts.resizable.handles||"e,s,se";li==="all"&&(li="n,e,s,w,se,sw,ne,nw");let ui=!ai.opts.alwaysShowResizeHandle;oi.setupResizable(sn(Di({},ai.opts.resizable),{handles:li,autoHide:ui,start:ti.start,stop:ti.stop,resize:ti.resize}))}}),this}draggable(ei,ti,ni,ri){return this._getDDElements(ei).forEach(oi=>{if(ti==="disable"||ti==="enable")oi.ddDraggable&&oi.ddDraggable[ti]();else if(ti==="destroy")oi.ddDraggable&&oi.cleanDraggable();else if(ti==="option")oi.setupDraggable({[ni]:ri});else{let si=oi.el.gridstackNode.grid;oi.setupDraggable(sn(Di({},si.opts.draggable),{start:ti.start,stop:ti.stop,drag:ti.drag}))}}),this}dragIn(ei,ti){return this._getDDElements(ei).forEach(ni=>ni.setupDraggable(ti)),this}droppable(ei,ti,ni,ri){return typeof ti.accept=="function"&&!ti._accept&&(ti._accept=ti.accept,ti.accept=oi=>ti._accept(oi)),this._getDDElements(ei).forEach(oi=>{ti==="disable"||ti==="enable"?oi.ddDroppable&&oi.ddDroppable[ti]():ti==="destroy"?oi.ddDroppable&&oi.cleanDroppable():ti==="option"?oi.setupDroppable({[ni]:ri}):oi.setupDroppable(ti)}),this}isDroppable(ei){var ti;return!!((ti=ei==null?void 0:ei.ddElement)!=null&&ti.ddDroppable&&!ei.ddElement.ddDroppable.disabled)}isDraggable(ei){var ti;return!!((ti=ei==null?void 0:ei.ddElement)!=null&&ti.ddDraggable&&!ei.ddElement.ddDraggable.disabled)}isResizable(ei){var ti;return!!((ti=ei==null?void 0:ei.ddElement)!=null&&ti.ddResizable&&!ei.ddElement.ddResizable.disabled)}on(ei,ti,ni){return this._getDDElements(ei).forEach(ri=>ri.on(ti,oi=>{ni(oi,Bi.dragElement?Bi.dragElement.el:oi.target,Bi.dragElement?Bi.dragElement.helper:null)})),this}off(ei,ti){return this._getDDElements(ei).forEach(ni=>ni.off(ti)),this}_getDDElements(ei,ti=!0){let ni=bi.getElements(ei);if(!ni.length)return[];let ri=ni.map(oi=>oi.ddElement||(ti?kl.init(oi):null));return ti||ri.filter(oi=>oi),ri}};var Bn=new Nl,Jr=class ii{static init(ei={},ti=".grid-stack"){if(typeof document=="undefined")return null;let ni=ii.getGridElement(ti);return ni?(ni.gridstack||(ni.gridstack=new ii(ni,bi.cloneDeep(ei))),ni.gridstack):(console.error(typeof ti=="string"?'GridStack.initAll() no grid was found with selector "'+ti+`" - element missing or wrong selector ? + `}}function Yi(){ti.calendarContainer.classList.add("hasWeeks");var fi=tn("div","flatpickr-weekwrapper");fi.appendChild(tn("span","flatpickr-weekday",ti.l10n.weekAbbreviation));var hi=tn("div","flatpickr-weeks");return fi.appendChild(hi),{weekWrapper:fi,weekNumbers:hi}}function Ri(fi,hi){hi===void 0&&(hi=!0);var mi=hi?fi:fi-ti.currentMonth;mi<0&&ti._hidePrevMonthArrow===!0||mi>0&&ti._hideNextMonthArrow===!0||(ti.currentMonth+=mi,(ti.currentMonth<0||ti.currentMonth>11)&&(ti.currentYear+=ti.currentMonth>11?1:-1,ti.currentMonth=(ti.currentMonth+12)%12,un("onYearChange"),Ji()),Qi(),un("onMonthChange"),Ca())}function Ii(fi,hi){if(fi===void 0&&(fi=!0),hi===void 0&&(hi=!0),ti.input.value="",ti.altInput!==void 0&&(ti.altInput.value=""),ti.mobileInput!==void 0&&(ti.mobileInput.value=""),ti.selectedDates=[],ti.latestSelectedDateObj=void 0,hi===!0&&(ti.currentYear=ti._initialDate.getFullYear(),ti.currentMonth=ti._initialDate.getMonth()),ti.config.enableTime===!0){var mi=Dl(ti.config),_i=mi.hours,Ti=mi.minutes,Ni=mi.seconds;yi(_i,Ti,Ni)}ti.redraw(),fi&&un("onChange")}function Ui(){ti.isOpen=!1,ti.isMobile||(ti.calendarContainer!==void 0&&ti.calendarContainer.classList.remove("open"),ti._input!==void 0&&ti._input.classList.remove("active")),un("onClose")}function ji(){ti.config!==void 0&&un("onDestroy");for(var fi=ti._handlers.length;fi--;)ti._handlers[fi].remove();if(ti._handlers=[],ti.mobileInput)ti.mobileInput.parentNode&&ti.mobileInput.parentNode.removeChild(ti.mobileInput),ti.mobileInput=void 0;else if(ti.calendarContainer&&ti.calendarContainer.parentNode)if(ti.config.static&&ti.calendarContainer.parentNode){var hi=ti.calendarContainer.parentNode;if(hi.lastChild&&hi.removeChild(hi.lastChild),hi.parentNode){for(;hi.firstChild;)hi.parentNode.insertBefore(hi.firstChild,hi);hi.parentNode.removeChild(hi)}}else ti.calendarContainer.parentNode.removeChild(ti.calendarContainer);ti.altInput&&(ti.input.type="text",ti.altInput.parentNode&&ti.altInput.parentNode.removeChild(ti.altInput),delete ti.altInput),ti.input&&(ti.input.type=ti.input._type,ti.input.classList.remove("flatpickr-input"),ti.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(mi){try{delete ti[mi]}catch(_i){}})}function Pi(fi){return ti.calendarContainer.contains(fi)}function ln(fi){if(ti.isOpen&&!ti.config.inline){var hi=Wn(fi),mi=Pi(hi),_i=hi===ti.input||hi===ti.altInput||ti.element.contains(hi)||fi.path&&fi.path.indexOf&&(~fi.path.indexOf(ti.input)||~fi.path.indexOf(ti.altInput)),Ti=!_i&&!mi&&!Pi(fi.relatedTarget),Ni=!ti.config.ignoredFocusElements.some(function(Ki){return Ki.contains(hi)});Ti&&Ni&&(ti.config.allowInput&&ti.setDate(ti._input.value,!1,ti.config.altInput?ti.config.altFormat:ti.config.dateFormat),ti.timeContainer!==void 0&&ti.minuteElement!==void 0&&ti.hourElement!==void 0&&ti.input.value!==""&&ti.input.value!==void 0&&li(),ti.close(),ti.config&&ti.config.mode==="range"&&ti.selectedDates.length===1&&ti.clear(!1))}}function kn(fi){if(!(!fi||ti.config.minDate&&fiti.config.maxDate.getFullYear())){var hi=fi,mi=ti.currentYear!==hi;ti.currentYear=hi||ti.currentYear,ti.config.maxDate&&ti.currentYear===ti.config.maxDate.getFullYear()?ti.currentMonth=Math.min(ti.config.maxDate.getMonth(),ti.currentMonth):ti.config.minDate&&ti.currentYear===ti.config.minDate.getFullYear()&&(ti.currentMonth=Math.max(ti.config.minDate.getMonth(),ti.currentMonth)),mi&&(ti.redraw(),un("onYearChange"),Ji())}}function yn(fi,hi){var mi;hi===void 0&&(hi=!0);var _i=ti.parseDate(fi,void 0,hi);if(ti.config.minDate&&_i&&Un(_i,ti.config.minDate,hi!==void 0?hi:!ti.minDateHasTime)<0||ti.config.maxDate&&_i&&Un(_i,ti.config.maxDate,hi!==void 0?hi:!ti.maxDateHasTime)>0)return!1;if(!ti.config.enable&&ti.config.disable.length===0)return!0;if(_i===void 0)return!1;for(var Ti=!!ti.config.enable,Ni=(mi=ti.config.enable)!==null&&mi!==void 0?mi:ti.config.disable,Ki=0,$i=void 0;Ki=$i.from.getTime()&&_i.getTime()<=$i.to.getTime())return Ti}return!Ti}function Cn(fi){return ti.daysContainer!==void 0?fi.className.indexOf("hidden")===-1&&fi.className.indexOf("flatpickr-disabled")===-1&&ti.daysContainer.contains(fi):!1}function $s(fi){var hi=fi.target===ti._input,mi=ti._input.value.trimEnd()!==Hl();hi&&mi&&!(fi.relatedTarget&&Pi(fi.relatedTarget))&&ti.setDate(ti._input.value,!0,fi.target===ti.altInput?ti.config.altFormat:ti.config.dateFormat)}function ro(fi){var hi=Wn(fi),mi=ti.config.wrap?ii.contains(hi):hi===ti._input,_i=ti.config.allowInput,Ti=ti.isOpen&&(!_i||!mi),Ni=ti.config.inline&&mi&&!_i;if(fi.keyCode===13&&mi){if(_i)return ti.setDate(ti._input.value,!0,hi===ti.altInput?ti.config.altFormat:ti.config.dateFormat),ti.close(),hi.blur();ti.open()}else if(Pi(hi)||Ti||Ni){var Ki=!!ti.timeContainer&&ti.timeContainer.contains(hi);switch(fi.keyCode){case 13:Ki?(fi.preventDefault(),li(),us()):ds(fi);break;case 27:fi.preventDefault(),us();break;case 8:case 46:mi&&!ti.config.allowInput&&(fi.preventDefault(),ti.clear());break;case 37:case 39:if(!Ki&&!mi){fi.preventDefault();var $i=oi();if(ti.daysContainer!==void 0&&(_i===!1||$i&&Cn($i))){var Xi=fi.keyCode===39?1:-1;fi.ctrlKey?(fi.stopPropagation(),Ri(Xi),qi(Mi(1),0)):qi(void 0,Xi)}}else ti.hourElement&&ti.hourElement.focus();break;case 38:case 40:fi.preventDefault();var Fi=fi.keyCode===40?1:-1;ti.daysContainer&&hi.$i!==void 0||hi===ti.input||hi===ti.altInput?fi.ctrlKey?(fi.stopPropagation(),kn(ti.currentYear-Fi),qi(Mi(1),0)):Ki||qi(void 0,Fi*7):hi===ti.currentYearElement?kn(ti.currentYear-Fi):ti.config.enableTime&&(!Ki&&ti.hourElement&&ti.hourElement.focus(),li(fi),ti._debouncedChange());break;case 9:if(Ki){var Gi=[ti.hourElement,ti.minuteElement,ti.secondElement,ti.amPM].concat(ti.pluginElements).filter(function(Kn){return Kn}),nn=Gi.indexOf(hi);if(nn!==-1){var oo=Gi[nn+(fi.shiftKey?-1:1)];fi.preventDefault(),(oo||ti._input).focus()}}else!ti.config.noCalendar&&ti.daysContainer&&ti.daysContainer.contains(hi)&&fi.shiftKey&&(fi.preventDefault(),ti._input.focus());break;default:break}}if(ti.amPM!==void 0&&hi===ti.amPM)switch(fi.key){case ti.l10n.amPM[0].charAt(0):case ti.l10n.amPM[0].charAt(0).toLowerCase():ti.amPM.textContent=ti.l10n.amPM[0],di(),lo();break;case ti.l10n.amPM[1].charAt(0):case ti.l10n.amPM[1].charAt(0).toLowerCase():ti.amPM.textContent=ti.l10n.amPM[1],di(),lo();break}(mi||Pi(hi))&&un("onKeyDown",fi)}function wo(fi,hi){if(hi===void 0&&(hi="flatpickr-day"),!(ti.selectedDates.length!==1||fi&&(!fi.classList.contains(hi)||fi.classList.contains("flatpickr-disabled")))){for(var mi=fi?fi.dateObj.getTime():ti.days.firstElementChild.dateObj.getTime(),_i=ti.parseDate(ti.selectedDates[0],void 0,!0).getTime(),Ti=Math.min(mi,ti.selectedDates[0].getTime()),Ni=Math.max(mi,ti.selectedDates[0].getTime()),Ki=!1,$i=0,Xi=0,Fi=Ti;FiTi&&Fi$i)?$i=Fi:Fi>_i&&(!Xi||Fi ."+hi));Gi.forEach(function(nn){var oo=nn.dateObj,Kn=oo.getTime(),Vs=$i>0&&Kn<$i||Xi>0&&Kn>Xi;if(Vs){nn.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(fs){nn.classList.remove(fs)});return}else if(Ki&&!Vs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(fs){nn.classList.remove(fs)}),fi!==void 0&&(fi.classList.add(mi<=ti.selectedDates[0].getTime()?"startRange":"endRange"),_imi&&Kn===_i&&nn.classList.add("endRange"),Kn>=$i&&(Xi===0||Kn<=Xi)&&mh(Kn,_i,mi)&&nn.classList.add("inRange"))})}}function bn(){ti.isOpen&&!ti.config.static&&!ti.config.inline&&Gn()}function xo(fi,hi){if(hi===void 0&&(hi=ti._positionElement),ti.isMobile===!0){if(fi){fi.preventDefault();var mi=Wn(fi);mi&&mi.blur()}ti.mobileInput!==void 0&&(ti.mobileInput.focus(),ti.mobileInput.click()),un("onOpen");return}else if(ti._input.disabled||ti.config.inline)return;var _i=ti.isOpen;ti.isOpen=!0,_i||(ti.calendarContainer.classList.add("open"),ti._input.classList.add("active"),un("onOpen"),Gn(hi)),ti.config.enableTime===!0&&ti.config.noCalendar===!0&&ti.config.allowInput===!1&&(fi===void 0||!ti.timeContainer.contains(fi.relatedTarget))&&setTimeout(function(){return ti.hourElement.select()},50)}function ao(fi){return function(hi){var mi=ti.config["_"+fi+"Date"]=ti.parseDate(hi,ti.config.dateFormat),_i=ti.config["_"+(fi==="min"?"max":"min")+"Date"];mi!==void 0&&(ti[fi==="min"?"minDateHasTime":"maxDateHasTime"]=mi.getHours()>0||mi.getMinutes()>0||mi.getSeconds()>0),ti.selectedDates&&(ti.selectedDates=ti.selectedDates.filter(function(Ti){return yn(Ti)}),!ti.selectedDates.length&&fi==="min"&&pi(mi),lo()),ti.daysContainer&&(Bs(),mi!==void 0?ti.currentYearElement[fi]=mi.getFullYear().toString():ti.currentYearElement.removeAttribute(fi),ti.currentYearElement.disabled=!!_i&&mi!==void 0&&_i.getFullYear()===mi.getFullYear())}}function ls(){var fi=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],hi=Hn(Hn({},JSON.parse(JSON.stringify(ii.dataset||{}))),ei),mi={};ti.config.parseDate=hi.parseDate,ti.config.formatDate=hi.formatDate,Object.defineProperty(ti.config,"enable",{get:function(){return ti.config._enable},set:function(Gi){ti.config._enable=nu(Gi)}}),Object.defineProperty(ti.config,"disable",{get:function(){return ti.config._disable},set:function(Gi){ti.config._disable=nu(Gi)}});var _i=hi.mode==="time";if(!hi.dateFormat&&(hi.enableTime||_i)){var Ti=xn.defaultConfig.dateFormat||Bo.dateFormat;mi.dateFormat=hi.noCalendar||_i?"H:i"+(hi.enableSeconds?":S":""):Ti+" H:i"+(hi.enableSeconds?":S":"")}if(hi.altInput&&(hi.enableTime||_i)&&!hi.altFormat){var Ni=xn.defaultConfig.altFormat||Bo.altFormat;mi.altFormat=hi.noCalendar||_i?"h:i"+(hi.enableSeconds?":S K":" K"):Ni+(" h:i"+(hi.enableSeconds?":S":"")+" K")}Object.defineProperty(ti.config,"minDate",{get:function(){return ti.config._minDate},set:ao("min")}),Object.defineProperty(ti.config,"maxDate",{get:function(){return ti.config._maxDate},set:ao("max")});var Ki=function(Gi){return function(nn){ti.config[Gi==="min"?"_minTime":"_maxTime"]=ti.parseDate(nn,"H:i:S")}};Object.defineProperty(ti.config,"minTime",{get:function(){return ti.config._minTime},set:Ki("min")}),Object.defineProperty(ti.config,"maxTime",{get:function(){return ti.config._maxTime},set:Ki("max")}),hi.mode==="time"&&(ti.config.noCalendar=!0,ti.config.enableTime=!0),Object.assign(ti.config,mi,hi);for(var $i=0;$i-1?ti.config[Fi]=Sl(Xi[Fi]).map(si).concat(ti.config[Fi]):typeof hi[Fi]=="undefined"&&(ti.config[Fi]=Xi[Fi])}hi.altInputClass||(ti.config.altInputClass=On().className+" "+ti.config.altInputClass),un("onParseConfig")}function On(){return ti.config.wrap?ii.querySelector("[data-input]"):ii}function zn(){typeof ti.config.locale!="object"&&typeof xn.l10ns[ti.config.locale]=="undefined"&&ti.config.errorHandler(new Error("flatpickr: invalid locale "+ti.config.locale)),ti.l10n=Hn(Hn({},xn.l10ns.default),typeof ti.config.locale=="object"?ti.config.locale:ti.config.locale!=="default"?xn.l10ns[ti.config.locale]:void 0),Eo.D="("+ti.l10n.weekdays.shorthand.join("|")+")",Eo.l="("+ti.l10n.weekdays.longhand.join("|")+")",Eo.M="("+ti.l10n.months.shorthand.join("|")+")",Eo.F="("+ti.l10n.months.longhand.join("|")+")",Eo.K="("+ti.l10n.amPM[0]+"|"+ti.l10n.amPM[1]+"|"+ti.l10n.amPM[0].toLowerCase()+"|"+ti.l10n.amPM[1].toLowerCase()+")";var fi=Hn(Hn({},ei),JSON.parse(JSON.stringify(ii.dataset||{})));fi.time_24hr===void 0&&xn.defaultConfig.time_24hr===void 0&&(ti.config.time_24hr=ti.l10n.time_24hr),ti.formatDate=Qc(ti),ti.parseDate=Cl({config:ti.config,l10n:ti.l10n})}function Gn(fi){if(typeof ti.config.position=="function")return void ti.config.position(ti,fi);if(ti.calendarContainer!==void 0){un("onPreCalendarPosition");var hi=fi||ti._positionElement,mi=Array.prototype.reduce.call(ti.calendarContainer.children,function(Kh,Qh){return Kh+Qh.offsetHeight},0),_i=ti.calendarContainer.offsetWidth,Ti=ti.config.position.split(" "),Ni=Ti[0],Ki=Ti.length>1?Ti[1]:null,$i=hi.getBoundingClientRect(),Xi=window.innerHeight-$i.bottom,Fi=Ni==="above"||Ni!=="below"&&Ximi,Gi=window.pageYOffset+$i.top+(Fi?-mi-2:hi.offsetHeight+2);if(In(ti.calendarContainer,"arrowTop",!Fi),In(ti.calendarContainer,"arrowBottom",Fi),!ti.config.inline){var nn=window.pageXOffset+$i.left,oo=!1,Kn=!1;Ki==="center"?(nn-=(_i-$i.width)/2,oo=!0):Ki==="right"&&(nn-=_i-$i.width,Kn=!0),In(ti.calendarContainer,"arrowLeft",!oo&&!Kn),In(ti.calendarContainer,"arrowCenter",oo),In(ti.calendarContainer,"arrowRight",Kn);var Vs=window.document.body.offsetWidth-(window.pageXOffset+$i.right),fs=nn+_i>window.document.body.offsetWidth,Vh=Vs+_i>window.document.body.offsetWidth;if(In(ti.calendarContainer,"rightMost",fs),!ti.config.static)if(ti.calendarContainer.style.top=Gi+"px",!fs)ti.calendarContainer.style.left=nn+"px",ti.calendarContainer.style.right="auto";else if(!Vh)ti.calendarContainer.style.left="auto",ti.calendarContainer.style.right=Vs+"px";else{var Pl=Jn();if(Pl===void 0)return;var jh=window.document.body.offsetWidth,qh=Math.max(0,jh/2-_i/2),Wh=".flatpickr-calendar.centerMost:before",Uh=".flatpickr-calendar.centerMost:after",Yh=Pl.cssRules.length,Gh="{left:"+$i.left+"px;right:auto;}";In(ti.calendarContainer,"rightMost",!1),In(ti.calendarContainer,"centerMost",!0),Pl.insertRule(Wh+","+Uh+Gh,Yh),ti.calendarContainer.style.left=qh+"px",ti.calendarContainer.style.right="auto"}}}}function Jn(){for(var fi=null,hi=0;hiti.currentMonth+ti.config.showMonths-1)&&ti.config.mode!=="range";if(ti.selectedDateElem=_i,ti.config.mode==="single")ti.selectedDates=[Ti];else if(ti.config.mode==="multiple"){var Ki=Il(Ti);Ki?ti.selectedDates.splice(parseInt(Ki),1):ti.selectedDates.push(Ti)}else ti.config.mode==="range"&&(ti.selectedDates.length===2&&ti.clear(!1,!1),ti.latestSelectedDateObj=Ti,ti.selectedDates.push(Ti),Un(Ti,ti.selectedDates[0],!0)!==0&&ti.selectedDates.sort(function(Gi,nn){return Gi.getTime()-nn.getTime()}));if(di(),Ni){var $i=ti.currentYear!==Ti.getFullYear();ti.currentYear=Ti.getFullYear(),ti.currentMonth=Ti.getMonth(),$i&&(un("onYearChange"),Ji()),un("onMonthChange")}if(Ca(),Qi(),lo(),!Ni&&ti.config.mode!=="range"&&ti.config.showMonths===1?ki(_i):ti.selectedDateElem!==void 0&&ti.hourElement===void 0&&ti.selectedDateElem&&ti.selectedDateElem.focus(),ti.hourElement!==void 0&&ti.hourElement!==void 0&&ti.hourElement.focus(),ti.config.closeOnSelect){var Xi=ti.config.mode==="single"&&!ti.config.enableTime,Fi=ti.config.mode==="range"&&ti.selectedDates.length===2&&!ti.config.enableTime;(Xi||Fi)&&us()}Ei()}}var Vo={locale:[zn,vn],showMonths:[rn,ai,Mn],minDate:[xi],maxDate:[xi],positionElement:[ru],clickOpens:[function(){ti.config.clickOpens===!0?(vi(ti._input,"focus",ti.open),vi(ti._input,"click",ti.open)):(ti._input.removeEventListener("focus",ti.open),ti._input.removeEventListener("click",ti.open))}]};function Ta(fi,hi){if(fi!==null&&typeof fi=="object"){Object.assign(ti.config,fi);for(var mi in fi)Vo[mi]!==void 0&&Vo[mi].forEach(function(_i){return _i()})}else ti.config[fi]=hi,Vo[fi]!==void 0?Vo[fi].forEach(function(_i){return _i()}):wl.indexOf(fi)>-1&&(ti.config[fi]=Sl(hi));ti.redraw(),lo(!0)}function zs(fi,hi){var mi=[];if(fi instanceof Array)mi=fi.map(function(_i){return ti.parseDate(_i,hi)});else if(fi instanceof Date||typeof fi=="number")mi=[ti.parseDate(fi,hi)];else if(typeof fi=="string")switch(ti.config.mode){case"single":case"time":mi=[ti.parseDate(fi,hi)];break;case"multiple":mi=fi.split(ti.config.conjunction).map(function(_i){return ti.parseDate(_i,hi)});break;case"range":mi=fi.split(ti.l10n.rangeSeparator).map(function(_i){return ti.parseDate(_i,hi)});break;default:break}else ti.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(fi)));ti.selectedDates=ti.config.allowInvalidPreload?mi:mi.filter(function(_i){return _i instanceof Date&&yn(_i,!1)}),ti.config.mode==="range"&&ti.selectedDates.sort(function(_i,Ti){return _i.getTime()-Ti.getTime()})}function Sa(fi,hi,mi){if(hi===void 0&&(hi=!1),mi===void 0&&(mi=ti.config.dateFormat),fi!==0&&!fi||fi instanceof Array&&fi.length===0)return ti.clear(hi);zs(fi,mi),ti.latestSelectedDateObj=ti.selectedDates[ti.selectedDates.length-1],ti.redraw(),xi(void 0,hi),pi(),ti.selectedDates.length===0&&ti.clear(!1),lo(hi),hi&&un("onChange")}function nu(fi){return fi.slice().map(function(hi){return typeof hi=="string"||typeof hi=="number"||hi instanceof Date?ti.parseDate(hi,void 0,!0):hi&&typeof hi=="object"&&hi.from&&hi.to?{from:ti.parseDate(hi.from,void 0),to:ti.parseDate(hi.to,void 0)}:hi}).filter(function(hi){return hi})}function Ih(){ti.selectedDates=[],ti.now=ti.parseDate(ti.config.now)||new Date;var fi=ti.config.defaultDate||((ti.input.nodeName==="INPUT"||ti.input.nodeName==="TEXTAREA")&&ti.input.placeholder&&ti.input.value===ti.input.placeholder?null:ti.input.value);fi&&zs(fi,ti.config.dateFormat),ti._initialDate=ti.selectedDates.length>0?ti.selectedDates[0]:ti.config.minDate&&ti.config.minDate.getTime()>ti.now.getTime()?ti.config.minDate:ti.config.maxDate&&ti.config.maxDate.getTime()0&&(ti.latestSelectedDateObj=ti.selectedDates[0]),ti.config.minTime!==void 0&&(ti.config.minTime=ti.parseDate(ti.config.minTime,"H:i")),ti.config.maxTime!==void 0&&(ti.config.maxTime=ti.parseDate(ti.config.maxTime,"H:i")),ti.minDateHasTime=!!ti.config.minDate&&(ti.config.minDate.getHours()>0||ti.config.minDate.getMinutes()>0||ti.config.minDate.getSeconds()>0),ti.maxDateHasTime=!!ti.config.maxDate&&(ti.config.maxDate.getHours()>0||ti.config.maxDate.getMinutes()>0||ti.config.maxDate.getSeconds()>0)}function Hh(){if(ti.input=On(),!ti.input){ti.config.errorHandler(new Error("Invalid input element specified"));return}ti.input._type=ti.input.type,ti.input.type="text",ti.input.classList.add("flatpickr-input"),ti._input=ti.input,ti.config.altInput&&(ti.altInput=tn(ti.input.nodeName,ti.config.altInputClass),ti._input=ti.altInput,ti.altInput.placeholder=ti.input.placeholder,ti.altInput.disabled=ti.input.disabled,ti.altInput.required=ti.input.required,ti.altInput.tabIndex=ti.input.tabIndex,ti.altInput.type="text",ti.input.setAttribute("type","hidden"),!ti.config.static&&ti.input.parentNode&&ti.input.parentNode.insertBefore(ti.altInput,ti.input.nextSibling)),ti.config.allowInput||ti._input.setAttribute("readonly","readonly"),ru()}function ru(){ti._positionElement=ti.config.positionElement||ti._input}function Ph(){var fi=ti.config.enableTime?ti.config.noCalendar?"time":"datetime-local":"date";ti.mobileInput=tn("input",ti.input.className+" flatpickr-mobile"),ti.mobileInput.tabIndex=1,ti.mobileInput.type=fi,ti.mobileInput.disabled=ti.input.disabled,ti.mobileInput.required=ti.input.required,ti.mobileInput.placeholder=ti.input.placeholder,ti.mobileFormatStr=fi==="datetime-local"?"Y-m-d\\TH:i:S":fi==="date"?"Y-m-d":"H:i:S",ti.selectedDates.length>0&&(ti.mobileInput.defaultValue=ti.mobileInput.value=ti.formatDate(ti.selectedDates[0],ti.mobileFormatStr)),ti.config.minDate&&(ti.mobileInput.min=ti.formatDate(ti.config.minDate,"Y-m-d")),ti.config.maxDate&&(ti.mobileInput.max=ti.formatDate(ti.config.maxDate,"Y-m-d")),ti.input.getAttribute("step")&&(ti.mobileInput.step=String(ti.input.getAttribute("step"))),ti.input.type="hidden",ti.altInput!==void 0&&(ti.altInput.type="hidden");try{ti.input.parentNode&&ti.input.parentNode.insertBefore(ti.mobileInput,ti.input.nextSibling)}catch(hi){}vi(ti.mobileInput,"change",function(hi){ti.setDate(Wn(hi).value,!1,ti.mobileFormatStr),un("onChange"),un("onClose")})}function Fh(fi){if(ti.isOpen===!0)return ti.close();ti.open(fi)}function un(fi,hi){if(ti.config!==void 0){var mi=ti.config[fi];if(mi!==void 0&&mi.length>0)for(var _i=0;mi[_i]&&_i=0&&Un(fi,ti.selectedDates[1])<=0}function Ca(){ti.config.noCalendar||ti.isMobile||!ti.monthNav||(ti.yearElements.forEach(function(fi,hi){var mi=new Date(ti.currentYear,ti.currentMonth,1);mi.setMonth(ti.currentMonth+hi),ti.config.showMonths>1||ti.config.monthSelectorType==="static"?ti.monthElements[hi].textContent=_a(mi.getMonth(),ti.config.shorthandCurrentMonth,ti.l10n)+" ":ti.monthsDropdownContainer.value=mi.getMonth().toString(),fi.value=mi.getFullYear().toString()}),ti._hidePrevMonthArrow=ti.config.minDate!==void 0&&(ti.currentYear===ti.config.minDate.getFullYear()?ti.currentMonth<=ti.config.minDate.getMonth():ti.currentYearti.config.maxDate.getMonth():ti.currentYear>ti.config.maxDate.getFullYear()))}function Hl(fi){var hi=fi||(ti.config.altInput?ti.config.altFormat:ti.config.dateFormat);return ti.selectedDates.map(function(mi){return ti.formatDate(mi,hi)}).filter(function(mi,_i,Ti){return ti.config.mode!=="range"||ti.config.enableTime||Ti.indexOf(mi)===_i}).join(ti.config.mode!=="range"?ti.config.conjunction:ti.l10n.rangeSeparator)}function lo(fi){fi===void 0&&(fi=!0),ti.mobileInput!==void 0&&ti.mobileFormatStr&&(ti.mobileInput.value=ti.latestSelectedDateObj!==void 0?ti.formatDate(ti.latestSelectedDateObj,ti.mobileFormatStr):""),ti.input.value=Hl(ti.config.dateFormat),ti.altInput!==void 0&&(ti.altInput.value=Hl(ti.config.altFormat)),fi!==!1&&un("onValueUpdate")}function Bh(fi){var hi=Wn(fi),mi=ti.prevMonthNav.contains(hi),_i=ti.nextMonthNav.contains(hi);mi||_i?Ri(mi?-1:1):ti.yearElements.indexOf(hi)>=0?hi.select():hi.classList.contains("arrowUp")?ti.changeYear(ti.currentYear+1):hi.classList.contains("arrowDown")&&ti.changeYear(ti.currentYear-1)}function zh(fi){fi.preventDefault();var hi=fi.type==="keydown",mi=Wn(fi),_i=mi;ti.amPM!==void 0&&mi===ti.amPM&&(ti.amPM.textContent=ti.l10n.amPM[qn(ti.amPM.textContent===ti.l10n.amPM[0])]);var Ti=parseFloat(_i.getAttribute("min")),Ni=parseFloat(_i.getAttribute("max")),Ki=parseFloat(_i.getAttribute("step")),$i=parseInt(_i.value,10),Xi=fi.delta||(hi?fi.which===38?1:-1:0),Fi=$i+Ki*Xi;if(typeof _i.value!="undefined"&&_i.value.length===2){var Gi=_i===ti.hourElement,nn=_i===ti.minuteElement;FiNi&&(Fi=_i===ti.hourElement?Fi-Ni-qn(!ti.amPM):Ti,nn&&Oi(void 0,1,ti.hourElement)),ti.amPM&&Gi&&(Ki===1?Fi+$i===23:Math.abs(Fi-$i)>Ki)&&(ti.amPM.textContent=ti.l10n.amPM[qn(ti.amPM.textContent===ti.l10n.amPM[0])]),_i.value=Rn(Fi)}}return ri(),ti}function Ns(ii,ei){for(var ti=Array.prototype.slice.call(ii).filter(function(si){return si instanceof HTMLElement}),ni=[],ri=0;ri option"))if(ei.selected){for(let ti of Hi("#id_columns"))ti.appendChild(ei.cloneNode(!0));ei.remove()}ii.preventDefault()}function z_(ii){for(let ei of Hi("#id_columns > option"))if(ei.selected){for(let ti of Hi("#id_available_columns"))ti.appendChild(ei.cloneNode(!0));ei.remove()}ii.preventDefault()}function _h(ii,ei){return co(this,null,function*(){return yield Ls(ii,ei)})}function V_(ii){var li,ui,ci;ii.preventDefault();let ei=ii.currentTarget,ti=ei.getAttribute("data-url");if(ti==null){Po("danger","Error Updating Table Configuration","No API path defined for configuration form.").show();return}let ni=((li=document.activeElement)==null?void 0:li.getAttribute("value"))==="Reset",ri=(ci=(ui=ei.getAttribute("data-config-root"))==null?void 0:ui.split("."))!=null?ci:[];if(ni){let di=ri.reduceRight((pi,yi)=>({[yi]:pi}),{});_h(ti,di).then(pi=>{rs(pi)?Po("danger","Error Resetting Table Configuration",pi.error).show():location.reload()});return}let oi=yf(ei,"select[name=columns]"),si=Object.assign({},...oi.map(di=>({[di.name]:di.options}))),ai=ri.reduceRight((di,pi)=>({[pi]:di}),si);_h(ti,ai).then(di=>{rs(di)?Po("danger","Error Updating Table Configuration",di.error).show():location.reload()})}function Eh(){for(let ii of Hi("#save_tableconfig"))ii.addEventListener("click",$_);for(let ii of Hi("#add_columns"))ii.addEventListener("click",B_);for(let ii of Hi("#remove_columns"))ii.addEventListener("click",z_);for(let ii of Hi("form.userconfigform"))ii.addEventListener("submit",V_)}function wh(ii){return typeof ii=="string"&&["show","hide"].includes(ii)}var ss=class extends Error{constructor(ti,ni){super(ti);en(this,"table");this.table=ni}},Rs=class{constructor(ei,ti){en(this,"button");en(this,"rows");this.button=ei,this.rows=ti}hideRows(){for(let ei of this.rows)ei.classList.add("d-none")}set buttonState(ei){wh(ei)&&this.button.setAttribute("data-state",ei)}get buttonState(){let ei=this.button.getAttribute("data-state");return wh(ei)?ei:null}toggleButton(){this.buttonState==="show"?this.button.innerText=Ms(this.button.innerText,"Show","Hide"):this.buttonState==="hide"&&(this.button.innerText=Ms(this.button.innerHTML,"Hide","Show"))}toggleState(){this.buttonState==="show"?this.buttonState="hide":this.buttonState==="hide"&&(this.buttonState="show")}toggle(){this.toggleState(),this.toggleButton()}handleClick(ei){ei.currentTarget.isEqualNode(this.button)&&this.toggle(),this.buttonState==="hide"&&this.hideRows()}},Xc=class{constructor(ei){en(this,"table");en(this,"enabledButton");en(this,"disabledButton");en(this,"virtualButton");en(this,"disconnectedButton");en(this,"rows");this.table=ei,this.rows=this.table.querySelectorAll("tr");try{let ti=os(this.table,"button.toggle-enabled"),ni=os(this.table,"button.toggle-disabled"),ri=os(this.table,"button.toggle-virtual"),oi=os(this.table,"button.toggle-disconnected");if(ti===null)throw new ss("Table is missing a 'toggle-enabled' button.",ei);if(ni===null)throw new ss("Table is missing a 'toggle-disabled' button.",ei);if(ri===null)throw new ss("Table is missing a 'toggle-virtual' button.",ei);if(oi===null)throw new ss("Table is missing a 'toggle-disconnected' button.",ei);ti.addEventListener("click",si=>this.handleClick(si,this)),ni.addEventListener("click",si=>this.handleClick(si,this)),ri.addEventListener("click",si=>this.handleClick(si,this)),oi.addEventListener("click",si=>this.handleClick(si,this)),this.enabledButton=new Rs(ti,ei.querySelectorAll('tr[data-enabled="enabled"]')),this.disabledButton=new Rs(ni,ei.querySelectorAll('tr[data-enabled="disabled"]')),this.virtualButton=new Rs(ri,ei.querySelectorAll('tr[data-type="virtual"]')),this.disconnectedButton=new Rs(oi,ei.querySelectorAll('tr[data-connected="disconnected"]'))}catch(ti){if(ti instanceof ss){console.debug("Table does not contain enable/disable toggle buttons");return}else throw ti}}handleClick(ei,ti){for(let ni of this.rows)ni.classList.remove("d-none");ti.enabledButton.handleClick(ei),ti.disabledButton.handleClick(ei),ti.virtualButton.handleClick(ei),ti.disconnectedButton.handleClick(ei)}};function xh(){for(let ii of Hi("table"))new Xc(ii)}var Jc=class{constructor(ei){en(this,"base");en(this,"state");en(this,"activeLink",null);en(this,"sections",[]);this.base=ei,this.state=new ga({pinned:!0},{persist:!0,key:"netbox-sidenav"}),this.init(),this.initSectionLinks(),this.initLinks()}bodyHas(ei){return document.body.hasAttribute(`data-sidenav-${ei}`)}bodyRemove(...ei){for(let ti of ei)document.body.removeAttribute(`data-sidenav-${ti}`)}bodyAdd(...ei){for(let ti of ei)document.body.setAttribute(`data-sidenav-${ti}`,"")}init(){for(let ei of this.base.querySelectorAll(".sidenav-toggle"))ei.addEventListener("click",ti=>this.onToggle(ti));for(let ei of Hi(".sidenav-toggle-mobile"))ei.addEventListener("click",ti=>this.onMobileToggle(ti));window.innerWidth>1200&&(this.state.get("pinned")&&this.pin(),this.state.get("pinned")||this.unpin(),window.addEventListener("resize",()=>this.onResize())),window.innerWidth<1200&&(this.bodyRemove("hide"),this.bodyAdd("hidden"),window.addEventListener("resize",()=>this.onResize())),this.base.addEventListener("mouseenter",()=>this.onEnter()),this.base.addEventListener("mouseleave",()=>this.onLeave())}initLinks(){for(let ei of this.getActiveLinks())this.bodyHas("show")?this.activateLink(ei,"expand"):this.bodyHas("hidden")&&this.activateLink(ei,"collapse")}show(){this.bodyAdd("show"),this.bodyRemove("hidden","hide")}hide(){this.bodyAdd("hidden"),this.bodyRemove("pinned","show");for(let ei of this.base.querySelectorAll(".collapse"))ei.classList.remove("show")}pin(){this.bodyAdd("show","pinned"),this.bodyRemove("hidden"),this.state.set("pinned",!0)}unpin(){this.bodyRemove("pinned","show"),this.bodyAdd("hidden");for(let ei of this.base.querySelectorAll(".collapse"))ei.classList.remove("show");this.state.set("pinned",!1)}handleSectionClick(ei){ei.preventDefault();let ti=ei.target;this.activeLink=ti,this.closeInactiveSections()}closeInactiveSections(){for(let[ei,ti]of this.sections)ei!==this.activeLink&&(ei.classList.add("collapsed"),ei.setAttribute("aria-expanded","false"),ti.hide())}initSectionLinks(){for(let ei of Hi(".navbar-nav .nav-item .nav-link[data-bs-toggle]"))if(ei.parentElement!==null){let ti=ei.parentElement.querySelector(".collapse");if(ti!==null){let ni=new Oo(ti,{toggle:!1});this.sections.push([ei,ni]),ei.addEventListener("click",ri=>this.handleSectionClick(ri))}}}activateLink(ei,ti){var ri;let ni=ei.closest(".dropdown-menu");if(fl(ni)){let oi=ni.parentElement,si=(ri=ni.parentElement)==null?void 0:ri.querySelector(".nav-link");if(fl(si)&&fl(oi))switch(ti){case"expand":si.setAttribute("aria-expanded","true"),oi.classList.add("active"),ni.classList.add("show"),ei.classList.add("active");break;case"collapse":si.setAttribute("aria-expanded","false"),oi.classList.remove("active"),ni.classList.remove("show"),ei.classList.remove("active");break}}}*getActiveLinks(){for(let ei of this.base.querySelectorAll("ul.navbar-nav .nav-item .dropdown-item")){let ti=ei.querySelector("a");if(ti){let ni=new RegExp(ti.href,"gi");window.location.href.match(ni)&&(yield ei)}}}onEnter(){if(!this.bodyHas("pinned")){this.bodyRemove("hide","hidden"),this.bodyAdd("show");for(let ei of this.getActiveLinks())this.activateLink(ei,"expand")}}onLeave(){if(!this.bodyHas("pinned")){this.bodyRemove("show"),this.bodyAdd("hide");for(let ei of this.getActiveLinks())this.activateLink(ei,"collapse");this.bodyRemove("hide"),this.bodyAdd("hidden")}}onResize(){this.bodyHas("show")&&!this.bodyHas("pinned")&&(this.bodyRemove("show"),this.bodyAdd("hidden"))}onToggle(ei){ei.preventDefault(),this.state.get("pinned")?this.unpin():this.pin()}onMobileToggle(ei){ei.preventDefault(),this.bodyHas("hidden")?this.show():this.hide()}};function Th(){for(let ii of Hi(".navbar"))new Jc(ii)}function Sh(ii,ei,ti,ni,ri){let oi=(...si)=>(console.warn("gridstack.js: Function `"+ti+"` is deprecated in "+ri+" and has been replaced with `"+ni+"`. It will be **removed** in a future release"),ei.apply(ii,si));return oi.prototype=ei.prototype,oi}var bi=class ii{static getElements(ei,ti=document){if(typeof ei=="string"){let ni="getElementById"in ti?ti:void 0;if(ni&&!isNaN(+ei[0])){let oi=ni.getElementById(ei);return oi?[oi]:[]}let ri=ti.querySelectorAll(ei);return!ri.length&&ei[0]!=="."&&ei[0]!=="#"&&(ri=ti.querySelectorAll("."+ei),ri.length||(ri=ti.querySelectorAll("#"+ei))),Array.from(ri)}return[ei]}static getElement(ei,ti=document){if(typeof ei=="string"){let ni="getElementById"in ti?ti:void 0;if(!ei.length)return null;if(ni&&ei[0]==="#")return ni.getElementById(ei.substring(1));if(ei[0]==="#"||ei[0]==="."||ei[0]==="[")return ti.querySelector(ei);if(ni&&!isNaN(+ei[0]))return ni.getElementById(ei);let ri=ti.querySelector(ei);return ni&&!ri&&(ri=ni.getElementById(ei)),ri||(ri=ti.querySelector("."+ei)),ri}return ei}static createWidgetDivs(ei,ti){var si,ai;let ni=ii.createDiv(["grid-stack-item",ei]),ri=ii.createDiv(["grid-stack-item-content"],ni);return ti.lazyLoad||((ai=(si=ti.grid)==null?void 0:si.opts)==null?void 0:ai.lazyLoad)&&ti.lazyLoad!==!1?ti.visibleObservable||(ti.visibleObservable=new IntersectionObserver(([li])=>{var ui;li.isIntersecting&&((ui=ti.visibleObservable)==null||ui.disconnect(),delete ti.visibleObservable,Jr.renderCB(ri,ti))}),window.setTimeout(()=>{var li;return(li=ti.visibleObservable)==null?void 0:li.observe(ni)})):Jr.renderCB(ri,ti),ni}static createDiv(ei,ti){let ni=document.createElement("div");return ei.forEach(ri=>{ri&&ni.classList.add(ri)}),ti==null||ti.appendChild(ni),ni}static shouldSizeToContent(ei,ti=!1){return(ei==null?void 0:ei.grid)&&(ti?ei.sizeToContent===!0||ei.grid.opts.sizeToContent===!0&&ei.sizeToContent===void 0:!!ei.sizeToContent||ei.grid.opts.sizeToContent&&ei.sizeToContent!==!1)}static isIntercepted(ei,ti){return!(ei.y>=ti.y+ti.h||ei.y+ei.h<=ti.y||ei.x+ei.w<=ti.x||ei.x>=ti.x+ti.w)}static isTouching(ei,ti){return ii.isIntercepted(ei,{x:ti.x-.5,y:ti.y-.5,w:ti.w+1,h:ti.h+1})}static areaIntercept(ei,ti){let ni=ei.x>ti.x?ei.x:ti.x,ri=ei.x+ei.wti.y?ei.y:ti.y,si=ei.y+ei.h{var ai,li,ui,ci;let si=ti*(((ai=ri.y)!=null?ai:1e4)-((li=oi.y)!=null?li:1e4));return si===0?ti*(((ui=ri.x)!=null?ui:1e4)-((ci=oi.x)!=null?ci:1e4)):si})}static find(ei,ti){return ti?ei.find(ni=>ni.id===ti):void 0}static createStylesheet(ei,ti,ni){let ri=document.createElement("style"),oi=ni==null?void 0:ni.nonce;return oi&&(ri.nonce=oi),ri.setAttribute("type","text/css"),ri.setAttribute("gs-style-id",ei),ri.styleSheet?ri.styleSheet.cssText="":ri.appendChild(document.createTextNode("")),ti?ti.insertBefore(ri,ti.firstChild):(ti=document.getElementsByTagName("head")[0],ti.appendChild(ri)),ri}static removeStylesheet(ei,ti){let ri=(ti||document).querySelector("STYLE[gs-style-id="+ei+"]");ri&&ri.parentNode&&ri.remove()}static addCSSRule(ei,ti,ni){ei.textContent+=`${ti} { ${ni} } `}static toBool(ei){return typeof ei=="boolean"?ei:typeof ei=="string"?(ei=ei.toLowerCase(),!(ei===""||ei==="no"||ei==="false"||ei==="0")):!!ei}static toNumber(ei){return ei===null||ei.length===0?void 0:Number(ei)}static parseHeight(ei){let ti,ni="px";if(typeof ei=="string")if(ei==="auto"||ei==="")ti=0;else{let ri=ei.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!ri)throw new Error(`Invalid height val = ${ei}`);ni=ri[2]||"px",ti=parseFloat(ri[1])}else ti=ei;return{h:ti,unit:ni}}static defaults(ei,...ti){return ti.forEach(ni=>{for(let ri in ni){if(!ni.hasOwnProperty(ri))return;ei[ri]===null||ei[ri]===void 0?ei[ri]=ni[ri]:typeof ni[ri]=="object"&&typeof ei[ri]=="object"&&this.defaults(ei[ri],ni[ri])}}),ei}static same(ei,ti){if(typeof ei!="object")return ei==ti;if(typeof ei!=typeof ti||Object.keys(ei).length!==Object.keys(ti).length)return!1;for(let ni in ei)if(ei[ni]!==ti[ni])return!1;return!0}static copyPos(ei,ti,ni=!1){return ti.x!==void 0&&(ei.x=ti.x),ti.y!==void 0&&(ei.y=ti.y),ti.w!==void 0&&(ei.w=ti.w),ti.h!==void 0&&(ei.h=ti.h),ni&&(ti.minW&&(ei.minW=ti.minW),ti.minH&&(ei.minH=ti.minH),ti.maxW&&(ei.maxW=ti.maxW),ti.maxH&&(ei.maxH=ti.maxH)),ei}static samePos(ei,ti){return ei&&ti&&ei.x===ti.x&&ei.y===ti.y&&(ei.w||1)===(ti.w||1)&&(ei.h||1)===(ti.h||1)}static sanitizeMinMax(ei){ei.minW||delete ei.minW,ei.minH||delete ei.minH,ei.maxW||delete ei.maxW,ei.maxH||delete ei.maxH}static removeInternalAndSame(ei,ti){if(!(typeof ei!="object"||typeof ti!="object"))for(let ni in ei){let ri=ei[ni],oi=ti[ni];ni[0]==="_"||ri===oi?delete ei[ni]:ri&&typeof ri=="object"&&oi!==void 0&&(ii.removeInternalAndSame(ri,oi),Object.keys(ri).length||delete ei[ni])}}static removeInternalForSave(ei,ti=!0){for(let ni in ei)(ni[0]==="_"||ei[ni]===null||ei[ni]===void 0)&&delete ei[ni];delete ei.grid,ti&&delete ei.el,ei.autoPosition||delete ei.autoPosition,ei.noResize||delete ei.noResize,ei.noMove||delete ei.noMove,ei.locked||delete ei.locked,(ei.w===1||ei.w===ei.minW)&&delete ei.w,(ei.h===1||ei.h===ei.minH)&&delete ei.h}static throttle(ei,ti){let ni=!1;return(...ri)=>{ni||(ni=!0,setTimeout(()=>{ei(...ri),ni=!1},ti))}}static removePositioningStyles(ei){let ti=ei.style;ti.position&&ti.removeProperty("position"),ti.left&&ti.removeProperty("left"),ti.top&&ti.removeProperty("top"),ti.width&&ti.removeProperty("width"),ti.height&&ti.removeProperty("height")}static getScrollElement(ei){if(!ei)return document.scrollingElement||document.documentElement;let ti=getComputedStyle(ei);return/(auto|scroll)/.test(ti.overflow+ti.overflowY)?ei:this.getScrollElement(ei.parentElement)}static updateScrollPosition(ei,ti,ni){let ri=ei.getBoundingClientRect(),oi=window.innerHeight||document.documentElement.clientHeight;if(ri.top<0||ri.bottom>oi){let si=ri.bottom-oi,ai=ri.top,li=this.getScrollElement(ei);if(li!==null){let ui=li.scrollTop;ri.top<0&&ni<0?ei.offsetHeight>oi?li.scrollTop+=ni:li.scrollTop+=Math.abs(ai)>Math.abs(ni)?ni:ai:ni>0&&(ei.offsetHeight>oi?li.scrollTop+=ni:li.scrollTop+=si>ni?ni:si),ti.top+=li.scrollTop-ui}}}static updateScrollResize(ei,ti,ni){let ri=this.getScrollElement(ti),oi=ri.clientHeight,si=ri===this.getScrollElement()?0:ri.getBoundingClientRect().top,ai=ei.clientY-si,li=aioi-ni;li?ri.scrollBy({behavior:"smooth",top:ai-ni}):ui&&ri.scrollBy({behavior:"smooth",top:ni-(oi-ai)})}static clone(ei){return ei==null||typeof ei!="object"?ei:ei instanceof Array?[...ei]:Di({},ei)}static cloneDeep(ei){let ti=["parentGrid","el","grid","subGrid","engine"],ni=ii.clone(ei);for(let ri in ni)ni.hasOwnProperty(ri)&&typeof ni[ri]=="object"&&ri.substring(0,2)!=="__"&&!ti.find(oi=>oi===ri)&&(ni[ri]=ii.cloneDeep(ei[ri]));return ni}static cloneNode(ei){let ti=ei.cloneNode(!0);return ti.removeAttribute("id"),ti}static appendTo(ei,ti){let ni;typeof ti=="string"?ni=ii.getElement(ti):ni=ti,ni&&ni.appendChild(ei)}static addElStyles(ei,ti){if(ti instanceof Object)for(let ni in ti)ti.hasOwnProperty(ni)&&(Array.isArray(ti[ni])?ti[ni].forEach(ri=>{ei.style[ni]=ri}):ei.style[ni]=ti[ni])}static initEvent(ei,ti){let ni={type:ti.type},ri={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:ti.target?ti.target:ei.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(oi=>ni[oi]=ei[oi]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(oi=>ni[oi]=ei[oi]),Di(Di({},ni),ri)}static simulateMouseEvent(ei,ti,ni){let ri=document.createEvent("MouseEvents");ri.initMouseEvent(ti,!0,!0,window,1,ei.screenX,ei.screenY,ei.clientX,ei.clientY,ei.ctrlKey,ei.altKey,ei.shiftKey,ei.metaKey,0,ei.target),(ni||ei.target).dispatchEvent(ri)}static getValuesFromTransformedElement(ei){let ti=document.createElement("div");ii.addElStyles(ti,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),ei.appendChild(ti);let ni=ti.getBoundingClientRect();return ei.removeChild(ti),ti.remove(),{xScale:1/ni.width,yScale:1/ni.height,xOffset:ni.left,yOffset:ni.top}}static swap(ei,ti,ni){if(!ei)return;let ri=ei[ti];ei[ti]=ei[ni],ei[ni]=ri}static canBeRotated(ei){var ti;return!(!ei||ei.w===ei.h||ei.locked||ei.noResize||(ti=ei.grid)!=null&&ti.opts.disableResize||ei.minW&&ei.minW===ei.maxW||ei.minH&&ei.minH===ei.maxH)}};var as=class ii{constructor(ei={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=ei.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=ei.maxRow,this._float=ei.float,this.nodes=ei.nodes||[],this.onChange=ei.onChange}batchUpdate(ei=!0,ti=!0){return!!this.batchMode===ei?this:(this.batchMode=ei,ei?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,ti&&this._packNodes(),this._notify()),this)}_useEntireRowArea(ei,ti){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!ei._moving||ei._skipDown||ti.y<=ei.y)}_fixCollisions(ei,ti=ei,ni,ri={}){if(this.sortNodes(-1),ni=ni||this.collide(ei,ti),!ni)return!1;if(ei._moving&&!ri.nested&&!this.float&&this.swap(ei,ni))return!0;let oi=ti;!this._loading&&this._useEntireRowArea(ei,ti)&&(oi={x:0,w:this.column,y:ti.y,h:ti.h},ni=this.collide(ei,oi,ri.skip));let si=!1,ai={nested:!0,pack:!1},li=0;for(;ni=ni||this.collide(ei,oi,ri.skip);){if(li++>this.nodes.length*2)throw new Error("Infinite collide check");let ui;if(ni.locked||this._loading||ei._moving&&!ei._skipDown&&ti.y>ei.y&&!this.float&&(!this.collide(ni,sn(Di({},ni),{y:ei.y}),ei)||!this.collide(ni,sn(Di({},ni),{y:ti.y-ni.h}),ei))){ei._skipDown=ei._skipDown||ti.y>ei.y;let ci=Di(sn(Di({},ti),{y:ni.y+ni.h}),ai);ui=this._loading&&bi.samePos(ei,ci)?!0:this.moveNode(ei,ci),(ni.locked||this._loading)&&ui?bi.copyPos(ti,ei):!ni.locked&&ui&&ri.pack&&(this._packNodes(),ti.y=ni.y+ni.h,bi.copyPos(ei,ti)),si=si||ui}else ui=this.moveNode(ni,Di(sn(Di({},ni),{y:ti.y+ti.h,skip:ei}),ai));if(!ui)return si;ni=void 0}return si}collide(ei,ti=ei,ni){let ri=ei._id,oi=ni==null?void 0:ni._id;return this.nodes.find(si=>si._id!==ri&&si._id!==oi&&bi.isIntercepted(si,ti))}collideAll(ei,ti=ei,ni){let ri=ei._id,oi=ni==null?void 0:ni._id;return this.nodes.filter(si=>si._id!==ri&&si._id!==oi&&bi.isIntercepted(si,ti))}directionCollideCoverage(ei,ti,ni){if(!ti.rect||!ei._rect)return;let ri=ei._rect,oi=Di({},ti.rect);oi.y>ri.y?(oi.h+=oi.y-ri.y,oi.y=ri.y):oi.h+=ri.y-oi.y,oi.x>ri.x?(oi.w+=oi.x-ri.x,oi.x=ri.x):oi.w+=ri.x-oi.x;let si,ai=.5;for(let li of ni){if(li.locked||!li._rect)break;let ui=li._rect,ci=Number.MAX_VALUE,di=Number.MAX_VALUE;ri.yui.y+ui.h&&(ci=(ui.y+ui.h-oi.y)/ui.h),ri.xui.x+ui.w&&(di=(ui.x+ui.w-oi.x)/ui.w);let pi=Math.min(di,ci);pi>ai&&(ai=pi,si=li)}return ti.collide=si,si}cacheRects(ei,ti,ni,ri,oi,si){return this.nodes.forEach(ai=>ai._rect={y:ai.y*ti+ni,x:ai.x*ei+si,w:ai.w*ei-si-ri,h:ai.h*ti-ni-oi}),this}swap(ei,ti){if(!ti||ti.locked||!ei||ei.locked)return!1;function ni(){let oi=ti.x,si=ti.y;return ti.x=ei.x,ti.y=ei.y,ei.h!=ti.h?(ei.x=oi,ei.y=ti.y+ti.h):ei.w!=ti.w?(ei.x=ti.x+ti.w,ei.y=si):(ei.x=oi,ei.y=si),ei._dirty=ti._dirty=!0,!0}let ri;if(ei.w===ti.w&&ei.h===ti.h&&(ei.x===ti.x||ei.y===ti.y)&&(ri=bi.isTouching(ei,ti)))return ni();if(ri!==!1){if(ei.w===ti.w&&ei.x===ti.x&&(ri||(ri=bi.isTouching(ei,ti)))){if(ti.y{let ui;si.locked||(si.autoPosition=!0,ei==="list"&&ai&&(ui=li[ai-1])),this.addNode(si,!1,ui)}),ri||delete this._inColumnResize,ni||this.batchUpdate(!1),this}set float(ei){this._float!==ei&&(this._float=ei||!1,ei||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(ei=1){return this.nodes=bi.sort(this.nodes,ei),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(ei=>{if(ei._updating||ei._orig===void 0||ei.y===ei._orig.y)return;let ti=ei.y;for(;ti>ei._orig.y;)--ti,this.collide(ei,{x:ei.x,y:ti,w:ei.w,h:ei.h})||(ei._dirty=!0,ei.y=ti)}):this.nodes.forEach((ei,ti)=>{if(!ei.locked)for(;ei.y>0;){let ni=ti===0?0:ei.y-1;if(!(ti===0||!this.collide(ei,{x:ei.x,y:ni,w:ei.w,h:ei.h})))break;ei._dirty=ei.y!==ni,ei.y=ni}}),this)}prepareNode(ei,ti){var oi;ei._id=(oi=ei._id)!=null?oi:ii._idSeq++;let ni=ei.id;if(ni){let si=1;for(;this.nodes.find(ai=>ai.id===ei.id&&ai!==ei);)ei.id=ni+"_"+si++}(ei.x===void 0||ei.y===void 0||ei.x===null||ei.y===null)&&(ei.autoPosition=!0);let ri={x:0,y:0,w:1,h:1};return bi.defaults(ei,ri),ei.autoPosition||delete ei.autoPosition,ei.noResize||delete ei.noResize,ei.noMove||delete ei.noMove,bi.sanitizeMinMax(ei),typeof ei.x=="string"&&(ei.x=Number(ei.x)),typeof ei.y=="string"&&(ei.y=Number(ei.y)),typeof ei.w=="string"&&(ei.w=Number(ei.w)),typeof ei.h=="string"&&(ei.h=Number(ei.h)),isNaN(ei.x)&&(ei.x=ri.x,ei.autoPosition=!0),isNaN(ei.y)&&(ei.y=ri.y,ei.autoPosition=!0),isNaN(ei.w)&&(ei.w=ri.w),isNaN(ei.h)&&(ei.h=ri.h),this.nodeBoundFix(ei,ti),ei}nodeBoundFix(ei,ti){let ni=ei._orig||bi.copyPos({},ei);if(ei.maxW&&ei.w&&(ei.w=Math.min(ei.w,ei.maxW)),ei.maxH&&ei.h&&(ei.h=Math.min(ei.h,ei.maxH)),ei.minW&&ei.w&&ei.minW<=this.column&&(ei.w=Math.max(ei.w,ei.minW)),ei.minH&&ei.h&&(ei.h=Math.max(ei.h,ei.minH)),(ei.x||0)+(ei.w||1)>this.column&&this.columnthis.column?ei.w=this.column:ei.w<1&&(ei.w=1),this.maxRow&&ei.h>this.maxRow?ei.h=this.maxRow:ei.h<1&&(ei.h=1),ei.x<0&&(ei.x=0),ei.y<0&&(ei.y=0),ei.x+ei.w>this.column&&(ti?ei.w=this.column-ei.x:ei.x=this.column-ei.w),this.maxRow&&ei.y+ei.h>this.maxRow&&(ti?ei.h=this.maxRow-ei.y:ei.y=this.maxRow-ei.h),bi.samePos(ei,ni)||(ei._dirty=!0),this}getDirtyNodes(ei){return ei?this.nodes.filter(ti=>ti._dirty&&!bi.samePos(ti,ti._orig)):this.nodes.filter(ti=>ti._dirty)}_notify(ei){if(this.batchMode||!this.onChange)return this;let ti=(ei||[]).concat(this.getDirtyNodes());return this.onChange(ti),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(ei=>{delete ei._dirty,delete ei._lastTried}),this)}saveInitial(){return this.nodes.forEach(ei=>{ei._orig=bi.copyPos({},ei),delete ei._dirty}),this._hasLocked=this.nodes.some(ei=>ei.locked),this}restoreInitial(){return this.nodes.forEach(ei=>{!ei._orig||bi.samePos(ei,ei._orig)||(bi.copyPos(ei,ei._orig),ei._dirty=!0)}),this._notify(),this}findEmptyPosition(ei,ti=this.nodes,ni=this.column,ri){let oi=ri?ri.y*ni+(ri.x+ri.w):0,si=!1;for(let ai=oi;!si;++ai){let li=ai%ni,ui=Math.floor(ai/ni);if(li+ei.w>ni)continue;let ci={x:li,y:ui,w:ei.w,h:ei.h};ti.find(di=>bi.isIntercepted(ci,di))||((ei.x!==li||ei.y!==ui)&&(ei._dirty=!0),ei.x=li,ei.y=ui,delete ei.autoPosition,si=!0)}return si}addNode(ei,ti=!1,ni){let ri=this.nodes.find(si=>si._id===ei._id);if(ri)return ri;this._inColumnResize?this.nodeBoundFix(ei):this.prepareNode(ei),delete ei._temporaryRemoved,delete ei._removeDOM;let oi;return ei.autoPosition&&this.findEmptyPosition(ei,this.nodes,this.column,ni)&&(delete ei.autoPosition,oi=!0),this.nodes.push(ei),ti&&this.addedNodes.push(ei),oi||this._fixCollisions(ei),this.batchMode||this._packNodes()._notify(),ei}removeNode(ei,ti=!0,ni=!1){return this.nodes.find(ri=>ri._id===ei._id)?(ni&&this.removedNodes.push(ei),ti&&(ei._removeDOM=!0),this.nodes=this.nodes.filter(ri=>ri._id!==ei._id),ei._isAboutToRemove||this._packNodes(),this._notify([ei]),this):this}removeAll(ei=!0,ti=!0){if(delete this._layouts,!this.nodes.length)return this;ei&&this.nodes.forEach(ri=>ri._removeDOM=!0);let ni=this.nodes;return this.removedNodes=ti?ni:[],this.nodes=[],this._notify(ni)}moveNodeCheck(ei,ti){if(!this.changedPosConstrain(ei,ti))return!1;if(ti.pack=!0,!this.maxRow)return this.moveNode(ei,ti);let ni,ri=new ii({column:this.column,float:this.float,nodes:this.nodes.map(si=>si._id===ei._id?(ni=Di({},si),ni):Di({},si))});if(!ni)return!1;let oi=ri.moveNode(ni,ti)&&ri.getRow()<=Math.max(this.getRow(),this.maxRow);if(!oi&&!ti.resizing&&ti.collide){let si=ti.collide.el.gridstackNode;if(this.swap(ei,si))return this._notify(),!0}return oi?(ri.nodes.filter(si=>si._dirty).forEach(si=>{let ai=this.nodes.find(li=>li._id===si._id);ai&&(bi.copyPos(ai,si),ai._dirty=!0)}),this._notify(),!0):!1}willItFit(ei){if(delete ei._willFitPos,!this.maxRow)return!0;let ti=new ii({column:this.column,float:this.float,nodes:this.nodes.map(ri=>Di({},ri))}),ni=Di({},ei);return this.cleanupNode(ni),delete ni.el,delete ni._id,delete ni.content,delete ni.grid,ti.addNode(ni),ti.getRow()<=this.maxRow?(ei._willFitPos=bi.copyPos({},ni),!0):!1}changedPosConstrain(ei,ti){return ti.w=ti.w||ei.w,ti.h=ti.h||ei.h,ei.x!==ti.x||ei.y!==ti.y?!0:(ei.maxW&&(ti.w=Math.min(ti.w,ei.maxW)),ei.maxH&&(ti.h=Math.min(ti.h,ei.maxH)),ei.minW&&(ti.w=Math.max(ti.w,ei.minW)),ei.minH&&(ti.h=Math.max(ti.h,ei.minH)),ei.w!==ti.w||ei.h!==ti.h)}moveNode(ei,ti){var ui,ci;if(!ei||!ti)return!1;let ni;ti.pack===void 0&&!this.batchMode&&(ni=ti.pack=!0),typeof ti.x!="number"&&(ti.x=ei.x),typeof ti.y!="number"&&(ti.y=ei.y),typeof ti.w!="number"&&(ti.w=ei.w),typeof ti.h!="number"&&(ti.h=ei.h);let ri=ei.w!==ti.w||ei.h!==ti.h,oi=bi.copyPos({},ei,!0);if(bi.copyPos(oi,ti),this.nodeBoundFix(oi,ri),bi.copyPos(ti,oi),!ti.forceCollide&&bi.samePos(ei,ti))return!1;let si=bi.copyPos({},ei),ai=this.collideAll(ei,oi,ti.skip),li=!0;if(ai.length){let di=ei._moving&&!ti.nested,pi=di?this.directionCollideCoverage(ei,ti,ai):ai[0];if(di&&pi&&((ci=(ui=ei.grid)==null?void 0:ui.opts)!=null&&ci.subGridDynamic)&&!ei.grid._isTemp){let yi=bi.areaIntercept(ti.rect,pi._rect),gi=bi.area(ti.rect),vi=bi.area(pi._rect);yi/(gi.8&&(pi.grid.makeSubGrid(pi.el,void 0,ei),pi=void 0)}pi?li=!this._fixCollisions(ei,oi,pi,ti):(li=!1,ni&&delete ti.pack)}return li&&!bi.samePos(ei,oi)&&(ei._dirty=!0,bi.copyPos(ei,oi)),ti.pack&&this._packNodes()._notify(),!bi.samePos(ei,si)}getRow(){return this.nodes.reduce((ei,ti)=>Math.max(ei,ti.y+ti.h),0)}beginUpdate(ei){return ei._updating||(ei._updating=!0,delete ei._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let ei=this.nodes.find(ti=>ti._updating);return ei&&(delete ei._updating,delete ei._skipDown),this}save(ei=!0,ti){var si;let ni=(si=this._layouts)==null?void 0:si.length,ri=ni&&this.column!==ni-1?this._layouts[ni-1]:null,oi=[];return this.sortNodes(),this.nodes.forEach(ai=>{let li=ri==null?void 0:ri.find(ci=>ci._id===ai._id),ui=Di(Di({},ai),li||{});bi.removeInternalForSave(ui,!ei),ti&&ti(ai,ui),oi.push(ui)}),oi}layoutsNodesChange(ei){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((ti,ni)=>{if(!ti||ni===this.column)return this;if(ni{if(!oi._orig)return;let si=ti.find(ai=>ai._id===oi._id);si&&(si.y>=0&&oi.y!==oi._orig.y&&(si.y+=oi.y-oi._orig.y),oi.x!==oi._orig.x&&(si.x=Math.round(oi.x*ri)),oi.w!==oi._orig.w&&(si.w=Math.round(oi.w*ri)))})}}),this)}columnChanged(ei,ti,ni="moveScale"){var ai;if(!this.nodes.length||!ti||ei===ti)return this;if(ni==="none")return this;let ri=ni==="compact"||ni==="list";ri&&this.sortNodes(1),tiei&&this._layouts){let li=this._layouts[ti]||[],ui=this._layouts.length-1;!li.length&&ei!==ui&&((ai=this._layouts[ui])!=null&&ai.length)&&(ei=ui,this._layouts[ui].forEach(ci=>{var pi,yi,gi;let di=si.find(vi=>vi._id===ci._id);di&&(!ri&&!ci.autoPosition&&(di.x=(pi=ci.x)!=null?pi:di.x,di.y=(yi=ci.y)!=null?yi:di.y),di.w=(gi=ci.w)!=null?gi:di.w,(ci.x==null||ci.y===void 0)&&(di.autoPosition=!0))})),li.forEach(ci=>{var pi,yi,gi;let di=si.findIndex(vi=>vi._id===ci._id);if(di!==-1){let vi=si[di];if(ri){vi.w=ci.w;return}(ci.autoPosition||isNaN(ci.x)||isNaN(ci.y))&&this.findEmptyPosition(ci,oi),ci.autoPosition||(vi.x=(pi=ci.x)!=null?pi:vi.x,vi.y=(yi=ci.y)!=null?yi:vi.y,vi.w=(gi=ci.w)!=null?gi:vi.w,oi.push(vi)),si.splice(di,1)}})}if(ri)this.compact(ni,!1);else{if(si.length)if(typeof ni=="function")ni(ti,ei,oi,si);else{let li=ri?1:ti/ei,ui=ni==="move"||ni==="moveScale",ci=ni==="scale"||ni==="moveScale";si.forEach(di=>{di.x=ti===1?0:ui?Math.round(di.x*li):Math.min(di.x,ti-1),di.w=ti===1||ei===1?1:ci?Math.round(di.w*li)||1:Math.min(di.w,ti),oi.push(di)}),si=[]}oi=bi.sort(oi,-1),this._inColumnResize=!0,this.nodes=[],oi.forEach(li=>{this.addNode(li,!1),delete li._orig})}return this.nodes.forEach(li=>delete li._orig),this.batchUpdate(!1,!ri),delete this._inColumnResize,this}cacheLayout(ei,ti,ni=!1){let ri=[];return ei.forEach((oi,si)=>{var ai;if(oi._id===void 0){let li=oi.id?this.nodes.find(ui=>ui.id===oi.id):void 0;oi._id=(ai=li==null?void 0:li._id)!=null?ai:ii._idSeq++}ri[si]={x:oi.x,y:oi.y,w:oi.w,_id:oi._id}}),this._layouts=ni?[]:this._layouts||[],this._layouts[ti]=ri,this}cacheOneLayout(ei,ti){var oi;ei._id=(oi=ei._id)!=null?oi:ii._idSeq++;let ni={x:ei.x,y:ei.y,w:ei.w,_id:ei._id};(ei.autoPosition||ei.x===void 0)&&(delete ni.x,delete ni.y,ei.autoPosition&&(ni.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[ti]=this._layouts[ti]||[];let ri=this.findCacheLayout(ei,ti);return ri===-1?this._layouts[ti].push(ni):this._layouts[ti][ri]=ni,this}findCacheLayout(ei,ti){var ni,ri,oi;return(oi=(ri=(ni=this._layouts)==null?void 0:ni[ti])==null?void 0:ri.findIndex(si=>si._id===ei._id))!=null?oi:-1}removeNodeFromLayoutCache(ei){if(this._layouts)for(let ti=0;ti0||navigator.msMaxTouchPoints>0),Zr=class{};function Ll(ii,ei){if(ii.touches.length>1)return;ii.cancelable&&ii.preventDefault();let ti=ii.changedTouches[0],ni=document.createEvent("MouseEvents");ni.initMouseEvent(ei,!0,!0,window,1,ti.screenX,ti.screenY,ti.clientX,ti.clientY,!1,!1,!1,!1,0,null),ii.target.dispatchEvent(ni)}function Ch(ii,ei){ii.cancelable&&ii.preventDefault();let ti=document.createEvent("MouseEvents");ti.initMouseEvent(ei,!0,!0,window,1,ii.screenX,ii.screenY,ii.clientX,ii.clientY,!1,!1,!1,!1,0,null),ii.target.dispatchEvent(ti)}function Is(ii){Zr.touchHandled||(Zr.touchHandled=!0,Ll(ii,"mousedown"))}function Hs(ii){Zr.touchHandled&&Ll(ii,"mousemove")}function Ps(ii){if(!Zr.touchHandled)return;Zr.pointerLeaveTimeout&&(window.clearTimeout(Zr.pointerLeaveTimeout),delete Zr.pointerLeaveTimeout);let ei=!!Bi.dragElement;Ll(ii,"mouseup"),ei||Ll(ii,"click"),Zr.touchHandled=!1}function Fs(ii){ii.pointerType!=="mouse"&&ii.target.releasePointerCapture(ii.pointerId)}function Zc(ii){Bi.dragElement&&ii.pointerType!=="mouse"&&Ch(ii,"mouseenter")}function eu(ii){Bi.dragElement&&ii.pointerType!=="mouse"&&(Zr.pointerLeaveTimeout=window.setTimeout(()=>{delete Zr.pointerLeaveTimeout,Ch(ii,"mouseleave")},10))}var Ea=class ii{constructor(ei,ti,ni){this.host=ei,this.dir=ti,this.option=ni,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){let ei=this.el=document.createElement("div");return ei.classList.add("ui-resizable-handle"),ei.classList.add(`${ii.prefix}${this.dir}`),ei.style.zIndex="100",ei.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),$n&&(this.el.addEventListener("touchstart",Is),this.el.addEventListener("pointerdown",Fs)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),$n&&(this.el.removeEventListener("touchstart",Is),this.el.removeEventListener("pointerdown",Fs)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(ei){this.mouseDownEvent=ei,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),$n&&(this.el.addEventListener("touchmove",Hs),this.el.addEventListener("touchend",Ps)),ei.stopPropagation(),ei.preventDefault()}_mouseMove(ei){let ti=this.mouseDownEvent;this.moving?this._triggerEvent("move",ei):Math.abs(ei.x-ti.x)+Math.abs(ei.y-ti.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",ei),document.addEventListener("keydown",this._keyEvent)),ei.stopPropagation()}_mouseUp(ei){this.moving&&(this._triggerEvent("stop",ei),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),$n&&(this.el.removeEventListener("touchmove",Hs),this.el.removeEventListener("touchend",Ps)),delete this.moving,delete this.mouseDownEvent,ei.stopPropagation(),ei.preventDefault()}_keyEvent(ei){var ti,ni;ei.key==="Escape"&&((ni=(ti=this.host.gridstackNode)==null?void 0:ti.grid)==null||ni.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(ei,ti){return this.option[ei]&&this.option[ei](ti),this}};Ea.prefix="ui-resizable-";var zo=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(ei,ti){this._eventRegister[ei]=ti}off(ei){delete this._eventRegister[ei]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(ei,ti){if(!this.disabled&&this._eventRegister&&this._eventRegister[ei])return this._eventRegister[ei](ti)}};var wa=class ii extends zo{constructor(ei,ti={}){super(),this.el=ei,this.option=ti,this.rectScale={x:1,y:1},this._ui=()=>{let ri=this.el.parentElement.getBoundingClientRect(),oi={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},si=this.temporalRect||oi;return{position:{left:(si.left-ri.left)*this.rectScale.x,top:(si.top-ri.top)*this.rectScale.y},size:{width:si.width*this.rectScale.x,height:si.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(ei,ti){super.on(ei,ti)}off(ei){super.off(ei)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(ei){let ti=ei.handles&&ei.handles!==this.option.handles,ni=ei.autoHide&&ei.autoHide!==this.option.autoHide;return Object.keys(ei).forEach(ri=>this.option[ri]=ei[ri]),ti&&(this._removeHandlers(),this._setupHandlers()),ni&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(ei){return ei?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Bi.overResizeElement===this&&delete Bi.overResizeElement),this}_mouseOver(ei){Bi.overResizeElement||Bi.dragElement||(Bi.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(ei){Bi.overResizeElement===this&&(delete Bi.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(ei=>ei.trim()).map(ei=>new Ea(this.el,ei,{start:ti=>{this._resizeStart(ti)},stop:ti=>{this._resizeStop(ti)},move:ti=>{this._resizing(ti,ei)}})),this}_resizeStart(ei){this.sizeToContent=bi.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=bi.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=ei,this._setupHelper(),this._applyChange();let ti=bi.initEvent(ei,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(ti,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",ti),this}_resizing(ei,ti){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(ei,ti),this._applyChange();let ni=bi.initEvent(ei,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(ni,this._ui()),this.triggerEvent("resize",ni),this}_resizeStop(ei){let ti=bi.initEvent(ei,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(ti),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",ti),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=ii._originStyleProp.map(ni=>this.el.style[ni]),this.parentOriginStylePosition=this.el.parentElement.style.position;let ei=this.el.parentElement,ti=bi.getValuesFromTransformedElement(ei);return this.rectScale={x:ti.xScale,y:ti.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return ii._originStyleProp.forEach((ei,ti)=>{this.el.style[ei]=this.elOriginStyleVal[ti]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(ei,ti){let ni=this.startEvent,ri={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},oi=ei.clientX-ni.clientX,si=this.sizeToContent?0:ei.clientY-ni.clientY,ai,li;ti.indexOf("e")>-1?ri.width+=oi:ti.indexOf("w")>-1&&(ri.width-=oi,ri.left+=oi,ai=!0),ti.indexOf("s")>-1?ri.height+=si:ti.indexOf("n")>-1&&(ri.height-=si,ri.top+=si,li=!0);let ui=this._constrainSize(ri.width,ri.height,ai,li);return Math.round(ri.width)!==Math.round(ui.width)&&(ti.indexOf("w")>-1&&(ri.left+=ri.width-ui.width),ri.width=ui.width),Math.round(ri.height)!==Math.round(ui.height)&&(ti.indexOf("n")>-1&&(ri.top+=ri.height-ui.height),ri.height=ui.height),ri}_constrainSize(ei,ti,ni,ri){let oi=this.option,si=(ni?oi.maxWidthMoveLeft:oi.maxWidth)||Number.MAX_SAFE_INTEGER,ai=oi.minWidth/this.rectScale.x||ei,li=(ri?oi.maxHeightMoveUp:oi.maxHeight)||Number.MAX_SAFE_INTEGER,ui=oi.minHeight/this.rectScale.y||ti,ci=Math.min(si,Math.max(ai,ei)),di=Math.min(li,Math.max(ui,ti));return{width:ci,height:di}}_applyChange(){let ei={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let ti=this.el.parentElement,{left:ni,top:ri}=ti.getBoundingClientRect();ei={left:ni,top:ri,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(ti=>{let ni=this.temporalRect[ti],ri=ti==="width"||ti==="left"?this.rectScale.x:ti==="height"||ti==="top"?this.rectScale.y:1;this.el.style[ti]=(ni-ei[ti])*ri+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(ei=>ei.destroy()),delete this.handlers,this}};wa._originStyleProp=["width","height","position","left","top","opacity","zIndex"];var j_='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',xa=class ii extends zo{constructor(ei,ti={}){var oi;super(),this.el=ei,this.option=ti,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let ni=(oi=ti==null?void 0:ti.handle)==null?void 0:oi.substring(1),ri=ei.gridstackNode;this.dragEls=!ni||ei.classList.contains(ni)?[ei]:ri!=null&&ri.subGrid?[ei.querySelector(ti.handle)||ei]:Array.from(ei.querySelectorAll(ti.handle)),this.dragEls.length===0&&(this.dragEls=[ei]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(ei,ti){super.on(ei,ti)}off(ei){super.off(ei)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(ei=>{ei.addEventListener("mousedown",this._mouseDown),$n&&(ei.addEventListener("touchstart",Is),ei.addEventListener("pointerdown",Fs))}),this.el.classList.remove("ui-draggable-disabled"))}disable(ei=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(ti=>{ti.removeEventListener("mousedown",this._mouseDown),$n&&(ti.removeEventListener("touchstart",Is),ti.removeEventListener("pointerdown",Fs))}),ei||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(ei){return Object.keys(ei).forEach(ti=>this.option[ti]=ei[ti]),this}_mouseDown(ei){if(!Bi.mouseHandled)return ei.button!==0||!this.dragEls.find(ti=>ti===ei.target)&&ei.target.closest(j_)||this.option.cancel&&ei.target.closest(this.option.cancel)||(this.mouseDownEvent=ei,delete this.dragging,delete Bi.dragElement,delete Bi.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),$n&&(ei.currentTarget.addEventListener("touchmove",Hs),ei.currentTarget.addEventListener("touchend",Ps)),ei.preventDefault(),document.activeElement&&document.activeElement.blur(),Bi.mouseHandled=!0),!0}_callDrag(ei){if(!this.dragging)return;let ti=bi.initEvent(ei,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(ti,this.ui()),this.triggerEvent("drag",ti)}_mouseMove(ei){var ni;let ti=this.mouseDownEvent;if(this.lastDrag=ei,this.dragging)if(this._dragFollow(ei),Bi.pauseDrag){let ri=Number.isInteger(Bi.pauseDrag)?Bi.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(ei),ri)}else this._callDrag(ei);else if(Math.abs(ei.x-ti.x)+Math.abs(ei.y-ti.y)>3){this.dragging=!0,Bi.dragElement=this;let ri=(ni=this.el.gridstackNode)==null?void 0:ni.grid;ri?Bi.dropElement=ri.el.ddElement.ddDroppable:delete Bi.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=bi.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(ei,this.el,this.helperContainment),this._setupHelperStyle(ei);let oi=bi.initEvent(ei,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(oi,this.ui()),this.triggerEvent("dragstart",oi),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(ei){var ti,ni;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),$n&&ei.currentTarget&&(ei.currentTarget.removeEventListener("touchmove",Hs,!0),ei.currentTarget.removeEventListener("touchend",Ps,!0)),this.dragging){delete this.dragging,(ti=this.el.gridstackNode)==null||delete ti._origRotate,document.removeEventListener("keydown",this._keyEvent),((ni=Bi.dropElement)==null?void 0:ni.el)===this.el.parentElement&&delete Bi.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let ri=bi.initEvent(ei,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(ri),this.triggerEvent("dragstop",ri),Bi.dropElement&&Bi.dropElement.drop(ei)}delete this.helper,delete this.mouseDownEvent,delete Bi.dragElement,delete Bi.dropElement,delete Bi.mouseHandled,ei.preventDefault()}_keyEvent(ei){var ri,oi;let ti=this.el.gridstackNode,ni=(ti==null?void 0:ti.grid)||((oi=(ri=Bi.dropElement)==null?void 0:ri.el)==null?void 0:oi.gridstack);if(ei.key==="Escape")ti&&ti._origRotate&&(ti._orig=ti._origRotate,delete ti._origRotate),ni==null||ni.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(ti&&ni&&(ei.key==="r"||ei.key==="R")){if(!bi.canBeRotated(ti))return;ti._origRotate=ti._origRotate||Di({},ti._orig),delete ti._moving,ni.setAnimation(!1).rotate(ti.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),ti._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,ti.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",bi.swap(ti._orig,"w","h"),delete ti._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let ei=this.el;return typeof this.option.helper=="function"?ei=this.option.helper(this.el):this.option.helper==="clone"&&(ei=bi.cloneNode(this.el)),document.body.contains(ei)||bi.appendTo(ei,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=ii.originStyleProp.map(ti=>this.el.style[ti]),ei}_setupHelperStyle(ei){this.helper.classList.add("ui-draggable-dragging");let ti=this.helper.style;return ti.pointerEvents="none",ti.width=this.dragOffset.width+"px",ti.height=this.dragOffset.height+"px",ti.willChange="left, top",ti.position="fixed",this._dragFollow(ei),ti.transition="none",setTimeout(()=>{this.helper&&(ti.transition=null)},0),this}_removeHelperStyle(){var ti;this.helper.classList.remove("ui-draggable-dragging");let ei=(ti=this.helper)==null?void 0:ti.gridstackNode;if(!(ei!=null&&ei._isAboutToRemove)&&this.dragElementOriginStyle){let ni=this.helper,ri=this.dragElementOriginStyle.transition||null;ni.style.transition=this.dragElementOriginStyle.transition="none",ii.originStyleProp.forEach(oi=>ni.style[oi]=this.dragElementOriginStyle[oi]||null),setTimeout(()=>ni.style.transition=ri,50)}return delete this.dragElementOriginStyle,this}_dragFollow(ei){let ti={left:0,top:0},ni=this.helper.style,ri=this.dragOffset;ni.left=(ei.clientX+ri.offsetLeft-ti.left)*this.dragTransform.xScale+"px",ni.top=(ei.clientY+ri.offsetTop-ti.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(ei,ti,ni){let ri=0,oi=0;ni&&(ri=this.dragTransform.xOffset,oi=this.dragTransform.yOffset);let si=ti.getBoundingClientRect();return{left:si.left,top:si.top,offsetLeft:-ei.clientX+si.left-ri,offsetTop:-ei.clientY+si.top-oi,width:si.width*this.dragTransform.xScale,height:si.height*this.dragTransform.yScale}}ui(){let ti=this.el.parentElement.getBoundingClientRect(),ni=this.helper.getBoundingClientRect();return{position:{top:(ni.top-ti.top)*this.dragTransform.yScale,left:(ni.left-ti.left)*this.dragTransform.xScale}}}};xa.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];var Ml=class extends zo{constructor(ei,ti={}){super(),this.el=ei,this.option=ti,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(ei,ti){super.on(ei,ti)}off(ei){super.off(ei)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),$n&&(this.el.addEventListener("pointerenter",Zc),this.el.addEventListener("pointerleave",eu)))}disable(ei=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),ei||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),$n&&(this.el.removeEventListener("pointerenter",Zc),this.el.removeEventListener("pointerleave",eu)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(ei){return Object.keys(ei).forEach(ti=>this.option[ti]=ei[ti]),this._setupAccept(),this}_mouseEnter(ei){if(!Bi.dragElement||!this._canDrop(Bi.dragElement.el))return;ei.preventDefault(),ei.stopPropagation(),Bi.dropElement&&Bi.dropElement!==this&&Bi.dropElement._mouseLeave(ei,!0),Bi.dropElement=this;let ti=bi.initEvent(ei,{target:this.el,type:"dropover"});this.option.over&&this.option.over(ti,this._ui(Bi.dragElement)),this.triggerEvent("dropover",ti),this.el.classList.add("ui-droppable-over")}_mouseLeave(ei,ti=!1){var ri;if(!Bi.dragElement||Bi.dropElement!==this)return;ei.preventDefault(),ei.stopPropagation();let ni=bi.initEvent(ei,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(ni,this._ui(Bi.dragElement)),this.triggerEvent("dropout",ni),Bi.dropElement===this&&(delete Bi.dropElement,!ti)){let oi,si=this.el.parentElement;for(;!oi&&si;)oi=(ri=si.ddElement)==null?void 0:ri.ddDroppable,si=si.parentElement;oi&&oi._mouseEnter(ei)}}drop(ei){ei.preventDefault();let ti=bi.initEvent(ei,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(ti,this._ui(Bi.dragElement)),this.triggerEvent("drop",ti)}_canDrop(ei){return ei&&(!this.accept||this.accept(ei))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=ei=>ei.classList.contains(this.option.accept)||ei.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(ei){return Di({draggable:ei.el},ei.ui())}};var kl=class ii{static init(ei){return ei.ddElement||(ei.ddElement=new ii(ei)),ei.ddElement}constructor(ei){this.el=ei}on(ei,ti){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(ei)>-1?this.ddDraggable.on(ei,ti):this.ddDroppable&&["drop","dropover","dropout"].indexOf(ei)>-1?this.ddDroppable.on(ei,ti):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(ei)>-1&&this.ddResizable.on(ei,ti),this}off(ei){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(ei)>-1?this.ddDraggable.off(ei):this.ddDroppable&&["drop","dropover","dropout"].indexOf(ei)>-1?this.ddDroppable.off(ei):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(ei)>-1&&this.ddResizable.off(ei),this}setupDraggable(ei){return this.ddDraggable?this.ddDraggable.updateOption(ei):this.ddDraggable=new xa(this.el,ei),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(ei){return this.ddResizable?this.ddResizable.updateOption(ei):this.ddResizable=new wa(this.el,ei),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(ei){return this.ddDroppable?this.ddDroppable.updateOption(ei):this.ddDroppable=new Ml(this.el,ei),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Nl=class{resizable(ei,ti,ni,ri){return this._getDDElements(ei).forEach(oi=>{if(ti==="disable"||ti==="enable")oi.ddResizable&&oi.ddResizable[ti]();else if(ti==="destroy")oi.ddResizable&&oi.cleanResizable();else if(ti==="option")oi.setupResizable({[ni]:ri});else{let ai=oi.el.gridstackNode.grid,li=oi.el.getAttribute("gs-resize-handles")||ai.opts.resizable.handles||"e,s,se";li==="all"&&(li="n,e,s,w,se,sw,ne,nw");let ui=!ai.opts.alwaysShowResizeHandle;oi.setupResizable(sn(Di({},ai.opts.resizable),{handles:li,autoHide:ui,start:ti.start,stop:ti.stop,resize:ti.resize}))}}),this}draggable(ei,ti,ni,ri){return this._getDDElements(ei).forEach(oi=>{if(ti==="disable"||ti==="enable")oi.ddDraggable&&oi.ddDraggable[ti]();else if(ti==="destroy")oi.ddDraggable&&oi.cleanDraggable();else if(ti==="option")oi.setupDraggable({[ni]:ri});else{let si=oi.el.gridstackNode.grid;oi.setupDraggable(sn(Di({},si.opts.draggable),{start:ti.start,stop:ti.stop,drag:ti.drag}))}}),this}dragIn(ei,ti){return this._getDDElements(ei).forEach(ni=>ni.setupDraggable(ti)),this}droppable(ei,ti,ni,ri){return typeof ti.accept=="function"&&!ti._accept&&(ti._accept=ti.accept,ti.accept=oi=>ti._accept(oi)),this._getDDElements(ei).forEach(oi=>{ti==="disable"||ti==="enable"?oi.ddDroppable&&oi.ddDroppable[ti]():ti==="destroy"?oi.ddDroppable&&oi.cleanDroppable():ti==="option"?oi.setupDroppable({[ni]:ri}):oi.setupDroppable(ti)}),this}isDroppable(ei){var ti;return!!((ti=ei==null?void 0:ei.ddElement)!=null&&ti.ddDroppable&&!ei.ddElement.ddDroppable.disabled)}isDraggable(ei){var ti;return!!((ti=ei==null?void 0:ei.ddElement)!=null&&ti.ddDraggable&&!ei.ddElement.ddDraggable.disabled)}isResizable(ei){var ti;return!!((ti=ei==null?void 0:ei.ddElement)!=null&&ti.ddResizable&&!ei.ddElement.ddResizable.disabled)}on(ei,ti,ni){return this._getDDElements(ei).forEach(ri=>ri.on(ti,oi=>{ni(oi,Bi.dragElement?Bi.dragElement.el:oi.target,Bi.dragElement?Bi.dragElement.helper:null)})),this}off(ei,ti){return this._getDDElements(ei).forEach(ni=>ni.off(ti)),this}_getDDElements(ei,ti=!0){let ni=bi.getElements(ei);if(!ni.length)return[];let ri=ni.map(oi=>oi.ddElement||(ti?kl.init(oi):null));return ti||ri.filter(oi=>oi),ri}};var Bn=new Nl,Jr=class ii{static init(ei={},ti=".grid-stack"){if(typeof document=="undefined")return null;let ni=ii.getGridElement(ti);return ni?(ni.gridstack||(ni.gridstack=new ii(ni,bi.cloneDeep(ei))),ni.gridstack):(console.error(typeof ti=="string"?'GridStack.initAll() no grid was found with selector "'+ti+`" - element missing or wrong selector ? Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(ei={},ti=".grid-stack"){let ni=[];return typeof document=="undefined"||(ii.getGridElements(ti).forEach(ri=>{ri.gridstack||(ri.gridstack=new ii(ri,bi.cloneDeep(ei))),ni.push(ri.gridstack)}),ni.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+ti+`" - element missing or wrong selector ? -Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),ni}static addGrid(ei,ti={}){if(!ei)return null;let ni=ei;if(ni.gridstack){let si=ni.gridstack;return ti&&(si.opts=Di(Di({},si.opts),ti)),ti.children!==void 0&&si.load(ti.children),si}return(!ei.classList.contains("grid-stack")||ii.addRemoveCB)&&(ii.addRemoveCB?ni=ii.addRemoveCB(ei,ti,!0,!0):ni=bi.createDiv(["grid-stack",ti.class],ei)),ii.init(ti,ni)}static registerEngine(ei){ii.engineClass=ei}get placeholder(){if(!this._placeholder){let ei=document.createElement("div");ei.className="placeholder-content",this.opts.placeholderText&&(ei.textContent=this.opts.placeholderText),this._placeholder=document.createElement("div"),this._placeholder.classList.add(this.opts.placeholderClass,Yn.itemClass,this.opts.itemClass),this.placeholder.appendChild(ei)}return this._placeholder}constructor(ei,ti={}){var di,pi,yi;this.el=ei,this.opts=ti,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},ei.gridstack=this,this.opts=ti=ti||{},ei.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),ti.row&&(ti.minRow=ti.maxRow=ti.row,delete ti.row);let ni=bi.toNumber(ei.getAttribute("gs-row"));ti.column==="auto"&&delete ti.column,ti.alwaysShowResizeHandle!==void 0&&(ti._alwaysShowResizeHandle=ti.alwaysShowResizeHandle);let ri=(di=ti.columnOpts)==null?void 0:di.breakpoints,oi=ti;if(oi.oneColumnModeDomSort&&(delete oi.oneColumnModeDomSort,console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")),oi.oneColumnSize||oi.disableOneColumnMode===!1){let gi=oi.oneColumnSize||768;delete oi.oneColumnSize,delete oi.disableOneColumnMode,ti.columnOpts=ti.columnOpts||{},ri=ti.columnOpts.breakpoints=ti.columnOpts.breakpoints||[];let vi=ri.find(Ei=>Ei.c===1);vi?vi.w=gi:(vi={c:1,w:gi},ri.push(vi,{c:12,w:gi+1}))}let si=ti.columnOpts;si&&(!si.columnWidth&&!((pi=si.breakpoints)!=null&&pi.length)?(delete ti.columnOpts,ri=void 0):si.columnMax=si.columnMax||12),(ri==null?void 0:ri.length)>1&&ri.sort((gi,vi)=>(vi.w||0)-(gi.w||0));let ai=sn(Di({},bi.cloneDeep(Yn)),{column:bi.toNumber(ei.getAttribute("gs-column"))||Yn.column,minRow:ni||bi.toNumber(ei.getAttribute("gs-min-row"))||Yn.minRow,maxRow:ni||bi.toNumber(ei.getAttribute("gs-max-row"))||Yn.maxRow,staticGrid:bi.toBool(ei.getAttribute("gs-static"))||Yn.staticGrid,sizeToContent:bi.toBool(ei.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(ti.handleClass?"."+ti.handleClass:ti.handle?ti.handle:"")||Yn.draggable.handle},removableOptions:{accept:ti.itemClass||Yn.removableOptions.accept,decline:Yn.removableOptions.decline}});ei.getAttribute("gs-animate")&&(ai.animate=bi.toBool(ei.getAttribute("gs-animate"))),ti=bi.defaults(ti,ai),this._initMargin(),this.checkDynamicColumn(),this.el.classList.add("gs-"+ti.column),ti.rtl==="auto"&&(ti.rtl=ei.style.direction==="rtl"),ti.rtl&&this.el.classList.add("grid-stack-rtl");let li=this.el.closest("."+Yn.itemClass),ui=li==null?void 0:li.gridstackNode;ui&&(ui.subGrid=this,this.parentGridNode=ui,this.el.classList.add("grid-stack-nested"),ui.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=ti.cellHeight==="auto",this._isAutoCellHeight||ti.cellHeight==="initial"?this.cellHeight(void 0,!1):(typeof ti.cellHeight=="number"&&ti.cellHeightUnit&&ti.cellHeightUnit!==Yn.cellHeightUnit&&(ti.cellHeight=ti.cellHeight+ti.cellHeightUnit,delete ti.cellHeightUnit),this.cellHeight(ti.cellHeight,!1)),ti.alwaysShowResizeHandle==="mobile"&&(ti.alwaysShowResizeHandle=$n),this._styleSheetClass="gs-id-"+as._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let ci=ti.engineClass||ii.engineClass||as;if(this.engine=new ci({column:this.getColumn(),float:ti.float,maxRow:ti.maxRow,onChange:gi=>{let vi=0;this.engine.nodes.forEach(Ei=>{vi=Math.max(vi,Ei.y+Ei.h)}),gi.forEach(Ei=>{let Ci=Ei.el;Ci&&(Ei._removeDOM?(Ci&&Ci.remove(),delete Ei._removeDOM):this._writePosAttr(Ci,Ei))}),this._updateStyles(!1,vi)}}),this._updateStyles(!1,0),ti.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(gi=>this._prepareElement(gi)),delete this.engine._loading,this.batchUpdate(!1)),ti.children){let gi=ti.children;delete ti.children,gi.length&&this.load(gi)}this.setAnimation(),ti.subGridDynamic&&!Bi.pauseDrag&&(Bi.pauseDrag=!0),((yi=ti.draggable)==null?void 0:yi.pause)!==void 0&&(Bi.pauseDrag=ti.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(ei){if(typeof ei=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(ei.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(ei);let ti,ni=ei;if(ni.grid=this,ni!=null&&ni.el?ti=ni.el:ii.addRemoveCB?ti=ii.addRemoveCB(this.el,ei,!0,!1):ti=bi.createWidgetDivs(this.opts.itemClass,ni),!ti)return;if(ni=ti.gridstackNode,ni&&ti.parentElement===this.el&&this.engine.nodes.find(oi=>oi._id===ni._id))return ti;let ri=this._readAttr(ti);return bi.defaults(ei,ri),this.engine.prepareNode(ei),this.el.appendChild(ti),this.makeWidget(ti,ei),ti}makeSubGrid(ei,ti,ni,ri=!0){var yi,gi,vi;let oi=ei.gridstackNode;if(oi||(oi=this.makeWidget(ei).gridstackNode),(yi=oi.subGrid)!=null&&yi.el)return oi.subGrid;let si,ai=this;for(;ai&&!si;)si=(gi=ai.opts)==null?void 0:gi.subGridOpts,ai=(vi=ai.parentGridNode)==null?void 0:vi.grid;ti=bi.cloneDeep(Di(Di(sn(Di({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),si||{}),ti||oi.subGridOpts||{})),oi.subGridOpts=ti;let li;ti.column==="auto"&&(li=!0,ti.column=Math.max(oi.w||1,(ni==null?void 0:ni.w)||1),delete ti.columnOpts);let ui=oi.el.querySelector(".grid-stack-item-content"),ci,di;if(ri&&(this._removeDD(oi.el),di=sn(Di({},oi),{x:0,y:0}),bi.removeInternalForSave(di),delete di.subGridOpts,oi.content&&(di.content=oi.content,delete oi.content),ii.addRemoveCB?ci=ii.addRemoveCB(this.el,di,!0,!1):(ci=bi.createDiv(["grid-stack-item"]),ci.appendChild(ui),ui=bi.createDiv(["grid-stack-item-content"],oi.el)),this._prepareDragDropByNode(oi)),ni){let Ei=li?ti.column:oi.w,Ci=oi.h+ni.h,xi=oi.el.style;xi.transition="none",this.update(oi.el,{w:Ei,h:Ci}),setTimeout(()=>xi.transition=null)}let pi=oi.subGrid=ii.addGrid(ui,ti);return ni!=null&&ni._moving&&(pi._isTemp=!0),li&&(pi._autoColumn=!0),ri&&pi.makeWidget(ci,di),ni&&(ni._moving?window.setTimeout(()=>bi.simulateMouseEvent(ni._event,"mouseenter",pi.el),0):pi.makeWidget(oi.el,oi)),this.resizeToContentCheck(!1,oi),pi}removeAsSubGrid(ei){var ni;let ti=(ni=this.parentGridNode)==null?void 0:ni.grid;ti&&(ti.batchUpdate(),ti.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(ri=>{ri.x+=this.parentGridNode.x,ri.y+=this.parentGridNode.y,ti.makeWidget(ri.el,ri)}),ti.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,ei&&window.setTimeout(()=>bi.simulateMouseEvent(ei._event,"mouseenter",ti.el),0))}save(ei=!0,ti=!1,ni=ii.saveCB){let ri=this.engine.save(ei,ni);if(ri.forEach(oi=>{var si;if(ei&&oi.el&&!oi.subGrid&&!ni){let ai=oi.el.querySelector(".grid-stack-item-content");oi.content=ai==null?void 0:ai.innerHTML,oi.content||delete oi.content}else if(!ei&&!ni&&delete oi.content,(si=oi.subGrid)!=null&&si.el){let ai=oi.subGrid.save(ei,ti,ni);oi.subGridOpts=ti?ai:{children:ai},delete oi.subGrid}delete oi.el}),ti){let oi=bi.cloneDeep(this.opts);oi.marginBottom===oi.marginTop&&oi.marginRight===oi.marginLeft&&oi.marginTop===oi.marginRight&&(oi.margin=oi.marginTop,delete oi.marginTop,delete oi.marginRight,delete oi.marginBottom,delete oi.marginLeft),oi.rtl===(this.el.style.direction==="rtl")&&(oi.rtl="auto"),this._isAutoCellHeight&&(oi.cellHeight="auto"),this._autoColumn&&(oi.column="auto");let si=oi._alwaysShowResizeHandle;return delete oi._alwaysShowResizeHandle,si!==void 0?oi.alwaysShowResizeHandle=si:delete oi.alwaysShowResizeHandle,bi.removeInternalAndSame(oi,Yn),oi.children=ri,oi}return ri}load(ei,ti=ii.addRemoveCB||!0){var ui;ei=bi.cloneDeep(ei);let ni=this.getColumn();ei.forEach(ci=>{ci.w=ci.w||1,ci.h=ci.h||1}),ei=bi.sort(ei);let ri=0;ei.forEach(ci=>{ri=Math.max(ri,(ci.x||0)+ci.w)}),ri>this.engine.defaultColumn&&(this.engine.defaultColumn=ri),ri>ni&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(ei,ri,!0));let oi=ii.addRemoveCB;typeof ti=="function"&&(ii.addRemoveCB=ti);let si=[];this.batchUpdate();let ai=!this.engine.nodes.length;ai&&this.setAnimation(!1),!ai&&ti&&[...this.engine.nodes].forEach(di=>{if(!di.id)return;bi.find(ei,di.id)||(ii.addRemoveCB&&ii.addRemoveCB(this.el,di,!1,!1),si.push(di),this.removeWidget(di.el,!0,!1))}),this.engine._loading=!0;let li=[];return this.engine.nodes=this.engine.nodes.filter(ci=>bi.find(ei,ci.id)?(li.push(ci),!1):!0),ei.forEach(ci=>{var pi;let di=bi.find(li,ci.id);if(di){if(bi.shouldSizeToContent(di)&&(ci.h=di.h),this.engine.nodeBoundFix(ci),(ci.autoPosition||ci.x===void 0||ci.y===void 0)&&(ci.w=ci.w||di.w,ci.h=ci.h||di.h,this.engine.findEmptyPosition(ci)),this.engine.nodes.push(di),bi.samePos(di,ci)&&this.engine.nodes.length>1&&(this.moveNode(di,sn(Di({},ci),{forceCollide:!0})),bi.copyPos(ci,di)),this.update(di.el,ci),(pi=ci.subGridOpts)!=null&&pi.children){let yi=di.el.querySelector(".grid-stack");yi&&yi.gridstack&&yi.gridstack.load(ci.subGridOpts.children)}}else ti&&this.addWidget(ci)}),delete this.engine._loading,this.engine.removedNodes=si,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,oi?ii.addRemoveCB=oi:delete ii.addRemoveCB,ai&&((ui=this.opts)!=null&&ui.animate)&&this.setAnimation(this.opts.animate,!0),this}batchUpdate(ei=!0){return this.engine.batchUpdate(ei),ei||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(ei=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!ei||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let ti=this.el.querySelector("."+this.opts.itemClass);if(ti){let ri=bi.toNumber(ti.getAttribute("gs-h"))||1;return Math.round(ti.offsetHeight/ri)}let ni=parseInt(this.el.getAttribute("gs-current-row"));return ni?Math.round(this.el.getBoundingClientRect().height/ni):this.opts.cellHeight}cellHeight(ei,ti=!0){if(ti&&ei!==void 0&&this._isAutoCellHeight!==(ei==="auto")&&(this._isAutoCellHeight=ei==="auto",this._updateResizeEvent()),(ei==="initial"||ei==="auto")&&(ei=void 0),ei===void 0){let ri=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;ei=this.cellWidth()+ri}let ni=bi.parseHeight(ei);return this.opts.cellHeightUnit===ni.unit&&this.opts.cellHeight===ni.h?this:(this.opts.cellHeightUnit=ni.unit,this.opts.cellHeight=ni.h,this.resizeToContentCheck(),ti&&this._updateStyles(!0),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(ei=!1){var ti;return ei&&((ti=this.opts.columnOpts)!=null&&ti.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var oi,si;let ei=this.opts.columnOpts;if(!ei||!ei.columnWidth&&!((oi=ei.breakpoints)!=null&&oi.length))return!1;let ti=this.getColumn(),ni=ti,ri=this._widthOrContainer(!0);if(ei.columnWidth)ni=Math.min(Math.round(ri/ei.columnWidth)||1,ei.columnMax);else{ni=ei.columnMax;let ai=0;for(;aili.c===ni);return this.column(ni,(ai==null?void 0:ai.layout)||ei.layout),!0}return!1}compact(ei="compact",ti=!0){return this.engine.compact(ei,ti),this._triggerChangeEvent(),this}column(ei,ti="moveScale"){if(!ei||ei<1||this.opts.column===ei)return this;let ni=this.getColumn();return this.opts.column=ei,this.engine?(this.engine.column=ei,this.el.classList.remove("gs-"+ni),this.el.classList.add("gs-"+ei),this.engine.columnChanged(ni,ei,ti),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(ei=>ei.matches("."+this.opts.itemClass)&&!ei.matches("."+this.opts.placeholderClass))}destroy(ei=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),ei?this.el.parentNode.removeChild(this.el):(this.removeAll(ei),this.el.classList.remove(this._styleSheetClass),this.el.removeAttribute("gs-current-row")),this._removeStylesheet(),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(ei){return this.opts.float!==ei&&(this.opts.float=this.engine.float=ei,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(ei,ti=!1){let ni=this.el.getBoundingClientRect(),ri;ti?ri={top:ni.top+document.documentElement.scrollTop,left:ni.left}:ri={top:this.el.offsetTop,left:this.el.offsetLeft};let oi=ei.left-ri.left,si=ei.top-ri.top,ai=ni.width/this.getColumn(),li=ni.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(oi/ai),y:Math.floor(si/li)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(ei,ti,ni,ri){return this.engine.isAreaEmpty(ei,ti,ni,ri)}makeWidget(ei,ti){let ni=ii.getElement(ei);if(!ni)return;ni.parentElement||this.el.appendChild(ni),this._prepareElement(ni,!0,ti);let ri=ni.gridstackNode;return this._updateContainerHeight(),ri.subGridOpts&&this.makeSubGrid(ni,ri.subGridOpts,void 0,!1),this.opts.column===1&&(this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,ni}on(ei,ti){return ei.indexOf(" ")!==-1?(ei.split(" ").forEach(ri=>this.on(ri,ti)),this):(ei==="change"||ei==="added"||ei==="removed"||ei==="enable"||ei==="disable"?(ei==="enable"||ei==="disable"?this._gsEventHandler[ei]=ri=>ti(ri):this._gsEventHandler[ei]=ri=>{ri.detail&&ti(ri,ri.detail)},this.el.addEventListener(ei,this._gsEventHandler[ei])):ei==="drag"||ei==="dragstart"||ei==="dragstop"||ei==="resizestart"||ei==="resize"||ei==="resizestop"||ei==="dropped"||ei==="resizecontent"?this._gsEventHandler[ei]=ti:console.error("GridStack.on("+ei+") event not supported"),this)}off(ei){return ei.indexOf(" ")!==-1?(ei.split(" ").forEach(ni=>this.off(ni)),this):((ei==="change"||ei==="added"||ei==="removed"||ei==="enable"||ei==="disable")&&this._gsEventHandler[ei]&&this.el.removeEventListener(ei,this._gsEventHandler[ei]),delete this._gsEventHandler[ei],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(ei=>this.off(ei)),this}removeWidget(ei,ti=!0,ni=!0){return ei?(ii.getElements(ei).forEach(ri=>{if(ri.parentElement&&ri.parentElement!==this.el)return;let oi=ri.gridstackNode;oi||(oi=this.engine.nodes.find(si=>ri===si.el)),oi&&(ti&&ii.addRemoveCB&&ii.addRemoveCB(this.el,oi,!1,!1),delete ri.gridstackNode,this._removeDD(ri),this.engine.removeNode(oi,ti,ni),ti&&ri.parentElement&&ri.remove())}),ni&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(ei=!0,ti=!0){return this.engine.nodes.forEach(ni=>{ei&&ii.addRemoveCB&&ii.addRemoveCB(this.el,ni,!1,!1),delete ni.el.gridstackNode,this.opts.staticGrid||this._removeDD(ni.el)}),this.engine.removeAll(ei,ti),ti&&this._triggerRemoveEvent(),this}setAnimation(ei=this.opts.animate,ti){return ti?setTimeout(()=>{this.opts&&this.setAnimation(ei)}):ei?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(ei,ti=!0,ni=!0){return!!this.opts.staticGrid===ei?this:(ei?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(ri=>{this._prepareDragDropByNode(ri),ri.subGrid&&ni&&ri.subGrid.setStatic(ei,ti,ni)}),ti&&this._setStaticClass(),this)}update(ei,ti){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");let ni=arguments,ri=1;return ti={x:ni[ri++],y:ni[ri++],w:ni[ri++],h:ni[ri++]},this.update(ei,ti)}return ii.getElements(ei).forEach(ni=>{var ci;let ri=ni==null?void 0:ni.gridstackNode;if(!ri)return;let oi=bi.cloneDeep(ti);this.engine.nodeBoundFix(oi),delete oi.autoPosition;let si=["x","y","w","h"],ai;if(si.some(di=>oi[di]!==void 0&&oi[di]!==ri[di])&&(ai={},si.forEach(di=>{ai[di]=oi[di]!==void 0?oi[di]:ri[di],delete oi[di]})),!ai&&(oi.minW||oi.minH||oi.maxW||oi.maxH)&&(ai={}),oi.content!==void 0){let di=ni.querySelector(".grid-stack-item-content");di&&di.textContent!==oi.content&&(ri.content=oi.content,ii.renderCB(di,oi),(ci=ri.subGrid)!=null&&ci.el&&(di.appendChild(ri.subGrid.el),ri.subGrid.opts.styleInHead||ri.subGrid._updateStyles(!0))),delete oi.content}let li=!1,ui=!1;for(let di in oi)di[0]!=="_"&&ri[di]!==oi[di]&&(ri[di]=oi[di],li=!0,ui=ui||!this.opts.staticGrid&&(di==="noResize"||di==="noMove"||di==="locked"));if(bi.sanitizeMinMax(ri),ai){let di=ai.w!==void 0&&ai.w!==ri.w;this.moveNode(ri,ai),di&&ri.subGrid?ri.subGrid.onResize(this.hasAnimationCSS()?ri.w:void 0):this.resizeToContentCheck(di,ri),delete ri._orig}(ai||li)&&this._writeAttr(ni,ri),ui&&this._prepareDragDropByNode(ri)}),this}moveNode(ei,ti){let ni=ei._updating;ni||this.engine.cleanNodes().beginUpdate(ei),this.engine.moveNode(ei,ti),this._updateContainerHeight(),ni||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(ei){var pi,yi;if(!ei||(ei.classList.remove("size-to-content-max"),!ei.clientHeight))return;let ti=ei.gridstackNode;if(!ti)return;let ni=ti.grid;if(!ni||ei.parentElement!==ni.el)return;let ri=ni.getCellHeight(!0);if(!ri)return;let oi=ti.h?ti.h*ri:ei.clientHeight,si;if(ti.resizeToContentParent&&(si=ei.querySelector(ti.resizeToContentParent)),si||(si=ei.querySelector(ii.resizeToContentParent)),!si)return;let ai=ei.clientHeight-si.clientHeight,li=ti.h?ti.h*ri-ai:si.clientHeight,ui;if(ti.subGrid){ui=ti.subGrid.getRow()*ti.subGrid.getCellHeight(!0);let gi=ti.subGrid.el.getBoundingClientRect(),vi=ti.subGrid.el.parentElement.getBoundingClientRect();ui+=gi.top-vi.top}else{if((yi=(pi=ti.subGridOpts)==null?void 0:pi.children)!=null&&yi.length)return;{let gi=si.firstElementChild;if(!gi){console.error(`Error: GridStack.resizeToContent() widget id:${ti.id} '${ii.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}ui=gi.getBoundingClientRect().height||li}}if(li===ui)return;oi+=ui-li;let ci=Math.ceil(oi/ri),di=Number.isInteger(ti.sizeToContent)?ti.sizeToContent:0;di&&ci>di&&(ci=di,ei.classList.add("size-to-content-max")),ti.minH&&citi.maxH&&(ci=ti.maxH),ci!==ti.h&&(ni._ignoreLayoutsNodeChange=!0,ni.moveNode(ti,{h:ci}),delete ni._ignoreLayoutsNodeChange)}resizeToContentCBCheck(ei){ii.resizeToContentCB?ii.resizeToContentCB(ei):this.resizeToContent(ei)}rotate(ei,ti){return ii.getElements(ei).forEach(ni=>{let ri=ni.gridstackNode;if(!bi.canBeRotated(ri))return;let oi={w:ri.h,h:ri.w,minH:ri.minW,minW:ri.minH,maxH:ri.maxW,maxW:ri.maxH};if(ti){let ai=ti.left>0?Math.floor(ti.left/this.cellWidth()):0,li=ti.top>0?Math.floor(ti.top/this.opts.cellHeight):0;oi.x=ri.x+ai-(ri.h-(li+1)),oi.y=ri.y+li-ai}Object.keys(oi).forEach(ai=>{oi[ai]===void 0&&delete oi[ai]});let si=ri._orig;this.update(ni,oi),ri._orig=si}),this}margin(ei){if(!(typeof ei=="string"&&ei.split(" ").length>1)){let ni=bi.parseHeight(ei);if(this.opts.marginUnit===ni.unit&&this.opts.margin===ni.h)return}return this.opts.margin=ei,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(ei){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let ti=arguments,ni=0,ri={x:ti[ni++],y:ti[ni++],w:ti[ni++],h:ti[ni++],autoPosition:ti[ni++]};return this.willItFit(ri)}return this.engine.willItFit(ei)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let ei=this.engine.getDirtyNodes(!0);return ei&&ei.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(ei),this._triggerEvent("change",ei)),this.engine.saveInitial(),this}_triggerAddEvent(){var ei;if(this.engine.batchMode)return this;if((ei=this.engine.addedNodes)!=null&&ei.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(ni=>{delete ni._dirty});let ti=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",ti)}return this}_triggerRemoveEvent(){var ei;if(this.engine.batchMode)return this;if((ei=this.engine.removedNodes)!=null&&ei.length){let ti=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",ti)}return this}_triggerEvent(ei,ti){let ni=ti?new CustomEvent(ei,{bubbles:!1,detail:ti}):new Event(ei);return this.el.dispatchEvent(ni),this}_removeStylesheet(){if(this._styles){let ei=this.opts.styleInHead?void 0:this.el.parentNode;bi.removeStylesheet(this._styleSheetClass,ei),delete this._styles}return this}_updateStyles(ei=!1,ti){if(ei&&this._removeStylesheet(),ti===void 0&&(ti=this.getRow()),this._updateContainerHeight(),this.opts.cellHeight===0)return this;let ni=this.opts.cellHeight,ri=this.opts.cellHeightUnit,oi=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let si=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=bi.createStylesheet(this._styleSheetClass,si,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,bi.addCSSRule(this._styles,oi,`height: ${ni}${ri}`);let ai=this.opts.marginTop+this.opts.marginUnit,li=this.opts.marginBottom+this.opts.marginUnit,ui=this.opts.marginRight+this.opts.marginUnit,ci=this.opts.marginLeft+this.opts.marginUnit,di=`${oi} > .grid-stack-item-content`,pi=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;bi.addCSSRule(this._styles,di,`top: ${ai}; right: ${ui}; bottom: ${li}; left: ${ci};`),bi.addCSSRule(this._styles,pi,`top: ${ai}; right: ${ui}; bottom: ${li}; left: ${ci};`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-n`,`top: ${ai};`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-s`,`bottom: ${li}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-ne`,`right: ${ui}; top: ${ai}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-e`,`right: ${ui}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-se`,`right: ${ui}; bottom: ${li}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-nw`,`left: ${ci}; top: ${ai}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-w`,`left: ${ci}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-sw`,`left: ${ci}; bottom: ${li}`)}if(ti=ti||this._styles._max,ti>this._styles._max){let si=ai=>ni*ai+ri;for(let ai=this._styles._max+1;ai<=ti;ai++)bi.addCSSRule(this._styles,`${oi}[gs-y="${ai}"]`,`top: ${si(ai)}`),bi.addCSSRule(this._styles,`${oi}[gs-h="${ai+1}"]`,`height: ${si(ai+1)}`);this._styles._max=ti}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let ei=this.parentGridNode,ti=this.getRow()+this._extraDragRow,ni=this.opts.cellHeight,ri=this.opts.cellHeightUnit;if(!ni)return this;if(!ei){let oi=bi.parseHeight(getComputedStyle(this.el).minHeight);if(oi.h>0&&oi.unit===ri){let si=Math.floor(oi.h/ni);ti1?ei.setAttribute("gs-w",String(ti.w)):ei.removeAttribute("gs-w"),ti.h>1?ei.setAttribute("gs-h",String(ti.h)):ei.removeAttribute("gs-h"),this}_writeAttr(ei,ti){if(!ti)return this;this._writePosAttr(ei,ti);let ni={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(let ri in ni)ti[ri]?ei.setAttribute(ni[ri],String(ti[ri])):ei.removeAttribute(ni[ri]);return this}_readAttr(ei,ti=!0){let ni={};ni.x=bi.toNumber(ei.getAttribute("gs-x")),ni.y=bi.toNumber(ei.getAttribute("gs-y")),ni.w=bi.toNumber(ei.getAttribute("gs-w")),ni.h=bi.toNumber(ei.getAttribute("gs-h")),ni.autoPosition=bi.toBool(ei.getAttribute("gs-auto-position")),ni.noResize=bi.toBool(ei.getAttribute("gs-no-resize")),ni.noMove=bi.toBool(ei.getAttribute("gs-no-move")),ni.locked=bi.toBool(ei.getAttribute("gs-locked")),ni.sizeToContent=bi.toBool(ei.getAttribute("gs-size-to-content")),ni.id=ei.getAttribute("gs-id"),ni.maxW=bi.toNumber(ei.getAttribute("gs-max-w")),ni.minW=bi.toNumber(ei.getAttribute("gs-min-w")),ni.maxH=bi.toNumber(ei.getAttribute("gs-max-h")),ni.minH=bi.toNumber(ei.getAttribute("gs-min-h")),ti&&(ni.w===1&&ei.removeAttribute("gs-w"),ni.h===1&&ei.removeAttribute("gs-h"),ni.maxW&&ei.removeAttribute("gs-max-w"),ni.minW&&ei.removeAttribute("gs-min-w"),ni.maxH&&ei.removeAttribute("gs-max-h"),ni.minH&&ei.removeAttribute("gs-min-h"));for(let ri in ni){if(!ni.hasOwnProperty(ri))return;!ni[ri]&&ni[ri]!==0&&delete ni[ri]}return ni}_setStaticClass(){let ei=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...ei),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...ei),this.el.removeAttribute("gs-static")),this}onResize(ei=(ti=>(ti=this.el)==null?void 0:ti.clientWidth)()){if(!ei||this.prevWidth===ei)return;this.prevWidth=ei,this.batchUpdate();let ni=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),ni=!0):ni=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(ri=>{ri.subGrid&&ri.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(ni),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(ei=!1,ti=void 0){if(this.engine){if(ei&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,ti),this.animationDelay);if(ti)bi.shouldSizeToContent(ti)&&this.resizeToContentCBCheck(ti.el);else if(this.engine.nodes.some(ni=>bi.shouldSizeToContent(ni))){let ni=[...this.engine.nodes];this.batchUpdate(),ni.forEach(ri=>{bi.shouldSizeToContent(ri)&&this.resizeToContentCBCheck(ri.el)}),this.batchUpdate(!1)}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,ti?[ti]:this.engine.nodes)}}_updateResizeEvent(ei=!1){let ti=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(ni=>ni.sizeToContent));return!ei&&ti&&!this.resizeObserver?(this._sizeThrottle=bi.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(ei||!ti)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(ei=".grid-stack-item"){return bi.getElement(ei)}static getElements(ei=".grid-stack-item"){return bi.getElements(ei)}static getGridElement(ei){return ii.getElement(ei)}static getGridElements(ei){return bi.getElements(ei)}_initMargin(){let ei,ti=0,ni=[];return typeof this.opts.margin=="string"&&(ni=this.opts.margin.split(" ")),ni.length===2?(this.opts.marginTop=this.opts.marginBottom=ni[0],this.opts.marginLeft=this.opts.marginRight=ni[1]):ni.length===4?(this.opts.marginTop=ni[0],this.opts.marginRight=ni[1],this.opts.marginBottom=ni[2],this.opts.marginLeft=ni[3]):(ei=bi.parseHeight(this.opts.margin),this.opts.marginUnit=ei.unit,ti=this.opts.margin=ei.h),this.opts.marginTop===void 0?this.opts.marginTop=ti:(ei=bi.parseHeight(this.opts.marginTop),this.opts.marginTop=ei.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=ti:(ei=bi.parseHeight(this.opts.marginBottom),this.opts.marginBottom=ei.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=ti:(ei=bi.parseHeight(this.opts.marginRight),this.opts.marginRight=ei.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=ti:(ei=bi.parseHeight(this.opts.marginLeft),this.opts.marginLeft=ei.h,delete this.opts.margin),this.opts.marginUnit=ei.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static getDD(){return Bn}static setupDragIn(ei,ti,ni,ri=document){(ti==null?void 0:ti.pause)!==void 0&&(Bi.pauseDrag=ti.pause),ti=Di({appendTo:"body",helper:"clone"},ti||{}),(typeof ei=="string"?bi.getElements(ei,ri):ei).forEach((si,ai)=>{Bn.isDraggable(si)||Bn.dragIn(si,ti),ni!=null&&ni[ai]&&(si.gridstackNode=ni[ai])})}movable(ei,ti){return this.opts.staticGrid?this:(ii.getElements(ei).forEach(ni=>{let ri=ni.gridstackNode;ri&&(ti?delete ri.noMove:ri.noMove=!0,this._prepareDragDropByNode(ri))}),this)}resizable(ei,ti){return this.opts.staticGrid?this:(ii.getElements(ei).forEach(ni=>{let ri=ni.gridstackNode;ri&&(ti?delete ri.noResize:ri.noResize=!0,this._prepareDragDropByNode(ri))}),this)}disable(ei=!0){if(!this.opts.staticGrid)return this.enableMove(!1,ei),this.enableResize(!1,ei),this._triggerEvent("disable"),this}enable(ei=!0){if(!this.opts.staticGrid)return this.enableMove(!0,ei),this.enableResize(!0,ei),this._triggerEvent("enable"),this}enableMove(ei,ti=!0){return this.opts.staticGrid?this:(ei?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(ni=>{this._prepareDragDropByNode(ni),ni.subGrid&&ti&&ni.subGrid.enableMove(ei,ti)}),this)}enableResize(ei,ti=!0){return this.opts.staticGrid?this:(ei?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(ni=>{this._prepareDragDropByNode(ni),ni.subGrid&&ti&&ni.subGrid.enableResize(ei,ti)}),this)}_removeDD(ei){return Bn.draggable(ei,"destroy").resizable(ei,"destroy"),ei.gridstackNode&&delete ei.gridstackNode._initDD,delete ei.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Bn.droppable(this.el,"destroy"),this;let ei,ti,ni=(ri,oi,si)=>{var pi;si=si||oi;let ai=si.gridstackNode;if(!ai)return;if(!((pi=ai.grid)!=null&&pi.el)){si.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let yi=si.getBoundingClientRect();si.style.left=yi.x+(this.dragTransform.xScale-1)*(ri.clientX-yi.x)/this.dragTransform.xScale+"px",si.style.top=yi.y+(this.dragTransform.yScale-1)*(ri.clientY-yi.y)/this.dragTransform.yScale+"px",si.style.transformOrigin="0px 0px"}let{top:li,left:ui}=si.getBoundingClientRect(),ci=this.el.getBoundingClientRect();ui-=ci.left,li-=ci.top;let di={position:{top:li*this.dragTransform.xScale,left:ui*this.dragTransform.yScale}};if(ai._temporaryRemoved){if(ai.x=Math.max(0,Math.round(ui/ti)),ai.y=Math.max(0,Math.round(li/ei)),delete ai.autoPosition,this.engine.nodeBoundFix(ai),!this.engine.willItFit(ai)){if(ai.autoPosition=!0,!this.engine.willItFit(ai)){Bn.off(oi,"drag");return}ai._willFitPos&&(bi.copyPos(ai,ai._willFitPos),delete ai._willFitPos)}this._onStartMoving(si,ri,di,ai,ti,ei)}else this._dragOrResize(si,ri,di,ai,ti,ei)};return Bn.droppable(this.el,{accept:ri=>{let oi=ri.gridstackNode||this._readAttr(ri,!1);if((oi==null?void 0:oi.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let si=!0;if(typeof this.opts.acceptWidgets=="function")si=this.opts.acceptWidgets(ri);else{let ai=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;si=ri.matches(ai)}if(si&&oi&&this.opts.maxRow){let ai={w:oi.w,h:oi.h,minW:oi.minW,minH:oi.minH};si=this.engine.willItFit(ai)}return si}}).on(this.el,"dropover",(ri,oi,si)=>{let ai=(si==null?void 0:si.gridstackNode)||oi.gridstackNode;if((ai==null?void 0:ai.grid)===this&&!ai._temporaryRemoved)return!1;if(ai!=null&&ai.grid&&ai.grid!==this&&!ai._temporaryRemoved&&ai.grid._leave(oi,si),si=si||oi,ti=this.cellWidth(),ei=this.getCellHeight(!0),!ai){if(si.hasAttribute("gridstacknode")){try{ai=JSON.parse(si.getAttribute("gridstacknode"))}catch(ci){console.error("Gridstack dropover: Bad JSON format: ",si.getAttribute("gridstacknode"))}si.removeAttribute("gridstacknode")}ai||(ai=this._readAttr(si))}ai.grid||(ai.el||(ai=Di({},ai)),ai._isExternal=!0,si.gridstackNode=ai);let li=ai.w||Math.round(si.offsetWidth/ti)||1,ui=ai.h||Math.round(si.offsetHeight/ei)||1;return ai.grid&&ai.grid!==this?(oi._gridstackNodeOrig||(oi._gridstackNodeOrig=ai),oi.gridstackNode=ai=sn(Di({},ai),{w:li,h:ui,grid:this}),delete ai.x,delete ai.y,this.engine.cleanupNode(ai).nodeBoundFix(ai),ai._initDD=ai._isExternal=ai._temporaryRemoved=!0):(ai.w=li,ai.h=ui,ai._temporaryRemoved=!0),ii._itemRemoving(ai.el,!1),Bn.on(oi,"drag",ni),ni(ri,oi,si),!1}).on(this.el,"dropout",(ri,oi,si)=>{let ai=(si==null?void 0:si.gridstackNode)||oi.gridstackNode;return ai&&(!ai.grid||ai.grid===this)&&(this._leave(oi,si),this._isTemp&&this.removeAsSubGrid(ai)),!1}).on(this.el,"drop",(ri,oi,si)=>{var yi,gi,vi;let ai=(si==null?void 0:si.gridstackNode)||oi.gridstackNode;if((ai==null?void 0:ai.grid)===this&&!ai._isExternal)return!1;let li=!!this.placeholder.parentElement,ui=oi!==si;this.placeholder.remove();let ci=li&&this.opts.animate;ci&&this.setAnimation(!1);let di=oi._gridstackNodeOrig;if(delete oi._gridstackNodeOrig,li&&(di!=null&&di.grid)&&di.grid!==this){let Ei=di.grid;Ei.engine.removeNodeFromLayoutCache(di),Ei.engine.removedNodes.push(di),Ei._triggerRemoveEvent()._triggerChangeEvent(),Ei.parentGridNode&&!Ei.engine.nodes.length&&Ei.opts.subGridDynamic&&Ei.removeAsSubGrid()}if(!ai||(li&&(this.engine.cleanupNode(ai),ai.grid=this),(yi=ai.grid)==null||delete yi._isTemp,Bn.off(oi,"drag"),si!==oi?(si.remove(),oi=si):oi.remove(),this._removeDD(oi),!li))return!1;let pi=(vi=(gi=ai.subGrid)==null?void 0:gi.el)==null?void 0:vi.gridstack;return bi.copyPos(ai,this._readAttr(this.placeholder)),bi.removePositioningStyles(oi),ui&&(ai.content||ai.subGridOpts||ii.addRemoveCB)?(delete ai.el,oi=this.addWidget(ai)):(this._prepareElement(oi,!0,ai),this.el.appendChild(oi),this.resizeToContentCheck(!1,ai),pi&&(pi.parentGridNode=ai,pi.opts.styleInHead||pi._updateStyles(!0)),this._updateContainerHeight()),this.engine.addedNodes.push(ai),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(sn(Di({},ri),{type:"dropped"}),di&&di.grid?di:void 0,ai),ci&&this.setAnimation(this.opts.animate,!0),!1}),this}static _itemRemoving(ei,ti){if(!ei)return;let ni=ei?ei.gridstackNode:void 0;!(ni!=null&&ni.grid)||ei.classList.contains(ni.grid.opts.removableOptions.decline)||(ti?ni._isAboutToRemove=!0:delete ni._isAboutToRemove,ti?ei.classList.add("grid-stack-item-removing"):ei.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let ei=document.querySelector(this.opts.removable);return ei?(!this.opts.staticGrid&&!Bn.isDroppable(ei)&&Bn.droppable(ei,this.opts.removableOptions).on(ei,"dropover",(ti,ni)=>ii._itemRemoving(ni,!0)).on(ei,"dropout",(ti,ni)=>ii._itemRemoving(ni,!1)),this):this}_prepareDragDropByNode(ei){let ti=ei.el,ni=ei.noMove||this.opts.disableDrag,ri=ei.noResize||this.opts.disableResize;if(this.opts.staticGrid||ni&&ri)return ei._initDD&&(this._removeDD(ti),delete ei._initDD),ti.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!ei._initDD){let oi,si,ai=(ci,di)=>{this._gsEventHandler[ci.type]&&this._gsEventHandler[ci.type](ci,ci.target),oi=this.cellWidth(),si=this.getCellHeight(!0),this._onStartMoving(ti,ci,di,ei,oi,si)},li=(ci,di)=>{this._dragOrResize(ti,ci,di,ei,oi,si)},ui=ci=>{this.placeholder.remove(),delete ei._moving,delete ei._event,delete ei._lastTried;let di=ei.w!==ei._orig.w,pi=ci.target;if(!(!pi.gridstackNode||pi.gridstackNode.grid!==this)){if(ei.el=pi,ei._isAboutToRemove){let yi=ti.gridstackNode.grid;yi._gsEventHandler[ci.type]&&yi._gsEventHandler[ci.type](ci,pi),yi.engine.nodes.push(ei),yi.removeWidget(ti,!0,!0)}else bi.removePositioningStyles(pi),ei._temporaryRemoved?(bi.copyPos(ei,ei._orig),this._writePosAttr(pi,ei),this.engine.addNode(ei)):this._writePosAttr(pi,ei),this._gsEventHandler[ci.type]&&this._gsEventHandler[ci.type](ci,pi);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),ci.type==="resizestop"&&(Number.isInteger(ei.sizeToContent)&&(ei.sizeToContent=ei.h),this.resizeToContentCheck(di,ei))}};Bn.draggable(ti,{start:ai,stop:ui,drag:li}).resizable(ti,{start:ai,stop:ui,resize:li}),ei._initDD=!0}return Bn.draggable(ti,ni?"disable":"enable").resizable(ti,ri?"disable":"enable"),this}_onStartMoving(ei,ti,ni,ri,oi,si){var ai;if(this.engine.cleanNodes().beginUpdate(ri),this._writePosAttr(this.placeholder,ri),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=ri,(ai=ri.grid)!=null&&ai.el)this.dragTransform=bi.getValuesFromTransformedElement(ei);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let li=this.placeholder.closest(".grid-stack");this.dragTransform=bi.getValuesFromTransformedElement(li)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(ri.el=this.placeholder,ri._lastUiPosition=ni.position,ri._prevYPix=ni.position.top,ri._moving=ti.type==="dragstart",delete ri._lastTried,ti.type==="dropover"&&ri._temporaryRemoved&&(this.engine.addNode(ri),ri._moving=!0),this.engine.cacheRects(oi,si,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),ti.type==="resizestart"){let li=this.getColumn()-ri.x,ui=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-ri.y;Bn.resizable(ei,"option","minWidth",oi*Math.min(ri.minW||1,li)).resizable(ei,"option","minHeight",si*Math.min(ri.minH||1,ui)).resizable(ei,"option","maxWidth",oi*Math.min(ri.maxW||Number.MAX_SAFE_INTEGER,li)).resizable(ei,"option","maxWidthMoveLeft",oi*Math.min(ri.maxW||Number.MAX_SAFE_INTEGER,ri.x+ri.w)).resizable(ei,"option","maxHeight",si*Math.min(ri.maxH||Number.MAX_SAFE_INTEGER,ui)).resizable(ei,"option","maxHeightMoveUp",si*Math.min(ri.maxH||Number.MAX_SAFE_INTEGER,ri.y+ri.h))}}_dragOrResize(ei,ti,ni,ri,oi,si){let ai=Di({},ri._orig),li,ui=this.opts.marginLeft,ci=this.opts.marginRight,di=this.opts.marginTop,pi=this.opts.marginBottom,yi=Math.round(si*.1),gi=Math.round(oi*.1);if(ui=Math.min(ui,gi),ci=Math.min(ci,gi),di=Math.min(di,yi),pi=Math.min(pi,yi),ti.type==="drag"){if(ri._temporaryRemoved)return;let Ei=ni.position.top-ri._prevYPix;ri._prevYPix=ni.position.top,this.opts.draggable.scroll!==!1&&bi.updateScrollPosition(ei,ni.position,Ei);let Ci=ni.position.left+(ni.position.left>ri._lastUiPosition.left?-ci:ui),xi=ni.position.top+(ni.position.top>ri._lastUiPosition.top?-pi:di);ai.x=Math.round(Ci/oi),ai.y=Math.round(xi/si);let Li=this._extraDragRow;if(this.engine.collide(ri,ai)){let Oi=this.getRow(),zi=Math.max(0,ai.y+ri.h-Oi);this.opts.maxRow&&Oi+zi>this.opts.maxRow&&(zi=Math.max(0,this.opts.maxRow-Oi)),this._extraDragRow=zi}else this._extraDragRow=0;if(this._extraDragRow!==Li&&this._updateContainerHeight(),ri.x===ai.x&&ri.y===ai.y)return}else if(ti.type==="resize"){if(ai.x<0||(bi.updateScrollResize(ti,ei,si),ai.w=Math.round((ni.size.width-ui)/oi),ai.h=Math.round((ni.size.height-di)/si),ri.w===ai.w&&ri.h===ai.h)||ri._lastTried&&ri._lastTried.w===ai.w&&ri._lastTried.h===ai.h)return;let Ei=ni.position.left+ui,Ci=ni.position.top+di;ai.x=Math.round(Ei/oi),ai.y=Math.round(Ci/si),li=!0}ri._event=ti,ri._lastTried=ai;let vi={x:ni.position.left+ui,y:ni.position.top+di,w:(ni.size?ni.size.width:ri.w*oi)-ui-ci,h:(ni.size?ni.size.height:ri.h*si)-di-pi};if(this.engine.moveNodeCheck(ri,sn(Di({},ai),{cellWidth:oi,cellHeight:si,rect:vi,resizing:li}))){ri._lastUiPosition=ni.position,this.engine.cacheRects(oi,si,di,ci,pi,ui),delete ri._skipDown,li&&ri.subGrid&&ri.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let Ei=ti.target;this._writePosAttr(Ei,ri),this._gsEventHandler[ti.type]&&this._gsEventHandler[ti.type](ti,Ei)}}_leave(ei,ti){ti=ti||ei;let ni=ti.gridstackNode;ni&&(ti.style.transform=ti.style.transformOrigin=null,Bn.off(ei,"drag"),!ni._temporaryRemoved&&(ni._temporaryRemoved=!0,this.engine.removeNode(ni),ni.el=ni._isExternal&&ti?ti:ei,ni._isExternal&&this.engine.cleanupNode(ni),this.opts.removable===!0&&ii._itemRemoving(ei,!0),ei._gridstackNodeOrig?(ei.gridstackNode=ei._gridstackNodeOrig,delete ei._gridstackNodeOrig):ni._isExternal&&this.engine.restoreInitial()))}commit(){return Sh(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}};Jr.renderCB=(ii,ei)=>{ii&&(ei!=null&&ei.content)&&(ii.textContent=ei.content)};Jr.resizeToContentParent=".grid-stack-item-content";Jr.Utils=bi;Jr.Engine=as;Jr.GDRev="11.1.2";function q_(){let ii=document.getElementById("dashboard");ii&&ii.gridstack.disable()}function W_(){let ii=document.getElementById("dashboard");ii&&ii.gridstack.enable()}function U_(ii,ei){return co(this,null,function*(){return yield Ls(ii,{layout:ei})})}function Ah(){if(document.getElementById("dashboard")==null)return;let ei=Jr.init({cellHeight:100,disableDrag:!0,disableResize:!0,draggable:{handle:".grid-stack-item-content .card-header",appendTo:"body",scroll:!0}}),ti=document.getElementById("lock_dashboard");ti&&ti.addEventListener("click",()=>{q_()});let ni=document.getElementById("unlock_dashboard");ni&&ni.addEventListener("click",()=>{W_()});let ri=document.getElementById("save_dashboard");ri!==null&&ri.addEventListener("click",()=>{let oi=ri.getAttribute("data-url");if(oi==null)return;let si=ei.save(!1);U_(oi,si).then(ai=>{rs(ai)?Po("danger","Error Saving Dashboard Config",ai.error).show():location.reload()})})}function Dh(ii,ei){switch(ii){case"images-and-labels":{tu("image.device-image",ei),tu("text.device-image-label",ei);break}case"images-only":{tu("image.device-image",ei),iu("text.device-image-label",ei);break}case"labels-only":{iu("image.device-image",ei),iu("text.device-image-label",ei);break}}}function tu(ii,ei){var ni,ri;let ti=(ri=(ni=ei.contentDocument)==null?void 0:ni.querySelectorAll(ii))!=null?ri:[];for(let oi of ti)oi.classList.remove("hidden")}function iu(ii,ei){var ni,ri;let ti=(ri=(ni=ei.contentDocument)==null?void 0:ni.querySelectorAll(ii))!=null?ri:[];for(let oi of ti)oi.classList.add("hidden")}function Y_(ii,ei){ei.set("view",ii);for(let ti of Hi(".rack_elevation"))Dh(ii,ti)}function Oh(){let ii=qc.get("view");for(let ei of Hi("select.rack-view"))ei.selectedIndex=[...ei.options].findIndex(ti=>ti.value==ii),ei.addEventListener("change",ti=>{Y_(ti.currentTarget.value,qc)},!1);for(let ei of Hi(".rack_elevation"))ei.addEventListener("load",()=>{Dh(ii,ei)})}function G_(ii){let ei=document.getElementById("selector_results");if(ei==null)return;let ti=ei.getAttribute("data-selector-target");if(ti==null)return;let ni=document.getElementById(ti);if(ni==null)return;let ri=ii.getAttribute("data-label"),oi=ii.getAttribute("data-value");ni.tomselect.addOption({id:oi,display:ri}),ni.tomselect.addItem(oi)}function Lh(){for(let ii of Hi("#selector_results a"))ii.addEventListener("click",()=>G_(ii))}function K_(){let ii=document.getElementById("quick-add-object");if(ii==null)return;let ei=ii.getAttribute("data-object-id");if(ei==null)return;let ti=ii.getAttribute("data-object-repr");if(ti==null)return;let ni=ii.getAttribute("data-target-id");if(ni==null)return;let ri=document.getElementById(ni);if(ri==null)return;ri.tomselect.addOption({id:ei,display:ti}),ri.tomselect.addItem(ei);let oi=document.getElementById("htmx-modal");if(oi){let si=io.getInstance(oi);si&&si.hide()}}function Mh(){let ii=document.getElementById("htmx-modal-content");ii&&ii.addEventListener("htmx:afterSwap",()=>K_())}function Q_(){bl(),El(),yl(),Lh(),Mh(),hl(),_l()}function kh(){document.addEventListener("htmx:afterSettle",Q_)}function X_(ii){let ei=ii.currentTarget,ti=ei.baseURI.split("?")[0],ni="?",ri=Array.from(ei.options).filter(oi=>oi.selected).map(oi=>`filter_id=${oi.value}`).join("&");ti+=`${ni}${ri}`,document.location.href=ti}function Nh(){let ii=document.getElementById("results");if(pn(ii)){let ei=document.getElementById("id_filter_id");pn(ei)&&ei.addEventListener("change",X_)}}function Rh(){for(let ii of[hl,dh,_l,Ef,Tf,yl,bh,bl,El,Eh,xh,Th,Ah,Oh,kh,Nh])ii()}function J_(){let ii=document.forms;for(let ti of ii)ti.method.toUpperCase()=="GET"&&ti.addEventListener("formdata",function(ni){let ri=ni.formData;for(let[oi,si]of Array.from(ri.entries()))si===""&&ri.delete(oi)});let ei=document.querySelector(".content-container");ei!==null&&ei.focus()}window.addEventListener("load",J_);document.readyState!=="loading"?Rh():document.addEventListener("DOMContentLoaded",Rh);})(); +Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),ni}static addGrid(ei,ti={}){if(!ei)return null;let ni=ei;if(ni.gridstack){let si=ni.gridstack;return ti&&(si.opts=Di(Di({},si.opts),ti)),ti.children!==void 0&&si.load(ti.children),si}return(!ei.classList.contains("grid-stack")||ii.addRemoveCB)&&(ii.addRemoveCB?ni=ii.addRemoveCB(ei,ti,!0,!0):ni=bi.createDiv(["grid-stack",ti.class],ei)),ii.init(ti,ni)}static registerEngine(ei){ii.engineClass=ei}get placeholder(){if(!this._placeholder){this._placeholder=bi.createDiv([this.opts.placeholderClass,Yn.itemClass,this.opts.itemClass]);let ei=bi.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(ei.textContent=this.opts.placeholderText)}return this._placeholder}constructor(ei,ti={}){var di,pi,yi;this.el=ei,this.opts=ti,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},ei.gridstack=this,this.opts=ti=ti||{},ei.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),ti.row&&(ti.minRow=ti.maxRow=ti.row,delete ti.row);let ni=bi.toNumber(ei.getAttribute("gs-row"));ti.column==="auto"&&delete ti.column,ti.alwaysShowResizeHandle!==void 0&&(ti._alwaysShowResizeHandle=ti.alwaysShowResizeHandle);let ri=(di=ti.columnOpts)==null?void 0:di.breakpoints,oi=ti;if(oi.oneColumnModeDomSort&&(delete oi.oneColumnModeDomSort,console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")),oi.oneColumnSize||oi.disableOneColumnMode===!1){let gi=oi.oneColumnSize||768;delete oi.oneColumnSize,delete oi.disableOneColumnMode,ti.columnOpts=ti.columnOpts||{},ri=ti.columnOpts.breakpoints=ti.columnOpts.breakpoints||[];let vi=ri.find(Ei=>Ei.c===1);vi?vi.w=gi:(vi={c:1,w:gi},ri.push(vi,{c:12,w:gi+1}))}let si=ti.columnOpts;si&&(!si.columnWidth&&!((pi=si.breakpoints)!=null&&pi.length)?(delete ti.columnOpts,ri=void 0):si.columnMax=si.columnMax||12),(ri==null?void 0:ri.length)>1&&ri.sort((gi,vi)=>(vi.w||0)-(gi.w||0));let ai=sn(Di({},bi.cloneDeep(Yn)),{column:bi.toNumber(ei.getAttribute("gs-column"))||Yn.column,minRow:ni||bi.toNumber(ei.getAttribute("gs-min-row"))||Yn.minRow,maxRow:ni||bi.toNumber(ei.getAttribute("gs-max-row"))||Yn.maxRow,staticGrid:bi.toBool(ei.getAttribute("gs-static"))||Yn.staticGrid,sizeToContent:bi.toBool(ei.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(ti.handleClass?"."+ti.handleClass:ti.handle?ti.handle:"")||Yn.draggable.handle},removableOptions:{accept:ti.itemClass||Yn.removableOptions.accept,decline:Yn.removableOptions.decline}});ei.getAttribute("gs-animate")&&(ai.animate=bi.toBool(ei.getAttribute("gs-animate"))),ti=bi.defaults(ti,ai),this._initMargin(),this.checkDynamicColumn(),this.el.classList.add("gs-"+ti.column),ti.rtl==="auto"&&(ti.rtl=ei.style.direction==="rtl"),ti.rtl&&this.el.classList.add("grid-stack-rtl");let li=this.el.closest("."+Yn.itemClass),ui=li==null?void 0:li.gridstackNode;ui&&(ui.subGrid=this,this.parentGridNode=ui,this.el.classList.add("grid-stack-nested"),ui.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=ti.cellHeight==="auto",this._isAutoCellHeight||ti.cellHeight==="initial"?this.cellHeight(void 0,!1):(typeof ti.cellHeight=="number"&&ti.cellHeightUnit&&ti.cellHeightUnit!==Yn.cellHeightUnit&&(ti.cellHeight=ti.cellHeight+ti.cellHeightUnit,delete ti.cellHeightUnit),this.cellHeight(ti.cellHeight,!1)),ti.alwaysShowResizeHandle==="mobile"&&(ti.alwaysShowResizeHandle=$n),this._styleSheetClass="gs-id-"+as._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let ci=ti.engineClass||ii.engineClass||as;if(this.engine=new ci({column:this.getColumn(),float:ti.float,maxRow:ti.maxRow,onChange:gi=>{let vi=0;this.engine.nodes.forEach(Ei=>{vi=Math.max(vi,Ei.y+Ei.h)}),gi.forEach(Ei=>{let Ci=Ei.el;Ci&&(Ei._removeDOM?(Ci&&Ci.remove(),delete Ei._removeDOM):this._writePosAttr(Ci,Ei))}),this._updateStyles(!1,vi)}}),this._updateStyles(!1,0),ti.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(gi=>this._prepareElement(gi)),delete this.engine._loading,this.batchUpdate(!1)),ti.children){let gi=ti.children;delete ti.children,gi.length&&this.load(gi)}this.setAnimation(),ti.subGridDynamic&&!Bi.pauseDrag&&(Bi.pauseDrag=!0),((yi=ti.draggable)==null?void 0:yi.pause)!==void 0&&(Bi.pauseDrag=ti.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(ei){if(typeof ei=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(ei.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(ei);let ti,ni=ei;if(ni.grid=this,ni!=null&&ni.el?ti=ni.el:ii.addRemoveCB?ti=ii.addRemoveCB(this.el,ei,!0,!1):ti=bi.createWidgetDivs(this.opts.itemClass,ni),!ti)return;if(ni=ti.gridstackNode,ni&&ti.parentElement===this.el&&this.engine.nodes.find(oi=>oi._id===ni._id))return ti;let ri=this._readAttr(ti);return bi.defaults(ei,ri),this.engine.prepareNode(ei),this.el.appendChild(ti),this.makeWidget(ti,ei),ti}makeSubGrid(ei,ti,ni,ri=!0){var yi,gi,vi;let oi=ei.gridstackNode;if(oi||(oi=this.makeWidget(ei).gridstackNode),(yi=oi.subGrid)!=null&&yi.el)return oi.subGrid;let si,ai=this;for(;ai&&!si;)si=(gi=ai.opts)==null?void 0:gi.subGridOpts,ai=(vi=ai.parentGridNode)==null?void 0:vi.grid;ti=bi.cloneDeep(Di(Di(sn(Di({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),si||{}),ti||oi.subGridOpts||{})),oi.subGridOpts=ti;let li;ti.column==="auto"&&(li=!0,ti.column=Math.max(oi.w||1,(ni==null?void 0:ni.w)||1),delete ti.columnOpts);let ui=oi.el.querySelector(".grid-stack-item-content"),ci,di;if(ri&&(this._removeDD(oi.el),di=sn(Di({},oi),{x:0,y:0}),bi.removeInternalForSave(di),delete di.subGridOpts,oi.content&&(di.content=oi.content,delete oi.content),ii.addRemoveCB?ci=ii.addRemoveCB(this.el,di,!0,!1):(ci=bi.createDiv(["grid-stack-item"]),ci.appendChild(ui),ui=bi.createDiv(["grid-stack-item-content"],oi.el)),this._prepareDragDropByNode(oi)),ni){let Ei=li?ti.column:oi.w,Ci=oi.h+ni.h,xi=oi.el.style;xi.transition="none",this.update(oi.el,{w:Ei,h:Ci}),setTimeout(()=>xi.transition=null)}let pi=oi.subGrid=ii.addGrid(ui,ti);return ni!=null&&ni._moving&&(pi._isTemp=!0),li&&(pi._autoColumn=!0),ri&&pi.makeWidget(ci,di),ni&&(ni._moving?window.setTimeout(()=>bi.simulateMouseEvent(ni._event,"mouseenter",pi.el),0):pi.makeWidget(oi.el,oi)),this.resizeToContentCheck(!1,oi),pi}removeAsSubGrid(ei){var ni;let ti=(ni=this.parentGridNode)==null?void 0:ni.grid;ti&&(ti.batchUpdate(),ti.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(ri=>{ri.x+=this.parentGridNode.x,ri.y+=this.parentGridNode.y,ti.makeWidget(ri.el,ri)}),ti.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,ei&&window.setTimeout(()=>bi.simulateMouseEvent(ei._event,"mouseenter",ti.el),0))}save(ei=!0,ti=!1,ni=ii.saveCB){let ri=this.engine.save(ei,ni);if(ri.forEach(oi=>{var si;if(ei&&oi.el&&!oi.subGrid&&!ni){let ai=oi.el.querySelector(".grid-stack-item-content");oi.content=ai==null?void 0:ai.innerHTML,oi.content||delete oi.content}else if(!ei&&!ni&&delete oi.content,(si=oi.subGrid)!=null&&si.el){let ai=oi.subGrid.save(ei,ti,ni);oi.subGridOpts=ti?ai:{children:ai},delete oi.subGrid}delete oi.el}),ti){let oi=bi.cloneDeep(this.opts);oi.marginBottom===oi.marginTop&&oi.marginRight===oi.marginLeft&&oi.marginTop===oi.marginRight&&(oi.margin=oi.marginTop,delete oi.marginTop,delete oi.marginRight,delete oi.marginBottom,delete oi.marginLeft),oi.rtl===(this.el.style.direction==="rtl")&&(oi.rtl="auto"),this._isAutoCellHeight&&(oi.cellHeight="auto"),this._autoColumn&&(oi.column="auto");let si=oi._alwaysShowResizeHandle;return delete oi._alwaysShowResizeHandle,si!==void 0?oi.alwaysShowResizeHandle=si:delete oi.alwaysShowResizeHandle,bi.removeInternalAndSame(oi,Yn),oi.children=ri,oi}return ri}load(ei,ti=ii.addRemoveCB||!0){var ui;ei=bi.cloneDeep(ei);let ni=this.getColumn();ei.forEach(ci=>{ci.w=ci.w||1,ci.h=ci.h||1}),ei=bi.sort(ei);let ri=0;ei.forEach(ci=>{ri=Math.max(ri,(ci.x||0)+ci.w)}),ri>this.engine.defaultColumn&&(this.engine.defaultColumn=ri),ri>ni&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(ei,ri,!0));let oi=ii.addRemoveCB;typeof ti=="function"&&(ii.addRemoveCB=ti);let si=[];this.batchUpdate();let ai=!this.engine.nodes.length;ai&&this.setAnimation(!1),!ai&&ti&&[...this.engine.nodes].forEach(di=>{if(!di.id)return;bi.find(ei,di.id)||(ii.addRemoveCB&&ii.addRemoveCB(this.el,di,!1,!1),si.push(di),this.removeWidget(di.el,!0,!1))}),this.engine._loading=!0;let li=[];return this.engine.nodes=this.engine.nodes.filter(ci=>bi.find(ei,ci.id)?(li.push(ci),!1):!0),ei.forEach(ci=>{var pi;let di=bi.find(li,ci.id);if(di){if(bi.shouldSizeToContent(di)&&(ci.h=di.h),this.engine.nodeBoundFix(ci),(ci.autoPosition||ci.x===void 0||ci.y===void 0)&&(ci.w=ci.w||di.w,ci.h=ci.h||di.h,this.engine.findEmptyPosition(ci)),this.engine.nodes.push(di),bi.samePos(di,ci)&&this.engine.nodes.length>1&&(this.moveNode(di,sn(Di({},ci),{forceCollide:!0})),bi.copyPos(ci,di)),this.update(di.el,ci),(pi=ci.subGridOpts)!=null&&pi.children){let yi=di.el.querySelector(".grid-stack");yi&&yi.gridstack&&yi.gridstack.load(ci.subGridOpts.children)}}else ti&&this.addWidget(ci)}),delete this.engine._loading,this.engine.removedNodes=si,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,oi?ii.addRemoveCB=oi:delete ii.addRemoveCB,ai&&((ui=this.opts)!=null&&ui.animate)&&this.setAnimation(this.opts.animate,!0),this}batchUpdate(ei=!0){return this.engine.batchUpdate(ei),ei||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(ei=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!ei||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let ti=this.el.querySelector("."+this.opts.itemClass);if(ti){let ri=bi.toNumber(ti.getAttribute("gs-h"))||1;return Math.round(ti.offsetHeight/ri)}let ni=parseInt(this.el.getAttribute("gs-current-row"));return ni?Math.round(this.el.getBoundingClientRect().height/ni):this.opts.cellHeight}cellHeight(ei,ti=!0){if(ti&&ei!==void 0&&this._isAutoCellHeight!==(ei==="auto")&&(this._isAutoCellHeight=ei==="auto",this._updateResizeEvent()),(ei==="initial"||ei==="auto")&&(ei=void 0),ei===void 0){let ri=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;ei=this.cellWidth()+ri}let ni=bi.parseHeight(ei);return this.opts.cellHeightUnit===ni.unit&&this.opts.cellHeight===ni.h?this:(this.opts.cellHeightUnit=ni.unit,this.opts.cellHeight=ni.h,this.resizeToContentCheck(),ti&&this._updateStyles(!0),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(ei=!1){var ti;return ei&&((ti=this.opts.columnOpts)!=null&&ti.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var oi,si;let ei=this.opts.columnOpts;if(!ei||!ei.columnWidth&&!((oi=ei.breakpoints)!=null&&oi.length))return!1;let ti=this.getColumn(),ni=ti,ri=this._widthOrContainer(!0);if(ei.columnWidth)ni=Math.min(Math.round(ri/ei.columnWidth)||1,ei.columnMax);else{ni=ei.columnMax;let ai=0;for(;aili.c===ni);return this.column(ni,(ai==null?void 0:ai.layout)||ei.layout),!0}return!1}compact(ei="compact",ti=!0){return this.engine.compact(ei,ti),this._triggerChangeEvent(),this}column(ei,ti="moveScale"){if(!ei||ei<1||this.opts.column===ei)return this;let ni=this.getColumn();return this.opts.column=ei,this.engine?(this.engine.column=ei,this.el.classList.remove("gs-"+ni),this.el.classList.add("gs-"+ei),this.engine.columnChanged(ni,ei,ti),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(ei=>ei.matches("."+this.opts.itemClass)&&!ei.matches("."+this.opts.placeholderClass))}destroy(ei=!0){var ti,ni;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),ei?this.el.parentNode.removeChild(this.el):(this.removeAll(ei),this.el.classList.remove(this._styleSheetClass),this.el.removeAttribute("gs-current-row")),this._removeStylesheet(),(ti=this.parentGridNode)==null||delete ti.subGrid,delete this.parentGridNode,delete this.opts,(ni=this._placeholder)==null||delete ni.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(ei){return this.opts.float!==ei&&(this.opts.float=this.engine.float=ei,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(ei,ti=!1){let ni=this.el.getBoundingClientRect(),ri;ti?ri={top:ni.top+document.documentElement.scrollTop,left:ni.left}:ri={top:this.el.offsetTop,left:this.el.offsetLeft};let oi=ei.left-ri.left,si=ei.top-ri.top,ai=ni.width/this.getColumn(),li=ni.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(oi/ai),y:Math.floor(si/li)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(ei,ti,ni,ri){return this.engine.isAreaEmpty(ei,ti,ni,ri)}makeWidget(ei,ti){let ni=ii.getElement(ei);if(!ni)return;ni.parentElement||this.el.appendChild(ni),this._prepareElement(ni,!0,ti);let ri=ni.gridstackNode;return this._updateContainerHeight(),ri.subGridOpts&&this.makeSubGrid(ni,ri.subGridOpts,void 0,!1),this.opts.column===1&&(this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,ni}on(ei,ti){return ei.indexOf(" ")!==-1?(ei.split(" ").forEach(ri=>this.on(ri,ti)),this):(ei==="change"||ei==="added"||ei==="removed"||ei==="enable"||ei==="disable"?(ei==="enable"||ei==="disable"?this._gsEventHandler[ei]=ri=>ti(ri):this._gsEventHandler[ei]=ri=>{ri.detail&&ti(ri,ri.detail)},this.el.addEventListener(ei,this._gsEventHandler[ei])):ei==="drag"||ei==="dragstart"||ei==="dragstop"||ei==="resizestart"||ei==="resize"||ei==="resizestop"||ei==="dropped"||ei==="resizecontent"?this._gsEventHandler[ei]=ti:console.error("GridStack.on("+ei+") event not supported"),this)}off(ei){return ei.indexOf(" ")!==-1?(ei.split(" ").forEach(ni=>this.off(ni)),this):((ei==="change"||ei==="added"||ei==="removed"||ei==="enable"||ei==="disable")&&this._gsEventHandler[ei]&&this.el.removeEventListener(ei,this._gsEventHandler[ei]),delete this._gsEventHandler[ei],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(ei=>this.off(ei)),this}removeWidget(ei,ti=!0,ni=!0){return ei?(ii.getElements(ei).forEach(ri=>{if(ri.parentElement&&ri.parentElement!==this.el)return;let oi=ri.gridstackNode;oi||(oi=this.engine.nodes.find(si=>ri===si.el)),oi&&(ti&&ii.addRemoveCB&&ii.addRemoveCB(this.el,oi,!1,!1),delete ri.gridstackNode,this._removeDD(ri),this.engine.removeNode(oi,ti,ni),ti&&ri.parentElement&&ri.remove())}),ni&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(ei=!0,ti=!0){return this.engine.nodes.forEach(ni=>{ei&&ii.addRemoveCB&&ii.addRemoveCB(this.el,ni,!1,!1),delete ni.el.gridstackNode,this.opts.staticGrid||this._removeDD(ni.el)}),this.engine.removeAll(ei,ti),ti&&this._triggerRemoveEvent(),this}setAnimation(ei=this.opts.animate,ti){return ti?setTimeout(()=>{this.opts&&this.setAnimation(ei)}):ei?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(ei,ti=!0,ni=!0){return!!this.opts.staticGrid===ei?this:(ei?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(ri=>{this._prepareDragDropByNode(ri),ri.subGrid&&ni&&ri.subGrid.setStatic(ei,ti,ni)}),ti&&this._setStaticClass(),this)}update(ei,ti){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");let ni=arguments,ri=1;return ti={x:ni[ri++],y:ni[ri++],w:ni[ri++],h:ni[ri++]},this.update(ei,ti)}return ii.getElements(ei).forEach(ni=>{var ci;let ri=ni==null?void 0:ni.gridstackNode;if(!ri)return;let oi=bi.cloneDeep(ti);this.engine.nodeBoundFix(oi),delete oi.autoPosition;let si=["x","y","w","h"],ai;if(si.some(di=>oi[di]!==void 0&&oi[di]!==ri[di])&&(ai={},si.forEach(di=>{ai[di]=oi[di]!==void 0?oi[di]:ri[di],delete oi[di]})),!ai&&(oi.minW||oi.minH||oi.maxW||oi.maxH)&&(ai={}),oi.content!==void 0){let di=ni.querySelector(".grid-stack-item-content");di&&di.textContent!==oi.content&&(ri.content=oi.content,ii.renderCB(di,oi),(ci=ri.subGrid)!=null&&ci.el&&(di.appendChild(ri.subGrid.el),ri.subGrid.opts.styleInHead||ri.subGrid._updateStyles(!0))),delete oi.content}let li=!1,ui=!1;for(let di in oi)di[0]!=="_"&&ri[di]!==oi[di]&&(ri[di]=oi[di],li=!0,ui=ui||!this.opts.staticGrid&&(di==="noResize"||di==="noMove"||di==="locked"));if(bi.sanitizeMinMax(ri),ai){let di=ai.w!==void 0&&ai.w!==ri.w;this.moveNode(ri,ai),di&&ri.subGrid?ri.subGrid.onResize(this.hasAnimationCSS()?ri.w:void 0):this.resizeToContentCheck(di,ri),delete ri._orig}(ai||li)&&this._writeAttr(ni,ri),ui&&this._prepareDragDropByNode(ri)}),this}moveNode(ei,ti){let ni=ei._updating;ni||this.engine.cleanNodes().beginUpdate(ei),this.engine.moveNode(ei,ti),this._updateContainerHeight(),ni||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(ei){var pi,yi;if(!ei||(ei.classList.remove("size-to-content-max"),!ei.clientHeight))return;let ti=ei.gridstackNode;if(!ti)return;let ni=ti.grid;if(!ni||ei.parentElement!==ni.el)return;let ri=ni.getCellHeight(!0);if(!ri)return;let oi=ti.h?ti.h*ri:ei.clientHeight,si;if(ti.resizeToContentParent&&(si=ei.querySelector(ti.resizeToContentParent)),si||(si=ei.querySelector(ii.resizeToContentParent)),!si)return;let ai=ei.clientHeight-si.clientHeight,li=ti.h?ti.h*ri-ai:si.clientHeight,ui;if(ti.subGrid){ui=ti.subGrid.getRow()*ti.subGrid.getCellHeight(!0);let gi=ti.subGrid.el.getBoundingClientRect(),vi=ti.subGrid.el.parentElement.getBoundingClientRect();ui+=gi.top-vi.top}else{if((yi=(pi=ti.subGridOpts)==null?void 0:pi.children)!=null&&yi.length)return;{let gi=si.firstElementChild;if(!gi){console.error(`Error: GridStack.resizeToContent() widget id:${ti.id} '${ii.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}ui=gi.getBoundingClientRect().height||li}}if(li===ui)return;oi+=ui-li;let ci=Math.ceil(oi/ri),di=Number.isInteger(ti.sizeToContent)?ti.sizeToContent:0;di&&ci>di&&(ci=di,ei.classList.add("size-to-content-max")),ti.minH&&citi.maxH&&(ci=ti.maxH),ci!==ti.h&&(ni._ignoreLayoutsNodeChange=!0,ni.moveNode(ti,{h:ci}),delete ni._ignoreLayoutsNodeChange)}resizeToContentCBCheck(ei){ii.resizeToContentCB?ii.resizeToContentCB(ei):this.resizeToContent(ei)}rotate(ei,ti){return ii.getElements(ei).forEach(ni=>{let ri=ni.gridstackNode;if(!bi.canBeRotated(ri))return;let oi={w:ri.h,h:ri.w,minH:ri.minW,minW:ri.minH,maxH:ri.maxW,maxW:ri.maxH};if(ti){let ai=ti.left>0?Math.floor(ti.left/this.cellWidth()):0,li=ti.top>0?Math.floor(ti.top/this.opts.cellHeight):0;oi.x=ri.x+ai-(ri.h-(li+1)),oi.y=ri.y+li-ai}Object.keys(oi).forEach(ai=>{oi[ai]===void 0&&delete oi[ai]});let si=ri._orig;this.update(ni,oi),ri._orig=si}),this}margin(ei){if(!(typeof ei=="string"&&ei.split(" ").length>1)){let ni=bi.parseHeight(ei);if(this.opts.marginUnit===ni.unit&&this.opts.margin===ni.h)return}return this.opts.margin=ei,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(ei){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let ti=arguments,ni=0,ri={x:ti[ni++],y:ti[ni++],w:ti[ni++],h:ti[ni++],autoPosition:ti[ni++]};return this.willItFit(ri)}return this.engine.willItFit(ei)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let ei=this.engine.getDirtyNodes(!0);return ei&&ei.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(ei),this._triggerEvent("change",ei)),this.engine.saveInitial(),this}_triggerAddEvent(){var ei;if(this.engine.batchMode)return this;if((ei=this.engine.addedNodes)!=null&&ei.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(ni=>{delete ni._dirty});let ti=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",ti)}return this}_triggerRemoveEvent(){var ei;if(this.engine.batchMode)return this;if((ei=this.engine.removedNodes)!=null&&ei.length){let ti=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",ti)}return this}_triggerEvent(ei,ti){let ni=ti?new CustomEvent(ei,{bubbles:!1,detail:ti}):new Event(ei);return this.el.dispatchEvent(ni),this}_removeStylesheet(){if(this._styles){let ei=this.opts.styleInHead?void 0:this.el.parentNode;bi.removeStylesheet(this._styleSheetClass,ei),delete this._styles}return this}_updateStyles(ei=!1,ti){if(ei&&this._removeStylesheet(),ti===void 0&&(ti=this.getRow()),this._updateContainerHeight(),this.opts.cellHeight===0)return this;let ni=this.opts.cellHeight,ri=this.opts.cellHeightUnit,oi=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let si=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=bi.createStylesheet(this._styleSheetClass,si,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,bi.addCSSRule(this._styles,oi,`height: ${ni}${ri}`);let ai=this.opts.marginTop+this.opts.marginUnit,li=this.opts.marginBottom+this.opts.marginUnit,ui=this.opts.marginRight+this.opts.marginUnit,ci=this.opts.marginLeft+this.opts.marginUnit,di=`${oi} > .grid-stack-item-content`,pi=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;bi.addCSSRule(this._styles,di,`top: ${ai}; right: ${ui}; bottom: ${li}; left: ${ci};`),bi.addCSSRule(this._styles,pi,`top: ${ai}; right: ${ui}; bottom: ${li}; left: ${ci};`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-n`,`top: ${ai};`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-s`,`bottom: ${li}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-ne`,`right: ${ui}; top: ${ai}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-e`,`right: ${ui}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-se`,`right: ${ui}; bottom: ${li}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-nw`,`left: ${ci}; top: ${ai}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-w`,`left: ${ci}`),bi.addCSSRule(this._styles,`${oi} > .ui-resizable-sw`,`left: ${ci}; bottom: ${li}`)}if(ti=ti||this._styles._max,ti>this._styles._max){let si=ai=>ni*ai+ri;for(let ai=this._styles._max+1;ai<=ti;ai++)bi.addCSSRule(this._styles,`${oi}[gs-y="${ai}"]`,`top: ${si(ai)}`),bi.addCSSRule(this._styles,`${oi}[gs-h="${ai+1}"]`,`height: ${si(ai+1)}`);this._styles._max=ti}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let ei=this.parentGridNode,ti=this.getRow()+this._extraDragRow,ni=this.opts.cellHeight,ri=this.opts.cellHeightUnit;if(!ni)return this;if(!ei){let oi=bi.parseHeight(getComputedStyle(this.el).minHeight);if(oi.h>0&&oi.unit===ri){let si=Math.floor(oi.h/ni);ti1?ei.setAttribute("gs-w",String(ti.w)):ei.removeAttribute("gs-w"),ti.h>1?ei.setAttribute("gs-h",String(ti.h)):ei.removeAttribute("gs-h"),this}_writeAttr(ei,ti){if(!ti)return this;this._writePosAttr(ei,ti);let ni={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(let ri in ni)ti[ri]?ei.setAttribute(ni[ri],String(ti[ri])):ei.removeAttribute(ni[ri]);return this}_readAttr(ei,ti=!0){let ni={};ni.x=bi.toNumber(ei.getAttribute("gs-x")),ni.y=bi.toNumber(ei.getAttribute("gs-y")),ni.w=bi.toNumber(ei.getAttribute("gs-w")),ni.h=bi.toNumber(ei.getAttribute("gs-h")),ni.autoPosition=bi.toBool(ei.getAttribute("gs-auto-position")),ni.noResize=bi.toBool(ei.getAttribute("gs-no-resize")),ni.noMove=bi.toBool(ei.getAttribute("gs-no-move")),ni.locked=bi.toBool(ei.getAttribute("gs-locked")),ni.sizeToContent=bi.toBool(ei.getAttribute("gs-size-to-content")),ni.id=ei.getAttribute("gs-id"),ni.maxW=bi.toNumber(ei.getAttribute("gs-max-w")),ni.minW=bi.toNumber(ei.getAttribute("gs-min-w")),ni.maxH=bi.toNumber(ei.getAttribute("gs-max-h")),ni.minH=bi.toNumber(ei.getAttribute("gs-min-h")),ti&&(ni.w===1&&ei.removeAttribute("gs-w"),ni.h===1&&ei.removeAttribute("gs-h"),ni.maxW&&ei.removeAttribute("gs-max-w"),ni.minW&&ei.removeAttribute("gs-min-w"),ni.maxH&&ei.removeAttribute("gs-max-h"),ni.minH&&ei.removeAttribute("gs-min-h"));for(let ri in ni){if(!ni.hasOwnProperty(ri))return;!ni[ri]&&ni[ri]!==0&&delete ni[ri]}return ni}_setStaticClass(){let ei=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...ei),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...ei),this.el.removeAttribute("gs-static")),this}onResize(ei=(ti=>(ti=this.el)==null?void 0:ti.clientWidth)()){if(!ei||this.prevWidth===ei)return;this.prevWidth=ei,this.batchUpdate();let ni=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),ni=!0):ni=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(ri=>{ri.subGrid&&ri.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(ni),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(ei=!1,ti=void 0){if(this.engine){if(ei&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,ti),this.animationDelay);if(ti)bi.shouldSizeToContent(ti)&&this.resizeToContentCBCheck(ti.el);else if(this.engine.nodes.some(ni=>bi.shouldSizeToContent(ni))){let ni=[...this.engine.nodes];this.batchUpdate(),ni.forEach(ri=>{bi.shouldSizeToContent(ri)&&this.resizeToContentCBCheck(ri.el)}),this.batchUpdate(!1)}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,ti?[ti]:this.engine.nodes)}}_updateResizeEvent(ei=!1){let ti=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(ni=>ni.sizeToContent));return!ei&&ti&&!this.resizeObserver?(this._sizeThrottle=bi.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(ei||!ti)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(ei=".grid-stack-item"){return bi.getElement(ei)}static getElements(ei=".grid-stack-item"){return bi.getElements(ei)}static getGridElement(ei){return ii.getElement(ei)}static getGridElements(ei){return bi.getElements(ei)}_initMargin(){let ei,ti=0,ni=[];return typeof this.opts.margin=="string"&&(ni=this.opts.margin.split(" ")),ni.length===2?(this.opts.marginTop=this.opts.marginBottom=ni[0],this.opts.marginLeft=this.opts.marginRight=ni[1]):ni.length===4?(this.opts.marginTop=ni[0],this.opts.marginRight=ni[1],this.opts.marginBottom=ni[2],this.opts.marginLeft=ni[3]):(ei=bi.parseHeight(this.opts.margin),this.opts.marginUnit=ei.unit,ti=this.opts.margin=ei.h),this.opts.marginTop===void 0?this.opts.marginTop=ti:(ei=bi.parseHeight(this.opts.marginTop),this.opts.marginTop=ei.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=ti:(ei=bi.parseHeight(this.opts.marginBottom),this.opts.marginBottom=ei.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=ti:(ei=bi.parseHeight(this.opts.marginRight),this.opts.marginRight=ei.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=ti:(ei=bi.parseHeight(this.opts.marginLeft),this.opts.marginLeft=ei.h,delete this.opts.margin),this.opts.marginUnit=ei.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static getDD(){return Bn}static setupDragIn(ei,ti,ni,ri=document){(ti==null?void 0:ti.pause)!==void 0&&(Bi.pauseDrag=ti.pause),ti=Di({appendTo:"body",helper:"clone"},ti||{}),(typeof ei=="string"?bi.getElements(ei,ri):ei).forEach((si,ai)=>{Bn.isDraggable(si)||Bn.dragIn(si,ti),ni!=null&&ni[ai]&&(si.gridstackNode=ni[ai])})}movable(ei,ti){return this.opts.staticGrid?this:(ii.getElements(ei).forEach(ni=>{let ri=ni.gridstackNode;ri&&(ti?delete ri.noMove:ri.noMove=!0,this._prepareDragDropByNode(ri))}),this)}resizable(ei,ti){return this.opts.staticGrid?this:(ii.getElements(ei).forEach(ni=>{let ri=ni.gridstackNode;ri&&(ti?delete ri.noResize:ri.noResize=!0,this._prepareDragDropByNode(ri))}),this)}disable(ei=!0){if(!this.opts.staticGrid)return this.enableMove(!1,ei),this.enableResize(!1,ei),this._triggerEvent("disable"),this}enable(ei=!0){if(!this.opts.staticGrid)return this.enableMove(!0,ei),this.enableResize(!0,ei),this._triggerEvent("enable"),this}enableMove(ei,ti=!0){return this.opts.staticGrid?this:(ei?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(ni=>{this._prepareDragDropByNode(ni),ni.subGrid&&ti&&ni.subGrid.enableMove(ei,ti)}),this)}enableResize(ei,ti=!0){return this.opts.staticGrid?this:(ei?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(ni=>{this._prepareDragDropByNode(ni),ni.subGrid&&ti&&ni.subGrid.enableResize(ei,ti)}),this)}cancelDrag(){var ti;let ei=(ti=this._placeholder)==null?void 0:ti.gridstackNode;ei&&(ei._isExternal?(ei._isAboutToRemove=!0,this.engine.removeNode(ei)):ei._isAboutToRemove&&ii._itemRemoving(ei.el,!1),this.engine.restoreInitial())}_removeDD(ei){return Bn.draggable(ei,"destroy").resizable(ei,"destroy"),ei.gridstackNode&&delete ei.gridstackNode._initDD,delete ei.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Bn.droppable(this.el,"destroy"),this;let ei,ti,ni=(ri,oi,si)=>{var pi;si=si||oi;let ai=si.gridstackNode;if(!ai)return;if(!((pi=ai.grid)!=null&&pi.el)){si.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let yi=si.getBoundingClientRect();si.style.left=yi.x+(this.dragTransform.xScale-1)*(ri.clientX-yi.x)/this.dragTransform.xScale+"px",si.style.top=yi.y+(this.dragTransform.yScale-1)*(ri.clientY-yi.y)/this.dragTransform.yScale+"px",si.style.transformOrigin="0px 0px"}let{top:li,left:ui}=si.getBoundingClientRect(),ci=this.el.getBoundingClientRect();ui-=ci.left,li-=ci.top;let di={position:{top:li*this.dragTransform.xScale,left:ui*this.dragTransform.yScale}};if(ai._temporaryRemoved){if(ai.x=Math.max(0,Math.round(ui/ti)),ai.y=Math.max(0,Math.round(li/ei)),delete ai.autoPosition,this.engine.nodeBoundFix(ai),!this.engine.willItFit(ai)){if(ai.autoPosition=!0,!this.engine.willItFit(ai)){Bn.off(oi,"drag");return}ai._willFitPos&&(bi.copyPos(ai,ai._willFitPos),delete ai._willFitPos)}this._onStartMoving(si,ri,di,ai,ti,ei)}else this._dragOrResize(si,ri,di,ai,ti,ei)};return Bn.droppable(this.el,{accept:ri=>{let oi=ri.gridstackNode||this._readAttr(ri,!1);if((oi==null?void 0:oi.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let si=!0;if(typeof this.opts.acceptWidgets=="function")si=this.opts.acceptWidgets(ri);else{let ai=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;si=ri.matches(ai)}if(si&&oi&&this.opts.maxRow){let ai={w:oi.w,h:oi.h,minW:oi.minW,minH:oi.minH};si=this.engine.willItFit(ai)}return si}}).on(this.el,"dropover",(ri,oi,si)=>{let ai=(si==null?void 0:si.gridstackNode)||oi.gridstackNode;if((ai==null?void 0:ai.grid)===this&&!ai._temporaryRemoved)return!1;if(ai!=null&&ai.grid&&ai.grid!==this&&!ai._temporaryRemoved&&ai.grid._leave(oi,si),si=si||oi,ti=this.cellWidth(),ei=this.getCellHeight(!0),!ai){let ci=si.getAttribute("data-gs-widget")||si.getAttribute("gridstacknode");if(ci){try{ai=JSON.parse(ci)}catch(di){console.error("Gridstack dropover: Bad JSON format: ",ci)}si.removeAttribute("data-gs-widget"),si.removeAttribute("gridstacknode")}ai||(ai=this._readAttr(si))}ai.grid||(ai.el||(ai=Di({},ai)),ai._isExternal=!0,si.gridstackNode=ai);let li=ai.w||Math.round(si.offsetWidth/ti)||1,ui=ai.h||Math.round(si.offsetHeight/ei)||1;return ai.grid&&ai.grid!==this?(oi._gridstackNodeOrig||(oi._gridstackNodeOrig=ai),oi.gridstackNode=ai=sn(Di({},ai),{w:li,h:ui,grid:this}),delete ai.x,delete ai.y,this.engine.cleanupNode(ai).nodeBoundFix(ai),ai._initDD=ai._isExternal=ai._temporaryRemoved=!0):(ai.w=li,ai.h=ui,ai._temporaryRemoved=!0),ii._itemRemoving(ai.el,!1),Bn.on(oi,"drag",ni),ni(ri,oi,si),!1}).on(this.el,"dropout",(ri,oi,si)=>{let ai=(si==null?void 0:si.gridstackNode)||oi.gridstackNode;return ai&&(!ai.grid||ai.grid===this)&&(this._leave(oi,si),this._isTemp&&this.removeAsSubGrid(ai)),!1}).on(this.el,"drop",(ri,oi,si)=>{var yi,gi,vi;let ai=(si==null?void 0:si.gridstackNode)||oi.gridstackNode;if((ai==null?void 0:ai.grid)===this&&!ai._isExternal)return!1;let li=!!this.placeholder.parentElement,ui=oi!==si;this.placeholder.remove(),delete this.placeholder.gridstackNode;let ci=li&&this.opts.animate;ci&&this.setAnimation(!1);let di=oi._gridstackNodeOrig;if(delete oi._gridstackNodeOrig,li&&(di!=null&&di.grid)&&di.grid!==this){let Ei=di.grid;Ei.engine.removeNodeFromLayoutCache(di),Ei.engine.removedNodes.push(di),Ei._triggerRemoveEvent()._triggerChangeEvent(),Ei.parentGridNode&&!Ei.engine.nodes.length&&Ei.opts.subGridDynamic&&Ei.removeAsSubGrid()}if(!ai||(li&&(this.engine.cleanupNode(ai),ai.grid=this),(yi=ai.grid)==null||delete yi._isTemp,Bn.off(oi,"drag"),si!==oi?(si.remove(),oi=si):oi.remove(),this._removeDD(oi),!li))return!1;let pi=(vi=(gi=ai.subGrid)==null?void 0:gi.el)==null?void 0:vi.gridstack;return bi.copyPos(ai,this._readAttr(this.placeholder)),bi.removePositioningStyles(oi),ui&&(ai.content||ai.subGridOpts||ii.addRemoveCB)?(delete ai.el,oi=this.addWidget(ai)):(this._prepareElement(oi,!0,ai),this.el.appendChild(oi),this.resizeToContentCheck(!1,ai),pi&&(pi.parentGridNode=ai,pi.opts.styleInHead||pi._updateStyles(!0)),this._updateContainerHeight()),this.engine.addedNodes.push(ai),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(sn(Di({},ri),{type:"dropped"}),di&&di.grid?di:void 0,ai),ci&&this.setAnimation(this.opts.animate,!0),!1}),this}static _itemRemoving(ei,ti){if(!ei)return;let ni=ei?ei.gridstackNode:void 0;!(ni!=null&&ni.grid)||ei.classList.contains(ni.grid.opts.removableOptions.decline)||(ti?ni._isAboutToRemove=!0:delete ni._isAboutToRemove,ti?ei.classList.add("grid-stack-item-removing"):ei.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let ei=document.querySelector(this.opts.removable);return ei?(!this.opts.staticGrid&&!Bn.isDroppable(ei)&&Bn.droppable(ei,this.opts.removableOptions).on(ei,"dropover",(ti,ni)=>ii._itemRemoving(ni,!0)).on(ei,"dropout",(ti,ni)=>ii._itemRemoving(ni,!1)),this):this}_prepareDragDropByNode(ei){let ti=ei.el,ni=ei.noMove||this.opts.disableDrag,ri=ei.noResize||this.opts.disableResize;if(this.opts.staticGrid||ni&&ri)return ei._initDD&&(this._removeDD(ti),delete ei._initDD),ti.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!ei._initDD){let oi,si,ai=(ci,di)=>{this._gsEventHandler[ci.type]&&this._gsEventHandler[ci.type](ci,ci.target),oi=this.cellWidth(),si=this.getCellHeight(!0),this._onStartMoving(ti,ci,di,ei,oi,si)},li=(ci,di)=>{this._dragOrResize(ti,ci,di,ei,oi,si)},ui=ci=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete ei._moving,delete ei._event,delete ei._lastTried;let di=ei.w!==ei._orig.w,pi=ci.target;if(!(!pi.gridstackNode||pi.gridstackNode.grid!==this)){if(ei.el=pi,ei._isAboutToRemove){let yi=ti.gridstackNode.grid;yi._gsEventHandler[ci.type]&&yi._gsEventHandler[ci.type](ci,pi),yi.engine.nodes.push(ei),yi.removeWidget(ti,!0,!0)}else bi.removePositioningStyles(pi),ei._temporaryRemoved?(bi.copyPos(ei,ei._orig),this._writePosAttr(pi,ei),this.engine.addNode(ei)):this._writePosAttr(pi,ei),this._gsEventHandler[ci.type]&&this._gsEventHandler[ci.type](ci,pi);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),ci.type==="resizestop"&&(Number.isInteger(ei.sizeToContent)&&(ei.sizeToContent=ei.h),this.resizeToContentCheck(di,ei))}};Bn.draggable(ti,{start:ai,stop:ui,drag:li}).resizable(ti,{start:ai,stop:ui,resize:li}),ei._initDD=!0}return Bn.draggable(ti,ni?"disable":"enable").resizable(ti,ri?"disable":"enable"),this}_onStartMoving(ei,ti,ni,ri,oi,si){var ai;if(this.engine.cleanNodes().beginUpdate(ri),this._writePosAttr(this.placeholder,ri),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=ri,(ai=ri.grid)!=null&&ai.el)this.dragTransform=bi.getValuesFromTransformedElement(ei);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let li=this.placeholder.closest(".grid-stack");this.dragTransform=bi.getValuesFromTransformedElement(li)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(ri.el=this.placeholder,ri._lastUiPosition=ni.position,ri._prevYPix=ni.position.top,ri._moving=ti.type==="dragstart",delete ri._lastTried,ti.type==="dropover"&&ri._temporaryRemoved&&(this.engine.addNode(ri),ri._moving=!0),this.engine.cacheRects(oi,si,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),ti.type==="resizestart"){let li=this.getColumn()-ri.x,ui=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-ri.y;Bn.resizable(ei,"option","minWidth",oi*Math.min(ri.minW||1,li)).resizable(ei,"option","minHeight",si*Math.min(ri.minH||1,ui)).resizable(ei,"option","maxWidth",oi*Math.min(ri.maxW||Number.MAX_SAFE_INTEGER,li)).resizable(ei,"option","maxWidthMoveLeft",oi*Math.min(ri.maxW||Number.MAX_SAFE_INTEGER,ri.x+ri.w)).resizable(ei,"option","maxHeight",si*Math.min(ri.maxH||Number.MAX_SAFE_INTEGER,ui)).resizable(ei,"option","maxHeightMoveUp",si*Math.min(ri.maxH||Number.MAX_SAFE_INTEGER,ri.y+ri.h))}}_dragOrResize(ei,ti,ni,ri,oi,si){let ai=Di({},ri._orig),li,ui=this.opts.marginLeft,ci=this.opts.marginRight,di=this.opts.marginTop,pi=this.opts.marginBottom,yi=Math.round(si*.1),gi=Math.round(oi*.1);if(ui=Math.min(ui,gi),ci=Math.min(ci,gi),di=Math.min(di,yi),pi=Math.min(pi,yi),ti.type==="drag"){if(ri._temporaryRemoved)return;let Ei=ni.position.top-ri._prevYPix;ri._prevYPix=ni.position.top,this.opts.draggable.scroll!==!1&&bi.updateScrollPosition(ei,ni.position,Ei);let Ci=ni.position.left+(ni.position.left>ri._lastUiPosition.left?-ci:ui),xi=ni.position.top+(ni.position.top>ri._lastUiPosition.top?-pi:di);ai.x=Math.round(Ci/oi),ai.y=Math.round(xi/si);let Li=this._extraDragRow;if(this.engine.collide(ri,ai)){let Oi=this.getRow(),zi=Math.max(0,ai.y+ri.h-Oi);this.opts.maxRow&&Oi+zi>this.opts.maxRow&&(zi=Math.max(0,this.opts.maxRow-Oi)),this._extraDragRow=zi}else this._extraDragRow=0;if(this._extraDragRow!==Li&&this._updateContainerHeight(),ri.x===ai.x&&ri.y===ai.y)return}else if(ti.type==="resize"){if(ai.x<0||(bi.updateScrollResize(ti,ei,si),ai.w=Math.round((ni.size.width-ui)/oi),ai.h=Math.round((ni.size.height-di)/si),ri.w===ai.w&&ri.h===ai.h)||ri._lastTried&&ri._lastTried.w===ai.w&&ri._lastTried.h===ai.h)return;let Ei=ni.position.left+ui,Ci=ni.position.top+di;ai.x=Math.round(Ei/oi),ai.y=Math.round(Ci/si),li=!0}ri._event=ti,ri._lastTried=ai;let vi={x:ni.position.left+ui,y:ni.position.top+di,w:(ni.size?ni.size.width:ri.w*oi)-ui-ci,h:(ni.size?ni.size.height:ri.h*si)-di-pi};if(this.engine.moveNodeCheck(ri,sn(Di({},ai),{cellWidth:oi,cellHeight:si,rect:vi,resizing:li}))){ri._lastUiPosition=ni.position,this.engine.cacheRects(oi,si,di,ci,pi,ui),delete ri._skipDown,li&&ri.subGrid&&ri.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let Ei=ti.target;this._writePosAttr(Ei,ri),this._gsEventHandler[ti.type]&&this._gsEventHandler[ti.type](ti,Ei)}}_leave(ei,ti){ti=ti||ei;let ni=ti.gridstackNode;ni&&(ti.style.transform=ti.style.transformOrigin=null,Bn.off(ei,"drag"),!ni._temporaryRemoved&&(ni._temporaryRemoved=!0,this.engine.removeNode(ni),ni.el=ni._isExternal&&ti?ti:ei,ni._isExternal&&this.engine.cleanupNode(ni),this.opts.removable===!0&&ii._itemRemoving(ei,!0),ei._gridstackNodeOrig?(ei.gridstackNode=ei._gridstackNodeOrig,delete ei._gridstackNodeOrig):ni._isExternal&&this.engine.restoreInitial()))}commit(){return Sh(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}};Jr.renderCB=(ii,ei)=>{ii&&(ei!=null&&ei.content)&&(ii.textContent=ei.content)};Jr.resizeToContentParent=".grid-stack-item-content";Jr.Utils=bi;Jr.Engine=as;Jr.GDRev="11.2.0";function q_(){let ii=document.getElementById("dashboard");ii&&ii.gridstack.disable()}function W_(){let ii=document.getElementById("dashboard");ii&&ii.gridstack.enable()}function U_(ii,ei){return co(this,null,function*(){return yield Ls(ii,{layout:ei})})}function Ah(){if(document.getElementById("dashboard")==null)return;let ei=Jr.init({cellHeight:100,disableDrag:!0,disableResize:!0,draggable:{handle:".grid-stack-item-content .card-header",appendTo:"body",scroll:!0}}),ti=document.getElementById("lock_dashboard");ti&&ti.addEventListener("click",()=>{q_()});let ni=document.getElementById("unlock_dashboard");ni&&ni.addEventListener("click",()=>{W_()});let ri=document.getElementById("save_dashboard");ri!==null&&ri.addEventListener("click",()=>{let oi=ri.getAttribute("data-url");if(oi==null)return;let si=ei.save(!1);U_(oi,si).then(ai=>{rs(ai)?Po("danger","Error Saving Dashboard Config",ai.error).show():location.reload()})})}function Dh(ii,ei){switch(ii){case"images-and-labels":{tu("image.device-image",ei),tu("text.device-image-label",ei);break}case"images-only":{tu("image.device-image",ei),iu("text.device-image-label",ei);break}case"labels-only":{iu("image.device-image",ei),iu("text.device-image-label",ei);break}}}function tu(ii,ei){var ni,ri;let ti=(ri=(ni=ei.contentDocument)==null?void 0:ni.querySelectorAll(ii))!=null?ri:[];for(let oi of ti)oi.classList.remove("hidden")}function iu(ii,ei){var ni,ri;let ti=(ri=(ni=ei.contentDocument)==null?void 0:ni.querySelectorAll(ii))!=null?ri:[];for(let oi of ti)oi.classList.add("hidden")}function Y_(ii,ei){ei.set("view",ii);for(let ti of Hi(".rack_elevation"))Dh(ii,ti)}function Oh(){let ii=qc.get("view");for(let ei of Hi("select.rack-view"))ei.selectedIndex=[...ei.options].findIndex(ti=>ti.value==ii),ei.addEventListener("change",ti=>{Y_(ti.currentTarget.value,qc)},!1);for(let ei of Hi(".rack_elevation"))ei.addEventListener("load",()=>{Dh(ii,ei)})}function G_(ii){let ei=document.getElementById("selector_results");if(ei==null)return;let ti=ei.getAttribute("data-selector-target");if(ti==null)return;let ni=document.getElementById(ti);if(ni==null)return;let ri=ii.getAttribute("data-label"),oi=ii.getAttribute("data-value");ni.tomselect.addOption({id:oi,display:ri}),ni.tomselect.addItem(oi)}function Lh(){for(let ii of Hi("#selector_results a"))ii.addEventListener("click",()=>G_(ii))}function K_(){let ii=document.getElementById("quick-add-object");if(ii==null)return;let ei=ii.getAttribute("data-object-id");if(ei==null)return;let ti=ii.getAttribute("data-object-repr");if(ti==null)return;let ni=ii.getAttribute("data-target-id");if(ni==null)return;let ri=document.getElementById(ni);if(ri==null)return;ri.tomselect.addOption({id:ei,display:ti}),ri.tomselect.addItem(ei);let oi=document.getElementById("htmx-modal");if(oi){let si=io.getInstance(oi);si&&si.hide()}}function Mh(){let ii=document.getElementById("htmx-modal-content");ii&&ii.addEventListener("htmx:afterSwap",()=>K_())}function Q_(){bl(),El(),yl(),Lh(),Mh(),hl(),_l()}function kh(){document.addEventListener("htmx:afterSettle",Q_)}function X_(ii){let ei=ii.currentTarget,ti=ei.baseURI.split("?")[0],ni="?",ri=Array.from(ei.options).filter(oi=>oi.selected).map(oi=>`filter_id=${oi.value}`).join("&");ti+=`${ni}${ri}`,document.location.href=ti}function Nh(){let ii=document.getElementById("results");if(pn(ii)){let ei=document.getElementById("id_filter_id");pn(ei)&&ei.addEventListener("change",X_)}}function Rh(){for(let ii of[hl,dh,_l,Ef,Tf,yl,bh,bl,El,Eh,xh,Th,Ah,Oh,kh,Nh])ii()}function J_(){let ii=document.forms;for(let ti of ii)ti.method.toUpperCase()=="GET"&&ti.addEventListener("formdata",function(ni){let ri=ni.formData;for(let[oi,si]of Array.from(ri.entries()))si===""&&ri.delete(oi)});let ei=document.querySelector(".content-container");ei!==null&&ei.focus()}window.addEventListener("load",J_);document.readyState!=="loading"?Rh():document.addEventListener("DOMContentLoaded",Rh);})(); /*! Bundled license information: clipboard/dist/clipboard.js: @@ -26,7 +26,7 @@ bootstrap/dist/js/bootstrap.esm.js: gridstack/dist/gridstack.js: (*! - * GridStack 11.1.2 + * GridStack 11.2.0 * https://gridstackjs.com/ * * Copyright (c) 2021-2024 Alain Dumesny diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index bfe749fd719..d94269b5df2 100644 --- a/netbox/project-static/dist/netbox.js.map +++ b/netbox/project-static/dist/netbox.js.map @@ -1,6 +1,6 @@ { "version": 3, "sources": ["../node_modules/htmx.org/dist/htmx.min.js", "../node_modules/clipboard/dist/clipboard.js", "../node_modules/@popperjs/core/lib/index.js", "../node_modules/@popperjs/core/lib/enums.js", "../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../node_modules/@popperjs/core/lib/utils/math.js", "../node_modules/@popperjs/core/lib/utils/userAgent.js", "../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../node_modules/@popperjs/core/lib/utils/within.js", "../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../node_modules/@popperjs/core/lib/utils/getVariation.js", "../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../node_modules/@popperjs/core/lib/modifiers/flip.js", "../node_modules/@popperjs/core/lib/modifiers/hide.js", "../node_modules/@popperjs/core/lib/modifiers/offset.js", "../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../node_modules/@popperjs/core/lib/utils/debounce.js", "../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../node_modules/@popperjs/core/lib/createPopper.js", "../node_modules/@popperjs/core/lib/popper-lite.js", "../node_modules/@popperjs/core/lib/popper.js", "../node_modules/bootstrap/js/src/dom/data.js", "../node_modules/bootstrap/js/src/util/index.js", "../node_modules/bootstrap/js/src/dom/event-handler.js", "../node_modules/bootstrap/js/src/dom/manipulator.js", "../node_modules/bootstrap/js/src/util/config.js", "../node_modules/bootstrap/js/src/base-component.js", "../node_modules/bootstrap/js/src/dom/selector-engine.js", "../node_modules/bootstrap/js/src/util/component-functions.js", "../node_modules/bootstrap/js/src/alert.js", "../node_modules/bootstrap/js/src/button.js", "../node_modules/bootstrap/js/src/util/swipe.js", "../node_modules/bootstrap/js/src/carousel.js", "../node_modules/bootstrap/js/src/collapse.js", "../node_modules/bootstrap/js/src/dropdown.js", "../node_modules/bootstrap/js/src/util/backdrop.js", "../node_modules/bootstrap/js/src/util/focustrap.js", "../node_modules/bootstrap/js/src/util/scrollbar.js", "../node_modules/bootstrap/js/src/modal.js", "../node_modules/bootstrap/js/src/offcanvas.js", "../node_modules/bootstrap/js/src/util/sanitizer.js", "../node_modules/bootstrap/js/src/util/template-factory.js", "../node_modules/bootstrap/js/src/tooltip.js", "../node_modules/bootstrap/js/src/popover.js", "../node_modules/bootstrap/js/src/scrollspy.js", "../node_modules/bootstrap/js/src/tab.js", "../node_modules/bootstrap/js/src/toast.js", "../src/index.ts", "../node_modules/tom-select/src/contrib/microevent.ts", "../node_modules/tom-select/src/contrib/microplugin.ts", "../node_modules/@orchidjs/unicode-variants/lib/regex.ts", "../node_modules/@orchidjs/unicode-variants/lib/strings.ts", "../node_modules/@orchidjs/unicode-variants/lib/index.ts", "../node_modules/@orchidjs/sifter/lib/utils.ts", "../node_modules/@orchidjs/sifter/lib/sifter.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/contrib/highlight.ts", "../node_modules/tom-select/src/constants.ts", "../node_modules/tom-select/src/defaults.ts", "../node_modules/tom-select/src/getSettings.ts", "../node_modules/tom-select/src/tom-select.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/plugins/change_listener/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/checkbox_options/plugin.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/clear_button/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/drag_drop/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/dropdown_header/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/caret_position/plugin.ts", "../node_modules/tom-select/src/constants.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/dropdown_input/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/plugins/input_autogrow/plugin.ts", "../node_modules/tom-select/src/plugins/no_backspace_delete/plugin.ts", "../node_modules/tom-select/src/plugins/no_active_items/plugin.ts", "../node_modules/tom-select/src/constants.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/optgroup_columns/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/remove_button/plugin.ts", "../node_modules/tom-select/src/plugins/restore_on_backspace/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/virtual_scroll/plugin.ts", "../node_modules/tom-select/src/tom-select.complete.ts", "../src/util.ts", "../src/forms/elements.ts", "../src/forms/speedSelector.ts", "../src/forms/index.ts", "../src/bs.ts", "../src/search.ts", "../src/select/config.ts", "../src/select/static.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/query-string/base.js", "../node_modules/decode-uri-component/index.js", "../node_modules/filter-obj/index.js", "../node_modules/split-on-first/index.js", "../node_modules/query-string/index.js", "../src/select/types.ts", "../src/select/classes/dynamicParamsMap.ts", "../src/select/classes/dynamicTomSelect.ts", "../src/select/dynamic.ts", "../src/select/index.ts", "../src/buttons/connectionToggle.ts", "../src/state/index.ts", "../src/stores/objectDepth.ts", "../src/stores/rackImages.ts", "../src/stores/previousPkCheck.ts", "../src/stores/secret.ts", "../src/buttons/depthToggle.ts", "../src/buttons/moveOptions.ts", "../src/buttons/reslug.ts", "../src/buttons/selectAll.ts", "../src/buttons/floatBulk.ts", "../src/buttons/selectMultiple.ts", "../src/buttons/markdownPreview.ts", "../src/buttons/secretToggle.ts", "../src/buttons/index.ts", "../src/colorMode.ts", "../src/messages.ts", "../src/clipboard.ts", "../node_modules/flatpickr/dist/esm/types/options.js", "../node_modules/flatpickr/dist/esm/l10n/default.js", "../node_modules/flatpickr/dist/esm/utils/index.js", "../node_modules/flatpickr/dist/esm/utils/dom.js", "../node_modules/flatpickr/dist/esm/utils/formatting.js", "../node_modules/flatpickr/dist/esm/utils/dates.js", "../node_modules/flatpickr/dist/esm/utils/polyfills.js", "../node_modules/flatpickr/dist/esm/index.js", "../src/dateSelector.ts", "../src/tableConfig.ts", "../src/tables/interfaceTable.ts", "../src/sidenav.ts", "../node_modules/gridstack/src/utils.ts", "../node_modules/gridstack/src/gridstack-engine.ts", "../node_modules/gridstack/src/types.ts", "../node_modules/gridstack/src/dd-manager.ts", "../node_modules/gridstack/src/dd-touch.ts", "../node_modules/gridstack/src/dd-resizable-handle.ts", "../node_modules/gridstack/src/dd-base-impl.ts", "../node_modules/gridstack/src/dd-resizable.ts", "../node_modules/gridstack/src/dd-draggable.ts", "../node_modules/gridstack/src/dd-droppable.ts", "../node_modules/gridstack/src/dd-element.ts", "../node_modules/gridstack/src/dd-gridstack.ts", "../node_modules/gridstack/src/gridstack.ts", "../src/dashboard.ts", "../src/racks.ts", "../src/objectSelector.ts", "../src/quickAdd.ts", "../src/htmx.ts", "../src/forms/savedFiltersSelect.ts", "../src/netbox.ts"], - "mappings": "20CAAA,IAAAA,GAAAC,GAAA,oBAAC,SAASC,GAAEC,GAAE,CAAI,OAAO,QAAS,YAAY,OAAO,IAAK,OAAO,CAAC,EAAEA,EAAC,EAAU,OAAO,QAAS,UAAU,OAAO,QAAS,OAAO,QAAQA,GAAE,EAAOD,GAAE,KAAKA,GAAE,MAAMC,GAAE,CAAE,GAAG,OAAO,MAAO,YAAY,KAAK,QAAK,UAAU,CAAC,OAAO,UAAU,CAAC,aAAa,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,GAAG,GAAG,GAAG,IAAI,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,SAASD,GAAEC,GAAE,CAAC,IAAIC,GAAE,GAAGF,GAAEC,IAAG,MAAM,EAAE,OAAOC,GAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,eAAe,GAAK,iBAAiB,GAAG,qBAAqB,GAAM,iBAAiB,YAAY,iBAAiB,EAAE,mBAAmB,GAAG,uBAAuB,GAAK,eAAe,iBAAiB,aAAa,eAAe,WAAW,aAAa,cAAc,gBAAgB,cAAc,gBAAgB,UAAU,GAAK,gBAAgB,GAAK,kBAAkB,GAAG,mBAAmB,CAAC,QAAQ,QAAQ,QAAQ,QAAQ,EAAE,gBAAgB,GAAM,QAAQ,EAAE,iBAAiB,cAAc,aAAa,OAAO,gBAAgB,kCAAkC,qBAAqB,GAAM,eAAe,SAAS,mBAAmB,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,CAACE,GAAMC,EAAK,IAAK,MAAM,KAAKF,GAAS,QAAQ,CAAC,EACnDE,KAAU,IAAIF,GAAS,OAAOC,EAAI,CAE1C,CAAC,EAIL,IAAME,GAAmB,SAAS,cAA2B,oBAAoB,EAC7EA,KAAqB,MAEvBA,GAAiB,MAAM,CAE3B,CAEA,OAAO,iBAAiB,OAAQP,EAAU,EAEtC,SAAS,aAAe,UAC1BlB,GAAa,EAEb,SAAS,iBAAiB,mBAAoBA,EAAY", - "names": ["require_htmx_min", "__commonJSMin", "e", "t", "r", "n", "i", "a", "o", "s", "l", "u", "f", "c", "h", "v", "M", "X", "d", "D", "U", "g", "p", "m", "x", "B", "F", "V", "y", "b", "w", "j", "S", "E", "_", "C", "R", "z", "$", "T", "O", "W", "q", "H", "G", "J", "L", "A", "Z", "N", "K", "I", "k", "P", "Y", "require_clipboard", "__commonJSMin", "exports", "module", "root", "factory", "__webpack_modules__", "__unused_webpack_module", "__webpack_exports__", "__webpack_require__", "clipboard", "tiny_emitter", "tiny_emitter_default", "listen", "listen_default", "src_select", "select_default", "command", "type", "err", "ClipboardActionCut", "target", "selectedText", "actions_cut", "createFakeElement", "value", "isRTL", "fakeElement", "yPosition", "fakeCopyAction", "options", "ClipboardActionCopy", "actions_copy", "_typeof", "obj", "ClipboardActionDefault", "_options$action", "action", "container", "text", "actions_default", "clipboard_typeof", "_classCallCheck", "instance", "Constructor", "_defineProperties", "props", "i", "descriptor", "_createClass", "protoProps", "staticProps", "_inherits", "subClass", "superClass", "_setPrototypeOf", "o", "p", "_createSuper", "Derived", "hasNativeReflectConstruct", "_isNativeReflectConstruct", "Super", "_getPrototypeOf", "result", "NewTarget", "_possibleConstructorReturn", "self", "call", "_assertThisInitialized", "e", "getAttributeValue", "suffix", "element", "attribute", "Clipboard", "_Emitter", "_super", "trigger", "_this", "_this2", "selector", "actions", "support", "DOCUMENT_NODE_TYPE", "proto", "closest", "__unused_webpack_exports", "_delegate", "callback", "useCapture", "listenerFn", "listener", "delegate", "elements", "is", "listenNode", "listenNodeList", "listenSelector", "node", "nodeList", "select", "isReadOnly", "selection", "range", "E", "name", "ctx", "data", "evtArr", "len", "evts", "liveEvents", "__webpack_module_cache__", "moduleId", "getter", "definition", "key", "prop", "lib_exports", "__export", "afterMain", "afterRead", "afterWrite", "applyStyles_default", "arrow_default", "auto", "basePlacements", "beforeMain", "beforeRead", "beforeWrite", "bottom", "clippingParents", "computeStyles_default", "createPopper", "detectOverflow", "end", "eventListeners_default", "flip_default", "hide_default", "left", "main", "modifierPhases", "offset_default", "placements", "popper", "popperGenerator", "popperOffsets_default", "preventOverflow_default", "read", "reference", "right", "start", "top", "variationPlacements", "viewport", "write", "top", "bottom", "right", "left", "auto", "basePlacements", "start", "end", "clippingParents", "viewport", "popper", "reference", "variationPlacements", "acc", "placement", "placements", "beforeRead", "read", "afterRead", "beforeMain", "main", "afterMain", "beforeWrite", "write", "afterWrite", "modifierPhases", "getNodeName", "element", "getWindow", "node", "ownerDocument", "isElement", "node", "OwnElement", "getWindow", "isHTMLElement", "isShadowRoot", "applyStyles", "_ref", "state", "name", "style", "attributes", "element", "isHTMLElement", "getNodeName", "value", "effect", "_ref2", "initialStyles", "styleProperties", "property", "attribute", "applyStyles_default", "getBasePlacement", "placement", "max", "min", "round", "getUAString", "uaData", "item", "isLayoutViewport", "getUAString", "getBoundingClientRect", "element", "includeScale", "isFixedStrategy", "clientRect", "scaleX", "scaleY", "isHTMLElement", "round", "_ref", "isElement", "getWindow", "visualViewport", "addVisualOffsets", "isLayoutViewport", "x", "y", "width", "height", "getLayoutRect", "element", "clientRect", "getBoundingClientRect", "width", "height", "contains", "parent", "child", "rootNode", "isShadowRoot", "next", "getComputedStyle", "element", "getWindow", "isTableElement", "element", "getNodeName", "getDocumentElement", "element", "isElement", "getParentNode", "element", "getNodeName", "isShadowRoot", "getDocumentElement", "getTrueOffsetParent", "element", "isHTMLElement", "getComputedStyle", "getContainingBlock", "isFirefox", "getUAString", "isIE", "elementCss", "currentNode", "getParentNode", "isShadowRoot", "getNodeName", "css", "getOffsetParent", "window", "getWindow", "offsetParent", "isTableElement", "getMainAxisFromPlacement", "placement", "within", "min", "value", "max", "withinMaxClamp", "v", "getFreshSideObject", "mergePaddingObject", "paddingObject", "getFreshSideObject", "expandToHashMap", "value", "keys", "hashMap", "key", "toPaddingObject", "padding", "state", "mergePaddingObject", "expandToHashMap", "basePlacements", "arrow", "_ref", "_state$modifiersData$", "name", "options", "arrowElement", "popperOffsets", "basePlacement", "getBasePlacement", "axis", "getMainAxisFromPlacement", "isVertical", "left", "right", "len", "paddingObject", "arrowRect", "getLayoutRect", "minProp", "top", "maxProp", "bottom", "endDiff", "startDiff", "arrowOffsetParent", "getOffsetParent", "clientSize", "centerToReference", "min", "max", "center", "offset", "within", "axisProp", "effect", "_ref2", "_options$element", "contains", "arrow_default", "getVariation", "placement", "unsetSides", "roundOffsetsByDPR", "_ref", "win", "x", "y", "dpr", "round", "mapToStyles", "_ref2", "_Object$assign2", "popper", "popperRect", "placement", "variation", "offsets", "position", "gpuAcceleration", "adaptive", "roundOffsets", "isFixed", "_offsets$x", "_offsets$y", "_ref3", "hasX", "hasY", "sideX", "left", "sideY", "top", "offsetParent", "getOffsetParent", "heightProp", "widthProp", "getWindow", "getDocumentElement", "getComputedStyle", "right", "end", "bottom", "offsetY", "offsetX", "commonStyles", "_ref4", "_Object$assign", "computeStyles", "_ref5", "state", "options", "_options$gpuAccelerat", "_options$adaptive", "_options$roundOffsets", "getBasePlacement", "getVariation", "computeStyles_default", "passive", "effect", "_ref", "state", "instance", "options", "_options$scroll", "scroll", "_options$resize", "resize", "window", "getWindow", "scrollParents", "scrollParent", "eventListeners_default", "hash", "getOppositePlacement", "placement", "matched", "hash", "getOppositeVariationPlacement", "placement", "matched", "getWindowScroll", "node", "win", "getWindow", "scrollLeft", "scrollTop", "getWindowScrollBarX", "element", "getBoundingClientRect", "getDocumentElement", "getWindowScroll", "getViewportRect", "element", "strategy", "win", "getWindow", "html", "getDocumentElement", "visualViewport", "width", "height", "x", "y", "layoutViewport", "isLayoutViewport", "getWindowScrollBarX", "getDocumentRect", "element", "_element$ownerDocumen", "html", "getDocumentElement", "winScroll", "getWindowScroll", "body", "width", "max", "height", "x", "getWindowScrollBarX", "y", "getComputedStyle", "isScrollParent", "element", "_getComputedStyle", "getComputedStyle", "overflow", "overflowX", "overflowY", "getScrollParent", "node", "getNodeName", "isHTMLElement", "isScrollParent", "getParentNode", "listScrollParents", "element", "list", "_element$ownerDocumen", "scrollParent", "getScrollParent", "isBody", "win", "getWindow", "target", "isScrollParent", "updatedList", "getParentNode", "rectToClientRect", "rect", "getInnerBoundingClientRect", "element", "strategy", "rect", "getBoundingClientRect", "getClientRectFromMixedType", "clippingParent", "viewport", "rectToClientRect", "getViewportRect", "isElement", "getDocumentRect", "getDocumentElement", "getClippingParents", "clippingParents", "listScrollParents", "getParentNode", "canEscapeClipping", "getComputedStyle", "clipperElement", "isHTMLElement", "getOffsetParent", "contains", "getNodeName", "getClippingRect", "boundary", "rootBoundary", "mainClippingParents", "firstClippingParent", "clippingRect", "accRect", "max", "min", "computeOffsets", "_ref", "reference", "element", "placement", "basePlacement", "getBasePlacement", "variation", "getVariation", "commonX", "commonY", "offsets", "top", "bottom", "right", "left", "mainAxis", "getMainAxisFromPlacement", "len", "start", "end", "detectOverflow", "state", "options", "_options", "_options$placement", "placement", "_options$strategy", "strategy", "_options$boundary", "boundary", "clippingParents", "_options$rootBoundary", "rootBoundary", "viewport", "_options$elementConte", "elementContext", "popper", "_options$altBoundary", "altBoundary", "_options$padding", "padding", "paddingObject", "mergePaddingObject", "expandToHashMap", "basePlacements", "altContext", "reference", "popperRect", "element", "clippingClientRect", "getClippingRect", "isElement", "getDocumentElement", "referenceClientRect", "getBoundingClientRect", "popperOffsets", "computeOffsets", "popperClientRect", "rectToClientRect", "elementClientRect", "overflowOffsets", "offsetData", "offset", "key", "multiply", "right", "bottom", "axis", "top", "computeAutoPlacement", "state", "options", "_options", "placement", "boundary", "rootBoundary", "padding", "flipVariations", "_options$allowedAutoP", "allowedAutoPlacements", "placements", "variation", "getVariation", "variationPlacements", "basePlacements", "allowedPlacements", "overflows", "acc", "detectOverflow", "getBasePlacement", "a", "b", "getExpandedFallbackPlacements", "placement", "getBasePlacement", "auto", "oppositePlacement", "getOppositePlacement", "getOppositeVariationPlacement", "flip", "_ref", "state", "options", "name", "_options$mainAxis", "checkMainAxis", "_options$altAxis", "checkAltAxis", "specifiedFallbackPlacements", "padding", "boundary", "rootBoundary", "altBoundary", "_options$flipVariatio", "flipVariations", "allowedAutoPlacements", "preferredPlacement", "basePlacement", "isBasePlacement", "fallbackPlacements", "placements", "acc", "computeAutoPlacement", "referenceRect", "popperRect", "checksMap", "makeFallbackChecks", "firstFittingPlacement", "i", "_basePlacement", "isStartVariation", "getVariation", "start", "isVertical", "top", "bottom", "len", "overflow", "detectOverflow", "mainVariationSide", "right", "left", "altVariationSide", "checks", "check", "numberOfChecks", "_loop", "_i", "fittingPlacement", "_ret", "flip_default", "getSideOffsets", "overflow", "rect", "preventedOffsets", "isAnySideFullyClipped", "top", "right", "bottom", "left", "side", "hide", "_ref", "state", "name", "referenceRect", "popperRect", "referenceOverflow", "detectOverflow", "popperAltOverflow", "referenceClippingOffsets", "popperEscapeOffsets", "isReferenceHidden", "hasPopperEscaped", "hide_default", "distanceAndSkiddingToXY", "placement", "rects", "offset", "basePlacement", "getBasePlacement", "invertDistance", "left", "top", "_ref", "skidding", "distance", "right", "_ref2", "state", "options", "name", "_options$offset", "data", "placements", "acc", "_data$state$placement", "x", "y", "offset_default", "popperOffsets", "_ref", "state", "name", "computeOffsets", "popperOffsets_default", "getAltAxis", "axis", "preventOverflow", "_ref", "state", "options", "name", "_options$mainAxis", "checkMainAxis", "_options$altAxis", "checkAltAxis", "boundary", "rootBoundary", "altBoundary", "padding", "_options$tether", "tether", "_options$tetherOffset", "tetherOffset", "overflow", "detectOverflow", "basePlacement", "getBasePlacement", "variation", "getVariation", "isBasePlacement", "mainAxis", "getMainAxisFromPlacement", "altAxis", "getAltAxis", "popperOffsets", "referenceRect", "popperRect", "tetherOffsetValue", "normalizedTetherOffsetValue", "offsetModifierState", "data", "_offsetModifierState$", "mainSide", "top", "left", "altSide", "bottom", "right", "len", "offset", "min", "max", "additive", "minLen", "start", "maxLen", "arrowElement", "arrowRect", "getLayoutRect", "arrowPaddingObject", "getFreshSideObject", "arrowPaddingMin", "arrowPaddingMax", "arrowLen", "within", "minOffset", "maxOffset", "arrowOffsetParent", "getOffsetParent", "clientOffset", "offsetModifierValue", "tetherMin", "tetherMax", "preventedOffset", "_offsetModifierState$2", "_mainSide", "_altSide", "_offset", "_len", "_min", "_max", "isOriginSide", "_offsetModifierValue", "_tetherMin", "_tetherMax", "_preventedOffset", "withinMaxClamp", "preventOverflow_default", "getHTMLElementScroll", "element", "getNodeScroll", "node", "getWindow", "isHTMLElement", "getWindowScroll", "getHTMLElementScroll", "isElementScaled", "element", "rect", "scaleX", "round", "scaleY", "getCompositeRect", "elementOrVirtualElement", "offsetParent", "isFixed", "isOffsetParentAnElement", "isHTMLElement", "offsetParentIsScaled", "documentElement", "getDocumentElement", "getBoundingClientRect", "scroll", "offsets", "getNodeName", "isScrollParent", "getNodeScroll", "getWindowScrollBarX", "order", "modifiers", "map", "visited", "result", "modifier", "sort", "requires", "dep", "depModifier", "orderModifiers", "orderedModifiers", "modifierPhases", "acc", "phase", "debounce", "fn", "pending", "resolve", "mergeByName", "modifiers", "merged", "current", "existing", "key", "DEFAULT_OPTIONS", "areValidElements", "_len", "args", "_key", "element", "popperGenerator", "generatorOptions", "_generatorOptions", "_generatorOptions$def", "defaultModifiers", "_generatorOptions$def2", "defaultOptions", "reference", "popper", "options", "state", "effectCleanupFns", "isDestroyed", "instance", "setOptionsAction", "cleanupModifierEffects", "isElement", "listScrollParents", "orderedModifiers", "orderModifiers", "mergeByName", "m", "runModifierEffects", "_state$elements", "getCompositeRect", "getOffsetParent", "getLayoutRect", "modifier", "index", "_state$orderedModifie", "fn", "_state$orderedModifie2", "_options", "name", "debounce", "resolve", "_ref", "_ref$options", "effect", "cleanupFn", "noopFn", "createPopper", "defaultModifiers", "eventListeners_default", "popperOffsets_default", "computeStyles_default", "applyStyles_default", "createPopper", "popperGenerator", "defaultModifiers", "eventListeners_default", "popperOffsets_default", "computeStyles_default", "applyStyles_default", "offset_default", "flip_default", "preventOverflow_default", "arrow_default", "hide_default", "createPopper", "popperGenerator", "elementMap", "Map", "Data", "set", "element", "key", "instance", "has", "instanceMap", "get", "size", "console", "error", "Array", "from", "keys", "remove", "delete", "MAX_UID", "MILLISECONDS_MULTIPLIER", "TRANSITION_END", "parseSelector", "selector", "window", "CSS", "escape", "replace", "match", "id", "toType", "object", "Object", "prototype", "toString", "call", "toLowerCase", "getUID", "prefix", "Math", "floor", "random", "document", "getElementById", "getTransitionDurationFromElement", "transitionDuration", "transitionDelay", "getComputedStyle", "floatTransitionDuration", "Number", "parseFloat", "floatTransitionDelay", "split", "triggerTransitionEnd", "dispatchEvent", "Event", "isElement", "jquery", "nodeType", "getElement", "length", "querySelector", "isVisible", "getClientRects", "elementIsVisible", "getPropertyValue", "closedDetails", "closest", "summary", "parentNode", "isDisabled", "Node", "ELEMENT_NODE", "classList", "contains", "disabled", "hasAttribute", "getAttribute", "findShadowRoot", "documentElement", "attachShadow", "getRootNode", "root", "ShadowRoot", "noop", "reflow", "offsetHeight", "getjQuery", "jQuery", "body", "DOMContentLoadedCallbacks", "onDOMContentLoaded", "callback", "readyState", "addEventListener", "push", "isRTL", "dir", "defineJQueryPlugin", "plugin", "$", "name", "NAME", "JQUERY_NO_CONFLICT", "fn", "jQueryInterface", "Constructor", "noConflict", "execute", "possibleCallback", "args", "defaultValue", "executeAfterTransition", "transitionElement", "waitForTransition", "emulatedDuration", "called", "handler", "target", "removeEventListener", "setTimeout", "getNextActiveElement", "list", "activeElement", "shouldGetNext", "isCycleAllowed", "listLength", "index", "indexOf", "max", "min", "namespaceRegex", "stripNameRegex", "stripUidRegex", "eventRegistry", "uidEvent", "customEvents", "mouseenter", "mouseleave", "nativeEvents", "Set", "makeEventUid", "uid", "getElementEvents", "bootstrapHandler", "event", "hydrateObj", "delegateTarget", "oneOff", "EventHandler", "off", "type", "apply", "bootstrapDelegationHandler", "domElements", "querySelectorAll", "domElement", "findHandler", "events", "callable", "delegationSelector", "values", "find", "normalizeParameters", "originalTypeEvent", "delegationFunction", "isDelegated", "typeEvent", "getTypeEvent", "addHandler", "relatedTarget", "handlers", "previousFunction", "removeHandler", "Boolean", "removeNamespacedHandlers", "namespace", "storeElementEvent", "handlerKey", "entries", "includes", "on", "one", "inNamespace", "isNamespace", "startsWith", "elementEvent", "slice", "keyHandlers", "trigger", "jQueryEvent", "bubbles", "nativeDispatch", "defaultPrevented", "isPropagationStopped", "isImmediatePropagationStopped", "isDefaultPrevented", "evt", "cancelable", "preventDefault", "obj", "meta", "value", "_unused", "defineProperty", "configurable", "normalizeData", "JSON", "parse", "decodeURIComponent", "normalizeDataKey", "chr", "Manipulator", "setDataAttribute", "setAttribute", "removeDataAttribute", "removeAttribute", "getDataAttributes", "attributes", "bsKeys", "dataset", "filter", "pureKey", "charAt", "getDataAttribute", "Config", "Default", "DefaultType", "Error", "_getConfig", "config", "_mergeConfigObj", "_configAfterMerge", "_typeCheckConfig", "jsonConfig", "__spreadValues", "constructor", "configTypes", "property", "expectedTypes", "valueType", "RegExp", "test", "TypeError", "toUpperCase", "VERSION", "BaseComponent", "_element", "_config", "DATA_KEY", "dispose", "EVENT_KEY", "propertyName", "getOwnPropertyNames", "_queueCallback", "isAnimated", "getInstance", "getOrCreateInstance", "eventName", "getSelector", "hrefAttribute", "trim", "map", "sel", "join", "SelectorEngine", "concat", "Element", "findOne", "children", "child", "matches", "parents", "ancestor", "prev", "previous", "previousElementSibling", "next", "nextElementSibling", "focusableChildren", "focusables", "el", "getSelectorFromElement", "getElementFromSelector", "getMultipleElementsFromSelector", "enableDismissTrigger", "component", "method", "clickEvent", "tagName", "EVENT_CLOSE", "EVENT_CLOSED", "CLASS_NAME_FADE", "CLASS_NAME_SHOW", "Alert", "close", "_destroyElement", "each", "data", "undefined", "DATA_API_KEY", "CLASS_NAME_ACTIVE", "SELECTOR_DATA_TOGGLE", "EVENT_CLICK_DATA_API", "Button", "toggle", "button", "EVENT_TOUCHSTART", "EVENT_TOUCHMOVE", "EVENT_TOUCHEND", "EVENT_POINTERDOWN", "EVENT_POINTERUP", "POINTER_TYPE_TOUCH", "POINTER_TYPE_PEN", "CLASS_NAME_POINTER_EVENT", "SWIPE_THRESHOLD", "endCallback", "leftCallback", "rightCallback", "Swipe", "isSupported", "_deltaX", "_supportPointerEvents", "PointerEvent", "_initEvents", "_start", "touches", "clientX", "_eventIsPointerPenTouch", "_end", "_handleSwipe", "_move", "absDeltaX", "abs", "direction", "add", "pointerType", "navigator", "maxTouchPoints", "ARROW_LEFT_KEY", "ARROW_RIGHT_KEY", "TOUCHEVENT_COMPAT_WAIT", "ORDER_NEXT", "ORDER_PREV", "DIRECTION_LEFT", "DIRECTION_RIGHT", "EVENT_SLIDE", "EVENT_SLID", "EVENT_KEYDOWN", "EVENT_MOUSEENTER", "EVENT_MOUSELEAVE", "EVENT_DRAG_START", "EVENT_LOAD_DATA_API", "CLASS_NAME_CAROUSEL", "CLASS_NAME_SLIDE", "CLASS_NAME_END", "CLASS_NAME_START", "CLASS_NAME_NEXT", "CLASS_NAME_PREV", "SELECTOR_ACTIVE", "SELECTOR_ITEM", "SELECTOR_ACTIVE_ITEM", "SELECTOR_ITEM_IMG", "SELECTOR_INDICATORS", "SELECTOR_DATA_SLIDE", "SELECTOR_DATA_RIDE", "KEY_TO_DIRECTION", "interval", "keyboard", "pause", "ride", "touch", "wrap", "Carousel", "_interval", "_activeElement", "_isSliding", "touchTimeout", "_swipeHelper", "_indicatorsElement", "_addEventListeners", "cycle", "_slide", "nextWhenVisible", "hidden", "_clearInterval", "_updateInterval", "setInterval", "_maybeEnableCycle", "to", "items", "_getItems", "activeIndex", "_getItemIndex", "_getActive", "order", "defaultInterval", "_keydown", "_addTouchEventListeners", "img", "swipeConfig", "_directionToOrder", "endCallBack", "clearTimeout", "_setActiveIndicatorElement", "activeIndicator", "newActiveIndicator", "elementInterval", "parseInt", "isNext", "nextElement", "nextElementIndex", "triggerEvent", "_orderToDirection", "isCycling", "directionalClassName", "orderClassName", "completeCallBack", "_isAnimated", "clearInterval", "carousel", "slideIndex", "carousels", "EVENT_SHOW", "EVENT_SHOWN", "EVENT_HIDE", "EVENT_HIDDEN", "CLASS_NAME_COLLAPSE", "CLASS_NAME_COLLAPSING", "CLASS_NAME_COLLAPSED", "CLASS_NAME_DEEPER_CHILDREN", "CLASS_NAME_HORIZONTAL", "WIDTH", "HEIGHT", "SELECTOR_ACTIVES", "parent", "Collapse", "_isTransitioning", "_triggerArray", "toggleList", "elem", "filterElement", "foundElement", "_initializeChildren", "_addAriaAndCollapsedClass", "_isShown", "hide", "show", "activeChildren", "_getFirstLevelChildren", "activeInstance", "dimension", "_getDimension", "style", "complete", "scrollSize", "getBoundingClientRect", "selected", "triggerArray", "isOpen", "ESCAPE_KEY", "TAB_KEY", "ARROW_UP_KEY", "ARROW_DOWN_KEY", "RIGHT_MOUSE_BUTTON", "EVENT_KEYDOWN_DATA_API", "EVENT_KEYUP_DATA_API", "CLASS_NAME_DROPUP", "CLASS_NAME_DROPEND", "CLASS_NAME_DROPSTART", "CLASS_NAME_DROPUP_CENTER", "CLASS_NAME_DROPDOWN_CENTER", "SELECTOR_DATA_TOGGLE_SHOWN", "SELECTOR_MENU", "SELECTOR_NAVBAR", "SELECTOR_NAVBAR_NAV", "SELECTOR_VISIBLE_ITEMS", "PLACEMENT_TOP", "PLACEMENT_TOPEND", "PLACEMENT_BOTTOM", "PLACEMENT_BOTTOMEND", "PLACEMENT_RIGHT", "PLACEMENT_LEFT", "PLACEMENT_TOPCENTER", "PLACEMENT_BOTTOMCENTER", "autoClose", "boundary", "display", "offset", "popperConfig", "reference", "Dropdown", "_popper", "_parent", "_menu", "_inNavbar", "_detectNavbar", "showEvent", "_createPopper", "focus", "_completeHide", "destroy", "update", "hideEvent", "Popper", "referenceElement", "_getPopperConfig", "createPopper", "_getPlacement", "parentDropdown", "isEnd", "_getOffset", "popperData", "defaultBsPopperConfig", "placement", "modifiers", "options", "enabled", "_selectMenuItem", "clearMenus", "openToggles", "context", "composedPath", "isMenuTarget", "dataApiKeydownHandler", "isInput", "isEscapeEvent", "isUpOrDownEvent", "getToggleButton", "stopPropagation", "EVENT_MOUSEDOWN", "className", "clickCallback", "rootElement", "Backdrop", "_isAppended", "_append", "_getElement", "_emulateAnimation", "backdrop", "createElement", "append", "EVENT_FOCUSIN", "EVENT_KEYDOWN_TAB", "TAB_NAV_FORWARD", "TAB_NAV_BACKWARD", "autofocus", "trapElement", "FocusTrap", "_isActive", "_lastTabNavDirection", "activate", "_handleFocusin", "_handleKeydown", "deactivate", "elements", "shiftKey", "SELECTOR_FIXED_CONTENT", "SELECTOR_STICKY_CONTENT", "PROPERTY_PADDING", "PROPERTY_MARGIN", "ScrollBarHelper", "getWidth", "documentWidth", "clientWidth", "innerWidth", "width", "_disableOverFlow", "_setElementAttributes", "calculatedValue", "reset", "_resetElementAttributes", "isOverflowing", "_saveInitialAttribute", "overflow", "styleProperty", "scrollbarWidth", "manipulationCallBack", "setProperty", "_applyManipulationCallback", "actualValue", "removeProperty", "callBack", "EVENT_HIDE_PREVENTED", "EVENT_RESIZE", "EVENT_CLICK_DISMISS", "EVENT_MOUSEDOWN_DISMISS", "EVENT_KEYDOWN_DISMISS", "CLASS_NAME_OPEN", "CLASS_NAME_STATIC", "OPEN_SELECTOR", "SELECTOR_DIALOG", "SELECTOR_MODAL_BODY", "Modal", "_dialog", "_backdrop", "_initializeBackDrop", "_focustrap", "_initializeFocusTrap", "_scrollBar", "_adjustDialog", "_showElement", "_hideModal", "handleUpdate", "scrollTop", "modalBody", "transitionComplete", "_triggerBackdropTransition", "event2", "_resetAdjustments", "isModalOverflowing", "scrollHeight", "clientHeight", "initialOverflowY", "overflowY", "isBodyOverflowing", "paddingLeft", "paddingRight", "alreadyOpen", "CLASS_NAME_SHOWING", "CLASS_NAME_HIDING", "CLASS_NAME_BACKDROP", "scroll", "Offcanvas", "blur", "completeCallback", "position", "ARIA_ATTRIBUTE_PATTERN", "DefaultAllowlist", "a", "area", "b", "br", "col", "code", "dd", "div", "dl", "dt", "em", "hr", "h1", "h2", "h3", "h4", "h5", "h6", "i", "li", "ol", "p", "pre", "s", "small", "span", "sub", "sup", "strong", "u", "ul", "uriAttributes", "SAFE_URL_PATTERN", "allowedAttribute", "attribute", "allowedAttributeList", "attributeName", "nodeName", "nodeValue", "attributeRegex", "some", "regex", "sanitizeHtml", "unsafeHtml", "allowList", "sanitizeFunction", "createdDocument", "DOMParser", "parseFromString", "elementName", "attributeList", "allowedAttributes", "innerHTML", "content", "extraClass", "html", "sanitize", "sanitizeFn", "template", "DefaultContentType", "entry", "TemplateFactory", "getContent", "_resolvePossibleFunction", "hasContent", "changeContent", "_checkContent", "toHtml", "templateWrapper", "_maybeSanitize", "text", "_setContent", "arg", "templateElement", "_putElementInTemplate", "textContent", "DISALLOWED_ATTRIBUTES", "CLASS_NAME_MODAL", "SELECTOR_TOOLTIP_INNER", "SELECTOR_MODAL", "EVENT_MODAL_HIDE", "TRIGGER_HOVER", "TRIGGER_FOCUS", "TRIGGER_CLICK", "TRIGGER_MANUAL", "EVENT_INSERTED", "EVENT_CLICK", "EVENT_FOCUSOUT", "AttachmentMap", "AUTO", "TOP", "RIGHT", "BOTTOM", "LEFT", "animation", "container", "customClass", "delay", "fallbackPlacements", "title", "Tooltip", "_isEnabled", "_timeout", "_isHovered", "_activeTrigger", "_templateFactory", "_newContent", "tip", "_setListeners", "_fixTitle", "enable", "disable", "toggleEnabled", "click", "_leave", "_enter", "_hideModalHandler", "_disposePopper", "_isWithContent", "isInTheDom", "ownerDocument", "_getTipElement", "_isWithActiveTrigger", "_getTitle", "_createTipElement", "_getContentForTemplate", "_getTemplateFactory", "tipId", "setContent", "__spreadProps", "_initializeOnDelegatedTarget", "_getDelegateConfig", "attachment", "phase", "state", "triggers", "eventIn", "eventOut", "_setTimeout", "timeout", "dataAttributes", "dataAttribute", "SELECTOR_TITLE", "SELECTOR_CONTENT", "Popover", "_getContent", "EVENT_ACTIVATE", "CLASS_NAME_DROPDOWN_ITEM", "SELECTOR_DATA_SPY", "SELECTOR_TARGET_LINKS", "SELECTOR_NAV_LIST_GROUP", "SELECTOR_NAV_LINKS", "SELECTOR_NAV_ITEMS", "SELECTOR_LIST_ITEMS", "SELECTOR_LINK_ITEMS", "SELECTOR_DROPDOWN", "SELECTOR_DROPDOWN_TOGGLE", "rootMargin", "smoothScroll", "threshold", "ScrollSpy", "_targetLinks", "_observableSections", "_rootElement", "_activeTarget", "_observer", "_previousScrollData", "visibleEntryTop", "parentScrollTop", "refresh", "_initializeTargetsAndObservables", "_maybeEnableSmoothScroll", "disconnect", "_getNewObserver", "section", "observe", "observableSection", "hash", "height", "offsetTop", "scrollTo", "top", "behavior", "IntersectionObserver", "_observerCallback", "targetElement", "_process", "userScrollsDown", "isIntersecting", "_clearActiveClass", "entryIsLowerThanPrevious", "targetLinks", "anchor", "decodeURI", "_activateParents", "listGroup", "item", "activeNodes", "node", "spy", "HOME_KEY", "END_KEY", "CLASS_DROPDOWN", "SELECTOR_DROPDOWN_MENU", "NOT_SELECTOR_DROPDOWN_TOGGLE", "SELECTOR_TAB_PANEL", "SELECTOR_OUTER", "SELECTOR_INNER", "SELECTOR_INNER_ELEM", "SELECTOR_DATA_TOGGLE_ACTIVE", "Tab", "_setInitialAttributes", "_getChildren", "innerElem", "_elemIsActive", "active", "_getActiveElem", "_deactivate", "_activate", "relatedElem", "_toggleDropDown", "nextActiveElement", "preventScroll", "_setAttributeIfNotExists", "_setInitialAttributesOnChild", "_getInnerElement", "isActive", "outerElem", "_getOuterElement", "_setInitialAttributesOnTargetPanel", "open", "EVENT_MOUSEOVER", "EVENT_MOUSEOUT", "CLASS_NAME_HIDE", "autohide", "Toast", "_hasMouseInteraction", "_hasKeyboardInteraction", "_clearTimeout", "_maybeScheduleHide", "isShown", "_onInteraction", "isInteracting", "import_htmx", "forEvents", "events", "callback", "event", "MicroEvent", "fct", "event_array", "n", "args", "self", "MicroPlugin", "Interface", "name", "fn", "plugins", "key", "self", "queue", "plugin", "arrayToPattern", "chars", "maxValueLength", "sequencePattern", "array", "hasDuplicates", "pattern", "prev_char_count", "prev_pattern", "char", "i", "setToPattern", "escape_regex", "str", "longest", "value", "unicodeLength", "allSubstrings", "input", "result", "start", "subresult", "tmp", "code_points", "accent_pat", "unicode_map", "multi_char_reg", "max_char_length", "latin_convert", "latin_condensed", "latin", "unicode", "i", "char", "convert_pat", "initialize", "_code_points", "generateMap", "normalize", "str", "form", "asciifold", "result", "_asciifold", "generator", "code_point_min", "code_point_max", "composed", "folded", "generateSets", "unicode_sets", "addMatching", "to_add", "folded_set", "patt", "setToPattern", "escape_regex", "value", "multi_char", "set", "a", "b", "multi_char_patt", "arrayToPattern", "mapSequence", "strings", "min_replacement", "chars_replaced", "sequencePattern", "substringsToPattern", "allSubstrings", "sub_pat", "sequencesToPattern", "sequences", "all", "sequence", "seq", "len", "j", "inSequences", "needle_seq", "needle_parts", "filter", "part", "needle_part", "Sequence", "_Sequence", "__publicField", "position", "last_piece", "clone", "parts", "last_part", "last_substr", "clone_last_len", "getPattern", "pattern", "match", "match_str", "overlapping", "added_types", "new_seq", "old_seq", "getAttr", "obj", "name", "getAttrNesting", "part", "names", "scoreValue", "value", "token", "weight", "score", "pos", "propToArray", "key", "iterate", "object", "callback", "cmp", "a", "b", "asciifold", "Sifter", "items", "settings", "__publicField", "query", "respect_word_boundaries", "weights", "tokens", "words", "field_regex", "escape_regex", "word", "field_match", "field", "regex", "getPattern", "options", "search", "token_count", "fields", "field_count", "getAttrFn", "scoreObject", "token", "data", "scoreValue", "sum", "value", "iterate", "weight", "score", "implicit_score", "sort_flds", "self", "sort", "get_field", "name", "result", "s", "fld", "a", "b", "sort_fld", "cmp", "optsUser", "propToArray", "getAttrNesting", "getAttr", "fn_score", "item", "id", "_", "fn_sort", "hash_key", "value", "get_hash", "escape_html", "str", "timeout", "fn", "loadDebounce", "delay", "callback", "self", "debounce_events", "types", "type", "trigger", "event_args", "getSelection", "input", "preventDefault", "evt", "stop", "addEvent", "target", "options", "isKeyDown", "key_name", "count", "getId", "el", "id", "existing_id", "addSlashes", "append", "parent", "node", "iterate", "object", "key", "getDom", "query", "isHtmlString", "tpl", "arg", "escapeQuery", "triggerEvent", "dom_el", "event_name", "event", "applyCSS", "css", "addClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "el", "cls", "removeClasses", "args", "iterate", "_classes", "parentMatch", "target", "selector", "wrapper", "getTail", "list", "direction", "isEmptyObject", "obj", "nodeIndex", "amongst", "i", "setAttr", "attrs", "val", "attr", "replaceNode", "existing", "replacement", "highlight", "element", "regex", "highlightText", "node", "match", "spannode", "middlebit", "middleclone", "replaceNode", "highlightChildren", "highlightRecursive", "removeHighlight", "el", "elements", "parent", "IS_MAC", "KEY_SHORTCUT", "defaults_default", "query", "getSettings", "input", "settings_user", "settings", "defaults_default", "attr_data", "field_label", "field_value", "field_disabled", "field_optgroup", "field_optgroup_label", "field_optgroup_value", "tag_name", "placeholder", "option", "settings_element", "init_select", "tagName", "options", "optionsMap", "group_count", "$order", "readData", "el", "data", "json", "addOption", "group", "value", "hash_key", "arr", "option_data", "addGroup", "optgroup", "id", "optgroup_data", "iterate", "child", "init_textbox", "data_raw", "opt", "values", "instance_i", "TomSelect", "MicroPlugin", "MicroEvent", "input_arg", "user_settings", "dir", "input", "getDom", "computedStyle", "settings", "getSettings", "getId", "Sifter", "filter", "value", "wrapper", "control", "dropdown", "dropdown_content", "classes", "inputMode", "control_input", "addClasses", "append", "isHtmlString", "attrs", "iterate", "attr", "setAttr", "self", "focus_node", "passive_event", "listboxId", "control_id", "query", "escapeQuery", "label", "label_click", "addEvent", "label_id", "classes_plugins", "escape_regex", "loadDebounce", "e", "target_match", "parentMatch", "evt", "option", "preventDefault", "doc_mousedown", "target", "win_scroll", "options", "optgroups", "optgroup", "field_label", "field_optgroup", "templates", "data", "escape", "key", "fn", "callbacks", "get_settings", "triggerEvent", "pastedText", "splitInput", "piece", "hash_key", "character", "isKeyDown", "KEY_SHORTCUT", "next", "prev", "timeout", "wasFocused", "deactivate", "item", "callback", "removeClasses", "classList", "changed", "silent", "events", "debounce_events", "eventName", "i", "begin", "end", "swap", "last", "last_active", "idx", "scroll", "behavior", "content", "height_menu", "scrollTop", "height_item", "y", "activeItems", "sort", "result", "calculateScore", "hashed", "triggerDropdown", "j", "k", "n", "html", "has_create_option", "active_group", "create", "groups", "groups_order", "same_query", "results", "active_option", "show_dropdown", "getGroupFragment", "order", "group_order_i", "order_group", "group_fragment", "opt_value", "opt_hash", "get_hash", "option_el", "self_optgroup", "a", "b", "group_order", "group_heading", "group_options", "header", "group_html", "removeHighlight", "tok", "highlight", "add_template", "template", "active_index", "user_created", "dat", "id", "hashed_id", "item_new", "index_item", "value_old", "value_new", "data_old", "option_new", "replaceNode", "boundFilter", "selected", "direction", "type", "all", "addSlashes", "values", "items", "x", "last_item", "wasFull", "nodeIndex", "caret", "output", "created", "isFull", "isLocked", "wrap_classList", "isEmptyObject", "opts", "empty_option", "AddSelected", "escape_html", "has_selected", "reuse_opt", "applyCSS", "setTextboxValue", "trigger", "context", "rect", "top", "left", "el", "selection", "tail", "getSelection", "rm_items", "getTail", "rm_item", "adjacent", "new_pos", "lock", "disabled", "isReadOnly", "revertSettings", "templateName", "when", "method", "new_fn", "orig_method", "result_new", "addEvent", "target", "type", "callback", "options", "addEventListener", "plugin", "input", "sync", "hash_key", "value", "get_hash", "preventDefault", "evt", "stop", "stopPropagation", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "plugin", "userOptions", "self", "orig_onOptionSelect", "onOptionSelect", "settings", "hideSelected", "cbOptions", "Object", "assign", "className", "checkedClassNames", "undefined", "uncheckedClassNames", "UpdateChecked", "checkbox", "toCheck", "checked", "classList", "remove", "add", "UpdateCheckbox", "option", "setTimeout", "HTMLInputElement", "contains", "hook", "orig_render_option", "render", "data", "escape_html", "rendered", "call", "addEventListener", "type", "hashed", "valueField", "items", "prepend", "on", "getOption", "removeItem", "dataset", "refreshOptions", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "plugin", "userOptions", "self", "options", "Object", "assign", "className", "title", "html", "data", "on", "button", "addEventListener", "evt", "isLocked", "clear", "settings", "mode", "allowEmptyOption", "addItem", "preventDefault", "stopPropagation", "control", "appendChild", "preventDefault", "evt", "stop", "stopPropagation", "addEvent", "target", "type", "callback", "options", "addEventListener", "iterate", "object", "Array", "isArray", "forEach", "key", "hasOwnProperty", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "setAttr", "el", "attrs", "val", "attr", "removeAttribute", "setAttribute", "insertAfter", "referenceNode", "newNode", "_referenceNode$parent", "parentNode", "insertBefore", "nextSibling", "_referenceNode$parent2", "isBefore", "_newNode", "previousElementSibling", "plugin", "self", "settings", "mode", "orig_lock", "lock", "orig_unlock", "unlock", "sortable", "drag_item", "hook", "orig_render_item", "render", "item", "data", "escape", "call", "mousedown", "dragStart", "setTimeout", "classList", "add", "dragOver", "moveitem", "dragLeave", "remove", "targetitem", "dragitem", "undefined", "dragend", "_drag_item", "querySelectorAll", "values", "control", "dataset", "value", "push", "setValue", "preventDefault", "evt", "stop", "stopPropagation", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "plugin", "userOptions", "self", "options", "Object", "assign", "title", "headerClass", "titleRowClass", "labelClass", "closeClass", "html", "data", "on", "header", "close_link", "addEventListener", "close", "dropdown", "insertBefore", "iterate", "object", "callback", "Array", "isArray", "forEach", "key", "hasOwnProperty", "removeClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "map", "el", "cls", "classList", "remove", "args", "_classes", "trim", "split", "concat", "filter", "Boolean", "arg", "nodeIndex", "amongst", "nodeName", "i", "previousElementSibling", "matches", "plugin", "self", "hook", "new_pos", "settings", "mode", "control", "contains", "control_input", "items", "length", "Math", "max", "min", "caretPos", "isPending", "controlChildren", "child", "j", "insertAdjacentElement", "appendChild", "direction", "isFocused", "last_active", "getLastActive", "idx", "setCaret", "setActiveItem", "preventDefault", "evt", "stop", "stopPropagation", "addEvent", "target", "type", "callback", "options", "addEventListener", "iterate", "object", "Array", "isArray", "forEach", "key", "hasOwnProperty", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "addClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "map", "el", "cls", "classList", "add", "args", "_classes", "split", "concat", "filter", "Boolean", "plugin", "self", "settings", "shouldOpen", "hook", "focus_node", "control", "control_input", "div", "append", "dropdown", "insertBefore", "placeholder", "on", "keyCode", "constants", "isOpen", "close", "clearActiveItems", "tabIndex", "onKeyDown", "call", "isDisabled", "focus", "orig_onBlur", "onBlur", "relatedTarget", "preventScroll", "addEvent", "target", "type", "callback", "options", "addEventListener", "plugin", "self", "on", "test_input", "document", "createElement", "control", "control_input", "style", "cssText", "wrapper", "appendChild", "transfer_styles", "style_name", "resize", "textContent", "value", "width", "clientWidth", "plugin", "self", "orig_deleteSelection", "deleteSelection", "hook", "evt", "activeItems", "length", "call", "plugin", "hook", "parentMatch", "target", "selector", "wrapper", "matches", "parentNode", "nodeIndex", "el", "amongst", "nodeName", "i", "previousElementSibling", "plugin", "self", "orig_keydown", "onKeyDown", "hook", "evt", "index", "option", "options", "optgroup", "isOpen", "keyCode", "constants", "call", "ignoreHover", "activeOption", "previousSibling", "nextSibling", "querySelectorAll", "Math", "min", "length", "setActiveOption", "escape_html", "str", "replace", "preventDefault", "evt", "stop", "stopPropagation", "addEvent", "target", "type", "callback", "options", "addEventListener", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "plugin", "userOptions", "Object", "assign", "label", "title", "className", "append", "self", "html", "hook", "orig_render_item", "settings", "render", "item", "data", "escape", "call", "close_button", "appendChild", "isLocked", "shouldDelete", "removeItem", "refreshOptions", "inputState", "plugin", "userOptions", "self", "options", "Object", "assign", "text", "option", "settings", "labelField", "on", "value", "isFocused", "control_input", "trim", "setTextboxValue", "call", "iterate", "object", "callback", "Array", "isArray", "forEach", "key", "hasOwnProperty", "addClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "map", "el", "cls", "classList", "add", "args", "_classes", "trim", "split", "concat", "filter", "Boolean", "arg", "plugin", "self", "orig_canLoad", "canLoad", "orig_clearActiveOption", "clearActiveOption", "orig_loadCallback", "loadCallback", "pagination", "dropdown_content", "loading_more", "load_more_opt", "default_values", "settings", "shouldLoadMore", "clientHeight", "scrollHeight", "scrollTop", "activeOption", "selectable", "index", "from", "indexOf", "length", "firstUrl", "sortField", "field", "canLoadMore", "query", "maxOptions", "children", "clearFilter", "option", "value", "items", "setNextUrl", "next_url", "getUrl", "clearPagination", "call", "hook", "options", "optgroups", "clearOptions", "first_option", "undefined", "dataset", "valueField", "lastValue", "render", "setAttribute", "querySelector", "optionClass", "append", "on", "Object", "keys", "assign", "no_more_results", "addEventListener", "load", "TomSelect", "plugin", "tom_select_complete_default", "hasError", "data", "isTruthy", "value", "badStrings", "isElement", "obj", "apiRequest", "url", "method", "data", "__async", "token", "headers", "body", "res", "contentType", "json", "apiPatch", "getElements", "key", "query", "element", "getElement", "id", "scrollTo", "element", "offset", "yOffset", "title", "top", "getSelectedOptions", "base", "selector", "selected", "select", "option", "findFirstAdjacent", "base", "query", "boundary", "atBoundary", "element", "match", "parent", "child", "createElement", "tag", "properties", "classes", "children", "k", "key", "value", "replaceAll", "input", "pattern", "replacement", "flags", "handleFormSubmit", "event", "form", "invalids", "element", "firstInvalid", "scrollTo", "initFormElements", "getElements", "submitters", "submitter", "resetButton", "initSpeedSelector", "element", "getElements", "handleClick", "event", "value", "input", "initForms", "func", "initFormElements", "initSpeedSelector", "Collapse", "Modal", "Popover", "Toast", "Tooltip", "initTooltips", "tooltip", "getElements", "initModals", "modal", "createToast", "level", "title", "message", "extra", "iconName", "container", "main", "header", "icon", "titleElement", "button", "body", "extraElement", "initTabs", "hash", "target", "element", "Tab", "initSidebarAccordions", "items", "handleToggle", "thisItem", "item", "initImagePreview", "maxWidth", "image", "createElement", "content", "initBootstrap", "func", "quickSearchEventHandler", "event", "quicksearch", "clearbtn", "isTruthy", "clearLinkParams", "link", "linkUpdated", "handleQuickSearchParams", "quickSearchParameters", "search_parameter", "initQuickSearch", "__async", "search", "f", "getPlugins", "element", "plugins", "data", "initStaticSelects", "select", "getElements", "tom_select_complete_default", "__spreadProps", "__spreadValues", "getPlugins", "initColorSelects", "renderColor", "item", "escape", "iterate", "object", "callback", "key", "addClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "el", "cls", "classesArray", "args", "classes", "iterate", "_classes", "castAsArray", "arg", "base_exports", "__export", "exclude", "extract", "parse", "parseUrl", "pick", "stringify", "stringifyUrl", "token", "singleMatcher", "multiMatcher", "decodeComponents", "components", "split", "e", "left", "right", "decode", "input", "tokens", "i", "customDecodeURIComponent", "replaceMap", "match", "result", "entries", "key", "decodeUriComponent", "encodedURI", "includeKeys", "object", "predicate", "result", "key", "descriptor", "value", "splitOnFirst", "string", "separator", "separatorIndex", "isNullOrUndefined", "value", "strictUriEncode", "string", "x", "encodeFragmentIdentifier", "encoderForArrayFormat", "options", "key", "result", "index", "encode", "keyValueSeparator", "parserForArrayFormat", "accumulator", "isArray", "isEncodedArray", "decode", "newValue", "item", "arrayValue", "validateArrayFormatSeparator", "decodeUriComponent", "keysSorter", "input", "a", "b", "removeHash", "hashStart", "getHash", "url", "hash", "parseValue", "type", "extract", "queryStart", "parse", "query", "__spreadValues", "formatter", "returnValue", "parameter", "parameter_", "splitOnFirst", "key2", "value2", "stringify", "object", "shouldFilter", "objectCopy", "keys", "parseUrl", "_a", "_b", "url_", "stringifyUrl", "queryFromUrl", "queryString", "urlObjectForFragmentEncode", "pick", "filter", "fragmentIdentifier", "includeKeys", "exclude", "exclusionFilter", "query_string_default", "base_exports", "isDataDynamicParams", "value", "item", "DynamicParamsMap", "fieldName", "value", "queryValue", "current", "isTruthy", "queryParam", "json", "deserialized", "isDataDynamicParams", "DynamicTomSelect", "tom_select_complete_default", "input_arg", "user_settings", "__publicField", "DynamicParamsMap", "nullOption", "valueField", "labelField", "key", "value", "filter", "self", "url", "addClasses", "response", "apiData", "results", "options", "result", "option", "search", "query", "replaceAll", "query_string_default", "data", "parent", "serialized", "deserialized", "queryParam", "queryValue", "err", "fieldName", "element", "elementValue", "o", "current", "staticValue", "id", "getElement", "dependencies", "dep", "filterElement", "event", "target", "VALUE_FIELD", "LABEL_FIELD", "MAX_OPTIONS", "renderOption", "data", "escape", "html", "renderItem", "initDynamicSelects", "select", "getElements", "DynamicTomSelect", "__spreadProps", "__spreadValues", "getPlugins", "initSelects", "initStaticSelects", "initDynamicSelects", "initColorSelects", "setConnectionStatus", "element", "status", "_a", "row", "url", "isTruthy", "apiPatch", "res", "hasError", "createToast", "initConnectionToggle", "getElements", "ProxyStateHandler", "target", "key", "value", "StateManager", "raw", "options", "__publicField", "saved", "__spreadValues", "obj", "createState", "initial", "objectDepthState", "createState", "rackImagesState", "createState", "previousPkCheckState", "createState", "secretState", "createState", "toggleDepthButton", "hidden", "button", "showDepthIndicators", "element", "getElements", "hideDepthIndicators", "handleDepthToggle", "state", "initiallyHidden", "initDepthToggle", "objectDepthState", "event", "moveOptionUp", "element", "options", "i", "option", "moveOptionDown", "next", "initMoveButtons", "button", "getElements", "target", "select", "slugify", "slug", "chars", "initReslug", "slugButton", "getElements", "form", "slugField", "sourceId", "sourceField", "slugLengthAttr", "slugLength", "handlePkCheck", "event", "element", "getElements", "handleSelectAllToggle", "tableSelectAll", "table", "findFirstAdjacent", "confirmCard", "confirmCheckbox", "initSelectAll", "toggleFloat", "checkedCheckboxes", "buttonGroup", "isFloating", "initFloatBulk", "element", "getElements", "removeTextSelection", "_a", "updatePreviousPkCheckState", "eventTargetElement", "state", "toggleCheckboxRange", "previousStateElement", "elementList", "changePkCheckboxState", "element", "typedElement", "handlePkCheck", "event", "checkboxList", "getElements", "initSelectMultiple", "checkboxElements", "previousPkCheckState", "initMarkdownPreview", "markdownWidget", "previewButton", "textarea", "preview", "isTruthy", "height", "e", "initMarkdownPreviews", "toggleSecretButton", "hidden", "button", "showSecret", "secret", "getElement", "isTruthy", "value", "hideSecret", "handleSecretToggle", "state", "toggleCallback", "event", "secretState", "initSecretToggle", "getElements", "initButtons", "func", "initDepthToggle", "initConnectionToggle", "initReslug", "initSelectAll", "initSelectMultiple", "initFloatBulk", "initMoveButtons", "initMarkdownPreviews", "initSecretToggle", "COLOR_MODE_KEY", "isColorMode", "value", "storeColorMode", "mode", "updateElements", "targetMode", "_a", "_b", "body", "elevation", "getElements", "svg", "setColorMode", "handleColorModeToggle", "currentValue", "defaultColorMode", "isTruthy", "preference", "initColorModeToggle", "element", "initColorMode", "func", "initMessages", "elements", "element", "toast", "Toast", "import_clipboard", "initClipboard", "element", "getElements", "Clipboard", "HOOKS", "defaults", "err", "givenDate", "date", "week1", "english", "nth", "s", "default_default", "pad", "number", "length", "int", "bool", "debounce", "fn", "wait", "t", "_this", "args", "arrayify", "obj", "toggleClass", "elem", "className", "bool", "createElement", "tag", "content", "e", "clearNode", "node", "findParent", "condition", "createNumberInput", "inputClassName", "opts", "wrapper", "numInput", "arrowUp", "arrowDown", "key", "getEventTarget", "event", "path", "error", "doNothing", "monthToStr", "monthNumber", "shorthand", "locale", "revFormat", "dateObj", "monthName", "hour", "day", "amPM", "int", "shortMonth", "seconds", "_", "unixSeconds", "weekNum", "weekNumber", "date", "year", "ISODate", "minutes", "month", "unixMillSeconds", "tokenRegex", "formats", "options", "pad", "createDateFormatter", "_a", "_b", "config", "defaults", "_c", "l10n", "english", "_d", "isMobile", "dateObj", "frmt", "overrideLocale", "locale", "c", "i", "arr", "formats", "createDateParser", "date", "givenFormat", "timeless", "customLocale", "parsedDate", "dateOrig", "format", "datestr", "matched", "ops", "matchIndex", "regexStr", "token", "isBackSlash", "escaped", "tokenRegex", "match", "revFormat", "fn", "val", "compareDates", "date1", "date2", "isBetween", "ts", "ts1", "ts2", "calculateSecondsSinceMidnight", "hours", "minutes", "seconds", "parseSeconds", "secondsSinceMidnight", "duration", "getDefaultHours", "config", "minHour", "minMinutes", "minSeconds", "maxHr", "maxMinutes", "target", "args", "_i", "_loop_1", "source", "key", "_a", "args_1", "__assign", "t", "s", "i", "n", "p", "__spreadArrays", "il", "r", "k", "a", "j", "jl", "DEBOUNCED_CHANGE_MS", "FlatpickrInstance", "element", "instanceConfig", "self", "defaults", "flatpickr", "default_default", "createDateParser", "bind", "setHoursFromDate", "positionCalendar", "changeMonth", "changeYear", "clear", "close", "onMouseOver", "createElement", "createDay", "destroy", "isEnabled", "jumpToDate", "updateValue", "open", "redraw", "set", "setDate", "toggle", "setupHelperFunctions", "month", "yr", "init", "parseConfig", "setupLocale", "setupInputs", "setupDates", "build", "bindEvents", "setCalendarWidth", "isSafari", "triggerEvent", "getClosestActiveElement", "_a", "bindToInstance", "fn", "config", "daysWidth", "updateTime", "e", "defaultDate", "compareDates", "getDefaultHours", "timeWrapper", "prevValue", "setHoursFromInputs", "ampm2military", "hour", "amPM", "int", "military2ampm", "hours", "minutes", "seconds", "limitMinHours", "limitMaxHours", "minBound", "calculateSecondsSinceMidnight", "maxBound", "currentTime", "result", "parseSeconds", "maxTime", "minTime", "setHours", "dateObj", "date", "pad", "onYearInput", "event", "eventTarget", "getEventTarget", "year", "handler", "options", "ev", "el", "triggerChange", "evt", "setupMobile", "debouncedResize", "debounce", "onResize", "onKeyDown", "documentClick", "onMonthNavClick", "selectDate", "selText", "timeIncrement", "onBlur", "jumpDate", "jumpTo", "oldYear", "oldMonth", "buildMonthSwitch", "incrementNumInput", "delta", "inputElem", "target", "input", "createEvent", "fragment", "buildMonthNav", "buildWeeks", "weekWrapper", "weekNumbers", "buildWeekdays", "buildDays", "buildTime", "toggleClass", "customAppend", "wrapper", "className", "_dayNumber", "dateIsEnabled", "dayElement", "isDateSelected", "isDateInRange", "focusOnDayElem", "targetNode", "getFirstAvailableDay", "startMonth", "endMonth", "m", "startIndex", "endIndex", "c", "getNextAvailableDay", "current", "givenMonth", "loopDelta", "numMonthDays", "focusOnDay", "offset", "activeElement", "dayFocused", "isInView", "startElem", "buildMonthDays", "firstOfMonth", "prevMonthDays", "daysInMonth", "days", "isMultiMonth", "prevMonthDayClass", "nextMonthDayClass", "dayNumber", "dayIndex", "dayNum", "dayContainer", "clearNode", "frag", "d", "shouldBuildMonth", "monthToStr", "buildMonth", "container", "monthNavFragment", "monthElement", "selectedMonth", "yearInput", "createNumberInput", "yearElement", "currentMonth", "buildMonths", "bool", "updateNavigationCurrentMonth", "separator", "hourInput", "minuteInput", "secondInput", "updateWeekdays", "firstDayOfWeek", "weekdays", "value", "isOffset", "triggerChangeEvent", "toInitial", "_", "isCalendarElem", "elem", "eventTarget_1", "isCalendarElement", "isInput", "lostFocus", "isIgnored", "newYear", "newYearNum", "isNewYear", "timeless", "dateToCheck", "array", "parsed", "valueChanged", "getDateStr", "allowInput", "allowKeydown", "allowInlineKeydown", "isTimeObj", "focusAndClose", "delta_1", "elems", "x", "cellClass", "hoverDate", "initialDate", "rangeStartDate", "rangeEndDate", "containsDisabled", "minRange", "maxRange", "duration", "hoverableCells", "dayElem", "timestamp", "outOfRange", "isBetween", "positionElement", "wasOpen", "minMaxDateSetter", "type", "inverseDateObj", "boolOpts", "userConfig", "formats", "dates", "parseDateRules", "timeMode", "defaultDateFormat", "defaultAltFormat", "minMaxTimeSetter", "val", "HOOKS", "hook", "arrayify", "pluginConf", "key", "getInputElem", "tokenRegex", "createDateFormatter", "customPositionElement", "calendarHeight", "acc", "child", "calendarWidth", "configPos", "configPosVertical", "configPosHorizontal", "inputBounds", "distanceFromBottom", "showOnTop", "top", "left", "isCenter", "isRight", "right", "rightMost", "centerMost", "doc", "getDocumentStyleSheet", "bodyWidth", "centerLeft", "centerBefore", "centerAfter", "centerIndex", "centerStyle", "editableSheet", "sheet", "err", "createStyleSheet", "style", "isSelectable", "day", "findParent", "selectedDate", "shouldChangeMonth", "selectedIndex", "b", "single", "range", "CALLBACKS", "updatePositionElement", "option", "setSelectedDate", "inputDate", "format", "arr", "rule", "preloadedDate", "inputType", "data", "hooks", "name", "specificFormat", "dObj", "isPrevMonth", "isNextMonth", "isKeyDown", "min", "max", "step", "curValue", "newValue", "isHourElem", "isMinuteElem", "_flatpickr", "nodeList", "nodes", "instances", "node", "selector", "l10n", "esm_default", "initDateSelector", "esm_default", "saveTableConfig", "element", "getElements", "addColumns", "event", "selectedOption", "selected", "removeColumns", "available", "submitFormConfig", "url", "formConfig", "__async", "apiPatch", "handleSubmit", "_a", "_b", "_c", "createToast", "reset", "path", "data", "value", "key", "res", "hasError", "options", "getSelectedOptions", "formData", "opt", "initTableConfig", "isShowHide", "value", "TableStateError", "message", "table", "__publicField", "ButtonState", "button", "rows", "row", "state", "replaceAll", "event", "TableState", "toggleEnabledButton", "findFirstAdjacent", "toggleDisabledButton", "toggleVirtualButton", "toggleDisconnectedButton", "err", "instance", "initInterfaceTable", "element", "getElements", "SideNav", "base", "__publicField", "StateManager", "attr", "attrs", "toggler", "event", "getElements", "link", "collapse", "element", "section", "collapseInstance", "Collapse", "action", "_a", "dropdownMenu", "isElement", "groupItem", "groupLink", "menuitem", "href", "initSideNav", "sidenav", "obsolete", "self", "f", "oldName", "newName", "rev", "wrapper", "args", "Utils", "_Utils", "els", "root", "doc", "el", "list", "itemClass", "n", "_a", "_b", "cont", "entry", "GridStack", "classes", "parent", "c", "strict", "a", "b", "x0", "x1", "y0", "y1", "nodes", "dir", "_c", "_d", "diffY", "id", "options", "style", "nonce", "sheet", "selector", "rules", "v", "value", "val", "h", "unit", "match", "target", "sources", "source", "key", "doMinMax", "node", "aVal", "bVal", "removeEl", "func", "delay", "isWaiting", "args", "position", "distance", "rect", "innerHeightOrClientHeight", "offsetDiffDown", "offsetDiffUp", "scrollEl", "prevScroll", "event", "height", "offsetTop", "pointerPosY", "top", "bottom", "obj", "__spreadValues", "skipFields", "ret", "k", "parentNode", "styles", "s", "e", "info", "evt", "p", "simulatedType", "simulatedEvent", "transformReference", "transformValues", "o", "tmp", "GridStackEngine", "_GridStackEngine", "opts", "flag", "doPack", "node", "nn", "collide", "opt", "area", "didMove", "newOpt", "counter", "moved", "__spreadProps", "__spreadValues", "newNN", "Utils", "skip", "skip2", "skipId", "skip2Id", "n", "o", "collides", "r0", "r", "overMax", "r2", "yOver", "xOver", "over", "w", "h", "top", "right", "bottom", "left", "a", "b", "_doSwap", "x", "y", "touching", "t", "layout", "doSort", "wasBatch", "wasColumnResize", "copyNodes", "index", "list", "after", "val", "dir", "newY", "i", "resizing", "_a", "id", "count", "defaults", "before", "copy", "verify", "removedNodes", "dirtyNodes", "nodeList", "column", "start", "found", "box", "triggerAddEvent", "dup", "skipCollision", "removeDOM", "triggerEvent", "clonedNode", "clone", "canMove", "c", "p", "_b", "wasUndefinedPack", "prevPos", "needToMove", "activeDrag", "a1", "a2", "row", "saveElement", "saveCB", "len", "wl", "l", "nodes", "ratio", "prevColumn", "doCompact", "newNodes", "cacheNodes", "lastIndex", "cacheNode", "_c", "j", "move", "scale", "clear", "existing", "n2", "prop", "gridDefaults", "DDManager", "isTouch", "DDTouch", "simulateMouseEvent", "e", "simulatedType", "touch", "simulatedEvent", "simulatePointerMouseEvent", "touchstart", "touchmove", "touchend", "wasDragging", "DDManager", "pointerdown", "pointerenter", "pointerleave", "DDResizableHandle", "_DDResizableHandle", "host", "dir", "option", "el", "isTouch", "touchstart", "pointerdown", "e", "touchmove", "touchend", "s", "_a", "_b", "name", "event", "DDBaseImplement", "event", "callback", "eventName", "DDResizable", "_DDResizable", "DDBaseImplement", "el", "option", "containmentRect", "newRect", "rect", "event", "callback", "opts", "updateHandles", "updateAutoHide", "key", "auto", "DDManager", "e", "dir", "DDResizableHandle", "Utils", "ev", "prop", "parent", "dragTransform", "i", "oEvent", "offsetX", "offsetY", "moveLeft", "moveUp", "constrain", "oWidth", "oHeight", "o", "maxWidth", "minWidth", "maxHeight", "minHeight", "width", "height", "containmentEl", "left", "top", "value", "scaleReciprocal", "handle", "skipMouseDown", "DDDraggable", "_DDDraggable", "DDBaseImplement", "el", "option", "_a", "handleName", "n", "event", "callback", "dragEl", "isTouch", "touchstart", "pointerdown", "forDestroy", "opts", "key", "e", "DDManager", "touchmove", "touchend", "ev", "Utils", "s", "pause", "grid", "_b", "__spreadValues", "helper", "prop", "style", "node", "transition", "containmentRect", "offset", "parent", "xformOffsetX", "xformOffsetY", "targetOffset", "DDDroppable", "DDBaseImplement", "el", "option", "event", "callback", "isTouch", "pointerenter", "pointerleave", "forDestroy", "opts", "key", "e", "DDManager", "ev", "Utils", "calledByEnter", "_a", "parentDrop", "parent", "drag", "__spreadValues", "DDElement", "_DDElement", "el", "eventName", "callback", "opts", "DDDraggable", "DDResizable", "DDDroppable", "DDGridStack", "el", "opts", "key", "value", "dEl", "grid", "handles", "autoHide", "__spreadProps", "__spreadValues", "_a", "name", "callback", "event", "DDManager", "els", "create", "hosts", "Utils", "list", "e", "DDElement", "d", "dd", "DDGridStack", "GridStack", "_GridStack", "options", "elOrString", "el", "Utils", "selector", "grids", "parent", "opt", "grid", "__spreadValues", "engineClass", "placeholderChild", "gridDefaults", "opts", "_a", "_b", "_c", "rowAttr", "bk", "oldOpts", "oneSize", "oneColumn", "b", "resp", "a", "defaults", "__spreadProps", "parentGridItem", "parentNode", "isTouch", "GridStackEngine", "cbNodes", "maxH", "n", "children", "DDManager", "w", "node", "domAttr", "ops", "nodeToAdd", "saveContent", "subGridTemplate", "autoColumn", "content", "newItem", "newItemOpt", "h", "style", "subGrid", "nodeThatRemoved", "pGrid", "saveGridOpt", "saveCB", "list", "itemContent", "listOrOpt", "o", "origShow", "items", "addRemove", "column", "maxColumn", "prevCB", "removed", "blank", "updateNodes", "item", "sub", "flag", "forcePixel", "rows", "val", "update", "marginDiff", "data", "forBreakpoint", "newColumn", "i", "layout", "doSort", "oldColumn", "removeDOM", "position", "useDocRelative", "box", "containerPos", "relativeLeft", "relativeTop", "columnWidth", "rowHeight", "x", "y", "els", "name", "callback", "event", "key", "triggerEvent", "doAnimate", "delay", "updateClass", "recurse", "keys", "m", "k", "changed", "ddChanged", "widthChanged", "wasUpdating", "cell", "height", "padding", "itemH", "wantedH", "subRec", "parentRec", "child", "softMax", "relative", "rot", "pivotX", "pivotY", "_orig", "value", "elements", "addedNodes", "removedNodes", "type", "styleLocation", "forceUpdate", "cellHeight", "cellHeightUnit", "prefix", "top", "bottom", "right", "left", "placeholder", "getHeight", "row", "unit", "cssMinHeight", "minRow", "triggerAddEvent", "sizeToContent", "attrs", "clearDefaultAttr", "classes", "clientWidth", "columnChanged", "nodes", "forceRemove", "trackSize", "margin", "margins", "dragIn", "dragInOptions", "widgets", "root", "doEnable", "cellWidth", "onDrag", "helper", "helperRect", "rect", "ui", "canAccept", "error", "wasAdded", "wasSidebar", "noAnim", "origNode", "oGrid", "remove", "trashEl", "noMove", "noResize", "onStartMoving", "dragOrResize", "onEndMoving", "target", "gridEl", "colLeft", "rowLeft", "p", "resizing", "mLeft", "mRight", "mTop", "mBottom", "mHeight", "mWidth", "distance", "prev", "extra", "obsolete", "lockDashboard", "dashboard", "unlockDashboard", "saveDashboardLayout", "url", "gridData", "__async", "apiPatch", "initDashboard", "grid", "GridStack", "gridLockButton", "gridUnlockButton", "gridSaveButton", "res", "hasError", "createToast", "setRackView", "view", "elevation", "showRackElements", "hideRackElements", "selector", "_a", "_b", "elements", "element", "handleRackViewSelect", "newView", "state", "getElements", "initRackElevation", "initialView", "rackImagesState", "control", "o", "event", "handleSelection", "link", "selector_results", "target_id", "target", "label", "value", "initObjectSelector", "element", "getElements", "handleQuickAddObject", "quick_add", "object_id", "object_repr", "target_id", "target", "modal_element", "modal", "Modal", "initQuickAdd", "quick_add_modal", "initDepedencies", "initButtons", "initClipboard", "initSelects", "initObjectSelector", "initQuickAdd", "initBootstrap", "initMessages", "initHtmx", "handleSavedFilterChange", "event", "savedFilter", "baseUrl", "preFilter", "selectedOptions", "option", "initSavedFilterSelect", "divResults", "isTruthy", "savedFilterSelect", "initDocument", "init", "initBootstrap", "initColorMode", "initMessages", "initForms", "initQuickSearch", "initSelects", "initDateSelector", "initButtons", "initClipboard", "initTableConfig", "initInterfaceTable", "initSideNav", "initDashboard", "initRackElevation", "initHtmx", "initSavedFilterSelect", "initWindow", "documentForms", "documentForm", "event", "formData", "name", "value", "contentContainer"] + "mappings": "20CAAA,IAAAA,GAAAC,GAAA,oBAAC,SAASC,GAAEC,GAAE,CAAI,OAAO,QAAS,YAAY,OAAO,IAAK,OAAO,CAAC,EAAEA,EAAC,EAAU,OAAO,QAAS,UAAU,OAAO,QAAS,OAAO,QAAQA,GAAE,EAAOD,GAAE,KAAKA,GAAE,MAAMC,GAAE,CAAE,GAAG,OAAO,MAAO,YAAY,KAAK,QAAK,UAAU,CAAC,OAAO,UAAU,CAAC,aAAa,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,GAAG,GAAG,GAAG,IAAI,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,SAASD,GAAEC,GAAE,CAAC,IAAIC,GAAE,GAAGF,GAAEC,IAAG,MAAM,EAAE,OAAOC,GAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,G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,MAAM,GAAG,EAAE,CAAC,EACxCE,GAAY,IAEZC,GAAkB,MAAM,KAAKH,GAAY,OAAO,EACnD,OAAOI,IAAUA,GAAO,QAAQ,EAChC,IAAIA,IAAU,aAAaA,GAAO,KAAK,EAAE,EACzC,KAAK,GAAG,EAEXH,IAAW,GAAGC,EAAS,GAAGC,EAAe,GACzC,SAAS,SAAS,KAAOF,EAC3B,CAEO,SAASI,IAA8B,CAC5C,IAAMC,GAAa,SAAS,eAAe,SAAS,EACpD,GAAIC,GAASD,EAAU,EAAG,CACxB,IAAME,GAAoB,SAAS,eAAe,cAAc,EAC5DD,GAASC,EAAiB,GAC5BA,GAAkB,iBAAiB,SAAUV,EAAuB,CAExE,CACF,CCZA,SAASW,IAAqB,CAC5B,QAAWC,KAAQ,CACjBC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EACF,EACEhB,GAAK,CAET,CAEA,SAASiB,IAAmB,CAC1B,IAAMC,GAAgB,SAAS,MAC/B,QAAWC,MAAgBD,GACrBC,GAAa,OAAO,YAAY,GAAK,OACvCA,GAAa,iBAAiB,WAAY,SAAUC,GAAsB,CACxE,IAAMC,GAAqBD,GAAM,SACjC,OAAW,CAACE,GAAMC,EAAK,IAAK,MAAM,KAAKF,GAAS,QAAQ,CAAC,EACnDE,KAAU,IAAIF,GAAS,OAAOC,EAAI,CAE1C,CAAC,EAIL,IAAME,GAAmB,SAAS,cAA2B,oBAAoB,EAC7EA,KAAqB,MAEvBA,GAAiB,MAAM,CAE3B,CAEA,OAAO,iBAAiB,OAAQP,EAAU,EAEtC,SAAS,aAAe,UAC1BlB,GAAa,EAEb,SAAS,iBAAiB,mBAAoBA,EAAY", + "names": ["require_htmx_min", "__commonJSMin", "e", "t", "r", "n", "i", "a", "o", "s", "l", "u", "f", "c", "h", "v", "M", "X", "d", "D", "U", "g", "p", "m", "x", "B", "F", "V", "y", "b", "w", "j", "S", "E", "_", "C", "R", "z", "$", "T", "O", "W", "q", "H", "G", "J", "L", "A", "Z", "N", "K", "I", "k", "P", "Y", "require_clipboard", "__commonJSMin", "exports", "module", "root", "factory", "__webpack_modules__", "__unused_webpack_module", "__webpack_exports__", "__webpack_require__", "clipboard", "tiny_emitter", "tiny_emitter_default", "listen", "listen_default", "src_select", "select_default", "command", "type", "err", "ClipboardActionCut", "target", "selectedText", "actions_cut", "createFakeElement", "value", "isRTL", "fakeElement", "yPosition", "fakeCopyAction", "options", "ClipboardActionCopy", "actions_copy", "_typeof", "obj", "ClipboardActionDefault", "_options$action", "action", "container", "text", "actions_default", "clipboard_typeof", "_classCallCheck", "instance", "Constructor", "_defineProperties", "props", "i", "descriptor", "_createClass", "protoProps", "staticProps", "_inherits", "subClass", "superClass", "_setPrototypeOf", "o", "p", "_createSuper", "Derived", "hasNativeReflectConstruct", "_isNativeReflectConstruct", "Super", "_getPrototypeOf", "result", "NewTarget", "_possibleConstructorReturn", "self", "call", "_assertThisInitialized", "e", "getAttributeValue", "suffix", "element", "attribute", "Clipboard", "_Emitter", "_super", "trigger", "_this", "_this2", "selector", "actions", "support", "DOCUMENT_NODE_TYPE", "proto", "closest", "__unused_webpack_exports", "_delegate", "callback", "useCapture", "listenerFn", "listener", "delegate", "elements", "is", "listenNode", "listenNodeList", "listenSelector", "node", "nodeList", "select", "isReadOnly", "selection", "range", "E", "name", "ctx", "data", "evtArr", "len", "evts", "liveEvents", "__webpack_module_cache__", "moduleId", "getter", "definition", "key", "prop", "lib_exports", "__export", "afterMain", "afterRead", "afterWrite", "applyStyles_default", "arrow_default", "auto", "basePlacements", "beforeMain", "beforeRead", "beforeWrite", "bottom", "clippingParents", "computeStyles_default", "createPopper", "detectOverflow", "end", "eventListeners_default", "flip_default", "hide_default", "left", "main", "modifierPhases", "offset_default", "placements", "popper", "popperGenerator", "popperOffsets_default", "preventOverflow_default", "read", "reference", "right", "start", "top", "variationPlacements", "viewport", "write", "top", "bottom", "right", "left", "auto", "basePlacements", "start", "end", "clippingParents", "viewport", "popper", "reference", "variationPlacements", "acc", "placement", "placements", "beforeRead", "read", "afterRead", "beforeMain", "main", "afterMain", "beforeWrite", "write", "afterWrite", "modifierPhases", "getNodeName", "element", "getWindow", "node", "ownerDocument", "isElement", "node", "OwnElement", "getWindow", "isHTMLElement", "isShadowRoot", "applyStyles", "_ref", "state", "name", "style", "attributes", "element", "isHTMLElement", "getNodeName", "value", "effect", "_ref2", "initialStyles", "styleProperties", "property", "attribute", "applyStyles_default", "getBasePlacement", "placement", "max", "min", "round", "getUAString", "uaData", "item", "isLayoutViewport", "getUAString", "getBoundingClientRect", "element", "includeScale", "isFixedStrategy", "clientRect", "scaleX", "scaleY", "isHTMLElement", "round", "_ref", "isElement", "getWindow", "visualViewport", "addVisualOffsets", "isLayoutViewport", "x", "y", "width", "height", "getLayoutRect", "element", "clientRect", "getBoundingClientRect", "width", "height", "contains", "parent", "child", "rootNode", "isShadowRoot", "next", "getComputedStyle", "element", "getWindow", "isTableElement", "element", "getNodeName", "getDocumentElement", "element", "isElement", "getParentNode", "element", "getNodeName", "isShadowRoot", "getDocumentElement", "getTrueOffsetParent", "element", "isHTMLElement", "getComputedStyle", "getContainingBlock", "isFirefox", "getUAString", "isIE", "elementCss", "currentNode", "getParentNode", "isShadowRoot", "getNodeName", "css", "getOffsetParent", "window", "getWindow", "offsetParent", "isTableElement", "getMainAxisFromPlacement", "placement", "within", "min", "value", "max", "withinMaxClamp", "v", "getFreshSideObject", "mergePaddingObject", "paddingObject", "getFreshSideObject", "expandToHashMap", "value", "keys", "hashMap", "key", "toPaddingObject", "padding", "state", "mergePaddingObject", "expandToHashMap", "basePlacements", "arrow", "_ref", "_state$modifiersData$", "name", "options", "arrowElement", "popperOffsets", "basePlacement", "getBasePlacement", "axis", "getMainAxisFromPlacement", "isVertical", "left", "right", "len", "paddingObject", "arrowRect", "getLayoutRect", "minProp", "top", "maxProp", "bottom", "endDiff", "startDiff", "arrowOffsetParent", "getOffsetParent", "clientSize", "centerToReference", "min", "max", "center", "offset", "within", "axisProp", "effect", "_ref2", "_options$element", "contains", "arrow_default", "getVariation", "placement", "unsetSides", "roundOffsetsByDPR", "_ref", "win", "x", "y", "dpr", "round", "mapToStyles", "_ref2", "_Object$assign2", "popper", "popperRect", "placement", "variation", "offsets", "position", "gpuAcceleration", "adaptive", "roundOffsets", "isFixed", "_offsets$x", "_offsets$y", "_ref3", "hasX", "hasY", "sideX", "left", "sideY", "top", "offsetParent", "getOffsetParent", "heightProp", "widthProp", "getWindow", "getDocumentElement", "getComputedStyle", "right", "end", "bottom", "offsetY", "offsetX", "commonStyles", "_ref4", "_Object$assign", "computeStyles", "_ref5", "state", "options", "_options$gpuAccelerat", "_options$adaptive", "_options$roundOffsets", "getBasePlacement", "getVariation", "computeStyles_default", "passive", "effect", "_ref", "state", "instance", "options", "_options$scroll", "scroll", "_options$resize", "resize", "window", "getWindow", "scrollParents", "scrollParent", "eventListeners_default", "hash", "getOppositePlacement", "placement", "matched", "hash", "getOppositeVariationPlacement", "placement", "matched", "getWindowScroll", "node", "win", "getWindow", "scrollLeft", "scrollTop", "getWindowScrollBarX", "element", "getBoundingClientRect", "getDocumentElement", "getWindowScroll", "getViewportRect", "element", "strategy", "win", "getWindow", "html", "getDocumentElement", "visualViewport", "width", "height", "x", "y", "layoutViewport", "isLayoutViewport", "getWindowScrollBarX", "getDocumentRect", "element", "_element$ownerDocumen", "html", "getDocumentElement", "winScroll", "getWindowScroll", "body", "width", "max", "height", "x", "getWindowScrollBarX", "y", "getComputedStyle", "isScrollParent", "element", "_getComputedStyle", "getComputedStyle", "overflow", "overflowX", "overflowY", "getScrollParent", "node", "getNodeName", "isHTMLElement", "isScrollParent", "getParentNode", "listScrollParents", "element", "list", "_element$ownerDocumen", "scrollParent", "getScrollParent", "isBody", "win", "getWindow", "target", "isScrollParent", "updatedList", "getParentNode", "rectToClientRect", "rect", "getInnerBoundingClientRect", "element", "strategy", "rect", "getBoundingClientRect", "getClientRectFromMixedType", "clippingParent", "viewport", "rectToClientRect", "getViewportRect", "isElement", "getDocumentRect", "getDocumentElement", "getClippingParents", "clippingParents", "listScrollParents", "getParentNode", "canEscapeClipping", "getComputedStyle", "clipperElement", "isHTMLElement", "getOffsetParent", "contains", "getNodeName", "getClippingRect", "boundary", "rootBoundary", "mainClippingParents", "firstClippingParent", "clippingRect", "accRect", "max", "min", "computeOffsets", "_ref", "reference", "element", "placement", "basePlacement", "getBasePlacement", "variation", "getVariation", "commonX", "commonY", "offsets", "top", "bottom", "right", "left", "mainAxis", "getMainAxisFromPlacement", "len", "start", "end", "detectOverflow", "state", "options", "_options", "_options$placement", "placement", "_options$strategy", "strategy", "_options$boundary", "boundary", "clippingParents", "_options$rootBoundary", "rootBoundary", "viewport", "_options$elementConte", "elementContext", "popper", "_options$altBoundary", "altBoundary", "_options$padding", "padding", "paddingObject", "mergePaddingObject", "expandToHashMap", "basePlacements", "altContext", "reference", "popperRect", "element", "clippingClientRect", "getClippingRect", "isElement", "getDocumentElement", "referenceClientRect", "getBoundingClientRect", "popperOffsets", "computeOffsets", "popperClientRect", "rectToClientRect", "elementClientRect", "overflowOffsets", "offsetData", "offset", "key", "multiply", "right", "bottom", "axis", "top", "computeAutoPlacement", "state", "options", "_options", "placement", "boundary", "rootBoundary", "padding", "flipVariations", "_options$allowedAutoP", "allowedAutoPlacements", "placements", "variation", "getVariation", "variationPlacements", "basePlacements", "allowedPlacements", "overflows", "acc", "detectOverflow", "getBasePlacement", "a", "b", "getExpandedFallbackPlacements", "placement", "getBasePlacement", "auto", "oppositePlacement", "getOppositePlacement", "getOppositeVariationPlacement", "flip", "_ref", "state", "options", "name", "_options$mainAxis", "checkMainAxis", "_options$altAxis", "checkAltAxis", "specifiedFallbackPlacements", "padding", "boundary", "rootBoundary", "altBoundary", "_options$flipVariatio", "flipVariations", "allowedAutoPlacements", "preferredPlacement", "basePlacement", "isBasePlacement", "fallbackPlacements", "placements", "acc", "computeAutoPlacement", "referenceRect", "popperRect", "checksMap", "makeFallbackChecks", "firstFittingPlacement", "i", "_basePlacement", "isStartVariation", "getVariation", "start", "isVertical", "top", "bottom", "len", "overflow", "detectOverflow", "mainVariationSide", "right", "left", "altVariationSide", "checks", "check", "numberOfChecks", "_loop", "_i", "fittingPlacement", "_ret", "flip_default", "getSideOffsets", "overflow", "rect", "preventedOffsets", "isAnySideFullyClipped", "top", "right", "bottom", "left", "side", "hide", "_ref", "state", "name", "referenceRect", "popperRect", "referenceOverflow", "detectOverflow", "popperAltOverflow", "referenceClippingOffsets", "popperEscapeOffsets", "isReferenceHidden", "hasPopperEscaped", "hide_default", "distanceAndSkiddingToXY", "placement", "rects", "offset", "basePlacement", "getBasePlacement", "invertDistance", "left", "top", "_ref", "skidding", "distance", "right", "_ref2", "state", "options", "name", "_options$offset", "data", "placements", "acc", "_data$state$placement", "x", "y", "offset_default", "popperOffsets", "_ref", "state", "name", "computeOffsets", "popperOffsets_default", "getAltAxis", "axis", "preventOverflow", "_ref", "state", "options", "name", "_options$mainAxis", "checkMainAxis", "_options$altAxis", "checkAltAxis", "boundary", "rootBoundary", "altBoundary", "padding", "_options$tether", "tether", "_options$tetherOffset", "tetherOffset", "overflow", "detectOverflow", "basePlacement", "getBasePlacement", "variation", "getVariation", "isBasePlacement", "mainAxis", "getMainAxisFromPlacement", "altAxis", "getAltAxis", "popperOffsets", "referenceRect", "popperRect", "tetherOffsetValue", "normalizedTetherOffsetValue", "offsetModifierState", "data", "_offsetModifierState$", "mainSide", "top", "left", "altSide", "bottom", "right", "len", "offset", "min", "max", "additive", "minLen", "start", "maxLen", "arrowElement", "arrowRect", "getLayoutRect", "arrowPaddingObject", "getFreshSideObject", "arrowPaddingMin", "arrowPaddingMax", "arrowLen", "within", "minOffset", "maxOffset", "arrowOffsetParent", "getOffsetParent", "clientOffset", "offsetModifierValue", "tetherMin", "tetherMax", "preventedOffset", "_offsetModifierState$2", "_mainSide", "_altSide", "_offset", "_len", "_min", "_max", "isOriginSide", "_offsetModifierValue", "_tetherMin", "_tetherMax", "_preventedOffset", "withinMaxClamp", "preventOverflow_default", "getHTMLElementScroll", "element", "getNodeScroll", "node", "getWindow", "isHTMLElement", "getWindowScroll", "getHTMLElementScroll", "isElementScaled", "element", "rect", "scaleX", "round", "scaleY", "getCompositeRect", "elementOrVirtualElement", "offsetParent", "isFixed", "isOffsetParentAnElement", "isHTMLElement", "offsetParentIsScaled", "documentElement", "getDocumentElement", "getBoundingClientRect", "scroll", "offsets", "getNodeName", "isScrollParent", "getNodeScroll", "getWindowScrollBarX", "order", "modifiers", "map", "visited", "result", "modifier", "sort", "requires", "dep", "depModifier", "orderModifiers", "orderedModifiers", "modifierPhases", "acc", "phase", "debounce", "fn", "pending", "resolve", "mergeByName", "modifiers", "merged", "current", "existing", "key", "DEFAULT_OPTIONS", "areValidElements", "_len", "args", "_key", "element", "popperGenerator", "generatorOptions", "_generatorOptions", "_generatorOptions$def", "defaultModifiers", "_generatorOptions$def2", "defaultOptions", "reference", "popper", "options", "state", "effectCleanupFns", "isDestroyed", "instance", "setOptionsAction", "cleanupModifierEffects", "isElement", "listScrollParents", "orderedModifiers", "orderModifiers", "mergeByName", "m", "runModifierEffects", "_state$elements", "getCompositeRect", "getOffsetParent", "getLayoutRect", "modifier", "index", "_state$orderedModifie", "fn", "_state$orderedModifie2", "_options", "name", "debounce", "resolve", "_ref", "_ref$options", "effect", "cleanupFn", "noopFn", "createPopper", "defaultModifiers", "eventListeners_default", "popperOffsets_default", "computeStyles_default", "applyStyles_default", "createPopper", "popperGenerator", "defaultModifiers", "eventListeners_default", "popperOffsets_default", "computeStyles_default", "applyStyles_default", "offset_default", "flip_default", "preventOverflow_default", "arrow_default", "hide_default", "createPopper", "popperGenerator", "elementMap", "Map", "Data", "set", "element", "key", "instance", "has", "instanceMap", "get", "size", "console", "error", "Array", "from", "keys", "remove", "delete", "MAX_UID", "MILLISECONDS_MULTIPLIER", "TRANSITION_END", "parseSelector", "selector", "window", "CSS", "escape", "replace", "match", "id", "toType", "object", "Object", "prototype", "toString", "call", "toLowerCase", "getUID", "prefix", "Math", "floor", "random", "document", "getElementById", "getTransitionDurationFromElement", "transitionDuration", "transitionDelay", "getComputedStyle", "floatTransitionDuration", "Number", "parseFloat", "floatTransitionDelay", "split", "triggerTransitionEnd", "dispatchEvent", "Event", "isElement", "jquery", "nodeType", "getElement", "length", "querySelector", "isVisible", "getClientRects", "elementIsVisible", "getPropertyValue", "closedDetails", "closest", "summary", "parentNode", "isDisabled", "Node", "ELEMENT_NODE", "classList", "contains", "disabled", "hasAttribute", "getAttribute", "findShadowRoot", "documentElement", "attachShadow", "getRootNode", "root", "ShadowRoot", "noop", "reflow", "offsetHeight", "getjQuery", "jQuery", "body", "DOMContentLoadedCallbacks", "onDOMContentLoaded", "callback", "readyState", "addEventListener", "push", "isRTL", "dir", "defineJQueryPlugin", "plugin", "$", "name", "NAME", "JQUERY_NO_CONFLICT", "fn", "jQueryInterface", "Constructor", "noConflict", "execute", "possibleCallback", "args", "defaultValue", "executeAfterTransition", "transitionElement", "waitForTransition", "emulatedDuration", "called", "handler", "target", "removeEventListener", "setTimeout", "getNextActiveElement", "list", "activeElement", "shouldGetNext", "isCycleAllowed", "listLength", "index", "indexOf", "max", "min", "namespaceRegex", "stripNameRegex", "stripUidRegex", "eventRegistry", "uidEvent", "customEvents", "mouseenter", "mouseleave", "nativeEvents", "Set", "makeEventUid", "uid", "getElementEvents", "bootstrapHandler", "event", "hydrateObj", "delegateTarget", "oneOff", "EventHandler", "off", "type", "apply", "bootstrapDelegationHandler", "domElements", "querySelectorAll", "domElement", "findHandler", "events", "callable", "delegationSelector", "values", "find", "normalizeParameters", "originalTypeEvent", "delegationFunction", "isDelegated", "typeEvent", "getTypeEvent", "addHandler", "relatedTarget", "handlers", "previousFunction", "removeHandler", "Boolean", "removeNamespacedHandlers", "namespace", "storeElementEvent", "handlerKey", "entries", "includes", "on", "one", "inNamespace", "isNamespace", "startsWith", "elementEvent", "slice", "keyHandlers", "trigger", "jQueryEvent", "bubbles", "nativeDispatch", "defaultPrevented", "isPropagationStopped", "isImmediatePropagationStopped", "isDefaultPrevented", "evt", "cancelable", "preventDefault", "obj", "meta", "value", "_unused", "defineProperty", "configurable", "normalizeData", "JSON", "parse", "decodeURIComponent", "normalizeDataKey", "chr", "Manipulator", "setDataAttribute", "setAttribute", "removeDataAttribute", "removeAttribute", "getDataAttributes", "attributes", "bsKeys", "dataset", "filter", "pureKey", "charAt", "getDataAttribute", "Config", "Default", "DefaultType", "Error", "_getConfig", "config", "_mergeConfigObj", "_configAfterMerge", "_typeCheckConfig", "jsonConfig", "__spreadValues", "constructor", "configTypes", "property", "expectedTypes", "valueType", "RegExp", "test", "TypeError", "toUpperCase", "VERSION", "BaseComponent", "_element", "_config", "DATA_KEY", "dispose", "EVENT_KEY", "propertyName", "getOwnPropertyNames", "_queueCallback", "isAnimated", "getInstance", "getOrCreateInstance", "eventName", "getSelector", "hrefAttribute", "trim", "map", "sel", "join", "SelectorEngine", "concat", "Element", "findOne", "children", "child", "matches", "parents", "ancestor", "prev", "previous", "previousElementSibling", "next", "nextElementSibling", "focusableChildren", "focusables", "el", "getSelectorFromElement", "getElementFromSelector", "getMultipleElementsFromSelector", "enableDismissTrigger", "component", "method", "clickEvent", "tagName", "EVENT_CLOSE", "EVENT_CLOSED", "CLASS_NAME_FADE", "CLASS_NAME_SHOW", "Alert", "close", "_destroyElement", "each", "data", "undefined", "DATA_API_KEY", "CLASS_NAME_ACTIVE", "SELECTOR_DATA_TOGGLE", "EVENT_CLICK_DATA_API", "Button", "toggle", "button", "EVENT_TOUCHSTART", "EVENT_TOUCHMOVE", "EVENT_TOUCHEND", "EVENT_POINTERDOWN", "EVENT_POINTERUP", "POINTER_TYPE_TOUCH", "POINTER_TYPE_PEN", "CLASS_NAME_POINTER_EVENT", "SWIPE_THRESHOLD", "endCallback", "leftCallback", "rightCallback", "Swipe", "isSupported", "_deltaX", "_supportPointerEvents", "PointerEvent", "_initEvents", "_start", "touches", "clientX", "_eventIsPointerPenTouch", "_end", "_handleSwipe", "_move", "absDeltaX", "abs", "direction", "add", "pointerType", "navigator", "maxTouchPoints", "ARROW_LEFT_KEY", "ARROW_RIGHT_KEY", "TOUCHEVENT_COMPAT_WAIT", "ORDER_NEXT", "ORDER_PREV", "DIRECTION_LEFT", "DIRECTION_RIGHT", "EVENT_SLIDE", "EVENT_SLID", "EVENT_KEYDOWN", "EVENT_MOUSEENTER", "EVENT_MOUSELEAVE", "EVENT_DRAG_START", "EVENT_LOAD_DATA_API", "CLASS_NAME_CAROUSEL", "CLASS_NAME_SLIDE", "CLASS_NAME_END", "CLASS_NAME_START", "CLASS_NAME_NEXT", "CLASS_NAME_PREV", "SELECTOR_ACTIVE", "SELECTOR_ITEM", "SELECTOR_ACTIVE_ITEM", "SELECTOR_ITEM_IMG", "SELECTOR_INDICATORS", "SELECTOR_DATA_SLIDE", "SELECTOR_DATA_RIDE", "KEY_TO_DIRECTION", "interval", "keyboard", "pause", "ride", "touch", "wrap", "Carousel", "_interval", "_activeElement", "_isSliding", "touchTimeout", "_swipeHelper", "_indicatorsElement", "_addEventListeners", "cycle", "_slide", "nextWhenVisible", "hidden", "_clearInterval", "_updateInterval", "setInterval", "_maybeEnableCycle", "to", "items", "_getItems", "activeIndex", "_getItemIndex", "_getActive", "order", "defaultInterval", "_keydown", "_addTouchEventListeners", "img", "swipeConfig", "_directionToOrder", "endCallBack", "clearTimeout", "_setActiveIndicatorElement", "activeIndicator", "newActiveIndicator", "elementInterval", "parseInt", "isNext", "nextElement", "nextElementIndex", "triggerEvent", "_orderToDirection", "isCycling", "directionalClassName", "orderClassName", "completeCallBack", "_isAnimated", "clearInterval", "carousel", "slideIndex", "carousels", "EVENT_SHOW", "EVENT_SHOWN", "EVENT_HIDE", "EVENT_HIDDEN", "CLASS_NAME_COLLAPSE", "CLASS_NAME_COLLAPSING", "CLASS_NAME_COLLAPSED", "CLASS_NAME_DEEPER_CHILDREN", "CLASS_NAME_HORIZONTAL", "WIDTH", "HEIGHT", "SELECTOR_ACTIVES", "parent", "Collapse", "_isTransitioning", "_triggerArray", "toggleList", "elem", "filterElement", "foundElement", "_initializeChildren", "_addAriaAndCollapsedClass", "_isShown", "hide", "show", "activeChildren", "_getFirstLevelChildren", "activeInstance", "dimension", "_getDimension", "style", "complete", "scrollSize", "getBoundingClientRect", "selected", "triggerArray", "isOpen", "ESCAPE_KEY", "TAB_KEY", "ARROW_UP_KEY", "ARROW_DOWN_KEY", "RIGHT_MOUSE_BUTTON", "EVENT_KEYDOWN_DATA_API", "EVENT_KEYUP_DATA_API", "CLASS_NAME_DROPUP", "CLASS_NAME_DROPEND", "CLASS_NAME_DROPSTART", "CLASS_NAME_DROPUP_CENTER", "CLASS_NAME_DROPDOWN_CENTER", "SELECTOR_DATA_TOGGLE_SHOWN", "SELECTOR_MENU", "SELECTOR_NAVBAR", "SELECTOR_NAVBAR_NAV", "SELECTOR_VISIBLE_ITEMS", "PLACEMENT_TOP", "PLACEMENT_TOPEND", "PLACEMENT_BOTTOM", "PLACEMENT_BOTTOMEND", "PLACEMENT_RIGHT", "PLACEMENT_LEFT", "PLACEMENT_TOPCENTER", "PLACEMENT_BOTTOMCENTER", "autoClose", "boundary", "display", "offset", "popperConfig", "reference", "Dropdown", "_popper", "_parent", "_menu", "_inNavbar", "_detectNavbar", "showEvent", "_createPopper", "focus", "_completeHide", "destroy", "update", "hideEvent", "Popper", "referenceElement", "_getPopperConfig", "createPopper", "_getPlacement", "parentDropdown", "isEnd", "_getOffset", "popperData", "defaultBsPopperConfig", "placement", "modifiers", "options", "enabled", "_selectMenuItem", "clearMenus", "openToggles", "context", "composedPath", "isMenuTarget", "dataApiKeydownHandler", "isInput", "isEscapeEvent", "isUpOrDownEvent", "getToggleButton", "stopPropagation", "EVENT_MOUSEDOWN", "className", "clickCallback", "rootElement", "Backdrop", "_isAppended", "_append", "_getElement", "_emulateAnimation", "backdrop", "createElement", "append", "EVENT_FOCUSIN", "EVENT_KEYDOWN_TAB", "TAB_NAV_FORWARD", "TAB_NAV_BACKWARD", "autofocus", "trapElement", "FocusTrap", "_isActive", "_lastTabNavDirection", "activate", "_handleFocusin", "_handleKeydown", "deactivate", "elements", "shiftKey", "SELECTOR_FIXED_CONTENT", "SELECTOR_STICKY_CONTENT", "PROPERTY_PADDING", "PROPERTY_MARGIN", "ScrollBarHelper", "getWidth", "documentWidth", "clientWidth", "innerWidth", "width", "_disableOverFlow", "_setElementAttributes", "calculatedValue", "reset", "_resetElementAttributes", "isOverflowing", "_saveInitialAttribute", "overflow", "styleProperty", "scrollbarWidth", "manipulationCallBack", "setProperty", "_applyManipulationCallback", "actualValue", "removeProperty", "callBack", "EVENT_HIDE_PREVENTED", "EVENT_RESIZE", "EVENT_CLICK_DISMISS", "EVENT_MOUSEDOWN_DISMISS", "EVENT_KEYDOWN_DISMISS", "CLASS_NAME_OPEN", "CLASS_NAME_STATIC", "OPEN_SELECTOR", "SELECTOR_DIALOG", "SELECTOR_MODAL_BODY", "Modal", "_dialog", "_backdrop", "_initializeBackDrop", "_focustrap", "_initializeFocusTrap", "_scrollBar", "_adjustDialog", "_showElement", "_hideModal", "handleUpdate", "scrollTop", "modalBody", "transitionComplete", "_triggerBackdropTransition", "event2", "_resetAdjustments", "isModalOverflowing", "scrollHeight", "clientHeight", "initialOverflowY", "overflowY", "isBodyOverflowing", "paddingLeft", "paddingRight", "alreadyOpen", "CLASS_NAME_SHOWING", "CLASS_NAME_HIDING", "CLASS_NAME_BACKDROP", "scroll", "Offcanvas", "blur", "completeCallback", "position", "ARIA_ATTRIBUTE_PATTERN", "DefaultAllowlist", "a", "area", "b", "br", "col", "code", "dd", "div", "dl", "dt", "em", "hr", "h1", "h2", "h3", "h4", "h5", "h6", "i", "li", "ol", "p", "pre", "s", "small", "span", "sub", "sup", "strong", "u", "ul", "uriAttributes", "SAFE_URL_PATTERN", "allowedAttribute", "attribute", "allowedAttributeList", "attributeName", "nodeName", "nodeValue", "attributeRegex", "some", "regex", "sanitizeHtml", "unsafeHtml", "allowList", "sanitizeFunction", "createdDocument", "DOMParser", "parseFromString", "elementName", "attributeList", "allowedAttributes", "innerHTML", "content", "extraClass", "html", "sanitize", "sanitizeFn", "template", "DefaultContentType", "entry", "TemplateFactory", "getContent", "_resolvePossibleFunction", "hasContent", "changeContent", "_checkContent", "toHtml", "templateWrapper", "_maybeSanitize", "text", "_setContent", "arg", "templateElement", "_putElementInTemplate", "textContent", "DISALLOWED_ATTRIBUTES", "CLASS_NAME_MODAL", "SELECTOR_TOOLTIP_INNER", "SELECTOR_MODAL", "EVENT_MODAL_HIDE", "TRIGGER_HOVER", "TRIGGER_FOCUS", "TRIGGER_CLICK", "TRIGGER_MANUAL", "EVENT_INSERTED", "EVENT_CLICK", "EVENT_FOCUSOUT", "AttachmentMap", "AUTO", "TOP", "RIGHT", "BOTTOM", "LEFT", "animation", "container", "customClass", "delay", "fallbackPlacements", "title", "Tooltip", "_isEnabled", "_timeout", "_isHovered", "_activeTrigger", "_templateFactory", "_newContent", "tip", "_setListeners", "_fixTitle", "enable", "disable", "toggleEnabled", "click", "_leave", "_enter", "_hideModalHandler", "_disposePopper", "_isWithContent", "isInTheDom", "ownerDocument", "_getTipElement", "_isWithActiveTrigger", "_getTitle", "_createTipElement", "_getContentForTemplate", "_getTemplateFactory", "tipId", "setContent", "__spreadProps", "_initializeOnDelegatedTarget", "_getDelegateConfig", "attachment", "phase", "state", "triggers", "eventIn", "eventOut", "_setTimeout", "timeout", "dataAttributes", "dataAttribute", "SELECTOR_TITLE", "SELECTOR_CONTENT", "Popover", "_getContent", "EVENT_ACTIVATE", "CLASS_NAME_DROPDOWN_ITEM", "SELECTOR_DATA_SPY", "SELECTOR_TARGET_LINKS", "SELECTOR_NAV_LIST_GROUP", "SELECTOR_NAV_LINKS", "SELECTOR_NAV_ITEMS", "SELECTOR_LIST_ITEMS", "SELECTOR_LINK_ITEMS", "SELECTOR_DROPDOWN", "SELECTOR_DROPDOWN_TOGGLE", "rootMargin", "smoothScroll", "threshold", "ScrollSpy", "_targetLinks", "_observableSections", "_rootElement", "_activeTarget", "_observer", "_previousScrollData", "visibleEntryTop", "parentScrollTop", "refresh", "_initializeTargetsAndObservables", "_maybeEnableSmoothScroll", "disconnect", "_getNewObserver", "section", "observe", "observableSection", "hash", "height", "offsetTop", "scrollTo", "top", "behavior", "IntersectionObserver", "_observerCallback", "targetElement", "_process", "userScrollsDown", "isIntersecting", "_clearActiveClass", "entryIsLowerThanPrevious", "targetLinks", "anchor", "decodeURI", "_activateParents", "listGroup", "item", "activeNodes", "node", "spy", "HOME_KEY", "END_KEY", "CLASS_DROPDOWN", "SELECTOR_DROPDOWN_MENU", "NOT_SELECTOR_DROPDOWN_TOGGLE", "SELECTOR_TAB_PANEL", "SELECTOR_OUTER", "SELECTOR_INNER", "SELECTOR_INNER_ELEM", "SELECTOR_DATA_TOGGLE_ACTIVE", "Tab", "_setInitialAttributes", "_getChildren", "innerElem", "_elemIsActive", "active", "_getActiveElem", "_deactivate", "_activate", "relatedElem", "_toggleDropDown", "nextActiveElement", "preventScroll", "_setAttributeIfNotExists", "_setInitialAttributesOnChild", "_getInnerElement", "isActive", "outerElem", "_getOuterElement", "_setInitialAttributesOnTargetPanel", "open", "EVENT_MOUSEOVER", "EVENT_MOUSEOUT", "CLASS_NAME_HIDE", "autohide", "Toast", "_hasMouseInteraction", "_hasKeyboardInteraction", "_clearTimeout", "_maybeScheduleHide", "isShown", "_onInteraction", "isInteracting", "import_htmx", "forEvents", "events", "callback", "event", "MicroEvent", "fct", "event_array", "n", "args", "self", "MicroPlugin", "Interface", "name", "fn", "plugins", "key", "self", "queue", "plugin", "arrayToPattern", "chars", "maxValueLength", "sequencePattern", "array", "hasDuplicates", "pattern", "prev_char_count", "prev_pattern", "char", "i", "setToPattern", "escape_regex", "str", "longest", "value", "unicodeLength", "allSubstrings", "input", "result", "start", "subresult", "tmp", "code_points", "accent_pat", "unicode_map", "multi_char_reg", "max_char_length", "latin_convert", "latin_condensed", "latin", "unicode", "i", "char", "convert_pat", "initialize", "_code_points", "generateMap", "normalize", "str", "form", "asciifold", "result", "_asciifold", "generator", "code_point_min", "code_point_max", "composed", "folded", "generateSets", "unicode_sets", "addMatching", "to_add", "folded_set", "patt", "setToPattern", "escape_regex", "value", "multi_char", "set", "a", "b", "multi_char_patt", "arrayToPattern", "mapSequence", "strings", "min_replacement", "chars_replaced", "sequencePattern", "substringsToPattern", "allSubstrings", "sub_pat", "sequencesToPattern", "sequences", "all", "sequence", "seq", "len", "j", "inSequences", "needle_seq", "needle_parts", "filter", "part", "needle_part", "Sequence", "_Sequence", "__publicField", "position", "last_piece", "clone", "parts", "last_part", "last_substr", "clone_last_len", "getPattern", "pattern", "match", "match_str", "overlapping", "added_types", "new_seq", "old_seq", "getAttr", "obj", "name", "getAttrNesting", "part", "names", "scoreValue", "value", "token", "weight", "score", "pos", "propToArray", "key", "iterate", "object", "callback", "cmp", "a", "b", "asciifold", "Sifter", "items", "settings", "__publicField", "query", "respect_word_boundaries", "weights", "tokens", "words", "field_regex", "escape_regex", "word", "field_match", "field", "regex", "getPattern", "options", "search", "token_count", "fields", "field_count", "getAttrFn", "scoreObject", "token", "data", "scoreValue", "sum", "value", "iterate", "weight", "score", "implicit_score", "sort_flds", "self", "sort", "get_field", "name", "result", "s", "fld", "a", "b", "sort_fld", "cmp", "optsUser", "propToArray", "getAttrNesting", "getAttr", "fn_score", "item", "id", "_", "fn_sort", "hash_key", "value", "get_hash", "escape_html", "str", "timeout", "fn", "loadDebounce", "delay", "callback", "self", "debounce_events", "types", "type", "trigger", "event_args", "getSelection", "input", "preventDefault", "evt", "stop", "addEvent", "target", "options", "isKeyDown", "key_name", "count", "getId", "el", "id", "existing_id", "addSlashes", "append", "parent", "node", "iterate", "object", "key", "getDom", "query", "isHtmlString", "tpl", "arg", "escapeQuery", "triggerEvent", "dom_el", "event_name", "event", "applyCSS", "css", "addClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "el", "cls", "removeClasses", "args", "iterate", "_classes", "parentMatch", "target", "selector", "wrapper", "getTail", "list", "direction", "isEmptyObject", "obj", "nodeIndex", "amongst", "i", "setAttr", "attrs", "val", "attr", "replaceNode", "existing", "replacement", "highlight", "element", "regex", "highlightText", "node", "match", "spannode", "middlebit", "middleclone", "replaceNode", "highlightChildren", "highlightRecursive", "removeHighlight", "el", "elements", "parent", "IS_MAC", "KEY_SHORTCUT", "defaults_default", "query", "getSettings", "input", "settings_user", "settings", "defaults_default", "attr_data", "field_label", "field_value", "field_disabled", "field_optgroup", "field_optgroup_label", "field_optgroup_value", "tag_name", "placeholder", "option", "settings_element", "init_select", "tagName", "options", "optionsMap", "group_count", "$order", "readData", "el", "data", "json", "addOption", "group", "value", "hash_key", "arr", "option_data", "addGroup", "optgroup", "id", "optgroup_data", "iterate", "child", "init_textbox", "data_raw", "opt", "values", "instance_i", "TomSelect", "MicroPlugin", "MicroEvent", "input_arg", "user_settings", "dir", "input", "getDom", "computedStyle", "settings", "getSettings", "getId", "Sifter", "filter", "value", "wrapper", "control", "dropdown", "dropdown_content", "classes", "inputMode", "control_input", "addClasses", "append", "isHtmlString", "attrs", "iterate", "attr", "setAttr", "self", "focus_node", "passive_event", "listboxId", "control_id", "query", "escapeQuery", "label", "label_click", "addEvent", "label_id", "classes_plugins", "escape_regex", "loadDebounce", "e", "target_match", "parentMatch", "evt", "option", "preventDefault", "doc_mousedown", "target", "win_scroll", "options", "optgroups", "optgroup", "field_label", "field_optgroup", "templates", "data", "escape", "key", "fn", "callbacks", "get_settings", "triggerEvent", "pastedText", "splitInput", "piece", "hash_key", "character", "isKeyDown", "KEY_SHORTCUT", "next", "prev", "timeout", "wasFocused", "deactivate", "item", "callback", "removeClasses", "classList", "changed", "silent", "events", "debounce_events", "eventName", "i", "begin", "end", "swap", "last", "last_active", "idx", "scroll", "behavior", "content", "height_menu", "scrollTop", "height_item", "y", "activeItems", "sort", "result", "calculateScore", "hashed", "triggerDropdown", "j", "k", "n", "html", "has_create_option", "active_group", "create", "groups", "groups_order", "same_query", "results", "active_option", "show_dropdown", "getGroupFragment", "order", "group_order_i", "order_group", "group_fragment", "opt_value", "opt_hash", "get_hash", "option_el", "self_optgroup", "a", "b", "group_order", "group_heading", "group_options", "header", "group_html", "removeHighlight", "tok", "highlight", "add_template", "template", "active_index", "user_created", "dat", "id", "hashed_id", "item_new", "index_item", "value_old", "value_new", "data_old", "option_new", "replaceNode", "boundFilter", "selected", "direction", "type", "all", "addSlashes", "values", "items", "x", "last_item", "wasFull", "nodeIndex", "caret", "output", "created", "isFull", "isLocked", "wrap_classList", "isEmptyObject", "opts", "empty_option", "AddSelected", "escape_html", "has_selected", "reuse_opt", "applyCSS", "setTextboxValue", "trigger", "context", "rect", "top", "left", "el", "selection", "tail", "getSelection", "rm_items", "getTail", "rm_item", "adjacent", "new_pos", "lock", "disabled", "isReadOnly", "revertSettings", "templateName", "when", "method", "new_fn", "orig_method", "result_new", "addEvent", "target", "type", "callback", "options", "addEventListener", "plugin", "input", "sync", "hash_key", "value", "get_hash", "preventDefault", "evt", "stop", "stopPropagation", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "plugin", "userOptions", "self", "orig_onOptionSelect", "onOptionSelect", "settings", "hideSelected", "cbOptions", "Object", "assign", "className", "checkedClassNames", "undefined", "uncheckedClassNames", "UpdateChecked", "checkbox", "toCheck", "checked", "classList", "remove", "add", "UpdateCheckbox", "option", "setTimeout", "HTMLInputElement", "contains", "hook", "orig_render_option", "render", "data", "escape_html", "rendered", "call", "addEventListener", "type", "hashed", "valueField", "items", "prepend", "on", "getOption", "removeItem", "dataset", "refreshOptions", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "plugin", "userOptions", "self", "options", "Object", "assign", "className", "title", "html", "data", "on", "button", "addEventListener", "evt", "isLocked", "clear", "settings", "mode", "allowEmptyOption", "addItem", "preventDefault", "stopPropagation", "control", "appendChild", "preventDefault", "evt", "stop", "stopPropagation", "addEvent", "target", "type", "callback", "options", "addEventListener", "iterate", "object", "Array", "isArray", "forEach", "key", "hasOwnProperty", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "setAttr", "el", "attrs", "val", "attr", "removeAttribute", "setAttribute", "insertAfter", "referenceNode", "newNode", "_referenceNode$parent", "parentNode", "insertBefore", "nextSibling", "_referenceNode$parent2", "isBefore", "_newNode", "previousElementSibling", "plugin", "self", "settings", "mode", "orig_lock", "lock", "orig_unlock", "unlock", "sortable", "drag_item", "hook", "orig_render_item", "render", "item", "data", "escape", "call", "mousedown", "dragStart", "setTimeout", "classList", "add", "dragOver", "moveitem", "dragLeave", "remove", "targetitem", "dragitem", "undefined", "dragend", "_drag_item", "querySelectorAll", "values", "control", "dataset", "value", "push", "setValue", "preventDefault", "evt", "stop", "stopPropagation", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "plugin", "userOptions", "self", "options", "Object", "assign", "title", "headerClass", "titleRowClass", "labelClass", "closeClass", "html", "data", "on", "header", "close_link", "addEventListener", "close", "dropdown", "insertBefore", "iterate", "object", "callback", "Array", "isArray", "forEach", "key", "hasOwnProperty", "removeClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "map", "el", "cls", "classList", "remove", "args", "_classes", "trim", "split", "concat", "filter", "Boolean", "arg", "nodeIndex", "amongst", "nodeName", "i", "previousElementSibling", "matches", "plugin", "self", "hook", "new_pos", "settings", "mode", "control", "contains", "control_input", "items", "length", "Math", "max", "min", "caretPos", "isPending", "controlChildren", "child", "j", "insertAdjacentElement", "appendChild", "direction", "isFocused", "last_active", "getLastActive", "idx", "setCaret", "setActiveItem", "preventDefault", "evt", "stop", "stopPropagation", "addEvent", "target", "type", "callback", "options", "addEventListener", "iterate", "object", "Array", "isArray", "forEach", "key", "hasOwnProperty", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "addClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "map", "el", "cls", "classList", "add", "args", "_classes", "split", "concat", "filter", "Boolean", "plugin", "self", "settings", "shouldOpen", "hook", "focus_node", "control", "control_input", "div", "append", "dropdown", "insertBefore", "placeholder", "on", "keyCode", "constants", "isOpen", "close", "clearActiveItems", "tabIndex", "onKeyDown", "call", "isDisabled", "focus", "orig_onBlur", "onBlur", "relatedTarget", "preventScroll", "addEvent", "target", "type", "callback", "options", "addEventListener", "plugin", "self", "on", "test_input", "document", "createElement", "control", "control_input", "style", "cssText", "wrapper", "appendChild", "transfer_styles", "style_name", "resize", "textContent", "value", "width", "clientWidth", "plugin", "self", "orig_deleteSelection", "deleteSelection", "hook", "evt", "activeItems", "length", "call", "plugin", "hook", "parentMatch", "target", "selector", "wrapper", "matches", "parentNode", "nodeIndex", "el", "amongst", "nodeName", "i", "previousElementSibling", "plugin", "self", "orig_keydown", "onKeyDown", "hook", "evt", "index", "option", "options", "optgroup", "isOpen", "keyCode", "constants", "call", "ignoreHover", "activeOption", "previousSibling", "nextSibling", "querySelectorAll", "Math", "min", "length", "setActiveOption", "escape_html", "str", "replace", "preventDefault", "evt", "stop", "stopPropagation", "addEvent", "target", "type", "callback", "options", "addEventListener", "getDom", "query", "jquery", "HTMLElement", "isHtmlString", "tpl", "document", "createElement", "innerHTML", "trim", "content", "firstChild", "querySelector", "arg", "indexOf", "plugin", "userOptions", "Object", "assign", "label", "title", "className", "append", "self", "html", "hook", "orig_render_item", "settings", "render", "item", "data", "escape", "call", "close_button", "appendChild", "isLocked", "shouldDelete", "removeItem", "refreshOptions", "inputState", "plugin", "userOptions", "self", "options", "Object", "assign", "text", "option", "settings", "labelField", "on", "value", "isFocused", "control_input", "trim", "setTextboxValue", "call", "iterate", "object", "callback", "Array", "isArray", "forEach", "key", "hasOwnProperty", "addClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "map", "el", "cls", "classList", "add", "args", "_classes", "trim", "split", "concat", "filter", "Boolean", "arg", "plugin", "self", "orig_canLoad", "canLoad", "orig_clearActiveOption", "clearActiveOption", "orig_loadCallback", "loadCallback", "pagination", "dropdown_content", "loading_more", "load_more_opt", "default_values", "settings", "shouldLoadMore", "clientHeight", "scrollHeight", "scrollTop", "activeOption", "selectable", "index", "from", "indexOf", "length", "firstUrl", "sortField", "field", "canLoadMore", "query", "maxOptions", "children", "clearFilter", "option", "value", "items", "setNextUrl", "next_url", "getUrl", "clearPagination", "call", "hook", "options", "optgroups", "clearOptions", "first_option", "undefined", "dataset", "valueField", "lastValue", "render", "setAttribute", "querySelector", "optionClass", "append", "on", "Object", "keys", "assign", "no_more_results", "addEventListener", "load", "TomSelect", "plugin", "tom_select_complete_default", "hasError", "data", "isTruthy", "value", "badStrings", "isElement", "obj", "apiRequest", "url", "method", "data", "__async", "token", "headers", "body", "res", "contentType", "json", "apiPatch", "getElements", "key", "query", "element", "getElement", "id", "scrollTo", "element", "offset", "yOffset", "title", "top", "getSelectedOptions", "base", "selector", "selected", "select", "option", "findFirstAdjacent", "base", "query", "boundary", "atBoundary", "element", "match", "parent", "child", "createElement", "tag", "properties", "classes", "children", "k", "key", "value", "replaceAll", "input", "pattern", "replacement", "flags", "handleFormSubmit", "event", "form", "invalids", "element", "firstInvalid", "scrollTo", "initFormElements", "getElements", "submitters", "submitter", "resetButton", "initSpeedSelector", "element", "getElements", "handleClick", "event", "value", "input", "initForms", "func", "initFormElements", "initSpeedSelector", "Collapse", "Modal", "Popover", "Toast", "Tooltip", "initTooltips", "tooltip", "getElements", "initModals", "modal", "createToast", "level", "title", "message", "extra", "iconName", "container", "main", "header", "icon", "titleElement", "button", "body", "extraElement", "initTabs", "hash", "target", "element", "Tab", "initSidebarAccordions", "items", "handleToggle", "thisItem", "item", "initImagePreview", "maxWidth", "image", "createElement", "content", "initBootstrap", "func", "quickSearchEventHandler", "event", "quicksearch", "clearbtn", "isTruthy", "clearLinkParams", "link", "linkUpdated", "handleQuickSearchParams", "quickSearchParameters", "search_parameter", "initQuickSearch", "__async", "search", "f", "getPlugins", "element", "plugins", "data", "initStaticSelects", "select", "getElements", "tom_select_complete_default", "__spreadProps", "__spreadValues", "getPlugins", "initColorSelects", "renderColor", "item", "escape", "iterate", "object", "callback", "key", "addClasses", "elmts", "classes", "norm_classes", "classesArray", "castAsArray", "el", "cls", "classesArray", "args", "classes", "iterate", "_classes", "castAsArray", "arg", "base_exports", "__export", "exclude", "extract", "parse", "parseUrl", "pick", "stringify", "stringifyUrl", "token", "singleMatcher", "multiMatcher", "decodeComponents", "components", "split", "e", "left", "right", "decode", "input", "tokens", "i", "customDecodeURIComponent", "replaceMap", "match", "result", "entries", "key", "decodeUriComponent", "encodedURI", "includeKeys", "object", "predicate", "result", "key", "descriptor", "value", "splitOnFirst", "string", "separator", "separatorIndex", "isNullOrUndefined", "value", "strictUriEncode", "string", "x", "encodeFragmentIdentifier", "encoderForArrayFormat", "options", "key", "result", "index", "encode", "keyValueSeparator", "parserForArrayFormat", "accumulator", "isArray", "isEncodedArray", "decode", "newValue", "item", "arrayValue", "validateArrayFormatSeparator", "decodeUriComponent", "keysSorter", "input", "a", "b", "removeHash", "hashStart", "getHash", "url", "hash", "parseValue", "type", "extract", "queryStart", "parse", "query", "__spreadValues", "formatter", "returnValue", "parameter", "parameter_", "splitOnFirst", "key2", "value2", "stringify", "object", "shouldFilter", "objectCopy", "keys", "parseUrl", "_a", "_b", "url_", "stringifyUrl", "queryFromUrl", "queryString", "urlObjectForFragmentEncode", "pick", "filter", "fragmentIdentifier", "includeKeys", "exclude", "exclusionFilter", "query_string_default", "base_exports", "isDataDynamicParams", "value", "item", "DynamicParamsMap", "fieldName", "value", "queryValue", "current", "isTruthy", "queryParam", "json", "deserialized", "isDataDynamicParams", "DynamicTomSelect", "tom_select_complete_default", "input_arg", "user_settings", "__publicField", "DynamicParamsMap", "nullOption", "valueField", "labelField", "key", "value", "filter", "self", "url", "addClasses", "response", "apiData", "results", "options", "result", "option", "search", "query", "replaceAll", "query_string_default", "data", "parent", "serialized", "deserialized", "queryParam", "queryValue", "err", "fieldName", "element", "elementValue", "o", "current", "staticValue", "id", "getElement", "dependencies", "dep", "filterElement", "event", "target", "VALUE_FIELD", "LABEL_FIELD", "MAX_OPTIONS", "renderOption", "data", "escape", "html", "renderItem", "initDynamicSelects", "select", "getElements", "DynamicTomSelect", "__spreadProps", "__spreadValues", "getPlugins", "initSelects", "initStaticSelects", "initDynamicSelects", "initColorSelects", "setConnectionStatus", "element", "status", "_a", "row", "url", "isTruthy", "apiPatch", "res", "hasError", "createToast", "initConnectionToggle", "getElements", "ProxyStateHandler", "target", "key", "value", "StateManager", "raw", "options", "__publicField", "saved", "__spreadValues", "obj", "createState", "initial", "objectDepthState", "createState", "rackImagesState", "createState", "previousPkCheckState", "createState", "secretState", "createState", "toggleDepthButton", "hidden", "button", "showDepthIndicators", "element", "getElements", "hideDepthIndicators", "handleDepthToggle", "state", "initiallyHidden", "initDepthToggle", "objectDepthState", "event", "moveOptionUp", "element", "options", "i", "option", "moveOptionDown", "next", "initMoveButtons", "button", "getElements", "target", "select", "slugify", "slug", "chars", "initReslug", "slugButton", "getElements", "form", "slugField", "sourceId", "sourceField", "slugLengthAttr", "slugLength", "handlePkCheck", "event", "element", "getElements", "handleSelectAllToggle", "tableSelectAll", "table", "findFirstAdjacent", "confirmCard", "confirmCheckbox", "initSelectAll", "toggleFloat", "checkedCheckboxes", "buttonGroup", "isFloating", "initFloatBulk", "element", "getElements", "removeTextSelection", "_a", "updatePreviousPkCheckState", "eventTargetElement", "state", "toggleCheckboxRange", "previousStateElement", "elementList", "changePkCheckboxState", "element", "typedElement", "handlePkCheck", "event", "checkboxList", "getElements", "initSelectMultiple", "checkboxElements", "previousPkCheckState", "initMarkdownPreview", "markdownWidget", "previewButton", "textarea", "preview", "isTruthy", "height", "e", "initMarkdownPreviews", "toggleSecretButton", "hidden", "button", "showSecret", "secret", "getElement", "isTruthy", "value", "hideSecret", "handleSecretToggle", "state", "toggleCallback", "event", "secretState", "initSecretToggle", "getElements", "initButtons", "func", "initDepthToggle", "initConnectionToggle", "initReslug", "initSelectAll", "initSelectMultiple", "initFloatBulk", "initMoveButtons", "initMarkdownPreviews", "initSecretToggle", "COLOR_MODE_KEY", "isColorMode", "value", "storeColorMode", "mode", "updateElements", "targetMode", "_a", "_b", "body", "elevation", "getElements", "svg", "setColorMode", "handleColorModeToggle", "currentValue", "defaultColorMode", "isTruthy", "preference", "initColorModeToggle", "element", "initColorMode", "func", "initMessages", "elements", "element", "toast", "Toast", "import_clipboard", "initClipboard", "element", "getElements", "Clipboard", "HOOKS", "defaults", "err", "givenDate", "date", "week1", "english", "nth", "s", "default_default", "pad", "number", "length", "int", "bool", "debounce", "fn", "wait", "t", "_this", "args", "arrayify", "obj", "toggleClass", "elem", "className", "bool", "createElement", "tag", "content", "e", "clearNode", "node", "findParent", "condition", "createNumberInput", "inputClassName", "opts", "wrapper", "numInput", "arrowUp", "arrowDown", "key", "getEventTarget", "event", "path", "error", "doNothing", "monthToStr", "monthNumber", "shorthand", "locale", "revFormat", "dateObj", "monthName", "hour", "day", "amPM", "int", "shortMonth", "seconds", "_", "unixSeconds", "weekNum", "weekNumber", "date", "year", "ISODate", "minutes", "month", "unixMillSeconds", "tokenRegex", "formats", "options", "pad", "createDateFormatter", "_a", "_b", "config", "defaults", "_c", "l10n", "english", "_d", "isMobile", "dateObj", "frmt", "overrideLocale", "locale", "c", "i", "arr", "formats", "createDateParser", "date", "givenFormat", "timeless", "customLocale", "parsedDate", "dateOrig", "format", "datestr", "matched", "ops", "matchIndex", "regexStr", "token", "isBackSlash", "escaped", "tokenRegex", "match", "revFormat", "fn", "val", "compareDates", "date1", "date2", "isBetween", "ts", "ts1", "ts2", "calculateSecondsSinceMidnight", "hours", "minutes", "seconds", "parseSeconds", "secondsSinceMidnight", "duration", "getDefaultHours", "config", "minHour", "minMinutes", "minSeconds", "maxHr", "maxMinutes", "target", "args", "_i", "_loop_1", "source", "key", "_a", "args_1", "__assign", "t", "s", "i", "n", "p", "__spreadArrays", "il", "r", "k", "a", "j", "jl", "DEBOUNCED_CHANGE_MS", "FlatpickrInstance", "element", "instanceConfig", "self", "defaults", "flatpickr", "default_default", "createDateParser", "bind", "setHoursFromDate", "positionCalendar", "changeMonth", "changeYear", "clear", "close", "onMouseOver", "createElement", "createDay", "destroy", "isEnabled", "jumpToDate", "updateValue", "open", "redraw", "set", "setDate", "toggle", "setupHelperFunctions", "month", "yr", "init", "parseConfig", "setupLocale", "setupInputs", "setupDates", "build", "bindEvents", "setCalendarWidth", "isSafari", "triggerEvent", "getClosestActiveElement", "_a", "bindToInstance", "fn", "config", "daysWidth", "updateTime", "e", "defaultDate", "compareDates", "getDefaultHours", "timeWrapper", "prevValue", "setHoursFromInputs", "ampm2military", "hour", "amPM", "int", "military2ampm", "hours", "minutes", "seconds", "limitMinHours", "limitMaxHours", "minBound", "calculateSecondsSinceMidnight", "maxBound", "currentTime", "result", "parseSeconds", "maxTime", "minTime", "setHours", "dateObj", "date", "pad", "onYearInput", "event", "eventTarget", "getEventTarget", "year", "handler", "options", "ev", "el", "triggerChange", "evt", "setupMobile", "debouncedResize", "debounce", "onResize", "onKeyDown", "documentClick", "onMonthNavClick", "selectDate", "selText", "timeIncrement", "onBlur", "jumpDate", "jumpTo", "oldYear", "oldMonth", "buildMonthSwitch", "incrementNumInput", "delta", "inputElem", "target", "input", "createEvent", "fragment", "buildMonthNav", "buildWeeks", "weekWrapper", "weekNumbers", "buildWeekdays", "buildDays", "buildTime", "toggleClass", "customAppend", "wrapper", "className", "_dayNumber", "dateIsEnabled", "dayElement", "isDateSelected", "isDateInRange", "focusOnDayElem", "targetNode", "getFirstAvailableDay", "startMonth", "endMonth", "m", "startIndex", "endIndex", "c", "getNextAvailableDay", "current", "givenMonth", "loopDelta", "numMonthDays", "focusOnDay", "offset", "activeElement", "dayFocused", "isInView", "startElem", "buildMonthDays", "firstOfMonth", "prevMonthDays", "daysInMonth", "days", "isMultiMonth", "prevMonthDayClass", "nextMonthDayClass", "dayNumber", "dayIndex", "dayNum", "dayContainer", "clearNode", "frag", "d", "shouldBuildMonth", "monthToStr", "buildMonth", "container", "monthNavFragment", "monthElement", "selectedMonth", "yearInput", "createNumberInput", "yearElement", "currentMonth", "buildMonths", "bool", "updateNavigationCurrentMonth", "separator", "hourInput", "minuteInput", "secondInput", "updateWeekdays", "firstDayOfWeek", "weekdays", "value", "isOffset", "triggerChangeEvent", "toInitial", "_", "isCalendarElem", "elem", "eventTarget_1", "isCalendarElement", "isInput", "lostFocus", "isIgnored", "newYear", "newYearNum", "isNewYear", "timeless", "dateToCheck", "array", "parsed", "valueChanged", "getDateStr", "allowInput", "allowKeydown", "allowInlineKeydown", "isTimeObj", "focusAndClose", "delta_1", "elems", "x", "cellClass", "hoverDate", "initialDate", "rangeStartDate", "rangeEndDate", "containsDisabled", "minRange", "maxRange", "duration", "hoverableCells", "dayElem", "timestamp", "outOfRange", "isBetween", "positionElement", "wasOpen", "minMaxDateSetter", "type", "inverseDateObj", "boolOpts", "userConfig", "formats", "dates", "parseDateRules", "timeMode", "defaultDateFormat", "defaultAltFormat", "minMaxTimeSetter", "val", "HOOKS", "hook", "arrayify", "pluginConf", "key", "getInputElem", "tokenRegex", "createDateFormatter", "customPositionElement", "calendarHeight", "acc", "child", "calendarWidth", "configPos", "configPosVertical", "configPosHorizontal", "inputBounds", "distanceFromBottom", "showOnTop", "top", "left", "isCenter", "isRight", "right", "rightMost", "centerMost", "doc", "getDocumentStyleSheet", "bodyWidth", "centerLeft", "centerBefore", "centerAfter", "centerIndex", "centerStyle", "editableSheet", "sheet", "err", "createStyleSheet", "style", "isSelectable", "day", "findParent", "selectedDate", "shouldChangeMonth", "selectedIndex", "b", "single", "range", "CALLBACKS", "updatePositionElement", "option", "setSelectedDate", "inputDate", "format", "arr", "rule", "preloadedDate", "inputType", "data", "hooks", "name", "specificFormat", "dObj", "isPrevMonth", "isNextMonth", "isKeyDown", "min", "max", "step", "curValue", "newValue", "isHourElem", "isMinuteElem", "_flatpickr", "nodeList", "nodes", "instances", "node", "selector", "l10n", "esm_default", "initDateSelector", "esm_default", "saveTableConfig", "element", "getElements", "addColumns", "event", "selectedOption", "selected", "removeColumns", "available", "submitFormConfig", "url", "formConfig", "__async", "apiPatch", "handleSubmit", "_a", "_b", "_c", "createToast", "reset", "path", "data", "value", "key", "res", "hasError", "options", "getSelectedOptions", "formData", "opt", "initTableConfig", "isShowHide", "value", "TableStateError", "message", "table", "__publicField", "ButtonState", "button", "rows", "row", "state", "replaceAll", "event", "TableState", "toggleEnabledButton", "findFirstAdjacent", "toggleDisabledButton", "toggleVirtualButton", "toggleDisconnectedButton", "err", "instance", "initInterfaceTable", "element", "getElements", "SideNav", "base", "__publicField", "StateManager", "attr", "attrs", "toggler", "event", "getElements", "link", "collapse", "element", "section", "collapseInstance", "Collapse", "action", "_a", "dropdownMenu", "isElement", "groupItem", "groupLink", "menuitem", "href", "initSideNav", "sidenav", "obsolete", "self", "f", "oldName", "newName", "rev", "wrapper", "args", "Utils", "_Utils", "els", "root", "doc", "el", "list", "itemClass", "n", "_a", "_b", "cont", "entry", "GridStack", "classes", "parent", "c", "strict", "a", "b", "x0", "x1", "y0", "y1", "nodes", "dir", "_c", "_d", "diffY", "id", "options", "style", "nonce", "sheet", "selector", "rules", "v", "value", "val", "h", "unit", "match", "target", "sources", "source", "key", "doMinMax", "node", "aVal", "bVal", "removeEl", "func", "delay", "isWaiting", "args", "position", "distance", "rect", "innerHeightOrClientHeight", "offsetDiffDown", "offsetDiffUp", "scrollEl", "prevScroll", "event", "height", "offsetTop", "pointerPosY", "top", "bottom", "obj", "__spreadValues", "skipFields", "ret", "k", "parentNode", "styles", "s", "e", "info", "evt", "p", "simulatedType", "simulatedEvent", "transformReference", "transformValues", "o", "tmp", "GridStackEngine", "_GridStackEngine", "opts", "flag", "doPack", "node", "nn", "collide", "opt", "area", "didMove", "newOpt", "counter", "moved", "__spreadProps", "__spreadValues", "newNN", "Utils", "skip", "skip2", "skipId", "skip2Id", "n", "o", "collides", "r0", "r", "overMax", "r2", "yOver", "xOver", "over", "w", "h", "top", "right", "bottom", "left", "a", "b", "_doSwap", "x", "y", "touching", "t", "layout", "doSort", "wasBatch", "wasColumnResize", "copyNodes", "index", "list", "after", "val", "dir", "newY", "i", "resizing", "_a", "id", "count", "defaults", "before", "copy", "verify", "removedNodes", "dirtyNodes", "nodeList", "column", "start", "found", "box", "triggerAddEvent", "dup", "skipCollision", "removeDOM", "triggerEvent", "clonedNode", "clone", "canMove", "c", "p", "_b", "wasUndefinedPack", "prevPos", "needToMove", "activeDrag", "a1", "a2", "row", "saveElement", "saveCB", "len", "wl", "l", "nodes", "ratio", "prevColumn", "doCompact", "newNodes", "cacheNodes", "lastIndex", "cacheNode", "_c", "j", "move", "scale", "clear", "existing", "n2", "prop", "gridDefaults", "DDManager", "isTouch", "DDTouch", "simulateMouseEvent", "e", "simulatedType", "touch", "simulatedEvent", "simulatePointerMouseEvent", "touchstart", "touchmove", "touchend", "wasDragging", "DDManager", "pointerdown", "pointerenter", "pointerleave", "DDResizableHandle", "_DDResizableHandle", "host", "dir", "option", "el", "isTouch", "touchstart", "pointerdown", "e", "touchmove", "touchend", "s", "_a", "_b", "name", "event", "DDBaseImplement", "event", "callback", "eventName", "DDResizable", "_DDResizable", "DDBaseImplement", "el", "option", "containmentRect", "newRect", "rect", "event", "callback", "opts", "updateHandles", "updateAutoHide", "key", "auto", "DDManager", "e", "dir", "DDResizableHandle", "Utils", "ev", "prop", "parent", "dragTransform", "i", "oEvent", "offsetX", "offsetY", "moveLeft", "moveUp", "constrain", "oWidth", "oHeight", "o", "maxWidth", "minWidth", "maxHeight", "minHeight", "width", "height", "containmentEl", "left", "top", "value", "scaleReciprocal", "handle", "skipMouseDown", "DDDraggable", "_DDDraggable", "DDBaseImplement", "el", "option", "_a", "handleName", "n", "event", "callback", "dragEl", "isTouch", "touchstart", "pointerdown", "forDestroy", "opts", "key", "e", "DDManager", "touchmove", "touchend", "ev", "Utils", "s", "pause", "grid", "_b", "__spreadValues", "helper", "prop", "style", "node", "transition", "containmentRect", "offset", "parent", "xformOffsetX", "xformOffsetY", "targetOffset", "DDDroppable", "DDBaseImplement", "el", "option", "event", "callback", "isTouch", "pointerenter", "pointerleave", "forDestroy", "opts", "key", "e", "DDManager", "ev", "Utils", "calledByEnter", "_a", "parentDrop", "parent", "drag", "__spreadValues", "DDElement", "_DDElement", "el", "eventName", "callback", "opts", "DDDraggable", "DDResizable", "DDDroppable", "DDGridStack", "el", "opts", "key", "value", "dEl", "grid", "handles", "autoHide", "__spreadProps", "__spreadValues", "_a", "name", "callback", "event", "DDManager", "els", "create", "hosts", "Utils", "list", "e", "DDElement", "d", "dd", "DDGridStack", "GridStack", "_GridStack", "options", "elOrString", "el", "Utils", "selector", "grids", "parent", "opt", "grid", "__spreadValues", "engineClass", "gridDefaults", "placeholderChild", "opts", "_a", "_b", "_c", "rowAttr", "bk", "oldOpts", "oneSize", "oneColumn", "b", "resp", "a", "defaults", "__spreadProps", "parentGridItem", "parentNode", "isTouch", "GridStackEngine", "cbNodes", "maxH", "n", "children", "DDManager", "w", "node", "domAttr", "ops", "nodeToAdd", "saveContent", "subGridTemplate", "autoColumn", "content", "newItem", "newItemOpt", "h", "style", "subGrid", "nodeThatRemoved", "pGrid", "saveGridOpt", "saveCB", "list", "itemContent", "listOrOpt", "o", "origShow", "items", "addRemove", "column", "maxColumn", "prevCB", "removed", "blank", "updateNodes", "item", "sub", "flag", "forcePixel", "rows", "val", "update", "marginDiff", "data", "forBreakpoint", "newColumn", "i", "layout", "doSort", "oldColumn", "removeDOM", "position", "useDocRelative", "box", "containerPos", "relativeLeft", "relativeTop", "columnWidth", "rowHeight", "x", "y", "els", "name", "callback", "event", "key", "triggerEvent", "doAnimate", "delay", "updateClass", "recurse", "keys", "m", "k", "changed", "ddChanged", "widthChanged", "wasUpdating", "cell", "height", "padding", "itemH", "wantedH", "subRec", "parentRec", "child", "softMax", "relative", "rot", "pivotX", "pivotY", "_orig", "value", "elements", "addedNodes", "removedNodes", "type", "styleLocation", "forceUpdate", "cellHeight", "cellHeightUnit", "prefix", "top", "bottom", "right", "left", "placeholder", "getHeight", "row", "unit", "cssMinHeight", "minRow", "triggerAddEvent", "sizeToContent", "attrs", "clearDefaultAttr", "classes", "clientWidth", "columnChanged", "nodes", "forceRemove", "trackSize", "margin", "margins", "dragIn", "dragInOptions", "widgets", "root", "doEnable", "cellWidth", "onDrag", "helper", "helperRect", "rect", "ui", "canAccept", "attr", "error", "wasAdded", "wasSidebar", "noAnim", "origNode", "oGrid", "remove", "trashEl", "noMove", "noResize", "onStartMoving", "dragOrResize", "onEndMoving", "target", "gridEl", "colLeft", "rowLeft", "p", "resizing", "mLeft", "mRight", "mTop", "mBottom", "mHeight", "mWidth", "distance", "prev", "extra", "obsolete", "lockDashboard", "dashboard", "unlockDashboard", "saveDashboardLayout", "url", "gridData", "__async", "apiPatch", "initDashboard", "grid", "GridStack", "gridLockButton", "gridUnlockButton", "gridSaveButton", "res", "hasError", "createToast", "setRackView", "view", "elevation", "showRackElements", "hideRackElements", "selector", "_a", "_b", "elements", "element", "handleRackViewSelect", "newView", "state", "getElements", "initRackElevation", "initialView", "rackImagesState", "control", "o", "event", "handleSelection", "link", "selector_results", "target_id", "target", "label", "value", "initObjectSelector", "element", "getElements", "handleQuickAddObject", "quick_add", "object_id", "object_repr", "target_id", "target", "modal_element", "modal", "Modal", "initQuickAdd", "quick_add_modal", "initDepedencies", "initButtons", "initClipboard", "initSelects", "initObjectSelector", "initQuickAdd", "initBootstrap", "initMessages", "initHtmx", "handleSavedFilterChange", "event", "savedFilter", "baseUrl", "preFilter", "selectedOptions", "option", "initSavedFilterSelect", "divResults", "isTruthy", "savedFilterSelect", "initDocument", "init", "initBootstrap", "initColorMode", "initMessages", "initForms", "initQuickSearch", "initSelects", "initDateSelector", "initButtons", "initClipboard", "initTableConfig", "initInterfaceTable", "initSideNav", "initDashboard", "initRackElevation", "initHtmx", "initSavedFilterSelect", "initWindow", "documentForms", "documentForm", "event", "formData", "name", "value", "contentContainer"] } diff --git a/netbox/project-static/netbox-graphiql/package.json b/netbox/project-static/netbox-graphiql/package.json index c5b2f3077d2..00218185ab2 100644 --- a/netbox/project-static/netbox-graphiql/package.json +++ b/netbox/project-static/netbox-graphiql/package.json @@ -6,9 +6,9 @@ "license": "Apache-2.0", "private": true, "dependencies": { - "@graphiql/plugin-explorer": "3.2.3", - "graphiql": "3.7.2", - "graphql": "16.9.0", + "@graphiql/plugin-explorer": "3.2.5", + "graphiql": "3.8.3", + "graphql": "16.10.0", "js-cookie": "3.0.5", "react": "18.3.1", "react-dom": "18.3.1" diff --git a/netbox/project-static/package.json b/netbox/project-static/package.json index 34974fe1214..8416d4b4b0b 100644 --- a/netbox/project-static/package.json +++ b/netbox/project-static/package.json @@ -27,10 +27,10 @@ "bootstrap": "5.3.3", "clipboard": "2.0.11", "flatpickr": "4.6.13", - "gridstack": "11.1.2", + "gridstack": "11.2.0", "htmx.org": "1.9.12", "query-string": "9.1.1", - "sass": "1.82.0", + "sass": "1.83.1", "tom-select": "2.4.1", "typeface-inter": "3.18.1", "typeface-roboto-mono": "1.1.13" diff --git a/netbox/project-static/yarn.lock b/netbox/project-static/yarn.lock index a57d6dc9b89..a3ded9bdb09 100644 --- a/netbox/project-static/yarn.lock +++ b/netbox/project-static/yarn.lock @@ -200,17 +200,17 @@ resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.2.tgz#d8bae93ac8b815b2bd7a98078cf91e2724ef11e5" integrity sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw== -"@graphiql/plugin-explorer@3.2.3": - version "3.2.3" - resolved "https://registry.yarnpkg.com/@graphiql/plugin-explorer/-/plugin-explorer-3.2.3.tgz#03854d7e62d6e24c6552ae6706e3945b9324fa23" - integrity sha512-yh5WXRqDPuKjVyNxUwXYjx8tImvVOx+2FGanLyjoAJP2LKQu6eDtButyJ8sExk1qW4+HCSrXxJNSPs4W7cYT3g== +"@graphiql/plugin-explorer@3.2.5": + version "3.2.5" + resolved "https://registry.yarnpkg.com/@graphiql/plugin-explorer/-/plugin-explorer-3.2.5.tgz#02e64eb5b934da3240bcb8c02cc77bee32d818ab" + integrity sha512-gM9UwD0PcOHe+XrRY2YMIV4pUrDIfV0YBQ5kQUZxk0BuVvZO9xk06XFv5plBKDAwtxbsuq+nET4i9FJCiYev2g== dependencies: graphiql-explorer "^0.9.0" -"@graphiql/react@^0.27.0": - version "0.27.0" - resolved "https://registry.yarnpkg.com/@graphiql/react/-/react-0.27.0.tgz#4475a0f4ddf25d8ebc1bfc538fb21f5f1d435916" - integrity sha512-K9ZKWd+ewodbS/1kewedmITeeKLUQswMOXwIv8XFLPt3Ondodji0vr1XXXsttlyl+V2QG/9tYVV2RJ9Ch5LdrA== +"@graphiql/react@^0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@graphiql/react/-/react-0.28.2.tgz#031a3599e0fa054990b31a2f4eceb5ac13845188" + integrity sha512-6PE2Ff9dXpyQMHy3oKzCjT738kY2+wdQ4Xce8+1K+G2yMGZ716Fo0i4vW3S6ErHVI4S/C76gFTQlv/pzxU5ylg== dependencies: "@graphiql/toolkit" "^0.11.0" "@headlessui/react" "^1.7.15" @@ -221,12 +221,13 @@ "@types/codemirror" "^5.60.8" clsx "^1.2.1" codemirror "^5.65.3" - codemirror-graphql "^2.1.1" + codemirror-graphql "^2.2.0" copy-to-clipboard "^3.2.0" framer-motion "^6.5.1" get-value "^3.0.1" graphql-language-service "^5.3.0" markdown-it "^14.1.0" + react-compiler-runtime "19.0.0-beta-37ed2a7-20241206" set-value "^4.1.0" "@graphiql/toolkit@^0.11.0": @@ -1147,10 +1148,10 @@ clsx@^1.2.1: resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== -codemirror-graphql@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/codemirror-graphql/-/codemirror-graphql-2.1.1.tgz#cbf5f0c8d2143b70cd832a08a6d827148d6e9a1d" - integrity sha512-qVNd+H4OqkeBLDztB5bYllAmToxmZASOoELgbf+csNcoovIHKqSB/eppkzWI5jdQGd8bvLK1lTePfqXsCBFryw== +codemirror-graphql@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/codemirror-graphql/-/codemirror-graphql-2.2.0.tgz#1eb7388a1d6844b0ce902a26cba4bdf59b547bc0" + integrity sha512-egIiewf5zEH5LLSkJpJDpYxO1OkNruD0gTWiBrS1JmXk7yjt5WPw7jSmDRkWJx8JheHONltaJPNPWdTUT5LRIQ== dependencies: "@types/codemirror" "^0.0.90" graphql-language-service "5.3.0" @@ -1883,12 +1884,12 @@ graphiql-explorer@^0.9.0: resolved "https://registry.yarnpkg.com/graphiql-explorer/-/graphiql-explorer-0.9.0.tgz#25f6b990bfc3e04e88c0cf419e28d12abe2c4fbe" integrity sha512-fZC/wsuatqiQDO2otchxriFO0LaWIo/ovF/CQJ1yOudmY0P7pzDiP+l9CEHUiWbizk3e99x6DQG4XG1VxA+d6A== -graphiql@3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/graphiql/-/graphiql-3.7.2.tgz#6a754256f4f2e6268a64e585b0fe35bf38f1b87d" - integrity sha512-DL+KrX+aQdyzl+KwcqjlmdYdjyKegm7FcZJKkIQ1e56xn6Eoe8lw5F4t65gFex/45fHzv8e8CpaIcljxfJhO7A== +graphiql@3.8.3: + version "3.8.3" + resolved "https://registry.yarnpkg.com/graphiql/-/graphiql-3.8.3.tgz#3ce95db42317c3fbba6cdbfab5d2430756f9b5dd" + integrity sha512-cuPDYtXVKV86Pu5PHBX642Odi/uVEE2y1Jxq5rGO/Qy1G2lRp7ZZ7a/T30RzxhuLSWo9zUbzq0P3U49//H0Ugw== dependencies: - "@graphiql/react" "^0.27.0" + "@graphiql/react" "^0.28.2" graphql-language-service@5.3.0, graphql-language-service@^5.3.0: version "5.3.0" @@ -1899,15 +1900,15 @@ graphql-language-service@5.3.0, graphql-language-service@^5.3.0: nullthrows "^1.0.0" vscode-languageserver-types "^3.17.1" -graphql@16.9.0: - version "16.9.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.9.0.tgz#1c310e63f16a49ce1fbb230bd0a000e99f6f115f" - integrity sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw== +graphql@16.10.0: + version "16.10.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.10.0.tgz#24c01ae0af6b11ea87bf55694429198aaa8e220c" + integrity sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ== -gridstack@11.1.2: - version "11.1.2" - resolved "https://registry.yarnpkg.com/gridstack/-/gridstack-11.1.2.tgz#e72091e2883f7b37cbd150c218d38eebc9fc4f18" - integrity sha512-6wJ5RffnFchF63/Yhs6tcZcWxRG1EgCnxgejbQsAjQ6Qj8QqKjew73jPq5c1yCAiyEAsXxI2tOJ8lZABOAZxoQ== +gridstack@11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/gridstack/-/gridstack-11.2.0.tgz#8977a6632c521260f064ef171b92c7a8df4f58a9" + integrity sha512-ajwUzd9spR8NXDxfJotHWq9WOYoDOV9o6UJR3ksevNz8cvXNxDtI9H/lC+RN6ijM2DexureLlsG0RpYjBZiOtg== has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" @@ -2529,6 +2530,11 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +react-compiler-runtime@19.0.0-beta-37ed2a7-20241206: + version "19.0.0-beta-37ed2a7-20241206" + resolved "https://registry.yarnpkg.com/react-compiler-runtime/-/react-compiler-runtime-19.0.0-beta-37ed2a7-20241206.tgz#f05231928f2daf9ff5ff9b63e5861161de2c3e6d" + integrity sha512-9e6rCpVylr9EnVocgYAjft7+2v01BDpajeHKRoO+oc9pKcAMTpstHtHvE/TSVbyf4FvzCGjfKcfHM9XGTXI6Tw== + react-dom@18.3.1: version "18.3.1" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" @@ -2661,10 +2667,10 @@ safe-regex-test@^1.0.3: es-errors "^1.3.0" is-regex "^1.1.4" -sass@1.82.0: - version "1.82.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.82.0.tgz#30da277af3d0fa6042e9ceabd0d984ed6d07df70" - integrity sha512-j4GMCTa8elGyN9A7x7bEglx0VgSpNUG4W4wNedQ33wSMdnkqQCT8HTwOaVSV4e6yQovcu/3Oc4coJP/l0xhL2Q== +sass@1.83.1: + version "1.83.1" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.83.1.tgz#dee1ab94b47a6f9993d3195d36f556bcbda64846" + integrity sha512-EVJbDaEs4Rr3F0glJzFSOvtg2/oy2V/YrGFPqPY24UqcLDWcI9ZY5sN+qyO3c/QCZwzgfirvhXvINiJCE/OLcA== dependencies: chokidar "^4.0.0" immutable "^5.0.2" diff --git a/netbox/translations/f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?1jzKMhGkGFM3pnEExez^| zO_Vsbx_9Z)Eu>>`x4;hYb4H$y2?A=xh#-y`M^XoPB00TyhNcN96Tx#iL%_MnQA-AO z2nh{#)edSiV@LLY71c>=!{P8RL5792G#;;^T8nnUVP0CVs-tIGk`?WoQHIWn@mXD7 zYR{1z0ezxd, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-12 05:02+0000\n" +"POT-Creation-Date: 2025-01-04 05:02+0000\n" "PO-Revision-Date: 2023-10-30 17:48+0000\n" -"Last-Translator: Jeremy Stretch, 2024\n" +"Last-Translator: marcpaulchand , 2025\n" "Language-Team: French (https://app.transifex.com/netbox-community/teams/178115/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -158,7 +159,7 @@ msgstr "Inactif" #: netbox/dcim/filtersets.py:464 netbox/dcim/filtersets.py:1021 #: netbox/dcim/filtersets.py:1368 netbox/dcim/filtersets.py:1903 #: netbox/dcim/filtersets.py:2146 netbox/dcim/filtersets.py:2204 -#: netbox/ipam/filtersets.py:339 netbox/ipam/filtersets.py:959 +#: netbox/ipam/filtersets.py:341 netbox/ipam/filtersets.py:961 #: netbox/virtualization/filtersets.py:45 #: netbox/virtualization/filtersets.py:173 netbox/vpn/filtersets.py:358 msgid "Region (ID)" @@ -170,8 +171,8 @@ msgstr "Région (ID)" #: netbox/dcim/filtersets.py:471 netbox/dcim/filtersets.py:1028 #: netbox/dcim/filtersets.py:1375 netbox/dcim/filtersets.py:1910 #: netbox/dcim/filtersets.py:2153 netbox/dcim/filtersets.py:2211 -#: netbox/extras/filtersets.py:509 netbox/ipam/filtersets.py:346 -#: netbox/ipam/filtersets.py:966 netbox/virtualization/filtersets.py:52 +#: netbox/extras/filtersets.py:509 netbox/ipam/filtersets.py:348 +#: netbox/ipam/filtersets.py:968 netbox/virtualization/filtersets.py:52 #: netbox/virtualization/filtersets.py:180 netbox/vpn/filtersets.py:353 msgid "Region (slug)" msgstr "Région (slug)" @@ -181,8 +182,8 @@ msgstr "Région (slug)" #: netbox/dcim/filtersets.py:346 netbox/dcim/filtersets.py:477 #: netbox/dcim/filtersets.py:1034 netbox/dcim/filtersets.py:1381 #: netbox/dcim/filtersets.py:1916 netbox/dcim/filtersets.py:2159 -#: netbox/dcim/filtersets.py:2217 netbox/ipam/filtersets.py:352 -#: netbox/ipam/filtersets.py:972 netbox/virtualization/filtersets.py:58 +#: netbox/dcim/filtersets.py:2217 netbox/ipam/filtersets.py:354 +#: netbox/ipam/filtersets.py:974 netbox/virtualization/filtersets.py:58 #: netbox/virtualization/filtersets.py:186 msgid "Site group (ID)" msgstr "Groupe de sites (ID)" @@ -193,7 +194,7 @@ msgstr "Groupe de sites (ID)" #: netbox/dcim/filtersets.py:1041 netbox/dcim/filtersets.py:1388 #: netbox/dcim/filtersets.py:1923 netbox/dcim/filtersets.py:2166 #: netbox/dcim/filtersets.py:2224 netbox/extras/filtersets.py:515 -#: netbox/ipam/filtersets.py:359 netbox/ipam/filtersets.py:979 +#: netbox/ipam/filtersets.py:361 netbox/ipam/filtersets.py:981 #: netbox/virtualization/filtersets.py:65 #: netbox/virtualization/filtersets.py:193 msgid "Site group (slug)" @@ -263,8 +264,8 @@ msgstr "Site" #: netbox/circuits/filtersets.py:62 netbox/circuits/filtersets.py:229 #: netbox/circuits/filtersets.py:274 netbox/dcim/filtersets.py:242 #: netbox/dcim/filtersets.py:363 netbox/dcim/filtersets.py:458 -#: netbox/extras/filtersets.py:531 netbox/ipam/filtersets.py:238 -#: netbox/ipam/filtersets.py:369 netbox/ipam/filtersets.py:989 +#: netbox/extras/filtersets.py:531 netbox/ipam/filtersets.py:240 +#: netbox/ipam/filtersets.py:371 netbox/ipam/filtersets.py:991 #: netbox/virtualization/filtersets.py:75 #: netbox/virtualization/filtersets.py:203 netbox/vpn/filtersets.py:363 msgid "Site (slug)" @@ -283,13 +284,13 @@ msgstr "Numéro d'AS" #: netbox/circuits/filtersets.py:95 netbox/circuits/filtersets.py:122 #: netbox/circuits/filtersets.py:156 netbox/circuits/filtersets.py:283 -#: netbox/circuits/filtersets.py:325 netbox/ipam/filtersets.py:243 +#: netbox/circuits/filtersets.py:325 netbox/ipam/filtersets.py:245 msgid "Provider (ID)" msgstr "Fournisseur (ID)" #: netbox/circuits/filtersets.py:101 netbox/circuits/filtersets.py:128 #: netbox/circuits/filtersets.py:162 netbox/circuits/filtersets.py:289 -#: netbox/circuits/filtersets.py:331 netbox/ipam/filtersets.py:249 +#: netbox/circuits/filtersets.py:331 netbox/ipam/filtersets.py:251 msgid "Provider (slug)" msgstr "Fournisseur (slug)" @@ -318,8 +319,8 @@ msgstr "Type de circuit (slug)" #: netbox/dcim/filtersets.py:452 netbox/dcim/filtersets.py:1045 #: netbox/dcim/filtersets.py:1393 netbox/dcim/filtersets.py:1928 #: netbox/dcim/filtersets.py:2170 netbox/dcim/filtersets.py:2229 -#: netbox/ipam/filtersets.py:232 netbox/ipam/filtersets.py:363 -#: netbox/ipam/filtersets.py:983 netbox/virtualization/filtersets.py:69 +#: netbox/ipam/filtersets.py:234 netbox/ipam/filtersets.py:365 +#: netbox/ipam/filtersets.py:985 netbox/virtualization/filtersets.py:69 #: netbox/virtualization/filtersets.py:197 netbox/vpn/filtersets.py:368 msgid "Site (ID)" msgstr "Site (ID)" @@ -673,7 +674,7 @@ msgstr "Identifiant de compte du prestataire" #: netbox/dcim/forms/filtersets.py:924 netbox/dcim/forms/filtersets.py:958 #: netbox/dcim/forms/filtersets.py:1059 netbox/dcim/forms/filtersets.py:1170 #: netbox/dcim/tables/devices.py:140 netbox/dcim/tables/devices.py:817 -#: netbox/dcim/tables/devices.py:1063 netbox/dcim/tables/modules.py:69 +#: netbox/dcim/tables/devices.py:1063 netbox/dcim/tables/modules.py:70 #: netbox/dcim/tables/power.py:74 netbox/dcim/tables/racks.py:126 #: netbox/dcim/tables/sites.py:82 netbox/dcim/tables/sites.py:138 #: netbox/ipam/forms/bulk_edit.py:256 netbox/ipam/forms/bulk_edit.py:306 @@ -1108,7 +1109,7 @@ msgstr "Affectation" #: netbox/circuits/tables/circuits.py:155 netbox/dcim/forms/bulk_edit.py:118 #: netbox/dcim/forms/bulk_import.py:100 netbox/dcim/forms/model_forms.py:117 #: netbox/dcim/tables/sites.py:89 netbox/extras/forms/filtersets.py:480 -#: netbox/ipam/filtersets.py:999 netbox/ipam/forms/bulk_edit.py:493 +#: netbox/ipam/filtersets.py:1001 netbox/ipam/forms/bulk_edit.py:493 #: netbox/ipam/forms/bulk_import.py:460 netbox/ipam/forms/model_forms.py:561 #: netbox/ipam/tables/fhrp.py:67 netbox/ipam/tables/vlans.py:122 #: netbox/ipam/tables/vlans.py:226 @@ -1548,7 +1549,7 @@ msgstr "Bande passante garantie" #: netbox/circuits/tables/providers.py:82 #: netbox/circuits/tables/providers.py:107 netbox/dcim/tables/devices.py:1036 #: netbox/dcim/tables/devicetypes.py:92 netbox/dcim/tables/modules.py:29 -#: netbox/dcim/tables/modules.py:72 netbox/dcim/tables/power.py:39 +#: netbox/dcim/tables/modules.py:73 netbox/dcim/tables/power.py:39 #: netbox/dcim/tables/power.py:96 netbox/dcim/tables/racks.py:84 #: netbox/dcim/tables/racks.py:145 netbox/dcim/tables/racks.py:225 #: netbox/dcim/tables/sites.py:108 netbox/extras/tables/tables.py:582 @@ -2954,7 +2955,7 @@ msgid "Parent site group (slug)" msgstr "Groupe de sites parents (slug)" #: netbox/dcim/filtersets.py:164 netbox/extras/filtersets.py:364 -#: netbox/ipam/filtersets.py:841 netbox/ipam/filtersets.py:993 +#: netbox/ipam/filtersets.py:843 netbox/ipam/filtersets.py:995 msgid "Group (ID)" msgstr "Groupe (ID)" @@ -3004,23 +3005,23 @@ msgstr "Fabricant (slug)" #: netbox/dcim/filtersets.py:393 msgid "Rack type (slug)" -msgstr "Type de rack (limace)" +msgstr "Type de baie (slug)" #: netbox/dcim/filtersets.py:397 msgid "Rack type (ID)" -msgstr "Type de rack (ID)" +msgstr "Type de baie (ID)" #: netbox/dcim/filtersets.py:411 netbox/dcim/filtersets.py:892 #: netbox/dcim/filtersets.py:994 netbox/dcim/filtersets.py:1850 -#: netbox/ipam/filtersets.py:381 netbox/ipam/filtersets.py:493 -#: netbox/ipam/filtersets.py:1003 netbox/virtualization/filtersets.py:210 +#: netbox/ipam/filtersets.py:383 netbox/ipam/filtersets.py:495 +#: netbox/ipam/filtersets.py:1005 netbox/virtualization/filtersets.py:210 msgid "Role (ID)" msgstr "Rôle (ID)" #: netbox/dcim/filtersets.py:417 netbox/dcim/filtersets.py:898 #: netbox/dcim/filtersets.py:1000 netbox/dcim/filtersets.py:1856 -#: netbox/extras/filtersets.py:558 netbox/ipam/filtersets.py:387 -#: netbox/ipam/filtersets.py:499 netbox/ipam/filtersets.py:1009 +#: netbox/extras/filtersets.py:558 netbox/ipam/filtersets.py:389 +#: netbox/ipam/filtersets.py:501 netbox/ipam/filtersets.py:1011 #: netbox/virtualization/filtersets.py:216 msgid "Role (slug)" msgstr "Rôle (slug)" @@ -3218,7 +3219,7 @@ msgstr "VDC (IDENTIFIANT)" msgid "Device model" msgstr "Modèle d'appareil" -#: netbox/dcim/filtersets.py:1267 netbox/ipam/filtersets.py:632 +#: netbox/dcim/filtersets.py:1267 netbox/ipam/filtersets.py:634 #: netbox/vpn/filtersets.py:102 netbox/vpn/filtersets.py:401 msgid "Interface (ID)" msgstr "Interface (ID)" @@ -3232,8 +3233,8 @@ msgid "Module bay (ID)" msgstr "Baie modulaire (ID)" #: netbox/dcim/filtersets.py:1333 netbox/dcim/filtersets.py:1425 -#: netbox/ipam/filtersets.py:611 netbox/ipam/filtersets.py:851 -#: netbox/ipam/filtersets.py:1115 netbox/virtualization/filtersets.py:161 +#: netbox/ipam/filtersets.py:613 netbox/ipam/filtersets.py:853 +#: netbox/ipam/filtersets.py:1117 netbox/virtualization/filtersets.py:161 #: netbox/vpn/filtersets.py:379 msgid "Device (ID)" msgstr "Appareil (ID)" @@ -3242,8 +3243,8 @@ msgstr "Appareil (ID)" msgid "Rack (name)" msgstr "Baie (nom)" -#: netbox/dcim/filtersets.py:1431 netbox/ipam/filtersets.py:606 -#: netbox/ipam/filtersets.py:846 netbox/ipam/filtersets.py:1121 +#: netbox/dcim/filtersets.py:1431 netbox/ipam/filtersets.py:608 +#: netbox/ipam/filtersets.py:848 netbox/ipam/filtersets.py:1123 #: netbox/vpn/filtersets.py:374 msgid "Device (name)" msgstr "Appareil (nom)" @@ -3295,9 +3296,9 @@ msgstr "VID attribué" #: netbox/dcim/forms/bulk_import.py:913 netbox/dcim/forms/filtersets.py:1428 #: netbox/dcim/forms/model_forms.py:1385 #: netbox/dcim/models/device_components.py:711 -#: netbox/dcim/tables/devices.py:626 netbox/ipam/filtersets.py:316 -#: netbox/ipam/filtersets.py:327 netbox/ipam/filtersets.py:483 -#: netbox/ipam/filtersets.py:584 netbox/ipam/filtersets.py:595 +#: netbox/dcim/tables/devices.py:626 netbox/ipam/filtersets.py:318 +#: netbox/ipam/filtersets.py:329 netbox/ipam/filtersets.py:485 +#: netbox/ipam/filtersets.py:586 netbox/ipam/filtersets.py:597 #: netbox/ipam/forms/bulk_edit.py:242 netbox/ipam/forms/bulk_edit.py:298 #: netbox/ipam/forms/bulk_edit.py:340 netbox/ipam/forms/bulk_import.py:157 #: netbox/ipam/forms/bulk_import.py:243 netbox/ipam/forms/bulk_import.py:279 @@ -3324,19 +3325,19 @@ msgstr "VID attribué" msgid "VRF" msgstr "VRF" -#: netbox/dcim/filtersets.py:1619 netbox/ipam/filtersets.py:322 -#: netbox/ipam/filtersets.py:333 netbox/ipam/filtersets.py:489 -#: netbox/ipam/filtersets.py:590 netbox/ipam/filtersets.py:601 +#: netbox/dcim/filtersets.py:1619 netbox/ipam/filtersets.py:324 +#: netbox/ipam/filtersets.py:335 netbox/ipam/filtersets.py:491 +#: netbox/ipam/filtersets.py:592 netbox/ipam/filtersets.py:603 msgid "VRF (RD)" msgstr "VRF (RD)" -#: netbox/dcim/filtersets.py:1624 netbox/ipam/filtersets.py:1030 +#: netbox/dcim/filtersets.py:1624 netbox/ipam/filtersets.py:1032 #: netbox/vpn/filtersets.py:342 msgid "L2VPN (ID)" msgstr "L2VPN (IDENTIFIANT)" #: netbox/dcim/filtersets.py:1630 netbox/dcim/forms/filtersets.py:1433 -#: netbox/dcim/tables/devices.py:570 netbox/ipam/filtersets.py:1036 +#: netbox/dcim/tables/devices.py:570 netbox/ipam/filtersets.py:1038 #: netbox/ipam/forms/filtersets.py:518 netbox/ipam/tables/vlans.py:137 #: netbox/templates/dcim/interface.html:93 netbox/templates/ipam/vlan.html:66 #: netbox/templates/vpn/l2vpntermination.html:12 @@ -3441,7 +3442,7 @@ msgstr "Panneau d'alimentation (ID)" #: netbox/templates/inc/panels/tags.html:5 #: netbox/utilities/forms/fields/fields.py:81 msgid "Tags" -msgstr "Balises" +msgstr "Étiquettes" #: netbox/dcim/forms/bulk_create.py:112 netbox/dcim/forms/filtersets.py:1498 #: netbox/dcim/forms/model_forms.py:488 netbox/dcim/forms/model_forms.py:546 @@ -3498,7 +3499,7 @@ msgstr "Fuseau horaire" #: netbox/dcim/forms/object_import.py:187 netbox/dcim/tables/devices.py:96 #: netbox/dcim/tables/devices.py:172 netbox/dcim/tables/devices.py:940 #: netbox/dcim/tables/devicetypes.py:80 netbox/dcim/tables/devicetypes.py:308 -#: netbox/dcim/tables/modules.py:20 netbox/dcim/tables/modules.py:60 +#: netbox/dcim/tables/modules.py:20 netbox/dcim/tables/modules.py:61 #: netbox/dcim/tables/racks.py:58 netbox/dcim/tables/racks.py:132 #: netbox/templates/dcim/devicetype.html:14 #: netbox/templates/dcim/inventoryitem.html:44 @@ -3597,7 +3598,7 @@ msgstr "Unité de poids" #: netbox/dcim/forms/model_forms.py:217 netbox/dcim/forms/model_forms.py:256 #: netbox/templates/dcim/rack.html:45 netbox/templates/dcim/racktype.html:13 msgid "Rack Type" -msgstr "Type de rack" +msgstr "Type de baie" #: netbox/dcim/forms/bulk_edit.py:299 netbox/dcim/forms/model_forms.py:220 #: netbox/dcim/forms/model_forms.py:297 @@ -3749,7 +3750,7 @@ msgid "Device Type" msgstr "Type d'appareil" #: netbox/dcim/forms/bulk_edit.py:598 netbox/dcim/forms/model_forms.py:401 -#: netbox/dcim/tables/modules.py:17 netbox/dcim/tables/modules.py:65 +#: netbox/dcim/tables/modules.py:17 netbox/dcim/tables/modules.py:66 #: netbox/templates/dcim/module.html:65 #: netbox/templates/dcim/modulebay.html:66 #: netbox/templates/dcim/moduletype.html:22 @@ -3857,7 +3858,7 @@ msgstr "Cluster" #: netbox/dcim/tables/devices.py:697 netbox/dcim/tables/devices.py:754 #: netbox/dcim/tables/devices.py:801 netbox/dcim/tables/devices.py:861 #: netbox/dcim/tables/devices.py:930 netbox/dcim/tables/devices.py:1057 -#: netbox/dcim/tables/modules.py:52 netbox/extras/forms/filtersets.py:321 +#: netbox/dcim/tables/modules.py:53 netbox/extras/forms/filtersets.py:321 #: netbox/ipam/forms/bulk_import.py:304 netbox/ipam/forms/bulk_import.py:505 #: netbox/ipam/forms/filtersets.py:551 netbox/ipam/forms/model_forms.py:323 #: netbox/ipam/forms/model_forms.py:712 netbox/ipam/forms/model_forms.py:745 @@ -4098,22 +4099,22 @@ msgstr "groupe VLAN" #: netbox/virtualization/forms/bulk_edit.py:248 #: netbox/virtualization/forms/model_forms.py:326 msgid "Untagged VLAN" -msgstr "VLAN non balisé" +msgstr "VLAN non étiqueté" #: netbox/dcim/forms/bulk_edit.py:1508 netbox/dcim/forms/model_forms.py:1376 #: netbox/dcim/tables/devices.py:585 #: netbox/virtualization/forms/bulk_edit.py:256 #: netbox/virtualization/forms/model_forms.py:335 msgid "Tagged VLANs" -msgstr "VLAN balisés" +msgstr "VLAN étiqueté" #: netbox/dcim/forms/bulk_edit.py:1511 msgid "Add tagged VLANs" -msgstr "" +msgstr "Ajouter des VLANs étiquetés" #: netbox/dcim/forms/bulk_edit.py:1520 msgid "Remove tagged VLANs" -msgstr "" +msgstr "Retirer des VLANs étiquetés" #: netbox/dcim/forms/bulk_edit.py:1536 netbox/dcim/forms/model_forms.py:1348 msgid "Wireless LAN group" @@ -4161,7 +4162,7 @@ msgstr "Commutation 802.1Q" #: netbox/dcim/forms/bulk_edit.py:1558 msgid "Add/Remove" -msgstr "" +msgstr "Ajouter/Supprimer" #: netbox/dcim/forms/bulk_edit.py:1617 netbox/dcim/forms/bulk_edit.py:1619 msgid "Interface mode must be specified to assign VLANs" @@ -4170,7 +4171,7 @@ msgstr "Le mode d'interface doit être spécifié pour attribuer des VLAN" #: netbox/dcim/forms/bulk_edit.py:1624 netbox/dcim/forms/common.py:50 msgid "An access interface cannot have tagged VLANs assigned." msgstr "" -"Des tags de VLAN ne peuvent pas être associés à une interface d'accès." +"Des étiquettes de VLAN ne peuvent pas être associés à une interface d'accès." #: netbox/dcim/forms/bulk_import.py:64 msgid "Name of parent region" @@ -4212,11 +4213,11 @@ msgstr "Emplacement introuvable." #: netbox/dcim/forms/bulk_import.py:185 msgid "The manufacturer of this rack type" -msgstr "Le fabricant de ce type de rack" +msgstr "Le fabricant de ce type de baie" #: netbox/dcim/forms/bulk_import.py:196 msgid "The lowest-numbered position in the rack" -msgstr "La position la plus basse du rack" +msgstr "La position la plus basse de la baie" #: netbox/dcim/forms/bulk_import.py:201 netbox/dcim/forms/bulk_import.py:276 msgid "Rail-to-rail width (in inches)" @@ -4228,7 +4229,7 @@ msgstr "Unité pour les dimensions extérieures" #: netbox/dcim/forms/bulk_import.py:213 netbox/dcim/forms/bulk_import.py:298 msgid "Unit for rack weights" -msgstr "Unité poids de la baie" +msgstr "Unité de poids de la baie" #: netbox/dcim/forms/bulk_import.py:245 msgid "Name of assigned tenant" @@ -4240,7 +4241,7 @@ msgstr "Nom du rôle attribué" #: netbox/dcim/forms/bulk_import.py:264 msgid "Rack type model" -msgstr "" +msgstr "Modèle de baie" #: netbox/dcim/forms/bulk_import.py:292 netbox/dcim/forms/bulk_import.py:435 #: netbox/dcim/forms/bulk_import.py:605 @@ -4656,8 +4657,9 @@ msgid "" "The tagged VLANs ({vlans}) must belong to the same site as the interface's " "parent device/VM, or they must be global" msgstr "" -"Les VLAN balisés ({vlans}) doivent appartenir au même site que l'appareil/la" -" machine virtuelle parent de l'interface, ou ils doivent être globaux" +"Les VLAN étiquetés ({vlans}) doivent appartenir au même site que " +"l'appareil/la machine virtuelle parente de l'interface, ou ils doivent être " +"globaux" #: netbox/dcim/forms/common.py:126 msgid "" @@ -4863,7 +4865,7 @@ msgstr "Identifiant" #: netbox/dcim/forms/model_forms.py:259 msgid "Select a pre-defined rack type, or set physical characteristics below." msgstr "" -"Sélectionnez un type de rack prédéfini ou définissez les caractéristiques " +"Sélectionnez un type de baie prédéfini ou définissez les caractéristiques " "physiques ci-dessous." #: netbox/dcim/forms/model_forms.py:265 @@ -5637,7 +5639,7 @@ msgstr "réseaux locaux sans fil" #: netbox/dcim/models/device_components.py:697 #: netbox/virtualization/models/virtualmachines.py:335 msgid "untagged VLAN" -msgstr "VLAN non balisé" +msgstr "VLAN non étiqueté" #: netbox/dcim/models/device_components.py:703 #: netbox/virtualization/models/virtualmachines.py:341 @@ -5786,7 +5788,7 @@ msgid "" "The untagged VLAN ({untagged_vlan}) must belong to the same site as the " "interface's parent device, or it must be global." msgstr "" -"Le VLAN non balisé ({untagged_vlan}) doit appartenir au même site que " +"Le VLAN non étiqueté ({untagged_vlan}) doit appartenir au même site que " "l'appareil parent de l'interface, ou il doit être global." #: netbox/dcim/models/device_components.py:990 @@ -6494,11 +6496,11 @@ msgstr "facteur de forme" #: netbox/dcim/models/racks.py:162 msgid "rack type" -msgstr "type de rack" +msgstr "type de baie" #: netbox/dcim/models/racks.py:163 msgid "rack types" -msgstr "types de rayonnages" +msgstr "types de baies" #: netbox/dcim/models/racks.py:180 netbox/dcim/models/racks.py:379 msgid "Must specify a unit when setting an outer width/depth" @@ -6852,7 +6854,7 @@ msgstr "Baies pour modules" msgid "Inventory items" msgstr "Articles d'inventaire" -#: netbox/dcim/tables/devices.py:305 netbox/dcim/tables/modules.py:56 +#: netbox/dcim/tables/devices.py:305 netbox/dcim/tables/modules.py:57 #: netbox/templates/dcim/modulebay.html:17 msgid "Module Bay" msgstr "Module Bay" @@ -7135,7 +7137,7 @@ msgstr "Réservations" #: netbox/dcim/views.py:757 netbox/templates/dcim/location.html:90 #: netbox/templates/dcim/site.html:140 msgid "Non-Racked Devices" -msgstr "Appareils non rackés" +msgstr "Appareils non mis en baie" #: netbox/dcim/views.py:2086 netbox/extras/forms/model_forms.py:577 #: netbox/templates/extras/configcontext.html:10 @@ -7584,12 +7586,12 @@ msgstr "Signets" msgid "Show your personal bookmarks" msgstr "Afficher vos favoris personnels" -#: netbox/extras/events.py:147 +#: netbox/extras/events.py:151 #, python-brace-format msgid "Unknown action type for an event rule: {action_type}" msgstr "Type d'action inconnu pour une règle d'événement : {action_type}" -#: netbox/extras/events.py:192 +#: netbox/extras/events.py:196 #, python-brace-format msgid "Cannot import events pipeline {name} error: {error}" msgstr "" @@ -7632,11 +7634,11 @@ msgstr "Groupe de locataires (slug)" #: netbox/extras/filtersets.py:623 netbox/extras/forms/model_forms.py:495 #: netbox/templates/extras/tag.html:11 msgid "Tag" -msgstr "Balise" +msgstr "Étiquette" #: netbox/extras/filtersets.py:629 msgid "Tag (slug)" -msgstr "Tag (slug)" +msgstr "Étiquette (slug)" #: netbox/extras/filtersets.py:689 netbox/extras/forms/filtersets.py:429 msgid "Has local config context data" @@ -7932,7 +7934,7 @@ msgstr "Type d'action" #: netbox/extras/forms/filtersets.py:307 msgid "Tagged object type" -msgstr "Type d'objet balisé" +msgstr "Type d'objet étiqueté" #: netbox/extras/forms/filtersets.py:312 msgid "Allowed object type" @@ -9066,7 +9068,7 @@ msgstr "étiquette" #: netbox/extras/models/tags.py:50 msgid "tags" -msgstr "balises" +msgstr "étiquettes" #: netbox/extras/models/tags.py:78 msgid "tagged item" @@ -9395,129 +9397,129 @@ msgstr "Exportation de L2VPN" msgid "Exporting L2VPN (identifier)" msgstr "Exportation de L2VPN (identifiant)" -#: netbox/ipam/filtersets.py:155 netbox/ipam/filtersets.py:281 +#: netbox/ipam/filtersets.py:155 netbox/ipam/filtersets.py:283 #: netbox/ipam/forms/model_forms.py:229 netbox/ipam/tables/ip.py:212 #: netbox/templates/ipam/prefix.html:12 msgid "Prefix" msgstr "Préfixe" #: netbox/ipam/filtersets.py:159 netbox/ipam/filtersets.py:198 -#: netbox/ipam/filtersets.py:221 +#: netbox/ipam/filtersets.py:223 msgid "RIR (ID)" msgstr "RIRE (ID)" #: netbox/ipam/filtersets.py:165 netbox/ipam/filtersets.py:204 -#: netbox/ipam/filtersets.py:227 +#: netbox/ipam/filtersets.py:229 msgid "RIR (slug)" msgstr "RIR (slug)" -#: netbox/ipam/filtersets.py:285 +#: netbox/ipam/filtersets.py:287 msgid "Within prefix" msgstr "Dans le préfixe" -#: netbox/ipam/filtersets.py:289 +#: netbox/ipam/filtersets.py:291 msgid "Within and including prefix" msgstr "Dans le préfixe et y compris" -#: netbox/ipam/filtersets.py:293 +#: netbox/ipam/filtersets.py:295 msgid "Prefixes which contain this prefix or IP" msgstr "Préfixes contenant ce préfixe ou cette adresse IP" -#: netbox/ipam/filtersets.py:304 netbox/ipam/filtersets.py:572 +#: netbox/ipam/filtersets.py:306 netbox/ipam/filtersets.py:574 #: netbox/ipam/forms/bulk_edit.py:343 netbox/ipam/forms/filtersets.py:196 #: netbox/ipam/forms/filtersets.py:331 msgid "Mask length" msgstr "Longueur du masque" -#: netbox/ipam/filtersets.py:373 netbox/vpn/filtersets.py:427 +#: netbox/ipam/filtersets.py:375 netbox/vpn/filtersets.py:427 msgid "VLAN (ID)" msgstr "VLAN (IDENTIFIANT)" -#: netbox/ipam/filtersets.py:377 netbox/vpn/filtersets.py:422 +#: netbox/ipam/filtersets.py:379 netbox/vpn/filtersets.py:422 msgid "VLAN number (1-4094)" msgstr "Numéro de VLAN (1-4094)" -#: netbox/ipam/filtersets.py:471 netbox/ipam/filtersets.py:475 -#: netbox/ipam/filtersets.py:567 netbox/ipam/forms/model_forms.py:496 +#: netbox/ipam/filtersets.py:473 netbox/ipam/filtersets.py:477 +#: netbox/ipam/filtersets.py:569 netbox/ipam/forms/model_forms.py:496 #: netbox/templates/tenancy/contact.html:53 #: netbox/tenancy/forms/bulk_edit.py:113 msgid "Address" msgstr "Adresse" -#: netbox/ipam/filtersets.py:479 +#: netbox/ipam/filtersets.py:481 msgid "Ranges which contain this prefix or IP" msgstr "Plages contenant ce préfixe ou cette adresse IP" -#: netbox/ipam/filtersets.py:507 netbox/ipam/filtersets.py:563 +#: netbox/ipam/filtersets.py:509 netbox/ipam/filtersets.py:565 msgid "Parent prefix" msgstr "Préfixe parent" -#: netbox/ipam/filtersets.py:616 netbox/ipam/filtersets.py:856 -#: netbox/ipam/filtersets.py:1131 netbox/vpn/filtersets.py:385 +#: netbox/ipam/filtersets.py:618 netbox/ipam/filtersets.py:858 +#: netbox/ipam/filtersets.py:1133 netbox/vpn/filtersets.py:385 msgid "Virtual machine (name)" msgstr "Machine virtuelle (nom)" -#: netbox/ipam/filtersets.py:621 netbox/ipam/filtersets.py:861 -#: netbox/ipam/filtersets.py:1125 netbox/virtualization/filtersets.py:282 +#: netbox/ipam/filtersets.py:623 netbox/ipam/filtersets.py:863 +#: netbox/ipam/filtersets.py:1127 netbox/virtualization/filtersets.py:282 #: netbox/virtualization/filtersets.py:321 netbox/vpn/filtersets.py:390 msgid "Virtual machine (ID)" msgstr "Machine virtuelle (ID)" -#: netbox/ipam/filtersets.py:627 netbox/vpn/filtersets.py:97 +#: netbox/ipam/filtersets.py:629 netbox/vpn/filtersets.py:97 #: netbox/vpn/filtersets.py:396 msgid "Interface (name)" msgstr "Interface (nom)" -#: netbox/ipam/filtersets.py:638 netbox/vpn/filtersets.py:108 +#: netbox/ipam/filtersets.py:640 netbox/vpn/filtersets.py:108 #: netbox/vpn/filtersets.py:407 msgid "VM interface (name)" msgstr "Interface de machine virtuelle (nom)" -#: netbox/ipam/filtersets.py:643 netbox/vpn/filtersets.py:113 +#: netbox/ipam/filtersets.py:645 netbox/vpn/filtersets.py:113 msgid "VM interface (ID)" msgstr "Interface de machine virtuelle (ID)" -#: netbox/ipam/filtersets.py:648 +#: netbox/ipam/filtersets.py:650 msgid "FHRP group (ID)" msgstr "Groupe FHRP (ID)" -#: netbox/ipam/filtersets.py:652 +#: netbox/ipam/filtersets.py:654 msgid "Is assigned to an interface" msgstr "Est affecté à une interface" -#: netbox/ipam/filtersets.py:656 +#: netbox/ipam/filtersets.py:658 msgid "Is assigned" msgstr "Est attribué" -#: netbox/ipam/filtersets.py:668 +#: netbox/ipam/filtersets.py:670 msgid "Service (ID)" msgstr "Service (ID)" -#: netbox/ipam/filtersets.py:673 +#: netbox/ipam/filtersets.py:675 msgid "NAT inside IP address (ID)" msgstr "Adresse IP intérieure NAT (ID)" -#: netbox/ipam/filtersets.py:1041 netbox/ipam/forms/bulk_import.py:322 +#: netbox/ipam/filtersets.py:1043 netbox/ipam/forms/bulk_import.py:322 msgid "Assigned interface" msgstr "Interface attribuée" -#: netbox/ipam/filtersets.py:1046 +#: netbox/ipam/filtersets.py:1048 msgid "Assigned VM interface" msgstr "Interface de machine virtuelle attribuée" -#: netbox/ipam/filtersets.py:1136 +#: netbox/ipam/filtersets.py:1138 msgid "IP address (ID)" msgstr "Adresse IP (ID)" -#: netbox/ipam/filtersets.py:1142 netbox/ipam/models/ip.py:788 +#: netbox/ipam/filtersets.py:1144 netbox/ipam/models/ip.py:788 msgid "IP address" msgstr "Adresse IP" -#: netbox/ipam/filtersets.py:1167 +#: netbox/ipam/filtersets.py:1169 msgid "Primary IPv4 (ID)" msgstr "IPv4 principal (ID)" -#: netbox/ipam/filtersets.py:1172 +#: netbox/ipam/filtersets.py:1174 msgid "Primary IPv6 (ID)" msgstr "IPv6 principal (ID)" @@ -9606,7 +9608,7 @@ msgstr "Longueur du préfixe" #: netbox/ipam/forms/bulk_edit.py:268 netbox/ipam/forms/filtersets.py:241 #: netbox/templates/ipam/prefix.html:85 msgid "Is a pool" -msgstr "C'est une piscine" +msgstr "C'est une plage d'adresses" #: netbox/ipam/forms/bulk_edit.py:273 netbox/ipam/forms/bulk_edit.py:318 #: netbox/ipam/forms/filtersets.py:248 netbox/ipam/forms/filtersets.py:293 @@ -10175,7 +10177,7 @@ msgstr "La fonction principale de ce préfixe" #: netbox/ipam/models/ip.py:265 msgid "is a pool" -msgstr "est une piscine" +msgstr "est une plage d'adresses" #: netbox/ipam/models/ip.py:267 msgid "All IP addresses within this prefix are considered usable" @@ -10523,7 +10525,7 @@ msgstr "Profondeur" #: netbox/ipam/tables/ip.py:262 msgid "Pool" -msgstr "Piscine" +msgstr "Plage d'adresses" #: netbox/ipam/tables/ip.py:266 netbox/ipam/tables/ip.py:320 msgid "Marked Utilized" @@ -10989,11 +10991,11 @@ msgstr "" #: netbox/netbox/forms/base.py:120 msgid "Add tags" -msgstr "Ajouter des tags" +msgstr "Ajouter des étiquettes" #: netbox/netbox/forms/base.py:125 msgid "Remove tags" -msgstr "Supprimer les tags" +msgstr "Supprimer les étiquettes" #: netbox/netbox/forms/mixins.py:38 #, python-brace-format @@ -11081,7 +11083,7 @@ msgstr "Associer des contacts" #: netbox/netbox/navigation/menu.py:50 msgid "Rack Roles" -msgstr "Rôles des baies" +msgstr "Rôles de la baie" #: netbox/netbox/navigation/menu.py:54 msgid "Elevations" @@ -11089,7 +11091,7 @@ msgstr "Élévations" #: netbox/netbox/navigation/menu.py:60 netbox/netbox/navigation/menu.py:62 msgid "Rack Types" -msgstr "Types de rayonnages" +msgstr "Types de baie" #: netbox/netbox/navigation/menu.py:76 msgid "Modules" @@ -12197,7 +12199,7 @@ msgstr "Dossiers" #: netbox/templates/core/inc/config_data.html:7 msgid "Rack elevations" -msgstr "Élévations des rayonnages" +msgstr "Positions en baie" #: netbox/templates/core/inc/config_data.html:10 msgid "Default unit height" @@ -12613,7 +12615,7 @@ msgstr "Non connecté" #: netbox/templates/dcim/device.html:34 msgid "Highlight device in rack" -msgstr "Surligner l'appareil dans le rack" +msgstr "Surligner l'appareil dans la baie" #: netbox/templates/dcim/device.html:55 msgid "Not racked" @@ -12939,7 +12941,7 @@ msgstr "Non connecté" #: netbox/templates/dcim/inc/interface_vlans_table.html:6 msgid "Untagged" -msgstr "Non taggé" +msgstr "Non étiqueté" #: netbox/templates/dcim/inc/interface_vlans_table.html:37 msgid "No VLANs Assigned" @@ -12969,7 +12971,7 @@ msgstr "Unités décroissantes" #: netbox/templates/dcim/inc/rack_elevation.html:3 msgid "Rack elevation" -msgstr "Élévation du rack" +msgstr "Position en baie" #: netbox/templates/dcim/interface.html:17 msgid "Add Child Interface" @@ -13165,7 +13167,7 @@ msgstr "Afficher la liste" #: netbox/templates/dcim/rack_elevation_list.html:14 msgid "Select rack view" -msgstr "Sélectionnez la vue du rack" +msgstr "Sélectionnez la vue de la baie" #: netbox/templates/dcim/rack_elevation_list.html:25 msgid "Sort By" @@ -13275,7 +13277,7 @@ msgstr "Édition d'un châssis virtuel %(name)s" #: netbox/templates/dcim/virtualchassis_edit.html:53 msgid "Rack/Unit" -msgstr "Baie/U" +msgstr "Baie/Unité" #: netbox/templates/dcim/virtualchassis_remove_member.html:5 msgid "Remove Virtual Chassis Member" @@ -13690,7 +13692,7 @@ msgstr "Tous" #: netbox/templates/extras/tag.html:32 msgid "Tagged Items" -msgstr "Articles taggés" +msgstr "Articles étiquetés" #: netbox/templates/extras/tag.html:43 msgid "Allowed Object Types" @@ -13702,11 +13704,11 @@ msgstr "N'importe lequel" #: netbox/templates/extras/tag.html:57 msgid "Tagged Item Types" -msgstr "Types d'articles taggés" +msgstr "Types d'articles étiquetés" #: netbox/templates/extras/tag.html:81 msgid "Tagged Objects" -msgstr "Objets taggés" +msgstr "Objets étiquetés" #: netbox/templates/extras/webhook.html:26 msgid "HTTP Method" @@ -15559,12 +15561,12 @@ msgstr "Mémoire (Mo)" #: netbox/virtualization/forms/bulk_edit.py:174 msgid "Disk (MB)" -msgstr "" +msgstr "Disque (Mo)" #: netbox/virtualization/forms/bulk_edit.py:334 #: netbox/virtualization/forms/filtersets.py:251 msgid "Size (MB)" -msgstr "" +msgstr "Taille (Mo)" #: netbox/virtualization/forms/bulk_import.py:44 msgid "Type of cluster" @@ -15737,7 +15739,7 @@ msgid "" "The untagged VLAN ({untagged_vlan}) must belong to the same site as the " "interface's parent virtual machine, or it must be global." msgstr "" -"Le VLAN non taggé ({untagged_vlan}) doit appartenir au même site que la " +"Le VLAN non étiqueté ({untagged_vlan}) doit appartenir au même site que la " "machine virtuelle parente de l'interface, ou il doit être global." #: netbox/virtualization/models/virtualmachines.py:434 @@ -15780,19 +15782,19 @@ msgstr "GRE" #: netbox/vpn/choices.py:39 msgid "WireGuard" -msgstr "" +msgstr "Wireguard" #: netbox/vpn/choices.py:40 msgid "OpenVPN" -msgstr "" +msgstr "OpenVPN" #: netbox/vpn/choices.py:41 msgid "L2TP" -msgstr "" +msgstr "L2TP" #: netbox/vpn/choices.py:42 msgid "PPTP" -msgstr "" +msgstr "PPTP" #: netbox/vpn/choices.py:64 msgid "Hub" diff --git a/requirements.txt b/requirements.txt index bd16b5d1044..e5ffe83869d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==5.1.3 +Django==5.1.4 django-cors-headers==4.6.0 django-debug-toolbar==4.4.6 django-filter==24.3