All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.webjars.graphiql.0.9.3.graphiql.min.js Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.GraphiQL=f()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o1&&e.setState({navStack:e.state.navStack.slice(0,-1)})},e.handleClickTypeOrField=function(t){e.showDoc(t)},e.handleSearch=function(t){e.showSearch(t)},e.state={navStack:[initialNav]},e}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e,t){return this.props.schema!==e.schema||this.state.navStack!==t.navStack}},{key:"render",value:function(){var e=this.props.schema,t=this.state.navStack,a=t[t.length-1],r=void 0;r=void 0===e?_react2.default.createElement("div",{className:"spinner-container"},_react2.default.createElement("div",{className:"spinner"})):e?a.search?_react2.default.createElement(_SearchResults2.default,{searchValue:a.search,withinType:a.def,schema:e,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField}):1===t.length?_react2.default.createElement(_SchemaDoc2.default,{schema:e,onClickType:this.handleClickTypeOrField}):(0,_graphql.isType)(a.def)?_react2.default.createElement(_TypeDoc2.default,{schema:e,type:a.def,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField}):_react2.default.createElement(_FieldDoc2.default,{field:a.def,onClickType:this.handleClickTypeOrField}):_react2.default.createElement("div",{className:"error-container"},"No Schema Available");var c=1===t.length||(0,_graphql.isType)(a.def)&&a.def.getFields,l=void 0;return t.length>1&&(l=t[t.length-2].name),_react2.default.createElement("div",{className:"doc-explorer",key:a.name},_react2.default.createElement("div",{className:"doc-explorer-title-bar"},l&&_react2.default.createElement("div",{className:"doc-explorer-back",onClick:this.handleNavBackClick},l),_react2.default.createElement("div",{className:"doc-explorer-title"},a.title||a.name),_react2.default.createElement("div",{className:"doc-explorer-rhs"},this.props.children)),_react2.default.createElement("div",{className:"doc-explorer-contents"},c&&_react2.default.createElement(_SearchBox2.default,{value:a.search,placeholder:"Search "+a.name+"...",onSearch:this.handleSearch}),r))}},{key:"showDoc",value:function(e){var t=this.state.navStack,a=t[t.length-1];a.def!==e&&this.setState({navStack:t.concat([{name:e.name,def:e}])})}},{key:"showDocForReference",value:function(e){"Type"===e.kind?this.showDoc(e.type):"Field"===e.kind?this.showDoc(e.field):"Argument"===e.kind&&e.field?this.showDoc(e.field):"EnumValue"===e.kind&&e.type&&this.showDoc(e.type)}},{key:"showSearch",value:function(e){var t=this.state.navStack.slice(),a=t[t.length-1];t[t.length-1]=_extends({},a,{search:e}),this.setState({navStack:t})}},{key:"reset",value:function(){this.setState({navStack:[initialNav]})}}]),t}(_react2.default.Component);DocExplorer.propTypes={schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./DocExplorer/FieldDoc":3,"./DocExplorer/SchemaDoc":5,"./DocExplorer/SearchBox":6,"./DocExplorer/SearchResults":7,"./DocExplorer/TypeDoc":8,graphql:74}],2:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function Argument(e){var a=e.arg,t=e.onClickType,r=e.showDefaultValue;return _react2.default.createElement("span",{className:"arg"},_react2.default.createElement("span",{className:"arg-name"},a.name),": ",_react2.default.createElement(_TypeLink2.default,{type:a.type,onClick:t}),void 0!==a.defaultValue&&r!==!1&&_react2.default.createElement("span",null," = ",_react2.default.createElement("span",{className:"arg-default-value"},(0,_graphql.print)((0,_graphql.astFromValue)(a.defaultValue,a.type)))))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=Argument;var _react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_graphql=require("graphql"),_TypeLink=require("./TypeLink"),_TypeLink2=_interopRequireDefault(_TypeLink);Argument.propTypes={arg:_react.PropTypes.object.isRequired,onClickType:_react.PropTypes.func.isRequired,showDefaultValue:_react.PropTypes.bool}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./TypeLink":9,graphql:74}],3:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r0&&(r=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"arguments"),t.args.map(function(t){return _react2.default.createElement("div",{key:t.name,className:"doc-category-item"},_react2.default.createElement("div",null,_react2.default.createElement(_Argument2.default,{arg:t,onClickType:e.props.onClickType})),_react2.default.createElement(_MarkdownContent2.default,{className:"doc-value-description",markdown:t.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(_MarkdownContent2.default,{className:"doc-type-description",markdown:t.description||"No Description"}),t.deprecationReason&&_react2.default.createElement(_MarkdownContent2.default,{className:"doc-deprecation",markdown:t.deprecationReason}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"type"),_react2.default.createElement(_TypeLink2.default,{type:t.type,onClick:this.props.onClickType})),r)}}]),t}(_react2.default.Component);FieldDoc.propTypes={field:_react.PropTypes.object,onClickType:_react.PropTypes.func},exports.default=FieldDoc}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Argument":2,"./MarkdownContent":4,"./TypeLink":9}],4:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r=100)return"break";var u=i[r];t!==u&&isMatch(r,e)&&o.push(_react2.default.createElement("div",{className:"doc-category-item",key:r},_react2.default.createElement(_TypeLink2.default,{type:u,onClick:n}))),u.getFields&&!function(){var o=u.getFields();Object.keys(o).forEach(function(i){var s=o[i],p=void 0;if(!isMatch(i,e)){if(!s.args||!s.args.length)return;if(p=s.args.filter(function(t){return isMatch(t.name,e)}),0===p.length)return}var f=_react2.default.createElement("div",{className:"doc-category-item",key:r+"."+i},t!==u&&[_react2.default.createElement(_TypeLink2.default,{key:"type",type:u,onClick:n}),"."],_react2.default.createElement("a",{className:"field-name",onClick:function(e){return a(s,u,e)}},s.name),p&&["(",_react2.default.createElement("span",{key:"args"},p.map(function(e){return _react2.default.createElement(_Argument2.default,{key:e.name,arg:e,onClickType:n,showDefaultValue:!1})})),")"]);t===u?c.push(f):l.push(f)})}()},_=u[Symbol.iterator]();!(s=(h=_.next()).done);s=!0){var d=y();if("break"===d)break}}catch(e){p=!0,f=e}finally{try{!s&&_.return&&_.return()}finally{if(p)throw f}}return c.length+o.length+l.length===0?_react2.default.createElement("span",{className:"doc-alert-text"},"No results found."):t&&o.length+l.length>0?_react2.default.createElement("div",null,c,_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"other results"),o,l)):_react2.default.createElement("div",null,c,o,l)}}]),t}(_react2.default.Component);SearchResults.propTypes={schema:_react.PropTypes.object,withinType:_react.PropTypes.object,searchValue:_react.PropTypes.string,onClickType:_react.PropTypes.func,onClickField:_react.PropTypes.func},exports.default=SearchResults}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Argument":2,"./TypeLink":9}],8:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function Field(e){var t=e.type,a=e.field,r=e.onClickType,n=e.onClickField;return _react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(e){return n(a,t,e)}},a.name),a.args&&a.args.length>0&&["(",_react2.default.createElement("span",{key:"args"},a.args.map(function(e){return _react2.default.createElement(_Argument2.default,{key:e.name,arg:e,onClickType:r})})),")"],": ",_react2.default.createElement(_TypeLink2.default,{type:a.type,onClick:r}),a.deprecationReason&&_react2.default.createElement(_MarkdownContent2.default,{className:"doc-deprecation",markdown:a.deprecationReason}))}function EnumValue(e){var t=e.value;return _react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("div",{className:"enum-value"},t.name),_react2.default.createElement(_MarkdownContent2.default,{className:"doc-value-description",markdown:t.description}),t.deprecationReason&&_react2.default.createElement(_MarkdownContent2.default,{className:"doc-deprecation",markdown:t.deprecationReason}))}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var a=0;a0&&(l=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},c),o.map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement(_TypeLink2.default,{type:e,onClick:r}))})));var i=void 0,s=void 0;a.getFields&&!function(){var t=a.getFields(),c=Object.keys(t).map(function(e){return t[e]});i=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"fields"),c.filter(function(e){return!e.isDeprecated}).map(function(e){return _react2.default.createElement(Field,{key:e.name,type:a,field:e,onClickType:r,onClickField:n})}));var o=c.filter(function(e){return e.isDeprecated});o.length>0&&(s=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"deprecated fields"),e.state.showDeprecated?o.map(function(e){return _react2.default.createElement(Field,{key:e.name,type:a,field:e,onClickType:r,onClickField:n})}):_react2.default.createElement("button",{className:"show-btn",onClick:e.handleShowDeprecated},"Show deprecated fields...")))}();var p=void 0,u=void 0;if(a instanceof _graphql.GraphQLEnumType){var d=a.getValues();p=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"values"),d.filter(function(e){return!e.isDeprecated}).map(function(e){return _react2.default.createElement(EnumValue,{key:e.name,value:e})}));var f=d.filter(function(e){return e.isDeprecated});f.length>0&&(u=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"deprecated values"),this.state.showDeprecated?f.map(function(e){return _react2.default.createElement(EnumValue,{key:e.name,value:e})}):_react2.default.createElement("button",{className:"show-btn",onClick:this.handleShowDeprecated},"Show deprecated values...")))}return _react2.default.createElement("div",null,_react2.default.createElement(_MarkdownContent2.default,{className:"doc-type-description",markdown:a.description||"No Description"}),a instanceof _graphql.GraphQLObjectType&&l,i,s,p,u,!(a instanceof _graphql.GraphQLObjectType)&&l)}}]),t}(_react2.default.Component);TypeDoc.propTypes={schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema),type:_react.PropTypes.object,onClickType:_react.PropTypes.func,onClickField:_react.PropTypes.func},exports.default=TypeDoc,Field.propTypes={type:_react.PropTypes.object,field:_react.PropTypes.object,onClickType:_react.PropTypes.func,onClickField:_react.PropTypes.func},EnumValue.propTypes={value:_react.PropTypes.object}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Argument":2,"./MarkdownContent":4,"./TypeLink":9,graphql:74}],9:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function renderType(e,t){return e instanceof _graphql.GraphQLNonNull?_react2.default.createElement("span",null,renderType(e.ofType,t),"!"):e instanceof _graphql.GraphQLList?_react2.default.createElement("span",null,"[",renderType(e.ofType,t),"]"):_react2.default.createElement("a",{className:"type-name",onClick:function(r){return t(e,r)}},e.name)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r1,r=null;o&&n&&!function(){var n=e.state.highlight;r=_react2.default.createElement("ul",{className:"execute-options"},t.map(function(t){return _react2.default.createElement("li",{key:t.name?t.name.value:"*",className:t===n&&"selected",onMouseOver:function(){return e.setState({highlight:t})},onMouseOut:function(){return e.setState({highlight:null})},onMouseUp:function(){return e._onOptionSelected(t)}},t.name?t.name.value:"")}))}();var a=void 0;!this.props.isRunning&&o||(a=this._onClick);var u=void 0;this.props.isRunning||!o||n||(u=this._onOptionsOpen);var i=this.props.isRunning?_react2.default.createElement("path",{d:"M 10 10 L 23 10 L 23 23 L 10 23 z"}):_react2.default.createElement("path",{d:"M 11 9 L 24 16 L 11 23 z"});return _react2.default.createElement("div",{className:"execute-button-wrap"},_react2.default.createElement("button",{type:"button",className:"execute-button",onMouseDown:u,onClick:a,title:"Execute Query (Ctrl-Enter)"},_react2.default.createElement("svg",{width:"34",height:"34"},i)),r)}}]),t}(_react2.default.Component);ExecuteButton.propTypes={onRun:_react.PropTypes.func,onStop:_react.PropTypes.func,isRunning:_react.PropTypes.bool,operations:_react.PropTypes.array}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function isPromise(e){return"object"===("undefined"==typeof e?"undefined":_typeof(e))&&"function"==typeof e.then}function observableToPromise(e){return isObservable(e)?new Promise(function(t,r){var o=e.subscribe(function(e){t(e),o.unsubscribe()},r,function(){r(new Error("no value resolved"))})}):e}function isObservable(e){return"object"===("undefined"==typeof e?"undefined":_typeof(e))&&"function"==typeof e.subscribe}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphiQL=void 0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_extends=Object.assign||function(e){for(var t=1;t0&&!function(){var t=e.getQueryEditor();t.operation(function(){var e=t.getCursor(),n=t.indexFromPos(e);t.setValue(o);var i=0,a=r.map(function(e){var r=e.index,o=e.string;return t.markText(t.posFromIndex(r+i),t.posFromIndex(r+(i+=o.length)),{className:"autoInsertedLeaf",clearOnEnter:!0,title:"Automatically added leaf fields"})});setTimeout(function(){return a.forEach(function(e){return e.clear()})},7e3);var s=n;r.forEach(function(e){var t=e.index,r=e.string;t=n){e=a.name&&a.name.value;break}}}this.handleRunQuery(e)}},{key:"_didClickDragBar",value:function(e){if(0!==e.button||e.ctrlKey)return!1;var t=e.target;if(0!==t.className.indexOf("CodeMirror-gutter"))return!1;for(var r=_reactDom2.default.findDOMNode(this.resultComponent);t;){if(t===r)return!0;t=t.parentNode}return!1}}]),t}(_react2.default.Component);GraphiQL.propTypes={fetcher:_react.PropTypes.func.isRequired,schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema),query:_react.PropTypes.string,variables:_react.PropTypes.string,operationName:_react.PropTypes.string,response:_react.PropTypes.string,storage:_react.PropTypes.shape({getItem:_react.PropTypes.func,setItem:_react.PropTypes.func}),defaultQuery:_react.PropTypes.string,onEditQuery:_react.PropTypes.func,onEditVariables:_react.PropTypes.func,onEditOperationName:_react.PropTypes.func,onToggleDocs:_react.PropTypes.func,getDefaultFieldNames:_react.PropTypes.func,editorTheme:_react.PropTypes.string};var _initialiseProps=function(){var e=this;this.handleClickReference=function(t){e.setState({docExplorerOpen:!0},function(){e.docExplorerComponent.showDocForReference(t)})},this.handleRunQuery=function(t){e._editorQueryID++;var r=e._editorQueryID,o=e.autoCompleteLeafs()||e.state.query,n=e.state.variables,i=e.state.operationName;if(t&&t!==i){i=t;var a=e.props.onEditOperationName;a&&a(i)}try{e.setState({isWaitingForResponse:!0,response:null,operationName:i});var s=e._fetchQuery(o,n,i,function(t){r===e._editorQueryID&&e.setState({isWaitingForResponse:!1,response:JSON.stringify(t,null,2)})});e.setState({subscription:s})}catch(t){e.setState({isWaitingForResponse:!1,response:t.message})}},this.handleStopQuery=function(){var t=e.state.subscription;e.setState({isWaitingForResponse:!1,subscription:null}),t&&t.unsubscribe()},this.handlePrettifyQuery=function(){var t=e.getQueryEditor();t.setValue((0,_graphql.print)((0,_graphql.parse)(t.getValue())))},this.handleEditQuery=(0,_debounce2.default)(100,function(t){if(e.state.schema&&e._updateQueryFacts(t),e.setState({query:t}),e.props.onEditQuery)return e.props.onEditQuery(t)}),this._updateQueryFacts=function(t){var r=(0,_getQueryFacts2.default)(e.state.schema,t);if(r){var o=(0,_getSelectedOperationName2.default)(e.state.operations,e.state.operationName,r.operations),n=e.props.onEditOperationName;n&&o!==e.state.operationName&&n(o),e.setState(_extends({operationName:o},r))}},this.handleEditVariables=function(t){e.setState({variables:t}),e.props.onEditVariables&&e.props.onEditVariables(t)},this.handleHintInformationRender=function(t){t.addEventListener("click",e._onClickHintInformation);var r=void 0;t.addEventListener("DOMNodeRemoved",r=function(){t.removeEventListener("DOMNodeRemoved",r),t.removeEventListener("click",e._onClickHintInformation)})},this.handleEditorRunQuery=function(){e._runQueryAtCursor()},this._onClickHintInformation=function(t){if("typeName"===t.target.className){var r=t.target.innerHTML,o=e.state.schema;o&&!function(){var t=o.getType(r);t&&e.setState({docExplorerOpen:!0},function(){e.docExplorerComponent.showDoc(t)})}()}},this.handleToggleDocs=function(){"function"==typeof e.props.onToggleDocs&&e.props.onToggleDocs(!e.state.docExplorerOpen),e.setState({docExplorerOpen:!e.state.docExplorerOpen})},this.handleResizeStart=function(t){if(e._didClickDragBar(t)){t.preventDefault();var r=t.clientX-(0,_elementPosition.getLeft)(t.target),o=function(t){if(0===t.buttons)return n();var o=_reactDom2.default.findDOMNode(e.editorBarComponent),i=t.clientX-(0,_elementPosition.getLeft)(o)-r,a=o.clientWidth-i;e.setState({editorFlex:i/a})},n=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",n),o=null,n=null});document.addEventListener("mousemove",o),document.addEventListener("mouseup",n)}},this.handleDocsResizeStart=function(t){t.preventDefault();var r=e.state.docExplorerWidth,o=t.clientX-(0,_elementPosition.getLeft)(t.target),n=function(t){if(0===t.buttons)return i();var r=_reactDom2.default.findDOMNode(e),n=t.clientX-(0,_elementPosition.getLeft)(r)-o,a=r.clientWidth-n;a<100?e.setState({docExplorerOpen:!1}):e.setState({docExplorerOpen:!0,docExplorerWidth:Math.min(a,650)})},i=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){e.state.docExplorerOpen||e.setState({docExplorerWidth:r}),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",i),n=null,i=null});document.addEventListener("mousemove",n),document.addEventListener("mouseup",i)},this.handleVariableResizeStart=function(t){t.preventDefault();var r=!1,o=e.state.variableEditorOpen,n=e.state.variableEditorHeight,i=t.clientY-(0,_elementPosition.getTop)(t.target),a=function(t){if(0===t.buttons)return s();r=!0;var o=_reactDom2.default.findDOMNode(e.editorBarComponent),a=t.clientY-(0,_elementPosition.getTop)(o)-i,u=o.clientHeight-a;u<60?e.setState({variableEditorOpen:!1,variableEditorHeight:n}):e.setState({variableEditorOpen:!0,variableEditorHeight:u})},s=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){r||e.setState({variableEditorOpen:!o}),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),a=null,s=null});document.addEventListener("mousemove",a),document.addEventListener("mouseup",s)}};GraphiQL.Logo=function(e){return _react2.default.createElement("div",{className:"title"},e.children||_react2.default.createElement("span",null,"Graph",_react2.default.createElement("em",null,"i"),"QL"))},GraphiQL.Toolbar=function(e){return _react2.default.createElement("div",{className:"toolbar"},e.children)},GraphiQL.Button=_ToolbarButton.ToolbarButton,GraphiQL.ToolbarButton=_ToolbarButton.ToolbarButton,GraphiQL.Group=_ToolbarGroup.ToolbarGroup,GraphiQL.Menu=_ToolbarMenu.ToolbarMenu,GraphiQL.MenuItem=_ToolbarMenu.ToolbarMenuItem,GraphiQL.Select=_ToolbarSelect.ToolbarSelect,GraphiQL.SelectOption=_ToolbarSelect.ToolbarSelectOption,GraphiQL.Footer=function(e){return _react2.default.createElement("div",{className:"footer"},e.children)};var defaultQuery='# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a "{" character. Lines that starts\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n#     {\n#       field(arg: "value") {\n#         subField\n#       }\n#     }\n#\n# Keyboard shortcuts:\n#\n#       Run Query:  Ctrl-Enter (or press the play button above)\n#\n#   Auto Complete:  Ctrl-Space (or just start typing)\n#\n\n'}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/CodeMirrorSizer":20,"../utility/debounce":21,"../utility/elementPosition":22,"../utility/fillLeafs":23,"../utility/find":24,"../utility/getQueryFacts":25,"../utility/getSelectedOperationName":26,"../utility/introspectionQueries":27,"./DocExplorer":1,"./ExecuteButton":10,"./QueryEditor":12,"./ResultViewer":13,"./ToolbarButton":14,"./ToolbarGroup":15,"./ToolbarMenu":16,"./ToolbarSelect":17,"./VariableEditor":18,graphql:74}],12:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueryEditor=void 0;var _createClass=function(){function e(e,t){for(var r=0;r=65&&o<=90||!t.shiftKey&&o>=48&&o<=57||t.shiftKey&&189===o||t.shiftKey&&50===o||t.shiftKey&&57===o)&&r.editor.execCommand("autocomplete")},r._onEdit=function(){r.ignoreChangeEvent||(r.cachedValue=r.editor.getValue(),r.props.onEdit&&r.props.onEdit(r.cachedValue))},r._onHasCompletion=function(e,t){(0,_onHasCompletion2.default)(e,t,r.props.onHintInformationRender)},r.cachedValue=e.value||"",r}return _inherits(t,e),_createClass(t,[{key:"componentDidMount",value:function(){var e=this,t=require("codemirror");require("codemirror/addon/hint/show-hint"),require("codemirror/addon/comment/comment"),require("codemirror/addon/edit/matchbrackets"),require("codemirror/addon/edit/closebrackets"),require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/fold/brace-fold"),require("codemirror/addon/lint/lint"),require("codemirror/keymap/sublime"),require("codemirror-graphql/hint"),require("codemirror-graphql/lint"),require("codemirror-graphql/info"),require("codemirror-graphql/jump"),require("codemirror-graphql/mode"),this.editor=t(this._node,{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql",theme:this.props.editorTheme||"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,foldGutter:{minFoldSize:4},lint:{schema:this.props.schema},hintOptions:{schema:this.props.schema,closeOnUnfocus:!1,completeSingle:!1},info:{schema:this.props.schema,renderDescription:function(e){return(0,_marked2.default)(e,{sanitize:!0})},onClick:function(t){return e.props.onClickReference(t)}},jump:{schema:this.props.schema,onClick:function(t){return e.props.onClickReference(t)}},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Cmd-Space":function(){return e.editor.showHint({completeSingle:!0})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!0})},"Alt-Space":function(){return e.editor.showHint({completeSingle:!0})},"Shift-Space":function(){return e.editor.showHint({completeSingle:!0})},"Cmd-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Ctrl-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}}),this.editor.on("change",this._onEdit),this.editor.on("keyup",this._onKeyUp),this.editor.on("hasCompletion",this._onHasCompletion)}},{key:"componentDidUpdate",value:function(e){var t=require("codemirror");this.ignoreChangeEvent=!0,this.props.schema!==e.schema&&(this.editor.options.lint.schema=this.props.schema,this.editor.options.hintOptions.schema=this.props.schema,this.editor.options.info.schema=this.props.schema,this.editor.options.jump.schema=this.props.schema,t.signal(this.editor,"change",this.editor)),this.props.value!==e.value&&this.props.value!==this.cachedValue&&(this.cachedValue=this.props.value,this.editor.setValue(this.props.value)),this.ignoreChangeEvent=!1}},{key:"componentWillUnmount",value:function(){this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null}},{key:"render",value:function(){var e=this;return _react2.default.createElement("div",{className:"query-editor",ref:function(t){e._node=t}})}},{key:"getCodeMirror",value:function(){return this.editor}},{key:"getClientHeight",value:function(){return this._node&&this._node.clientHeight}}]),t}(_react2.default.Component);QueryEditor.propTypes={schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema),value:_react.PropTypes.string,onEdit:_react.PropTypes.func,onHintInformationRender:_react.PropTypes.func,onClickReference:_react.PropTypes.func,onRunQuery:_react.PropTypes.func,editorTheme:_react.PropTypes.string}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/onHasCompletion":28,codemirror:64,"codemirror-graphql/hint":29,"codemirror-graphql/info":30,"codemirror-graphql/jump":31,"codemirror-graphql/lint":32,"codemirror-graphql/mode":33,"codemirror/addon/comment/comment":52,"codemirror/addon/edit/closebrackets":54,"codemirror/addon/edit/matchbrackets":55,"codemirror/addon/fold/brace-fold":56,"codemirror/addon/fold/foldgutter":58,"codemirror/addon/hint/show-hint":59,"codemirror/addon/lint/lint":60,"codemirror/keymap/sublime":63,graphql:74,marked:145}],13:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ResultViewer=void 0;var _createClass=function(){function e(e,t){for(var r=0;r=65&&r<=90||!t.shiftKey&&r>=48&&r<=57||t.shiftKey&&189===r||t.shiftKey&&222===r)&&o.editor.execCommand("autocomplete")},o._onEdit=function(){o.ignoreChangeEvent||(o.cachedValue=o.editor.getValue(),o.props.onEdit&&o.props.onEdit(o.cachedValue))},o._onHasCompletion=function(e,t){(0,_onHasCompletion2.default)(e,t,o.props.onHintInformationRender)},o.cachedValue=e.value||"",o}return _inherits(t,e),_createClass(t,[{key:"componentDidMount",value:function(){var e=this,t=require("codemirror");require("codemirror/addon/hint/show-hint"),require("codemirror/addon/edit/matchbrackets"),require("codemirror/addon/edit/closebrackets"),require("codemirror/addon/fold/brace-fold"),require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/lint/lint"),require("codemirror/keymap/sublime"),require("codemirror-graphql/variables/hint"),require("codemirror-graphql/variables/lint"),require("codemirror-graphql/variables/mode"),this.editor=t(this._node,{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql-variables",theme:this.props.editorTheme||"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,foldGutter:{minFoldSize:4},lint:{variableToType:this.props.variableToType},hintOptions:{variableToType:this.props.variableToType},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Cmd-Space":function(){return e.editor.showHint({completeSingle:!1})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!1})},"Alt-Space":function(){return e.editor.showHint({completeSingle:!1})},"Shift-Space":function(){return e.editor.showHint({completeSingle:!1})},"Cmd-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Ctrl-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}}),this.editor.on("change",this._onEdit),this.editor.on("keyup",this._onKeyUp),this.editor.on("hasCompletion",this._onHasCompletion)}},{key:"componentDidUpdate",value:function(e){var t=require("codemirror");this.ignoreChangeEvent=!0,this.props.variableToType!==e.variableToType&&(this.editor.options.lint.variableToType=this.props.variableToType,this.editor.options.hintOptions.variableToType=this.props.variableToType,t.signal(this.editor,"change",this.editor)),this.props.value!==e.value&&this.props.value!==this.cachedValue&&(this.cachedValue=this.props.value,this.editor.setValue(this.props.value)),this.ignoreChangeEvent=!1}},{key:"componentWillUnmount",value:function(){this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null}},{key:"render",value:function(){var e=this;return _react2.default.createElement("div",{className:"codemirrorWrap",ref:function(t){e._node=t}})}},{key:"getCodeMirror",value:function(){return this.editor}},{key:"getClientHeight",value:function(){return this._node&&this._node.clientHeight}}]),t}(_react2.default.Component);VariableEditor.propTypes={variableToType:_react.PropTypes.object,value:_react.PropTypes.string,onEdit:_react.PropTypes.func,onHintInformationRender:_react.PropTypes.func,onRunQuery:_react.PropTypes.func,editorTheme:_react.PropTypes.string}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/onHasCompletion":28,codemirror:64,"codemirror-graphql/variables/hint":49,"codemirror-graphql/variables/lint":50,"codemirror-graphql/variables/mode":51,"codemirror/addon/edit/closebrackets":54,"codemirror/addon/edit/matchbrackets":55,"codemirror/addon/fold/brace-fold":56,"codemirror/addon/fold/foldgutter":58,"codemirror/addon/hint/show-hint":59,"codemirror/addon/lint/lint":60,"codemirror/keymap/sublime":63}],19:[function(require,module,exports){"use strict";module.exports=require("./components/GraphiQL").GraphiQL},{"./components/GraphiQL":11}],20:[function(require,module,exports){"use strict";function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,r){for(var t=0;t'+renderType(e.type)+"":"";if(t.innerHTML='
'+("

"===a.slice(0,3)?"

"+o+a.slice(3):o+a)+"

",e.isDeprecated){var d=e.deprecationReason?(0,_marked2.default)(e.deprecationReason,{sanitize:!0}):"";i.innerHTML='Deprecated'+d,i.style.display="block"}else i.style.display="none";r&&r(t)})}function renderType(e){return e instanceof _graphql.GraphQLNonNull?renderType(e.ofType)+"!":e instanceof _graphql.GraphQLList?"["+renderType(e.ofType)+"]":''+e.name+""}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=onHasCompletion;var _graphql=require("graphql"),_marked=require("marked"),_marked2=_interopRequireDefault(_marked)},{codemirror:64,graphql:74,marked:145}],29:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_getHintsAtPosition=require("./utils/getHintsAtPosition"),_getHintsAtPosition2=_interopRequireDefault(_getHintsAtPosition);_codemirror2.default.registerHelper("hint","graphql",function(e,t){var r=t.schema;if(r){var o=e.getCursor(),i=e.getTokenAt(o),n=(0,_getHintsAtPosition2.default)(r,e.getValue(),o,i);return n&&n.list&&n.list.length>0&&(n.from=_codemirror2.default.Pos(n.from.line,n.from.column),n.to=_codemirror2.default.Pos(n.to.line,n.to.column),_codemirror2.default.signal(e,"hasCompletion",e,n,i)),n}})},{"./utils/getHintsAtPosition":40,codemirror:64}],30:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function renderField(e,r,n){renderQualifiedField(e,r,n),renderTypeAnnotation(e,r,n,r.type)}function renderQualifiedField(e,r,n){var t=r.fieldDef.name;"__"!==t.slice(0,2)&&(renderType(e,r,n,r.parentType),text(e,".")),text(e,t,"field-name",n,(0,_SchemaReference.getFieldReference)(r))}function renderDirective(e,r,n){var t="@"+r.directiveDef.name;text(e,t,"directive-name",n,(0,_SchemaReference.getDirectiveReference)(r))}function renderArg(e,r,n){r.directiveDef?renderDirective(e,r,n):r.fieldDef&&renderQualifiedField(e,r,n);var t=r.argDef.name;text(e,"("),text(e,t,"arg-name",n,(0,_SchemaReference.getArgumentReference)(r)),renderTypeAnnotation(e,r,n,r.inputType),text(e,")")}function renderTypeAnnotation(e,r,n,t){text(e,": "),renderType(e,r,n,t)}function renderEnumValue(e,r,n){var t=r.enumValue.name;renderType(e,r,n,r.inputType),text(e,"."),text(e,t,"enum-value",n,(0,_SchemaReference.getEnumValueReference)(r))}function renderType(e,r,n,t){t instanceof _graphql.GraphQLNonNull?(renderType(e,r,n,t.ofType),text(e,"!")):t instanceof _graphql.GraphQLList?(text(e,"["),renderType(e,r,n,t.ofType),text(e,"]")):text(e,t.name,"type-name",n,(0,_SchemaReference.getTypeReference)(r,t))}function renderDescription(e,r,n){var t=n.description;if(t){var i=document.createElement("div");i.className="info-description",r.renderDescription?i.innerHTML=r.renderDescription(t):i.appendChild(document.createTextNode(t)),e.appendChild(i)}renderDeprecation(e,r,n)}function renderDeprecation(e,r,n){var t=n.deprecationReason;if(t){var i=document.createElement("div");i.className="info-deprecation",r.renderDescription?i.innerHTML=r.renderDescription(t):i.appendChild(document.createTextNode(t));var d=document.createElement("span");d.className="info-deprecation-label",d.appendChild(document.createTextNode("Deprecated: ")),i.insertBefore(d,i.firstChild),e.appendChild(i)}}function text(e,r,n,t,i){n?!function(){var d=t.onClick,a=document.createElement(d?"a":"span");d&&(a.href="javascript:void 0",a.addEventListener("click",function(e){d(i,e)})),a.className=n,a.appendChild(document.createTextNode(r)),e.appendChild(a)}():e.appendChild(document.createTextNode(r))}var _graphql=require("graphql"),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_getTypeInfo=require("./utils/getTypeInfo"),_getTypeInfo2=_interopRequireDefault(_getTypeInfo),_SchemaReference=require("./utils/SchemaReference");require("./utils/info-addon"),_codemirror2.default.registerHelper("info","graphql",function(e,r){if(r.schema&&e.state){var n=e.state,t=n.kind,i=n.step,d=(0,_getTypeInfo2.default)(r.schema,e.state);if("Field"===t&&0===i&&d.fieldDef||"AliasedField"===t&&2===i&&d.fieldDef){var a=document.createElement("div");return renderField(a,d,r),renderDescription(a,r,d.fieldDef),a}if("Directive"===t&&1===i&&d.directiveDef){var c=document.createElement("div");return renderDirective(c,d,r),renderDescription(c,r,d.directiveDef),c}if("Argument"===t&&0===i&&d.argDef){var o=document.createElement("div");return renderArg(o,d,r),renderDescription(o,r,d.argDef),o}if("EnumValue"===t&&d.enumValue&&d.enumValue.description){var p=document.createElement("div");return renderEnumValue(p,d,r),renderDescription(p,r,d.enumValue),p}if("NamedType"===t&&d.type&&d.type.description){var u=document.createElement("div");return renderType(u,d,r,d.type),renderDescription(u,r,d.type),u}}})},{"./utils/SchemaReference":38,"./utils/getTypeInfo":41,"./utils/info-addon":43,codemirror:64,graphql:74}],31:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_getTypeInfo=require("./utils/getTypeInfo"),_getTypeInfo2=_interopRequireDefault(_getTypeInfo),_SchemaReference=require("./utils/SchemaReference");require("./utils/jump-addon"),_codemirror2.default.registerHelper("jump","graphql",function(e,r){if(r.schema&&r.onClick&&e.state){var t=e.state,i=t.kind,n=t.step,c=(0,_getTypeInfo2.default)(r.schema,t);return"Field"===i&&0===n&&c.fieldDef||"AliasedField"===i&&2===n&&c.fieldDef?(0,_SchemaReference.getFieldReference)(c):"Directive"===i&&1===n&&c.directiveDef?(0,_SchemaReference.getDirectiveReference)(c):"Argument"===i&&0===n&&c.argDef?(0,_SchemaReference.getArgumentReference)(c):"EnumValue"===i&&c.enumValue?(0,_SchemaReference.getEnumValueReference)(c):"NamedType"===i&&c.type?(0,_SchemaReference.getTypeReference)(c):void 0}})},{"./utils/SchemaReference":38,"./utils/getTypeInfo":41,"./utils/jump-addon":45,codemirror:64}],32:[function(require,module,exports){"use strict";function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function annotations(r,e,a,t){return e.nodes.map(function(n){var o="Variable"!==n.kind&&n.name?n.name:n.variable?n.variable:n;return{message:e.message,severity:a,type:t,from:r.posFromIndex(o.loc.start),to:r.posFromIndex(o.loc.end)}})}function mapCat(r,e){return Array.prototype.concat.apply([],r.map(e))}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql");_codemirror2.default.registerHelper("lint","graphql",function(r,e,a){var t=e.schema;if(!t)return[];try{var n=(0,_graphql.parse)(r),o=mapCat((0,_graphql.validate)(t,n),function(r){return annotations(a,r,"error","validation")}),i=_graphql.findDeprecatedUsages?mapCat((0,_graphql.findDeprecatedUsages)(t,n),function(r){return annotations(a,r,"warning","deprecation")}):[];return o.concat(i)}catch(r){var s=r.locations[0],c=_codemirror2.default.Pos(s.line-1,s.column),l=a.getTokenAt(c);return[{message:r.message,severity:"error",type:"syntax",from:_codemirror2.default.Pos(s.line-1,l.start),to:_codemirror2.default.Pos(s.line-1,l.end)}]}})},{codemirror:64,graphql:74}],33:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function indent(e,r){var t=e.levels,n=t&&0!==t.length?t[t.length-1]-(this.electricInput.test(r)?1:0):e.indentLevel;return n*this.config.indentUnit}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_onlineParser=require("./utils/onlineParser"),_onlineParser2=_interopRequireDefault(_onlineParser),_Rules=require("./utils/Rules");_codemirror2.default.defineMode("graphql",function(e){var r=(0,_onlineParser2.default)({eatWhitespace:function(e){return e.eatWhile(_Rules.isIgnored)},LexRules:_Rules.LexRules,ParseRules:_Rules.ParseRules,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:r.startState,token:r.token,indent:indent,electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}})},{"./utils/Rules":37,"./utils/onlineParser":47,codemirror:64}],34:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function indent(e,r){var l=e.levels,u=l&&0!==l.length?l[l.length-1]-(this.electricInput.test(r)?1:0):e.indentLevel;return u*this.config.indentUnit}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_onlineParser=require("../utils/onlineParser"),_onlineParser2=_interopRequireDefault(_onlineParser),_RuleHelpers=require("../utils/RuleHelpers");_codemirror2.default.defineMode("graphql-results",function(e){var r=(0,_onlineParser2.default)({eatWhitespace:function(e){return e.eatSpace()},LexRules:LexRules,ParseRules:ParseRules,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:r.startState,token:r.token,indent:indent,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}});var 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/},ParseRules={Document:[(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("Entry",(0,_RuleHelpers.p)(",")),(0,_RuleHelpers.p)("}")],Entry:[(0,_RuleHelpers.t)("String","def"),(0,_RuleHelpers.p)(":"),"Value"],Value:function(e){switch(e.kind){case"Number": return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,_RuleHelpers.t)("Number","number")],StringValue:[(0,_RuleHelpers.t)("String","string")],BooleanValue:[(0,_RuleHelpers.t)("Keyword","builtin")],NullValue:[(0,_RuleHelpers.t)("Keyword","keyword")],ListValue:[(0,_RuleHelpers.p)("["),(0,_RuleHelpers.list)("Value",(0,_RuleHelpers.p)(",")),(0,_RuleHelpers.p)("]")],ObjectValue:[(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("ObjectField",(0,_RuleHelpers.p)(",")),(0,_RuleHelpers.p)("}")],ObjectField:[(0,_RuleHelpers.t)("String","property"),(0,_RuleHelpers.p)(":"),"Value"]}},{"../utils/RuleHelpers":36,"../utils/onlineParser":47,codemirror:64}],35:[function(require,module,exports){"use strict";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var CharacterStream=function(){function t(e){_classCallCheck(this,t),this._start=0,this._pos=0,this._sourceText=e}return t.prototype.getStartOfToken=function(){return this._start},t.prototype.getCurrentPosition=function(){return this._pos},t.prototype._testNextCharacter=function(t){var e=this._sourceText.charAt(this._pos);return"string"==typeof t?e===t:t.test?t.test(e):t(e)},t.prototype.eol=function(){return this._sourceText.length===this._pos},t.prototype.sol=function(){return 0===this._pos},t.prototype.peek=function(){return this._sourceText.charAt(this._pos)?this._sourceText.charAt(this._pos):null},t.prototype.next=function(){var t=this._sourceText.charAt(this._pos);return this._pos++,t},t.prototype.eat=function(t){var e=this._testNextCharacter(t);if(e)return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},t.prototype.eatWhile=function(t){var e=this._testNextCharacter(t),s=!1;for(e&&(s=e,this._start=this._pos);e;)this._pos++,e=this._testNextCharacter(t),s=!0;return s},t.prototype.eatSpace=function(){return this.eatWhile(/[\s\u00a0]/)},t.prototype.skipToEnd=function(){this._pos=this._sourceText.length},t.prototype.skipTo=function(t){this._pos=t},t.prototype.match=function t(e){var s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments[2],r=null,t=null;switch(typeof e){case"string":var i=new RegExp(e,o?"i":"");t=i.test(this._sourceText.substr(this._pos,e.length)),r=e;break;case"object":case"function":t=this._sourceText.slice(this._pos).match(e),r=t&&t[0]}return!(!t||"string"!=typeof e&&0!==t.index)&&(s&&(this._start=this._pos,this._pos+=r.length),t)},t.prototype.backUp=function(t){this._pos-=t},t.prototype.column=function(){return this._pos},t.prototype.indentation=function(){var t=this._sourceText.match(/\s*/),e=0;if(t&&0===t.index)for(var s=t[0],o=0;s.length>o;)9===s.charCodeAt(o)?e+=2:e++,o++;return e},t.prototype.current=function(){return this._sourceText.slice(this._start,this._pos)},t}();exports.default=CharacterStream},{}],36:[function(require,module,exports){"use strict";function opt(t){return{ofRule:t}}function list(t,n){return{ofRule:t,isList:!0,separator:n}}function butNot(t,n){var e=t.match;return t.match=function(t){return e(t)&&n.every(function(n){return!n.match(t)})},t}function t(t,n){return{style:n,match:function(n){return n.kind===t}}}function p(t,n){return{style:n||"punctuation",match:function(n){return"Punctuation"===n.kind&&n.value===t}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.opt=opt,exports.list=list,exports.butNot=butNot,exports.t=t,exports.p=p},{}],37:[function(require,module,exports){"use strict";function word(e){return{style:"keyword",match:function(l){return"Name"===l.kind&&l.value===e}}}function name(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,l){e.name=l.value}}}function type(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,l){e.name=l.value,e.prevState.prevState.type=l.value}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ParseRules=exports.LexRules=exports.isIgnored=void 0;var _RuleHelpers=require("../utils/RuleHelpers");exports.isIgnored=function(e){return" "===e||"\t"===e||","===e||"\n"===e||"\r"===e||"\ufeff"===e},exports.LexRules={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Comment:/^#.*/},exports.ParseRules={Document:[(0,_RuleHelpers.list)("Definition")],Definition:function(e){switch(e.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return"FragmentDefinition";case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[word("query"),(0,_RuleHelpers.opt)(name("def")),(0,_RuleHelpers.opt)("VariableDefinitions"),(0,_RuleHelpers.list)("Directive"),"SelectionSet"],Mutation:[word("mutation"),(0,_RuleHelpers.opt)(name("def")),(0,_RuleHelpers.opt)("VariableDefinitions"),(0,_RuleHelpers.list)("Directive"),"SelectionSet"],Subscription:[word("subscription"),(0,_RuleHelpers.opt)(name("def")),(0,_RuleHelpers.opt)("VariableDefinitions"),(0,_RuleHelpers.list)("Directive"),"SelectionSet"],VariableDefinitions:[(0,_RuleHelpers.p)("("),(0,_RuleHelpers.list)("VariableDefinition"),(0,_RuleHelpers.p)(")")],VariableDefinition:["Variable",(0,_RuleHelpers.p)(":"),"Type",(0,_RuleHelpers.opt)("DefaultValue")],Variable:[(0,_RuleHelpers.p)("$","variable"),name("variable")],DefaultValue:[(0,_RuleHelpers.p)("="),"Value"],SelectionSet:[(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("Selection"),(0,_RuleHelpers.p)("}")],Selection:function(e,l){return"..."===e.value?l.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":l.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[name("property"),(0,_RuleHelpers.p)(":"),name("qualifier"),(0,_RuleHelpers.opt)("Arguments"),(0,_RuleHelpers.list)("Directive"),(0,_RuleHelpers.opt)("SelectionSet")],Field:[name("property"),(0,_RuleHelpers.opt)("Arguments"),(0,_RuleHelpers.list)("Directive"),(0,_RuleHelpers.opt)("SelectionSet")],Arguments:[(0,_RuleHelpers.p)("("),(0,_RuleHelpers.list)("Argument"),(0,_RuleHelpers.p)(")")],Argument:[name("attribute"),(0,_RuleHelpers.p)(":"),"Value"],FragmentSpread:[(0,_RuleHelpers.p)("..."),name("def"),(0,_RuleHelpers.list)("Directive")],InlineFragment:[(0,_RuleHelpers.p)("..."),(0,_RuleHelpers.opt)("TypeCondition"),(0,_RuleHelpers.list)("Directive"),"SelectionSet"],FragmentDefinition:[word("fragment"),(0,_RuleHelpers.opt)((0,_RuleHelpers.butNot)(name("def"),[word("on")])),"TypeCondition",(0,_RuleHelpers.list)("Directive"),"SelectionSet"],TypeCondition:[word("on"),"NamedType"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable"}return null;case"Name":switch(e.value){case"true":case"false":return"BooleanValue"}return"null"===e.value?"NullValue":"EnumValue"}},NumberValue:[(0,_RuleHelpers.t)("Number","number")],StringValue:[(0,_RuleHelpers.t)("String","string")],BooleanValue:[(0,_RuleHelpers.t)("Name","builtin")],NullValue:[(0,_RuleHelpers.t)("Name","keyword")],EnumValue:[name("string-2")],ListValue:[(0,_RuleHelpers.p)("["),(0,_RuleHelpers.list)("Value"),(0,_RuleHelpers.p)("]")],ObjectValue:[(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("ObjectField"),(0,_RuleHelpers.p)("}")],ObjectField:[name("attribute"),(0,_RuleHelpers.p)(":"),"Value"],Type:function(e){return"["===e.value?"ListType":"NonNullType"},ListType:[(0,_RuleHelpers.p)("["),"Type",(0,_RuleHelpers.p)("]"),(0,_RuleHelpers.opt)((0,_RuleHelpers.p)("!"))],NonNullType:["NamedType",(0,_RuleHelpers.opt)((0,_RuleHelpers.p)("!"))],NamedType:[type("atom")],Directive:[(0,_RuleHelpers.p)("@","meta"),name("meta"),(0,_RuleHelpers.opt)("Arguments")],SchemaDef:[word("schema"),(0,_RuleHelpers.list)("Directive"),(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("OperationTypeDef"),(0,_RuleHelpers.p)("}")],OperationTypeDef:[name("keyword"),(0,_RuleHelpers.p)(":"),name("atom")],ScalarDef:[word("scalar"),name("atom"),(0,_RuleHelpers.list)("Directive")],ObjectTypeDef:[word("type"),name("atom"),(0,_RuleHelpers.opt)("Implements"),(0,_RuleHelpers.list)("Directive"),(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("FieldDef"),(0,_RuleHelpers.p)("}")],Implements:[word("implements"),(0,_RuleHelpers.list)("NamedType")],FieldDef:[name("property"),(0,_RuleHelpers.opt)("ArgumentsDef"),(0,_RuleHelpers.p)(":"),"Type",(0,_RuleHelpers.list)("Directive")],ArgumentsDef:[(0,_RuleHelpers.p)("("),(0,_RuleHelpers.list)("InputValueDef"),(0,_RuleHelpers.p)(")")],InputValueDef:[name("attribute"),(0,_RuleHelpers.p)(":"),"Type",(0,_RuleHelpers.opt)("DefaultValue"),(0,_RuleHelpers.list)("Directive")],InterfaceDef:[word("interface"),name("atom"),(0,_RuleHelpers.list)("Directive"),(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("FieldDef"),(0,_RuleHelpers.p)("}")],UnionDef:[word("union"),name("atom"),(0,_RuleHelpers.list)("Directive"),(0,_RuleHelpers.p)("="),(0,_RuleHelpers.list)("UnionMember",(0,_RuleHelpers.p)("|"))],UnionMember:["NamedType"],EnumDef:[word("enum"),name("atom"),(0,_RuleHelpers.list)("Directive"),(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("EnumValueDef"),(0,_RuleHelpers.p)("}")],EnumValueDef:[name("string-2"),(0,_RuleHelpers.list)("Directive")],InputDef:[word("input"),name("atom"),(0,_RuleHelpers.list)("Directive"),(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("InputValueDef"),(0,_RuleHelpers.p)("}")],ExtendDef:[word("extend"),"ObjectTypeDef"],DirectiveDef:[word("directive"),(0,_RuleHelpers.p)("@","meta"),name("meta"),(0,_RuleHelpers.opt)("ArgumentsDef"),word("on"),(0,_RuleHelpers.list)("DirectiveLocation",(0,_RuleHelpers.p)("|"))],DirectiveLocation:[name("string-2")]}},{"../utils/RuleHelpers":36}],38:[function(require,module,exports){"use strict";function getFieldReference(e){return{kind:"Field",schema:e.schema,field:e.fieldDef,type:isMetaField(e.fieldDef)?null:e.parentType}}function getDirectiveReference(e){return{kind:"Directive",schema:e.schema,directive:e.directiveDef}}function getArgumentReference(e){return e.directiveDef?{kind:"Argument",schema:e.schema,argument:e.argDef,directive:e.directiveDef}:{kind:"Argument",schema:e.schema,argument:e.argDef,field:e.fieldDef,type:isMetaField(e.fieldDef)?null:e.parentType}}function getEnumValueReference(e){return{kind:"EnumValue",value:e.enumValue,type:(0,_graphql.getNamedType)(e.inputType)}}function getTypeReference(e,t){return{kind:"Type",schema:e.schema,type:t||e.type}}function isMetaField(e){return"__"===e.name.slice(0,2)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFieldReference=getFieldReference,exports.getDirectiveReference=getDirectiveReference,exports.getArgumentReference=getArgumentReference,exports.getEnumValueReference=getEnumValueReference,exports.getTypeReference=getTypeReference;var _graphql=require("graphql")},{graphql:74}],39:[function(require,module,exports){"use strict";function forEachState(e,t){for(var r=[],a=e;a&&a.kind;)r.push(a),a=a.prevState;for(var o=r.length-1;o>=0;o--)t(r[o])}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=forEachState},{}],40:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getHintsAtPosition(e,t,n,i){var r="Invalid"===i.state.kind?i.state.prevState:i.state,a=r.kind,u=r.step,o=(0,_getTypeInfo2.default)(e,r);if("Document"===a)return(0,_hintList2.default)(n,i,[{text:"query"},{text:"mutation"},{text:"subscription"},{text:"fragment"},{text:"{"}]);if(("SelectionSet"===a||"Field"===a||"AliasedField"===a)&&o.parentType){var p=o.parentType.getFields?(0,_objectValues2.default)(o.parentType.getFields()):[];return(0,_graphql.isAbstractType)(o.parentType)&&p.push(_introspection.TypeNameMetaFieldDef),o.parentType===e.getQueryType()&&p.push(_introspection.SchemaMetaFieldDef,_introspection.TypeMetaFieldDef),(0,_hintList2.default)(n,i,p.map(function(e){return{text:e.name,type:e.type,description:e.description,isDeprecated:e.isDeprecated,deprecationReason:e.deprecationReason}}))}if("Arguments"===a||"Argument"===a&&0===u){var s=o.argDefs;if(s)return(0,_hintList2.default)(n,i,s.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if(("ObjectValue"===a||"ObjectField"===a&&0===u)&&o.objectFieldDefs){var c=(0,_objectValues2.default)(o.objectFieldDefs);return(0,_hintList2.default)(n,i,c.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if("EnumValue"===a||"ListValue"===a&&1===u||"ObjectField"===a&&2===u||"Argument"===a&&2===u){var f=function(){var e=(0,_graphql.getNamedType)(o.inputType);if(e instanceof _graphql.GraphQLEnumType){var t=e.getValues(),r=(0,_objectValues2.default)(t);return{v:(0,_hintList2.default)(n,i,r.map(function(t){return{text:t.name,type:e,description:t.description,isDeprecated:t.isDeprecated,deprecationReason:t.deprecationReason}}))}}if(e===_graphql.GraphQLBoolean)return{v:(0,_hintList2.default)(n,i,[{text:"true",type:_graphql.GraphQLBoolean,description:"Not false."},{text:"false",type:_graphql.GraphQLBoolean,description:"Not true."}])}}();if("object"==typeof f)return f.v}if("TypeCondition"===a&&1===u||"NamedType"===a&&"TypeCondition"===r.prevState.kind){var l=void 0;if(o.parentType)(0,_graphql.isAbstractType)(o.parentType)?!function(){var t=e.getPossibleTypes(o.parentType),n=Object.create(null);t.forEach(function(e){e.getInterfaces().forEach(function(e){n[e.name]=e})}),l=t.concat((0,_objectValues2.default)(n))}():l=[o.parentType];else{var d=e.getTypeMap();l=(0,_objectValues2.default)(d).filter(_graphql.isCompositeType)}return(0,_hintList2.default)(n,i,l.map(function(e){return{text:e.name,description:e.description}}))}if("FragmentSpread"===a&&1===u){var _=function(){var r=e.getTypeMap(),a=getDefinitionState(i.state),u=getFragmentDefinitions(t),p=u.filter(function(t){return r[t.typeCondition.name.value]&&!(a&&"FragmentDefinition"===a.kind&&a.name===t.name.value)&&(0,_graphql.doTypesOverlap)(e,o.parentType,r[t.typeCondition.name.value])});return{v:(0,_hintList2.default)(n,i,p.map(function(e){return{text:e.name.value,type:r[e.typeCondition.name.value],description:"fragment "+e.name.value+" on "+e.typeCondition.name.value}}))}}();if("object"==typeof _)return _.v}if("VariableDefinition"===a&&2===u||"ListType"===a&&1===u||"NamedType"===a&&("VariableDefinition"===r.prevState.kind||"ListType"===r.prevState.kind)){var y=e.getTypeMap(),m=(0,_objectValues2.default)(y).filter(_graphql.isInputType);return(0,_hintList2.default)(n,i,m.map(function(e){return{text:e.name,description:e.description}}))}if("Directive"===a){var g=e.getDirectives().filter(function(e){return canUseDirective(r.prevState.kind,e)});return(0,_hintList2.default)(n,i,g.map(function(e){return{text:e.name,description:e.description}}))}}function canUseDirective(e,t){var n=t.locations;switch(e){case"Query":return n.indexOf("QUERY")!==-1;case"Mutation":return n.indexOf("MUTATION")!==-1;case"Subscription":return n.indexOf("SUBSCRIPTION")!==-1;case"Field":case"AliasedField":return n.indexOf("FIELD")!==-1;case"FragmentDefinition":return n.indexOf("FRAGMENT_DEFINITION")!==-1;case"FragmentSpread":return n.indexOf("FRAGMENT_SPREAD")!==-1;case"InlineFragment":return n.indexOf("INLINE_FRAGMENT")!==-1}return!1}function getFragmentDefinitions(e){var t=[];return(0,_runParser2.default)(e,{eatWhitespace:function(e){return e.eatWhile(_Rules.isIgnored)},LexRules:_Rules.LexRules,ParseRules:_Rules.ParseRules},function(e,n){"FragmentDefinition"===n.kind&&n.name&&n.type&&t.push({kind:"FragmentDefinition",name:{kind:"Name",value:n.name},typeCondition:{kind:"NamedType",name:{kind:"Name",value:n.type}}})}),t}function getDefinitionState(e){var t=void 0;return(0,_forEachState2.default)(e,function(e){switch(e.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":t=e}}),t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=getHintsAtPosition;var _graphql=require("graphql"),_introspection=require("graphql/type/introspection"),_forEachState=require("./forEachState"),_forEachState2=_interopRequireDefault(_forEachState),_getTypeInfo=require("./getTypeInfo"),_getTypeInfo2=_interopRequireDefault(_getTypeInfo),_hintList=require("./hintList"),_hintList2=_interopRequireDefault(_hintList),_objectValues=require("./objectValues"),_objectValues2=_interopRequireDefault(_objectValues),_runParser=require("./runParser"),_runParser2=_interopRequireDefault(_runParser),_Rules=require("./Rules")},{"./Rules":37,"./forEachState":39,"./getTypeInfo":41,"./hintList":42,"./objectValues":46,"./runParser":48,graphql:74,"graphql/type/introspection":94}],41:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getTypeInfo(e,t){var a={schema:e,type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return(0,_forEachState2.default)(t,function(t){switch(t.kind){case"Query":case"ShortQuery":a.type=e.getQueryType();break;case"Mutation":a.type=e.getMutationType();break;case"Subscription":a.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":t.type&&(a.type=e.getType(t.type));break;case"Field":case"AliasedField":a.fieldDef=a.type&&t.name?getFieldDef(e,a.parentType,t.name):null,a.type=a.fieldDef&&a.fieldDef.type;break;case"SelectionSet":a.parentType=(0,_graphql.getNamedType)(a.type);break;case"Directive":a.directiveDef=t.name&&e.getDirective(t.name);break;case"Arguments":var r="Field"===t.prevState.kind?a.fieldDef:"Directive"===t.prevState.kind?a.directiveDef:"AliasedField"===t.prevState.kind?t.prevState.name&&getFieldDef(e,a.parentType,t.prevState.name):null;a.argDefs=r&&r.args;break;case"Argument":if(a.argDef=null,a.argDefs)for(var n=0;ne.length&&(n-=t.length-e.length-1,n+=0===t.indexOf(e)?0:.5),n}function lexicalDistance(t,e){var n=void 0,r=void 0,i=[],o=t.length,l=e.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=l;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=l;r++){var u=t[n-1]===e[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+u),n>1&&r>1&&t[n-1]===e[r-2]&&t[n-2]===e[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+u))}return i[o][l]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=hintList},{}],43:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function createState(e){return{options:e instanceof Function?{render:e}:e===!0?{}:e}}function getHoverTime(e){var o=e.state.info.options;return o&&o.hoverTime||500}function onMouseOver(e,o){var t=e.state.info,r=o.target||o.srcElement;if("SPAN"===r.nodeName&&void 0===t.hoverTimeout){var i=r.getBoundingClientRect(),n=getHoverTime(e);t.hoverTimeout=setTimeout(a,n);var u=function(){clearTimeout(t.hoverTimeout),t.hoverTimeout=setTimeout(a,n)},m=function o(){_codemirror2.default.off(document,"mousemove",u),_codemirror2.default.off(e.getWrapperElement(),"mouseout",o),clearTimeout(t.hoverTimeout),t.hoverTimeout=void 0},a=function(){_codemirror2.default.off(document,"mousemove",u),_codemirror2.default.off(e.getWrapperElement(),"mouseout",m),t.hoverTimeout=void 0,onMouseHover(e,i)};_codemirror2.default.on(document,"mousemove",u),_codemirror2.default.on(e.getWrapperElement(),"mouseout",m)}}function onMouseHover(e,o){var t=e.coordsChar({left:(o.left+o.right)/2,top:(o.top+o.bottom)/2}),r=e.state.info,i=r.options,n=i.render||e.getHelper(t,"info");if(n){var u=e.getTokenAt(t,!0);if(u){var m=n(u,i,e);m&&showPopup(e,o,m)}}}function showPopup(e,o,t){var r=document.createElement("div");r.className="CodeMirror-info",r.appendChild(t),document.body.appendChild(r);var i=r.getBoundingClientRect(),n=r.currentStyle||window.getComputedStyle(r),u=i.right-i.left+parseFloat(n.marginLeft)+parseFloat(n.marginRight),m=i.bottom-i.top+parseFloat(n.marginTop)+parseFloat(n.marginBottom),a=o.bottom;m>window.innerHeight-o.bottom-15&&o.top>window.innerHeight-o.bottom&&(a=o.top-m),a<0&&(a=o.bottom);var d=Math.max(0,window.innerWidth-u-15);d>o.left&&(d=o.left),r.style.opacity=1,r.style.top=a+"px",r.style.left=d+"px";var f=void 0,l=function(){clearTimeout(f)},c=function(){clearTimeout(f),f=setTimeout(s,200)},s=function(){_codemirror2.default.off(r,"mouseover",l),_codemirror2.default.off(r,"mouseout",c),_codemirror2.default.off(e.getWrapperElement(),"mouseout",c),r.style.opacity?(r.style.opacity=0,setTimeout(function(){r.parentNode&&r.parentNode.removeChild(r)},600)):r.parentNode&&r.parentNode.removeChild(r)};_codemirror2.default.on(r,"mouseover",l),_codemirror2.default.on(r,"mouseout",c),_codemirror2.default.on(e.getWrapperElement(),"mouseout",c)}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);_codemirror2.default.defineOption("info",!1,function(e,o,t){if(t&&t!==_codemirror2.default.Init){var r=e.state.info.onMouseOver;_codemirror2.default.off(e.getWrapperElement(),"mouseover",r),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(o){var i=e.state.info=createState(o);i.onMouseOver=onMouseOver.bind(null,e),_codemirror2.default.on(e.getWrapperElement(),"mouseover",i.onMouseOver)}})},{codemirror:64}],44:[function(require,module,exports){"use strict";function jsonParse(e){string=e,strLen=e.length,start=end=lastEnd=-1,ch(),lex();var r=parseObj();return expect("EOF"),r}function parseObj(){var e=start,r=[];if(expect("{"),!skip("}")){do r.push(parseMember());while(skip(","));expect("}")}return{kind:"Object",start:e,end:lastEnd,members:r}}function parseMember(){var e=start,r="String"===kind?curToken():null;expect("String"),expect(":");var t=parseVal();return{kind:"Member",start:e,end:lastEnd,key:r,value:t}}function parseArr(){var e=start,r=[];if(expect("["),!skip("]")){do r.push(parseVal());while(skip(","));expect("]")}return{kind:"Array",start:e,end:lastEnd,values:r}}function parseVal(){switch(kind){case"[":return parseArr();case"{":return parseObj();case"String":case"Number":case"Boolean":case"Null":var e=curToken();return lex(),e}return expect("Value")}function curToken(){return{kind:kind,start:start,end:end,value:JSON.parse(string.slice(start,end))}}function expect(e){if(kind===e)return void lex();var r=void 0;if("EOF"===kind)r="[end of file]";else if(end-start>1)r="`"+string.slice(start,end)+"`";else{var t=string.slice(start).match(/^.+?\b/);r="`"+(t?t[0]:string[start])+"`"}throw syntaxError("Expected "+e+" but found "+r+".")}function syntaxError(e){return{message:e,start:start,end:end}}function skip(e){if(kind===e)return lex(),!0}function ch(){end31;)if(92===code)switch(ch(),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.")}else{if(end===strLen)throw syntaxError("Unterminated string.");ch()}if(34===code)return void ch();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(){45===code&&ch(),48===code?ch():readDigits(),46===code&&(ch(),readDigits()),69!==code&&101!==code||(ch(),43!==code&&45!==code||ch(),readDigits())}function readDigits(){if(code<48||code>57)throw syntaxError("Expected decimal digit.");do ch();while(code>=48&&code<=57)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=jsonParse;var string=void 0,strLen=void 0,start=void 0,end=void 0,lastEnd=void 0,code=void 0,kind=void 0},{}],45:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function onMouseOver(e,o){var t=o.target||o.srcElement;if("SPAN"===t.nodeName){var r=t.getBoundingClientRect(),n={left:(r.left+r.right)/2,top:(r.top+r.bottom)/2};e.state.jump.cursor=n,e.state.jump.isHoldingModifier&&enableJumpMode(e)}}function onMouseOut(e){return!e.state.jump.isHoldingModifier&&e.state.jump.cursor?void(e.state.jump.cursor=null):void(e.state.jump.isHoldingModifier&&e.state.jump.marker&&disableJumpMode(e))}function onKeyDown(e,o){if(!e.state.jump.isHoldingModifier&&isJumpModifier(o.key)){e.state.jump.isHoldingModifier=!0,e.state.jump.cursor&&enableJumpMode(e);var t=function t(u){u.code===o.code&&(e.state.jump.isHoldingModifier=!1,e.state.jump.marker&&disableJumpMode(e),_codemirror2.default.off(document,"keyup",t),_codemirror2.default.off(document,"click",r),e.off("mousedown",n))},r=function(o){var t=e.state.jump.destination;t&&e.state.jump.options.onClick(t,o)},n=function(o,t){e.state.jump.destination&&(t.codemirrorIgnore=!0)};_codemirror2.default.on(document,"keyup",t),_codemirror2.default.on(document,"click",r),e.on("mousedown",n)}}function isJumpModifier(e){return e===(isMac?"Meta":"Control")}function enableJumpMode(e){if(!e.state.jump.marker){var o=e.state.jump.cursor,t=e.coordsChar(o),r=e.getTokenAt(t,!0),n=e.state.jump.options,u=n.getDestination||e.getHelper(t,"jump");if(u){var i=u(r,n,e);if(i){var a=e.markText({line:t.line,ch:r.start},{line:t.line,ch:r.end},{className:"CodeMirror-jump-token"});e.state.jump.marker=a,e.state.jump.destination=i}}}}function disableJumpMode(e){var o=e.state.jump.marker;e.state.jump.marker=null,e.state.jump.destination=null,o.clear()}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);_codemirror2.default.defineOption("jump",!1,function(e,o,t){if(t&&t!==_codemirror2.default.Init){var r=e.state.jump.onMouseOver;_codemirror2.default.off(e.getWrapperElement(),"mouseover",r);var n=e.state.jump.onMouseOut;_codemirror2.default.off(e.getWrapperElement(),"mouseout",n),_codemirror2.default.off(document,"keydown",e.state.jump.onKeyDown),delete e.state.jump}if(o){var u=e.state.jump={options:o,onMouseOver:onMouseOver.bind(null,e),onMouseOut:onMouseOut.bind(null,e),onKeyDown:onKeyDown.bind(null,e)};_codemirror2.default.on(e.getWrapperElement(),"mouseover",u.onMouseOver),_codemirror2.default.on(e.getWrapperElement(),"mouseout",u.onMouseOut),_codemirror2.default.on(document,"keydown",u.onKeyDown)}});var isMac=navigator&&navigator.appVersion.indexOf("Mac")!==-1},{codemirror:64}],46:[function(require,module,exports){"use strict";function objectValues(e){for(var t=Object.keys(e),r=t.length,o=new Array(r),s=0;s0&&p[p.length-1]0&&(a.from=_codemirror2.default.Pos(a.from.line,a.from.column),a.to=_codemirror2.default.Pos(a.to.line,a.to.column),_codemirror2.default.signal(e,"hasCompletion",e,a,i)),a})},{"../utils/forEachState":39,"../utils/hintList":42,codemirror:64,graphql:74}],50:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function validateVariables(e,r,a){var n=[];return a.members.forEach(function(a){var t=a.key.value,i=r[t];i?validateValue(i,a.value).forEach(function(r){var a=r[0],t=r[1];n.push(lintError(e,a,t))}):n.push(lintError(e,a.key,'Variable "$'+t+'" does not appear in any GraphQL query.'))}),n}function validateValue(e,r){if(e instanceof _graphql.GraphQLNonNull)return"Null"===r.kind?[[r,'Type "'+e+'" is non-nullable and cannot be null.']]:validateValue(e.ofType,r);if("Null"===r.kind)return[];if(e instanceof _graphql.GraphQLList){var a=function(){var a=e.ofType;return"Array"===r.kind?{v:mapCat(r.values,function(e){return validateValue(a,e)})}:{v:validateValue(a,r)}}();if("object"==typeof a)return a.v}if(e instanceof _graphql.GraphQLInputObjectType){var n=function(){if("Object"!==r.kind)return{v:[[r,'Type "'+e+'" must be an Object.']]};var a=Object.create(null),n=mapCat(r.members,function(r){var n=r.key.value;a[n]=!0;var t=e.getFields()[n];if(!t)return[[r.key,'Type "'+e+'" does not have a field "'+n+'".']];var i=t?t.type:void 0;return validateValue(i,r.value)});return Object.keys(e.getFields()).forEach(function(t){if(!a[t]){var i=e.getFields()[t].type;i instanceof _graphql.GraphQLNonNull&&n.push([r,'Object of type "'+e+'" is missing required field "'+t+'".'])}}),{v:n}}();if("object"==typeof n)return n.v}return"Boolean"===e.name&&"Boolean"!==r.kind||"String"===e.name&&"String"!==r.kind||"ID"===e.name&&"Number"!==r.kind&&"String"!==r.kind||"Float"===e.name&&"Number"!==r.kind||"Int"===e.name&&("Number"!==r.kind||(0|r.value)!==r.value)?[[r,'Expected value of type "'+e+'".']]:(e instanceof _graphql.GraphQLEnumType||e instanceof _graphql.GraphQLScalarType)&&("String"!==r.kind&&"Number"!==r.kind&&"Boolean"!==r.kind&&"Null"!==r.kind||isNullish(e.parseValue(r.value)))?[[r,'Expected value of type "'+e+'".']]:[]}function lintError(e,r,a){return{message:a,severity:"error",type:"validation",from:e.posFromIndex(r.start),to:e.posFromIndex(r.end)}}function isNullish(e){return null===e||void 0===e||e!==e}function mapCat(e,r){return Array.prototype.concat.apply([],e.map(r))}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql"),_jsonParse=require("../utils/jsonParse"),_jsonParse2=_interopRequireDefault(_jsonParse);_codemirror2.default.registerHelper("lint","graphql-variables",function(e,r,a){if(!e)return[];var n=void 0;try{n=(0,_jsonParse2.default)(e)}catch(e){if(e.stack)throw e;return[lintError(a,e,e.message)]}var t=r.variableToType;return t?validateVariables(a,t,n):[]})},{"../utils/jsonParse":44,codemirror:64,graphql:74}],51:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function indent(e,r){var l=e.levels,u=l&&0!==l.length?l[l.length-1]-(this.electricInput.test(r)?1:0):e.indentLevel;return u*this.config.indentUnit}function namedKey(e){return{style:e,match:function(e){return"String"===e.kind},update:function(e,r){e.name=r.value.slice(1,-1)}}}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_onlineParser=require("../utils/onlineParser"),_onlineParser2=_interopRequireDefault(_onlineParser),_RuleHelpers=require("../utils/RuleHelpers");_codemirror2.default.defineMode("graphql-variables",function(e){var r=(0,_onlineParser2.default)({eatWhitespace:function(e){return e.eatSpace()},LexRules:LexRules,ParseRules:ParseRules,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:r.startState,token:r.token,indent:indent,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}});var 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/},ParseRules={Document:[(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("Variable",(0,_RuleHelpers.opt)((0,_RuleHelpers.p)(","))),(0,_RuleHelpers.p)("}")],Variable:[namedKey("variable"),(0,_RuleHelpers.p)(":"),"Value"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,_RuleHelpers.t)("Number","number")],StringValue:[(0,_RuleHelpers.t)("String","string")],BooleanValue:[(0,_RuleHelpers.t)("Keyword","builtin")],NullValue:[(0,_RuleHelpers.t)("Keyword","keyword")],ListValue:[(0,_RuleHelpers.p)("["),(0,_RuleHelpers.list)("Value",(0,_RuleHelpers.opt)((0,_RuleHelpers.p)(","))),(0,_RuleHelpers.p)("]")],ObjectValue:[(0,_RuleHelpers.p)("{"),(0,_RuleHelpers.list)("ObjectField",(0,_RuleHelpers.opt)((0,_RuleHelpers.p)(","))),(0,_RuleHelpers.p)("}")],ObjectField:[namedKey("attribute"),(0,_RuleHelpers.p)(":"),"Value"]}},{"../utils/RuleHelpers":36,"../utils/onlineParser":47,codemirror:64}],52:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e){var n=e.search(l);return n==-1?0:n}function t(e,n,t){return/\bstring\b/.test(e.getTokenTypeAt(o(n.line,0)))&&!/^[\'\"`]/.test(t)}var i={},l=/[^\s\u00a0]/,o=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=i);for(var n=this,t=1/0,l=this.listSelections(),r=null,a=l.length-1;a>=0;a--){var m=l[a].from(),c=l[a].to();m.line>=t||(c.line>=t&&(c=o(t,0)),t=m.line,null==r?n.uncomment(m,c,e)?r="un":(n.lineComment(m,c,e),r="line"):"un"==r?n.uncomment(m,c,e):n.lineComment(m,c,e))}}),e.defineExtension("lineComment",function(e,r,a){a||(a=i);var m=this,c=m.getModeAt(e),f=m.getLine(e.line);if(null!=f&&!t(m,e,f)){var g=a.lineComment||c.lineComment;if(!g)return void((a.blockCommentStart||c.blockCommentStart)&&(a.fullLines=!0,m.blockComment(e,r,a)));var s=Math.min(0!=r.ch||r.line==e.line?r.line+1:r.line,m.lastLine()+1),d=null==a.padding?" ":a.padding,u=a.commentBlankLines||e.line==r.line;m.operation(function(){if(a.indent){for(var t=null,i=e.line;ic.length)&&(t=c)}for(var i=e.line;if||r.operation(function(){if(0!=t.fullLines){var i=l.test(r.getLine(f));r.replaceRange(g+c,o(f)),r.replaceRange(m+g,o(e.line,0));var s=t.blockCommentLead||a.blockCommentLead;if(null!=s)for(var d=e.line+1;d<=f;++d)(d!=f||i)&&r.replaceRange(s+g,o(d,0))}else r.replaceRange(c,n),r.replaceRange(m,e)})}}),e.defineExtension("uncomment",function(e,n,t){t||(t=i);var r,a=this,m=a.getModeAt(e),c=Math.min(0!=n.ch||n.line==e.line?n.line:n.line-1,a.lastLine()),f=Math.min(e.line,c),g=t.lineComment||m.lineComment,s=[],d=null==t.padding?" ":t.padding;e:if(g){for(var u=f;u<=c;++u){var h=a.getLine(u),v=h.indexOf(g);if(v>-1&&!/comment/.test(a.getTokenTypeAt(o(u,v+1)))&&(v=-1),v==-1&&l.test(h))break e;if(v>-1&&l.test(h.slice(0,v)))break e;s.push(h)}if(a.operation(function(){for(var e=f;e<=c;++e){var n=s[e-f],t=n.indexOf(g),i=t+g.length;t<0||(n.slice(i,i+d.length)==d&&(i+=d.length),r=!0,a.replaceRange("",o(e,t),o(e,i)))}}),r)return!0}var p=t.blockCommentStart||m.blockCommentStart,C=t.blockCommentEnd||m.blockCommentEnd;if(!p||!C)return!1;var b=t.blockCommentLead||m.blockCommentLead,k=a.getLine(f),L=k.indexOf(p);if(L==-1)return!1;var x=c==f?k:a.getLine(c),R=x.indexOf(C,c==f?L+p.length:0);if(R==-1&&f!=c&&(x=a.getLine(--c),R=x.indexOf(C)),R==-1||!/comment/.test(a.getTokenTypeAt(o(f,L+1)))||!/comment/.test(a.getTokenTypeAt(o(c,R+1))))return!1;var O=k.lastIndexOf(p,e.ch),T=O==-1?-1:k.slice(0,e.ch).indexOf(C,O+p.length);if(O!=-1&&T!=-1&&T+C.length!=e.ch)return!1;T=x.indexOf(C,n.ch);var y=x.slice(n.ch).lastIndexOf(p,T-n.ch);return O=T==-1||y==-1?-1:n.ch+y,(T==-1||O==-1||O==n.ch)&&(a.operation(function(){a.replaceRange("",o(c,R-(d&&x.slice(R-d.length,R)==d?d.length:0)),o(c,R+C.length));var e=L+p.length;if(d&&k.slice(e,e+d.length)==d&&(e+=d.length),a.replaceRange("",o(f,L),o(f,e)),b)for(var n=f+1;n<=c;++n){var t=a.getLine(n),i=t.indexOf(b);if(i!=-1&&!l.test(t.slice(0,i))){var r=i+b.length;d&&t.slice(r,r+d.length)==d&&(r+=d.length),a.replaceRange("",o(n,i),o(n,r))}}}),!0)})})},{"../../lib/codemirror":64}],53:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function o(e,o,n){var t,i=e.getWrapperElement();return t=i.appendChild(document.createElement("div")),n?t.className="CodeMirror-dialog CodeMirror-dialog-bottom":t.className="CodeMirror-dialog CodeMirror-dialog-top","string"==typeof o?t.innerHTML=o:t.appendChild(o),t}function n(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}e.defineExtension("openDialog",function(t,i,r){function u(e){if("string"==typeof e)s.value=e;else{if(f)return;f=!0,c.parentNode.removeChild(c),a.focus(),r.onClose&&r.onClose(c)}}r||(r={}),n(this,null);var l,c=o(this,t,r.bottom),f=!1,a=this,s=c.getElementsByTagName("input")[0];return s?(s.focus(),r.value&&(s.value=r.value,r.selectValueOnOpen!==!1&&s.select()),r.onInput&&e.on(s,"input",function(e){r.onInput(e,s.value,u)}),r.onKeyUp&&e.on(s,"keyup",function(e){r.onKeyUp(e,s.value,u)}),e.on(s,"keydown",function(o){r&&r.onKeyDown&&r.onKeyDown(o,s.value,u)||((27==o.keyCode||r.closeOnEnter!==!1&&13==o.keyCode)&&(s.blur(),e.e_stop(o),u()),13==o.keyCode&&i(s.value,o))}),r.closeOnBlur!==!1&&e.on(s,"blur",u)):(l=c.getElementsByTagName("button")[0])&&(e.on(l,"click",function(){u(),a.focus()}),r.closeOnBlur!==!1&&e.on(l,"blur",u),l.focus()),u}),e.defineExtension("openConfirm",function(t,i,r){function u(){f||(f=!0,l.parentNode.removeChild(l),a.focus())}n(this,null);var l=o(this,t,r&&r.bottom),c=l.getElementsByTagName("button"),f=!1,a=this,s=1;c[0].focus();for(var d=0;d=0;s--){var f=o[s].head;n.replaceRange("",d(f.line,f.ch-1),d(f.line,f.ch+1),"+delete")}}function a(n){var i=r(n),a=i&&t(i,"explode");if(!a||n.getOption("disableInput"))return e.Pass;for(var o=n.listSelections(),s=0;s0;return{anchor:new d(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new d(t.head.line,t.head.ch+(n?1:-1))}}function s(n,i){var a=r(n);if(!a||n.getOption("disableInput"))return e.Pass;var s=t(a,"pairs"),l=s.indexOf(i);if(l==-1)return e.Pass;for(var u,g=t(a,"triples"),p=s.charAt(l+1)==i,v=n.listSelections(),m=l%2==0,b=0;b1&&g.indexOf(i)>=0&&n.getRange(d(k.line,k.ch-2),k)==i+i&&(k.ch<=2||n.getRange(d(k.line,k.ch-3),d(k.line,k.ch-2))!=i))x="addFour";else if(p){if(e.isWordChar(P)||!f(n,k,i))return e.Pass;x="both"}else{if(!m||n.getLine(k.line).length!=k.ch&&!c(P,s)&&!/\s/.test(P))return e.Pass;x="both"}else x=p&&h(n,k)?"both":g.indexOf(i)>=0&&n.getRange(k,d(k.line,k.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=x)return e.Pass}else u=x}var S=l%2?s.charAt(l-1):i,y=l%2?i:s.charAt(l+1);n.operation(function(){if("skip"==u)n.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;e<3;e++)n.execCommand("goCharRight");else if("surround"==u){for(var t=n.getSelections(),e=0;e-1&&n%2==1}function l(e,t){var n=e.getRange(d(t.line,t.ch-1),d(t.line,t.ch+1));return 2==n.length?n:null}function f(t,n,r){var i=t.getLine(n.line),a=t.getTokenAt(n);if(/\bstring2?\b/.test(a.type))return!1;var o=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(o.pos=o.start=a.start;;){var s=t.getMode().token(o,a.state);if(o.pos>=n.ch+1)return/\bstring2?\b/.test(s);o.start=o.pos}}function h(e,t){var n=e.getTokenAt(d(t.line,t.ch+1));return/\bstring/.test(n.type)&&n.start==t.ch}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},d=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(p),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(p))});for(var g=u.pairs+"`",p={Backspace:i,Enter:a},v=0;v=0&&c[o.text.charAt(l)]||c[o.text.charAt(++l)];if(!f)return null;var u=">"==f.charAt(1)?1:-1;if(i&&u>0!=(l==t.ch))return null;var h=e.getTokenTypeAt(a(t.line,l+1)),s=n(e,a(t.line,l+(u>0?1:0)),u,h||null,r);return null==s?null:{from:a(t.line,l),to:s&&s.pos,match:s&&s.ch==f.charAt(0),forward:u>0}}function n(e,t,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,l=r&&r.maxScanLines||1e3,f=[],u=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,h=n>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),s=t.line;s!=h;s+=n){var m=e.getLine(s);if(m){var d=n>0?0:m.length-1,g=n>0?m.length:-1;if(!(m.length>o))for(s==t.line&&(d=t.ch-(n<0?1:0));d!=g;d+=n){var p=m.charAt(d);if(u.test(p)&&(void 0===i||e.getTokenTypeAt(a(s,d+1))==i)){var v=c[p];if(">"==v.charAt(1)==n>0)f.push(p);else{if(!f.length)return{pos:a(s,d),ch:p};f.pop()}}}}}return s-n!=(n>0?e.lastLine():e.firstLine())&&null}function i(e,n,i){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,c=[],l=e.listSelections(),f=0;f",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&(t.off("cursorActivity",r),l&&(l(),l=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",r))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,i){return t(this,e,n,i)}),e.defineExtension("scanForBracket",function(e,t,i,r){return n(this,e,t,i,r)})})},{"../../lib/codemirror":64}],56:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(r,n){function t(t){for(var f=n.ch,s=0;;){var u=f<=0?-1:l.lastIndexOf(t,f-1);if(u!=-1){if(1==s&&ur.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));if(/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"keyword"!=t.type||"import"!=t.string)return null;for(var i=n,o=Math.min(r.lastLine(),n+10);i<=o;++i){var l=r.getLine(i),f=l.indexOf(";");if(f!=-1)return{startCh:t.end,end:e.Pos(i,f)}}}var i,o=n.line,l=t(o);if(!l||t(o-1)||(i=t(o-2))&&i.end.line==o-1)return null;for(var f=l.end;;){var s=t(f.line+1);if(null==s)break;f=s.end}return{from:r.clipPos(e.Pos(o,l.startCh+1)),to:f}}),e.registerHelper("fold","include",function(r,n){function t(n){if(nr.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));return/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"meta"==t.type&&"#include"==t.string.slice(0,8)?t.start+8:void 0}var i=n.line,o=t(i);if(null==o||null!=t(i-1))return null;for(var l=i;;){var f=t(l+1);if(null==f)break;++l}return{from:e.Pos(i,o+1),to:r.clipPos(e.Pos(l))}})})},{"../../lib/codemirror":64}],57:[function(require,module,exports){!function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}(function(n){"use strict";function o(o,i,t,l){function f(n){var e=d(o,i);if(!e||e.to.line-e.from.lineo.firstLine();)i=n.Pos(i.line-1,0),a=f(!1);if(a&&!a.cleared&&"unfold"!==l){var c=e(o,t);n.on(c,"mousedown",function(o){s.clear(),n.e_preventDefault(o)});var s=o.markText(a.from,a.to,{replacedWith:c,clearOnEnter:r(o,t,"clearOnEnter"),__isFold:!0});s.on("clear",function(e,r){n.signal(o,"unfold",o,e,r)}),n.signal(o,"fold",o,a.from,a.to)}}function e(n,o){var e=r(n,o,"widget");if("string"==typeof e){var i=document.createTextNode(e);e=document.createElement("span"),e.appendChild(i),e.className="CodeMirror-foldmarker"}return e}function r(n,o,e){if(o&&void 0!==o[e])return o[e];var r=n.options.foldOptions;return r&&void 0!==r[e]?r[e]:i[e]}n.newFoldFunction=function(n,e){return function(r,i){o(r,i,{rangeFinder:n,widget:e})}},n.defineExtension("foldCode",function(n,e,r){o(this,n,e,r)}),n.defineExtension("isFolded",function(n){for(var o=this.findMarksAt(n),e=0;e=d&&(e=n(i.indicatorOpen))}o.setGutterMarker(t,i.gutter,e),++f})}function f(o){var t=o.getViewport(),e=o.state.foldGutter;e&&(o.operation(function(){i(o,t.from,t.to)}),e.from=t.from,e.to=t.to)}function d(o,t,e){var n=o.state.foldGutter;if(n){var i=n.options;if(e==i.gutter){var f=r(o,t);f?f.clear():o.foldCode(c(t,0),i.rangeFinder)}}}function a(o){var t=o.state.foldGutter;if(t){var e=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){f(o)},e.foldOnChangeTimeSpan||600)}}function u(o){var t=o.state.foldGutter;if(t){var e=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var e=o.getViewport();t.from==t.to||e.from-t.to>20||t.from-e.to>20?f(o):o.operation(function(){e.fromt.to&&(i(o,t.to,e.to),t.to=e.to)})},e.updateViewportTimeSpan||400)}}function l(o,t){var e=o.state.foldGutter;if(e){var r=t.line;r>=e.from&&r0&&i.to.ch-i.from.ch!=e.to.ch-e.from.ch}function n(t,i,e){var n=t.options.hintOptions,o={};for(var s in m)o[s]=m[s];if(n)for(var s in n)void 0!==n[s]&&(o[s]=n[s]);if(e)for(var s in e)void 0!==e[s]&&(o[s]=e[s]);return o.hint.resolve&&(o.hint=o.hint.resolve(t,i)),o}function o(t){return"string"==typeof t?t:t.text}function s(t,i){function e(t,e){var o;o="string"!=typeof e?function(t){return e(t,i)}:n.hasOwnProperty(e)?n[e]:e,s[t]=o}var n={Up:function(){i.moveFocus(-1)},Down:function(){i.moveFocus(1)},PageUp:function(){i.moveFocus(-i.menuSize()+1,!0)},PageDown:function(){i.moveFocus(i.menuSize()-1,!0)},Home:function(){i.setFocus(0)},End:function(){i.setFocus(i.length-1)},Enter:i.pick,Tab:i.pick,Esc:i.close},o=t.options.customKeys,s=o?{}:n;if(o)for(var c in o)o.hasOwnProperty(c)&&e(c,o[c]);var r=t.options.extraKeys;if(r)for(var c in r)r.hasOwnProperty(c)&&e(c,r[c]);return s}function c(t,i){for(;i&&i!=t;){if("LI"===i.nodeName.toUpperCase()&&i.parentNode==t)return i;i=i.parentNode}}function r(i,e){this.completion=i,this.data=e,this.picked=!1;var n=this,r=i.cm,h=this.hints=document.createElement("ul");h.className="CodeMirror-hints",this.selectedHint=e.selectedHint||0;for(var l=e.list,a=0;ah.clientHeight+1,A=r.getScrollInfo();if(b>0){var S=C.bottom-C.top,T=g.top-(g.bottom-C.top);if(T-S>0)h.style.top=(y=g.top-S)+"px",w=!1;else if(S>k){h.style.height=k-5+"px",h.style.top=(y=g.bottom-C.top)+"px";var M=r.getCursor();e.from.ch!=M.ch&&(g=r.cursorCoords(M),h.style.left=(v=g.left)+"px",C=h.getBoundingClientRect())}}var F=C.right-H;if(F>0&&(C.right-C.left>H&&(h.style.width=H-5+"px",F-=C.right-C.left-H),h.style.left=(v=g.left-F)+"px"),x)for(var N=h.firstChild;N;N=N.nextSibling)N.style.paddingRight=r.display.nativeBarWidth+"px";if(r.addKeyMap(this.keyMap=s(i,{moveFocus:function(t,i){n.changeActive(n.selectedHint+t,i)},setFocus:function(t){n.changeActive(t); },menuSize:function(){return n.screenAmount()},length:l.length,close:function(){i.close()},pick:function(){n.pick()},data:e})),i.options.closeOnUnfocus){var E;r.on("blur",this.onBlur=function(){E=setTimeout(function(){i.close()},100)}),r.on("focus",this.onFocus=function(){clearTimeout(E)})}return r.on("scroll",this.onScroll=function(){var t=r.getScrollInfo(),e=r.getWrapperElement().getBoundingClientRect(),n=y+A.top-t.top,o=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return w||(o+=h.offsetHeight),o<=e.top||o>=e.bottom?i.close():(h.style.top=n+"px",void(h.style.left=v+A.left-t.left+"px"))}),t.on(h,"dblclick",function(t){var i=c(h,t.target||t.srcElement);i&&null!=i.hintId&&(n.changeActive(i.hintId),n.pick())}),t.on(h,"click",function(t){var e=c(h,t.target||t.srcElement);e&&null!=e.hintId&&(n.changeActive(e.hintId),i.options.completeOnSingleClick&&n.pick())}),t.on(h,"mousedown",function(){setTimeout(function(){r.focus()},20)}),t.signal(e,"select",l[0],h.firstChild),!0}function h(t,i){if(!t.somethingSelected())return i;for(var e=[],n=0;n0?i(t):n(o+1)})}var s=h(t,o);n(0)};return s.async=!0,s.supportsSelection=!0,s}return(n=i.getHelper(i.getCursor(),"hintWords"))?function(i){return t.hint.fromList(i,{words:n})}:t.hint.anyword?function(i,e){return t.hint.anyword(i,e)}:function(){}}var u="CodeMirror-hint",f="CodeMirror-hint-active";t.showHint=function(t,i,e){if(!i)return t.showHint(e);e&&e.async&&(i.async=!0);var n={hint:i};if(e)for(var o in e)n[o]=e[o];return t.showHint(n)},t.defineExtension("showHint",function(e){e=n(this,this.getCursor("start"),e);var o=this.listSelections();if(!(o.length>1)){if(this.somethingSelected()){if(!e.hint.supportsSelection)return;for(var s=0;s=this.data.list.length?i=e?this.data.list.length-1:0:i<0&&(i=e?0:this.data.list.length-1),this.selectedHint!=i){var n=this.hints.childNodes[this.selectedHint];n.className=n.className.replace(" "+f,""),n=this.hints.childNodes[this.selectedHint=i],n.className+=" "+f,n.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+3),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",{resolve:a}),t.registerHelper("hint","fromList",function(i,e){var n=i.getCursor(),o=i.getTokenAt(n),s=t.Pos(n.line,o.end);if(o.string&&/\w/.test(o.string[o.string.length-1]))var c=o.string,r=t.Pos(n.line,o.start);else var c="",r=s;for(var h=[],l=0;l,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};t.defineOption("hintOptions",null)})},{"../../lib/codemirror":64}],60:[function(require,module,exports){!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,n){function o(e){return r.parentNode?(r.style.top=Math.max(0,e.clientY-r.offsetHeight-5)+"px",void(r.style.left=e.clientX+5+"px")):t.off(document,"mousemove",o)}var r=document.createElement("div");return r.className="CodeMirror-lint-tooltip",r.appendChild(n.cloneNode(!0)),document.body.appendChild(r),t.on(document,"mousemove",o),o(e),null!=r.style.opacity&&(r.style.opacity=1),r}function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(t){t.parentNode&&(null==t.style.opacity&&n(t),t.style.opacity=0,setTimeout(function(){n(t)},600))}function r(n,r,i){function a(){t.off(i,"mouseout",a),l&&(o(l),l=null)}var l=e(n,r),s=setInterval(function(){if(l)for(var t=i;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){a();break}}if(!l)return clearInterval(s)},400);t.on(i,"mouseout",a)}function i(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){g(t,e)},this.waitingFor=0}function a(t,e){return e instanceof Function?{getAnnotations:e}:(e&&e!==!0||(e={}),e)}function l(t){var e=t.state.lint;e.hasGutter&&t.clearGutter(y);for(var n=0;n1,n.options.tooltips))}}o.onUpdateLinting&&o.onUpdateLinting(e,r,t)}function h(t){var e=t.state.lint;e&&(clearTimeout(e.timeout),e.timeout=setTimeout(function(){d(t)},e.options.delay||500))}function v(t,e){for(var n=e.target||e.srcElement,o=document.createDocumentFragment(),i=0;io.cursorCoords(n,"window").top&&((l=t).style.opacity=.4)}))};a(o,h,u,p,function(n,r){var i=e.keyName(n),a=e.keyMap[o.getOption("keyMap")][i];a||(a=o.getOption("extraKeys")[i]),"findNext"==a||"findPrev"==a||"findPersistentNext"==a||"findPersistentPrev"==a?(e.e_stop(n),f(o,t(o),r),o.execCommand(a)):"find"!=a&&"findPersistent"!=a||(e.e_stop(n),p(r,n))}),i&&u&&(f(o,c,u),d(o,n))}else s(o,h,"Search for:",u,function(e){e&&!c.query&&o.operation(function(){f(o,c,e),c.posFrom=c.posTo=o.getCursor(),d(o,n)})})}function d(o,n,r){o.operation(function(){var a=t(o),s=i(o,a.query,n?a.posFrom:a.posTo);(s.find(n)||(s=i(o,a.query,n?e.Pos(o.lastLine()):e.Pos(o.firstLine(),0)),s.find(n)))&&(o.setSelection(s.from(),s.to()),o.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),r&&r(s.from(),s.to()))})}function y(e){e.operation(function(){var o=t(e);o.lastQuery=o.query,o.query&&(o.query=o.queryText=null,e.removeOverlay(o.overlay),o.annotate&&(o.annotate.clear(),o.annotate=null))})}function m(e,o,n){e.operation(function(){for(var t=i(e,o);t.findNext();)if("string"!=typeof o){var r=e.getRange(t.from(),t.to()).match(o);t.replace(n.replace(/\$(\d)/g,function(e,o){return r[o]}))}else t.replace(n)})}function g(e,o){if(!e.getOption("readOnly")){var n=e.getSelection()||t(e).lastQuery,r=o?"Replace all:":"Replace:";s(e,r+v,r,n,function(n){n&&(n=l(n),s(e,x,"Replace with:","",function(t){if(t=u(t),o)m(e,n,t);else{y(e);var r=i(e,n,e.getCursor("from")),a=function(){var o,u=r.from();!(o=r.findNext())&&(r=i(e,n),!(o=r.findNext())||u&&r.from().line==u.line&&r.from().ch==u.ch)||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()}),c(e,q,"Replace?",[function(){s(o)},a,function(){m(e,n,t)}]))},s=function(e){r.replace("string"==typeof n?t:t.replace(/\$(\d)/g,function(o,n){return e[n]})),a()};a()}}))})}}var h='Search: (Use /re/ syntax for regexp search)',v=' (Use /re/ syntax for regexp search)',x='With: ',q="Replace? ";e.commands.find=function(e){y(e),p(e)},e.commands.findPersistent=function(e){y(e),p(e,!1,!0)},e.commands.findPersistentNext=function(e){p(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){p(e,!0,!0,!0)},e.commands.findNext=p,e.commands.findPrev=function(e){p(e,!0)},e.commands.clearSearch=y,e.commands.replace=g,e.commands.replaceAll=function(e){g(e,!0)}})},{"../../lib/codemirror":64,"../dialog/dialog":53,"./searchcursor":62}],62:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),r=r?e.clipPos(r):i(0,0),this.pos={from:r,to:r},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,r){if(n){t.lastIndex=0;for(var o,s,l=e.getLine(r.line).slice(0,r.ch),f=0;;){t.lastIndex=f;var h=t.exec(l);if(!h)break;if(o=h,s=o.index,f=o.index+(o[0].length||1),f==l.length)break}var c=o&&o[0].length||0;c||(0==s&&0==l.length?o=void 0:s!=e.getLine(r.line).length&&c++)}else{t.lastIndex=r.ch;var l=e.getLine(r.line),o=t.exec(l),c=o&&o[0].length||0,s=o&&o.index;s+c==l.length||c||(c=1)}if(o&&c)return{from:i(r.line,s),to:i(r.line,s+c),match:o}};else{var s=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},f=t.split("\n");if(1==f.length)t.length?this.matches=function(r,o){if(r){var f=e.getLine(o.line).slice(0,o.ch),h=l(f),c=h.lastIndexOf(t);if(c>-1)return c=n(f,h,c),{from:i(o.line,c),to:i(o.line,c+s.length)}}else{var f=e.getLine(o.line).slice(o.ch),h=l(f),c=h.indexOf(t);if(c>-1)return c=n(f,h,c)+o.ch,{from:i(o.line,c),to:i(o.line,c+s.length)}}}:this.matches=function(){};else{var h=s.split("\n");this.matches=function(t,n){var r=f.length-1;if(t){if(n.line-(f.length-1)=1;--c,--s)if(f[c]!=l(e.getLine(s)))return;var u=e.getLine(s),a=u.length-h[0].length;if(l(u.slice(a))!=f[0])return;return{from:i(s,a),to:o}}if(!(n.line+(f.length-1)>e.lastLine())){var u=e.getLine(n.line),a=u.length-h[0].length;if(l(u.slice(a))==f[0]){for(var g=i(n.line,a),s=n.line+1,c=1;cn))return i;--i}}}var i=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=i(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=i(r.line-1,this.doc.getLine(r.line-1).length)}else{var o=this.doc.lineCount();if(r.line==o-1)return t(o);r=i(r.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,i){return new t(this.doc,e,n,i)}),e.defineDocExtension("getSearchCursor",function(e,n,i){return new t(this,e,n,i)}),e.defineExtension("selectMatches",function(t,n){for(var i=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)i.push({anchor:r.from(),head:r.to()});i.length&&this.setSelections(i,0)})})},{"../../lib/codemirror":64}],63:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){if(r<0&&0==n.ch)return t.clipPos(h(n.line-1));var o=t.getLine(n.line);if(r>0&&n.ch>=o.length)return t.clipPos(h(n.line+1,0));for(var i,a="start",l=n.ch,s=r<0?0:o.length,c=0;l!=s;l+=r,c++){var f=o.charAt(r<0?l-1:l),u="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==u&&f.toUpperCase()==f&&(u="W"),"start"==a)"o"!=u&&(a="in",i=u);else if("in"==a&&i!=u){if("w"==i&&"W"==u&&r<0&&l--,"W"==i&&"w"==u&&r>0){i="w";continue}break}}return h(n.line,l)}function n(e,n){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?t(e.doc,r.head,n):n<0?r.from():r.to()})}function r(t,n){return t.isReadOnly()?e.Pass:(t.operation(function(){for(var e=t.listSelections().length,r=[],o=-1,i=0;i=0;l--){var s=r[i[l]];if(!(c&&e.cmpPos(s.head,c)>0)){var f=o(t,s.head);c=f.from,t.replaceRange(n(f.word),f.from,f.to)}}})}function s(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=o(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function c(e,t){var n=s(e);if(n){var r=n.query,o=e.getSearchCursor(r,t?n.to:n.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(r,t?h(e.firstLine(),0):e.clipPos(h(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):n.word&&e.setSelection(n.from,n.to))}}var f=e.keyMap.sublime={fallthrough:"default"},u=e.commands,h=e.Pos,d=e.keyMap.default==e.keyMap.macDefault,p=d?"Cmd-":"Ctrl-",m=d?"Ctrl-":"Alt-";u[f[m+"Left"]="goSubwordLeft"]=function(e){n(e,-1)},u[f[m+"Right"]="goSubwordRight"]=function(e){n(e,1)},d&&(f["Cmd-Left"]="goLineStartSmart");var g=d?"Ctrl-Alt-":"Ctrl-";u[f[g+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},u[f[g+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},u[f["Shift-"+p+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;ro.line&&a==i.line&&0==i.ch||n.push({anchor:a==o.line?o:h(a,0),head:a==i.line?i:h(a)});e.setSelections(n,0)},f["Shift-Tab"]="indentLess",u[f.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},u[f[p+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;ro?r.push(s,c):r.length&&(r[r.length-1]=c),o=c}t.operation(function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+a,h(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",h(o,0),null,"+swapLine")}t.setSelections(i),t.scrollIntoView()})},u[f[S+"Down"]="swapLineDown"]=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],o=t.lastLine()+1,i=n.length-1;i>=0;i--){var a=n[i],l=a.to().line+1,s=a.from().line;0!=a.to().ch||a.empty()||l--,l=0;e-=2){var n=r[e],o=r[e+1],i=t.getLine(n);n==t.lastLine()?t.replaceRange("",h(n-1),h(n),"+swapLine"):t.replaceRange("",h(n,0),h(n+1,0),"+swapLine"),t.replaceRange(i+"\n",h(o,0),null,"+swapLine")}t.scrollIntoView()})},u[f[p+"/"]="toggleCommentIndented"]=function(e){e.toggleComment({indent:!0})},u[f[p+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],r=0;r=0;o--){var i=n[o].head,a=t.getRange({line:i.line,ch:0},i),l=e.countColumn(a,null,t.getOption("tabSize")),s=t.findPosH(i,-1,"char",!1);if(a&&!/\S/.test(a)&&l%r==0){var c=new h(i.line,e.findColumn(a,l-r,r));c.ch!=i.ch&&(s=c)}t.replaceRange("",s,i,"+delete")}})},u[f[k+p+"K"]="delLineRight"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,h(t[n].to().line),"+delete");e.scrollIntoView()})},u[f[k+p+"U"]="upcaseAtCursor"]=function(e){l(e,function(e){return e.toUpperCase()})},u[f[k+p+"L"]="downcaseAtCursor"]=function(e){l(e,function(e){return e.toLowerCase()})},u[f[k+p+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},u[f[k+p+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},u[f[k+p+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),o=n;if(e.cmpPos(r,o)>0){var i=o;o=r,r=i}t.state.sublimeKilled=t.getRange(r,o),t.replaceRange("",r,o)}},u[f[k+p+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},u[f[k+p+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f[k+p+"G"]="clearBookmarks",u[f[k+p+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)};var L=d?"Ctrl-Shift-":"Ctrl-Alt-";u[f[L+"Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;ne.firstLine()&&e.addSelection(h(r.head.line-1,r.head.ch))}})},u[f[L+"Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}function f(){this.id=null}function h(e,t){for(var r=0;r=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;Al.length<=e;)Al.push(g(Al)+" ");return Al[e]}function g(e){return e[e.length-1]}function v(e,t){for(var r=[],n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||Ol.test(e))}function x(e,t){return t?!!(t.source.indexOf("\\w")>-1&&w(e))||t.test(e):w(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function S(e){return e.charCodeAt(0)>=768&&Wl.test(e)}function L(e,t,r){var i=this;this.input=r,i.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=n("div",null,"CodeMirror-code"),i.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=n("div",null,"CodeMirror-cursors"),i.measure=n("div",null,"CodeMirror-measure"),i.lineMeasure=n("div",null,"CodeMirror-measure"),i.lineSpace=n("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=n("div",[n("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=n("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=n("div",null,null,"position: absolute; height: "+Ll+"px; width: 1px;"),i.gutters=n("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=n("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=n("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),rl&&nl<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),il||Jo&&hl||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}function T(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?H(r,T(e,r).text.length):B(t,T(e,t.line).text.length)}function B(e,t){var r=e.ch;return null==r||r>t?H(e.line,t):r<0?H(e.line,0):e}function G(e,t){for(var r=[],n=0;n=t:o.to>t);(n||(n=[])).push(new K(l,o.from,a?null:o.to))}}return n}function $(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&s)for(var x=0;x0)){var c=[a,1],f=P(u.from,s.from),d=P(u.to,s.to);(f<0||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from}),(d>0||!l.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-1}}return i}function J(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?P(u.to,r)>=0:P(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?P(u.from,n)<=0:P(u.from,n)<0)))return!0}}}function ae(e){for(var t;t=oe(e);)e=t.find(-1,!0).line;return e}function ue(e){for(var t,r;t=le(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function ce(e,t){var r=T(e,t),n=ae(r);return r==n?t:A(n)}function fe(e,t){if(t>e.lastLine())return t;var r,n=T(e,t);if(!he(e,n))return t;for(;r=le(n);)n=r.find(1,!0).line;return A(n)+1}function he(e,t){var r=Hl&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function me(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function ye(e){return e.level%2?e.to:e.from}function be(e){return e.level%2?e.from:e.to}function we(e){var t=ke(e);return t?ye(t[0]):0}function xe(e){var t=ke(e);return t?be(g(t)):e.text.length}function Ce(e,t,r){var n=e[0].level;return t==n||r!=n&&tt)return n;if(i.from==t||i.to==t){if(null!=r)return Ce(e,i.level,e[r].level)?(i.from!=i.to&&(Pl=r),n):(i.from!=i.to&&(Pl=n),r);r=n}}return r}function Le(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&S(e.text.charAt(t)));return t}function Te(e,t,r,n){var i=ke(e);if(!i)return Me(e,t,r,n);for(var o=Se(i,t),l=i[o],s=Le(e,t,l.level%2?-r:r,n);;){if(s>l.from&&s0==l.level%2?l.to:l.from);if(l=i[o+=r],!l)return null;s=r>0==l.level%2?Le(e,l.to,-1,n):Le(e,l.from,1,n)}}function Me(e,t,r,n){var i=t+r;if(n)for(;i>0&&S(e.text.charAt(i));)i+=r;return i<0||i>e.text.length?null:i}function ke(e){var t=e.order;return null==t&&(t=e.order=El(e.text)),t}function Ne(e,t){return e._handlers&&e._handlers[t]||Il}function Ae(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=h(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Oe(e,t){var r=Ne(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function Pe(e){e.prototype.on=function(e,t){zl(this,e,t)},e.prototype.off=function(e,t){Ae(this,e,t)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ze(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Fe(e){Ee(e),Ie(e)}function Re(e){return e.target||e.srcElement}function Be(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),dl&&e.ctrlKey&&1==t&&(t=3),t}function Ge(e){if(null==Cl){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Cl=t.offsetWidth<=1&&t.offsetHeight>2&&!(rl&&nl<8))}var i=Cl?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Ue(e){if(null!=Sl)return Sl;var n=r(e,document.createTextNode("AخA")),i=ml(n,0,1).getBoundingClientRect(),o=ml(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(Sl=o.right-i.right<3)}function Ve(e){if(null!=Ul)return Ul;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=ml(t,0,1).getBoundingClientRect();return Ul=Math.abs(i.left-o.left)>1}function Ke(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Vl[e]=t}function je(e,t){Kl[e]=t}function Xe(e){if("string"==typeof e&&Kl.hasOwnProperty(e))e=Kl[e];else if(e&&"string"==typeof e.name&&Kl.hasOwnProperty(e.name)){var t=Kl[e.name];"string"==typeof t&&(t={name:t}),e=b(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Xe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Xe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ye(e,t){t=Xe(t);var r=Vl[t.name];if(!r)return Ye(e,"text/plain");var n=r(e,t);if(jl.hasOwnProperty(t.name)){var i=jl[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}function _e(e,t){var r=jl.hasOwnProperty(e)?jl[e]:jl[e]={};u(t,r)}function $e(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function qe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ze(e,t,r){return!e.startState||e.startState(t,r)}function Qe(e,t,r,n){var i=[e.state.modeGen],o={};lt(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var l=function(r){var n=e.state.overlays[r],l=1,s=0;lt(e,t.text,n.mode,!0,function(e,t){for(var r=l;se&&i.splice(l,1,e,i[l+1],o),l+=2,s=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;re.options.maxHighlightLength?$e(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function et(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=st(e,t,r),l=o>n.first&&T(n,o-1).stateAfter;return l=l?$e(n.mode,l):Ze(n.mode),n.iter(o,t,function(r){tt(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&ot.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function it(e,t,r,n){var i,o=function(e){return{start:f.start,end:f.pos,string:f.current(),type:i||null,state:e?$e(l.mode,c):c}},l=e.doc,s=l.mode;t=R(l,t);var a,u=T(l,t.line),c=et(e,t.line,r),f=new Xl(u.text,e.options.tabSize);for(n&&(a=[]);(n||f.pose.options.maxHighlightLength?(s=!1,l&&tt(e,t,n,f.pos),f.pos=t.length,a=null):a=ot(nt(r,f,n,h),o),h){var d=h[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;ul;--s){if(s<=o.first)return o.first;var a=T(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=c(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function at(e,t,r){this.text=e,ee(this,t),this.height=r?r(this):1}function ut(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),J(e),ee(e,r);var i=n?n(e):1;i!=e.height&&N(e,i)}function ct(e){e.parent=null,J(e)}function ft(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?$l:_l;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ht(e,t){var r=n("span",null,null,il?"padding-right: .1px":null),i={pre:n("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(rl||il)&&e.getOption("lineWrapping")};r.setAttribute("role","presentation"),i.pre.setAttribute("role","presentation"),t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var l=o?t.rest[o-1]:t.line,a=void 0;i.pos=0,i.addToken=pt,Ue(e.display.measure)&&(a=ke(l))&&(i.addToken=vt(i.addToken,a)),i.map=[];var u=t!=e.display.externalMeasured&&A(l);yt(l,i,Je(e,l,u)),l.styleClasses&&(l.styleClasses.bgClass&&(i.bgClass=s(l.styleClasses.bgClass,i.bgClass||"")),l.styleClasses.textClass&&(i.textClass=s(l.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Ge(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(il){var c=i.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Oe(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=s(i.pre.className,i.textClass||"")),i}function dt(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function pt(e,t,r,i,o,l,s){if(t){var a,u=e.splitSpaces?gt(t,e.trailingSpace):t,c=e.cm.state.specialChars,f=!1;if(c.test(t)){a=document.createDocumentFragment();for(var h=0;;){c.lastIndex=h;var d=c.exec(t),g=d?d.index-h:t.length-h;if(g){var v=document.createTextNode(u.slice(h,h+g));rl&&nl<9?a.appendChild(n("span",[v])):a.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!d)break;h+=g+1;var m=void 0;if("\t"==d[0]){var y=e.cm.options.tabSize,b=y-e.col%y;m=a.appendChild(n("span",p(b),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==d[0]||"\n"==d[0]?(m=a.appendChild(n("span","\r"==d[0]?"␍":"␤","cm-invalidchar")),m.setAttribute("cm-text",d[0]),e.col+=1):(m=e.cm.options.specialCharPlaceholder(d[0]),m.setAttribute("cm-text",d[0]),rl&&nl<9?a.appendChild(n("span",[m])):a.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,a=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,a),rl&&nl<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||i||o||f||s){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[a],w,s);return l&&(x.title=l),e.content.appendChild(x)}e.content.appendChild(a)}}function gt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;iu&&f.from<=u));h++);if(f.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,f.to-u),i,o,null,s,a),o=null,n=n.slice(f.to-u),u=f.to}}}function mt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function yt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=f=s="",h=null,m=1/0;for(var y=[],b=void 0,w=0;wp||C.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&!f&&(f=C.title),C.collapsed&&(!h||ne(h.marker,C)<0)&&(h=x)):x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S=d)break;for(var T=Math.min(d,m);;){if(v){var M=p+v.length;if(!h){var k=M>T?v.slice(0,T-p):v;t.addToken(t,k,l?l+a:a,c,p+k.length==m?u:"",f,s)}if(M>=T){v=v.slice(T-p),p=T;break}p=M,c=""}v=i.slice(o,o=r[g++]),l=ft(r[g++],t.cm.options)}}else for(var N=1;N2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Yt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function _t(e,t){t=ae(t);var n=A(t),i=e.display.externalMeasured=new bt(e.doc,t,n);i.lineN=n;var o=i.built=ht(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function $t(e,t,r,n){return Qt(e,Zt(e,t),r,n)}function qt(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(o=a-s,i=o-1,t>=a&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[(u-=3)+2],l="left";if("right"==r&&i==a-s)for(;u=0&&(r=e[i]).left==r.right;i--);return r}function tr(e,t,r,n){var i,o=Jt(t.map,r,n),l=o.node,s=o.start,a=o.end,u=o.collapse;if(3==l.nodeType){for(var c=0;c<4;c++){for(;s&&S(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+a0&&(u=n="right");var f;i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(rl&&nl<9&&!s&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+mr(e.display),top:h.top,bottom:h.bottom}:Ql}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,m=0;mr.from?l(e-1):l(e,n)}n=n||T(e.doc,t.line),i||(i=Zt(e,n));var a=ke(n),u=t.ch;if(!a)return l(u);var c=Se(a,u),f=s(u,c);return null!=Pl&&(f.other=s(u,Pl)),f}function hr(e,t){var r=0;t=R(e.doc,t),e.options.lineWrapping||(r=mr(e.display)*t.ch);var n=T(e.doc,t.line),i=pe(n)+Bt(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function dr(e,t,r,n){var i=H(e,t);return i.xRel=n,r&&(i.outside=!0),i}function pr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return dr(n.first,0,!0,-1);var i=O(n,r),o=n.first+n.size-1;if(i>o)return dr(n.first+n.size-1,T(n,o).text.length,!0,1);t<0&&(t=0);for(var l=T(n,i);;){var s=gr(e,l,i,t,r),a=le(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=A(l=u.to.line)}}function gr(e,t,r,n,i){function o(n){var i=fr(e,H(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:lv)return dr(r,d,m,1);for(;;){if(c?d==h||d==Te(t,h,1):d-h<=1){var y=n0&&y1){var x=Qt(e,u,y,"right");l<=x.bottom&&l>=x.top&&Math.abs(n-x.right)1?1:0);return C}var L=Math.ceil(f/2),T=h+L;if(c){T=h;for(var M=0;Mn?(d=T,v=k,(m=s)&&(v+=1e3),f=L):(h=T,p=k,g=s,f-=L)}}function vr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Yl){Yl=n("pre");for(var i=0;i<49;++i)Yl.appendChild(document.createTextNode("x")),Yl.appendChild(n("br"));Yl.appendChild(document.createTextNode("x"))}r(e.measure,Yl);var o=Yl.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function mr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),l=(o.right-o.left)/10;return l>2&&(e.cachedCharWidth=l),l||10}function yr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:br(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function br(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wr(e){var t=vr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/mr(e.display)-3);return function(i){if(he(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||s.to().line3&&(i(d,g.top,null,g.bottom),d=c,g.bottoma.bottom||u.bottom==a.bottom&&u.right>a.right)&&(a=u),d0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ar(e){e.state.focused||(e.display.input.focus(),Wr(e))}function Or(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Dr(e))},100)}function Wr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Oe(e,"focus",e,t),e.state.focused=!0,l(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),il&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Nr(e))}function Dr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Oe(e,"blur",e,t),e.state.focused=!1,wl(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Hr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=br(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l.001||a<-.001)&&(N(i.line,o),Ir(i.line),i.rest))for(var u=0;u=l&&(o=O(t,pe(T(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function Fr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Jo||Ln(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Jo&&Ln(e),bn(e,100))}function Rr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Gr(e){var t=Br(e);return t.x*=es,t.y*=es,t}function Ur(e,t){var r=Br(t),n=r.x,i=r.y,o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,a=l.scrollHeight>l.clientHeight;if(n&&s||i&&a){if(i&&dl&&il)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var f=0;f(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!cl){var l=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Bt(e.display))+"px;\n height: "+(t.bottom-t.top+Vt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(o),e.display.lineSpace.removeChild(l)}}}function _r(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var l=!1;i=fr(e,t);var s=r&&r!=t?fr(e,r):i,a=qr(e,Math.min(i.left,s.left),Math.min(i.top,s.top)-n,Math.max(i.left,s.left),Math.max(i.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(Fr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=a.scrollLeft&&(Rr(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(l=!0)),!l)break}return i}function $r(e,t,r,n,i){var o=qr(e,t,r,n,i);null!=o.scrollTop&&Fr(e,o.scrollTop),null!=o.scrollLeft&&Rr(e,o.scrollLeft)}function qr(e,t,r,n,i){var o=e.display,l=vr(e.display);r<0&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=jt(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Gt(o),f=rc-l;if(rs+a){var d=Math.min(r,(h?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Kt(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),t<10?u.scrollLeft=0:tg+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Zr(e,t,r){null==t&&null==r||Jr(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Qr(e){Jr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?H(t.line,t.ch-1):t,n=H(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Jr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=hr(e,t.from),n=hr(e,t.to),i=qr(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function en(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++is},xt(e.curOp)}function tn(e){var t=e.curOp;St(t,function(e){for(var t=0;t=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new os(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function on(e){e.updatedDisplay=e.mustUpdate&&Cn(e.cm,e.update)}function ln(e){var t=e.cm,r=t.display;e.updatedDisplay&&Er(t),e.barMeasure=Vr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Vt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Kt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function sn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Hl&&ce(e.doc,t)i.viewFrom?gn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)gn(e);else if(t<=i.viewFrom){var o=vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):gn(e)}else if(r>=i.viewTo){var l=vn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):gn(e)}else{var s=vn(e,t,t,-1),a=vn(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(wt(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):gn(e)}var u=i.externalMeasured;u&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Sr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);h(l,r)==-1&&l.push(r)}}}function gn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vn(e,t,r,n){var i,o=Sr(e,t),l=e.display.view;if(!Hl||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;ce(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function mn(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=wt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=wt(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Sr(e,r)))),n.viewTo=r}function yn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=$e(t.mode,et(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength,a=Qe(e,o,s?$e(t.mode,n):n,!0);o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!f&&hr)return bn(e,e.options.workDelay),!0}),i.length&&un(e,function(){for(var t=0;t=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==yn(e))return!1;Pr(e)&&(gn(e),r.dims=yr(e));var l=i.first+i.size,s=Math.max(r.visible.from-e.options.viewportMargin,i.first),a=Math.min(l,r.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(l,n.viewTo)),Hl&&(s=ce(e.doc,s),a=fe(e.doc,a));var u=s!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;mn(e,s,a),n.viewOffset=pe(T(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=yn(e);if(!u&&0==c&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var f=o();return c>4&&(n.lineDiv.style.display="none"),Tn(e,n.updateLineNumbers,r.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,f&&o()!=f&&f.offsetHeight&&f.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,u&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,bn(e,400)),n.updateLineNumbers=null,!0}function Sn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Kt(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Gt(e.display)-jt(e),r.top)}),t.visible=zr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Cn(e,t);n=!1){Er(e);var i=Vr(e);Lr(e),Kr(e,i),kn(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ln(e,t){var r=new os(e,t);if(Cn(e,r)){Er(e),Sn(e,r);var n=Vr(e);Lr(e),Kr(e,n),kn(e,n),r.finish()}}function Tn(e,r,n){function i(t){var r=t.nextSibling;return il&&dl&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,l=e.options.lineNumbers,s=o.lineDiv,a=s.firstChild,u=o.view,c=o.viewFrom,f=0;f-1&&(p=!1),Mt(e,d,c,n)),p&&(t(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(D(e.options,c)))),a=d.node.nextSibling}else{var g=Pt(e,d,c,n);s.insertBefore(g,a)}c+=d.size}for(;a;)a=i(a)}function Mn(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function kn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Vt(e)+"px"}function Nn(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function On(e,t){this.ranges=e,this.primIndex=t}function Wn(e,t){this.anchor=e,this.head=t}function Dn(e,t){var r=e[t];e.sort(function(e,t){return P(e.from(),t.from())}),t=h(e,r);for(var n=1;n=0){var l=z(o.from(),i.from()),s=I(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new Wn(a?s:l,a?l:s))}}return new On(e,t)}function Hn(e,t){return new On([new Wn(e,t||e)],0)}function Pn(e){return e.text?H(e.from.line+e.text.length-1,g(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function En(e,t){if(P(e,t.from)<0)return e;if(P(e,t.to)<=0)return Pn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Pn(t).ch-t.to.ch),H(r,n)}function In(e,t){for(var r=[],n=0;n1&&e.remove(s.line+1,p-1),e.insert(s.line+1,y)}Lt(e,"change",e,t)}function Vn(e,t,r){function n(e,i,o){if(e.linked)for(var l=0;l1&&!e.done[e.done.length-2].ranges?(e.done.pop(),g(e.done)):void 0}function $n(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=_n(i,i.lastOp==n)))l=g(o.changes),0==P(t.from,t.to)&&0==P(t.from,l.to)?l.to=Pn(t):o.changes.push(Xn(e,t));else{var a=g(i.done);for(a&&a.ranges||Qn(e.sel,i.done),o={changes:[Xn(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||Oe(e,"historyAdded")}function qn(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Zn(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||qn(e,o,g(i.done),t))?i.done[i.done.length-1]=t:Qn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&Yn(i.undone)}function Qn(e,t){var r=g(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Jn(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function ei(e){if(!e)return null;for(var t,r=0;r-1&&(g(s)[f]=u[f],delete u[f])}}}return n}function ii(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=P(r,i)<0;o!=P(n,i)<0?(i=r,r=n):o!=P(r,n)<0&&(r=n)}return new Wn(i,r)}return new Wn(n||r,r)}function oi(e,t,r,n){fi(e,new On([ii(e,e.sel.primary(),t,r)],0),n)}function li(e,t,r){for(var n=[],i=0;i=t.ch:s.to>t.ch))){if(i&&(Oe(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u=a.find(n<0?1:-1),c=void 0;if((n<0?a.inclusiveRight:a.inclusiveLeft)&&(u=yi(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=P(u,r))&&(n<0?c<0:c>0))return vi(e,u,t,n,i)}var f=a.find(n<0?-1:1);return(n<0?a.inclusiveLeft:a.inclusiveRight)&&(f=yi(e,f,n,f.line==t.line?o:null)),f?vi(e,f,t,n,i):null}}return t}function mi(e,t,r,n,i){var o=n||1,l=vi(e,t,r,o,i)||!i&&vi(e,t,r,o,!0)||vi(e,t,r,-o,i)||!i&&vi(e,t,r,-o,!0);return l?l:(e.cantEdit=!0,H(e.first,0))}function yi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?R(e,H(t.line-1)):null:r>0&&t.ch==(n||T(e,t.line)).text.length?t.line=0;--i)Ci(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Ci(e,t)}}function Ci(e,t){if(1!=t.text.length||""!=t.text[0]||0!=P(t.from,t.to)){var r=In(e,t);$n(e,t,r,e.cm?e.cm.curOp.id:NaN),Ti(e,t,r,q(e,t));var n=[];Vn(e,function(e,r){r||h(n,e.history)!=-1||(Oi(e.history,t),n.push(e.history)),Ti(e,t,null,q(e,t))})}}function Si(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a=0;--d){var p=f(d);if(p)return p.v}}}}function Li(e,t){if(0!=t&&(e.first+=t,e.sel=new On(v(e.sel.ranges,function(e){return new Wn(H(e.anchor.line+t,e.anchor.ch),H(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){dn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:H(o,T(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=M(e,t.from,t.to),r||(r=In(e,t)),e.cm?Mi(e.cm,t,n):Un(e,t,n),hi(e,r,Ml)}}function Mi(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=A(ae(T(n,o.line))),n.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&De(e),Un(n,t,r,wr(e)),e.options.lineWrapping||(n.iter(a,o.line+t.text.length,function(e){var t=ge(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),bn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?dn(e):o.line!=l.line||1!=t.text.length||Gn(e.doc,t)?dn(e,o.line,l.line+1,u):pn(e,o.line,"text");var c=He(e,"changes"),f=He(e,"change");if(f||c){var h={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&Lt(e,"change",e,h),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function ki(e,t,r,n,i){if(n||(n=r),P(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),xi(e,{from:r,to:n,text:t,origin:i})}function Ni(e,t,r,n){r0||0==s&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=n("span",[l.replacedWith],"CodeMirror-widget"),l.widgetNode.setAttribute("role","presentation"),i.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(se(e,t.line,t,r,l)||t.line!=r.line&&se(e,r.line,t,r,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");V()}l.addToHistory&&$n(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var a,c=t.line,f=e.cm;if(e.iter(c,r.line+1,function(e){f&&l.collapsed&&!f.options.lineWrapping&&ae(e)==f.display.maxLine&&(a=!0),l.collapsed&&c!=t.line&&N(e,0),Y(e,new K(l,c==t.line?t.ch:null,c==r.line?r.ch:null)),++c}),l.collapsed&&e.iter(t.line,r.line+1,function(t){he(e,t)&&N(t,0)}),l.clearOnEnter&&zl(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(U(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++ls,l.atomic=!0),f){if(a&&(f.curOp.updateMaxLine=!0),l.collapsed)dn(f,t.line,r.line+1);else if(l.className||l.title||l.startStyle||l.endStyle||l.css)for(var h=t.line;h<=r.line;h++)pn(f,h,"text");l.atomic&&pi(f.doc),Lt(f,"markerAdded",f,l)}return l}function Ri(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),hi(t.doc,Hn(r,r)),c)for(var f=0;f=0;t--)ki(e.doc,"",n[t].from,n[t].to,"+delete");Qr(e)})}function oo(e,t){var r=T(e.doc,t),n=ae(r);n!=r&&(t=A(n));var i=ke(n),o=i?i[0].level%2?xe(n):we(n):0;return H(t,o)}function lo(e,t){for(var r,n=T(e.doc,t);r=le(n);)n=r.find(1,!0).line,t=null;var i=ke(n),o=i?i[0].level%2?we(n):xe(n):n.text.length;return H(null==t?A(n):t,o)}function so(e,t){var r=oo(e,t.line),n=T(e.doc,r.line),i=ke(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return H(r.line,l?0:o)}return r}function ao(e,t,r){if("string"==typeof t&&(t=ys[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=Tl}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function uo(e,t,r){for(var n=0;ni-400&&0==P(ms.pos,r)?n="triple":vs&&vs.time>i-400&&0==P(vs.pos,r)?(n="double",ms={time:i,pos:r}):(n="single",vs={time:i,pos:r});var l,s=e.doc.sel,u=dl?t.metaKey:t.ctrlKey;e.options.dragDrop&&Fl&&!e.isReadOnly()&&"single"==n&&(l=s.contains(r))>-1&&(P((l=s.ranges[l]).from(),r)<0||r.xRel>0)&&(P(l.to(),r)>0||r.xRel<0)?wo(e,t,r,u):xo(e,t,r,n,u)}function wo(e,t,r,n){var i=e.display,o=+new Date,l=cn(e,function(s){il&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ae(document,"mouseup",l),Ae(i.scroller,"drop",l),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(Ee(s),!n&&+new Date-200w&&i.push(new Wn(H(v,w),H(v,d(y,u,o))))}i.length||i.push(new Wn(r,r)),fi(f,Dn(g.ranges.slice(0,p).concat(i),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=h,C=x.anchor,S=t;if("single"!=n){var L;L="double"==n?e.findWordAt(t):new Wn(H(t.line,0),R(f,H(t.line+1,0))),P(L.anchor,C)>0?(S=L.head,C=z(x.from(),L.anchor)):(S=L.anchor,C=I(x.to(),L.head))}var M=g.ranges.slice(0);M[p]=new Wn(R(f,C),S),fi(f,Dn(M,p),kl)}}function s(t){var r=++x,i=Cr(e,t,!0,"rect"==n);if(i)if(0!=P(i,b)){e.curOp.focus=o(),l(i);var a=zr(u,f);(i.line>=a.to||i.linew.bottom?20:0;c&&setTimeout(cn(e,function(){x==r&&(u.scroller.scrollTop+=c,s(t))}),50)}}function a(t){e.state.selectingText=!1,x=1/0,Ee(t),u.input.focus(),Ae(document,"mousemove",C),Ae(document,"mouseup",S),f.history.lastSelOrigin=null}var u=e.display,f=e.doc;Ee(t);var h,p,g=f.sel,v=g.ranges;if(i&&!t.shiftKey?(p=f.sel.contains(r),h=p>-1?v[p]:new Wn(r,r)):(h=f.sel.primary(),p=f.sel.primIndex),pl?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(h=new Wn(r,r)),r=Cr(e,t,!0,!0),p=-1;else if("double"==n){var m=e.findWordAt(r);h=e.display.shift||f.extend?ii(f,h,m.anchor,m.head):m}else if("triple"==n){var y=new Wn(H(r.line,0),R(f,H(r.line+1,0)));h=e.display.shift||f.extend?ii(f,h,y.anchor,y.head):y}else h=ii(f,h,r);i?p==-1?(p=v.length,fi(f,Dn(v.concat([h]),p),{scroll:!1,origin:"*mouse"})):v.length>1&&v[p].empty()&&"single"==n&&!t.shiftKey?(fi(f,Dn(v.slice(0,p).concat(v.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),g=f.sel):si(f,p,h,kl):(p=0,fi(f,new On([h],0),kl),g=f.sel);var b=r,w=u.wrapper.getBoundingClientRect(),x=0,C=cn(e,function(e){Be(e)?s(e):a(e)}),S=cn(e,a);e.state.selectingText=S,zl(document,"mousemove",C),zl(document,"mouseup",S)}function Co(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ee(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!He(e,r))return ze(t);o-=s.top-l.viewOffset;for(var a=0;a=i){var c=O(e.doc,o),f=e.options.gutters[a];return Oe(e,r,e,c,f,t),ze(t)}}}function So(e,t){return Co(e,t,"gutterClick",!0)}function Lo(e,t){Rt(e.display,t)||To(e,t)||We(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function To(e,t){return!!He(e,"gutterContextMenu")&&Co(e,t,"gutterContextMenu",!1)}function Mo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),or(e)}function ko(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=xs&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=xs,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Rn(e)},!0),t("indentUnit",2,Rn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Bn(e),or(e),dn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(H(n,o))}n++});for(var i=r.length-1;i>=0;i--)ki(e.doc,t,r[i],H(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=xs&&e.refresh()}),t("specialCharPlaceholder",dt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",hl?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!gl),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Mo(e),No(e)},!0),t("keyMap","default",function(e,t,r){var n=no(t),i=r!=xs&&no(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,Oo,!0),t("gutters",[],function(e){An(e.options),No(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?br(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Kr(e)},!0),t("scrollbarStyle","native",function(e){Xr(e),Kr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){An(e.options),No(e)},!0),t("firstLineNumber",1,No,!0),t("lineNumberFormatter",function(e){return e},No,!0),t("showCursorWhenSelecting",!1,Lr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Dr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Ao),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Lr,!0),t("singleCursorHeightPerLine",!0,Lr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Bn,!0),t("addModeClass",!1,Bn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Bn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null)}function No(e){Nn(e),dn(e),Hr(e)}function Ao(e,t,r){var n=r&&r!=xs;if(!t!=!n){var i=e.display.dragFunctions,o=t?zl:Ae;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Oo(e){e.options.lineWrapping?(l(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(wl(e.display.wrapper,"CodeMirror-wrap"),ve(e)),xr(e),dn(e),or(e),setTimeout(function(){return Kr(e)},100)}function Wo(e,t){var r=this;if(!(this instanceof Wo))return new Wo(e,t);this.options=t=t?u(t):{},u(Cs,t,!1),An(t);var n=t.value;"string"==typeof n&&(n=new as(n,t.mode,null,t.lineSeparator)),this.doc=n;var i=new Wo.inputStyles[t.inputStyle](this),o=this.display=new L(e,n,i);o.wrapper.CodeMirror=this,Nn(this),Mo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Xr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new f,keySeq:null,specialChars:null},t.autofocus&&!hl&&o.input.focus(),rl&&nl<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Do(this),$i(),en(this),this.curOp.forceUpdate=!0,Kn(this,n),t.autofocus&&!hl||this.hasFocus()?setTimeout(a(Wr,this),20):Dr(this);for(var l in Ss)Ss.hasOwnProperty(l)&&Ss[l](r,t[l],xs);Pr(this),t.finishInit&&t.finishInit(this);for(var s=0;s400}var i=e.display;zl(i.scroller,"mousedown",cn(e,yo)),rl&&nl<11?zl(i.scroller,"dblclick",cn(e,function(t){if(!We(e,t)){var r=Cr(e,t);if(r&&!So(e,t)&&!Rt(e.display,t)){Ee(t);var n=e.findWordAt(r);oi(e.doc,n.anchor,n.head)}}})):zl(i.scroller,"dblclick",function(t){return We(e,t)||Ee(t)}),bl||zl(i.scroller,"contextmenu",function(t){return Lo(e,t)});var o,l={end:0};zl(i.scroller,"touchstart",function(t){if(!We(e,t)&&!r(t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-l.end<=300?l:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),zl(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),zl(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!Rt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var l,s=e.coordsChar(i.activeTouch,"page");l=!o.prev||n(o,o.prev)?new Wn(s,s):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(s):new Wn(H(s.line,0),R(e.doc,H(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),Ee(r)}t()}),zl(i.scroller,"touchcancel",t),zl(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Fr(e,i.scroller.scrollTop),Rr(e,i.scroller.scrollLeft,!0),Oe(e,"scroll",e))}),zl(i.scroller,"mousewheel",function(t){return Ur(e,t)}),zl(i.scroller,"DOMMouseScroll",function(t){return Ur(e,t)}),zl(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){We(e,t)||Fe(t)},over:function(t){We(e,t)||(Xi(e,t),Fe(t))},start:function(t){return ji(e,t)},drop:cn(e,Ki),leave:function(t){We(e,t)||Yi(e)}};var s=i.input.getField();zl(s,"keyup",function(t){return vo.call(e,t)}),zl(s,"keydown",cn(e,po)),zl(s,"keypress",cn(e,mo)),zl(s,"focus",function(t){return Wr(e,t)}),zl(s,"blur",function(t){return Dr(e,t)})}function Ho(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=et(e,t):r="prev");var l=e.options.tabSize,s=T(o,t),a=c(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,f=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(f.length),s.text),u==Tl||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?c(T(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",d=0;if(e.options.indentWithTabs)for(var g=Math.floor(u/l);g;--g)d+=l,h+="\t";if(d1)if(Ts&&Ts.text.join("\n")==t){if(n.ranges.length%Ts.text.length==0){a=[];for(var u=0;u=0;f--){var h=n.ranges[f],d=h.from(),p=h.to();h.empty()&&(r&&r>0?d=H(d.line,d.ch-r):e.state.overwrite&&!l?p=H(p.line,Math.min(T(o,p.line).text.length,p.ch+g(s).length)):Ts&&Ts.lineWise&&Ts.text.join("\n")==t&&(d=p=H(d.line,0))),c=e.curOp.updateInput;var m={from:d,to:p,text:a?a[f%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};xi(e.doc,m),Lt(e,"inputRead",e,m)}t&&!l&&zo(e,t),Qr(e),e.curOp.updateInput=c,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Io(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||un(t,function(){return Eo(t,r,0,null,"paste")}),!0}function zo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s-1){l=Ho(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(T(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Ho(e,i.head.line,"smart"));l&&Lt(e,"electricInput",e,i.head.line)}}}function Fo(e){for(var t=[],r=[],n=0;nn&&(Ho(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Qr(t));else{var l=o.from(),s=o.to(),a=Math.max(n,l.line);n=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var u=a;u0&&si(t.doc,i,new Wn(l,c[i].to()),Ml)}}}),getTokenAt:function(e,t){return it(this,e,t)},getLineTokens:function(e,t){return it(this,H(e),t,!0)},getTokenTypeAt:function(e){e=R(this.doc,e);var t,r=Je(this,T(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]o&&(e=o,i=!0),n=T(this.doc,e)}else n=e;return ar(this,n,{top:0,left:0},t||"page",r).top+(i?this.doc.height-pe(n):0)},defaultTextHeight:function(){return vr(this.display)},defaultCharWidth:function(){return mr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=fr(this,R(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&$r(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:fn(po),triggerOnKeyPress:fn(mo),triggerOnKeyUp:vo,execCommand:function(e){if(ys.hasOwnProperty(e))return ys[e].call(null,this)},triggerElectric:fn(function(e){zo(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var l=R(this.doc,e),s=0;s0&&s(r.charAt(n-1));)--n;for(;i.5)&&xr(this),Oe(this,"refresh",this)}),swapDoc:fn(function(e){var t=this.doc;return t.cm=null,Kn(this,e),or(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Lt(this,"swapDoc",this,t),t}),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}},Pe(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function Uo(e,t,r,n,i){function o(){var t=s+r;return!(t=e.first+e.size)&&(s=t,c=T(e,t))}function l(e){var t=(i?Te:Me)(c,a,r,!0);if(null==t){if(e||!o())return!1;a=i?(r<0?xe:we)(c):r<0?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=T(e,s);if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var f=null,h="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||l(!p);p=!1){var g=c.text.charAt(a)||"\n",v=x(g,d)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||p||v||(v="s"),f&&f!=v){r<0&&(r=1,l());break}if(v&&(f=v),r>0&&!l(!p))break}var m=mi(e,H(s,a),t,u,!0);return P(t,m)||(m.hitSide=!0),m}function Vo(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),a=Math.max(s-.5*vr(e.display),3);i=(r>0?t.bottom:t.top)+r*a}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var u;u=pr(e,l,i),u.outside;){if(r<0?i<=0:i>=o.height){u.hitSide=!0;break}i+=5*r}return u}function Ko(e,t){var r=qt(e,t.line);if(!r||r.hidden)return null;var n=T(e.doc,t.line),i=Yt(r,n,t.line),o=ke(n),l="left";if(o){var s=Se(o,t.ch);l=s%2?"right":"left"}var a=Jt(i.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function jo(e,t){return t&&(e.bad=!0),e}function Xo(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void(s+=""==r?t.textContent.replace(/\u200b/g,""):r);var c,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(H(n,0),H(i+1,0),o(+f));return void(h.length&&(c=h[0].find())&&(s+=M(e.doc,c.from,c.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d=15&&(sl=!1,il=!0);var ml,yl=dl&&(ol||sl&&(null==vl||vl<12.11)),bl=Jo||rl&&nl>=9,wl=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};ml=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var xl=function(e){e.select()};fl?xl=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:rl&&(xl=function(e){try{e.select()}catch(e){}}),f.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Cl,Sl,Ll=30,Tl={toString:function(){return"CodeMirror.Pass"}},Ml={scroll:!1},kl={origin:"*mouse"},Nl={origin:"+move"},Al=[""],Ol=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Wl=/[\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]/,Dl=!1,Hl=!1,Pl=null,El=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n=r.length,c=[],f=0;f=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},Pe(at),at.prototype.lineNo=function(){return A(this)};var Yl,_l={},$l={},ql=null,Zl=null,Ql={left:0,right:0,top:0,bottom:0},Jl=0,es=null;rl?es=-.53:Jo?es=15:ll?es=-.7:al&&(es=-1/3);var ts=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),zl(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),zl(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,rl&&nl<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ts.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},ts.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},ts.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},ts.prototype.zeroWidthHack=function(){var e=dl&&!ul?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new f,this.disableVert=new f},ts.prototype.enableZeroWidthBar=function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},ts.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var rs=function(){};rs.prototype.update=function(){return{bottom:0,right:0}},rs.prototype.setScrollLeft=function(){},rs.prototype.setScrollTop=function(){},rs.prototype.clear=function(){};var ns={native:ts,null:rs},is=0,os=function(e,t,r){var n=e.display;this.viewport=t,this.visible=zr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Kt(e),this.force=r,this.dims=yr(e),this.events=[]};os.prototype.signal=function(e,t){He(e,t)&&this.events.push(arguments)},os.prototype.finish=function(){for(var e=this,t=0;t=0&&P(e,i.to())<=0)return n}return-1}},Wn.prototype={from:function(){return z(this.anchor,this.head)},to:function(){return I(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}},Di.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=this,n=e,i=e+t;n1||!(this.children[0]instanceof Di))){var a=[];this.collapse(a),this.children=[new Di(a)],this.children[0].parent=this}},collapse:function(e){for(var t=this,r=0;r50){for(var s=o.lines.length%25+25,a=s;a10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=this,i=0;it.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=f,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&dn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&pi(t.doc)),t&&Lt(t,"markerCleared",t,this),r&&tn(t),this.parent&&this.parent.clear()}},zi.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o=0;u--)xi(n,i[u]);a?ci(this,a):this.cm&&Qr(this.cm)}),undo:hn(function(){Si(this,"undo")}),redo:hn(function(){Si(this,"redo")}),undoSelection:hn(function(){Si(this,"undo",!0)}),redoSelection:hn(function(){Si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=R(this,e),t=R(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=o,void++r)}),R(this,H(r,t))},indexFromPos:function(e){e=R(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)i=new H(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),H(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=T(e.doc,i.line-1).text;l&&(i=new H(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),H(i.line-1,l.length-1),i,"+transpose"))}r.push(new Wn(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return un(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne.firstLine()&&(n=H(n.line-1,T(e.doc,n.line-1).length)),i.ch==T(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,l,s;n.line==t.viewFrom||0==(o=Sr(e,n.line))?(l=A(t.view[0].line),s=t.view[0].node):(l=A(t.view[o].line),s=t.view[o-1].node.nextSibling);var a,u,c=Sr(e,i.line);if(c==t.view.length-1?(a=t.viewTo-1,u=t.lineDiv.lastChild):(a=A(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var f=e.doc.splitLines(Xo(e,s,u,l,a)),h=M(e.doc,H(l,0),H(a,T(e.doc,a).text.length));f.length>1&&h.length>1;)if(g(f)==g(h))f.pop(),h.pop(),a--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),l++}for(var d=0,p=0,v=f[0],m=h[0],y=Math.min(v.length,m.length);d1||f[0]||P(C,S)?(ki(e.doc,f,C,S,"+input"),!0):void 0},Ms.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ms.prototype.reset=function(){this.forceCompositionEnd()},Ms.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.pollContent()||dn(this.cm),this.div.blur(),this.div.focus())},Ms.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}!e.cm.isReadOnly()&&e.pollContent()||un(e.cm,function(){return dn(e.cm)})},80))},Ms.prototype.setUneditable=function(e){e.contentEditable="false"},Ms.prototype.onKeyPress=function(e){e.preventDefault(),this.cm.isReadOnly()||cn(this.cm,Eo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},Ms.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ms.prototype.onContextMenu=function(){},Ms.prototype.resetPosition=function(){},Ms.prototype.needsContentAttribute=!0;var ks=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new f,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};ks.prototype.init=function(e){function t(e){if(!We(i,e)){if(i.somethingSelected())Po({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,l.value=Ts.text.join("\n"),xl(l));else{if(!i.options.lineWiseCopyCut)return;var t=Fo(i);Po({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Ml):(n.prevInput="",l.value=t.text.join("\n"),xl(l))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Bo(),l=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),fl&&(l.style.width="0px"),zl(l,"input",function(){rl&&nl>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),zl(l,"paste",function(e){We(i,e)||Io(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),zl(l,"cut",t),zl(l,"copy",t),zl(e.scroller,"paste",function(t){Rt(e,t)||We(i,t)||(i.state.pasteIncoming=!0,n.focus())}),zl(e.lineSpace,"selectstart",function(t){Rt(e,t)||Ee(t)}),zl(l,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),zl(l,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},ks.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Tr(e);if(e.options.moveInputWithCursor){var i=fr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},ks.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ks.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Gl&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&xl(this.textarea),rl&&nl>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",rl&&nl>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},ks.prototype.getField=function(){return this.textarea},ks.prototype.supportsTouch=function(){return!1},ks.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!hl||o()!=this.textarea))try{this.textarea.focus()}catch(e){}},ks.prototype.blur=function(){this.textarea.blur()},ks.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ks.prototype.receivedFocus=function(){this.slowPoll()},ks.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ks.prototype.fastPoll=function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},ks.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Bl(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(rl&&nl>=9&&this.hasSelection===i||dl&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,s=Math.min(n.length,i.length);l1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ks.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ks.prototype.onKeyPress=function(){rl&&nl>=9&&(this.hasSelection=null),this.fastPoll()},ks.prototype.onContextMenu=function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t="​"+(e?l.value:"");l.value="⇚",l.value=t,n.prevInput=e?"":"​",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=f,l.style.cssText=c,rl&&nl<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!rl||rl&&nl<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&"​"==n.prevInput?cn(i,bi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,s=Cr(i,e),a=o.scroller.scrollTop;if(s&&!sl){var u=i.options.resetSelectionOnContextMenu;u&&i.doc.sel.contains(s)==-1&&cn(i,fi)(i.doc,Hn(s),Ml);var c=l.style.cssText,f=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var h=n.wrapper.getBoundingClientRect();l.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(rl?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var d;if(il&&(d=window.scrollY),o.input.focus(),il&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),rl&&nl>=9&&t(),bl){Fe(e);var p=function(){Ae(window,"mouseup",p),setTimeout(r,20)};zl(window,"mouseup",p)}else setTimeout(r,50)}},ks.prototype.readOnlyChanged=function(e){e||this.reset()},ks.prototype.setUneditable=function(){},ks.prototype.needsContentAttribute=!1,ko(Wo),Go(Wo);var Ns="iter insert remove copy getEditor constructor".split(" ");for(var As in as.prototype)as.prototype.hasOwnProperty(As)&&h(Ns,As)<0&&(Wo.prototype[As]=function(e){return function(){return e.apply(this.doc,arguments)}}(as.prototype[As]));return Pe(as),Wo.inputStyles={textarea:ks,contenteditable:Ms},Wo.defineMode=function(e){Wo.defaults.mode||"null"==e||(Wo.defaults.mode=e),Ke.apply(this,arguments)},Wo.defineMIME=je,Wo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Wo.defineMIME("text/plain","null"),Wo.defineExtension=function(e,t){Wo.prototype[e]=t},Wo.defineDocExtension=function(e,t){as.prototype[e]=t},Wo.fromTextArea=$o,qo(Wo),Wo.version="5.23.0",Wo})},{}],65:[function(require,module,exports){"use strict";function GraphQLError(r,e,o,a,t,i){i&&i.stack?Object.defineProperty(this,"stack",{value:i.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0});var c=o;if(!c&&e&&e.length>0){var l=e[0];c=l&&l.loc&&l.loc.source}var n=a;!n&&e&&(n=e.filter(function(r){return Boolean(r.loc)}).map(function(r){return r.loc.start})),n&&0===n.length&&(n=void 0);var u=void 0,s=c;s&&n&&(u=n.map(function(r){return(0,_location.getLocation)(s,r)})),Object.defineProperties(this,{message:{value:r,enumerable:!0,writable:!0},locations:{value:u||void 0,enumerable:!0},path:{value:t||void 0,enumerable:!0},nodes:{value:e||void 0},source:{value:c||void 0},positions:{value:n||void 0},originalError:{value:i}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphQLError=GraphQLError;var _location=require("../language/location");GraphQLError.prototype=Object.create(Error.prototype,{constructor:{value:GraphQLError},name:{value:"GraphQLError"}})},{"../language/location":86}],66:[function(require,module,exports){"use strict";function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function formatError(r){return(0,_invariant2.default)(r,"Received null or undefined error."),{message:r.message,locations:r.locations,path:r.path}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatError=formatError;var _invariant=require("../jsutils/invariant"),_invariant2=_interopRequireDefault(_invariant)},{"../jsutils/invariant":76}],67:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _GraphQLError=require("./GraphQLError");Object.defineProperty(exports,"GraphQLError",{enumerable:!0,get:function(){return _GraphQLError.GraphQLError}});var _syntaxError=require("./syntaxError");Object.defineProperty(exports,"syntaxError",{enumerable:!0,get:function(){return _syntaxError.syntaxError}});var _locatedError=require("./locatedError");Object.defineProperty(exports,"locatedError",{enumerable:!0,get:function(){return _locatedError.locatedError}});var _formatError=require("./formatError");Object.defineProperty(exports,"formatError",{enumerable:!0,get:function(){return _formatError.formatError}})},{"./GraphQLError":65,"./formatError":66,"./locatedError":68,"./syntaxError":69}],68:[function(require,module,exports){"use strict";function locatedError(r,e,o){if(r&&r.path)return r;var t=r?r.message||String(r):"An unknown error occurred.";return new _GraphQLError.GraphQLError(t,r&&r.nodes||e,r&&r.source,r&&r.positions,o,r)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.locatedError=locatedError;var _GraphQLError=require("./GraphQLError")},{"./GraphQLError":65}],69:[function(require,module,exports){"use strict";function syntaxError(r,n,o){var t=(0,_location.getLocation)(r,n),e=new _GraphQLError.GraphQLError("Syntax Error "+r.name+" ("+t.line+":"+t.column+") "+o+"\n\n"+highlightSourceAtLocation(r,t),void 0,r,[n]); return e}function highlightSourceAtLocation(r,n){var o=n.line,t=(o-1).toString(),e=o.toString(),a=(o+1).toString(),i=a.length,l=r.body.split(/\r\n|[\n\r]/g);return(o>=2?lpad(i,t)+": "+l[o-2]+"\n":"")+lpad(i,e)+": "+l[o-1]+"\n"+Array(2+i+n.column).join(" ")+"^\n"+(o0?{errors:c}:(0,_execute.execute)(e,s,a,t,u,i))}).then(void 0,function(e){return{errors:[e]}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.graphql=graphql;var _source=require("./language/source"),_parser=require("./language/parser"),_validate=require("./validation/validate"),_execute=require("./execution/execute")},{"./execution/execute":70,"./language/parser":87,"./language/source":89,"./validation/validate":143}],74:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _graphql=require("./graphql");Object.defineProperty(exports,"graphql",{enumerable:!0,get:function(){return _graphql.graphql}});var _type=require("./type");Object.defineProperty(exports,"GraphQLSchema",{enumerable:!0,get:function(){return _type.GraphQLSchema}}),Object.defineProperty(exports,"GraphQLScalarType",{enumerable:!0,get:function(){return _type.GraphQLScalarType}}),Object.defineProperty(exports,"GraphQLObjectType",{enumerable:!0,get:function(){return _type.GraphQLObjectType}}),Object.defineProperty(exports,"GraphQLInterfaceType",{enumerable:!0,get:function(){return _type.GraphQLInterfaceType}}),Object.defineProperty(exports,"GraphQLUnionType",{enumerable:!0,get:function(){return _type.GraphQLUnionType}}),Object.defineProperty(exports,"GraphQLEnumType",{enumerable:!0,get:function(){return _type.GraphQLEnumType}}),Object.defineProperty(exports,"GraphQLInputObjectType",{enumerable:!0,get:function(){return _type.GraphQLInputObjectType}}),Object.defineProperty(exports,"GraphQLList",{enumerable:!0,get:function(){return _type.GraphQLList}}),Object.defineProperty(exports,"GraphQLNonNull",{enumerable:!0,get:function(){return _type.GraphQLNonNull}}),Object.defineProperty(exports,"GraphQLDirective",{enumerable:!0,get:function(){return _type.GraphQLDirective}}),Object.defineProperty(exports,"TypeKind",{enumerable:!0,get:function(){return _type.TypeKind}}),Object.defineProperty(exports,"DirectiveLocation",{enumerable:!0,get:function(){return _type.DirectiveLocation}}),Object.defineProperty(exports,"GraphQLInt",{enumerable:!0,get:function(){return _type.GraphQLInt}}),Object.defineProperty(exports,"GraphQLFloat",{enumerable:!0,get:function(){return _type.GraphQLFloat}}),Object.defineProperty(exports,"GraphQLString",{enumerable:!0,get:function(){return _type.GraphQLString}}),Object.defineProperty(exports,"GraphQLBoolean",{enumerable:!0,get:function(){return _type.GraphQLBoolean}}),Object.defineProperty(exports,"GraphQLID",{enumerable:!0,get:function(){return _type.GraphQLID}}),Object.defineProperty(exports,"specifiedDirectives",{enumerable:!0,get:function(){return _type.specifiedDirectives}}),Object.defineProperty(exports,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return _type.GraphQLIncludeDirective}}),Object.defineProperty(exports,"GraphQLSkipDirective",{enumerable:!0,get:function(){return _type.GraphQLSkipDirective}}),Object.defineProperty(exports,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return _type.GraphQLDeprecatedDirective}}),Object.defineProperty(exports,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return _type.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(exports,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return _type.SchemaMetaFieldDef}}),Object.defineProperty(exports,"TypeMetaFieldDef",{enumerable:!0,get:function(){return _type.TypeMetaFieldDef}}),Object.defineProperty(exports,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return _type.TypeNameMetaFieldDef}}),Object.defineProperty(exports,"__Schema",{enumerable:!0,get:function(){return _type.__Schema}}),Object.defineProperty(exports,"__Directive",{enumerable:!0,get:function(){return _type.__Directive}}),Object.defineProperty(exports,"__DirectiveLocation",{enumerable:!0,get:function(){return _type.__DirectiveLocation}}),Object.defineProperty(exports,"__Type",{enumerable:!0,get:function(){return _type.__Type}}),Object.defineProperty(exports,"__Field",{enumerable:!0,get:function(){return _type.__Field}}),Object.defineProperty(exports,"__InputValue",{enumerable:!0,get:function(){return _type.__InputValue}}),Object.defineProperty(exports,"__EnumValue",{enumerable:!0,get:function(){return _type.__EnumValue}}),Object.defineProperty(exports,"__TypeKind",{enumerable:!0,get:function(){return _type.__TypeKind}}),Object.defineProperty(exports,"isType",{enumerable:!0,get:function(){return _type.isType}}),Object.defineProperty(exports,"isInputType",{enumerable:!0,get:function(){return _type.isInputType}}),Object.defineProperty(exports,"isOutputType",{enumerable:!0,get:function(){return _type.isOutputType}}),Object.defineProperty(exports,"isLeafType",{enumerable:!0,get:function(){return _type.isLeafType}}),Object.defineProperty(exports,"isCompositeType",{enumerable:!0,get:function(){return _type.isCompositeType}}),Object.defineProperty(exports,"isAbstractType",{enumerable:!0,get:function(){return _type.isAbstractType}}),Object.defineProperty(exports,"isNamedType",{enumerable:!0,get:function(){return _type.isNamedType}}),Object.defineProperty(exports,"assertType",{enumerable:!0,get:function(){return _type.assertType}}),Object.defineProperty(exports,"assertInputType",{enumerable:!0,get:function(){return _type.assertInputType}}),Object.defineProperty(exports,"assertOutputType",{enumerable:!0,get:function(){return _type.assertOutputType}}),Object.defineProperty(exports,"assertLeafType",{enumerable:!0,get:function(){return _type.assertLeafType}}),Object.defineProperty(exports,"assertCompositeType",{enumerable:!0,get:function(){return _type.assertCompositeType}}),Object.defineProperty(exports,"assertAbstractType",{enumerable:!0,get:function(){return _type.assertAbstractType}}),Object.defineProperty(exports,"assertNamedType",{enumerable:!0,get:function(){return _type.assertNamedType}}),Object.defineProperty(exports,"getNullableType",{enumerable:!0,get:function(){return _type.getNullableType}}),Object.defineProperty(exports,"getNamedType",{enumerable:!0,get:function(){return _type.getNamedType}});var _language=require("./language");Object.defineProperty(exports,"Source",{enumerable:!0,get:function(){return _language.Source}}),Object.defineProperty(exports,"getLocation",{enumerable:!0,get:function(){return _language.getLocation}}),Object.defineProperty(exports,"parse",{enumerable:!0,get:function(){return _language.parse}}),Object.defineProperty(exports,"parseValue",{enumerable:!0,get:function(){return _language.parseValue}}),Object.defineProperty(exports,"parseType",{enumerable:!0,get:function(){return _language.parseType}}),Object.defineProperty(exports,"print",{enumerable:!0,get:function(){return _language.print}}),Object.defineProperty(exports,"visit",{enumerable:!0,get:function(){return _language.visit}}),Object.defineProperty(exports,"visitInParallel",{enumerable:!0,get:function(){return _language.visitInParallel}}),Object.defineProperty(exports,"visitWithTypeInfo",{enumerable:!0,get:function(){return _language.visitWithTypeInfo}}),Object.defineProperty(exports,"Kind",{enumerable:!0,get:function(){return _language.Kind}}),Object.defineProperty(exports,"TokenKind",{enumerable:!0,get:function(){return _language.TokenKind}}),Object.defineProperty(exports,"BREAK",{enumerable:!0,get:function(){return _language.BREAK}});var _execution=require("./execution");Object.defineProperty(exports,"execute",{enumerable:!0,get:function(){return _execution.execute}}),Object.defineProperty(exports,"defaultFieldResolver",{enumerable:!0,get:function(){return _execution.defaultFieldResolver}}),Object.defineProperty(exports,"responsePathAsArray",{enumerable:!0,get:function(){return _execution.responsePathAsArray}});var _validation=require("./validation");Object.defineProperty(exports,"validate",{enumerable:!0,get:function(){return _validation.validate}}),Object.defineProperty(exports,"ValidationContext",{enumerable:!0,get:function(){return _validation.ValidationContext}}),Object.defineProperty(exports,"specifiedRules",{enumerable:!0,get:function(){return _validation.specifiedRules}});var _error=require("./error");Object.defineProperty(exports,"GraphQLError",{enumerable:!0,get:function(){return _error.GraphQLError}}),Object.defineProperty(exports,"formatError",{enumerable:!0,get:function(){return _error.formatError}});var _utilities=require("./utilities");Object.defineProperty(exports,"introspectionQuery",{enumerable:!0,get:function(){return _utilities.introspectionQuery}}),Object.defineProperty(exports,"getOperationAST",{enumerable:!0,get:function(){return _utilities.getOperationAST}}),Object.defineProperty(exports,"buildClientSchema",{enumerable:!0,get:function(){return _utilities.buildClientSchema}}),Object.defineProperty(exports,"buildASTSchema",{enumerable:!0,get:function(){return _utilities.buildASTSchema}}),Object.defineProperty(exports,"buildSchema",{enumerable:!0,get:function(){return _utilities.buildSchema}}),Object.defineProperty(exports,"extendSchema",{enumerable:!0,get:function(){return _utilities.extendSchema}}),Object.defineProperty(exports,"printSchema",{enumerable:!0,get:function(){return _utilities.printSchema}}),Object.defineProperty(exports,"printType",{enumerable:!0,get:function(){return _utilities.printType}}),Object.defineProperty(exports,"typeFromAST",{enumerable:!0,get:function(){return _utilities.typeFromAST}}),Object.defineProperty(exports,"valueFromAST",{enumerable:!0,get:function(){return _utilities.valueFromAST}}),Object.defineProperty(exports,"astFromValue",{enumerable:!0,get:function(){return _utilities.astFromValue}}),Object.defineProperty(exports,"TypeInfo",{enumerable:!0,get:function(){return _utilities.TypeInfo}}),Object.defineProperty(exports,"isValidJSValue",{enumerable:!0,get:function(){return _utilities.isValidJSValue}}),Object.defineProperty(exports,"isValidLiteralValue",{enumerable:!0,get:function(){return _utilities.isValidLiteralValue}}),Object.defineProperty(exports,"concatAST",{enumerable:!0,get:function(){return _utilities.concatAST}}),Object.defineProperty(exports,"separateOperations",{enumerable:!0,get:function(){return _utilities.separateOperations}}),Object.defineProperty(exports,"isEqualType",{enumerable:!0,get:function(){return _utilities.isEqualType}}),Object.defineProperty(exports,"isTypeSubTypeOf",{enumerable:!0,get:function(){return _utilities.isTypeSubTypeOf}}),Object.defineProperty(exports,"doTypesOverlap",{enumerable:!0,get:function(){return _utilities.doTypesOverlap}}),Object.defineProperty(exports,"assertValidName",{enumerable:!0,get:function(){return _utilities.assertValidName}}),Object.defineProperty(exports,"findBreakingChanges",{enumerable:!0,get:function(){return _utilities.findBreakingChanges}}),Object.defineProperty(exports,"findDeprecatedUsages",{enumerable:!0,get:function(){return _utilities.findDeprecatedUsages}})},{"./error":67,"./execution":71,"./graphql":73,"./language":83,"./type":93,"./utilities":107,"./validation":116}],75:[function(require,module,exports){"use strict";function find(e,t){for(var r=0;r2?", ":" ")+(u===t.length-1?"or ":"")+r})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=quotedOrList;var MAX_LENGTH=5},{}],82:[function(require,module,exports){"use strict";function suggestionList(t,e){for(var n=Object.create(null),r=e.length,i=t.length/2,o=0;o1&&r>1&&t[n-1]===e[r-2]&&t[n-2]===e[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+s))}return i[o][a]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=suggestionList},{}],83:[function(require,module,exports){"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.BREAK=exports.visitWithTypeInfo=exports.visitInParallel=exports.visit=exports.Source=exports.print=exports.parseType=exports.parseValue=exports.parse=exports.TokenKind=exports.createLexer=exports.Kind=exports.getLocation=void 0;var _location=require("./location");Object.defineProperty(exports,"getLocation",{enumerable:!0,get:function(){return _location.getLocation}});var _lexer=require("./lexer");Object.defineProperty(exports,"createLexer",{enumerable:!0,get:function(){return _lexer.createLexer}}),Object.defineProperty(exports,"TokenKind",{enumerable:!0,get:function(){return _lexer.TokenKind}});var _parser=require("./parser");Object.defineProperty(exports,"parse",{enumerable:!0,get:function(){return _parser.parse}}),Object.defineProperty(exports,"parseValue",{enumerable:!0,get:function(){return _parser.parseValue}}),Object.defineProperty(exports,"parseType",{enumerable:!0,get:function(){return _parser.parseType}});var _printer=require("./printer");Object.defineProperty(exports,"print",{enumerable:!0,get:function(){return _printer.print}});var _source=require("./source");Object.defineProperty(exports,"Source",{enumerable:!0,get:function(){return _source.Source}});var _visitor=require("./visitor");Object.defineProperty(exports,"visit",{enumerable:!0,get:function(){return _visitor.visit}}),Object.defineProperty(exports,"visitInParallel",{enumerable:!0,get:function(){return _visitor.visitInParallel}}),Object.defineProperty(exports,"visitWithTypeInfo",{enumerable:!0,get:function(){ return _visitor.visitWithTypeInfo}}),Object.defineProperty(exports,"BREAK",{enumerable:!0,get:function(){return _visitor.BREAK}});var _kinds=require("./kinds"),Kind=_interopRequireWildcard(_kinds);exports.Kind=Kind},{"./kinds":84,"./lexer":85,"./location":86,"./parser":87,"./printer":88,"./source":89,"./visitor":90}],84:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.NAME="Name",exports.DOCUMENT="Document",exports.OPERATION_DEFINITION="OperationDefinition",exports.VARIABLE_DEFINITION="VariableDefinition",exports.VARIABLE="Variable",exports.SELECTION_SET="SelectionSet",exports.FIELD="Field",exports.ARGUMENT="Argument",exports.FRAGMENT_SPREAD="FragmentSpread",exports.INLINE_FRAGMENT="InlineFragment",exports.FRAGMENT_DEFINITION="FragmentDefinition",exports.INT="IntValue",exports.FLOAT="FloatValue",exports.STRING="StringValue",exports.BOOLEAN="BooleanValue",exports.NULL="NullValue",exports.ENUM="EnumValue",exports.LIST="ListValue",exports.OBJECT="ObjectValue",exports.OBJECT_FIELD="ObjectField",exports.DIRECTIVE="Directive",exports.NAMED_TYPE="NamedType",exports.LIST_TYPE="ListType",exports.NON_NULL_TYPE="NonNullType",exports.SCHEMA_DEFINITION="SchemaDefinition",exports.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",exports.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",exports.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",exports.FIELD_DEFINITION="FieldDefinition",exports.INPUT_VALUE_DEFINITION="InputValueDefinition",exports.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",exports.UNION_TYPE_DEFINITION="UnionTypeDefinition",exports.ENUM_TYPE_DEFINITION="EnumTypeDefinition",exports.ENUM_VALUE_DEFINITION="EnumValueDefinition",exports.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",exports.TYPE_EXTENSION_DEFINITION="TypeExtensionDefinition",exports.DIRECTIVE_DEFINITION="DirectiveDefinition"},{}],85:[function(require,module,exports){"use strict";function createLexer(e,r){var a=new Tok(SOF,0,0,0,0,null),t={source:e,options:r,lastToken:a,token:a,line:1,lineStart:0,advance:advanceLexer};return t}function advanceLexer(){var e=this.lastToken=this.token;if(e.kind!==EOF){do e=e.next=readToken(this,e);while(e.kind===COMMENT);this.token=e}return e}function getTokenDesc(e){var r=e.value;return r?e.kind+' "'+r+'"':e.kind}function Tok(e,r,a,t,c,n,o){this.kind=e,this.start=r,this.end=a,this.line=t,this.column=c,this.value=o,this.prev=n,this.next=null}function printCharCode(e){return isNaN(e)?EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'+("00"+e.toString(16).toUpperCase()).slice(-4)+'"'}function readToken(e,r){var a=e.source,t=a.body,c=t.length,n=positionAfterWhitespace(t,r.end,e),o=e.line,s=1+n-e.lineStart;if(n>=c)return new Tok(EOF,c,c,o,s,r);var i=charCodeAt.call(t,n);if(i<32&&9!==i&&10!==i&&13!==i)throw(0,_error.syntaxError)(a,n,"Cannot contain the invalid character "+printCharCode(i)+".");switch(i){case 33:return new Tok(BANG,n,n+1,o,s,r);case 35:return readComment(a,n,o,s,r);case 36:return new Tok(DOLLAR,n,n+1,o,s,r);case 40:return new Tok(PAREN_L,n,n+1,o,s,r);case 41:return new Tok(PAREN_R,n,n+1,o,s,r);case 46:if(46===charCodeAt.call(t,n+1)&&46===charCodeAt.call(t,n+2))return new Tok(SPREAD,n,n+3,o,s,r);break;case 58:return new Tok(COLON,n,n+1,o,s,r);case 61:return new Tok(EQUALS,n,n+1,o,s,r);case 64:return new Tok(AT,n,n+1,o,s,r);case 91:return new Tok(BRACKET_L,n,n+1,o,s,r);case 93:return new Tok(BRACKET_R,n,n+1,o,s,r);case 123:return new Tok(BRACE_L,n,n+1,o,s,r);case 124:return new Tok(PIPE,n,n+1,o,s,r);case 125:return new Tok(BRACE_R,n,n+1,o,s,r);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return readName(a,n,o,s,r);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(a,n,i,o,s,r);case 34:return readString(a,n,o,s,r)}throw(0,_error.syntaxError)(a,n,unexpectedCharacterMessage(i))}function unexpectedCharacterMessage(e){return 39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character "+printCharCode(e)+"."}function positionAfterWhitespace(e,r,a){for(var t=e.length,c=r;c31||9===o));return new Tok(COMMENT,r,s,a,t,c,slice.call(n,r+1,s))}function readNumber(e,r,a,t,c,n){var o=e.body,s=a,i=r,l=!1;if(45===s&&(s=charCodeAt.call(o,++i)),48===s){if(s=charCodeAt.call(o,++i),s>=48&&s<=57)throw(0,_error.syntaxError)(e,i,"Invalid number, unexpected digit after 0: "+printCharCode(s)+".")}else i=readDigits(e,i,s),s=charCodeAt.call(o,i);return 46===s&&(l=!0,s=charCodeAt.call(o,++i),i=readDigits(e,i,s),s=charCodeAt.call(o,i)),69!==s&&101!==s||(l=!0,s=charCodeAt.call(o,++i),43!==s&&45!==s||(s=charCodeAt.call(o,++i)),i=readDigits(e,i,s)),new Tok(l?FLOAT:INT,r,i,t,c,n,slice.call(o,r,i))}function readDigits(e,r,a){var t=e.body,c=r,n=a;if(n>=48&&n<=57){do n=charCodeAt.call(t,++c);while(n>=48&&n<=57);return c}throw(0,_error.syntaxError)(e,c,"Invalid number, expected digit but got: "+printCharCode(n)+".")}function readString(e,r,a,t,c){for(var n=e.body,o=r+1,s=o,i=0,l="";o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function readName(e,r,a,t,c){for(var n=e.body,o=n.length,s=r+1,i=0;s!==o&&null!==(i=charCodeAt.call(n,s))&&(95===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122);)++s;return new Tok(NAME,r,s,a,t,c,slice.call(n,r,s))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TokenKind=void 0,exports.createLexer=createLexer,exports.getTokenDesc=getTokenDesc;var _error=require("../error"),SOF="",EOF="",BANG="!",DOLLAR="$",PAREN_L="(",PAREN_R=")",SPREAD="...",COLON=":",EQUALS="=",AT="@",BRACKET_L="[",BRACKET_R="]",BRACE_L="{",PIPE="|",BRACE_R="}",NAME="Name",INT="Int",FLOAT="Float",STRING="String",COMMENT="Comment",charCodeAt=(exports.TokenKind={SOF:SOF,EOF:EOF,BANG:BANG,DOLLAR:DOLLAR,PAREN_L:PAREN_L,PAREN_R:PAREN_R,SPREAD:SPREAD,COLON:COLON,EQUALS:EQUALS,AT:AT,BRACKET_L:BRACKET_L,BRACKET_R:BRACKET_R,BRACE_L:BRACE_L,PIPE:PIPE,BRACE_R:BRACE_R,NAME:NAME,INT:INT,FLOAT:FLOAT,STRING:STRING,COMMENT:COMMENT},String.prototype.charCodeAt),slice=String.prototype.slice;Tok.prototype.toJSON=Tok.prototype.inspect=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},{"../error":67}],86:[function(require,module,exports){"use strict";function getLocation(e,o){for(var t=/\r\n|[\n\r]/g,n=1,r=o+1,i=void 0;(i=t.exec(e.body))&&i.index0,e.name+" fields must be an object with field names as keys or a function which returns such an object.");var r={};return a.forEach(function(t){(0,_assertValidName.assertValidName)(t);var a=n[t];(0,_invariant2.default)(!a.hasOwnProperty("isDeprecated"),e.name+"."+t+' should provide "deprecationReason" instead of "isDeprecated".');var i=_extends({},a,{isDeprecated:Boolean(a.deprecationReason),name:t});(0,_invariant2.default)(isOutputType(i.type),e.name+"."+t+" field type must be Output Type but "+("got: "+String(i.type)+".")),(0,_invariant2.default)(isValidResolver(i.resolve),e.name+"."+t+" field resolver must be a function if "+("provided, but got: "+String(i.resolve)+"."));var s=a.args;s?((0,_invariant2.default)(isPlainObj(s),e.name+"."+t+" args must be an object with argument names as keys."),i.args=Object.keys(s).map(function(n){(0,_assertValidName.assertValidName)(n);var a=s[n];return(0,_invariant2.default)(isInputType(a.type),e.name+"."+t+"("+n+":) argument type must be "+("Input Type but got: "+String(a.type)+".")),{name:n,description:void 0===a.description?null:a.description,type:a.type,defaultValue:a.defaultValue}})):i.args=[],r[t]=i}),r}function isPlainObj(e){return e&&"object"==typeof e&&!Array.isArray(e)}function isValidResolver(e){return null==e||"function"==typeof e}function defineTypes(e,t){var n=resolveThunk(t);return(0,_invariant2.default)(Array.isArray(n)&&n.length>0,"Must provide Array of types or a function which returns "+("such an array for Union "+e.name+".")),n.forEach(function(t){(0,_invariant2.default)(t instanceof GraphQLObjectType,e.name+" may only contain Object types, it cannot contain: "+(String(t)+".")),"function"!=typeof e.resolveType&&(0,_invariant2.default)("function"==typeof t.isTypeOf,'Union type "'+e.name+'" does not provide a "resolveType" '+('function and possible type "'+t.name+'" does not provide an ')+'"isTypeOf" function. There is no way to resolve this possible type during execution.')}),n}function defineEnumValues(e,t){(0,_invariant2.default)(isPlainObj(t),e.name+" values must be an object with value names as keys.");var n=Object.keys(t);return(0,_invariant2.default)(n.length>0,e.name+" values must be an object with value names as keys."),n.map(function(n){(0,_assertValidName.assertValidName)(n);var a=t[n];return(0,_invariant2.default)(isPlainObj(a),e.name+"."+n+' must refer to an object with a "value" key '+("representing an internal value but got: "+String(a)+".")),(0,_invariant2.default)(!a.hasOwnProperty("isDeprecated"),e.name+"."+n+' should provide "deprecationReason" instead of "isDeprecated".'),{name:n,description:a.description,isDeprecated:Boolean(a.deprecationReason),deprecationReason:a.deprecationReason,value:(0,_isNullish2.default)(a.value)?n:a.value}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphQLNonNull=exports.GraphQLList=exports.GraphQLInputObjectType=exports.GraphQLEnumType=exports.GraphQLUnionType=exports.GraphQLInterfaceType=exports.GraphQLObjectType=exports.GraphQLScalarType=void 0;var _extends=Object.assign||function(e){for(var t=1;t0,this.name+" fields must be an object with field names as keys or a function which returns such an object.");var a={};return n.forEach(function(n){(0,_assertValidName.assertValidName)(n);var r=_extends({},t[n],{name:n});(0,_invariant2.default)(isInputType(r.type),e.name+"."+n+" field type must be Input Type but "+("got: "+String(r.type)+".")),(0,_invariant2.default)(null==r.resolve,e.name+"."+n+" field type has a resolve property, but Input Types cannot define resolvers."),a[n]=r}),a},e.prototype.toString=function(){return this.name},e}();GraphQLInputObjectType.prototype.toJSON=GraphQLInputObjectType.prototype.inspect=GraphQLInputObjectType.prototype.toString;var GraphQLList=exports.GraphQLList=function(){function e(t){_classCallCheck(this,e),(0,_invariant2.default)(isType(t),"Can only create List of a GraphQLType but got: "+String(t)+"."),this.ofType=t}return e.prototype.toString=function(){return"["+String(this.ofType)+"]"},e}();GraphQLList.prototype.toJSON=GraphQLList.prototype.inspect=GraphQLList.prototype.toString;var GraphQLNonNull=exports.GraphQLNonNull=function(){function e(t){_classCallCheck(this,e),(0,_invariant2.default)(isType(t)&&!(t instanceof e),"Can only create NonNull of a Nullable GraphQLType but got: "+(String(t)+".")),this.ofType=t}return e.prototype.toString=function(){return this.ofType.toString()+"!"},e}();GraphQLNonNull.prototype.toJSON=GraphQLNonNull.prototype.inspect=GraphQLNonNull.prototype.toString},{"../jsutils/invariant":76,"../jsutils/isNullish":78,"../language/kinds":84,"../utilities/assertValidName":98}],92:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.specifiedDirectives=exports.GraphQLDeprecatedDirective=exports.DEFAULT_DEPRECATION_REASON=exports.GraphQLSkipDirective=exports.GraphQLIncludeDirective=exports.GraphQLDirective=exports.DirectiveLocation=void 0;var _definition=require("./definition"),_scalars=require("./scalars"),_invariant=require("../jsutils/invariant"),_invariant2=_interopRequireDefault(_invariant),_assertValidName=require("../utilities/assertValidName"),DirectiveLocation=exports.DirectiveLocation={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"},GraphQLDirective=exports.GraphQLDirective=function e(i){_classCallCheck(this,e),(0,_invariant2.default)(i.name,"Directive must be named."),(0,_assertValidName.assertValidName)(i.name),(0,_invariant2.default)(Array.isArray(i.locations),"Must provide locations for directive."),this.name=i.name,this.description=i.description,this.locations=i.locations;var t=i.args;t?((0,_invariant2.default)(!Array.isArray(t),"@"+i.name+" args must be an object with argument names as keys."),this.args=Object.keys(t).map(function(e){(0,_assertValidName.assertValidName)(e);var r=t[e];return(0,_invariant2.default)((0,_definition.isInputType)(r.type),"@"+i.name+"("+e+":) argument type must be "+("Input Type but got: "+String(r.type)+".")),{name:e,description:void 0===r.description?null:r.description,type:r.type,defaultValue:r.defaultValue}})):this.args=[]},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.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Included when true."}}}),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.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Skipped when true."}}}),DEFAULT_DEPRECATION_REASON=exports.DEFAULT_DEPRECATION_REASON="No longer supported",GraphQLDeprecatedDirective=exports.GraphQLDeprecatedDirective=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[DirectiveLocation.FIELD_DEFINITION,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 in [Markdown](https://daringfireball.net/projects/markdown/).",defaultValue:DEFAULT_DEPRECATION_REASON}}});exports.specifiedDirectives=[GraphQLIncludeDirective,GraphQLSkipDirective,GraphQLDeprecatedDirective]},{"../jsutils/invariant":76,"../utilities/assertValidName":98,"./definition":91,"./scalars":95}],93:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _schema=require("./schema");Object.defineProperty(exports,"GraphQLSchema",{enumerable:!0,get:function(){return _schema.GraphQLSchema}});var _definition=require("./definition");Object.defineProperty(exports,"isType",{enumerable:!0,get:function(){return _definition.isType}}),Object.defineProperty(exports,"isInputType",{enumerable:!0,get:function(){return _definition.isInputType}}),Object.defineProperty(exports,"isOutputType",{enumerable:!0,get:function(){return _definition.isOutputType}}),Object.defineProperty(exports,"isLeafType",{enumerable:!0,get:function(){return _definition.isLeafType}}),Object.defineProperty(exports,"isCompositeType",{enumerable:!0,get:function(){return _definition.isCompositeType}}),Object.defineProperty(exports,"isAbstractType",{enumerable:!0,get:function(){return _definition.isAbstractType}}),Object.defineProperty(exports,"isNamedType",{enumerable:!0,get:function(){return _definition.isNamedType}}),Object.defineProperty(exports,"assertType",{enumerable:!0,get:function(){return _definition.assertType}}),Object.defineProperty(exports,"assertInputType",{enumerable:!0,get:function(){return _definition.assertInputType}}),Object.defineProperty(exports,"assertOutputType",{enumerable:!0,get:function(){return _definition.assertOutputType}}),Object.defineProperty(exports,"assertLeafType",{enumerable:!0,get:function(){return _definition.assertLeafType}}),Object.defineProperty(exports,"assertCompositeType",{enumerable:!0,get:function(){return _definition.assertCompositeType}}),Object.defineProperty(exports,"assertAbstractType",{enumerable:!0,get:function(){return _definition.assertAbstractType}}),Object.defineProperty(exports,"assertNamedType",{enumerable:!0,get:function(){return _definition.assertNamedType}}),Object.defineProperty(exports,"getNullableType",{enumerable:!0,get:function(){return _definition.getNullableType}}),Object.defineProperty(exports,"getNamedType",{enumerable:!0,get:function(){return _definition.getNamedType}}),Object.defineProperty(exports,"GraphQLScalarType",{enumerable:!0,get:function(){return _definition.GraphQLScalarType}}),Object.defineProperty(exports,"GraphQLObjectType",{enumerable:!0,get:function(){return _definition.GraphQLObjectType}}),Object.defineProperty(exports,"GraphQLInterfaceType",{enumerable:!0,get:function(){return _definition.GraphQLInterfaceType}}),Object.defineProperty(exports,"GraphQLUnionType",{enumerable:!0,get:function(){return _definition.GraphQLUnionType}}),Object.defineProperty(exports,"GraphQLEnumType",{enumerable:!0,get:function(){return _definition.GraphQLEnumType}}),Object.defineProperty(exports,"GraphQLInputObjectType",{enumerable:!0,get:function(){return _definition.GraphQLInputObjectType}}),Object.defineProperty(exports,"GraphQLList",{enumerable:!0,get:function(){return _definition.GraphQLList}}),Object.defineProperty(exports,"GraphQLNonNull",{enumerable:!0,get:function(){return _definition.GraphQLNonNull}});var _directives=require("./directives");Object.defineProperty(exports,"DirectiveLocation",{enumerable:!0,get:function(){return _directives.DirectiveLocation}}),Object.defineProperty(exports,"GraphQLDirective",{enumerable:!0,get:function(){return _directives.GraphQLDirective}}),Object.defineProperty(exports,"specifiedDirectives",{enumerable:!0,get:function(){return _directives.specifiedDirectives}}),Object.defineProperty(exports,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return _directives.GraphQLIncludeDirective}}),Object.defineProperty(exports,"GraphQLSkipDirective",{enumerable:!0,get:function(){return _directives.GraphQLSkipDirective}}),Object.defineProperty(exports,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return _directives.GraphQLDeprecatedDirective}}),Object.defineProperty(exports,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return _directives.DEFAULT_DEPRECATION_REASON}});var _scalars=require("./scalars");Object.defineProperty(exports,"GraphQLInt",{enumerable:!0,get:function(){return _scalars.GraphQLInt}}),Object.defineProperty(exports,"GraphQLFloat",{enumerable:!0,get:function(){return _scalars.GraphQLFloat}}),Object.defineProperty(exports,"GraphQLString",{enumerable:!0,get:function(){return _scalars.GraphQLString}}),Object.defineProperty(exports,"GraphQLBoolean",{enumerable:!0,get:function(){return _scalars.GraphQLBoolean}}),Object.defineProperty(exports,"GraphQLID",{enumerable:!0,get:function(){return _scalars.GraphQLID}});var _introspection=require("./introspection");Object.defineProperty(exports,"TypeKind",{enumerable:!0,get:function(){return _introspection.TypeKind}}),Object.defineProperty(exports,"__Schema",{enumerable:!0,get:function(){return _introspection.__Schema}}),Object.defineProperty(exports,"__Directive",{enumerable:!0,get:function(){return _introspection.__Directive}}),Object.defineProperty(exports,"__DirectiveLocation",{enumerable:!0,get:function(){return _introspection.__DirectiveLocation}}),Object.defineProperty(exports,"__Type",{enumerable:!0,get:function(){return _introspection.__Type}}),Object.defineProperty(exports,"__Field",{enumerable:!0,get:function(){return _introspection.__Field}}),Object.defineProperty(exports,"__InputValue",{enumerable:!0,get:function(){return _introspection.__InputValue}}),Object.defineProperty(exports,"__EnumValue",{enumerable:!0,get:function(){return _introspection.__EnumValue}}),Object.defineProperty(exports,"__TypeKind",{enumerable:!0,get:function(){return _introspection.__TypeKind}}),Object.defineProperty(exports,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return _introspection.SchemaMetaFieldDef}}),Object.defineProperty(exports,"TypeMetaFieldDef",{enumerable:!0,get:function(){return _introspection.TypeMetaFieldDef}}),Object.defineProperty(exports,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return _introspection.TypeNameMetaFieldDef}})},{"./definition":91,"./directives":92,"./introspection":94,"./scalars":95,"./schema":96}],94:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TypeNameMetaFieldDef=exports.TypeMetaFieldDef=exports.SchemaMetaFieldDef=exports.__TypeKind=exports.TypeKind=exports.__EnumValue=exports.__InputValue=exports.__Field=exports.__Type=exports.__DirectiveLocation=exports.__Directive=exports.__Schema=void 0;var _isInvalid=require("../jsutils/isInvalid"),_isInvalid2=_interopRequireDefault(_isInvalid),_astFromValue=require("../utilities/astFromValue"),_printer=require("../language/printer"),_definition=require("./definition"),_scalars=require("./scalars"),_directives=require("./directives"),__Schema=exports.__Schema=new _definition.GraphQLObjectType({name:"__Schema",isIntrospection:!0,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:function(){return{types:{description:"A list of all types supported by this server.",type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type))),resolve:function(e){var i=e.getTypeMap();return Object.keys(i).map(function(e){return i[e]})}},queryType:{description:"The type that query operations will be rooted at.",type:new _definition.GraphQLNonNull(__Type),resolve:function(e){return e.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:__Type,resolve:function(e){return e.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:__Type,resolve:function(e){return e.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Directive))),resolve:function(e){return e.getDirectives()}}}}}),__Directive=exports.__Directive=new _definition.GraphQLObjectType({name:"__Directive",isIntrospection:!0,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:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},locations:{type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__DirectiveLocation)))},args:{type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),resolve:function(e){return e.args||[]}},onOperation:{deprecationReason:"Use `locations`.",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return e.locations.indexOf(_directives.DirectiveLocation.QUERY)!==-1||e.locations.indexOf(_directives.DirectiveLocation.MUTATION)!==-1||e.locations.indexOf(_directives.DirectiveLocation.SUBSCRIPTION)!==-1}},onFragment:{deprecationReason:"Use `locations`.",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return e.locations.indexOf(_directives.DirectiveLocation.FRAGMENT_SPREAD)!==-1||e.locations.indexOf(_directives.DirectiveLocation.INLINE_FRAGMENT)!==-1||e.locations.indexOf(_directives.DirectiveLocation.FRAGMENT_DEFINITION)!==-1}},onField:{deprecationReason:"Use `locations`.",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return e.locations.indexOf(_directives.DirectiveLocation.FIELD)!==-1}}}}}),__DirectiveLocation=exports.__DirectiveLocation=new _definition.GraphQLEnumType({name:"__DirectiveLocation",isIntrospection:!0,description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:_directives.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:_directives.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:_directives.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:_directives.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:_directives.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:_directives.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:_directives.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},SCHEMA:{value:_directives.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:_directives.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:_directives.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:_directives.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:_directives.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:_directives.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:_directives.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:_directives.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:_directives.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:_directives.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:_directives.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),__Type=exports.__Type=new _definition.GraphQLObjectType({name:"__Type",isIntrospection:!0,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 and description, 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:function(){return{kind:{type:new _definition.GraphQLNonNull(__TypeKind),resolve:function(e){if(e instanceof _definition.GraphQLScalarType)return TypeKind.SCALAR;if(e instanceof _definition.GraphQLObjectType)return TypeKind.OBJECT;if(e instanceof _definition.GraphQLInterfaceType)return TypeKind.INTERFACE;if(e instanceof _definition.GraphQLUnionType)return TypeKind.UNION;if(e instanceof _definition.GraphQLEnumType)return TypeKind.ENUM;if(e instanceof _definition.GraphQLInputObjectType)return TypeKind.INPUT_OBJECT;if(e instanceof _definition.GraphQLList)return TypeKind.LIST;if(e instanceof _definition.GraphQLNonNull)return TypeKind.NON_NULL;throw new Error("Unknown kind of type: "+e)}},name:{type:_scalars.GraphQLString},description:{type:_scalars.GraphQLString},fields:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Field)),args:{includeDeprecated:{type:_scalars.GraphQLBoolean,defaultValue:!1}},resolve:function(e,i){var n=i.includeDeprecated;if(e instanceof _definition.GraphQLObjectType||e instanceof _definition.GraphQLInterfaceType){var t=function(){var i=e.getFields(),t=Object.keys(i).map(function(e){return i[e]});return n||(t=t.filter(function(e){return!e.deprecationReason})),{v:t}}();if("object"==typeof t)return t.v}return null}},interfaces:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),resolve:function(e){if(e instanceof _definition.GraphQLObjectType)return e.getInterfaces()}},possibleTypes:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),resolve:function(e,i,n,t){var a=t.schema;if(e instanceof _definition.GraphQLInterfaceType||e instanceof _definition.GraphQLUnionType)return a.getPossibleTypes(e)}},enumValues:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__EnumValue)),args:{includeDeprecated:{type:_scalars.GraphQLBoolean,defaultValue:!1}},resolve:function(e,i){var n=i.includeDeprecated;if(e instanceof _definition.GraphQLEnumType){var t=e.getValues();return n||(t=t.filter(function(e){return!e.deprecationReason})),t}}},inputFields:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue)),resolve:function(e){if(e instanceof _definition.GraphQLInputObjectType){var i=function(){var i=e.getFields();return{v:Object.keys(i).map(function(e){return i[e]})}}();if("object"==typeof i)return i.v}}},ofType:{type:__Type}}}}),__Field=exports.__Field=new _definition.GraphQLObjectType({name:"__Field",isIntrospection:!0,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:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},args:{type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),resolve:function(e){return e.args||[]}},type:{type:new _definition.GraphQLNonNull(__Type)},isDeprecated:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},deprecationReason:{type:_scalars.GraphQLString}}}}),__InputValue=exports.__InputValue=new _definition.GraphQLObjectType({name:"__InputValue",isIntrospection:!0,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:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},type:{type:new _definition.GraphQLNonNull(__Type)},defaultValue:{type:_scalars.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(e){return(0,_isInvalid2.default)(e.defaultValue)?null:(0,_printer.print)((0,_astFromValue.astFromValue)(e.defaultValue,e.type))}}}}}),__EnumValue=exports.__EnumValue=new _definition.GraphQLObjectType({name:"__EnumValue",isIntrospection:!0,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:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},isDeprecated:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},deprecationReason:{ type:_scalars.GraphQLString}}}}),TypeKind=exports.TypeKind={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},__TypeKind=exports.__TypeKind=new _definition.GraphQLEnumType({name:"__TypeKind",isIntrospection:!0,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` 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."}}});exports.SchemaMetaFieldDef={name:"__schema",type:new _definition.GraphQLNonNull(__Schema),description:"Access the current type schema of this server.",args:[],resolve:function(e,i,n,t){var a=t.schema;return a}},exports.TypeMetaFieldDef={name:"__type",type:__Type,description:"Request the type information of a single type.",args:[{name:"name",type:new _definition.GraphQLNonNull(_scalars.GraphQLString)}],resolve:function(e,i,n,t){var a=i.name,r=t.schema;return r.getType(a)}},exports.TypeNameMetaFieldDef={name:"__typename",type:new _definition.GraphQLNonNull(_scalars.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(e,i,n,t){var a=t.parentType;return a.name}}},{"../jsutils/isInvalid":77,"../language/printer":88,"../utilities/astFromValue":99,"./definition":91,"./directives":92,"./scalars":95}],95:[function(require,module,exports){"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r.default=e,r}function coerceInt(e){if(""===e)throw new TypeError("Int cannot represent non 32-bit signed integer value: (empty string)");var r=Number(e);if(r===r&&r<=MAX_INT&&r>=MIN_INT)return(r<0?Math.ceil:Math.floor)(r);throw new TypeError("Int cannot represent non 32-bit signed integer value: "+String(e))}function coerceFloat(e){if(""===e)throw new TypeError("Float cannot represent non numeric value: (empty string)");var r=Number(e);if(r===r)return r;throw new TypeError("Float cannot represent non numeric value: "+String(e))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphQLID=exports.GraphQLBoolean=exports.GraphQLString=exports.GraphQLFloat=exports.GraphQLInt=void 0;var _definition=require("./definition"),_kinds=require("../language/kinds"),Kind=_interopRequireWildcard(_kinds),MAX_INT=2147483647,MIN_INT=-2147483648;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:coerceInt,parseValue:coerceInt,parseLiteral:function(e){if(e.kind===Kind.INT){var r=parseInt(e.value,10);if(r<=MAX_INT&&r>=MIN_INT)return r}return null}}),exports.GraphQLFloat=new _definition.GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ",serialize:coerceFloat,parseValue:coerceFloat,parseLiteral:function(e){return e.kind===Kind.FLOAT||e.kind===Kind.INT?parseFloat(e.value):null}}),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:String,parseValue:String,parseLiteral:function(e){return e.kind===Kind.STRING?e.value:null}}),exports.GraphQLBoolean=new _definition.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Boolean,parseValue:Boolean,parseLiteral:function(e){return e.kind===Kind.BOOLEAN?e.value:null}}),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:String,parseValue:String,parseLiteral:function(e){return e.kind===Kind.STRING||e.kind===Kind.INT?e.value:null}})},{"../language/kinds":84,"./definition":91}],96:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function typeMapReducer(e,t){if(!t)return e;if(t instanceof _definition.GraphQLList||t instanceof _definition.GraphQLNonNull)return typeMapReducer(e,t.ofType);if(e[t.name])return(0,_invariant2.default)(e[t.name]===t,"Schema must contain unique named types but contains multiple "+('types named "'+t.name+'".')),e;e[t.name]=t;var i=e;return t instanceof _definition.GraphQLUnionType&&(i=t.getTypes().reduce(typeMapReducer,i)),t instanceof _definition.GraphQLObjectType&&(i=t.getInterfaces().reduce(typeMapReducer,i)),(t instanceof _definition.GraphQLObjectType||t instanceof _definition.GraphQLInterfaceType)&&!function(){var e=t.getFields();Object.keys(e).forEach(function(t){var n=e[t];if(n.args){var r=n.args.map(function(e){return e.type});i=r.reduce(typeMapReducer,i)}i=typeMapReducer(i,n.type)})}(),t instanceof _definition.GraphQLInputObjectType&&!function(){var e=t.getFields();Object.keys(e).forEach(function(t){var n=e[t];i=typeMapReducer(i,n.type)})}(),i}function assertObjectImplementsInterface(e,t,i){var n=t.getFields(),r=i.getFields();Object.keys(r).forEach(function(a){var p=n[a],o=r[a];(0,_invariant2.default)(p,'"'+i.name+'" expects field "'+a+'" but "'+t.name+'" does not provide it.'),(0,_invariant2.default)((0,_typeComparators.isTypeSubTypeOf)(e,p.type,o.type),i.name+"."+a+' expects type "'+String(o.type)+'" but '+(t.name+"."+a+' provides type "'+String(p.type)+'".')),o.args.forEach(function(e){var n=e.name,r=(0,_find2.default)(p.args,function(e){return e.name===n});(0,_invariant2.default)(r,i.name+"."+a+' expects argument "'+n+'" but '+(t.name+"."+a+" does not provide it.")),(0,_invariant2.default)((0,_typeComparators.isEqualType)(e.type,r.type),i.name+"."+a+"("+n+":) expects type "+('"'+String(e.type)+'" but ')+(t.name+"."+a+"("+n+":) provides type ")+('"'+String(r.type)+'".'))}),p.args.forEach(function(e){var n=e.name,r=(0,_find2.default)(o.args,function(e){return e.name===n});r||(0,_invariant2.default)(!(e.type instanceof _definition.GraphQLNonNull),t.name+"."+a+"("+n+":) is of required type "+('"'+String(e.type)+'" but is not also provided by the ')+("interface "+i.name+"."+a+"."))})})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphQLSchema=void 0;var _definition=require("./definition"),_directives=require("./directives"),_introspection=require("./introspection"),_find=require("../jsutils/find"),_find2=_interopRequireDefault(_find),_invariant=require("../jsutils/invariant"),_invariant2=_interopRequireDefault(_invariant),_typeComparators=require("../utilities/typeComparators");exports.GraphQLSchema=function(){function e(t){var i=this;_classCallCheck(this,e),(0,_invariant2.default)("object"==typeof t,"Must provide configuration object."),(0,_invariant2.default)(t.query instanceof _definition.GraphQLObjectType,"Schema query must be Object Type but got: "+String(t.query)+"."),this._queryType=t.query,(0,_invariant2.default)(!t.mutation||t.mutation instanceof _definition.GraphQLObjectType,"Schema mutation must be Object Type if provided but got: "+String(t.mutation)+"."),this._mutationType=t.mutation,(0,_invariant2.default)(!t.subscription||t.subscription instanceof _definition.GraphQLObjectType,"Schema subscription must be Object Type if provided but got: "+String(t.subscription)+"."),this._subscriptionType=t.subscription,(0,_invariant2.default)(!t.types||Array.isArray(t.types),"Schema types must be Array if provided but got: "+String(t.types)+"."),(0,_invariant2.default)(!t.directives||Array.isArray(t.directives)&&t.directives.every(function(e){return e instanceof _directives.GraphQLDirective}),"Schema directives must be Array if provided but got: "+String(t.directives)+"."),this._directives=t.directives||_directives.specifiedDirectives;var n=[this.getQueryType(),this.getMutationType(),this.getSubscriptionType(),_introspection.__Schema],r=t.types;r&&(n=n.concat(r)),this._typeMap=n.reduce(typeMapReducer,Object.create(null)),this._implementations=Object.create(null),Object.keys(this._typeMap).forEach(function(e){var t=i._typeMap[e];t instanceof _definition.GraphQLObjectType&&t.getInterfaces().forEach(function(e){var n=i._implementations[e.name];n?n.push(t):i._implementations[e.name]=[t]})}),Object.keys(this._typeMap).forEach(function(e){var t=i._typeMap[e];t instanceof _definition.GraphQLObjectType&&t.getInterfaces().forEach(function(e){return assertObjectImplementsInterface(i,t,e)})})}return e.prototype.getQueryType=function(){return this._queryType},e.prototype.getMutationType=function(){return this._mutationType},e.prototype.getSubscriptionType=function(){return this._subscriptionType},e.prototype.getTypeMap=function(){return this._typeMap},e.prototype.getType=function(e){return this.getTypeMap()[e]},e.prototype.getPossibleTypes=function(e){return e instanceof _definition.GraphQLUnionType?e.getTypes():((0,_invariant2.default)(e instanceof _definition.GraphQLInterfaceType),this._implementations[e.name])},e.prototype.isPossibleType=function(e,t){var i=this._possibleTypeMap;if(i||(this._possibleTypeMap=i=Object.create(null)),!i[e.name]){var n=this.getPossibleTypes(e);(0,_invariant2.default)(Array.isArray(n),"Could not find possible implementing types for "+e.name+" in schema. Check that schema.types is defined and is an array of all possible types in the schema."),i[e.name]=n.reduce(function(e,t){return e[t.name]=!0,e},Object.create(null))}return Boolean(i[e.name][t.name])},e.prototype.getDirectives=function(){return this._directives},e.prototype.getDirective=function(e){return(0,_find2.default)(this.getDirectives(),function(t){return t.name===e})},e}()},{"../jsutils/find":75,"../jsutils/invariant":76,"../utilities/typeComparators":113,"./definition":91,"./directives":92,"./introspection":94}],97:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function getFieldDef(e,t,i){var n=i.name.value;return n===_introspection.SchemaMetaFieldDef.name&&e.getQueryType()===t?_introspection.SchemaMetaFieldDef:n===_introspection.TypeMetaFieldDef.name&&e.getQueryType()===t?_introspection.TypeMetaFieldDef:n===_introspection.TypeNameMetaFieldDef.name&&(t instanceof _definition.GraphQLObjectType||t instanceof _definition.GraphQLInterfaceType||t instanceof _definition.GraphQLUnionType)?_introspection.TypeNameMetaFieldDef:t instanceof _definition.GraphQLObjectType||t instanceof _definition.GraphQLInterfaceType?t.getFields()[n]:void 0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TypeInfo=void 0;var _kinds=require("../language/kinds"),Kind=_interopRequireWildcard(_kinds),_definition=require("../type/definition"),_introspection=require("../type/introspection"),_typeFromAST=require("./typeFromAST"),_find=require("../jsutils/find"),_find2=_interopRequireDefault(_find);exports.TypeInfo=function(){function e(t,i){_classCallCheck(this,e),this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i||getFieldDef}return e.prototype.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},e.prototype.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},e.prototype.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},e.prototype.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},e.prototype.getDirective=function(){return this._directive},e.prototype.getArgument=function(){return this._argument},e.prototype.getEnumValue=function(){return this._enumValue},e.prototype.enter=function(e){var t=this._schema;switch(e.kind){case Kind.SELECTION_SET:var i=(0,_definition.getNamedType)(this.getType()),n=void 0;(0,_definition.isCompositeType)(i)&&(n=i),this._parentTypeStack.push(n);break;case Kind.FIELD:var a=this.getParentType(),p=void 0;a&&(p=this._getFieldDef(t,a,e)),this._fieldDefStack.push(p),this._typeStack.push(p&&p.type);break;case Kind.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case Kind.OPERATION_DEFINITION:var r=void 0;"query"===e.operation?r=t.getQueryType():"mutation"===e.operation?r=t.getMutationType():"subscription"===e.operation&&(r=t.getSubscriptionType()),this._typeStack.push(r);break;case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:var s=e.typeCondition,o=s?(0,_typeFromAST.typeFromAST)(t,s):this.getType();this._typeStack.push(o);break;case Kind.VARIABLE_DEFINITION:var c=(0,_typeFromAST.typeFromAST)(t,e.type);this._inputTypeStack.push(c);break;case Kind.ARGUMENT:var u=void 0,_=void 0,d=this.getDirective()||this.getFieldDef();d&&(u=(0,_find2.default)(d.args,function(t){return t.name===e.name.value}),u&&(_=u.type)),this._argument=u,this._inputTypeStack.push(_);break;case Kind.LIST:var h=(0,_definition.getNullableType)(this.getInputType());this._inputTypeStack.push(h instanceof _definition.GraphQLList?h.ofType:void 0);break;case Kind.OBJECT_FIELD:var f=(0,_definition.getNamedType)(this.getInputType()),y=void 0;if(f instanceof _definition.GraphQLInputObjectType){var T=f.getFields()[e.name.value];y=T?T.type:void 0}this._inputTypeStack.push(y);break;case Kind.ENUM:var l=(0,_definition.getNamedType)(this.getInputType()),k=void 0;l instanceof _definition.GraphQLEnumType&&(k=l.getValue(e.value)),this._enumValue=k}},e.prototype.leave=function(e){switch(e.kind){case Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Kind.DIRECTIVE:this._directive=null;break;case Kind.OPERATION_DEFINITION:case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Kind.ARGUMENT:this._argument=null,this._inputTypeStack.pop();break;case Kind.LIST:case Kind.OBJECT_FIELD:this._inputTypeStack.pop();break;case Kind.ENUM:this._enumValue=null}},e}()},{"../jsutils/find":75,"../language/kinds":84,"../type/definition":91,"../type/introspection":94,"./typeFromAST":114}],98:[function(require,module,exports){"use strict";function assertValidName(e,r){if(!e||"string"!=typeof e)throw new Error("Must be named. Unexpected name: "+e+".");if(!r&&"__"===e.slice(0,2)&&!hasWarnedAboutDunder&&(hasWarnedAboutDunder=!0,console&&console.error)){var t=new Error('Name "'+e+'" must not begin with "__", which is reserved by GraphQL introspection.');console.error(t.stack||String(t))}if(!NAME_RX.test(e))throw new Error('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'+e+'" does not.')}Object.defineProperty(exports,"__esModule",{value:!0}),exports.assertValidName=assertValidName;var NAME_RX=/^[_a-zA-Z][_a-zA-Z0-9]*$/,hasWarnedAboutDunder=!1},{}],99:[function(require,module,exports){"use strict";function _interopRequireDefault(i){return i&&i.__esModule?i:{default:i}}function astFromValue(i,e){var n=i;if(e instanceof _definition.GraphQLNonNull){var r=astFromValue(n,e.ofType);return r&&r.kind===_kinds.NULL?null:r}if(null===n)return{kind:_kinds.NULL};if((0,_isInvalid2.default)(n))return null;if(e instanceof _definition.GraphQLList){var t=function(){var i=e.ofType;if((0,_iterall.isCollection)(n)){var r=function(){var e=[];return(0,_iterall.forEach)(n,function(n){var r=astFromValue(n,i);r&&e.push(r)}),{v:{v:{kind:_kinds.LIST,values:e}}}}();if("object"==typeof r)return r.v}return{v:astFromValue(n,i)}}();if("object"==typeof t)return t.v}if(e instanceof _definition.GraphQLInputObjectType){var a=function(){if(null===n||"object"!=typeof n)return{v:null};var i=e.getFields(),r=[];return Object.keys(i).forEach(function(e){var t=i[e].type,a=astFromValue(n[e],t);a&&r.push({kind:_kinds.OBJECT_FIELD,name:{kind:_kinds.NAME,value:e},value:a})}),{v:{kind:_kinds.OBJECT,fields:r}}}();if("object"==typeof a)return a.v}(0,_invariant2.default)(e instanceof _definition.GraphQLScalarType||e instanceof _definition.GraphQLEnumType,"Must provide Input Type, cannot use: "+String(e));var u=e.serialize(n);if((0,_isNullish2.default)(u))return null;if("boolean"==typeof u)return{kind:_kinds.BOOLEAN,value:u};if("number"==typeof u){var l=String(u);return/^[0-9]+$/.test(l)?{kind:_kinds.INT,value:l}:{kind:_kinds.FLOAT,value:l}}if("string"==typeof u)return e instanceof _definition.GraphQLEnumType?{kind:_kinds.ENUM,value:u}:e===_scalars.GraphQLID&&/^[0-9]+$/.test(u)?{kind:_kinds.INT,value:u}:{kind:_kinds.STRING,value:JSON.stringify(u).slice(1,-1)};throw new TypeError("Cannot convert value to AST: "+String(u))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.astFromValue=astFromValue;var _iterall=require("iterall"),_invariant=require("../jsutils/invariant"),_invariant2=_interopRequireDefault(_invariant),_isNullish=require("../jsutils/isNullish"),_isNullish2=_interopRequireDefault(_isNullish),_isInvalid=require("../jsutils/isInvalid"),_isInvalid2=_interopRequireDefault(_isInvalid),_kinds=require("../language/kinds"),_definition=require("../type/definition"),_scalars=require("../type/scalars")},{"../jsutils/invariant":76,"../jsutils/isInvalid":77,"../jsutils/isNullish":78,"../language/kinds":84,"../type/definition":91,"../type/scalars":95,iterall:144}],100:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function buildWrappedType(e,n){if(n.kind===_kinds.LIST_TYPE)return new _definition.GraphQLList(buildWrappedType(e,n.type));if(n.kind===_kinds.NON_NULL_TYPE){var i=buildWrappedType(e,n.type);return(0,_invariant2.default)(!(i instanceof _definition.GraphQLNonNull),"No nesting nonnull."),new _definition.GraphQLNonNull(i)}return e}function getNamedTypeNode(e){for(var n=e;n.kind===_kinds.LIST_TYPE||n.kind===_kinds.NON_NULL_TYPE;)n=n.type;return n}function buildASTSchema(e){function n(e){return new _directives.GraphQLDirective({name:e.name.value,description:getDescription(e),locations:e.locations.map(function(e){return e.value}),args:e.arguments&&f(e.arguments)})}function i(e){var n=c(e.name.value);return(0,_invariant2.default)(n instanceof _definition.GraphQLObjectType,"AST must provide object type."),n}function r(e){var n=getNamedTypeNode(e).name.value,i=c(n);return buildWrappedType(i,e)}function t(e){var n=r(e);return(0,_invariant2.default)((0,_definition.isInputType)(n),"Expected Input type."),n}function a(e){var n=r(e);return(0,_invariant2.default)((0,_definition.isOutputType)(n),"Expected Output type."),n}function o(e){var n=r(e);return(0,_invariant2.default)(n instanceof _definition.GraphQLObjectType,"Expected Object type."),n}function u(e){var n=r(e);return(0,_invariant2.default)(n instanceof _definition.GraphQLInterfaceType,"Expected Interface type."),n}function c(e){if(L[e])return L[e];if(!I[e])throw new Error('Type "'+e+'" not found in document.');var n=s(I[e]);if(!n)throw new Error('Nothing constructed for "'+e+'".');return L[e]=n,n}function s(e){if(!e)throw new Error("def must be defined");switch(e.kind){case _kinds.OBJECT_TYPE_DEFINITION:return p(e);case _kinds.INTERFACE_TYPE_DEFINITION:return l(e);case _kinds.ENUM_TYPE_DEFINITION:return v(e);case _kinds.UNION_TYPE_DEFINITION:return m(e);case _kinds.SCALAR_TYPE_DEFINITION:return T(e);case _kinds.INPUT_OBJECT_TYPE_DEFINITION:return y(e);default:throw new Error('Type kind "'+e.kind+'" not supported.')}}function p(e){var n=e.name.value;return new _definition.GraphQLObjectType({name:n,description:getDescription(e),fields:function(){return d(e)},interfaces:function(){return _(e)}})}function d(e){return(0,_keyValMap2.default)(e.fields,function(e){return e.name.value},function(e){return{type:a(e.type),description:getDescription(e),args:f(e.arguments),deprecationReason:getDeprecationReason(e.directives)}})}function _(e){return e.interfaces&&e.interfaces.map(function(e){return u(e)})}function f(e){return(0,_keyValMap2.default)(e,function(e){return e.name.value},function(e){var n=t(e.type);return{type:n,description:getDescription(e),defaultValue:(0,_valueFromAST.valueFromAST)(e.defaultValue,n)}})}function l(e){var n=e.name.value;return new _definition.GraphQLInterfaceType({name:n,description:getDescription(e),fields:function(){return d(e)},resolveType:cannotExecuteSchema})}function v(e){var n=new _definition.GraphQLEnumType({name:e.name.value,description:getDescription(e),values:(0,_keyValMap2.default)(e.values,function(e){return e.name.value},function(e){return{description:getDescription(e),deprecationReason:getDeprecationReason(e.directives)}})});return n}function m(e){return new _definition.GraphQLUnionType({name:e.name.value,description:getDescription(e),types:e.types.map(function(e){return o(e)}),resolveType:cannotExecuteSchema})}function T(e){return new _definition.GraphQLScalarType({name:e.name.value,description:getDescription(e),serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function y(e){return new _definition.GraphQLInputObjectType({name:e.name.value,description:getDescription(e),fields:function(){return f(e.fields)}})}if(!e||e.kind!==_kinds.DOCUMENT)throw new Error("Must provide a document ast.");for(var h=void 0,E=[],I=Object.create(null),N=[],D=0;D1&&void 0!==arguments[1]?arguments[1]:"";return 0===n.length?"":n.every(function(n){return!n.description})?"("+n.map(printInputValue).join(", ")+")":"(\n"+n.map(function(n,i){return printDescription(n," "+e,!i)+" "+e+printInputValue(n)}).join("\n")+"\n"+e+")"}function printInputValue(n){var e=n.name+": "+String(n.type);return(0,_isInvalid2.default)(n.defaultValue)||(e+=" = "+(0,_printer.print)((0,_astFromValue.astFromValue)(n.defaultValue,n.type))),e}function printDirective(n){return printDescription(n)+"directive @"+n.name+printArgs(n.args)+" on "+n.locations.join(" | ")}function printDeprecated(n){var e=n.deprecationReason;return(0,_isNullish2.default)(e)?"":""===e||e===_directives.DEFAULT_DEPRECATION_REASON?" @deprecated":" @deprecated(reason: "+(0,_printer.print)((0,_astFromValue.astFromValue)(e,_scalars.GraphQLString))+")"}function printDescription(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!n.description)return"";for(var t=n.description.split("\n"),r=e&&!i?"\n":"",a=0;a0&&e.reportError(new _error.GraphQLError(badValueMessage(r.name.value,a.type,(0,_printer.print)(r.value),t),[r.value]))}return!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.badValueMessage=badValueMessage,exports.ArgumentsOfCorrectType=ArgumentsOfCorrectType;var _error=require("../../error"),_printer=require("../../language/printer"),_isValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":67,"../../language/printer":88,"../../utilities/isValidLiteralValue":110}],118:[function(require,module,exports){"use strict";function defaultForNonNullArgMessage(e,r,a){return'Variable "$'+e+'" of type "'+String(r)+'" is required and will not use the default value. '+('Perhaps you meant to use type "'+String(a)+'".')}function badValueForDefaultArgMessage(e,r,a,t){var i=t?"\n"+t.join("\n"):"";return'Variable "$'+e+'" of type "'+String(r)+'" has invalid '+("default value "+a+"."+i)}function DefaultValuesOfCorrectType(e){return{VariableDefinition:function(r){var a=r.variable.name.value,t=r.defaultValue,i=e.getInputType();if(i instanceof _definition.GraphQLNonNull&&t&&e.reportError(new _error.GraphQLError(defaultForNonNullArgMessage(a,i,i.ofType),[t])),i&&t){var l=(0,_isValidLiteralValue.isValidLiteralValue)(i,t);l&&l.length>0&&e.reportError(new _error.GraphQLError(badValueForDefaultArgMessage(a,i,(0,_printer.print)(t),l),[t]))}return!1},SelectionSet:function(){return!1},FragmentDefinition:function(){return!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultForNonNullArgMessage=defaultForNonNullArgMessage,exports.badValueForDefaultArgMessage=badValueForDefaultArgMessage,exports.DefaultValuesOfCorrectType=DefaultValuesOfCorrectType;var _error=require("../../error"),_printer=require("../../language/printer"),_definition=require("../../type/definition"),_isValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":67,"../../language/printer":88,"../../type/definition":91,"../../utilities/isValidLiteralValue":110}],119:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function undefinedFieldMessage(e,t,n,i){var r='Cannot query field "'+e+'" on type "'+t+'".';if(0!==n.length){var s=(0,_quotedOrList2.default)(n);r+=" Did you mean to use an inline fragment on "+s+"?"}else 0!==i.length&&(r+=" Did you mean "+(0,_quotedOrList2.default)(i)+"?");return r}function FieldsOnCorrectType(e){return{Field:function(t){var n=e.getParentType();if(n){var i=e.getFieldDef();if(!i){var r=e.getSchema(),s=t.name.value,u=getSuggestedTypeNames(r,n,s),o=0!==u.length?[]:getSuggestedFieldNames(r,n,s);e.reportError(new _error.GraphQLError(undefinedFieldMessage(s,n.name,u,o),[t]))}}}}}function getSuggestedTypeNames(e,t,n){if(t instanceof _definition.GraphQLInterfaceType||t instanceof _definition.GraphQLUnionType){var i=function(){var i=[],r=Object.create(null);e.getPossibleTypes(t).forEach(function(e){e.getFields()[n]&&(i.push(e.name),e.getInterfaces().forEach(function(e){e.getFields()[n]&&(r[e.name]=(r[e.name]||0)+1)}))});var s=Object.keys(r).sort(function(e,t){return r[t]-r[e]});return{v:s.concat(i)}}();if("object"==typeof i)return i.v}return[]}function getSuggestedFieldNames(e,t,n){if(t instanceof _definition.GraphQLObjectType||t instanceof _definition.GraphQLInterfaceType){var i=Object.keys(t.getFields());return(0,_suggestionList2.default)(n,i)}return[]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.undefinedFieldMessage=undefinedFieldMessage,exports.FieldsOnCorrectType=FieldsOnCorrectType;var _error=require("../../error"),_suggestionList=require("../../jsutils/suggestionList"),_suggestionList2=_interopRequireDefault(_suggestionList),_quotedOrList=require("../../jsutils/quotedOrList"),_quotedOrList2=_interopRequireDefault(_quotedOrList),_definition=require("../../type/definition")},{"../../error":67,"../../jsutils/quotedOrList":81,"../../jsutils/suggestionList":82,"../../type/definition":91}],120:[function(require,module,exports){"use strict";function inlineFragmentOnNonCompositeErrorMessage(e){return'Fragment cannot condition on non composite type "'+String(e)+'".'}function fragmentOnNonCompositeErrorMessage(e,n){return'Fragment "'+e+'" cannot condition on non composite '+('type "'+String(n)+'".')}function FragmentsOnCompositeTypes(e){return{InlineFragment:function(n){var r=e.getType();n.typeCondition&&r&&!(0,_definition.isCompositeType)(r)&&e.reportError(new _error.GraphQLError(inlineFragmentOnNonCompositeErrorMessage((0,_printer.print)(n.typeCondition)),[n.typeCondition]))},FragmentDefinition:function(n){var r=e.getType();r&&!(0,_definition.isCompositeType)(r)&&e.reportError(new _error.GraphQLError(fragmentOnNonCompositeErrorMessage(n.name.value,(0,_printer.print)(n.typeCondition)),[n.typeCondition]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.inlineFragmentOnNonCompositeErrorMessage=inlineFragmentOnNonCompositeErrorMessage,exports.fragmentOnNonCompositeErrorMessage=fragmentOnNonCompositeErrorMessage,exports.FragmentsOnCompositeTypes=FragmentsOnCompositeTypes;var _error=require("../../error"),_printer=require("../../language/printer"),_definition=require("../../type/definition")},{"../../error":67,"../../language/printer":88,"../../type/definition":91}],121:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function unknownArgMessage(e,n,r,t){var i='Unknown argument "'+e+'" on field "'+n+'" of '+('type "'+String(r)+'".');return t.length&&(i+=" Did you mean "+(0,_quotedOrList2.default)(t)+"?"),i}function unknownDirectiveArgMessage(e,n,r){var t='Unknown argument "'+e+'" on directive "@'+n+'".';return r.length&&(t+=" Did you mean "+(0,_quotedOrList2.default)(r)+"?"),t}function KnownArgumentNames(e){return{Argument:function(n,r,t,i,u){var a=u[u.length-1];if(a.kind===_kinds.FIELD){var s=e.getFieldDef();if(s){var o=(0,_find2.default)(s.args,function(e){return e.name===n.name.value});if(!o){var g=e.getParentType();(0,_invariant2.default)(g),e.reportError(new _error.GraphQLError(unknownArgMessage(n.name.value,s.name,g.name,(0,_suggestionList2.default)(n.name.value,s.args.map(function(e){return e.name}))),[n]))}}}else if(a.kind===_kinds.DIRECTIVE){var f=e.getDirective();if(f){var d=(0,_find2.default)(f.args,function(e){return e.name===n.name.value});d||e.reportError(new _error.GraphQLError(unknownDirectiveArgMessage(n.name.value,f.name,(0,_suggestionList2.default)(n.name.value,f.args.map(function(e){return e.name}))),[n]))}}}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownArgMessage=unknownArgMessage,exports.unknownDirectiveArgMessage=unknownDirectiveArgMessage,exports.KnownArgumentNames=KnownArgumentNames;var _error=require("../../error"),_find=require("../../jsutils/find"),_find2=_interopRequireDefault(_find),_invariant=require("../../jsutils/invariant"),_invariant2=_interopRequireDefault(_invariant),_suggestionList=require("../../jsutils/suggestionList"),_suggestionList2=_interopRequireDefault(_suggestionList),_quotedOrList=require("../../jsutils/quotedOrList"),_quotedOrList2=_interopRequireDefault(_quotedOrList),_kinds=require("../../language/kinds")},{"../../error":67,"../../jsutils/find":75,"../../jsutils/invariant":76,"../../jsutils/quotedOrList":81,"../../jsutils/suggestionList":82,"../../language/kinds":84}],122:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function unknownDirectiveMessage(e){return'Unknown directive "'+e+'".'}function misplacedDirectiveMessage(e,i){return'Directive "'+e+'" may not be used on '+i+"."}function KnownDirectives(e){return{Directive:function(i,r,t,n,c){var s=(0,_find2.default)(e.getSchema().getDirectives(),function(e){return e.name===i.name.value});if(!s)return void e.reportError(new _error.GraphQLError(unknownDirectiveMessage(i.name.value),[i]));var o=getDirectiveLocationForASTPath(c);o?s.locations.indexOf(o)===-1&&e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(i.name.value,o),[i])):e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(i.name.value,i.type),[i]))}}}function getDirectiveLocationForASTPath(e){var i=e[e.length-1];switch(i.kind){case _kinds.OPERATION_DEFINITION:switch(i.operation){case"query":return _directives.DirectiveLocation.QUERY;case"mutation":return _directives.DirectiveLocation.MUTATION;case"subscription":return _directives.DirectiveLocation.SUBSCRIPTION}break;case _kinds.FIELD:return _directives.DirectiveLocation.FIELD;case _kinds.FRAGMENT_SPREAD:return _directives.DirectiveLocation.FRAGMENT_SPREAD;case _kinds.INLINE_FRAGMENT:return _directives.DirectiveLocation.INLINE_FRAGMENT;case _kinds.FRAGMENT_DEFINITION:return _directives.DirectiveLocation.FRAGMENT_DEFINITION;case _kinds.SCHEMA_DEFINITION:return _directives.DirectiveLocation.SCHEMA;case _kinds.SCALAR_TYPE_DEFINITION:return _directives.DirectiveLocation.SCALAR;case _kinds.OBJECT_TYPE_DEFINITION:return _directives.DirectiveLocation.OBJECT;case _kinds.FIELD_DEFINITION:return _directives.DirectiveLocation.FIELD_DEFINITION;case _kinds.INTERFACE_TYPE_DEFINITION:return _directives.DirectiveLocation.INTERFACE;case _kinds.UNION_TYPE_DEFINITION:return _directives.DirectiveLocation.UNION;case _kinds.ENUM_TYPE_DEFINITION:return _directives.DirectiveLocation.ENUM;case _kinds.ENUM_VALUE_DEFINITION:return _directives.DirectiveLocation.ENUM_VALUE;case _kinds.INPUT_OBJECT_TYPE_DEFINITION:return _directives.DirectiveLocation.INPUT_OBJECT;case _kinds.INPUT_VALUE_DEFINITION:var r=e[e.length-3];return r.kind===_kinds.INPUT_OBJECT_TYPE_DEFINITION?_directives.DirectiveLocation.INPUT_FIELD_DEFINITION:_directives.DirectiveLocation.ARGUMENT_DEFINITION}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownDirectiveMessage=unknownDirectiveMessage,exports.misplacedDirectiveMessage=misplacedDirectiveMessage,exports.KnownDirectives=KnownDirectives;var _error=require("../../error"),_find=require("../../jsutils/find"),_find2=_interopRequireDefault(_find),_kinds=require("../../language/kinds"),_directives=require("../../type/directives")},{"../../error":67,"../../jsutils/find":75,"../../language/kinds":84,"../../type/directives":92}],123:[function(require,module,exports){"use strict";function unknownFragmentMessage(e){return'Unknown fragment "'+e+'".'}function KnownFragmentNames(e){return{FragmentSpread:function(n){var r=n.name.value,a=e.getFragment(r);a||e.reportError(new _error.GraphQLError(unknownFragmentMessage(r),[n.name]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownFragmentMessage=unknownFragmentMessage,exports.KnownFragmentNames=KnownFragmentNames;var _error=require("../../error")},{"../../error":67}],124:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function unknownTypeMessage(e,n){var t='Unknown type "'+String(e)+'".';return n.length&&(t+=" Did you mean "+(0,_quotedOrList2.default)(n)+"?"),t}function KnownTypeNames(e){return{ObjectTypeDefinition:function(){return!1},InterfaceTypeDefinition:function(){return!1},UnionTypeDefinition:function(){return!1},InputObjectTypeDefinition:function(){return!1},NamedType:function(n){var t=e.getSchema(),r=n.name.value,i=t.getType(r);i||e.reportError(new _error.GraphQLError(unknownTypeMessage(r,(0,_suggestionList2.default)(r,Object.keys(t.getTypeMap()))),[n]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownTypeMessage=unknownTypeMessage,exports.KnownTypeNames=KnownTypeNames;var _error=require("../../error"),_suggestionList=require("../../jsutils/suggestionList"),_suggestionList2=_interopRequireDefault(_suggestionList),_quotedOrList=require("../../jsutils/quotedOrList"),_quotedOrList2=_interopRequireDefault(_quotedOrList)},{"../../error":67,"../../jsutils/quotedOrList":81,"../../jsutils/suggestionList":82}],125:[function(require,module,exports){"use strict";function anonOperationNotAloneMessage(){return"This anonymous operation must be the only defined operation."}function LoneAnonymousOperation(n){var e=0;return{Document:function(n){e=n.definitions.filter(function(n){return n.kind===_kinds.OPERATION_DEFINITION}).length},OperationDefinition:function(o){!o.name&&e>1&&n.reportError(new _error.GraphQLError(anonOperationNotAloneMessage(),[o]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.anonOperationNotAloneMessage=anonOperationNotAloneMessage,exports.LoneAnonymousOperation=LoneAnonymousOperation;var _error=require("../../error"),_kinds=require("../../language/kinds")},{"../../error":67,"../../language/kinds":84}],126:[function(require,module,exports){"use strict";function cycleErrorMessage(e,r){var n=r.length?" via "+r.join(", "):"";return'Cannot spread fragment "'+e+'" within itself'+n+"."}function NoFragmentCycles(e){function r(o){var i=o.name.value;n[i]=!0;var c=e.getFragmentSpreads(o.selectionSet);if(0!==c.length){a[i]=t.length;for(var l=0;l1)for(var l=0;l0)return[[n,e.map(function(e){var n=e[0];return n})],e.reduce(function(e,n){var t=n[1];return e.concat(t)},[t]),e.reduce(function(e,n){var t=n[2];return e.concat(t)},[i])]}function _pairSetAdd(e,n,t,i){var r=e[n];r||(r=Object.create(null),e[n]=r),r[t]=i}Object.defineProperty(exports,"__esModule",{value:!0}),exports.fieldsConflictMessage=fieldsConflictMessage,exports.OverlappingFieldsCanBeMerged=OverlappingFieldsCanBeMerged;var _error=require("../../error"),_find=require("../../jsutils/find"),_find2=_interopRequireDefault(_find),_kinds=require("../../language/kinds"),_printer=require("../../language/printer"),_definition=require("../../type/definition"),_typeFromAST=require("../../utilities/typeFromAST"),PairSet=function(){function e(){_classCallCheck(this,e),this._data=Object.create(null)}return e.prototype.has=function(e,n,t){var i=this._data[e],r=i&&i[n];return void 0!==r&&(t!==!1||r===!1)},e.prototype.add=function(e,n,t){_pairSetAdd(this._data,e,n,t),_pairSetAdd(this._data,n,e,t)},e}()},{"../../error":67,"../../jsutils/find":75,"../../language/kinds":84,"../../language/printer":88,"../../type/definition":91,"../../utilities/typeFromAST":114}],131:[function(require,module,exports){"use strict";function typeIncompatibleSpreadMessage(e,r,t){return'Fragment "'+e+'" cannot be spread here as objects of '+('type "'+String(r)+'" can never be of type "'+String(t)+'".')}function typeIncompatibleAnonSpreadMessage(e,r){return"Fragment cannot be spread here as objects of "+('type "'+String(e)+'" can never be of type "'+String(r)+'".')}function PossibleFragmentSpreads(e){return{InlineFragment:function(r){var t=e.getType(),a=e.getParentType();t&&a&&!(0,_typeComparators.doTypesOverlap)(e.getSchema(),t,a)&&e.reportError(new _error.GraphQLError(typeIncompatibleAnonSpreadMessage(a,t),[r]))},FragmentSpread:function(r){var t=r.name.value,a=getFragmentType(e,t),p=e.getParentType();a&&p&&!(0,_typeComparators.doTypesOverlap)(e.getSchema(),a,p)&&e.reportError(new _error.GraphQLError(typeIncompatibleSpreadMessage(t,p,a),[r]))}}}function getFragmentType(e,r){var t=e.getFragment(r);return t&&(0,_typeFromAST.typeFromAST)(e.getSchema(),t.typeCondition)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.typeIncompatibleSpreadMessage=typeIncompatibleSpreadMessage,exports.typeIncompatibleAnonSpreadMessage=typeIncompatibleAnonSpreadMessage,exports.PossibleFragmentSpreads=PossibleFragmentSpreads;var _error=require("../../error"),_typeComparators=require("../../utilities/typeComparators"),_typeFromAST=require("../../utilities/typeFromAST")},{"../../error":67,"../../utilities/typeComparators":113,"../../utilities/typeFromAST":114}],132:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function missingFieldArgMessage(e,r,i){return'Field "'+e+'" argument "'+r+'" of type '+('"'+String(i)+'" is required but not provided.')}function missingDirectiveArgMessage(e,r,i){return'Directive "@'+e+'" argument "'+r+'" of type '+('"'+String(i)+'" is required but not provided.')}function ProvidedNonNullArguments(e){return{Field:{leave:function(r){var i=e.getFieldDef();if(!i)return!1;var n=r.arguments||[],t=(0,_keyMap2.default)(n,function(e){return e.name.value});i.args.forEach(function(i){var n=t[i.name];!n&&i.type instanceof _definition.GraphQLNonNull&&e.reportError(new _error.GraphQLError(missingFieldArgMessage(r.name.value,i.name,i.type),[r]))})}},Directive:{leave:function(r){var i=e.getDirective();if(!i)return!1;var n=r.arguments||[],t=(0,_keyMap2.default)(n,function(e){return e.name.value});i.args.forEach(function(i){var n=t[i.name];!n&&i.type instanceof _definition.GraphQLNonNull&&e.reportError(new _error.GraphQLError(missingDirectiveArgMessage(r.name.value,i.name,i.type),[r]))})}}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.missingFieldArgMessage=missingFieldArgMessage,exports.missingDirectiveArgMessage=missingDirectiveArgMessage,exports.ProvidedNonNullArguments=ProvidedNonNullArguments;var _error=require("../../error"),_keyMap=require("../../jsutils/keyMap"),_keyMap2=_interopRequireDefault(_keyMap),_definition=require("../../type/definition")},{"../../error":67,"../../jsutils/keyMap":79,"../../type/definition":91}],133:[function(require,module,exports){"use strict";function noSubselectionAllowedMessage(e,r){return'Field "'+e+'" must not have a selection since '+('type "'+String(r)+'" has no subfields.')}function requiredSubselectionMessage(e,r){return'Field "'+e+'" of type "'+String(r)+'" must have a '+('selection of subfields. Did you mean "'+e+' { ... }"?')}function ScalarLeafs(e){return{Field:function(r){var o=e.getType();o&&((0,_definition.isLeafType)(o)?r.selectionSet&&e.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(r.name.value,o),[r.selectionSet])):r.selectionSet||e.reportError(new _error.GraphQLError(requiredSubselectionMessage(r.name.value,o),[r])))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.noSubselectionAllowedMessage=noSubselectionAllowedMessage,exports.requiredSubselectionMessage=requiredSubselectionMessage,exports.ScalarLeafs=ScalarLeafs;var _error=require("../../error"),_definition=require("../../type/definition"); },{"../../error":67,"../../type/definition":91}],134:[function(require,module,exports){"use strict";function duplicateArgMessage(e){return'There can be only one argument named "'+e+'".'}function UniqueArgumentNames(e){var r=Object.create(null);return{Field:function(){r=Object.create(null)},Directive:function(){r=Object.create(null)},Argument:function(n){var t=n.name.value;return r[t]?e.reportError(new _error.GraphQLError(duplicateArgMessage(t),[r[t],n.name])):r[t]=n.name,!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateArgMessage=duplicateArgMessage,exports.UniqueArgumentNames=UniqueArgumentNames;var _error=require("../../error")},{"../../error":67}],135:[function(require,module,exports){"use strict";function duplicateDirectiveMessage(e){return'The directive "'+e+'" can only be used once at this location.'}function UniqueDirectivesPerLocation(e){return{enter:function(r){r.directives&&!function(){var i=Object.create(null);r.directives.forEach(function(r){var t=r.name.value;i[t]?e.reportError(new _error.GraphQLError(duplicateDirectiveMessage(t),[i[t],r])):i[t]=r})}()}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateDirectiveMessage=duplicateDirectiveMessage,exports.UniqueDirectivesPerLocation=UniqueDirectivesPerLocation;var _error=require("../../error")},{"../../error":67}],136:[function(require,module,exports){"use strict";function duplicateFragmentNameMessage(e){return'There can only be one fragment named "'+e+'".'}function UniqueFragmentNames(e){var r=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(n){var a=n.name.value;return r[a]?e.reportError(new _error.GraphQLError(duplicateFragmentNameMessage(a),[r[a],n.name])):r[a]=n.name,!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateFragmentNameMessage=duplicateFragmentNameMessage,exports.UniqueFragmentNames=UniqueFragmentNames;var _error=require("../../error")},{"../../error":67}],137:[function(require,module,exports){"use strict";function duplicateInputFieldMessage(e){return'There can be only one input field named "'+e+'".'}function UniqueInputFieldNames(e){var r=[],n=Object.create(null);return{ObjectValue:{enter:function(){r.push(n),n=Object.create(null)},leave:function(){n=r.pop()}},ObjectField:function(r){var t=r.name.value;return n[t]?e.reportError(new _error.GraphQLError(duplicateInputFieldMessage(t),[n[t],r.name])):n[t]=r.name,!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateInputFieldMessage=duplicateInputFieldMessage,exports.UniqueInputFieldNames=UniqueInputFieldNames;var _error=require("../../error")},{"../../error":67}],138:[function(require,module,exports){"use strict";function duplicateOperationNameMessage(e){return'There can only be one operation named "'+e+'".'}function UniqueOperationNames(e){var r=Object.create(null);return{OperationDefinition:function(a){var n=a.name;return n&&(r[n.value]?e.reportError(new _error.GraphQLError(duplicateOperationNameMessage(n.value),[r[n.value],n])):r[n.value]=n),!1},FragmentDefinition:function(){return!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateOperationNameMessage=duplicateOperationNameMessage,exports.UniqueOperationNames=UniqueOperationNames;var _error=require("../../error")},{"../../error":67}],139:[function(require,module,exports){"use strict";function duplicateVariableMessage(e){return'There can be only one variable named "'+e+'".'}function UniqueVariableNames(e){var a=Object.create(null);return{OperationDefinition:function(){a=Object.create(null)},VariableDefinition:function(r){var i=r.variable.name.value;a[i]?e.reportError(new _error.GraphQLError(duplicateVariableMessage(i),[a[i],r.variable.name])):a[i]=r.variable.name}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateVariableMessage=duplicateVariableMessage,exports.UniqueVariableNames=UniqueVariableNames;var _error=require("../../error")},{"../../error":67}],140:[function(require,module,exports){"use strict";function nonInputTypeOnVarMessage(e,r){return'Variable "$'+e+'" cannot be non-input type "'+r+'".'}function VariablesAreInputTypes(e){return{VariableDefinition:function(r){var n=(0,_typeFromAST.typeFromAST)(e.getSchema(),r.type);if(n&&!(0,_definition.isInputType)(n)){var t=r.variable.name.value;e.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(t,(0,_printer.print)(r.type)),[r.type]))}}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.nonInputTypeOnVarMessage=nonInputTypeOnVarMessage,exports.VariablesAreInputTypes=VariablesAreInputTypes;var _error=require("../../error"),_printer=require("../../language/printer"),_definition=require("../../type/definition"),_typeFromAST=require("../../utilities/typeFromAST")},{"../../error":67,"../../language/printer":88,"../../type/definition":91,"../../utilities/typeFromAST":114}],141:[function(require,module,exports){"use strict";function badVarPosMessage(e,r,i){return'Variable "$'+e+'" of type "'+String(r)+'" used in '+('position expecting type "'+String(i)+'".')}function VariablesInAllowedPosition(e){var r=Object.create(null);return{OperationDefinition:{enter:function(){r=Object.create(null)},leave:function(i){var t=e.getRecursiveVariableUsages(i);t.forEach(function(i){var t=i.node,o=i.type,a=t.name.value,n=r[a];if(n&&o){var s=e.getSchema(),l=(0,_typeFromAST.typeFromAST)(s,n.type);l&&!(0,_typeComparators.isTypeSubTypeOf)(s,effectiveType(l,n),o)&&e.reportError(new _error.GraphQLError(badVarPosMessage(a,l,o),[n,t]))}})}},VariableDefinition:function(e){r[e.variable.name.value]=e}}}function effectiveType(e,r){return!r.defaultValue||e instanceof _definition.GraphQLNonNull?e:new _definition.GraphQLNonNull(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.badVarPosMessage=badVarPosMessage,exports.VariablesInAllowedPosition=VariablesInAllowedPosition;var _error=require("../../error"),_definition=require("../../type/definition"),_typeComparators=require("../../utilities/typeComparators"),_typeFromAST=require("../../utilities/typeFromAST")},{"../../error":67,"../../type/definition":91,"../../utilities/typeComparators":113,"../../utilities/typeFromAST":114}],142:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.specifiedRules=void 0;var _UniqueOperationNames=require("./rules/UniqueOperationNames"),_LoneAnonymousOperation=require("./rules/LoneAnonymousOperation"),_KnownTypeNames=require("./rules/KnownTypeNames"),_FragmentsOnCompositeTypes=require("./rules/FragmentsOnCompositeTypes"),_VariablesAreInputTypes=require("./rules/VariablesAreInputTypes"),_ScalarLeafs=require("./rules/ScalarLeafs"),_FieldsOnCorrectType=require("./rules/FieldsOnCorrectType"),_UniqueFragmentNames=require("./rules/UniqueFragmentNames"),_KnownFragmentNames=require("./rules/KnownFragmentNames"),_NoUnusedFragments=require("./rules/NoUnusedFragments"),_PossibleFragmentSpreads=require("./rules/PossibleFragmentSpreads"),_NoFragmentCycles=require("./rules/NoFragmentCycles"),_UniqueVariableNames=require("./rules/UniqueVariableNames"),_NoUndefinedVariables=require("./rules/NoUndefinedVariables"),_NoUnusedVariables=require("./rules/NoUnusedVariables"),_KnownDirectives=require("./rules/KnownDirectives"),_UniqueDirectivesPerLocation=require("./rules/UniqueDirectivesPerLocation"),_KnownArgumentNames=require("./rules/KnownArgumentNames"),_UniqueArgumentNames=require("./rules/UniqueArgumentNames"),_ArgumentsOfCorrectType=require("./rules/ArgumentsOfCorrectType"),_ProvidedNonNullArguments=require("./rules/ProvidedNonNullArguments"),_DefaultValuesOfCorrectType=require("./rules/DefaultValuesOfCorrectType"),_VariablesInAllowedPosition=require("./rules/VariablesInAllowedPosition"),_OverlappingFieldsCanBeMerged=require("./rules/OverlappingFieldsCanBeMerged"),_UniqueInputFieldNames=require("./rules/UniqueInputFieldNames");exports.specifiedRules=[_UniqueOperationNames.UniqueOperationNames,_LoneAnonymousOperation.LoneAnonymousOperation,_KnownTypeNames.KnownTypeNames,_FragmentsOnCompositeTypes.FragmentsOnCompositeTypes,_VariablesAreInputTypes.VariablesAreInputTypes,_ScalarLeafs.ScalarLeafs,_FieldsOnCorrectType.FieldsOnCorrectType,_UniqueFragmentNames.UniqueFragmentNames,_KnownFragmentNames.KnownFragmentNames,_NoUnusedFragments.NoUnusedFragments,_PossibleFragmentSpreads.PossibleFragmentSpreads,_NoFragmentCycles.NoFragmentCycles,_UniqueVariableNames.UniqueVariableNames,_NoUndefinedVariables.NoUndefinedVariables,_NoUnusedVariables.NoUnusedVariables,_KnownDirectives.KnownDirectives,_UniqueDirectivesPerLocation.UniqueDirectivesPerLocation,_KnownArgumentNames.KnownArgumentNames,_UniqueArgumentNames.UniqueArgumentNames,_ArgumentsOfCorrectType.ArgumentsOfCorrectType,_ProvidedNonNullArguments.ProvidedNonNullArguments,_DefaultValuesOfCorrectType.DefaultValuesOfCorrectType,_VariablesInAllowedPosition.VariablesInAllowedPosition,_OverlappingFieldsCanBeMerged.OverlappingFieldsCanBeMerged,_UniqueInputFieldNames.UniqueInputFieldNames]},{"./rules/ArgumentsOfCorrectType":117,"./rules/DefaultValuesOfCorrectType":118,"./rules/FieldsOnCorrectType":119,"./rules/FragmentsOnCompositeTypes":120,"./rules/KnownArgumentNames":121,"./rules/KnownDirectives":122,"./rules/KnownFragmentNames":123,"./rules/KnownTypeNames":124,"./rules/LoneAnonymousOperation":125,"./rules/NoFragmentCycles":126,"./rules/NoUndefinedVariables":127,"./rules/NoUnusedFragments":128,"./rules/NoUnusedVariables":129,"./rules/OverlappingFieldsCanBeMerged":130,"./rules/PossibleFragmentSpreads":131,"./rules/ProvidedNonNullArguments":132,"./rules/ScalarLeafs":133,"./rules/UniqueArgumentNames":134,"./rules/UniqueDirectivesPerLocation":135,"./rules/UniqueFragmentNames":136,"./rules/UniqueInputFieldNames":137,"./rules/UniqueOperationNames":138,"./rules/UniqueVariableNames":139,"./rules/VariablesAreInputTypes":140,"./rules/VariablesInAllowedPosition":141}],143:[function(require,module,exports){"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function validate(e,t,r){(0,_invariant2.default)(e,"Must provide schema"),(0,_invariant2.default)(t,"Must provide document"),(0,_invariant2.default)(e instanceof _schema.GraphQLSchema,"Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory.");var i=new _TypeInfo.TypeInfo(e);return visitUsingRules(e,i,t,r||_specifiedRules.specifiedRules)}function visitUsingRules(e,t,r,i){var n=new ValidationContext(e,r,t),s=i.map(function(e){return e(n)});return(0,_visitor.visit)(r,(0,_visitor.visitWithTypeInfo)(t,(0,_visitor.visitInParallel)(s))),n.getErrors()}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ValidationContext=void 0,exports.validate=validate,exports.visitUsingRules=visitUsingRules;var _invariant=require("../jsutils/invariant"),_invariant2=_interopRequireDefault(_invariant),_visitor=(require("../error"),require("../language/visitor")),_kinds=require("../language/kinds"),Kind=_interopRequireWildcard(_kinds),_schema=require("../type/schema"),_TypeInfo=require("../utilities/TypeInfo"),_specifiedRules=require("./specifiedRules"),ValidationContext=exports.ValidationContext=function(){function e(t,r,i){_classCallCheck(this,e),this._schema=t,this._ast=r,this._typeInfo=i,this._errors=[],this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}return e.prototype.reportError=function(e){this._errors.push(e)},e.prototype.getErrors=function(){return this._errors},e.prototype.getSchema=function(){return this._schema},e.prototype.getDocument=function(){return this._ast},e.prototype.getFragment=function(e){var t=this._fragments;return t||(this._fragments=t=this.getDocument().definitions.reduce(function(e,t){return t.kind===Kind.FRAGMENT_DEFINITION&&(e[t.name.value]=t),e},{})),t[e]},e.prototype.getFragmentSpreads=function(e){var t=this._fragmentSpreads.get(e);if(!t){t=[];for(var r=[e];0!==r.length;)for(var i=r.pop(),n=0;n=0&&r%1===0}function isCollection(t){return Object(t)===t&&(isArrayLike(t)||isIterable(t))}function getIterator(t){var r=getIteratorMethod(t);if(r)return r.call(t)}function getIteratorMethod(t){if(null!=t){var r=SYMBOL_ITERATOR&&t[SYMBOL_ITERATOR]||t["@@iterator"];if("function"==typeof r)return r}}function forEach(t,r,e){if(null!=t){if("function"==typeof t.forEach)return t.forEach(r,e);var o=0,i=getIterator(t);if(i){for(var a;!(a=i.next()).done;)if(r.call(e,a.value,o++,t),o>9999999)throw new TypeError("Near-infinite iteration.")}else if(isArrayLike(t))for(;o=this._o.length?(this._o=void 0,{value:void 0,done:!0}):{value:this._o[this._i++],done:!1}}},{}],145:[function(require,module,exports){(function(global){(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=u.breaks:this.rules=u.gfm:this.options.pedantic&&(this.rules=u.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||a.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(){}function h(e){for(var t,n,r=1;rAn error occured:

"+s(e.message+"",!0)+"
";throw e}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,u,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,u=0;u1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:s(e,!0))+"\n
\n":"
"+(n?e:s(e,!0))+"\n
"},n.prototype.blockquote=function(e){return"
\n"+e+"
\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var s='
    "},n.prototype.image=function(e,t,n){var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;e




    © 2015 - 2024 Weber Informatics LLC | Privacy Policy